Permalink
Browse files

Updating generators, references

  • Loading branch information...
1 parent 03b7a20 commit 8a9fc7408ba5b7bb170b791dcdb34a0d12e7f4cd @daffl daffl committed Oct 23, 2012
2 can
Submodule can updated from 033019 to 354830
File renamed without changes.
@@ -1,5 +1,5 @@
// map fixtures for this application
-steal("can/util/fixture", function(){
-
+steal("can/util/fixture", function() {
+
})
@@ -4,7 +4,7 @@
<title><%= application_name %></title>
</head>
<body>
- <h1>Welcome to JavaSciptMVC!</h1>
+ <h1>Welcome to JavaScriptMVC!</h1>
<ul>
<li>Steal plugins and files in <i><%= path %>/<%= application_name %>.js</i>.</li>
<li>Change to production mode by changing <i>steal.js</i> to <i>steal.production.js</i> in this file.</li>
@@ -1,7 +1,7 @@
-steal("funcunit", function(){
+steal("funcunit", function(FuncUnit){
module("<%=application_name%> test", {
setup: function(){
- S.open("//<%= path %>/<%=application_name%>.html");
+ S.open("//<%= path %>/index.html");
}
});
@@ -1,2 +1 @@
-steal("funcunit")
- .then("./<%= application_name %>_test.js");
+steal("./<%= application_name %>_test.js");
@@ -1,20 +1,21 @@
-steal('can/control', 'can/view/ejs', './views/init.ejs', function(){
+steal('can/control', 'can/view/ejs', './views/init.ejs', function(Control, EJS){
-/**
- * @class <%= name %>
- */
-can.Control('<%= name %>',
-/** @Static */
-{
- defaults : {}
-},
-/** @Prototype */
-{
- init : function(){
- this.element.html(can.view("//<%= path %>/<%= underscore %>/views/init.ejs",{
- message: "Hello World"
- }));
- }
-})
+ /**
+ * @class <%= name %>
+ */
+ Control('<%= name %>',
+ /** @Static */
+ {
+ defaults : {}
+ },
+ /** @Prototype */
+ {
+ init : function(){
+ this.element.html(can.view("//<%= path %>/<%= underscore %>/views/init.ejs",{
+ message: "Hello World"
+ }));
+ }
+ })
+ return <%= name %>;
});
@@ -1,4 +1,4 @@
-steal('funcunit', function(){
+steal('funcunit', function(FuncUnit){
module("<%= fullName %>", {
setup: function(){
@@ -1 +1 @@
-<%= this.message %>
+<%%= this.message %>
@@ -1,21 +1,22 @@
-steal('can/model', function(){
+steal('can/model', function(Model){
-/**
- * @class <%=name%>
- * @parent index
- * @inherits can.Model
- * Wraps backend <%=underscore%> services.
- */
-can.Model('<%=name%>',
-/* @Static */
-{
- findAll: "GET /<%= plural %>",
- findOne : "GET /<%= plural %>/{id}",
- create : "POST /<%= plural %>",
- update : "PUT /<%= plural %>/{id}",
- destroy : "DELETE /<%= plural %>/{id}"
-},
-/* @Prototype */
-{});
+ /**
+ * @class <%=name%>
+ * @parent index
+ * @inherits can.Model
+ * Wraps backend <%=underscore%> services.
+ */
+ Model('<%=name%>',
+ /* @Static */
+ {
+ findAll: "GET /<%= plural %>",
+ findOne : "GET /<%= plural %>/{id}",
+ create : "POST /<%= plural %>",
+ update : "PUT /<%= plural %>/{id}",
+ destroy : "DELETE /<%= plural %>/{id}"
+ },
+ /* @Prototype */
+ {});
+ return <%=name%>;
})
@@ -1,26 +1,29 @@
-steal('can', 'can/control/view', 'jquery/dom/form_params', '<%= appPath %>/models', './views/init.ejs', function() {
+steal('can', 'can/control/view', 'jquery/dom/form_params', '<%= appPath %>/models', './views/init.ejs',
+function(Control) {
-/**
- * @class <%=baseName%>.Create
- * @parent index
- * @inherits jQuery.Controller
- * Creates <%= plural %>
- */
-can.Control('<%=baseName%>.Create',
-/** @Prototype */
-{
- init : function(){
- this.element.html(this.view());
- },
- submit : function(el, ev){
- ev.preventDefault();
- var el = this.element;
- el.find('[type=submit]').val('Creating...')
- new <%= name %>(el.formParams()).save().done(function() {
- el.find('[type=submit]').val('Create');
- el[0].reset()
- });
- }
-})
+ /**
+ * @class <%=baseName%>.Create
+ * @parent index
+ * @inherits jQuery.Controller
+ * Creates <%= plural %>
+ */
+ can.Control('<%=baseName%>.Create',
+ /** @Prototype */
+ {
+ init : function(){
+ this.element.html(this.view());
+ },
+ submit : function(el, ev){
+ ev.preventDefault();
+ var el = this.element;
+ el.find('[type=submit]').val('Creating...')
+ new <%= name %>(el.formParams()).save().done(function() {
+ el.find('[type=submit]').val('Create');
+ el[0].reset()
+ });
+ }
+ });
+
+ return <%=baseName%>.Create;
});
@@ -1,37 +1,38 @@
-steal( 'can/control/view', 'can/view/ejs', 'can/model/elements', '<%= appPath %>/models', './views/init.ejs',
-function(){
+steal( 'can', 'can/control/view', 'can/view/ejs', 'can/model/elements', '<%= appPath %>/models', './views/init.ejs',
+function(can){
-/**
- * @class <%=baseName%>.List
- * @parent index
- * @inherits can.Control
- * Lists <%= plural %> and lets you destroy them.
- */
-can.Control('<%=baseName%>.List',
-/** @Static */
-{
- defaults : {}
-},
-/** @Prototype */
-{
- init : function(){
- <%= name %>.findAll().done(can.proxy(this.list, this));
+ /**
+ * @class <%=baseName%>.List
+ * @parent index
+ * @inherits can.Control
+ * Lists <%= plural %> and lets you destroy them.
+ */
+ can.Control('<%=baseName%>.List',
+ /** @Static */
+ {
+ defaults : {}
},
+ /** @Prototype */
+ {
+ init : function(){
+ <%= name %>.findAll().done(can.proxy(this.list, this));
+ },
- list : function(list) {
- this.list = list;
- this.element.html(this.view('init', list));
- },
+ list : function(list) {
+ this.list = list;
+ this.element.html(this.view('init', list));
+ },
- '.destroy click': function( el ){
- if(confirm("Are you sure you want to destroy?")){
- el.closest('.<%= underscore %>').model().destroy();
- }
- },
+ '.destroy click': function( el ){
+ if(confirm("Are you sure you want to destroy?")){
+ el.closest('.<%= underscore %>').model().destroy();
+ }
+ },
- "{Cookbook.Models.Recipe} created" : function(Recipe, ev, recipe){
- this.list.push(recipe);
- }
-});
+ "{Cookbook.Models.Recipe} created" : function(Recipe, ev, recipe){
+ this.list.push(recipe);
+ }
+ });
+ return <%=baseName%>.List;
});
View
@@ -56,7 +56,7 @@
mxui : 'https://github.com/jupiterjs/mxui'
};
DOCS_LOCATION = "docs/" //adds searchData to this
- JMVCDOC_TIMESTAMP = 1349721952108;
+ JMVCDOC_TIMESTAMP = 1350935346913;
COMMENTS_LOCATION = 'http://jmvcs3.disqus.com/embed.js';
steal = {
loaded: ['documentjs/jmvcdoc/production.css']
View
@@ -1,14 +1,14 @@
-steal('steal/generate',
- 'steal/get',
- 'steal/build',
- 'steal/build/pluginify',
- 'steal/coffee',
- 'steal/less',
- 'steal/clean',
- 'steal/parse',
- 'steal/html/crawl')
-.then('documentjs')
-.then('can/construct',
+//steal('steal/generate',
+// 'steal/get',
+// 'steal/build',
+// 'steal/build/pluginify',
+// 'steal/coffee',
+// 'steal/less',
+// 'steal/clean',
+// 'steal/parse',
+// 'steal/html/crawl')
+//.then('documentjs')
+steal('can/construct',
'can/construct/proxy',
'can/control',
'can/control/route',
@@ -23,7 +23,7 @@ steal('steal/generate',
'can/view/ejs',
'can/util/fixture',
'can/view/modifiers')
-.then('jquery/build/lib.js')
-.then('funcunit')
+// .then('jquery/build/lib.js')
+// .then('funcunit')
.then('./pages/init.js')
// .then('canui')
Submodule status_panel added at 95bdda
2 steal
Submodule steal updated from 8a51dc to 84c7af

0 comments on commit 8a9fc74

Please sign in to comment.