thorax-rails 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +50 -0
- data/lib/generators/thorax/install/install_generator.rb +30 -0
- data/lib/generators/thorax/thorax_helpers.rb +55 -0
- data/lib/thorax.rb +6 -0
- data/vendor/assets/javascripts/backbone.js +1498 -0
- data/vendor/assets/javascripts/handlebars.js +45 -0
- data/vendor/assets/javascripts/thorax.js +3091 -0
- data/vendor/assets/javascripts/undersccore.js +1221 -0
- metadata +218 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
/*global Handlebars: true */
|
2
|
+
|
3
|
+
var handlebars = require("./handlebars/base"),
|
4
|
+
|
5
|
+
// Each of these augment the Handlebars object. No need to setup here.
|
6
|
+
// (This is done to easily share code between commonjs and browse envs)
|
7
|
+
utils = require("./handlebars/utils"),
|
8
|
+
compiler = require("./handlebars/compiler"),
|
9
|
+
runtime = require("./handlebars/runtime");
|
10
|
+
|
11
|
+
var create = function() {
|
12
|
+
var hb = handlebars.create();
|
13
|
+
|
14
|
+
utils.attach(hb);
|
15
|
+
compiler.attach(hb);
|
16
|
+
runtime.attach(hb);
|
17
|
+
|
18
|
+
return hb;
|
19
|
+
};
|
20
|
+
|
21
|
+
var Handlebars = create();
|
22
|
+
Handlebars.create = create;
|
23
|
+
|
24
|
+
module.exports = Handlebars; // instantiate an instance
|
25
|
+
|
26
|
+
// Publish a Node.js require() handler for .handlebars and .hbs files
|
27
|
+
if (require.extensions) {
|
28
|
+
var extension = function(module, filename) {
|
29
|
+
var fs = require("fs");
|
30
|
+
var templateString = fs.readFileSync(filename, "utf8");
|
31
|
+
module.exports = Handlebars.compile(templateString);
|
32
|
+
};
|
33
|
+
require.extensions[".handlebars"] = extension;
|
34
|
+
require.extensions[".hbs"] = extension;
|
35
|
+
}
|
36
|
+
|
37
|
+
// BEGIN(BROWSER)
|
38
|
+
|
39
|
+
// END(BROWSER)
|
40
|
+
|
41
|
+
// USAGE:
|
42
|
+
// var handlebars = require('handlebars');
|
43
|
+
|
44
|
+
// var singleton = handlebars.Handlebars,
|
45
|
+
// local = handlebars.create();
|