]>
Commit | Line | Data |
---|---|---|
2f01fe57 AD |
1 | /* |
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["dojo.cache"]){ | |
9 | dojo._hasResource["dojo.cache"]=true; | |
10 | dojo.provide("dojo.cache"); | |
11 | (function(){ | |
12 | var _1={}; | |
13 | dojo.cache=function(_2,_3,_4){ | |
14 | if(typeof _2=="string"){ | |
15 | var _5=dojo.moduleUrl(_2,_3); | |
16 | }else{ | |
17 | _5=_2; | |
18 | _4=_3; | |
19 | } | |
20 | var _6=_5.toString(); | |
21 | var _7=_4; | |
22 | if(_4!=undefined&&!dojo.isString(_4)){ | |
23 | _7=("value" in _4?_4.value:undefined); | |
24 | } | |
25 | var _8=_4&&_4.sanitize?true:false; | |
26 | if(typeof _7=="string"){ | |
27 | _7=_1[_6]=_8?dojo.cache._sanitize(_7):_7; | |
28 | }else{ | |
29 | if(_7===null){ | |
30 | delete _1[_6]; | |
31 | }else{ | |
32 | if(!(_6 in _1)){ | |
33 | _7=dojo._getText(_6); | |
34 | _1[_6]=_8?dojo.cache._sanitize(_7):_7; | |
35 | } | |
36 | _7=_1[_6]; | |
37 | } | |
38 | } | |
39 | return _7; | |
40 | }; | |
41 | dojo.cache._sanitize=function(_9){ | |
42 | if(_9){ | |
43 | _9=_9.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,""); | |
44 | var _a=_9.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im); | |
45 | if(_a){ | |
46 | _9=_a[1]; | |
47 | } | |
48 | }else{ | |
49 | _9=""; | |
50 | } | |
51 | return _9; | |
52 | }; | |
53 | })(); | |
54 | } |