pullentity-backbone 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Pullentity
2
2
  module Backbone
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -1,4 +1,6 @@
1
- /*
1
+ /*!
2
+
3
+ handlebars v1.0.12
2
4
 
3
5
  Copyright (C) 2011 by Yehuda Katz
4
6
 
@@ -20,12 +22,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
22
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
23
  THE SOFTWARE.
22
24
 
25
+ @license
23
26
  */
24
27
 
25
28
  // lib/handlebars/browser-prefix.js
26
- var Handlebars = {};
27
-
28
- (function(Handlebars, undefined) {
29
+ (function(undefined) {
30
+ var Handlebars = {};
29
31
  ;
30
32
  // lib/handlebars/base.js
31
33
 
@@ -43,9 +45,24 @@ Handlebars.helpers = {};
43
45
  Handlebars.partials = {};
44
46
 
45
47
  var toString = Object.prototype.toString,
46
- functionType = '[object Function]',
47
48
  objectType = '[object Object]';
48
49
 
50
+ // Sourced from lodash
51
+ // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
52
+ function isFunction(value) {
53
+ return typeof value === 'function';
54
+ }
55
+ // fallback for older versions of Chrome and Safari
56
+ if (isFunction(/x/)) {
57
+ isFunction = function(value) {
58
+ return typeof value === 'function' && toString.call(value) === '[object Function]';
59
+ };
60
+ }
61
+
62
+ function isArray(value) {
63
+ return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
64
+ };
65
+
49
66
  Handlebars.registerHelper = function(name, fn, inverse) {
50
67
  if (toString.call(name) === objectType) {
51
68
  if (inverse || fn) { throw new Handlebars.Exception('Arg not supported with multiple helpers'); }
@@ -75,15 +92,13 @@ Handlebars.registerHelper('helperMissing', function(arg) {
75
92
  Handlebars.registerHelper('blockHelperMissing', function(context, options) {
76
93
  var inverse = options.inverse || function() {}, fn = options.fn;
77
94
 
78
- var type = toString.call(context);
79
-
80
- if(type === functionType) { context = context.call(this); }
95
+ if (isFunction(context)) { context = context.call(this); }
81
96
 
82
97
  if(context === true) {
83
98
  return fn(this);
84
99
  } else if(context === false || context == null) {
85
100
  return inverse(this);
86
- } else if(type === "[object Array]") {
101
+ } else if (isArray(context)) {
87
102
  if(context.length > 0) {
88
103
  return Handlebars.helpers.each(context, options);
89
104
  } else {
@@ -94,12 +109,9 @@ Handlebars.registerHelper('blockHelperMissing', function(context, options) {
94
109
  }
95
110
  });
96
111
 
97
- Handlebars.K = function() {};
98
-
99
- Handlebars.createFrame = Object.create || function(object) {
100
- Handlebars.K.prototype = object;
101
- var obj = new Handlebars.K();
102
- Handlebars.K.prototype = null;
112
+ Handlebars.createFrame = function(object) {
113
+ var obj = {};
114
+ Handlebars.Utils.extend(obj, object);
103
115
  return obj;
104
116
  };
105
117
 
@@ -125,15 +137,14 @@ Handlebars.registerHelper('each', function(context, options) {
125
137
  var fn = options.fn, inverse = options.inverse;
126
138
  var i = 0, ret = "", data;
127
139
 
128
- var type = toString.call(context);
129
- if(type === functionType) { context = context.call(this); }
140
+ if (isFunction(context)) { context = context.call(this); }
130
141
 
131
142
  if (options.data) {
132
143
  data = Handlebars.createFrame(options.data);
133
144
  }
134
145
 
135
146
  if(context && typeof context === 'object') {
136
- if(context instanceof Array){
147
+ if (isArray(context)) {
137
148
  for(var j = context.length; i<j; i++) {
138
149
  if (data) { data.index = i; }
139
150
  ret = ret + fn(context[i], { data: data });
@@ -157,10 +168,9 @@ Handlebars.registerHelper('each', function(context, options) {
157
168
  });
158
169
 
159
170
  Handlebars.registerHelper('if', function(conditional, options) {
160
- var type = toString.call(conditional);
161
- if(type === functionType) { conditional = conditional.call(this); }
171
+ if (isFunction(conditional)) { conditional = conditional.call(this); }
162
172
 
163
- if(!conditional || Handlebars.Utils.isEmpty(conditional)) {
173
+ if(Handlebars.Utils.isEmpty(conditional)) {
164
174
  return options.inverse(this);
165
175
  } else {
166
176
  return options.fn(this);
@@ -172,8 +182,7 @@ Handlebars.registerHelper('unless', function(conditional, options) {
172
182
  });
173
183
 
174
184
  Handlebars.registerHelper('with', function(context, options) {
175
- var type = toString.call(context);
176
- if(type === functionType) { context = context.call(this); }
185
+ if (isFunction(context)) { context = context.call(this); }
177
186
 
178
187
  if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
179
188
  });
@@ -188,120 +197,104 @@ Handlebars.registerHelper('log', function(context, options) {
188
197
  var handlebars = (function(){
189
198
  var parser = {trace: function trace() { },
190
199
  yy: {},
191
- symbols_: {"error":2,"root":3,"program":4,"EOF":5,"simpleInverse":6,"statements":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"CLOSE_UNESCAPED":24,"OPEN_PARTIAL":25,"partialName":26,"params":27,"hash":28,"dataName":29,"param":30,"STRING":31,"INTEGER":32,"BOOLEAN":33,"hashSegments":34,"hashSegment":35,"ID":36,"EQUALS":37,"DATA":38,"pathSegments":39,"SEP":40,"$accept":0,"$end":1},
192
- terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",31:"STRING",32:"INTEGER",33:"BOOLEAN",36:"ID",37:"EQUALS",38:"DATA",40:"SEP"},
193
- productions_: [0,[3,2],[4,2],[4,3],[4,2],[4,1],[4,1],[4,0],[7,1],[7,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[6,2],[17,3],[17,2],[17,2],[17,1],[17,1],[27,2],[27,1],[30,1],[30,1],[30,1],[30,1],[30,1],[28,1],[34,2],[34,1],[35,3],[35,3],[35,3],[35,3],[35,3],[26,1],[26,1],[26,1],[29,2],[21,1],[39,3],[39,1]],
200
+ symbols_: {"error":2,"root":3,"statements":4,"EOF":5,"program":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"CLOSE_UNESCAPED":24,"OPEN_PARTIAL":25,"partialName":26,"partial_option0":27,"inMustache_repetition0":28,"inMustache_option0":29,"dataName":30,"param":31,"STRING":32,"INTEGER":33,"BOOLEAN":34,"hash":35,"hash_repetition_plus0":36,"hashSegment":37,"ID":38,"EQUALS":39,"DATA":40,"pathSegments":41,"SEP":42,"$accept":0,"$end":1},
201
+ terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",38:"ID",39:"EQUALS",40:"DATA",42:"SEP"},
202
+ productions_: [0,[3,2],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[35,1],[37,3],[26,1],[26,1],[26,1],[30,2],[21,1],[41,3],[41,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[36,1],[36,2]],
194
203
  performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
195
204
 
196
205
  var $0 = $$.length - 1;
197
206
  switch (yystate) {
198
- case 1: return $$[$0-1];
207
+ case 1: return new yy.ProgramNode($$[$0-1]);
199
208
  break;
200
- case 2: this.$ = new yy.ProgramNode([], $$[$0]);
209
+ case 2:this.$ = new yy.ProgramNode([], $$[$0]);
201
210
  break;
202
- case 3: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]);
211
+ case 3:this.$ = new yy.ProgramNode($$[$0-2], $$[$0]);
203
212
  break;
204
- case 4: this.$ = new yy.ProgramNode($$[$0-1], []);
213
+ case 4:this.$ = new yy.ProgramNode($$[$0-1], []);
205
214
  break;
206
- case 5: this.$ = new yy.ProgramNode($$[$0]);
215
+ case 5:this.$ = new yy.ProgramNode($$[$0]);
207
216
  break;
208
- case 6: this.$ = new yy.ProgramNode([], []);
217
+ case 6:this.$ = new yy.ProgramNode([]);
209
218
  break;
210
- case 7: this.$ = new yy.ProgramNode([]);
219
+ case 7:this.$ = new yy.ProgramNode([]);
211
220
  break;
212
- case 8: this.$ = [$$[$0]];
221
+ case 8:this.$ = [$$[$0]];
213
222
  break;
214
- case 9: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
223
+ case 9: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
215
224
  break;
216
- case 10: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]);
225
+ case 10:this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]);
217
226
  break;
218
- case 11: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]);
227
+ case 11:this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]);
219
228
  break;
220
- case 12: this.$ = $$[$0];
229
+ case 12:this.$ = $$[$0];
221
230
  break;
222
- case 13: this.$ = $$[$0];
231
+ case 13:this.$ = $$[$0];
223
232
  break;
224
- case 14: this.$ = new yy.ContentNode($$[$0]);
233
+ case 14:this.$ = new yy.ContentNode($$[$0]);
225
234
  break;
226
- case 15: this.$ = new yy.CommentNode($$[$0]);
235
+ case 15:this.$ = new yy.CommentNode($$[$0]);
227
236
  break;
228
- case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
237
+ case 16:this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
229
238
  break;
230
- case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
239
+ case 17:this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]);
231
240
  break;
232
- case 18: this.$ = $$[$0-1];
241
+ case 18:this.$ = $$[$0-1];
233
242
  break;
234
243
  case 19:
235
244
  // Parsing out the '&' escape token at this level saves ~500 bytes after min due to the removal of one parser node.
236
245
  this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], $$[$0-2][2] === '&');
237
-
238
- break;
239
- case 20: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true);
240
- break;
241
- case 21: this.$ = new yy.PartialNode($$[$0-1]);
242
- break;
243
- case 22: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]);
244
- break;
245
- case 23:
246
- break;
247
- case 24: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]];
246
+
248
247
  break;
249
- case 25: this.$ = [[$$[$0-1]].concat($$[$0]), null];
248
+ case 20:this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true);
250
249
  break;
251
- case 26: this.$ = [[$$[$0-1]], $$[$0]];
250
+ case 21:this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]);
252
251
  break;
253
- case 27: this.$ = [[$$[$0]], null];
252
+ case 22:
254
253
  break;
255
- case 28: this.$ = [[$$[$0]], null];
254
+ case 23:this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]];
256
255
  break;
257
- case 29: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
256
+ case 24:this.$ = [[$$[$0]], null];
258
257
  break;
259
- case 30: this.$ = [$$[$0]];
258
+ case 25:this.$ = $$[$0];
260
259
  break;
261
- case 31: this.$ = $$[$0];
260
+ case 26:this.$ = new yy.StringNode($$[$0]);
262
261
  break;
263
- case 32: this.$ = new yy.StringNode($$[$0]);
262
+ case 27:this.$ = new yy.IntegerNode($$[$0]);
264
263
  break;
265
- case 33: this.$ = new yy.IntegerNode($$[$0]);
264
+ case 28:this.$ = new yy.BooleanNode($$[$0]);
266
265
  break;
267
- case 34: this.$ = new yy.BooleanNode($$[$0]);
266
+ case 29:this.$ = $$[$0];
268
267
  break;
269
- case 35: this.$ = $$[$0];
268
+ case 30:this.$ = new yy.HashNode($$[$0]);
270
269
  break;
271
- case 36: this.$ = new yy.HashNode($$[$0]);
270
+ case 31:this.$ = [$$[$0-2], $$[$0]];
272
271
  break;
273
- case 37: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
272
+ case 32:this.$ = new yy.PartialNameNode($$[$0]);
274
273
  break;
275
- case 38: this.$ = [$$[$0]];
274
+ case 33:this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0]));
276
275
  break;
277
- case 39: this.$ = [$$[$0-2], $$[$0]];
276
+ case 34:this.$ = new yy.PartialNameNode(new yy.IntegerNode($$[$0]));
278
277
  break;
279
- case 40: this.$ = [$$[$0-2], new yy.StringNode($$[$0])];
278
+ case 35:this.$ = new yy.DataNode($$[$0]);
280
279
  break;
281
- case 41: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])];
280
+ case 36:this.$ = new yy.IdNode($$[$0]);
282
281
  break;
