forked from cocoo/easyui-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.parser.js
107 lines (106 loc) · 2.22 KB
/
jquery.parser.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/**
* EasyUi Bootstrap 1.3
*
* Licensed under the GPL terms
* To use it on other terms please contact us
*
* Copyright(c) 2009-2012 stworthy [ stworthy@gmail.com ]
*
*/
(function($){
$.parser={auto:true,onComplete:function(_1){
},plugins:["draggable","droppable","resizable","pagination","linkbutton","menu","menubutton","splitbutton","progressbar","tree","combobox","combotree","combogrid","numberbox","validatebox","searchbox","numberspinner","timespinner","calendar","datebox","datetimebox","slider","layout","panel","datagrid","propertygrid","treegrid","tabs","accordion","window","dialog"],parse:function(_2){
var aa=[];
for(var i=0;i<$.parser.plugins.length;i++){
var _3=$.parser.plugins[i];
var r=$(".easyui-"+_3,_2);
if(r.length){
if(r[_3]){
r[_3]();
}else{
aa.push({name:_3,jq:r});
}
}
}
if(aa.length&&window.easyloader){
var _4=[];
for(var i=0;i<aa.length;i++){
_4.push(aa[i].name);
}
easyloader.load(_4,function(){
for(var i=0;i<aa.length;i++){
var _5=aa[i].name;
var jq=aa[i].jq;
jq[_5]();
}
$.parser.onComplete.call($.parser,_2);
});
}else{
$.parser.onComplete.call($.parser,_2);
}
},parseOptions:function(_6,_7){
var t=$(_6);
var _8={};
var s=$.trim(t.attr("data-options"));
if(s){
var _9=s.substring(0,1);
var _a=s.substring(s.length-1,1);
if(_9!="{"){
s="{"+s;
}
if(_a!="}"){
s=s+"}";
}
_8=(new Function("return "+s))();
}
if(_7){
var _b={};
for(var i=0;i<_7.length;i++){
var pp=_7[i];
if(typeof pp=="string"){
if(pp=="width"||pp=="height"||pp=="left"||pp=="top"){
_b[pp]=parseInt(_6.style[pp])||undefined;
}else{
_b[pp]=t.attr(pp);
}
}else{
for(var _c in pp){
var _d=pp[_c];
if(_d=="boolean"){
_b[_c]=t.attr(_c)?(t.attr(_c)=="true"):undefined;
}else{
if(_d=="number"){
_b[_c]=t.attr(_c)=="0"?0:parseFloat(t.attr(_c))||undefined;
}
}
}
}
}
$.extend(_8,_b);
}
return _8;
}};
$(function(){
if(!window.easyloader&&$.parser.auto){
$.parser.parse();
}
});
$.fn._outerWidth=function(_e){
return this.each(function(){
if(!$.boxModel&&$.browser.msie){
$(this).width(_e);
}else{
$(this).width(_e-($(this).outerWidth()-$(this).width()));
}
});
};
$.fn._outerHeight=function(_f){
return this.each(function(){
if(!$.boxModel&&$.browser.msie){
$(this).height(_f);
}else{
$(this).height(_f-($(this).outerHeight()-$(this).height()));
}
});
};
})(jQuery);