sht_rails 0.2.0 → 0.2.1
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 +4 -4
- data/README.md +9 -0
- data/lib/sht_rails/config.rb +3 -1
- data/lib/sht_rails/tilt.rb +3 -5
- data/lib/sht_rails/version.rb +1 -1
- data/vendor/assets/javascripts/handlebars.js +1550 -1005
- data/vendor/assets/javascripts/handlebars.runtime.js +422 -213
- metadata +3 -3
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
/*!
|
2
|
+
|
3
|
+
handlebars v1.3.0
|
2
4
|
|
3
5
|
Copyright (C) 2011 by Yehuda Katz
|
4
6
|
|
@@ -20,302 +22,509 @@ 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
|
*/
|
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
|
+
}
|
37
|
+
|
38
|
+
SafeString.prototype.toString = function() {
|
39
|
+
return "" + this.string;
|
40
|
+
};
|
24
41
|
|
25
|
-
|
42
|
+
__exports__ = SafeString;
|
43
|
+
return __exports__;
|
44
|
+
})();
|
26
45
|
|
27
|
-
|
28
|
-
|
46
|
+
// handlebars/utils.js
|
47
|
+
var __module2__ = (function(__dependency1__) {
|
48
|
+
"use strict";
|
49
|
+
var __exports__ = {};
|
50
|
+
/*jshint -W004 */
|
51
|
+
var SafeString = __dependency1__;
|
29
52
|
|
30
|
-
|
53
|
+
var escape = {
|
54
|
+
"&": "&",
|
55
|
+
"<": "<",
|
56
|
+
">": ">",
|
57
|
+
'"': """,
|
58
|
+
"'": "'",
|
59
|
+
"`": "`"
|
60
|
+
};
|
31
61
|
|
32
|
-
|
33
|
-
|
62
|
+
var badChars = /[&<>"'`]/g;
|
63
|
+
var possible = /[&<>"'`]/;
|
34
64
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
};
|
65
|
+
function escapeChar(chr) {
|
66
|
+
return escape[chr] || "&";
|
67
|
+
}
|
39
68
|
|
40
|
-
|
41
|
-
|
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
|
+
}
|
42
76
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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
|
+
}
|
47
104
|
|
48
|
-
|
49
|
-
|
50
|
-
|
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;
|
51
109
|
|
52
|
-
|
53
|
-
|
54
|
-
return undefined;
|
55
|
-
} else {
|
56
|
-
throw new Error("Could not find property '" + arg + "'");
|
110
|
+
if(!possible.test(string)) { return string; }
|
111
|
+
return string.replace(badChars, escapeChar);
|
57
112
|
}
|
58
|
-
});
|
59
113
|
|
60
|
-
|
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;
|
119
|
+
} else {
|
120
|
+
return false;
|
121
|
+
}
|
122
|
+
}
|
61
123
|
|
62
|
-
|
63
|
-
|
124
|
+
__exports__.isEmpty = isEmpty;
|
125
|
+
return __exports__;
|
126
|
+
})(__module3__);
|
64
127
|
|
128
|
+
// handlebars/exception.js
|
129
|
+
var __module4__ = (function() {
|
130
|
+
"use strict";
|
131
|
+
var __exports__;
|
65
132
|
|
66
|
-
var
|
67
|
-
var type = toString.call(context);
|
133
|
+
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
|
68
134
|
|
69
|
-
|
135
|
+
function Exception(message, node) {
|
136
|
+
var line;
|
137
|
+
if (node && node.firstLine) {
|
138
|
+
line = node.firstLine;
|
70
139
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
140
|
+
message += ' - ' + line + ':' + node.firstColumn;
|
141
|
+
}
|
142
|
+
|
143
|
+
var tmp = Error.prototype.constructor.call(this, message);
|
144
|
+
|
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;
|
80
153
|
}
|
81
|
-
} else {
|
82
|
-
return fn(context);
|
83
154
|
}
|
84
|
-
});
|
85
155
|
|
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
|
-
|
90
|
-
var obj = new Handlebars.K();
|
91
|
-
Handlebars.K.prototype = null;
|
92
|
-
return obj;
|
93
|
-
};
|
188
|
+
registerDefaultHelpers(this);
|
189
|
+
}
|
94
190
|
|
95
|
-
|
96
|
-
|
191
|
+
__exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
|
192
|
+
constructor: HandlebarsEnvironment,
|
97
193
|
|
98
|
-
|
194
|
+
logger: logger,
|
195
|
+
log: log,
|
99
196
|
|
100
|
-
|
101
|
-
|
102
|
-
|
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
|
+
},
|
206
|
+
|
207
|
+
registerPartial: function(name, str) {
|
208
|
+
if (toString.call(name) === objectType) {
|
209
|
+
Utils.extend(this.partials, name);
|
210
|
+
} else {
|
211
|
+
this.partials[name] = str;
|
106
212
|
}
|
107
213
|
}
|
108
|
-
}
|
109
|
-
};
|
214
|
+
};
|
110
215
|
|
111
|
-
|
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
|
+
});
|
112
224
|
|
113
|
-
|
114
|
-
|
115
|
-
var i = 0, ret = "", data;
|
225
|
+
instance.registerHelper('blockHelperMissing', function(context, options) {
|
226
|
+
var inverse = options.inverse || function() {}, fn = options.fn;
|
116
227
|
|
117
|
-
|
118
|
-
data = Handlebars.createFrame(options.data);
|
119
|
-
}
|
228
|
+
if (isFunction(context)) { context = context.call(this); }
|
120
229
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
if(data) { data.key = key; }
|
131
|
-
ret = ret + fn(context[key], {data: data});
|
132
|
-
i++;
|
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);
|
133
239
|
}
|
240
|
+
} else {
|
241
|
+
return fn(context);
|
134
242
|
}
|
135
|
-
}
|
136
|
-
}
|
243
|
+
});
|
137
244
|
|
138
|
-
|
139
|
-
|
140
|
-
|
245
|
+
instance.registerHelper('each', function(context, options) {
|
246
|
+
var fn = options.fn, inverse = options.inverse;
|
247
|
+
var i = 0, ret = "", data;
|
141
248
|
|
142
|
-
|
143
|
-
});
|
249
|
+
if (isFunction(context)) { context = context.call(this); }
|
144
250
|
|
145
|
-
|
146
|
-
|
147
|
-
|
251
|
+
if (options.data) {
|
252
|
+
data = createFrame(options.data);
|
253
|
+
}
|
148
254
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
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
|
+
}
|
278
|
+
}
|
155
279
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
options.inverse = fn;
|
280
|
+
if(i === 0){
|
281
|
+
ret = inverse(this);
|
282
|
+
}
|
160
283
|
|
161
|
-
|
162
|
-
});
|
284
|
+
return ret;
|
285
|
+
});
|
163
286
|
|
164
|
-
|
165
|
-
|
166
|
-
});
|
287
|
+
instance.registerHelper('if', function(conditional, options) {
|
288
|
+
if (isFunction(conditional)) { conditional = conditional.call(this); }
|
167
289
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
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);
|
295
|
+
} else {
|
296
|
+
return options.fn(this);
|
297
|
+
}
|
298
|
+
});
|
172
299
|
|
173
|
-
|
174
|
-
;
|
175
|
-
|
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
|
+
});
|
176
303
|
|
177
|
-
|
304
|
+
instance.registerHelper('with', function(context, options) {
|
305
|
+
if (isFunction(context)) { context = context.call(this); }
|
178
306
|
|
179
|
-
|
180
|
-
|
307
|
+
if (!Utils.isEmpty(context)) return options.fn(context);
|
308
|
+
});
|
181
309
|
|
182
|
-
|
183
|
-
|
184
|
-
|
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
|
+
});
|
185
314
|
}
|
186
|
-
};
|
187
|
-
Handlebars.Exception.prototype = new Error();
|
188
|
-
|
189
|
-
// Build out our basic SafeString type
|
190
|
-
Handlebars.SafeString = function(string) {
|
191
|
-
this.string = string;
|
192
|
-
};
|
193
|
-
Handlebars.SafeString.prototype.toString = function() {
|
194
|
-
return this.string.toString();
|
195
|
-
};
|
196
|
-
|
197
|
-
(function() {
|
198
|
-
var escape = {
|
199
|
-
"&": "&",
|
200
|
-
"<": "<",
|
201
|
-
">": ">",
|
202
|
-
'"': """,
|
203
|
-
"'": "'",
|
204
|
-
"`": "`"
|
205
|
-
};
|
206
315
|
|
207
|
-
var
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
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
|
+
}
|
333
|
+
}
|
334
|
+
}
|
212
335
|
};
|
336
|
+
__exports__.logger = logger;
|
337
|
+
function log(level, obj) { logger.log(level, obj); }
|
213
338
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
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]+").");
|
221
371
|
}
|
372
|
+
}
|
373
|
+
}
|
222
374
|
|
223
|
-
|
224
|
-
|
225
|
-
|
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
|
+
}
|
226
381
|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
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);
|
232
392
|
} else {
|
233
|
-
|
393
|
+
throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
|
234
394
|
}
|
235
|
-
}
|
236
|
-
|
237
|
-
})();;
|
238
|
-
// lib/handlebars/runtime.js
|
239
|
-
Handlebars.VM = {
|
240
|
-
template: function(templateSpec) {
|
395
|
+
};
|
396
|
+
|
241
397
|
// Just add water
|
242
398
|
var container = {
|
243
|
-
escapeExpression:
|
244
|
-
invokePartial:
|
399
|
+
escapeExpression: Utils.escapeExpression,
|
400
|
+
invokePartial: invokePartialWrapper,
|
245
401
|
programs: [],
|
246
402
|
program: function(i, fn, data) {
|
247
403
|
var programWrapper = this.programs[i];
|
248
404
|
if(data) {
|
249
|
-
|
250
|
-
} else if(programWrapper) {
|
251
|
-
|
252
|
-
}
|
253
|
-
|
254
|
-
|
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);
|
255
418
|
}
|
419
|
+
return ret;
|
256
420
|
},
|
257
|
-
programWithDepth:
|
258
|
-
noop:
|
421
|
+
programWithDepth: env.VM.programWithDepth,
|
422
|
+
noop: env.VM.noop,
|
259
423
|
compilerInfo: null
|
260
424
|
};
|
261
425
|
|
262
426
|
return function(context, options) {
|
263
427
|
options = options || {};
|
264
|
-
var
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
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);
|
281
445
|
}
|
282
446
|
|
283
447
|
return result;
|
284
448
|
};
|
285
|
-
}
|
449
|
+
}
|
286
450
|
|
287
|
-
|
288
|
-
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);
|
289
453
|
|
290
|
-
|
454
|
+
var prog = function(context, options) {
|
291
455
|
options = options || {};
|
292
456
|
|
293
457
|
return fn.apply(this, [context, options.data || data].concat(args));
|
294
458
|
};
|
295
|
-
|
296
|
-
|
297
|
-
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) {
|
298
466
|
options = options || {};
|
299
467
|
|
300
468
|
return fn(context, options.data || data);
|
301
469
|
};
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
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 };
|
306
477
|
|
307
478
|
if(partial === undefined) {
|
308
|
-
throw new
|
479
|
+
throw new Exception("The partial " + name + " could not be found");
|
309
480
|
} else if(partial instanceof Function) {
|
310
481
|
return partial(context, options);
|
311
|
-
} else if (!Handlebars.compile) {
|
312
|
-
throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
|
313
|
-
} else {
|
314
|
-
partials[name] = Handlebars.compile(partial, {data: data !== undefined});
|
315
|
-
return partials[name](context, options);
|
316
482
|
}
|
317
483
|
}
|
318
|
-
};
|
319
484
|
|
320
|
-
|
321
|
-
|
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
|
+
})();
|