283
- case 42: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])];
282
+ case 37: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2];
284
283
  break;
285
- case 43: this.$ = [$$[$0-2], $$[$0]];
284
+ case 38:this.$ = [{part: $$[$0]}];
286
285
  break;
287
- case 44: this.$ = new yy.PartialNameNode($$[$0]);
286
+ case 41:this.$ = [];
288
287
  break;
289
- case 45: this.$ = new yy.PartialNameNode(new yy.StringNode($$[$0]));
288
+ case 42:$$[$0-1].push($$[$0]);
290
289
  break;
291
- case 46: this.$ = new yy.PartialNameNode(new yy.IntegerNode($$[$0]));
290
+ case 45:this.$ = [$$[$0]];
292
291
  break;
293
- case 47: this.$ = new yy.DataNode($$[$0]);
294
- break;
295
- case 48: this.$ = new yy.IdNode($$[$0]);
296
- break;
297
- case 49: $$[$0-2].push({part: $$[$0], separator: $$[$0-1]}); this.$ = $$[$0-2];
298
- break;
299
- case 50: this.$ = [{part: $$[$0]}];
292
+ case 46:$$[$0-1].push($$[$0]);
300
293
  break;
301
294
  }
302
295
  },
303
- table: [{3:1,4:2,5:[2,7],6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],22:[1,14],23:[1,15],25:[1,16]},{1:[3]},{5:[1,17]},{5:[2,6],7:18,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,6],22:[1,14],23:[1,15],25:[1,16]},{5:[2,5],6:20,8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,5],22:[1,14],23:[1,15],25:[1,16]},{17:23,18:[1,22],21:24,29:25,36:[1,28],38:[1,27],39:26},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],25:[2,8]},{4:29,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],25:[1,16]},{4:30,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],25:[1,16]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{17:31,21:24,29:25,36:[1,28],38:[1,27],39:26},{17:32,21:24,29:25,36:[1,28],38:[1,27],39:26},{17:33,21:24,29:25,36:[1,28],38:[1,27],39:26},{21:35,26:34,31:[1,36],32:[1,37],36:[1,28],39:26},{1:[2,1]},{5:[2,2],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,2],22:[1,14],23:[1,15],25:[1,16]},{17:23,21:24,29:25,36:[1,28],38:[1,27],39:26},{5:[2,4],7:38,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,4],22:[1,14],23:[1,15],25:[1,16]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{5:[2,23],14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{18:[1,39]},{18:[2,27],21:44,24:[2,27],27:40,28:41,29:48,30:42,31:[1,45],32:[1,46],33:[1,47],34:43,35:49,36:[1,50],38:[1,27],39:26},{18:[2,28],24:[2,28]},{18:[2,48],24:[2,48],31:[2,48],32:[2,48],33:[2,48],36:[2,48],38:[2,48],40:[1,51]},{21:52,36:[1,28],39:26},{18:[2,50],24:[2,50],31:[2,50],32:[2,50],33:[2,50],36:[2,50],38:[2,50],40:[2,50]},{10:53,20:[1,54]},{10:55,20:[1,54]},{18:[1,56]},{18:[1,57]},{24:[1,58]},{18:[1,59],21:60,36:[1,28],39:26},{18:[2,44],36:[2,44]},{18:[2,45],36:[2,45]},{18:[2,46],36:[2,46]},{5:[2,3],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,3],22:[1,14],23:[1,15],25:[1,16]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{18:[2,25],21:44,24:[2,25],28:61,29:48,30:62,31:[1,45],32:[1,46],33:[1,47],34:43,35:49,36:[1,50],38:[1,27],39:26},{18:[2,26],24:[2,26]},{18:[2,30],24:[2,30],31:[2,30],32:[2,30],33:[2,30],36:[2,30],38:[2,30]},{18:[2,36],24:[2,36],35:63,36:[1,64]},{18:[2,31],24:[2,31],31:[2,31],32:[2,31],33:[2,31],36:[2,31],38:[2,31]},{18:[2,32],24:[2,32],31:[2,32],32:[2,32],33:[2,32],36:[2,32],38:[2,32]},{18:[2,33],24:[2,33],31:[2,33],32:[2,33],33:[2,33],36:[2,33],38:[2,33]},{18:[2,34],24:[2,34],31:[2,34],32:[2,34],33:[2,34],36:[2,34],38:[2,34]},{18:[2,35],24:[2,35],31:[2,35],32:[2,35],33:[2,35],36:[2,35],38:[2,35]},{18:[2,38],24:[2,38],36:[2,38]},{18:[2,50],24:[2,50],31:[2,50],32:[2,50],33:[2,50],36:[2,50],37:[1,65],38:[2,50],40:[2,50]},{36:[1,66]},{18:[2,47],24:[2,47],31:[2,47],32:[2,47],33:[2,47],36:[2,47],38:[2,47]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{21:67,36:[1,28],39:26},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,68]},{18:[2,24],24:[2,24]},{18:[2,29],24:[2,29],31:[2,29],32:[2,29],33:[2,29],36:[2,29],38:[2,29]},{18:[2,37],24:[2,37],36:[2,37]},{37:[1,65]},{21:69,29:73,31:[1,70],32:[1,71],33:[1,72],36:[1,28],38:[1,27],39:26},{18:[2,49],24:[2,49],31:[2,49],32:[2,49],33:[2,49],36:[2,49],38:[2,49],40:[2,49]},{18:[1,74]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{18:[2,39],24:[2,39],36:[2,39]},{18:[2,40],24:[2,40],36:[2,40]},{18:[2,41],24:[2,41],36:[2,41]},{18:[2,42],24:[2,42],36:[2,42]},{18:[2,43],24:[2,43],36:[2,43]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]}],
304
- defaultActions: {17:[2,1]},
296
+ table: [{3:1,4:2,8:3,9:4,11:5,12:6,13:7,14:[1,8],15:[1,9],16:[1,11],19:[1,10],22:[1,12],23:[1,13],25:[1,14]},{1:[3]},{5:[1,15],8:16,9:4,11:5,12:6,13:7,14:[1,8],15:[1,9],16:[1,11],19:[1,10],22:[1,12],23:[1,13],25:[1,14]},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],25:[2,8]},{4:19,6:17,7:18,8:3,9:4,11:5,12:6,13:7,14:[1,8],15:[1,9],16:[1,11],19:[1,20],20:[2,7],22:[1,12],23:[1,13],25:[1,14]},{4:19,6:21,7:18,8:3,9:4,11:5,12:6,13:7,14:[1,8],15:[1,9],16:[1,11],19:[1,20],20:[2,7],22:[1,12],23:[1,13],25:[1,14]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{17:22,21:23,30:24,38:[1,27],40:[1,26],41:25},{17:28,21:23,30:24,38:[1,27],40:[1,26],41:25},{17:29,21:23,30:24,38:[1,27],40:[1,26],41:25},{17:30,21:23,30:24,38:[1,27],40:[1,26],41:25},{21:32,26:31,32:[1,33],33:[1,34],38:[1,27],41:25},{1:[2,1]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{10:35,20:[1,36]},{4:37,8:3,9:4,11:5,12:6,13:7,14:[1,8],15:[1,9],16:[1,11],19:[1,10],20:[2,6],22:[1,12],23:[1,13],25:[1,14]},{7:38,8:16,9:4,11:5,12:6,13:7,14:[1,8],15:[1,9],16:[1,11],19:[1,20],20:[2,5],22:[1,12],23:[1,13],25:[1,14]},{17:22,18:[1,39],21:23,30:24,38:[1,27],40:[1,26],41:25},{10:40,20:[1,36]},{18:[1,41]},{18:[2,41],24:[2,41],28:42,32:[2,41],33:[2,41],34:[2,41],38:[2,41],40:[2,41]},{18:[2,24],24:[2,24]},{18:[2,36],24:[2,36],32:[2,36],33:[2,36],34:[2,36],38:[2,36],40:[2,36],42:[1,43]},{21:44,38:[1,27],41:25},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],38:[2,38],40:[2,38],42:[2,38]},{18:[1,45]},{18:[1,46]},{24:[1,47]},{18:[2,39],21:49,27:48,38:[1,27],41:25},{18:[2,32],38:[2,32]},{18:[2,33],38:[2,33]},{18:[2,34],38:[2,34]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{21:50,38:[1,27],41:25},{8:16,9:4,11:5,12:6,13:7,14:[1,8],15:[1,9],16:[1,11],19:[1,10],20:[2,2],22:[1,12],23:[1,13],25:[1,14]},{4:51,8:3,9:4,11:5,12:6,13:7,14:[1,8],15:[1,9],16:[1,11],19:[1,10],20:[2,4],22:[1,12],23:[1,13],25:[1,14]},{14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{18:[2,43],21:55,24:[2,43],29:52,30:59,31:53,32:[1,56],33:[1,57],34:[1,58],35:54,36:60,37:61,38:[1,62],40:[1,26],41:25},{38:[1,63]},{18:[2,35],24:[2,35],32:[2,35],33:[2,35],34:[2,35],38:[2,35],40:[2,35]},{14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{18:[1,64]},{18:[2,40]},{18:[1,65]},{8:16,9:4,11:5,12:6,13:7,14:[1,8],15:[1,9],16:[1,11],19:[1,10],20:[2,3],22:[1,12],23:[1,13],25:[1,14]},{18:[2,23],24:[2,23]},{18:[2,42],24:[2,42],32:[2,42],33:[2,42],34:[2,42],38:[2,42],40:[2,42]},{18:[2,44],24:[2,44]},{18:[2,25],24:[2,25],32:[2,25],33:[2,25],34:[2,25],38:[2,25],40:[2,25]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],38:[2,26],40:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],38:[2,27],40:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],38:[2,28],40:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],38:[2,29],40:[2,29]},{18:[2,30],24:[2,30],37:66,38:[1,67]},{18:[2,45],24:[2,45],38:[2,45]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],38:[2,38],39:[1,68],40:[2,38],42:[2,38]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],38:[2,37],40:[2,37],42:[2,37]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,46],24:[2,46],38:[2,46]},{39:[1,68]},{21:55,30:59,31:69,32:[1,56],33:[1,57],34:[1,58],38:[1,27],40:[1,26],41:25},{18:[2,31],24:[2,31],38:[2,31]}],
297
+ defaultActions: {15:[2,1],49:[2,40]},
305
298
  parseError: function parseError(str, hash) {
306
299
  throw new Error(str);
307
300
  },
