easyloader.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /**
  2. * EasyUI for jQuery 1.9.4
  3. *
  4. * Copyright (c) 2009-2020 www.jeasyui.com. All rights reserved.
  5. *
  6. * Licensed under the freeware license: http://www.jeasyui.com/license_freeware.php
  7. * To use it on other terms please contact us: info@jeasyui.com
  8. *
  9. */
  10. (function(){
  11. var _1={draggable:{js:"jquery.draggable.js"},droppable:{js:"jquery.droppable.js"},resizable:{js:"jquery.resizable.js"},linkbutton:{js:"jquery.linkbutton.js",css:"linkbutton.css"},progressbar:{js:"jquery.progressbar.js",css:"progressbar.css"},tooltip:{js:"jquery.tooltip.js",css:"tooltip.css"},pagination:{js:"jquery.pagination.js",css:"pagination.css",dependencies:["linkbutton"]},datagrid:{js:"jquery.datagrid.js",css:"datagrid.css",dependencies:["panel","resizable","linkbutton","pagination"]},treegrid:{js:"jquery.treegrid.js",css:"tree.css",dependencies:["datagrid"]},propertygrid:{js:"jquery.propertygrid.js",css:"propertygrid.css",dependencies:["datagrid"]},datalist:{js:"jquery.datalist.js",css:"datalist.css",dependencies:["datagrid"]},panel:{js:"jquery.panel.js",css:"panel.css"},window:{js:"jquery.window.js",css:"window.css",dependencies:["resizable","draggable","panel"]},dialog:{js:"jquery.dialog.js",css:"dialog.css",dependencies:["linkbutton","window"]},messager:{js:"jquery.messager.js",css:"messager.css",dependencies:["linkbutton","dialog","progressbar"]},layout:{js:"jquery.layout.js",css:"layout.css",dependencies:["resizable","panel"]},form:{js:"jquery.form.js"},menu:{js:"jquery.menu.js",css:"menu.css"},tabs:{js:"jquery.tabs.js",css:"tabs.css",dependencies:["panel","linkbutton"]},menubutton:{js:"jquery.menubutton.js",css:"menubutton.css",dependencies:["linkbutton","menu"]},splitbutton:{js:"jquery.splitbutton.js",css:"splitbutton.css",dependencies:["menubutton"]},switchbutton:{js:"jquery.switchbutton.js",css:"switchbutton.css"},accordion:{js:"jquery.accordion.js",css:"accordion.css",dependencies:["panel"]},calendar:{js:"jquery.calendar.js",css:"calendar.css"},textbox:{js:"jquery.textbox.js",css:"textbox.css",dependencies:["validatebox","linkbutton"]},passwordbox:{js:"jquery.passwordbox.js",css:"passwordbox.css",dependencies:["textbox"]},filebox:{js:"jquery.filebox.js",css:"filebox.css",dependencies:["textbox"]},radiobutton:{js:"jquery.radiobutton.js",css:"radiobutton.css"},checkbox:{js:"jquery.checkbox.js",css:"checkbox.css"},sidemenu:{js:"jquery.sidemenu.js",css:"sidemenu.css",dependencies:["accordion","tree","tooltip"]},combo:{js:"jquery.combo.js",css:"combo.css",dependencies:["panel","textbox"]},combobox:{js:"jquery.combobox.js",css:"combobox.css",dependencies:["combo"]},combotree:{js:"jquery.combotree.js",dependencies:["combo","tree"]},combogrid:{js:"jquery.combogrid.js",dependencies:["combo","datagrid"]},combotreegrid:{js:"jquery.combotreegrid.js",dependencies:["combo","treegrid"]},tagbox:{js:"jquery.tagbox.js",dependencies:["combobox"]},validatebox:{js:"jquery.validatebox.js",css:"validatebox.css",dependencies:["tooltip"]},numberbox:{js:"jquery.numberbox.js",dependencies:["textbox"]},searchbox:{js:"jquery.searchbox.js",css:"searchbox.css",dependencies:["menubutton","textbox"]},spinner:{js:"jquery.spinner.js",css:"spinner.css",dependencies:["textbox"]},numberspinner:{js:"jquery.numberspinner.js",dependencies:["spinner","numberbox"]},timespinner:{js:"jquery.timespinner.js",dependencies:["spinner"]},timepicker:{js:"jquery.timepicker.js",css:"timepicker.css",dependencies:["combo"]},tree:{js:"jquery.tree.js",css:"tree.css",dependencies:["draggable","droppable"]},datebox:{js:"jquery.datebox.js",css:"datebox.css",dependencies:["calendar","combo"]},datetimebox:{js:"jquery.datetimebox.js",dependencies:["datebox","timespinner"]},slider:{js:"jquery.slider.js",dependencies:["draggable"]},parser:{js:"jquery.parser.js",css:"flex.css"},mobile:{js:"jquery.mobile.js"}};
  12. var _2={"af":"easyui-lang-af.js","ar":"easyui-lang-ar.js","bg":"easyui-lang-bg.js","ca":"easyui-lang-ca.js","cs":"easyui-lang-cs.js","cz":"easyui-lang-cz.js","da":"easyui-lang-da.js","de":"easyui-lang-de.js","el":"easyui-lang-el.js","en":"easyui-lang-en.js","es":"easyui-lang-es.js","fr":"easyui-lang-fr.js","it":"easyui-lang-it.js","jp":"easyui-lang-jp.js","nl":"easyui-lang-nl.js","pl":"easyui-lang-pl.js","pt_BR":"easyui-lang-pt_BR.js","ru":"easyui-lang-ru.js","sv_SE":"easyui-lang-sv_SE.js","tr":"easyui-lang-tr.js","zh_CN":"easyui-lang-zh_CN.js","zh_TW":"easyui-lang-zh_TW.js"};
  13. var _3={};
  14. function _4(_5,_6){
  15. var _7=false;
  16. var _8=document.createElement("script");
  17. _8.type="text/javascript";
  18. _8.language="javascript";
  19. _8.src=_5;
  20. _8.onload=_8.onreadystatechange=function(){
  21. if(!_7&&(!_8.readyState||_8.readyState=="loaded"||_8.readyState=="complete")){
  22. _7=true;
  23. _8.onload=_8.onreadystatechange=null;
  24. if(_6){
  25. _6.call(_8);
  26. }
  27. }
  28. };
  29. document.getElementsByTagName("head")[0].appendChild(_8);
  30. };
  31. function _9(_a,_b){
  32. _4(_a,function(){
  33. document.getElementsByTagName("head")[0].removeChild(this);
  34. if(_b){
  35. _b();
  36. }
  37. });
  38. };
  39. function _c(_d,_e){
  40. var _f=document.createElement("link");
  41. _f.rel="stylesheet";
  42. _f.type="text/css";
  43. _f.media="screen";
  44. _f.href=_d;
  45. document.getElementsByTagName("head")[0].appendChild(_f);
  46. if(_e){
  47. _e.call(_f);
  48. }
  49. };
  50. function _10(_11,_12){
  51. _3[_11]="loading";
  52. var _13=_1[_11];
  53. var _14="loading";
  54. var _15=(easyloader.css&&_13["css"])?"loading":"loaded";
  55. if(easyloader.css&&_13["css"]){
  56. if(/^http/i.test(_13["css"])){
  57. var url=_13["css"];
  58. }else{
  59. var url=easyloader.base+"themes/"+easyloader.theme+"/"+_13["css"];
  60. }
  61. _c(url,function(){
  62. _15="loaded";
  63. if(_14=="loaded"&&_15=="loaded"){
  64. _16();
  65. }
  66. });
  67. }
  68. if(/^http/i.test(_13["js"])){
  69. var url=_13["js"];
  70. }else{
  71. var url=easyloader.base+"plugins/"+_13["js"];
  72. }
  73. _4(url,function(){
  74. _14="loaded";
  75. if(_14=="loaded"&&_15=="loaded"){
  76. _16();
  77. }
  78. });
  79. function _16(){
  80. _3[_11]="loaded";
  81. easyloader.onProgress(_11);
  82. if(_12){
  83. _12();
  84. }
  85. };
  86. };
  87. function _17(_18,_19){
  88. var mm=[];
  89. var _1a=false;
  90. if(typeof _18=="string"){
  91. add(_18);
  92. }else{
  93. for(var i=0;i<_18.length;i++){
  94. add(_18[i]);
  95. }
  96. }
  97. mm.unshift("parser");
  98. function add(_1b){
  99. if(!_1[_1b]){
  100. return;
  101. }
  102. var d=_1[_1b]["dependencies"];
  103. if(d){
  104. for(var i=0;i<d.length;i++){
  105. add(d[i]);
  106. }
  107. }
  108. mm.push(_1b);
  109. };
  110. function _1c(){
  111. if(_19){
  112. if(window.jQuery){
  113. window.jQuery.parser.parseVars();
  114. }
  115. _19();
  116. }
  117. easyloader.onLoad(_18);
  118. };
  119. var _1d=0;
  120. function _1e(){
  121. if(mm.length){
  122. var m=mm[0];
  123. if(!_3[m]){
  124. _1a=true;
  125. _10(m,function(){
  126. mm.shift();
  127. _1e();
  128. });
  129. }else{
  130. if(_3[m]=="loaded"){
  131. mm.shift();
  132. _1e();
  133. }else{
  134. if(_1d<easyloader.timeout){
  135. _1d+=10;
  136. setTimeout(arguments.callee,10);
  137. }
  138. }
  139. }
  140. }else{
  141. if(easyloader.locale&&_1a==true&&_2[easyloader.locale]){
  142. var url=easyloader.base+"locale/"+_2[easyloader.locale];
  143. _9(url,function(){
  144. _1c();
  145. });
  146. }else{
  147. _1c();
  148. }
  149. }
  150. };
  151. _1e();
  152. };
  153. easyloader={modules:_1,locales:_2,base:".",theme:"default",css:true,locale:null,timeout:2000,load:function(_1f,_20){
  154. if(/\.css$/i.test(_1f)){
  155. if(/^http/i.test(_1f)){
  156. _c(_1f,_20);
  157. }else{
  158. _c(easyloader.base+_1f,_20);
  159. }
  160. }else{
  161. if(/\.js$/i.test(_1f)){
  162. if(/^http/i.test(_1f)){
  163. _4(_1f,_20);
  164. }else{
  165. _4(easyloader.base+_1f,_20);
  166. }
  167. }else{
  168. _17(_1f,_20);
  169. }
  170. }
  171. },onProgress:function(_21){
  172. },onLoad:function(_22){
  173. }};
  174. var _23=document.getElementsByTagName("script");
  175. for(var i=0;i<_23.length;i++){
  176. var src=_23[i].src;
  177. if(!src){
  178. continue;
  179. }
  180. var m=src.match(/easyloader\.js(\W|$)/i);
  181. if(m){
  182. easyloader.base=src.substring(0,m.index);
  183. }
  184. }
  185. window.using=easyloader.load;
  186. if(window.jQuery){
  187. jQuery(function(){
  188. easyloader.load("parser",function(){
  189. jQuery.parser.parse();
  190. });
  191. });
  192. }
  193. })();