@@ -33,7 +33,7 @@ Types.BaseType = Class.extend({
33
33
var cols = m [ 1 ] ;
34
34
var rows = m [ 2 ] ;
35
35
var value = val == undefined ? '' : val ;
36
- this . ui = $ ( '<textarea id="' + _id_ify ( this . spec . keys )
36
+ this . $ ui = $ ( '<textarea id="' + _id_ify ( this . spec . keys )
37
37
+ '" rows="' + rows
38
38
+ '" cols="' + cols
39
39
+ '" class="foswikiTextArea">' + value + '</textarea>' ) ;
@@ -44,26 +44,26 @@ Types.BaseType = Class.extend({
44
44
&& ( m = this . spec . SIZE . match ( / ^ \s * ( \d + ) ( \s | $ ) / ) ) ) {
45
45
size = m [ 1 ] ;
46
46
}
47
- this . ui = $ ( '<input id="' + _id_ify ( this . spec . keys )
47
+ this . $ ui = $ ( '<input id="' + _id_ify ( this . spec . keys )
48
48
+ '" size="' + size + '"/>' ) ;
49
- this . ui . attr ( 'value' , val ) ;
49
+ this . $ ui. val ( val ) ;
50
50
}
51
51
if ( this . spec . SPELLCHECK ) {
52
- this . ui . attr ( 'spellcheck' , " true" ) ;
52
+ this . $ ui. attr ( 'spellcheck' , ' true' ) ;
53
53
}
54
54
if ( change_handler != undefined )
55
- this . ui . change ( change_handler ) ;
56
- return this . ui ;
55
+ this . $ ui. change ( change_handler ) ;
56
+ return this . $ ui;
57
57
} ,
58
58
59
59
useVal : function ( val ) {
60
- this . ui . val ( val ) ;
60
+ this . $ ui. val ( val ) ;
61
61
} ,
62
62
63
63
currentValue : function ( ) {
64
64
if ( this . null_if != null && this . null_if ( ) )
65
65
return null ;
66
- return this . ui . val ( ) ;
66
+ return this . $ ui. val ( ) ;
67
67
} ,
68
68
69
69
commitVal : function ( ) {
@@ -96,23 +96,23 @@ Types.BaseType = Class.extend({
96
96
97
97
Types . BOOLEAN = Types . BaseType . extend ( {
98
98
createUI : function ( change_handler ) {
99
- this . ui = $ ( '<input type="checkbox" id="' + _id_ify ( this . spec . keys )
99
+ this . $ ui = $ ( '<input type="checkbox" id="' + _id_ify ( this . spec . keys )
100
100
+ '" />' ) ;
101
101
if ( change_handler != undefined )
102
- this . ui . change ( change_handler ) ;
102
+ this . $ ui. change ( change_handler ) ;
103
103
if ( typeof ( this . spec . current_value ) == 'undefined' )
104
104
this . spec . current_value = 0 ;
105
105
if ( this . spec . current_value != 0 ) {
106
- this . ui . attr ( 'checked' , 'checked' ) ;
106
+ this . $ ui. attr ( 'checked' , 'checked' ) ;
107
107
}
108
108
if ( this . spec . extraClass ) {
109
- this . ui . addClass ( this . spec . extraClass ) ;
109
+ this . $ ui. addClass ( this . spec . extraClass ) ;
110
110
}
111
- return this . ui ;
111
+ return this . $ ui;
112
112
} ,
113
113
114
114
currentValue : function ( ) {
115
- return this . ui [ 0 ] . checked ? 1 : 0 ;
115
+ return this . $ ui[ 0 ] . checked ? 1 : 0 ;
116
116
} ,
117
117
118
118
isModified : function ( ) {
@@ -128,7 +128,7 @@ Types.BOOLEAN = Types.BaseType.extend({
128
128
} ,
129
129
130
130
useVal : function ( val ) {
131
- this . ui [ 0 ] . attr ( checked , val ? 'checked' : '' ) ;
131
+ this . $ui . attr ( ' checked' , val ? 'checked' : '' ) ;
132
132
}
133
133
} ) ;
134
134
@@ -140,16 +140,16 @@ Types.BOOLGROUP = Types.BaseType.extend({
140
140
for ( var i = 0 ; i < values . length ; i ++ ) {
141
141
sets [ values [ i ] ] = true ;
142
142
}
143
- this . ui = $ ( '<div class="checkbox_group"></div>' ) ;
143
+ this . $ ui = $ ( '<div class="checkbox_group"></div>' ) ;
144
144
for ( var i = 0 ; i < options . length ; i ++ ) {
145
145
var cb = $ ( '<input type="checkbox" name="' + options [ i ]
146
146
+ ' id="' + _id_ify ( this . spec . keys ) + '"/>' ) ;
147
147
if ( sets [ options [ i ] ] )
148
148
cb . attr ( 'checked' , 'checked' ) ;
149
149
cb . change ( change_handler ) ;
150
- this . ui . append ( cb ) ;
150
+ this . $ ui. append ( cb ) ;
151
151
}
152
- return this . ui ;
152
+ return this . $ ui;
153
153
} ,
154
154
155
155
currentValue : function ( ) {
@@ -168,7 +168,7 @@ Types.BOOLGROUP = Types.BaseType.extend({
168
168
sets [ values [ i ] ] = true ;
169
169
}
170
170
var i = 0 ;
171
- this . ui . find ( 'input[type="checkbox"]' ) . each ( function ( ) {
171
+ this . $ ui. find ( 'input[type="checkbox"]' ) . each ( function ( ) {
172
172
if ( sets [ options [ i ++ ] ] )
173
173
cb . attr ( 'checked' , 'checked' ) ;
174
174
} ) ;
@@ -178,9 +178,9 @@ Types.BOOLGROUP = Types.BaseType.extend({
178
178
Types . PASSWORD = Types . BaseType . extend ( {
179
179
createUI : function ( change_handler ) {
180
180
this . _super ( change_handler ) ;
181
- this . ui . attr ( 'type' , 'password' ) ;
182
- this . ui . attr ( 'autocomplete' , 'off' ) ;
183
- return this . ui ;
181
+ this . $ ui. attr ( 'type' , 'password' ) ;
182
+ this . $ ui. attr ( 'autocomplete' , 'off' ) ;
183
+ return this . $ ui;
184
184
}
185
185
} ) ;
186
186
@@ -214,16 +214,16 @@ Types.OCTAL = Types.BaseType.extend({
214
214
} ,
215
215
216
216
currentValue : function ( ) {
217
- var newval = this . ui . val ( ) ;
217
+ var newval = this . $ ui. val ( ) ;
218
218
return newval . toString ( 8 ) ;
219
219
}
220
220
} ) ;
221
221
222
222
Types . PATHINFO = Types . BaseType . extend ( {
223
223
createUI : function ( change_handler ) {
224
224
this . _super ( change_handler ) ;
225
- this . ui . attr ( 'readonly' , 'readonly' ) ;
226
- return this . ui ;
225
+ this . $ ui. attr ( 'readonly' , 'readonly' ) ;
226
+ return this . $ ui;
227
227
}
228
228
} ) ;
229
229
@@ -233,19 +233,19 @@ Types.PATHINFO = Types.BaseType.extend({
233
233
Types . NULL = Types . BaseType . extend ( {
234
234
createUI : function ( change_handler ) {
235
235
this . _super ( change_handler ) ;
236
- this . ui . attr ( 'readonly' , 'readonly' ) ;
237
- this . ui . attr ( 'disabled' , 'disabled' ) ;
238
- this . ui . attr ( 'size' , '1' ) ;
239
- return this . ui ;
236
+ this . $ ui. attr ( 'readonly' , 'readonly' ) ;
237
+ this . $ ui. attr ( 'disabled' , 'disabled' ) ;
238
+ this . $ ui. attr ( 'size' , '1' ) ;
239
+ return this . $ ui;
240
240
}
241
241
} ) ;
242
242
243
243
Types . BUTTON = Types . BaseType . extend ( {
244
244
createUI : function ( ) {
245
- this . ui = $ ( '<a href="' + this . spec . uri + '">'
245
+ this . $ ui = $ ( '<a href="' + this . spec . uri + '">'
246
246
+ this . spec . title + '</a>' ) ;
247
- this . ui . button ( ) ;
248
- return this . ui ;
247
+ this . $ ui. button ( ) ;
248
+ return this . $ ui;
249
249
} ,
250
250
251
251
useVal : function ( ) {
@@ -277,12 +277,12 @@ Types.SELECT = Types.BaseType.extend({
277
277
if ( this . spec . SIZE && ( m = this . spec . SIZE . match ( / \b ( \d + ) \b / ) ) )
278
278
size = m [ 0 ] ;
279
279
280
- this . ui = $ ( '<select id="' + _id_ify ( this . spec . keys ) + '" size="' + size
280
+ this . $ ui = $ ( '<select id="' + _id_ify ( this . spec . keys ) + '" size="' + size
281
281
+ '" class="foswikiSelect" />' ) ;
282
282
if ( change_handler != undefined )
283
- this . ui . change ( change_handler ) ;
283
+ this . $ ui. change ( change_handler ) ;
284
284
if ( this . spec . MULTIPLE ) {
285
- this . ui . attr ( 'multiple' , 'multiple' ) ;
285
+ this . $ ui. attr ( 'multiple' , 'multiple' ) ;
286
286
}
287
287
288
288
if ( this . spec . select_from != undefined ) {
@@ -293,18 +293,18 @@ Types.SELECT = Types.BaseType.extend({
293
293
if ( sel [ opt ] ) {
294
294
option . attr ( 'selected' , 'selected' ) ;
295
295
}
296
- this . ui . append ( option ) ;
296
+ this . $ ui. append ( option ) ;
297
297
}
298
298
}
299
- return this . ui ;
299
+ return this . $ ui;
300
300
} ,
301
301
302
302
useVal : function ( val ) {
303
303
var sel = this . _getSel ( val ) ;
304
304
var sf = this . spec . select_from ;
305
305
if ( sf != undefined ) {
306
306
var i = 0 ;
307
- this . ui . find ( 'option' ) . each ( function ( ) {
307
+ this . $ ui. find ( 'option' ) . each ( function ( ) {
308
308
var opt = sf [ i ++ ] ;
309
309
if ( sel [ opt ] )
310
310
$ ( this ) . attr ( 'selected' , 'selected' ) ;
0 commit comments