@@ -580,83 +573,89 @@ pushState:function begin(condition) {
580
573
  lexer.options = {};
581
574
  lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
582
575
 
576
+
577
+ function strip(start, end) {
578
+ return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
579
+ }
580
+
581
+
583
582
  var YYSTATE=YY_START
584
583
  switch($avoiding_name_collisions) {
585
- case 0: yy_.yytext = "\\"; return 14;
584
+ case 0:yy_.yytext = "\\"; return 14;
586
585
  break;
587
586
  case 1:
588
587
  if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
589
- if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
588
+ if(yy_.yytext.slice(-1) === "\\") strip(0,1), this.begin("emu");
590
589
  if(yy_.yytext) return 14;
591
-
590
+
592
591
  break;
593
- case 2: return 14;
592
+ case 2:return 14;
594
593
  break;
595
594
  case 3:
596
595
  if(yy_.yytext.slice(-1) !== "\\") this.popState();
597
- if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1);
596
+ if(yy_.yytext.slice(-1) === "\\") strip(0,1);
598
597
  return 14;
599
-
598
+
600
599
  break;
601
- case 4: yy_.yytext = yy_.yytext.substr(0, yy_.yyleng-4); this.popState(); return 15;
600
+ case 4:strip(0,4); this.popState(); return 15;
602
601
  break;
603
- case 5: return 25;
602
+ case 5:return 25;
604
603
  break;
605
- case 6: return 16;
604
+ case 6:return 16;
606
605
  break;
607
- case 7: return 20;
606
+ case 7:return 20;
608
607
  break;
609
- case 8: return 19;
608
+ case 8:return 19;
610
609
  break;
611
- case 9: return 19;
610
+ case 9:return 19;
612
611
  break;
613
- case 10: return 23;
612
+ case 10:return 23;
614
613
  break;
615
- case 11: return 22;
614
+ case 11:return 22;
616
615
  break;
617
- case 12: this.popState(); this.begin('com');
616
+ case 12:this.popState(); this.begin('com');
618
617
  break;
619
- case 13: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
618
+ case 13:strip(3,5); this.popState(); return 15;
620
619
  break;
621
- case 14: return 22;
620
+ case 14:return 22;
622
621
  break;
623
- case 15: return 37;
622
+ case 15:return 39;
624
623
  break;
625
- case 16: return 36;
624
+ case 16:return 38;
626
625
  break;
627
- case 17: return 36;
626
+ case 17:return 38;
628
627
  break;
629
- case 18: return 40;
628
+ case 18:return 42;
630
629
  break;
631
- case 19: /*ignore whitespace*/
630
+ case 19:/*ignore whitespace*/
632
631
  break;
633
- case 20: this.popState(); return 24;
632
+ case 20:this.popState(); return 24;
634
633
  break;
635
- case 21: this.popState(); return 18;
634
+ case 21:this.popState(); return 18;
636
635
  break;
637
- case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 31;
636
+ case 22:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 32;
638
637
  break;
639
- case 23: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 31;
638
+ case 23:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 32;
640
639
  break;
641
- case 24: return 38;
640
+ case 24:return 40;
642
641
  break;
643
- case 25: return 33;
642
+ case 25:return 34;
644
643
  break;
645
- case 26: return 33;
644
+ case 26:return 34;
646
645
  break;
647
- case 27: return 32;
646
+ case 27:return 33;
648
647
  break;
649
- case 28: return 36;
648
+ case 28:return 38;
650
649
  break;
651
- case 29: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 36;
650
+ case 29:yy_.yytext = strip(1,2); return 38;
652
651
  break;
653
- case 30: return 'INVALID';
652
+ case 30:return 'INVALID';
654
653
  break;
655
- case 31: return 5;
654
+ case 31:return 5;
656
655
  break;
657
656
  }
