username@email.com
2021-06-03 904fb460b9359fe92e00ce25804d96c8a52bb513
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
/**
 * jQuery EasyUI 1.5.2
 * 
 * Copyright (c) 2009-2017 www.jeasyui.com. All rights reserved.
 *
 * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
 * To use it on other terms please contact us: info@jeasyui.com
 *
 */
(function($){
$(function(){
$(document).unbind(".combo").bind("mousedown.combo mousewheel.combo",function(e){
var p=$(e.target).closest("span.combo,div.combo-p,div.menu");
if(p.length){
_1(p);
return;
}
$("body>div.combo-p>div.combo-panel:visible").panel("close");
});
});
function _2(_3){
var _4=$.data(_3,"combo");
var _5=_4.options;
if(!_4.panel){
_4.panel=$("<div class=\"combo-panel\"></div>").appendTo("body");
_4.panel.panel({minWidth:_5.panelMinWidth,maxWidth:_5.panelMaxWidth,minHeight:_5.panelMinHeight,maxHeight:_5.panelMaxHeight,doSize:false,closed:true,cls:"combo-p",style:{position:"absolute",zIndex:10},onOpen:function(){
var _6=$(this).panel("options").comboTarget;
var _7=$.data(_6,"combo");
if(_7){
_7.options.onShowPanel.call(_6);
}
},onBeforeClose:function(){
_1($(this).parent());
},onClose:function(){
var _8=$(this).panel("options").comboTarget;
var _9=$(_8).data("combo");
if(_9){
_9.options.onHidePanel.call(_8);
}
}});
}
var _a=$.extend(true,[],_5.icons);
if(_5.hasDownArrow){
_a.push({iconCls:"combo-arrow",handler:function(e){
_f(e.data.target);
}});
}
$(_3).addClass("combo-f").textbox($.extend({},_5,{icons:_a,onChange:function(){
}}));
$(_3).attr("comboName",$(_3).attr("textboxName"));
_4.combo=$(_3).next();
_4.combo.addClass("combo");
};
function _b(_c){
var _d=$.data(_c,"combo");
var _e=_d.options;
var p=_d.panel;
if(p.is(":visible")){
p.panel("close");
}
if(!_e.cloned){
p.panel("destroy");
}
$(_c).textbox("destroy");
};
function _f(_10){
var _11=$.data(_10,"combo").panel;
if(_11.is(":visible")){
var _12=_11.combo("combo");
_13(_12);
if(_12!=_10){
$(_10).combo("showPanel");
}
}else{
var p=$(_10).closest("div.combo-p").children(".combo-panel");
$("div.combo-panel:visible").not(_11).not(p).panel("close");
$(_10).combo("showPanel");
}
$(_10).combo("textbox").focus();
};
function _1(_14){
$(_14).find(".combo-f").each(function(){
var p=$(this).combo("panel");
if(p.is(":visible")){
p.panel("close");
}
});
};
function _15(e){
var _16=e.data.target;
var _17=$.data(_16,"combo");
var _18=_17.options;
if(!_18.editable){
_f(_16);
}else{
var p=$(_16).closest("div.combo-p").children(".combo-panel");
$("div.combo-panel:visible").not(p).each(function(){
var _19=$(this).combo("combo");
if(_19!=_16){
_13(_19);
}
});
}
};
function _1a(e){
var _1b=e.data.target;
var t=$(_1b);
var _1c=t.data("combo");
var _1d=t.combo("options");
_1c.panel.panel("options").comboTarget=_1b;
switch(e.keyCode){
case 38:
_1d.keyHandler.up.call(_1b,e);
break;
case 40:
_1d.keyHandler.down.call(_1b,e);
break;
case 37:
_1d.keyHandler.left.call(_1b,e);
break;
case 39:
_1d.keyHandler.right.call(_1b,e);
break;
case 13:
e.preventDefault();
_1d.keyHandler.enter.call(_1b,e);
return false;
case 9:
case 27:
_13(_1b);
break;
default:
if(_1d.editable){
if(_1c.timer){
clearTimeout(_1c.timer);
}
_1c.timer=setTimeout(function(){
var q=t.combo("getText");
if(_1c.previousText!=q){
_1c.previousText=q;
t.combo("showPanel");
_1d.keyHandler.query.call(_1b,q,e);
t.combo("validate");
}
},_1d.delay);
}
}
};
function _1e(_1f){
var _20=$.data(_1f,"combo");
var _21=_20.combo;
var _22=_20.panel;
var _23=$(_1f).combo("options");
var _24=_22.panel("options");
_24.comboTarget=_1f;
if(_24.closed){
_22.panel("panel").show().css({zIndex:($.fn.menu?$.fn.menu.defaults.zIndex++:($.fn.window?$.fn.window.defaults.zIndex++:99)),left:-999999});
_22.panel("resize",{width:(_23.panelWidth?_23.panelWidth:_21._outerWidth()),height:_23.panelHeight});
_22.panel("panel").hide();
_22.panel("open");
}
(function(){
if(_24.comboTarget==_1f&&_22.is(":visible")){
_22.panel("move",{left:_25(),top:_26()});
setTimeout(arguments.callee,200);
}
})();
function _25(){
var _27=_21.offset().left;
if(_23.panelAlign=="right"){
_27+=_21._outerWidth()-_22._outerWidth();
}
if(_27+_22._outerWidth()>$(window)._outerWidth()+$(document).scrollLeft()){
_27=$(window)._outerWidth()+$(document).scrollLeft()-_22._outerWidth();
}
if(_27<0){
_27=0;
}
return _27;
};
function _26(){
var top=_21.offset().top+_21._outerHeight();
if(top+_22._outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){
top=_21.offset().top-_22._outerHeight();
}
if(top<$(document).scrollTop()){
top=_21.offset().top+_21._outerHeight();
}
return top;
};
};
function _13(_28){
var _29=$.data(_28,"combo").panel;
_29.panel("close");
};
function _2a(_2b,_2c){
var _2d=$.data(_2b,"combo");
var _2e=$(_2b).textbox("getText");
if(_2e!=_2c){
$(_2b).textbox("setText",_2c);
}
_2d.previousText=_2c;
};
function _2f(_30){
var _31=$.data(_30,"combo");
var _32=_31.options;
var _33=$(_30).next();
var _34=[];
_33.find(".textbox-value").each(function(){
_34.push($(this).val());
});
if(_32.multivalue){
return _34;
}else{
return _34.length?_34[0].split(_32.separator):_34;
}
};
function _35(_36,_37){
var _38=$.data(_36,"combo");
var _39=_38.combo;
var _3a=$(_36).combo("options");
if(!$.isArray(_37)){
_37=_37.split(_3a.separator);
}
var _3b=_2f(_36);
_39.find(".textbox-value").remove();
if(_37.length){
if(_3a.multivalue){
for(var i=0;i<_37.length;i++){
_3c(_37[i]);
}
}else{
_3c(_37.join(_3a.separator));
}
}
function _3c(_3d){
var _3e=$(_36).attr("textboxName")||"";
var _3f=$("<input type=\"hidden\" class=\"textbox-value\">").appendTo(_39);
_3f.attr("name",_3e);
if(_3a.disabled){
_3f.attr("disabled","disabled");
}
_3f.val(_3d);
};
var _40=(function(){
if(_3b.length!=_37.length){
return true;
}
for(var i=0;i<_37.length;i++){
if(_37[i]!=_3b[i]){
return true;
}
}
return false;
})();
if(_40){
$(_36).val(_37.join(_3a.separator));
if(_3a.multiple){
_3a.onChange.call(_36,_37,_3b);
}else{
_3a.onChange.call(_36,_37[0],_3b[0]);
}
$(_36).closest("form").trigger("_change",[_36]);
}
};
function _41(_42){
var _43=_2f(_42);
return _43[0];
};
function _44(_45,_46){
_35(_45,[_46]);
};
function _47(_48){
var _49=$.data(_48,"combo").options;
var _4a=_49.onChange;
_49.onChange=function(){
};
if(_49.multiple){
_35(_48,_49.value?_49.value:[]);
}else{
_44(_48,_49.value);
}
_49.onChange=_4a;
};
$.fn.combo=function(_4b,_4c){
if(typeof _4b=="string"){
var _4d=$.fn.combo.methods[_4b];
if(_4d){
return _4d(this,_4c);
}else{
return this.textbox(_4b,_4c);
}
}
_4b=_4b||{};
return this.each(function(){
var _4e=$.data(this,"combo");
if(_4e){
$.extend(_4e.options,_4b);
if(_4b.value!=undefined){
_4e.options.originalValue=_4b.value;
}
}else{
_4e=$.data(this,"combo",{options:$.extend({},$.fn.combo.defaults,$.fn.combo.parseOptions(this),_4b),previousText:""});
_4e.options.originalValue=_4e.options.value;
}
_2(this);
_47(this);
});
};
$.fn.combo.methods={options:function(jq){
var _4f=jq.textbox("options");
return $.extend($.data(jq[0],"combo").options,{width:_4f.width,height:_4f.height,disabled:_4f.disabled,readonly:_4f.readonly});
},cloneFrom:function(jq,_50){
return jq.each(function(){
$(this).textbox("cloneFrom",_50);
$.data(this,"combo",{options:$.extend(true,{cloned:true},$(_50).combo("options")),combo:$(this).next(),panel:$(_50).combo("panel")});
$(this).addClass("combo-f").attr("comboName",$(this).attr("textboxName"));
});
},combo:function(jq){
return jq.closest(".combo-panel").panel("options").comboTarget;
},panel:function(jq){
return $.data(jq[0],"combo").panel;
},destroy:function(jq){
return jq.each(function(){
_b(this);
});
},showPanel:function(jq){
return jq.each(function(){
_1e(this);
});
},hidePanel:function(jq){
return jq.each(function(){
_13(this);
});
},clear:function(jq){
return jq.each(function(){
$(this).textbox("setText","");
var _51=$.data(this,"combo").options;
if(_51.multiple){
$(this).combo("setValues",[]);
}else{
$(this).combo("setValue","");
}
});
},reset:function(jq){
return jq.each(function(){
var _52=$.data(this,"combo").options;
if(_52.multiple){
$(this).combo("setValues",_52.originalValue);
}else{
$(this).combo("setValue",_52.originalValue);
}
});
},setText:function(jq,_53){
return jq.each(function(){
_2a(this,_53);
});
},getValues:function(jq){
return _2f(jq[0]);
},setValues:function(jq,_54){
return jq.each(function(){
_35(this,_54);
});
},getValue:function(jq){
return _41(jq[0]);
},setValue:function(jq,_55){
return jq.each(function(){
_44(this,_55);
});
}};
$.fn.combo.parseOptions=function(_56){
var t=$(_56);
return $.extend({},$.fn.textbox.parseOptions(_56),$.parser.parseOptions(_56,["separator","panelAlign",{panelWidth:"number",hasDownArrow:"boolean",delay:"number",reversed:"boolean",multivalue:"boolean",selectOnNavigation:"boolean"},{panelMinWidth:"number",panelMaxWidth:"number",panelMinHeight:"number",panelMaxHeight:"number"}]),{panelHeight:(t.attr("panelHeight")=="auto"?"auto":parseInt(t.attr("panelHeight"))||undefined),multiple:(t.attr("multiple")?true:undefined)});
};
$.fn.combo.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:{click:_15,keydown:_1a,paste:_1a,drop:_1a},panelWidth:null,panelHeight:200,panelMinWidth:null,panelMaxWidth:null,panelMinHeight:null,panelMaxHeight:null,panelAlign:"left",reversed:false,multiple:false,multivalue:true,selectOnNavigation:true,separator:",",hasDownArrow:true,delay:200,keyHandler:{up:function(e){
},down:function(e){
},left:function(e){
},right:function(e){
},enter:function(e){
},query:function(q,e){
}},onShowPanel:function(){
},onHidePanel:function(){
},onChange:function(_57,_58){
}});
})(jQuery);