Version zu Ende April 2023
This commit is contained in:
350
static/jeasyui/plugins/jquery.accordion.js
Executable file
350
static/jeasyui/plugins/jquery.accordion.js
Executable file
@@ -0,0 +1,350 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2,_3){
|
||||
var _4=$.data(_2,"accordion");
|
||||
var _5=_4.options;
|
||||
var _6=_4.panels;
|
||||
var cc=$(_2);
|
||||
var _7=(_5.halign=="left"||_5.halign=="right");
|
||||
cc.children(".panel-last").removeClass("panel-last");
|
||||
cc.children(".panel:last").addClass("panel-last");
|
||||
if(_3){
|
||||
$.extend(_5,{width:_3.width,height:_3.height});
|
||||
}
|
||||
cc._size(_5);
|
||||
var _8=0;
|
||||
var _9="auto";
|
||||
var _a=cc.find(">.panel>.accordion-header");
|
||||
if(_a.length){
|
||||
if(_7){
|
||||
$(_a[0]).next().panel("resize",{width:cc.width(),height:cc.height()});
|
||||
_8=$(_a[0])._outerWidth();
|
||||
}else{
|
||||
_8=$(_a[0]).css("height","")._outerHeight();
|
||||
}
|
||||
}
|
||||
if(!isNaN(parseInt(_5.height))){
|
||||
if(_7){
|
||||
_9=cc.width()-_8*_a.length;
|
||||
}else{
|
||||
_9=cc.height()-_8*_a.length;
|
||||
}
|
||||
}
|
||||
_b(true,_9-_b(false));
|
||||
function _b(_c,_d){
|
||||
var _e=0;
|
||||
for(var i=0;i<_6.length;i++){
|
||||
var p=_6[i];
|
||||
if(_7){
|
||||
var h=p.panel("header")._outerWidth(_8);
|
||||
}else{
|
||||
var h=p.panel("header")._outerHeight(_8);
|
||||
}
|
||||
if(p.panel("options").collapsible==_c){
|
||||
var _f=isNaN(_d)?undefined:(_d+_8*h.length);
|
||||
if(_7){
|
||||
p.panel("resize",{height:cc.height(),width:(_c?_f:undefined)});
|
||||
_e+=p.panel("panel")._outerWidth()-_8*h.length;
|
||||
}else{
|
||||
p.panel("resize",{width:cc.width(),height:(_c?_f:undefined)});
|
||||
_e+=p.panel("panel").outerHeight()-_8*h.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
return _e;
|
||||
};
|
||||
};
|
||||
function _10(_11,_12,_13,all){
|
||||
var _14=$.data(_11,"accordion").panels;
|
||||
var pp=[];
|
||||
for(var i=0;i<_14.length;i++){
|
||||
var p=_14[i];
|
||||
if(_12){
|
||||
if(p.panel("options")[_12]==_13){
|
||||
pp.push(p);
|
||||
}
|
||||
}else{
|
||||
if(p[0]==$(_13)[0]){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_12){
|
||||
return all?pp:(pp.length?pp[0]:null);
|
||||
}else{
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
function _15(_16){
|
||||
return _10(_16,"collapsed",false,true);
|
||||
};
|
||||
function _17(_18){
|
||||
var pp=_15(_18);
|
||||
return pp.length?pp[0]:null;
|
||||
};
|
||||
function _19(_1a,_1b){
|
||||
return _10(_1a,null,_1b);
|
||||
};
|
||||
function _1c(_1d,_1e){
|
||||
var _1f=$.data(_1d,"accordion").panels;
|
||||
if(typeof _1e=="number"){
|
||||
if(_1e<0||_1e>=_1f.length){
|
||||
return null;
|
||||
}else{
|
||||
return _1f[_1e];
|
||||
}
|
||||
}
|
||||
return _10(_1d,"title",_1e);
|
||||
};
|
||||
function _20(_21){
|
||||
var _22=$.data(_21,"accordion").options;
|
||||
var cc=$(_21);
|
||||
if(_22.border){
|
||||
cc.removeClass("accordion-noborder");
|
||||
}else{
|
||||
cc.addClass("accordion-noborder");
|
||||
}
|
||||
};
|
||||
function _23(_24){
|
||||
var _25=$.data(_24,"accordion");
|
||||
var cc=$(_24);
|
||||
cc.addClass("accordion");
|
||||
_25.panels=[];
|
||||
cc.children("div").each(function(){
|
||||
var _26=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)});
|
||||
var pp=$(this);
|
||||
_25.panels.push(pp);
|
||||
_28(_24,pp,_26);
|
||||
});
|
||||
cc._bind("_resize",function(e,_27){
|
||||
if($(this).hasClass("easyui-fluid")||_27){
|
||||
_1(_24);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
function _28(_29,pp,_2a){
|
||||
var _2b=$.data(_29,"accordion").options;
|
||||
pp.panel($.extend({},{collapsible:true,minimizable:false,maximizable:false,closable:false,doSize:false,collapsed:true,headerCls:"accordion-header",bodyCls:"accordion-body",halign:_2b.halign},_2a,{onBeforeExpand:function(){
|
||||
if(_2a.onBeforeExpand){
|
||||
if(_2a.onBeforeExpand.call(this)==false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(!_2b.multiple){
|
||||
var all=$.grep(_15(_29),function(p){
|
||||
return p.panel("options").collapsible;
|
||||
});
|
||||
for(var i=0;i<all.length;i++){
|
||||
_34(_29,_19(_29,all[i]));
|
||||
}
|
||||
}
|
||||
var _2c=$(this).panel("header");
|
||||
_2c.addClass("accordion-header-selected");
|
||||
_2c.find(".accordion-collapse").removeClass("accordion-expand");
|
||||
},onExpand:function(){
|
||||
$(_29).find(">.panel-last>.accordion-header").removeClass("accordion-header-border");
|
||||
if(_2a.onExpand){
|
||||
_2a.onExpand.call(this);
|
||||
}
|
||||
_2b.onSelect.call(_29,$(this).panel("options").title,_19(_29,this));
|
||||
},onBeforeCollapse:function(){
|
||||
if(_2a.onBeforeCollapse){
|
||||
if(_2a.onBeforeCollapse.call(this)==false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$(_29).find(">.panel-last>.accordion-header").addClass("accordion-header-border");
|
||||
var _2d=$(this).panel("header");
|
||||
_2d.removeClass("accordion-header-selected");
|
||||
_2d.find(".accordion-collapse").addClass("accordion-expand");
|
||||
},onCollapse:function(){
|
||||
if(isNaN(parseInt(_2b.height))){
|
||||
$(_29).find(">.panel-last>.accordion-header").removeClass("accordion-header-border");
|
||||
}
|
||||
if(_2a.onCollapse){
|
||||
_2a.onCollapse.call(this);
|
||||
}
|
||||
_2b.onUnselect.call(_29,$(this).panel("options").title,_19(_29,this));
|
||||
}}));
|
||||
var _2e=pp.panel("header");
|
||||
var _2f=_2e.children("div.panel-tool");
|
||||
_2f.children("a.panel-tool-collapse").hide();
|
||||
var t=$("<a href=\"javascript:;\"></a>").addClass("accordion-collapse accordion-expand").appendTo(_2f);
|
||||
t._bind("click",function(){
|
||||
_30(pp);
|
||||
return false;
|
||||
});
|
||||
pp.panel("options").collapsible?t.show():t.hide();
|
||||
if(_2b.halign=="left"||_2b.halign=="right"){
|
||||
t.hide();
|
||||
}
|
||||
_2e._bind("click",function(){
|
||||
_30(pp);
|
||||
return false;
|
||||
});
|
||||
function _30(p){
|
||||
var _31=p.panel("options");
|
||||
if(_31.collapsible){
|
||||
var _32=_19(_29,p);
|
||||
if(_31.collapsed){
|
||||
_33(_29,_32);
|
||||
}else{
|
||||
_34(_29,_32);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
function _33(_35,_36){
|
||||
var p=_1c(_35,_36);
|
||||
if(!p){
|
||||
return;
|
||||
}
|
||||
_37(_35);
|
||||
var _38=$.data(_35,"accordion").options;
|
||||
p.panel("expand",_38.animate);
|
||||
};
|
||||
function _34(_39,_3a){
|
||||
var p=_1c(_39,_3a);
|
||||
if(!p){
|
||||
return;
|
||||
}
|
||||
_37(_39);
|
||||
var _3b=$.data(_39,"accordion").options;
|
||||
p.panel("collapse",_3b.animate);
|
||||
};
|
||||
function _3c(_3d){
|
||||
var _3e=$.data(_3d,"accordion").options;
|
||||
$(_3d).find(">.panel-last>.accordion-header").addClass("accordion-header-border");
|
||||
var p=_10(_3d,"selected",true);
|
||||
if(p){
|
||||
_3f(_19(_3d,p));
|
||||
}else{
|
||||
_3f(_3e.selected);
|
||||
}
|
||||
function _3f(_40){
|
||||
var _41=_3e.animate;
|
||||
_3e.animate=false;
|
||||
_33(_3d,_40);
|
||||
_3e.animate=_41;
|
||||
};
|
||||
};
|
||||
function _37(_42){
|
||||
var _43=$.data(_42,"accordion").panels;
|
||||
for(var i=0;i<_43.length;i++){
|
||||
_43[i].stop(true,true);
|
||||
}
|
||||
};
|
||||
function add(_44,_45){
|
||||
var _46=$.data(_44,"accordion");
|
||||
var _47=_46.options;
|
||||
var _48=_46.panels;
|
||||
if(_45.selected==undefined){
|
||||
_45.selected=true;
|
||||
}
|
||||
_37(_44);
|
||||
var pp=$("<div></div>").appendTo(_44);
|
||||
_48.push(pp);
|
||||
_28(_44,pp,_45);
|
||||
_1(_44);
|
||||
_47.onAdd.call(_44,_45.title,_48.length-1);
|
||||
if(_45.selected){
|
||||
_33(_44,_48.length-1);
|
||||
}
|
||||
};
|
||||
function _49(_4a,_4b){
|
||||
var _4c=$.data(_4a,"accordion");
|
||||
var _4d=_4c.options;
|
||||
var _4e=_4c.panels;
|
||||
_37(_4a);
|
||||
var _4f=_1c(_4a,_4b);
|
||||
var _50=_4f.panel("options").title;
|
||||
var _51=_19(_4a,_4f);
|
||||
if(!_4f){
|
||||
return;
|
||||
}
|
||||
if(_4d.onBeforeRemove.call(_4a,_50,_51)==false){
|
||||
return;
|
||||
}
|
||||
_4e.splice(_51,1);
|
||||
_4f.panel("destroy");
|
||||
if(_4e.length){
|
||||
_1(_4a);
|
||||
var _52=_17(_4a);
|
||||
if(!_52){
|
||||
_33(_4a,0);
|
||||
}
|
||||
}
|
||||
_4d.onRemove.call(_4a,_50,_51);
|
||||
};
|
||||
$.fn.accordion=function(_53,_54){
|
||||
if(typeof _53=="string"){
|
||||
return $.fn.accordion.methods[_53](this,_54);
|
||||
}
|
||||
_53=_53||{};
|
||||
return this.each(function(){
|
||||
var _55=$.data(this,"accordion");
|
||||
if(_55){
|
||||
$.extend(_55.options,_53);
|
||||
}else{
|
||||
$.data(this,"accordion",{options:$.extend({},$.fn.accordion.defaults,$.fn.accordion.parseOptions(this),_53),accordion:$(this).addClass("accordion"),panels:[]});
|
||||
_23(this);
|
||||
}
|
||||
_20(this);
|
||||
_1(this);
|
||||
_3c(this);
|
||||
});
|
||||
};
|
||||
$.fn.accordion.methods={options:function(jq){
|
||||
return $.data(jq[0],"accordion").options;
|
||||
},panels:function(jq){
|
||||
return $.data(jq[0],"accordion").panels;
|
||||
},resize:function(jq,_56){
|
||||
return jq.each(function(){
|
||||
_1(this,_56);
|
||||
});
|
||||
},getSelections:function(jq){
|
||||
return _15(jq[0]);
|
||||
},getSelected:function(jq){
|
||||
return _17(jq[0]);
|
||||
},getPanel:function(jq,_57){
|
||||
return _1c(jq[0],_57);
|
||||
},getPanelIndex:function(jq,_58){
|
||||
return _19(jq[0],_58);
|
||||
},select:function(jq,_59){
|
||||
return jq.each(function(){
|
||||
_33(this,_59);
|
||||
});
|
||||
},unselect:function(jq,_5a){
|
||||
return jq.each(function(){
|
||||
_34(this,_5a);
|
||||
});
|
||||
},add:function(jq,_5b){
|
||||
return jq.each(function(){
|
||||
add(this,_5b);
|
||||
});
|
||||
},remove:function(jq,_5c){
|
||||
return jq.each(function(){
|
||||
_49(this,_5c);
|
||||
});
|
||||
}};
|
||||
$.fn.accordion.parseOptions=function(_5d){
|
||||
var t=$(_5d);
|
||||
return $.extend({},$.parser.parseOptions(_5d,["width","height","halign",{fit:"boolean",border:"boolean",animate:"boolean",multiple:"boolean",selected:"number"}]));
|
||||
};
|
||||
$.fn.accordion.defaults={width:"auto",height:"auto",fit:false,border:true,animate:true,multiple:false,selected:0,halign:"top",onSelect:function(_5e,_5f){
|
||||
},onUnselect:function(_60,_61){
|
||||
},onAdd:function(_62,_63){
|
||||
},onBeforeRemove:function(_64,_65){
|
||||
},onRemove:function(_66,_67){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
403
static/jeasyui/plugins/jquery.calendar.js
Executable file
403
static/jeasyui/plugins/jquery.calendar.js
Executable file
@@ -0,0 +1,403 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2,_3){
|
||||
var _4=$.data(_2,"calendar").options;
|
||||
var t=$(_2);
|
||||
if(_3){
|
||||
$.extend(_4,{width:_3.width,height:_3.height});
|
||||
}
|
||||
t._size(_4,t.parent());
|
||||
t.find(".calendar-body")._outerHeight(t.height()-t.find(".calendar-header")._outerHeight());
|
||||
if(t.find(".calendar-menu").is(":visible")){
|
||||
_5(_2);
|
||||
}
|
||||
};
|
||||
function _6(_7){
|
||||
$(_7).addClass("calendar").html("<div class=\"calendar-header\">"+"<div class=\"calendar-nav calendar-prevmonth\"></div>"+"<div class=\"calendar-nav calendar-nextmonth\"></div>"+"<div class=\"calendar-nav calendar-prevyear\"></div>"+"<div class=\"calendar-nav calendar-nextyear\"></div>"+"<div class=\"calendar-title\">"+"<span class=\"calendar-text\"></span>"+"</div>"+"</div>"+"<div class=\"calendar-body\">"+"<div class=\"calendar-menu\">"+"<div class=\"calendar-menu-year-inner\">"+"<span class=\"calendar-nav calendar-menu-prev\"></span>"+"<span><input class=\"calendar-menu-year\" type=\"text\"></span>"+"<span class=\"calendar-nav calendar-menu-next\"></span>"+"</div>"+"<div class=\"calendar-menu-month-inner\">"+"</div>"+"</div>"+"</div>");
|
||||
$(_7)._bind("_resize",function(e,_8){
|
||||
if($(this).hasClass("easyui-fluid")||_8){
|
||||
_1(_7);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
function _9(_a){
|
||||
var _b=$.data(_a,"calendar").options;
|
||||
var _c=$(_a).find(".calendar-menu");
|
||||
_c.find(".calendar-menu-year")._unbind(".calendar")._bind("keypress.calendar",function(e){
|
||||
if(e.keyCode==13){
|
||||
_d(true);
|
||||
}
|
||||
});
|
||||
$(_a)._unbind(".calendar")._bind("mouseover.calendar",function(e){
|
||||
var t=_e(e.target);
|
||||
if(t.hasClass("calendar-nav")||t.hasClass("calendar-text")||(t.hasClass("calendar-day")&&!t.hasClass("calendar-disabled"))){
|
||||
t.addClass("calendar-nav-hover");
|
||||
}
|
||||
})._bind("mouseout.calendar",function(e){
|
||||
var t=_e(e.target);
|
||||
if(t.hasClass("calendar-nav")||t.hasClass("calendar-text")||(t.hasClass("calendar-day")&&!t.hasClass("calendar-disabled"))){
|
||||
t.removeClass("calendar-nav-hover");
|
||||
}
|
||||
})._bind("click.calendar",function(e){
|
||||
var t=_e(e.target);
|
||||
if(t.hasClass("calendar-menu-next")||t.hasClass("calendar-nextyear")){
|
||||
_f(1);
|
||||
}else{
|
||||
if(t.hasClass("calendar-menu-prev")||t.hasClass("calendar-prevyear")){
|
||||
_f(-1);
|
||||
}else{
|
||||
if(t.hasClass("calendar-menu-month")){
|
||||
_c.find(".calendar-selected").removeClass("calendar-selected");
|
||||
t.addClass("calendar-selected");
|
||||
_d(true);
|
||||
}else{
|
||||
if(t.hasClass("calendar-prevmonth")){
|
||||
_10(-1);
|
||||
}else{
|
||||
if(t.hasClass("calendar-nextmonth")){
|
||||
_10(1);
|
||||
}else{
|
||||
if(t.hasClass("calendar-text")){
|
||||
if(_c.is(":visible")){
|
||||
_c.hide();
|
||||
}else{
|
||||
_5(_a);
|
||||
}
|
||||
}else{
|
||||
if(t.hasClass("calendar-day")){
|
||||
if(t.hasClass("calendar-disabled")){
|
||||
return;
|
||||
}
|
||||
var _11=_b.current;
|
||||
t.closest("div.calendar-body").find(".calendar-selected").removeClass("calendar-selected");
|
||||
t.addClass("calendar-selected");
|
||||
var _12=t.attr("abbr").split(",");
|
||||
var y=parseInt(_12[0]);
|
||||
var m=parseInt(_12[1]);
|
||||
var d=parseInt(_12[2]);
|
||||
_b.current=new _b.Date(y,m-1,d);
|
||||
_b.onSelect.call(_a,_b.current);
|
||||
if(!_11||_11.getTime()!=_b.current.getTime()){
|
||||
_b.onChange.call(_a,_b.current,_11);
|
||||
}
|
||||
if(_b.year!=y||_b.month!=m){
|
||||
_b.year=y;
|
||||
_b.month=m;
|
||||
_19(_a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
function _e(t){
|
||||
var day=$(t).closest(".calendar-day");
|
||||
if(day.length){
|
||||
return day;
|
||||
}else{
|
||||
return $(t);
|
||||
}
|
||||
};
|
||||
function _d(_13){
|
||||
var _14=$(_a).find(".calendar-menu");
|
||||
var _15=_14.find(".calendar-menu-year").val();
|
||||
var _16=_14.find(".calendar-selected").attr("abbr");
|
||||
if(!isNaN(_15)){
|
||||
_b.year=parseInt(_15);
|
||||
_b.month=parseInt(_16);
|
||||
_19(_a);
|
||||
}
|
||||
if(_13){
|
||||
_14.hide();
|
||||
}
|
||||
};
|
||||
function _f(_17){
|
||||
_b.year+=_17;
|
||||
_19(_a);
|
||||
_c.find(".calendar-menu-year").val(_b.year);
|
||||
};
|
||||
function _10(_18){
|
||||
_b.month+=_18;
|
||||
if(_b.month>12){
|
||||
_b.year++;
|
||||
_b.month=1;
|
||||
}else{
|
||||
if(_b.month<1){
|
||||
_b.year--;
|
||||
_b.month=12;
|
||||
}
|
||||
}
|
||||
_19(_a);
|
||||
_c.find("td.calendar-selected").removeClass("calendar-selected");
|
||||
_c.find("td:eq("+(_b.month-1)+")").addClass("calendar-selected");
|
||||
};
|
||||
};
|
||||
function _5(_1a){
|
||||
var _1b=$.data(_1a,"calendar").options;
|
||||
$(_1a).find(".calendar-menu").show();
|
||||
if($(_1a).find(".calendar-menu-month-inner").is(":empty")){
|
||||
$(_1a).find(".calendar-menu-month-inner").empty();
|
||||
var t=$("<table class=\"calendar-mtable\"></table>").appendTo($(_1a).find(".calendar-menu-month-inner"));
|
||||
var idx=0;
|
||||
for(var i=0;i<3;i++){
|
||||
var tr=$("<tr></tr>").appendTo(t);
|
||||
for(var j=0;j<4;j++){
|
||||
$("<td class=\"calendar-nav calendar-menu-month\"></td>").html(_1b.months[idx++]).attr("abbr",idx).appendTo(tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
var _1c=$(_1a).find(".calendar-body");
|
||||
var _1d=$(_1a).find(".calendar-menu");
|
||||
var _1e=_1d.find(".calendar-menu-year-inner");
|
||||
var _1f=_1d.find(".calendar-menu-month-inner");
|
||||
_1e.find("input").val(_1b.year).focus();
|
||||
_1f.find("td.calendar-selected").removeClass("calendar-selected");
|
||||
_1f.find("td:eq("+(_1b.month-1)+")").addClass("calendar-selected");
|
||||
_1d._outerWidth(_1c._outerWidth());
|
||||
_1d._outerHeight(_1c._outerHeight());
|
||||
_1f._outerHeight(_1d.height()-_1e._outerHeight());
|
||||
};
|
||||
function _20(_21,_22,_23){
|
||||
var _24=$.data(_21,"calendar").options;
|
||||
var _25=[];
|
||||
var _26=new _24.Date(_22,_23,0).getDate();
|
||||
for(var i=1;i<=_26;i++){
|
||||
_25.push([_22,_23,i]);
|
||||
}
|
||||
var _27=[],_28=[];
|
||||
var _29=-1;
|
||||
while(_25.length>0){
|
||||
var _2a=_25.shift();
|
||||
_28.push(_2a);
|
||||
var day=new _24.Date(_2a[0],_2a[1]-1,_2a[2]).getDay();
|
||||
if(_29==day){
|
||||
day=0;
|
||||
}else{
|
||||
if(day==(_24.firstDay==0?7:_24.firstDay)-1){
|
||||
_27.push(_28);
|
||||
_28=[];
|
||||
}
|
||||
}
|
||||
_29=day;
|
||||
}
|
||||
if(_28.length){
|
||||
_27.push(_28);
|
||||
}
|
||||
var _2b=_27[0];
|
||||
if(_2b.length<7){
|
||||
while(_2b.length<7){
|
||||
var _2c=_2b[0];
|
||||
var _2a=new _24.Date(_2c[0],_2c[1]-1,_2c[2]-1);
|
||||
_2b.unshift([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]);
|
||||
}
|
||||
}else{
|
||||
var _2c=_2b[0];
|
||||
var _28=[];
|
||||
for(var i=1;i<=7;i++){
|
||||
var _2a=new _24.Date(_2c[0],_2c[1]-1,_2c[2]-i);
|
||||
_28.unshift([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]);
|
||||
}
|
||||
_27.unshift(_28);
|
||||
}
|
||||
var _2d=_27[_27.length-1];
|
||||
while(_2d.length<7){
|
||||
var _2e=_2d[_2d.length-1];
|
||||
var _2a=new _24.Date(_2e[0],_2e[1]-1,_2e[2]+1);
|
||||
_2d.push([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]);
|
||||
}
|
||||
if(_27.length<6){
|
||||
var _2e=_2d[_2d.length-1];
|
||||
var _28=[];
|
||||
for(var i=1;i<=7;i++){
|
||||
var _2a=new _24.Date(_2e[0],_2e[1]-1,_2e[2]+i);
|
||||
_28.push([_2a.getFullYear(),_2a.getMonth()+1,_2a.getDate()]);
|
||||
}
|
||||
_27.push(_28);
|
||||
}
|
||||
return _27;
|
||||
};
|
||||
function _19(_2f){
|
||||
var _30=$.data(_2f,"calendar").options;
|
||||
if(_30.current&&!_30.validator.call(_2f,_30.current)){
|
||||
_30.current=null;
|
||||
}
|
||||
var now=new _30.Date();
|
||||
var _31=now.getFullYear()+","+(now.getMonth()+1)+","+now.getDate();
|
||||
var _32=_30.current?(_30.current.getFullYear()+","+(_30.current.getMonth()+1)+","+_30.current.getDate()):"";
|
||||
var _33=6-_30.firstDay;
|
||||
var _34=_33+1;
|
||||
if(_33>=7){
|
||||
_33-=7;
|
||||
}
|
||||
if(_34>=7){
|
||||
_34-=7;
|
||||
}
|
||||
$(_2f).find(".calendar-title span").html(_30.months[_30.month-1]+" "+_30.year);
|
||||
var _35=$(_2f).find("div.calendar-body");
|
||||
_35.children("table").remove();
|
||||
var _36=["<table class=\"calendar-dtable\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">"];
|
||||
_36.push("<thead><tr>");
|
||||
if(_30.showWeek){
|
||||
_36.push("<th class=\"calendar-week\">"+_30.weekNumberHeader+"</th>");
|
||||
}
|
||||
for(var i=_30.firstDay;i<_30.weeks.length;i++){
|
||||
_36.push("<th>"+_30.weeks[i]+"</th>");
|
||||
}
|
||||
for(var i=0;i<_30.firstDay;i++){
|
||||
_36.push("<th>"+_30.weeks[i]+"</th>");
|
||||
}
|
||||
_36.push("</tr></thead>");
|
||||
_36.push("<tbody>");
|
||||
var _37=_20(_2f,_30.year,_30.month);
|
||||
for(var i=0;i<_37.length;i++){
|
||||
var _38=_37[i];
|
||||
var cls="";
|
||||
if(i==0){
|
||||
cls="calendar-first";
|
||||
}else{
|
||||
if(i==_37.length-1){
|
||||
cls="calendar-last";
|
||||
}
|
||||
}
|
||||
_36.push("<tr class=\""+cls+"\">");
|
||||
if(_30.showWeek){
|
||||
var _39=_30.getWeekNumber(new _30.Date(_38[0][0],parseInt(_38[0][1])-1,_38[0][2]));
|
||||
_36.push("<td class=\"calendar-week\">"+_39+"</td>");
|
||||
}
|
||||
for(var j=0;j<_38.length;j++){
|
||||
var day=_38[j];
|
||||
var s=day[0]+","+day[1]+","+day[2];
|
||||
var _3a=new _30.Date(day[0],parseInt(day[1])-1,day[2]);
|
||||
var d=_30.formatter.call(_2f,_3a);
|
||||
var css=_30.styler.call(_2f,_3a);
|
||||
var _3b="";
|
||||
var _3c="";
|
||||
if(typeof css=="string"){
|
||||
_3c=css;
|
||||
}else{
|
||||
if(css){
|
||||
_3b=css["class"]||"";
|
||||
_3c=css["style"]||"";
|
||||
}
|
||||
}
|
||||
var cls="calendar-day";
|
||||
if(!(_30.year==day[0]&&_30.month==day[1])){
|
||||
cls+=" calendar-other-month";
|
||||
}
|
||||
if(s==_31){
|
||||
cls+=" calendar-today";
|
||||
}
|
||||
if(s==_32){
|
||||
cls+=" calendar-selected";
|
||||
}
|
||||
if(j==_33){
|
||||
cls+=" calendar-saturday";
|
||||
}else{
|
||||
if(j==_34){
|
||||
cls+=" calendar-sunday";
|
||||
}
|
||||
}
|
||||
if(j==0){
|
||||
cls+=" calendar-first";
|
||||
}else{
|
||||
if(j==_38.length-1){
|
||||
cls+=" calendar-last";
|
||||
}
|
||||
}
|
||||
cls+=" "+_3b;
|
||||
if(!_30.validator.call(_2f,_3a)){
|
||||
cls+=" calendar-disabled";
|
||||
}
|
||||
_36.push("<td class=\""+cls+"\" abbr=\""+s+"\" style=\""+_3c+"\">"+d+"</td>");
|
||||
}
|
||||
_36.push("</tr>");
|
||||
}
|
||||
_36.push("</tbody>");
|
||||
_36.push("</table>");
|
||||
_35.append(_36.join(""));
|
||||
_35.children("table.calendar-dtable").prependTo(_35);
|
||||
_30.onNavigate.call(_2f,_30.year,_30.month);
|
||||
};
|
||||
$.fn.calendar=function(_3d,_3e){
|
||||
if(typeof _3d=="string"){
|
||||
return $.fn.calendar.methods[_3d](this,_3e);
|
||||
}
|
||||
_3d=_3d||{};
|
||||
return this.each(function(){
|
||||
var _3f=$.data(this,"calendar");
|
||||
if(_3f){
|
||||
$.extend(_3f.options,_3d);
|
||||
}else{
|
||||
_3f=$.data(this,"calendar",{options:$.extend({},$.fn.calendar.defaults,$.fn.calendar.parseOptions(this),_3d)});
|
||||
_6(this);
|
||||
}
|
||||
if(_3f.options.border==false){
|
||||
$(this).addClass("calendar-noborder");
|
||||
}
|
||||
_1(this);
|
||||
_9(this);
|
||||
_19(this);
|
||||
$(this).find("div.calendar-menu").hide();
|
||||
});
|
||||
};
|
||||
$.fn.calendar.methods={options:function(jq){
|
||||
return $.data(jq[0],"calendar").options;
|
||||
},resize:function(jq,_40){
|
||||
return jq.each(function(){
|
||||
_1(this,_40);
|
||||
});
|
||||
},moveTo:function(jq,_41){
|
||||
return jq.each(function(){
|
||||
var _42=$(this).calendar("options");
|
||||
if(!_41){
|
||||
var now=new _42.Date();
|
||||
$(this).calendar({year:now.getFullYear(),month:now.getMonth()+1,current:_41});
|
||||
return;
|
||||
}
|
||||
if(_42.validator.call(this,_41)){
|
||||
var _43=_42.current;
|
||||
$(this).calendar({year:_41.getFullYear(),month:_41.getMonth()+1,current:_41});
|
||||
if(!_43||_43.getTime()!=_41.getTime()){
|
||||
_42.onChange.call(this,_42.current,_43);
|
||||
}
|
||||
}
|
||||
});
|
||||
}};
|
||||
$.fn.calendar.parseOptions=function(_44){
|
||||
var t=$(_44);
|
||||
return $.extend({},$.parser.parseOptions(_44,["weekNumberHeader",{firstDay:"number",fit:"boolean",border:"boolean",showWeek:"boolean"}]));
|
||||
};
|
||||
$.fn.calendar.defaults={Date:Date,width:180,height:180,fit:false,border:true,showWeek:false,firstDay:0,weeks:["S","M","T","W","T","F","S"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],year:new Date().getFullYear(),month:new Date().getMonth()+1,current:(function(){
|
||||
var d=new Date();
|
||||
return new Date(d.getFullYear(),d.getMonth(),d.getDate());
|
||||
})(),weekNumberHeader:"",getWeekNumber:function(_45){
|
||||
var _46=new Date(_45.getTime());
|
||||
_46.setDate(_46.getDate()+4-(_46.getDay()||7));
|
||||
var _47=_46.getTime();
|
||||
_46.setMonth(0);
|
||||
_46.setDate(1);
|
||||
return Math.floor(Math.round((_47-_46)/86400000)/7)+1;
|
||||
},formatter:function(_48){
|
||||
return _48.getDate();
|
||||
},styler:function(_49){
|
||||
return "";
|
||||
},validator:function(_4a){
|
||||
return true;
|
||||
},onSelect:function(_4b){
|
||||
},onChange:function(_4c,_4d){
|
||||
},onNavigate:function(_4e,_4f){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
190
static/jeasyui/plugins/jquery.checkbox.js
Normal file
190
static/jeasyui/plugins/jquery.checkbox.js
Normal file
@@ -0,0 +1,190 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=1;
|
||||
function _2(_3){
|
||||
var _4=$("<span class=\"checkbox inputbox\">"+"<span class=\"checkbox-inner\">"+"<svg xml:space=\"preserve\" focusable=\"false\" version=\"1.1\" viewBox=\"0 0 24 24\"><path d=\"M4.1,12.7 9,17.6 20.3,6.3\" fill=\"none\" stroke=\"white\"></path></svg>"+"</span>"+"<input type=\"checkbox\" class=\"checkbox-value\">"+"</span>").insertAfter(_3);
|
||||
var t=$(_3);
|
||||
t.addClass("checkbox-f").hide();
|
||||
var _5=t.attr("name");
|
||||
if(_5){
|
||||
t.removeAttr("name").attr("checkboxName",_5);
|
||||
_4.find(".checkbox-value").attr("name",_5);
|
||||
}
|
||||
return _4;
|
||||
};
|
||||
function _6(_7){
|
||||
var _8=$.data(_7,"checkbox");
|
||||
var _9=_8.options;
|
||||
var _a=_8.checkbox;
|
||||
var _b="_easyui_checkbox_"+(++_1);
|
||||
var _c=_a.find(".checkbox-value").attr("id",_b);
|
||||
_c._unbind(".checkbox")._bind("change.checkbox",function(e){
|
||||
return false;
|
||||
});
|
||||
if(_9.label){
|
||||
if(typeof _9.label=="object"){
|
||||
_8.label=$(_9.label);
|
||||
_8.label.attr("for",_b);
|
||||
}else{
|
||||
$(_8.label).remove();
|
||||
_8.label=$("<label class=\"textbox-label\"></label>").html(_9.label);
|
||||
_8.label.css("textAlign",_9.labelAlign).attr("for",_b);
|
||||
if(_9.labelPosition=="after"){
|
||||
_8.label.insertAfter(_a);
|
||||
}else{
|
||||
_8.label.insertBefore(_7);
|
||||
}
|
||||
_8.label.removeClass("textbox-label-left textbox-label-right textbox-label-top");
|
||||
_8.label.addClass("textbox-label-"+_9.labelPosition);
|
||||
}
|
||||
}else{
|
||||
$(_8.label).remove();
|
||||
}
|
||||
$(_7).checkbox("setValue",_9.value);
|
||||
_d(_7,_9.checked);
|
||||
_e(_7,_9.readonly);
|
||||
_f(_7,_9.disabled);
|
||||
};
|
||||
function _10(_11){
|
||||
var _12=$.data(_11,"checkbox");
|
||||
var _13=_12.options;
|
||||
var _14=_12.checkbox;
|
||||
_14._unbind(".checkbox")._bind("click.checkbox",function(){
|
||||
if(!_13.disabled&&!_13.readonly){
|
||||
_d(_11,!_13.checked);
|
||||
}
|
||||
});
|
||||
};
|
||||
function _15(_16){
|
||||
var _17=$.data(_16,"checkbox");
|
||||
var _18=_17.options;
|
||||
var _19=_17.checkbox;
|
||||
_19._size(_18,_19.parent());
|
||||
if(_18.label&&_18.labelPosition){
|
||||
if(_18.labelPosition=="top"){
|
||||
_17.label._size({width:_18.labelWidth},_19);
|
||||
}else{
|
||||
_17.label._size({width:_18.labelWidth,height:_19.outerHeight()},_19);
|
||||
_17.label.css("lineHeight",_19.outerHeight()+"px");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _d(_1a,_1b){
|
||||
var _1c=$.data(_1a,"checkbox");
|
||||
var _1d=_1c.options;
|
||||
var _1e=_1c.checkbox;
|
||||
_1e.find(".checkbox-value")._propAttr("checked",_1b);
|
||||
var _1f=_1e.find(".checkbox-inner").css("display",_1b?"":"none");
|
||||
if(_1b){
|
||||
_1e.addClass("checkbox-checked");
|
||||
$(_1c.label).addClass("textbox-label-checked");
|
||||
}else{
|
||||
_1e.removeClass("checkbox-checked");
|
||||
$(_1c.label).removeClass("textbox-label-checked");
|
||||
}
|
||||
if(_1d.checked!=_1b){
|
||||
_1d.checked=_1b;
|
||||
_1d.onChange.call(_1a,_1b);
|
||||
$(_1a).closest("form").trigger("_change",[_1a]);
|
||||
}
|
||||
};
|
||||
function _e(_20,_21){
|
||||
var _22=$.data(_20,"checkbox");
|
||||
var _23=_22.options;
|
||||
_23.readonly=_21==undefined?true:_21;
|
||||
if(_23.readonly){
|
||||
_22.checkbox.addClass("checkbox-readonly");
|
||||
$(_22.label).addClass("textbox-label-readonly");
|
||||
}else{
|
||||
_22.checkbox.removeClass("checkbox-readonly");
|
||||
$(_22.label).removeClass("textbox-label-readonly");
|
||||
}
|
||||
};
|
||||
function _f(_24,_25){
|
||||
var _26=$.data(_24,"checkbox");
|
||||
var _27=_26.options;
|
||||
var _28=_26.checkbox;
|
||||
var rv=_28.find(".checkbox-value");
|
||||
_27.disabled=_25;
|
||||
if(_25){
|
||||
$(_24).add(rv)._propAttr("disabled",true);
|
||||
_28.addClass("checkbox-disabled");
|
||||
$(_26.label).addClass("textbox-label-disabled");
|
||||
}else{
|
||||
$(_24).add(rv)._propAttr("disabled",false);
|
||||
_28.removeClass("checkbox-disabled");
|
||||
$(_26.label).removeClass("textbox-label-disabled");
|
||||
}
|
||||
};
|
||||
$.fn.checkbox=function(_29,_2a){
|
||||
if(typeof _29=="string"){
|
||||
return $.fn.checkbox.methods[_29](this,_2a);
|
||||
}
|
||||
_29=_29||{};
|
||||
return this.each(function(){
|
||||
var _2b=$.data(this,"checkbox");
|
||||
if(_2b){
|
||||
$.extend(_2b.options,_29);
|
||||
}else{
|
||||
_2b=$.data(this,"checkbox",{options:$.extend({},$.fn.checkbox.defaults,$.fn.checkbox.parseOptions(this),_29),checkbox:_2(this)});
|
||||
}
|
||||
_2b.options.originalChecked=_2b.options.checked;
|
||||
_6(this);
|
||||
_10(this);
|
||||
_15(this);
|
||||
});
|
||||
};
|
||||
$.fn.checkbox.methods={options:function(jq){
|
||||
var _2c=jq.data("checkbox");
|
||||
return $.extend(_2c.options,{value:_2c.checkbox.find(".checkbox-value").val()});
|
||||
},setValue:function(jq,_2d){
|
||||
return jq.each(function(){
|
||||
$(this).val(_2d);
|
||||
$.data(this,"checkbox").checkbox.find(".checkbox-value").val(_2d);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,false);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,true);
|
||||
});
|
||||
},readonly:function(jq,_2e){
|
||||
return jq.each(function(){
|
||||
_e(this,_2e);
|
||||
});
|
||||
},check:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,true);
|
||||
});
|
||||
},uncheck:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _2f=$(this).checkbox("options");
|
||||
_d(this,_2f.originalChecked);
|
||||
});
|
||||
}};
|
||||
$.fn.checkbox.parseOptions=function(_30){
|
||||
var t=$(_30);
|
||||
return $.extend({},$.parser.parseOptions(_30,["label","labelPosition","labelAlign",{labelWidth:"number"}]),{value:(t.val()||undefined),checked:(t.attr("checked")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)});
|
||||
};
|
||||
$.fn.checkbox.defaults={width:20,height:20,value:null,disabled:false,readonly:false,checked:false,label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",onChange:function(_31){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
414
static/jeasyui/plugins/jquery.combo.js
Executable file
414
static/jeasyui/plugins/jquery.combo.js
Executable file
@@ -0,0 +1,414 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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("html>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){
|
||||
_10(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");
|
||||
_4.panel._unbind(".combo");
|
||||
for(var _b in _5.panelEvents){
|
||||
_4.panel._bind(_b+".combo",{target:_3},_5.panelEvents[_b]);
|
||||
}
|
||||
};
|
||||
function _c(_d){
|
||||
var _e=$.data(_d,"combo");
|
||||
var _f=_e.options;
|
||||
var p=_e.panel;
|
||||
if(p.is(":visible")){
|
||||
p.panel("close");
|
||||
}
|
||||
if(!_f.cloned){
|
||||
p.panel("destroy");
|
||||
}
|
||||
$(_d).textbox("destroy");
|
||||
};
|
||||
function _10(_11){
|
||||
var _12=$.data(_11,"combo").panel;
|
||||
if(_12.is(":visible")){
|
||||
var _13=_12.combo("combo");
|
||||
_14(_13);
|
||||
if(_13!=_11){
|
||||
$(_11).combo("showPanel");
|
||||
}
|
||||
}else{
|
||||
var p=$(_11).closest("div.combo-p").children(".combo-panel");
|
||||
$("div.combo-panel:visible").not(_12).not(p).panel("close");
|
||||
$(_11).combo("showPanel");
|
||||
}
|
||||
$(_11).combo("textbox").focus();
|
||||
};
|
||||
function _1(_15){
|
||||
$(_15).find(".combo-f").each(function(){
|
||||
var p=$(this).combo("panel");
|
||||
if(p.is(":visible")){
|
||||
p.panel("close");
|
||||
}
|
||||
});
|
||||
};
|
||||
function _16(e){
|
||||
var _17=e.data.target;
|
||||
var _18=$.data(_17,"combo");
|
||||
var _19=_18.options;
|
||||
if(!_19.editable){
|
||||
_10(_17);
|
||||
}else{
|
||||
var p=$(_17).closest("div.combo-p").children(".combo-panel");
|
||||
$("div.combo-panel:visible").not(p).each(function(){
|
||||
var _1a=$(this).combo("combo");
|
||||
if(_1a!=_17){
|
||||
_14(_1a);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
function _1b(e){
|
||||
var _1c=e.data.target;
|
||||
var t=$(_1c);
|
||||
var _1d=t.data("combo");
|
||||
var _1e=t.combo("options");
|
||||
_1d.panel.panel("options").comboTarget=_1c;
|
||||
switch(e.keyCode){
|
||||
case 38:
|
||||
_1e.keyHandler.up.call(_1c,e);
|
||||
break;
|
||||
case 40:
|
||||
_1e.keyHandler.down.call(_1c,e);
|
||||
break;
|
||||
case 37:
|
||||
_1e.keyHandler.left.call(_1c,e);
|
||||
break;
|
||||
case 39:
|
||||
_1e.keyHandler.right.call(_1c,e);
|
||||
break;
|
||||
case 13:
|
||||
e.preventDefault();
|
||||
_1e.keyHandler.enter.call(_1c,e);
|
||||
return false;
|
||||
case 9:
|
||||
case 27:
|
||||
_14(_1c);
|
||||
break;
|
||||
default:
|
||||
if(_1e.editable){
|
||||
if(_1d.timer){
|
||||
clearTimeout(_1d.timer);
|
||||
}
|
||||
_1d.timer=setTimeout(function(){
|
||||
var q=t.combo("getText");
|
||||
if(_1d.previousText!=q){
|
||||
_1d.previousText=q;
|
||||
t.combo("showPanel");
|
||||
_1e.keyHandler.query.call(_1c,q,e);
|
||||
t.combo("validate");
|
||||
}
|
||||
},_1e.delay);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _1f(e){
|
||||
var _20=e.data.target;
|
||||
var _21=$(_20).data("combo");
|
||||
if(_21.timer){
|
||||
clearTimeout(_21.timer);
|
||||
}
|
||||
};
|
||||
function _22(_23){
|
||||
var _24=$.data(_23,"combo");
|
||||
var _25=_24.combo;
|
||||
var _26=_24.panel;
|
||||
var _27=$(_23).combo("options");
|
||||
var _28=_26.panel("options");
|
||||
_28.comboTarget=_23;
|
||||
if(_28.closed){
|
||||
_26.panel("panel").show().css({zIndex:($.fn.menu?$.fn.menu.defaults.zIndex++:($.fn.window?$.fn.window.defaults.zIndex++:99)),left:-999999});
|
||||
_26.panel("resize",{width:(_27.panelWidth?_27.panelWidth:_25._outerWidth()),height:_27.panelHeight});
|
||||
_26.panel("panel").hide();
|
||||
_26.panel("open");
|
||||
}
|
||||
(function(){
|
||||
if(_28.comboTarget==_23&&_26.is(":visible")){
|
||||
_26.panel("move",{left:_29(),top:_2a()});
|
||||
setTimeout(arguments.callee,200);
|
||||
}
|
||||
})();
|
||||
function _29(){
|
||||
var _2b=_25.offset().left;
|
||||
if(_27.panelAlign=="right"){
|
||||
_2b+=_25._outerWidth()-_26._outerWidth();
|
||||
}
|
||||
if(_2b+_26._outerWidth()>$(window)._outerWidth()+$(document).scrollLeft()){
|
||||
_2b=$(window)._outerWidth()+$(document).scrollLeft()-_26._outerWidth();
|
||||
}
|
||||
if(_2b<0){
|
||||
_2b=0;
|
||||
}
|
||||
return _2b;
|
||||
};
|
||||
function _2a(){
|
||||
if(_27.panelValign=="top"){
|
||||
var top=_25.offset().top-_26._outerHeight();
|
||||
}else{
|
||||
if(_27.panelValign=="bottom"){
|
||||
var top=_25.offset().top+_25._outerHeight();
|
||||
}else{
|
||||
var top=_25.offset().top+_25._outerHeight();
|
||||
if(top+_26._outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){
|
||||
top=_25.offset().top-_26._outerHeight();
|
||||
}
|
||||
if(top<$(document).scrollTop()){
|
||||
top=_25.offset().top+_25._outerHeight();
|
||||
}
|
||||
}
|
||||
}
|
||||
return top;
|
||||
};
|
||||
};
|
||||
function _14(_2c){
|
||||
var _2d=$.data(_2c,"combo").panel;
|
||||
_2d.panel("close");
|
||||
};
|
||||
function _2e(_2f,_30){
|
||||
var _31=$.data(_2f,"combo");
|
||||
var _32=$(_2f).textbox("getText");
|
||||
if(_32!=_30){
|
||||
$(_2f).textbox("setText",_30);
|
||||
}
|
||||
_31.previousText=_30;
|
||||
};
|
||||
function _33(_34){
|
||||
var _35=$.data(_34,"combo");
|
||||
var _36=_35.options;
|
||||
var _37=$(_34).next();
|
||||
var _38=[];
|
||||
_37.find(".textbox-value").each(function(){
|
||||
_38.push($(this).val());
|
||||
});
|
||||
if(_36.multivalue){
|
||||
return _38;
|
||||
}else{
|
||||
return _38.length?_38[0].split(_36.separator):_38;
|
||||
}
|
||||
};
|
||||
function _39(_3a,_3b){
|
||||
var _3c=$.data(_3a,"combo");
|
||||
var _3d=_3c.combo;
|
||||
var _3e=$(_3a).combo("options");
|
||||
if(!$.isArray(_3b)){
|
||||
_3b=_3b.split(_3e.separator);
|
||||
}
|
||||
var _3f=_33(_3a);
|
||||
_3d.find(".textbox-value").remove();
|
||||
if(_3b.length){
|
||||
if(_3e.multivalue){
|
||||
for(var i=0;i<_3b.length;i++){
|
||||
_40(_3b[i]);
|
||||
}
|
||||
}else{
|
||||
_40(_3b.join(_3e.separator));
|
||||
}
|
||||
}
|
||||
function _40(_41){
|
||||
var _42=$(_3a).attr("textboxName")||"";
|
||||
var _43=$("<input type=\"hidden\" class=\"textbox-value\">").appendTo(_3d);
|
||||
_43.attr("name",_42);
|
||||
if(_3e.disabled){
|
||||
_43.attr("disabled","disabled");
|
||||
}
|
||||
_43.val(_41);
|
||||
};
|
||||
var _44=(function(){
|
||||
if(_3e.onChange==$.parser.emptyFn){
|
||||
return false;
|
||||
}
|
||||
if(_3f.length!=_3b.length){
|
||||
return true;
|
||||
}
|
||||
for(var i=0;i<_3b.length;i++){
|
||||
if(_3b[i]!=_3f[i]){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})();
|
||||
if(_44){
|
||||
$(_3a).val(_3b.join(_3e.separator));
|
||||
if(_3e.multiple){
|
||||
_3e.onChange.call(_3a,_3b,_3f);
|
||||
}else{
|
||||
_3e.onChange.call(_3a,_3b[0],_3f[0]);
|
||||
}
|
||||
$(_3a).closest("form").trigger("_change",[_3a]);
|
||||
}
|
||||
};
|
||||
function _45(_46){
|
||||
var _47=_33(_46);
|
||||
return _47[0];
|
||||
};
|
||||
function _48(_49,_4a){
|
||||
_39(_49,[_4a]);
|
||||
};
|
||||
function _4b(_4c){
|
||||
var _4d=$.data(_4c,"combo").options;
|
||||
var _4e=_4d.onChange;
|
||||
_4d.onChange=$.parser.emptyFn;
|
||||
if(_4d.multiple){
|
||||
_39(_4c,_4d.value?_4d.value:[]);
|
||||
}else{
|
||||
_48(_4c,_4d.value);
|
||||
}
|
||||
_4d.onChange=_4e;
|
||||
};
|
||||
$.fn.combo=function(_4f,_50){
|
||||
if(typeof _4f=="string"){
|
||||
var _51=$.fn.combo.methods[_4f];
|
||||
if(_51){
|
||||
return _51(this,_50);
|
||||
}else{
|
||||
return this.textbox(_4f,_50);
|
||||
}
|
||||
}
|
||||
_4f=_4f||{};
|
||||
return this.each(function(){
|
||||
var _52=$.data(this,"combo");
|
||||
if(_52){
|
||||
$.extend(_52.options,_4f);
|
||||
if(_4f.value!=undefined){
|
||||
_52.options.originalValue=_4f.value;
|
||||
}
|
||||
}else{
|
||||
_52=$.data(this,"combo",{options:$.extend({},$.fn.combo.defaults,$.fn.combo.parseOptions(this),_4f),previousText:""});
|
||||
if(_52.options.multiple&&_52.options.value==""){
|
||||
_52.options.originalValue=[];
|
||||
}else{
|
||||
_52.options.originalValue=_52.options.value;
|
||||
}
|
||||
}
|
||||
_2(this);
|
||||
_4b(this);
|
||||
});
|
||||
};
|
||||
$.fn.combo.methods={options:function(jq){
|
||||
var _53=jq.textbox("options");
|
||||
return $.extend($.data(jq[0],"combo").options,{width:_53.width,height:_53.height,disabled:_53.disabled,readonly:_53.readonly});
|
||||
},cloneFrom:function(jq,_54){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("cloneFrom",_54);
|
||||
$.data(this,"combo",{options:$.extend(true,{cloned:true},$(_54).combo("options")),combo:$(this).next(),panel:$(_54).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(){
|
||||
_c(this);
|
||||
});
|
||||
},showPanel:function(jq){
|
||||
return jq.each(function(){
|
||||
_22(this);
|
||||
});
|
||||
},hidePanel:function(jq){
|
||||
return jq.each(function(){
|
||||
_14(this);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("setText","");
|
||||
var _55=$.data(this,"combo").options;
|
||||
if(_55.multiple){
|
||||
$(this).combo("setValues",[]);
|
||||
}else{
|
||||
$(this).combo("setValue","");
|
||||
}
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _56=$.data(this,"combo").options;
|
||||
if(_56.multiple){
|
||||
$(this).combo("setValues",_56.originalValue);
|
||||
}else{
|
||||
$(this).combo("setValue",_56.originalValue);
|
||||
}
|
||||
});
|
||||
},setText:function(jq,_57){
|
||||
return jq.each(function(){
|
||||
_2e(this,_57);
|
||||
});
|
||||
},getValues:function(jq){
|
||||
return _33(jq[0]);
|
||||
},setValues:function(jq,_58){
|
||||
return jq.each(function(){
|
||||
_39(this,_58);
|
||||
});
|
||||
},getValue:function(jq){
|
||||
return _45(jq[0]);
|
||||
},setValue:function(jq,_59){
|
||||
return jq.each(function(){
|
||||
_48(this,_59);
|
||||
});
|
||||
}};
|
||||
$.fn.combo.parseOptions=function(_5a){
|
||||
var t=$(_5a);
|
||||
return $.extend({},$.fn.textbox.parseOptions(_5a),$.parser.parseOptions(_5a,["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:_16,keydown:_1b,paste:_1b,drop:_1b,blur:_1f},panelEvents:{mousedown:function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}},panelWidth:null,panelHeight:300,panelMinWidth:null,panelMaxWidth:null,panelMinHeight:null,panelMaxHeight:null,panelAlign:"left",panelValign:"auto",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(_5b,_5c){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
612
static/jeasyui/plugins/jquery.combobox.js
Executable file
612
static/jeasyui/plugins/jquery.combobox.js
Executable file
@@ -0,0 +1,612 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2,_3){
|
||||
var _4=$.data(_2,"combobox");
|
||||
return $.easyui.indexOfArray(_4.data,_4.options.valueField,_3);
|
||||
};
|
||||
function _5(_6,_7){
|
||||
var _8=$.data(_6,"combobox").options;
|
||||
var _9=$(_6).combo("panel");
|
||||
var _a=_8.finder.getEl(_6,_7);
|
||||
if(_a.length){
|
||||
if(_a.position().top<=0){
|
||||
var h=_9.scrollTop()+_a.position().top;
|
||||
_9.scrollTop(h);
|
||||
}else{
|
||||
if(_a.position().top+_a.outerHeight()>_9.height()){
|
||||
var h=_9.scrollTop()+_a.position().top+_a.outerHeight()-_9.height();
|
||||
_9.scrollTop(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
_9.triggerHandler("scroll");
|
||||
};
|
||||
function _b(_c,_d){
|
||||
var _e=$.data(_c,"combobox").options;
|
||||
var _f=$(_c).combobox("panel");
|
||||
var _10=_f.children("div.combobox-item-hover");
|
||||
if(!_10.length){
|
||||
_10=_f.children("div.combobox-item-selected");
|
||||
}
|
||||
_10.removeClass("combobox-item-hover");
|
||||
var _11="div.combobox-item:visible:not(.combobox-item-disabled):first";
|
||||
var _12="div.combobox-item:visible:not(.combobox-item-disabled):last";
|
||||
if(!_10.length){
|
||||
_10=_f.children(_d=="next"?_11:_12);
|
||||
}else{
|
||||
if(_d=="next"){
|
||||
_10=_10.nextAll(_11);
|
||||
if(!_10.length){
|
||||
_10=_f.children(_11);
|
||||
}
|
||||
}else{
|
||||
_10=_10.prevAll(_11);
|
||||
if(!_10.length){
|
||||
_10=_f.children(_12);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_10.length){
|
||||
_10.addClass("combobox-item-hover");
|
||||
var row=_e.finder.getRow(_c,_10);
|
||||
if(row){
|
||||
$(_c).combobox("scrollTo",row[_e.valueField]);
|
||||
if(_e.selectOnNavigation){
|
||||
_13(_c,row[_e.valueField]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
function _13(_14,_15,_16){
|
||||
var _17=$.data(_14,"combobox").options;
|
||||
var _18=$(_14).combo("getValues");
|
||||
if($.inArray(_15+"",_18)==-1){
|
||||
if(_17.multiple){
|
||||
_18.push(_15);
|
||||
}else{
|
||||
_18=[_15];
|
||||
}
|
||||
_19(_14,_18,_16);
|
||||
}
|
||||
};
|
||||
function _1a(_1b,_1c){
|
||||
var _1d=$.data(_1b,"combobox").options;
|
||||
var _1e=$(_1b).combo("getValues");
|
||||
var _1f=$.inArray(_1c+"",_1e);
|
||||
if(_1f>=0){
|
||||
_1e.splice(_1f,1);
|
||||
_19(_1b,_1e);
|
||||
}
|
||||
};
|
||||
function _19(_20,_21,_22){
|
||||
var _23=$.data(_20,"combobox").options;
|
||||
var _24=$(_20).combo("panel");
|
||||
if(!$.isArray(_21)){
|
||||
_21=_21.split(_23.separator);
|
||||
}
|
||||
if(!_23.multiple){
|
||||
_21=_21.length?[_21[0]]:[""];
|
||||
}
|
||||
var _25=$(_20).combo("getValues");
|
||||
if(_24.is(":visible")){
|
||||
_24.find(".combobox-item-selected").each(function(){
|
||||
var row=_23.finder.getRow(_20,$(this));
|
||||
if(row){
|
||||
if($.easyui.indexOfArray(_25,row[_23.valueField])==-1){
|
||||
$(this).removeClass("combobox-item-selected");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
$.map(_25,function(v){
|
||||
if($.easyui.indexOfArray(_21,v)==-1){
|
||||
var el=_23.finder.getEl(_20,v);
|
||||
if(el.hasClass("combobox-item-selected")){
|
||||
el.removeClass("combobox-item-selected");
|
||||
_23.onUnselect.call(_20,_23.finder.getRow(_20,v));
|
||||
}
|
||||
}
|
||||
});
|
||||
var _26=null;
|
||||
var vv=[],ss=[];
|
||||
for(var i=0;i<_21.length;i++){
|
||||
var v=_21[i];
|
||||
var s=v;
|
||||
var row=_23.finder.getRow(_20,v);
|
||||
if(row){
|
||||
s=row[_23.textField];
|
||||
_26=row;
|
||||
var el=_23.finder.getEl(_20,v);
|
||||
if(!el.hasClass("combobox-item-selected")){
|
||||
el.addClass("combobox-item-selected");
|
||||
_23.onSelect.call(_20,row);
|
||||
}
|
||||
}else{
|
||||
s=_27(v,_23.mappingRows)||v;
|
||||
}
|
||||
vv.push(v);
|
||||
ss.push(s);
|
||||
}
|
||||
if(!_22){
|
||||
$(_20).combo("setText",ss.join(_23.separator));
|
||||
}
|
||||
if(_23.showItemIcon){
|
||||
var tb=$(_20).combobox("textbox");
|
||||
tb.removeClass("textbox-bgicon "+_23.textboxIconCls);
|
||||
if(_26&&_26.iconCls){
|
||||
tb.addClass("textbox-bgicon "+_26.iconCls);
|
||||
_23.textboxIconCls=_26.iconCls;
|
||||
}
|
||||
}
|
||||
$(_20).combo("setValues",vv);
|
||||
_24.triggerHandler("scroll");
|
||||
function _27(_28,a){
|
||||
var _29=$.easyui.getArrayItem(a,_23.valueField,_28);
|
||||
return _29?_29[_23.textField]:undefined;
|
||||
};
|
||||
};
|
||||
function _2a(_2b,_2c,_2d){
|
||||
var _2e=$.data(_2b,"combobox");
|
||||
var _2f=_2e.options;
|
||||
_2e.data=_2f.loadFilter.call(_2b,_2c);
|
||||
_2f.view.render.call(_2f.view,_2b,$(_2b).combo("panel"),_2e.data);
|
||||
var vv=$(_2b).combobox("getValues");
|
||||
$.easyui.forEach(_2e.data,false,function(row){
|
||||
if(row["selected"]){
|
||||
$.easyui.addArrayItem(vv,row[_2f.valueField]+"");
|
||||
}
|
||||
});
|
||||
if(_2f.multiple){
|
||||
_19(_2b,vv,_2d);
|
||||
}else{
|
||||
_19(_2b,vv.length?[vv[vv.length-1]]:[],_2d);
|
||||
}
|
||||
_2f.onLoadSuccess.call(_2b,_2c);
|
||||
};
|
||||
function _30(_31,url,_32,_33){
|
||||
var _34=$.data(_31,"combobox").options;
|
||||
if(url){
|
||||
_34.url=url;
|
||||
}
|
||||
_32=$.extend({},_34.queryParams,_32||{});
|
||||
if(_34.onBeforeLoad.call(_31,_32)==false){
|
||||
return;
|
||||
}
|
||||
_34.loader.call(_31,_32,function(_35){
|
||||
_2a(_31,_35,_33);
|
||||
},function(){
|
||||
_34.onLoadError.apply(this,arguments);
|
||||
});
|
||||
};
|
||||
function _36(_37,q){
|
||||
var _38=$.data(_37,"combobox");
|
||||
var _39=_38.options;
|
||||
var _3a=$();
|
||||
var qq=_39.multiple?q.split(_39.separator):[q];
|
||||
if(_39.mode=="remote"){
|
||||
_3b(qq);
|
||||
_30(_37,null,{q:q},true);
|
||||
}else{
|
||||
var _3c=$(_37).combo("panel");
|
||||
_3c.find(".combobox-item-hover").removeClass("combobox-item-hover");
|
||||
_3c.find(".combobox-item,.combobox-group").hide();
|
||||
var _3d=_38.data;
|
||||
var vv=[];
|
||||
$.map(qq,function(q){
|
||||
q=$.trim(q);
|
||||
var _3e=q;
|
||||
var _3f=undefined;
|
||||
_3a=$();
|
||||
for(var i=0;i<_3d.length;i++){
|
||||
var row=_3d[i];
|
||||
if(_39.filter.call(_37,q,row)){
|
||||
var v=row[_39.valueField];
|
||||
var s=row[_39.textField];
|
||||
var g=row[_39.groupField];
|
||||
var _40=_39.finder.getEl(_37,v).show();
|
||||
if(s.toLowerCase()==q.toLowerCase()){
|
||||
_3e=v;
|
||||
if(_39.reversed){
|
||||
_3a=_40;
|
||||
}else{
|
||||
_13(_37,v,true);
|
||||
}
|
||||
}
|
||||
if(_39.groupField&&_3f!=g){
|
||||
_39.finder.getGroupEl(_37,g).show();
|
||||
_3f=g;
|
||||
}
|
||||
}
|
||||
}
|
||||
vv.push(_3e);
|
||||
});
|
||||
_3b(vv);
|
||||
}
|
||||
function _3b(vv){
|
||||
if(_39.reversed){
|
||||
_3a.addClass("combobox-item-hover");
|
||||
}else{
|
||||
_19(_37,_39.multiple?(q?vv:[]):vv,true);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _41(_42){
|
||||
var t=$(_42);
|
||||
var _43=t.combobox("options");
|
||||
var _44=t.combobox("panel");
|
||||
var _45=_44.children("div.combobox-item-hover");
|
||||
if(_45.length){
|
||||
_45.removeClass("combobox-item-hover");
|
||||
var row=_43.finder.getRow(_42,_45);
|
||||
var _46=row[_43.valueField];
|
||||
if(_43.multiple){
|
||||
if(_45.hasClass("combobox-item-selected")){
|
||||
t.combobox("unselect",_46);
|
||||
}else{
|
||||
t.combobox("select",_46);
|
||||
}
|
||||
}else{
|
||||
t.combobox("select",_46);
|
||||
}
|
||||
}
|
||||
var vv=[];
|
||||
$.map(t.combobox("getValues"),function(v){
|
||||
if(_1(_42,v)>=0){
|
||||
vv.push(v);
|
||||
}
|
||||
});
|
||||
t.combobox("setValues",vv);
|
||||
if(!_43.multiple){
|
||||
t.combobox("hidePanel");
|
||||
}
|
||||
};
|
||||
function _47(_48){
|
||||
var _49=$.data(_48,"combobox");
|
||||
var _4a=_49.options;
|
||||
$(_48).addClass("combobox-f");
|
||||
$(_48).combo($.extend({},_4a,{onShowPanel:function(){
|
||||
$(this).combo("panel").find("div.combobox-item:hidden,div.combobox-group:hidden").show();
|
||||
_19(this,$(this).combobox("getValues"),true);
|
||||
$(this).combobox("scrollTo",$(this).combobox("getValue"));
|
||||
_4a.onShowPanel.call(this);
|
||||
}}));
|
||||
};
|
||||
function _4b(e){
|
||||
$(this).children("div.combobox-item-hover").removeClass("combobox-item-hover");
|
||||
var _4c=$(e.target).closest("div.combobox-item");
|
||||
if(!_4c.hasClass("combobox-item-disabled")){
|
||||
_4c.addClass("combobox-item-hover");
|
||||
}
|
||||
e.stopPropagation();
|
||||
};
|
||||
function _4d(e){
|
||||
$(e.target).closest("div.combobox-item").removeClass("combobox-item-hover");
|
||||
e.stopPropagation();
|
||||
};
|
||||
function _4e(e){
|
||||
var _4f=$(this).panel("options").comboTarget;
|
||||
if(!_4f){
|
||||
return;
|
||||
}
|
||||
var _50=$(_4f).combobox("options");
|
||||
var _51=$(e.target).closest("div.combobox-item");
|
||||
if(!_51.length||_51.hasClass("combobox-item-disabled")){
|
||||
return;
|
||||
}
|
||||
var row=_50.finder.getRow(_4f,_51);
|
||||
if(!row){
|
||||
return;
|
||||
}
|
||||
if(_50.blurTimer){
|
||||
clearTimeout(_50.blurTimer);
|
||||
_50.blurTimer=null;
|
||||
}
|
||||
_50.onClick.call(_4f,row);
|
||||
var _52=row[_50.valueField];
|
||||
if(_50.multiple){
|
||||
if(_51.hasClass("combobox-item-selected")){
|
||||
_1a(_4f,_52);
|
||||
}else{
|
||||
_13(_4f,_52);
|
||||
}
|
||||
}else{
|
||||
$(_4f).combobox("setValue",_52).combobox("hidePanel");
|
||||
}
|
||||
e.stopPropagation();
|
||||
};
|
||||
function _53(e){
|
||||
var _54=$(this).panel("options").comboTarget;
|
||||
if(!_54){
|
||||
return;
|
||||
}
|
||||
var _55=$(_54).combobox("options");
|
||||
if(_55.groupPosition=="sticky"){
|
||||
var _56=$(this).children(".combobox-stick");
|
||||
if(!_56.length){
|
||||
_56=$("<div class=\"combobox-stick\"></div>").appendTo(this);
|
||||
}
|
||||
_56.hide();
|
||||
var _57=$(_54).data("combobox");
|
||||
$(this).children(".combobox-group:visible").each(function(){
|
||||
var g=$(this);
|
||||
var _58=_55.finder.getGroup(_54,g);
|
||||
var _59=_57.data[_58.startIndex+_58.count-1];
|
||||
var _5a=_55.finder.getEl(_54,_59[_55.valueField]);
|
||||
if(g.position().top<0&&_5a.position().top>0){
|
||||
_56.show().html(g.html());
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$.fn.combobox=function(_5b,_5c){
|
||||
if(typeof _5b=="string"){
|
||||
var _5d=$.fn.combobox.methods[_5b];
|
||||
if(_5d){
|
||||
return _5d(this,_5c);
|
||||
}else{
|
||||
return this.combo(_5b,_5c);
|
||||
}
|
||||
}
|
||||
_5b=_5b||{};
|
||||
return this.each(function(){
|
||||
var _5e=$.data(this,"combobox");
|
||||
if(_5e){
|
||||
$.extend(_5e.options,_5b);
|
||||
}else{
|
||||
_5e=$.data(this,"combobox",{options:$.extend({},$.fn.combobox.defaults,$.fn.combobox.parseOptions(this),_5b),data:[]});
|
||||
}
|
||||
_47(this);
|
||||
if(_5e.options.data){
|
||||
_2a(this,_5e.options.data);
|
||||
}else{
|
||||
var _5f=$.fn.combobox.parseData(this);
|
||||
if(_5f.length){
|
||||
_2a(this,_5f);
|
||||
}
|
||||
}
|
||||
_30(this);
|
||||
});
|
||||
};
|
||||
$.fn.combobox.methods={options:function(jq){
|
||||
var _60=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"combobox").options,{width:_60.width,height:_60.height,originalValue:_60.originalValue,disabled:_60.disabled,readonly:_60.readonly});
|
||||
},cloneFrom:function(jq,_61){
|
||||
return jq.each(function(){
|
||||
$(this).combo("cloneFrom",_61);
|
||||
$.data(this,"combobox",$(_61).data("combobox"));
|
||||
$(this).addClass("combobox-f").attr("comboboxName",$(this).attr("textboxName"));
|
||||
});
|
||||
},getData:function(jq){
|
||||
return $.data(jq[0],"combobox").data;
|
||||
},setValues:function(jq,_62){
|
||||
return jq.each(function(){
|
||||
var _63=$(this).combobox("options");
|
||||
if($.isArray(_62)){
|
||||
_62=$.map(_62,function(_64){
|
||||
if(_64&&typeof _64=="object"){
|
||||
$.easyui.addArrayItem(_63.mappingRows,_63.valueField,_64);
|
||||
return _64[_63.valueField];
|
||||
}else{
|
||||
return _64;
|
||||
}
|
||||
});
|
||||
}
|
||||
_19(this,_62);
|
||||
});
|
||||
},setValue:function(jq,_65){
|
||||
return jq.each(function(){
|
||||
$(this).combobox("setValues",$.isArray(_65)?_65:[_65]);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_19(this,[]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _66=$(this).combobox("options");
|
||||
if(_66.multiple){
|
||||
$(this).combobox("setValues",_66.originalValue);
|
||||
}else{
|
||||
$(this).combobox("setValue",_66.originalValue);
|
||||
}
|
||||
});
|
||||
},loadData:function(jq,_67){
|
||||
return jq.each(function(){
|
||||
_2a(this,_67);
|
||||
});
|
||||
},reload:function(jq,url){
|
||||
return jq.each(function(){
|
||||
if(typeof url=="string"){
|
||||
_30(this,url);
|
||||
}else{
|
||||
if(url){
|
||||
var _68=$(this).combobox("options");
|
||||
_68.queryParams=url;
|
||||
}
|
||||
_30(this);
|
||||
}
|
||||
});
|
||||
},select:function(jq,_69){
|
||||
return jq.each(function(){
|
||||
_13(this,_69);
|
||||
});
|
||||
},unselect:function(jq,_6a){
|
||||
return jq.each(function(){
|
||||
_1a(this,_6a);
|
||||
});
|
||||
},scrollTo:function(jq,_6b){
|
||||
return jq.each(function(){
|
||||
_5(this,_6b);
|
||||
});
|
||||
}};
|
||||
$.fn.combobox.parseOptions=function(_6c){
|
||||
var t=$(_6c);
|
||||
return $.extend({},$.fn.combo.parseOptions(_6c),$.parser.parseOptions(_6c,["valueField","textField","groupField","groupPosition","mode","method","url",{showItemIcon:"boolean",limitToList:"boolean"}]));
|
||||
};
|
||||
$.fn.combobox.parseData=function(_6d){
|
||||
var _6e=[];
|
||||
var _6f=$(_6d).combobox("options");
|
||||
$(_6d).children().each(function(){
|
||||
if(this.tagName.toLowerCase()=="optgroup"){
|
||||
var _70=$(this).attr("label");
|
||||
$(this).children().each(function(){
|
||||
_71(this,_70);
|
||||
});
|
||||
}else{
|
||||
_71(this);
|
||||
}
|
||||
});
|
||||
return _6e;
|
||||
function _71(el,_72){
|
||||
var t=$(el);
|
||||
var row={};
|
||||
row[_6f.valueField]=t.attr("value")!=undefined?t.attr("value"):t.text();
|
||||
row[_6f.textField]=t.text();
|
||||
row["iconCls"]=$.parser.parseOptions(el,["iconCls"]).iconCls;
|
||||
row["selected"]=t.is(":selected");
|
||||
row["disabled"]=t.is(":disabled");
|
||||
if(_72){
|
||||
_6f.groupField=_6f.groupField||"group";
|
||||
row[_6f.groupField]=_72;
|
||||
}
|
||||
_6e.push(row);
|
||||
};
|
||||
};
|
||||
var _73=0;
|
||||
var _74={render:function(_75,_76,_77){
|
||||
var _78=$.data(_75,"combobox");
|
||||
var _79=_78.options;
|
||||
var _7a=$(_75).attr("id")||"";
|
||||
_73++;
|
||||
_78.itemIdPrefix=_7a+"_easyui_combobox_i"+_73;
|
||||
_78.groupIdPrefix=_7a+"_easyui_combobox_g"+_73;
|
||||
_78.groups=[];
|
||||
var dd=[];
|
||||
var _7b=undefined;
|
||||
for(var i=0;i<_77.length;i++){
|
||||
var row=_77[i];
|
||||
var v=row[_79.valueField]+"";
|
||||
var s=row[_79.textField];
|
||||
var g=row[_79.groupField];
|
||||
if(g){
|
||||
if(_7b!=g){
|
||||
_7b=g;
|
||||
_78.groups.push({value:g,startIndex:i,count:1});
|
||||
dd.push("<div id=\""+(_78.groupIdPrefix+"_"+(_78.groups.length-1))+"\" class=\"combobox-group\">");
|
||||
dd.push(_79.groupFormatter?_79.groupFormatter.call(_75,g):g);
|
||||
dd.push("</div>");
|
||||
}else{
|
||||
_78.groups[_78.groups.length-1].count++;
|
||||
}
|
||||
}else{
|
||||
_7b=undefined;
|
||||
}
|
||||
var cls="combobox-item"+(row.disabled?" combobox-item-disabled":"")+(g?" combobox-gitem":"");
|
||||
dd.push("<div id=\""+(_78.itemIdPrefix+"_"+i)+"\" class=\""+cls+"\">");
|
||||
if(_79.showItemIcon&&row.iconCls){
|
||||
dd.push("<span class=\"combobox-icon "+row.iconCls+"\"></span>");
|
||||
}
|
||||
dd.push(_79.formatter?_79.formatter.call(_75,row):s);
|
||||
dd.push("</div>");
|
||||
}
|
||||
$(_76).html(dd.join(""));
|
||||
}};
|
||||
$.fn.combobox.defaults=$.extend({},$.fn.combo.defaults,{valueField:"value",textField:"text",groupPosition:"static",groupField:null,groupFormatter:function(_7c){
|
||||
return _7c;
|
||||
},mode:"local",method:"post",url:null,data:null,queryParams:{},showItemIcon:false,limitToList:false,unselectedValues:[],mappingRows:[],view:_74,keyHandler:{up:function(e){
|
||||
_b(this,"prev");
|
||||
e.preventDefault();
|
||||
},down:function(e){
|
||||
_b(this,"next");
|
||||
e.preventDefault();
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_41(this);
|
||||
},query:function(q,e){
|
||||
_36(this,q);
|
||||
}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){
|
||||
$.fn.combo.defaults.inputEvents.blur(e);
|
||||
var _7d=e.data.target;
|
||||
var _7e=$(_7d).combobox("options");
|
||||
if(_7e.reversed||_7e.limitToList){
|
||||
if(_7e.blurTimer){
|
||||
clearTimeout(_7e.blurTimer);
|
||||
}
|
||||
_7e.blurTimer=setTimeout(function(){
|
||||
var _7f=$(_7d).parent().length;
|
||||
if(_7f){
|
||||
if(_7e.reversed){
|
||||
$(_7d).combobox("setValues",$(_7d).combobox("getValues"));
|
||||
}else{
|
||||
if(_7e.limitToList){
|
||||
var vv=[];
|
||||
$.map($(_7d).combobox("getValues"),function(v){
|
||||
var _80=$.easyui.indexOfArray($(_7d).combobox("getData"),_7e.valueField,v);
|
||||
if(_80>=0){
|
||||
vv.push(v);
|
||||
}
|
||||
});
|
||||
$(_7d).combobox("setValues",vv);
|
||||
}
|
||||
}
|
||||
_7e.blurTimer=null;
|
||||
}
|
||||
},50);
|
||||
}
|
||||
}}),panelEvents:{mouseover:_4b,mouseout:_4d,mousedown:function(e){
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
},click:_4e,scroll:_53},filter:function(q,row){
|
||||
var _81=$(this).combobox("options");
|
||||
return row[_81.textField].toLowerCase().indexOf(q.toLowerCase())>=0;
|
||||
},formatter:function(row){
|
||||
var _82=$(this).combobox("options");
|
||||
return row[_82.textField];
|
||||
},loader:function(_83,_84,_85){
|
||||
var _86=$(this).combobox("options");
|
||||
if(!_86.url){
|
||||
return false;
|
||||
}
|
||||
$.ajax({type:_86.method,url:_86.url,data:_83,dataType:"json",success:function(_87){
|
||||
_84(_87);
|
||||
},error:function(){
|
||||
_85.apply(this,arguments);
|
||||
}});
|
||||
},loadFilter:function(_88){
|
||||
return _88;
|
||||
},finder:{getEl:function(_89,_8a){
|
||||
var _8b=_1(_89,_8a);
|
||||
var id=$.data(_89,"combobox").itemIdPrefix+"_"+_8b;
|
||||
return $("#"+id);
|
||||
},getGroupEl:function(_8c,_8d){
|
||||
var _8e=$.data(_8c,"combobox");
|
||||
var _8f=$.easyui.indexOfArray(_8e.groups,"value",_8d);
|
||||
var id=_8e.groupIdPrefix+"_"+_8f;
|
||||
return $("#"+id);
|
||||
},getGroup:function(_90,p){
|
||||
var _91=$.data(_90,"combobox");
|
||||
var _92=p.attr("id").substr(_91.groupIdPrefix.length+1);
|
||||
return _91.groups[parseInt(_92)];
|
||||
},getRow:function(_93,p){
|
||||
var _94=$.data(_93,"combobox");
|
||||
var _95=(p instanceof $)?p.attr("id").substr(_94.itemIdPrefix.length+1):_1(_93,p);
|
||||
return _94.data[parseInt(_95)];
|
||||
}},onBeforeLoad:function(_96){
|
||||
},onLoadSuccess:function(_97){
|
||||
},onLoadError:function(){
|
||||
},onSelect:function(_98){
|
||||
},onUnselect:function(_99){
|
||||
},onClick:function(_9a){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
353
static/jeasyui/plugins/jquery.combogrid.js
Executable file
353
static/jeasyui/plugins/jquery.combogrid.js
Executable file
@@ -0,0 +1,353 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"combogrid");
|
||||
var _4=_3.options;
|
||||
var _5=_3.grid;
|
||||
$(_2).addClass("combogrid-f").combo($.extend({},_4,{onShowPanel:function(){
|
||||
_22(this,$(this).combogrid("getValues"),true);
|
||||
var p=$(this).combogrid("panel");
|
||||
var _6=p.outerHeight()-p.height();
|
||||
var _7=p._size("minHeight");
|
||||
var _8=p._size("maxHeight");
|
||||
var dg=$(this).combogrid("grid");
|
||||
dg.datagrid("resize",{width:"100%",height:(isNaN(parseInt(_4.panelHeight))?"auto":"100%"),minHeight:(_7?_7-_6:""),maxHeight:(_8?_8-_6:"")});
|
||||
var _9=dg.datagrid("getSelected");
|
||||
if(_9){
|
||||
dg.datagrid("scrollTo",dg.datagrid("getRowIndex",_9));
|
||||
}
|
||||
_4.onShowPanel.call(this);
|
||||
}}));
|
||||
var _a=$(_2).combo("panel");
|
||||
if(!_5){
|
||||
_5=$("<table></table>").appendTo(_a);
|
||||
_3.grid=_5;
|
||||
}
|
||||
_5.datagrid($.extend({},_4,{border:false,singleSelect:(!_4.multiple),onLoadSuccess:_b,onClickRow:_c,onSelect:_d("onSelect"),onUnselect:_d("onUnselect"),onSelectAll:_d("onSelectAll"),onUnselectAll:_d("onUnselectAll")}));
|
||||
function _e(dg){
|
||||
return $(dg).closest(".combo-panel").panel("options").comboTarget||_2;
|
||||
};
|
||||
function _b(_f){
|
||||
var _10=_e(this);
|
||||
var _11=$(_10).data("combogrid");
|
||||
var _12=_11.options;
|
||||
var _13=$(_10).combo("getValues");
|
||||
_22(_10,_13,_11.remainText);
|
||||
_12.onLoadSuccess.call(this,_f);
|
||||
};
|
||||
function _c(_14,row){
|
||||
var _15=_e(this);
|
||||
var _16=$(_15).data("combogrid");
|
||||
var _17=_16.options;
|
||||
_16.remainText=false;
|
||||
_18.call(this);
|
||||
if(!_17.multiple){
|
||||
$(_15).combo("hidePanel");
|
||||
}
|
||||
_17.onClickRow.call(this,_14,row);
|
||||
};
|
||||
function _d(_19){
|
||||
return function(_1a,row){
|
||||
var _1b=_e(this);
|
||||
var _1c=$(_1b).combogrid("options");
|
||||
if(_19=="onUnselectAll"){
|
||||
if(_1c.multiple){
|
||||
_18.call(this);
|
||||
}
|
||||
}else{
|
||||
_18.call(this);
|
||||
}
|
||||
_1c[_19].call(this,_1a,row);
|
||||
};
|
||||
};
|
||||
function _18(){
|
||||
var dg=$(this);
|
||||
var _1d=_e(dg);
|
||||
var _1e=$(_1d).data("combogrid");
|
||||
var _1f=_1e.options;
|
||||
var vv=$.map(dg.datagrid("getSelections"),function(row){
|
||||
return row[_1f.idField];
|
||||
});
|
||||
vv=vv.concat(_1f.unselectedValues);
|
||||
var _20=dg.data("datagrid").dc.body2;
|
||||
var _21=_20.scrollTop();
|
||||
_22(_1d,vv,_1e.remainText);
|
||||
_20.scrollTop(_21);
|
||||
};
|
||||
};
|
||||
function nav(_23,dir){
|
||||
var _24=$.data(_23,"combogrid");
|
||||
var _25=_24.options;
|
||||
var _26=_24.grid;
|
||||
var _27=_26.datagrid("getRows").length;
|
||||
if(!_27){
|
||||
return;
|
||||
}
|
||||
var tr=_25.finder.getTr(_26[0],null,"highlight");
|
||||
if(!tr.length){
|
||||
tr=_25.finder.getTr(_26[0],null,"selected");
|
||||
}
|
||||
var _28;
|
||||
if(!tr.length){
|
||||
_28=(dir=="next"?0:_27-1);
|
||||
}else{
|
||||
var _28=parseInt(tr.attr("datagrid-row-index"));
|
||||
_28+=(dir=="next"?1:-1);
|
||||
if(_28<0){
|
||||
_28=_27-1;
|
||||
}
|
||||
if(_28>=_27){
|
||||
_28=0;
|
||||
}
|
||||
}
|
||||
_26.datagrid("highlightRow",_28);
|
||||
if(_25.selectOnNavigation){
|
||||
_24.remainText=false;
|
||||
_26.datagrid("selectRow",_28);
|
||||
}
|
||||
};
|
||||
function _22(_29,_2a,_2b){
|
||||
var _2c=$.data(_29,"combogrid");
|
||||
var _2d=_2c.options;
|
||||
var _2e=_2c.grid;
|
||||
var _2f=$(_29).combo("getValues");
|
||||
var _30=$(_29).combo("options");
|
||||
var _31=_30.onChange;
|
||||
_30.onChange=function(){
|
||||
};
|
||||
var _32=_2e.datagrid("options");
|
||||
var _33=_32.onSelect;
|
||||
var _34=_32.onUnselectAll;
|
||||
_32.onSelect=_32.onUnselectAll=function(){
|
||||
};
|
||||
if(!$.isArray(_2a)){
|
||||
_2a=_2a.split(_2d.separator);
|
||||
}
|
||||
if(!_2d.multiple){
|
||||
_2a=_2a.length?[_2a[0]]:[""];
|
||||
}
|
||||
var vv=$.map(_2a,function(_35){
|
||||
return String(_35);
|
||||
});
|
||||
vv=$.grep(vv,function(v,_36){
|
||||
return _36===$.inArray(v,vv);
|
||||
});
|
||||
var _37=$.grep(_2e.datagrid("getSelections"),function(row,_38){
|
||||
return $.inArray(String(row[_2d.idField]),vv)>=0;
|
||||
});
|
||||
_2e.datagrid("clearSelections");
|
||||
_2e.data("datagrid").selectedRows=_37;
|
||||
var ss=[];
|
||||
_2d.unselectedValues=[];
|
||||
$.map(vv,function(v){
|
||||
var _39=_2e.datagrid("getRowIndex",v);
|
||||
if(_39>=0){
|
||||
_2e.datagrid("selectRow",_39);
|
||||
}else{
|
||||
if($.easyui.indexOfArray(_37,_2d.idField,v)==-1){
|
||||
_2d.unselectedValues.push(v);
|
||||
}
|
||||
}
|
||||
ss.push(_3a(v,_2e.datagrid("getRows"))||_3a(v,_37)||_3a(v,_2d.mappingRows)||v);
|
||||
});
|
||||
$(_29).combo("setValues",_2f);
|
||||
_30.onChange=_31;
|
||||
_32.onSelect=_33;
|
||||
_32.onUnselectAll=_34;
|
||||
if(!_2b){
|
||||
var s=ss.join(_2d.separator);
|
||||
if($(_29).combo("getText")!=s){
|
||||
$(_29).combo("setText",s);
|
||||
}
|
||||
}
|
||||
$(_29).combo("setValues",_2a);
|
||||
function _3a(_3b,a){
|
||||
var _3c=$.easyui.getArrayItem(a,_2d.idField,_3b);
|
||||
return _3c?_3c[_2d.textField]:undefined;
|
||||
};
|
||||
};
|
||||
function _3d(_3e,q){
|
||||
var _3f=$.data(_3e,"combogrid");
|
||||
var _40=_3f.options;
|
||||
var _41=_3f.grid;
|
||||
_3f.remainText=true;
|
||||
var qq=_40.multiple?q.split(_40.separator):[q];
|
||||
qq=$.grep(qq,function(q){
|
||||
return $.trim(q)!="";
|
||||
});
|
||||
if(_40.mode=="remote"){
|
||||
_42(qq);
|
||||
_41.datagrid("load",$.extend({},_40.queryParams,{q:q}));
|
||||
}else{
|
||||
_41.datagrid("highlightRow",-1);
|
||||
var _43=_41.datagrid("getRows");
|
||||
var vv=[];
|
||||
$.map(qq,function(q){
|
||||
q=$.trim(q);
|
||||
var _44=q;
|
||||
_45(_40.mappingRows,q);
|
||||
_45(_41.datagrid("getSelections"),q);
|
||||
var _46=_45(_43,q);
|
||||
if(_46>=0){
|
||||
if(_40.reversed){
|
||||
_41.datagrid("highlightRow",_46);
|
||||
}
|
||||
}else{
|
||||
$.map(_43,function(row,i){
|
||||
if(_40.filter.call(_3e,q,row)){
|
||||
_41.datagrid("highlightRow",i);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
_42(vv);
|
||||
}
|
||||
function _45(_47,q){
|
||||
for(var i=0;i<_47.length;i++){
|
||||
var row=_47[i];
|
||||
if((row[_40.textField]||"").toLowerCase()==q.toLowerCase()){
|
||||
vv.push(row[_40.idField]);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
function _42(vv){
|
||||
if(!_40.reversed){
|
||||
_22(_3e,vv,true);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _48(_49){
|
||||
var _4a=$.data(_49,"combogrid");
|
||||
var _4b=_4a.options;
|
||||
var _4c=_4a.grid;
|
||||
var tr=_4b.finder.getTr(_4c[0],null,"highlight");
|
||||
_4a.remainText=false;
|
||||
if(tr.length){
|
||||
var _4d=parseInt(tr.attr("datagrid-row-index"));
|
||||
if(_4b.multiple){
|
||||
if(tr.hasClass("datagrid-row-selected")){
|
||||
_4c.datagrid("unselectRow",_4d);
|
||||
}else{
|
||||
_4c.datagrid("selectRow",_4d);
|
||||
}
|
||||
}else{
|
||||
_4c.datagrid("selectRow",_4d);
|
||||
}
|
||||
}
|
||||
var vv=[];
|
||||
$.map(_4c.datagrid("getSelections"),function(row){
|
||||
vv.push(row[_4b.idField]);
|
||||
});
|
||||
$.map(_4b.unselectedValues,function(v){
|
||||
if($.easyui.indexOfArray(_4b.mappingRows,_4b.idField,v)>=0){
|
||||
$.easyui.addArrayItem(vv,v);
|
||||
}
|
||||
});
|
||||
$(_49).combogrid("setValues",vv);
|
||||
if(!_4b.multiple){
|
||||
$(_49).combogrid("hidePanel");
|
||||
}
|
||||
};
|
||||
$.fn.combogrid=function(_4e,_4f){
|
||||
if(typeof _4e=="string"){
|
||||
var _50=$.fn.combogrid.methods[_4e];
|
||||
if(_50){
|
||||
return _50(this,_4f);
|
||||
}else{
|
||||
return this.combo(_4e,_4f);
|
||||
}
|
||||
}
|
||||
_4e=_4e||{};
|
||||
return this.each(function(){
|
||||
var _51=$.data(this,"combogrid");
|
||||
if(_51){
|
||||
$.extend(_51.options,_4e);
|
||||
}else{
|
||||
_51=$.data(this,"combogrid",{options:$.extend({},$.fn.combogrid.defaults,$.fn.combogrid.parseOptions(this),_4e)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.combogrid.methods={options:function(jq){
|
||||
var _52=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"combogrid").options,{width:_52.width,height:_52.height,originalValue:_52.originalValue,disabled:_52.disabled,readonly:_52.readonly});
|
||||
},cloneFrom:function(jq,_53){
|
||||
return jq.each(function(){
|
||||
$(this).combo("cloneFrom",_53);
|
||||
$.data(this,"combogrid",{options:$.extend(true,{cloned:true},$(_53).combogrid("options")),combo:$(this).next(),panel:$(_53).combo("panel"),grid:$(_53).combogrid("grid")});
|
||||
});
|
||||
},grid:function(jq){
|
||||
return $.data(jq[0],"combogrid").grid;
|
||||
},setValues:function(jq,_54){
|
||||
return jq.each(function(){
|
||||
var _55=$(this).combogrid("options");
|
||||
if($.isArray(_54)){
|
||||
_54=$.map(_54,function(_56){
|
||||
if(_56&&typeof _56=="object"){
|
||||
$.easyui.addArrayItem(_55.mappingRows,_55.idField,_56);
|
||||
return _56[_55.idField];
|
||||
}else{
|
||||
return _56;
|
||||
}
|
||||
});
|
||||
}
|
||||
_22(this,_54);
|
||||
});
|
||||
},setValue:function(jq,_57){
|
||||
return jq.each(function(){
|
||||
$(this).combogrid("setValues",$.isArray(_57)?_57:[_57]);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).combogrid("setValues",[]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _58=$(this).combogrid("options");
|
||||
if(_58.multiple){
|
||||
$(this).combogrid("setValues",_58.originalValue);
|
||||
}else{
|
||||
$(this).combogrid("setValue",_58.originalValue);
|
||||
}
|
||||
});
|
||||
}};
|
||||
$.fn.combogrid.parseOptions=function(_59){
|
||||
var t=$(_59);
|
||||
return $.extend({},$.fn.combo.parseOptions(_59),$.fn.datagrid.parseOptions(_59),$.parser.parseOptions(_59,["idField","textField","mode"]));
|
||||
};
|
||||
$.fn.combogrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.datagrid.defaults,{loadMsg:null,idField:null,textField:null,unselectedValues:[],mappingRows:[],mode:"local",keyHandler:{up:function(e){
|
||||
nav(this,"prev");
|
||||
e.preventDefault();
|
||||
},down:function(e){
|
||||
nav(this,"next");
|
||||
e.preventDefault();
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_48(this);
|
||||
},query:function(q,e){
|
||||
_3d(this,q);
|
||||
}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){
|
||||
$.fn.combo.defaults.inputEvents.blur(e);
|
||||
var _5a=e.data.target;
|
||||
var _5b=$(_5a).combogrid("options");
|
||||
if(_5b.reversed){
|
||||
$(_5a).combogrid("setValues",$(_5a).combogrid("getValues"));
|
||||
}
|
||||
}}),panelEvents:{mousedown:function(e){
|
||||
}},filter:function(q,row){
|
||||
var _5c=$(this).combogrid("options");
|
||||
return (row[_5c.textField]||"").toLowerCase().indexOf(q.toLowerCase())>=0;
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
239
static/jeasyui/plugins/jquery.combotree.js
Executable file
239
static/jeasyui/plugins/jquery.combotree.js
Executable file
@@ -0,0 +1,239 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"combotree");
|
||||
var _4=_3.options;
|
||||
var _5=_3.tree;
|
||||
$(_2).addClass("combotree-f");
|
||||
$(_2).combo($.extend({},_4,{onShowPanel:function(){
|
||||
if(_4.editable){
|
||||
_5.tree("doFilter","");
|
||||
}
|
||||
_4.onShowPanel.call(this);
|
||||
}}));
|
||||
var _6=$(_2).combo("panel");
|
||||
if(!_5){
|
||||
_5=$("<ul></ul>").appendTo(_6);
|
||||
_3.tree=_5;
|
||||
}
|
||||
_5.tree($.extend({},_4,{checkbox:_4.multiple,onLoadSuccess:function(_7,_8){
|
||||
var _9=$(_2).combotree("getValues");
|
||||
if(_4.multiple){
|
||||
$.map(_5.tree("getChecked"),function(_a){
|
||||
$.easyui.addArrayItem(_9,_a.id);
|
||||
});
|
||||
}
|
||||
_15(_2,_9,_3.remainText);
|
||||
_4.onLoadSuccess.call(this,_7,_8);
|
||||
},onClick:function(_b){
|
||||
if(_4.multiple){
|
||||
$(this).tree(_b.checked?"uncheck":"check",_b.target);
|
||||
}else{
|
||||
$(_2).combo("hidePanel");
|
||||
}
|
||||
_3.remainText=false;
|
||||
_e(_2);
|
||||
_4.onClick.call(this,_b);
|
||||
},onCheck:function(_c,_d){
|
||||
_3.remainText=false;
|
||||
_e(_2);
|
||||
_4.onCheck.call(this,_c,_d);
|
||||
}}));
|
||||
};
|
||||
function _e(_f){
|
||||
var _10=$.data(_f,"combotree");
|
||||
var _11=_10.options;
|
||||
var _12=_10.tree;
|
||||
var vv=[];
|
||||
if(_11.multiple){
|
||||
vv=$.map(_12.tree("getChecked"),function(_13){
|
||||
return _13.id;
|
||||
});
|
||||
}else{
|
||||
var _14=_12.tree("getSelected");
|
||||
if(_14){
|
||||
vv.push(_14.id);
|
||||
}
|
||||
}
|
||||
vv=vv.concat(_11.unselectedValues);
|
||||
_15(_f,vv,_10.remainText);
|
||||
};
|
||||
function _15(_16,_17,_18){
|
||||
var _19=$.data(_16,"combotree");
|
||||
var _1a=_19.options;
|
||||
var _1b=_19.tree;
|
||||
var _1c=_1b.tree("options");
|
||||
var _1d=_1c.onBeforeCheck;
|
||||
var _1e=_1c.onCheck;
|
||||
var _1f=_1c.onBeforeSelect;
|
||||
var _20=_1c.onSelect;
|
||||
_1c.onBeforeCheck=_1c.onCheck=_1c.onBeforeSelect=_1c.onSelect=function(){
|
||||
};
|
||||
if(!$.isArray(_17)){
|
||||
_17=_17.split(_1a.separator);
|
||||
}
|
||||
if(!_1a.multiple){
|
||||
_17=_17.length?[_17[0]]:[""];
|
||||
}
|
||||
var vv=$.map(_17,function(_21){
|
||||
return String(_21);
|
||||
});
|
||||
_1b.find("div.tree-node-selected").removeClass("tree-node-selected");
|
||||
$.map(_1b.tree("getChecked"),function(_22){
|
||||
if($.inArray(String(_22.id),vv)==-1){
|
||||
_1b.tree("uncheck",_22.target);
|
||||
}
|
||||
});
|
||||
var ss=[];
|
||||
_1a.unselectedValues=[];
|
||||
$.map(vv,function(v){
|
||||
var _23=_1b.tree("find",v);
|
||||
if(_23){
|
||||
_1b.tree("check",_23.target).tree("select",_23.target);
|
||||
ss.push(_24(_23));
|
||||
}else{
|
||||
ss.push(_25(v,_1a.mappingRows)||v);
|
||||
_1a.unselectedValues.push(v);
|
||||
}
|
||||
});
|
||||
if(_1a.multiple){
|
||||
$.map(_1b.tree("getChecked"),function(_26){
|
||||
var id=String(_26.id);
|
||||
if($.inArray(id,vv)==-1){
|
||||
vv.push(id);
|
||||
ss.push(_24(_26));
|
||||
}
|
||||
});
|
||||
}
|
||||
_1c.onBeforeCheck=_1d;
|
||||
_1c.onCheck=_1e;
|
||||
_1c.onBeforeSelect=_1f;
|
||||
_1c.onSelect=_20;
|
||||
if(!_18){
|
||||
var s=ss.join(_1a.separator);
|
||||
if($(_16).combo("getText")!=s){
|
||||
$(_16).combo("setText",s);
|
||||
}
|
||||
}
|
||||
$(_16).combo("setValues",vv);
|
||||
function _25(_27,a){
|
||||
var _28=$.easyui.getArrayItem(a,"id",_27);
|
||||
return _28?_24(_28):undefined;
|
||||
};
|
||||
function _24(_29){
|
||||
return _29[_1a.textField||""]||_29.text;
|
||||
};
|
||||
};
|
||||
function _2a(_2b,q){
|
||||
var _2c=$.data(_2b,"combotree");
|
||||
var _2d=_2c.options;
|
||||
var _2e=_2c.tree;
|
||||
_2c.remainText=true;
|
||||
_2e.tree("doFilter",_2d.multiple?q.split(_2d.separator):q);
|
||||
};
|
||||
function _2f(_30){
|
||||
var _31=$.data(_30,"combotree");
|
||||
_31.remainText=false;
|
||||
$(_30).combotree("setValues",$(_30).combotree("getValues"));
|
||||
$(_30).combotree("hidePanel");
|
||||
};
|
||||
$.fn.combotree=function(_32,_33){
|
||||
if(typeof _32=="string"){
|
||||
var _34=$.fn.combotree.methods[_32];
|
||||
if(_34){
|
||||
return _34(this,_33);
|
||||
}else{
|
||||
return this.combo(_32,_33);
|
||||
}
|
||||
}
|
||||
_32=_32||{};
|
||||
return this.each(function(){
|
||||
var _35=$.data(this,"combotree");
|
||||
if(_35){
|
||||
$.extend(_35.options,_32);
|
||||
}else{
|
||||
$.data(this,"combotree",{options:$.extend({},$.fn.combotree.defaults,$.fn.combotree.parseOptions(this),_32)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.combotree.methods={options:function(jq){
|
||||
var _36=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"combotree").options,{width:_36.width,height:_36.height,originalValue:_36.originalValue,disabled:_36.disabled,readonly:_36.readonly});
|
||||
},clone:function(jq,_37){
|
||||
var t=jq.combo("clone",_37);
|
||||
t.data("combotree",{options:$.extend(true,{},jq.combotree("options")),tree:jq.combotree("tree")});
|
||||
return t;
|
||||
},tree:function(jq){
|
||||
return $.data(jq[0],"combotree").tree;
|
||||
},loadData:function(jq,_38){
|
||||
return jq.each(function(){
|
||||
var _39=$.data(this,"combotree").options;
|
||||
_39.data=_38;
|
||||
var _3a=$.data(this,"combotree").tree;
|
||||
_3a.tree("loadData",_38);
|
||||
});
|
||||
},reload:function(jq,url){
|
||||
return jq.each(function(){
|
||||
var _3b=$.data(this,"combotree").options;
|
||||
var _3c=$.data(this,"combotree").tree;
|
||||
if(url){
|
||||
_3b.url=url;
|
||||
}
|
||||
_3c.tree({url:_3b.url});
|
||||
});
|
||||
},setValues:function(jq,_3d){
|
||||
return jq.each(function(){
|
||||
var _3e=$(this).combotree("options");
|
||||
if($.isArray(_3d)){
|
||||
_3d=$.map(_3d,function(_3f){
|
||||
if(_3f&&typeof _3f=="object"){
|
||||
$.easyui.addArrayItem(_3e.mappingRows,"id",_3f);
|
||||
return _3f.id;
|
||||
}else{
|
||||
return _3f;
|
||||
}
|
||||
});
|
||||
}
|
||||
_15(this,_3d);
|
||||
});
|
||||
},setValue:function(jq,_40){
|
||||
return jq.each(function(){
|
||||
$(this).combotree("setValues",$.isArray(_40)?_40:[_40]);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).combotree("setValues",[]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _41=$(this).combotree("options");
|
||||
if(_41.multiple){
|
||||
$(this).combotree("setValues",_41.originalValue);
|
||||
}else{
|
||||
$(this).combotree("setValue",_41.originalValue);
|
||||
}
|
||||
});
|
||||
}};
|
||||
$.fn.combotree.parseOptions=function(_42){
|
||||
return $.extend({},$.fn.combo.parseOptions(_42),$.fn.tree.parseOptions(_42));
|
||||
};
|
||||
$.fn.combotree.defaults=$.extend({},$.fn.combo.defaults,$.fn.tree.defaults,{editable:false,textField:null,unselectedValues:[],mappingRows:[],keyHandler:{up:function(e){
|
||||
},down:function(e){
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_2f(this);
|
||||
},query:function(q,e){
|
||||
_2a(this,q);
|
||||
}}});
|
||||
})(jQuery);
|
||||
|
||||
328
static/jeasyui/plugins/jquery.combotreegrid.js
Normal file
328
static/jeasyui/plugins/jquery.combotreegrid.js
Normal file
@@ -0,0 +1,328 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"combotreegrid");
|
||||
var _4=_3.options;
|
||||
$(_2).addClass("combotreegrid-f").combo($.extend({},_4,{onShowPanel:function(){
|
||||
var p=$(this).combotreegrid("panel");
|
||||
var _5=p.outerHeight()-p.height();
|
||||
var _6=p._size("minHeight");
|
||||
var _7=p._size("maxHeight");
|
||||
var dg=$(this).combotreegrid("grid");
|
||||
dg.treegrid("resize",{width:"100%",height:(isNaN(parseInt(_4.panelHeight))?"auto":"100%"),minHeight:(_6?_6-_5:""),maxHeight:(_7?_7-_5:"")});
|
||||
var _8=dg.treegrid("getSelected");
|
||||
if(_8){
|
||||
dg.treegrid("scrollTo",_8[_4.idField]);
|
||||
}
|
||||
_4.onShowPanel.call(this);
|
||||
}}));
|
||||
if(!_3.grid){
|
||||
var _9=$(_2).combo("panel");
|
||||
_3.grid=$("<table></table>").appendTo(_9);
|
||||
}
|
||||
_3.grid.treegrid($.extend({},_4,{border:false,checkbox:_4.multiple,onLoadSuccess:function(_a,_b){
|
||||
var _c=$(_2).combotreegrid("getValues");
|
||||
if(_4.multiple){
|
||||
$.map($(this).treegrid("getCheckedNodes"),function(_d){
|
||||
$.easyui.addArrayItem(_c,_d[_4.idField]);
|
||||
});
|
||||
}
|
||||
_16(_2,_c);
|
||||
_4.onLoadSuccess.call(this,_a,_b);
|
||||
_3.remainText=false;
|
||||
},onClickRow:function(_e){
|
||||
if(_4.multiple){
|
||||
$(this).treegrid(_e.checked?"uncheckNode":"checkNode",_e[_4.idField]);
|
||||
$(this).treegrid("unselect",_e[_4.idField]);
|
||||
}else{
|
||||
$(_2).combo("hidePanel");
|
||||
}
|
||||
_11(_2);
|
||||
_4.onClickRow.call(this,_e);
|
||||
},onCheckNode:function(_f,_10){
|
||||
_11(_2);
|
||||
_4.onCheckNode.call(this,_f,_10);
|
||||
}}));
|
||||
};
|
||||
function _11(_12){
|
||||
var _13=$.data(_12,"combotreegrid");
|
||||
var _14=_13.options;
|
||||
var _15=_13.grid;
|
||||
var vv=[];
|
||||
if(_14.multiple){
|
||||
vv=$.map(_15.treegrid("getCheckedNodes"),function(row){
|
||||
return row[_14.idField];
|
||||
});
|
||||
}else{
|
||||
var row=_15.treegrid("getSelected");
|
||||
if(row){
|
||||
vv.push(row[_14.idField]);
|
||||
}
|
||||
}
|
||||
vv=vv.concat(_14.unselectedValues);
|
||||
_16(_12,vv);
|
||||
};
|
||||
function _16(_17,_18){
|
||||
var _19=$.data(_17,"combotreegrid");
|
||||
var _1a=_19.options;
|
||||
var _1b=_19.grid;
|
||||
var _1c=_1b.datagrid("options");
|
||||
var _1d=_1c.onBeforeCheck;
|
||||
var _1e=_1c.onCheck;
|
||||
var _1f=_1c.onBeforeSelect;
|
||||
var _20=_1c.onSelect;
|
||||
_1c.onBeforeCheck=_1c.onCheck=_1c.onBeforeSelect=_1c.onSelect=function(){
|
||||
};
|
||||
if(!$.isArray(_18)){
|
||||
_18=_18.split(_1a.separator);
|
||||
}
|
||||
if(!_1a.multiple){
|
||||
_18=_18.length?[_18[0]]:[""];
|
||||
}
|
||||
var vv=$.map(_18,function(_21){
|
||||
return String(_21);
|
||||
});
|
||||
vv=$.grep(vv,function(v,_22){
|
||||
return _22===$.inArray(v,vv);
|
||||
});
|
||||
var _23=_1b.treegrid("getSelected");
|
||||
if(_23){
|
||||
_1b.treegrid("unselect",_23[_1a.idField]);
|
||||
}
|
||||
$.map(_1b.treegrid("getCheckedNodes"),function(row){
|
||||
if($.inArray(String(row[_1a.idField]),vv)==-1){
|
||||
_1b.treegrid("uncheckNode",row[_1a.idField]);
|
||||
}
|
||||
});
|
||||
var ss=[];
|
||||
_1a.unselectedValues=[];
|
||||
$.map(vv,function(v){
|
||||
var row=_1b.treegrid("find",v);
|
||||
if(row){
|
||||
if(_1a.multiple){
|
||||
_1b.treegrid("checkNode",v);
|
||||
}else{
|
||||
_1b.treegrid("select",v);
|
||||
}
|
||||
ss.push(_24(row));
|
||||
}else{
|
||||
ss.push(_25(v,_1a.mappingRows)||v);
|
||||
_1a.unselectedValues.push(v);
|
||||
}
|
||||
});
|
||||
if(_1a.multiple){
|
||||
$.map(_1b.treegrid("getCheckedNodes"),function(row){
|
||||
var id=String(row[_1a.idField]);
|
||||
if($.inArray(id,vv)==-1){
|
||||
vv.push(id);
|
||||
ss.push(_24(row));
|
||||
}
|
||||
});
|
||||
}
|
||||
_1c.onBeforeCheck=_1d;
|
||||
_1c.onCheck=_1e;
|
||||
_1c.onBeforeSelect=_1f;
|
||||
_1c.onSelect=_20;
|
||||
if(!_19.remainText){
|
||||
var s=ss.join(_1a.separator);
|
||||
if($(_17).combo("getText")!=s){
|
||||
$(_17).combo("setText",s);
|
||||
}
|
||||
}
|
||||
$(_17).combo("setValues",vv);
|
||||
function _25(_26,a){
|
||||
var _27=$.easyui.getArrayItem(a,_1a.idField,_26);
|
||||
return _27?_24(_27):undefined;
|
||||
};
|
||||
function _24(row){
|
||||
return row[_1a.textField||""]||row[_1a.treeField];
|
||||
};
|
||||
};
|
||||
function _28(_29,q){
|
||||
var _2a=$.data(_29,"combotreegrid");
|
||||
var _2b=_2a.options;
|
||||
var _2c=_2a.grid;
|
||||
_2a.remainText=true;
|
||||
var qq=_2b.multiple?q.split(_2b.separator):[q];
|
||||
qq=$.grep(qq,function(q){
|
||||
return $.trim(q)!="";
|
||||
});
|
||||
_2c.treegrid("clearSelections").treegrid("clearChecked").treegrid("highlightRow",-1);
|
||||
if(_2b.mode=="remote"){
|
||||
_2d(qq);
|
||||
_2c.treegrid("load",$.extend({},_2b.queryParams,{q:q}));
|
||||
}else{
|
||||
if(q){
|
||||
var _2e=_2c.treegrid("getData");
|
||||
var vv=[];
|
||||
$.map(qq,function(q){
|
||||
q=$.trim(q);
|
||||
if(q){
|
||||
var v=undefined;
|
||||
$.easyui.forEach(_2e,true,function(row){
|
||||
if(q.toLowerCase()==String(row[_2b.treeField]).toLowerCase()){
|
||||
v=row[_2b.idField];
|
||||
return false;
|
||||
}else{
|
||||
if(_2b.filter.call(_29,q,row)){
|
||||
_2c.treegrid("expandTo",row[_2b.idField]);
|
||||
_2c.treegrid("highlightRow",row[_2b.idField]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(v==undefined){
|
||||
$.easyui.forEach(_2b.mappingRows,false,function(row){
|
||||
if(q.toLowerCase()==String(row[_2b.treeField])){
|
||||
v=row[_2b.idField];
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
if(v!=undefined){
|
||||
vv.push(v);
|
||||
}else{
|
||||
vv.push(q);
|
||||
}
|
||||
}
|
||||
});
|
||||
_2d(vv);
|
||||
_2a.remainText=false;
|
||||
}
|
||||
}
|
||||
function _2d(vv){
|
||||
if(!_2b.reversed){
|
||||
$(_29).combotreegrid("setValues",vv);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _2f(_30){
|
||||
var _31=$.data(_30,"combotreegrid");
|
||||
var _32=_31.options;
|
||||
var _33=_31.grid;
|
||||
var tr=_32.finder.getTr(_33[0],null,"highlight");
|
||||
_31.remainText=false;
|
||||
if(tr.length){
|
||||
var id=tr.attr("node-id");
|
||||
if(_32.multiple){
|
||||
if(tr.hasClass("datagrid-row-selected")){
|
||||
_33.treegrid("uncheckNode",id);
|
||||
}else{
|
||||
_33.treegrid("checkNode",id);
|
||||
}
|
||||
}else{
|
||||
_33.treegrid("selectRow",id);
|
||||
}
|
||||
}
|
||||
var vv=[];
|
||||
if(_32.multiple){
|
||||
$.map(_33.treegrid("getCheckedNodes"),function(row){
|
||||
vv.push(row[_32.idField]);
|
||||
});
|
||||
}else{
|
||||
var row=_33.treegrid("getSelected");
|
||||
if(row){
|
||||
vv.push(row[_32.idField]);
|
||||
}
|
||||
}
|
||||
$.map(_32.unselectedValues,function(v){
|
||||
if($.easyui.indexOfArray(_32.mappingRows,_32.idField,v)>=0){
|
||||
$.easyui.addArrayItem(vv,v);
|
||||
}
|
||||
});
|
||||
$(_30).combotreegrid("setValues",vv);
|
||||
if(!_32.multiple){
|
||||
$(_30).combotreegrid("hidePanel");
|
||||
}
|
||||
};
|
||||
$.fn.combotreegrid=function(_34,_35){
|
||||
if(typeof _34=="string"){
|
||||
var _36=$.fn.combotreegrid.methods[_34];
|
||||
if(_36){
|
||||
return _36(this,_35);
|
||||
}else{
|
||||
return this.combo(_34,_35);
|
||||
}
|
||||
}
|
||||
_34=_34||{};
|
||||
return this.each(function(){
|
||||
var _37=$.data(this,"combotreegrid");
|
||||
if(_37){
|
||||
$.extend(_37.options,_34);
|
||||
}else{
|
||||
_37=$.data(this,"combotreegrid",{options:$.extend({},$.fn.combotreegrid.defaults,$.fn.combotreegrid.parseOptions(this),_34)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.combotreegrid.methods={options:function(jq){
|
||||
var _38=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"combotreegrid").options,{width:_38.width,height:_38.height,originalValue:_38.originalValue,disabled:_38.disabled,readonly:_38.readonly});
|
||||
},grid:function(jq){
|
||||
return $.data(jq[0],"combotreegrid").grid;
|
||||
},setValues:function(jq,_39){
|
||||
return jq.each(function(){
|
||||
var _3a=$(this).combotreegrid("options");
|
||||
if($.isArray(_39)){
|
||||
_39=$.map(_39,function(_3b){
|
||||
if(_3b&&typeof _3b=="object"){
|
||||
$.easyui.addArrayItem(_3a.mappingRows,_3a.idField,_3b);
|
||||
return _3b[_3a.idField];
|
||||
}else{
|
||||
return _3b;
|
||||
}
|
||||
});
|
||||
}
|
||||
_16(this,_39);
|
||||
});
|
||||
},setValue:function(jq,_3c){
|
||||
return jq.each(function(){
|
||||
$(this).combotreegrid("setValues",$.isArray(_3c)?_3c:[_3c]);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).combotreegrid("setValues",[]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _3d=$(this).combotreegrid("options");
|
||||
if(_3d.multiple){
|
||||
$(this).combotreegrid("setValues",_3d.originalValue);
|
||||
}else{
|
||||
$(this).combotreegrid("setValue",_3d.originalValue);
|
||||
}
|
||||
});
|
||||
}};
|
||||
$.fn.combotreegrid.parseOptions=function(_3e){
|
||||
var t=$(_3e);
|
||||
return $.extend({},$.fn.combo.parseOptions(_3e),$.fn.treegrid.parseOptions(_3e),$.parser.parseOptions(_3e,["mode",{limitToGrid:"boolean"}]));
|
||||
};
|
||||
$.fn.combotreegrid.defaults=$.extend({},$.fn.combo.defaults,$.fn.treegrid.defaults,{editable:false,singleSelect:true,limitToGrid:false,unselectedValues:[],mappingRows:[],mode:"local",textField:null,keyHandler:{up:function(e){
|
||||
},down:function(e){
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_2f(this);
|
||||
},query:function(q,e){
|
||||
_28(this,q);
|
||||
}},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){
|
||||
$.fn.combo.defaults.inputEvents.blur(e);
|
||||
var _3f=e.data.target;
|
||||
var _40=$(_3f).combotreegrid("options");
|
||||
if(_40.limitToGrid){
|
||||
_2f(_3f);
|
||||
}
|
||||
}}),filter:function(q,row){
|
||||
var _41=$(this).combotreegrid("options");
|
||||
return (row[_41.treeField]||"").toLowerCase().indexOf(q.toLowerCase())>=0;
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
2614
static/jeasyui/plugins/jquery.datagrid.js
Executable file
2614
static/jeasyui/plugins/jquery.datagrid.js
Executable file
File diff suppressed because it is too large
Load Diff
136
static/jeasyui/plugins/jquery.datalist.js
Normal file
136
static/jeasyui/plugins/jquery.datalist.js
Normal file
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"datalist").options;
|
||||
$(_2).datagrid($.extend({},_3,{cls:"datalist"+(_3.lines?" datalist-lines":""),frozenColumns:(_3.frozenColumns&&_3.frozenColumns.length)?_3.frozenColumns:(_3.checkbox?[[{field:"_ck",checkbox:true}]]:undefined),columns:(_3.columns&&_3.columns.length)?_3.columns:[[{field:_3.textField,width:"100%",formatter:function(_4,_5,_6){
|
||||
return _3.textFormatter?_3.textFormatter(_4,_5,_6):_4;
|
||||
}}]]}));
|
||||
};
|
||||
var _7=$.extend({},$.fn.datagrid.defaults.view,{render:function(_8,_9,_a){
|
||||
var _b=$.data(_8,"datagrid");
|
||||
var _c=_b.options;
|
||||
if(_c.groupField){
|
||||
var g=this.groupRows(_8,_b.data.rows);
|
||||
this.groups=g.groups;
|
||||
_b.data.rows=g.rows;
|
||||
var _d=[];
|
||||
for(var i=0;i<g.groups.length;i++){
|
||||
_d.push(this.renderGroup.call(this,_8,i,g.groups[i],_a));
|
||||
}
|
||||
$(_9).html(_d.join(""));
|
||||
}else{
|
||||
$(_9).html(this.renderTable(_8,0,_b.data.rows,_a));
|
||||
}
|
||||
},renderGroup:function(_e,_f,_10,_11){
|
||||
var _12=$.data(_e,"datagrid");
|
||||
var _13=_12.options;
|
||||
var _14=$(_e).datagrid("getColumnFields",_11);
|
||||
var _15=[];
|
||||
_15.push("<div class=\"datagrid-group\" group-index="+_f+">");
|
||||
if(!_11){
|
||||
_15.push("<span class=\"datagrid-group-title\">");
|
||||
_15.push(_13.groupFormatter.call(_e,_10.value,_10.rows));
|
||||
_15.push("</span>");
|
||||
}
|
||||
_15.push("</div>");
|
||||
_15.push(this.renderTable(_e,_10.startIndex,_10.rows,_11));
|
||||
return _15.join("");
|
||||
},groupRows:function(_16,_17){
|
||||
var _18=$.data(_16,"datagrid");
|
||||
var _19=_18.options;
|
||||
var _1a=[];
|
||||
for(var i=0;i<_17.length;i++){
|
||||
var row=_17[i];
|
||||
var _1b=_1c(row[_19.groupField]);
|
||||
if(!_1b){
|
||||
_1b={value:row[_19.groupField],rows:[row]};
|
||||
_1a.push(_1b);
|
||||
}else{
|
||||
_1b.rows.push(row);
|
||||
}
|
||||
}
|
||||
var _1d=0;
|
||||
var _17=[];
|
||||
for(var i=0;i<_1a.length;i++){
|
||||
var _1b=_1a[i];
|
||||
_1b.startIndex=_1d;
|
||||
_1d+=_1b.rows.length;
|
||||
_17=_17.concat(_1b.rows);
|
||||
}
|
||||
return {groups:_1a,rows:_17};
|
||||
function _1c(_1e){
|
||||
for(var i=0;i<_1a.length;i++){
|
||||
var _1f=_1a[i];
|
||||
if(_1f.value==_1e){
|
||||
return _1f;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}});
|
||||
$.fn.datalist=function(_20,_21){
|
||||
if(typeof _20=="string"){
|
||||
var _22=$.fn.datalist.methods[_20];
|
||||
if(_22){
|
||||
return _22(this,_21);
|
||||
}else{
|
||||
return this.datagrid(_20,_21);
|
||||
}
|
||||
}
|
||||
_20=_20||{};
|
||||
return this.each(function(){
|
||||
var _23=$.data(this,"datalist");
|
||||
if(_23){
|
||||
$.extend(_23.options,_20);
|
||||
}else{
|
||||
var _24=$.extend({},$.fn.datalist.defaults,$.fn.datalist.parseOptions(this),_20);
|
||||
_24.columns=$.extend(true,[],_24.columns);
|
||||
_23=$.data(this,"datalist",{options:_24});
|
||||
}
|
||||
_1(this);
|
||||
if(!_23.options.data){
|
||||
var _25=$.fn.datalist.parseData(this);
|
||||
if(_25.total){
|
||||
$(this).datalist("loadData",_25);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.datalist.methods={options:function(jq){
|
||||
return $.data(jq[0],"datalist").options;
|
||||
}};
|
||||
$.fn.datalist.parseOptions=function(_26){
|
||||
return $.extend({},$.fn.datagrid.parseOptions(_26),$.parser.parseOptions(_26,["valueField","textField","groupField",{checkbox:"boolean",lines:"boolean"}]));
|
||||
};
|
||||
$.fn.datalist.parseData=function(_27){
|
||||
var _28=$.data(_27,"datalist").options;
|
||||
var _29={total:0,rows:[]};
|
||||
$(_27).children().each(function(){
|
||||
var _2a=$.parser.parseOptions(this,["value","group"]);
|
||||
var row={};
|
||||
var _2b=$(this).html();
|
||||
row[_28.valueField]=_2a.value!=undefined?_2a.value:_2b;
|
||||
row[_28.textField]=_2b;
|
||||
if(_28.groupField){
|
||||
row[_28.groupField]=_2a.group;
|
||||
}
|
||||
_29.total++;
|
||||
_29.rows.push(row);
|
||||
});
|
||||
return _29;
|
||||
};
|
||||
$.fn.datalist.defaults=$.extend({},$.fn.datagrid.defaults,{fitColumns:true,singleSelect:true,showHeader:false,checkbox:false,lines:false,valueField:"value",textField:"text",groupField:"",view:_7,textFormatter:function(_2c,row){
|
||||
return _2c;
|
||||
},groupFormatter:function(_2d,_2e){
|
||||
return _2d;
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
233
static/jeasyui/plugins/jquery.datebox.js
Executable file
233
static/jeasyui/plugins/jquery.datebox.js
Executable file
@@ -0,0 +1,233 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"datebox");
|
||||
var _4=_3.options;
|
||||
$(_2).addClass("datebox-f").combo($.extend({},_4,{onShowPanel:function(){
|
||||
_5(this);
|
||||
_6(this);
|
||||
_7(this);
|
||||
_18(this,$(this).datebox("getText"),true);
|
||||
_4.onShowPanel.call(this);
|
||||
}}));
|
||||
if(!_3.calendar){
|
||||
var _8=$(_2).combo("panel").css("overflow","hidden");
|
||||
_8.panel("options").onBeforeDestroy=function(){
|
||||
var c=$(this).find(".calendar-shared");
|
||||
if(c.length){
|
||||
c.insertBefore(c[0].pholder);
|
||||
}
|
||||
};
|
||||
var cc=$("<div class=\"datebox-calendar-inner\"></div>").prependTo(_8);
|
||||
if(_4.sharedCalendar){
|
||||
var c=$(_4.sharedCalendar);
|
||||
if(!c[0].pholder){
|
||||
c[0].pholder=$("<div class=\"calendar-pholder\" style=\"display:none\"></div>").insertAfter(c);
|
||||
}
|
||||
c.addClass("calendar-shared").appendTo(cc);
|
||||
if(!c.hasClass("calendar")){
|
||||
c.calendar();
|
||||
}
|
||||
_3.calendar=c;
|
||||
}else{
|
||||
_3.calendar=$("<div></div>").appendTo(cc).calendar();
|
||||
}
|
||||
$.extend(_3.calendar.calendar("options"),{fit:true,border:false,onSelect:function(_9){
|
||||
var _a=this.target;
|
||||
var _b=$(_a).datebox("options");
|
||||
_b.onSelect.call(_a,_9);
|
||||
_18(_a,_b.formatter.call(_a,_9));
|
||||
$(_a).combo("hidePanel");
|
||||
}});
|
||||
}
|
||||
$(_2).combo("textbox").parent().addClass("datebox");
|
||||
$(_2).datebox("initValue",_4.value);
|
||||
function _5(_c){
|
||||
var _d=$(_c).datebox("options");
|
||||
var _e=$(_c).combo("panel");
|
||||
_e._unbind(".datebox")._bind("click.datebox",function(e){
|
||||
if($(e.target).hasClass("datebox-button-a")){
|
||||
var _f=parseInt($(e.target).attr("datebox-button-index"));
|
||||
_d.buttons[_f].handler.call(e.target,_c);
|
||||
}
|
||||
});
|
||||
};
|
||||
function _6(_10){
|
||||
var _11=$(_10).combo("panel");
|
||||
if(_11.children("div.datebox-button").length){
|
||||
return;
|
||||
}
|
||||
var _12=$("<div class=\"datebox-button\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%\"><tr></tr></table></div>").appendTo(_11);
|
||||
var tr=_12.find("tr");
|
||||
for(var i=0;i<_4.buttons.length;i++){
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var btn=_4.buttons[i];
|
||||
var t=$("<a class=\"datebox-button-a\" href=\"javascript:;\"></a>").html($.isFunction(btn.text)?btn.text(_10):btn.text).appendTo(td);
|
||||
t.attr("datebox-button-index",i);
|
||||
}
|
||||
tr.find("td").css("width",(100/_4.buttons.length)+"%");
|
||||
};
|
||||
function _7(_13){
|
||||
var _14=$(_13).combo("panel");
|
||||
var cc=_14.children("div.datebox-calendar-inner");
|
||||
_14.children()._outerWidth(_14.width());
|
||||
_3.calendar.appendTo(cc);
|
||||
_3.calendar[0].target=_13;
|
||||
if(_4.panelHeight!="auto"){
|
||||
var _15=_14.height();
|
||||
_14.children().not(cc).each(function(){
|
||||
_15-=$(this).outerHeight();
|
||||
});
|
||||
cc._outerHeight(_15);
|
||||
}
|
||||
_3.calendar.calendar("resize");
|
||||
};
|
||||
};
|
||||
function _16(_17,q){
|
||||
_18(_17,q,true);
|
||||
};
|
||||
function _19(_1a){
|
||||
var _1b=$.data(_1a,"datebox");
|
||||
var _1c=_1b.options;
|
||||
var _1d=_1b.calendar.calendar("options").current;
|
||||
if(_1d){
|
||||
_18(_1a,_1c.formatter.call(_1a,_1d));
|
||||
$(_1a).combo("hidePanel");
|
||||
}
|
||||
};
|
||||
function _18(_1e,_1f,_20){
|
||||
var _21=$.data(_1e,"datebox");
|
||||
var _22=_21.options;
|
||||
var _23=_21.calendar;
|
||||
_23.calendar("moveTo",_22.parser.call(_1e,_1f));
|
||||
if(_20){
|
||||
$(_1e).combo("setValue",_1f);
|
||||
}else{
|
||||
if(_1f){
|
||||
_1f=_22.formatter.call(_1e,_23.calendar("options").current);
|
||||
}
|
||||
$(_1e).combo("setText",_1f).combo("setValue",_1f);
|
||||
}
|
||||
};
|
||||
$.fn.datebox=function(_24,_25){
|
||||
if(typeof _24=="string"){
|
||||
var _26=$.fn.datebox.methods[_24];
|
||||
if(_26){
|
||||
return _26(this,_25);
|
||||
}else{
|
||||
return this.combo(_24,_25);
|
||||
}
|
||||
}
|
||||
_24=_24||{};
|
||||
return this.each(function(){
|
||||
var _27=$.data(this,"datebox");
|
||||
if(_27){
|
||||
$.extend(_27.options,_24);
|
||||
}else{
|
||||
$.data(this,"datebox",{options:$.extend({},$.fn.datebox.defaults,$.fn.datebox.parseOptions(this),_24)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.datebox.methods={options:function(jq){
|
||||
var _28=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"datebox").options,{width:_28.width,height:_28.height,originalValue:_28.originalValue,disabled:_28.disabled,readonly:_28.readonly});
|
||||
},cloneFrom:function(jq,_29){
|
||||
return jq.each(function(){
|
||||
$(this).combo("cloneFrom",_29);
|
||||
$.data(this,"datebox",{options:$.extend(true,{},$(_29).datebox("options")),calendar:$(_29).datebox("calendar")});
|
||||
$(this).addClass("datebox-f");
|
||||
});
|
||||
},calendar:function(jq){
|
||||
return $.data(jq[0],"datebox").calendar;
|
||||
},initValue:function(jq,_2a){
|
||||
return jq.each(function(){
|
||||
var _2b=$(this).datebox("options");
|
||||
var _2c=_2b.value;
|
||||
if(_2c){
|
||||
var _2d=_2b.parser.call(this,_2c);
|
||||
_2c=_2b.formatter.call(this,_2d);
|
||||
$(this).datebox("calendar").calendar("moveTo",_2d);
|
||||
}
|
||||
$(this).combo("initValue",_2c).combo("setText",_2c);
|
||||
});
|
||||
},setValue:function(jq,_2e){
|
||||
return jq.each(function(){
|
||||
_18(this,_2e);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _2f=$(this).datebox("options");
|
||||
$(this).datebox("setValue",_2f.originalValue);
|
||||
});
|
||||
},setDate:function(jq,_30){
|
||||
return jq.each(function(){
|
||||
var _31=$(this).datebox("options");
|
||||
$(this).datebox("calendar").calendar("moveTo",_30);
|
||||
_18(this,_30?_31.formatter.call(this,_30):"");
|
||||
});
|
||||
},getDate:function(jq){
|
||||
if(jq.datebox("getValue")){
|
||||
return jq.datebox("calendar").calendar("options").current;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}};
|
||||
$.fn.datebox.parseOptions=function(_32){
|
||||
return $.extend({},$.fn.combo.parseOptions(_32),$.parser.parseOptions(_32,["sharedCalendar"]));
|
||||
};
|
||||
$.fn.datebox.defaults=$.extend({},$.fn.combo.defaults,{panelWidth:250,panelHeight:"auto",sharedCalendar:null,keyHandler:{up:function(e){
|
||||
},down:function(e){
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_19(this);
|
||||
},query:function(q,e){
|
||||
_16(this,q);
|
||||
}},currentText:"Today",closeText:"Close",okText:"Ok",buttons:[{text:function(_33){
|
||||
return $(_33).datebox("options").currentText;
|
||||
},handler:function(_34){
|
||||
var _35=$(_34).datebox("options");
|
||||
var now=new Date();
|
||||
var _36=new Date(now.getFullYear(),now.getMonth(),now.getDate());
|
||||
$(_34).datebox("calendar").calendar({year:_36.getFullYear(),month:_36.getMonth()+1,current:_36});
|
||||
_35.onSelect.call(_34,_36);
|
||||
_19(_34);
|
||||
}},{text:function(_37){
|
||||
return $(_37).datebox("options").closeText;
|
||||
},handler:function(_38){
|
||||
$(this).closest("div.combo-panel").panel("close");
|
||||
}}],formatter:function(_39){
|
||||
var y=_39.getFullYear();
|
||||
var m=_39.getMonth()+1;
|
||||
var d=_39.getDate();
|
||||
return (m<10?("0"+m):m)+"/"+(d<10?("0"+d):d)+"/"+y;
|
||||
},parser:function(s){
|
||||
var _3a=$.fn.calendar.defaults.Date;
|
||||
if($(this).data("datebox")){
|
||||
_3a=$(this).datebox("calendar").calendar("options").Date;
|
||||
}
|
||||
if(!s){
|
||||
return new _3a();
|
||||
}
|
||||
var ss=s.split("/");
|
||||
var m=parseInt(ss[0],10);
|
||||
var d=parseInt(ss[1],10);
|
||||
var y=parseInt(ss[2],10);
|
||||
if(!isNaN(y)&&!isNaN(m)&&!isNaN(d)){
|
||||
return new _3a(y,m-1,d);
|
||||
}else{
|
||||
return new _3a();
|
||||
}
|
||||
},onSelect:function(_3b){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
182
static/jeasyui/plugins/jquery.datetimebox.js
Executable file
182
static/jeasyui/plugins/jquery.datetimebox.js
Executable file
@@ -0,0 +1,182 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"datetimebox");
|
||||
var _4=_3.options;
|
||||
$(_2).datebox($.extend({},_4,{onShowPanel:function(){
|
||||
var _5=$(this).datetimebox("getValue");
|
||||
_d(this,_5,true);
|
||||
_4.onShowPanel.call(this);
|
||||
},formatter:$.fn.datebox.defaults.formatter,parser:$.fn.datebox.defaults.parser}));
|
||||
$(_2).removeClass("datebox-f").addClass("datetimebox-f");
|
||||
$(_2).datebox("calendar").calendar({onSelect:function(_6){
|
||||
_4.onSelect.call(this.target,_6);
|
||||
}});
|
||||
if(!_3.spinner){
|
||||
var _7=$(_2).datebox("panel");
|
||||
var p=$("<div style=\"padding:2px\"><input></div>").insertAfter(_7.children("div.datebox-calendar-inner"));
|
||||
_3.spinner=p.children("input");
|
||||
}
|
||||
_3.spinner.timespinner({width:_4.spinnerWidth,showSeconds:_4.showSeconds,separator:_4.timeSeparator,hour12:_4.hour12});
|
||||
$(_2).datetimebox("initValue",_4.value);
|
||||
};
|
||||
function _8(_9){
|
||||
var c=$(_9).datetimebox("calendar");
|
||||
var t=$(_9).datetimebox("spinner");
|
||||
var _a=c.calendar("options").current;
|
||||
return new Date(_a.getFullYear(),_a.getMonth(),_a.getDate(),t.timespinner("getHours"),t.timespinner("getMinutes"),t.timespinner("getSeconds"));
|
||||
};
|
||||
function _b(_c,q){
|
||||
_d(_c,q,true);
|
||||
};
|
||||
function _e(_f){
|
||||
var _10=$.data(_f,"datetimebox").options;
|
||||
var _11=_8(_f);
|
||||
_d(_f,_10.formatter.call(_f,_11));
|
||||
$(_f).combo("hidePanel");
|
||||
};
|
||||
function _d(_12,_13,_14){
|
||||
var _15=$.data(_12,"datetimebox").options;
|
||||
$(_12).combo("setValue",_13);
|
||||
if(!_14){
|
||||
if(_13){
|
||||
var _16=_15.parser.call(_12,_13);
|
||||
$(_12).combo("setText",_15.formatter.call(_12,_16));
|
||||
$(_12).combo("setValue",_15.formatter.call(_12,_16));
|
||||
}else{
|
||||
$(_12).combo("setText",_13);
|
||||
}
|
||||
}
|
||||
var _16=_15.parser.call(_12,_13);
|
||||
$(_12).datetimebox("calendar").calendar("moveTo",_16);
|
||||
$(_12).datetimebox("spinner").timespinner("setValue",_17(_16));
|
||||
function _17(_18){
|
||||
function _19(_1a){
|
||||
return (_1a<10?"0":"")+_1a;
|
||||
};
|
||||
var tt=[_19(_18.getHours()),_19(_18.getMinutes())];
|
||||
if(_15.showSeconds){
|
||||
tt.push(_19(_18.getSeconds()));
|
||||
}
|
||||
return tt.join($(_12).datetimebox("spinner").timespinner("options").separator);
|
||||
};
|
||||
};
|
||||
$.fn.datetimebox=function(_1b,_1c){
|
||||
if(typeof _1b=="string"){
|
||||
var _1d=$.fn.datetimebox.methods[_1b];
|
||||
if(_1d){
|
||||
return _1d(this,_1c);
|
||||
}else{
|
||||
return this.datebox(_1b,_1c);
|
||||
}
|
||||
}
|
||||
_1b=_1b||{};
|
||||
return this.each(function(){
|
||||
var _1e=$.data(this,"datetimebox");
|
||||
if(_1e){
|
||||
$.extend(_1e.options,_1b);
|
||||
}else{
|
||||
$.data(this,"datetimebox",{options:$.extend({},$.fn.datetimebox.defaults,$.fn.datetimebox.parseOptions(this),_1b)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.datetimebox.methods={options:function(jq){
|
||||
var _1f=jq.datebox("options");
|
||||
return $.extend($.data(jq[0],"datetimebox").options,{originalValue:_1f.originalValue,disabled:_1f.disabled,readonly:_1f.readonly});
|
||||
},cloneFrom:function(jq,_20){
|
||||
return jq.each(function(){
|
||||
$(this).datebox("cloneFrom",_20);
|
||||
$.data(this,"datetimebox",{options:$.extend(true,{},$(_20).datetimebox("options")),spinner:$(_20).datetimebox("spinner")});
|
||||
$(this).removeClass("datebox-f").addClass("datetimebox-f");
|
||||
});
|
||||
},spinner:function(jq){
|
||||
return $.data(jq[0],"datetimebox").spinner;
|
||||
},initValue:function(jq,_21){
|
||||
return jq.each(function(){
|
||||
var _22=$(this).datetimebox("options");
|
||||
var _23=_22.value;
|
||||
if(_23){
|
||||
var _24=_22.parser.call(this,_23);
|
||||
_23=_22.formatter.call(this,_24);
|
||||
$(this).datetimebox("calendar").calendar("moveTo",_24);
|
||||
}
|
||||
$(this).combo("initValue",_23).combo("setText",_23);
|
||||
});
|
||||
},setValue:function(jq,_25){
|
||||
return jq.each(function(){
|
||||
_d(this,_25);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _26=$(this).datetimebox("options");
|
||||
$(this).datetimebox("setValue",_26.originalValue);
|
||||
});
|
||||
},setDate:function(jq,_27){
|
||||
return jq.each(function(){
|
||||
var _28=$(this).datetimebox("options");
|
||||
$(this).datetimebox("calendar").calendar("moveTo",_27);
|
||||
_d(this,_27?_28.formatter.call(this,_27):"");
|
||||
});
|
||||
},getDate:function(jq){
|
||||
if(jq.datetimebox("getValue")){
|
||||
return jq.datetimebox("calendar").calendar("options").current;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}};
|
||||
$.fn.datetimebox.parseOptions=function(_29){
|
||||
var t=$(_29);
|
||||
return $.extend({},$.fn.datebox.parseOptions(_29),$.parser.parseOptions(_29,["timeSeparator","spinnerWidth",{showSeconds:"boolean"}]));
|
||||
};
|
||||
$.fn.datetimebox.defaults=$.extend({},$.fn.datebox.defaults,{spinnerWidth:"100%",showSeconds:true,timeSeparator:":",hour12:false,panelEvents:{mousedown:function(e){
|
||||
}},keyHandler:{up:function(e){
|
||||
},down:function(e){
|
||||
},left:function(e){
|
||||
},right:function(e){
|
||||
},enter:function(e){
|
||||
_e(this);
|
||||
},query:function(q,e){
|
||||
_b(this,q);
|
||||
}},buttons:[{text:function(_2a){
|
||||
return $(_2a).datetimebox("options").currentText;
|
||||
},handler:function(_2b){
|
||||
var _2c=$(_2b).datetimebox("options");
|
||||
_d(_2b,_2c.formatter.call(_2b,new Date()));
|
||||
$(_2b).datetimebox("hidePanel");
|
||||
}},{text:function(_2d){
|
||||
return $(_2d).datetimebox("options").okText;
|
||||
},handler:function(_2e){
|
||||
_e(_2e);
|
||||
}},{text:function(_2f){
|
||||
return $(_2f).datetimebox("options").closeText;
|
||||
},handler:function(_30){
|
||||
$(_30).datetimebox("hidePanel");
|
||||
}}],formatter:function(_31){
|
||||
if(!_31){
|
||||
return "";
|
||||
}
|
||||
return $.fn.datebox.defaults.formatter.call(this,_31)+" "+$.fn.timespinner.defaults.formatter.call($(this).datetimebox("spinner")[0],_31);
|
||||
},parser:function(s){
|
||||
s=$.trim(s);
|
||||
if(!s){
|
||||
return new Date();
|
||||
}
|
||||
var dt=s.split(" ");
|
||||
var _32=$.fn.datebox.defaults.parser.call(this,dt[0]);
|
||||
if(dt.length<2){
|
||||
return _32;
|
||||
}
|
||||
var _33=$.fn.timespinner.defaults.parser.call($(this).datetimebox("spinner")[0],dt[1]+(dt[2]?" "+dt[2]:""));
|
||||
return new Date(_32.getFullYear(),_32.getMonth(),_32.getDate(),_33.getHours(),_33.getMinutes(),_33.getSeconds());
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
61
static/jeasyui/plugins/jquery.datetimespinner.js
Normal file
61
static/jeasyui/plugins/jquery.datetimespinner.js
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"datetimespinner").options;
|
||||
$(_2).addClass("datetimespinner-f").timespinner(_3);
|
||||
};
|
||||
$.fn.datetimespinner=function(_4,_5){
|
||||
if(typeof _4=="string"){
|
||||
var _6=$.fn.datetimespinner.methods[_4];
|
||||
if(_6){
|
||||
return _6(this,_5);
|
||||
}else{
|
||||
return this.timespinner(_4,_5);
|
||||
}
|
||||
}
|
||||
_4=_4||{};
|
||||
return this.each(function(){
|
||||
var _7=$.data(this,"datetimespinner");
|
||||
if(_7){
|
||||
$.extend(_7.options,_4);
|
||||
}else{
|
||||
$.data(this,"datetimespinner",{options:$.extend({},$.fn.datetimespinner.defaults,$.fn.datetimespinner.parseOptions(this),_4)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.datetimespinner.methods={options:function(jq){
|
||||
var _8=jq.timespinner("options");
|
||||
return $.extend($.data(jq[0],"datetimespinner").options,{width:_8.width,value:_8.value,originalValue:_8.originalValue,disabled:_8.disabled,readonly:_8.readonly});
|
||||
}};
|
||||
$.fn.datetimespinner.parseOptions=function(_9){
|
||||
return $.extend({},$.fn.timespinner.parseOptions(_9),$.parser.parseOptions(_9,[]));
|
||||
};
|
||||
$.fn.datetimespinner.defaults=$.extend({},$.fn.timespinner.defaults,{formatter:function(_a){
|
||||
if(!_a){
|
||||
return "";
|
||||
}
|
||||
return $.fn.datebox.defaults.formatter.call(this,_a)+" "+$.fn.timespinner.defaults.formatter.call(this,_a);
|
||||
},parser:function(s){
|
||||
s=$.trim(s);
|
||||
if(!s){
|
||||
return null;
|
||||
}
|
||||
var dt=s.split(" ");
|
||||
var _b=$.fn.datebox.defaults.parser.call(this,dt[0]);
|
||||
if(dt.length<2){
|
||||
return _b;
|
||||
}
|
||||
var _c=$.fn.timespinner.defaults.parser.call(this,dt[1]+(dt[2]?" "+dt[2]:""));
|
||||
return new Date(_b.getFullYear(),_b.getMonth(),_b.getDate(),_c.getHours(),_c.getMinutes(),_c.getSeconds());
|
||||
},selections:[[0,2],[3,5],[6,10],[11,13],[14,16],[17,19],[20,22]]});
|
||||
})(jQuery);
|
||||
|
||||
136
static/jeasyui/plugins/jquery.dialog.js
Executable file
136
static/jeasyui/plugins/jquery.dialog.js
Executable file
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"dialog").options;
|
||||
_3.inited=false;
|
||||
$(_2).window($.extend({},_3,{onResize:function(w,h){
|
||||
if(_3.inited){
|
||||
_b(this);
|
||||
_3.onResize.call(this,w,h);
|
||||
}
|
||||
}}));
|
||||
var _4=$(_2).window("window");
|
||||
if(_3.toolbar){
|
||||
if($.isArray(_3.toolbar)){
|
||||
$(_2).siblings("div.dialog-toolbar").remove();
|
||||
var _5=$("<div class=\"dialog-toolbar\"><table cellspacing=\"0\" cellpadding=\"0\"><tr></tr></table></div>").appendTo(_4);
|
||||
var tr=_5.find("tr");
|
||||
for(var i=0;i<_3.toolbar.length;i++){
|
||||
var _6=_3.toolbar[i];
|
||||
if(_6=="-"){
|
||||
$("<td><div class=\"dialog-tool-separator\"></div></td>").appendTo(tr);
|
||||
}else{
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var _7=$("<a href=\"javascript:;\"></a>").appendTo(td);
|
||||
_7[0].onclick=eval(_6.handler||function(){
|
||||
});
|
||||
_7.linkbutton($.extend({},_6,{plain:true}));
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$(_3.toolbar).addClass("dialog-toolbar").appendTo(_4);
|
||||
$(_3.toolbar).show();
|
||||
}
|
||||
}else{
|
||||
$(_2).siblings("div.dialog-toolbar").remove();
|
||||
}
|
||||
if(_3.buttons){
|
||||
if($.isArray(_3.buttons)){
|
||||
$(_2).siblings("div.dialog-button").remove();
|
||||
var _8=$("<div class=\"dialog-button\"></div>").appendTo(_4);
|
||||
for(var i=0;i<_3.buttons.length;i++){
|
||||
var p=_3.buttons[i];
|
||||
var _9=$("<a href=\"javascript:;\"></a>").appendTo(_8);
|
||||
if(p.handler){
|
||||
_9[0].onclick=p.handler;
|
||||
}
|
||||
_9.linkbutton(p);
|
||||
}
|
||||
}else{
|
||||
$(_3.buttons).addClass("dialog-button").appendTo(_4);
|
||||
$(_3.buttons).show();
|
||||
}
|
||||
}else{
|
||||
$(_2).siblings("div.dialog-button").remove();
|
||||
}
|
||||
_3.inited=true;
|
||||
var _a=_3.closed;
|
||||
_4.show();
|
||||
$(_2).window("resize",{});
|
||||
if(_a){
|
||||
_4.hide();
|
||||
}
|
||||
};
|
||||
function _b(_c,_d){
|
||||
var t=$(_c);
|
||||
var _e=t.dialog("options");
|
||||
var _f=_e.noheader;
|
||||
var tb=t.siblings(".dialog-toolbar");
|
||||
var bb=t.siblings(".dialog-button");
|
||||
tb.insertBefore(_c).css({borderTopWidth:(_f?1:0),top:(_f?tb.length:0)});
|
||||
bb.insertAfter(_c);
|
||||
tb.add(bb)._outerWidth(t._outerWidth()).find(".easyui-fluid:visible").each(function(){
|
||||
$(this).triggerHandler("_resize");
|
||||
});
|
||||
var _10=tb._outerHeight()+bb._outerHeight();
|
||||
if(!isNaN(parseInt(_e.height))){
|
||||
t._outerHeight(t._outerHeight()-_10);
|
||||
}else{
|
||||
var _11=t._size("min-height");
|
||||
if(_11){
|
||||
t._size("min-height",_11-_10);
|
||||
}
|
||||
var _12=t._size("max-height");
|
||||
if(_12){
|
||||
t._size("max-height",_12-_10);
|
||||
}
|
||||
}
|
||||
var _13=$.data(_c,"window").shadow;
|
||||
if(_13){
|
||||
var cc=t.panel("panel");
|
||||
_13.css({width:cc._outerWidth(),height:cc._outerHeight()});
|
||||
}
|
||||
};
|
||||
$.fn.dialog=function(_14,_15){
|
||||
if(typeof _14=="string"){
|
||||
var _16=$.fn.dialog.methods[_14];
|
||||
if(_16){
|
||||
return _16(this,_15);
|
||||
}else{
|
||||
return this.window(_14,_15);
|
||||
}
|
||||
}
|
||||
_14=_14||{};
|
||||
return this.each(function(){
|
||||
var _17=$.data(this,"dialog");
|
||||
if(_17){
|
||||
$.extend(_17.options,_14);
|
||||
}else{
|
||||
$.data(this,"dialog",{options:$.extend({},$.fn.dialog.defaults,$.fn.dialog.parseOptions(this),_14)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.dialog.methods={options:function(jq){
|
||||
var _18=$.data(jq[0],"dialog").options;
|
||||
var _19=jq.panel("options");
|
||||
$.extend(_18,{width:_19.width,height:_19.height,left:_19.left,top:_19.top,closed:_19.closed,collapsed:_19.collapsed,minimized:_19.minimized,maximized:_19.maximized});
|
||||
return _18;
|
||||
},dialog:function(jq){
|
||||
return jq.window("window");
|
||||
}};
|
||||
$.fn.dialog.parseOptions=function(_1a){
|
||||
var t=$(_1a);
|
||||
return $.extend({},$.fn.window.parseOptions(_1a),$.parser.parseOptions(_1a,["toolbar","buttons"]),{toolbar:(t.children(".dialog-toolbar").length?t.children(".dialog-toolbar").removeClass("dialog-toolbar"):undefined),buttons:(t.children(".dialog-button").length?t.children(".dialog-button").removeClass("dialog-button"):undefined)});
|
||||
};
|
||||
$.fn.dialog.defaults=$.extend({},$.fn.window.defaults,{title:"New Dialog",collapsible:false,minimizable:false,maximizable:false,resizable:false,toolbar:null,buttons:null});
|
||||
})(jQuery);
|
||||
|
||||
306
static/jeasyui/plugins/jquery.draggable.js
Executable file
306
static/jeasyui/plugins/jquery.draggable.js
Executable file
@@ -0,0 +1,306 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(e){
|
||||
var _2=$.data(e.data.target,"draggable");
|
||||
var _3=_2.options;
|
||||
var _4=_2.proxy;
|
||||
var _5=e.data;
|
||||
var _6=_5.startLeft+e.pageX-_5.startX;
|
||||
var _7=_5.startTop+e.pageY-_5.startY;
|
||||
if(_4){
|
||||
if(_4.parent()[0]==document.body){
|
||||
if(_3.deltaX!=null&&_3.deltaX!=undefined){
|
||||
_6=e.pageX+_3.deltaX;
|
||||
}else{
|
||||
_6=e.pageX-e.data.offsetWidth;
|
||||
}
|
||||
if(_3.deltaY!=null&&_3.deltaY!=undefined){
|
||||
_7=e.pageY+_3.deltaY;
|
||||
}else{
|
||||
_7=e.pageY-e.data.offsetHeight;
|
||||
}
|
||||
}else{
|
||||
if(_3.deltaX!=null&&_3.deltaX!=undefined){
|
||||
_6+=e.data.offsetWidth+_3.deltaX;
|
||||
}
|
||||
if(_3.deltaY!=null&&_3.deltaY!=undefined){
|
||||
_7+=e.data.offsetHeight+_3.deltaY;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(e.data.parent!=document.body){
|
||||
_6+=$(e.data.parent).scrollLeft();
|
||||
_7+=$(e.data.parent).scrollTop();
|
||||
}
|
||||
if(_3.axis=="h"){
|
||||
_5.left=_6;
|
||||
}else{
|
||||
if(_3.axis=="v"){
|
||||
_5.top=_7;
|
||||
}else{
|
||||
_5.left=_6;
|
||||
_5.top=_7;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _8(e){
|
||||
var _9=$.data(e.data.target,"draggable");
|
||||
var _a=_9.options;
|
||||
var _b=_9.proxy;
|
||||
if(!_b){
|
||||
_b=$(e.data.target);
|
||||
}
|
||||
_b.css({left:e.data.left,top:e.data.top});
|
||||
$("body").css("cursor",_a.cursor);
|
||||
};
|
||||
function _c(e){
|
||||
if(!$.fn.draggable.isDragging){
|
||||
return false;
|
||||
}
|
||||
var _d=$.data(e.data.target,"draggable");
|
||||
var _e=_d.options;
|
||||
var _f=$(".droppable:visible").filter(function(){
|
||||
return e.data.target!=this;
|
||||
}).filter(function(){
|
||||
var _10=$.data(this,"droppable").options.accept;
|
||||
if(_10){
|
||||
return $(_10).filter(function(){
|
||||
return this==e.data.target;
|
||||
}).length>0;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
});
|
||||
_d.droppables=_f;
|
||||
var _11=_d.proxy;
|
||||
if(!_11){
|
||||
if(_e.proxy){
|
||||
if(_e.proxy=="clone"){
|
||||
_11=$(e.data.target).clone().insertAfter(e.data.target);
|
||||
}else{
|
||||
_11=_e.proxy.call(e.data.target,e.data.target);
|
||||
}
|
||||
_d.proxy=_11;
|
||||
}else{
|
||||
_11=$(e.data.target);
|
||||
}
|
||||
}
|
||||
_11.css("position","absolute");
|
||||
_1(e);
|
||||
_8(e);
|
||||
_e.onStartDrag.call(e.data.target,e);
|
||||
return false;
|
||||
};
|
||||
function _12(e){
|
||||
if(!$.fn.draggable.isDragging){
|
||||
return false;
|
||||
}
|
||||
var _13=$.data(e.data.target,"draggable");
|
||||
_1(e);
|
||||
if(_13.options.onDrag.call(e.data.target,e)!=false){
|
||||
_8(e);
|
||||
}
|
||||
var _14=e.data.target;
|
||||
_13.droppables.each(function(){
|
||||
var _15=$(this);
|
||||
if(_15.droppable("options").disabled){
|
||||
return;
|
||||
}
|
||||
var p2=_15.offset();
|
||||
if(e.pageX>p2.left&&e.pageX<p2.left+_15.outerWidth()&&e.pageY>p2.top&&e.pageY<p2.top+_15.outerHeight()){
|
||||
if(!this.entered){
|
||||
$(this).trigger("_dragenter",[_14]);
|
||||
this.entered=true;
|
||||
}
|
||||
$(this).trigger("_dragover",[_14]);
|
||||
}else{
|
||||
if(this.entered){
|
||||
$(this).trigger("_dragleave",[_14]);
|
||||
this.entered=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
function _16(e){
|
||||
if(!$.fn.draggable.isDragging){
|
||||
_17();
|
||||
return false;
|
||||
}
|
||||
_12(e);
|
||||
var _18=$.data(e.data.target,"draggable");
|
||||
var _19=_18.proxy;
|
||||
var _1a=_18.options;
|
||||
_1a.onEndDrag.call(e.data.target,e);
|
||||
if(_1a.revert){
|
||||
if(_1b()==true){
|
||||
$(e.data.target).css({position:e.data.startPosition,left:e.data.startLeft,top:e.data.startTop});
|
||||
}else{
|
||||
if(_19){
|
||||
var _1c,top;
|
||||
if(_19.parent()[0]==document.body){
|
||||
_1c=e.data.startX-e.data.offsetWidth;
|
||||
top=e.data.startY-e.data.offsetHeight;
|
||||
}else{
|
||||
_1c=e.data.startLeft;
|
||||
top=e.data.startTop;
|
||||
}
|
||||
_19.animate({left:_1c,top:top},function(){
|
||||
_1d();
|
||||
});
|
||||
}else{
|
||||
$(e.data.target).animate({left:e.data.startLeft,top:e.data.startTop},function(){
|
||||
$(e.data.target).css("position",e.data.startPosition);
|
||||
});
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$(e.data.target).css({position:"absolute",left:e.data.left,top:e.data.top});
|
||||
_1b();
|
||||
}
|
||||
_1a.onStopDrag.call(e.data.target,e);
|
||||
_17();
|
||||
function _1d(){
|
||||
if(_19){
|
||||
_19.remove();
|
||||
}
|
||||
_18.proxy=null;
|
||||
};
|
||||
function _1b(){
|
||||
var _1e=false;
|
||||
_18.droppables.each(function(){
|
||||
var _1f=$(this);
|
||||
if(_1f.droppable("options").disabled){
|
||||
return;
|
||||
}
|
||||
var p2=_1f.offset();
|
||||
if(e.pageX>p2.left&&e.pageX<p2.left+_1f.outerWidth()&&e.pageY>p2.top&&e.pageY<p2.top+_1f.outerHeight()){
|
||||
if(_1a.revert){
|
||||
$(e.data.target).css({position:e.data.startPosition,left:e.data.startLeft,top:e.data.startTop});
|
||||
}
|
||||
$(this).triggerHandler("_drop",[e.data.target]);
|
||||
_1d();
|
||||
_1e=true;
|
||||
this.entered=false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if(!_1e&&!_1a.revert){
|
||||
_1d();
|
||||
}
|
||||
return _1e;
|
||||
};
|
||||
return false;
|
||||
};
|
||||
function _17(){
|
||||
if($.fn.draggable.timer){
|
||||
clearTimeout($.fn.draggable.timer);
|
||||
$.fn.draggable.timer=undefined;
|
||||
}
|
||||
$(document)._unbind(".draggable");
|
||||
$.fn.draggable.isDragging=false;
|
||||
setTimeout(function(){
|
||||
$("body").css("cursor","");
|
||||
},100);
|
||||
};
|
||||
$.fn.draggable=function(_20,_21){
|
||||
if(typeof _20=="string"){
|
||||
return $.fn.draggable.methods[_20](this,_21);
|
||||
}
|
||||
return this.each(function(){
|
||||
var _22;
|
||||
var _23=$.data(this,"draggable");
|
||||
if(_23){
|
||||
_23.handle._unbind(".draggable");
|
||||
_22=$.extend(_23.options,_20);
|
||||
}else{
|
||||
_22=$.extend({},$.fn.draggable.defaults,$.fn.draggable.parseOptions(this),_20||{});
|
||||
}
|
||||
var _24=_22.handle?(typeof _22.handle=="string"?$(_22.handle,this):_22.handle):$(this);
|
||||
$.data(this,"draggable",{options:_22,handle:_24});
|
||||
if(_22.disabled){
|
||||
$(this).css("cursor","");
|
||||
return;
|
||||
}
|
||||
_24._unbind(".draggable")._bind("mousemove.draggable",{target:this},function(e){
|
||||
if($.fn.draggable.isDragging){
|
||||
return;
|
||||
}
|
||||
var _25=$.data(e.data.target,"draggable").options;
|
||||
if(_26(e)){
|
||||
$(this).css("cursor",_25.cursor);
|
||||
}else{
|
||||
$(this).css("cursor","");
|
||||
}
|
||||
})._bind("mouseleave.draggable",{target:this},function(e){
|
||||
$(this).css("cursor","");
|
||||
})._bind("mousedown.draggable",{target:this},function(e){
|
||||
if(_26(e)==false){
|
||||
return;
|
||||
}
|
||||
$(this).css("cursor","");
|
||||
var _27=$(e.data.target).position();
|
||||
var _28=$(e.data.target).offset();
|
||||
var _29={startPosition:$(e.data.target).css("position"),startLeft:_27.left,startTop:_27.top,left:_27.left,top:_27.top,startX:e.pageX,startY:e.pageY,width:$(e.data.target).outerWidth(),height:$(e.data.target).outerHeight(),offsetWidth:(e.pageX-_28.left),offsetHeight:(e.pageY-_28.top),target:e.data.target,parent:$(e.data.target).parent()[0]};
|
||||
$.extend(e.data,_29);
|
||||
var _2a=$.data(e.data.target,"draggable").options;
|
||||
if(_2a.onBeforeDrag.call(e.data.target,e)==false){
|
||||
return;
|
||||
}
|
||||
$(document)._bind("mousedown.draggable",e.data,_c);
|
||||
$(document)._bind("mousemove.draggable",e.data,_12);
|
||||
$(document)._bind("mouseup.draggable",e.data,_16);
|
||||
$.fn.draggable.timer=setTimeout(function(){
|
||||
$.fn.draggable.isDragging=true;
|
||||
_c(e);
|
||||
},_2a.delay);
|
||||
return false;
|
||||
});
|
||||
function _26(e){
|
||||
var _2b=$.data(e.data.target,"draggable");
|
||||
var _2c=_2b.handle;
|
||||
var _2d=$(_2c).offset();
|
||||
var _2e=$(_2c).outerWidth();
|
||||
var _2f=$(_2c).outerHeight();
|
||||
var t=e.pageY-_2d.top;
|
||||
var r=_2d.left+_2e-e.pageX;
|
||||
var b=_2d.top+_2f-e.pageY;
|
||||
var l=e.pageX-_2d.left;
|
||||
return Math.min(t,r,b,l)>_2b.options.edge;
|
||||
};
|
||||
});
|
||||
};
|
||||
$.fn.draggable.methods={options:function(jq){
|
||||
return $.data(jq[0],"draggable").options;
|
||||
},proxy:function(jq){
|
||||
return $.data(jq[0],"draggable").proxy;
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).draggable({disabled:false});
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).draggable({disabled:true});
|
||||
});
|
||||
}};
|
||||
$.fn.draggable.parseOptions=function(_30){
|
||||
var t=$(_30);
|
||||
return $.extend({},$.parser.parseOptions(_30,["cursor","handle","axis",{"revert":"boolean","deltaX":"number","deltaY":"number","edge":"number","delay":"number"}]),{disabled:(t.attr("disabled")?true:undefined)});
|
||||
};
|
||||
$.fn.draggable.defaults={proxy:null,revert:false,cursor:"move",deltaX:null,deltaY:null,handle:null,disabled:false,edge:0,axis:null,delay:100,onBeforeDrag:function(e){
|
||||
},onStartDrag:function(e){
|
||||
},onDrag:function(e){
|
||||
},onEndDrag:function(e){
|
||||
},onStopDrag:function(e){
|
||||
}};
|
||||
$.fn.draggable.isDragging=false;
|
||||
})(jQuery);
|
||||
|
||||
62
static/jeasyui/plugins/jquery.droppable.js
Executable file
62
static/jeasyui/plugins/jquery.droppable.js
Executable file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
$(_2).addClass("droppable");
|
||||
$(_2)._bind("_dragenter",function(e,_3){
|
||||
$.data(_2,"droppable").options.onDragEnter.apply(_2,[e,_3]);
|
||||
});
|
||||
$(_2)._bind("_dragleave",function(e,_4){
|
||||
$.data(_2,"droppable").options.onDragLeave.apply(_2,[e,_4]);
|
||||
});
|
||||
$(_2)._bind("_dragover",function(e,_5){
|
||||
$.data(_2,"droppable").options.onDragOver.apply(_2,[e,_5]);
|
||||
});
|
||||
$(_2)._bind("_drop",function(e,_6){
|
||||
$.data(_2,"droppable").options.onDrop.apply(_2,[e,_6]);
|
||||
});
|
||||
};
|
||||
$.fn.droppable=function(_7,_8){
|
||||
if(typeof _7=="string"){
|
||||
return $.fn.droppable.methods[_7](this,_8);
|
||||
}
|
||||
_7=_7||{};
|
||||
return this.each(function(){
|
||||
var _9=$.data(this,"droppable");
|
||||
if(_9){
|
||||
$.extend(_9.options,_7);
|
||||
}else{
|
||||
_1(this);
|
||||
$.data(this,"droppable",{options:$.extend({},$.fn.droppable.defaults,$.fn.droppable.parseOptions(this),_7)});
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.droppable.methods={options:function(jq){
|
||||
return $.data(jq[0],"droppable").options;
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).droppable({disabled:false});
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).droppable({disabled:true});
|
||||
});
|
||||
}};
|
||||
$.fn.droppable.parseOptions=function(_a){
|
||||
var t=$(_a);
|
||||
return $.extend({},$.parser.parseOptions(_a,["accept"]),{disabled:(t.attr("disabled")?true:undefined)});
|
||||
};
|
||||
$.fn.droppable.defaults={accept:null,disabled:false,onDragEnter:function(e,_b){
|
||||
},onDragOver:function(e,_c){
|
||||
},onDragLeave:function(e,_d){
|
||||
},onDrop:function(e,_e){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
100
static/jeasyui/plugins/jquery.filebox.js
Normal file
100
static/jeasyui/plugins/jquery.filebox.js
Normal file
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=0;
|
||||
function _2(_3){
|
||||
var _4=$.data(_3,"filebox");
|
||||
var _5=_4.options;
|
||||
_5.fileboxId="filebox_file_id_"+(++_1);
|
||||
$(_3).addClass("filebox-f").textbox(_5);
|
||||
$(_3).textbox("textbox").attr("readonly","readonly");
|
||||
_4.filebox=$(_3).next().addClass("filebox");
|
||||
var _6=_7(_3);
|
||||
var _8=$(_3).filebox("button");
|
||||
if(_8.length){
|
||||
$("<label class=\"filebox-label\" for=\""+_5.fileboxId+"\"></label>").appendTo(_8);
|
||||
if(_8.linkbutton("options").disabled){
|
||||
_6._propAttr("disabled",true);
|
||||
}else{
|
||||
_6._propAttr("disabled",false);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _7(_9){
|
||||
var _a=$.data(_9,"filebox");
|
||||
var _b=_a.options;
|
||||
_a.filebox.find(".textbox-value").remove();
|
||||
_b.oldValue="";
|
||||
var _c=$("<input type=\"file\" class=\"textbox-value\">").appendTo(_a.filebox);
|
||||
_c.attr("id",_b.fileboxId).attr("name",$(_9).attr("textboxName")||"");
|
||||
_c.attr("accept",_b.accept);
|
||||
_c.attr("capture",_b.capture);
|
||||
if(_b.multiple){
|
||||
_c.attr("multiple","multiple");
|
||||
}
|
||||
_c.change(function(){
|
||||
var _d=this.value;
|
||||
if(this.files){
|
||||
_d=$.map(this.files,function(_e){
|
||||
return _e.name;
|
||||
}).join(_b.separator);
|
||||
}
|
||||
$(_9).filebox("setText",_d);
|
||||
_b.onChange.call(_9,_d,_b.oldValue);
|
||||
_b.oldValue=_d;
|
||||
});
|
||||
return _c;
|
||||
};
|
||||
$.fn.filebox=function(_f,_10){
|
||||
if(typeof _f=="string"){
|
||||
var _11=$.fn.filebox.methods[_f];
|
||||
if(_11){
|
||||
return _11(this,_10);
|
||||
}else{
|
||||
return this.textbox(_f,_10);
|
||||
}
|
||||
}
|
||||
_f=_f||{};
|
||||
return this.each(function(){
|
||||
var _12=$.data(this,"filebox");
|
||||
if(_12){
|
||||
$.extend(_12.options,_f);
|
||||
}else{
|
||||
$.data(this,"filebox",{options:$.extend({},$.fn.filebox.defaults,$.fn.filebox.parseOptions(this),_f)});
|
||||
}
|
||||
_2(this);
|
||||
});
|
||||
};
|
||||
$.fn.filebox.methods={options:function(jq){
|
||||
var _13=jq.textbox("options");
|
||||
return $.extend($.data(jq[0],"filebox").options,{width:_13.width,value:_13.value,originalValue:_13.originalValue,disabled:_13.disabled,readonly:_13.readonly});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("clear");
|
||||
_7(this);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).filebox("clear");
|
||||
});
|
||||
},setValue:function(jq){
|
||||
return jq;
|
||||
},setValues:function(jq){
|
||||
return jq;
|
||||
},files:function(jq){
|
||||
return jq.next().find(".textbox-value")[0].files;
|
||||
}};
|
||||
$.fn.filebox.parseOptions=function(_14){
|
||||
var t=$(_14);
|
||||
return $.extend({},$.fn.textbox.parseOptions(_14),$.parser.parseOptions(_14,["accept","capture","separator"]),{multiple:(t.attr("multiple")?true:undefined)});
|
||||
};
|
||||
$.fn.filebox.defaults=$.extend({},$.fn.textbox.defaults,{buttonIcon:null,buttonText:"Choose File",buttonAlign:"right",inputEvents:{},accept:"",capture:"",separator:",",multiple:false});
|
||||
})(jQuery);
|
||||
|
||||
414
static/jeasyui/plugins/jquery.form.js
Executable file
414
static/jeasyui/plugins/jquery.form.js
Executable file
@@ -0,0 +1,414 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2,_3){
|
||||
var _4=$.data(_2,"form").options;
|
||||
$.extend(_4,_3||{});
|
||||
var _5=$.extend({},_4.queryParams);
|
||||
if(_4.onSubmit.call(_2,_5)==false){
|
||||
return;
|
||||
}
|
||||
var _6=$(_2).find(".textbox-text:focus");
|
||||
_6.triggerHandler("blur");
|
||||
_6.focus();
|
||||
var _7=null;
|
||||
if(_4.dirty){
|
||||
var ff=[];
|
||||
$.map(_4.dirtyFields,function(f){
|
||||
if($(f).hasClass("textbox-f")){
|
||||
$(f).next().find(".textbox-value").each(function(){
|
||||
ff.push(this);
|
||||
});
|
||||
}else{
|
||||
ff.push(f);
|
||||
}
|
||||
});
|
||||
_7=$(_2).find("input[name]:enabled,textarea[name]:enabled,select[name]:enabled").filter(function(){
|
||||
return $.inArray(this,ff)==-1;
|
||||
});
|
||||
_7._propAttr("disabled",true);
|
||||
}
|
||||
if(_4.ajax){
|
||||
if(_4.iframe){
|
||||
_8(_2,_5);
|
||||
}else{
|
||||
if(window.FormData!==undefined){
|
||||
_9(_2,_5);
|
||||
}else{
|
||||
_8(_2,_5);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$(_2).submit();
|
||||
}
|
||||
if(_4.dirty){
|
||||
_7._propAttr("disabled",false);
|
||||
}
|
||||
};
|
||||
function _8(_a,_b){
|
||||
var _c=$.data(_a,"form").options;
|
||||
var _d="easyui_frame_"+(new Date().getTime());
|
||||
var _e=$("<iframe id="+_d+" name="+_d+"></iframe>").appendTo("body");
|
||||
_e.attr("src",window.ActiveXObject?"javascript:false":"about:blank");
|
||||
_e.css({position:"absolute",top:-1000,left:-1000});
|
||||
_e.bind("load",cb);
|
||||
_f(_b);
|
||||
function _f(_10){
|
||||
var _11=$(_a);
|
||||
if(_c.url){
|
||||
_11.attr("action",_c.url);
|
||||
}
|
||||
var t=_11.attr("target"),a=_11.attr("action");
|
||||
_11.attr("target",_d);
|
||||
var _12=$();
|
||||
try{
|
||||
for(var n in _10){
|
||||
var _13=$("<input type=\"hidden\" name=\""+n+"\">").val(_10[n]).appendTo(_11);
|
||||
_12=_12.add(_13);
|
||||
}
|
||||
_14();
|
||||
_11[0].submit();
|
||||
}
|
||||
finally{
|
||||
_11.attr("action",a);
|
||||
t?_11.attr("target",t):_11.removeAttr("target");
|
||||
_12.remove();
|
||||
}
|
||||
};
|
||||
function _14(){
|
||||
var f=$("#"+_d);
|
||||
if(!f.length){
|
||||
return;
|
||||
}
|
||||
try{
|
||||
var s=f.contents()[0].readyState;
|
||||
if(s&&s.toLowerCase()=="uninitialized"){
|
||||
setTimeout(_14,100);
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
cb();
|
||||
}
|
||||
};
|
||||
var _15=10;
|
||||
function cb(){
|
||||
var f=$("#"+_d);
|
||||
if(!f.length){
|
||||
return;
|
||||
}
|
||||
f.unbind();
|
||||
var _16="";
|
||||
try{
|
||||
var _17=f.contents().find("body");
|
||||
_16=_17.html();
|
||||
if(_16==""){
|
||||
if(--_15){
|
||||
setTimeout(cb,100);
|
||||
return;
|
||||
}
|
||||
}
|
||||
var ta=_17.find(">textarea");
|
||||
if(ta.length){
|
||||
_16=ta.val();
|
||||
}else{
|
||||
var pre=_17.find(">pre");
|
||||
if(pre.length){
|
||||
_16=pre.html();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e){
|
||||
}
|
||||
_c.success.call(_a,_16);
|
||||
setTimeout(function(){
|
||||
f.unbind();
|
||||
f.remove();
|
||||
},100);
|
||||
};
|
||||
};
|
||||
function _9(_18,_19){
|
||||
var _1a=$.data(_18,"form").options;
|
||||
var _1b=new FormData($(_18)[0]);
|
||||
for(var _1c in _19){
|
||||
_1b.append(_1c,_19[_1c]);
|
||||
}
|
||||
$.ajax({url:_1a.url,type:"post",xhr:function(){
|
||||
var xhr=$.ajaxSettings.xhr();
|
||||
if(xhr.upload){
|
||||
xhr.upload.addEventListener("progress",function(e){
|
||||
if(e.lengthComputable){
|
||||
var _1d=e.total;
|
||||
var _1e=e.loaded||e.position;
|
||||
var _1f=Math.ceil(_1e*100/_1d);
|
||||
_1a.onProgress.call(_18,_1f);
|
||||
}
|
||||
},false);
|
||||
}
|
||||
return xhr;
|
||||
},data:_1b,dataType:"html",cache:false,contentType:false,processData:false,complete:function(res){
|
||||
_1a.success.call(_18,res.responseText);
|
||||
}});
|
||||
};
|
||||
function _20(_21,_22){
|
||||
var _23=$.data(_21,"form").options;
|
||||
if(typeof _22=="string"){
|
||||
var _24={};
|
||||
if(_23.onBeforeLoad.call(_21,_24)==false){
|
||||
return;
|
||||
}
|
||||
$.ajax({url:_22,data:_24,dataType:"json",success:function(_25){
|
||||
_26(_25);
|
||||
},error:function(){
|
||||
_23.onLoadError.apply(_21,arguments);
|
||||
}});
|
||||
}else{
|
||||
_26(_22);
|
||||
}
|
||||
function _26(_27){
|
||||
var _28=$(_21);
|
||||
for(var _29 in _27){
|
||||
var val=_27[_29];
|
||||
if(!_2a(_29,val)){
|
||||
if(!_2b(_29,val)){
|
||||
_28.find("input[name=\""+_29+"\"]").val(val);
|
||||
_28.find("textarea[name=\""+_29+"\"]").val(val);
|
||||
_28.find("select[name=\""+_29+"\"]").val(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
_23.onLoadSuccess.call(_21,_27);
|
||||
_28.form("validate");
|
||||
};
|
||||
function _2a(_2c,val){
|
||||
var _2d=["switchbutton","radiobutton","checkbox"];
|
||||
for(var i=0;i<_2d.length;i++){
|
||||
var _2e=_2d[i];
|
||||
var cc=$(_21).find("["+_2e+"Name=\""+_2c+"\"]");
|
||||
if(cc.length){
|
||||
cc[_2e]("uncheck");
|
||||
cc.each(function(){
|
||||
if(_2f($(this)[_2e]("options").value,val)){
|
||||
$(this)[_2e]("check");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
var cc=$(_21).find("input[name=\""+_2c+"\"][type=radio], input[name=\""+_2c+"\"][type=checkbox]");
|
||||
if(cc.length){
|
||||
cc._propAttr("checked",false);
|
||||
cc.each(function(){
|
||||
if(_2f($(this).val(),val)){
|
||||
$(this)._propAttr("checked",true);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
function _2f(v,val){
|
||||
if(v==String(val)||$.inArray(v,$.isArray(val)?val:[val])>=0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
function _2b(_30,val){
|
||||
var _31=$(_21).find("[textboxName=\""+_30+"\"],[sliderName=\""+_30+"\"]");
|
||||
if(_31.length){
|
||||
for(var i=0;i<_23.fieldTypes.length;i++){
|
||||
var _32=_23.fieldTypes[i];
|
||||
var _33=_31.data(_32);
|
||||
if(_33){
|
||||
if(_33.options.multiple||_33.options.range){
|
||||
_31[_32]("setValues",val);
|
||||
}else{
|
||||
_31[_32]("setValue",val);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
};
|
||||
function _34(_35){
|
||||
$("input,select,textarea",_35).each(function(){
|
||||
if($(this).hasClass("textbox-value")){
|
||||
return;
|
||||
}
|
||||
var t=this.type,tag=this.tagName.toLowerCase();
|
||||
if(t=="text"||t=="hidden"||t=="password"||tag=="textarea"){
|
||||
this.value="";
|
||||
}else{
|
||||
if(t=="file"){
|
||||
var _36=$(this);
|
||||
if(!_36.hasClass("textbox-value")){
|
||||
var _37=_36.clone().val("");
|
||||
_37.insertAfter(_36);
|
||||
if(_36.data("validatebox")){
|
||||
_36.validatebox("destroy");
|
||||
_37.validatebox();
|
||||
}else{
|
||||
_36.remove();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(t=="checkbox"||t=="radio"){
|
||||
this.checked=false;
|
||||
}else{
|
||||
if(tag=="select"){
|
||||
this.selectedIndex=-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
var tmp=$();
|
||||
var _38=$(_35);
|
||||
var _39=$.data(_35,"form").options;
|
||||
for(var i=0;i<_39.fieldTypes.length;i++){
|
||||
var _3a=_39.fieldTypes[i];
|
||||
var _3b=_38.find("."+_3a+"-f").not(tmp);
|
||||
if(_3b.length&&_3b[_3a]){
|
||||
_3b[_3a]("clear");
|
||||
tmp=tmp.add(_3b);
|
||||
}
|
||||
}
|
||||
_38.form("validate");
|
||||
};
|
||||
function _3c(_3d){
|
||||
_3d.reset();
|
||||
var _3e=$(_3d);
|
||||
var _3f=$.data(_3d,"form").options;
|
||||
for(var i=_3f.fieldTypes.length-1;i>=0;i--){
|
||||
var _40=_3f.fieldTypes[i];
|
||||
var _41=_3e.find("."+_40+"-f");
|
||||
if(_41.length&&_41[_40]){
|
||||
_41[_40]("reset");
|
||||
}
|
||||
}
|
||||
_3e.form("validate");
|
||||
};
|
||||
function _42(_43){
|
||||
var _44=$.data(_43,"form").options;
|
||||
$(_43).unbind(".form");
|
||||
if(_44.ajax){
|
||||
$(_43).bind("submit.form",function(){
|
||||
setTimeout(function(){
|
||||
_1(_43,_44);
|
||||
},0);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
$(_43).bind("_change.form",function(e,t){
|
||||
if($.inArray(t,_44.dirtyFields)==-1){
|
||||
_44.dirtyFields.push(t);
|
||||
}
|
||||
_44.onChange.call(this,t);
|
||||
}).bind("change.form",function(e){
|
||||
var t=e.target;
|
||||
if(!$(t).hasClass("textbox-text")){
|
||||
if($.inArray(t,_44.dirtyFields)==-1){
|
||||
_44.dirtyFields.push(t);
|
||||
}
|
||||
_44.onChange.call(this,t);
|
||||
}
|
||||
});
|
||||
_45(_43,_44.novalidate);
|
||||
};
|
||||
function _46(_47,_48){
|
||||
_48=_48||{};
|
||||
var _49=$.data(_47,"form");
|
||||
if(_49){
|
||||
$.extend(_49.options,_48);
|
||||
}else{
|
||||
$.data(_47,"form",{options:$.extend({},$.fn.form.defaults,$.fn.form.parseOptions(_47),_48)});
|
||||
}
|
||||
};
|
||||
function _4a(_4b){
|
||||
if($.fn.validatebox){
|
||||
var t=$(_4b);
|
||||
t.find(".validatebox-text:not(:disabled)").validatebox("validate");
|
||||
var _4c=t.find(".validatebox-invalid");
|
||||
_4c.filter(":not(:disabled):first").focus();
|
||||
return _4c.length==0;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
function _45(_4d,_4e){
|
||||
var _4f=$.data(_4d,"form").options;
|
||||
_4f.novalidate=_4e;
|
||||
$(_4d).find(".validatebox-text:not(:disabled)").validatebox(_4e?"disableValidation":"enableValidation");
|
||||
};
|
||||
$.fn.form=function(_50,_51){
|
||||
if(typeof _50=="string"){
|
||||
this.each(function(){
|
||||
_46(this);
|
||||
});
|
||||
return $.fn.form.methods[_50](this,_51);
|
||||
}
|
||||
return this.each(function(){
|
||||
_46(this,_50);
|
||||
_42(this);
|
||||
});
|
||||
};
|
||||
$.fn.form.methods={options:function(jq){
|
||||
return $.data(jq[0],"form").options;
|
||||
},submit:function(jq,_52){
|
||||
return jq.each(function(){
|
||||
_1(this,_52);
|
||||
});
|
||||
},load:function(jq,_53){
|
||||
return jq.each(function(){
|
||||
_20(this,_53);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_34(this);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
_3c(this);
|
||||
});
|
||||
},validate:function(jq){
|
||||
return _4a(jq[0]);
|
||||
},disableValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
_45(this,true);
|
||||
});
|
||||
},enableValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
_45(this,false);
|
||||
});
|
||||
},resetValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).find(".validatebox-text:not(:disabled)").validatebox("resetValidation");
|
||||
});
|
||||
},resetDirty:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).form("options").dirtyFields=[];
|
||||
});
|
||||
}};
|
||||
$.fn.form.parseOptions=function(_54){
|
||||
var t=$(_54);
|
||||
return $.extend({},$.parser.parseOptions(_54,[{ajax:"boolean",dirty:"boolean"}]),{url:(t.attr("action")?t.attr("action"):undefined)});
|
||||
};
|
||||
$.fn.form.defaults={fieldTypes:["tagbox","combobox","combotree","combogrid","combotreegrid","datetimebox","datebox","timepicker","combo","datetimespinner","timespinner","numberspinner","spinner","slider","searchbox","numberbox","passwordbox","filebox","textbox","switchbutton","radiobutton","checkbox"],novalidate:false,ajax:true,iframe:true,dirty:false,dirtyFields:[],url:null,queryParams:{},onSubmit:function(_55){
|
||||
return $(this).form("validate");
|
||||
},onProgress:function(_56){
|
||||
},success:function(_57){
|
||||
},onBeforeLoad:function(_58){
|
||||
},onLoadSuccess:function(_59){
|
||||
},onLoadError:function(){
|
||||
},onChange:function(_5a){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
530
static/jeasyui/plugins/jquery.layout.js
Executable file
530
static/jeasyui/plugins/jquery.layout.js
Executable file
@@ -0,0 +1,530 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=false;
|
||||
function _2(_3,_4){
|
||||
var _5=$.data(_3,"layout");
|
||||
var _6=_5.options;
|
||||
var _7=_5.panels;
|
||||
var cc=$(_3);
|
||||
if(_4){
|
||||
$.extend(_6,{width:_4.width,height:_4.height});
|
||||
}
|
||||
if(_3.tagName.toLowerCase()=="body"){
|
||||
cc._size("fit");
|
||||
}else{
|
||||
cc._size(_6);
|
||||
}
|
||||
var _8={top:0,left:0,width:cc.width(),height:cc.height()};
|
||||
_9(_a(_7.expandNorth)?_7.expandNorth:_7.north,"n");
|
||||
_9(_a(_7.expandSouth)?_7.expandSouth:_7.south,"s");
|
||||
_b(_a(_7.expandEast)?_7.expandEast:_7.east,"e");
|
||||
_b(_a(_7.expandWest)?_7.expandWest:_7.west,"w");
|
||||
_7.center.panel("resize",_8);
|
||||
function _9(pp,_c){
|
||||
if(!pp.length||!_a(pp)){
|
||||
return;
|
||||
}
|
||||
var _d=pp.panel("options");
|
||||
pp.panel("resize",{width:cc.width(),height:_d.height});
|
||||
var _e=pp.panel("panel").outerHeight();
|
||||
pp.panel("move",{left:0,top:(_c=="n"?0:cc.height()-_e)});
|
||||
_8.height-=_e;
|
||||
if(_c=="n"){
|
||||
_8.top+=_e;
|
||||
if(!_d.split&&_d.border){
|
||||
_8.top--;
|
||||
}
|
||||
}
|
||||
if(!_d.split&&_d.border){
|
||||
_8.height++;
|
||||
}
|
||||
};
|
||||
function _b(pp,_f){
|
||||
if(!pp.length||!_a(pp)){
|
||||
return;
|
||||
}
|
||||
var _10=pp.panel("options");
|
||||
pp.panel("resize",{width:_10.width,height:_8.height});
|
||||
var _11=pp.panel("panel").outerWidth();
|
||||
pp.panel("move",{left:(_f=="e"?cc.width()-_11:0),top:_8.top});
|
||||
_8.width-=_11;
|
||||
if(_f=="w"){
|
||||
_8.left+=_11;
|
||||
if(!_10.split&&_10.border){
|
||||
_8.left--;
|
||||
}
|
||||
}
|
||||
if(!_10.split&&_10.border){
|
||||
_8.width++;
|
||||
}
|
||||
};
|
||||
};
|
||||
function _12(_13){
|
||||
var cc=$(_13);
|
||||
cc.addClass("layout");
|
||||
function _14(el){
|
||||
var _15=$.fn.layout.parsePanelOptions(el);
|
||||
if("north,south,east,west,center".indexOf(_15.region)>=0){
|
||||
_19(_13,_15,el);
|
||||
}
|
||||
};
|
||||
var _16=cc.layout("options");
|
||||
var _17=_16.onAdd;
|
||||
_16.onAdd=function(){
|
||||
};
|
||||
cc.find(">div,>form>div").each(function(){
|
||||
_14(this);
|
||||
});
|
||||
_16.onAdd=_17;
|
||||
cc.append("<div class=\"layout-split-proxy-h\"></div><div class=\"layout-split-proxy-v\"></div>");
|
||||
cc._bind("_resize",function(e,_18){
|
||||
if($(this).hasClass("easyui-fluid")||_18){
|
||||
_2(_13);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
function _19(_1a,_1b,el){
|
||||
_1b.region=_1b.region||"center";
|
||||
var _1c=$.data(_1a,"layout").panels;
|
||||
var cc=$(_1a);
|
||||
var dir=_1b.region;
|
||||
if(_1c[dir].length){
|
||||
return;
|
||||
}
|
||||
var pp=$(el);
|
||||
if(!pp.length){
|
||||
pp=$("<div></div>").appendTo(cc);
|
||||
}
|
||||
var _1d=$.extend({},$.fn.layout.paneldefaults,{width:(pp.length?parseInt(pp[0].style.width)||pp.outerWidth():"auto"),height:(pp.length?parseInt(pp[0].style.height)||pp.outerHeight():"auto"),doSize:false,collapsible:true,onOpen:function(){
|
||||
var _1e=$(this).panel("header").children("div.panel-tool");
|
||||
_1e.children("a.panel-tool-collapse").hide();
|
||||
var _1f={north:"up",south:"down",east:"right",west:"left"};
|
||||
if(!_1f[dir]){
|
||||
return;
|
||||
}
|
||||
var _20="layout-button-"+_1f[dir];
|
||||
var t=_1e.children("a."+_20);
|
||||
if(!t.length){
|
||||
t=$("<a href=\"javascript:;\"></a>").addClass(_20).appendTo(_1e);
|
||||
t._bind("click",{dir:dir},function(e){
|
||||
_39(_1a,e.data.dir);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
$(this).panel("options").collapsible?t.show():t.hide();
|
||||
}},_1b,{cls:((_1b.cls||"")+" layout-panel layout-panel-"+dir),bodyCls:((_1b.bodyCls||"")+" layout-body")});
|
||||
pp.panel(_1d);
|
||||
_1c[dir]=pp;
|
||||
var _21={north:"s",south:"n",east:"w",west:"e"};
|
||||
var _22=pp.panel("panel");
|
||||
if(pp.panel("options").split){
|
||||
_22.addClass("layout-split-"+dir);
|
||||
}
|
||||
_22.resizable($.extend({},{handles:(_21[dir]||""),disabled:(!pp.panel("options").split),onStartResize:function(e){
|
||||
_1=true;
|
||||
if(dir=="north"||dir=="south"){
|
||||
var _23=$(">div.layout-split-proxy-v",_1a);
|
||||
}else{
|
||||
var _23=$(">div.layout-split-proxy-h",_1a);
|
||||
}
|
||||
var top=0,_24=0,_25=0,_26=0;
|
||||
var pos={display:"block"};
|
||||
if(dir=="north"){
|
||||
pos.top=parseInt(_22.css("top"))+_22.outerHeight()-_23.height();
|
||||
pos.left=parseInt(_22.css("left"));
|
||||
pos.width=_22.outerWidth();
|
||||
pos.height=_23.height();
|
||||
}else{
|
||||
if(dir=="south"){
|
||||
pos.top=parseInt(_22.css("top"));
|
||||
pos.left=parseInt(_22.css("left"));
|
||||
pos.width=_22.outerWidth();
|
||||
pos.height=_23.height();
|
||||
}else{
|
||||
if(dir=="east"){
|
||||
pos.top=parseInt(_22.css("top"))||0;
|
||||
pos.left=parseInt(_22.css("left"))||0;
|
||||
pos.width=_23.width();
|
||||
pos.height=_22.outerHeight();
|
||||
}else{
|
||||
if(dir=="west"){
|
||||
pos.top=parseInt(_22.css("top"))||0;
|
||||
pos.left=_22.outerWidth()-_23.width();
|
||||
pos.width=_23.width();
|
||||
pos.height=_22.outerHeight();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_23.css(pos);
|
||||
$("<div class=\"layout-mask\"></div>").css({left:0,top:0,width:cc.width(),height:cc.height()}).appendTo(cc);
|
||||
},onResize:function(e){
|
||||
if(dir=="north"||dir=="south"){
|
||||
var _27=_28(this);
|
||||
$(this).resizable("options").maxHeight=_27;
|
||||
var _29=$(">div.layout-split-proxy-v",_1a);
|
||||
var top=dir=="north"?e.data.height-_29.height():$(_1a).height()-e.data.height;
|
||||
_29.css("top",top);
|
||||
}else{
|
||||
var _2a=_28(this);
|
||||
$(this).resizable("options").maxWidth=_2a;
|
||||
var _29=$(">div.layout-split-proxy-h",_1a);
|
||||
var _2b=dir=="west"?e.data.width-_29.width():$(_1a).width()-e.data.width;
|
||||
_29.css("left",_2b);
|
||||
}
|
||||
return false;
|
||||
},onStopResize:function(e){
|
||||
cc.children("div.layout-split-proxy-v,div.layout-split-proxy-h").hide();
|
||||
pp.panel("resize",e.data);
|
||||
_2(_1a);
|
||||
_1=false;
|
||||
cc.find(">div.layout-mask").remove();
|
||||
}},_1b));
|
||||
cc.layout("options").onAdd.call(_1a,dir);
|
||||
function _28(p){
|
||||
var _2c="expand"+dir.substring(0,1).toUpperCase()+dir.substring(1);
|
||||
var _2d=_1c["center"];
|
||||
var _2e=(dir=="north"||dir=="south")?"minHeight":"minWidth";
|
||||
var _2f=(dir=="north"||dir=="south")?"maxHeight":"maxWidth";
|
||||
var _30=(dir=="north"||dir=="south")?"_outerHeight":"_outerWidth";
|
||||
var _31=$.parser.parseValue(_2f,_1c[dir].panel("options")[_2f],$(_1a));
|
||||
var _32=$.parser.parseValue(_2e,_2d.panel("options")[_2e],$(_1a));
|
||||
var _33=_2d.panel("panel")[_30]()-_32;
|
||||
if(_a(_1c[_2c])){
|
||||
_33+=_1c[_2c][_30]()-1;
|
||||
}else{
|
||||
_33+=$(p)[_30]();
|
||||
}
|
||||
if(_33>_31){
|
||||
_33=_31;
|
||||
}
|
||||
return _33;
|
||||
};
|
||||
};
|
||||
function _34(_35,_36){
|
||||
var _37=$.data(_35,"layout").panels;
|
||||
if(_37[_36].length){
|
||||
_37[_36].panel("destroy");
|
||||
_37[_36]=$();
|
||||
var _38="expand"+_36.substring(0,1).toUpperCase()+_36.substring(1);
|
||||
if(_37[_38]){
|
||||
_37[_38].panel("destroy");
|
||||
_37[_38]=undefined;
|
||||
}
|
||||
$(_35).layout("options").onRemove.call(_35,_36);
|
||||
}
|
||||
};
|
||||
function _39(_3a,_3b,_3c){
|
||||
if(_3c==undefined){
|
||||
_3c="normal";
|
||||
}
|
||||
var _3d=$.data(_3a,"layout");
|
||||
var _3e=_3d.panels;
|
||||
var p=_3e[_3b];
|
||||
var _3f=p.panel("options");
|
||||
if(_3f.onBeforeCollapse.call(p)==false){
|
||||
return;
|
||||
}
|
||||
var _40="expand"+_3b.substring(0,1).toUpperCase()+_3b.substring(1);
|
||||
if(!_3e[_40]){
|
||||
_3e[_40]=_41(_3b);
|
||||
var ep=_3e[_40].panel("panel");
|
||||
if(!_3f.expandMode){
|
||||
ep.css("cursor","default");
|
||||
}else{
|
||||
ep._bind("click",function(){
|
||||
if(_3f.expandMode=="dock"){
|
||||
_53(_3a,_3b);
|
||||
}else{
|
||||
p.panel("expand",false).panel("open");
|
||||
var _42=_43();
|
||||
p.panel("resize",_42.collapse);
|
||||
p.panel("panel")._unbind(".layout")._bind("mouseleave.layout",{region:_3b},function(e){
|
||||
var _44=this;
|
||||
_3d.collapseTimer=setTimeout(function(){
|
||||
$(_44).stop(true,true);
|
||||
if(_1==true){
|
||||
return;
|
||||
}
|
||||
if($("body>div.combo-p>div.combo-panel:visible").length){
|
||||
return;
|
||||
}
|
||||
_39(_3a,e.data.region);
|
||||
},_3d.options.collapseDelay);
|
||||
});
|
||||
p.panel("panel").animate(_42.expand,function(){
|
||||
$(_3a).layout("options").onExpand.call(_3a,_3b);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
var _45=_43();
|
||||
if(!_a(_3e[_40])){
|
||||
_3e.center.panel("resize",_45.resizeC);
|
||||
}
|
||||
p.panel("panel").animate(_45.collapse,_3c,function(){
|
||||
p.panel("collapse",false).panel("close");
|
||||
_3e[_40].panel("open").panel("resize",_45.expandP);
|
||||
$(this)._unbind(".layout");
|
||||
$(_3a).layout("options").onCollapse.call(_3a,_3b);
|
||||
});
|
||||
function _41(dir){
|
||||
var _46={"east":"left","west":"right","north":"down","south":"up"};
|
||||
var _47=(_3f.region=="north"||_3f.region=="south");
|
||||
var _48="layout-button-"+_46[dir];
|
||||
var p=$("<div></div>").appendTo(_3a);
|
||||
p.panel($.extend({},$.fn.layout.paneldefaults,{cls:("layout-expand layout-expand-"+dir),title:" ",titleDirection:_3f.titleDirection,iconCls:(_3f.hideCollapsedContent?null:_3f.iconCls),closed:true,minWidth:0,minHeight:0,doSize:false,region:_3f.region,collapsedSize:_3f.collapsedSize,noheader:(!_47&&_3f.hideExpandTool),tools:((_47&&_3f.hideExpandTool)?null:[{iconCls:_48,handler:function(){
|
||||
_53(_3a,_3b);
|
||||
return false;
|
||||
}}]),onResize:function(){
|
||||
var _49=$(this).children(".layout-expand-title");
|
||||
if(_49.length){
|
||||
var _4a=$(this).children(".panel-icon");
|
||||
var _4b=_4a.length>0?(_4a._outerHeight()+2):0;
|
||||
_49._outerWidth($(this).height()-_4b);
|
||||
var _4c=($(this).width()-Math.min(_49._outerWidth(),_49._outerHeight()))/2;
|
||||
var top=Math.max(_49._outerWidth(),_49._outerHeight());
|
||||
if(_49.hasClass("layout-expand-title-down")){
|
||||
_4c+=Math.min(_49._outerWidth(),_49._outerHeight());
|
||||
top=0;
|
||||
}
|
||||
top+=_4b;
|
||||
_49.css({left:(_4c+"px"),top:(top+"px")});
|
||||
}
|
||||
}}));
|
||||
if(!_3f.hideCollapsedContent){
|
||||
var _4d=typeof _3f.collapsedContent=="function"?_3f.collapsedContent.call(p[0],_3f.title):_3f.collapsedContent;
|
||||
_47?p.panel("setTitle",_4d):p.html(_4d);
|
||||
}
|
||||
p.panel("panel").hover(function(){
|
||||
$(this).addClass("layout-expand-over");
|
||||
},function(){
|
||||
$(this).removeClass("layout-expand-over");
|
||||
});
|
||||
return p;
|
||||
};
|
||||
function _43(){
|
||||
var cc=$(_3a);
|
||||
var _4e=_3e.center.panel("options");
|
||||
var _4f=_3f.collapsedSize;
|
||||
if(_3b=="east"){
|
||||
var _50=p.panel("panel")._outerWidth();
|
||||
var _51=_4e.width+_50-_4f;
|
||||
if(_3f.split||!_3f.border){
|
||||
_51++;
|
||||
}
|
||||
return {resizeC:{width:_51},expand:{left:cc.width()-_50},expandP:{top:_4e.top,left:cc.width()-_4f,width:_4f,height:_4e.height},collapse:{left:cc.width(),top:_4e.top,height:_4e.height}};
|
||||
}else{
|
||||
if(_3b=="west"){
|
||||
var _50=p.panel("panel")._outerWidth();
|
||||
var _51=_4e.width+_50-_4f;
|
||||
if(_3f.split||!_3f.border){
|
||||
_51++;
|
||||
}
|
||||
return {resizeC:{width:_51,left:_4f-1},expand:{left:0},expandP:{left:0,top:_4e.top,width:_4f,height:_4e.height},collapse:{left:-_50,top:_4e.top,height:_4e.height}};
|
||||
}else{
|
||||
if(_3b=="north"){
|
||||
var _52=p.panel("panel")._outerHeight();
|
||||
var hh=_4e.height;
|
||||
if(!_a(_3e.expandNorth)){
|
||||
hh+=_52-_4f+((_3f.split||!_3f.border)?1:0);
|
||||
}
|
||||
_3e.east.add(_3e.west).add(_3e.expandEast).add(_3e.expandWest).panel("resize",{top:_4f-1,height:hh});
|
||||
return {resizeC:{top:_4f-1,height:hh},expand:{top:0},expandP:{top:0,left:0,width:cc.width(),height:_4f},collapse:{top:-_52,width:cc.width()}};
|
||||
}else{
|
||||
if(_3b=="south"){
|
||||
var _52=p.panel("panel")._outerHeight();
|
||||
var hh=_4e.height;
|
||||
if(!_a(_3e.expandSouth)){
|
||||
hh+=_52-_4f+((_3f.split||!_3f.border)?1:0);
|
||||
}
|
||||
_3e.east.add(_3e.west).add(_3e.expandEast).add(_3e.expandWest).panel("resize",{height:hh});
|
||||
return {resizeC:{height:hh},expand:{top:cc.height()-_52},expandP:{top:cc.height()-_4f,left:0,width:cc.width(),height:_4f},collapse:{top:cc.height(),width:cc.width()}};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
function _53(_54,_55){
|
||||
var _56=$.data(_54,"layout").panels;
|
||||
var p=_56[_55];
|
||||
var _57=p.panel("options");
|
||||
if(_57.onBeforeExpand.call(p)==false){
|
||||
return;
|
||||
}
|
||||
var _58="expand"+_55.substring(0,1).toUpperCase()+_55.substring(1);
|
||||
if(_56[_58]){
|
||||
_56[_58].panel("close");
|
||||
p.panel("panel").stop(true,true);
|
||||
p.panel("expand",false).panel("open");
|
||||
var _59=_5a();
|
||||
p.panel("resize",_59.collapse);
|
||||
p.panel("panel").animate(_59.expand,function(){
|
||||
_2(_54);
|
||||
$(_54).layout("options").onExpand.call(_54,_55);
|
||||
});
|
||||
}
|
||||
function _5a(){
|
||||
var cc=$(_54);
|
||||
var _5b=_56.center.panel("options");
|
||||
if(_55=="east"&&_56.expandEast){
|
||||
return {collapse:{left:cc.width(),top:_5b.top,height:_5b.height},expand:{left:cc.width()-p.panel("panel")._outerWidth()}};
|
||||
}else{
|
||||
if(_55=="west"&&_56.expandWest){
|
||||
return {collapse:{left:-p.panel("panel")._outerWidth(),top:_5b.top,height:_5b.height},expand:{left:0}};
|
||||
}else{
|
||||
if(_55=="north"&&_56.expandNorth){
|
||||
return {collapse:{top:-p.panel("panel")._outerHeight(),width:cc.width()},expand:{top:0}};
|
||||
}else{
|
||||
if(_55=="south"&&_56.expandSouth){
|
||||
return {collapse:{top:cc.height(),width:cc.width()},expand:{top:cc.height()-p.panel("panel")._outerHeight()}};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
function _a(pp){
|
||||
if(!pp){
|
||||
return false;
|
||||
}
|
||||
if(pp.length){
|
||||
return pp.panel("panel").is(":visible");
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
function _5c(_5d){
|
||||
var _5e=$.data(_5d,"layout");
|
||||
var _5f=_5e.options;
|
||||
var _60=_5e.panels;
|
||||
var _61=_5f.onCollapse;
|
||||
_5f.onCollapse=function(){
|
||||
};
|
||||
_62("east");
|
||||
_62("west");
|
||||
_62("north");
|
||||
_62("south");
|
||||
_5f.onCollapse=_61;
|
||||
function _62(_63){
|
||||
var p=_60[_63];
|
||||
if(p.length&&p.panel("options").collapsed){
|
||||
_39(_5d,_63,0);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _64(_65,_66,_67){
|
||||
var p=$(_65).layout("panel",_66);
|
||||
p.panel("options").split=_67;
|
||||
var cls="layout-split-"+_66;
|
||||
var _68=p.panel("panel").removeClass(cls);
|
||||
if(_67){
|
||||
_68.addClass(cls);
|
||||
}
|
||||
_68.resizable({disabled:(!_67)});
|
||||
_2(_65);
|
||||
};
|
||||
$.fn.layout=function(_69,_6a){
|
||||
if(typeof _69=="string"){
|
||||
return $.fn.layout.methods[_69](this,_6a);
|
||||
}
|
||||
_69=_69||{};
|
||||
return this.each(function(){
|
||||
var _6b=$.data(this,"layout");
|
||||
if(_6b){
|
||||
$.extend(_6b.options,_69);
|
||||
}else{
|
||||
var _6c=$.extend({},$.fn.layout.defaults,$.fn.layout.parseOptions(this),_69);
|
||||
$.data(this,"layout",{options:_6c,panels:{center:$(),north:$(),south:$(),east:$(),west:$()}});
|
||||
_12(this);
|
||||
}
|
||||
_2(this);
|
||||
_5c(this);
|
||||
});
|
||||
};
|
||||
$.fn.layout.methods={options:function(jq){
|
||||
return $.data(jq[0],"layout").options;
|
||||
},resize:function(jq,_6d){
|
||||
return jq.each(function(){
|
||||
_2(this,_6d);
|
||||
});
|
||||
},panel:function(jq,_6e){
|
||||
return $.data(jq[0],"layout").panels[_6e];
|
||||
},collapse:function(jq,_6f){
|
||||
return jq.each(function(){
|
||||
_39(this,_6f);
|
||||
});
|
||||
},expand:function(jq,_70){
|
||||
return jq.each(function(){
|
||||
_53(this,_70);
|
||||
});
|
||||
},add:function(jq,_71){
|
||||
return jq.each(function(){
|
||||
_19(this,_71);
|
||||
_2(this);
|
||||
if($(this).layout("panel",_71.region).panel("options").collapsed){
|
||||
_39(this,_71.region,0);
|
||||
}
|
||||
});
|
||||
},remove:function(jq,_72){
|
||||
return jq.each(function(){
|
||||
_34(this,_72);
|
||||
_2(this);
|
||||
});
|
||||
},split:function(jq,_73){
|
||||
return jq.each(function(){
|
||||
_64(this,_73,true);
|
||||
});
|
||||
},unsplit:function(jq,_74){
|
||||
return jq.each(function(){
|
||||
_64(this,_74,false);
|
||||
});
|
||||
},stopCollapsing:function(jq){
|
||||
return jq.each(function(){
|
||||
clearTimeout($(this).data("layout").collapseTimer);
|
||||
});
|
||||
}};
|
||||
$.fn.layout.parseOptions=function(_75){
|
||||
return $.extend({},$.parser.parseOptions(_75,[{fit:"boolean"}]));
|
||||
};
|
||||
$.fn.layout.defaults={fit:false,onExpand:function(_76){
|
||||
},onCollapse:function(_77){
|
||||
},onAdd:function(_78){
|
||||
},onRemove:function(_79){
|
||||
}};
|
||||
$.fn.layout.parsePanelOptions=function(_7a){
|
||||
var t=$(_7a);
|
||||
return $.extend({},$.fn.panel.parseOptions(_7a),$.parser.parseOptions(_7a,["region",{split:"boolean",collpasedSize:"number",minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number"}]));
|
||||
};
|
||||
$.fn.layout.paneldefaults=$.extend({},$.fn.panel.defaults,{region:null,split:false,collapseDelay:100,collapsedSize:32,expandMode:"float",hideExpandTool:false,hideCollapsedContent:true,collapsedContent:function(_7b){
|
||||
var p=$(this);
|
||||
var _7c=p.panel("options");
|
||||
if(_7c.region=="north"||_7c.region=="south"){
|
||||
return _7b;
|
||||
}
|
||||
var cc=[];
|
||||
if(_7c.iconCls){
|
||||
cc.push("<div class=\"panel-icon "+_7c.iconCls+"\"></div>");
|
||||
}
|
||||
cc.push("<div class=\"panel-title layout-expand-title");
|
||||
cc.push(" layout-expand-title-"+_7c.titleDirection);
|
||||
cc.push(_7c.iconCls?" layout-expand-with-icon":"");
|
||||
cc.push("\">");
|
||||
cc.push(_7b);
|
||||
cc.push("</div>");
|
||||
return cc.join("");
|
||||
},minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000});
|
||||
})(jQuery);
|
||||
|
||||
185
static/jeasyui/plugins/jquery.linkbutton.js
Executable file
185
static/jeasyui/plugins/jquery.linkbutton.js
Executable file
@@ -0,0 +1,185 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2,_3){
|
||||
var _4=$.data(_2,"linkbutton").options;
|
||||
if(_3){
|
||||
$.extend(_4,_3);
|
||||
}
|
||||
if(_4.width||_4.height||_4.fit){
|
||||
var _5=$(_2);
|
||||
var _6=_5.parent();
|
||||
var _7=_5.is(":visible");
|
||||
if(!_7){
|
||||
var _8=$("<div style=\"display:none\"></div>").insertBefore(_2);
|
||||
var _9={position:_5.css("position"),display:_5.css("display"),left:_5.css("left")};
|
||||
_5.appendTo("body");
|
||||
_5.css({position:"absolute",display:"inline-block",left:-20000});
|
||||
}
|
||||
_5._size(_4,_6);
|
||||
var _a=_5.find(".l-btn-left");
|
||||
_a.css("margin-top",0);
|
||||
_a.css("margin-top",parseInt((_5.height()-_a.height())/2)+"px");
|
||||
if(!_7){
|
||||
_5.insertAfter(_8);
|
||||
_5.css(_9);
|
||||
_8.remove();
|
||||
}
|
||||
}
|
||||
};
|
||||
function _b(_c){
|
||||
var _d=$.data(_c,"linkbutton").options;
|
||||
var t=$(_c).empty();
|
||||
t.addClass("l-btn").removeClass("l-btn-plain l-btn-selected l-btn-plain-selected l-btn-outline");
|
||||
t.removeClass("l-btn-small l-btn-medium l-btn-large").addClass("l-btn-"+_d.size);
|
||||
if(_d.plain){
|
||||
t.addClass("l-btn-plain");
|
||||
}
|
||||
if(_d.outline){
|
||||
t.addClass("l-btn-outline");
|
||||
}
|
||||
if(_d.selected){
|
||||
t.addClass(_d.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected");
|
||||
}
|
||||
t.attr("group",_d.group||"");
|
||||
t.attr("id",_d.id||"");
|
||||
var _e=$("<span class=\"l-btn-left\"></span>").appendTo(t);
|
||||
if(_d.text){
|
||||
$("<span class=\"l-btn-text\"></span>").html(_d.text).appendTo(_e);
|
||||
}else{
|
||||
$("<span class=\"l-btn-text l-btn-empty\"> </span>").appendTo(_e);
|
||||
}
|
||||
if(_d.iconCls){
|
||||
$("<span class=\"l-btn-icon\"> </span>").addClass(_d.iconCls).appendTo(_e);
|
||||
_e.addClass("l-btn-icon-"+_d.iconAlign);
|
||||
}
|
||||
t._unbind(".linkbutton")._bind("focus.linkbutton",function(){
|
||||
if(!_d.disabled){
|
||||
$(this).addClass("l-btn-focus");
|
||||
}
|
||||
})._bind("blur.linkbutton",function(){
|
||||
$(this).removeClass("l-btn-focus");
|
||||
})._bind("click.linkbutton",function(){
|
||||
if(!_d.disabled){
|
||||
if(_d.toggle){
|
||||
if(_d.selected){
|
||||
$(this).linkbutton("unselect");
|
||||
}else{
|
||||
$(this).linkbutton("select");
|
||||
}
|
||||
}
|
||||
_d.onClick.call(this);
|
||||
}
|
||||
});
|
||||
_f(_c,_d.selected);
|
||||
_10(_c,_d.disabled);
|
||||
};
|
||||
function _f(_11,_12){
|
||||
var _13=$.data(_11,"linkbutton").options;
|
||||
if(_12){
|
||||
if(_13.group){
|
||||
$("a.l-btn[group=\""+_13.group+"\"]").each(function(){
|
||||
var o=$(this).linkbutton("options");
|
||||
if(o.toggle){
|
||||
$(this).removeClass("l-btn-selected l-btn-plain-selected");
|
||||
o.selected=false;
|
||||
}
|
||||
});
|
||||
}
|
||||
$(_11).addClass(_13.plain?"l-btn-selected l-btn-plain-selected":"l-btn-selected");
|
||||
_13.selected=true;
|
||||
}else{
|
||||
if(!_13.group){
|
||||
$(_11).removeClass("l-btn-selected l-btn-plain-selected");
|
||||
_13.selected=false;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _10(_14,_15){
|
||||
var _16=$.data(_14,"linkbutton");
|
||||
var _17=_16.options;
|
||||
$(_14).removeClass("l-btn-disabled l-btn-plain-disabled");
|
||||
if(_15){
|
||||
_17.disabled=true;
|
||||
var _18=$(_14).attr("href");
|
||||
if(_18){
|
||||
_16.href=_18;
|
||||
$(_14).attr("href","javascript:;");
|
||||
}
|
||||
if(_14.onclick){
|
||||
_16.onclick=_14.onclick;
|
||||
_14.onclick=null;
|
||||
}
|
||||
_17.plain?$(_14).addClass("l-btn-disabled l-btn-plain-disabled"):$(_14).addClass("l-btn-disabled");
|
||||
}else{
|
||||
_17.disabled=false;
|
||||
if(_16.href){
|
||||
$(_14).attr("href",_16.href);
|
||||
}
|
||||
if(_16.onclick){
|
||||
_14.onclick=_16.onclick;
|
||||
}
|
||||
}
|
||||
$(_14)._propAttr("disabled",_15);
|
||||
};
|
||||
$.fn.linkbutton=function(_19,_1a){
|
||||
if(typeof _19=="string"){
|
||||
return $.fn.linkbutton.methods[_19](this,_1a);
|
||||
}
|
||||
_19=_19||{};
|
||||
return this.each(function(){
|
||||
var _1b=$.data(this,"linkbutton");
|
||||
if(_1b){
|
||||
$.extend(_1b.options,_19);
|
||||
}else{
|
||||
$.data(this,"linkbutton",{options:$.extend({},$.fn.linkbutton.defaults,$.fn.linkbutton.parseOptions(this),_19)});
|
||||
$(this)._propAttr("disabled",false);
|
||||
$(this)._bind("_resize",function(e,_1c){
|
||||
if($(this).hasClass("easyui-fluid")||_1c){
|
||||
_1(this);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
_b(this);
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.linkbutton.methods={options:function(jq){
|
||||
return $.data(jq[0],"linkbutton").options;
|
||||
},resize:function(jq,_1d){
|
||||
return jq.each(function(){
|
||||
_1(this,_1d);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,false);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,true);
|
||||
});
|
||||
},select:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,true);
|
||||
});
|
||||
},unselect:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,false);
|
||||
});
|
||||
}};
|
||||
$.fn.linkbutton.parseOptions=function(_1e){
|
||||
var t=$(_1e);
|
||||
return $.extend({},$.parser.parseOptions(_1e,["id","iconCls","iconAlign","group","size","text",{plain:"boolean",toggle:"boolean",selected:"boolean",outline:"boolean"}]),{disabled:(t.attr("disabled")?true:undefined),text:($.trim(t.html())||undefined),iconCls:(t.attr("icon")||t.attr("iconCls"))});
|
||||
};
|
||||
$.fn.linkbutton.defaults={id:null,disabled:false,toggle:false,selected:false,outline:false,group:null,plain:false,text:"",iconCls:null,iconAlign:"left",size:"small",onClick:function(){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
221
static/jeasyui/plugins/jquery.maskedbox.js
Normal file
221
static/jeasyui/plugins/jquery.maskedbox.js
Normal file
@@ -0,0 +1,221 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$(_2).data("maskedbox");
|
||||
var _4=_3.options;
|
||||
$(_2).textbox(_4);
|
||||
$(_2).maskedbox("initValue",_4.value);
|
||||
};
|
||||
function _5(_6,_7){
|
||||
var _8=$(_6).maskedbox("options");
|
||||
var tt=(_7||$(_6).maskedbox("getText")||"").split("");
|
||||
var vv=[];
|
||||
for(var i=0;i<_8.mask.length;i++){
|
||||
if(_8.masks[_8.mask[i]]){
|
||||
var t=tt[i];
|
||||
vv.push(t!=_8.promptChar?t:" ");
|
||||
}
|
||||
}
|
||||
return vv.join("");
|
||||
};
|
||||
function _9(_a,_b){
|
||||
var _c=$(_a).maskedbox("options");
|
||||
var cc=_b.split("");
|
||||
var tt=[];
|
||||
for(var i=0;i<_c.mask.length;i++){
|
||||
var m=_c.mask[i];
|
||||
var r=_c.masks[m];
|
||||
if(r){
|
||||
var c=cc.shift();
|
||||
if(c!=undefined){
|
||||
var d=new RegExp(r,"i");
|
||||
if(d.test(c)){
|
||||
tt.push(c);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
tt.push(_c.promptChar);
|
||||
}else{
|
||||
tt.push(m);
|
||||
}
|
||||
}
|
||||
return tt.join("");
|
||||
};
|
||||
function _d(_e,c){
|
||||
var _f=$(_e).maskedbox("options");
|
||||
var _10=$(_e).maskedbox("getSelectionRange");
|
||||
var _11=_12(_e,_10.start);
|
||||
var end=_12(_e,_10.end);
|
||||
if(_11!=-1){
|
||||
var r=new RegExp(_f.masks[_f.mask[_11]],"i");
|
||||
if(r.test(c)){
|
||||
var vv=_5(_e).split("");
|
||||
var _13=_11-_14(_e,_11);
|
||||
var _15=end-_14(_e,end);
|
||||
vv.splice(_13,_15-_13,c);
|
||||
$(_e).maskedbox("setValue",_9(_e,vv.join("")));
|
||||
_11=_12(_e,++_11);
|
||||
$(_e).maskedbox("setSelectionRange",{start:_11,end:_11});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _16(_17,_18){
|
||||
var _19=$(_17).maskedbox("options");
|
||||
var vv=_5(_17).split("");
|
||||
var _1a=$(_17).maskedbox("getSelectionRange");
|
||||
if(_1a.start==_1a.end){
|
||||
if(_18){
|
||||
var _1b=_1c(_17,_1a.start);
|
||||
}else{
|
||||
var _1b=_12(_17,_1a.start);
|
||||
}
|
||||
var _1d=_1b-_14(_17,_1b);
|
||||
if(_1d>=0){
|
||||
vv.splice(_1d,1);
|
||||
}
|
||||
}else{
|
||||
var _1b=_12(_17,_1a.start);
|
||||
var end=_1c(_17,_1a.end);
|
||||
var _1d=_1b-_14(_17,_1b);
|
||||
var _1e=end-_14(_17,end);
|
||||
vv.splice(_1d,_1e-_1d+1);
|
||||
}
|
||||
$(_17).maskedbox("setValue",_9(_17,vv.join("")));
|
||||
$(_17).maskedbox("setSelectionRange",{start:_1b,end:_1b});
|
||||
};
|
||||
function _14(_1f,pos){
|
||||
var _20=$(_1f).maskedbox("options");
|
||||
var _21=0;
|
||||
if(pos>=_20.mask.length){
|
||||
pos--;
|
||||
}
|
||||
for(var i=pos;i>=0;i--){
|
||||
if(_20.masks[_20.mask[i]]==undefined){
|
||||
_21++;
|
||||
}
|
||||
}
|
||||
return _21;
|
||||
};
|
||||
function _12(_22,pos){
|
||||
var _23=$(_22).maskedbox("options");
|
||||
var m=_23.mask[pos];
|
||||
var r=_23.masks[m];
|
||||
while(pos<_23.mask.length&&!r){
|
||||
pos++;
|
||||
m=_23.mask[pos];
|
||||
r=_23.masks[m];
|
||||
}
|
||||
return pos;
|
||||
};
|
||||
function _1c(_24,pos){
|
||||
var _25=$(_24).maskedbox("options");
|
||||
var m=_25.mask[--pos];
|
||||
var r=_25.masks[m];
|
||||
while(pos>=0&&!r){
|
||||
pos--;
|
||||
m=_25.mask[pos];
|
||||
r=_25.masks[m];
|
||||
}
|
||||
return pos<0?0:pos;
|
||||
};
|
||||
function _26(e){
|
||||
if(e.metaKey||e.ctrlKey){
|
||||
return;
|
||||
}
|
||||
var _27=e.data.target;
|
||||
var _28=$(_27).maskedbox("options");
|
||||
var _29=[9,13,35,36,37,39];
|
||||
if($.inArray(e.keyCode,_29)!=-1){
|
||||
return true;
|
||||
}
|
||||
if(e.keyCode>=96&&e.keyCode<=105){
|
||||
e.keyCode-=48;
|
||||
}
|
||||
var c=String.fromCharCode(e.keyCode);
|
||||
if(e.keyCode>=65&&e.keyCode<=90&&!e.shiftKey){
|
||||
c=c.toLowerCase();
|
||||
}else{
|
||||
if(e.keyCode==189){
|
||||
c="-";
|
||||
}else{
|
||||
if(e.keyCode==187){
|
||||
c="+";
|
||||
}else{
|
||||
if(e.keyCode==190){
|
||||
c=".";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(e.keyCode==8){
|
||||
_16(_27,true);
|
||||
}else{
|
||||
if(e.keyCode==46){
|
||||
_16(_27,false);
|
||||
}else{
|
||||
_d(_27,c);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
$.extend($.fn.textbox.methods,{inputMask:function(jq,_2a){
|
||||
return jq.each(function(){
|
||||
var _2b=this;
|
||||
var _2c=$.extend({},$.fn.maskedbox.defaults,_2a);
|
||||
$.data(_2b,"maskedbox",{options:_2c});
|
||||
var _2d=$(_2b).textbox("textbox");
|
||||
_2d._unbind(".maskedbox");
|
||||
for(var _2e in _2c.inputEvents){
|
||||
_2d._bind(_2e+".maskedbox",{target:_2b},_2c.inputEvents[_2e]);
|
||||
}
|
||||
});
|
||||
}});
|
||||
$.fn.maskedbox=function(_2f,_30){
|
||||
if(typeof _2f=="string"){
|
||||
var _31=$.fn.maskedbox.methods[_2f];
|
||||
if(_31){
|
||||
return _31(this,_30);
|
||||
}else{
|
||||
return this.textbox(_2f,_30);
|
||||
}
|
||||
}
|
||||
_2f=_2f||{};
|
||||
return this.each(function(){
|
||||
var _32=$.data(this,"maskedbox");
|
||||
if(_32){
|
||||
$.extend(_32.options,_2f);
|
||||
}else{
|
||||
$.data(this,"maskedbox",{options:$.extend({},$.fn.maskedbox.defaults,$.fn.maskedbox.parseOptions(this),_2f)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.maskedbox.methods={options:function(jq){
|
||||
var _33=jq.textbox("options");
|
||||
return $.extend($.data(jq[0],"maskedbox").options,{width:_33.width,value:_33.value,originalValue:_33.originalValue,disabled:_33.disabled,readonly:_33.readonly});
|
||||
},initValue:function(jq,_34){
|
||||
return jq.each(function(){
|
||||
_34=_9(this,_5(this,_34));
|
||||
$(this).textbox("initValue",_34);
|
||||
});
|
||||
},setValue:function(jq,_35){
|
||||
return jq.each(function(){
|
||||
_35=_9(this,_5(this,_35));
|
||||
$(this).textbox("setValue",_35);
|
||||
});
|
||||
}};
|
||||
$.fn.maskedbox.parseOptions=function(_36){
|
||||
var t=$(_36);
|
||||
return $.extend({},$.fn.textbox.parseOptions(_36),$.parser.parseOptions(_36,["mask","promptChar"]),{});
|
||||
};
|
||||
$.fn.maskedbox.defaults=$.extend({},$.fn.textbox.defaults,{mask:"",promptChar:"_",masks:{"9":"[0-9]","a":"[a-zA-Z]","*":"[0-9a-zA-Z]"},inputEvents:{keydown:_26}});
|
||||
})(jQuery);
|
||||
|
||||
502
static/jeasyui/plugins/jquery.menu.js
Executable file
502
static/jeasyui/plugins/jquery.menu.js
Executable file
@@ -0,0 +1,502 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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(".menu")._bind("mousedown.menu",function(e){
|
||||
var m=$(e.target).closest("div.menu,div.combo-p");
|
||||
if(m.length){
|
||||
return;
|
||||
}
|
||||
$("body>div.menu-top:visible").not(".menu-inline").menu("hide");
|
||||
_1($("body>div.menu:visible").not(".menu-inline"));
|
||||
});
|
||||
});
|
||||
function _2(_3){
|
||||
var _4=$.data(_3,"menu").options;
|
||||
$(_3).addClass("menu-top");
|
||||
_4.inline?$(_3).addClass("menu-inline"):$(_3).appendTo("body");
|
||||
$(_3)._bind("_resize",function(e,_5){
|
||||
if($(this).hasClass("easyui-fluid")||_5){
|
||||
$(_3).menu("resize",_3);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
var _6=_7($(_3));
|
||||
for(var i=0;i<_6.length;i++){
|
||||
_b(_3,_6[i]);
|
||||
}
|
||||
function _7(_8){
|
||||
var _9=[];
|
||||
_8.addClass("menu");
|
||||
_9.push(_8);
|
||||
if(!_8.hasClass("menu-content")){
|
||||
_8.children("div").each(function(){
|
||||
var _a=$(this).children("div");
|
||||
if(_a.length){
|
||||
_a.appendTo("body");
|
||||
this.submenu=_a;
|
||||
var mm=_7(_a);
|
||||
_9=_9.concat(mm);
|
||||
}
|
||||
});
|
||||
}
|
||||
return _9;
|
||||
};
|
||||
};
|
||||
function _b(_c,_d){
|
||||
var _e=$(_d).addClass("menu");
|
||||
if(!_e.data("menu")){
|
||||
_e.data("menu",{options:$.parser.parseOptions(_e[0],["width","height"])});
|
||||
}
|
||||
if(!_e.hasClass("menu-content")){
|
||||
_e.children("div").each(function(){
|
||||
_f(_c,this);
|
||||
});
|
||||
$("<div class=\"menu-line\"></div>").prependTo(_e);
|
||||
}
|
||||
_10(_c,_e);
|
||||
if(!_e.hasClass("menu-inline")){
|
||||
_e.hide();
|
||||
}
|
||||
_11(_c,_e);
|
||||
};
|
||||
function _f(_12,div,_13){
|
||||
var _14=$(div);
|
||||
var _15=$.extend({},$.parser.parseOptions(_14[0],["id","name","iconCls","href",{separator:"boolean"}]),{disabled:(_14.attr("disabled")?true:undefined),text:$.trim(_14.html()),onclick:_14[0].onclick},_13||{});
|
||||
_15.onclick=_15.onclick||_15.handler||null;
|
||||
_14.data("menuitem",{options:_15});
|
||||
if(_15.separator){
|
||||
_14.addClass("menu-sep");
|
||||
}
|
||||
if(!_14.hasClass("menu-sep")){
|
||||
_14.addClass("menu-item");
|
||||
_14.empty().append($("<div class=\"menu-text\"></div>").html(_15.text));
|
||||
if(_15.iconCls){
|
||||
$("<div class=\"menu-icon\"></div>").addClass(_15.iconCls).appendTo(_14);
|
||||
}
|
||||
if(_15.id){
|
||||
_14.attr("id",_15.id);
|
||||
}
|
||||
if(_15.onclick){
|
||||
if(typeof _15.onclick=="string"){
|
||||
_14.attr("onclick",_15.onclick);
|
||||
}else{
|
||||
_14[0].onclick=eval(_15.onclick);
|
||||
}
|
||||
}
|
||||
if(_15.disabled){
|
||||
_16(_12,_14[0],true);
|
||||
}
|
||||
if(_14[0].submenu){
|
||||
$("<div class=\"menu-rightarrow\"></div>").appendTo(_14);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _10(_17,_18){
|
||||
var _19=$.data(_17,"menu").options;
|
||||
var _1a=_18.attr("style")||"";
|
||||
var _1b=_18.is(":visible");
|
||||
_18.css({display:"block",left:-10000,height:"auto",overflow:"hidden"});
|
||||
_18.find(".menu-item").each(function(){
|
||||
$(this)._outerHeight(_19.itemHeight);
|
||||
$(this).find(".menu-text").css({height:(_19.itemHeight-2)+"px",lineHeight:(_19.itemHeight-2)+"px"});
|
||||
});
|
||||
_18.removeClass("menu-noline").addClass(_19.noline?"menu-noline":"");
|
||||
var _1c=_18.data("menu").options;
|
||||
var _1d=_1c.width;
|
||||
var _1e=_1c.height;
|
||||
if(isNaN(parseInt(_1d))){
|
||||
_1d=0;
|
||||
_18.find("div.menu-text").each(function(){
|
||||
if(_1d<$(this).outerWidth()){
|
||||
_1d=$(this).outerWidth();
|
||||
}
|
||||
});
|
||||
_1d=_1d?_1d+40:"";
|
||||
}
|
||||
var _1f=_18.outerHeight();
|
||||
if(isNaN(parseInt(_1e))){
|
||||
_1e=_1f;
|
||||
if(_18.hasClass("menu-top")&&_19.alignTo){
|
||||
var at=$(_19.alignTo);
|
||||
var h1=at.offset().top-$(document).scrollTop();
|
||||
var h2=$(window)._outerHeight()+$(document).scrollTop()-at.offset().top-at._outerHeight();
|
||||
_1e=Math.min(_1e,Math.max(h1,h2));
|
||||
}else{
|
||||
if(_1e>$(window)._outerHeight()){
|
||||
_1e=$(window).height();
|
||||
}
|
||||
}
|
||||
}
|
||||
_18.attr("style",_1a);
|
||||
_18.show();
|
||||
_18._size($.extend({},_1c,{width:_1d,height:_1e,minWidth:_1c.minWidth||_19.minWidth,maxWidth:_1c.maxWidth||_19.maxWidth}));
|
||||
_18.find(".easyui-fluid").triggerHandler("_resize",[true]);
|
||||
_18.css("overflow",_18.outerHeight()<_1f?"auto":"hidden");
|
||||
_18.children("div.menu-line")._outerHeight(_1f-2);
|
||||
if(!_1b){
|
||||
_18.hide();
|
||||
}
|
||||
};
|
||||
function _11(_20,_21){
|
||||
var _22=$.data(_20,"menu");
|
||||
var _23=_22.options;
|
||||
_21._unbind(".menu");
|
||||
for(var _24 in _23.events){
|
||||
_21._bind(_24+".menu",{target:_20},_23.events[_24]);
|
||||
}
|
||||
};
|
||||
function _25(e){
|
||||
var _26=e.data.target;
|
||||
var _27=$.data(_26,"menu");
|
||||
if(_27.timer){
|
||||
clearTimeout(_27.timer);
|
||||
_27.timer=null;
|
||||
}
|
||||
};
|
||||
function _28(e){
|
||||
var _29=e.data.target;
|
||||
var _2a=$.data(_29,"menu");
|
||||
if(_2a.options.hideOnUnhover){
|
||||
_2a.timer=setTimeout(function(){
|
||||
_2b(_29,$(_29).hasClass("menu-inline"));
|
||||
},_2a.options.duration);
|
||||
}
|
||||
};
|
||||
function _2c(e){
|
||||
var _2d=e.data.target;
|
||||
var _2e=$(e.target).closest(".menu-item");
|
||||
if(_2e.length){
|
||||
_2e.siblings().each(function(){
|
||||
if(this.submenu){
|
||||
_1(this.submenu);
|
||||
}
|
||||
$(this).removeClass("menu-active");
|
||||
});
|
||||
_2e.addClass("menu-active");
|
||||
if(_2e.hasClass("menu-item-disabled")){
|
||||
_2e.addClass("menu-active-disabled");
|
||||
return;
|
||||
}
|
||||
var _2f=_2e[0].submenu;
|
||||
if(_2f){
|
||||
$(_2d).menu("show",{menu:_2f,parent:_2e});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _30(e){
|
||||
var _31=$(e.target).closest(".menu-item");
|
||||
if(_31.length){
|
||||
_31.removeClass("menu-active menu-active-disabled");
|
||||
var _32=_31[0].submenu;
|
||||
if(_32){
|
||||
if(e.pageX>=parseInt(_32.css("left"))){
|
||||
_31.addClass("menu-active");
|
||||
}else{
|
||||
_1(_32);
|
||||
}
|
||||
}else{
|
||||
_31.removeClass("menu-active");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _33(e){
|
||||
var _34=e.data.target;
|
||||
var _35=$(e.target).closest(".menu-item");
|
||||
if(_35.length){
|
||||
var _36=$(_34).data("menu").options;
|
||||
var _37=_35.data("menuitem").options;
|
||||
if(_37.disabled){
|
||||
return;
|
||||
}
|
||||
if(!_35[0].submenu){
|
||||
_2b(_34,_36.inline);
|
||||
if(_37.href){
|
||||
location.href=_37.href;
|
||||
}
|
||||
}
|
||||
_35.trigger("mouseenter");
|
||||
_36.onClick.call(_34,$(_34).menu("getItem",_35[0]));
|
||||
}
|
||||
};
|
||||
function _2b(_38,_39){
|
||||
var _3a=$.data(_38,"menu");
|
||||
if(_3a){
|
||||
if($(_38).is(":visible")){
|
||||
_1($(_38));
|
||||
if(_39){
|
||||
$(_38).show();
|
||||
}else{
|
||||
_3a.options.onHide.call(_38);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
function _3b(_3c,_3d){
|
||||
_3d=_3d||{};
|
||||
var _3e,top;
|
||||
var _3f=$.data(_3c,"menu").options;
|
||||
var _40=$(_3d.menu||_3c);
|
||||
$(_3c).menu("resize",_40[0]);
|
||||
if(_40.hasClass("menu-top")){
|
||||
$.extend(_3f,_3d);
|
||||
_3e=_3f.left;
|
||||
top=_3f.top;
|
||||
if(_3f.alignTo){
|
||||
var at=$(_3f.alignTo);
|
||||
_3e=at.offset().left;
|
||||
top=at.offset().top+at._outerHeight();
|
||||
if(_3f.align=="right"){
|
||||
_3e+=at.outerWidth()-_40.outerWidth();
|
||||
}
|
||||
}
|
||||
if(_3e+_40.outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){
|
||||
_3e=$(window)._outerWidth()+$(document).scrollLeft()-_40.outerWidth()-5;
|
||||
}
|
||||
if(_3e<0){
|
||||
_3e=0;
|
||||
}
|
||||
top=_41(top,_3f.alignTo);
|
||||
}else{
|
||||
var _42=_3d.parent;
|
||||
_3e=_42.offset().left+_42.outerWidth()-2;
|
||||
if(_3e+_40.outerWidth()+5>$(window)._outerWidth()+$(document).scrollLeft()){
|
||||
_3e=_42.offset().left-_40.outerWidth()+2;
|
||||
}
|
||||
top=_41(_42.offset().top-3);
|
||||
}
|
||||
function _41(top,_43){
|
||||
if(top+_40.outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){
|
||||
if(_43){
|
||||
top=$(_43).offset().top-_40._outerHeight();
|
||||
}else{
|
||||
top=$(window)._outerHeight()+$(document).scrollTop()-_40.outerHeight();
|
||||
}
|
||||
}
|
||||
if(top<0){
|
||||
top=0;
|
||||
}
|
||||
return top;
|
||||
};
|
||||
_40.css(_3f.position.call(_3c,_40[0],_3e,top));
|
||||
_40.show(0,function(){
|
||||
if(!_40[0].shadow){
|
||||
_40[0].shadow=$("<div class=\"menu-shadow\"></div>").insertAfter(_40);
|
||||
}
|
||||
_40[0].shadow.css({display:(_40.hasClass("menu-inline")?"none":"block"),zIndex:$.fn.menu.defaults.zIndex++,left:_40.css("left"),top:_40.css("top"),width:_40.outerWidth(),height:_40.outerHeight()});
|
||||
_40.css("z-index",$.fn.menu.defaults.zIndex++);
|
||||
if(_40.hasClass("menu-top")){
|
||||
_3f.onShow.call(_3c);
|
||||
}
|
||||
});
|
||||
};
|
||||
function _1(_44){
|
||||
if(_44&&_44.length){
|
||||
_45(_44);
|
||||
_44.find("div.menu-item").each(function(){
|
||||
if(this.submenu){
|
||||
_1(this.submenu);
|
||||
}
|
||||
$(this).removeClass("menu-active");
|
||||
});
|
||||
}
|
||||
function _45(m){
|
||||
m.stop(true,true);
|
||||
if(m[0].shadow){
|
||||
m[0].shadow.hide();
|
||||
}
|
||||
m.hide();
|
||||
};
|
||||
};
|
||||
function _46(_47,_48){
|
||||
var _49=null;
|
||||
var fn=$.isFunction(_48)?_48:function(_4a){
|
||||
for(var p in _48){
|
||||
if(_4a[p]!=_48[p]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
function _4b(_4c){
|
||||
_4c.children("div.menu-item").each(function(){
|
||||
var _4d=$(this).data("menuitem").options;
|
||||
if(fn.call(_47,_4d)==true){
|
||||
_49=$(_47).menu("getItem",this);
|
||||
}else{
|
||||
if(this.submenu&&!_49){
|
||||
_4b(this.submenu);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
_4b($(_47));
|
||||
return _49;
|
||||
};
|
||||
function _16(_4e,_4f,_50){
|
||||
var t=$(_4f);
|
||||
if(t.hasClass("menu-item")){
|
||||
var _51=t.data("menuitem").options;
|
||||
_51.disabled=_50;
|
||||
if(_50){
|
||||
t.addClass("menu-item-disabled");
|
||||
t[0].onclick=null;
|
||||
}else{
|
||||
t.removeClass("menu-item-disabled");
|
||||
t[0].onclick=_51.onclick;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _52(_53,_54){
|
||||
var _55=$.data(_53,"menu").options;
|
||||
var _56=$(_53);
|
||||
if(_54.parent){
|
||||
if(!_54.parent.submenu){
|
||||
var _57=$("<div></div>").appendTo("body");
|
||||
_54.parent.submenu=_57;
|
||||
$("<div class=\"menu-rightarrow\"></div>").appendTo(_54.parent);
|
||||
_b(_53,_57);
|
||||
}
|
||||
_56=_54.parent.submenu;
|
||||
}
|
||||
var div=$("<div></div>").appendTo(_56);
|
||||
_f(_53,div,_54);
|
||||
};
|
||||
function _58(_59,_5a){
|
||||
function _5b(el){
|
||||
if(el.submenu){
|
||||
el.submenu.children("div.menu-item").each(function(){
|
||||
_5b(this);
|
||||
});
|
||||
var _5c=el.submenu[0].shadow;
|
||||
if(_5c){
|
||||
_5c.remove();
|
||||
}
|
||||
el.submenu.remove();
|
||||
}
|
||||
$(el).remove();
|
||||
};
|
||||
_5b(_5a);
|
||||
};
|
||||
function _5d(_5e,_5f,_60){
|
||||
var _61=$(_5f).parent();
|
||||
if(_60){
|
||||
$(_5f).show();
|
||||
}else{
|
||||
$(_5f).hide();
|
||||
}
|
||||
_10(_5e,_61);
|
||||
};
|
||||
function _62(_63){
|
||||
$(_63).children("div.menu-item").each(function(){
|
||||
_58(_63,this);
|
||||
});
|
||||
if(_63.shadow){
|
||||
_63.shadow.remove();
|
||||
}
|
||||
$(_63).remove();
|
||||
};
|
||||
$.fn.menu=function(_64,_65){
|
||||
if(typeof _64=="string"){
|
||||
return $.fn.menu.methods[_64](this,_65);
|
||||
}
|
||||
_64=_64||{};
|
||||
return this.each(function(){
|
||||
var _66=$.data(this,"menu");
|
||||
if(_66){
|
||||
$.extend(_66.options,_64);
|
||||
}else{
|
||||
_66=$.data(this,"menu",{options:$.extend({},$.fn.menu.defaults,$.fn.menu.parseOptions(this),_64)});
|
||||
_2(this);
|
||||
}
|
||||
$(this).css({left:_66.options.left,top:_66.options.top});
|
||||
});
|
||||
};
|
||||
$.fn.menu.methods={options:function(jq){
|
||||
return $.data(jq[0],"menu").options;
|
||||
},show:function(jq,pos){
|
||||
return jq.each(function(){
|
||||
_3b(this,pos);
|
||||
});
|
||||
},hide:function(jq){
|
||||
return jq.each(function(){
|
||||
_2b(this);
|
||||
});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_62(this);
|
||||
});
|
||||
},setText:function(jq,_67){
|
||||
return jq.each(function(){
|
||||
var _68=$(_67.target).data("menuitem").options;
|
||||
_68.text=_67.text;
|
||||
$(_67.target).children("div.menu-text").html(_67.text);
|
||||
});
|
||||
},setIcon:function(jq,_69){
|
||||
return jq.each(function(){
|
||||
var _6a=$(_69.target).data("menuitem").options;
|
||||
_6a.iconCls=_69.iconCls;
|
||||
$(_69.target).children("div.menu-icon").remove();
|
||||
if(_69.iconCls){
|
||||
$("<div class=\"menu-icon\"></div>").addClass(_69.iconCls).appendTo(_69.target);
|
||||
}
|
||||
});
|
||||
},getItem:function(jq,_6b){
|
||||
var _6c=$(_6b).data("menuitem").options;
|
||||
return $.extend({},_6c,{target:$(_6b)[0]});
|
||||
},findItem:function(jq,_6d){
|
||||
if(typeof _6d=="string"){
|
||||
return _46(jq[0],function(_6e){
|
||||
return $("<div>"+_6e.text+"</div>").text()==_6d;
|
||||
});
|
||||
}else{
|
||||
return _46(jq[0],_6d);
|
||||
}
|
||||
},appendItem:function(jq,_6f){
|
||||
return jq.each(function(){
|
||||
_52(this,_6f);
|
||||
});
|
||||
},removeItem:function(jq,_70){
|
||||
return jq.each(function(){
|
||||
_58(this,_70);
|
||||
});
|
||||
},enableItem:function(jq,_71){
|
||||
return jq.each(function(){
|
||||
_16(this,_71,false);
|
||||
});
|
||||
},disableItem:function(jq,_72){
|
||||
return jq.each(function(){
|
||||
_16(this,_72,true);
|
||||
});
|
||||
},showItem:function(jq,_73){
|
||||
return jq.each(function(){
|
||||
_5d(this,_73,true);
|
||||
});
|
||||
},hideItem:function(jq,_74){
|
||||
return jq.each(function(){
|
||||
_5d(this,_74,false);
|
||||
});
|
||||
},resize:function(jq,_75){
|
||||
return jq.each(function(){
|
||||
_10(this,_75?$(_75):$(this));
|
||||
});
|
||||
}};
|
||||
$.fn.menu.parseOptions=function(_76){
|
||||
return $.extend({},$.parser.parseOptions(_76,[{minWidth:"number",itemHeight:"number",duration:"number",hideOnUnhover:"boolean"},{fit:"boolean",inline:"boolean",noline:"boolean"}]));
|
||||
};
|
||||
$.fn.menu.defaults={zIndex:110000,left:0,top:0,alignTo:null,align:"left",minWidth:150,itemHeight:32,duration:100,hideOnUnhover:true,inline:false,fit:false,noline:false,events:{mouseenter:_25,mouseleave:_28,mouseover:_2c,mouseout:_30,click:_33},position:function(_77,_78,top){
|
||||
return {left:_78,top:top};
|
||||
},onShow:function(){
|
||||
},onHide:function(){
|
||||
},onClick:function(_79){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
123
static/jeasyui/plugins/jquery.menubutton.js
Executable file
123
static/jeasyui/plugins/jquery.menubutton.js
Executable file
@@ -0,0 +1,123 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"menubutton").options;
|
||||
var _4=$(_2);
|
||||
_4.linkbutton(_3);
|
||||
if(_3.hasDownArrow){
|
||||
_4.removeClass(_3.cls.btn1+" "+_3.cls.btn2).addClass("m-btn");
|
||||
_4.removeClass("m-btn-small m-btn-medium m-btn-large").addClass("m-btn-"+_3.size);
|
||||
var _5=_4.find(".l-btn-left");
|
||||
$("<span></span>").addClass(_3.cls.arrow).appendTo(_5);
|
||||
$("<span></span>").addClass("m-btn-line").appendTo(_5);
|
||||
}
|
||||
$(_2).menubutton("resize");
|
||||
if(_3.menu){
|
||||
$(_3.menu).menu({duration:_3.duration});
|
||||
var _6=$(_3.menu).menu("options");
|
||||
var _7=_6.onShow;
|
||||
var _8=_6.onHide;
|
||||
$.extend(_6,{onShow:function(){
|
||||
var _9=$(this).menu("options");
|
||||
var _a=$(_9.alignTo);
|
||||
var _b=_a.menubutton("options");
|
||||
_a.addClass((_b.plain==true)?_b.cls.btn2:_b.cls.btn1);
|
||||
_7.call(this);
|
||||
},onHide:function(){
|
||||
var _c=$(this).menu("options");
|
||||
var _d=$(_c.alignTo);
|
||||
var _e=_d.menubutton("options");
|
||||
_d.removeClass((_e.plain==true)?_e.cls.btn2:_e.cls.btn1);
|
||||
_8.call(this);
|
||||
}});
|
||||
}
|
||||
};
|
||||
function _f(_10){
|
||||
var _11=$.data(_10,"menubutton").options;
|
||||
var btn=$(_10);
|
||||
var t=btn.find("."+_11.cls.trigger);
|
||||
if(!t.length){
|
||||
t=btn;
|
||||
}
|
||||
t._unbind(".menubutton");
|
||||
var _12=null;
|
||||
t._bind(_11.showEvent+".menubutton",function(){
|
||||
if(!_13()){
|
||||
_12=setTimeout(function(){
|
||||
_14(_10);
|
||||
},_11.duration);
|
||||
return false;
|
||||
}
|
||||
})._bind(_11.hideEvent+".menubutton",function(){
|
||||
if(_12){
|
||||
clearTimeout(_12);
|
||||
}
|
||||
$(_11.menu).triggerHandler("mouseleave");
|
||||
});
|
||||
function _13(){
|
||||
return $(_10).linkbutton("options").disabled;
|
||||
};
|
||||
};
|
||||
function _14(_15){
|
||||
var _16=$(_15).menubutton("options");
|
||||
if(_16.disabled||!_16.menu){
|
||||
return;
|
||||
}
|
||||
$("body>div.menu-top").menu("hide");
|
||||
var btn=$(_15);
|
||||
var mm=$(_16.menu);
|
||||
if(mm.length){
|
||||
mm.menu("options").alignTo=btn;
|
||||
mm.menu("show",{alignTo:btn,align:_16.menuAlign});
|
||||
}
|
||||
btn.blur();
|
||||
};
|
||||
$.fn.menubutton=function(_17,_18){
|
||||
if(typeof _17=="string"){
|
||||
var _19=$.fn.menubutton.methods[_17];
|
||||
if(_19){
|
||||
return _19(this,_18);
|
||||
}else{
|
||||
return this.linkbutton(_17,_18);
|
||||
}
|
||||
}
|
||||
_17=_17||{};
|
||||
return this.each(function(){
|
||||
var _1a=$.data(this,"menubutton");
|
||||
if(_1a){
|
||||
$.extend(_1a.options,_17);
|
||||
}else{
|
||||
$.data(this,"menubutton",{options:$.extend({},$.fn.menubutton.defaults,$.fn.menubutton.parseOptions(this),_17)});
|
||||
$(this)._propAttr("disabled",false);
|
||||
}
|
||||
_1(this);
|
||||
_f(this);
|
||||
});
|
||||
};
|
||||
$.fn.menubutton.methods={options:function(jq){
|
||||
var _1b=jq.linkbutton("options");
|
||||
return $.extend($.data(jq[0],"menubutton").options,{toggle:_1b.toggle,selected:_1b.selected,disabled:_1b.disabled});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
var _1c=$(this).menubutton("options");
|
||||
if(_1c.menu){
|
||||
$(_1c.menu).menu("destroy");
|
||||
}
|
||||
$(this).remove();
|
||||
});
|
||||
}};
|
||||
$.fn.menubutton.parseOptions=function(_1d){
|
||||
var t=$(_1d);
|
||||
return $.extend({},$.fn.linkbutton.parseOptions(_1d),$.parser.parseOptions(_1d,["menu",{plain:"boolean",hasDownArrow:"boolean",duration:"number"}]));
|
||||
};
|
||||
$.fn.menubutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,hasDownArrow:true,menu:null,menuAlign:"left",duration:100,showEvent:"mouseenter",hideEvent:"mouseleave",cls:{btn1:"m-btn-active",btn2:"m-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn"}});
|
||||
})(jQuery);
|
||||
|
||||
186
static/jeasyui/plugins/jquery.messager.js
Executable file
186
static/jeasyui/plugins/jquery.messager.js
Executable file
@@ -0,0 +1,186 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(){
|
||||
$(document)._unbind(".messager")._bind("keydown.messager",function(e){
|
||||
if(e.keyCode==27){
|
||||
$("body").children("div.messager-window").children("div.messager-body").each(function(){
|
||||
$(this).dialog("close");
|
||||
});
|
||||
}else{
|
||||
if(e.keyCode==9){
|
||||
var _2=$("body").children("div.messager-window");
|
||||
if(!_2.length){
|
||||
return;
|
||||
}
|
||||
var _3=_2.find(".messager-input,.messager-button .l-btn");
|
||||
for(var i=0;i<_3.length;i++){
|
||||
if($(_3[i]).is(":focus")){
|
||||
$(_3[i>=_3.length-1?0:i+1]).focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(e.keyCode==13){
|
||||
var _4=$(e.target).closest("input.messager-input");
|
||||
if(_4.length){
|
||||
var _5=_4.closest(".messager-body");
|
||||
_6(_5,_4.val());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
function _7(){
|
||||
$(document)._unbind(".messager");
|
||||
};
|
||||
function _8(_9){
|
||||
var _a=$.extend({},$.messager.defaults,{modal:false,shadow:false,draggable:false,resizable:false,closed:true,style:{left:"",top:"",right:0,zIndex:$.fn.window.defaults.zIndex++,bottom:-document.body.scrollTop-document.documentElement.scrollTop},title:"",width:300,height:150,minHeight:0,showType:"slide",showSpeed:600,content:_9.msg,timeout:4000},_9);
|
||||
var _b=$("<div class=\"messager-body\"></div>").appendTo("body");
|
||||
_b.dialog($.extend({},_a,{noheader:(_a.title?false:true),openAnimation:(_a.showType),closeAnimation:(_a.showType=="show"?"hide":_a.showType),openDuration:_a.showSpeed,closeDuration:_a.showSpeed,onOpen:function(){
|
||||
_b.dialog("dialog").hover(function(){
|
||||
if(_a.timer){
|
||||
clearTimeout(_a.timer);
|
||||
}
|
||||
},function(){
|
||||
_c();
|
||||
});
|
||||
_c();
|
||||
function _c(){
|
||||
if(_a.timeout>0){
|
||||
_a.timer=setTimeout(function(){
|
||||
if(_b.length&&_b.data("dialog")){
|
||||
_b.dialog("close");
|
||||
}
|
||||
},_a.timeout);
|
||||
}
|
||||
};
|
||||
if(_9.onOpen){
|
||||
_9.onOpen.call(this);
|
||||
}else{
|
||||
_a.onOpen.call(this);
|
||||
}
|
||||
},onClose:function(){
|
||||
if(_a.timer){
|
||||
clearTimeout(_a.timer);
|
||||
}
|
||||
if(_9.onClose){
|
||||
_9.onClose.call(this);
|
||||
}else{
|
||||
_a.onClose.call(this);
|
||||
}
|
||||
_b.dialog("destroy");
|
||||
}}));
|
||||
_b.dialog("dialog").css(_a.style);
|
||||
_b.dialog("open");
|
||||
return _b;
|
||||
};
|
||||
function _d(_e){
|
||||
_1();
|
||||
var _f=$("<div class=\"messager-body\"></div>").appendTo("body");
|
||||
_f.dialog($.extend({},_e,{noheader:(_e.title?false:true),onClose:function(){
|
||||
_7();
|
||||
if(_e.onClose){
|
||||
_e.onClose.call(this);
|
||||
}
|
||||
_f.dialog("destroy");
|
||||
}}));
|
||||
var win=_f.dialog("dialog").addClass("messager-window");
|
||||
win.find(".dialog-button").addClass("messager-button").find("a:first").focus();
|
||||
return _f;
|
||||
};
|
||||
function _6(dlg,_10){
|
||||
var _11=dlg.dialog("options");
|
||||
dlg.dialog("close");
|
||||
_11.fn(_10);
|
||||
};
|
||||
$.messager={show:function(_12){
|
||||
return _8(_12);
|
||||
},alert:function(_13,msg,_14,fn){
|
||||
var _15=typeof _13=="object"?_13:{title:_13,msg:msg,icon:_14,fn:fn};
|
||||
var cls=_15.icon?"messager-icon messager-"+_15.icon:"";
|
||||
_15=$.extend({},$.messager.defaults,{content:"<div class=\""+cls+"\"></div>"+"<div>"+_15.msg+"</div>"+"<div style=\"clear:both;\"></div>"},_15);
|
||||
if(!_15.buttons){
|
||||
_15.buttons=[{text:_15.ok,onClick:function(){
|
||||
_6(dlg);
|
||||
}}];
|
||||
}
|
||||
var dlg=_d(_15);
|
||||
return dlg;
|
||||
},confirm:function(_16,msg,fn){
|
||||
var _17=typeof _16=="object"?_16:{title:_16,msg:msg,fn:fn};
|
||||
_17=$.extend({},$.messager.defaults,{content:"<div class=\"messager-icon messager-question\"></div>"+"<div>"+_17.msg+"</div>"+"<div style=\"clear:both;\"></div>"},_17);
|
||||
if(!_17.buttons){
|
||||
_17.buttons=[{text:_17.ok,onClick:function(){
|
||||
_6(dlg,true);
|
||||
}},{text:_17.cancel,onClick:function(){
|
||||
_6(dlg,false);
|
||||
}}];
|
||||
}
|
||||
var dlg=_d(_17);
|
||||
return dlg;
|
||||
},prompt:function(_18,msg,fn){
|
||||
var _19=typeof _18=="object"?_18:{title:_18,msg:msg,fn:fn};
|
||||
_19=$.extend({},$.messager.defaults,{content:"<div class=\"messager-icon messager-question\"></div>"+"<div>"+_19.msg+"</div>"+"<br>"+"<div style=\"clear:both;\"></div>"+"<div><input class=\"messager-input\" type=\"text\"></div>"},_19);
|
||||
if(!_19.buttons){
|
||||
_19.buttons=[{text:_19.ok,onClick:function(){
|
||||
_6(dlg,dlg.find(".messager-input").val());
|
||||
}},{text:_19.cancel,onClick:function(){
|
||||
_6(dlg);
|
||||
}}];
|
||||
}
|
||||
var dlg=_d(_19);
|
||||
dlg.find(".messager-input").focus();
|
||||
return dlg;
|
||||
},progress:function(_1a){
|
||||
var _1b={bar:function(){
|
||||
return $("body>div.messager-window").find("div.messager-p-bar");
|
||||
},close:function(){
|
||||
var dlg=$("body>div.messager-window>div.messager-body:has(div.messager-progress)");
|
||||
if(dlg.length){
|
||||
dlg.dialog("close");
|
||||
}
|
||||
}};
|
||||
if(typeof _1a=="string"){
|
||||
var _1c=_1b[_1a];
|
||||
return _1c();
|
||||
}
|
||||
_1a=_1a||{};
|
||||
var _1d=$.extend({},{title:"",minHeight:0,content:undefined,msg:"",text:undefined,interval:300},_1a);
|
||||
var dlg=_d($.extend({},$.messager.defaults,{content:"<div class=\"messager-progress\"><div class=\"messager-p-msg\">"+_1d.msg+"</div><div class=\"messager-p-bar\"></div></div>",closable:false,doSize:false},_1d,{onClose:function(){
|
||||
if(this.timer){
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
if(_1a.onClose){
|
||||
_1a.onClose.call(this);
|
||||
}else{
|
||||
$.messager.defaults.onClose.call(this);
|
||||
}
|
||||
}}));
|
||||
var bar=dlg.find("div.messager-p-bar");
|
||||
bar.progressbar({text:_1d.text});
|
||||
dlg.dialog("resize");
|
||||
if(_1d.interval){
|
||||
dlg[0].timer=setInterval(function(){
|
||||
var v=bar.progressbar("getValue");
|
||||
v+=10;
|
||||
if(v>100){
|
||||
v=0;
|
||||
}
|
||||
bar.progressbar("setValue",v);
|
||||
},_1d.interval);
|
||||
}
|
||||
return dlg;
|
||||
}};
|
||||
$.messager.defaults=$.extend({},$.fn.dialog.defaults,{ok:"Ok",cancel:"Cancel",width:300,height:"auto",minHeight:150,modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,fn:function(){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
141
static/jeasyui/plugins/jquery.mobile.js
Normal file
141
static/jeasyui/plugins/jquery.mobile.js
Normal file
@@ -0,0 +1,141 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
$.fn.navpanel=function(_1,_2){
|
||||
if(typeof _1=="string"){
|
||||
var _3=$.fn.navpanel.methods[_1];
|
||||
return _3?_3(this,_2):this.panel(_1,_2);
|
||||
}else{
|
||||
_1=_1||{};
|
||||
return this.each(function(){
|
||||
var _4=$.data(this,"navpanel");
|
||||
if(_4){
|
||||
$.extend(_4.options,_1);
|
||||
}else{
|
||||
_4=$.data(this,"navpanel",{options:$.extend({},$.fn.navpanel.defaults,$.fn.navpanel.parseOptions(this),_1)});
|
||||
}
|
||||
$(this).panel(_4.options);
|
||||
});
|
||||
}
|
||||
};
|
||||
$.fn.navpanel.methods={options:function(jq){
|
||||
return $.data(jq[0],"navpanel").options;
|
||||
}};
|
||||
$.fn.navpanel.parseOptions=function(_5){
|
||||
return $.extend({},$.fn.panel.parseOptions(_5),$.parser.parseOptions(_5,[]));
|
||||
};
|
||||
$.fn.navpanel.defaults=$.extend({},$.fn.panel.defaults,{fit:true,border:false,cls:"navpanel"});
|
||||
$.parser.plugins.push("navpanel");
|
||||
})(jQuery);
|
||||
(function($){
|
||||
$(function(){
|
||||
$.mobile.init();
|
||||
});
|
||||
$.mobile={defaults:{animation:"slide",direction:"left",reverseDirections:{up:"down",down:"up",left:"right",right:"left"}},panels:[],init:function(_6){
|
||||
$.mobile.panels=[];
|
||||
var _7=$(_6||"body").children(".navpanel:visible");
|
||||
if(_7.length){
|
||||
_7.not(":first").children(".panel-body").navpanel("close");
|
||||
var p=_7.eq(0).children(".panel-body");
|
||||
$.mobile.panels.push({panel:p,animation:$.mobile.defaults.animation,direction:$.mobile.defaults.direction});
|
||||
}
|
||||
$(document)._unbind(".mobile")._bind("click.mobile",function(e){
|
||||
var a=$(e.target).closest("a");
|
||||
if(a.length){
|
||||
var _8=$.parser.parseOptions(a[0],["animation","direction",{back:"boolean"}]);
|
||||
if(_8.back){
|
||||
$.mobile.back();
|
||||
e.preventDefault();
|
||||
}else{
|
||||
var _9=$.trim(a.attr("href"));
|
||||
if(/^#/.test(_9)){
|
||||
var to=$(_9);
|
||||
if(to.length&&to.hasClass("panel-body")){
|
||||
$.mobile.go(to,_8.animation,_8.direction);
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$(window)._unbind(".mobile")._bind("hashchange.mobile",function(){
|
||||
var _a=$.mobile.panels.length;
|
||||
if(_a>1){
|
||||
var _b=location.hash;
|
||||
var p=$.mobile.panels[_a-2];
|
||||
if(!_b||_b=="#&"+p.panel.attr("id")){
|
||||
$.mobile._back();
|
||||
}
|
||||
}
|
||||
});
|
||||
},nav:function(_c,to,_d,_e){
|
||||
if(window.WebKitAnimationEvent){
|
||||
_d=_d!=undefined?_d:$.mobile.defaults.animation;
|
||||
_e=_e!=undefined?_e:$.mobile.defaults.direction;
|
||||
var _f="m-"+_d+(_e?"-"+_e:"");
|
||||
var p1=$(_c).panel("open").panel("resize").panel("panel");
|
||||
var p2=$(to).panel("open").panel("resize").panel("panel");
|
||||
p1.add(p2)._bind("webkitAnimationEnd",function(){
|
||||
$(this)._unbind("webkitAnimationEnd");
|
||||
var p=$(this).children(".panel-body");
|
||||
if($(this).hasClass("m-in")){
|
||||
p.panel("open").panel("resize");
|
||||
}else{
|
||||
p.panel("close");
|
||||
}
|
||||
$(this).removeClass(_f+" m-in m-out");
|
||||
});
|
||||
p2.addClass(_f+" m-in");
|
||||
p1.addClass(_f+" m-out");
|
||||
}else{
|
||||
$(to).panel("open").panel("resize");
|
||||
$(_c).panel("close");
|
||||
}
|
||||
},_go:function(_10,_11,_12){
|
||||
_11=_11!=undefined?_11:$.mobile.defaults.animation;
|
||||
_12=_12!=undefined?_12:$.mobile.defaults.direction;
|
||||
var _13=$.mobile.panels[$.mobile.panels.length-1].panel;
|
||||
var to=$(_10);
|
||||
if(_13[0]!=to[0]){
|
||||
$.mobile.nav(_13,to,_11,_12);
|
||||
$.mobile.panels.push({panel:to,animation:_11,direction:_12});
|
||||
}
|
||||
},_back:function(){
|
||||
if($.mobile.panels.length<2){
|
||||
return;
|
||||
}
|
||||
var p1=$.mobile.panels.pop();
|
||||
var p2=$.mobile.panels[$.mobile.panels.length-1];
|
||||
var _14=p1.animation;
|
||||
var _15=$.mobile.defaults.reverseDirections[p1.direction]||"";
|
||||
$.mobile.nav(p1.panel,p2.panel,_14,_15);
|
||||
},go:function(_16,_17,_18){
|
||||
_17=_17!=undefined?_17:$.mobile.defaults.animation;
|
||||
_18=_18!=undefined?_18:$.mobile.defaults.direction;
|
||||
location.hash="#&"+$(_16).attr("id");
|
||||
$.mobile._go(_16,_17,_18);
|
||||
},back:function(){
|
||||
history.go(-1);
|
||||
}};
|
||||
$.map(["validatebox","textbox","passwordbox","filebox","searchbox","combo","combobox","combogrid","combotree","combotreegrid","datebox","datetimebox","numberbox","spinner","numberspinner","timespinner","datetimespinner"],function(_19){
|
||||
if($.fn[_19]){
|
||||
$.extend($.fn[_19].defaults,{iconWidth:28,tipPosition:"bottom"});
|
||||
}
|
||||
});
|
||||
$.map(["spinner","numberspinner","timespinner","datetimespinner"],function(_1a){
|
||||
if($.fn[_1a]){
|
||||
$.extend($.fn[_1a].defaults,{iconWidth:56,spinAlign:"horizontal"});
|
||||
}
|
||||
});
|
||||
if($.fn.menu){
|
||||
$.extend($.fn.menu.defaults,{itemHeight:30,noline:true});
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
187
static/jeasyui/plugins/jquery.numberbox.js
Executable file
187
static/jeasyui/plugins/jquery.numberbox.js
Executable file
@@ -0,0 +1,187 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"numberbox");
|
||||
var _4=_3.options;
|
||||
$(_2).addClass("numberbox-f").textbox(_4);
|
||||
$(_2).textbox("textbox").css({imeMode:"disabled"});
|
||||
$(_2).attr("numberboxName",$(_2).attr("textboxName"));
|
||||
_3.numberbox=$(_2).next();
|
||||
_3.numberbox.addClass("numberbox");
|
||||
var _5=_4.parser.call(_2,_4.value);
|
||||
var _6=_4.formatter.call(_2,_5);
|
||||
$(_2).numberbox("initValue",_5).numberbox("setText",_6);
|
||||
};
|
||||
function _7(_8,_9){
|
||||
var _a=$.data(_8,"numberbox");
|
||||
var _b=_a.options;
|
||||
_b.value=parseFloat(_9);
|
||||
var _9=_b.parser.call(_8,_9);
|
||||
var _c=_b.formatter.call(_8,_9);
|
||||
_b.value=_9;
|
||||
$(_8).textbox("setText",_c).textbox("setValue",_9);
|
||||
_c=_b.formatter.call(_8,$(_8).textbox("getValue"));
|
||||
$(_8).textbox("setText",_c);
|
||||
};
|
||||
$.fn.numberbox=function(_d,_e){
|
||||
if(typeof _d=="string"){
|
||||
var _f=$.fn.numberbox.methods[_d];
|
||||
if(_f){
|
||||
return _f(this,_e);
|
||||
}else{
|
||||
return this.textbox(_d,_e);
|
||||
}
|
||||
}
|
||||
_d=_d||{};
|
||||
return this.each(function(){
|
||||
var _10=$.data(this,"numberbox");
|
||||
if(_10){
|
||||
$.extend(_10.options,_d);
|
||||
}else{
|
||||
_10=$.data(this,"numberbox",{options:$.extend({},$.fn.numberbox.defaults,$.fn.numberbox.parseOptions(this),_d)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.numberbox.methods={options:function(jq){
|
||||
var _11=jq.data("textbox")?jq.textbox("options"):{};
|
||||
return $.extend($.data(jq[0],"numberbox").options,{width:_11.width,originalValue:_11.originalValue,disabled:_11.disabled,readonly:_11.readonly});
|
||||
},cloneFrom:function(jq,_12){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("cloneFrom",_12);
|
||||
$.data(this,"numberbox",{options:$.extend(true,{},$(_12).numberbox("options"))});
|
||||
$(this).addClass("numberbox-f");
|
||||
});
|
||||
},fix:function(jq){
|
||||
return jq.each(function(){
|
||||
var _13=$(this).numberbox("options");
|
||||
_13.value=null;
|
||||
var _14=_13.parser.call(this,$(this).numberbox("getText"));
|
||||
$(this).numberbox("setValue",_14);
|
||||
});
|
||||
},setValue:function(jq,_15){
|
||||
return jq.each(function(){
|
||||
_7(this,_15);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("clear");
|
||||
$(this).numberbox("options").value="";
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("reset");
|
||||
$(this).numberbox("setValue",$(this).numberbox("getValue"));
|
||||
});
|
||||
}};
|
||||
$.fn.numberbox.parseOptions=function(_16){
|
||||
var t=$(_16);
|
||||
return $.extend({},$.fn.textbox.parseOptions(_16),$.parser.parseOptions(_16,["decimalSeparator","groupSeparator","suffix",{min:"number",max:"number",precision:"number"}]),{prefix:(t.attr("prefix")?t.attr("prefix"):undefined)});
|
||||
};
|
||||
$.fn.numberbox.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:{keypress:function(e){
|
||||
var _17=e.data.target;
|
||||
var _18=$(_17).numberbox("options");
|
||||
return _18.filter.call(_17,e);
|
||||
},blur:function(e){
|
||||
$(e.data.target).numberbox("fix");
|
||||
},keydown:function(e){
|
||||
if(e.keyCode==13){
|
||||
$(e.data.target).numberbox("fix");
|
||||
}
|
||||
}},min:null,max:null,precision:0,decimalSeparator:".",groupSeparator:"",prefix:"",suffix:"",filter:function(e){
|
||||
var _19=$(this).numberbox("options");
|
||||
var s=$(this).numberbox("getText");
|
||||
if(e.metaKey||e.ctrlKey){
|
||||
return true;
|
||||
}
|
||||
if($.inArray(String(e.which),["46","8","13","0"])>=0){
|
||||
return true;
|
||||
}
|
||||
var tmp=$("<span></span>");
|
||||
tmp.html(String.fromCharCode(e.which));
|
||||
var c=tmp.text();
|
||||
tmp.remove();
|
||||
if(!c){
|
||||
return true;
|
||||
}
|
||||
if(c=="-"&&_19.min!=null&&_19.min>=0){
|
||||
return false;
|
||||
}
|
||||
if(c=="-"||c==_19.decimalSeparator){
|
||||
return (s.indexOf(c)==-1)?true:false;
|
||||
}else{
|
||||
if(c==_19.groupSeparator){
|
||||
return true;
|
||||
}else{
|
||||
if("0123456789".indexOf(c)>=0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},formatter:function(_1a){
|
||||
if(!_1a){
|
||||
return _1a;
|
||||
}
|
||||
_1a=_1a+"";
|
||||
var _1b=$(this).numberbox("options");
|
||||
var s1=_1a,s2="";
|
||||
var _1c=_1a.indexOf(".");
|
||||
if(_1c>=0){
|
||||
s1=_1a.substring(0,_1c);
|
||||
s2=_1a.substring(_1c+1,_1a.length);
|
||||
}
|
||||
if(_1b.groupSeparator){
|
||||
var p=/(\d+)(\d{3})/;
|
||||
while(p.test(s1)){
|
||||
s1=s1.replace(p,"$1"+_1b.groupSeparator+"$2");
|
||||
}
|
||||
}
|
||||
if(s2){
|
||||
return _1b.prefix+s1+_1b.decimalSeparator+s2+_1b.suffix;
|
||||
}else{
|
||||
return _1b.prefix+s1+_1b.suffix;
|
||||
}
|
||||
},parser:function(s){
|
||||
s=s+"";
|
||||
var _1d=$(this).numberbox("options");
|
||||
if(_1d.prefix){
|
||||
s=$.trim(s.replace(new RegExp("\\"+$.trim(_1d.prefix),"g"),""));
|
||||
}
|
||||
if(_1d.suffix){
|
||||
s=$.trim(s.replace(new RegExp("\\"+$.trim(_1d.suffix),"g"),""));
|
||||
}
|
||||
if(parseFloat(s)!=_1d.value){
|
||||
if(_1d.groupSeparator){
|
||||
s=$.trim(s.replace(new RegExp("\\"+_1d.groupSeparator,"g"),""));
|
||||
}
|
||||
if(_1d.decimalSeparator){
|
||||
s=$.trim(s.replace(new RegExp("\\"+_1d.decimalSeparator,"g"),"."));
|
||||
}
|
||||
s=s.replace(/\s/g,"");
|
||||
}
|
||||
var val=parseFloat(s).toFixed(_1d.precision);
|
||||
if(isNaN(val)){
|
||||
val="";
|
||||
}else{
|
||||
if(typeof (_1d.min)=="number"&&val<_1d.min){
|
||||
val=_1d.min.toFixed(_1d.precision);
|
||||
}else{
|
||||
if(typeof (_1d.max)=="number"&&val>_1d.max){
|
||||
val=_1d.max.toFixed(_1d.precision);
|
||||
}
|
||||
}
|
||||
}
|
||||
return val;
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
58
static/jeasyui/plugins/jquery.numberspinner.js
Executable file
58
static/jeasyui/plugins/jquery.numberspinner.js
Executable file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
$(_2).addClass("numberspinner-f");
|
||||
var _3=$.data(_2,"numberspinner").options;
|
||||
$(_2).numberbox($.extend({},_3,{doSize:false})).spinner(_3);
|
||||
$(_2).numberbox("setValue",_3.value);
|
||||
};
|
||||
function _4(_5,_6){
|
||||
var _7=$.data(_5,"numberspinner").options;
|
||||
var v=parseFloat($(_5).numberbox("getValue")||_7.value)||0;
|
||||
if(_6){
|
||||
v-=_7.increment;
|
||||
}else{
|
||||
v+=_7.increment;
|
||||
}
|
||||
$(_5).numberbox("setValue",v);
|
||||
};
|
||||
$.fn.numberspinner=function(_8,_9){
|
||||
if(typeof _8=="string"){
|
||||
var _a=$.fn.numberspinner.methods[_8];
|
||||
if(_a){
|
||||
return _a(this,_9);
|
||||
}else{
|
||||
return this.numberbox(_8,_9);
|
||||
}
|
||||
}
|
||||
_8=_8||{};
|
||||
return this.each(function(){
|
||||
var _b=$.data(this,"numberspinner");
|
||||
if(_b){
|
||||
$.extend(_b.options,_8);
|
||||
}else{
|
||||
$.data(this,"numberspinner",{options:$.extend({},$.fn.numberspinner.defaults,$.fn.numberspinner.parseOptions(this),_8)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.numberspinner.methods={options:function(jq){
|
||||
var _c=jq.numberbox("options");
|
||||
return $.extend($.data(jq[0],"numberspinner").options,{width:_c.width,value:_c.value,originalValue:_c.originalValue,disabled:_c.disabled,readonly:_c.readonly});
|
||||
}};
|
||||
$.fn.numberspinner.parseOptions=function(_d){
|
||||
return $.extend({},$.fn.spinner.parseOptions(_d),$.fn.numberbox.parseOptions(_d),{});
|
||||
};
|
||||
$.fn.numberspinner.defaults=$.extend({},$.fn.spinner.defaults,$.fn.numberbox.defaults,{spin:function(_e){
|
||||
_4(this,_e);
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
304
static/jeasyui/plugins/jquery.pagination.js
Executable file
304
static/jeasyui/plugins/jquery.pagination.js
Executable file
@@ -0,0 +1,304 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"pagination");
|
||||
var _4=_3.options;
|
||||
var bb=_3.bb={};
|
||||
if(_4.buttons&&!$.isArray(_4.buttons)){
|
||||
$(_4.buttons).insertAfter(_2);
|
||||
}
|
||||
var _5=$(_2).addClass("pagination").html("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr></tr></table>");
|
||||
var tr=_5.find("tr");
|
||||
var aa=$.extend([],_4.layout);
|
||||
if(!_4.showPageList){
|
||||
_6(aa,"list");
|
||||
}
|
||||
if(!_4.showPageInfo){
|
||||
_6(aa,"info");
|
||||
}
|
||||
if(!_4.showRefresh){
|
||||
_6(aa,"refresh");
|
||||
}
|
||||
if(aa[0]=="sep"){
|
||||
aa.shift();
|
||||
}
|
||||
if(aa[aa.length-1]=="sep"){
|
||||
aa.pop();
|
||||
}
|
||||
for(var _7=0;_7<aa.length;_7++){
|
||||
var _8=aa[_7];
|
||||
if(_8=="list"){
|
||||
var ps=$("<select class=\"pagination-page-list\"></select>");
|
||||
ps._bind("change",function(){
|
||||
_4.pageSize=parseInt($(this).val());
|
||||
_4.onChangePageSize.call(_2,_4.pageSize);
|
||||
_10(_2,_4.pageNumber);
|
||||
});
|
||||
for(var i=0;i<_4.pageList.length;i++){
|
||||
$("<option></option>").text(_4.pageList[i]).appendTo(ps);
|
||||
}
|
||||
$("<td></td>").append(ps).appendTo(tr);
|
||||
}else{
|
||||
if(_8=="sep"){
|
||||
$("<td><div class=\"pagination-btn-separator\"></div></td>").appendTo(tr);
|
||||
}else{
|
||||
if(_8=="first"){
|
||||
bb.first=_9("first");
|
||||
}else{
|
||||
if(_8=="prev"){
|
||||
bb.prev=_9("prev");
|
||||
}else{
|
||||
if(_8=="next"){
|
||||
bb.next=_9("next");
|
||||
}else{
|
||||
if(_8=="last"){
|
||||
bb.last=_9("last");
|
||||
}else{
|
||||
if(_8=="manual"){
|
||||
$("<span style=\"padding-left:6px;\"></span>").html(_4.beforePageText).appendTo(tr).wrap("<td></td>");
|
||||
bb.num=$("<input class=\"pagination-num\" type=\"text\" value=\"1\" size=\"2\">").appendTo(tr).wrap("<td></td>");
|
||||
bb.num._unbind(".pagination")._bind("keydown.pagination",function(e){
|
||||
if(e.keyCode==13){
|
||||
var _a=parseInt($(this).val())||1;
|
||||
_10(_2,_a);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
bb.after=$("<span style=\"padding-right:6px;\"></span>").appendTo(tr).wrap("<td></td>");
|
||||
}else{
|
||||
if(_8=="refresh"){
|
||||
bb.refresh=_9("refresh");
|
||||
}else{
|
||||
if(_8=="links"){
|
||||
$("<td class=\"pagination-links\"></td>").appendTo(tr);
|
||||
}else{
|
||||
if(_8=="info"){
|
||||
if(_7==aa.length-1){
|
||||
$("<div class=\"pagination-info\"></div>").appendTo(_5);
|
||||
}else{
|
||||
$("<td><div class=\"pagination-info\"></div></td>").appendTo(tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_4.buttons){
|
||||
$("<td><div class=\"pagination-btn-separator\"></div></td>").appendTo(tr);
|
||||
if($.isArray(_4.buttons)){
|
||||
for(var i=0;i<_4.buttons.length;i++){
|
||||
var _b=_4.buttons[i];
|
||||
if(_b=="-"){
|
||||
$("<td><div class=\"pagination-btn-separator\"></div></td>").appendTo(tr);
|
||||
}else{
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var a=$("<a href=\"javascript:;\"></a>").appendTo(td);
|
||||
a[0].onclick=eval(_b.handler||function(){
|
||||
});
|
||||
a.linkbutton($.extend({},_b,{plain:true}));
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
$(_4.buttons).appendTo(td).show();
|
||||
}
|
||||
}
|
||||
$("<div style=\"clear:both;\"></div>").appendTo(_5);
|
||||
function _9(_c){
|
||||
var _d=_4.nav[_c];
|
||||
var a=$("<a href=\"javascript:;\"></a>").appendTo(tr);
|
||||
a.wrap("<td></td>");
|
||||
a.linkbutton({iconCls:_d.iconCls,plain:true})._unbind(".pagination")._bind("click.pagination",function(){
|
||||
_d.handler.call(_2);
|
||||
});
|
||||
return a;
|
||||
};
|
||||
function _6(aa,_e){
|
||||
var _f=$.inArray(_e,aa);
|
||||
if(_f>=0){
|
||||
aa.splice(_f,1);
|
||||
}
|
||||
return aa;
|
||||
};
|
||||
};
|
||||
function _10(_11,_12){
|
||||
var _13=$.data(_11,"pagination").options;
|
||||
if(_13.onBeforeSelectPage.call(_11,_12,_13.pageSize)==false){
|
||||
_14(_11);
|
||||
return;
|
||||
}
|
||||
_14(_11,{pageNumber:_12});
|
||||
_13.onSelectPage.call(_11,_13.pageNumber,_13.pageSize);
|
||||
};
|
||||
function _14(_15,_16){
|
||||
var _17=$.data(_15,"pagination");
|
||||
var _18=_17.options;
|
||||
var bb=_17.bb;
|
||||
$.extend(_18,_16||{});
|
||||
var ps=$(_15).find("select.pagination-page-list");
|
||||
if(ps.length){
|
||||
ps.val(_18.pageSize+"");
|
||||
_18.pageSize=parseInt(ps.val());
|
||||
}
|
||||
var _19=Math.ceil(_18.total/_18.pageSize)||1;
|
||||
if(_18.pageNumber<1){
|
||||
_18.pageNumber=1;
|
||||
}
|
||||
if(_18.pageNumber>_19){
|
||||
_18.pageNumber=_19;
|
||||
}
|
||||
if(_18.total==0){
|
||||
_18.pageNumber=0;
|
||||
_19=0;
|
||||
}
|
||||
if(bb.num){
|
||||
bb.num.val(_18.pageNumber);
|
||||
}
|
||||
if(bb.after){
|
||||
bb.after.html(_18.afterPageText.replace(/{pages}/,_19));
|
||||
}
|
||||
var td=$(_15).find("td.pagination-links");
|
||||
if(td.length){
|
||||
td.empty();
|
||||
var _1a=_18.pageNumber-Math.floor(_18.links/2);
|
||||
if(_1a<1){
|
||||
_1a=1;
|
||||
}
|
||||
var _1b=_1a+_18.links-1;
|
||||
if(_1b>_19){
|
||||
_1b=_19;
|
||||
}
|
||||
_1a=_1b-_18.links+1;
|
||||
if(_1a<1){
|
||||
_1a=1;
|
||||
}
|
||||
for(var i=_1a;i<=_1b;i++){
|
||||
var a=$("<a class=\"pagination-link\" href=\"javascript:;\"></a>").appendTo(td);
|
||||
a.linkbutton({plain:true,text:i});
|
||||
if(i==_18.pageNumber){
|
||||
a.linkbutton("select");
|
||||
}else{
|
||||
a._unbind(".pagination")._bind("click.pagination",{pageNumber:i},function(e){
|
||||
_10(_15,e.data.pageNumber);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
var _1c=_18.displayMsg;
|
||||
_1c=_1c.replace(/{from}/,_18.total==0?0:_18.pageSize*(_18.pageNumber-1)+1);
|
||||
_1c=_1c.replace(/{to}/,Math.min(_18.pageSize*(_18.pageNumber),_18.total));
|
||||
_1c=_1c.replace(/{total}/,_18.total);
|
||||
$(_15).find("div.pagination-info").html(_1c);
|
||||
if(bb.first){
|
||||
bb.first.linkbutton({disabled:((!_18.total)||_18.pageNumber==1)});
|
||||
}
|
||||
if(bb.prev){
|
||||
bb.prev.linkbutton({disabled:((!_18.total)||_18.pageNumber==1)});
|
||||
}
|
||||
if(bb.next){
|
||||
bb.next.linkbutton({disabled:(_18.pageNumber==_19)});
|
||||
}
|
||||
if(bb.last){
|
||||
bb.last.linkbutton({disabled:(_18.pageNumber==_19)});
|
||||
}
|
||||
_1d(_15,_18.loading);
|
||||
};
|
||||
function _1d(_1e,_1f){
|
||||
var _20=$.data(_1e,"pagination");
|
||||
var _21=_20.options;
|
||||
_21.loading=_1f;
|
||||
if(_21.showRefresh&&_20.bb.refresh){
|
||||
_20.bb.refresh.linkbutton({iconCls:(_21.loading?"pagination-loading":"pagination-load")});
|
||||
}
|
||||
};
|
||||
$.fn.pagination=function(_22,_23){
|
||||
if(typeof _22=="string"){
|
||||
return $.fn.pagination.methods[_22](this,_23);
|
||||
}
|
||||
_22=_22||{};
|
||||
return this.each(function(){
|
||||
var _24;
|
||||
var _25=$.data(this,"pagination");
|
||||
if(_25){
|
||||
_24=$.extend(_25.options,_22);
|
||||
}else{
|
||||
_24=$.extend({},$.fn.pagination.defaults,$.fn.pagination.parseOptions(this),_22);
|
||||
$.data(this,"pagination",{options:_24});
|
||||
}
|
||||
_1(this);
|
||||
_14(this);
|
||||
});
|
||||
};
|
||||
$.fn.pagination.methods={options:function(jq){
|
||||
return $.data(jq[0],"pagination").options;
|
||||
},loading:function(jq){
|
||||
return jq.each(function(){
|
||||
_1d(this,true);
|
||||
});
|
||||
},loaded:function(jq){
|
||||
return jq.each(function(){
|
||||
_1d(this,false);
|
||||
});
|
||||
},refresh:function(jq,_26){
|
||||
return jq.each(function(){
|
||||
_14(this,_26);
|
||||
});
|
||||
},select:function(jq,_27){
|
||||
return jq.each(function(){
|
||||
_10(this,_27);
|
||||
});
|
||||
}};
|
||||
$.fn.pagination.parseOptions=function(_28){
|
||||
var t=$(_28);
|
||||
return $.extend({},$.parser.parseOptions(_28,[{total:"number",pageSize:"number",pageNumber:"number",links:"number"},{loading:"boolean",showPageList:"boolean",showPageInfo:"boolean",showRefresh:"boolean"}]),{pageList:(t.attr("pageList")?eval(t.attr("pageList")):undefined)});
|
||||
};
|
||||
$.fn.pagination.defaults={total:1,pageSize:10,pageNumber:1,pageList:[10,20,30,50],loading:false,buttons:null,showPageList:true,showPageInfo:true,showRefresh:true,links:10,layout:["list","sep","first","prev","sep","manual","sep","next","last","sep","refresh","info"],onBeforeSelectPage:function(_29,_2a){
|
||||
},onSelectPage:function(_2b,_2c){
|
||||
},onBeforeRefresh:function(_2d,_2e){
|
||||
},onRefresh:function(_2f,_30){
|
||||
},onChangePageSize:function(_31){
|
||||
},beforePageText:"Page",afterPageText:"of {pages}",displayMsg:"Displaying {from} to {to} of {total} items",nav:{first:{iconCls:"pagination-first",handler:function(){
|
||||
var _32=$(this).pagination("options");
|
||||
if(_32.pageNumber>1){
|
||||
$(this).pagination("select",1);
|
||||
}
|
||||
}},prev:{iconCls:"pagination-prev",handler:function(){
|
||||
var _33=$(this).pagination("options");
|
||||
if(_33.pageNumber>1){
|
||||
$(this).pagination("select",_33.pageNumber-1);
|
||||
}
|
||||
}},next:{iconCls:"pagination-next",handler:function(){
|
||||
var _34=$(this).pagination("options");
|
||||
var _35=Math.ceil(_34.total/_34.pageSize);
|
||||
if(_34.pageNumber<_35){
|
||||
$(this).pagination("select",_34.pageNumber+1);
|
||||
}
|
||||
}},last:{iconCls:"pagination-last",handler:function(){
|
||||
var _36=$(this).pagination("options");
|
||||
var _37=Math.ceil(_36.total/_36.pageSize);
|
||||
if(_36.pageNumber<_37){
|
||||
$(this).pagination("select",_37);
|
||||
}
|
||||
}},refresh:{iconCls:"pagination-refresh",handler:function(){
|
||||
var _38=$(this).pagination("options");
|
||||
if(_38.onBeforeRefresh.call(this,_38.pageNumber,_38.pageSize)!=false){
|
||||
$(this).pagination("select",_38.pageNumber);
|
||||
_38.onRefresh.call(this,_38.pageNumber,_38.pageSize);
|
||||
}
|
||||
}}}};
|
||||
})(jQuery);
|
||||
|
||||
694
static/jeasyui/plugins/jquery.panel.js
Executable file
694
static/jeasyui/plugins/jquery.panel.js
Executable file
@@ -0,0 +1,694 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
$.fn._remove=function(){
|
||||
return this.each(function(){
|
||||
$(this).remove();
|
||||
try{
|
||||
this.outerHTML="";
|
||||
}
|
||||
catch(err){
|
||||
}
|
||||
});
|
||||
};
|
||||
function _1(_2){
|
||||
_2._remove();
|
||||
};
|
||||
function _3(_4,_5){
|
||||
var _6=$.data(_4,"panel");
|
||||
var _7=_6.options;
|
||||
var _8=_6.panel;
|
||||
var _9=_8.children(".panel-header");
|
||||
var _a=_8.children(".panel-body");
|
||||
var _b=_8.children(".panel-footer");
|
||||
var _c=(_7.halign=="left"||_7.halign=="right");
|
||||
if(_5){
|
||||
$.extend(_7,{width:_5.width,height:_5.height,minWidth:_5.minWidth,maxWidth:_5.maxWidth,minHeight:_5.minHeight,maxHeight:_5.maxHeight,left:_5.left,top:_5.top});
|
||||
_7.hasResized=false;
|
||||
}
|
||||
var _d=_8.outerWidth();
|
||||
var _e=_8.outerHeight();
|
||||
_8._size(_7);
|
||||
var _f=_8.outerWidth();
|
||||
var _10=_8.outerHeight();
|
||||
if(_7.hasResized&&(_d==_f&&_e==_10)){
|
||||
return;
|
||||
}
|
||||
_7.hasResized=true;
|
||||
if(!_c){
|
||||
_9._outerWidth(_8.width());
|
||||
}
|
||||
_a._outerWidth(_8.width());
|
||||
if(!isNaN(parseInt(_7.height))){
|
||||
if(_c){
|
||||
if(_7.header){
|
||||
var _11=$(_7.header)._outerWidth();
|
||||
}else{
|
||||
_9.css("width","");
|
||||
var _11=_9._outerWidth();
|
||||
}
|
||||
var _12=_9.find(".panel-title");
|
||||
_11+=Math.min(_12._outerWidth(),_12._outerHeight());
|
||||
var _13=_8.height();
|
||||
_9._outerWidth(_11)._outerHeight(_13);
|
||||
_12._outerWidth(_9.height());
|
||||
_a._outerWidth(_8.width()-_11-_b._outerWidth())._outerHeight(_13);
|
||||
_b._outerHeight(_13);
|
||||
_a.css({left:"",right:""});
|
||||
if(_9.length){
|
||||
_a.css(_7.halign,(_9.position()[_7.halign]+_11)+"px");
|
||||
}
|
||||
_7.panelCssWidth=_8.css("width");
|
||||
if(_7.collapsed){
|
||||
_8._outerWidth(_11+_b._outerWidth());
|
||||
}
|
||||
}else{
|
||||
_a._outerHeight(_8.height()-_9._outerHeight()-_b._outerHeight());
|
||||
}
|
||||
}else{
|
||||
_a.css("height","");
|
||||
var min=$.parser.parseValue("minHeight",_7.minHeight,_8.parent());
|
||||
var max=$.parser.parseValue("maxHeight",_7.maxHeight,_8.parent());
|
||||
var _14=_9._outerHeight()+_b._outerHeight()+_8._outerHeight()-_8.height();
|
||||
_a._size("minHeight",min?(min-_14):"");
|
||||
_a._size("maxHeight",max?(max-_14):"");
|
||||
}
|
||||
_8.css({height:(_c?undefined:""),minHeight:"",maxHeight:"",left:_7.left,top:_7.top});
|
||||
_7.onResize.apply(_4,[_7.width,_7.height]);
|
||||
$(_4).panel("doLayout");
|
||||
};
|
||||
function _15(_16,_17){
|
||||
var _18=$.data(_16,"panel");
|
||||
var _19=_18.options;
|
||||
var _1a=_18.panel;
|
||||
if(_17){
|
||||
if(_17.left!=null){
|
||||
_19.left=_17.left;
|
||||
}
|
||||
if(_17.top!=null){
|
||||
_19.top=_17.top;
|
||||
}
|
||||
}
|
||||
_1a.css({left:_19.left,top:_19.top});
|
||||
_1a.find(".tooltip-f").each(function(){
|
||||
$(this).tooltip("reposition");
|
||||
});
|
||||
_19.onMove.apply(_16,[_19.left,_19.top]);
|
||||
};
|
||||
function _1b(_1c){
|
||||
$(_1c).addClass("panel-body")._size("clear");
|
||||
var _1d=$("<div class=\"panel\"></div>").insertBefore(_1c);
|
||||
_1d[0].appendChild(_1c);
|
||||
_1d._bind("_resize",function(e,_1e){
|
||||
if($(this).hasClass("easyui-fluid")||_1e){
|
||||
_3(_1c,{});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return _1d;
|
||||
};
|
||||
function _1f(_20){
|
||||
var _21=$.data(_20,"panel");
|
||||
var _22=_21.options;
|
||||
var _23=_21.panel;
|
||||
_23.css(_22.style);
|
||||
_23.addClass(_22.cls);
|
||||
_23.removeClass("panel-hleft panel-hright").addClass("panel-h"+_22.halign);
|
||||
_24();
|
||||
_25();
|
||||
var _26=$(_20).panel("header");
|
||||
var _27=$(_20).panel("body");
|
||||
var _28=$(_20).siblings(".panel-footer");
|
||||
if(_22.border){
|
||||
_26.removeClass("panel-header-noborder");
|
||||
_27.removeClass("panel-body-noborder");
|
||||
_28.removeClass("panel-footer-noborder");
|
||||
}else{
|
||||
_26.addClass("panel-header-noborder");
|
||||
_27.addClass("panel-body-noborder");
|
||||
_28.addClass("panel-footer-noborder");
|
||||
}
|
||||
_26.addClass(_22.headerCls);
|
||||
_27.addClass(_22.bodyCls);
|
||||
$(_20).attr("id",_22.id||"");
|
||||
if(_22.content){
|
||||
$(_20).panel("clear");
|
||||
$(_20).html(_22.content);
|
||||
$.parser.parse($(_20));
|
||||
}
|
||||
function _24(){
|
||||
if(_22.noheader||(!_22.title&&!_22.header)){
|
||||
_1(_23.children(".panel-header"));
|
||||
_23.children(".panel-body").addClass("panel-body-noheader");
|
||||
}else{
|
||||
if(_22.header){
|
||||
$(_22.header).addClass("panel-header").prependTo(_23);
|
||||
}else{
|
||||
var _29=_23.children(".panel-header");
|
||||
if(!_29.length){
|
||||
_29=$("<div class=\"panel-header\"></div>").prependTo(_23);
|
||||
}
|
||||
if(!$.isArray(_22.tools)){
|
||||
_29.find("div.panel-tool .panel-tool-a").appendTo(_22.tools);
|
||||
}
|
||||
_29.empty();
|
||||
var _2a=$("<div class=\"panel-title\"></div>").html(_22.title).appendTo(_29);
|
||||
if(_22.iconCls){
|
||||
_2a.addClass("panel-with-icon");
|
||||
$("<div class=\"panel-icon\"></div>").addClass(_22.iconCls).appendTo(_29);
|
||||
}
|
||||
if(_22.halign=="left"||_22.halign=="right"){
|
||||
_2a.addClass("panel-title-"+_22.titleDirection);
|
||||
}
|
||||
var _2b=$("<div class=\"panel-tool\"></div>").appendTo(_29);
|
||||
_2b._bind("click",function(e){
|
||||
e.stopPropagation();
|
||||
});
|
||||
if(_22.tools){
|
||||
if($.isArray(_22.tools)){
|
||||
$.map(_22.tools,function(t){
|
||||
_2c(_2b,t.iconCls,eval(t.handler));
|
||||
});
|
||||
}else{
|
||||
$(_22.tools).children().each(function(){
|
||||
$(this).addClass($(this).attr("iconCls")).addClass("panel-tool-a").appendTo(_2b);
|
||||
});
|
||||
}
|
||||
}
|
||||
if(_22.collapsible){
|
||||
_2c(_2b,"panel-tool-collapse",function(){
|
||||
if(_22.collapsed==true){
|
||||
_57(_20,true);
|
||||
}else{
|
||||
_43(_20,true);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(_22.minimizable){
|
||||
_2c(_2b,"panel-tool-min",function(){
|
||||
_62(_20);
|
||||
});
|
||||
}
|
||||
if(_22.maximizable){
|
||||
_2c(_2b,"panel-tool-max",function(){
|
||||
if(_22.maximized==true){
|
||||
_66(_20);
|
||||
}else{
|
||||
_42(_20);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(_22.closable){
|
||||
_2c(_2b,"panel-tool-close",function(){
|
||||
_44(_20);
|
||||
});
|
||||
}
|
||||
}
|
||||
_23.children("div.panel-body").removeClass("panel-body-noheader");
|
||||
}
|
||||
};
|
||||
function _2c(c,_2d,_2e){
|
||||
var a=$("<a href=\"javascript:;\"></a>").addClass(_2d).appendTo(c);
|
||||
a._bind("click",_2e);
|
||||
};
|
||||
function _25(){
|
||||
if(_22.footer){
|
||||
$(_22.footer).addClass("panel-footer").appendTo(_23);
|
||||
$(_20).addClass("panel-body-nobottom");
|
||||
}else{
|
||||
_23.children(".panel-footer").remove();
|
||||
$(_20).removeClass("panel-body-nobottom");
|
||||
}
|
||||
};
|
||||
};
|
||||
function _2f(_30,_31){
|
||||
var _32=$.data(_30,"panel");
|
||||
var _33=_32.options;
|
||||
if(_34){
|
||||
_33.queryParams=_31;
|
||||
}
|
||||
if(!_33.href){
|
||||
return;
|
||||
}
|
||||
if(!_32.isLoaded||!_33.cache){
|
||||
var _34=$.extend({},_33.queryParams);
|
||||
if(_33.onBeforeLoad.call(_30,_34)==false){
|
||||
return;
|
||||
}
|
||||
_32.isLoaded=false;
|
||||
if(_33.loadingMessage){
|
||||
$(_30).panel("clear");
|
||||
$(_30).html($("<div class=\"panel-loading\"></div>").html(_33.loadingMessage));
|
||||
}
|
||||
_33.loader.call(_30,_34,function(_35){
|
||||
var _36=_33.extractor.call(_30,_35);
|
||||
$(_30).panel("clear");
|
||||
$(_30).html(_36);
|
||||
$.parser.parse($(_30));
|
||||
_33.onLoad.apply(_30,arguments);
|
||||
_32.isLoaded=true;
|
||||
},function(){
|
||||
_33.onLoadError.apply(_30,arguments);
|
||||
});
|
||||
}
|
||||
};
|
||||
function _37(_38){
|
||||
var t=$(_38);
|
||||
t.find(".combo-f").each(function(){
|
||||
$(this).combo("destroy");
|
||||
});
|
||||
t.find(".m-btn").each(function(){
|
||||
$(this).menubutton("destroy");
|
||||
});
|
||||
t.find(".s-btn").each(function(){
|
||||
$(this).splitbutton("destroy");
|
||||
});
|
||||
t.find(".tooltip-f").each(function(){
|
||||
$(this).tooltip("destroy");
|
||||
});
|
||||
t.children("div").each(function(){
|
||||
$(this)._size("unfit");
|
||||
});
|
||||
t.empty();
|
||||
};
|
||||
function _39(_3a){
|
||||
$(_3a).panel("doLayout",true);
|
||||
};
|
||||
function _3b(_3c,_3d){
|
||||
var _3e=$.data(_3c,"panel");
|
||||
var _3f=_3e.options;
|
||||
var _40=_3e.panel;
|
||||
if(_3d!=true){
|
||||
if(_3f.onBeforeOpen.call(_3c)==false){
|
||||
return;
|
||||
}
|
||||
}
|
||||
_40.stop(true,true);
|
||||
if($.isFunction(_3f.openAnimation)){
|
||||
_3f.openAnimation.call(_3c,cb);
|
||||
}else{
|
||||
switch(_3f.openAnimation){
|
||||
case "slide":
|
||||
_40.slideDown(_3f.openDuration,cb);
|
||||
break;
|
||||
case "fade":
|
||||
_40.fadeIn(_3f.openDuration,cb);
|
||||
break;
|
||||
case "show":
|
||||
_40.show(_3f.openDuration,cb);
|
||||
break;
|
||||
default:
|
||||
_40.show();
|
||||
cb();
|
||||
}
|
||||
}
|
||||
function cb(){
|
||||
_3f.closed=false;
|
||||
_3f.minimized=false;
|
||||
var _41=_40.children(".panel-header").find("a.panel-tool-restore");
|
||||
if(_41.length){
|
||||
_3f.maximized=true;
|
||||
}
|
||||
_3f.onOpen.call(_3c);
|
||||
if(_3f.maximized==true){
|
||||
_3f.maximized=false;
|
||||
_42(_3c);
|
||||
}
|
||||
if(_3f.collapsed==true){
|
||||
_3f.collapsed=false;
|
||||
_43(_3c);
|
||||
}
|
||||
if(!_3f.collapsed){
|
||||
if(_3f.href&&(!_3e.isLoaded||!_3f.cache)){
|
||||
_2f(_3c);
|
||||
_39(_3c);
|
||||
_3f.doneLayout=true;
|
||||
}
|
||||
}
|
||||
if(!_3f.doneLayout){
|
||||
_3f.doneLayout=true;
|
||||
_39(_3c);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _44(_45,_46){
|
||||
var _47=$.data(_45,"panel");
|
||||
var _48=_47.options;
|
||||
var _49=_47.panel;
|
||||
if(_46!=true){
|
||||
if(_48.onBeforeClose.call(_45)==false){
|
||||
return;
|
||||
}
|
||||
}
|
||||
_49.find(".tooltip-f").each(function(){
|
||||
$(this).tooltip("hide");
|
||||
});
|
||||
_49.stop(true,true);
|
||||
_49._size("unfit");
|
||||
if($.isFunction(_48.closeAnimation)){
|
||||
_48.closeAnimation.call(_45,cb);
|
||||
}else{
|
||||
switch(_48.closeAnimation){
|
||||
case "slide":
|
||||
_49.slideUp(_48.closeDuration,cb);
|
||||
break;
|
||||
case "fade":
|
||||
_49.fadeOut(_48.closeDuration,cb);
|
||||
break;
|
||||
case "hide":
|
||||
_49.hide(_48.closeDuration,cb);
|
||||
break;
|
||||
default:
|
||||
_49.hide();
|
||||
cb();
|
||||
}
|
||||
}
|
||||
function cb(){
|
||||
_48.closed=true;
|
||||
_48.onClose.call(_45);
|
||||
};
|
||||
};
|
||||
function _4a(_4b,_4c){
|
||||
var _4d=$.data(_4b,"panel");
|
||||
var _4e=_4d.options;
|
||||
var _4f=_4d.panel;
|
||||
if(_4c!=true){
|
||||
if(_4e.onBeforeDestroy.call(_4b)==false){
|
||||
return;
|
||||
}
|
||||
}
|
||||
$(_4b).panel("clear").panel("clear","footer");
|
||||
_1(_4f);
|
||||
_4e.onDestroy.call(_4b);
|
||||
};
|
||||
function _43(_50,_51){
|
||||
var _52=$.data(_50,"panel").options;
|
||||
var _53=$.data(_50,"panel").panel;
|
||||
var _54=_53.children(".panel-body");
|
||||
var _55=_53.children(".panel-header");
|
||||
var _56=_55.find("a.panel-tool-collapse");
|
||||
if(_52.collapsed==true){
|
||||
return;
|
||||
}
|
||||
_54.stop(true,true);
|
||||
if(_52.onBeforeCollapse.call(_50)==false){
|
||||
return;
|
||||
}
|
||||
_56.addClass("panel-tool-expand");
|
||||
if(_51==true){
|
||||
if(_52.halign=="left"||_52.halign=="right"){
|
||||
_53.animate({width:_55._outerWidth()+_53.children(".panel-footer")._outerWidth()},function(){
|
||||
cb();
|
||||
});
|
||||
}else{
|
||||
_54.slideUp("normal",function(){
|
||||
cb();
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if(_52.halign=="left"||_52.halign=="right"){
|
||||
_53._outerWidth(_55._outerWidth()+_53.children(".panel-footer")._outerWidth());
|
||||
}
|
||||
cb();
|
||||
}
|
||||
function cb(){
|
||||
_54.hide();
|
||||
_52.collapsed=true;
|
||||
_52.onCollapse.call(_50);
|
||||
};
|
||||
};
|
||||
function _57(_58,_59){
|
||||
var _5a=$.data(_58,"panel").options;
|
||||
var _5b=$.data(_58,"panel").panel;
|
||||
var _5c=_5b.children(".panel-body");
|
||||
var _5d=_5b.children(".panel-header").find("a.panel-tool-collapse");
|
||||
if(_5a.collapsed==false){
|
||||
return;
|
||||
}
|
||||
_5c.stop(true,true);
|
||||
if(_5a.onBeforeExpand.call(_58)==false){
|
||||
return;
|
||||
}
|
||||
_5d.removeClass("panel-tool-expand");
|
||||
if(_59==true){
|
||||
if(_5a.halign=="left"||_5a.halign=="right"){
|
||||
_5c.show();
|
||||
_5b.animate({width:_5a.panelCssWidth},function(){
|
||||
cb();
|
||||
});
|
||||
}else{
|
||||
_5c.slideDown("normal",function(){
|
||||
cb();
|
||||
});
|
||||
}
|
||||
}else{
|
||||
if(_5a.halign=="left"||_5a.halign=="right"){
|
||||
_5b.css("width",_5a.panelCssWidth);
|
||||
}
|
||||
cb();
|
||||
}
|
||||
function cb(){
|
||||
_5c.show();
|
||||
_5a.collapsed=false;
|
||||
_5a.onExpand.call(_58);
|
||||
_2f(_58);
|
||||
_39(_58);
|
||||
};
|
||||
};
|
||||
function _42(_5e){
|
||||
var _5f=$.data(_5e,"panel").options;
|
||||
var _60=$.data(_5e,"panel").panel;
|
||||
var _61=_60.children(".panel-header").find("a.panel-tool-max");
|
||||
if(_5f.maximized==true){
|
||||
return;
|
||||
}
|
||||
_61.addClass("panel-tool-restore");
|
||||
if(!$.data(_5e,"panel").original){
|
||||
$.data(_5e,"panel").original={width:_5f.width,height:_5f.height,left:_5f.left,top:_5f.top,fit:_5f.fit};
|
||||
}
|
||||
_5f.left=0;
|
||||
_5f.top=0;
|
||||
_5f.fit=true;
|
||||
_3(_5e);
|
||||
_5f.minimized=false;
|
||||
_5f.maximized=true;
|
||||
_5f.onMaximize.call(_5e);
|
||||
};
|
||||
function _62(_63){
|
||||
var _64=$.data(_63,"panel").options;
|
||||
var _65=$.data(_63,"panel").panel;
|
||||
_65._size("unfit");
|
||||
_65.hide();
|
||||
_64.minimized=true;
|
||||
_64.maximized=false;
|
||||
_64.onMinimize.call(_63);
|
||||
};
|
||||
function _66(_67){
|
||||
var _68=$.data(_67,"panel").options;
|
||||
var _69=$.data(_67,"panel").panel;
|
||||
var _6a=_69.children(".panel-header").find("a.panel-tool-max");
|
||||
if(_68.maximized==false){
|
||||
return;
|
||||
}
|
||||
_69.show();
|
||||
_6a.removeClass("panel-tool-restore");
|
||||
$.extend(_68,$.data(_67,"panel").original);
|
||||
_3(_67);
|
||||
_68.minimized=false;
|
||||
_68.maximized=false;
|
||||
$.data(_67,"panel").original=null;
|
||||
_68.onRestore.call(_67);
|
||||
};
|
||||
function _6b(_6c,_6d){
|
||||
$.data(_6c,"panel").options.title=_6d;
|
||||
$(_6c).panel("header").find("div.panel-title").html(_6d);
|
||||
};
|
||||
var _6e=null;
|
||||
$(window)._unbind(".panel")._bind("resize.panel",function(){
|
||||
if(_6e){
|
||||
clearTimeout(_6e);
|
||||
}
|
||||
_6e=setTimeout(function(){
|
||||
var _6f=$("body.layout");
|
||||
if(_6f.length){
|
||||
_6f.layout("resize");
|
||||
$("body").children(".easyui-fluid:visible").each(function(){
|
||||
$(this).triggerHandler("_resize");
|
||||
});
|
||||
}else{
|
||||
$("body").panel("doLayout");
|
||||
}
|
||||
_6e=null;
|
||||
},100);
|
||||
});
|
||||
$.fn.panel=function(_70,_71){
|
||||
if(typeof _70=="string"){
|
||||
return $.fn.panel.methods[_70](this,_71);
|
||||
}
|
||||
_70=_70||{};
|
||||
return this.each(function(){
|
||||
var _72=$.data(this,"panel");
|
||||
var _73;
|
||||
if(_72){
|
||||
_73=$.extend(_72.options,_70);
|
||||
_72.isLoaded=false;
|
||||
}else{
|
||||
_73=$.extend({},$.fn.panel.defaults,$.fn.panel.parseOptions(this),_70);
|
||||
$(this).attr("title","");
|
||||
_72=$.data(this,"panel",{options:_73,panel:_1b(this),isLoaded:false});
|
||||
}
|
||||
_1f(this);
|
||||
$(this).show();
|
||||
if(_73.doSize==true){
|
||||
_72.panel.css("display","block");
|
||||
_3(this);
|
||||
}
|
||||
if(_73.closed==true||_73.minimized==true){
|
||||
_72.panel.hide();
|
||||
}else{
|
||||
_3b(this);
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.panel.methods={options:function(jq){
|
||||
return $.data(jq[0],"panel").options;
|
||||
},panel:function(jq){
|
||||
return $.data(jq[0],"panel").panel;
|
||||
},header:function(jq){
|
||||
return $.data(jq[0],"panel").panel.children(".panel-header");
|
||||
},footer:function(jq){
|
||||
return jq.panel("panel").children(".panel-footer");
|
||||
},body:function(jq){
|
||||
return $.data(jq[0],"panel").panel.children(".panel-body");
|
||||
},setTitle:function(jq,_74){
|
||||
return jq.each(function(){
|
||||
_6b(this,_74);
|
||||
});
|
||||
},open:function(jq,_75){
|
||||
return jq.each(function(){
|
||||
_3b(this,_75);
|
||||
});
|
||||
},close:function(jq,_76){
|
||||
return jq.each(function(){
|
||||
_44(this,_76);
|
||||
});
|
||||
},destroy:function(jq,_77){
|
||||
return jq.each(function(){
|
||||
_4a(this,_77);
|
||||
});
|
||||
},clear:function(jq,_78){
|
||||
return jq.each(function(){
|
||||
_37(_78=="footer"?$(this).panel("footer"):this);
|
||||
});
|
||||
},refresh:function(jq,_79){
|
||||
return jq.each(function(){
|
||||
var _7a=$.data(this,"panel");
|
||||
_7a.isLoaded=false;
|
||||
if(_79){
|
||||
if(typeof _79=="string"){
|
||||
_7a.options.href=_79;
|
||||
}else{
|
||||
_7a.options.queryParams=_79;
|
||||
}
|
||||
}
|
||||
_2f(this);
|
||||
});
|
||||
},resize:function(jq,_7b){
|
||||
return jq.each(function(){
|
||||
_3(this,_7b||{});
|
||||
});
|
||||
},doLayout:function(jq,all){
|
||||
return jq.each(function(){
|
||||
_7c(this,"body");
|
||||
_7c($(this).siblings(".panel-footer")[0],"footer");
|
||||
function _7c(_7d,_7e){
|
||||
if(!_7d){
|
||||
return;
|
||||
}
|
||||
var _7f=_7d==$("body")[0];
|
||||
var s=$(_7d).find("div.panel:visible,div.accordion:visible,div.tabs-container:visible,div.layout:visible,.easyui-fluid:visible").filter(function(_80,el){
|
||||
var p=$(el).parents(".panel-"+_7e+":first");
|
||||
return _7f?p.length==0:p[0]==_7d;
|
||||
});
|
||||
s.each(function(){
|
||||
$(this).triggerHandler("_resize",[all||false]);
|
||||
});
|
||||
};
|
||||
});
|
||||
},move:function(jq,_81){
|
||||
return jq.each(function(){
|
||||
_15(this,_81);
|
||||
});
|
||||
},maximize:function(jq){
|
||||
return jq.each(function(){
|
||||
_42(this);
|
||||
});
|
||||
},minimize:function(jq){
|
||||
return jq.each(function(){
|
||||
_62(this);
|
||||
});
|
||||
},restore:function(jq){
|
||||
return jq.each(function(){
|
||||
_66(this);
|
||||
});
|
||||
},collapse:function(jq,_82){
|
||||
return jq.each(function(){
|
||||
_43(this,_82);
|
||||
});
|
||||
},expand:function(jq,_83){
|
||||
return jq.each(function(){
|
||||
_57(this,_83);
|
||||
});
|
||||
}};
|
||||
$.fn.panel.parseOptions=function(_84){
|
||||
var t=$(_84);
|
||||
var hh=t.children(".panel-header,header");
|
||||
var ff=t.children(".panel-footer,footer");
|
||||
return $.extend({},$.parser.parseOptions(_84,["id","width","height","left","top","title","iconCls","cls","headerCls","bodyCls","tools","href","method","header","footer","halign","titleDirection",{cache:"boolean",fit:"boolean",border:"boolean",noheader:"boolean"},{collapsible:"boolean",minimizable:"boolean",maximizable:"boolean"},{closable:"boolean",collapsed:"boolean",minimized:"boolean",maximized:"boolean",closed:"boolean"},"openAnimation","closeAnimation",{openDuration:"number",closeDuration:"number"},]),{loadingMessage:(t.attr("loadingMessage")!=undefined?t.attr("loadingMessage"):undefined),header:(hh.length?hh.removeClass("panel-header"):undefined),footer:(ff.length?ff.removeClass("panel-footer"):undefined)});
|
||||
};
|
||||
$.fn.panel.defaults={id:null,title:null,iconCls:null,width:"auto",height:"auto",left:null,top:null,cls:null,headerCls:null,bodyCls:null,style:{},href:null,cache:true,fit:false,border:true,doSize:true,noheader:false,content:null,halign:"top",titleDirection:"down",collapsible:false,minimizable:false,maximizable:false,closable:false,collapsed:false,minimized:false,maximized:false,closed:false,openAnimation:false,openDuration:400,closeAnimation:false,closeDuration:400,tools:null,footer:null,header:null,queryParams:{},method:"get",href:null,loadingMessage:"Loading...",loader:function(_85,_86,_87){
|
||||
var _88=$(this).panel("options");
|
||||
if(!_88.href){
|
||||
return false;
|
||||
}
|
||||
$.ajax({type:_88.method,url:_88.href,cache:false,data:_85,dataType:"html",success:function(_89){
|
||||
_86(_89);
|
||||
},error:function(){
|
||||
_87.apply(this,arguments);
|
||||
}});
|
||||
},extractor:function(_8a){
|
||||
var _8b=/<body[^>]*>((.|[\n\r])*)<\/body>/im;
|
||||
var _8c=_8b.exec(_8a);
|
||||
if(_8c){
|
||||
return _8c[1];
|
||||
}else{
|
||||
return _8a;
|
||||
}
|
||||
},onBeforeLoad:function(_8d){
|
||||
},onLoad:function(){
|
||||
},onLoadError:function(){
|
||||
},onBeforeOpen:function(){
|
||||
},onOpen:function(){
|
||||
},onBeforeClose:function(){
|
||||
},onClose:function(){
|
||||
},onBeforeDestroy:function(){
|
||||
},onDestroy:function(){
|
||||
},onResize:function(_8e,_8f){
|
||||
},onMove:function(_90,top){
|
||||
},onMaximize:function(){
|
||||
},onRestore:function(){
|
||||
},onMinimize:function(){
|
||||
},onBeforeCollapse:function(){
|
||||
},onBeforeExpand:function(){
|
||||
},onCollapse:function(){
|
||||
},onExpand:function(){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
393
static/jeasyui/plugins/jquery.parser.js
Executable file
393
static/jeasyui/plugins/jquery.parser.js
Executable file
@@ -0,0 +1,393 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
$.easyui={indexOfArray:function(a,o,id){
|
||||
for(var i=0,_1=a.length;i<_1;i++){
|
||||
if(id==undefined){
|
||||
if(a[i]==o){
|
||||
return i;
|
||||
}
|
||||
}else{
|
||||
if(a[i][o]==id){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
},removeArrayItem:function(a,o,id){
|
||||
if(typeof o=="string"){
|
||||
for(var i=0,_2=a.length;i<_2;i++){
|
||||
if(a[i][o]==id){
|
||||
a.splice(i,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var _3=this.indexOfArray(a,o);
|
||||
if(_3!=-1){
|
||||
a.splice(_3,1);
|
||||
}
|
||||
}
|
||||
},addArrayItem:function(a,o,r){
|
||||
var _4=this.indexOfArray(a,o,r?r[o]:undefined);
|
||||
if(_4==-1){
|
||||
a.push(r?r:o);
|
||||
}else{
|
||||
a[_4]=r?r:o;
|
||||
}
|
||||
},getArrayItem:function(a,o,id){
|
||||
var _5=this.indexOfArray(a,o,id);
|
||||
return _5==-1?null:a[_5];
|
||||
},forEach:function(_6,_7,_8){
|
||||
var _9=[];
|
||||
for(var i=0;i<_6.length;i++){
|
||||
_9.push(_6[i]);
|
||||
}
|
||||
while(_9.length){
|
||||
var _a=_9.shift();
|
||||
if(_8(_a)==false){
|
||||
return;
|
||||
}
|
||||
if(_7&&_a.children){
|
||||
for(var i=_a.children.length-1;i>=0;i--){
|
||||
_9.unshift(_a.children[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}};
|
||||
$.parser={auto:true,emptyFn:function(){
|
||||
},onComplete:function(_b){
|
||||
},plugins:["draggable","droppable","resizable","pagination","tooltip","linkbutton","menu","sidemenu","menubutton","splitbutton","switchbutton","progressbar","radiobutton","checkbox","tree","textbox","passwordbox","maskedbox","filebox","combo","combobox","combotree","combogrid","combotreegrid","tagbox","numberbox","validatebox","searchbox","spinner","numberspinner","timespinner","datetimespinner","calendar","datebox","datetimebox","timepicker","slider","layout","panel","datagrid","propertygrid","treegrid","datalist","tabs","accordion","window","dialog","form"],parse:function(_c){
|
||||
var aa=[];
|
||||
for(var i=0;i<$.parser.plugins.length;i++){
|
||||
var _d=$.parser.plugins[i];
|
||||
var r=$(".easyui-"+_d,_c);
|
||||
if(r.length){
|
||||
if(r[_d]){
|
||||
r.each(function(){
|
||||
$(this)[_d]($.data(this,"options")||{});
|
||||
});
|
||||
}else{
|
||||
aa.push({name:_d,jq:r});
|
||||
}
|
||||
}
|
||||
}
|
||||
if(aa.length&&window.easyloader){
|
||||
var _e=[];
|
||||
for(var i=0;i<aa.length;i++){
|
||||
_e.push(aa[i].name);
|
||||
}
|
||||
easyloader.load(_e,function(){
|
||||
for(var i=0;i<aa.length;i++){
|
||||
var _f=aa[i].name;
|
||||
var jq=aa[i].jq;
|
||||
jq.each(function(){
|
||||
$(this)[_f]($.data(this,"options")||{});
|
||||
});
|
||||
}
|
||||
$.parser.onComplete.call($.parser,_c);
|
||||
});
|
||||
}else{
|
||||
$.parser.onComplete.call($.parser,_c);
|
||||
}
|
||||
},parseValue:function(_10,_11,_12,_13){
|
||||
_13=_13||0;
|
||||
var v=$.trim(String(_11||""));
|
||||
var _14=v.substr(v.length-1,1);
|
||||
if(_14=="%"){
|
||||
v=parseFloat(v.substr(0,v.length-1));
|
||||
if(_10.toLowerCase().indexOf("width")>=0){
|
||||
_13+=_12[0].offsetWidth-_12[0].clientWidth;
|
||||
v=Math.floor((_12.width()-_13)*v/100);
|
||||
}else{
|
||||
_13+=_12[0].offsetHeight-_12[0].clientHeight;
|
||||
v=Math.floor((_12.height()-_13)*v/100);
|
||||
}
|
||||
}else{
|
||||
v=parseInt(v)||undefined;
|
||||
}
|
||||
return v;
|
||||
},parseOptions:function(_15,_16){
|
||||
var t=$(_15);
|
||||
var _17={};
|
||||
var s=$.trim(t.attr("data-options"));
|
||||
if(s){
|
||||
if(s.substring(0,1)!="{"){
|
||||
s="{"+s+"}";
|
||||
}
|
||||
_17=(new Function("return "+s))();
|
||||
}
|
||||
$.map(["width","height","left","top","minWidth","maxWidth","minHeight","maxHeight"],function(p){
|
||||
var pv=$.trim(_15.style[p]||"");
|
||||
if(pv){
|
||||
if(pv.indexOf("%")==-1){
|
||||
pv=parseInt(pv);
|
||||
if(isNaN(pv)){
|
||||
pv=undefined;
|
||||
}
|
||||
}
|
||||
_17[p]=pv;
|
||||
}
|
||||
});
|
||||
if(_16){
|
||||
var _18={};
|
||||
for(var i=0;i<_16.length;i++){
|
||||
var pp=_16[i];
|
||||
if(typeof pp=="string"){
|
||||
_18[pp]=t.attr(pp);
|
||||
}else{
|
||||
for(var _19 in pp){
|
||||
var _1a=pp[_19];
|
||||
if(_1a=="boolean"){
|
||||
_18[_19]=t.attr(_19)?(t.attr(_19)=="true"):undefined;
|
||||
}else{
|
||||
if(_1a=="number"){
|
||||
_18[_19]=t.attr(_19)=="0"?0:parseFloat(t.attr(_19))||undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$.extend(_17,_18);
|
||||
}
|
||||
return _17;
|
||||
},parseVars:function(){
|
||||
var d=$("<div style=\"position:absolute;top:-1000px;width:100px;height:100px;padding:5px\"></div>").appendTo("body");
|
||||
$._boxModel=d.outerWidth()!=100;
|
||||
d.remove();
|
||||
d=$("<div style=\"position:fixed\"></div>").appendTo("body");
|
||||
$._positionFixed=(d.css("position")=="fixed");
|
||||
d.remove();
|
||||
}};
|
||||
$(function(){
|
||||
$.parser.parseVars();
|
||||
if(!window.easyloader&&$.parser.auto){
|
||||
$.parser.parse();
|
||||
}
|
||||
});
|
||||
$.fn._outerWidth=function(_1b){
|
||||
if(_1b==undefined){
|
||||
if(this[0]==window){
|
||||
return this.width()||document.body.clientWidth;
|
||||
}
|
||||
return this.outerWidth()||0;
|
||||
}
|
||||
return this._size("width",_1b);
|
||||
};
|
||||
$.fn._outerHeight=function(_1c){
|
||||
if(_1c==undefined){
|
||||
if(this[0]==window){
|
||||
return this.height()||document.body.clientHeight;
|
||||
}
|
||||
return this.outerHeight()||0;
|
||||
}
|
||||
return this._size("height",_1c);
|
||||
};
|
||||
$.fn._scrollLeft=function(_1d){
|
||||
if(_1d==undefined){
|
||||
return this.scrollLeft();
|
||||
}else{
|
||||
return this.each(function(){
|
||||
$(this).scrollLeft(_1d);
|
||||
});
|
||||
}
|
||||
};
|
||||
$.fn._propAttr=$.fn.prop||$.fn.attr;
|
||||
$.fn._bind=$.fn.on;
|
||||
$.fn._unbind=$.fn.off;
|
||||
$.fn._size=function(_1e,_1f){
|
||||
if(typeof _1e=="string"){
|
||||
if(_1e=="clear"){
|
||||
return this.each(function(){
|
||||
$(this).css({width:"",minWidth:"",maxWidth:"",height:"",minHeight:"",maxHeight:""});
|
||||
});
|
||||
}else{
|
||||
if(_1e=="fit"){
|
||||
return this.each(function(){
|
||||
_20(this,this.tagName=="BODY"?$("body"):$(this).parent(),true);
|
||||
});
|
||||
}else{
|
||||
if(_1e=="unfit"){
|
||||
return this.each(function(){
|
||||
_20(this,$(this).parent(),false);
|
||||
});
|
||||
}else{
|
||||
if(_1f==undefined){
|
||||
return _21(this[0],_1e);
|
||||
}else{
|
||||
return this.each(function(){
|
||||
_21(this,_1e,_1f);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return this.each(function(){
|
||||
_1f=_1f||$(this).parent();
|
||||
$.extend(_1e,_20(this,_1f,_1e.fit)||{});
|
||||
var r1=_22(this,"width",_1f,_1e);
|
||||
var r2=_22(this,"height",_1f,_1e);
|
||||
if(r1||r2){
|
||||
$(this).addClass("easyui-fluid");
|
||||
}else{
|
||||
$(this).removeClass("easyui-fluid");
|
||||
}
|
||||
});
|
||||
}
|
||||
function _20(_23,_24,fit){
|
||||
if(!_24.length){
|
||||
return false;
|
||||
}
|
||||
var t=$(_23)[0];
|
||||
var p=_24[0];
|
||||
var _25=p.fcount||0;
|
||||
if(fit){
|
||||
if(!t.fitted){
|
||||
t.fitted=true;
|
||||
p.fcount=_25+1;
|
||||
$(p).addClass("panel-noscroll");
|
||||
if(p.tagName=="BODY"){
|
||||
$("html").addClass("panel-fit");
|
||||
}
|
||||
}
|
||||
return {width:($(p).width()||1),height:($(p).height()||1)};
|
||||
}else{
|
||||
if(t.fitted){
|
||||
t.fitted=false;
|
||||
p.fcount=_25-1;
|
||||
if(p.fcount==0){
|
||||
$(p).removeClass("panel-noscroll");
|
||||
if(p.tagName=="BODY"){
|
||||
$("html").removeClass("panel-fit");
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
function _22(_26,_27,_28,_29){
|
||||
var t=$(_26);
|
||||
var p=_27;
|
||||
var p1=p.substr(0,1).toUpperCase()+p.substr(1);
|
||||
var min=$.parser.parseValue("min"+p1,_29["min"+p1],_28);
|
||||
var max=$.parser.parseValue("max"+p1,_29["max"+p1],_28);
|
||||
var val=$.parser.parseValue(p,_29[p],_28);
|
||||
var _2a=(String(_29[p]||"").indexOf("%")>=0?true:false);
|
||||
if(!isNaN(val)){
|
||||
var v=Math.min(Math.max(val,min||0),max||99999);
|
||||
if(!_2a){
|
||||
_29[p]=v;
|
||||
}
|
||||
t._size("min"+p1,"");
|
||||
t._size("max"+p1,"");
|
||||
t._size(p,v);
|
||||
}else{
|
||||
t._size(p,"");
|
||||
t._size("min"+p1,min);
|
||||
t._size("max"+p1,max);
|
||||
}
|
||||
return _2a||_29.fit;
|
||||
};
|
||||
function _21(_2b,_2c,_2d){
|
||||
var t=$(_2b);
|
||||
if(_2d==undefined){
|
||||
_2d=parseInt(_2b.style[_2c]);
|
||||
if(isNaN(_2d)){
|
||||
return undefined;
|
||||
}
|
||||
if($._boxModel){
|
||||
_2d+=_2e();
|
||||
}
|
||||
return _2d;
|
||||
}else{
|
||||
if(_2d===""){
|
||||
t.css(_2c,"");
|
||||
}else{
|
||||
if($._boxModel){
|
||||
_2d-=_2e();
|
||||
if(_2d<0){
|
||||
_2d=0;
|
||||
}
|
||||
}
|
||||
t.css(_2c,_2d+"px");
|
||||
}
|
||||
}
|
||||
function _2e(){
|
||||
if(_2c.toLowerCase().indexOf("width")>=0){
|
||||
return t.outerWidth()-t.width();
|
||||
}else{
|
||||
return t.outerHeight()-t.height();
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
})(jQuery);
|
||||
(function($){
|
||||
var _2f=null;
|
||||
var _30=null;
|
||||
var _31=false;
|
||||
function _32(e){
|
||||
if(e.touches.length!=1){
|
||||
return;
|
||||
}
|
||||
if(!_31){
|
||||
_31=true;
|
||||
dblClickTimer=setTimeout(function(){
|
||||
_31=false;
|
||||
},500);
|
||||
}else{
|
||||
clearTimeout(dblClickTimer);
|
||||
_31=false;
|
||||
_33(e,"dblclick");
|
||||
}
|
||||
_2f=setTimeout(function(){
|
||||
_33(e,"contextmenu",3);
|
||||
},1000);
|
||||
_33(e,"mousedown");
|
||||
if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
function _34(e){
|
||||
if(e.touches.length!=1){
|
||||
return;
|
||||
}
|
||||
if(_2f){
|
||||
clearTimeout(_2f);
|
||||
}
|
||||
_33(e,"mousemove");
|
||||
if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
function _35(e){
|
||||
if(_2f){
|
||||
clearTimeout(_2f);
|
||||
}
|
||||
_33(e,"mouseup");
|
||||
if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
function _33(e,_36,_37){
|
||||
var _38=new $.Event(_36);
|
||||
_38.pageX=e.changedTouches[0].pageX;
|
||||
_38.pageY=e.changedTouches[0].pageY;
|
||||
_38.which=_37||1;
|
||||
$(e.target).trigger(_38);
|
||||
};
|
||||
if(document.addEventListener){
|
||||
document.addEventListener("touchstart",_32,true);
|
||||
document.addEventListener("touchmove",_34,true);
|
||||
document.addEventListener("touchend",_35,true);
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
164
static/jeasyui/plugins/jquery.passwordbox.js
Normal file
164
static/jeasyui/plugins/jquery.passwordbox.js
Normal file
@@ -0,0 +1,164 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"passwordbox");
|
||||
var _4=_3.options;
|
||||
var _5=$.extend(true,[],_4.icons);
|
||||
if(_4.showEye){
|
||||
_5.push({iconCls:"passwordbox-open",handler:function(e){
|
||||
_4.revealed=!_4.revealed;
|
||||
_6(_2);
|
||||
}});
|
||||
}
|
||||
$(_2).addClass("passwordbox-f").textbox($.extend({},_4,{icons:_5}));
|
||||
_6(_2);
|
||||
};
|
||||
function _7(_8,_9,_a){
|
||||
var _b=$(_8).data("passwordbox");
|
||||
var t=$(_8);
|
||||
var _c=t.passwordbox("options");
|
||||
if(_c.revealed){
|
||||
t.textbox("setValue",_9);
|
||||
return;
|
||||
}
|
||||
_b.converting=true;
|
||||
var _d=unescape(_c.passwordChar);
|
||||
var cc=_9.split("");
|
||||
var vv=t.passwordbox("getValue").split("");
|
||||
for(var i=0;i<cc.length;i++){
|
||||
var c=cc[i];
|
||||
if(c!=vv[i]){
|
||||
if(c!=_d){
|
||||
vv.splice(i,0,c);
|
||||
}
|
||||
}
|
||||
}
|
||||
var _e=t.passwordbox("getSelectionStart");
|
||||
if(cc.length<vv.length){
|
||||
vv.splice(_e,vv.length-cc.length,"");
|
||||
}
|
||||
for(var i=0;i<cc.length;i++){
|
||||
if(_a||i!=_e-1){
|
||||
cc[i]=_d;
|
||||
}
|
||||
}
|
||||
t.textbox("setValue",vv.join(""));
|
||||
t.textbox("setText",cc.join(""));
|
||||
t.textbox("setSelectionRange",{start:_e,end:_e});
|
||||
setTimeout(function(){
|
||||
_b.converting=false;
|
||||
},0);
|
||||
};
|
||||
function _6(_f,_10){
|
||||
var t=$(_f);
|
||||
var _11=t.passwordbox("options");
|
||||
var _12=t.next().find(".passwordbox-open");
|
||||
var _13=unescape(_11.passwordChar);
|
||||
_10=_10==undefined?t.textbox("getValue"):_10;
|
||||
t.textbox("setValue",_10);
|
||||
t.textbox("setText",_11.revealed?_10:_10.replace(/./ig,_13));
|
||||
_11.revealed?_12.addClass("passwordbox-close"):_12.removeClass("passwordbox-close");
|
||||
};
|
||||
function _14(e){
|
||||
var _15=e.data.target;
|
||||
var t=$(e.data.target);
|
||||
var _16=t.data("passwordbox");
|
||||
var _17=t.data("passwordbox").options;
|
||||
_16.checking=true;
|
||||
_16.value=t.passwordbox("getText");
|
||||
(function(){
|
||||
if(_16.checking){
|
||||
var _18=t.passwordbox("getText");
|
||||
if(_16.value!=_18){
|
||||
_16.value=_18;
|
||||
if(_16.lastTimer){
|
||||
clearTimeout(_16.lastTimer);
|
||||
_16.lastTimer=undefined;
|
||||
}
|
||||
_7(_15,_18);
|
||||
_16.lastTimer=setTimeout(function(){
|
||||
_7(_15,t.passwordbox("getText"),true);
|
||||
_16.lastTimer=undefined;
|
||||
},_17.lastDelay);
|
||||
}
|
||||
setTimeout(arguments.callee,_17.checkInterval);
|
||||
}
|
||||
})();
|
||||
};
|
||||
function _19(e){
|
||||
var _1a=e.data.target;
|
||||
var _1b=$(_1a).data("passwordbox");
|
||||
_1b.checking=false;
|
||||
if(_1b.lastTimer){
|
||||
clearTimeout(_1b.lastTimer);
|
||||
_1b.lastTimer=undefined;
|
||||
}
|
||||
_6(_1a);
|
||||
};
|
||||
$.fn.passwordbox=function(_1c,_1d){
|
||||
if(typeof _1c=="string"){
|
||||
var _1e=$.fn.passwordbox.methods[_1c];
|
||||
if(_1e){
|
||||
return _1e(this,_1d);
|
||||
}else{
|
||||
return this.textbox(_1c,_1d);
|
||||
}
|
||||
}
|
||||
_1c=_1c||{};
|
||||
return this.each(function(){
|
||||
var _1f=$.data(this,"passwordbox");
|
||||
if(_1f){
|
||||
$.extend(_1f.options,_1c);
|
||||
}else{
|
||||
_1f=$.data(this,"passwordbox",{options:$.extend({},$.fn.passwordbox.defaults,$.fn.passwordbox.parseOptions(this),_1c)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.passwordbox.methods={options:function(jq){
|
||||
return $.data(jq[0],"passwordbox").options;
|
||||
},setValue:function(jq,_20){
|
||||
return jq.each(function(){
|
||||
_6(this,_20);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_6(this,"");
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("reset");
|
||||
_6(this);
|
||||
});
|
||||
},showPassword:function(jq){
|
||||
return jq.each(function(){
|
||||
var _21=$(this).passwordbox("options");
|
||||
_21.revealed=true;
|
||||
_6(this);
|
||||
});
|
||||
},hidePassword:function(jq){
|
||||
return jq.each(function(){
|
||||
var _22=$(this).passwordbox("options");
|
||||
_22.revealed=false;
|
||||
_6(this);
|
||||
});
|
||||
}};
|
||||
$.fn.passwordbox.parseOptions=function(_23){
|
||||
return $.extend({},$.fn.textbox.parseOptions(_23),$.parser.parseOptions(_23,["passwordChar",{checkInterval:"number",lastDelay:"number",revealed:"boolean",showEye:"boolean"}]));
|
||||
};
|
||||
$.fn.passwordbox.defaults=$.extend({},$.fn.textbox.defaults,{passwordChar:"%u25CF",checkInterval:200,lastDelay:500,revealed:false,showEye:true,inputEvents:{focus:_14,blur:_19,keydown:function(e){
|
||||
var _24=$(e.data.target).data("passwordbox");
|
||||
return !_24.converting;
|
||||
}},val:function(_25){
|
||||
return $(_25).parent().prev().passwordbox("getValue");
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
84
static/jeasyui/plugins/jquery.progressbar.js
Executable file
84
static/jeasyui/plugins/jquery.progressbar.js
Executable file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
$(_2).addClass("progressbar");
|
||||
$(_2).html("<div class=\"progressbar-text\"></div><div class=\"progressbar-value\"><div class=\"progressbar-text\"></div></div>");
|
||||
$(_2)._bind("_resize",function(e,_3){
|
||||
if($(this).hasClass("easyui-fluid")||_3){
|
||||
_4(_2);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return $(_2);
|
||||
};
|
||||
function _4(_5,_6){
|
||||
var _7=$.data(_5,"progressbar").options;
|
||||
var _8=$.data(_5,"progressbar").bar;
|
||||
if(_6){
|
||||
_7.width=_6;
|
||||
}
|
||||
_8._size(_7);
|
||||
_8.find("div.progressbar-text").css("width",_8.width());
|
||||
_8.find("div.progressbar-text,div.progressbar-value").css({height:_8.height()+"px",lineHeight:_8.height()+"px"});
|
||||
};
|
||||
$.fn.progressbar=function(_9,_a){
|
||||
if(typeof _9=="string"){
|
||||
var _b=$.fn.progressbar.methods[_9];
|
||||
if(_b){
|
||||
return _b(this,_a);
|
||||
}
|
||||
}
|
||||
_9=_9||{};
|
||||
return this.each(function(){
|
||||
var _c=$.data(this,"progressbar");
|
||||
if(_c){
|
||||
$.extend(_c.options,_9);
|
||||
}else{
|
||||
_c=$.data(this,"progressbar",{options:$.extend({},$.fn.progressbar.defaults,$.fn.progressbar.parseOptions(this),_9),bar:_1(this)});
|
||||
}
|
||||
$(this).progressbar("setValue",_c.options.value);
|
||||
_4(this);
|
||||
});
|
||||
};
|
||||
$.fn.progressbar.methods={options:function(jq){
|
||||
return $.data(jq[0],"progressbar").options;
|
||||
},resize:function(jq,_d){
|
||||
return jq.each(function(){
|
||||
_4(this,_d);
|
||||
});
|
||||
},getValue:function(jq){
|
||||
return $.data(jq[0],"progressbar").options.value;
|
||||
},setValue:function(jq,_e){
|
||||
if(_e<0){
|
||||
_e=0;
|
||||
}
|
||||
if(_e>100){
|
||||
_e=100;
|
||||
}
|
||||
return jq.each(function(){
|
||||
var _f=$.data(this,"progressbar").options;
|
||||
var _10=_f.text.replace(/{value}/,_e);
|
||||
var _11=_f.value;
|
||||
_f.value=_e;
|
||||
$(this).find("div.progressbar-value").width(_e+"%");
|
||||
$(this).find("div.progressbar-text").html(_10);
|
||||
if(_11!=_e){
|
||||
_f.onChange.call(this,_e,_11);
|
||||
}
|
||||
});
|
||||
}};
|
||||
$.fn.progressbar.parseOptions=function(_12){
|
||||
return $.extend({},$.parser.parseOptions(_12,["width","height","text",{value:"number"}]));
|
||||
};
|
||||
$.fn.progressbar.defaults={width:"auto",height:22,value:0,text:"{value}%",onChange:function(_13,_14){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
427
static/jeasyui/plugins/jquery.propertygrid.js
Executable file
427
static/jeasyui/plugins/jquery.propertygrid.js
Executable file
@@ -0,0 +1,427 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1;
|
||||
$(document)._unbind(".propertygrid")._bind("mousedown.propertygrid",function(e){
|
||||
var p=$(e.target).closest("div.datagrid-view,div.combo-panel");
|
||||
if(p.length){
|
||||
return;
|
||||
}
|
||||
_2(_1);
|
||||
_1=undefined;
|
||||
});
|
||||
function _3(_4){
|
||||
var _5=$.data(_4,"propertygrid");
|
||||
var _6=$.data(_4,"propertygrid").options;
|
||||
$(_4).datagrid($.extend({},_6,{cls:"propertygrid",view:(_6.showGroup?_6.groupView:_6.view),onBeforeEdit:function(_7,_8){
|
||||
if(_6.onBeforeEdit.call(_4,_7,_8)==false){
|
||||
return false;
|
||||
}
|
||||
var dg=$(this);
|
||||
var _8=dg.datagrid("getRows")[_7];
|
||||
var _9=dg.datagrid("getColumnOption","value");
|
||||
_9.editor=_8.editor;
|
||||
},onClickCell:function(_a,_b,_c){
|
||||
if(_1!=this){
|
||||
_2(_1);
|
||||
_1=this;
|
||||
}
|
||||
if(_6.editIndex!=_a){
|
||||
_2(_1);
|
||||
$(this).datagrid("beginEdit",_a);
|
||||
var ed=$(this).datagrid("getEditor",{index:_a,field:_b});
|
||||
if(!ed){
|
||||
ed=$(this).datagrid("getEditor",{index:_a,field:"value"});
|
||||
}
|
||||
if(ed){
|
||||
var t=$(ed.target);
|
||||
var _d=t.data("textbox")?t.textbox("textbox"):t;
|
||||
_d.focus();
|
||||
_6.editIndex=_a;
|
||||
}
|
||||
}
|
||||
_6.onClickCell.call(_4,_a,_b,_c);
|
||||
},loadFilter:function(_e){
|
||||
_2(this);
|
||||
return _6.loadFilter.call(this,_e);
|
||||
}}));
|
||||
};
|
||||
function _2(_f){
|
||||
var t=$(_f);
|
||||
if(!t.length){
|
||||
return;
|
||||
}
|
||||
var _10=$.data(_f,"propertygrid").options;
|
||||
_10.finder.getTr(_f,null,"editing").each(function(){
|
||||
var _11=parseInt($(this).attr("datagrid-row-index"));
|
||||
if(t.datagrid("validateRow",_11)){
|
||||
t.datagrid("endEdit",_11);
|
||||
}else{
|
||||
t.datagrid("cancelEdit",_11);
|
||||
}
|
||||
});
|
||||
_10.editIndex=undefined;
|
||||
};
|
||||
$.fn.propertygrid=function(_12,_13){
|
||||
if(typeof _12=="string"){
|
||||
var _14=$.fn.propertygrid.methods[_12];
|
||||
if(_14){
|
||||
return _14(this,_13);
|
||||
}else{
|
||||
return this.datagrid(_12,_13);
|
||||
}
|
||||
}
|
||||
_12=_12||{};
|
||||
return this.each(function(){
|
||||
var _15=$.data(this,"propertygrid");
|
||||
if(_15){
|
||||
$.extend(_15.options,_12);
|
||||
}else{
|
||||
var _16=$.extend({},$.fn.propertygrid.defaults,$.fn.propertygrid.parseOptions(this),_12);
|
||||
_16.frozenColumns=$.extend(true,[],_16.frozenColumns);
|
||||
_16.columns=$.extend(true,[],_16.columns);
|
||||
$.data(this,"propertygrid",{options:_16});
|
||||
}
|
||||
_3(this);
|
||||
});
|
||||
};
|
||||
$.fn.propertygrid.methods={options:function(jq){
|
||||
return $.data(jq[0],"propertygrid").options;
|
||||
}};
|
||||
$.fn.propertygrid.parseOptions=function(_17){
|
||||
return $.extend({},$.fn.datagrid.parseOptions(_17),$.parser.parseOptions(_17,[{showGroup:"boolean"}]));
|
||||
};
|
||||
var _18=$.extend({},$.fn.datagrid.defaults.view,{render:function(_19,_1a,_1b){
|
||||
var _1c=[];
|
||||
var _1d=this.groups;
|
||||
for(var i=0;i<_1d.length;i++){
|
||||
_1c.push(this.renderGroup.call(this,_19,i,_1d[i],_1b));
|
||||
}
|
||||
$(_1a).html(_1c.join(""));
|
||||
},renderGroup:function(_1e,_1f,_20,_21){
|
||||
var _22=$.data(_1e,"datagrid");
|
||||
var _23=_22.options;
|
||||
var _24=$(_1e).datagrid("getColumnFields",_21);
|
||||
var _25=_23.frozenColumns&&_23.frozenColumns.length;
|
||||
if(_21){
|
||||
if(!(_23.rownumbers||_25)){
|
||||
return "";
|
||||
}
|
||||
}
|
||||
var _26=[];
|
||||
var css=_23.groupStyler.call(_1e,_20.value,_20.rows);
|
||||
var cs=_27(css,"datagrid-group");
|
||||
_26.push("<div group-index="+_1f+" "+cs+">");
|
||||
if((_21&&(_23.rownumbers||_23.frozenColumns.length))||(!_21&&!(_23.rownumbers||_23.frozenColumns.length))){
|
||||
_26.push("<span class=\"datagrid-group-expander\">");
|
||||
_26.push("<span class=\"datagrid-row-expander datagrid-row-collapse\"> </span>");
|
||||
_26.push("</span>");
|
||||
}
|
||||
if((_21&&_25)||(!_21)){
|
||||
_26.push("<span class=\"datagrid-group-title\">");
|
||||
_26.push(_23.groupFormatter.call(_1e,_20.value,_20.rows));
|
||||
_26.push("</span>");
|
||||
}
|
||||
_26.push("</div>");
|
||||
_26.push("<table class=\"datagrid-btable\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tbody>");
|
||||
var _28=_20.startIndex;
|
||||
for(var j=0;j<_20.rows.length;j++){
|
||||
var css=_23.rowStyler?_23.rowStyler.call(_1e,_28,_20.rows[j]):"";
|
||||
var _29="";
|
||||
var _2a="";
|
||||
if(typeof css=="string"){
|
||||
_2a=css;
|
||||
}else{
|
||||
if(css){
|
||||
_29=css["class"]||"";
|
||||
_2a=css["style"]||"";
|
||||
}
|
||||
}
|
||||
var cls="class=\"datagrid-row "+(_28%2&&_23.striped?"datagrid-row-alt ":" ")+_29+"\"";
|
||||
var _2b=_2a?"style=\""+_2a+"\"":"";
|
||||
var _2c=_22.rowIdPrefix+"-"+(_21?1:2)+"-"+_28;
|
||||
_26.push("<tr id=\""+_2c+"\" datagrid-row-index=\""+_28+"\" "+cls+" "+_2b+">");
|
||||
_26.push(this.renderRow.call(this,_1e,_24,_21,_28,_20.rows[j]));
|
||||
_26.push("</tr>");
|
||||
_28++;
|
||||
}
|
||||
_26.push("</tbody></table>");
|
||||
return _26.join("");
|
||||
function _27(css,cls){
|
||||
var _2d="";
|
||||
var _2e="";
|
||||
if(typeof css=="string"){
|
||||
_2e=css;
|
||||
}else{
|
||||
if(css){
|
||||
_2d=css["class"]||"";
|
||||
_2e=css["style"]||"";
|
||||
}
|
||||
}
|
||||
return "class=\""+cls+(_2d?" "+_2d:"")+"\" "+"style=\""+_2e+"\"";
|
||||
};
|
||||
},bindEvents:function(_2f){
|
||||
var _30=$.data(_2f,"datagrid");
|
||||
var dc=_30.dc;
|
||||
var _31=dc.body1.add(dc.body2);
|
||||
var _32=($.data(_31[0],"events")||$._data(_31[0],"events")).click[0].handler;
|
||||
_31._unbind("click")._bind("click",function(e){
|
||||
var tt=$(e.target);
|
||||
var _33=tt.closest("span.datagrid-row-expander");
|
||||
if(_33.length){
|
||||
var _34=_33.closest("div.datagrid-group").attr("group-index");
|
||||
if(_33.hasClass("datagrid-row-collapse")){
|
||||
$(_2f).datagrid("collapseGroup",_34);
|
||||
}else{
|
||||
$(_2f).datagrid("expandGroup",_34);
|
||||
}
|
||||
}else{
|
||||
_32(e);
|
||||
}
|
||||
e.stopPropagation();
|
||||
});
|
||||
},onBeforeRender:function(_35,_36){
|
||||
var _37=$.data(_35,"datagrid");
|
||||
var _38=_37.options;
|
||||
_39();
|
||||
var _3a=[];
|
||||
for(var i=0;i<_36.length;i++){
|
||||
var row=_36[i];
|
||||
var _3b=_3c(row[_38.groupField]);
|
||||
if(!_3b){
|
||||
_3b={value:row[_38.groupField],rows:[row]};
|
||||
_3a.push(_3b);
|
||||
}else{
|
||||
_3b.rows.push(row);
|
||||
}
|
||||
}
|
||||
var _3d=0;
|
||||
var _3e=[];
|
||||
for(var i=0;i<_3a.length;i++){
|
||||
var _3b=_3a[i];
|
||||
_3b.startIndex=_3d;
|
||||
_3d+=_3b.rows.length;
|
||||
_3e=_3e.concat(_3b.rows);
|
||||
}
|
||||
_37.data.rows=_3e;
|
||||
this.groups=_3a;
|
||||
var _3f=this;
|
||||
setTimeout(function(){
|
||||
_3f.bindEvents(_35);
|
||||
},0);
|
||||
function _3c(_40){
|
||||
for(var i=0;i<_3a.length;i++){
|
||||
var _41=_3a[i];
|
||||
if(_41.value==_40){
|
||||
return _41;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
function _39(){
|
||||
if(!$("#datagrid-group-style").length){
|
||||
$("head").append("<style id=\"datagrid-group-style\">"+".datagrid-group{height:"+_38.groupHeight+"px;overflow:hidden;font-weight:bold;border-bottom:1px solid #ccc;white-space:nowrap;word-break:normal;}"+".datagrid-group-title,.datagrid-group-expander{display:inline-block;vertical-align:bottom;height:100%;line-height:"+_38.groupHeight+"px;padding:0 4px;}"+".datagrid-group-title{position:relative;}"+".datagrid-group-expander{width:"+_38.expanderWidth+"px;text-align:center;padding:0}"+".datagrid-group-expander .datagrid-row-expander{margin:"+Math.floor((_38.groupHeight-16)/2)+"px 0;display:inline-block;width:16px;height:16px;cursor:pointer}"+"</style>");
|
||||
}
|
||||
};
|
||||
},onAfterRender:function(_42){
|
||||
$.fn.datagrid.defaults.view.onAfterRender.call(this,_42);
|
||||
var _43=this;
|
||||
var _44=$.data(_42,"datagrid");
|
||||
var _45=_44.options;
|
||||
if(!_44.onResizeColumn){
|
||||
_44.onResizeColumn=_45.onResizeColumn;
|
||||
}
|
||||
if(!_44.onResize){
|
||||
_44.onResize=_45.onResize;
|
||||
}
|
||||
_45.onResizeColumn=function(_46,_47){
|
||||
_43.resizeGroup(_42);
|
||||
_44.onResizeColumn.call(_42,_46,_47);
|
||||
};
|
||||
_45.onResize=function(_48,_49){
|
||||
_43.resizeGroup(_42);
|
||||
_44.onResize.call($(_42).datagrid("getPanel")[0],_48,_49);
|
||||
};
|
||||
_43.resizeGroup(_42);
|
||||
}});
|
||||
$.extend($.fn.datagrid.methods,{groups:function(jq){
|
||||
return jq.datagrid("options").view.groups;
|
||||
},expandGroup:function(jq,_4a){
|
||||
return jq.each(function(){
|
||||
var _4b=$(this).datagrid("options");
|
||||
var _4c=$.data(this,"datagrid").dc.view;
|
||||
var _4d=_4c.find(_4a!=undefined?"div.datagrid-group[group-index=\""+_4a+"\"]":"div.datagrid-group");
|
||||
var _4e=_4d.find("span.datagrid-row-expander");
|
||||
if(_4e.hasClass("datagrid-row-expand")){
|
||||
_4e.removeClass("datagrid-row-expand").addClass("datagrid-row-collapse");
|
||||
_4d.next("table").show();
|
||||
}
|
||||
$(this).datagrid("fixRowHeight");
|
||||
if(_4b.onExpandGroup){
|
||||
_4b.onExpandGroup.call(this,_4a);
|
||||
}
|
||||
});
|
||||
},collapseGroup:function(jq,_4f){
|
||||
return jq.each(function(){
|
||||
var _50=$(this).datagrid("options");
|
||||
var _51=$.data(this,"datagrid").dc.view;
|
||||
var _52=_51.find(_4f!=undefined?"div.datagrid-group[group-index=\""+_4f+"\"]":"div.datagrid-group");
|
||||
var _53=_52.find("span.datagrid-row-expander");
|
||||
if(_53.hasClass("datagrid-row-collapse")){
|
||||
_53.removeClass("datagrid-row-collapse").addClass("datagrid-row-expand");
|
||||
_52.next("table").hide();
|
||||
}
|
||||
$(this).datagrid("fixRowHeight");
|
||||
if(_50.onCollapseGroup){
|
||||
_50.onCollapseGroup.call(this,_4f);
|
||||
}
|
||||
});
|
||||
},scrollToGroup:function(jq,_54){
|
||||
return jq.each(function(){
|
||||
var _55=$.data(this,"datagrid");
|
||||
var dc=_55.dc;
|
||||
var _56=dc.body2.children("div.datagrid-group[group-index=\""+_54+"\"]");
|
||||
if(_56.length){
|
||||
var _57=_56.outerHeight();
|
||||
var _58=dc.view2.children("div.datagrid-header")._outerHeight();
|
||||
var _59=dc.body2.outerHeight(true)-dc.body2.outerHeight();
|
||||
var top=_56.position().top-_58-_59;
|
||||
if(top<0){
|
||||
dc.body2.scrollTop(dc.body2.scrollTop()+top);
|
||||
}else{
|
||||
if(top+_57>dc.body2.height()-18){
|
||||
dc.body2.scrollTop(dc.body2.scrollTop()+top+_57-dc.body2.height()+18);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}});
|
||||
$.extend(_18,{refreshGroupTitle:function(_5a,_5b){
|
||||
var _5c=$.data(_5a,"datagrid");
|
||||
var _5d=_5c.options;
|
||||
var dc=_5c.dc;
|
||||
var _5e=this.groups[_5b];
|
||||
var _5f=dc.body1.add(dc.body2).children("div.datagrid-group[group-index="+_5b+"]").find("span.datagrid-group-title");
|
||||
_5f.html(_5d.groupFormatter.call(_5a,_5e.value,_5e.rows));
|
||||
},resizeGroup:function(_60,_61){
|
||||
var _62=$.data(_60,"datagrid");
|
||||
var dc=_62.dc;
|
||||
var ht=dc.header2.find("table");
|
||||
var fr=ht.find("tr.datagrid-filter-row").hide();
|
||||
var ww=dc.body2.children("table.datagrid-btable:first").width();
|
||||
if(_61==undefined){
|
||||
var _63=dc.body2.children("div.datagrid-group");
|
||||
}else{
|
||||
var _63=dc.body2.children("div.datagrid-group[group-index="+_61+"]");
|
||||
}
|
||||
_63._outerWidth(ww);
|
||||
var _64=_62.options;
|
||||
if(_64.frozenColumns&&_64.frozenColumns.length){
|
||||
var _65=dc.view1.width()-_64.expanderWidth;
|
||||
var _66=dc.view1.css("direction").toLowerCase()=="rtl";
|
||||
_63.find(".datagrid-group-title").css(_66?"right":"left",-_65+"px");
|
||||
}
|
||||
if(fr.length){
|
||||
if(_64.showFilterBar){
|
||||
fr.show();
|
||||
}
|
||||
}
|
||||
},insertRow:function(_67,_68,row){
|
||||
var _69=$.data(_67,"datagrid");
|
||||
var _6a=_69.options;
|
||||
var dc=_69.dc;
|
||||
var _6b=null;
|
||||
var _6c;
|
||||
if(!_69.data.rows.length){
|
||||
$(_67).datagrid("loadData",[row]);
|
||||
return;
|
||||
}
|
||||
for(var i=0;i<this.groups.length;i++){
|
||||
if(this.groups[i].value==row[_6a.groupField]){
|
||||
_6b=this.groups[i];
|
||||
_6c=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_6b){
|
||||
if(_68==undefined||_68==null){
|
||||
_68=_69.data.rows.length;
|
||||
}
|
||||
if(_68<_6b.startIndex){
|
||||
_68=_6b.startIndex;
|
||||
}else{
|
||||
if(_68>_6b.startIndex+_6b.rows.length){
|
||||
_68=_6b.startIndex+_6b.rows.length;
|
||||
}
|
||||
}
|
||||
$.fn.datagrid.defaults.view.insertRow.call(this,_67,_68,row);
|
||||
if(_68>=_6b.startIndex+_6b.rows.length){
|
||||
_6d(_68,true);
|
||||
_6d(_68,false);
|
||||
}
|
||||
_6b.rows.splice(_68-_6b.startIndex,0,row);
|
||||
}else{
|
||||
_6b={value:row[_6a.groupField],rows:[row],startIndex:_69.data.rows.length};
|
||||
_6c=this.groups.length;
|
||||
dc.body1.append(this.renderGroup.call(this,_67,_6c,_6b,true));
|
||||
dc.body2.append(this.renderGroup.call(this,_67,_6c,_6b,false));
|
||||
this.groups.push(_6b);
|
||||
_69.data.rows.push(row);
|
||||
}
|
||||
this.setGroupIndex(_67);
|
||||
this.refreshGroupTitle(_67,_6c);
|
||||
this.resizeGroup(_67);
|
||||
function _6d(_6e,_6f){
|
||||
var _70=_6f?1:2;
|
||||
var _71=_6a.finder.getTr(_67,_6e-1,"body",_70);
|
||||
var tr=_6a.finder.getTr(_67,_6e,"body",_70);
|
||||
tr.insertAfter(_71);
|
||||
};
|
||||
},updateRow:function(_72,_73,row){
|
||||
var _74=$.data(_72,"datagrid").options;
|
||||
$.fn.datagrid.defaults.view.updateRow.call(this,_72,_73,row);
|
||||
var tb=_74.finder.getTr(_72,_73,"body",2).closest("table.datagrid-btable");
|
||||
var _75=parseInt(tb.prev().attr("group-index"));
|
||||
this.refreshGroupTitle(_72,_75);
|
||||
},deleteRow:function(_76,_77){
|
||||
var _78=$.data(_76,"datagrid");
|
||||
var _79=_78.options;
|
||||
var dc=_78.dc;
|
||||
var _7a=dc.body1.add(dc.body2);
|
||||
var tb=_79.finder.getTr(_76,_77,"body",2).closest("table.datagrid-btable");
|
||||
var _7b=parseInt(tb.prev().attr("group-index"));
|
||||
$.fn.datagrid.defaults.view.deleteRow.call(this,_76,_77);
|
||||
var _7c=this.groups[_7b];
|
||||
if(_7c.rows.length>1){
|
||||
_7c.rows.splice(_77-_7c.startIndex,1);
|
||||
this.refreshGroupTitle(_76,_7b);
|
||||
}else{
|
||||
_7a.children("div.datagrid-group[group-index="+_7b+"]").remove();
|
||||
for(var i=_7b+1;i<this.groups.length;i++){
|
||||
_7a.children("div.datagrid-group[group-index="+i+"]").attr("group-index",i-1);
|
||||
}
|
||||
this.groups.splice(_7b,1);
|
||||
}
|
||||
this.setGroupIndex(_76);
|
||||
},setGroupIndex:function(_7d){
|
||||
var _7e=0;
|
||||
for(var i=0;i<this.groups.length;i++){
|
||||
var _7f=this.groups[i];
|
||||
_7f.startIndex=_7e;
|
||||
_7e+=_7f.rows.length;
|
||||
}
|
||||
}});
|
||||
$.fn.propertygrid.defaults=$.extend({},$.fn.datagrid.defaults,{groupHeight:28,expanderWidth:20,singleSelect:true,remoteSort:false,fitColumns:true,loadMsg:"",frozenColumns:[[{field:"f",width:20,resizable:false}]],columns:[[{field:"name",title:"Name",width:100,sortable:true},{field:"value",title:"Value",width:100,resizable:false}]],showGroup:false,groupView:_18,groupField:"group",groupStyler:function(_80,_81){
|
||||
return "";
|
||||
},groupFormatter:function(_82,_83){
|
||||
return _82;
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
204
static/jeasyui/plugins/jquery.radiobutton.js
Normal file
204
static/jeasyui/plugins/jquery.radiobutton.js
Normal file
@@ -0,0 +1,204 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=1;
|
||||
function _2(_3){
|
||||
var _4=$("<span class=\"radiobutton inputbox\">"+"<span class=\"radiobutton-inner\" style=\"display:none\"></span>"+"<input type=\"radio\" class=\"radiobutton-value\">"+"</span>").insertAfter(_3);
|
||||
var t=$(_3);
|
||||
t.addClass("radiobutton-f").hide();
|
||||
var _5=t.attr("name");
|
||||
if(_5){
|
||||
t.removeAttr("name").attr("radiobuttonName",_5);
|
||||
_4.find(".radiobutton-value").attr("name",_5);
|
||||
}
|
||||
return _4;
|
||||
};
|
||||
function _6(_7){
|
||||
var _8=$.data(_7,"radiobutton");
|
||||
var _9=_8.options;
|
||||
var _a=_8.radiobutton;
|
||||
var _b="_easyui_radiobutton_"+(++_1);
|
||||
var _c=_a.find(".radiobutton-value").attr("id",_b);
|
||||
_c._unbind(".radiobutton")._bind("change.radiobutton",function(e){
|
||||
return false;
|
||||
});
|
||||
if(_9.label){
|
||||
if(typeof _9.label=="object"){
|
||||
_8.label=$(_9.label);
|
||||
_8.label.attr("for",_b);
|
||||
}else{
|
||||
$(_8.label).remove();
|
||||
_8.label=$("<label class=\"textbox-label\"></label>").html(_9.label);
|
||||
_8.label.css("textAlign",_9.labelAlign).attr("for",_b);
|
||||
if(_9.labelPosition=="after"){
|
||||
_8.label.insertAfter(_a);
|
||||
}else{
|
||||
_8.label.insertBefore(_7);
|
||||
}
|
||||
_8.label.removeClass("textbox-label-left textbox-label-right textbox-label-top");
|
||||
_8.label.addClass("textbox-label-"+_9.labelPosition);
|
||||
}
|
||||
}else{
|
||||
$(_8.label).remove();
|
||||
}
|
||||
$(_7).radiobutton("setValue",_9.value);
|
||||
_d(_7,_9.checked);
|
||||
_e(_7,_9.readonly);
|
||||
_f(_7,_9.disabled);
|
||||
};
|
||||
function _10(_11){
|
||||
var _12=$.data(_11,"radiobutton");
|
||||
var _13=_12.options;
|
||||
var _14=_12.radiobutton;
|
||||
_14._unbind(".radiobutton")._bind("click.radiobutton",function(){
|
||||
if(!_13.disabled&&!_13.readonly){
|
||||
_d(_11,true);
|
||||
}
|
||||
});
|
||||
};
|
||||
function _15(_16){
|
||||
var _17=$.data(_16,"radiobutton");
|
||||
var _18=_17.options;
|
||||
var _19=_17.radiobutton;
|
||||
_19._size(_18,_19.parent());
|
||||
if(_18.label&&_18.labelPosition){
|
||||
if(_18.labelPosition=="top"){
|
||||
_17.label._size({width:_18.labelWidth},_19);
|
||||
}else{
|
||||
_17.label._size({width:_18.labelWidth,height:_19.outerHeight()},_19);
|
||||
_17.label.css("lineHeight",_19.outerHeight()+"px");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _d(_1a,_1b){
|
||||
if(_1b){
|
||||
var f=$(_1a).closest("form");
|
||||
var _1c=$(_1a).attr("radiobuttonName");
|
||||
f.find(".radiobutton-f[radiobuttonName=\""+_1c+"\"]").each(function(){
|
||||
if(this!=_1a){
|
||||
_1d(this,false);
|
||||
}
|
||||
});
|
||||
_1d(_1a,true);
|
||||
}else{
|
||||
_1d(_1a,false);
|
||||
}
|
||||
function _1d(b,c){
|
||||
var _1e=$(b).data("radiobutton");
|
||||
var _1f=_1e.options;
|
||||
var _20=_1e.radiobutton;
|
||||
_20.find(".radiobutton-inner").css("display",c?"":"none");
|
||||
_20.find(".radiobutton-value")._propAttr("checked",c);
|
||||
if(c){
|
||||
_20.addClass("radiobutton-checked");
|
||||
$(_1e.label).addClass("textbox-label-checked");
|
||||
}else{
|
||||
_20.removeClass("radiobutton-checked");
|
||||
$(_1e.label).removeClass("textbox-label-checked");
|
||||
}
|
||||
if(_1f.checked!=c){
|
||||
_1f.checked=c;
|
||||
_1f.onChange.call($(b)[0],c);
|
||||
$(b).closest("form").trigger("_change",[$(b)[0]]);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _f(_21,_22){
|
||||
var _23=$.data(_21,"radiobutton");
|
||||
var _24=_23.options;
|
||||
var _25=_23.radiobutton;
|
||||
var rv=_25.find(".radiobutton-value");
|
||||
_24.disabled=_22;
|
||||
if(_22){
|
||||
$(_21).add(rv)._propAttr("disabled",true);
|
||||
_25.addClass("radiobutton-disabled");
|
||||
$(_23.label).addClass("textbox-label-disabled");
|
||||
}else{
|
||||
$(_21).add(rv)._propAttr("disabled",false);
|
||||
_25.removeClass("radiobutton-disabled");
|
||||
$(_23.label).removeClass("textbox-label-disabled");
|
||||
}
|
||||
};
|
||||
function _e(_26,_27){
|
||||
var _28=$.data(_26,"radiobutton");
|
||||
var _29=_28.options;
|
||||
_29.readonly=_27==undefined?true:_27;
|
||||
if(_29.readonly){
|
||||
_28.radiobutton.addClass("radiobutton-readonly");
|
||||
$(_28.label).addClass("textbox-label-readonly");
|
||||
}else{
|
||||
_28.radiobutton.removeClass("radiobutton-readonly");
|
||||
$(_28.label).removeClass("textbox-label-readonly");
|
||||
}
|
||||
};
|
||||
$.fn.radiobutton=function(_2a,_2b){
|
||||
if(typeof _2a=="string"){
|
||||
return $.fn.radiobutton.methods[_2a](this,_2b);
|
||||
}
|
||||
_2a=_2a||{};
|
||||
return this.each(function(){
|
||||
var _2c=$.data(this,"radiobutton");
|
||||
if(_2c){
|
||||
$.extend(_2c.options,_2a);
|
||||
}else{
|
||||
_2c=$.data(this,"radiobutton",{options:$.extend({},$.fn.radiobutton.defaults,$.fn.radiobutton.parseOptions(this),_2a),radiobutton:_2(this)});
|
||||
}
|
||||
_2c.options.originalChecked=_2c.options.checked;
|
||||
_6(this);
|
||||
_10(this);
|
||||
_15(this);
|
||||
});
|
||||
};
|
||||
$.fn.radiobutton.methods={options:function(jq){
|
||||
var _2d=jq.data("radiobutton");
|
||||
return $.extend(_2d.options,{value:_2d.radiobutton.find(".radiobutton-value").val()});
|
||||
},setValue:function(jq,_2e){
|
||||
return jq.each(function(){
|
||||
$(this).val(_2e);
|
||||
$.data(this,"radiobutton").radiobutton.find(".radiobutton-value").val(_2e);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,false);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this,true);
|
||||
});
|
||||
},readonly:function(jq,_2f){
|
||||
return jq.each(function(){
|
||||
_e(this,_2f);
|
||||
});
|
||||
},check:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,true);
|
||||
});
|
||||
},uncheck:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _30=$(this).radiobutton("options");
|
||||
_d(this,_30.originalChecked);
|
||||
});
|
||||
}};
|
||||
$.fn.radiobutton.parseOptions=function(_31){
|
||||
var t=$(_31);
|
||||
return $.extend({},$.parser.parseOptions(_31,["label","labelPosition","labelAlign",{labelWidth:"number"}]),{value:(t.val()||undefined),checked:(t.attr("checked")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)});
|
||||
};
|
||||
$.fn.radiobutton.defaults={width:20,height:20,value:null,disabled:false,readonly:false,checked:false,label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",onChange:function(_32){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
173
static/jeasyui/plugins/jquery.resizable.js
Executable file
173
static/jeasyui/plugins/jquery.resizable.js
Executable file
@@ -0,0 +1,173 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(e){
|
||||
var _2=e.data;
|
||||
var _3=$.data(_2.target,"resizable").options;
|
||||
if(_2.dir.indexOf("e")!=-1){
|
||||
var _4=_2.startWidth+e.pageX-_2.startX;
|
||||
_4=Math.min(Math.max(_4,_3.minWidth),_3.maxWidth);
|
||||
_2.width=_4;
|
||||
}
|
||||
if(_2.dir.indexOf("s")!=-1){
|
||||
var _5=_2.startHeight+e.pageY-_2.startY;
|
||||
_5=Math.min(Math.max(_5,_3.minHeight),_3.maxHeight);
|
||||
_2.height=_5;
|
||||
}
|
||||
if(_2.dir.indexOf("w")!=-1){
|
||||
var _4=_2.startWidth-e.pageX+_2.startX;
|
||||
_4=Math.min(Math.max(_4,_3.minWidth),_3.maxWidth);
|
||||
_2.width=_4;
|
||||
_2.left=_2.startLeft+_2.startWidth-_2.width;
|
||||
}
|
||||
if(_2.dir.indexOf("n")!=-1){
|
||||
var _5=_2.startHeight-e.pageY+_2.startY;
|
||||
_5=Math.min(Math.max(_5,_3.minHeight),_3.maxHeight);
|
||||
_2.height=_5;
|
||||
_2.top=_2.startTop+_2.startHeight-_2.height;
|
||||
}
|
||||
};
|
||||
function _6(e){
|
||||
var _7=e.data;
|
||||
var t=$(_7.target);
|
||||
t.css({left:_7.left,top:_7.top});
|
||||
if(t.outerWidth()!=_7.width){
|
||||
t._outerWidth(_7.width);
|
||||
}
|
||||
if(t.outerHeight()!=_7.height){
|
||||
t._outerHeight(_7.height);
|
||||
}
|
||||
};
|
||||
function _8(e){
|
||||
$.fn.resizable.isResizing=true;
|
||||
$.data(e.data.target,"resizable").options.onStartResize.call(e.data.target,e);
|
||||
return false;
|
||||
};
|
||||
function _9(e){
|
||||
_1(e);
|
||||
if($.data(e.data.target,"resizable").options.onResize.call(e.data.target,e)!=false){
|
||||
_6(e);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
function _a(e){
|
||||
$.fn.resizable.isResizing=false;
|
||||
_1(e,true);
|
||||
_6(e);
|
||||
$.data(e.data.target,"resizable").options.onStopResize.call(e.data.target,e);
|
||||
$(document)._unbind(".resizable");
|
||||
$("body").css("cursor","");
|
||||
return false;
|
||||
};
|
||||
function _b(e){
|
||||
var _c=$(e.data.target).resizable("options");
|
||||
var tt=$(e.data.target);
|
||||
var _d="";
|
||||
var _e=tt.offset();
|
||||
var _f=tt.outerWidth();
|
||||
var _10=tt.outerHeight();
|
||||
var _11=_c.edge;
|
||||
if(e.pageY>_e.top&&e.pageY<_e.top+_11){
|
||||
_d+="n";
|
||||
}else{
|
||||
if(e.pageY<_e.top+_10&&e.pageY>_e.top+_10-_11){
|
||||
_d+="s";
|
||||
}
|
||||
}
|
||||
if(e.pageX>_e.left&&e.pageX<_e.left+_11){
|
||||
_d+="w";
|
||||
}else{
|
||||
if(e.pageX<_e.left+_f&&e.pageX>_e.left+_f-_11){
|
||||
_d+="e";
|
||||
}
|
||||
}
|
||||
var _12=_c.handles.split(",");
|
||||
_12=$.map(_12,function(h){
|
||||
return $.trim(h).toLowerCase();
|
||||
});
|
||||
if($.inArray("all",_12)>=0||$.inArray(_d,_12)>=0){
|
||||
return _d;
|
||||
}
|
||||
for(var i=0;i<_d.length;i++){
|
||||
var _13=$.inArray(_d.substr(i,1),_12);
|
||||
if(_13>=0){
|
||||
return _12[_13];
|
||||
}
|
||||
}
|
||||
return "";
|
||||
};
|
||||
$.fn.resizable=function(_14,_15){
|
||||
if(typeof _14=="string"){
|
||||
return $.fn.resizable.methods[_14](this,_15);
|
||||
}
|
||||
return this.each(function(){
|
||||
var _16=null;
|
||||
var _17=$.data(this,"resizable");
|
||||
if(_17){
|
||||
$(this)._unbind(".resizable");
|
||||
_16=$.extend(_17.options,_14||{});
|
||||
}else{
|
||||
_16=$.extend({},$.fn.resizable.defaults,$.fn.resizable.parseOptions(this),_14||{});
|
||||
$.data(this,"resizable",{options:_16});
|
||||
}
|
||||
if(_16.disabled==true){
|
||||
return;
|
||||
}
|
||||
$(this)._bind("mousemove.resizable",{target:this},function(e){
|
||||
if($.fn.resizable.isResizing){
|
||||
return;
|
||||
}
|
||||
var dir=_b(e);
|
||||
$(e.data.target).css("cursor",dir?dir+"-resize":"");
|
||||
})._bind("mouseleave.resizable",{target:this},function(e){
|
||||
$(e.data.target).css("cursor","");
|
||||
})._bind("mousedown.resizable",{target:this},function(e){
|
||||
var dir=_b(e);
|
||||
if(dir==""){
|
||||
return;
|
||||
}
|
||||
function _18(css){
|
||||
var val=parseInt($(e.data.target).css(css));
|
||||
if(isNaN(val)){
|
||||
return 0;
|
||||
}else{
|
||||
return val;
|
||||
}
|
||||
};
|
||||
var _19={target:e.data.target,dir:dir,startLeft:_18("left"),startTop:_18("top"),left:_18("left"),top:_18("top"),startX:e.pageX,startY:e.pageY,startWidth:$(e.data.target).outerWidth(),startHeight:$(e.data.target).outerHeight(),width:$(e.data.target).outerWidth(),height:$(e.data.target).outerHeight(),deltaWidth:$(e.data.target).outerWidth()-$(e.data.target).width(),deltaHeight:$(e.data.target).outerHeight()-$(e.data.target).height()};
|
||||
$(document)._bind("mousedown.resizable",_19,_8);
|
||||
$(document)._bind("mousemove.resizable",_19,_9);
|
||||
$(document)._bind("mouseup.resizable",_19,_a);
|
||||
$("body").css("cursor",dir+"-resize");
|
||||
});
|
||||
});
|
||||
};
|
||||
$.fn.resizable.methods={options:function(jq){
|
||||
return $.data(jq[0],"resizable").options;
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).resizable({disabled:false});
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).resizable({disabled:true});
|
||||
});
|
||||
}};
|
||||
$.fn.resizable.parseOptions=function(_1a){
|
||||
var t=$(_1a);
|
||||
return $.extend({},$.parser.parseOptions(_1a,["handles",{minWidth:"number",minHeight:"number",maxWidth:"number",maxHeight:"number",edge:"number"}]),{disabled:(t.attr("disabled")?true:undefined)});
|
||||
};
|
||||
$.fn.resizable.defaults={disabled:false,handles:"n, e, s, w, ne, se, sw, nw, all",minWidth:10,minHeight:10,maxWidth:10000,maxHeight:10000,edge:5,onStartResize:function(e){
|
||||
},onResize:function(e){
|
||||
},onStopResize:function(e){
|
||||
}};
|
||||
$.fn.resizable.isResizing=false;
|
||||
})(jQuery);
|
||||
|
||||
132
static/jeasyui/plugins/jquery.searchbox.js
Executable file
132
static/jeasyui/plugins/jquery.searchbox.js
Executable file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"searchbox");
|
||||
var _4=_3.options;
|
||||
var _5=$.extend(true,[],_4.icons);
|
||||
_5.push({iconCls:"searchbox-button",handler:function(e){
|
||||
var t=$(e.data.target);
|
||||
var _6=t.searchbox("options");
|
||||
_6.searcher.call(e.data.target,t.searchbox("getValue"),t.searchbox("getName"));
|
||||
}});
|
||||
_7();
|
||||
var _8=_9();
|
||||
$(_2).addClass("searchbox-f").textbox($.extend({},_4,{icons:_5,buttonText:(_8?_8.text:"")}));
|
||||
$(_2).attr("searchboxName",$(_2).attr("textboxName"));
|
||||
_3.searchbox=$(_2).next();
|
||||
_3.searchbox.addClass("searchbox");
|
||||
_a(_8);
|
||||
function _7(){
|
||||
if(_4.menu){
|
||||
_3.menu=$(_4.menu).menu();
|
||||
var _b=_3.menu.menu("options");
|
||||
var _c=_b.onClick;
|
||||
_b.onClick=function(_d){
|
||||
_a(_d);
|
||||
_c.call(this,_d);
|
||||
};
|
||||
}else{
|
||||
if(_3.menu){
|
||||
_3.menu.menu("destroy");
|
||||
}
|
||||
_3.menu=null;
|
||||
}
|
||||
};
|
||||
function _9(){
|
||||
if(_3.menu){
|
||||
var _e=_3.menu.children("div.menu-item:first");
|
||||
_3.menu.children("div.menu-item").each(function(){
|
||||
var _f=$.extend({},$.parser.parseOptions(this),{selected:($(this).attr("selected")?true:undefined)});
|
||||
if(_f.selected){
|
||||
_e=$(this);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return _3.menu.menu("getItem",_e[0]);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
};
|
||||
function _a(_10){
|
||||
if(!_10){
|
||||
return;
|
||||
}
|
||||
$(_2).textbox("button").menubutton({text:_10.text,iconCls:(_10.iconCls||null),menu:_3.menu,menuAlign:_4.buttonAlign,plain:false});
|
||||
_3.searchbox.find("input.textbox-value").attr("name",_10.name||_10.text);
|
||||
$(_2).searchbox("resize");
|
||||
};
|
||||
};
|
||||
$.fn.searchbox=function(_11,_12){
|
||||
if(typeof _11=="string"){
|
||||
var _13=$.fn.searchbox.methods[_11];
|
||||
if(_13){
|
||||
return _13(this,_12);
|
||||
}else{
|
||||
return this.textbox(_11,_12);
|
||||
}
|
||||
}
|
||||
_11=_11||{};
|
||||
return this.each(function(){
|
||||
var _14=$.data(this,"searchbox");
|
||||
if(_14){
|
||||
$.extend(_14.options,_11);
|
||||
}else{
|
||||
$.data(this,"searchbox",{options:$.extend({},$.fn.searchbox.defaults,$.fn.searchbox.parseOptions(this),_11)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.searchbox.methods={options:function(jq){
|
||||
var _15=jq.textbox("options");
|
||||
return $.extend($.data(jq[0],"searchbox").options,{width:_15.width,value:_15.value,originalValue:_15.originalValue,disabled:_15.disabled,readonly:_15.readonly});
|
||||
},menu:function(jq){
|
||||
return $.data(jq[0],"searchbox").menu;
|
||||
},getName:function(jq){
|
||||
return $.data(jq[0],"searchbox").searchbox.find("input.textbox-value").attr("name");
|
||||
},selectName:function(jq,_16){
|
||||
return jq.each(function(){
|
||||
var _17=$.data(this,"searchbox").menu;
|
||||
if(_17){
|
||||
_17.children("div.menu-item").each(function(){
|
||||
var _18=_17.menu("getItem",this);
|
||||
if(_18.name==_16){
|
||||
$(this).trigger("click");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
var _19=$(this).searchbox("menu");
|
||||
if(_19){
|
||||
_19.menu("destroy");
|
||||
}
|
||||
$(this).textbox("destroy");
|
||||
});
|
||||
}};
|
||||
$.fn.searchbox.parseOptions=function(_1a){
|
||||
var t=$(_1a);
|
||||
return $.extend({},$.fn.textbox.parseOptions(_1a),$.parser.parseOptions(_1a,["menu"]),{searcher:(t.attr("searcher")?eval(t.attr("searcher")):undefined)});
|
||||
};
|
||||
$.fn.searchbox.defaults=$.extend({},$.fn.textbox.defaults,{inputEvents:$.extend({},$.fn.textbox.defaults.inputEvents,{keydown:function(e){
|
||||
if(e.keyCode==13){
|
||||
e.preventDefault();
|
||||
var t=$(e.data.target);
|
||||
var _1b=t.searchbox("options");
|
||||
t.searchbox("setValue",$(this).val());
|
||||
_1b.searcher.call(e.data.target,t.searchbox("getValue"),t.searchbox("getName"));
|
||||
return false;
|
||||
}
|
||||
}}),buttonAlign:"left",menu:null,searcher:function(_1c,_1d){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
245
static/jeasyui/plugins/jquery.sidemenu.js
Normal file
245
static/jeasyui/plugins/jquery.sidemenu.js
Normal file
@@ -0,0 +1,245 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=1;
|
||||
function _2(_3){
|
||||
$(_3).addClass("sidemenu");
|
||||
};
|
||||
function _4(_5,_6){
|
||||
var _7=$(_5).sidemenu("options");
|
||||
if(_6){
|
||||
$.extend(_7,{width:_6.width,height:_6.height});
|
||||
}
|
||||
$(_5)._size(_7);
|
||||
$(_5).find(".accordion").accordion("resize");
|
||||
};
|
||||
function _8(_9,_a,_b){
|
||||
var _c=$(_9).sidemenu("options");
|
||||
var tt=$("<ul class=\"sidemenu-tree\"></ul>").appendTo(_a);
|
||||
tt.tree({data:_b,animate:_c.animate,onBeforeSelect:function(_d){
|
||||
if(_d.children){
|
||||
return false;
|
||||
}
|
||||
},onSelect:function(_e){
|
||||
_12(_9,_e.id,true);
|
||||
},onExpand:function(_f){
|
||||
_25(_9,_f);
|
||||
},onCollapse:function(_10){
|
||||
_25(_9,_10);
|
||||
},onClick:function(_11){
|
||||
if(_11.children){
|
||||
if(_11.state=="open"){
|
||||
$(_11.target).addClass("tree-node-nonleaf-collapsed");
|
||||
}else{
|
||||
$(_11.target).removeClass("tree-node-nonleaf-collapsed");
|
||||
}
|
||||
$(this).tree("toggle",_11.target);
|
||||
}
|
||||
}});
|
||||
tt._unbind(".sidemenu")._bind("mouseleave.sidemenu",function(){
|
||||
$(_a).trigger("mouseleave");
|
||||
});
|
||||
_12(_9,_c.selectedItemId);
|
||||
};
|
||||
function _13(_14,_15,_16){
|
||||
var _17=$(_14).sidemenu("options");
|
||||
$(_15).tooltip({content:$("<div></div>"),position:_17.floatMenuPosition,valign:"top",data:_16,onUpdate:function(_18){
|
||||
var _19=$(this).tooltip("options");
|
||||
var _1a=_19.data;
|
||||
_18.accordion({width:_17.floatMenuWidth,multiple:false}).accordion("add",{title:_1a.text,collapsed:false,collapsible:false});
|
||||
_8(_14,_18.accordion("panels")[0],_1a.children);
|
||||
},onShow:function(){
|
||||
var t=$(this);
|
||||
var tip=t.tooltip("tip").addClass("sidemenu-tooltip");
|
||||
tip.children(".tooltip-content").addClass("sidemenu");
|
||||
tip.find(".accordion").accordion("resize");
|
||||
tip.add(tip.find("ul.tree"))._unbind(".sidemenu")._bind("mouseover.sidemenu",function(){
|
||||
t.tooltip("show");
|
||||
})._bind("mouseleave.sidemenu",function(){
|
||||
t.tooltip("hide");
|
||||
});
|
||||
t.tooltip("reposition");
|
||||
},onPosition:function(_1b,top){
|
||||
var tip=$(this).tooltip("tip");
|
||||
if(!_17.collapsed){
|
||||
tip.css({left:-999999});
|
||||
}else{
|
||||
if(top+tip.outerHeight()>$(window)._outerHeight()+$(document).scrollTop()){
|
||||
top=$(window)._outerHeight()+$(document).scrollTop()-tip.outerHeight();
|
||||
tip.css("top",top);
|
||||
}
|
||||
}
|
||||
}});
|
||||
};
|
||||
function _1c(_1d,_1e){
|
||||
$(_1d).find(".sidemenu-tree").each(function(){
|
||||
_1e($(this));
|
||||
});
|
||||
$(_1d).find(".tooltip-f").each(function(){
|
||||
var tip=$(this).tooltip("tip");
|
||||
if(tip){
|
||||
tip.find(".sidemenu-tree").each(function(){
|
||||
_1e($(this));
|
||||
});
|
||||
$(this).tooltip("reposition");
|
||||
}
|
||||
});
|
||||
};
|
||||
function _12(_1f,_20,_21){
|
||||
var _22=null;
|
||||
var _23=$(_1f).sidemenu("options");
|
||||
_1c(_1f,function(t){
|
||||
t.find("div.tree-node-selected").removeClass("tree-node-selected");
|
||||
var _24=t.tree("find",_20);
|
||||
if(_24){
|
||||
$(_24.target).addClass("tree-node-selected");
|
||||
_23.selectedItemId=_24.id;
|
||||
t.trigger("mouseleave.sidemenu");
|
||||
_22=_24;
|
||||
}
|
||||
});
|
||||
if(_21&&_22){
|
||||
_23.onSelect.call(_1f,_22);
|
||||
}
|
||||
};
|
||||
function _25(_26,_27){
|
||||
_1c(_26,function(t){
|
||||
var _28=t.tree("find",_27.id);
|
||||
if(_28){
|
||||
var _29=t.tree("options");
|
||||
var _2a=_29.animate;
|
||||
_29.animate=false;
|
||||
t.tree(_27.state=="open"?"expand":"collapse",_28.target);
|
||||
_29.animate=_2a;
|
||||
}
|
||||
});
|
||||
};
|
||||
function _2b(_2c){
|
||||
var _2d=$(_2c).sidemenu("options");
|
||||
$(_2c).empty();
|
||||
if(_2d.data){
|
||||
$.easyui.forEach(_2d.data,true,function(_2e){
|
||||
if(!_2e.id){
|
||||
_2e.id="_easyui_sidemenu_"+(_1++);
|
||||
}
|
||||
if(!_2e.iconCls){
|
||||
_2e.iconCls="sidemenu-default-icon";
|
||||
}
|
||||
if(_2e.children){
|
||||
_2e.nodeCls="tree-node-nonleaf";
|
||||
if(!_2e.state){
|
||||
_2e.state="closed";
|
||||
}
|
||||
if(_2e.state=="open"){
|
||||
_2e.nodeCls="tree-node-nonleaf";
|
||||
}else{
|
||||
_2e.nodeCls="tree-node-nonleaf tree-node-nonleaf-collapsed";
|
||||
}
|
||||
}
|
||||
});
|
||||
var acc=$("<div></div>").appendTo(_2c);
|
||||
acc.accordion({fit:_2d.height=="auto"?false:true,border:_2d.border,multiple:_2d.multiple});
|
||||
var _2f=_2d.data;
|
||||
for(var i=0;i<_2f.length;i++){
|
||||
acc.accordion("add",{title:_2f[i].text,selected:_2f[i].state=="open",iconCls:_2f[i].iconCls,onBeforeExpand:function(){
|
||||
return !_2d.collapsed;
|
||||
}});
|
||||
var ap=acc.accordion("panels")[i];
|
||||
_8(_2c,ap,_2f[i].children);
|
||||
_13(_2c,ap.panel("header"),_2f[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _30(_31,_32){
|
||||
var _33=$(_31).sidemenu("options");
|
||||
_33.collapsed=_32;
|
||||
var acc=$(_31).find(".accordion");
|
||||
var _34=acc.accordion("panels");
|
||||
acc.accordion("options").animate=false;
|
||||
if(_33.collapsed){
|
||||
$(_31).addClass("sidemenu-collapsed");
|
||||
for(var i=0;i<_34.length;i++){
|
||||
var _35=_34[i];
|
||||
if(_35.panel("options").collapsed){
|
||||
_33.data[i].state="closed";
|
||||
}else{
|
||||
_33.data[i].state="open";
|
||||
acc.accordion("unselect",i);
|
||||
}
|
||||
var _36=_35.panel("header");
|
||||
_36.find(".panel-title").html("");
|
||||
_36.find(".panel-tool").hide();
|
||||
}
|
||||
}else{
|
||||
$(_31).removeClass("sidemenu-collapsed");
|
||||
for(var i=0;i<_34.length;i++){
|
||||
var _35=_34[i];
|
||||
if(_33.data[i].state=="open"){
|
||||
acc.accordion("select",i);
|
||||
}
|
||||
var _36=_35.panel("header");
|
||||
_36.find(".panel-title").html(_35.panel("options").title);
|
||||
_36.find(".panel-tool").show();
|
||||
}
|
||||
}
|
||||
acc.accordion("options").animate=_33.animate;
|
||||
};
|
||||
function _37(_38){
|
||||
$(_38).find(".tooltip-f").each(function(){
|
||||
$(this).tooltip("destroy");
|
||||
});
|
||||
$(_38).remove();
|
||||
};
|
||||
$.fn.sidemenu=function(_39,_3a){
|
||||
if(typeof _39=="string"){
|
||||
var _3b=$.fn.sidemenu.methods[_39];
|
||||
return _3b(this,_3a);
|
||||
}
|
||||
_39=_39||{};
|
||||
return this.each(function(){
|
||||
var _3c=$.data(this,"sidemenu");
|
||||
if(_3c){
|
||||
$.extend(_3c.options,_39);
|
||||
}else{
|
||||
_3c=$.data(this,"sidemenu",{options:$.extend({},$.fn.sidemenu.defaults,$.fn.sidemenu.parseOptions(this),_39)});
|
||||
_2(this);
|
||||
}
|
||||
_4(this);
|
||||
_2b(this);
|
||||
_30(this,_3c.options.collapsed);
|
||||
});
|
||||
};
|
||||
$.fn.sidemenu.methods={options:function(jq){
|
||||
return jq.data("sidemenu").options;
|
||||
},resize:function(jq,_3d){
|
||||
return jq.each(function(){
|
||||
_4(this,_3d);
|
||||
});
|
||||
},collapse:function(jq){
|
||||
return jq.each(function(){
|
||||
_30(this,true);
|
||||
});
|
||||
},expand:function(jq){
|
||||
return jq.each(function(){
|
||||
_30(this,false);
|
||||
});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_37(this);
|
||||
});
|
||||
}};
|
||||
$.fn.sidemenu.parseOptions=function(_3e){
|
||||
var t=$(_3e);
|
||||
return $.extend({},$.parser.parseOptions(_3e,["width","height"]));
|
||||
};
|
||||
$.fn.sidemenu.defaults={width:200,height:"auto",border:true,animate:true,multiple:true,collapsed:false,data:null,floatMenuWidth:200,floatMenuPosition:"right",onSelect:function(_3f){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
347
static/jeasyui/plugins/jquery.slider.js
Executable file
347
static/jeasyui/plugins/jquery.slider.js
Executable file
@@ -0,0 +1,347 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$("<div class=\"slider\">"+"<div class=\"slider-inner\">"+"<a href=\"javascript:;\" class=\"slider-handle\"></a>"+"<span class=\"slider-tip\"></span>"+"</div>"+"<div class=\"slider-rule\"></div>"+"<div class=\"slider-rulelabel\"></div>"+"<div style=\"clear:both\"></div>"+"<input type=\"hidden\" class=\"slider-value\">"+"</div>").insertAfter(_2);
|
||||
var t=$(_2);
|
||||
t.addClass("slider-f").hide();
|
||||
var _4=t.attr("name");
|
||||
if(_4){
|
||||
_3.find("input.slider-value").attr("name",_4);
|
||||
t.removeAttr("name").attr("sliderName",_4);
|
||||
}
|
||||
_3._bind("_resize",function(e,_5){
|
||||
if($(this).hasClass("easyui-fluid")||_5){
|
||||
_6(_2);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return _3;
|
||||
};
|
||||
function _6(_7,_8){
|
||||
var _9=$.data(_7,"slider");
|
||||
var _a=_9.options;
|
||||
var _b=_9.slider;
|
||||
if(_8){
|
||||
if(_8.width){
|
||||
_a.width=_8.width;
|
||||
}
|
||||
if(_8.height){
|
||||
_a.height=_8.height;
|
||||
}
|
||||
}
|
||||
_b._size(_a);
|
||||
if(_a.mode=="h"){
|
||||
_b.css("height","");
|
||||
_b.children("div").css("height","");
|
||||
}else{
|
||||
_b.css("width","");
|
||||
_b.children("div").css("width","");
|
||||
_b.children("div.slider-rule,div.slider-rulelabel,div.slider-inner")._outerHeight(_b._outerHeight());
|
||||
}
|
||||
_c(_7);
|
||||
};
|
||||
function _d(_e){
|
||||
var _f=$.data(_e,"slider");
|
||||
var _10=_f.options;
|
||||
var _11=_f.slider;
|
||||
var aa=_10.mode=="h"?_10.rule:_10.rule.slice(0).reverse();
|
||||
if(_10.reversed){
|
||||
aa=aa.slice(0).reverse();
|
||||
}
|
||||
_12(aa);
|
||||
function _12(aa){
|
||||
var _13=_11.find("div.slider-rule");
|
||||
var _14=_11.find("div.slider-rulelabel");
|
||||
_13.empty();
|
||||
_14.empty();
|
||||
for(var i=0;i<aa.length;i++){
|
||||
var _15=i*100/(aa.length-1)+"%";
|
||||
var _16=$("<span></span>").appendTo(_13);
|
||||
_16.css((_10.mode=="h"?"left":"top"),_15);
|
||||
if(aa[i]!="|"){
|
||||
_16=$("<span></span>").appendTo(_14);
|
||||
_16.html(aa[i]);
|
||||
if(_10.mode=="h"){
|
||||
_16.css({left:_15,marginLeft:-Math.round(_16.outerWidth()/2)});
|
||||
}else{
|
||||
_16.css({top:_15,marginTop:-Math.round(_16.outerHeight()/2)});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
function _17(_18){
|
||||
var _19=$.data(_18,"slider");
|
||||
var _1a=_19.options;
|
||||
var _1b=_19.slider;
|
||||
_1b.removeClass("slider-h slider-v slider-disabled");
|
||||
_1b.addClass(_1a.mode=="h"?"slider-h":"slider-v");
|
||||
_1b.addClass(_1a.disabled?"slider-disabled":"");
|
||||
var _1c=_1b.find(".slider-inner");
|
||||
_1c.html("<a href=\"javascript:;\" class=\"slider-handle\"></a>"+"<span class=\"slider-tip\"></span>");
|
||||
if(_1a.range){
|
||||
_1c.append("<a href=\"javascript:;\" class=\"slider-handle\"></a>"+"<span class=\"slider-tip\"></span>");
|
||||
}
|
||||
_1b.find("a.slider-handle").draggable({axis:_1a.mode,cursor:"pointer",disabled:_1a.disabled,onDrag:function(e){
|
||||
var _1d=e.data.left;
|
||||
var _1e=_1b.width();
|
||||
if(_1a.mode!="h"){
|
||||
_1d=e.data.top;
|
||||
_1e=_1b.height();
|
||||
}
|
||||
if(_1d<0||_1d>_1e){
|
||||
return false;
|
||||
}else{
|
||||
_1f(_1d,this);
|
||||
return false;
|
||||
}
|
||||
},onStartDrag:function(){
|
||||
_19.isDragging=true;
|
||||
_1a.onSlideStart.call(_18,_1a.value);
|
||||
},onStopDrag:function(e){
|
||||
_1f(_1a.mode=="h"?e.data.left:e.data.top,this);
|
||||
_1a.onSlideEnd.call(_18,_1a.value);
|
||||
_1a.onComplete.call(_18,_1a.value);
|
||||
_19.isDragging=false;
|
||||
}});
|
||||
_1b.find("div.slider-inner")._unbind(".slider")._bind("mousedown.slider",function(e){
|
||||
if(_19.isDragging||_1a.disabled){
|
||||
return;
|
||||
}
|
||||
var pos=$(this).offset();
|
||||
_1f(_1a.mode=="h"?(e.pageX-pos.left):(e.pageY-pos.top));
|
||||
_1a.onComplete.call(_18,_1a.value);
|
||||
});
|
||||
function _20(_21){
|
||||
var dd=String(_1a.step).split(".");
|
||||
var _22=dd.length>1?dd[1].length:0;
|
||||
return parseFloat(_21.toFixed(_22));
|
||||
};
|
||||
function _1f(pos,_23){
|
||||
var _24=_25(_18,pos);
|
||||
var s=Math.abs(_24%_1a.step);
|
||||
if(s<_1a.step/2){
|
||||
_24-=s;
|
||||
}else{
|
||||
_24=_24-s+_1a.step;
|
||||
}
|
||||
_24=_20(_24);
|
||||
if(_1a.range){
|
||||
var v1=_1a.value[0];
|
||||
var v2=_1a.value[1];
|
||||
var m=parseFloat((v1+v2)/2);
|
||||
if(_23){
|
||||
var _26=$(_23).nextAll(".slider-handle").length>0;
|
||||
if(_24<=v2&&_26){
|
||||
v1=_24;
|
||||
}else{
|
||||
if(_24>=v1&&(!_26)){
|
||||
v2=_24;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(_24<v1){
|
||||
v1=_24;
|
||||
}else{
|
||||
if(_24>v2){
|
||||
v2=_24;
|
||||
}else{
|
||||
_24<m?v1=_24:v2=_24;
|
||||
}
|
||||
}
|
||||
}
|
||||
$(_18).slider("setValues",[v1,v2]);
|
||||
}else{
|
||||
$(_18).slider("setValue",_24);
|
||||
}
|
||||
};
|
||||
};
|
||||
function _27(_28,_29){
|
||||
var _2a=$.data(_28,"slider");
|
||||
var _2b=_2a.options;
|
||||
var _2c=_2a.slider;
|
||||
var _2d=$.isArray(_2b.value)?_2b.value:[_2b.value];
|
||||
var _2e=[];
|
||||
if(!$.isArray(_29)){
|
||||
_29=$.map(String(_29).split(_2b.separator),function(v){
|
||||
return parseFloat(v);
|
||||
});
|
||||
}
|
||||
_2c.find(".slider-value").remove();
|
||||
var _2f=$(_28).attr("sliderName")||"";
|
||||
for(var i=0;i<_29.length;i++){
|
||||
var _30=_29[i];
|
||||
if(_30<_2b.min){
|
||||
_30=_2b.min;
|
||||
}
|
||||
if(_30>_2b.max){
|
||||
_30=_2b.max;
|
||||
}
|
||||
var _31=$("<input type=\"hidden\" class=\"slider-value\">").appendTo(_2c);
|
||||
_31.attr("name",_2f);
|
||||
_31.val(_30);
|
||||
_2e.push(_30);
|
||||
var _32=_2c.find(".slider-handle:eq("+i+")");
|
||||
var tip=_32.next();
|
||||
var pos=_33(_28,_30);
|
||||
if(_2b.showTip){
|
||||
tip.show();
|
||||
tip.html(_2b.tipFormatter.call(_28,_30));
|
||||
}else{
|
||||
tip.hide();
|
||||
}
|
||||
if(_2b.mode=="h"){
|
||||
var _34="left:"+pos+"px;";
|
||||
_32.attr("style",_34);
|
||||
tip.attr("style",_34+"margin-left:"+(-Math.round(tip.outerWidth()/2))+"px");
|
||||
}else{
|
||||
var _34="top:"+pos+"px;";
|
||||
_32.attr("style",_34);
|
||||
tip.attr("style",_34+"margin-left:"+(-Math.round(tip.outerWidth()))+"px");
|
||||
}
|
||||
}
|
||||
_2b.value=_2b.range?_2e:_2e[0];
|
||||
$(_28).val(_2b.range?_2e.join(_2b.separator):_2e[0]);
|
||||
if(_2d.join(",")!=_2e.join(",")){
|
||||
_2b.onChange.call(_28,_2b.value,(_2b.range?_2d:_2d[0]));
|
||||
}
|
||||
};
|
||||
function _c(_35){
|
||||
var _36=$.data(_35,"slider").options;
|
||||
var fn=_36.onChange;
|
||||
_36.onChange=function(){
|
||||
};
|
||||
_27(_35,_36.value);
|
||||
_36.onChange=fn;
|
||||
};
|
||||
function _33(_37,_38){
|
||||
var _39=$.data(_37,"slider");
|
||||
var _3a=_39.options;
|
||||
var _3b=_39.slider;
|
||||
var _3c=_3a.mode=="h"?_3b.width():_3b.height();
|
||||
var pos=_3a.converter.toPosition.call(_37,_38,_3c);
|
||||
if(_3a.mode=="v"){
|
||||
pos=_3b.height()-pos;
|
||||
}
|
||||
if(_3a.reversed){
|
||||
pos=_3c-pos;
|
||||
}
|
||||
return pos;
|
||||
};
|
||||
function _25(_3d,pos){
|
||||
var _3e=$.data(_3d,"slider");
|
||||
var _3f=_3e.options;
|
||||
var _40=_3e.slider;
|
||||
var _41=_3f.mode=="h"?_40.width():_40.height();
|
||||
var pos=_3f.mode=="h"?(_3f.reversed?(_41-pos):pos):(_3f.reversed?pos:(_41-pos));
|
||||
var _42=_3f.converter.toValue.call(_3d,pos,_41);
|
||||
return _42;
|
||||
};
|
||||
$.fn.slider=function(_43,_44){
|
||||
if(typeof _43=="string"){
|
||||
return $.fn.slider.methods[_43](this,_44);
|
||||
}
|
||||
_43=_43||{};
|
||||
return this.each(function(){
|
||||
var _45=$.data(this,"slider");
|
||||
if(_45){
|
||||
$.extend(_45.options,_43);
|
||||
}else{
|
||||
_45=$.data(this,"slider",{options:$.extend({},$.fn.slider.defaults,$.fn.slider.parseOptions(this),_43),slider:_1(this)});
|
||||
$(this)._propAttr("disabled",false);
|
||||
}
|
||||
var _46=_45.options;
|
||||
_46.min=parseFloat(_46.min);
|
||||
_46.max=parseFloat(_46.max);
|
||||
if(_46.range){
|
||||
if(!$.isArray(_46.value)){
|
||||
_46.value=$.map(String(_46.value).split(_46.separator),function(v){
|
||||
return parseFloat(v);
|
||||
});
|
||||
}
|
||||
if(_46.value.length<2){
|
||||
_46.value.push(_46.max);
|
||||
}
|
||||
}else{
|
||||
_46.value=parseFloat(_46.value);
|
||||
}
|
||||
_46.step=parseFloat(_46.step);
|
||||
_46.originalValue=_46.value;
|
||||
_17(this);
|
||||
_d(this);
|
||||
_6(this);
|
||||
});
|
||||
};
|
||||
$.fn.slider.methods={options:function(jq){
|
||||
return $.data(jq[0],"slider").options;
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
$.data(this,"slider").slider.remove();
|
||||
$(this).remove();
|
||||
});
|
||||
},resize:function(jq,_47){
|
||||
return jq.each(function(){
|
||||
_6(this,_47);
|
||||
});
|
||||
},getValue:function(jq){
|
||||
return jq.slider("options").value;
|
||||
},getValues:function(jq){
|
||||
return jq.slider("options").value;
|
||||
},setValue:function(jq,_48){
|
||||
return jq.each(function(){
|
||||
_27(this,[_48]);
|
||||
});
|
||||
},setValues:function(jq,_49){
|
||||
return jq.each(function(){
|
||||
_27(this,_49);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
var _4a=$(this).slider("options");
|
||||
_27(this,_4a.range?[_4a.min,_4a.max]:[_4a.min]);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _4b=$(this).slider("options");
|
||||
$(this).slider(_4b.range?"setValues":"setValue",_4b.originalValue);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
$.data(this,"slider").options.disabled=false;
|
||||
_17(this);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
$.data(this,"slider").options.disabled=true;
|
||||
_17(this);
|
||||
});
|
||||
}};
|
||||
$.fn.slider.parseOptions=function(_4c){
|
||||
var t=$(_4c);
|
||||
return $.extend({},$.parser.parseOptions(_4c,["width","height","mode",{reversed:"boolean",showTip:"boolean",range:"boolean",min:"number",max:"number",step:"number"}]),{value:(t.val()||undefined),disabled:(t.attr("disabled")?true:undefined),rule:(t.attr("rule")?eval(t.attr("rule")):undefined)});
|
||||
};
|
||||
$.fn.slider.defaults={width:"auto",height:"auto",mode:"h",reversed:false,showTip:false,disabled:false,range:false,value:0,separator:",",min:0,max:100,step:1,rule:[],tipFormatter:function(_4d){
|
||||
return _4d;
|
||||
},converter:{toPosition:function(_4e,_4f){
|
||||
var _50=$(this).slider("options");
|
||||
var p=(_4e-_50.min)/(_50.max-_50.min)*_4f;
|
||||
return p;
|
||||
},toValue:function(pos,_51){
|
||||
var _52=$(this).slider("options");
|
||||
var v=_52.min+(_52.max-_52.min)*(pos/_51);
|
||||
return v;
|
||||
}},onChange:function(_53,_54){
|
||||
},onSlideStart:function(_55){
|
||||
},onSlideEnd:function(_56){
|
||||
},onComplete:function(_57){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
128
static/jeasyui/plugins/jquery.spinner.js
Executable file
128
static/jeasyui/plugins/jquery.spinner.js
Executable file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"spinner");
|
||||
var _4=_3.options;
|
||||
var _5=$.extend(true,[],_4.icons);
|
||||
if(_4.spinAlign=="left"||_4.spinAlign=="right"){
|
||||
_4.spinArrow=true;
|
||||
_4.iconAlign=_4.spinAlign;
|
||||
var _6={iconCls:"spinner-button-updown",handler:function(e){
|
||||
var _7=$(e.target).closest(".spinner-arrow-up,.spinner-arrow-down");
|
||||
_13(e.data.target,_7.hasClass("spinner-arrow-down"));
|
||||
}};
|
||||
if(_4.spinAlign=="left"){
|
||||
_5.unshift(_6);
|
||||
}else{
|
||||
_5.push(_6);
|
||||
}
|
||||
}else{
|
||||
_4.spinArrow=false;
|
||||
if(_4.spinAlign=="vertical"){
|
||||
if(_4.buttonAlign!="top"){
|
||||
_4.buttonAlign="bottom";
|
||||
}
|
||||
_4.clsLeft="textbox-button-bottom";
|
||||
_4.clsRight="textbox-button-top";
|
||||
}else{
|
||||
_4.clsLeft="textbox-button-left";
|
||||
_4.clsRight="textbox-button-right";
|
||||
}
|
||||
}
|
||||
$(_2).addClass("spinner-f").textbox($.extend({},_4,{icons:_5,doSize:false,onResize:function(_8,_9){
|
||||
if(!_4.spinArrow){
|
||||
var _a=$(this).next();
|
||||
var _b=_a.find(".textbox-button:not(.spinner-button)");
|
||||
if(_b.length){
|
||||
var _c=_b.outerWidth();
|
||||
var _d=_b.outerHeight();
|
||||
var _e=_a.find(".spinner-button."+_4.clsLeft);
|
||||
var _f=_a.find(".spinner-button."+_4.clsRight);
|
||||
if(_4.buttonAlign=="right"){
|
||||
_f.css("marginRight",_c+"px");
|
||||
}else{
|
||||
if(_4.buttonAlign=="left"){
|
||||
_e.css("marginLeft",_c+"px");
|
||||
}else{
|
||||
if(_4.buttonAlign=="top"){
|
||||
_f.css("marginTop",_d+"px");
|
||||
}else{
|
||||
_e.css("marginBottom",_d+"px");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_4.onResize.call(this,_8,_9);
|
||||
}}));
|
||||
$(_2).attr("spinnerName",$(_2).attr("textboxName"));
|
||||
_3.spinner=$(_2).next();
|
||||
_3.spinner.addClass("spinner");
|
||||
if(_4.spinArrow){
|
||||
var _10=_3.spinner.find(".spinner-button-updown");
|
||||
_10.append("<span class=\"spinner-arrow spinner-button-top\">"+"<span class=\"spinner-arrow-up\"></span>"+"</span>"+"<span class=\"spinner-arrow spinner-button-bottom\">"+"<span class=\"spinner-arrow-down\"></span>"+"</span>");
|
||||
}else{
|
||||
var _11=$("<a href=\"javascript:;\" class=\"textbox-button spinner-button\"></a>").addClass(_4.clsLeft).appendTo(_3.spinner);
|
||||
var _12=$("<a href=\"javascript:;\" class=\"textbox-button spinner-button\"></a>").addClass(_4.clsRight).appendTo(_3.spinner);
|
||||
_11.linkbutton({iconCls:_4.reversed?"spinner-button-up":"spinner-button-down",onClick:function(){
|
||||
_13(_2,!_4.reversed);
|
||||
}});
|
||||
_12.linkbutton({iconCls:_4.reversed?"spinner-button-down":"spinner-button-up",onClick:function(){
|
||||
_13(_2,_4.reversed);
|
||||
}});
|
||||
if(_4.disabled){
|
||||
$(_2).spinner("disable");
|
||||
}
|
||||
if(_4.readonly){
|
||||
$(_2).spinner("readonly");
|
||||
}
|
||||
}
|
||||
$(_2).spinner("resize");
|
||||
};
|
||||
function _13(_14,_15){
|
||||
var _16=$(_14).spinner("options");
|
||||
_16.spin.call(_14,_15);
|
||||
_16[_15?"onSpinDown":"onSpinUp"].call(_14);
|
||||
$(_14).spinner("validate");
|
||||
};
|
||||
$.fn.spinner=function(_17,_18){
|
||||
if(typeof _17=="string"){
|
||||
var _19=$.fn.spinner.methods[_17];
|
||||
if(_19){
|
||||
return _19(this,_18);
|
||||
}else{
|
||||
return this.textbox(_17,_18);
|
||||
}
|
||||
}
|
||||
_17=_17||{};
|
||||
return this.each(function(){
|
||||
var _1a=$.data(this,"spinner");
|
||||
if(_1a){
|
||||
$.extend(_1a.options,_17);
|
||||
}else{
|
||||
_1a=$.data(this,"spinner",{options:$.extend({},$.fn.spinner.defaults,$.fn.spinner.parseOptions(this),_17)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.spinner.methods={options:function(jq){
|
||||
var _1b=jq.textbox("options");
|
||||
return $.extend($.data(jq[0],"spinner").options,{width:_1b.width,value:_1b.value,originalValue:_1b.originalValue,disabled:_1b.disabled,readonly:_1b.readonly});
|
||||
}};
|
||||
$.fn.spinner.parseOptions=function(_1c){
|
||||
return $.extend({},$.fn.textbox.parseOptions(_1c),$.parser.parseOptions(_1c,["min","max","spinAlign",{increment:"number",reversed:"boolean"}]));
|
||||
};
|
||||
$.fn.spinner.defaults=$.extend({},$.fn.textbox.defaults,{min:null,max:null,increment:1,spinAlign:"right",reversed:false,spin:function(_1d){
|
||||
},onSpinUp:function(){
|
||||
},onSpinDown:function(){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
49
static/jeasyui/plugins/jquery.splitbutton.js
Executable file
49
static/jeasyui/plugins/jquery.splitbutton.js
Executable file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"splitbutton").options;
|
||||
$(_2).menubutton(_3);
|
||||
$(_2).addClass("s-btn");
|
||||
};
|
||||
$.fn.splitbutton=function(_4,_5){
|
||||
if(typeof _4=="string"){
|
||||
var _6=$.fn.splitbutton.methods[_4];
|
||||
if(_6){
|
||||
return _6(this,_5);
|
||||
}else{
|
||||
return this.menubutton(_4,_5);
|
||||
}
|
||||
}
|
||||
_4=_4||{};
|
||||
return this.each(function(){
|
||||
var _7=$.data(this,"splitbutton");
|
||||
if(_7){
|
||||
$.extend(_7.options,_4);
|
||||
}else{
|
||||
$.data(this,"splitbutton",{options:$.extend({},$.fn.splitbutton.defaults,$.fn.splitbutton.parseOptions(this),_4)});
|
||||
$(this)._propAttr("disabled",false);
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.splitbutton.methods={options:function(jq){
|
||||
var _8=jq.menubutton("options");
|
||||
var _9=$.data(jq[0],"splitbutton").options;
|
||||
$.extend(_9,{disabled:_8.disabled,toggle:_8.toggle,selected:_8.selected});
|
||||
return _9;
|
||||
}};
|
||||
$.fn.splitbutton.parseOptions=function(_a){
|
||||
var t=$(_a);
|
||||
return $.extend({},$.fn.linkbutton.parseOptions(_a),$.parser.parseOptions(_a,["menu",{plain:"boolean",duration:"number"}]));
|
||||
};
|
||||
$.fn.splitbutton.defaults=$.extend({},$.fn.linkbutton.defaults,{plain:true,menu:null,duration:100,cls:{btn1:"m-btn-active s-btn-active",btn2:"m-btn-plain-active s-btn-plain-active",arrow:"m-btn-downarrow",trigger:"m-btn-line"}});
|
||||
})(jQuery);
|
||||
|
||||
234
static/jeasyui/plugins/jquery.switchbutton.js
Normal file
234
static/jeasyui/plugins/jquery.switchbutton.js
Normal file
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=1;
|
||||
function _2(_3){
|
||||
var _4=$("<span class=\"switchbutton\">"+"<span class=\"switchbutton-inner\">"+"<span class=\"switchbutton-on\"></span>"+"<span class=\"switchbutton-handle\"></span>"+"<span class=\"switchbutton-off\"></span>"+"<input class=\"switchbutton-value\" type=\"checkbox\" tabindex=\"-1\">"+"</span>"+"</span>").insertAfter(_3);
|
||||
var t=$(_3);
|
||||
t.addClass("switchbutton-f").hide();
|
||||
var _5=t.attr("name");
|
||||
if(_5){
|
||||
t.removeAttr("name").attr("switchbuttonName",_5);
|
||||
_4.find(".switchbutton-value").attr("name",_5);
|
||||
}
|
||||
_4._bind("_resize",function(e,_6){
|
||||
if($(this).hasClass("easyui-fluid")||_6){
|
||||
_7(_3);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return _4;
|
||||
};
|
||||
function _7(_8,_9){
|
||||
var _a=$.data(_8,"switchbutton");
|
||||
var _b=_a.options;
|
||||
var _c=_a.switchbutton;
|
||||
if(_9){
|
||||
$.extend(_b,_9);
|
||||
}
|
||||
var _d=_c.is(":visible");
|
||||
if(!_d){
|
||||
_c.appendTo("body");
|
||||
}
|
||||
_c._size(_b);
|
||||
if(_b.label&&_b.labelPosition){
|
||||
if(_b.labelPosition=="top"){
|
||||
_a.label._size({width:_b.labelWidth},_c);
|
||||
}else{
|
||||
_a.label._size({width:_b.labelWidth,height:_c.outerHeight()},_c);
|
||||
_a.label.css("lineHeight",_c.outerHeight()+"px");
|
||||
}
|
||||
}
|
||||
var w=_c.width();
|
||||
var h=_c.height();
|
||||
var w=_c.outerWidth();
|
||||
var h=_c.outerHeight();
|
||||
var _e=parseInt(_b.handleWidth)||_c.height();
|
||||
var _f=w*2-_e;
|
||||
_c.find(".switchbutton-inner").css({width:_f+"px",height:h+"px",lineHeight:h+"px"});
|
||||
_c.find(".switchbutton-handle")._outerWidth(_e)._outerHeight(h).css({marginLeft:-_e/2+"px"});
|
||||
_c.find(".switchbutton-on").css({width:(w-_e/2)+"px",textIndent:(_b.reversed?"":"-")+_e/2+"px"});
|
||||
_c.find(".switchbutton-off").css({width:(w-_e/2)+"px",textIndent:(_b.reversed?"-":"")+_e/2+"px"});
|
||||
_b.marginWidth=w-_e;
|
||||
_10(_8,_b.checked,false);
|
||||
if(!_d){
|
||||
_c.insertAfter(_8);
|
||||
}
|
||||
};
|
||||
function _11(_12){
|
||||
var _13=$.data(_12,"switchbutton");
|
||||
var _14=_13.options;
|
||||
var _15=_13.switchbutton;
|
||||
var _16=_15.find(".switchbutton-inner");
|
||||
var on=_16.find(".switchbutton-on").html(_14.onText);
|
||||
var off=_16.find(".switchbutton-off").html(_14.offText);
|
||||
var _17=_16.find(".switchbutton-handle").html(_14.handleText);
|
||||
if(_14.reversed){
|
||||
off.prependTo(_16);
|
||||
on.insertAfter(_17);
|
||||
}else{
|
||||
on.prependTo(_16);
|
||||
off.insertAfter(_17);
|
||||
}
|
||||
var _18="_easyui_switchbutton_"+(++_1);
|
||||
var _19=_15.find(".switchbutton-value")._propAttr("checked",_14.checked).attr("id",_18);
|
||||
_19._unbind(".switchbutton")._bind("change.switchbutton",function(e){
|
||||
return false;
|
||||
});
|
||||
_15.removeClass("switchbutton-reversed").addClass(_14.reversed?"switchbutton-reversed":"");
|
||||
if(_14.label){
|
||||
if(typeof _14.label=="object"){
|
||||
_13.label=$(_14.label);
|
||||
_13.label.attr("for",_18);
|
||||
}else{
|
||||
$(_13.label).remove();
|
||||
_13.label=$("<label class=\"textbox-label\"></label>").html(_14.label);
|
||||
_13.label.css("textAlign",_14.labelAlign).attr("for",_18);
|
||||
if(_14.labelPosition=="after"){
|
||||
_13.label.insertAfter(_15);
|
||||
}else{
|
||||
_13.label.insertBefore(_12);
|
||||
}
|
||||
_13.label.removeClass("textbox-label-left textbox-label-right textbox-label-top");
|
||||
_13.label.addClass("textbox-label-"+_14.labelPosition);
|
||||
}
|
||||
}else{
|
||||
$(_13.label).remove();
|
||||
}
|
||||
_10(_12,_14.checked);
|
||||
_1a(_12,_14.readonly);
|
||||
_1b(_12,_14.disabled);
|
||||
$(_12).switchbutton("setValue",_14.value);
|
||||
};
|
||||
function _10(_1c,_1d,_1e){
|
||||
var _1f=$.data(_1c,"switchbutton");
|
||||
var _20=_1f.options;
|
||||
var _21=_1f.switchbutton.find(".switchbutton-inner");
|
||||
var _22=_21.find(".switchbutton-on");
|
||||
var _23=_20.reversed?(_1d?_20.marginWidth:0):(_1d?0:_20.marginWidth);
|
||||
var dir=_22.css("float").toLowerCase();
|
||||
var css={};
|
||||
css["margin-"+dir]=-_23+"px";
|
||||
_1e?_21.animate(css,200):_21.css(css);
|
||||
var _24=_21.find(".switchbutton-value");
|
||||
$(_1c).add(_24)._propAttr("checked",_1d);
|
||||
if(_20.checked!=_1d){
|
||||
_20.checked=_1d;
|
||||
_20.onChange.call(_1c,_20.checked);
|
||||
$(_1c).closest("form").trigger("_change",[_1c]);
|
||||
}
|
||||
};
|
||||
function _1b(_25,_26){
|
||||
var _27=$.data(_25,"switchbutton");
|
||||
var _28=_27.options;
|
||||
var _29=_27.switchbutton;
|
||||
var _2a=_29.find(".switchbutton-value");
|
||||
if(_26){
|
||||
_28.disabled=true;
|
||||
$(_25).add(_2a)._propAttr("disabled",true);
|
||||
_29.addClass("switchbutton-disabled");
|
||||
_29.removeAttr("tabindex");
|
||||
}else{
|
||||
_28.disabled=false;
|
||||
$(_25).add(_2a)._propAttr("disabled",false);
|
||||
_29.removeClass("switchbutton-disabled");
|
||||
_29.attr("tabindex",$(_25).attr("tabindex")||"");
|
||||
}
|
||||
};
|
||||
function _1a(_2b,_2c){
|
||||
var _2d=$.data(_2b,"switchbutton");
|
||||
var _2e=_2d.options;
|
||||
_2e.readonly=_2c==undefined?true:_2c;
|
||||
_2d.switchbutton.removeClass("switchbutton-readonly").addClass(_2e.readonly?"switchbutton-readonly":"");
|
||||
};
|
||||
function _2f(_30){
|
||||
var _31=$.data(_30,"switchbutton");
|
||||
var _32=_31.options;
|
||||
_31.switchbutton._unbind(".switchbutton")._bind("click.switchbutton",function(){
|
||||
if(!_32.disabled&&!_32.readonly){
|
||||
_10(_30,_32.checked?false:true,true);
|
||||
}
|
||||
})._bind("keydown.switchbutton",function(e){
|
||||
if(e.which==13||e.which==32){
|
||||
if(!_32.disabled&&!_32.readonly){
|
||||
_10(_30,_32.checked?false:true,true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.switchbutton=function(_33,_34){
|
||||
if(typeof _33=="string"){
|
||||
return $.fn.switchbutton.methods[_33](this,_34);
|
||||
}
|
||||
_33=_33||{};
|
||||
return this.each(function(){
|
||||
var _35=$.data(this,"switchbutton");
|
||||
if(_35){
|
||||
$.extend(_35.options,_33);
|
||||
}else{
|
||||
_35=$.data(this,"switchbutton",{options:$.extend({},$.fn.switchbutton.defaults,$.fn.switchbutton.parseOptions(this),_33),switchbutton:_2(this)});
|
||||
}
|
||||
_35.options.originalChecked=_35.options.checked;
|
||||
_11(this);
|
||||
_7(this);
|
||||
_2f(this);
|
||||
});
|
||||
};
|
||||
$.fn.switchbutton.methods={options:function(jq){
|
||||
var _36=jq.data("switchbutton");
|
||||
return $.extend(_36.options,{value:_36.switchbutton.find(".switchbutton-value").val()});
|
||||
},resize:function(jq,_37){
|
||||
return jq.each(function(){
|
||||
_7(this,_37);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_1b(this,false);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_1b(this,true);
|
||||
});
|
||||
},readonly:function(jq,_38){
|
||||
return jq.each(function(){
|
||||
_1a(this,_38);
|
||||
});
|
||||
},check:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,true);
|
||||
});
|
||||
},uncheck:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,false);
|
||||
});
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
_10(this,false);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _39=$(this).switchbutton("options");
|
||||
_10(this,_39.originalChecked);
|
||||
});
|
||||
},setValue:function(jq,_3a){
|
||||
return jq.each(function(){
|
||||
$(this).val(_3a);
|
||||
$.data(this,"switchbutton").switchbutton.find(".switchbutton-value").val(_3a);
|
||||
});
|
||||
}};
|
||||
$.fn.switchbutton.parseOptions=function(_3b){
|
||||
var t=$(_3b);
|
||||
return $.extend({},$.parser.parseOptions(_3b,["onText","offText","handleText",{handleWidth:"number",reversed:"boolean"},"label","labelPosition","labelAlign",{labelWidth:"number"}]),{value:(t.val()||undefined),checked:(t.attr("checked")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined)});
|
||||
};
|
||||
$.fn.switchbutton.defaults={handleWidth:"auto",width:60,height:30,checked:false,disabled:false,readonly:false,reversed:false,onText:"ON",offText:"OFF",handleText:"",value:"on",label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",onChange:function(_3c){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
716
static/jeasyui/plugins/jquery.tabs.js
Executable file
716
static/jeasyui/plugins/jquery.tabs.js
Executable file
@@ -0,0 +1,716 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(c){
|
||||
var w=0;
|
||||
$(c).children().each(function(){
|
||||
w+=$(this).outerWidth(true);
|
||||
});
|
||||
return w;
|
||||
};
|
||||
function _2(_3){
|
||||
var _4=$.data(_3,"tabs").options;
|
||||
if(!_4.showHeader){
|
||||
return;
|
||||
}
|
||||
var _5=$(_3).children("div.tabs-header");
|
||||
var _6=_5.children("div.tabs-tool:not(.tabs-tool-hidden)");
|
||||
var _7=_5.children("div.tabs-scroller-left");
|
||||
var _8=_5.children("div.tabs-scroller-right");
|
||||
var _9=_5.children("div.tabs-wrap");
|
||||
if(_4.tabPosition=="left"||_4.tabPosition=="right"){
|
||||
if(!_6.length){
|
||||
return;
|
||||
}
|
||||
_6._outerWidth(_5.width());
|
||||
var _a={left:_4.tabPosition=="left"?"auto":0,right:_4.tabPosition=="left"?0:"auto",top:_4.toolPosition=="top"?0:"auto",bottom:_4.toolPosition=="top"?"auto":0};
|
||||
var _b={marginTop:_4.toolPosition=="top"?_6.outerHeight():0};
|
||||
_6.css(_a);
|
||||
_9.css(_b);
|
||||
return;
|
||||
}
|
||||
var _c=_5.outerHeight();
|
||||
if(_4.plain){
|
||||
_c-=_c-_5.height();
|
||||
}
|
||||
_6._outerHeight(_c);
|
||||
var _d=_1(_5.find("ul.tabs"));
|
||||
var _e=_5.width()-_6._outerWidth();
|
||||
if(_d>_e){
|
||||
_7.add(_8).show()._outerHeight(_c);
|
||||
if(_4.toolPosition=="left"){
|
||||
_6.css({left:_7.outerWidth(),right:""});
|
||||
_9.css({marginLeft:_7.outerWidth()+_6._outerWidth(),marginRight:_8._outerWidth(),width:_e-_7.outerWidth()-_8.outerWidth()});
|
||||
}else{
|
||||
_6.css({left:"",right:_8.outerWidth()});
|
||||
_9.css({marginLeft:_7.outerWidth(),marginRight:_8.outerWidth()+_6._outerWidth(),width:_e-_7.outerWidth()-_8.outerWidth()});
|
||||
}
|
||||
}else{
|
||||
_7.add(_8).hide();
|
||||
if(_4.toolPosition=="left"){
|
||||
_6.css({left:0,right:""});
|
||||
_9.css({marginLeft:_6._outerWidth(),marginRight:0,width:_e});
|
||||
}else{
|
||||
_6.css({left:"",right:0});
|
||||
_9.css({marginLeft:0,marginRight:_6._outerWidth(),width:_e});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _f(_10){
|
||||
var _11=$.data(_10,"tabs").options;
|
||||
var _12=$(_10).children("div.tabs-header");
|
||||
if(_11.tools){
|
||||
if(typeof _11.tools=="string"){
|
||||
$(_11.tools).addClass("tabs-tool").appendTo(_12);
|
||||
$(_11.tools).show();
|
||||
}else{
|
||||
_12.children("div.tabs-tool").remove();
|
||||
var _13=$("<div class=\"tabs-tool\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"height:100%\"><tr></tr></table></div>").appendTo(_12);
|
||||
var tr=_13.find("tr");
|
||||
for(var i=0;i<_11.tools.length;i++){
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var _14=$("<a href=\"javascript:;\"></a>").appendTo(td);
|
||||
_14[0].onclick=eval(_11.tools[i].handler||function(){
|
||||
});
|
||||
_14.linkbutton($.extend({},_11.tools[i],{plain:true}));
|
||||
}
|
||||
}
|
||||
}else{
|
||||
_12.children("div.tabs-tool").remove();
|
||||
}
|
||||
};
|
||||
function _15(_16,_17){
|
||||
var _18=$.data(_16,"tabs");
|
||||
var _19=_18.options;
|
||||
var cc=$(_16);
|
||||
if(!_19.doSize){
|
||||
return;
|
||||
}
|
||||
if(_17){
|
||||
$.extend(_19,{width:_17.width,height:_17.height});
|
||||
}
|
||||
cc._size(_19);
|
||||
var _1a=cc.children("div.tabs-header");
|
||||
var _1b=cc.children("div.tabs-panels");
|
||||
var _1c=_1a.find("div.tabs-wrap");
|
||||
var ul=_1c.find(".tabs");
|
||||
ul.children("li").removeClass("tabs-first tabs-last");
|
||||
ul.children("li:first").addClass("tabs-first");
|
||||
ul.children("li:last").addClass("tabs-last");
|
||||
if(_19.tabPosition=="left"||_19.tabPosition=="right"){
|
||||
_1a._outerWidth(_19.showHeader?_19.headerWidth:0);
|
||||
_1b._outerWidth(cc.width()-_1a.outerWidth());
|
||||
_1a.add(_1b)._size("height",isNaN(parseInt(_19.height))?"":cc.height());
|
||||
_1c._outerWidth(_1a.width());
|
||||
ul._outerWidth(_1c.width()).css("height","");
|
||||
}else{
|
||||
_1a.children("div.tabs-scroller-left,div.tabs-scroller-right,div.tabs-tool:not(.tabs-tool-hidden)").css("display",_19.showHeader?"block":"none");
|
||||
_1a._outerWidth(cc.width()).css("height","");
|
||||
if(_19.showHeader){
|
||||
_1a.css("background-color","");
|
||||
_1c.css("height","");
|
||||
}else{
|
||||
_1a.css("background-color","transparent");
|
||||
_1a._outerHeight(0);
|
||||
_1c._outerHeight(0);
|
||||
}
|
||||
ul._outerHeight(_19.tabHeight).css("width","");
|
||||
ul._outerHeight(ul.outerHeight()-ul.height()-1+_19.tabHeight).css("width","");
|
||||
_1b._size("height",isNaN(parseInt(_19.height))?"":(cc.height()-_1a.outerHeight()));
|
||||
_1b._size("width",cc.width());
|
||||
}
|
||||
if(_18.tabs.length){
|
||||
var d1=ul.outerWidth(true)-ul.width();
|
||||
var li=ul.children("li:first");
|
||||
var d2=li.outerWidth(true)-li.width();
|
||||
var _1d=_1a.width()-_1a.children(".tabs-tool:not(.tabs-tool-hidden)")._outerWidth();
|
||||
var _1e=Math.floor((_1d-d1-d2*_18.tabs.length)/_18.tabs.length);
|
||||
$.map(_18.tabs,function(p){
|
||||
_1f(p,(_19.justified&&$.inArray(_19.tabPosition,["top","bottom"])>=0)?_1e:undefined);
|
||||
});
|
||||
if(_19.justified&&$.inArray(_19.tabPosition,["top","bottom"])>=0){
|
||||
var _20=_1d-d1-_1(ul);
|
||||
_1f(_18.tabs[_18.tabs.length-1],_1e+_20);
|
||||
}
|
||||
}
|
||||
_2(_16);
|
||||
function _1f(p,_21){
|
||||
var _22=p.panel("options");
|
||||
var p_t=_22.tab.find(".tabs-inner");
|
||||
var _21=_21?_21:(parseInt(_22.tabWidth||_19.tabWidth||undefined));
|
||||
if(_21){
|
||||
p_t._outerWidth(_21);
|
||||
}else{
|
||||
p_t.css("width","");
|
||||
}
|
||||
p_t._outerHeight(_19.tabHeight);
|
||||
p_t.css("lineHeight",p_t.height()+"px");
|
||||
p_t.find(".easyui-fluid:visible").triggerHandler("_resize");
|
||||
};
|
||||
};
|
||||
function _23(_24){
|
||||
var _25=$.data(_24,"tabs").options;
|
||||
var tab=_26(_24);
|
||||
if(tab){
|
||||
var _27=$(_24).children("div.tabs-panels");
|
||||
var _28=_25.width=="auto"?"auto":_27.width();
|
||||
var _29=_25.height=="auto"?"auto":_27.height();
|
||||
tab.panel("resize",{width:_28,height:_29});
|
||||
}
|
||||
};
|
||||
function _2a(_2b){
|
||||
var _2c=$.data(_2b,"tabs").tabs;
|
||||
var cc=$(_2b).addClass("tabs-container");
|
||||
var _2d=$("<div class=\"tabs-panels\"></div>").insertBefore(cc);
|
||||
cc.children("div").each(function(){
|
||||
_2d[0].appendChild(this);
|
||||
});
|
||||
cc[0].appendChild(_2d[0]);
|
||||
$("<div class=\"tabs-header\">"+"<div class=\"tabs-scroller-left\"></div>"+"<div class=\"tabs-scroller-right\"></div>"+"<div class=\"tabs-wrap\">"+"<ul class=\"tabs\"></ul>"+"</div>"+"</div>").prependTo(_2b);
|
||||
cc.children("div.tabs-panels").children("div").each(function(i){
|
||||
var _2e=$.extend({},$.parser.parseOptions(this),{disabled:($(this).attr("disabled")?true:undefined),selected:($(this).attr("selected")?true:undefined)});
|
||||
_3e(_2b,_2e,$(this));
|
||||
});
|
||||
cc.children("div.tabs-header").find(".tabs-scroller-left, .tabs-scroller-right")._bind("mouseenter",function(){
|
||||
$(this).addClass("tabs-scroller-over");
|
||||
})._bind("mouseleave",function(){
|
||||
$(this).removeClass("tabs-scroller-over");
|
||||
});
|
||||
cc._bind("_resize",function(e,_2f){
|
||||
if($(this).hasClass("easyui-fluid")||_2f){
|
||||
_15(_2b);
|
||||
_23(_2b);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
function _30(_31){
|
||||
var _32=$.data(_31,"tabs");
|
||||
var _33=_32.options;
|
||||
$(_31).children("div.tabs-header")._unbind()._bind("click",function(e){
|
||||
if($(e.target).hasClass("tabs-scroller-left")){
|
||||
$(_31).tabs("scrollBy",-_33.scrollIncrement);
|
||||
}else{
|
||||
if($(e.target).hasClass("tabs-scroller-right")){
|
||||
$(_31).tabs("scrollBy",_33.scrollIncrement);
|
||||
}else{
|
||||
var li=$(e.target).closest("li");
|
||||
if(li.hasClass("tabs-disabled")){
|
||||
return false;
|
||||
}
|
||||
var a=$(e.target).closest(".tabs-close");
|
||||
if(a.length){
|
||||
_5d(_31,_34(li));
|
||||
}else{
|
||||
if(li.length){
|
||||
var _35=_34(li);
|
||||
var _36=_32.tabs[_35].panel("options");
|
||||
if(_36.collapsible){
|
||||
_36.closed?_53(_31,_35):_7b(_31,_35);
|
||||
}else{
|
||||
_53(_31,_35);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
})._bind("contextmenu",function(e){
|
||||
var li=$(e.target).closest("li");
|
||||
if(li.hasClass("tabs-disabled")){
|
||||
return;
|
||||
}
|
||||
if(li.length){
|
||||
_33.onContextMenu.call(_31,e,li.find("span.tabs-title").html(),_34(li));
|
||||
}
|
||||
});
|
||||
function _34(li){
|
||||
var _37=0;
|
||||
li.parent().children("li").each(function(i){
|
||||
if(li[0]==this){
|
||||
_37=i;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return _37;
|
||||
};
|
||||
};
|
||||
function _38(_39){
|
||||
var _3a=$.data(_39,"tabs").options;
|
||||
var _3b=$(_39).children("div.tabs-header");
|
||||
var _3c=$(_39).children("div.tabs-panels");
|
||||
_3b.removeClass("tabs-header-top tabs-header-bottom tabs-header-left tabs-header-right");
|
||||
_3c.removeClass("tabs-panels-top tabs-panels-bottom tabs-panels-left tabs-panels-right");
|
||||
if(_3a.tabPosition=="top"){
|
||||
_3b.insertBefore(_3c);
|
||||
}else{
|
||||
if(_3a.tabPosition=="bottom"){
|
||||
_3b.insertAfter(_3c);
|
||||
_3b.addClass("tabs-header-bottom");
|
||||
_3c.addClass("tabs-panels-top");
|
||||
}else{
|
||||
if(_3a.tabPosition=="left"){
|
||||
_3b.addClass("tabs-header-left");
|
||||
_3c.addClass("tabs-panels-right");
|
||||
}else{
|
||||
if(_3a.tabPosition=="right"){
|
||||
_3b.addClass("tabs-header-right");
|
||||
_3c.addClass("tabs-panels-left");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_3a.plain==true){
|
||||
_3b.addClass("tabs-header-plain");
|
||||
}else{
|
||||
_3b.removeClass("tabs-header-plain");
|
||||
}
|
||||
_3b.removeClass("tabs-header-narrow").addClass(_3a.narrow?"tabs-header-narrow":"");
|
||||
var _3d=_3b.find(".tabs");
|
||||
_3d.removeClass("tabs-pill").addClass(_3a.pill?"tabs-pill":"");
|
||||
_3d.removeClass("tabs-narrow").addClass(_3a.narrow?"tabs-narrow":"");
|
||||
_3d.removeClass("tabs-justified").addClass(_3a.justified?"tabs-justified":"");
|
||||
if(_3a.border==true){
|
||||
_3b.removeClass("tabs-header-noborder");
|
||||
_3c.removeClass("tabs-panels-noborder");
|
||||
}else{
|
||||
_3b.addClass("tabs-header-noborder");
|
||||
_3c.addClass("tabs-panels-noborder");
|
||||
}
|
||||
_3a.doSize=true;
|
||||
};
|
||||
function _3e(_3f,_40,pp){
|
||||
_40=_40||{};
|
||||
var _41=$.data(_3f,"tabs");
|
||||
var _42=_41.tabs;
|
||||
if(_40.index==undefined||_40.index>_42.length){
|
||||
_40.index=_42.length;
|
||||
}
|
||||
if(_40.index<0){
|
||||
_40.index=0;
|
||||
}
|
||||
var ul=$(_3f).children("div.tabs-header").find("ul.tabs");
|
||||
var _43=$(_3f).children("div.tabs-panels");
|
||||
var tab=$("<li>"+"<span class=\"tabs-inner\">"+"<span class=\"tabs-title\"></span>"+"<span class=\"tabs-icon\"></span>"+"</span>"+"</li>");
|
||||
if(!pp){
|
||||
pp=$("<div></div>");
|
||||
}
|
||||
if(_40.index>=_42.length){
|
||||
tab.appendTo(ul);
|
||||
pp.appendTo(_43);
|
||||
_42.push(pp);
|
||||
}else{
|
||||
tab.insertBefore(ul.children("li:eq("+_40.index+")"));
|
||||
pp.insertBefore(_43.children("div.panel:eq("+_40.index+")"));
|
||||
_42.splice(_40.index,0,pp);
|
||||
}
|
||||
pp.panel($.extend({},_40,{tab:tab,border:false,noheader:true,closed:true,doSize:false,iconCls:(_40.icon?_40.icon:undefined),onLoad:function(){
|
||||
if(_40.onLoad){
|
||||
_40.onLoad.apply(this,arguments);
|
||||
}
|
||||
_41.options.onLoad.call(_3f,$(this));
|
||||
},onBeforeOpen:function(){
|
||||
if(_40.onBeforeOpen){
|
||||
if(_40.onBeforeOpen.call(this)==false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var p=$(_3f).tabs("getSelected");
|
||||
if(p){
|
||||
if(p[0]!=this){
|
||||
$(_3f).tabs("unselect",_4d(_3f,p));
|
||||
p=$(_3f).tabs("getSelected");
|
||||
if(p){
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
_23(_3f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
var _44=$(this).panel("options");
|
||||
_44.tab.addClass("tabs-selected");
|
||||
var _45=$(_3f).find(">div.tabs-header>div.tabs-wrap");
|
||||
var _46=_44.tab.position().left;
|
||||
var _47=_46+_44.tab.outerWidth();
|
||||
if(_46<0||_47>_45.width()){
|
||||
var _48=_46-(_45.width()-_44.tab.width())/2;
|
||||
$(_3f).tabs("scrollBy",_48);
|
||||
}else{
|
||||
$(_3f).tabs("scrollBy",0);
|
||||
}
|
||||
var _49=$(this).panel("panel");
|
||||
_49.css("display","block");
|
||||
_23(_3f);
|
||||
_49.css("display","none");
|
||||
},onOpen:function(){
|
||||
if(_40.onOpen){
|
||||
_40.onOpen.call(this);
|
||||
}
|
||||
var _4a=$(this).panel("options");
|
||||
var _4b=_4d(_3f,this);
|
||||
_41.selectHis.push(_4b);
|
||||
_41.options.onSelect.call(_3f,_4a.title,_4b);
|
||||
},onBeforeClose:function(){
|
||||
if(_40.onBeforeClose){
|
||||
if(_40.onBeforeClose.call(this)==false){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$(this).panel("options").tab.removeClass("tabs-selected");
|
||||
},onClose:function(){
|
||||
if(_40.onClose){
|
||||
_40.onClose.call(this);
|
||||
}
|
||||
var _4c=$(this).panel("options");
|
||||
_41.options.onUnselect.call(_3f,_4c.title,_4d(_3f,this));
|
||||
}}));
|
||||
$(_3f).tabs("update",{tab:pp,options:pp.panel("options"),type:"header"});
|
||||
};
|
||||
function _4e(_4f,_50){
|
||||
var _51=$.data(_4f,"tabs");
|
||||
var _52=_51.options;
|
||||
if(_50.selected==undefined){
|
||||
_50.selected=true;
|
||||
}
|
||||
_3e(_4f,_50);
|
||||
_52.onAdd.call(_4f,_50.title,_50.index);
|
||||
if(_50.selected){
|
||||
_53(_4f,_50.index);
|
||||
}
|
||||
};
|
||||
function _54(_55,_56){
|
||||
_56.type=_56.type||"all";
|
||||
var _57=$.data(_55,"tabs").selectHis;
|
||||
var pp=_56.tab;
|
||||
var _58=pp.panel("options");
|
||||
var _59=_58.title;
|
||||
$.extend(_58,_56.options,{iconCls:(_56.options.icon?_56.options.icon:undefined)});
|
||||
if(_56.type=="all"||_56.type=="body"){
|
||||
pp.panel();
|
||||
}
|
||||
if(_56.type=="all"||_56.type=="header"){
|
||||
var tab=_58.tab;
|
||||
if(_58.header){
|
||||
tab.find(".tabs-inner").html($(_58.header));
|
||||
}else{
|
||||
var _5a=tab.find("span.tabs-title");
|
||||
var _5b=tab.find("span.tabs-icon");
|
||||
_5a.html(_58.title);
|
||||
_5b.attr("class","tabs-icon");
|
||||
tab.find(".tabs-close").remove();
|
||||
if(_58.closable){
|
||||
_5a.addClass("tabs-closable");
|
||||
$("<span class=\"tabs-close\"></span>").appendTo(tab);
|
||||
}else{
|
||||
_5a.removeClass("tabs-closable");
|
||||
}
|
||||
if(_58.iconCls){
|
||||
_5a.addClass("tabs-with-icon");
|
||||
_5b.addClass(_58.iconCls);
|
||||
}else{
|
||||
_5a.removeClass("tabs-with-icon");
|
||||
}
|
||||
if(_58.tools){
|
||||
var _5c=tab.find("span.tabs-p-tool");
|
||||
if(!_5c.length){
|
||||
var _5c=$("<span class=\"tabs-p-tool\"></span>").insertAfter(tab.find(".tabs-inner"));
|
||||
}
|
||||
if($.isArray(_58.tools)){
|
||||
_5c.empty();
|
||||
for(var i=0;i<_58.tools.length;i++){
|
||||
var t=$("<a href=\"javascript:;\"></a>").appendTo(_5c);
|
||||
t.addClass(_58.tools[i].iconCls);
|
||||
if(_58.tools[i].handler){
|
||||
t._bind("click",{handler:_58.tools[i].handler},function(e){
|
||||
if($(this).parents("li").hasClass("tabs-disabled")){
|
||||
return;
|
||||
}
|
||||
e.data.handler.call(this);
|
||||
});
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$(_58.tools).children().appendTo(_5c);
|
||||
}
|
||||
var pr=_5c.children().length*12;
|
||||
if(_58.closable){
|
||||
pr+=8;
|
||||
_5c.css("right","");
|
||||
}else{
|
||||
pr-=3;
|
||||
_5c.css("right","5px");
|
||||
}
|
||||
_5a.css("padding-right",pr+"px");
|
||||
}else{
|
||||
tab.find("span.tabs-p-tool").remove();
|
||||
_5a.css("padding-right","");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_58.disabled){
|
||||
_58.tab.addClass("tabs-disabled");
|
||||
}else{
|
||||
_58.tab.removeClass("tabs-disabled");
|
||||
}
|
||||
_15(_55);
|
||||
$.data(_55,"tabs").options.onUpdate.call(_55,_58.title,_4d(_55,pp));
|
||||
};
|
||||
function _5d(_5e,_5f){
|
||||
var _60=$.data(_5e,"tabs");
|
||||
var _61=_60.options;
|
||||
var _62=_60.tabs;
|
||||
var _63=_60.selectHis;
|
||||
if(!_64(_5e,_5f)){
|
||||
return;
|
||||
}
|
||||
var tab=_65(_5e,_5f);
|
||||
var _66=tab.panel("options").title;
|
||||
var _67=_4d(_5e,tab);
|
||||
if(_61.onBeforeClose.call(_5e,_66,_67)==false){
|
||||
return;
|
||||
}
|
||||
var tab=_65(_5e,_5f,true);
|
||||
tab.panel("options").tab.remove();
|
||||
tab.panel("destroy");
|
||||
_61.onClose.call(_5e,_66,_67);
|
||||
_15(_5e);
|
||||
var his=[];
|
||||
for(var i=0;i<_63.length;i++){
|
||||
var _68=_63[i];
|
||||
if(_68!=_67){
|
||||
his.push(_68>_67?_68-1:_68);
|
||||
}
|
||||
}
|
||||
_60.selectHis=his;
|
||||
var _69=$(_5e).tabs("getSelected");
|
||||
if(!_69&&his.length){
|
||||
_67=_60.selectHis.pop();
|
||||
$(_5e).tabs("select",_67);
|
||||
}
|
||||
};
|
||||
function _65(_6a,_6b,_6c){
|
||||
var _6d=$.data(_6a,"tabs").tabs;
|
||||
var tab=null;
|
||||
if(typeof _6b=="number"){
|
||||
if(_6b>=0&&_6b<_6d.length){
|
||||
tab=_6d[_6b];
|
||||
if(_6c){
|
||||
_6d.splice(_6b,1);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var tmp=$("<span></span>");
|
||||
for(var i=0;i<_6d.length;i++){
|
||||
var p=_6d[i];
|
||||
tmp.html(p.panel("options").title);
|
||||
var _6e=tmp.text();
|
||||
tmp.html(_6b);
|
||||
_6b=tmp.text();
|
||||
if(_6e==_6b){
|
||||
tab=p;
|
||||
if(_6c){
|
||||
_6d.splice(i,1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
tmp.remove();
|
||||
}
|
||||
return tab;
|
||||
};
|
||||
function _4d(_6f,tab){
|
||||
var _70=$.data(_6f,"tabs").tabs;
|
||||
for(var i=0;i<_70.length;i++){
|
||||
if(_70[i][0]==$(tab)[0]){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
function _26(_71){
|
||||
var _72=$.data(_71,"tabs").tabs;
|
||||
for(var i=0;i<_72.length;i++){
|
||||
var tab=_72[i];
|
||||
if(tab.panel("options").tab.hasClass("tabs-selected")){
|
||||
return tab;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
function _73(_74){
|
||||
var _75=$.data(_74,"tabs");
|
||||
var _76=_75.tabs;
|
||||
for(var i=0;i<_76.length;i++){
|
||||
var _77=_76[i].panel("options");
|
||||
if(_77.selected&&!_77.disabled){
|
||||
_53(_74,i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
_53(_74,_75.options.selected);
|
||||
};
|
||||
function _53(_78,_79){
|
||||
var p=_65(_78,_79);
|
||||
if(p&&!p.is(":visible")){
|
||||
_7a(_78);
|
||||
if(!p.panel("options").disabled){
|
||||
p.panel("open");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _7b(_7c,_7d){
|
||||
var p=_65(_7c,_7d);
|
||||
if(p&&p.is(":visible")){
|
||||
_7a(_7c);
|
||||
p.panel("close");
|
||||
}
|
||||
};
|
||||
function _7a(_7e){
|
||||
$(_7e).children("div.tabs-panels").each(function(){
|
||||
$(this).stop(true,true);
|
||||
});
|
||||
};
|
||||
function _64(_7f,_80){
|
||||
return _65(_7f,_80)!=null;
|
||||
};
|
||||
function _81(_82,_83){
|
||||
var _84=$.data(_82,"tabs").options;
|
||||
_84.showHeader=_83;
|
||||
$(_82).tabs("resize");
|
||||
};
|
||||
function _85(_86,_87){
|
||||
var _88=$(_86).find(">.tabs-header>.tabs-tool");
|
||||
if(_87){
|
||||
_88.removeClass("tabs-tool-hidden").show();
|
||||
}else{
|
||||
_88.addClass("tabs-tool-hidden").hide();
|
||||
}
|
||||
$(_86).tabs("resize").tabs("scrollBy",0);
|
||||
};
|
||||
$.fn.tabs=function(_89,_8a){
|
||||
if(typeof _89=="string"){
|
||||
return $.fn.tabs.methods[_89](this,_8a);
|
||||
}
|
||||
_89=_89||{};
|
||||
return this.each(function(){
|
||||
var _8b=$.data(this,"tabs");
|
||||
if(_8b){
|
||||
$.extend(_8b.options,_89);
|
||||
}else{
|
||||
$.data(this,"tabs",{options:$.extend({},$.fn.tabs.defaults,$.fn.tabs.parseOptions(this),_89),tabs:[],selectHis:[]});
|
||||
_2a(this);
|
||||
}
|
||||
_f(this);
|
||||
_38(this);
|
||||
_15(this);
|
||||
_30(this);
|
||||
_73(this);
|
||||
});
|
||||
};
|
||||
$.fn.tabs.methods={options:function(jq){
|
||||
var cc=jq[0];
|
||||
var _8c=$.data(cc,"tabs").options;
|
||||
var s=_26(cc);
|
||||
_8c.selected=s?_4d(cc,s):-1;
|
||||
return _8c;
|
||||
},tabs:function(jq){
|
||||
return $.data(jq[0],"tabs").tabs;
|
||||
},resize:function(jq,_8d){
|
||||
return jq.each(function(){
|
||||
_15(this,_8d);
|
||||
_23(this);
|
||||
});
|
||||
},add:function(jq,_8e){
|
||||
return jq.each(function(){
|
||||
_4e(this,_8e);
|
||||
});
|
||||
},close:function(jq,_8f){
|
||||
return jq.each(function(){
|
||||
_5d(this,_8f);
|
||||
});
|
||||
},getTab:function(jq,_90){
|
||||
return _65(jq[0],_90);
|
||||
},getTabIndex:function(jq,tab){
|
||||
return _4d(jq[0],tab);
|
||||
},getSelected:function(jq){
|
||||
return _26(jq[0]);
|
||||
},select:function(jq,_91){
|
||||
return jq.each(function(){
|
||||
_53(this,_91);
|
||||
});
|
||||
},unselect:function(jq,_92){
|
||||
return jq.each(function(){
|
||||
_7b(this,_92);
|
||||
});
|
||||
},exists:function(jq,_93){
|
||||
return _64(jq[0],_93);
|
||||
},update:function(jq,_94){
|
||||
return jq.each(function(){
|
||||
_54(this,_94);
|
||||
});
|
||||
},enableTab:function(jq,_95){
|
||||
return jq.each(function(){
|
||||
var _96=$(this).tabs("getTab",_95).panel("options");
|
||||
_96.tab.removeClass("tabs-disabled");
|
||||
_96.disabled=false;
|
||||
});
|
||||
},disableTab:function(jq,_97){
|
||||
return jq.each(function(){
|
||||
var _98=$(this).tabs("getTab",_97).panel("options");
|
||||
_98.tab.addClass("tabs-disabled");
|
||||
_98.disabled=true;
|
||||
});
|
||||
},showHeader:function(jq){
|
||||
return jq.each(function(){
|
||||
_81(this,true);
|
||||
});
|
||||
},hideHeader:function(jq){
|
||||
return jq.each(function(){
|
||||
_81(this,false);
|
||||
});
|
||||
},showTool:function(jq){
|
||||
return jq.each(function(){
|
||||
_85(this,true);
|
||||
});
|
||||
},hideTool:function(jq){
|
||||
return jq.each(function(){
|
||||
_85(this,false);
|
||||
});
|
||||
},scrollBy:function(jq,_99){
|
||||
return jq.each(function(){
|
||||
var _9a=$(this).tabs("options");
|
||||
var _9b=$(this).find(">div.tabs-header>div.tabs-wrap");
|
||||
var pos=Math.min(_9b._scrollLeft()+_99,_9c());
|
||||
_9b.animate({scrollLeft:pos},_9a.scrollDuration);
|
||||
function _9c(){
|
||||
var w=0;
|
||||
var ul=_9b.children("ul");
|
||||
ul.children("li").each(function(){
|
||||
w+=$(this).outerWidth(true);
|
||||
});
|
||||
return w-_9b.width()+(ul.outerWidth()-ul.width());
|
||||
};
|
||||
});
|
||||
}};
|
||||
$.fn.tabs.parseOptions=function(_9d){
|
||||
return $.extend({},$.parser.parseOptions(_9d,["tools","toolPosition","tabPosition",{fit:"boolean",border:"boolean",plain:"boolean"},{headerWidth:"number",tabWidth:"number",tabHeight:"number",selected:"number"},{showHeader:"boolean",justified:"boolean",narrow:"boolean",pill:"boolean"}]));
|
||||
};
|
||||
$.fn.tabs.defaults={width:"auto",height:"auto",headerWidth:150,tabWidth:"auto",tabHeight:32,selected:0,showHeader:true,plain:false,fit:false,border:true,justified:false,narrow:false,pill:false,tools:null,toolPosition:"right",tabPosition:"top",scrollIncrement:100,scrollDuration:400,onLoad:function(_9e){
|
||||
},onSelect:function(_9f,_a0){
|
||||
},onUnselect:function(_a1,_a2){
|
||||
},onBeforeClose:function(_a3,_a4){
|
||||
},onClose:function(_a5,_a6){
|
||||
},onAdd:function(_a7,_a8){
|
||||
},onUpdate:function(_a9,_aa){
|
||||
},onContextMenu:function(e,_ab,_ac){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
223
static/jeasyui/plugins/jquery.tagbox.js
Normal file
223
static/jeasyui/plugins/jquery.tagbox.js
Normal file
@@ -0,0 +1,223 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"tagbox");
|
||||
var _4=_3.options;
|
||||
$(_2).addClass("tagbox-f").combobox($.extend({},_4,{cls:"tagbox",reversed:true,onChange:function(_5,_6){
|
||||
_7();
|
||||
$(this).combobox("hidePanel");
|
||||
_4.onChange.call(_2,_5,_6);
|
||||
},onResizing:function(_8,_9){
|
||||
var _a=$(this).combobox("textbox");
|
||||
var tb=$(this).data("textbox").textbox;
|
||||
var _b=tb.outerWidth();
|
||||
tb.css({height:"",paddingLeft:_a.css("marginLeft"),paddingRight:_a.css("marginRight")});
|
||||
_a.css("margin",0);
|
||||
tb._outerWidth(_b);
|
||||
_23(_2);
|
||||
_12(this);
|
||||
_4.onResizing.call(_2,_8,_9);
|
||||
},onLoadSuccess:function(_c){
|
||||
_7();
|
||||
_4.onLoadSuccess.call(_2,_c);
|
||||
}}));
|
||||
_7();
|
||||
_23(_2);
|
||||
function _7(){
|
||||
$(_2).next().find(".tagbox-label").remove();
|
||||
var _d=$(_2).tagbox("textbox");
|
||||
var ss=[];
|
||||
$.map($(_2).tagbox("getValues"),function(_e,_f){
|
||||
var row=_4.finder.getRow(_2,_e);
|
||||
var _10=_4.tagFormatter.call(_2,_e,row);
|
||||
var cs={};
|
||||
var css=_4.tagStyler.call(_2,_e,row)||"";
|
||||
if(typeof css=="string"){
|
||||
cs={s:css};
|
||||
}else{
|
||||
cs={c:css["class"]||"",s:css["style"]||""};
|
||||
}
|
||||
var _11=$("<span class=\"tagbox-label\"></span>").insertBefore(_d).html(_10);
|
||||
_11.attr("tagbox-index",_f);
|
||||
_11.attr("style",cs.s).addClass(cs.c);
|
||||
$("<a href=\"javascript:;\" class=\"tagbox-remove\"></a>").appendTo(_11);
|
||||
});
|
||||
_12(_2);
|
||||
$(_2).combobox("setText","");
|
||||
};
|
||||
};
|
||||
function _12(_13,_14){
|
||||
var _15=$(_13).next();
|
||||
var _16=_14?$(_14):_15.find(".tagbox-label");
|
||||
if(_16.length){
|
||||
var _17=$(_13).tagbox("textbox");
|
||||
var _18=$(_16[0]);
|
||||
var _19=_18.outerHeight(true)-_18.outerHeight();
|
||||
var _1a=_17.outerHeight()-_19*2;
|
||||
_16.css({height:_1a+"px",lineHeight:_1a+"px"});
|
||||
var _1b=_15.find(".textbox-addon").css("height","100%");
|
||||
_1b.find(".textbox-icon").css("height","100%");
|
||||
_15.find(".textbox-button").linkbutton("resize",{height:"100%"});
|
||||
}
|
||||
};
|
||||
function _1c(_1d){
|
||||
var _1e=$(_1d).next();
|
||||
_1e._unbind(".tagbox")._bind("click.tagbox",function(e){
|
||||
var _1f=$(_1d).tagbox("options");
|
||||
if(_1f.disabled||_1f.readonly){
|
||||
return;
|
||||
}
|
||||
if($(e.target).hasClass("tagbox-remove")){
|
||||
var _20=parseInt($(e.target).parent().attr("tagbox-index"));
|
||||
var _21=$(_1d).tagbox("getValues");
|
||||
if(_1f.onBeforeRemoveTag.call(_1d,_21[_20])==false){
|
||||
return;
|
||||
}
|
||||
_1f.onRemoveTag.call(_1d,_21[_20]);
|
||||
_21.splice(_20,1);
|
||||
$(_1d).tagbox("setValues",_21);
|
||||
}else{
|
||||
var _22=$(e.target).closest(".tagbox-label");
|
||||
if(_22.length){
|
||||
var _20=parseInt(_22.attr("tagbox-index"));
|
||||
var _21=$(_1d).tagbox("getValues");
|
||||
_1f.onClickTag.call(_1d,_21[_20]);
|
||||
}
|
||||
}
|
||||
$(this).find(".textbox-text").focus();
|
||||
})._bind("keyup.tagbox",function(e){
|
||||
_23(_1d);
|
||||
})._bind("mouseover.tagbox",function(e){
|
||||
if($(e.target).closest(".textbox-button,.textbox-addon,.tagbox-label").length){
|
||||
$(this).triggerHandler("mouseleave");
|
||||
}else{
|
||||
$(this).find(".textbox-text").triggerHandler("mouseenter");
|
||||
}
|
||||
})._bind("mouseleave.tagbox",function(e){
|
||||
$(this).find(".textbox-text").triggerHandler("mouseleave");
|
||||
});
|
||||
};
|
||||
function _23(_24){
|
||||
var _25=$(_24).tagbox("options");
|
||||
var _26=$(_24).tagbox("textbox");
|
||||
var _27=$(_24).next();
|
||||
var tmp=$("<span></span>").appendTo("body");
|
||||
tmp.attr("style",_26.attr("style"));
|
||||
tmp.css({position:"absolute",top:-9999,left:-9999,width:"auto",fontFamily:_26.css("fontFamily"),fontSize:_26.css("fontSize"),fontWeight:_26.css("fontWeight"),whiteSpace:"nowrap"});
|
||||
var _28=_29(_26.val());
|
||||
var _2a=_29(_25.prompt||"");
|
||||
tmp.remove();
|
||||
var _2b=Math.min(Math.max(_28,_2a)+20,_27.width());
|
||||
_26._outerWidth(_2b);
|
||||
_27.find(".textbox-button").linkbutton("resize",{height:"100%"});
|
||||
function _29(val){
|
||||
var s=val.replace(/&/g,"&").replace(/\s/g," ").replace(/</g,"<").replace(/>/g,">");
|
||||
tmp.html(s);
|
||||
return tmp.outerWidth();
|
||||
};
|
||||
};
|
||||
function _2c(_2d){
|
||||
var t=$(_2d);
|
||||
var _2e=t.tagbox("options");
|
||||
if(_2e.limitToList){
|
||||
var _2f=t.tagbox("panel");
|
||||
var _30=_2f.children("div.combobox-item-hover");
|
||||
if(_30.length){
|
||||
_30.removeClass("combobox-item-hover");
|
||||
var row=_2e.finder.getRow(_2d,_30);
|
||||
var _31=row[_2e.valueField];
|
||||
$(_2d).tagbox(_30.hasClass("combobox-item-selected")?"unselect":"select",_31);
|
||||
}
|
||||
$(_2d).tagbox("hidePanel");
|
||||
}else{
|
||||
var v=$.trim($(_2d).tagbox("getText"));
|
||||
if(v!==""){
|
||||
var _32=$(_2d).tagbox("getValues");
|
||||
_32.push(v);
|
||||
$(_2d).tagbox("setValues",_32);
|
||||
}
|
||||
}
|
||||
};
|
||||
function _33(_34,_35){
|
||||
$(_34).combobox("setText","");
|
||||
_23(_34);
|
||||
$(_34).combobox("setValues",_35);
|
||||
$(_34).combobox("setText","");
|
||||
$(_34).tagbox("validate");
|
||||
};
|
||||
$.fn.tagbox=function(_36,_37){
|
||||
if(typeof _36=="string"){
|
||||
var _38=$.fn.tagbox.methods[_36];
|
||||
if(_38){
|
||||
return _38(this,_37);
|
||||
}else{
|
||||
return this.combobox(_36,_37);
|
||||
}
|
||||
}
|
||||
_36=_36||{};
|
||||
return this.each(function(){
|
||||
var _39=$.data(this,"tagbox");
|
||||
if(_39){
|
||||
$.extend(_39.options,_36);
|
||||
}else{
|
||||
$.data(this,"tagbox",{options:$.extend({},$.fn.tagbox.defaults,$.fn.tagbox.parseOptions(this),_36)});
|
||||
}
|
||||
_1(this);
|
||||
_1c(this);
|
||||
});
|
||||
};
|
||||
$.fn.tagbox.methods={options:function(jq){
|
||||
var _3a=jq.combobox("options");
|
||||
return $.extend($.data(jq[0],"tagbox").options,{width:_3a.width,height:_3a.height,originalValue:_3a.originalValue,disabled:_3a.disabled,readonly:_3a.readonly});
|
||||
},setValues:function(jq,_3b){
|
||||
return jq.each(function(){
|
||||
_33(this,_3b);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).combobox("reset").combobox("setText","");
|
||||
});
|
||||
}};
|
||||
$.fn.tagbox.parseOptions=function(_3c){
|
||||
return $.extend({},$.fn.combobox.parseOptions(_3c),$.parser.parseOptions(_3c,[]));
|
||||
};
|
||||
$.fn.tagbox.defaults=$.extend({},$.fn.combobox.defaults,{hasDownArrow:false,multiple:true,reversed:true,selectOnNavigation:false,tipOptions:$.extend({},$.fn.textbox.defaults.tipOptions,{showDelay:200}),val:function(_3d){
|
||||
var vv=$(_3d).parent().prev().tagbox("getValues");
|
||||
if($(_3d).is(":focus")){
|
||||
vv.push($(_3d).val());
|
||||
}
|
||||
return vv.join(",");
|
||||
},inputEvents:$.extend({},$.fn.combo.defaults.inputEvents,{blur:function(e){
|
||||
var _3e=e.data.target;
|
||||
var _3f=$(_3e).tagbox("options");
|
||||
if(_3f.limitToList){
|
||||
_2c(_3e);
|
||||
}
|
||||
}}),keyHandler:$.extend({},$.fn.combobox.defaults.keyHandler,{enter:function(e){
|
||||
_2c(this);
|
||||
},query:function(q,e){
|
||||
var _40=$(this).tagbox("options");
|
||||
if(_40.limitToList){
|
||||
$.fn.combobox.defaults.keyHandler.query.call(this,q,e);
|
||||
}else{
|
||||
$(this).combobox("hidePanel");
|
||||
}
|
||||
}}),tagFormatter:function(_41,row){
|
||||
var _42=$(this).tagbox("options");
|
||||
return row?row[_42.textField]:_41;
|
||||
},tagStyler:function(_43,row){
|
||||
return "";
|
||||
},onClickTag:function(_44){
|
||||
},onBeforeRemoveTag:function(_45){
|
||||
},onRemoveTag:function(_46){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
572
static/jeasyui/plugins/jquery.textbox.js
Normal file
572
static/jeasyui/plugins/jquery.textbox.js
Normal file
@@ -0,0 +1,572 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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($){
|
||||
var _1=0;
|
||||
function _2(_3){
|
||||
$(_3).addClass("textbox-f").hide();
|
||||
var _4=$("<span class=\"textbox\">"+"<input class=\"textbox-text\" autocomplete=\"off\">"+"<input type=\"hidden\" class=\"textbox-value\">"+"</span>").insertAfter(_3);
|
||||
var _5=$(_3).attr("name");
|
||||
if(_5){
|
||||
_4.find("input.textbox-value").attr("name",_5);
|
||||
$(_3).removeAttr("name").attr("textboxName",_5);
|
||||
}
|
||||
return _4;
|
||||
};
|
||||
function _6(_7){
|
||||
var _8=$.data(_7,"textbox");
|
||||
var _9=_8.options;
|
||||
var tb=_8.textbox;
|
||||
var _a="_easyui_textbox_input"+(++_1);
|
||||
tb.addClass(_9.cls);
|
||||
tb.find(".textbox-text").remove();
|
||||
if(_9.multiline){
|
||||
$("<textarea id=\""+_a+"\" class=\"textbox-text\" autocomplete=\"off\"></textarea>").prependTo(tb);
|
||||
}else{
|
||||
$("<input id=\""+_a+"\" type=\""+_9.type+"\" class=\"textbox-text\" autocomplete=\"off\">").prependTo(tb);
|
||||
}
|
||||
$("#"+_a).attr("tabindex",$(_7).attr("tabindex")||"").css("text-align",_7.style.textAlign||"");
|
||||
tb.find(".textbox-addon").remove();
|
||||
var bb=_9.icons?$.extend(true,[],_9.icons):[];
|
||||
if(_9.iconCls){
|
||||
bb.push({iconCls:_9.iconCls,disabled:true});
|
||||
}
|
||||
if(bb.length){
|
||||
var bc=$("<span class=\"textbox-addon\"></span>").prependTo(tb);
|
||||
bc.addClass("textbox-addon-"+_9.iconAlign);
|
||||
for(var i=0;i<bb.length;i++){
|
||||
bc.append("<a href=\"javascript:;\" class=\"textbox-icon "+bb[i].iconCls+"\" icon-index=\""+i+"\" tabindex=\"-1\"></a>");
|
||||
}
|
||||
}
|
||||
tb.find(".textbox-button").remove();
|
||||
if(_9.buttonText||_9.buttonIcon){
|
||||
var _b=$("<a href=\"javascript:;\" class=\"textbox-button\"></a>").prependTo(tb);
|
||||
_b.addClass("textbox-button-"+_9.buttonAlign).linkbutton({text:_9.buttonText,iconCls:_9.buttonIcon,onClick:function(){
|
||||
var t=$(this).parent().prev();
|
||||
t.textbox("options").onClickButton.call(t[0]);
|
||||
}});
|
||||
}
|
||||
if(_9.label){
|
||||
if(typeof _9.label=="object"){
|
||||
_8.label=$(_9.label);
|
||||
_8.label.attr("for",_a);
|
||||
}else{
|
||||
$(_8.label).remove();
|
||||
_8.label=$("<label class=\"textbox-label\"></label>").html(_9.label);
|
||||
_8.label.css("textAlign",_9.labelAlign).attr("for",_a);
|
||||
if(_9.labelPosition=="after"){
|
||||
_8.label.insertAfter(tb);
|
||||
}else{
|
||||
_8.label.insertBefore(_7);
|
||||
}
|
||||
_8.label.removeClass("textbox-label-left textbox-label-right textbox-label-top");
|
||||
_8.label.addClass("textbox-label-"+_9.labelPosition);
|
||||
}
|
||||
}else{
|
||||
$(_8.label).remove();
|
||||
}
|
||||
_c(_7);
|
||||
_d(_7,_9.disabled);
|
||||
_e(_7,_9.readonly);
|
||||
};
|
||||
function _f(_10){
|
||||
var _11=$.data(_10,"textbox");
|
||||
var tb=_11.textbox;
|
||||
tb.find(".textbox-text").validatebox("destroy");
|
||||
tb.remove();
|
||||
$(_11.label).remove();
|
||||
$(_10).remove();
|
||||
};
|
||||
function _12(_13,_14){
|
||||
var _15=$.data(_13,"textbox");
|
||||
var _16=_15.options;
|
||||
var tb=_15.textbox;
|
||||
var _17=tb.parent();
|
||||
if(_14){
|
||||
if(typeof _14=="object"){
|
||||
$.extend(_16,_14);
|
||||
}else{
|
||||
_16.width=_14;
|
||||
}
|
||||
}
|
||||
if(isNaN(parseInt(_16.width))){
|
||||
var c=$(_13).clone();
|
||||
c.css("visibility","hidden");
|
||||
c.insertAfter(_13);
|
||||
_16.width=c.outerWidth();
|
||||
c.remove();
|
||||
}
|
||||
var _18=tb.is(":visible");
|
||||
if(!_18){
|
||||
tb.appendTo("body");
|
||||
}
|
||||
var _19=tb.find(".textbox-text");
|
||||
var btn=tb.find(".textbox-button");
|
||||
var _1a=tb.find(".textbox-addon");
|
||||
var _1b=_1a.find(".textbox-icon");
|
||||
if(_16.height=="auto"){
|
||||
_19.css({margin:"",paddingTop:"",paddingBottom:"",height:"",lineHeight:""});
|
||||
}
|
||||
tb._size(_16,_17);
|
||||
if(_16.label&&_16.labelPosition){
|
||||
if(_16.labelPosition=="top"){
|
||||
_15.label._size({width:_16.labelWidth=="auto"?tb.outerWidth():_16.labelWidth},tb);
|
||||
if(_16.height!="auto"){
|
||||
tb._size("height",tb.outerHeight()-_15.label.outerHeight());
|
||||
}
|
||||
}else{
|
||||
_15.label._size({width:_16.labelWidth,height:tb.outerHeight()},tb);
|
||||
if(!_16.multiline){
|
||||
_15.label.css("lineHeight",_15.label.height()+"px");
|
||||
}
|
||||
tb._size("width",tb.outerWidth()-_15.label.outerWidth());
|
||||
}
|
||||
}
|
||||
if(_16.buttonAlign=="left"||_16.buttonAlign=="right"){
|
||||
btn.linkbutton("resize",{height:tb.height()});
|
||||
}else{
|
||||
btn.linkbutton("resize",{width:"100%"});
|
||||
}
|
||||
var _1c=tb.width()-_1b.length*_16.iconWidth-_1d("left")-_1d("right");
|
||||
var _1e=_16.height=="auto"?_19.outerHeight():(tb.height()-_1d("top")-_1d("bottom"));
|
||||
_1a.css(_16.iconAlign,_1d(_16.iconAlign)+"px");
|
||||
_1a.css("top",_1d("top")+"px");
|
||||
_1b.css({width:_16.iconWidth+"px",height:_1e+"px"});
|
||||
_19.css({paddingLeft:(_13.style.paddingLeft||""),paddingRight:(_13.style.paddingRight||""),marginLeft:_1f("left"),marginRight:_1f("right"),marginTop:_1d("top"),marginBottom:_1d("bottom")});
|
||||
if(_16.multiline){
|
||||
_19.css({paddingTop:(_13.style.paddingTop||""),paddingBottom:(_13.style.paddingBottom||"")});
|
||||
_19._outerHeight(_1e);
|
||||
}else{
|
||||
_19.css({paddingTop:0,paddingBottom:0,height:_1e+"px",lineHeight:_1e+"px"});
|
||||
}
|
||||
_19._outerWidth(_1c);
|
||||
_16.onResizing.call(_13,_16.width,_16.height);
|
||||
if(!_18){
|
||||
tb.insertAfter(_13);
|
||||
}
|
||||
_16.onResize.call(_13,_16.width,_16.height);
|
||||
function _1f(_20){
|
||||
return (_16.iconAlign==_20?_1a._outerWidth():0)+_1d(_20);
|
||||
};
|
||||
function _1d(_21){
|
||||
var w=0;
|
||||
btn.filter(".textbox-button-"+_21).each(function(){
|
||||
if(_21=="left"||_21=="right"){
|
||||
w+=$(this).outerWidth();
|
||||
}else{
|
||||
w+=$(this).outerHeight();
|
||||
}
|
||||
});
|
||||
return w;
|
||||
};
|
||||
};
|
||||
function _c(_22){
|
||||
var _23=$(_22).textbox("options");
|
||||
var _24=$(_22).textbox("textbox");
|
||||
_24.validatebox($.extend({},_23,{deltaX:function(_25){
|
||||
return $(_22).textbox("getTipX",_25);
|
||||
},deltaY:function(_26){
|
||||
return $(_22).textbox("getTipY",_26);
|
||||
},onBeforeValidate:function(){
|
||||
_23.onBeforeValidate.call(_22);
|
||||
var box=$(this);
|
||||
if(!box.is(":focus")){
|
||||
if(box.val()!==_23.value){
|
||||
_23.oldInputValue=box.val();
|
||||
box.val(_23.value);
|
||||
}
|
||||
}
|
||||
},onValidate:function(_27){
|
||||
var box=$(this);
|
||||
if(_23.oldInputValue!=undefined){
|
||||
box.val(_23.oldInputValue);
|
||||
_23.oldInputValue=undefined;
|
||||
}
|
||||
var tb=box.parent();
|
||||
if(_27){
|
||||
tb.removeClass("textbox-invalid");
|
||||
}else{
|
||||
tb.addClass("textbox-invalid");
|
||||
}
|
||||
_23.onValidate.call(_22,_27);
|
||||
}}));
|
||||
};
|
||||
function _28(_29){
|
||||
var _2a=$.data(_29,"textbox");
|
||||
var _2b=_2a.options;
|
||||
var tb=_2a.textbox;
|
||||
var _2c=tb.find(".textbox-text");
|
||||
_2c.attr("placeholder",_2b.prompt);
|
||||
_2c._unbind(".textbox");
|
||||
$(_2a.label)._unbind(".textbox");
|
||||
if(!_2b.disabled&&!_2b.readonly){
|
||||
if(_2a.label){
|
||||
$(_2a.label)._bind("click.textbox",function(e){
|
||||
if(!_2b.hasFocusMe){
|
||||
_2c.focus();
|
||||
$(_29).textbox("setSelectionRange",{start:0,end:_2c.val().length});
|
||||
}
|
||||
});
|
||||
}
|
||||
_2c._bind("blur.textbox",function(e){
|
||||
if(!tb.hasClass("textbox-focused")){
|
||||
return;
|
||||
}
|
||||
_2b.value=$(this).val();
|
||||
if(_2b.value==""){
|
||||
$(this).val(_2b.prompt).addClass("textbox-prompt");
|
||||
}else{
|
||||
$(this).removeClass("textbox-prompt");
|
||||
}
|
||||
tb.removeClass("textbox-focused");
|
||||
tb.closest(".form-field").removeClass("form-field-focused");
|
||||
})._bind("focus.textbox",function(e){
|
||||
_2b.hasFocusMe=true;
|
||||
if(tb.hasClass("textbox-focused")){
|
||||
return;
|
||||
}
|
||||
if($(this).val()!=_2b.value){
|
||||
$(this).val(_2b.value);
|
||||
}
|
||||
$(this).removeClass("textbox-prompt");
|
||||
tb.addClass("textbox-focused");
|
||||
tb.closest(".form-field").addClass("form-field-focused");
|
||||
});
|
||||
for(var _2d in _2b.inputEvents){
|
||||
_2c._bind(_2d+".textbox",{target:_29},_2b.inputEvents[_2d]);
|
||||
}
|
||||
}
|
||||
var _2e=tb.find(".textbox-addon");
|
||||
_2e._unbind()._bind("click",{target:_29},function(e){
|
||||
var _2f=$(e.target).closest("a.textbox-icon:not(.textbox-icon-disabled)");
|
||||
if(_2f.length){
|
||||
var _30=parseInt(_2f.attr("icon-index"));
|
||||
var _31=_2b.icons[_30];
|
||||
if(_31&&_31.handler){
|
||||
_31.handler.call(_2f[0],e);
|
||||
}
|
||||
_2b.onClickIcon.call(_29,_30);
|
||||
}
|
||||
});
|
||||
_2e.find(".textbox-icon").each(function(_32){
|
||||
var _33=_2b.icons[_32];
|
||||
var _34=$(this);
|
||||
if(!_33||_33.disabled||_2b.disabled||_2b.readonly){
|
||||
_34.addClass("textbox-icon-disabled");
|
||||
}else{
|
||||
_34.removeClass("textbox-icon-disabled");
|
||||
}
|
||||
});
|
||||
var btn=tb.find(".textbox-button");
|
||||
btn.linkbutton((_2b.disabled||_2b.readonly)?"disable":"enable");
|
||||
tb._unbind(".textbox")._bind("_resize.textbox",function(e,_35){
|
||||
if($(this).hasClass("easyui-fluid")||_35){
|
||||
_12(_29);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
function _d(_36,_37){
|
||||
var _38=$.data(_36,"textbox");
|
||||
var _39=_38.options;
|
||||
var tb=_38.textbox;
|
||||
var _3a=tb.find(".textbox-text");
|
||||
var ss=$(_36).add(tb.find(".textbox-value"));
|
||||
_39.disabled=_37;
|
||||
if(_39.disabled){
|
||||
_3a.blur();
|
||||
_3a.validatebox("disable");
|
||||
tb.addClass("textbox-disabled");
|
||||
ss._propAttr("disabled",true);
|
||||
$(_38.label).addClass("textbox-label-disabled");
|
||||
}else{
|
||||
_3a.validatebox("enable");
|
||||
tb.removeClass("textbox-disabled");
|
||||
ss._propAttr("disabled",false);
|
||||
$(_38.label).removeClass("textbox-label-disabled");
|
||||
}
|
||||
};
|
||||
function _e(_3b,_3c){
|
||||
var _3d=$.data(_3b,"textbox");
|
||||
var _3e=_3d.options;
|
||||
var tb=_3d.textbox;
|
||||
var _3f=tb.find(".textbox-text");
|
||||
_3e.readonly=_3c==undefined?true:_3c;
|
||||
if(_3e.readonly){
|
||||
_3f.triggerHandler("blur.textbox");
|
||||
}
|
||||
_3f.validatebox("readonly",_3e.readonly);
|
||||
if(_3e.readonly){
|
||||
tb.addClass("textbox-readonly");
|
||||
$(_3d.label).addClass("textbox-label-readonly");
|
||||
}else{
|
||||
tb.removeClass("textbox-readonly");
|
||||
$(_3d.label).removeClass("textbox-label-readonly");
|
||||
}
|
||||
};
|
||||
$.fn.textbox=function(_40,_41){
|
||||
if(typeof _40=="string"){
|
||||
var _42=$.fn.textbox.methods[_40];
|
||||
if(_42){
|
||||
return _42(this,_41);
|
||||
}else{
|
||||
return this.each(function(){
|
||||
var _43=$(this).textbox("textbox");
|
||||
_43.validatebox(_40,_41);
|
||||
});
|
||||
}
|
||||
}
|
||||
_40=_40||{};
|
||||
return this.each(function(){
|
||||
var _44=$.data(this,"textbox");
|
||||
if(_44){
|
||||
$.extend(_44.options,_40);
|
||||
if(_40.value!=undefined){
|
||||
_44.options.originalValue=_40.value;
|
||||
}
|
||||
}else{
|
||||
_44=$.data(this,"textbox",{options:$.extend({},$.fn.textbox.defaults,$.fn.textbox.parseOptions(this),_40),textbox:_2(this)});
|
||||
_44.options.originalValue=_44.options.value;
|
||||
}
|
||||
_6(this);
|
||||
_28(this);
|
||||
if(_44.options.doSize){
|
||||
_12(this);
|
||||
}
|
||||
var _45=_44.options.value;
|
||||
_44.options.value="";
|
||||
$(this).textbox("initValue",_45);
|
||||
});
|
||||
};
|
||||
$.fn.textbox.methods={options:function(jq){
|
||||
return $.data(jq[0],"textbox").options;
|
||||
},cloneFrom:function(jq,_46){
|
||||
return jq.each(function(){
|
||||
var t=$(this);
|
||||
if(t.data("textbox")){
|
||||
return;
|
||||
}
|
||||
if(!$(_46).data("textbox")){
|
||||
$(_46).textbox();
|
||||
}
|
||||
var _47=$.extend(true,{},$(_46).textbox("options"));
|
||||
var _48=t.attr("name")||"";
|
||||
t.addClass("textbox-f").hide();
|
||||
t.removeAttr("name").attr("textboxName",_48);
|
||||
var _49=$(_46).next().clone().insertAfter(t);
|
||||
var _4a="_easyui_textbox_input"+(++_1);
|
||||
_49.find(".textbox-value").attr("name",_48);
|
||||
_49.find(".textbox-text").attr("id",_4a);
|
||||
var _4b=$($(_46).textbox("label")).clone();
|
||||
if(_4b.length){
|
||||
_4b.attr("for",_4a);
|
||||
if(_47.labelPosition=="after"){
|
||||
_4b.insertAfter(t.next());
|
||||
}else{
|
||||
_4b.insertBefore(t);
|
||||
}
|
||||
}
|
||||
$.data(this,"textbox",{options:_47,textbox:_49,label:(_4b.length?_4b:undefined)});
|
||||
var _4c=$(_46).textbox("button");
|
||||
if(_4c.length){
|
||||
t.textbox("button").linkbutton($.extend(true,{},_4c.linkbutton("options")));
|
||||
}
|
||||
_28(this);
|
||||
_c(this);
|
||||
});
|
||||
},textbox:function(jq){
|
||||
return $.data(jq[0],"textbox").textbox.find(".textbox-text");
|
||||
},button:function(jq){
|
||||
return $.data(jq[0],"textbox").textbox.find(".textbox-button");
|
||||
},label:function(jq){
|
||||
return $.data(jq[0],"textbox").label;
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_f(this);
|
||||
});
|
||||
},resize:function(jq,_4d){
|
||||
return jq.each(function(){
|
||||
_12(this,_4d);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,true);
|
||||
_28(this);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_d(this,false);
|
||||
_28(this);
|
||||
});
|
||||
},readonly:function(jq,_4e){
|
||||
return jq.each(function(){
|
||||
_e(this,_4e);
|
||||
_28(this);
|
||||
});
|
||||
},isValid:function(jq){
|
||||
return jq.textbox("textbox").validatebox("isValid");
|
||||
},clear:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).textbox("setValue","");
|
||||
});
|
||||
},setText:function(jq,_4f){
|
||||
return jq.each(function(){
|
||||
var _50=$(this).textbox("options");
|
||||
var _51=$(this).textbox("textbox");
|
||||
_4f=_4f==undefined?"":String(_4f);
|
||||
if($(this).textbox("getText")!=_4f){
|
||||
_51.val(_4f);
|
||||
}
|
||||
_50.value=_4f;
|
||||
if(!_51.is(":focus")){
|
||||
if(_4f){
|
||||
_51.removeClass("textbox-prompt");
|
||||
}else{
|
||||
_51.val(_50.prompt).addClass("textbox-prompt");
|
||||
}
|
||||
}
|
||||
if(_50.value){
|
||||
$(this).closest(".form-field").removeClass("form-field-empty");
|
||||
}else{
|
||||
$(this).closest(".form-field").addClass("form-field-empty");
|
||||
}
|
||||
$(this).textbox("validate");
|
||||
});
|
||||
},initValue:function(jq,_52){
|
||||
return jq.each(function(){
|
||||
var _53=$.data(this,"textbox");
|
||||
$(this).textbox("setText",_52);
|
||||
_53.textbox.find(".textbox-value").val(_52);
|
||||
$(this).val(_52);
|
||||
});
|
||||
},setValue:function(jq,_54){
|
||||
return jq.each(function(){
|
||||
var _55=$.data(this,"textbox").options;
|
||||
var _56=$(this).textbox("getValue");
|
||||
$(this).textbox("initValue",_54);
|
||||
if(_56!=_54){
|
||||
_55.onChange.call(this,_54,_56);
|
||||
$(this).closest("form").trigger("_change",[this]);
|
||||
}
|
||||
});
|
||||
},getText:function(jq){
|
||||
var _57=jq.textbox("textbox");
|
||||
if(_57.is(":focus")){
|
||||
return _57.val();
|
||||
}else{
|
||||
return jq.textbox("options").value;
|
||||
}
|
||||
},getValue:function(jq){
|
||||
return jq.data("textbox").textbox.find(".textbox-value").val();
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _58=$(this).textbox("options");
|
||||
$(this).textbox("textbox").val(_58.originalValue);
|
||||
$(this).textbox("setValue",_58.originalValue);
|
||||
});
|
||||
},getIcon:function(jq,_59){
|
||||
return jq.data("textbox").textbox.find(".textbox-icon:eq("+_59+")");
|
||||
},getTipX:function(jq,_5a){
|
||||
var _5b=jq.data("textbox");
|
||||
var _5c=_5b.options;
|
||||
var tb=_5b.textbox;
|
||||
var _5d=tb.find(".textbox-text");
|
||||
var _5a=_5a||_5c.tipPosition;
|
||||
var p1=tb.offset();
|
||||
var p2=_5d.offset();
|
||||
var w1=tb.outerWidth();
|
||||
var w2=_5d.outerWidth();
|
||||
if(_5a=="right"){
|
||||
return w1-w2-p2.left+p1.left;
|
||||
}else{
|
||||
if(_5a=="left"){
|
||||
return p1.left-p2.left;
|
||||
}else{
|
||||
return (w1-w2-p2.left+p1.left)/2-(p2.left-p1.left)/2;
|
||||
}
|
||||
}
|
||||
},getTipY:function(jq,_5e){
|
||||
var _5f=jq.data("textbox");
|
||||
var _60=_5f.options;
|
||||
var tb=_5f.textbox;
|
||||
var _61=tb.find(".textbox-text");
|
||||
var _5e=_5e||_60.tipPosition;
|
||||
var p1=tb.offset();
|
||||
var p2=_61.offset();
|
||||
var h1=tb.outerHeight();
|
||||
var h2=_61.outerHeight();
|
||||
if(_5e=="left"||_5e=="right"){
|
||||
return (h1-h2-p2.top+p1.top)/2-(p2.top-p1.top)/2;
|
||||
}else{
|
||||
if(_5e=="bottom"){
|
||||
return (h1-h2-p2.top+p1.top);
|
||||
}else{
|
||||
return (p1.top-p2.top);
|
||||
}
|
||||
}
|
||||
},getSelectionStart:function(jq){
|
||||
return jq.textbox("getSelectionRange").start;
|
||||
},getSelectionRange:function(jq){
|
||||
var _62=jq.textbox("textbox")[0];
|
||||
var _63=0;
|
||||
var end=0;
|
||||
if(typeof _62.selectionStart=="number"){
|
||||
_63=_62.selectionStart;
|
||||
end=_62.selectionEnd;
|
||||
}else{
|
||||
if(_62.createTextRange){
|
||||
var s=document.selection.createRange();
|
||||
var _64=_62.createTextRange();
|
||||
_64.setEndPoint("EndToStart",s);
|
||||
_63=_64.text.length;
|
||||
end=_63+s.text.length;
|
||||
}
|
||||
}
|
||||
return {start:_63,end:end};
|
||||
},setSelectionRange:function(jq,_65){
|
||||
return jq.each(function(){
|
||||
var _66=$(this).textbox("textbox")[0];
|
||||
var _67=_65.start;
|
||||
var end=_65.end;
|
||||
if(_66.setSelectionRange){
|
||||
_66.setSelectionRange(_67,end);
|
||||
}else{
|
||||
if(_66.createTextRange){
|
||||
var _68=_66.createTextRange();
|
||||
_68.collapse();
|
||||
_68.moveEnd("character",end);
|
||||
_68.moveStart("character",_67);
|
||||
_68.select();
|
||||
}
|
||||
}
|
||||
});
|
||||
}};
|
||||
$.fn.textbox.parseOptions=function(_69){
|
||||
var t=$(_69);
|
||||
return $.extend({},$.fn.validatebox.parseOptions(_69),$.parser.parseOptions(_69,["prompt","iconCls","iconAlign","buttonText","buttonIcon","buttonAlign","label","labelPosition","labelAlign",{multiline:"boolean",iconWidth:"number",labelWidth:"number"}]),{value:(t.val()||undefined),type:(t.attr("type")?t.attr("type"):undefined)});
|
||||
};
|
||||
$.fn.textbox.defaults=$.extend({},$.fn.validatebox.defaults,{doSize:true,width:"auto",height:"auto",cls:null,prompt:"",value:"",type:"text",multiline:false,icons:[],iconCls:null,iconAlign:"right",iconWidth:26,buttonText:"",buttonIcon:null,buttonAlign:"right",label:null,labelWidth:"auto",labelPosition:"before",labelAlign:"left",inputEvents:{blur:function(e){
|
||||
var t=$(e.data.target);
|
||||
var _6a=t.textbox("options");
|
||||
if(t.textbox("getValue")!=_6a.value){
|
||||
t.textbox("setValue",_6a.value);
|
||||
}
|
||||
},keydown:function(e){
|
||||
if(e.keyCode==13){
|
||||
var t=$(e.data.target);
|
||||
t.textbox("setValue",t.textbox("getText"));
|
||||
}
|
||||
}},onChange:function(_6b,_6c){
|
||||
},onResizing:function(_6d,_6e){
|
||||
},onResize:function(_6f,_70){
|
||||
},onClickButton:function(){
|
||||
},onClickIcon:function(_71){
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
289
static/jeasyui/plugins/jquery.timepicker.js
Normal file
289
static/jeasyui/plugins/jquery.timepicker.js
Normal file
@@ -0,0 +1,289 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"timepicker");
|
||||
var _4=_3.options;
|
||||
$(_2).addClass("timepicker-f").combo($.extend({},_4,{onShowPanel:function(){
|
||||
_5(this);
|
||||
_6(_2);
|
||||
_13(_2,$(_2).timepicker("getValue"));
|
||||
}}));
|
||||
$(_2).timepicker("initValue",_4.value);
|
||||
function _5(_7){
|
||||
var _8=$(_7).timepicker("options");
|
||||
var _9=$(_7).combo("panel");
|
||||
_9._unbind(".timepicker")._bind("click.timepicker",function(e){
|
||||
if($(e.target).hasClass("datebox-button-a")){
|
||||
var _a=parseInt($(e.target).attr("datebox-button-index"));
|
||||
_8.buttons[_a].handler.call(e.target,_7);
|
||||
}
|
||||
});
|
||||
};
|
||||
function _6(_b){
|
||||
var _c=$(_b).combo("panel");
|
||||
if(_c.children("div.datebox-button").length){
|
||||
return;
|
||||
}
|
||||
var _d=$("<div class=\"datebox-button\"><table cellspacing=\"0\" cellpadding=\"0\" style=\"width:100%\"><tr></tr></table></div>").appendTo(_c);
|
||||
var tr=_d.find("tr");
|
||||
for(var i=0;i<_4.buttons.length;i++){
|
||||
var td=$("<td></td>").appendTo(tr);
|
||||
var _e=_4.buttons[i];
|
||||
var t=$("<a class=\"datebox-button-a\" href=\"javascript:;\"></a>").html($.isFunction(_e.text)?_e.text(_b):_e.text).appendTo(td);
|
||||
t.attr("datebox-button-index",i);
|
||||
}
|
||||
tr.find("td").css("width",(100/_4.buttons.length)+"%");
|
||||
};
|
||||
};
|
||||
function _f(_10,_11){
|
||||
var _12=$(_10).data("timepicker").options;
|
||||
_13(_10,_11);
|
||||
_12.value=_14(_10);
|
||||
$(_10).combo("setValue",_12.value).combo("setText",_12.value);
|
||||
};
|
||||
function _13(_15,_16){
|
||||
var _17=$(_15).data("timepicker").options;
|
||||
if(_16){
|
||||
var _18=_16.split(" ");
|
||||
var hm=_18[0].split(":");
|
||||
_17.selectingHour=parseInt(hm[0],10);
|
||||
_17.selectingMinute=parseInt(hm[1],10);
|
||||
_17.selectingAmpm=_18[1];
|
||||
}else{
|
||||
_17.selectingHour=12;
|
||||
_17.selectingMinute=0;
|
||||
_17.selectingAmpm=_17.ampm[0];
|
||||
}
|
||||
_19(_15);
|
||||
};
|
||||
function _14(_1a){
|
||||
var _1b=$(_1a).data("timepicker").options;
|
||||
var h=_1b.selectingHour;
|
||||
var m=_1b.selectingMinute;
|
||||
var _1c=_1b.selectingAmpm;
|
||||
if(!_1c){
|
||||
_1c=_1b.ampm[0];
|
||||
}
|
||||
var v=(h<10?"0"+h:h)+":"+(m<10?"0"+m:m);
|
||||
if(!_1b.hour24){
|
||||
v+=" "+_1c;
|
||||
}
|
||||
return v;
|
||||
};
|
||||
function _19(_1d){
|
||||
var _1e=$(_1d).data("timepicker").options;
|
||||
var _1f=$(_1d).combo("panel");
|
||||
var _20=_1f.children(".timepicker-panel");
|
||||
if(!_20.length){
|
||||
var _20=$("<div class=\"timepicker-panel f-column\"></div>").prependTo(_1f);
|
||||
}
|
||||
_20.empty();
|
||||
if(_1e.panelHeight!="auto"){
|
||||
var _21=_1f.height()-_1f.find(".datebox-button").outerHeight();
|
||||
_20._outerHeight(_21);
|
||||
}
|
||||
_22(_1d);
|
||||
_23(_1d);
|
||||
_20.off(".timepicker");
|
||||
_20.on("click.timepicker",".title-hour",function(e){
|
||||
_1e.selectingType="hour";
|
||||
_19(_1d);
|
||||
}).on("click.timepicker",".title-minute",function(e){
|
||||
_1e.selectingType="minute";
|
||||
_19(_1d);
|
||||
}).on("click.timepicker",".title-am",function(e){
|
||||
_1e.selectingAmpm=_1e.ampm[0];
|
||||
_19(_1d);
|
||||
}).on("click.timepicker",".title-pm",function(e){
|
||||
_1e.selectingAmpm=_1e.ampm[1];
|
||||
_19(_1d);
|
||||
}).on("click.timepicker",".item",function(e){
|
||||
var _24=parseInt($(this).text(),10);
|
||||
if(_1e.selectingType=="hour"){
|
||||
_1e.selectingHour=_24;
|
||||
}else{
|
||||
_1e.selectingMinute=_24;
|
||||
}
|
||||
_19(_1d);
|
||||
});
|
||||
};
|
||||
function _22(_25){
|
||||
var _26=$(_25).data("timepicker").options;
|
||||
var _27=$(_25).combo("panel");
|
||||
var _28=_27.find(".timepicker-panel");
|
||||
var _29=_26.selectingHour;
|
||||
var _2a=_26.selectingMinute;
|
||||
$("<div class=\"panel-header f-noshrink f-row f-content-center\">"+"<div class=\"title title-hour\">"+(_29<10?"0"+_29:_29)+"</div>"+"<div class=\"sep\">:</div>"+"<div class=\"title title-minute\">"+(_2a<10?"0"+_2a:_2a)+"</div>"+"<div class=\"ampm f-column\">"+"<div class=\"title title-am\">"+_26.ampm[0]+"</div>"+"<div class=\"title title-pm\">"+_26.ampm[1]+"</div>"+"</div>"+"</div>").appendTo(_28);
|
||||
var _2b=_28.find(".panel-header");
|
||||
if(_26.selectingType=="hour"){
|
||||
_2b.find(".title-hour").addClass("title-selected");
|
||||
}else{
|
||||
_2b.find(".title-minute").addClass("title-selected");
|
||||
}
|
||||
if(_26.selectingAmpm==_26.ampm[0]){
|
||||
_2b.find(".title-am").addClass("title-selected");
|
||||
}
|
||||
if(_26.selectingAmpm==_26.ampm[1]){
|
||||
_2b.find(".title-pm").addClass("title-selected");
|
||||
}
|
||||
if(_26.hour24){
|
||||
_2b.find(".ampm").hide();
|
||||
}
|
||||
};
|
||||
function _23(_2c){
|
||||
var _2d=$(_2c).data("timepicker").options;
|
||||
var _2e=$(_2c).combo("panel");
|
||||
var _2f=_2e.find(".timepicker-panel");
|
||||
var _30=$("<div class=\"clock-wrap f-full f-column f-content-center\">"+"</div>").appendTo(_2f);
|
||||
var _31=_30.outerWidth();
|
||||
var _32=_30.outerHeight();
|
||||
var _33=Math.min(_31,_32)-20;
|
||||
var _34=_33/2;
|
||||
_31=_33;
|
||||
_32=_33;
|
||||
var _35=_2d.selectingType=="hour"?_2d.selectingHour:_2d.selectingMinute;
|
||||
var _36=_35/(_2d.selectingType=="hour"?12:60)*360;
|
||||
_36=parseFloat(_36).toFixed(4);
|
||||
var _37={transform:"rotate("+_36+"deg)",};
|
||||
if(_2d.hour24&&_2d.selectingType=="hour"){
|
||||
if(_35==0){
|
||||
_37.top=_2d.hourDistance[0]+"px";
|
||||
}else{
|
||||
if(_35<=12){
|
||||
_37.top=_2d.hourDistance[1]+"px";
|
||||
}
|
||||
}
|
||||
}
|
||||
var _38={width:_31+"px",height:_32+"px",marginLeft:-_31/2+"px",marginTop:-_32/2+"px"};
|
||||
var _39=[];
|
||||
_39.push("<div class=\"clock\">");
|
||||
_39.push("<div class=\"center\"></div>");
|
||||
_39.push("<div class=\"hand\">");
|
||||
_39.push("<div class=\"drag\"></div>");
|
||||
_39.push("</div>");
|
||||
var _3a=_3b();
|
||||
if(_2d.hour24&&_2d.selectingType=="hour"){
|
||||
for(var i=0;i<_3a.length;i++){
|
||||
var _3c=parseInt(_3a[i],10);
|
||||
_3c+=12;
|
||||
if(_3c==24){
|
||||
_3c="00";
|
||||
}
|
||||
var cls="item f-column f-content-center";
|
||||
if(_3c==_35){
|
||||
cls+=" item-selected";
|
||||
}
|
||||
var _36=_3c/(_2d.selectingType=="hour"?12:60)*360*Math.PI/180;
|
||||
var x=(_34-20)*Math.sin(_36);
|
||||
var y=-(_34-20)*Math.cos(_36);
|
||||
_36=parseFloat(_36).toFixed(4);
|
||||
x=parseFloat(x).toFixed(4);
|
||||
y=parseFloat(y).toFixed(4);
|
||||
var _3d={transform:"translate("+x+"px,"+y+"px)"};
|
||||
var _3d="transform:translate("+x+"px,"+y+"px)";
|
||||
_39.push("<div class=\""+cls+"\" style=\""+_3d+"\">"+(_3c)+"</div>");
|
||||
}
|
||||
_34-=_2d.hourDistance[1]-_2d.hourDistance[0];
|
||||
}
|
||||
for(var i=0;i<_3a.length;i++){
|
||||
var _3c=_3a[i];
|
||||
var cls="item f-column f-content-center";
|
||||
if(_3c==_35){
|
||||
cls+=" item-selected";
|
||||
}
|
||||
var _36=_3c/(_2d.selectingType=="hour"?12:60)*360*Math.PI/180;
|
||||
var x=(_34-20)*Math.sin(_36);
|
||||
var y=-(_34-20)*Math.cos(_36);
|
||||
_36=parseFloat(_36).toFixed(4);
|
||||
x=parseFloat(x).toFixed(4);
|
||||
y=parseFloat(y).toFixed(4);
|
||||
var _3d={transform:"translate("+x+"px,"+y+"px)"};
|
||||
var _3d="transform:translate("+x+"px,"+y+"px)";
|
||||
_39.push("<div class=\""+cls+"\" style=\""+_3d+"\">"+_3c+"</div>");
|
||||
}
|
||||
_39.push("</div>");
|
||||
_30.html(_39.join(""));
|
||||
_30.find(".clock").css(_38);
|
||||
_30.find(".hand").css(_37);
|
||||
function _3b(){
|
||||
var _3e=[];
|
||||
if(_2d.selectingType=="hour"){
|
||||
for(var i=0;i<12;i++){
|
||||
_3e.push(String(i));
|
||||
}
|
||||
_3e[0]="12";
|
||||
}else{
|
||||
for(var i=0;i<60;i+=5){
|
||||
_3e.push(i<10?"0"+i:String(i));
|
||||
}
|
||||
_3e[0]="00";
|
||||
}
|
||||
return _3e;
|
||||
};
|
||||
};
|
||||
$.fn.timepicker=function(_3f,_40){
|
||||
if(typeof _3f=="string"){
|
||||
var _41=$.fn.timepicker.methods[_3f];
|
||||
if(_41){
|
||||
return _41(this,_40);
|
||||
}else{
|
||||
return this.combo(_3f,_40);
|
||||
}
|
||||
}
|
||||
_3f=_3f||{};
|
||||
return this.each(function(){
|
||||
var _42=$.data(this,"timepicker");
|
||||
if(_42){
|
||||
$.extend(_42.options,_3f);
|
||||
}else{
|
||||
$.data(this,"timepicker",{options:$.extend({},$.fn.timepicker.defaults,$.fn.timepicker.parseOptions(this),_3f)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.timepicker.methods={options:function(jq){
|
||||
var _43=jq.combo("options");
|
||||
return $.extend($.data(jq[0],"timepicker").options,{width:_43.width,height:_43.height,originalValue:_43.originalValue,disabled:_43.disabled,readonly:_43.readonly});
|
||||
},initValue:function(jq,_44){
|
||||
return jq.each(function(){
|
||||
var _45=$(this).timepicker("options");
|
||||
_45.value=_44;
|
||||
_13(this,_44);
|
||||
if(_44){
|
||||
_45.value=_14(this);
|
||||
$(this).combo("initValue",_45.value).combo("setText",_45.value);
|
||||
}
|
||||
});
|
||||
},setValue:function(jq,_46){
|
||||
return jq.each(function(){
|
||||
_f(this,_46);
|
||||
});
|
||||
},reset:function(jq){
|
||||
return jq.each(function(){
|
||||
var _47=$(this).timepicker("options");
|
||||
$(this).timepicker("setValue",_47.originalValue);
|
||||
});
|
||||
}};
|
||||
$.fn.timepicker.parseOptions=function(_48){
|
||||
return $.extend({},$.fn.combo.parseOptions(_48),$.parser.parseOptions(_48,[{hour24:"boolean"}]));
|
||||
};
|
||||
$.fn.timepicker.defaults=$.extend({},$.fn.combo.defaults,{closeText:"Close",okText:"Ok",buttons:[{text:function(_49){
|
||||
return $(_49).timepicker("options").okText;
|
||||
},handler:function(_4a){
|
||||
$(_4a).timepicker("setValue",_14(_4a));
|
||||
$(this).closest("div.combo-panel").panel("close");
|
||||
}},{text:function(_4b){
|
||||
return $(_4b).timepicker("options").closeText;
|
||||
},handler:function(_4c){
|
||||
$(this).closest("div.combo-panel").panel("close");
|
||||
}}],editable:false,ampm:["am","pm"],value:"",selectingHour:12,selectingMinute:0,selectingType:"hour",hour24:false,hourDistance:[20,50]});
|
||||
})(jQuery);
|
||||
|
||||
199
static/jeasyui/plugins/jquery.timespinner.js
Executable file
199
static/jeasyui/plugins/jquery.timespinner.js
Executable file
@@ -0,0 +1,199 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
var _3=$.data(_2,"timespinner").options;
|
||||
$(_2).addClass("timespinner-f").spinner(_3);
|
||||
var _4=_3.formatter.call(_2,_3.parser.call(_2,_3.value));
|
||||
$(_2).timespinner("initValue",_4);
|
||||
};
|
||||
function _5(e){
|
||||
var _6=e.data.target;
|
||||
var _7=$.data(_6,"timespinner").options;
|
||||
var _8=$(_6).timespinner("getSelectionStart");
|
||||
for(var i=0;i<_7.selections.length;i++){
|
||||
var _9=_7.selections[i];
|
||||
if(_8>=_9[0]&&_8<=_9[1]){
|
||||
_a(_6,i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
function _a(_b,_c){
|
||||
var _d=$.data(_b,"timespinner").options;
|
||||
if(_c!=undefined){
|
||||
_d.highlight=_c;
|
||||
}
|
||||
var _e=_d.selections[_d.highlight];
|
||||
if(_e){
|
||||
var tb=$(_b).timespinner("textbox");
|
||||
$(_b).timespinner("setSelectionRange",{start:_e[0],end:_e[1]});
|
||||
tb.focus();
|
||||
}
|
||||
};
|
||||
function _f(_10,_11){
|
||||
var _12=$.data(_10,"timespinner").options;
|
||||
var _11=_12.parser.call(_10,_11);
|
||||
var _13=_12.formatter.call(_10,_11);
|
||||
$(_10).spinner("setValue",_13);
|
||||
};
|
||||
function _14(_15,_16){
|
||||
var _17=$.data(_15,"timespinner").options;
|
||||
var s=$(_15).timespinner("getValue");
|
||||
var _18=_17.selections[_17.highlight];
|
||||
var s1=s.substring(0,_18[0]);
|
||||
var s2=s.substring(_18[0],_18[1]);
|
||||
var s3=s.substring(_18[1]);
|
||||
if(s2==_17.ampm[0]){
|
||||
s2=_17.ampm[1];
|
||||
}else{
|
||||
if(s2==_17.ampm[1]){
|
||||
s2=_17.ampm[0];
|
||||
}else{
|
||||
s2=parseInt(s2,10)||0;
|
||||
if(_17.selections.length-4==_17.highlight&&_17.hour12){
|
||||
if(s2==12){
|
||||
s2=0;
|
||||
}else{
|
||||
if(s2==11&&!_16){
|
||||
var tmp=s3.replace(_17.ampm[0],_17.ampm[1]);
|
||||
if(s3!=tmp){
|
||||
s3=tmp;
|
||||
}else{
|
||||
s3=s3.replace(_17.ampm[1],_17.ampm[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
s2=s2+_17.increment*(_16?-1:1);
|
||||
}
|
||||
}
|
||||
var v=s1+s2+s3;
|
||||
$(_15).timespinner("setValue",v);
|
||||
_a(_15);
|
||||
};
|
||||
$.fn.timespinner=function(_19,_1a){
|
||||
if(typeof _19=="string"){
|
||||
var _1b=$.fn.timespinner.methods[_19];
|
||||
if(_1b){
|
||||
return _1b(this,_1a);
|
||||
}else{
|
||||
return this.spinner(_19,_1a);
|
||||
}
|
||||
}
|
||||
_19=_19||{};
|
||||
return this.each(function(){
|
||||
var _1c=$.data(this,"timespinner");
|
||||
if(_1c){
|
||||
$.extend(_1c.options,_19);
|
||||
}else{
|
||||
$.data(this,"timespinner",{options:$.extend({},$.fn.timespinner.defaults,$.fn.timespinner.parseOptions(this),_19)});
|
||||
}
|
||||
_1(this);
|
||||
});
|
||||
};
|
||||
$.fn.timespinner.methods={options:function(jq){
|
||||
var _1d=jq.data("spinner")?jq.spinner("options"):{};
|
||||
return $.extend($.data(jq[0],"timespinner").options,{width:_1d.width,value:_1d.value,originalValue:_1d.originalValue,disabled:_1d.disabled,readonly:_1d.readonly});
|
||||
},setValue:function(jq,_1e){
|
||||
return jq.each(function(){
|
||||
_f(this,_1e);
|
||||
});
|
||||
},getHours:function(jq){
|
||||
var _1f=$.data(jq[0],"timespinner").options;
|
||||
var _20=_1f.parser.call(jq[0],jq.timespinner("getValue"));
|
||||
return _20?_20.getHours():null;
|
||||
},getMinutes:function(jq){
|
||||
var _21=$.data(jq[0],"timespinner").options;
|
||||
var _22=_21.parser.call(jq[0],jq.timespinner("getValue"));
|
||||
return _22?_22.getMinutes():null;
|
||||
},getSeconds:function(jq){
|
||||
var _23=$.data(jq[0],"timespinner").options;
|
||||
var _24=_23.parser.call(jq[0],jq.timespinner("getValue"));
|
||||
return _24?_24.getSeconds():null;
|
||||
}};
|
||||
$.fn.timespinner.parseOptions=function(_25){
|
||||
return $.extend({},$.fn.spinner.parseOptions(_25),$.parser.parseOptions(_25,["separator",{hour12:"boolean",showSeconds:"boolean",highlight:"number"}]));
|
||||
};
|
||||
$.fn.timespinner.defaults=$.extend({},$.fn.spinner.defaults,{inputEvents:$.extend({},$.fn.spinner.defaults.inputEvents,{click:function(e){
|
||||
_5.call(this,e);
|
||||
},blur:function(e){
|
||||
var t=$(e.data.target);
|
||||
t.timespinner("setValue",t.timespinner("getText"));
|
||||
},keydown:function(e){
|
||||
if(e.keyCode==13){
|
||||
var t=$(e.data.target);
|
||||
t.timespinner("setValue",t.timespinner("getText"));
|
||||
}
|
||||
}}),formatter:function(_26){
|
||||
if(!_26){
|
||||
return "";
|
||||
}
|
||||
var _27=$(this).timespinner("options");
|
||||
var _28=_26.getHours();
|
||||
var _29=_26.getMinutes();
|
||||
var _2a=_26.getSeconds();
|
||||
var _2b="";
|
||||
if(_27.hour12){
|
||||
_2b=_28>=12?_27.ampm[1]:_27.ampm[0];
|
||||
_28=_28%12;
|
||||
if(_28==0){
|
||||
_28=12;
|
||||
}
|
||||
}
|
||||
var tt=[_2c(_28),_2c(_29)];
|
||||
if(_27.showSeconds){
|
||||
tt.push(_2c(_2a));
|
||||
}
|
||||
var s=tt.join(_27.separator)+" "+_2b;
|
||||
return $.trim(s);
|
||||
function _2c(_2d){
|
||||
return (_2d<10?"0":"")+_2d;
|
||||
};
|
||||
},parser:function(s){
|
||||
var _2e=$(this).timespinner("options");
|
||||
var _2f=_30(s);
|
||||
if(_2f){
|
||||
var min=_30(_2e.min);
|
||||
var max=_30(_2e.max);
|
||||
if(min&&min>_2f){
|
||||
_2f=min;
|
||||
}
|
||||
if(max&&max<_2f){
|
||||
_2f=max;
|
||||
}
|
||||
}
|
||||
return _2f;
|
||||
function _30(s){
|
||||
if(!s){
|
||||
return null;
|
||||
}
|
||||
var ss=s.split(" ");
|
||||
var tt=ss[0].split(_2e.separator);
|
||||
var _31=parseInt(tt[0],10)||0;
|
||||
var _32=parseInt(tt[1],10)||0;
|
||||
var _33=parseInt(tt[2],10)||0;
|
||||
if(_2e.hour12){
|
||||
var _34=ss[1];
|
||||
if(_34==_2e.ampm[1]&&_31<12){
|
||||
_31+=12;
|
||||
}else{
|
||||
if(_34==_2e.ampm[0]&&_31==12){
|
||||
_31-=12;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Date(1900,0,0,_31,_32,_33);
|
||||
};
|
||||
},selections:[[0,2],[3,5],[6,8],[9,11]],separator:":",showSeconds:false,highlight:0,hour12:false,ampm:["AM","PM"],spin:function(_35){
|
||||
_14(this,_35);
|
||||
}});
|
||||
})(jQuery);
|
||||
|
||||
238
static/jeasyui/plugins/jquery.tooltip.js
Executable file
238
static/jeasyui/plugins/jquery.tooltip.js
Executable file
@@ -0,0 +1,238 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
$(_2).addClass("tooltip-f");
|
||||
};
|
||||
function _3(_4){
|
||||
var _5=$.data(_4,"tooltip").options;
|
||||
$(_4)._unbind(".tooltip")._bind(_5.showEvent+".tooltip",function(e){
|
||||
$(_4).tooltip("show",e);
|
||||
})._bind(_5.hideEvent+".tooltip",function(e){
|
||||
$(_4).tooltip("hide",e);
|
||||
})._bind("mousemove.tooltip",function(e){
|
||||
if(_5.trackMouse){
|
||||
_5.trackMouseX=e.pageX;
|
||||
_5.trackMouseY=e.pageY;
|
||||
$(_4).tooltip("reposition");
|
||||
}
|
||||
});
|
||||
};
|
||||
function _6(_7){
|
||||
var _8=$.data(_7,"tooltip");
|
||||
if(_8.showTimer){
|
||||
clearTimeout(_8.showTimer);
|
||||
_8.showTimer=null;
|
||||
}
|
||||
if(_8.hideTimer){
|
||||
clearTimeout(_8.hideTimer);
|
||||
_8.hideTimer=null;
|
||||
}
|
||||
};
|
||||
function _9(_a){
|
||||
var _b=$.data(_a,"tooltip");
|
||||
if(!_b||!_b.tip){
|
||||
return;
|
||||
}
|
||||
var _c=_b.options;
|
||||
var _d=_b.tip;
|
||||
var _e={left:-100000,top:-100000};
|
||||
if($(_a).is(":visible")){
|
||||
_e=_f(_c.position);
|
||||
if(_c.position=="top"&&_e.top<0){
|
||||
_e=_f("bottom");
|
||||
}else{
|
||||
if((_c.position=="bottom")&&(_e.top+_d._outerHeight()>$(window)._outerHeight()+$(document).scrollTop())){
|
||||
_e=_f("top");
|
||||
}
|
||||
}
|
||||
if(_e.left<0){
|
||||
if(_c.position=="left"){
|
||||
_e=_f("right");
|
||||
}else{
|
||||
$(_a).tooltip("arrow").css("left",_d._outerWidth()/2+_e.left);
|
||||
_e.left=0;
|
||||
}
|
||||
}else{
|
||||
if(_e.left+_d._outerWidth()>$(window)._outerWidth()+$(document)._scrollLeft()){
|
||||
if(_c.position=="right"){
|
||||
_e=_f("left");
|
||||
}else{
|
||||
var _10=_e.left;
|
||||
_e.left=$(window)._outerWidth()+$(document)._scrollLeft()-_d._outerWidth();
|
||||
$(_a).tooltip("arrow").css("left",_d._outerWidth()/2-(_e.left-_10));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_d.css({left:_e.left,top:_e.top,zIndex:(_c.zIndex!=undefined?_c.zIndex:($.fn.window?$.fn.window.defaults.zIndex++:""))});
|
||||
_c.onPosition.call(_a,_e.left,_e.top);
|
||||
function _f(_11){
|
||||
_c.position=_11||"bottom";
|
||||
_d.removeClass("tooltip-top tooltip-bottom tooltip-left tooltip-right").addClass("tooltip-"+_c.position);
|
||||
var _12,top;
|
||||
var _13=$.isFunction(_c.deltaX)?_c.deltaX.call(_a,_c.position):_c.deltaX;
|
||||
var _14=$.isFunction(_c.deltaY)?_c.deltaY.call(_a,_c.position):_c.deltaY;
|
||||
if(_c.trackMouse){
|
||||
t=$();
|
||||
_12=_c.trackMouseX+_13;
|
||||
top=_c.trackMouseY+_14;
|
||||
}else{
|
||||
var t=$(_a);
|
||||
_12=t.offset().left+_13;
|
||||
top=t.offset().top+_14;
|
||||
}
|
||||
switch(_c.position){
|
||||
case "right":
|
||||
_12+=t._outerWidth()+12+(_c.trackMouse?12:0);
|
||||
if(_c.valign=="middle"){
|
||||
top-=(_d._outerHeight()-t._outerHeight())/2;
|
||||
}
|
||||
break;
|
||||
case "left":
|
||||
_12-=_d._outerWidth()+12+(_c.trackMouse?12:0);
|
||||
if(_c.valign=="middle"){
|
||||
top-=(_d._outerHeight()-t._outerHeight())/2;
|
||||
}
|
||||
break;
|
||||
case "top":
|
||||
_12-=(_d._outerWidth()-t._outerWidth())/2;
|
||||
top-=_d._outerHeight()+12+(_c.trackMouse?12:0);
|
||||
break;
|
||||
case "bottom":
|
||||
_12-=(_d._outerWidth()-t._outerWidth())/2;
|
||||
top+=t._outerHeight()+12+(_c.trackMouse?12:0);
|
||||
break;
|
||||
}
|
||||
return {left:_12,top:top};
|
||||
};
|
||||
};
|
||||
function _15(_16,e){
|
||||
var _17=$.data(_16,"tooltip");
|
||||
var _18=_17.options;
|
||||
var tip=_17.tip;
|
||||
if(!tip){
|
||||
tip=$("<div tabindex=\"-1\" class=\"tooltip\">"+"<div class=\"tooltip-content\"></div>"+"<div class=\"tooltip-arrow-outer\"></div>"+"<div class=\"tooltip-arrow\"></div>"+"</div>").appendTo("body");
|
||||
_17.tip=tip;
|
||||
_19(_16);
|
||||
}
|
||||
_6(_16);
|
||||
_17.showTimer=setTimeout(function(){
|
||||
$(_16).tooltip("reposition");
|
||||
tip.show();
|
||||
_18.onShow.call(_16,e);
|
||||
var _1a=tip.children(".tooltip-arrow-outer");
|
||||
var _1b=tip.children(".tooltip-arrow");
|
||||
var bc="border-"+_18.position+"-color";
|
||||
_1a.add(_1b).css({borderTopColor:"",borderBottomColor:"",borderLeftColor:"",borderRightColor:""});
|
||||
_1a.css(bc,tip.css(bc));
|
||||
_1b.css(bc,tip.css("backgroundColor"));
|
||||
},_18.showDelay);
|
||||
};
|
||||
function _1c(_1d,e){
|
||||
var _1e=$.data(_1d,"tooltip");
|
||||
if(_1e&&_1e.tip){
|
||||
_6(_1d);
|
||||
_1e.hideTimer=setTimeout(function(){
|
||||
_1e.tip.hide();
|
||||
_1e.options.onHide.call(_1d,e);
|
||||
},_1e.options.hideDelay);
|
||||
}
|
||||
};
|
||||
function _19(_1f,_20){
|
||||
var _21=$.data(_1f,"tooltip");
|
||||
var _22=_21.options;
|
||||
if(_20){
|
||||
_22.content=_20;
|
||||
}
|
||||
if(!_21.tip){
|
||||
return;
|
||||
}
|
||||
var cc=typeof _22.content=="function"?_22.content.call(_1f):_22.content;
|
||||
_21.tip.children(".tooltip-content").html(cc);
|
||||
_22.onUpdate.call(_1f,cc);
|
||||
};
|
||||
function _23(_24){
|
||||
var _25=$.data(_24,"tooltip");
|
||||
if(_25){
|
||||
_6(_24);
|
||||
var _26=_25.options;
|
||||
if(_25.tip){
|
||||
_25.tip.remove();
|
||||
}
|
||||
if(_26._title){
|
||||
$(_24).attr("title",_26._title);
|
||||
}
|
||||
$.removeData(_24,"tooltip");
|
||||
$(_24)._unbind(".tooltip").removeClass("tooltip-f");
|
||||
_26.onDestroy.call(_24);
|
||||
}
|
||||
};
|
||||
$.fn.tooltip=function(_27,_28){
|
||||
if(typeof _27=="string"){
|
||||
return $.fn.tooltip.methods[_27](this,_28);
|
||||
}
|
||||
_27=_27||{};
|
||||
return this.each(function(){
|
||||
var _29=$.data(this,"tooltip");
|
||||
if(_29){
|
||||
$.extend(_29.options,_27);
|
||||
}else{
|
||||
$.data(this,"tooltip",{options:$.extend({},$.fn.tooltip.defaults,$.fn.tooltip.parseOptions(this),_27)});
|
||||
_1(this);
|
||||
}
|
||||
_3(this);
|
||||
_19(this);
|
||||
});
|
||||
};
|
||||
$.fn.tooltip.methods={options:function(jq){
|
||||
return $.data(jq[0],"tooltip").options;
|
||||
},tip:function(jq){
|
||||
return $.data(jq[0],"tooltip").tip;
|
||||
},arrow:function(jq){
|
||||
return jq.tooltip("tip").children(".tooltip-arrow-outer,.tooltip-arrow");
|
||||
},show:function(jq,e){
|
||||
return jq.each(function(){
|
||||
_15(this,e);
|
||||
});
|
||||
},hide:function(jq,e){
|
||||
return jq.each(function(){
|
||||
_1c(this,e);
|
||||
});
|
||||
},update:function(jq,_2a){
|
||||
return jq.each(function(){
|
||||
_19(this,_2a);
|
||||
});
|
||||
},reposition:function(jq){
|
||||
return jq.each(function(){
|
||||
_9(this);
|
||||
});
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_23(this);
|
||||
});
|
||||
}};
|
||||
$.fn.tooltip.parseOptions=function(_2b){
|
||||
var t=$(_2b);
|
||||
var _2c=$.extend({},$.parser.parseOptions(_2b,["position","showEvent","hideEvent","content",{trackMouse:"boolean",deltaX:"number",deltaY:"number",showDelay:"number",hideDelay:"number"}]),{_title:t.attr("title")});
|
||||
t.attr("title","");
|
||||
if(!_2c.content){
|
||||
_2c.content=_2c._title;
|
||||
}
|
||||
return _2c;
|
||||
};
|
||||
$.fn.tooltip.defaults={position:"bottom",valign:"middle",content:null,trackMouse:false,deltaX:0,deltaY:0,showEvent:"mouseenter",hideEvent:"mouseleave",showDelay:200,hideDelay:100,onShow:function(e){
|
||||
},onHide:function(e){
|
||||
},onUpdate:function(_2d){
|
||||
},onPosition:function(_2e,top){
|
||||
},onDestroy:function(){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
1265
static/jeasyui/plugins/jquery.tree.js
Executable file
1265
static/jeasyui/plugins/jquery.tree.js
Executable file
File diff suppressed because it is too large
Load Diff
1359
static/jeasyui/plugins/jquery.treegrid.js
Executable file
1359
static/jeasyui/plugins/jquery.treegrid.js
Executable file
File diff suppressed because it is too large
Load Diff
310
static/jeasyui/plugins/jquery.validatebox.js
Executable file
310
static/jeasyui/plugins/jquery.validatebox.js
Executable file
@@ -0,0 +1,310 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2){
|
||||
$(_2).addClass("validatebox-text");
|
||||
};
|
||||
function _3(_4){
|
||||
var _5=$.data(_4,"validatebox");
|
||||
_5.validating=false;
|
||||
if(_5.vtimer){
|
||||
clearTimeout(_5.vtimer);
|
||||
}
|
||||
if(_5.ftimer){
|
||||
clearTimeout(_5.ftimer);
|
||||
}
|
||||
$(_4).tooltip("destroy");
|
||||
$(_4)._unbind();
|
||||
$(_4).remove();
|
||||
};
|
||||
function _6(_7){
|
||||
var _8=$.data(_7,"validatebox").options;
|
||||
$(_7)._unbind(".validatebox");
|
||||
if(_8.novalidate||_8.disabled){
|
||||
return;
|
||||
}
|
||||
for(var _9 in _8.events){
|
||||
$(_7)._bind(_9+".validatebox",{target:_7},_8.events[_9]);
|
||||
}
|
||||
};
|
||||
function _a(e){
|
||||
var _b=e.data.target;
|
||||
var _c=$.data(_b,"validatebox");
|
||||
var _d=_c.options;
|
||||
if($(_b).attr("readonly")){
|
||||
return;
|
||||
}
|
||||
_c.validating=true;
|
||||
_c.value=_d.val(_b);
|
||||
(function(){
|
||||
if(!$(_b).is(":visible")){
|
||||
_c.validating=false;
|
||||
}
|
||||
if(_c.validating){
|
||||
var _e=_d.val(_b);
|
||||
if(_c.value!=_e){
|
||||
_c.value=_e;
|
||||
if(_c.vtimer){
|
||||
clearTimeout(_c.vtimer);
|
||||
}
|
||||
_c.vtimer=setTimeout(function(){
|
||||
$(_b).validatebox("validate");
|
||||
},_d.delay);
|
||||
}else{
|
||||
if(_c.message){
|
||||
_d.err(_b,_c.message);
|
||||
}
|
||||
}
|
||||
_c.ftimer=setTimeout(arguments.callee,_d.interval);
|
||||
}
|
||||
})();
|
||||
};
|
||||
function _f(e){
|
||||
var _10=e.data.target;
|
||||
var _11=$.data(_10,"validatebox");
|
||||
var _12=_11.options;
|
||||
_11.validating=false;
|
||||
if(_11.vtimer){
|
||||
clearTimeout(_11.vtimer);
|
||||
_11.vtimer=undefined;
|
||||
}
|
||||
if(_11.ftimer){
|
||||
clearTimeout(_11.ftimer);
|
||||
_11.ftimer=undefined;
|
||||
}
|
||||
if(_12.validateOnBlur){
|
||||
setTimeout(function(){
|
||||
$(_10).validatebox("validate");
|
||||
},0);
|
||||
}
|
||||
_12.err(_10,_11.message,"hide");
|
||||
};
|
||||
function _13(e){
|
||||
var _14=e.data.target;
|
||||
var _15=$.data(_14,"validatebox");
|
||||
_15.options.err(_14,_15.message,"show");
|
||||
};
|
||||
function _16(e){
|
||||
var _17=e.data.target;
|
||||
var _18=$.data(_17,"validatebox");
|
||||
if(!_18.validating){
|
||||
_18.options.err(_17,_18.message,"hide");
|
||||
}
|
||||
};
|
||||
function _19(_1a,_1b,_1c){
|
||||
var _1d=$.data(_1a,"validatebox");
|
||||
var _1e=_1d.options;
|
||||
var t=$(_1a);
|
||||
if(_1c=="hide"||!_1b){
|
||||
t.tooltip("hide");
|
||||
}else{
|
||||
if((t.is(":focus")&&_1d.validating)||_1c=="show"){
|
||||
t.tooltip($.extend({},_1e.tipOptions,{content:_1b,position:_1e.tipPosition,deltaX:_1e.deltaX,deltaY:_1e.deltaY})).tooltip("show");
|
||||
}
|
||||
}
|
||||
};
|
||||
function _1f(_20){
|
||||
var _21=$.data(_20,"validatebox");
|
||||
var _22=_21.options;
|
||||
var box=$(_20);
|
||||
_22.onBeforeValidate.call(_20);
|
||||
var _23=_24();
|
||||
_23?box.removeClass("validatebox-invalid"):box.addClass("validatebox-invalid");
|
||||
_22.err(_20,_21.message);
|
||||
_22.onValidate.call(_20,_23);
|
||||
return _23;
|
||||
function _25(msg){
|
||||
_21.message=msg;
|
||||
};
|
||||
function _26(_27,_28){
|
||||
var _29=_22.val(_20);
|
||||
var _2a=/([a-zA-Z_]+)(.*)/.exec(_27);
|
||||
var _2b=_22.rules[_2a[1]];
|
||||
if(_2b&&_29){
|
||||
var _2c=_28||_22.validParams||eval(_2a[2]);
|
||||
if(!_2b["validator"].call(_20,_29,_2c)){
|
||||
var _2d=_2b["message"];
|
||||
if(_2c){
|
||||
for(var i=0;i<_2c.length;i++){
|
||||
_2d=_2d.replace(new RegExp("\\{"+i+"\\}","g"),_2c[i]);
|
||||
}
|
||||
}
|
||||
_25(_22.invalidMessage||_2d);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
function _24(){
|
||||
_25("");
|
||||
if(!_22._validateOnCreate){
|
||||
setTimeout(function(){
|
||||
_22._validateOnCreate=true;
|
||||
},0);
|
||||
return true;
|
||||
}
|
||||
if(_22.novalidate||_22.disabled){
|
||||
return true;
|
||||
}
|
||||
if(_22.required){
|
||||
if(_22.val(_20)==""){
|
||||
_25(_22.missingMessage);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(_22.validType){
|
||||
if($.isArray(_22.validType)){
|
||||
for(var i=0;i<_22.validType.length;i++){
|
||||
if(!_26(_22.validType[i])){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(typeof _22.validType=="string"){
|
||||
if(!_26(_22.validType)){
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
for(var _2e in _22.validType){
|
||||
var _2f=_22.validType[_2e];
|
||||
if(!_26(_2e,_2f)){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
};
|
||||
function _30(_31,_32){
|
||||
var _33=$.data(_31,"validatebox").options;
|
||||
if(_32!=undefined){
|
||||
_33.disabled=_32;
|
||||
}
|
||||
if(_33.disabled){
|
||||
$(_31).addClass("validatebox-disabled")._propAttr("disabled",true);
|
||||
}else{
|
||||
$(_31).removeClass("validatebox-disabled")._propAttr("disabled",false);
|
||||
}
|
||||
};
|
||||
function _34(_35,_36){
|
||||
var _37=$.data(_35,"validatebox").options;
|
||||
_37.readonly=_36==undefined?true:_36;
|
||||
if(_37.readonly||!_37.editable){
|
||||
$(_35).triggerHandler("blur.validatebox");
|
||||
$(_35).addClass("validatebox-readonly")._propAttr("readonly",true);
|
||||
}else{
|
||||
$(_35).removeClass("validatebox-readonly")._propAttr("readonly",false);
|
||||
}
|
||||
};
|
||||
$.fn.validatebox=function(_38,_39){
|
||||
if(typeof _38=="string"){
|
||||
return $.fn.validatebox.methods[_38](this,_39);
|
||||
}
|
||||
_38=_38||{};
|
||||
return this.each(function(){
|
||||
var _3a=$.data(this,"validatebox");
|
||||
if(_3a){
|
||||
$.extend(_3a.options,_38);
|
||||
}else{
|
||||
_1(this);
|
||||
_3a=$.data(this,"validatebox",{options:$.extend({},$.fn.validatebox.defaults,$.fn.validatebox.parseOptions(this),_38)});
|
||||
}
|
||||
_3a.options._validateOnCreate=_3a.options.validateOnCreate;
|
||||
_30(this,_3a.options.disabled);
|
||||
_34(this,_3a.options.readonly);
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
};
|
||||
$.fn.validatebox.methods={options:function(jq){
|
||||
return $.data(jq[0],"validatebox").options;
|
||||
},destroy:function(jq){
|
||||
return jq.each(function(){
|
||||
_3(this);
|
||||
});
|
||||
},validate:function(jq){
|
||||
return jq.each(function(){
|
||||
_1f(this);
|
||||
});
|
||||
},isValid:function(jq){
|
||||
return _1f(jq[0]);
|
||||
},enableValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).validatebox("options").novalidate=false;
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
},disableValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
$(this).validatebox("options").novalidate=true;
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
},resetValidation:function(jq){
|
||||
return jq.each(function(){
|
||||
var _3b=$(this).validatebox("options");
|
||||
_3b._validateOnCreate=_3b.validateOnCreate;
|
||||
_1f(this);
|
||||
});
|
||||
},enable:function(jq){
|
||||
return jq.each(function(){
|
||||
_30(this,false);
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
},disable:function(jq){
|
||||
return jq.each(function(){
|
||||
_30(this,true);
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
},readonly:function(jq,_3c){
|
||||
return jq.each(function(){
|
||||
_34(this,_3c);
|
||||
_6(this);
|
||||
_1f(this);
|
||||
});
|
||||
}};
|
||||
$.fn.validatebox.parseOptions=function(_3d){
|
||||
var t=$(_3d);
|
||||
return $.extend({},$.parser.parseOptions(_3d,["validType","missingMessage","invalidMessage","tipPosition",{delay:"number",interval:"number",deltaX:"number"},{editable:"boolean",validateOnCreate:"boolean",validateOnBlur:"boolean"}]),{required:(t.attr("required")?true:undefined),disabled:(t.attr("disabled")?true:undefined),readonly:(t.attr("readonly")?true:undefined),novalidate:(t.attr("novalidate")!=undefined?true:undefined)});
|
||||
};
|
||||
$.fn.validatebox.defaults={required:false,validType:null,validParams:null,delay:200,interval:200,missingMessage:"This field is required.",invalidMessage:null,tipPosition:"right",deltaX:0,deltaY:0,novalidate:false,editable:true,disabled:false,readonly:false,validateOnCreate:true,validateOnBlur:false,events:{focus:_a,blur:_f,mouseenter:_13,mouseleave:_16,click:function(e){
|
||||
var t=$(e.data.target);
|
||||
if(t.attr("type")=="checkbox"||t.attr("type")=="radio"){
|
||||
t.focus().validatebox("validate");
|
||||
}
|
||||
}},val:function(_3e){
|
||||
return $(_3e).val();
|
||||
},err:function(_3f,_40,_41){
|
||||
_19(_3f,_40,_41);
|
||||
},tipOptions:{showEvent:"none",hideEvent:"none",showDelay:0,hideDelay:0,zIndex:"",onShow:function(){
|
||||
$(this).tooltip("tip").css({color:"#000",borderColor:"#CC9933",backgroundColor:"#FFFFCC"});
|
||||
},onHide:function(){
|
||||
$(this).tooltip("destroy");
|
||||
}},rules:{email:{validator:function(_42){
|
||||
return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(_42);
|
||||
},message:"Please enter a valid email address."},url:{validator:function(_43){
|
||||
return /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(_43);
|
||||
},message:"Please enter a valid URL."},length:{validator:function(_44,_45){
|
||||
var len=$.trim(_44).length;
|
||||
return len>=_45[0]&&len<=_45[1];
|
||||
},message:"Please enter a value between {0} and {1}."},remote:{validator:function(_46,_47){
|
||||
var _48={};
|
||||
_48[_47[1]]=_46;
|
||||
var _49=$.ajax({url:_47[0],dataType:"json",data:_48,async:false,cache:false,type:"post"}).responseText;
|
||||
return _49=="true";
|
||||
},message:"Please fix this field."}},onBeforeValidate:function(){
|
||||
},onValidate:function(_4a){
|
||||
}};
|
||||
})(jQuery);
|
||||
|
||||
323
static/jeasyui/plugins/jquery.window.js
Executable file
323
static/jeasyui/plugins/jquery.window.js
Executable file
@@ -0,0 +1,323 @@
|
||||
/**
|
||||
* EasyUI for jQuery 1.9.14
|
||||
*
|
||||
* Copyright (c) 2009-2021 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 _1(_2,_3){
|
||||
var _4=$.data(_2,"window");
|
||||
if(_3){
|
||||
if(_3.left!=null){
|
||||
_4.options.left=_3.left;
|
||||
}
|
||||
if(_3.top!=null){
|
||||
_4.options.top=_3.top;
|
||||
}
|
||||
}
|
||||
$(_2).panel("move",_4.options);
|
||||
if(_4.shadow){
|
||||
_4.shadow.css({left:_4.options.left,top:_4.options.top});
|
||||
}
|
||||
};
|
||||
function _5(_6,_7){
|
||||
var _8=$.data(_6,"window").options;
|
||||
var pp=$(_6).window("panel");
|
||||
var _9=pp._outerWidth();
|
||||
if(_8.inline){
|
||||
var _a=pp.parent();
|
||||
_8.left=Math.ceil((_a.width()-_9)/2+_a.scrollLeft());
|
||||
}else{
|
||||
var _b=_8.fixed?0:$(document).scrollLeft();
|
||||
_8.left=Math.ceil(($(window)._outerWidth()-_9)/2+_b);
|
||||
}
|
||||
if(_7){
|
||||
_1(_6);
|
||||
}
|
||||
};
|
||||
function _c(_d,_e){
|
||||
var _f=$.data(_d,"window").options;
|
||||
var pp=$(_d).window("panel");
|
||||
var _10=pp._outerHeight();
|
||||
if(_f.inline){
|
||||
var _11=pp.parent();
|
||||
_f.top=Math.ceil((_11.height()-_10)/2+_11.scrollTop());
|
||||
}else{
|
||||
var _12=_f.fixed?0:$(document).scrollTop();
|
||||
_f.top=Math.ceil(($(window)._outerHeight()-_10)/2+_12);
|
||||
}
|
||||
if(_e){
|
||||
_1(_d);
|
||||
}
|
||||
};
|
||||
function _13(_14){
|
||||
var _15=$.data(_14,"window");
|
||||
var _16=_15.options;
|
||||
var win=$(_14).panel($.extend({},_15.options,{border:false,doSize:true,closed:true,cls:"window "+(!_16.border?"window-thinborder window-noborder ":(_16.border=="thin"?"window-thinborder ":""))+(_16.cls||""),headerCls:"window-header "+(_16.headerCls||""),bodyCls:"window-body "+(_16.noheader?"window-body-noheader ":" ")+(_16.bodyCls||""),onBeforeDestroy:function(){
|
||||
if(_16.onBeforeDestroy.call(_14)==false){
|
||||
return false;
|
||||
}
|
||||
if(_15.shadow){
|
||||
_15.shadow.remove();
|
||||
}
|
||||
if(_15.mask){
|
||||
_15.mask.remove();
|
||||
}
|
||||
},onClose:function(){
|
||||
if(_15.shadow){
|
||||
_15.shadow.hide();
|
||||
}
|
||||
if(_15.mask){
|
||||
_15.mask.hide();
|
||||
}
|
||||
_16.onClose.call(_14);
|
||||
},onOpen:function(){
|
||||
if(_15.mask){
|
||||
_15.mask.css($.extend({display:"block",zIndex:$.fn.window.defaults.zIndex++},$.fn.window.getMaskSize(_14)));
|
||||
}
|
||||
if(_15.shadow){
|
||||
_15.shadow.css({display:"block",position:(_16.fixed?"fixed":"absolute"),zIndex:$.fn.window.defaults.zIndex++,left:_16.left,top:_16.top,width:_15.window._outerWidth(),height:_15.window._outerHeight()});
|
||||
}
|
||||
_15.window.css({position:(_16.fixed?"fixed":"absolute"),zIndex:$.fn.window.defaults.zIndex++});
|
||||
_16.onOpen.call(_14);
|
||||
},onResize:function(_17,_18){
|
||||
var _19=$(this).panel("options");
|
||||
$.extend(_16,{width:_19.width,height:_19.height,left:_19.left,top:_19.top});
|
||||
if(_15.shadow){
|
||||
_15.shadow.css({left:_16.left,top:_16.top,width:_15.window._outerWidth(),height:_15.window._outerHeight()});
|
||||
}
|
||||
_16.onResize.call(_14,_17,_18);
|
||||
},onMinimize:function(){
|
||||
if(_15.shadow){
|
||||
_15.shadow.hide();
|
||||
}
|
||||
if(_15.mask){
|
||||
_15.mask.hide();
|
||||
}
|
||||
_15.options.onMinimize.call(_14);
|
||||
},onBeforeCollapse:function(){
|
||||
if(_16.onBeforeCollapse.call(_14)==false){
|
||||
return false;
|
||||
}
|
||||
if(_15.shadow){
|
||||
_15.shadow.hide();
|
||||
}
|
||||
},onExpand:function(){
|
||||
if(_15.shadow){
|
||||
_15.shadow.show();
|
||||
}
|
||||
_16.onExpand.call(_14);
|
||||
}}));
|
||||
_15.window=win.panel("panel");
|
||||
if(_15.mask){
|
||||
_15.mask.remove();
|
||||
}
|
||||
if(_16.modal){
|
||||
_15.mask=$("<div class=\"window-mask\" style=\"display:none\"></div>").insertAfter(_15.window);
|
||||
}
|
||||
if(_15.shadow){
|
||||
_15.shadow.remove();
|
||||
}
|
||||
if(_16.shadow){
|
||||
_15.shadow=$("<div class=\"window-shadow\" style=\"display:none\"></div>").insertAfter(_15.window);
|
||||
}
|
||||
var _1a=_16.closed;
|
||||
if(_16.left==null){
|
||||
_5(_14);
|
||||
}
|
||||
if(_16.top==null){
|
||||
_c(_14);
|
||||
}
|
||||
_1(_14);
|
||||
if(!_1a){
|
||||
win.window("open");
|
||||
}
|
||||
};
|
||||
function _1b(_1c,top,_1d,_1e){
|
||||
var _1f=this;
|
||||
var _20=$.data(_1f,"window");
|
||||
var _21=_20.options;
|
||||
if(!_21.constrain){
|
||||
return {};
|
||||
}
|
||||
if($.isFunction(_21.constrain)){
|
||||
return _21.constrain.call(_1f,_1c,top,_1d,_1e);
|
||||
}
|
||||
var win=$(_1f).window("window");
|
||||
var _22=_21.inline?win.parent():$(window);
|
||||
var _23=_21.fixed?0:_22.scrollTop();
|
||||
if(_1c<0){
|
||||
_1c=0;
|
||||
}
|
||||
if(top<_23){
|
||||
top=_23;
|
||||
}
|
||||
if(_1c+_1d>_22.width()){
|
||||
if(_1d==win.outerWidth()){
|
||||
_1c=_22.width()-_1d;
|
||||
}else{
|
||||
_1d=_22.width()-_1c;
|
||||
}
|
||||
}
|
||||
if(top-_23+_1e>_22.height()){
|
||||
if(_1e==win.outerHeight()){
|
||||
top=_22.height()-_1e+_23;
|
||||
}else{
|
||||
_1e=_22.height()-top+_23;
|
||||
}
|
||||
}
|
||||
return {left:_1c,top:top,width:_1d,height:_1e};
|
||||
};
|
||||
function _24(_25){
|
||||
var _26=$.data(_25,"window");
|
||||
var _27=_26.options;
|
||||
_26.window.draggable({handle:">div.panel-header>div.panel-title",disabled:_26.options.draggable==false,onBeforeDrag:function(e){
|
||||
if(_26.mask){
|
||||
_26.mask.css("z-index",$.fn.window.defaults.zIndex++);
|
||||
}
|
||||
if(_26.shadow){
|
||||
_26.shadow.css("z-index",$.fn.window.defaults.zIndex++);
|
||||
}
|
||||
_26.window.css("z-index",$.fn.window.defaults.zIndex++);
|
||||
},onStartDrag:function(e){
|
||||
_28(e);
|
||||
},onDrag:function(e){
|
||||
_29(e);
|
||||
return false;
|
||||
},onStopDrag:function(e){
|
||||
_2a(e,"move");
|
||||
}});
|
||||
_26.window.resizable({disabled:_26.options.resizable==false,onStartResize:function(e){
|
||||
_28(e);
|
||||
},onResize:function(e){
|
||||
_29(e);
|
||||
return false;
|
||||
},onStopResize:function(e){
|
||||
_2a(e,"resize");
|
||||
}});
|
||||
function _28(e){
|
||||
_26.window.css("position",_27.fixed?"fixed":"absolute");
|
||||
if(_26.shadow){
|
||||
_26.shadow.css("position",_27.fixed?"fixed":"absolute");
|
||||
}
|
||||
if(_26.pmask){
|
||||
_26.pmask.remove();
|
||||
}
|
||||
_26.pmask=$("<div class=\"window-proxy-mask\"></div>").insertAfter(_26.window);
|
||||
_26.pmask.css({display:"none",position:(_27.fixed?"fixed":"absolute"),zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top,width:_26.window._outerWidth(),height:_26.window._outerHeight()});
|
||||
if(_26.proxy){
|
||||
_26.proxy.remove();
|
||||
}
|
||||
_26.proxy=$("<div class=\"window-proxy\"></div>").insertAfter(_26.window);
|
||||
_26.proxy.css({display:"none",position:(_27.fixed?"fixed":"absolute"),zIndex:$.fn.window.defaults.zIndex++,left:e.data.left,top:e.data.top});
|
||||
_26.proxy._outerWidth(e.data.width)._outerHeight(e.data.height);
|
||||
_26.proxy.hide();
|
||||
setTimeout(function(){
|
||||
if(_26.pmask){
|
||||
_26.pmask.show();
|
||||
}
|
||||
if(_26.proxy){
|
||||
_26.proxy.show();
|
||||
}
|
||||
},500);
|
||||
};
|
||||
function _29(e){
|
||||
$.extend(e.data,_1b.call(_25,e.data.left,e.data.top,e.data.width,e.data.height));
|
||||
_26.pmask.show();
|
||||
_26.proxy.css({display:"block",left:e.data.left,top:e.data.top});
|
||||
_26.proxy._outerWidth(e.data.width);
|
||||
_26.proxy._outerHeight(e.data.height);
|
||||
};
|
||||
function _2a(e,_2b){
|
||||
_26.window.css("position",_27.fixed?"fixed":"absolute");
|
||||
if(_26.shadow){
|
||||
_26.shadow.css("position",_27.fixed?"fixed":"absolute");
|
||||
}
|
||||
$.extend(e.data,_1b.call(_25,e.data.left,e.data.top,e.data.width+0.1,e.data.height+0.1));
|
||||
$(_25).window(_2b,e.data);
|
||||
_26.pmask.remove();
|
||||
_26.pmask=null;
|
||||
_26.proxy.remove();
|
||||
_26.proxy=null;
|
||||
};
|
||||
};
|
||||
$(function(){
|
||||
if(!$._positionFixed){
|
||||
$(window).resize(function(){
|
||||
$("body>div.window-mask:visible").css({width:"",height:""});
|
||||
setTimeout(function(){
|
||||
$("body>div.window-mask:visible").css($.fn.window.getMaskSize());
|
||||
},50);
|
||||
});
|
||||
}
|
||||
});
|
||||
$.fn.window=function(_2c,_2d){
|
||||
if(typeof _2c=="string"){
|
||||
var _2e=$.fn.window.methods[_2c];
|
||||
if(_2e){
|
||||
return _2e(this,_2d);
|
||||
}else{
|
||||
return this.panel(_2c,_2d);
|
||||
}
|
||||
}
|
||||
_2c=_2c||{};
|
||||
return this.each(function(){
|
||||
var _2f=$.data(this,"window");
|
||||
if(_2f){
|
||||
$.extend(_2f.options,_2c);
|
||||
}else{
|
||||
_2f=$.data(this,"window",{options:$.extend({},$.fn.window.defaults,$.fn.window.parseOptions(this),_2c)});
|
||||
if(!_2f.options.inline){
|
||||
document.body.appendChild(this);
|
||||
}
|
||||
}
|
||||
_13(this);
|
||||
_24(this);
|
||||
});
|
||||
};
|
||||
$.fn.window.methods={options:function(jq){
|
||||
var _30=jq.panel("options");
|
||||
var _31=$.data(jq[0],"window").options;
|
||||
return $.extend(_31,{closed:_30.closed,collapsed:_30.collapsed,minimized:_30.minimized,maximized:_30.maximized});
|
||||
},window:function(jq){
|
||||
return $.data(jq[0],"window").window;
|
||||
},move:function(jq,_32){
|
||||
return jq.each(function(){
|
||||
_1(this,_32);
|
||||
});
|
||||
},hcenter:function(jq){
|
||||
return jq.each(function(){
|
||||
_5(this,true);
|
||||
});
|
||||
},vcenter:function(jq){
|
||||
return jq.each(function(){
|
||||
_c(this,true);
|
||||
});
|
||||
},center:function(jq){
|
||||
return jq.each(function(){
|
||||
_5(this);
|
||||
_c(this);
|
||||
_1(this);
|
||||
});
|
||||
}};
|
||||
$.fn.window.getMaskSize=function(_33){
|
||||
var _34=$(_33).data("window");
|
||||
if(_34&&_34.options.inline){
|
||||
return {};
|
||||
}else{
|
||||
if($._positionFixed){
|
||||
return {position:"fixed"};
|
||||
}else{
|
||||
return {width:$(document).width(),height:$(document).height()};
|
||||
}
|
||||
}
|
||||
};
|
||||
$.fn.window.parseOptions=function(_35){
|
||||
return $.extend({},$.fn.panel.parseOptions(_35),$.parser.parseOptions(_35,[{draggable:"boolean",resizable:"boolean",shadow:"boolean",modal:"boolean",inline:"boolean"}]));
|
||||
};
|
||||
$.fn.window.defaults=$.extend({},$.fn.panel.defaults,{zIndex:9000,draggable:true,resizable:true,shadow:true,modal:false,border:true,inline:false,title:"New Window",collapsible:true,minimizable:true,maximizable:true,closable:true,closed:false,fixed:false,constrain:false});
|
||||
})(jQuery);
|
||||
|
||||
Reference in New Issue
Block a user