658
657
  };
659
- lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}\/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
658
+ lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}\/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/];
660
659
  lexer.conditions = {"mu":{"rules":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],"inclusive":false},"emu":{"rules":[3],"inclusive":false},"com":{"rules":[4],"inclusive":false},"INITIAL":{"rules":[0,1,2,31],"inclusive":true}};
661
660
  return lexer;})()
662
661
  parser.lexer = lexer;
@@ -714,13 +713,10 @@ Handlebars.AST.PartialNode = function(partialName, context) {
714
713
  };
715
714
 
716
715
  Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {
717
- var verifyMatch = function(open, close) {
718
- if(open.original !== close.original) {
719
- throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
720
- }
721
- };
716
+ if(mustache.id.original !== close.original) {
717
+ throw new Handlebars.Exception(mustache.id.original + " doesn't match " + close.original);
718
+ }
722
719
 
723
- verifyMatch(mustache.id, close);
724
720
  this.type = "block";
725
721
  this.mustache = mustache;
726
722
  this.program = program;
@@ -826,7 +822,7 @@ Handlebars.SafeString = function(string) {
826
822
  this.string = string;
827
823
  };
828
824
  Handlebars.SafeString.prototype.toString = function() {
829
- return this.string.toString();
825
+ return "" + this.string;
830
826
  };
831
827
 
832
828
  var escape = {
@@ -855,17 +851,19 @@ Handlebars.Utils = {
855
851
  },
856
852
 
857
853
  escapeExpression: function(string) {
854
+ /*jshint eqnull: true */
855
+
858
856
  // don't escape SafeStrings, since they're already safe
859
857
  if (string instanceof Handlebars.SafeString) {
860
858
  return string.toString();
861
- } else if (string == null || string === false) {
859
+ } else if (!string && string !== 0) {
862
860
  return "";
863
861
  }
864
862
 
865
863
  // Force a string conversion as this will be done by the append regardless and
866
864
  // the regex test will do this transparently behind the scenes, causing issues if
867
865
  // an object's to string has escaped characters in it.
868
- string = string.toString();
866
+ string = "" + string;
869
867
 
870
868
  if(!possible.test(string)) { return string; }
871
869
  return string.replace(badChars, escapeChar);
@@ -874,7 +872,7 @@ Handlebars.Utils = {
874
872
  isEmpty: function(value) {
875
873
  if (!value && value !== 0) {
876
874
  return true;
877
- } else if(toString.call(value) === "[object Array]" && value.length === 0) {
875
+ } else if (isArray(value) && value.length === 0) {
878
876
  return true;
879
877
  } else {
880
878
  return false;
@@ -886,7 +884,6 @@ Handlebars.Utils = {
886
884
 
887
885
  /*jshint eqnull:true*/
888
886
  var Compiler = Handlebars.Compiler = function() {};
889
- var JavaScriptCompiler = Handlebars.JavaScriptCompiler = function() {};
890
887
 
891
888
  // the foundHelper register will disambiguate helper lookup from finding a
892
889
  // function in a context. This is necessary for mustache compatibility, which
@@ -1294,10 +1291,57 @@ Compiler.prototype = {
1294
1291
  }
1295
1292
  };
1296
1293
 
1294
+ Handlebars.precompile = function(input, options) {
1295
+ if (input == null || (typeof input !== 'string' && input.constructor !== Handlebars.AST.ProgramNode)) {
1296
+ throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
1297
+ }
1298
+
1299
+ options = options || {};
1300
+ if (!('data' in options)) {
1301
+ options.data = true;
1302
+ }
1303
+ var ast = Handlebars.parse(input);
1304
+ var environment = new Compiler().compile(ast, options);
1305
+ return new Handlebars.JavaScriptCompiler().compile(environment, options);
1306
+ };
1307
+
1308
+ Handlebars.compile = function(input, options) {
1309
+ if (input == null || (typeof input !== 'string' && input.constructor !== Handlebars.AST.ProgramNode)) {
1310
+ throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
1311
+ }
1312
+
1313
+ options = options || {};
1314
+ if (!('data' in options)) {
1315
+ options.data = true;
1316
+ }
1317
+ var compiled;
1318
+ function compile() {
1319
+ var ast = Handlebars.parse(input);
1320
+ var environment = new Compiler().compile(ast, options);
1321
+ var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
1322
+ return Handlebars.template(templateSpec);
1323
+ }
1324
+
1325
+ // Template is only compiled on first use and cached after that point.
1326
+ return function(context, options) {
1327
+ if (!compiled) {
1328
+ compiled = compile();
1329
+ }
1330
+ return compiled.call(this, context, options);
1331
+ };
1332
+ };
1333
+
1334
+ ;
1335
+ // lib/handlebars/compiler/javascript-compiler.js
1336
+ /*jshint eqnull:true*/
1337
+
1297
1338
  var Literal = function(value) {
1298
1339
  this.value = value;
1299
1340
  };
1300
1341
 
1342
+
1343
+ var JavaScriptCompiler = Handlebars.JavaScriptCompiler = function() {};
1344
+
1301
1345
  JavaScriptCompiler.prototype = {
1302
1346
  // PUBLIC API: You can override these methods in a subclass to provide
1303
1347
  // alternative compiled forms for name lookup and buffering semantics
@@ -1359,7 +1403,7 @@ JavaScriptCompiler.prototype = {
1359
1403
 
1360
1404
  this.i = 0;
1361
1405
 
1362
- for(l=opcodes.length; this.i<l; this.i++) {
1406
+ for(var l=opcodes.length; this.i<l; this.i++) {
1363
1407
  opcode = opcodes[this.i];
1364
1408
 
1365
1409
  if(opcode.opcode === 'DECLARE') {
@@ -1634,10 +1678,10 @@ JavaScriptCompiler.prototype = {
1634
1678
  // [lookupData]
1635
1679
  //
1636
1680
  // On stack, before: ...
1637
- // On stack, after: data[id], ...
1681
+ // On stack, after: data, ...
1638
1682
  //
1639
- // Push the result of looking up `id` on the current data
1640
- lookupData: function(id) {
1683
+ // Push the data lookup operator
1684
+ lookupData: function() {
1641
1685
  this.push('data');
1642
1686
  },
1643
1687
 
@@ -2132,49 +2176,26 @@ JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
2132
2176
  }
2133
2177
  return false;
2134
2178
  };
2179
+ ;
2180
+ // lib/handlebars/runtime.js
2135
2181
 
2136
- Handlebars.precompile = function(input, options) {
2137
- if (input == null || (typeof input !== 'string' && input.constructor !== Handlebars.AST.ProgramNode)) {
2138
- throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
2139
- }
2140
-
2141
- options = options || {};
2142
- if (!('data' in options)) {
2143
- options.data = true;
2144
- }
2145
- var ast = Handlebars.parse(input);
2146
- var environment = new Compiler().compile(ast, options);
2147
- return new JavaScriptCompiler().compile(environment, options);
2148
- };
2149
-
2150
- Handlebars.compile = function(input, options) {
2151
- if (input == null || (typeof input !== 'string' && input.constructor !== Handlebars.AST.ProgramNode)) {
2152
- throw new Handlebars.Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
2153
- }
2182
+ function checkRevision(compilerInfo) {
2183
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
2184
+ currentRevision = Handlebars.COMPILER_REVISION;
2154
2185
 
2155
- options = options || {};
2156
- if (!('data' in options)) {
2157
- options.data = true;
2158
- }
2159
- var compiled;
2160
- function compile() {
2161
- var ast = Handlebars.parse(input);
2162
- var environment = new Compiler().compile(ast, options);
2163
- var templateSpec = new JavaScriptCompiler().compile(environment, options, undefined, true);
2164
- return Handlebars.template(templateSpec);
2165
- }
2166
-
2167
- // Template is only compiled on first use and cached after that point.
2168
- return function(context, options) {
2169
- if (!compiled) {
2170
- compiled = compile();
2186
+ if (compilerRevision !== currentRevision) {
2187
+ if (compilerRevision < currentRevision) {
2188
+ var runtimeVersions = Handlebars.REVISION_CHANGES[currentRevision],
2189
+ compilerVersions = Handlebars.REVISION_CHANGES[compilerRevision];
2190
+ throw "Template was precompiled with an older version of Handlebars than the current runtime. "+
2191
+ "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").";
2192
+ } else {
2193
+ // Use the embedded version info since the runtime doesn't know about this revision yet
2194
+ throw "Template was precompiled with a newer version of Handlebars than the current runtime. "+
2195
+ "Please update your runtime to a newer version ("+compilerInfo[1]+").";
2171
2196
  }
2172
- return compiled.call(this, context, options);
2173
- };
2174
- };
2175
-
2176
- ;
2177
- // lib/handlebars/runtime.js
2197
+ }
2198
+ }
2178
2199
 
2179
2200
  Handlebars.VM = {
2180
2201
  template: function(templateSpec) {
@@ -2195,7 +2216,7 @@ Handlebars.VM = {
2195
2216
  merge: function(param, common) {
2196
2217
  var ret = param || common;
2197
2218
 
2198
- if (param && common) {
2219
+ if (param && common && (param !== common)) {
2199
2220
  ret = {};
2200
2221
  Handlebars.Utils.extend(ret, common);
2201
2222
  Handlebars.Utils.extend(ret, param);
@@ -2209,23 +2230,23 @@ Handlebars.VM = {
2209
2230
 
2210
2231
  return function(context, options) {
2211
2232
  options = options || {};
2212
- var result = templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
2213
-
2214
- var compilerInfo = container.compilerInfo || [],
2215
- compilerRevision = compilerInfo[0] || 1,
2216
- currentRevision = Handlebars.COMPILER_REVISION;
2217
-
2218
- if (compilerRevision !== currentRevision) {
2219
- if (compilerRevision < currentRevision) {
2220
- var runtimeVersions = Handlebars.REVISION_CHANGES[currentRevision],
2221
- compilerVersions = Handlebars.REVISION_CHANGES[compilerRevision];
2222
- throw "Template was precompiled with an older version of Handlebars than the current runtime. "+
2223
- "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").";
2224
- } else {
2225
- // Use the embedded version info since the runtime doesn't know about this revision yet
2226
- throw "Template was precompiled with a newer version of Handlebars than the current runtime. "+
2227
- "Please update your runtime to a newer version ("+compilerInfo[1]+").";
2228
- }
2233
+ var namespace = options.partial ? options : Handlebars,
2234
+ helpers,
2235
+ partials;
2236
+
2237
+ if (!options.partial) {
2238
+ helpers = options.helpers;
2239
+ partials = options.partials;
2240
+ }
2241
+ var result = templateSpec.call(
2242
+ container,
2243
+ namespace, context,
2244
+ helpers,
2245
+ partials,
2246
+ options.data);
2247
+
2248
+ if (!options.partial) {
2249
+ checkRevision(container.compilerInfo);
2229
2250
  }
2230
2251
 
2231
2252
  return result;
@@ -2256,7 +2277,7 @@ Handlebars.VM = {
2256
2277
  },
2257
2278
  noop: function() { return ""; },
2258
2279
  invokePartial: function(partial, name, context, helpers, partials, data) {
2259
- var options = { helpers: helpers, partials: partials, data: data };
2280
+ var options = { partial: true, helpers: helpers, partials: partials, data: data };
2260
2281
 
2261
2282
  if(partial === undefined) {
2262
2283
  throw new Handlebars.Exception("The partial " + name + " could not be found");
@@ -2274,5 +2295,16 @@ Handlebars.VM = {
2274
2295
  Handlebars.template = Handlebars.VM.template;
2275
2296
  ;
2276
2297
  // lib/handlebars/browser-suffix.js
2277
- })(Handlebars);
2278
- ;
2298
+ if (typeof module === 'object' && module.exports) {
2299
+ // CommonJS
2300
+ module.exports = Handlebars;
2301
+
2302
+ } else if (typeof define === "function" && define.amd) {
2303
+ // AMD modules
2304
+ define(function() { return Handlebars; });
2305
+
2306
+ } else {
2307
+ // other, i.e. browser
2308
+ this.Handlebars = Handlebars;
2309
+ }
2310
+ }).call(this);
@@ -1,5 +1,6 @@
1
1
  class Pullentity.Routers.main extends Backbone.Router
2
2
  routes:
3
+ "blog" : "getBlog"
3
4
  "sections/:id" : "getSection"
4
5
  "projects/:id" : "getProject"
5
6
  "*actions": "defaultRoute" # matches http://example.com/#anything-here - See more at: http://backbonetutorials.com/what-is-a-router/
@@ -26,6 +26,7 @@ window.Pullentity =
26
26
  Views: {
27
27
  Commons: {}
28
28
  }
29
+ App: {}
29
30
 
30
31
  Helpers:
31
32
  BootstrapHelpers: {}
@@ -13,6 +13,9 @@ class Pullentity.Views.Commons.Main extends Backbone.View
13
13
 
14
14
  initModels: ()=>
15
15
  #console.log("init models")
16
+
17
+ @theme_templates = $(".pullentity-themes")
18
+
16
19
  @sections = new Pullentity.Collections.Sections(@site.get('sections'))
17
20
  @projects = new Pullentity.Collections.Projects(@site.get('projects'))
18
21
  #debugger
@@ -32,6 +35,7 @@ class Pullentity.Views.Commons.Main extends Backbone.View
32
35
  document.title = "#{@site.get("name")} pullentity site"
33
36
 
34
37
  initRouter: ()=>
38
+
35
39
  @app_router = new Pullentity.Routers.main
36
40
 
37
41
  @app_router.on 'route:defaultRoute', (actions)=>
@@ -45,8 +49,13 @@ class Pullentity.Views.Commons.Main extends Backbone.View
45
49
 
46
50
  @app_router.on 'route:getSection', (id)=>
47
51
  #console.log("get section #{id}")
52
+ #console.log @theme_templates
48
53
  @find_in_section(id)
49
54
 
55
+ @app_router.on 'route:getBlog', (id)=>
56
+ #console.log("get section #{id}")
57
+ @get_blog(id)
58
+
50
59
  Backbone.history.start(pushState: true)
51
60
 
52
61
  render: ()=>
@@ -54,7 +63,6 @@ class Pullentity.Views.Commons.Main extends Backbone.View
54
63
  source = $("#layout").html()
55
64
  @theme_templates = $(".pullentity-themes")
56
65
  @layout = Handlebars.compile(source)
57
- #console.log(@site.attributes)
58
66
  $("body").html(@layout(@site.attributes))
59
67
  @initRouter()
60
68
 
@@ -100,6 +108,9 @@ class Pullentity.Views.Commons.Main extends Backbone.View
100
108
  @render_handlebars()
101
109
  $("#content").html(@current_template(@current_project.attributes))
102
110
 
111
+ get_blog: ()=>
112
+ console.log("blog!!")
113
+
103
114
  find_theme_for_project: ()=>
104
115
  @current_theme_obj = _.find @theme_templates, (num)=>
105
116
  if $(num).attr("id") == @current_project.get("theme_template").name
@@ -125,7 +136,8 @@ class Pullentity.Views.Commons.Main extends Backbone.View
125
136
 
126
137
  render_handlebars: ()=>
127
138
  try
128
- @current_template = Handlebars.compile($(@current_theme_obj).html())
139
+ #console.log "(try to render) #{@current_theme_obj.text} "
140
+ @current_template = Handlebars.compile(@current_theme_obj.text)
129
141
  catch e
130
142
  #console.error "error while creating Handlebars script out of template for [", $(@current_theme_obj), e
131
143
  throw e
@@ -152,4 +164,4 @@ class Pullentity.Views.Commons.Main extends Backbone.View
152
164
 
153
165
  return false
154
166
 
155
- layout = new Pullentity.Views.Commons.Main
167
+ Pullentity.App = new Pullentity.Views.Commons.Main
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pullentity-backbone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-02 00:00:00.000000000 Z
12
+ date: 2013-09-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -92,12 +92,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
92
  - - ! '>='
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
+ segments:
96
+ - 0
97
+ hash: -3784392909798842244
95
98
  required_rubygems_version: !ruby/object:Gem::Requirement
96
99
  none: false
97
100
  requirements:
98
101
  - - ! '>='
99
102
  - !ruby/object:Gem::Version
100
103
  version: '0'
104
+ segments:
105
+ - 0
106
+ hash: -3784392909798842244
101
107
  requirements: []
102
108
  rubyforge_project:
103
109
  rubygems_version: 1.8.25