vendor/assets/javascripts/luca-development.min.js in luca-0.9.91 vs vendor/assets/javascripts/luca-development.min.js in luca-0.9.899

- old
+ new

@@ -1 +1 @@ -(function(){var a;a={readOnly:!1,lineNumbers:!0,gutter:!0,autofocus:!1,passDelay:50,autoClearEmptyLines:!0,smartIndent:!1,tabSize:2,electricChars:!1},Luca.define("Luca.tools.CodeMirrorField")["extends"]("Luca.Panel")["with"]({bodyClassName:"codemirror-wrapper",preProcessors:[],postProcessors:[],codemirrorOptions:function(){var b,c,d=this;return c=_.clone(a),b={mode:this.mode||"coffeescript",theme:this.theme||"monokai",keyMap:this.keyMap||"basic",lineNumbers:this.lineNumbers!=null?this.lineNumbers:a.lineNumbers,readOnly:this.readOnly!=null?this.readOnly:a.readOnly,gutter:this.gutter!=null?this.gutter:a.gutter,lineWrapping:this.lineWrapping===!0,onChange:function(){var a;return d.trigger("editor:change",d),(a=d.onEditorChange)!=null?a.call(d):void 0}},this.onKeyEvent!=null&&(b.onKeyEvent=_.bind(this.onKeyEvent,this)),_.extend(c,b)},getCodeMirror:function(){return this.instance},getValue:function(a){var b;return a==null&&(a=!0),b=this.getCodeMirror().getValue()},setValue:function(a,b){return a==null&&(a=""),b==null&&(b=!0),this.getCodeMirror().setValue(a)},afterRender:function(){return this.instance=CodeMirror(this.$bodyEl()[0],this.codemirrorOptions()),console.log("After Render On Code Mirror Field"),this.setMaxHeight(),this.setHeight()},setMaxHeight:function(a,b){a==null&&(a=void 0),b==null&&(b=!0),a||(a=this.maxHeight);if(a==null)return;this.$(".CodeMirror-scroll").css("max-height",a);if(b===!0)return this.$(".CodeMirror-scroll").css("height",a)},setHeight:function(a){a==null&&(a=void 0);if(a!=null)return this.$(".CodeMirror-scroll").css("height",a)}})}).call(this),function(){var developmentConsole,_base;developmentConsole=Luca.register("Luca.tools.DevelopmentConsole"),developmentConsole["extends"]("Luca.Container"),developmentConsole.defines({className:"luca-ui-console",name:"console",history:[],historyIndex:0,width:1e3,componentEvents:{"input key:keyup":"historyUp","input key:keydown":"historyDown","input key:enter":"runCommand"},compileOptions:{bare:!0},components:[{type:"code_mirror_field",role:"code_mirror",additionalClassNames:"clearfix",name:"code_output",readOnly:!0,lineNumbers:!1,mode:"javascript",lineWrapping:!0,gutter:!1},{type:"text_field",name:"code_input",role:"input",lineNumbers:!1,height:"30px",maxHeight:"30px",gutter:!1,autoBindEventHandlers:!0,hideLabel:!0,prepend:"Coffee>",events:{"keypress input":"onKeyEvent","keydown input":"onKeyEvent"},onKeyEvent:function(a){a.type==="keypress"&&a.keyCode===Luca.keys.ENTER&&this.trigger("key:enter",this.getValue()),a.type==="keydown"&&a.keyCode===Luca.keys.KEYUP&&this.trigger("key:keyup");if(a.type==="keydown"&&a.keyCode===Luca.keys.KEYDOWN)return this.trigger("key:keydown")},afterRender:function(){return this.$("input").focus()}}],afterRender:function(){var a;this.$container().modal({backdrop:!1});if(this.width!=null)return a=parseInt(this.width)*.5*-1,this.$container().css("width",this.width).css("margin-left",parseInt(a))},show:function(a){return a==null&&(a={}),this.$container().modal("show"),this},getContext:function(){return window},initialize:function(){return this._super("initialize",this,arguments),_.bindAll(this,"historyUp","historyDown","onSuccess","onError","runCommand")},saveHistory:function(a){return(a!=null?a.length:void 0)>0&&this.history.push(a),this.historyIndex=0},historyUp:function(){var a;return this.historyIndex-=1,this.historyIndex<0&&(this.historyIndex=0),a=this.getInput().getValue(),this.getInput().setValue(this.history[this.historyIndex]||a)},historyDown:function(){var a;return this.historyIndex+=1,this.historyIndex>this.history.length-1&&(this.historyIndex=this.history.length-1),a=this.getInput().getValue(),this.getInput().setValue(this.history[this.historyIndex]||a)},append:function(a,b,c){var d,e,f,g;return c==null&&(c=!1),e=this.getCodeMirror(),d=e.getValue(),a!=null&&(g="// "+a),f=c||a.match(/^console\.log/)?[d,b]:[d,g,b],e.setValue(_.compact(f).join("\n")),e.getCodeMirror().scrollTo(0,9e4)},onSuccess:function(a,b,c){var d;this.saveHistory(c),d="";if(_.isArray(a)||_.isObject(a)||_.isString(a)||_.isNumber(a))d=JSON.stringify(a,null," ");return d||(d=typeof a.toString=="function"?a.toString():void 0),this.append(b,d||"undefined")},onError:function(a,b,c){return this.append(b,"// ERROR: "+a.message)},evaluateCode:function(code,raw){var dev,evaluator,output,result;if(!((code!=null?code.length:void 0)>0))return;raw=_.string.strip(raw),output=this.getCodeMirror(),dev=this,evaluator=function(){var console,log,old_console,result;old_console=window.console,console={log:function(){var a,b,c,d;d=[];for(b=0,c=arguments.length;b<c;b++)a=arguments[b],d.push(dev.append(void 0,a,!0));return d}},log=console.log;try{result=eval(code)}catch(error){throw window.console=old_console,error}return window.console=old_console,result};try{result=evaluator.call(this.getContext()),Luca.isComponent(result)?result=Luca.util.inspectComponent(result):Luca.isComponentPrototype(result)&&(result=Luca.util.inspectComponentPrototype(result));if(!raw.match(/^console\.log/))return this.onSuccess(result,code,raw)}catch(error){return this.onError(error,code,raw)}},runCommand:function(){var a,b,c,d;return c=this,a=_.bind(Luca.tools.CoffeeEditor.prototype.compile,this),d=this.getInput().getValue(),b=a(d,function(a){return c.evaluateCode(a,d)})}}),(_base=Luca.util).launchers||(_base.launchers={}),Luca.util.inspectComponentPrototype=function(a){var b;return b=Luca.registry.findInstancesByClass(a)},Luca.util.inspectComponent=function(a){return _.isString(a)&&(a=Luca(a)),{name:a.name,instanceOf:a.displayName,subclassOf:a._superClass().prototype.displayName,inheritsFrom:Luca.parentClasses(a)}},Luca.util.launchers.developmentConsole=function(a){var b=this;return a==null&&(a="luca-development-console"),this._lucaDevConsole=Luca(a,function(){var c;return b.$el.append(Luca.View.prototype.make("div",{id:""+a+"-wrapper","class":"modal fade large"})),c=new Luca.tools.DevelopmentConsole({name:a,container:"#"+a+"-wrapper"}),c.render(),c.getCodeMirror().setHeight(602)}),this._lucaDevConsole.show(),Luca(a)}}.call(this),function(){var codeManager;codeManager=Luca.register("Luca.CodeSyncManager"),codeManager["extends"]("Luca.SocketManager"),codeManager.publicConfiguration({host:Luca.config.codeSyncHost||"//localhost:9292/faye",namespace:"luca",channel:Luca.config.codeSyncChannel||"/luca-code-sync"}),codeManager.classMethods({setup:function(a){return a==null&&(a={}),this.codeSyncManager=new Luca.CodeSyncManager(a),this.codeSyncManager.trigger("ready")}}),codeManager.privateMethods({initialize:function(a){return this.attributes=a!=null?a:{},this.attributes.host==null&&_.extend(this.attributes,{host:this.host||Luca.config.codeSyncHost}),Luca.SocketManager.prototype.initialize.call(this,this.attributes),this.bindToChannel()},start:function(){return this.trigger("ready")},bindToChannel:function(){var a=this;return this.client!=null?this.client.subscribe(this.channel,function(){return a.onChangesNotification.apply(a,arguments)}):this.on("change:client",function(b,c){return a.client.subscribe(a.channel,function(){return a.onChangesNotification.apply(a,arguments)})})},onChangesNotification:function(a,b){var c,d=this;a==null&&(a={});if(_.isEmpty(a))return;c=_(a).values()[0]||{},c.type==="template"&&(this.processTemplate(c),this.rerunSyncPad(c.type)),c.type==="component_definition"&&(this.processComponentDefinitionChange(c),this.processJavascriptChange(c),_.delay(function(){return d.rerunSyncPad(c.type)},25)),c.type==="javascript"&&this.processJavascriptChange(c);if(c.type==="stylesheet"&&(c!=null?c.path:void 0))return this.processStylesheetChange(c)},rerunSyncPad:function(){var a;if(a=this.get("last_syncpad_javascript_payload"))return this.processJavascriptChange(a)},processTemplate:function(change){var fn;return change==null&&(change={}),fn=function(){return eval(change.contents)},fn.apply(window)},processComponentDefinitionChange:function(a){var b;a==null&&(a={});if(_.isEmpty(a))return;this.components||(this.components=Luca.collections.Components.generate());if(a.class_name!=null){b=this.components.findByClassName(a.class_name);if(b&&a.source_file_contents!=null)return b.set({source_file_contents:a.source_file_contents})}},processJavascriptChange:function(a){var b,c,d;a==null&&(a={});if(a!=null?!a.compiled:!void 0)return;return b=$("body script[data-path='"+a.source+"']"),b.length>1&&b.remove(),((d=a.source)!=null?d.match(/syncpad/):void 0)&&(a!=null?a.compiled:void 0)&&!0&&this.set("last_syncpad_javascript_payload",a),c=this.make("script",{"data-path":a.source,type:"text/javascript"},a.compiled),$("body").append(c)},processStylesheetChange:function(a){var b;a==null&&(a={});if(_.isEmpty(a))return;return((b=a.path)!=null?b.match(/syncpad/):void 0)||Luca.config.codeSyncStylesheetMode==="single"?this.syncStylesheet(a):this.replaceStylesheetAndEverythingAfter(a.path)},replaceStylesheetAndEverythingAfter:function(a){var b,c,d,e,f,g;g=a.replace("./app/assets/stylesheets",Luca.config.assetsUrlPrefix),g=g.replace(".scss",""),d=$("link[href*='"+g+"']"),e=d.parent();if(d.length>0)return f=d.clone(),c=d.nextAll("link"),b=c.clone(),$(d,c).remove(),e.append(f),e.append(b);return},syncStylesheet:function(a){var b,c;b=$("head style[data-file='"+a.path+"']"),b.length>0&&b.remove();if(a.compiled!=null||a.contents!=null)return c=this.make("style",{"data-file":a.path,type:"text/css"},a.compiled||a.contents),$("head").append(c)}}),codeManager.defines({make:Luca.View.prototype.make})}.call(this),function(){var a;a=Luca.register("Luca.models.Component"),a["extends"]("Luca.Model"),a.configuration({defaults:{class_name:void 0,superClass:void 0,asset_id:void 0,source_file_contents:"",defined_in_file:""}}),a.defines({idAttribute:"class_name",documentation:function(){var a;return a=_(this.toJSON()).pick("header_documentation","class_name","defined_in_file"),_.extend(a,this.metaData(),{componentGroup:this.componentGroup(),componentType:this.componentType(),componentTypeAlias:this.componentTypeAlias(),details:{publicMethods:this.documentationFor("publicMethods"),privateMethods:this.documentationFor("privateMethods"),privateProperties:this.documentationFor("privateProperties"),publicProperties:this.documentationFor("publicProperties")}})},documentationFor:function(a){var b,c,d,e;return a==null&&(a="publicMethods"),b=_.extend({},this.get("defines_methods"),this.get("defines_properties")),d={},(c=(e=this.metaData())!=null?typeof e[a]=="function"?e[a]():void 0:void 0)&&_(c).reduce(function(a,c){return a[c]=b[c],a},d),d},url:function(){return"/project/components/"+Luca.namespace+"/"+this.classNameId()},metaData:function(){return Luca(this.get("class_name")).prototype.componentMetaData()},classNameId:function(){return this.get("class_name").replace(/\./g,"__")},componentGroup:function(){var a;return a=this.get("class_name").split("."),a.slice(0,2).join(".")},componentType:function(){var a,b,c,d;d="view",c=this.get("class_name").split(".");switch(b=c[1]){case"collections":"collection";break;case"models":"model";break;case"views":"view"}if(b!=null)return;if(a=Luca.util.resolve(this.get("class_name"))){if(Luca.isViewPrototype(a.prototype))return"view";if(Luca.isCollectionPrototype(a.prototype))return"collection";if(Luca.isModelProtoype(a.prototype))return"model"}return"view"},componentTypeAlias:function(){var a,b;return b=this.get("class_name").split("."),a=b.pop(),_.str.underscored(a)}})}.call(this),function(){var a;a=Luca.register("Luca.collections.Components"),a["extends"]("Luca.Collection"),a.configuration({model:Luca.models.Component,namespace:"components"}),a.classMethods({generate:function(){return this.collection=new Luca.collections.Components,this.collection.fetch(),this.collection}}),a.defines({findByClassName:function(a){return this.detect(function(b){return b.get("class_name")===a})},filterByNamespace:function(a){return this.query({class_name:{$like:a}})},classNames:function(){return this.pluck("class_name")},groupsInsideOf:function(a){var b,c,d,e,f,g,h;b=this.filterByNamespace(a),d={};for(e=0,f=b.length;e<f;e++)c=b[e],d[c.componentGroup()]==null&&((g=c.get("class_name"))!=null?(h=g.split("."))!=null?h.length:void 0:void 0)>2&&(d[c.componentGroup()]=c.componentGroup().split(".")[1]);return _.values(d)},namespaces:function(){var a;return a=_(this.classNames()).map(function(a){return a.split(".")[0]}),_(a).uniq()},fetch:function(a){return a==null&&(a={}),this.populateFromRegistry(a)},comparator:function(a){return a.get("class_name")},populateFromRegistry:function(a){var b,c,d;return a==null&&(a={}),d=function(){var a,c,d,e;d=Luca.registry.classes(!0),e=[];for(a=0,c=d.length;a<c;a++)b=d[a],e.push({class_name:b,name:b});return e}(),a.namespace&&(d=function(){var b,e,f;f=[];for(b=0,e=d.length;b<e;b++)c=d[b],c.name.match(a.namespace)&&f.push(c);return f}()),this.reset(d,a={})}})}.call(this),function(){}.call(this); +(function(){var a;a={readOnly:!1,lineNumbers:!0,gutter:!0,autofocus:!1,passDelay:50,autoClearEmptyLines:!0,smartIndent:!1,tabSize:2,electricChars:!1},Luca.define("Luca.tools.CodeMirrorField")["extends"]("Luca.Panel")["with"]({bodyClassName:"codemirror-wrapper",preProcessors:[],postProcessors:[],codemirrorOptions:function(){var b,c,d=this;return c=_.clone(a),b={mode:this.mode||"coffeescript",theme:this.theme||"monokai",keyMap:this.keyMap||"basic",lineNumbers:this.lineNumbers!=null?this.lineNumbers:a.lineNumbers,readOnly:this.readOnly!=null?this.readOnly:a.readOnly,gutter:this.gutter!=null?this.gutter:a.gutter,lineWrapping:this.lineWrapping===!0,onChange:function(){var a;return d.trigger("editor:change",d),(a=d.onEditorChange)!=null?a.call(d):void 0}},this.onKeyEvent!=null&&(b.onKeyEvent=_.bind(this.onKeyEvent,this)),_.extend(c,b)},getCodeMirror:function(){return this.instance},getValue:function(a){var b;return a==null&&(a=!0),b=this.getCodeMirror().getValue()},setValue:function(a,b){return a==null&&(a=""),b==null&&(b=!0),this.getCodeMirror().setValue(a)},afterRender:function(){return this.instance=CodeMirror(this.$bodyEl()[0],this.codemirrorOptions()),console.log("After Render On Code Mirror Field"),this.setMaxHeight(),this.setHeight()},setMaxHeight:function(a,b){a==null&&(a=void 0),b==null&&(b=!0),a||(a=this.maxHeight);if(a==null)return;this.$(".CodeMirror-scroll").css("max-height",a);if(b===!0)return this.$(".CodeMirror-scroll").css("height",a)},setHeight:function(a){a==null&&(a=void 0);if(a!=null)return this.$(".CodeMirror-scroll").css("height",a)}})}).call(this),function(){var developmentConsole,_base;developmentConsole=Luca.register("Luca.tools.DevelopmentConsole"),developmentConsole["extends"]("Luca.Container"),developmentConsole.defines({className:"luca-ui-console",name:"console",history:[],historyIndex:0,width:1e3,componentEvents:{"input key:keyup":"historyUp","input key:keydown":"historyDown","input key:enter":"runCommand"},compileOptions:{bare:!0},components:[{type:"code_mirror_field",role:"code_mirror",additionalClassNames:"clearfix",name:"code_output",readOnly:!0,lineNumbers:!1,mode:"javascript",lineWrapping:!0,gutter:!1},{type:"text_field",name:"code_input",role:"input",lineNumbers:!1,height:"30px",maxHeight:"30px",gutter:!1,autoBindEventHandlers:!0,hideLabel:!0,prepend:"Coffee>",events:{"keypress input":"onKeyEvent","keydown input":"onKeyEvent"},onKeyEvent:function(a){a.type==="keypress"&&a.keyCode===Luca.keys.ENTER&&this.trigger("key:enter",this.getValue()),a.type==="keydown"&&a.keyCode===Luca.keys.KEYUP&&this.trigger("key:keyup");if(a.type==="keydown"&&a.keyCode===Luca.keys.KEYDOWN)return this.trigger("key:keydown")},afterRender:function(){return this.$("input").focus()}}],afterRender:function(){var a;this.$container().modal({backdrop:!1});if(this.width!=null)return a=parseInt(this.width)*.5*-1,this.$container().css("width",this.width).css("margin-left",parseInt(a))},show:function(a){return a==null&&(a={}),this.$container().modal("show"),this},getContext:function(){return window},initialize:function(){return this._super("initialize",this,arguments),_.bindAll(this,"historyUp","historyDown","onSuccess","onError","runCommand")},saveHistory:function(a){return(a!=null?a.length:void 0)>0&&this.history.push(a),this.historyIndex=0},historyUp:function(){var a;return this.historyIndex-=1,this.historyIndex<0&&(this.historyIndex=0),a=this.getInput().getValue(),this.getInput().setValue(this.history[this.historyIndex]||a)},historyDown:function(){var a;return this.historyIndex+=1,this.historyIndex>this.history.length-1&&(this.historyIndex=this.history.length-1),a=this.getInput().getValue(),this.getInput().setValue(this.history[this.historyIndex]||a)},append:function(a,b,c){var d,e,f,g;return c==null&&(c=!1),e=this.getCodeMirror(),d=e.getValue(),a!=null&&(g="// "+a),f=c||a.match(/^console\.log/)?[d,b]:[d,g,b],e.setValue(_.compact(f).join("\n")),e.getCodeMirror().scrollTo(0,9e4)},onSuccess:function(a,b,c){var d;this.saveHistory(c),d="";if(_.isArray(a)||_.isObject(a)||_.isString(a)||_.isNumber(a))d=JSON.stringify(a,null," ");return d||(d=typeof a.toString=="function"?a.toString():void 0),this.append(b,d||"undefined")},onError:function(a,b,c){return this.append(b,"// ERROR: "+a.message)},evaluateCode:function(code,raw){var dev,evaluator,output,result;if(!((code!=null?code.length:void 0)>0))return;raw=_.string.strip(raw),output=this.getCodeMirror(),dev=this,evaluator=function(){var console,log,old_console,result;old_console=window.console,console={log:function(){var a,b,c,d;d=[];for(b=0,c=arguments.length;b<c;b++)a=arguments[b],d.push(dev.append(void 0,a,!0));return d}},log=console.log;try{result=eval(code)}catch(error){throw window.console=old_console,error}return window.console=old_console,result};try{result=evaluator.call(this.getContext()),Luca.isComponent(result)?result=Luca.util.inspectComponent(result):Luca.isComponentPrototype(result)&&(result=Luca.util.inspectComponentPrototype(result));if(!raw.match(/^console\.log/))return this.onSuccess(result,code,raw)}catch(error){return this.onError(error,code,raw)}},runCommand:function(){var a,b,c,d;return c=this,a=_.bind(Luca.tools.CoffeeEditor.prototype.compile,this),d=this.getInput().getValue(),b=a(d,function(a){return c.evaluateCode(a,d)})}}),(_base=Luca.util).launchers||(_base.launchers={}),Luca.util.inspectComponentPrototype=function(a){var b;return b=Luca.registry.findInstancesByClass(a)},Luca.util.inspectComponent=function(a){return _.isString(a)&&(a=Luca(a)),{name:a.name,instanceOf:a.displayName,subclassOf:a._superClass().prototype.displayName,inheritsFrom:Luca.parentClasses(a)}},Luca.util.launchers.developmentConsole=function(a){var b=this;return a==null&&(a="luca-development-console"),this._lucaDevConsole=Luca(a,function(){var c;return b.$el.append(Luca.View.prototype.make("div",{id:""+a+"-wrapper","class":"modal fade large"})),c=new Luca.tools.DevelopmentConsole({name:a,container:"#"+a+"-wrapper"}),c.render(),c.getCodeMirror().setHeight(602)}),this._lucaDevConsole.show(),Luca(a)}}.call(this),function(){var codeManager;codeManager=Luca.register("Luca.CodeSyncManager"),codeManager["extends"]("Luca.SocketManager"),codeManager.publicConfiguration({host:Luca.config.codeSyncHost||"http://localhost:9292/faye",namespace:"luca",channel:Luca.config.codeSyncChannel||"/changes"}),codeManager.classMethods({setup:function(a){return a==null&&(a={}),this.codeSyncManager=new Luca.CodeSyncManager(a),this.codeSyncManager.trigger("ready")}}),codeManager.privateMethods({initialize:function(a){return this.attributes=a!=null?a:{},this.attributes.host==null&&_.extend(this.attributes,{host:this.host||Luca.config.codeSyncHost}),Luca.SocketManager.prototype.initialize.call(this,this.attributes),this.bindToChannel()},bindToChannel:function(){var a=this;return this.client!=null?this.client.subscribe(this.channel,function(){return a.onChangesNotification.apply(a,arguments)}):this.on("change:client",function(b,c){return a.client.subscribe(a.channel,function(){return a.onChangesNotification.apply(a,arguments)})})},onChangesNotification:function(a,b){var c,d=this;a==null&&(a={});if(_.isEmpty(a))return;c=_(a).values()[0]||{},c.type==="template"&&(this.processTemplate(c),this.rerunSyncPad(c.type)),c.type==="component_definition"&&(this.processComponentDefinitionChange(c),this.processJavascriptChange(c),_.delay(function(){return d.rerunSyncPad(c.type)},25)),c.type==="javascript"&&this.processJavascriptChange(c);if(c.type==="stylesheet"&&(c!=null?c.path:void 0))return this.processStylesheetChange(c)},rerunSyncPad:function(){var a;if(a=this.get("last_syncpad_javascript_payload"))return this.processJavascriptChange(a)},processTemplate:function(change){var fn;return change==null&&(change={}),fn=function(){return eval(change.contents)},fn.apply(window)},processComponentDefinitionChange:function(a){var b;a==null&&(a={});if(_.isEmpty(a))return;this.components||(this.components=Luca.collections.Components.generate());if(a.class_name!=null){b=this.components.findByClassName(a.class_name);if(b&&a.source_file_contents!=null)return b.set({source_file_contents:a.source_file_contents})}},processJavascriptChange:function(a){var b,c,d;a==null&&(a={});if(a!=null?!a.compiled:!void 0)return;return b=$("body script[data-path='"+a.source+"']"),b.length>1&&b.remove(),((d=a.source)!=null?d.match(/syncpad/):void 0)&&(a!=null?a.compiled:void 0)&&!0&&this.set("last_syncpad_javascript_payload",a),c=this.make("script",{"data-path":a.source,type:"text/javascript"},a.compiled),$("body").append(c)},processStylesheetChange:function(a){var b;a==null&&(a={});if(_.isEmpty(a))return;return((b=a.path)!=null?b.match(/syncpad/):void 0)||Luca.config.codeSyncStylesheetMode==="single"?this.syncStylesheet(a):this.replaceStylesheetAndEverythingAfter(a.path)},replaceStylesheetAndEverythingAfter:function(a){var b,c,d,e,f,g;g=a.replace("./app/assets/stylesheets",Luca.config.assetsUrlPrefix),g=g.replace(".scss",""),d=$("link[href*='"+g+"']"),e=d.parent();if(d.length>0)return f=d.clone(),c=d.nextAll("link"),b=c.clone(),$(d,c).remove(),e.append(f),e.append(b);return},syncStylesheet:function(a){var b,c;b=$("head style[data-file='"+a.path+"']"),b.length>0&&b.remove();if(a.compiled!=null||a.contents!=null)return c=this.make("style",{"data-file":a.path,type:"text/css"},a.compiled||a.contents),$("head").append(c)}}),codeManager.defines({make:Luca.View.prototype.make})}.call(this),function(){var a;a=Luca.register("Luca.models.Component"),a["extends"]("Luca.Model"),a.configuration({defaults:{class_name:void 0,superClass:void 0,asset_id:void 0,source_file_contents:"",defined_in_file:""}}),a.defines({idAttribute:"class_name",documentation:function(){var a;return a=_(this.toJSON()).pick("header_documentation","class_name","defined_in_file"),_.extend(a,this.metaData(),{componentGroup:this.componentGroup(),componentType:this.componentType(),componentTypeAlias:this.componentTypeAlias(),details:{publicMethods:this.documentationFor("publicMethods"),privateMethods:this.documentationFor("privateMethods"),privateProperties:this.documentationFor("privateProperties"),publicProperties:this.documentationFor("publicProperties")}})},documentationFor:function(a){var b,c,d,e;return a==null&&(a="publicMethods"),b=_.extend({},this.get("defines_methods"),this.get("defines_properties")),d={},(c=(e=this.metaData())!=null?typeof e[a]=="function"?e[a]():void 0:void 0)&&_(c).reduce(function(a,c){return a[c]=b[c],a},d),d},url:function(){return"/project/components/"+Luca.namespace+"/"+this.classNameId()},metaData:function(){return Luca(this.get("class_name")).prototype.componentMetaData()},classNameId:function(){return this.get("class_name").replace(/\./g,"__")},componentGroup:function(){var a;return a=this.get("class_name").split("."),a.slice(0,2).join(".")},componentType:function(){var a,b,c,d;d="view",c=this.get("class_name").split(".");switch(b=c[1]){case"collections":"collection";break;case"models":"model";break;case"views":"view"}if(b!=null)return;if(a=Luca.util.resolve(this.get("class_name"))){if(Luca.isViewPrototype(a.prototype))return"view";if(Luca.isCollectionPrototype(a.prototype))return"collection";if(Luca.isModelProtoype(a.prototype))return"model"}return"view"},componentTypeAlias:function(){var a,b;return b=this.get("class_name").split("."),a=b.pop(),_.str.underscored(a)}})}.call(this),function(){var a;a=Luca.register("Luca.collections.Components"),a["extends"]("Luca.Collection"),a.configuration({model:Luca.models.Component,namespace:"components"}),a.classMethods({generate:function(){return this.collection=new Luca.collections.Components,this.collection.fetch(),this.collection}}),a.defines({findByClassName:function(a){return this.detect(function(b){return b.get("class_name")===a})},filterByNamespace:function(a){return this.query({class_name:{$like:a}})},classNames:function(){return this.pluck("class_name")},groupsInsideOf:function(a){var b,c,d,e,f,g,h;b=this.filterByNamespace(a),d={};for(e=0,f=b.length;e<f;e++)c=b[e],d[c.componentGroup()]==null&&((g=c.get("class_name"))!=null?(h=g.split("."))!=null?h.length:void 0:void 0)>2&&(d[c.componentGroup()]=c.componentGroup().split(".")[1]);return _.values(d)},namespaces:function(){var a;return a=_(this.classNames()).map(function(a){return a.split(".")[0]}),_(a).uniq()},fetch:function(a){return a==null&&(a={}),this.populateFromRegistry(a)},comparator:function(a){return a.get("class_name")},populateFromRegistry:function(a){var b,c,d;return a==null&&(a={}),d=function(){var a,c,d,e;d=Luca.registry.classes(!0),e=[];for(a=0,c=d.length;a<c;a++)b=d[a],e.push({class_name:b,name:b});return e}(),a.namespace&&(d=function(){var b,e,f;f=[];for(b=0,e=d.length;b<e;b++)c=d[b],c.name.match(a.namespace)&&f.push(c);return f}()),this.reset(d,a={})}})}.call(this),function(){}.call(this); \ No newline at end of file