Permalink
Browse files

Unbundled Handlebars

Since Handlebars has become common as a standalone library, we're no
longer bundling it as part of Ember. Currently Handlebars 1.0.beta.5 and
up are supported.

Fixes #849
  • Loading branch information...
wagenet committed May 22, 2012
1 parent 1ba9060 commit d1fd4ec850b0b32f21a51068a56c318478bf6632
@@ -1,8 +1,6 @@
// lib/handlebars/base.js
var Handlebars = {};
window.Handlebars = Handlebars;
Handlebars.VERSION = "1.0.beta.6";
Handlebars.helpers = {};
@@ -108,85 +106,85 @@ performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var $0 = $$.length - 1;
switch (yystate) {
case 1: return $$[$0-1]
case 1: return $$[$0-1]
break;
case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0])
case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0])
break;
case 3: this.$ = new yy.ProgramNode($$[$0])
case 3: this.$ = new yy.ProgramNode($$[$0])
break;
case 4: this.$ = new yy.ProgramNode([])
case 4: this.$ = new yy.ProgramNode([])
break;
case 5: this.$ = [$$[$0]]
case 5: this.$ = [$$[$0]]
break;
case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
break;
case 7: this.$ = new yy.InverseNode($$[$0-2], $$[$0-1], $$[$0])
case 7: this.$ = new yy.InverseNode($$[$0-2], $$[$0-1], $$[$0])
break;
case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0])
case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0])
break;
case 9: this.$ = $$[$0]
case 9: this.$ = $$[$0]
break;
case 10: this.$ = $$[$0]
case 10: this.$ = $$[$0]
break;
case 11: this.$ = new yy.ContentNode($$[$0])
case 11: this.$ = new yy.ContentNode($$[$0])
break;
case 12: this.$ = new yy.CommentNode($$[$0])
case 12: this.$ = new yy.CommentNode($$[$0])
break;
case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
break;
case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
break;
case 15: this.$ = $$[$0-1]
case 15: this.$ = $$[$0-1]
break;
case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
break;
case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true)
case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true)
break;
case 18: this.$ = new yy.PartialNode($$[$0-1])
case 18: this.$ = new yy.PartialNode($$[$0-1])
break;
case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1])
case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1])
break;
case 20:
case 20:
break;
case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]
case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]
break;
case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null]
case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null]
break;
case 23: this.$ = [[$$[$0-1]], $$[$0]]
case 23: this.$ = [[$$[$0-1]], $$[$0]]
break;
case 24: this.$ = [[$$[$0]], null]
case 24: this.$ = [[$$[$0]], null]
break;
case 25: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
case 25: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
break;
case 26: this.$ = [$$[$0]]
case 26: this.$ = [$$[$0]]
break;
case 27: this.$ = $$[$0]
case 27: this.$ = $$[$0]
break;
case 28: this.$ = new yy.StringNode($$[$0])
case 28: this.$ = new yy.StringNode($$[$0])
break;
case 29: this.$ = new yy.IntegerNode($$[$0])
case 29: this.$ = new yy.IntegerNode($$[$0])
break;
case 30: this.$ = new yy.BooleanNode($$[$0])
case 30: this.$ = new yy.BooleanNode($$[$0])
break;
case 31: this.$ = new yy.HashNode($$[$0])
case 31: this.$ = new yy.HashNode($$[$0])
break;
case 32: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
case 32: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
break;
case 33: this.$ = [$$[$0]]
case 33: this.$ = [$$[$0]]
break;
case 34: this.$ = [$$[$0-2], $$[$0]]
case 34: this.$ = [$$[$0-2], $$[$0]]
break;
case 35: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]
case 35: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]
break;
case 36: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]
case 36: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]
break;
case 37: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]
case 37: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]
break;
case 38: this.$ = new yy.IdNode($$[$0])
case 38: this.$ = new yy.IdNode($$[$0])
break;
case 39: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
case 39: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
break;
case 40: this.$ = [$$[$0]]
case 40: this.$ = [$$[$0]]
break;
}
},
@@ -386,7 +384,7 @@ next:function () {
if (this._input === "") {
return this.EOF;
} else {
this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
{text: "", token: null, line: this.yylineno});
}
},
@@ -421,59 +419,59 @@ case 0:
if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
if(yy_.yytext) return 14;
break;
case 1: return 14;
case 1: return 14;
break;
case 2: this.popState(); return 14;
case 2: this.popState(); return 14;
break;
case 3: return 24;
case 3: return 24;
break;
case 4: return 16;
case 4: return 16;
break;
case 5: return 20;
case 5: return 20;
break;
case 6: return 19;
case 6: return 19;
break;
case 7: return 19;
case 7: return 19;
break;
case 8: return 23;
case 8: return 23;
break;
case 9: return 23;
case 9: return 23;
break;
case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
break;
case 11: return 22;
case 11: return 22;
break;
case 12: return 34;
case 12: return 34;
break;
case 13: return 33;
case 13: return 33;
break;
case 14: return 33;
case 14: return 33;
break;
case 15: return 36;
case 15: return 36;
break;
case 16: /*ignore whitespace*/
case 16: /*ignore whitespace*/
break;
case 17: this.popState(); return 18;
case 17: this.popState(); return 18;
break;
case 18: this.popState(); return 18;
case 18: this.popState(); return 18;
break;
case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 28;
case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 28;
break;
case 20: return 30;
case 20: return 30;
break;
case 21: return 30;
case 21: return 30;
break;
case 22: return 29;
case 22: return 29;
break;
case 23: return 33;
case 23: return 33;
break;
case 24: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 33;
case 24: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 33;
break;
case 25: return 'INVALID';
case 25: return 'INVALID';
break;
case 26: return 5;
case 26: return 5;
break;
}
};
@@ -19,6 +19,8 @@ require("ember-views/system/render_buffer");
@description Helpers for Handlebars templates
*/
Ember.assert("Ember Handlebars requires Handlebars 1.0.beta.5 or greater", window.Handlebars && window.Handlebars.VERSION.match(/^1\.0\.beta\.[56789]$/));
/**
@class

This file was deleted.

Oops, something went wrong.
View
@@ -87,6 +87,24 @@ <h2 id="qunit-userAgent"></h2>
// Close the script tag to make sure document.write happens
</script>
<script>
// Load custom version of Handlebars if possible
var handlebarsVersion = QUnit.urlParams.handlebars || "1.0.0.beta.6";
if (handlebarsVersion !== 'none') {
document.write('<script src="https://github.com/downloads/wycats/handlebars.js/handlebars-'+handlebarsVersion+'.js"><\/script>');
}
// Close the script tag to make sure document.write happens
</script>
<script>
// Fallback to default Handlebars
if (handlebarsVersion !== 'none' && !window.Handlebars) {
if (console && console.warn) { console.warn("Unable to load Handlebars "+handlebarsVersion+". Using default."); }
document.write('<script src="../lib/handlebars-1.0.0.beta.6.js"><\/script>');
}
// Close the script tag to make sure document.write happens
</script>
<script>
// Load ember distribution from query vars
var distMatch = location.search.match(/dist=([^&]+)/),
@@ -150,7 +168,6 @@ <h2 id="qunit-userAgent"></h2>
// There is no require for this in the code
if (dist == 'spade') {
minispade.require('handlebars');
minispade.require('ember-debug');
}

0 comments on commit d1fd4ec

Please sign in to comment.