root / trunk / web / dojo / dojox / jq.js @ 13
History | View | Annotate | Download (24.1 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.jq"]){ |
||
9 | dojo._hasResource["dojox.jq"]=true; |
||
10 | dojo.provide("dojox.jq");
|
||
11 | dojo.require("dojo.NodeList-traverse");
|
||
12 | dojo.require("dojo.NodeList-manipulate");
|
||
13 | dojo.require("dojo.io.script");
|
||
14 | (function(){
|
||
15 | dojo.config.ioPublish=true;
|
||
16 | var _1="|img|meta|hr|br|input|"; |
||
17 | function _2(_3,_4){ |
||
18 | _3+="";
|
||
19 | _3=_3.replace(/<\s*(\w+)([^\/\>]*)\/\s*>/g,function(_5,_6,_7){ |
||
20 | if(_1.indexOf("|"+_6+"|")==-1){ |
||
21 | return "<"+_6+_7+"></"+_6+">"; |
||
22 | }else{
|
||
23 | return _5;
|
||
24 | } |
||
25 | }); |
||
26 | return dojo._toDom(_3,_4);
|
||
27 | }; |
||
28 | function _8(_9){ |
||
29 | var _a=_9.indexOf("-"); |
||
30 | if(_a!=-1){ |
||
31 | if(_a==0){ |
||
32 | _9=_9.substring(1);
|
||
33 | } |
||
34 | _9=_9.replace(/-(\w)/g,function(_b,_c){ |
||
35 | return _c.toUpperCase();
|
||
36 | }); |
||
37 | } |
||
38 | return _9;
|
||
39 | }; |
||
40 | var _d=dojo.global.$; |
||
41 | var _e=dojo.global.jQuery;
|
||
42 | var $=dojo.global.$=dojo.global.jQuery=function(){ |
||
43 | var _f=arguments[0]; |
||
44 | if(!_f){
|
||
45 | return $._wrap([],null,$); |
||
46 | }else{
|
||
47 | if(dojo.isString(_f)){
|
||
48 | if(_f.charAt(0)=="<"){ |
||
49 | _f=_2(_f); |
||
50 | if(_f.nodeType==11){ |
||
51 | _f=_f.childNodes; |
||
52 | }else{
|
||
53 | return $._wrap([_f],null,$); |
||
54 | } |
||
55 | }else{
|
||
56 | var _10=dojo._NodeListCtor;
|
||
57 | dojo._NodeListCtor=$;
|
||
58 | var _11=arguments[1]; |
||
59 | if(_11&&_11._is$){ |
||
60 | _11=_11[0];
|
||
61 | }else{
|
||
62 | if(dojo.isString(_11)){
|
||
63 | _11=dojo.query(_11)[0];
|
||
64 | } |
||
65 | } |
||
66 | var nl=dojo.query.call(this,_f,_11); |
||
67 | dojo._NodeListCtor=_10; |
||
68 | return nl;
|
||
69 | } |
||
70 | }else{
|
||
71 | if(dojo.isFunction(_f)){
|
||
72 | $.ready(_f);
|
||
73 | return $; |
||
74 | }else{
|
||
75 | if(_f==document||_f==window){
|
||
76 | return $._wrap([_f],null,$); |
||
77 | }else{
|
||
78 | if(dojo.isArray(_f)){
|
||
79 | var ary=[];
|
||
80 | for(var i=0;i<_f.length;i++){ |
||
81 | if(dojo.indexOf(ary,_f[i])==-1){ |
||
82 | ary.push(_f[i]); |
||
83 | } |
||
84 | } |
||
85 | return $._wrap(_f,null,$); |
||
86 | }else{
|
||
87 | if("nodeType" in _f){ |
||
88 | return $._wrap([_f],null,$); |
||
89 | } |
||
90 | } |
||
91 | } |
||
92 | } |
||
93 | } |
||
94 | } |
||
95 | return $._wrap(dojo._toArray(_f),null,$); |
||
96 | }; |
||
97 | var _12=dojo.NodeList.prototype;
|
||
98 | var f=$.fn=$.prototype=dojo.delegate(_12); |
||
99 | $._wrap=dojo.NodeList._wrap;
|
||
100 | var _13=/^H\d/i; |
||
101 | var _14=dojo.query.pseudos;
|
||
102 | dojo.mixin(_14,{has:function(_15,_16){ |
||
103 | return function(_17){ |
||
104 | return $(_16,_17).length; |
||
105 | }; |
||
106 | },visible:function(_18,_19){ |
||
107 | return function(_1a){ |
||
108 | return dojo.style(_1a,"visible")!="hidden"&&dojo.style(_1a,"display")!="none"; |
||
109 | }; |
||
110 | },hidden:function(_1b,_1c){ |
||
111 | return function(_1d){ |
||
112 | return _1d.type=="hidden"||dojo.style(_1d,"visible")=="hidden"||dojo.style(_1d,"display")=="none"; |
||
113 | }; |
||
114 | },selected:function(_1e,_1f){ |
||
115 | return function(_20){ |
||
116 | return _20.selected;
|
||
117 | }; |
||
118 | },checked:function(_21,_22){ |
||
119 | return function(_23){ |
||
120 | return _23.nodeName.toUpperCase()=="INPUT"&&_23.checked; |
||
121 | }; |
||
122 | },disabled:function(_24,_25){ |
||
123 | return function(_26){ |
||
124 | return _26.getAttribute("disabled"); |
||
125 | }; |
||
126 | },enabled:function(_27,_28){ |
||
127 | return function(_29){ |
||
128 | return !_29.getAttribute("disabled"); |
||
129 | }; |
||
130 | },input:function(_2a,_2b){ |
||
131 | return function(_2c){ |
||
132 | var n=_2c.nodeName.toUpperCase();
|
||
133 | return n=="INPUT"||n=="SELECT"||n=="TEXTAREA"||n=="BUTTON"; |
||
134 | }; |
||
135 | },button:function(_2d,_2e){ |
||
136 | return function(_2f){ |
||
137 | return (_2f.nodeName.toUpperCase()=="INPUT"&&_2f.type=="button")||_2f.nodeName.toUpperCase()=="BUTTON"; |
||
138 | }; |
||
139 | },header:function(_30,_31){ |
||
140 | return function(_32){ |
||
141 | return _32.nodeName.match(_13);
|
||
142 | }; |
||
143 | }}); |
||
144 | var _33={};
|
||
145 | dojo.forEach(["text","password","radio","checkbox","submit","image","reset","file"],function(_34){ |
||
146 | _33[_34]=function(_35,_36){
|
||
147 | return function(_37){ |
||
148 | return _37.nodeName.toUpperCase()=="INPUT"&&_37.type==_34; |
||
149 | }; |
||
150 | }; |
||
151 | }); |
||
152 | dojo.mixin(_14,_33); |
||
153 | $.browser={mozilla:dojo.isMoz,msie:dojo.isIE,opera:dojo.isOpera,safari:dojo.isSafari}; |
||
154 | $.browser.version=dojo.isIE||dojo.isMoz||dojo.isOpera||dojo.isSafari||dojo.isWebKit;
|
||
155 | $.ready=$.fn.ready=function(_38){ |
||
156 | dojo.addOnLoad(dojo.hitch(null,_38,$)); |
||
157 | return this; |
||
158 | }; |
||
159 | f._is$=true; |
||
160 | f.size=function(){ |
||
161 | return this.length; |
||
162 | }; |
||
163 | $.prop=function(_39,_3a){ |
||
164 | if(dojo.isFunction(_3a)){
|
||
165 | return _3a.call(_39);
|
||
166 | }else{
|
||
167 | return _3a;
|
||
168 | } |
||
169 | }; |
||
170 | $.className={add:dojo.addClass,remove:dojo.removeClass,has:dojo.hasClass}; |
||
171 | $.makeArray=function(_3b){ |
||
172 | if(typeof _3b=="undefined"){ |
||
173 | return [];
|
||
174 | }else{
|
||
175 | if(_3b.length&&!dojo.isString(_3b)&&!("location" in _3b)){ |
||
176 | return dojo._toArray(_3b);
|
||
177 | }else{
|
||
178 | return [_3b];
|
||
179 | } |
||
180 | } |
||
181 | }; |
||
182 | $.merge=function(_3c,_3d){ |
||
183 | var _3e=[_3c.length,0]; |
||
184 | _3e=_3e.concat(_3d); |
||
185 | _3c.splice.apply(_3c,_3e); |
||
186 | return _3c;
|
||
187 | }; |
||
188 | $.each=function(_3f,cb){ |
||
189 | if(dojo.isArrayLike(_3f)){
|
||
190 | for(var i=0;i<_3f.length;i++){ |
||
191 | if(cb.call(_3f[i],i,_3f[i])===false){ |
||
192 | break;
|
||
193 | } |
||
194 | } |
||
195 | }else{
|
||
196 | if(dojo.isObject(_3f)){
|
||
197 | for(var _40 in _3f){ |
||
198 | if(cb.call(_3f[_40],_40,_3f[_40])===false){ |
||
199 | break;
|
||
200 | } |
||
201 | } |
||
202 | } |
||
203 | } |
||
204 | return this; |
||
205 | }; |
||
206 | f.each=function(cb){ |
||
207 | return $.each.call(this,this,cb); |
||
208 | }; |
||
209 | f.eq=function(){ |
||
210 | var nl=$(); |
||
211 | dojo.forEach(arguments,function(i){ |
||
212 | if(this[i]){ |
||
213 | nl.push(this[i]);
|
||
214 | } |
||
215 | },this);
|
||
216 | return nl;
|
||
217 | }; |
||
218 | f.get=function(_41){ |
||
219 | if(_41||_41==0){ |
||
220 | return this[_41]; |
||
221 | } |
||
222 | return this; |
||
223 | }; |
||
224 | f.index=function(arg){ |
||
225 | if(arg._is$){ |
||
226 | arg=arg[0];
|
||
227 | } |
||
228 | return this.indexOf(arg); |
||
229 | }; |
||
230 | var _42=[];
|
||
231 | var _43=0; |
||
232 | var _44=dojo._scopeName+"DataId"; |
||
233 | var _45=function(_46){ |
||
234 | var id=_46.getAttribute(_44);
|
||
235 | if(!id){
|
||
236 | id=_43++; |
||
237 | _46.setAttribute(_44,id); |
||
238 | } |
||
239 | }; |
||
240 | var _47=function(_48){ |
||
241 | var _49={};
|
||
242 | if(_48.nodeType==1){ |
||
243 | var id=_45(_48);
|
||
244 | _49=_42[id]; |
||
245 | if(!_49){
|
||
246 | _49=_42[id]={}; |
||
247 | } |
||
248 | } |
||
249 | return _49;
|
||
250 | }; |
||
251 | $.data=function(_4a,_4b,_4c){ |
||
252 | var _4d=null; |
||
253 | if(_4b=="events"){ |
||
254 | _4d=_4e[_4a.getAttribute(_4f)]; |
||
255 | var _50=true; |
||
256 | if(_4d){
|
||
257 | for(var _51 in _4d){ |
||
258 | _50=false;
|
||
259 | break;
|
||
260 | } |
||
261 | } |
||
262 | return _50?null:_4d; |
||
263 | } |
||
264 | var _52=_47(_4a);
|
||
265 | if(typeof _4c!="undefined"){ |
||
266 | _52[_4b]=_4c; |
||
267 | }else{
|
||
268 | _4d=_52[_4b]; |
||
269 | } |
||
270 | return _4c?this:_4d; |
||
271 | }; |
||
272 | $.removeData=function(_53,_54){ |
||
273 | var _55=_47(_53);
|
||
274 | delete _55[_54];
|
||
275 | if(_53.nodeType==1){ |
||
276 | var _56=true; |
||
277 | for(var _57 in _55){ |
||
278 | _56=false;
|
||
279 | break;
|
||
280 | } |
||
281 | if(_56){
|
||
282 | _53.removeAttribute(_44); |
||
283 | } |
||
284 | } |
||
285 | return this; |
||
286 | }; |
||
287 | f.data=function(_58,_59){ |
||
288 | var _5a=null; |
||
289 | this.forEach(function(_5b){ |
||
290 | _5a=$.data(_5b,_58,_59);
|
||
291 | }); |
||
292 | return _59?this:_5a; |
||
293 | }; |
||
294 | f.removeData=function(_5c){ |
||
295 | this.forEach(function(_5d){ |
||
296 | $.removeData(_5d,_5c);
|
||
297 | }); |
||
298 | return this; |
||
299 | }; |
||
300 | function _5e(obj,_5f){ |
||
301 | if(obj==_5f){
|
||
302 | return obj;
|
||
303 | } |
||
304 | var _60={};
|
||
305 | for(var x in _5f){ |
||
306 | if((_60[x]===undefined||_60[x]!=_5f[x])&&_5f[x]!==undefined&&obj!=_5f[x]){ |
||
307 | if(dojo.isObject(obj[x])&&dojo.isObject(_5f[x])){
|
||
308 | if(dojo.isArray(_5f[x])){
|
||
309 | obj[x]=_5f[x]; |
||
310 | }else{
|
||
311 | obj[x]=_5e(obj[x],_5f[x]); |
||
312 | } |
||
313 | }else{
|
||
314 | obj[x]=_5f[x]; |
||
315 | } |
||
316 | } |
||
317 | } |
||
318 | if(dojo.isIE&&_5f){
|
||
319 | var p=_5f.toString;
|
||
320 | if(typeof p=="function"&&p!=obj.toString&&p!=_60.toString&&p!="\nfunction toString() {\n [native code]\n}\n"){ |
||
321 | obj.toString=_5f.toString; |
||
322 | } |
||
323 | } |
||
324 | return obj;
|
||
325 | }; |
||
326 | f.extend=function(){ |
||
327 | var _61=[this]; |
||
328 | _61=_61.concat(arguments);
|
||
329 | return $.extend.apply($,_61); |
||
330 | }; |
||
331 | $.extend=function(){ |
||
332 | var _62=arguments,_63; |
||
333 | for(var i=0;i<_62.length;i++){ |
||
334 | var obj=_62[i];
|
||
335 | if(obj&&dojo.isObject(obj)){
|
||
336 | if(!_63){
|
||
337 | _63=obj; |
||
338 | }else{
|
||
339 | _5e(_63,obj); |
||
340 | } |
||
341 | } |
||
342 | } |
||
343 | return _63;
|
||
344 | }; |
||
345 | $.noConflict=function(_64){ |
||
346 | var me=$; |
||
347 | dojo.global.$=_d;
|
||
348 | if(_64){
|
||
349 | dojo.global.jQuery=_e; |
||
350 | } |
||
351 | return me;
|
||
352 | }; |
||
353 | f.attr=function(_65,_66){ |
||
354 | if(arguments.length==1&&dojo.isString(arguments[0])){ |
||
355 | var _67=this[0]; |
||
356 | if(!_67){
|
||
357 | return null; |
||
358 | } |
||
359 | var arg=arguments[0]; |
||
360 | var _68=dojo.attr(_67,arg);
|
||
361 | var _69=_67[arg];
|
||
362 | if((arg in _67)&&!dojo.isObject(_69)&&_65!="href"){ |
||
363 | return _69;
|
||
364 | }else{
|
||
365 | return _68||_69;
|
||
366 | } |
||
367 | }else{
|
||
368 | if(dojo.isObject(_65)){
|
||
369 | for(var _6a in _65){ |
||
370 | this.attr(_6a,_65[_6a]);
|
||
371 | } |
||
372 | return this; |
||
373 | }else{
|
||
374 | var _6b=dojo.isFunction(_66);
|
||
375 | this.forEach(function(_6c,_6d){ |
||
376 | var _6e=_6c[_65];
|
||
377 | if((_65 in _6c)&&!dojo.isObject(_6e)&&_65!="href"){ |
||
378 | _6c[_65]=(_6b?_66.call(_6c,_6d):_66); |
||
379 | }else{
|
||
380 | if(_6c.nodeType==1){ |
||
381 | dojo.attr(_6c,_65,(_6b?_66.call(_6c,_6d):_66)); |
||
382 | } |
||
383 | } |
||
384 | }); |
||
385 | return this; |
||
386 | } |
||
387 | } |
||
388 | }; |
||
389 | f.removeAttr=function(_6f){ |
||
390 | this.forEach(function(_70,_71){ |
||
391 | var _72=_70[_6f];
|
||
392 | if((_6f in _70)&&!dojo.isObject(_72)&&_6f!="href"){ |
||
393 | delete _70[_6f];
|
||
394 | }else{
|
||
395 | if(_70.nodeType==1){ |
||
396 | if(_6f=="class"){ |
||
397 | _70.removeAttribute(_6f); |
||
398 | }else{
|
||
399 | dojo.removeAttr(_70,_6f); |
||
400 | } |
||
401 | } |
||
402 | } |
||
403 | }); |
||
404 | return this; |
||
405 | }; |
||
406 | f.toggleClass=function(_73,_74){ |
||
407 | var _75=arguments.length>1; |
||
408 | this.forEach(function(_76){ |
||
409 | dojo.toggleClass(_76,_73,_75?_74:!dojo.hasClass(_76,_73)); |
||
410 | }); |
||
411 | return this; |
||
412 | }; |
||
413 | f.toggle=function(){ |
||
414 | var _77=arguments; |
||
415 | if(arguments.length>1&&dojo.isFunction(arguments[0])){ |
||
416 | var _78=0; |
||
417 | var _79=function(){ |
||
418 | var _7a=_77[_78].apply(this,arguments); |
||
419 | _78+=1;
|
||
420 | if(_78>_77.length-1){ |
||
421 | _78=0;
|
||
422 | } |
||
423 | }; |
||
424 | return this.bind("click",_79); |
||
425 | }else{
|
||
426 | var _7b=arguments.length==1?arguments[0]:undefined; |
||
427 | this.forEach(function(_7c){ |
||
428 | var _7d=typeof _7b=="undefined"?dojo.style(_7c,"display")=="none":_7b; |
||
429 | var _7e=(_7d?"show":"hide"); |
||
430 | var nl=$(_7c); |
||
431 | nl[_7e].apply(nl,_77); |
||
432 | }); |
||
433 | return this; |
||
434 | } |
||
435 | }; |
||
436 | f.hasClass=function(_7f){ |
||
437 | return this.some(function(_80){ |
||
438 | return dojo.hasClass(_80,_7f);
|
||
439 | }); |
||
440 | }; |
||
441 | f.html=f.innerHTML; |
||
442 | dojo.forEach(["filter","slice"],function(_81){ |
||
443 | f[_81]=function(){
|
||
444 | var nl;
|
||
445 | if(dojo.isFunction(arguments[0])){ |
||
446 | var _82=arguments[0]; |
||
447 | arguments[0]=function(_83,_84){ |
||
448 | return _82.call(_83,_83,_84);
|
||
449 | }; |
||
450 | } |
||
451 | if(_81=="filter"&&dojo.isString(arguments[0])){ |
||
452 | var nl=this._filterQueryResult(this,arguments[0]); |
||
453 | }else{
|
||
454 | var _85=dojo._NodeListCtor;
|
||
455 | dojo._NodeListCtor=f; |
||
456 | nl=$(_12[_81].apply(this,arguments)); |
||
457 | dojo._NodeListCtor=_85; |
||
458 | } |
||
459 | return nl._stash(this); |
||
460 | }; |
||
461 | }); |
||
462 | f.map=function(_86){ |
||
463 | return this._buildArrayFromCallback(_86); |
||
464 | }; |
||
465 | $.map=function(ary,_87){ |
||
466 | return f._buildArrayFromCallback.call(ary,_87);
|
||
467 | }; |
||
468 | $.inArray=function(_88,ary){ |
||
469 | return dojo.indexOf(ary,_88);
|
||
470 | }; |
||
471 | f.is=function(_89){ |
||
472 | return (_89?!!this.filter(_89).length:false); |
||
473 | }; |
||
474 | f.not=function(){ |
||
475 | var _8a=$.apply($,arguments); |
||
476 | var nl=$(_12.filter.call(this,function(_8b){ |
||
477 | return _8a.indexOf(_8b)==-1; |
||
478 | })); |
||
479 | return nl._stash(this); |
||
480 | }; |
||
481 | f.add=function(){ |
||
482 | return this.concat.apply(this,arguments); |
||
483 | }; |
||
484 | function _8c(_8d){ |
||
485 | var doc=_8d.contentDocument||(((_8d.name)&&(_8d.document)&&(document.getElementsByTagName("iframe")[_8d.name].contentWindow)&&(document.getElementsByTagName("iframe")[_8d.name].contentWindow.document)))||((_8d.name)&&(document.frames[_8d.name])&&(document.frames[_8d.name].document))||null; |
||
486 | return doc;
|
||
487 | }; |
||
488 | f.contents=function(){ |
||
489 | var ary=[];
|
||
490 | this.forEach(function(_8e){ |
||
491 | if(_8e.nodeName.toUpperCase()=="IFRAME"){ |
||
492 | var doc=_8c(_8e);
|
||
493 | if(doc){
|
||
494 | ary.push(doc); |
||
495 | } |
||
496 | }else{
|
||
497 | var _8f=_8e.childNodes;
|
||
498 | for(var i=0;i<_8f.length;i++){ |
||
499 | ary.push(_8f[i]); |
||
500 | } |
||
501 | } |
||
502 | }); |
||
503 | return this._wrap(ary)._stash(this); |
||
504 | }; |
||
505 | f.find=function(_90){ |
||
506 | var ary=[];
|
||
507 | this.forEach(function(_91){ |
||
508 | if(_91.nodeType==1){ |
||
509 | ary=ary.concat(dojo._toArray($(_90,_91)));
|
||
510 | } |
||
511 | }); |
||
512 | return this._getUniqueAsNodeList(ary)._stash(this); |
||
513 | }; |
||
514 | f.andSelf=function(){ |
||
515 | return this.add(this._parent); |
||
516 | }; |
||
517 | f.remove=function(_92){ |
||
518 | var nl=(_92?this._filterQueryResult(this,_92):this); |
||
519 | nl.removeData(); |
||
520 | nl.forEach(function(_93){
|
||
521 | _93.parentNode.removeChild(_93); |
||
522 | }); |
||
523 | return this; |
||
524 | }; |
||
525 | $.css=function(_94,_95,_96){ |
||
526 | _95=_8(_95); |
||
527 | var _97=(_96?dojo.style(_94,_95,_96):dojo.style(_94,_95));
|
||
528 | return _97;
|
||
529 | }; |
||
530 | f.css=function(_98,_99){ |
||
531 | if(dojo.isString(_98)){
|
||
532 | _98=_8(_98); |
||
533 | if(arguments.length==2){ |
||
534 | if(!dojo.isString(_99)&&_98!="zIndex"){ |
||
535 | _99=_99+"px";
|
||
536 | } |
||
537 | this.forEach(function(_9a){ |
||
538 | if(_9a.nodeType==1){ |
||
539 | dojo.style(_9a,_98,_99); |
||
540 | } |
||
541 | }); |
||
542 | return this; |
||
543 | }else{
|
||
544 | _99=dojo.style(this[0],_98); |
||
545 | if(!dojo.isString(_99)&&_98!="zIndex"){ |
||
546 | _99=_99+"px";
|
||
547 | } |
||
548 | return _99;
|
||
549 | } |
||
550 | }else{
|
||
551 | for(var _9b in _98){ |
||
552 | this.css(_9b,_98[_9b]);
|
||
553 | } |
||
554 | return this; |
||
555 | } |
||
556 | }; |
||
557 | function _9c(nl,_9d,_9e,_9f){ |
||
558 | if(_9f){
|
||
559 | var mod={};
|
||
560 | mod[_9e]=_9f; |
||
561 | nl.forEach(function(_a0){
|
||
562 | dojo[_9d](_a0,mod); |
||
563 | }); |
||
564 | return nl;
|
||
565 | }else{
|
||
566 | return Math.abs(Math.round(dojo[_9d](nl[0])[_9e])); |
||
567 | } |
||
568 | }; |
||
569 | f.height=function(_a1){ |
||
570 | return _9c(this,"contentBox","h",_a1); |
||
571 | }; |
||
572 | f.width=function(_a2){ |
||
573 | return _9c(this,"contentBox","w",_a2); |
||
574 | }; |
||
575 | function _a3(_a4,_a5,_a6,_a7,_a8){ |
||
576 | var _a9=false; |
||
577 | if((_a9=_a4.style.display=="none")){ |
||
578 | _a4.style.display="block";
|
||
579 | } |
||
580 | var cs=dojo.getComputedStyle(_a4);
|
||
581 | var _aa=Math.abs(Math.round(dojo._getContentBox(_a4,cs)[_a5]));
|
||
582 | var pad=_a6?Math.abs(Math.round(dojo._getPadExtents(_a4,cs)[_a5])):0; |
||
583 | var _ab=_a7?Math.abs(Math.round(dojo._getBorderExtents(_a4,cs)[_a5])):0; |
||
584 | var _ac=_a8?Math.abs(Math.round(dojo._getMarginExtents(_a4,cs)[_a5])):0; |
||
585 | if(_a9){
|
||
586 | _a4.style.display="none";
|
||
587 | } |
||
588 | return pad+_aa+_ab+_ac;
|
||
589 | }; |
||
590 | f.innerHeight=function(){ |
||
591 | return _a3(this[0],"h",true); |
||
592 | }; |
||
593 | f.innerWidth=function(){ |
||
594 | return _a3(this[0],"w",true); |
||
595 | }; |
||
596 | f.outerHeight=function(_ad){ |
||
597 | return _a3(this[0],"h",true,true,_ad); |
||
598 | }; |
||
599 | f.outerWidth=function(_ae){ |
||
600 | return _a3(this[0],"w",true,true,_ae); |
||
601 | }; |
||
602 | var _4e=[];
|
||
603 | var _af=1; |
||
604 | var _4f=dojo._scopeName+"eventid"; |
||
605 | var _b0;
|
||
606 | function _b1(_b2){ |
||
607 | _b2=_b2.split("$$")[0]; |
||
608 | var _b3=_b2.indexOf("."); |
||
609 | if(_b3!=-1){ |
||
610 | _b2=_b2.substring(0,_b3);
|
||
611 | } |
||
612 | return _b2;
|
||
613 | }; |
||
614 | function _b4(_b5,_b6){ |
||
615 | if(_b6.indexOf("ajax")==0){ |
||
616 | return dojo.subscribe(_b7[_b6],function(dfd,res){ |
||
617 | var _b8=new $.Event(_b6); |
||
618 | if("ajaxComplete|ajaxSend|ajaxSuccess".indexOf(_b6)!=-1){ |
||
619 | _b9(_b5,[_b8,dfd.ioArgs.xhr,dfd.ioArgs.args]); |
||
620 | }else{
|
||
621 | if(_b6=="ajaxError"){ |
||
622 | _b9(_b5,[_b8,dfd.ioArgs.xhr,dfd.ioArgs.args,res]); |
||
623 | }else{
|
||
624 | _b9(_b5,[_b8]); |
||
625 | } |
||
626 | } |
||
627 | }); |
||
628 | }else{
|
||
629 | return dojo.connect(_b5,"on"+_b6,function(e){ |
||
630 | _b9(_b5,arguments);
|
||
631 | }); |
||
632 | } |
||
633 | }; |
||
634 | $.Event=function(_ba){ |
||
635 | if(this==$){ |
||
636 | return new $.Event(_ba); |
||
637 | } |
||
638 | if(typeof _ba=="string"){ |
||
639 | this.type=_ba.replace(/!/,""); |
||
640 | }else{
|
||
641 | dojo.mixin(this,_ba);
|
||
642 | } |
||
643 | this.timeStamp=(new Date()).getTime(); |
||
644 | this._isFake=true; |
||
645 | this._isStrict=(this.type.indexOf("!")!=-1); |
||
646 | }; |
||
647 | var ep=$.Event.prototype={preventDefault:function(){ |
||
648 | this.isDefaultPrevented=this._true; |
||
649 | },stopPropagation:function(){ |
||
650 | this.isPropagationStopped=this._true; |
||
651 | },stopImmediatePropagation:function(){ |
||
652 | this.isPropagationStopped=this._true; |
||
653 | this.isImmediatePropagationStopped=this._true; |
||
654 | },_true:function(){ |
||
655 | return true; |
||
656 | },_false:function(){ |
||
657 | return false; |
||
658 | }}; |
||
659 | dojo.mixin(ep,{isPropagationStopped:ep._false,isImmediatePropagationStopped:ep._false,isDefaultPrevented:ep._false}); |
||
660 | function _bb(_bc,_bd){ |
||
661 | _bc=_bc||[]; |
||
662 | _bc=[].concat(_bc); |
||
663 | var evt=_bc[0]; |
||
664 | if(!evt||!evt.preventDefault){
|
||
665 | evt=_bd&&_bd.preventDefault?_bd:new $.Event(_bd); |
||
666 | _bc.unshift(evt); |
||
667 | } |
||
668 | return _bc;
|
||
669 | }; |
||
670 | var _be=false; |
||
671 | function _b9(_bf,_c0,_c1){ |
||
672 | _be=true;
|
||
673 | _c0=_c0||_b0; |
||
674 | _c1=_c1; |
||
675 | if(_bf.nodeType==9){ |
||
676 | _bf=_bf.documentElement; |
||
677 | } |
||
678 | var _c2=_bf.getAttribute(_4f);
|
||
679 | if(!_c2){
|
||
680 | return;
|
||
681 | } |
||
682 | var evt=_c0[0]; |
||
683 | var _c3=evt.type;
|
||
684 | var _c4=_b1(_c3);
|
||
685 | var cbs=_4e[_c2][_c4];
|
||
686 | var _c5;
|
||
687 | if(_c1){
|
||
688 | _c5=_c1.apply(_bf,_c0); |
||
689 | } |
||
690 | if(_c5!==false){ |
||
691 | for(var _c6 in cbs){ |
||
692 | if(_c6!="_connectId"&&(!evt._isStrict&&(_c6.indexOf(_c3)==0)||(evt._isStrict&&_c6==_c3))){ |
||
693 | evt[dojo._scopeName+"callbackId"]=_c6;
|
||
694 | var cb=cbs[_c6];
|
||
695 | if(typeof cb.data!="undefined"){ |
||
696 | evt.data=cb.data; |
||
697 | }else{
|
||
698 | evt.data=null;
|
||
699 | } |
||
700 | if((_c5=cb.fn.apply(evt.target,_c0))===false&&!evt._isFake){ |
||
701 | dojo.stopEvent(evt); |
||
702 | } |
||
703 | evt.result=_c5; |
||
704 | } |
||
705 | } |
||
706 | } |
||
707 | return _c5;
|
||
708 | }; |
||
709 | f.triggerHandler=function(_c7,_c8,_c9){ |
||
710 | var _ca=this[0]; |
||
711 | if(_ca&&_ca.nodeType!=3&&_ca.nodeType!=8){ |
||
712 | _c8=_bb(_c8,_c7); |
||
713 | return _b9(_ca,_c8,_c9);
|
||
714 | }else{
|
||
715 | return undefined; |
||
716 | } |
||
717 | }; |
||
718 | f.trigger=function(_cb,_cc,_cd){ |
||
719 | _cc=_bb(_cc,_cb); |
||
720 | var evt=_cc[0]; |
||
721 | var _cb=_b1(evt.type);
|
||
722 | _b0=_cc; |
||
723 | currentExtraFunc=_cd; |
||
724 | var _ce=null; |
||
725 | var _cf=!evt.target;
|
||
726 | this.forEach(function(_d0){ |
||
727 | if(_d0.nodeType!=3&&_d0.nodeType!=8){ |
||
728 | if(_d0.nodeType==9){ |
||
729 | _d0=_d0.documentElement; |
||
730 | } |
||
731 | if(evt._isFake){
|
||
732 | evt.currentTarget=_d0; |
||
733 | if(_cf){
|
||
734 | evt.target=_d0; |
||
735 | } |
||
736 | } |
||
737 | if(_cd){
|
||
738 | var _d1=_cc.slice(1); |
||
739 | _ce=_cd.apply(_d0,(_ce=null?_d1:_d1.concat(_ce)));
|
||
740 | } |
||
741 | if(_ce!==false){ |
||
742 | _be=false;
|
||
743 | if(_d0[_cb]){
|
||
744 | try{
|
||
745 | _ce=_d0[_cb](); |
||
746 | } |
||
747 | catch(e){
|
||
748 | } |
||
749 | }else{
|
||
750 | if(_d0["on"+_cb]){ |
||
751 | try{
|
||
752 | _ce=_d0["on"+_cb]();
|
||
753 | } |
||
754 | catch(e){
|
||
755 | } |
||
756 | } |
||
757 | } |
||
758 | if(!_be){
|
||
759 | _ce=_b9(_d0,_cc); |
||
760 | } |
||
761 | var _d2=_d0.parentNode;
|
||
762 | if(_ce!==false&&!evt.isImmediatePropagationStopped()&&!evt.isPropagationStopped()&&_d2&&_d2.nodeType==1){ |
||
763 | $(_d2).trigger(_cb,_cc,_cd);
|
||
764 | } |
||
765 | } |
||
766 | } |
||
767 | }); |
||
768 | _b0=null;
|
||
769 | currentExtraFunc=null;
|
||
770 | return this; |
||
771 | }; |
||
772 | var _d3=0; |
||
773 | f.bind=function(_d4,_d5,fn){ |
||
774 | _d4=_d4.split(" ");
|
||
775 | if(!fn){
|
||
776 | fn=_d5; |
||
777 | _d5=null;
|
||
778 | } |
||
779 | this.forEach(function(_d6){ |
||
780 | if(_d6.nodeType!=3&&_d6.nodeType!=8){ |
||
781 | if(_d6.nodeType==9){ |
||
782 | _d6=_d6.documentElement; |
||
783 | } |
||
784 | var _d7=_d6.getAttribute(_4f);
|
||
785 | if(!_d7){
|
||
786 | _d7=_af++; |
||
787 | _d6.setAttribute(_4f,_d7); |
||
788 | _4e[_d7]={}; |
||
789 | } |
||
790 | for(var i=0;i<_d4.length;i++){ |
||
791 | var _d8=_d4[i];
|
||
792 | var _d9=_b1(_d8);
|
||
793 | if(_d9==_d8){
|
||
794 | _d8=_d9+"$$"+(_d3++);
|
||
795 | } |
||
796 | var lls=_4e[_d7];
|
||
797 | if(!lls[_d9]){
|
||
798 | lls[_d9]={_connectId:_b4(_d6,_d9)};
|
||
799 | } |
||
800 | lls[_d9][_d8]={fn:fn,data:_d5}; |
||
801 | } |
||
802 | } |
||
803 | }); |
||
804 | return this; |
||
805 | }; |
||
806 | function _da(src,_db){ |
||
807 | var _dc=_db.getAttribute(_4f);
|
||
808 | var sls=_4e[_dc];
|
||
809 | if(!sls){
|
||
810 | return;
|
||
811 | } |
||
812 | var _dd=_dd=_af++;
|
||
813 | _db.setAttribute(_4f,_dd); |
||
814 | var tls=_4e[_dd]={};
|
||
815 | var _de={};
|
||
816 | for(var _df in sls){ |
||
817 | var _e0=tls[_df]={_connectId:_b4(_db,_df)}; |
||
818 | var _e1=sls[_df];
|
||
819 | for(var _e2 in _e1){ |
||
820 | _e0[_e2]={fn:_e1[_e2].fn,data:_e1[_e2].data}; |
||
821 | } |
||
822 | } |
||
823 | }; |
||
824 | function _e3(lls,_e4,_e5,_e6,fn){ |
||
825 | var _e7=lls[_e4];
|
||
826 | if(_e7){
|
||
827 | var _e8=_e5.indexOf(".")!=-1; |
||
828 | var _e9=false; |
||
829 | if(_e6){
|
||
830 | delete _e7[_e6];
|
||
831 | }else{
|
||
832 | if(!_e8&&!fn){
|
||
833 | _e9=true;
|
||
834 | }else{
|
||
835 | if(_e8){
|
||
836 | if(_e5.charAt(0)=="."){ |
||
837 | for(var _ea in _e7){ |
||
838 | if(_ea.indexOf(_e5)==_ea.length-_e5.length){
|
||
839 | delete _e7[_ea];
|
||
840 | } |
||
841 | } |
||
842 | }else{
|
||
843 | delete _e7[_e5];
|
||
844 | } |
||
845 | }else{
|
||
846 | for(var _ea in _e7){ |
||
847 | if(_ea.indexOf("$$")!=-1&&_e7[_ea].fn==fn){ |
||
848 | delete _e7[_ea];
|
||
849 | break;
|
||
850 | } |
||
851 | } |
||
852 | } |
||
853 | } |
||
854 | } |
||
855 | var _eb=true; |
||
856 | for(var _ea in _e7){ |
||
857 | if(_ea!="_connectId"){ |
||
858 | _eb=false;
|
||
859 | break;
|
||
860 | } |
||
861 | } |
||
862 | if(_e9||_eb){
|
||
863 | if(_e4.indexOf("ajax")!=-1){ |
||
864 | dojo.unsubscribe(_e7._connectId); |
||
865 | }else{
|
||
866 | dojo.disconnect(_e7._connectId); |
||
867 | } |
||
868 | delete lls[_e4];
|
||
869 | } |
||
870 | } |
||
871 | }; |
||
872 | f.unbind=function(_ec,fn){ |
||
873 | var _ed=_ec?_ec[dojo._scopeName+"callbackId"]:null; |
||
874 | _ec=_ec&&_ec.type?_ec.type:_ec; |
||
875 | _ec=_ec?_ec.split(" "):_ec;
|
||
876 | this.forEach(function(_ee){ |
||
877 | if(_ee.nodeType!=3&&_ee.nodeType!=8){ |
||
878 | if(_ee.nodeType==9){ |
||
879 | _ee=_ee.documentElement; |
||
880 | } |
||
881 | var _ef=_ee.getAttribute(_4f);
|
||
882 | if(_ef){
|
||
883 | var lls=_4e[_ef];
|
||
884 | if(lls){
|
||
885 | var _f0=_ec;
|
||
886 | if(!_f0){
|
||
887 | _f0=[]; |
||
888 | for(var _f1 in lls){ |
||
889 | _f0.push(_f1); |
||
890 | } |
||
891 | } |
||
892 | for(var i=0;i<_f0.length;i++){ |
||
893 | var _f2=_f0[i];
|
||
894 | var _f3=_b1(_f2);
|
||
895 | if(_f2.charAt(0)=="."){ |
||
896 | for(var _f1 in lls){ |
||
897 | _e3(lls,_f1,_f2,_ed,fn); |
||
898 | } |
||
899 | }else{
|
||
900 | _e3(lls,_f3,_f2,_ed,fn); |
||
901 | } |
||
902 | } |
||
903 | } |
||
904 | } |
||
905 | } |
||
906 | }); |
||
907 | return this; |
||
908 | }; |
||
909 | f.one=function(_f4,_f5){ |
||
910 | var _f6=function(){ |
||
911 | $(this).unbind(_f4,arguments.callee); |
||
912 | return _f5.apply(this,arguments); |
||
913 | }; |
||
914 | return this.bind(_f4,_f6); |
||
915 | }; |
||
916 | f._cloneNode=function(src){ |
||
917 | var _f7=src.cloneNode(true); |
||
918 | if(src.nodeType==1){ |
||
919 | var _f8=dojo.query("["+_4f+"]",_f7); |
||
920 | for(var i=0,_f9;_f9=_f8[i];i++){ |
||
921 | var _fa=dojo.query("["+_4f+"=\""+_f9.getAttribute(_4f)+"\"]",src)[0]; |
||
922 | if(_fa){
|
||
923 | _da(_fa,_f9); |
||
924 | } |
||
925 | } |
||
926 | } |
||
927 | return _f7;
|
||
928 | }; |
||
929 | dojo.getObject("$.event.global",true); |
||
930 | dojo.forEach(["blur","focus","dblclick","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","submit","ajaxStart","ajaxSend","ajaxSuccess","ajaxError","ajaxComplete","ajaxStop"],function(evt){ |
||
931 | f[evt]=function(_fb){
|
||
932 | if(_fb){
|
||
933 | this.bind(evt,_fb);
|
||
934 | }else{
|
||
935 | this.trigger(evt);
|
||
936 | } |
||
937 | return this; |
||
938 | }; |
||
939 | }); |
||
940 | function _fc(_fd){ |
||
941 | if(dojo.isString(_fd)){
|
||
942 | if(_fd=="slow"){ |
||
943 | _fd=700;
|
||
944 | }else{
|
||
945 | if(_fd="fast"){ |
||
946 | _fd=300;
|
||
947 | }else{
|
||
948 | _fd=500;
|
||
949 | } |
||
950 | } |
||
951 | } |
||
952 | return _fd;
|
||
953 | }; |
||
954 | f.hide=function(_fe,_ff){ |
||
955 | _fe=_fc(_fe); |
||
956 | this.forEach(function(node){ |
||
957 | var _100=node.style;
|
||
958 | var cs=dojo.getComputedStyle(node);
|
||
959 | if(cs.display=="none"){ |
||
960 | return;
|
||
961 | } |
||
962 | _100.overflow="hidden";
|
||
963 | _100.display="block";
|
||
964 | if(_fe){
|
||
965 | dojo.anim(node,{width:0,height:0,opacity:0},_fe,null,function(){ |
||
966 | _100.width="";
|
||
967 | _100.height="";
|
||
968 | _100.display="none";
|
||
969 | return _ff&&_ff.call(node);
|
||
970 | }); |
||
971 | }else{
|
||
972 | dojo.style(node,"display","none"); |
||
973 | if(_ff){
|
||
974 | _ff.call(node); |
||
975 | } |
||
976 | } |
||
977 | }); |
||
978 | return this; |
||
979 | }; |
||
980 | f.show=function(_101,_102){ |
||
981 | _101=_fc(_101); |
||
982 | this.forEach(function(node){ |
||
983 | var _103=node.style;
|
||
984 | var cs=dojo.getComputedStyle(node);
|
||
985 | if(cs.display!="none"){ |
||
986 | return;
|
||
987 | } |
||
988 | if(_101){
|
||
989 | var _104=parseFloat(_103.width);
|
||
990 | var _105=parseFloat(_103.height);
|
||
991 | if(!_104||!_105){
|
||
992 | _103.display="block";
|
||
993 | var box=dojo.marginBox(node);
|
||
994 | _104=box.w; |
||
995 | _105=box.h; |
||
996 | } |
||
997 | _103.width=0;
|
||
998 | _103.height=0;
|
||
999 | _103.overflow="hidden";
|
||
1000 | dojo.attr(node,"opacity",0); |
||
1001 | _103.display="block";
|
||
1002 | dojo.anim(node,{width:_104,height:_105,opacity:1},_101,null,_102?dojo.hitch(node,_102):undefined); |
||
1003 | }else{
|
||
1004 | dojo.style(node,"display","block"); |
||
1005 | if(_102){
|
||
1006 | _102.call(node); |
||
1007 | } |
||
1008 | } |
||
1009 | }); |
||
1010 | return this; |
||
1011 | }; |
||
1012 | $.ajaxSettings={};
|
||
1013 | $.ajaxSetup=function(args){ |
||
1014 | dojo.mixin($.ajaxSettings,args);
|
||
1015 | }; |
||
1016 | var _b7={"ajaxStart":"/dojo/io/start","ajaxSend":"/dojo/io/send","ajaxSuccess":"/dojo/io/load","ajaxError":"/dojo/io/error","ajaxComplete":"/dojo/io/done","ajaxStop":"/dojo/io/stop"}; |
||
1017 | for(var _106 in _b7){ |
||
1018 | if(_106.indexOf("ajax")==0){ |
||
1019 | (function(_107){
|
||
1020 | f[_107]=function(_108){
|
||
1021 | this.forEach(function(node){ |
||
1022 | dojo.subscribe(_b7[_107],function(){
|
||
1023 | var _109=new $.Event(_107); |
||
1024 | var _10a=arguments[0]&&arguments[0].ioArgs; |
||
1025 | var xhr=_10a&&_10a.xhr;
|
||
1026 | var args=_10a&&_10a.args;
|
||
1027 | var res=arguments[1]; |
||
1028 | if("ajaxComplete|ajaxSend|ajaxSuccess".indexOf(_107)!=-1){ |
||
1029 | return _108.call(node,_109,xhr,args);
|
||
1030 | }else{
|
||
1031 | if(_107=="ajaxError"){ |
||
1032 | return _108.call(node,_109,xhr,args,res);
|
||
1033 | }else{
|
||
1034 | return _108.call(node,_109);
|
||
1035 | } |
||
1036 | } |
||
1037 | }); |
||
1038 | }); |
||
1039 | return this; |
||
1040 | }; |
||
1041 | })(_106); |
||
1042 | } |
||
1043 | } |
||
1044 | var _10b=dojo._xhrObj;
|
||
1045 | dojo._xhrObj=function(args){ |
||
1046 | var xhr=_10b.apply(dojo,arguments); |
||
1047 | if(args&&args.beforeSend){
|
||
1048 | if(args.beforeSend(xhr)===false){ |
||
1049 | return false; |
||
1050 | } |
||
1051 | } |
||
1052 | return xhr;
|
||
1053 | }; |
||
1054 | $.ajax=function(args){ |
||
1055 | var temp=dojo.delegate($.ajaxSettings); |
||
1056 | for(var _10c in args){ |
||
1057 | if(_10c=="data"&&dojo.isObject(args[_10c])&&dojo.isObject(temp.data)){ |
||
1058 | for(var prop in args[_10c]){ |
||
1059 | temp.data[prop]=args[_10c][prop]; |
||
1060 | } |
||
1061 | }else{
|
||
1062 | temp[_10c]=args[_10c]; |
||
1063 | } |
||
1064 | } |
||
1065 | args=temp; |
||
1066 | var url=args.url;
|
||
1067 | if("async" in args){ |
||
1068 | args.sync=!args.async; |
||
1069 | } |
||
1070 | if(args.global===false){ |
||
1071 | args.ioPublish=false;
|
||
1072 | } |
||
1073 | if(args.data){
|
||
1074 | var data=args.data;
|
||
1075 | if(dojo.isString(data)){
|
||
1076 | args.content=dojo.queryToObject(data); |
||
1077 | }else{
|
||
1078 | for(var _10c in data){ |
||
1079 | if(dojo.isFunction(data[_10c])){
|
||
1080 | data[_10c]=data[_10c](); |
||
1081 | } |
||
1082 | } |
||
1083 | args.content=data; |
||
1084 | } |
||
1085 | } |
||
1086 | var _10d=args.dataType;
|
||
1087 | if("dataType" in args){ |
||
1088 | if(_10d=="script"){ |
||
1089 | _10d="javascript";
|
||
1090 | }else{
|
||
1091 | if(_10d=="html"){ |
||
1092 | _10d="text";
|
||
1093 | } |
||
1094 | } |
||
1095 | args.handleAs=_10d; |
||
1096 | }else{
|
||
1097 | _10d=args.handleAs="text";
|
||
1098 | args.guessedType=true;
|
||
1099 | } |
||
1100 | if("cache" in args){ |
||
1101 | args.preventCache=!args.cache; |
||
1102 | }else{
|
||
1103 | if(args.dataType=="script"||args.dataType=="jsonp"){ |
||
1104 | args.preventCache=true;
|
||
1105 | } |
||
1106 | } |
||
1107 | if(args.error){
|
||
1108 | args._jqueryError=args.error; |
||
1109 | delete args.error;
|
||
1110 | } |
||
1111 | args.handle=function(_10e,_10f){ |
||
1112 | var _110="success"; |
||
1113 | if(_10e instanceof Error){ |
||
1114 | _110=(_10e.dojoType=="timeout"?"timeout":"error"); |
||
1115 | if(args._jqueryError){
|
||
1116 | args._jqueryError(_10f.xhr,_110,_10e); |
||
1117 | } |
||
1118 | }else{
|
||
1119 | var xml=(_10f.args.guessedType&&_10f.xhr&&_10f.xhr.responseXML);
|
||
1120 | if(xml){
|
||
1121 | _10e=xml; |
||
1122 | } |
||
1123 | if(args.success){
|
||
1124 | args.success(_10e,_110,_10f.xhr); |
||
1125 | } |
||
1126 | } |
||
1127 | if(args.complete){
|
||
1128 | args.complete(_10e,_110,_10f.xhr); |
||
1129 | } |
||
1130 | return _10e;
|
||
1131 | }; |
||
1132 | var _111=(_10d=="jsonp"); |
||
1133 | if(_10d=="javascript"){ |
||
1134 | var _112=url.indexOf(":"); |
||
1135 | var _113=url.indexOf("/"); |
||
1136 | if(_112>0&&_112<_113){ |
||
1137 | var _114=url.indexOf("/",_113+2); |
||
1138 | if(_114==-1){ |
||
1139 | _114=url.length; |
||
1140 | } |
||
1141 | if(location.protocol!=url.substring(0,_112+1)||location.hostname!=url.substring(_113+2,_114)){ |
||
1142 | _111=true;
|
||
1143 | } |
||
1144 | } |
||
1145 | } |
||
1146 | if(_111){
|
||
1147 | if(_10d=="jsonp"){ |
||
1148 | var cb=args.jsonp;
|
||
1149 | if(!cb){
|
||
1150 | var _115=args.url.split("?")[1]; |
||
1151 | if(_115&&(_115=dojo.queryToObject(_115))){
|
||
1152 | cb=_116(_115); |
||
1153 | if(cb){
|
||
1154 | var _117=new RegExp("([&\\?])?"+cb+"=?"); |
||
1155 | args.url=args.url.replace(_117+"=?");
|
||
1156 | } |
||
1157 | } |
||
1158 | if(!cb){
|
||
1159 | cb=_116(args.content); |
||
1160 | if(cb){
|
||
1161 | delete args.content[cb];
|
||
1162 | } |
||
1163 | } |
||
1164 | } |
||
1165 | args.jsonp=cb||"callback";
|
||
1166 | } |
||
1167 | var dfd=dojo.io.script.get(args);
|
||
1168 | return dfd;
|
||
1169 | }else{
|
||
1170 | var dfd=dojo.xhr(args.type||"GET",args); |
||
1171 | return dfd.ioArgs.xhr===false?false:dfd.ioArgs.xhr; |
||
1172 | } |
||
1173 | }; |
||
1174 | function _116(obj){ |
||
1175 | for(var prop in obj){ |
||
1176 | if(prop.indexOf("callback")==prop.length-8){ |
||
1177 | return prop;
|
||
1178 | } |
||
1179 | } |
||
1180 | return null; |
||
1181 | }; |
||
1182 | $.getpost=function(_118,url,data,_119,_11a){ |
||
1183 | var args={url:url,type:_118}; |
||
1184 | if(data){
|
||
1185 | if(dojo.isFunction(data)&&!_119){
|
||
1186 | args.complete=data; |
||
1187 | }else{
|
||
1188 | args.data=data; |
||
1189 | } |
||
1190 | } |
||
1191 | if(_119){
|
||
1192 | if(dojo.isString(_119)&&!_11a){
|
||
1193 | _11a=_119; |
||
1194 | }else{
|
||
1195 | args.complete=_119; |
||
1196 | } |
||
1197 | } |
||
1198 | if(_11a){
|
||
1199 | args.dataType=_11a; |
||
1200 | } |
||
1201 | return $.ajax(args); |
||
1202 | }; |
||
1203 | $.get=dojo.hitch($,"getpost","GET"); |
||
1204 | $.post=dojo.hitch($,"getpost","POST"); |
||
1205 | $.getJSON=function(url,data,_11b){ |
||
1206 | return $.getpost("GET",url,data,_11b,"json"); |
||
1207 | }; |
||
1208 | $.getScript=function(url,_11c){ |
||
1209 | return $.ajax({url:url,success:_11c,dataType:"script"}); |
||
1210 | }; |
||
1211 | f.load=function(url,data,_11d){ |
||
1212 | var node=this[0]; |
||
1213 | if(!node||!node.nodeType||node.nodeType==9){ |
||
1214 | dojo.addOnLoad(url); |
||
1215 | return this; |
||
1216 | } |
||
1217 | var _11e=url.split(/\s+/); |
||
1218 | url=_11e[0];
|
||
1219 | var _11f=_11e[1]; |
||
1220 | var _120=_11d||data;
|
||
1221 | var cb=dojo.hitch(this,function(_121,_122,xhr){ |
||
1222 | var _123=_121.match(/\<\s*body[^>]+>.*<\/body\s*>/i); |
||
1223 | if(_123){
|
||
1224 | _121=_123; |
||
1225 | } |
||
1226 | var _124=dojo._toDom(_121);
|
||
1227 | if(_11f){
|
||
1228 | var temp=$(dojo.create("div")); |
||
1229 | temp.append(_124); |
||
1230 | _124=temp.find(_11f); |
||
1231 | }else{
|
||
1232 | _124=$(_124.nodeType==11?_124.childNodes:_124); |
||
1233 | } |
||
1234 | this.html(_124);
|
||
1235 | if(_120){
|
||
1236 | setTimeout(dojo.hitch(this,function(){ |
||
1237 | this.forEach(function(node){ |
||
1238 | _120.call(node,_121,_122,xhr); |
||
1239 | }); |
||
1240 | }),10);
|
||
1241 | } |
||
1242 | }); |
||
1243 | if(!_11d){
|
||
1244 | data=cb; |
||
1245 | }else{
|
||
1246 | _11d=cb; |
||
1247 | } |
||
1248 | var _125="GET"; |
||
1249 | if(data&&dojo.isObject(data)){
|
||
1250 | _125="POST";
|
||
1251 | } |
||
1252 | $.getpost(_125,url,data,_11d,"html"); |
||
1253 | return this; |
||
1254 | }; |
||
1255 | var _126="file|submit|image|reset|button|"; |
||
1256 | f.serialize=function(){ |
||
1257 | var ret=""; |
||
1258 | var strs=this.map(function(node){ |
||
1259 | if(node.nodeName.toUpperCase()=="FORM"){ |
||
1260 | return dojo.formToQuery(node);
|
||
1261 | }else{
|
||
1262 | var type=(node.type||"").toLowerCase(); |
||
1263 | if(_126.indexOf(type)==-1){ |
||
1264 | var val=dojo.fieldToObject(node);
|
||
1265 | if(node.name&&val!=null){ |
||
1266 | var q={};
|
||
1267 | q[node.name]=val; |
||
1268 | return dojo.objectToQuery(q);
|
||
1269 | } |
||
1270 | } |
||
1271 | } |
||
1272 | }); |
||
1273 | return ret+strs.join("&"); |
||
1274 | }; |
||
1275 | $.param=function(obj){ |
||
1276 | if(obj._is$&&obj.serialize){ |
||
1277 | return obj.serialize();
|
||
1278 | }else{
|
||
1279 | if(dojo.isArray(obj)){
|
||
1280 | return dojo.map(obj,function(item){ |
||
1281 | return $.param(item); |
||
1282 | }).join("&");
|
||
1283 | }else{
|
||
1284 | return dojo.objectToQuery(obj);
|
||
1285 | } |
||
1286 | } |
||
1287 | }; |
||
1288 | $.isFunction=function(){ |
||
1289 | var _127=dojo.isFunction.apply(dojo,arguments); |
||
1290 | if(_127){
|
||
1291 | _127=(typeof (arguments[0])!="object"); |
||
1292 | } |
||
1293 | return _127;
|
||
1294 | }; |
||
1295 | })(); |
||
1296 | } |