|
|
|
@ -20,22 +20,23 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
@license
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// lib/handlebars/browser-prefix.js
|
|
|
|
|
var Handlebars = {};
|
|
|
|
|
|
|
|
|
|
(function(Handlebars, undefined) {
|
|
|
|
|
(function(undefined) {
|
|
|
|
|
var Handlebars = {};
|
|
|
|
|
;
|
|
|
|
|
// lib/handlebars/base.js
|
|
|
|
|
|
|
|
|
|
Handlebars.VERSION = "1.0.0-rc.4";
|
|
|
|
|
Handlebars.COMPILER_REVISION = 3;
|
|
|
|
|
Handlebars.VERSION = "1.0.0";
|
|
|
|
|
Handlebars.COMPILER_REVISION = 4;
|
|
|
|
|
|
|
|
|
|
Handlebars.REVISION_CHANGES = {
|
|
|
|
|
1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
|
|
|
|
|
2: '== 1.0.0-rc.3',
|
|
|
|
|
3: '>= 1.0.0-rc.4'
|
|
|
|
|
3: '== 1.0.0-rc.4',
|
|
|
|
|
4: '>= 1.0.0'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Handlebars.helpers = {};
|
|
|
|
@ -67,7 +68,7 @@ Handlebars.registerHelper('helperMissing', function(arg) {
|
|
|
|
|
if(arguments.length === 2) {
|
|
|
|
|
return undefined;
|
|
|
|
|
} else {
|
|
|
|
|
throw new Error("Could not find property '" + arg + "'");
|
|
|
|
|
throw new Error("Missing helper: '" + arg + "'");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -124,6 +125,9 @@ Handlebars.registerHelper('each', function(context, options) {
|
|
|
|
|
var fn = options.fn, inverse = options.inverse;
|
|
|
|
|
var i = 0, ret = "", data;
|
|
|
|
|
|
|
|
|
|
var type = toString.call(context);
|
|
|
|
|
if(type === functionType) { context = context.call(this); }
|
|
|
|
|
|
|
|
|
|
if (options.data) {
|
|
|
|
|
data = Handlebars.createFrame(options.data);
|
|
|
|
|
}
|
|
|
|
@ -168,6 +172,9 @@ Handlebars.registerHelper('unless', function(conditional, options) {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Handlebars.registerHelper('with', function(context, options) {
|
|
|
|
|
var type = toString.call(context);
|
|
|
|
|
if(type === functionType) { context = context.call(this); }
|
|
|
|
|
|
|
|
|
|
if (!Handlebars.Utils.isEmpty(context)) return options.fn(context);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -269,6 +276,16 @@ Handlebars.VM = {
|
|
|
|
|
}
|
|
|
|
|
return programWrapper;
|
|
|
|
|
},
|
|
|
|
|
merge: function(param, common) {
|
|
|
|
|
var ret = param || common;
|
|
|
|
|
|
|
|
|
|
if (param && common) {
|
|
|
|
|
ret = {};
|
|
|
|
|
Handlebars.Utils.extend(ret, common);
|
|
|
|
|
Handlebars.Utils.extend(ret, param);
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
},
|
|
|
|
|
programWithDepth: Handlebars.VM.programWithDepth,
|
|
|
|
|
noop: Handlebars.VM.noop,
|
|
|
|
|
compilerInfo: null
|
|
|
|
@ -341,5 +358,17 @@ Handlebars.VM = {
|
|
|
|
|
Handlebars.template = Handlebars.VM.template;
|
|
|
|
|
;
|
|
|
|
|
// lib/handlebars/browser-suffix.js
|
|
|
|
|
})(Handlebars);
|
|
|
|
|
if (typeof module === 'object' && module.exports) {
|
|
|
|
|
// CommonJS
|
|
|
|
|
module.exports = Handlebars;
|
|
|
|
|
|
|
|
|
|
} else if (typeof define === "function" && define.amd) {
|
|
|
|
|
// AMD modules
|
|
|
|
|
define(function() { return Handlebars; });
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
// other, i.e. browser
|
|
|
|
|
this.Handlebars = Handlebars;
|
|
|
|
|
}
|
|
|
|
|
}).call(this);
|
|
|
|
|
;
|
|
|
|
|