e701da349b3a47a732fd34f6b1261d69f219b94b.svn-base 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. /**
  2. * jQuery EasyUI 1.3.6
  3. *
  4. * Copyright (c) 2009-2014 www.jeasyui.com. All rights reserved.
  5. *
  6. * Licensed under the GPL license: http://www.gnu.org/licenses/gpl.txt
  7. * To use it on other terms please contact us at info@jeasyui.com
  8. *
  9. */
  10. (function($){
  11. $.parser={auto:true,onComplete:function(_1){
  12. },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){
  13. var aa=[];
  14. for(var i=0;i<$.parser.plugins.length;i++){
  15. var _3=$.parser.plugins[i];
  16. var r=$(".easyui-"+_3,_2);
  17. if(r.length){
  18. if(r[_3]){
  19. r[_3]();
  20. }else{
  21. aa.push({name:_3,jq:r});
  22. }
  23. }
  24. }
  25. if(aa.length&&window.easyloader){
  26. var _4=[];
  27. for(var i=0;i<aa.length;i++){
  28. _4.push(aa[i].name);
  29. }
  30. easyloader.load(_4,function(){
  31. for(var i=0;i<aa.length;i++){
  32. var _5=aa[i].name;
  33. var jq=aa[i].jq;
  34. jq[_5]();
  35. }
  36. $.parser.onComplete.call($.parser,_2);
  37. });
  38. }else{
  39. $.parser.onComplete.call($.parser,_2);
  40. }
  41. },parseOptions:function(_6,_7){
  42. var t=$(_6);
  43. var _8={};
  44. var s=$.trim(t.attr("data-options"));
  45. if(s){
  46. if(s.substring(0,1)!="{"){
  47. s="{"+s+"}";
  48. }
  49. _8=(new Function("return "+s))();
  50. }
  51. if(_7){
  52. var _9={};
  53. for(var i=0;i<_7.length;i++){
  54. var pp=_7[i];
  55. if(typeof pp=="string"){
  56. if(pp=="width"||pp=="height"||pp=="left"||pp=="top"){
  57. _9[pp]=parseInt(_6.style[pp])||undefined;
  58. }else{
  59. _9[pp]=t.attr(pp);
  60. }
  61. }else{
  62. for(var _a in pp){
  63. var _b=pp[_a];
  64. if(_b=="boolean"){
  65. _9[_a]=t.attr(_a)?(t.attr(_a)=="true"):undefined;
  66. }else{
  67. if(_b=="number"){
  68. _9[_a]=t.attr(_a)=="0"?0:parseFloat(t.attr(_a))||undefined;
  69. }
  70. }
  71. }
  72. }
  73. }
  74. $.extend(_8,_9);
  75. }
  76. return _8;
  77. }};
  78. $(function(){
  79. var d=$("<div style=\"position:absolute;top:-1000px;width:100px;height:100px;padding:5px\"></div>").appendTo("body");
  80. d.width(100);
  81. $._boxModel=parseInt(d.width())==100;
  82. d.remove();
  83. if(!window.easyloader&&$.parser.auto){
  84. $.parser.parse();
  85. }
  86. });
  87. $.fn._outerWidth=function(_c){
  88. if(_c==undefined){
  89. if(this[0]==window){
  90. return this.width()||document.body.clientWidth;
  91. }
  92. return this.outerWidth()||0;
  93. }
  94. return this.each(function(){
  95. if($._boxModel){
  96. $(this).width(_c-($(this).outerWidth()-$(this).width()));
  97. }else{
  98. $(this).width(_c);
  99. }
  100. });
  101. };
  102. $.fn._outerHeight=function(_d){
  103. if(_d==undefined){
  104. if(this[0]==window){
  105. return this.height()||document.body.clientHeight;
  106. }
  107. return this.outerHeight()||0;
  108. }
  109. return this.each(function(){
  110. if($._boxModel){
  111. $(this).height(_d-($(this).outerHeight()-$(this).height()));
  112. }else{
  113. $(this).height(_d);
  114. }
  115. });
  116. };
  117. $.fn._scrollLeft=function(_e){
  118. if(_e==undefined){
  119. return this.scrollLeft();
  120. }else{
  121. return this.each(function(){
  122. $(this).scrollLeft(_e);
  123. });
  124. }
  125. };
  126. $.fn._propAttr=$.fn.prop||$.fn.attr;
  127. $.fn._fit=function(_f){
  128. _f=_f==undefined?true:_f;
  129. var t=this[0];
  130. var p=(t.tagName=="BODY"?t:this.parent()[0]);
  131. var _10=p.fcount||0;
  132. if(_f){
  133. if(!t.fitted){
  134. t.fitted=true;
  135. p.fcount=_10+1;
  136. $(p).addClass("panel-noscroll");
  137. if(p.tagName=="BODY"){
  138. $("html").addClass("panel-fit");
  139. }
  140. }
  141. }else{
  142. if(t.fitted){
  143. t.fitted=false;
  144. p.fcount=_10-1;
  145. if(p.fcount==0){
  146. $(p).removeClass("panel-noscroll");
  147. if(p.tagName=="BODY"){
  148. $("html").removeClass("panel-fit");
  149. }
  150. }
  151. }
  152. }
  153. return {width:$(p).width(),height:$(p).height()};
  154. };
  155. })(jQuery);
  156. (function($){
  157. var _11=null;
  158. var _12=null;
  159. var _13=false;
  160. function _14(e){
  161. if(e.touches.length!=1){
  162. return;
  163. }
  164. if(!_13){
  165. _13=true;
  166. dblClickTimer=setTimeout(function(){
  167. _13=false;
  168. },500);
  169. }else{
  170. clearTimeout(dblClickTimer);
  171. _13=false;
  172. _15(e,"dblclick");
  173. }
  174. _11=setTimeout(function(){
  175. _15(e,"contextmenu",3);
  176. },1000);
  177. _15(e,"mousedown");
  178. if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
  179. e.preventDefault();
  180. }
  181. };
  182. function _16(e){
  183. if(e.touches.length!=1){
  184. return;
  185. }
  186. if(_11){
  187. clearTimeout(_11);
  188. }
  189. _15(e,"mousemove");
  190. if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
  191. e.preventDefault();
  192. }
  193. };
  194. function _17(e){
  195. if(_11){
  196. clearTimeout(_11);
  197. }
  198. _15(e,"mouseup");
  199. if($.fn.draggable.isDragging||$.fn.resizable.isResizing){
  200. e.preventDefault();
  201. }
  202. };
  203. function _15(e,_18,_19){
  204. var _1a=new $.Event(_18);
  205. _1a.pageX=e.changedTouches[0].pageX;
  206. _1a.pageY=e.changedTouches[0].pageY;
  207. _1a.which=_19||1;
  208. $(e.target).trigger(_1a);
  209. };
  210. if(document.addEventListener){
  211. document.addEventListener("touchstart",_14,true);
  212. document.addEventListener("touchmove",_16,true);
  213. document.addEventListener("touchend",_17,true);
  214. }
  215. })(jQuery);