luca 0.9.89 → 0.9.91

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/CHANGELOG +11 -1
  2. data/Gemfile +5 -2
  3. data/Gemfile.lock +84 -56
  4. data/Rakefile +10 -2
  5. data/app/assets/javascripts/luca/components/application.coffee +82 -89
  6. data/app/assets/javascripts/luca/components/collection_view.coffee +9 -5
  7. data/app/assets/javascripts/luca/components/controller.coffee +72 -11
  8. data/app/assets/javascripts/luca/components/fields/base.coffee +61 -8
  9. data/app/assets/javascripts/luca/components/fields/button_field.coffee +53 -7
  10. data/app/assets/javascripts/luca/components/fields/checkbox_array.coffee +12 -7
  11. data/app/assets/javascripts/luca/components/fields/text_field.coffee +1 -1
  12. data/app/assets/javascripts/luca/components/form_view.coffee +2 -2
  13. data/app/assets/javascripts/luca/components/grid_layout_view.coffee +0 -1
  14. data/app/assets/javascripts/luca/components/page.coffee +1 -0
  15. data/app/assets/javascripts/luca/components/table_view.coffee +2 -2
  16. data/app/assets/javascripts/luca/concerns/dom_helpers.coffee +2 -2
  17. data/app/assets/javascripts/luca/containers/card_view.coffee +84 -54
  18. data/app/assets/javascripts/luca/containers/container.coffee +126 -46
  19. data/app/assets/javascripts/luca/containers/modal_view.coffee +9 -9
  20. data/app/assets/javascripts/luca/containers/page_controller.coffee +25 -0
  21. data/app/assets/javascripts/luca/containers/panel_toolbar.coffee +1 -1
  22. data/app/assets/javascripts/luca/containers/viewport.coffee +2 -5
  23. data/app/assets/javascripts/luca/core/collection.coffee +18 -4
  24. data/app/assets/javascripts/luca/core/model.coffee +1 -1
  25. data/app/assets/javascripts/luca/core/panel.coffee +1 -1
  26. data/app/assets/javascripts/luca/core/view.coffee +26 -7
  27. data/app/assets/javascripts/luca/development/code_sync_manager.coffee +51 -4
  28. data/app/assets/javascripts/luca/development/console.coffee +1 -1
  29. data/app/assets/javascripts/luca/framework.coffee +1 -1
  30. data/app/assets/javascripts/luca/index.coffee +1 -0
  31. data/app/assets/javascripts/luca/util/luca.coffee +2 -1
  32. data/app/assets/stylesheets/luca/components/viewport.scss +0 -4
  33. data/bin/luca +14 -0
  34. data/docs/framework.json +1 -1
  35. data/docs/luca-framework-documentation.js +1 -0
  36. data/lib/luca/cli/generate.rb +37 -0
  37. data/lib/luca/cli/server.rb +20 -0
  38. data/lib/luca/cli/sync.rb +40 -0
  39. data/lib/luca/cli/watch.rb +16 -0
  40. data/lib/luca/cli.rb +68 -0
  41. data/lib/luca/collection/endpoint.rb +1 -0
  42. data/lib/luca/component_definition.rb +23 -5
  43. data/lib/luca/luca_application.rb +18 -7
  44. data/lib/luca/rails/version.rb +1 -1
  45. data/lib/luca/server.rb +7 -0
  46. data/lib/luca/stylesheet.rb +2 -3
  47. data/lib/luca/version.rb +3 -0
  48. data/lib/luca/watcher.rb +72 -0
  49. data/lib/luca.rb +8 -1
  50. data/luca.gemspec +14 -7
  51. data/site/.bundle/config +2 -0
  52. data/site/.gitignore +5 -0
  53. data/site/.rvmrc +1 -0
  54. data/site/CHANGELOG.md +41 -0
  55. data/site/DOCS.md +41 -0
  56. data/site/Gemfile +8 -0
  57. data/site/Gemfile.lock +134 -0
  58. data/site/LICENSE.md +19 -0
  59. data/site/config.rb +84 -0
  60. data/site/helpers/site_helpers.rb +20 -0
  61. data/site/html5bp-docs/README.md +38 -0
  62. data/site/html5bp-docs/contribute.md +104 -0
  63. data/site/html5bp-docs/crossdomain.md +21 -0
  64. data/site/html5bp-docs/css.md +135 -0
  65. data/site/html5bp-docs/extend.md +507 -0
  66. data/site/html5bp-docs/faq.md +77 -0
  67. data/site/html5bp-docs/htaccess.md +323 -0
  68. data/site/html5bp-docs/html.md +170 -0
  69. data/site/html5bp-docs/js.md +31 -0
  70. data/site/html5bp-docs/misc.md +25 -0
  71. data/site/html5bp-docs/usage.md +109 -0
  72. data/site/readme.md +47 -0
  73. data/site/source/.htaccess +540 -0
  74. data/site/source/404.html +157 -0
  75. data/site/source/app/assets/javascripts/dependencies.js.coffee +6 -0
  76. data/site/source/app/assets/javascripts/docs/application.coffee +64 -0
  77. data/site/source/app/assets/javascripts/docs/collections/docs_documentation.coffee +17 -0
  78. data/site/source/app/assets/javascripts/docs/collections/github_repositories.coffee +7 -0
  79. data/site/source/app/assets/javascripts/docs/collections/index.coffee +1 -0
  80. data/site/source/app/assets/javascripts/docs/collections/luca_documentation.coffee +17 -0
  81. data/site/source/app/assets/javascripts/docs/collections/public_gists.coffee +4 -0
  82. data/site/source/app/assets/javascripts/docs/config.coffee +5 -0
  83. data/site/source/app/assets/javascripts/docs/index.coffee +12 -0
  84. data/site/source/app/assets/javascripts/docs/lib/router.coffee +3 -0
  85. data/site/source/app/assets/javascripts/docs/lib/util.coffee +0 -0
  86. data/site/source/app/assets/javascripts/docs/models/component.coffee +99 -0
  87. data/site/source/app/assets/javascripts/docs/models/github_repository.coffee +3 -0
  88. data/site/source/app/assets/javascripts/docs/models/index.coffee +1 -0
  89. data/site/source/app/assets/javascripts/docs/templates/component_documentation.jst.ejs +55 -0
  90. data/site/source/app/assets/javascripts/docs/templates/examples_browser/overview.jst.ejs +4 -0
  91. data/site/source/app/assets/javascripts/docs/templates/examples_browser/selector.jst.ejs +11 -0
  92. data/site/source/app/assets/javascripts/docs/templates/github_repository.jst.ejs +4 -0
  93. data/site/source/app/assets/javascripts/docs/templates/layouts/main.jst.ejs +4 -0
  94. data/site/source/app/assets/javascripts/docs/templates/left_navigation.jst.ejs +5 -0
  95. data/site/source/app/assets/javascripts/docs/templates/pages/getting_started.jst.ejs +78 -0
  96. data/site/source/app/assets/javascripts/docs/templates/pages/home.jst.ejs +57 -0
  97. data/site/source/app/assets/javascripts/docs/views/components/code_editor/index.coffee +0 -0
  98. data/site/source/app/assets/javascripts/docs/views/components/code_editor.coffee +45 -0
  99. data/site/source/app/assets/javascripts/docs/views/components/component_documentation.coffee +72 -0
  100. data/site/source/app/assets/javascripts/docs/views/index.coffee +3 -0
  101. data/site/source/app/assets/javascripts/docs/views/pages/browse_source/details.coffee +37 -0
  102. data/site/source/app/assets/javascripts/docs/views/pages/browse_source/list.coffee +31 -0
  103. data/site/source/app/assets/javascripts/docs/views/pages/browse_source.coffee +46 -0
  104. data/site/source/app/assets/javascripts/docs/views/pages/component_editor.coffee +10 -0
  105. data/site/source/app/assets/javascripts/docs/views/pages/examples_browser/docs.coffee +12 -0
  106. data/site/source/app/assets/javascripts/docs/views/pages/examples_browser/source.coffee +13 -0
  107. data/site/source/app/assets/javascripts/docs/views/pages/examples_browser.coffee +102 -0
  108. data/site/source/app/assets/javascripts/docs/views/pages/home.coffee +10 -0
  109. data/site/source/app/assets/javascripts/docs/views/views/api_browser/index.coffee +43 -0
  110. data/site/source/app/assets/javascripts/docs/views/views/collection_view_examples/grid_layout_view_example.coffee +14 -0
  111. data/site/source/app/assets/javascripts/docs/views/views/collection_view_examples/table_view_example.coffee +39 -0
  112. data/site/source/app/assets/javascripts/docs/views/views/form_view_examples/basic_example.coffee +38 -0
  113. data/site/source/app/assets/javascripts/docs/views/views/form_view_examples/complex_layout.coffee +110 -0
  114. data/site/source/app/assets/javascripts/docs/views/views/top_navigation.coffee +6 -0
  115. data/site/source/app/assets/javascripts/docs-docs.js +1 -0
  116. data/site/source/app/assets/javascripts/luca-docs.js +1 -0
  117. data/site/source/app/assets/javascripts/luca-framework-documentation.js +1 -0
  118. data/site/source/app/assets/javascripts/site.js.coffee +4 -0
  119. data/site/source/app/assets/javascripts/vendor/codemirror.js +4786 -0
  120. data/site/source/app/assets/javascripts/vendor/coffeescript.js +346 -0
  121. data/site/source/app/assets/javascripts/vendor/css.js +465 -0
  122. data/site/source/app/assets/javascripts/vendor/htmlmixed.js +84 -0
  123. data/site/source/app/assets/javascripts/vendor/javascript.js +422 -0
  124. data/site/source/app/assets/javascripts/vendor/js-beautify.js +1353 -0
  125. data/site/source/app/assets/javascripts/vendor/modernizr-2.6.1.min.js +4 -0
  126. data/site/source/app/assets/javascripts/vendor/vim.js +2511 -0
  127. data/site/source/app/assets/stylesheets/docs/api-browser.css.scss +5 -0
  128. data/site/source/app/assets/stylesheets/docs/application.css.scss +35 -0
  129. data/site/source/app/assets/stylesheets/docs/browse-source.css.scss +5 -0
  130. data/site/source/app/assets/stylesheets/docs/scrollable-table.css.scss +5 -0
  131. data/site/source/app/assets/stylesheets/site.css.scss +2 -0
  132. data/site/source/app/assets/stylesheets/vendor/codemirror.css +240 -0
  133. data/site/source/app/assets/stylesheets/vendor/prettify-tomorrow-night-bright.css +160 -0
  134. data/site/source/app/assets/stylesheets/vendor/twilight.css +26 -0
  135. data/site/source/crossdomain.xml +15 -0
  136. data/site/source/documentation.html.haml +1 -0
  137. data/site/source/favicon_base.png +0 -0
  138. data/site/source/humans.txt +15 -0
  139. data/site/source/images/background.png +0 -0
  140. data/site/source/images/middleman.png +0 -0
  141. data/site/source/index.html.haml +1 -0
  142. data/site/source/layouts/layout.haml +55 -0
  143. data/site/source/readme.md +63 -0
  144. data/site/source/robots.txt +3 -0
  145. data/spec/javascripts/components/collection_view_spec.coffee +1 -1
  146. data/spec/javascripts/containers/card_view_spec.coffee +58 -5
  147. data/spec/javascripts/core/collection_spec.coffee +1 -1
  148. data/spec/javascripts/core/view_spec.coffee +2 -2
  149. data/vendor/assets/javascripts/backbone-min.js +37 -33
  150. data/vendor/assets/javascripts/backbone-query.min.js +1 -1
  151. data/vendor/assets/javascripts/jquery.js +5 -4
  152. data/vendor/assets/javascripts/luca-dependencies.min.js +8 -6
  153. data/vendor/assets/javascripts/luca-development.min.js +1 -1
  154. data/vendor/assets/javascripts/luca.full.min.js +12 -10
  155. data/vendor/assets/javascripts/luca.min.js +5 -5
  156. data/vendor/assets/javascripts/underscore-min.js +1 -5
  157. data/vendor/assets/javascripts/underscore-string.min.js +1 -1
  158. data/vendor/assets/stylesheets/luca-components.css +0 -2
  159. data/vendor/assets/stylesheets/luca-development.css +1 -1
  160. metadata +215 -39
  161. data/app/assets/javascripts/luca/components/page_controller.coffee +0 -3
  162. data/app/assets/javascripts/luca/core/collection_view.coffee +0 -150
  163. data/site/assets/bootstrap.min.js +0 -7
  164. data/site/assets/dependencies.js +0 -94
  165. data/site/assets/glyphicons-halflings-white.png +0 -0
  166. data/site/assets/glyphicons-halflings.png +0 -0
  167. data/site/assets/luca-ui-bootstrap.css +0 -1331
  168. data/site/assets/luca-ui-bootstrap.js +0 -9
  169. data/site/assets/luca-ui-development-tools.css +0 -234
  170. data/site/assets/luca-ui-development-tools.js +0 -18561
  171. data/site/assets/luca-ui-development-tools.min.js +0 -15
  172. data/site/assets/luca-ui-full.min.js +0 -8
  173. data/site/assets/luca-ui.min.js +0 -4
  174. data/site/assets/sandbox.css +0 -62
  175. data/site/assets/sandbox.js +0 -469
  176. data/site/docs/application.html +0 -41
  177. data/site/docs/caching.html +0 -43
  178. data/site/docs/collection.html +0 -75
  179. data/site/docs/collection_manager.html +0 -71
  180. data/site/docs/containers.html +0 -118
  181. data/site/docs/events.html +0 -153
  182. data/site/docs/view.html +0 -128
  183. data/site/img/glyphicons-halflings-white.png +0 -0
  184. data/site/img/glyphicons-halflings.png +0 -0
  185. data/site/index.html +0 -20
  186. data/site/source-map.js +0 -1
@@ -1 +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(Backbone.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:Backbone.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);
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);