Repository navigation
Expand file tree
/
Copy pathui.js
More file actions
executable file
·138 lines (124 loc) · 3.28 KB
/
Copy pathui.js
File metadata and controls
executable file
·138 lines (124 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
* Copyright 2009 Cosmos Inc. All right reserved.
* http://www.cos-mos.co.jp/
*/
Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif';
Ext.onReady(function() {
var inTextarea = {
id:'inTextarea',
xtype:'textarea',
emptyText : config.ui.inputEmptyText,
style: 'font-family: \"Courier New\",Courier,monospace;font-weight:normal;',
border: 'none'
};
var outTextarea = {
id:'outTextarea',
xtype:'textarea',
style: 'font-family: \"Courier New\",Courier,monospace;font-weight:normal;',
border: 'none'
};
var outRichText = {
id:'outRichText',
xtype:'box',
autoScroll: true,
style: 'font-family: \"Courier New\",Courier,monospace;font-weight:normal;',
html: ''
};
// パネルを作成
var inputPanel = new Ext.Panel({
title : 'DML Breaker(suVene) - 1.0.3',
collapsible: true,
height: 200,
layout:'fit',
items: [inTextarea] ,
buttons: [
{
id:'btnCnv',
text: config.ui.btnConv
},{
id:'btnReset',
text: config.ui.btnReset
}],
region: 'north'
});
var outPanel = new Ext.Panel({
title : '',
layout:'fit',
items: [
{
xtype:'tabpanel',
id: 'outTab',
deferredRender: true,
activeTab: 0,
items:[
{
title:'Plain Text',
layout:'fit',
items: outTextarea
},{
title:'Rich Text',
layout:'fit',
preventBodyReset: true,
style: 'background-color:yellow;font-size:11px;',
listeners: {activate: handleActivate},
items: {
xtype:'panel',
//layout:'fit',
autoScroll: true,
items: outRichText
}
}]
}],
region: 'center'
});
new Ext.Viewport({
layout:'border',
defaults: {
split: true
},
items:[
inputPanel,
outPanel,
{
xtype:'panel',
layout:'fit',
split: false,
border: false,
bodyBorder:false,
preventBodyReset:true,
region: 'south',
style: 'padding:5px;color:#15428b;font:bold 11px tahoma,arial,verdana,sans-serif;',
html: ''
}
]
});
Ext.get("btnCnv").on("click", function() {
input = Ext.getCmp("inTextarea").getValue();
if (input.trim() == "") {
Ext.MessageBox.alert('', config.msg.emptyInput);
} else {
if (validate(Ext.getCmp("inTextarea").getValue())) {
Ext.getCmp("outTab").setActiveTab(0);
var result = convertMain(Ext.getCmp("inTextarea").getValue());
Ext.getCmp("outTextarea").setValue(result);
} else {
Ext.MessageBox.alert('', config.msg.noSupportDML);
}
}
});
Ext.get("btnReset").on("click", function() {
Ext.getCmp("outTab").setActiveTab(0);
Ext.getCmp("inTextarea").setValue('');
Ext.getCmp("outTextarea").setValue('');
Ext.getDom("outRichText").innerHTML = '';
});
function handleActivate(tab) {
if (tab.title == 'Rich Text') {
if (Ext.getCmp("outTextarea").getValue() != '') {
Ext.getDom("outRichText").innerHTML = convUpperCaseKeywordAndRichText(Ext.getCmp("outTextarea").getValue());
} else {
Ext.getDom("outRichText").innerHTML = '';
}
}
}
});