tt-rss/lib/dojo/parser.js

8 lines
9.2 KiB
JavaScript
Raw Normal View History

/*
2013-03-18 07:26:24 +01:00
Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
2012-08-14 16:59:10 +02:00
//>>built
2013-03-18 07:26:24 +01:00
define("dojo/parser",["require","./_base/kernel","./_base/lang","./_base/array","./_base/config","./_base/html","./_base/window","./_base/url","./_base/json","./aspect","./date/stamp","./Deferred","./has","./query","./on","./ready"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,_10){new Date("X");var _11=0;_a.after(_3,"extend",function(){_11++;},true);function _12(_13){var map=_13._nameCaseMap,_14=_13.prototype;if(!map||map._extendCnt<_11){map=_13._nameCaseMap={};for(var _15 in _14){if(_15.charAt(0)==="_"){continue;}map[_15.toLowerCase()]=_15;}map._extendCnt=_11;}return map;};var _16={};function _17(_18){var ts=_18.join();if(!_16[ts]){var _19=[];for(var i=0,l=_18.length;i<l;i++){var t=_18[i];_19[_19.length]=(_16[t]=_16[t]||(_3.getObject(t)||(~t.indexOf("/")&&_1(t))));}var _1a=_19.shift();_16[ts]=_19.length?(_1a.createSubclass?_1a.createSubclass(_19):_1a.extend.apply(_1a,_19)):_1a;}return _16[ts];};var _1b={_clearCache:function(){_11++;_16={};},_functionFromScript:function(_1c,_1d){var _1e="",_1f="",_20=(_1c.getAttribute(_1d+"args")||_1c.getAttribute("args")),_21=_1c.getAttribute("with");var _22=(_20||"").split(/\s*,\s*/);if(_21&&_21.length){_4.forEach(_21.split(/\s*,\s*/),function(_23){_1e+="with("+_23+"){";_1f+="}";});}return new Function(_22,_1e+_1c.innerHTML+_1f);},instantiate:function(_24,_25,_26){_25=_25||{};_26=_26||{};var _27=(_26.scope||_2._scopeName)+"Type",_28="data-"+(_26.scope||_2._scopeName)+"-",_29=_28+"type",_2a=_28+"mixins";var _2b=[];_4.forEach(_24,function(_2c){var _2d=_27 in _25?_25[_27]:_2c.getAttribute(_29)||_2c.getAttribute(_27);if(_2d){var _2e=_2c.getAttribute(_2a),_2f=_2e?[_2d].concat(_2e.split(/\s*,\s*/)):[_2d];_2b.push({node:_2c,types:_2f});}});return this._instantiate(_2b,_25,_26);},_instantiate:function(_30,_31,_32){var _33=_4.map(_30,function(obj){var _34=obj.ctor||_17(obj.types);if(!_34){throw new Error("Unable to resolve constructor for: '"+obj.types.join()+"'");}return this.construct(_34,obj.node,_31,_32,obj.scripts,obj.inherited);},this);if(!_31._started&&!_32.noStart){_4.forEach(_33,function(_35){if(typeof _35.startup==="function"&&!_35._started){_35.startup();}});}return _33;},construct:function(_36,_37,_38,_39,_3a,_3b){var _3c=_36&&_36.prototype;_39=_39||{};var _3d={};if(_39.defaults){_3.mixin(_3d,_39.defaults);}if(_3b){_3.mixin(_3d,_3b);}var _3e;if(_d("dom-attributes-explicit")){_3e=_37.attributes;}else{if(_d("dom-attributes-specified-flag")){_3e=_4.filter(_37.attributes,function(a){return a.specified;});}else{var _3f=/^input$|^img$/i.test(_37.nodeName)?_37:_37.cloneNode(false),_40=_3f.outerHTML.replace(/=[^\s"']+|="[^"]*"|='[^']*'/g,"").replace(/^\s*<[a-zA-Z0-9]*\s*/,"").replace(/\s*>.*$/,"");_3e=_4.map(_40.split(/\s+/),function(_41){var _42=_41.toLowerCase();return {name:_41,value:(_37.nodeName=="LI"&&_41=="value")||_42=="enctype"?_37.getAttribute(_42):_37.getAttributeNode(_42).value};});}}var _43=_39.scope||_2._scopeName,_44="data-"+_43+"-",_45={};if(_43!=="dojo"){_45[_44+"props"]="data-dojo-props";_45[_44+"type"]="data-dojo-type";_45[_44+"mixins"]="data-dojo-mixins";_45[_43+"type"]="dojoType";_45[_44+"id"]="data-dojo-id";}var i=0,_46,_47=[],_48,_49;while(_46=_3e[i++]){var _4a=_46.name,_4b=_4a.toLowerCase(),_4c=_46.value;switch(_45[_4b]||_4b){case "data-dojo-type":case "dojotype":case "data-dojo-mixins":break;case "data-dojo-props":_49=_4c;break;case "data-dojo-id":case "jsid":_48=_4c;break;case "data-dojo-attach-point":case "dojoattachpoint":_3d.dojoAttachPoint=_4c;break;case "data-dojo-attach-event":case "dojoattachevent":_3d.dojoAttachEvent=_4c;break;case "class":_3d["class"]=_37.className;break;case "style":_3d["style"]=_37.style&&_37.style.cssText;break;default:if(!(_4a in _3c)){var map=_12(_36);_4a=map[_4b]||_4a;}if(_4a in _3c){switch(typeof _3c[_4a]){case "string":_3d[_4a]=_4c;break;case "number":_3d[_4a]=_4c.length?Number(_4c):NaN;break;case "boolean":_3d[_4a]=_4c.toLowerCase()!="false";break;case "function":if(_4c===""||_4c.search(/[^\w\.]+/i)!=-1){_3d[_4a]=new Function(_4c);}else{_3d[_4a]=_3.getObject(_4c,false)||new Function(_4c);}_47.push(_4a);break;default:var