123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216 |
- /**
- * jQuery EasyUI 1.3.6
- *
- * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved.
- *
- * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt
- * To use it on other terms please contact us at info@jeasyui.com
- *
- */
- (function($){
- $.parser={auto:true,onComplete:function(_1){
- },plugins:["draggable","droppable","resizable","pagination","tooltip","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){
- if(s.substring(0,1)!="{"){
- s="{"+s+"}";
- }
- _8=(new Function("return "+s))();
- }
- if(_7){
- var _9={};
- 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"){
- _9[pp]=parseInt(_6.style[pp])||undefined;
- }else{
- _9[pp]=t.attr(pp);
- }
- }else{
- for(var _a in pp){
- var _b=pp[_a];
- if(_b=="boolean"){
- _9[_a]=t.attr(_a)?(t.attr(_a)=="true"):undefined;
- }else{
- if(_b=="number"){
- _9[_a]=t.attr(_a)=="0"?0:parseFloat(t.attr(_a))||undefined;
- }
- }
- }
- }
- }
- $.extend(_8,_9);
- }
- return _8;
- }};
- $(function(){
- var d=$("<div style=\"position:absolute;top:-1000px;width:100px;height:100px;padding:5px\"></div>").appendTo("body");
- d.width(100);
- $._boxModel=parseInt(d.width())==100;
- d.remove();
- if(!window.easyloader&&$.parser.auto){
- $.parser.parse();
- }
- });
- $.fn._outerWidth=function(_c){
- if(_c==undefined){
- if(this[0]==window){
- return this.width()||document.body.clientWidth;
- }
- return this.outerWidth()||0;
- }
- return this.each(function(){
- if($._boxModel){
- $(this).width(_c-($(this).outerWidth()-$(this).width()));
- }else{
- $(this).width(_c);
- }
- });
- };
- $.fn._outerHeight=function(_d){
- if(_d==undefined){
- if(this[0]==window){
- return this.height()||document.body.clientHeight;
- }
- return this.outerHeight()||0;
- }
- return this.each(function(){
- if($._boxModel){
- $(this).height(_d-($(this).outerHeight()-$(this).height()));
- }else{
- $(this).height(_d);
- }
- });
- };
- $.fn._scrollLeft=function(_e){
- if(_e==undefined){
- return this.scrollLeft();
- }else{
- return this.each(function(){
- $(this).scrollLeft(_e);
- });
- }
- };
- $.fn._propAttr=$.fn.prop||$.fn.attr;
- $.fn._fit=function(_f){
- _f=_f==undefined?true:_f;
- var t=this[0];
- var p=(t.tagName=="BODY"?t:this.parent()[0]);
- var _10=p.fcount||0;
- if(_f){
- if(!t.fitted){
- t.fitted=true;
- p.fcount=_10+1;
- $(p).addClass("panel-noscroll");
- if(p.tagName=="BODY"){
- $("html").addClass("panel-fit");
- }
- }
- }else{
- if(t.fitted){
- t.fitted=false;
- p.fcount=_10-1;
- if(p.fcount==0){
- $(p).removeClass("panel-noscroll");
- if(p.tagName=="BODY"){
- $("html").removeClass("panel-fit");
- }
- }
- }
- }
- return {width:$(p).width(),height:$(p).height()};
- };
- })(jQuery);
- (function($){
- var _11=null;
- var _12=null;
- var _13=false;
- function _14(e){
- if(e.touches.length!=1){
- return;
- }
- if(!_13){
- _13=true;
- dblClickTimer=setTimeout(function(){
- _13=false;
- },500);
- }else{
- clearTimeout(dblClickTimer);
- _13=false;
- _15(e,"dblclick");
- }
- _11=setTimeout(function(){
- _15(e,"contextmenu",3);
- },1000);
- _15(e,"mousedown");
- if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
- e.preventDefault();
- }
- };
- function _16(e){
- if(e.touches.length!=1){
- return;
- }
- if(_11){
- clearTimeout(_11);
- }
- _15(e,"mousemove");
- if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
- e.preventDefault();
- }
- };
- function _17(e){
- if(_11){
- clearTimeout(_11);
- }
- _15(e,"mouseup");
- if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
- e.preventDefault();
- }
- };
- function _15(e,_18,_19){
- var _1a=new $.Event(_18);
- _1a.pageX=e.changedTouches[0].pageX;
- _1a.pageY=e.changedTouches[0].pageY;
- _1a.which=_19||1;
- $(e.target).trigger(_1a);
- };
- if(document.addEventListener){
- document.addEventListener("touchstart",_14,true);
- document.addEventListener("touchmove",_16,true);
- document.addEventListener("touchend",_17,true);
- }
- })(jQuery);
|