control-freak-ide/Code/client/build/davinci/dojo/parser.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

17 lines
7.4 KiB
JavaScript

//>>built
define("dojo/parser","require ./_base/kernel ./_base/lang ./_base/array ./_base/config ./dom ./_base/window ./_base/url ./aspect ./promise/all ./date/stamp ./Deferred ./has ./query ./on ./ready".split(" "),function(E,y,q,w,N,O,P,Q,L,R,S,F,G,M,T,U){function H(a){return eval("("+a+")")}function V(a){var b=a._nameCaseMap,c=a.prototype;if(!b||b._extendCnt<C){var b=a._nameCaseMap={},d;for(d in c)"_"!==d.charAt(0)&&(b[d.toLowerCase()]=d);b._extendCnt=C}return b}function I(a,b){var c=a.join();if(!A[c]){for(var d=
[],f=0,l=a.length;f<l;f++){var u=a[f];d[d.length]=A[u]=A[u]||q.getObject(u)||~u.indexOf("/")&&(b?b(u):E(u))}a=d.shift();A[c]=d.length?a.createSubclass?a.createSubclass(d):a.extend.apply(a,d):a}return A[c]}new Date("X");var C=0;L.after(q,"extend",function(){C++},!0);var A={},K={_clearCache:function(){C++;A={}},_functionFromScript:function(a,b){var c="",d="",f=a.getAttribute(b+"args")||a.getAttribute("args");b=a.getAttribute("with");f=(f||"").split(/\s*,\s*/);b&&b.length&&w.forEach(b.split(/\s*,\s*/),
function(b){c+="with("+b+"){";d+="}"});return new Function(f,c+a.innerHTML+d)},instantiate:function(a,b,c){b=b||{};c=c||{};var d=(c.scope||y._scopeName)+"Type",f="data-"+(c.scope||y._scopeName)+"-",l=f+"type",u=f+"mixins",t=[];w.forEach(a,function(a){var c=d in b?b[d]:a.getAttribute(l)||a.getAttribute(d);if(c){var f=a.getAttribute(u),c=f?[c].concat(f.split(/\s*,\s*/)):[c];t.push({node:a,types:c})}});return this._instantiate(t,b,c)},_instantiate:function(a,b,c,d){function f(a){b._started||c.noStart||
w.forEach(a,function(a){"function"!==typeof a.startup||a._started||a.startup()});return a}a=w.map(a,function(a){var d=a.ctor||I(a.types,c.contextRequire);if(!d)throw Error("Unable to resolve constructor for: '"+a.types.join()+"'");return this.construct(d,a.node,b,c,a.scripts,a.inherited)},this);return d?R(a).then(f):f(a)},construct:function(a,b,c,d,f,l){function u(a){v&&q.setObject(v,a);for(k=0;k<z.length;k++)L[z[k].advice||"after"](a,z[k].method,q.hitch(a,z[k].func),!0);for(k=0;k<J.length;k++)J[k].call(a);
for(k=0;k<D.length;k++)a.watch(D[k].prop,D[k].func);for(k=0;k<B.length;k++)T(a,B[k].event,B[k].func);return a}var t=a&&a.prototype;d=d||{};var n={};d.defaults&&q.mixin(n,d.defaults);l&&q.mixin(n,l);var r;G("dom-attributes-explicit")?r=b.attributes:G("dom-attributes-specified-flag")?r=w.filter(b.attributes,function(a){return a.specified}):(l=(/^input$|^img$/i.test(b.nodeName)?b:b.cloneNode(!1)).outerHTML.replace(/=[^\s"']+|="[^"]*"|='[^']*'/g,"").replace(/^\s*<[a-zA-Z0-9]*\s*/,"").replace(/\s*>.*$/,
""),r=w.map(l.split(/\s+/),function(a){var c=a.toLowerCase();return{name:a,value:"LI"==b.nodeName&&"value"==a||"enctype"==c?b.getAttribute(c):b.getAttributeNode(c).value}}));var h=d.scope||y._scopeName;l="data-"+h+"-";var g={};"dojo"!==h&&(g[l+"props"]="data-dojo-props",g[l+"type"]="data-dojo-type",g[l+"mixins"]="data-dojo-mixins",g[h+"type"]="dojoType",g[l+"id"]="data-dojo-id");for(var k=0,e,h=[],v,p;e=r[k++];){var m=e.name,x=m.toLowerCase();e=e.value;switch(g[x]||x){case "data-dojo-type":case "dojotype":case "data-dojo-mixins":break;
case "data-dojo-props":p=e;break;case "data-dojo-id":case "jsid":v=e;break;case "data-dojo-attach-point":case "dojoattachpoint":n.dojoAttachPoint=e;break;case "data-dojo-attach-event":case "dojoattachevent":n.dojoAttachEvent=e;break;case "class":n["class"]=b.className;break;case "style":n.style=b.style&&b.style.cssText;break;default:if(m in t||(m=V(a)[x]||m),m in t)switch(typeof t[m]){case "string":n[m]=e;break;case "number":n[m]=e.length?Number(e):NaN;break;case "boolean":n[m]="false"!=e.toLowerCase();
break;case "function":""===e||-1!=e.search(/[^\w\.]+/i)?n[m]=new Function(e):n[m]=q.getObject(e,!1)||new Function(e);h.push(m);break;default:x=t[m],n[m]=x&&"length"in x?e?e.split(/\s*,\s*/):[]:x instanceof Date?""==e?new Date(""):"now"==e?new Date:S.fromISOString(e):x instanceof Q?y.baseUrl+e:H(e)}else n[m]=e}}for(r=0;r<h.length;r++)g=h[r].toLowerCase(),b.removeAttribute(g),b[g]=null;if(p)try{p=H.call(d.propsThis,"{"+p+"}"),q.mixin(n,p)}catch(W){throw Error(W.toString()+" in data-dojo-props\x3d'"+
p+"'");}q.mixin(n,c);f||(f=a&&(a._noScript||t._noScript)?[]:M("\x3e script[type^\x3d'dojo/']",b));var z=[],J=[],D=[],B=[];if(f)for(k=0;k<f.length;k++)g=f[k],b.removeChild(g),c=g.getAttribute(l+"event")||g.getAttribute("event"),d=g.getAttribute(l+"prop"),p=g.getAttribute(l+"method"),h=g.getAttribute(l+"advice"),r=g.getAttribute("type"),g=this._functionFromScript(g,l),c?"dojo/connect"==r?z.push({method:c,func:g}):"dojo/on"==r?B.push({event:c,func:g}):n[c]=g:"dojo/aspect"==r?z.push({method:p,advice:h,
func:g}):"dojo/watch"==r?D.push({prop:d,func:g}):J.push(g);a=(f=a.markupFactory||t.markupFactory)?f(n,b,a):new a(n,b);return a.then?a.then(u):u(a)},scan:function(a,b){function c(a){if(!a.inherited){a.inherited={};var b=a.node,d=c(a.parent),b={dir:b.getAttribute("dir")||d.dir,lang:b.getAttribute("lang")||d.lang,textDir:b.getAttribute(r)||d.textDir},e;for(e in b)b[e]&&(a.inherited[e]=b[e])}return a.inherited}var d=[],f=[],l={},u=(b.scope||y._scopeName)+"Type",t="data-"+(b.scope||y._scopeName)+"-",n=
t+"type",r=t+"textdir",t=t+"mixins",h=a.firstChild,g=b.inherited;if(!g){var k=function(a,b){return a.getAttribute&&a.getAttribute(b)||a.parentNode&&k(a.parentNode,b)},g={dir:k(a,"dir"),lang:k(a,"lang"),textDir:k(a,r)},e;for(e in g)g[e]||delete g[e]}e={inherited:g};for(var v,p;;)if(h)if(1!=h.nodeType)h=h.nextSibling;else if(v&&"script"==h.nodeName.toLowerCase())(g=h.getAttribute("type"))&&/^dojo\/\w/i.test(g)&&v.push(h),h=h.nextSibling;else if(p)h=h.nextSibling;else if(g=h.getAttribute(n)||h.getAttribute(u),
a=h.firstChild,g||a&&(3!=a.nodeType||a.nextSibling)){p=null;if(g){var m=h.getAttribute(t);v=m?[g].concat(m.split(/\s*,\s*/)):[g];try{p=I(v,b.contextRequire)}catch(z){}p||w.forEach(v,function(a){~a.indexOf("/")&&!l[a]&&(l[a]=!0,f[f.length]=a)});m=p&&!p.prototype._noScript?[]:null;e={types:v,ctor:p,parent:e,node:h,scripts:m};e.inherited=c(e);d.push(e)}else e={node:h,scripts:v,parent:e};v=m;p=h.stopParser||p&&p.prototype.stopParser&&!b.template;h=a}else h=h.nextSibling;else{if(!e||!e.node)break;h=e.node.nextSibling;
p=!1;e=e.parent;v=e.scripts}var q=new F;f.length?(G("dojo-debug-messages"),(b.contextRequire||E)(f,function(){q.resolve(w.filter(d,function(a){if(!a.ctor)try{a.ctor=I(a.types,b.contextRequire)}catch(B){}for(var c=a.parent;c&&!c.types;)c=c.parent;var d=a.ctor&&a.ctor.prototype;a.instantiateChildren=!(d&&d.stopParser&&!b.template);a.instantiate=!c||c.instantiate&&c.instantiateChildren;return a.instantiate}))})):q.resolve(d);return q.promise},_require:function(a,b){a=H("{"+a.innerHTML+"}");var c=[],
d=[],f=new F;b=b&&b.contextRequire||E;for(var l in a)c.push(l),d.push(a[l]);b(d,function(){for(var a=0;a<c.length;a++)q.setObject(c[a],arguments[a]);f.resolve(arguments)});return f.promise},_scanAmd:function(a,b){var c=new F,d=c.promise;c.resolve(!0);var f=this;M("script[type\x3d'dojo/require']",a).forEach(function(a){d=d.then(function(){return f._require(a,b)});a.parentNode.removeChild(a)});return d},parse:function(a,b){var c;!b&&a&&a.rootNode?(b=a,c=b.rootNode):!a||!q.isObject(a)||"nodeType"in a?
c=a:b=a;c=c?O.byId(c):P.body();b=b||{};var d=b.template?{template:!0}:{},f=[],l=this;a=this._scanAmd(c,b).then(function(){return l.scan(c,b)}).then(function(a){return l._instantiate(a,d,b,!0)}).then(function(a){return f=f.concat(a)}).otherwise(function(a){console.error("dojo/parser::parse() error",a);throw a;});q.mixin(f,a);return f}};y.parser=K;N.parseOnLoad&&U(100,K,"parse");return K});
//# sourceMappingURL=parser.js.map