Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update Backbonist to be optimizable by no-build-conf
  • Loading branch information
Filirom1 committed Jun 5, 2012
1 parent 52a9ae5 commit 3dd1d0e
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 38 deletions.
1 change: 0 additions & 1 deletion css/style.css
Expand Up @@ -4,7 +4,6 @@
/* Create several CSS files, one per view.
* Don't worry, the build tool will merge them together and do minification.
*/
/* @import url("other-files.css"); */

/* Always at the end */
@import url("utils.css");
26 changes: 13 additions & 13 deletions index.html
Expand Up @@ -20,7 +20,7 @@

<!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->

<link rel="stylesheet" href="css/style.css">
<link data-build="css/style.css" rel="stylesheet" href="css/style.css">

<!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->
</head>
Expand All @@ -41,18 +41,18 @@
<script>(!!window.JSON && !!JSON.parse) || document.write('<script src="vendor/json2.min.js"><\/script>')</script>

<!-- scripts concatenated and minified via build script -->
<script src="vendor/log.js"></script>
<script src="vendor/underscore.js"></script>
<script src="vendor/backbone.js"></script>
<script src="vendor/handlebars.runtime-1.0.0.beta.6.js"></script>
<script src="application.js"></script>
<script src="lib/util.js"></script>
<script src="lib/jquery.plugin.js"></script>
<script src="lib/Backbone.plugin.js"></script>
<script src="model/Todo.js"></script>
<script src="template/templates.js"></script>
<script src="view/todo/TodoView.js"></script>
<script src="Router.js"></script>
<script data-build="app.js" src="vendor/log.js"></script>
<script data-build="app.js" src="vendor/underscore.js"></script>
<script data-build="app.js" src="vendor/backbone.js"></script>
<script data-build="app.js" src="vendor/handlebars.runtime-1.0.0.beta.6.js"></script>
<script data-build="app.js" src="application.js"></script>
<script data-build="app.js" src="lib/util.js"></script>
<script data-build="app.js" src="lib/jquery.plugin.js"></script>
<script data-build="app.js" src="lib/Backbone.plugin.js"></script>
<script data-build="app.js" src="model/Todo.js"></script>
<script data-build="app.js" src="templates.js"></script>
<script data-build="app.js" src="view/todo/TodoView.js"></script>
<script data-build="app.js" src="Router.js"></script>
<!-- end scripts -->

<!-- Asynchronous Google Analytics snippet. Change UA-XXXXX-X to be your site's ID.
Expand Down
16 changes: 9 additions & 7 deletions lib/util.js
@@ -1,7 +1,9 @@
// Replace this function, by anything that could be useful in your application.
//
// If you don't like this way, you could extend the underscore namespace.
// <http://documentcloud.github.com/underscore/#mixin>
xx.util.capitalize = function(string) {
return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
}
(function(){
// Replace this function, by anything that could be useful in your application.
//
// If you don't like this way, you could extend the underscore namespace.
// <http://documentcloud.github.com/underscore/#mixin>
xx.util.capitalize = function(string) {
return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
};
})();
17 changes: 0 additions & 17 deletions template/templates.js

This file was deleted.

27 changes: 27 additions & 0 deletions templates.js
@@ -0,0 +1,27 @@
(function(){ window.JST || (window.JST = {})
window.JST["README"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
helpers = helpers || Handlebars.helpers;
var foundHelper, self=this;


return "Call a JST compiler inside this folder.\n\nAll your templates will be compiled into a single JS file.\n\nIf you use Handlebars template, you can use this JST compiler:\n<https://github.com/wookiehangover/handlebars-jst>\n\n $ npm install -g handlebars-jst\n\n $ cd template\n\n $ tmpl\n";});
Handlebars.partials["README"] = window.JST["README"]
window.JST["todo"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
helpers = helpers || Handlebars.helpers;
var buffer = "", stack1, foundHelper, self=this, functionType="function", helperMissing=helpers.helperMissing, undef=void 0, escapeExpression=this.escapeExpression;


buffer += "<!--\nThis is a handlebars template.\nThis template will be transformed into a function by the handlebars\ncompiler.\n\nYou just have to include the result of the compilation\n`template/templates.js` into the `index.html` to access your templates via\nthe JST namespace.\n\n JST[\"your-template-name\"]({ name: 'Hello', text: 'You rock !' });\n\nYou can use the following Handlebars JST compiler <https://github.com/wookiehangover/handlebars-jst>\n-->\n\n<h2>";
foundHelper = helpers.name;
stack1 = foundHelper || depth0.name;
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "name", { hash: {} }); }
buffer += escapeExpression(stack1) + "</h2>\n<p>A custom paragraph here.</p>\n<p>";
foundHelper = helpers.text;
stack1 = foundHelper || depth0.text;
if(typeof stack1 === functionType) { stack1 = stack1.call(depth0, { hash: {} }); }
else if(stack1=== undef) { stack1 = helperMissing.call(depth0, "text", { hash: {} }); }
buffer += escapeExpression(stack1) + "</p>\n";
return buffer;});
Handlebars.partials["todo"] = window.JST["todo"]
})();

0 comments on commit 3dd1d0e

Please sign in to comment.