steering-rails 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +3 -14
- data/.travis.yml +22 -0
- data/Appraisals +11 -0
- data/Gemfile +0 -1
- data/README.md +12 -0
- data/Rakefile +10 -0
- data/gemfiles/rails_3.2.gemfile +7 -0
- data/gemfiles/rails_4.0.gemfile +7 -0
- data/gemfiles/rails_4.1.gemfile +7 -0
- data/lib/steering/rails.rb +1 -1
- data/lib/steering/rails/template.rb +4 -3
- data/lib/steering/rails/version.rb +1 -1
- data/steering-rails.gemspec +3 -1
- data/test/fixtures/hello.jst.handlebars +1 -0
- data/test/steering_rails_test.rb +33 -0
- data/test/test_helper.rb +12 -0
- data/vendor/assets/javascripts/handlebars.js +1808 -982
- data/vendor/assets/javascripts/handlebars.runtime.js +456 -167
- metadata +39 -28
@@ -1,241 +1,530 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
/*!
|
2
|
+
|
3
|
+
handlebars v1.3.0
|
4
|
+
|
5
|
+
Copyright (C) 2011 by Yehuda Katz
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
9
|
+
in the Software without restriction, including without limitation the rights
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
12
|
+
furnished to do so, subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
15
|
+
all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
|
+
THE SOFTWARE.
|
24
|
+
|
25
|
+
@license
|
26
|
+
*/
|
27
|
+
/* exported Handlebars */
|
28
|
+
var Handlebars = (function() {
|
29
|
+
// handlebars/safe-string.js
|
30
|
+
var __module3__ = (function() {
|
31
|
+
"use strict";
|
32
|
+
var __exports__;
|
33
|
+
// Build out our basic SafeString type
|
34
|
+
function SafeString(string) {
|
35
|
+
this.string = string;
|
36
|
+
}
|
5
37
|
|
6
|
-
|
38
|
+
SafeString.prototype.toString = function() {
|
39
|
+
return "" + this.string;
|
40
|
+
};
|
7
41
|
|
8
|
-
|
42
|
+
__exports__ = SafeString;
|
43
|
+
return __exports__;
|
44
|
+
})();
|
9
45
|
|
10
|
-
|
11
|
-
|
46
|
+
// handlebars/utils.js
|
47
|
+
var __module2__ = (function(__dependency1__) {
|
48
|
+
"use strict";
|
49
|
+
var __exports__ = {};
|
50
|
+
/*jshint -W004 */
|
51
|
+
var SafeString = __dependency1__;
|
12
52
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
53
|
+
var escape = {
|
54
|
+
"&": "&",
|
55
|
+
"<": "<",
|
56
|
+
">": ">",
|
57
|
+
'"': """,
|
58
|
+
"'": "'",
|
59
|
+
"`": "`"
|
60
|
+
};
|
17
61
|
|
18
|
-
|
19
|
-
|
20
|
-
};
|
62
|
+
var badChars = /[&<>"'`]/g;
|
63
|
+
var possible = /[&<>"'`]/;
|
21
64
|
|
22
|
-
|
23
|
-
|
24
|
-
return undefined;
|
25
|
-
} else {
|
26
|
-
throw new Error("Could not find property '" + arg + "'");
|
65
|
+
function escapeChar(chr) {
|
66
|
+
return escape[chr] || "&";
|
27
67
|
}
|
28
|
-
});
|
29
68
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
69
|
+
function extend(obj, value) {
|
70
|
+
for(var key in value) {
|
71
|
+
if(Object.prototype.hasOwnProperty.call(value, key)) {
|
72
|
+
obj[key] = value[key];
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
34
76
|
|
77
|
+
__exports__.extend = extend;var toString = Object.prototype.toString;
|
78
|
+
__exports__.toString = toString;
|
79
|
+
// Sourced from lodash
|
80
|
+
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
|
81
|
+
var isFunction = function(value) {
|
82
|
+
return typeof value === 'function';
|
83
|
+
};
|
84
|
+
// fallback for older versions of Chrome and Safari
|
85
|
+
if (isFunction(/x/)) {
|
86
|
+
isFunction = function(value) {
|
87
|
+
return typeof value === 'function' && toString.call(value) === '[object Function]';
|
88
|
+
};
|
89
|
+
}
|
90
|
+
var isFunction;
|
91
|
+
__exports__.isFunction = isFunction;
|
92
|
+
var isArray = Array.isArray || function(value) {
|
93
|
+
return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
|
94
|
+
};
|
95
|
+
__exports__.isArray = isArray;
|
96
|
+
|
97
|
+
function escapeExpression(string) {
|
98
|
+
// don't escape SafeStrings, since they're already safe
|
99
|
+
if (string instanceof SafeString) {
|
100
|
+
return string.toString();
|
101
|
+
} else if (!string && string !== 0) {
|
102
|
+
return "";
|
103
|
+
}
|
35
104
|
|
36
|
-
|
37
|
-
|
105
|
+
// Force a string conversion as this will be done by the append regardless and
|
106
|
+
// the regex test will do this transparently behind the scenes, causing issues if
|
107
|
+
// an object's to string has escaped characters in it.
|
108
|
+
string = "" + string;
|
38
109
|
|
39
|
-
|
110
|
+
if(!possible.test(string)) { return string; }
|
111
|
+
return string.replace(badChars, escapeChar);
|
112
|
+
}
|
40
113
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
if(context.length > 0) {
|
47
|
-
return Handlebars.helpers.each(context, options);
|
114
|
+
__exports__.escapeExpression = escapeExpression;function isEmpty(value) {
|
115
|
+
if (!value && value !== 0) {
|
116
|
+
return true;
|
117
|
+
} else if (isArray(value) && value.length === 0) {
|
118
|
+
return true;
|
48
119
|
} else {
|
49
|
-
return
|
120
|
+
return false;
|
50
121
|
}
|
51
|
-
} else {
|
52
|
-
return fn(context);
|
53
122
|
}
|
54
|
-
});
|
55
123
|
|
56
|
-
|
124
|
+
__exports__.isEmpty = isEmpty;
|
125
|
+
return __exports__;
|
126
|
+
})(__module3__);
|
57
127
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
return obj;
|
63
|
-
};
|
128
|
+
// handlebars/exception.js
|
129
|
+
var __module4__ = (function() {
|
130
|
+
"use strict";
|
131
|
+
var __exports__;
|
64
132
|
|
65
|
-
|
66
|
-
var fn = options.fn, inverse = options.inverse;
|
67
|
-
var ret = "", data;
|
133
|
+
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
|
68
134
|
|
69
|
-
|
70
|
-
|
71
|
-
|
135
|
+
function Exception(message, node) {
|
136
|
+
var line;
|
137
|
+
if (node && node.firstLine) {
|
138
|
+
line = node.firstLine;
|
139
|
+
|
140
|
+
message += ' - ' + line + ':' + node.firstColumn;
|
141
|
+
}
|
142
|
+
|
143
|
+
var tmp = Error.prototype.constructor.call(this, message);
|
72
144
|
|
73
|
-
|
74
|
-
for(var
|
75
|
-
|
76
|
-
|
145
|
+
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
|
146
|
+
for (var idx = 0; idx < errorProps.length; idx++) {
|
147
|
+
this[errorProps[idx]] = tmp[errorProps[idx]];
|
148
|
+
}
|
149
|
+
|
150
|
+
if (line) {
|
151
|
+
this.lineNumber = line;
|
152
|
+
this.column = node.firstColumn;
|
77
153
|
}
|
78
|
-
} else {
|
79
|
-
ret = inverse(this);
|
80
154
|
}
|
81
|
-
return ret;
|
82
|
-
});
|
83
155
|
|
84
|
-
|
85
|
-
|
86
|
-
|
156
|
+
Exception.prototype = new Error();
|
157
|
+
|
158
|
+
__exports__ = Exception;
|
159
|
+
return __exports__;
|
160
|
+
})();
|
161
|
+
|
162
|
+
// handlebars/base.js
|
163
|
+
var __module1__ = (function(__dependency1__, __dependency2__) {
|
164
|
+
"use strict";
|
165
|
+
var __exports__ = {};
|
166
|
+
var Utils = __dependency1__;
|
167
|
+
var Exception = __dependency2__;
|
168
|
+
|
169
|
+
var VERSION = "1.3.0";
|
170
|
+
__exports__.VERSION = VERSION;var COMPILER_REVISION = 4;
|
171
|
+
__exports__.COMPILER_REVISION = COMPILER_REVISION;
|
172
|
+
var REVISION_CHANGES = {
|
173
|
+
1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
|
174
|
+
2: '== 1.0.0-rc.3',
|
175
|
+
3: '== 1.0.0-rc.4',
|
176
|
+
4: '>= 1.0.0'
|
177
|
+
};
|
178
|
+
__exports__.REVISION_CHANGES = REVISION_CHANGES;
|
179
|
+
var isArray = Utils.isArray,
|
180
|
+
isFunction = Utils.isFunction,
|
181
|
+
toString = Utils.toString,
|
182
|
+
objectType = '[object Object]';
|
183
|
+
|
184
|
+
function HandlebarsEnvironment(helpers, partials) {
|
185
|
+
this.helpers = helpers || {};
|
186
|
+
this.partials = partials || {};
|
87
187
|
|
88
|
-
|
89
|
-
return options.inverse(this);
|
90
|
-
} else {
|
91
|
-
return options.fn(this);
|
188
|
+
registerDefaultHelpers(this);
|
92
189
|
}
|
93
|
-
});
|
94
190
|
|
95
|
-
|
96
|
-
|
97
|
-
options.fn = inverse;
|
98
|
-
options.inverse = fn;
|
191
|
+
__exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
|
192
|
+
constructor: HandlebarsEnvironment,
|
99
193
|
|
100
|
-
|
101
|
-
|
194
|
+
logger: logger,
|
195
|
+
log: log,
|
102
196
|
|
103
|
-
|
104
|
-
|
105
|
-
|
197
|
+
registerHelper: function(name, fn, inverse) {
|
198
|
+
if (toString.call(name) === objectType) {
|
199
|
+
if (inverse || fn) { throw new Exception('Arg not supported with multiple helpers'); }
|
200
|
+
Utils.extend(this.helpers, name);
|
201
|
+
} else {
|
202
|
+
if (inverse) { fn.not = inverse; }
|
203
|
+
this.helpers[name] = fn;
|
204
|
+
}
|
205
|
+
},
|
106
206
|
|
107
|
-
|
108
|
-
|
109
|
-
|
207
|
+
registerPartial: function(name, str) {
|
208
|
+
if (toString.call(name) === objectType) {
|
209
|
+
Utils.extend(this.partials, name);
|
210
|
+
} else {
|
211
|
+
this.partials[name] = str;
|
212
|
+
}
|
213
|
+
}
|
214
|
+
};
|
110
215
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
216
|
+
function registerDefaultHelpers(instance) {
|
217
|
+
instance.registerHelper('helperMissing', function(arg) {
|
218
|
+
if(arguments.length === 2) {
|
219
|
+
return undefined;
|
220
|
+
} else {
|
221
|
+
throw new Exception("Missing helper: '" + arg + "'");
|
222
|
+
}
|
223
|
+
});
|
116
224
|
|
117
|
-
|
118
|
-
|
119
|
-
}
|
225
|
+
instance.registerHelper('blockHelperMissing', function(context, options) {
|
226
|
+
var inverse = options.inverse || function() {}, fn = options.fn;
|
120
227
|
|
121
|
-
|
122
|
-
};
|
123
|
-
Handlebars.Exception.prototype = new Error();
|
228
|
+
if (isFunction(context)) { context = context.call(this); }
|
124
229
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
230
|
+
if(context === true) {
|
231
|
+
return fn(this);
|
232
|
+
} else if(context === false || context == null) {
|
233
|
+
return inverse(this);
|
234
|
+
} else if (isArray(context)) {
|
235
|
+
if(context.length > 0) {
|
236
|
+
return instance.helpers.each(context, options);
|
237
|
+
} else {
|
238
|
+
return inverse(this);
|
239
|
+
}
|
240
|
+
} else {
|
241
|
+
return fn(context);
|
242
|
+
}
|
243
|
+
});
|
132
244
|
|
133
|
-
(function() {
|
134
|
-
|
135
|
-
|
136
|
-
"<": "<",
|
137
|
-
">": ">",
|
138
|
-
'"': """,
|
139
|
-
"'": "'",
|
140
|
-
"`": "`"
|
141
|
-
};
|
245
|
+
instance.registerHelper('each', function(context, options) {
|
246
|
+
var fn = options.fn, inverse = options.inverse;
|
247
|
+
var i = 0, ret = "", data;
|
142
248
|
|
143
|
-
|
144
|
-
var possible = /[&<>"'`]/;
|
249
|
+
if (isFunction(context)) { context = context.call(this); }
|
145
250
|
|
146
|
-
|
147
|
-
|
148
|
-
|
251
|
+
if (options.data) {
|
252
|
+
data = createFrame(options.data);
|
253
|
+
}
|
149
254
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
255
|
+
if(context && typeof context === 'object') {
|
256
|
+
if (isArray(context)) {
|
257
|
+
for(var j = context.length; i<j; i++) {
|
258
|
+
if (data) {
|
259
|
+
data.index = i;
|
260
|
+
data.first = (i === 0);
|
261
|
+
data.last = (i === (context.length-1));
|
262
|
+
}
|
263
|
+
ret = ret + fn(context[i], { data: data });
|
264
|
+
}
|
265
|
+
} else {
|
266
|
+
for(var key in context) {
|
267
|
+
if(context.hasOwnProperty(key)) {
|
268
|
+
if(data) {
|
269
|
+
data.key = key;
|
270
|
+
data.index = i;
|
271
|
+
data.first = (i === 0);
|
272
|
+
}
|
273
|
+
ret = ret + fn(context[key], {data: data});
|
274
|
+
i++;
|
275
|
+
}
|
276
|
+
}
|
277
|
+
}
|
157
278
|
}
|
158
279
|
|
159
|
-
if(
|
160
|
-
|
161
|
-
|
280
|
+
if(i === 0){
|
281
|
+
ret = inverse(this);
|
282
|
+
}
|
283
|
+
|
284
|
+
return ret;
|
285
|
+
});
|
162
286
|
|
163
|
-
|
164
|
-
if (
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
return true;
|
287
|
+
instance.registerHelper('if', function(conditional, options) {
|
288
|
+
if (isFunction(conditional)) { conditional = conditional.call(this); }
|
289
|
+
|
290
|
+
// Default behavior is to render the positive path if the value is truthy and not empty.
|
291
|
+
// The `includeZero` option may be set to treat the condtional as purely not empty based on the
|
292
|
+
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
|
293
|
+
if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {
|
294
|
+
return options.inverse(this);
|
172
295
|
} else {
|
173
|
-
return
|
296
|
+
return options.fn(this);
|
297
|
+
}
|
298
|
+
});
|
299
|
+
|
300
|
+
instance.registerHelper('unless', function(conditional, options) {
|
301
|
+
return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});
|
302
|
+
});
|
303
|
+
|
304
|
+
instance.registerHelper('with', function(context, options) {
|
305
|
+
if (isFunction(context)) { context = context.call(this); }
|
306
|
+
|
307
|
+
if (!Utils.isEmpty(context)) return options.fn(context);
|
308
|
+
});
|
309
|
+
|
310
|
+
instance.registerHelper('log', function(context, options) {
|
311
|
+
var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
|
312
|
+
instance.log(level, context);
|
313
|
+
});
|
314
|
+
}
|
315
|
+
|
316
|
+
var logger = {
|
317
|
+
methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
|
318
|
+
|
319
|
+
// State enum
|
320
|
+
DEBUG: 0,
|
321
|
+
INFO: 1,
|
322
|
+
WARN: 2,
|
323
|
+
ERROR: 3,
|
324
|
+
level: 3,
|
325
|
+
|
326
|
+
// can be overridden in the host environment
|
327
|
+
log: function(level, obj) {
|
328
|
+
if (logger.level <= level) {
|
329
|
+
var method = logger.methodMap[level];
|
330
|
+
if (typeof console !== 'undefined' && console[method]) {
|
331
|
+
console[method].call(console, obj);
|
332
|
+
}
|
174
333
|
}
|
175
334
|
}
|
176
335
|
};
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
336
|
+
__exports__.logger = logger;
|
337
|
+
function log(level, obj) { logger.log(level, obj); }
|
338
|
+
|
339
|
+
__exports__.log = log;var createFrame = function(object) {
|
340
|
+
var obj = {};
|
341
|
+
Utils.extend(obj, object);
|
342
|
+
return obj;
|
343
|
+
};
|
344
|
+
__exports__.createFrame = createFrame;
|
345
|
+
return __exports__;
|
346
|
+
})(__module2__, __module4__);
|
347
|
+
|
348
|
+
// handlebars/runtime.js
|
349
|
+
var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
|
350
|
+
"use strict";
|
351
|
+
var __exports__ = {};
|
352
|
+
var Utils = __dependency1__;
|
353
|
+
var Exception = __dependency2__;
|
354
|
+
var COMPILER_REVISION = __dependency3__.COMPILER_REVISION;
|
355
|
+
var REVISION_CHANGES = __dependency3__.REVISION_CHANGES;
|
356
|
+
|
357
|
+
function checkRevision(compilerInfo) {
|
358
|
+
var compilerRevision = compilerInfo && compilerInfo[0] || 1,
|
359
|
+
currentRevision = COMPILER_REVISION;
|
360
|
+
|
361
|
+
if (compilerRevision !== currentRevision) {
|
362
|
+
if (compilerRevision < currentRevision) {
|
363
|
+
var runtimeVersions = REVISION_CHANGES[currentRevision],
|
364
|
+
compilerVersions = REVISION_CHANGES[compilerRevision];
|
365
|
+
throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
|
366
|
+
"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
|
367
|
+
} else {
|
368
|
+
// Use the embedded version info since the runtime doesn't know about this revision yet
|
369
|
+
throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
|
370
|
+
"Please update your runtime to a newer version ("+compilerInfo[1]+").");
|
371
|
+
}
|
372
|
+
}
|
373
|
+
}
|
374
|
+
|
375
|
+
__exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial
|
376
|
+
|
377
|
+
function template(templateSpec, env) {
|
378
|
+
if (!env) {
|
379
|
+
throw new Exception("No environment passed to template");
|
380
|
+
}
|
381
|
+
|
382
|
+
// Note: Using env.VM references rather than local var references throughout this section to allow
|
383
|
+
// for external users to override these as psuedo-supported APIs.
|
384
|
+
var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {
|
385
|
+
var result = env.VM.invokePartial.apply(this, arguments);
|
386
|
+
if (result != null) { return result; }
|
387
|
+
|
388
|
+
if (env.compile) {
|
389
|
+
var options = { helpers: helpers, partials: partials, data: data };
|
390
|
+
partials[name] = env.compile(partial, { data: data !== undefined }, env);
|
391
|
+
return partials[name](context, options);
|
392
|
+
} else {
|
393
|
+
throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
|
394
|
+
}
|
395
|
+
};
|
396
|
+
|
181
397
|
// Just add water
|
182
398
|
var container = {
|
183
|
-
escapeExpression:
|
184
|
-
invokePartial:
|
399
|
+
escapeExpression: Utils.escapeExpression,
|
400
|
+
invokePartial: invokePartialWrapper,
|
185
401
|
programs: [],
|
186
402
|
program: function(i, fn, data) {
|
187
403
|
var programWrapper = this.programs[i];
|
188
404
|
if(data) {
|
189
|
-
|
190
|
-
} else if(programWrapper) {
|
191
|
-
|
192
|
-
}
|
193
|
-
|
194
|
-
|
405
|
+
programWrapper = program(i, fn, data);
|
406
|
+
} else if (!programWrapper) {
|
407
|
+
programWrapper = this.programs[i] = program(i, fn);
|
408
|
+
}
|
409
|
+
return programWrapper;
|
410
|
+
},
|
411
|
+
merge: function(param, common) {
|
412
|
+
var ret = param || common;
|
413
|
+
|
414
|
+
if (param && common && (param !== common)) {
|
415
|
+
ret = {};
|
416
|
+
Utils.extend(ret, common);
|
417
|
+
Utils.extend(ret, param);
|
195
418
|
}
|
419
|
+
return ret;
|
196
420
|
},
|
197
|
-
programWithDepth:
|
198
|
-
noop:
|
421
|
+
programWithDepth: env.VM.programWithDepth,
|
422
|
+
noop: env.VM.noop,
|
423
|
+
compilerInfo: null
|
199
424
|
};
|
200
425
|
|
201
426
|
return function(context, options) {
|
202
427
|
options = options || {};
|
203
|
-
|
428
|
+
var namespace = options.partial ? options : env,
|
429
|
+
helpers,
|
430
|
+
partials;
|
431
|
+
|
432
|
+
if (!options.partial) {
|
433
|
+
helpers = options.helpers;
|
434
|
+
partials = options.partials;
|
435
|
+
}
|
436
|
+
var result = templateSpec.call(
|
437
|
+
container,
|
438
|
+
namespace, context,
|
439
|
+
helpers,
|
440
|
+
partials,
|
441
|
+
options.data);
|
442
|
+
|
443
|
+
if (!options.partial) {
|
444
|
+
env.VM.checkRevision(container.compilerInfo);
|
445
|
+
}
|
446
|
+
|
447
|
+
return result;
|
204
448
|
};
|
205
|
-
}
|
449
|
+
}
|
206
450
|
|
207
|
-
|
208
|
-
var args = Array.prototype.slice.call(arguments,
|
451
|
+
__exports__.template = template;function programWithDepth(i, fn, data /*, $depth */) {
|
452
|
+
var args = Array.prototype.slice.call(arguments, 3);
|
209
453
|
|
210
|
-
|
454
|
+
var prog = function(context, options) {
|
211
455
|
options = options || {};
|
212
456
|
|
213
457
|
return fn.apply(this, [context, options.data || data].concat(args));
|
214
458
|
};
|
215
|
-
|
216
|
-
|
217
|
-
return
|
459
|
+
prog.program = i;
|
460
|
+
prog.depth = args.length;
|
461
|
+
return prog;
|
462
|
+
}
|
463
|
+
|
464
|
+
__exports__.programWithDepth = programWithDepth;function program(i, fn, data) {
|
465
|
+
var prog = function(context, options) {
|
218
466
|
options = options || {};
|
219
467
|
|
220
468
|
return fn(context, options.data || data);
|
221
469
|
};
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
470
|
+
prog.program = i;
|
471
|
+
prog.depth = 0;
|
472
|
+
return prog;
|
473
|
+
}
|
474
|
+
|
475
|
+
__exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data) {
|
476
|
+
var options = { partial: true, helpers: helpers, partials: partials, data: data };
|
226
477
|
|
227
478
|
if(partial === undefined) {
|
228
|
-
throw new
|
479
|
+
throw new Exception("The partial " + name + " could not be found");
|
229
480
|
} else if(partial instanceof Function) {
|
230
481
|
return partial(context, options);
|
231
|
-
} else if (!Handlebars.compile) {
|
232
|
-
throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
|
233
|
-
} else {
|
234
|
-
partials[name] = Handlebars.compile(partial, {data: data !== undefined});
|
235
|
-
return partials[name](context, options);
|
236
482
|
}
|
237
483
|
}
|
238
|
-
};
|
239
484
|
|
240
|
-
|
241
|
-
|
485
|
+
__exports__.invokePartial = invokePartial;function noop() { return ""; }
|
486
|
+
|
487
|
+
__exports__.noop = noop;
|
488
|
+
return __exports__;
|
489
|
+
})(__module2__, __module4__, __module1__);
|
490
|
+
|
491
|
+
// handlebars.runtime.js
|
492
|
+
var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
|
493
|
+
"use strict";
|
494
|
+
var __exports__;
|
495
|
+
/*globals Handlebars: true */
|
496
|
+
var base = __dependency1__;
|
497
|
+
|
498
|
+
// Each of these augment the Handlebars object. No need to setup here.
|
499
|
+
// (This is done to easily share code between commonjs and browse envs)
|
500
|
+
var SafeString = __dependency2__;
|
501
|
+
var Exception = __dependency3__;
|
502
|
+
var Utils = __dependency4__;
|
503
|
+
var runtime = __dependency5__;
|
504
|
+
|
505
|
+
// For compatibility and usage outside of module systems, make the Handlebars object a namespace
|
506
|
+
var create = function() {
|
507
|
+
var hb = new base.HandlebarsEnvironment();
|
508
|
+
|
509
|
+
Utils.extend(hb, base);
|
510
|
+
hb.SafeString = SafeString;
|
511
|
+
hb.Exception = Exception;
|
512
|
+
hb.Utils = Utils;
|
513
|
+
|
514
|
+
hb.VM = runtime;
|
515
|
+
hb.template = function(spec) {
|
516
|
+
return runtime.template(spec, hb);
|
517
|
+
};
|
518
|
+
|
519
|
+
return hb;
|
520
|
+
};
|
521
|
+
|
522
|
+
var Handlebars = create();
|
523
|
+
Handlebars.create = create;
|
524
|
+
|
525
|
+
__exports__ = Handlebars;
|
526
|
+
return __exports__;
|
527
|
+
})(__module1__, __module3__, __module4__, __module2__, __module5__);
|
528
|
+
|
529
|
+
return __module0__;
|
530
|
+
})();
|