This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ember.Handlebars.registerHelper('contextualLinkTo', function(property) { | |
| var args, context, name, options; | |
| options = [].slice.call(arguments, -1)[0]; | |
| context = (options.contexts && options.contexts[0]) || this; | |
| name = Ember.Handlebars.get(context, property, options); | |
| args = arguments; | |
| arguments[0] = name; | |
| return Ember.Handlebars.helpers.linkTo.apply(this, args); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| var vm = require('vm'); | |
| var emberjs = fs.readFileSync('public/javascripts/vendor/ember-0.9.5.min.js', 'utf8'); | |
| var templatesDir = 'templates'; | |
| var destinationDir = 'public/javascripts/templates'; | |
| function compileHandlebarsTemplate(templatesDir, fileName) { | |
| var file = templatesDir + '/' + fileName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'execjs' | |
| class HandlebarsFilter < Filter | |
| class << self | |
| def contents | |
| @@contents ||= [File.read("headless-ember.js"), File.read("ember.js")].join("\n") | |
| end | |
| def context | |
| @@context ||= ExecJS.compile(contents) |