Sha256: 882d3e339fe0aa61fd46e0ad27ca0d1069d5595e542b8a422c2d8d1dd651b6d4

Contents?: true

Size: 1.67 KB

Versions: 2

Compression:

Stored size: 1.67 KB

Contents

Appcelerator.Module.Template={getName:function(){return"appcelerator template"},getDescription:function(){return"template widget"},getVersion:function(){return 1},getSpecVersion:function(){return 1},getAuthor:function(){return"Jeff Haynie"},getModuleURL:function(){return"http://www.appcelerator.org"},isWidget:function(){return true},getWidgetName:function(){return"app:template"},execute:function(D,A,C,B){Appcelerator.Module.Template.fetch(D,A["src"],A["args"])},getAttributes:function(){return[{name:"src",optional:false,description:"The source for the template file to load."},{name:"args",optional:true,description:"Used to replace text in the template file."}]},buildWidget:function(E,I,B){var A=I["src"];var F=I["args"];var H={};E.innerHTML=Appcelerator.Compiler.getHtml(E);if(E.childNodes.length>0){for(var G=0;G<E.childNodes.length;G++){var D=E.childNodes[G];if(D.nodeType==1){var C=D.getAttribute("id");H[C]=Appcelerator.Compiler.getHtml(D,true)}}}Appcelerator.Module.Template.fetch(E.id,E.scope,A,F,H,B);return{"position":Appcelerator.Compiler.POSITION_REPLACE,"presentation":""}},fetch:function(E,B,F,A,D,C){C.pending++;Appcelerator.Util.IFrame.fetch(F,function(K){if(A){var I=K.innerHTML;var H=Appcelerator.Compiler.compileTemplate(I);I=H(A.evalJSON());K.innerHTML=I}for(var G in D){if(typeof G=="string"){var J=K.ownerDocument.getElementById(G);if(J){J.innerHTML=D[G]}else{Logger.warn("Element with id = "+G+" not found in "+F)}}}var H=$(E);H.setAttribute("scope",B);H.innerHTML=Appcelerator.Compiler.getHtml(K);C.pending--;Appcelerator.Compiler.compileElement(H,C,false);Appcelerator.Compiler.checkLoadState(C)})}};Appcelerator.Core.registerModule("app:template",Appcelerator.Module.Template)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
appcelerator-2.0.2 appcelerator/templates/modules/app_template/app_template.js
appcelerator-2.0.1.1 appcelerator/templates/modules/app_template/app_template.js