From 5bac5a1b8ddfac226b9d02cf4f5c64e84ad8e8d1 Mon Sep 17 00:00:00 2001 From: Bala Clark Date: Mon, 13 Jul 2015 20:46:48 +0200 Subject: [PATCH] starting new build --- Makefile | 15 - README.md | 8 +- app/index.js | 15 + app/view/load-indicator.js | 7 + ...y.handlebars => load-indicator.handlebars} | 0 dist/comicbook.js | 792 ++++++++++++++++++ dist/comicbook.js.map | 35 + package.json | 15 +- 8 files changed, 867 insertions(+), 20 deletions(-) delete mode 100755 Makefile create mode 100644 app/view/load-indicator.js rename app/view/template/{loadingOverlay.handlebars => load-indicator.handlebars} (100%) create mode 100644 dist/comicbook.js create mode 100644 dist/comicbook.js.map diff --git a/Makefile b/Makefile deleted file mode 100755 index 2f348c1..0000000 --- a/Makefile +++ /dev/null @@ -1,15 +0,0 @@ - -build: - @echo "Compiling and minifying javascript..." - @./node_modules/.bin/uglifyjs dist/js/comicbook.js --compress --mangle --screw-ie8 --output comicbook.min.js --source-map dist/js/comicbook.min.js.map --source-map-root ./ - @echo "Compiling CSS..." - @cat fonts/icomoon-toolbar/style.css css/reset.css css/styles.css css/toolbar.css > comicbook/comicbook.css - @./node_modules/.bin/cssmin dist/comicbook.css > dist/comicbook.min.css - @echo "Copying assets..." - @cp -r assets/css/img dist/img - @cp -r assets/icons/1_Desktop_Icons/icon_128.png comicbook/img - @cp -r assets/icons/1_Desktop_Icons/icon_196.png comicbook/img - @cp -r assets/fonts/icomoon-toolbar/fonts comicbook - @cp -r assets/fonts/icomoon-toolbar/license.txt comicbook/fonts - @echo "Done" - diff --git a/README.md b/README.md index b1683e6..c3eed3b 100755 --- a/README.md +++ b/README.md @@ -17,9 +17,11 @@ Development Install Builds require nodejs and npm. Installs have been tested with nodejs 0.10.0, older versions may or may not work. - npm install - make - make test +```sh +npm install +npm run build +npm test +``` Copyright and License --------------------- diff --git a/app/index.js b/app/index.js index e69de29..4f2ae30 100644 --- a/app/index.js +++ b/app/index.js @@ -0,0 +1,15 @@ +'use strict' + +let loadIndicator = require('./view/load-indicator') + +function ComicBook () { + return { + replace (selector) { + console.log(selector, loadIndicator()) + } + } +} + +// TODO properly export in various formats +window.ComicBook = ComicBook + diff --git a/app/view/load-indicator.js b/app/view/load-indicator.js new file mode 100644 index 0000000..8034362 --- /dev/null +++ b/app/view/load-indicator.js @@ -0,0 +1,7 @@ +'use strict' + +let template = require('./template/load-indicator.handlebars') + +module.exports = function loadIndicator () { + console.log(template()) +} diff --git a/app/view/template/loadingOverlay.handlebars b/app/view/template/load-indicator.handlebars similarity index 100% rename from app/view/template/loadingOverlay.handlebars rename to app/view/template/load-indicator.handlebars diff --git a/dist/comicbook.js b/dist/comicbook.js new file mode 100644 index 0000000..c2130ed --- /dev/null +++ b/dist/comicbook.js @@ -0,0 +1,792 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { + return "\n
\n"; +},"useData":true}); +},{"handlebars/runtime":11}],4:[function(require,module,exports){ +'use strict'; + +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + +exports.__esModule = true; + +var _import = require('./handlebars/base'); + +var base = _interopRequireWildcard(_import); + +// Each of these augment the Handlebars object. No need to setup here. +// (This is done to easily share code between commonjs and browse envs) + +var _SafeString = require('./handlebars/safe-string'); + +var _SafeString2 = _interopRequireWildcard(_SafeString); + +var _Exception = require('./handlebars/exception'); + +var _Exception2 = _interopRequireWildcard(_Exception); + +var _import2 = require('./handlebars/utils'); + +var Utils = _interopRequireWildcard(_import2); + +var _import3 = require('./handlebars/runtime'); + +var runtime = _interopRequireWildcard(_import3); + +var _noConflict = require('./handlebars/no-conflict'); + +var _noConflict2 = _interopRequireWildcard(_noConflict); + +// For compatibility and usage outside of module systems, make the Handlebars object a namespace +function create() { + var hb = new base.HandlebarsEnvironment(); + + Utils.extend(hb, base); + hb.SafeString = _SafeString2['default']; + hb.Exception = _Exception2['default']; + hb.Utils = Utils; + hb.escapeExpression = Utils.escapeExpression; + + hb.VM = runtime; + hb.template = function (spec) { + return runtime.template(spec, hb); + }; + + return hb; +} + +var inst = create(); +inst.create = create; + +_noConflict2['default'](inst); + +inst['default'] = inst; + +exports['default'] = inst; +module.exports = exports['default']; +},{"./handlebars/base":5,"./handlebars/exception":6,"./handlebars/no-conflict":7,"./handlebars/runtime":8,"./handlebars/safe-string":9,"./handlebars/utils":10}],5:[function(require,module,exports){ +'use strict'; + +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + +exports.__esModule = true; +exports.HandlebarsEnvironment = HandlebarsEnvironment; +exports.createFrame = createFrame; + +var _import = require('./utils'); + +var Utils = _interopRequireWildcard(_import); + +var _Exception = require('./exception'); + +var _Exception2 = _interopRequireWildcard(_Exception); + +var VERSION = '3.0.1'; +exports.VERSION = VERSION; +var COMPILER_REVISION = 6; + +exports.COMPILER_REVISION = COMPILER_REVISION; +var 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', + 4: '== 1.x.x', + 5: '== 2.0.0-alpha.x', + 6: '>= 2.0.0-beta.1' +}; + +exports.REVISION_CHANGES = REVISION_CHANGES; +var isArray = Utils.isArray, + isFunction = Utils.isFunction, + toString = Utils.toString, + objectType = '[object Object]'; + +function HandlebarsEnvironment(helpers, partials) { + this.helpers = helpers || {}; + this.partials = partials || {}; + + registerDefaultHelpers(this); +} + +HandlebarsEnvironment.prototype = { + constructor: HandlebarsEnvironment, + + logger: logger, + log: log, + + registerHelper: function registerHelper(name, fn) { + if (toString.call(name) === objectType) { + if (fn) { + throw new _Exception2['default']('Arg not supported with multiple helpers'); + } + Utils.extend(this.helpers, name); + } else { + this.helpers[name] = fn; + } + }, + unregisterHelper: function unregisterHelper(name) { + delete this.helpers[name]; + }, + + registerPartial: function registerPartial(name, partial) { + if (toString.call(name) === objectType) { + Utils.extend(this.partials, name); + } else { + if (typeof partial === 'undefined') { + throw new _Exception2['default']('Attempting to register a partial as undefined'); + } + this.partials[name] = partial; + } + }, + unregisterPartial: function unregisterPartial(name) { + delete this.partials[name]; + } +}; + +function registerDefaultHelpers(instance) { + instance.registerHelper('helperMissing', function () { + if (arguments.length === 1) { + // A missing field in a {{foo}} constuct. + return undefined; + } else { + // Someone is actually trying to call something, blow up. + throw new _Exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); + } + }); + + instance.registerHelper('blockHelperMissing', function (context, options) { + var inverse = options.inverse, + fn = options.fn; + + if (context === true) { + return fn(this); + } else if (context === false || context == null) { + return inverse(this); + } else if (isArray(context)) { + if (context.length > 0) { + if (options.ids) { + options.ids = [options.name]; + } + + return instance.helpers.each(context, options); + } else { + return inverse(this); + } + } else { + if (options.data && options.ids) { + var data = createFrame(options.data); + data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name); + options = { data: data }; + } + + return fn(context, options); + } + }); + + instance.registerHelper('each', function (context, options) { + if (!options) { + throw new _Exception2['default']('Must pass iterator to #each'); + } + + var fn = options.fn, + inverse = options.inverse, + i = 0, + ret = '', + data = undefined, + contextPath = undefined; + + if (options.data && options.ids) { + contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; + } + + if (isFunction(context)) { + context = context.call(this); + } + + if (options.data) { + data = createFrame(options.data); + } + + function execIteration(field, index, last) { + if (data) { + data.key = field; + data.index = index; + data.first = index === 0; + data.last = !!last; + + if (contextPath) { + data.contextPath = contextPath + field; + } + } + + ret = ret + fn(context[field], { + data: data, + blockParams: Utils.blockParams([context[field], field], [contextPath + field, null]) + }); + } + + if (context && typeof context === 'object') { + if (isArray(context)) { + for (var j = context.length; i < j; i++) { + execIteration(i, i, i === context.length - 1); + } + } else { + var priorKey = undefined; + + for (var key in context) { + if (context.hasOwnProperty(key)) { + // We're running the iterations one step out of sync so we can detect + // the last iteration without have to scan the object twice and create + // an itermediate keys array. + if (priorKey) { + execIteration(priorKey, i - 1); + } + priorKey = key; + i++; + } + } + if (priorKey) { + execIteration(priorKey, i - 1, true); + } + } + } + + if (i === 0) { + ret = inverse(this); + } + + return ret; + }); + + instance.registerHelper('if', function (conditional, options) { + if (isFunction(conditional)) { + conditional = conditional.call(this); + } + + // Default behavior is to render the positive path if the value is truthy and not empty. + // The `includeZero` option may be set to treat the condtional as purely not empty based on the + // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. + if (!options.hash.includeZero && !conditional || Utils.isEmpty(conditional)) { + return options.inverse(this); + } else { + return options.fn(this); + } + }); + + instance.registerHelper('unless', function (conditional, options) { + return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); + }); + + instance.registerHelper('with', function (context, options) { + if (isFunction(context)) { + context = context.call(this); + } + + var fn = options.fn; + + if (!Utils.isEmpty(context)) { + if (options.data && options.ids) { + var data = createFrame(options.data); + data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]); + options = { data: data }; + } + + return fn(context, options); + } else { + return options.inverse(this); + } + }); + + instance.registerHelper('log', function (message, options) { + var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1; + instance.log(level, message); + }); + + instance.registerHelper('lookup', function (obj, field) { + return obj && obj[field]; + }); +} + +var logger = { + methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' }, + + // State enum + DEBUG: 0, + INFO: 1, + WARN: 2, + ERROR: 3, + level: 1, + + // Can be overridden in the host environment + log: function log(level, message) { + if (typeof console !== 'undefined' && logger.level <= level) { + var method = logger.methodMap[level]; + (console[method] || console.log).call(console, message); // eslint-disable-line no-console + } + } +}; + +exports.logger = logger; +var log = logger.log; + +exports.log = log; + +function createFrame(object) { + var frame = Utils.extend({}, object); + frame._parent = object; + return frame; +} + +/* [args, ]options */ +},{"./exception":6,"./utils":10}],6:[function(require,module,exports){ +'use strict'; + +exports.__esModule = true; + +var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; + +function Exception(message, node) { + var loc = node && node.loc, + line = undefined, + column = undefined; + if (loc) { + line = loc.start.line; + column = loc.start.column; + + message += ' - ' + line + ':' + column; + } + + var tmp = Error.prototype.constructor.call(this, message); + + // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. + for (var idx = 0; idx < errorProps.length; idx++) { + this[errorProps[idx]] = tmp[errorProps[idx]]; + } + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, Exception); + } + + if (loc) { + this.lineNumber = line; + this.column = column; + } +} + +Exception.prototype = new Error(); + +exports['default'] = Exception; +module.exports = exports['default']; +},{}],7:[function(require,module,exports){ +(function (global){ +'use strict'; + +exports.__esModule = true; +/*global window */ + +exports['default'] = function (Handlebars) { + /* istanbul ignore next */ + var root = typeof global !== 'undefined' ? global : window, + $Handlebars = root.Handlebars; + /* istanbul ignore next */ + Handlebars.noConflict = function () { + if (root.Handlebars === Handlebars) { + root.Handlebars = $Handlebars; + } + }; +}; + +module.exports = exports['default']; +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + +},{}],8:[function(require,module,exports){ +'use strict'; + +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + +exports.__esModule = true; +exports.checkRevision = checkRevision; + +// TODO: Remove this line and break up compilePartial + +exports.template = template; +exports.wrapProgram = wrapProgram; +exports.resolvePartial = resolvePartial; +exports.invokePartial = invokePartial; +exports.noop = noop; + +var _import = require('./utils'); + +var Utils = _interopRequireWildcard(_import); + +var _Exception = require('./exception'); + +var _Exception2 = _interopRequireWildcard(_Exception); + +var _COMPILER_REVISION$REVISION_CHANGES$createFrame = require('./base'); + +function checkRevision(compilerInfo) { + var compilerRevision = compilerInfo && compilerInfo[0] || 1, + currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION; + + if (compilerRevision !== currentRevision) { + if (compilerRevision < currentRevision) { + var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision], + compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision]; + throw new _Exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); + } else { + // Use the embedded version info since the runtime doesn't know about this revision yet + throw new _Exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); + } + } +} + +function template(templateSpec, env) { + /* istanbul ignore next */ + if (!env) { + throw new _Exception2['default']('No environment passed to template'); + } + if (!templateSpec || !templateSpec.main) { + throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec); + } + + // Note: Using env.VM references rather than local var references throughout this section to allow + // for external users to override these as psuedo-supported APIs. + env.VM.checkRevision(templateSpec.compiler); + + function invokePartialWrapper(partial, context, options) { + if (options.hash) { + context = Utils.extend({}, context, options.hash); + } + + partial = env.VM.resolvePartial.call(this, partial, context, options); + var result = env.VM.invokePartial.call(this, partial, context, options); + + if (result == null && env.compile) { + options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); + result = options.partials[options.name](context, options); + } + if (result != null) { + if (options.indent) { + var lines = result.split('\n'); + for (var i = 0, l = lines.length; i < l; i++) { + if (!lines[i] && i + 1 === l) { + break; + } + + lines[i] = options.indent + lines[i]; + } + result = lines.join('\n'); + } + return result; + } else { + throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); + } + } + + // Just add water + var container = { + strict: function strict(obj, name) { + if (!(name in obj)) { + throw new _Exception2['default']('"' + name + '" not defined in ' + obj); + } + return obj[name]; + }, + lookup: function lookup(depths, name) { + var len = depths.length; + for (var i = 0; i < len; i++) { + if (depths[i] && depths[i][name] != null) { + return depths[i][name]; + } + } + }, + lambda: function lambda(current, context) { + return typeof current === 'function' ? current.call(context) : current; + }, + + escapeExpression: Utils.escapeExpression, + invokePartial: invokePartialWrapper, + + fn: function fn(i) { + return templateSpec[i]; + }, + + programs: [], + program: function program(i, data, declaredBlockParams, blockParams, depths) { + var programWrapper = this.programs[i], + fn = this.fn(i); + if (data || depths || blockParams || declaredBlockParams) { + programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); + } else if (!programWrapper) { + programWrapper = this.programs[i] = wrapProgram(this, i, fn); + } + return programWrapper; + }, + + data: function data(value, depth) { + while (value && depth--) { + value = value._parent; + } + return value; + }, + merge: function merge(param, common) { + var obj = param || common; + + if (param && common && param !== common) { + obj = Utils.extend({}, common, param); + } + + return obj; + }, + + noop: env.VM.noop, + compilerInfo: templateSpec.compiler + }; + + function ret(context) { + var options = arguments[1] === undefined ? {} : arguments[1]; + + var data = options.data; + + ret._setup(options); + if (!options.partial && templateSpec.useData) { + data = initData(context, data); + } + var depths = undefined, + blockParams = templateSpec.useBlockParams ? [] : undefined; + if (templateSpec.useDepths) { + depths = options.depths ? [context].concat(options.depths) : [context]; + } + + return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths); + } + ret.isTop = true; + + ret._setup = function (options) { + if (!options.partial) { + container.helpers = container.merge(options.helpers, env.helpers); + + if (templateSpec.usePartial) { + container.partials = container.merge(options.partials, env.partials); + } + } else { + container.helpers = options.helpers; + container.partials = options.partials; + } + }; + + ret._child = function (i, data, blockParams, depths) { + if (templateSpec.useBlockParams && !blockParams) { + throw new _Exception2['default']('must pass block params'); + } + if (templateSpec.useDepths && !depths) { + throw new _Exception2['default']('must pass parent depths'); + } + + return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); + }; + return ret; +} + +function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { + function prog(context) { + var options = arguments[1] === undefined ? {} : arguments[1]; + + return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths)); + } + prog.program = i; + prog.depth = depths ? depths.length : 0; + prog.blockParams = declaredBlockParams || 0; + return prog; +} + +function resolvePartial(partial, context, options) { + if (!partial) { + partial = options.partials[options.name]; + } else if (!partial.call && !options.name) { + // This is a dynamic partial that returned a string + options.name = partial; + partial = options.partials[partial]; + } + return partial; +} + +function invokePartial(partial, context, options) { + options.partial = true; + + if (partial === undefined) { + throw new _Exception2['default']('The partial ' + options.name + ' could not be found'); + } else if (partial instanceof Function) { + return partial(context, options); + } +} + +function noop() { + return ''; +} + +function initData(context, data) { + if (!data || !('root' in data)) { + data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {}; + data.root = context; + } + return data; +} +},{"./base":5,"./exception":6,"./utils":10}],9:[function(require,module,exports){ +'use strict'; + +exports.__esModule = true; +// Build out our basic SafeString type +function SafeString(string) { + this.string = string; +} + +SafeString.prototype.toString = SafeString.prototype.toHTML = function () { + return '' + this.string; +}; + +exports['default'] = SafeString; +module.exports = exports['default']; +},{}],10:[function(require,module,exports){ +'use strict'; + +exports.__esModule = true; +exports.extend = extend; + +// Older IE versions do not directly support indexOf so we must implement our own, sadly. +exports.indexOf = indexOf; +exports.escapeExpression = escapeExpression; +exports.isEmpty = isEmpty; +exports.blockParams = blockParams; +exports.appendContextPath = appendContextPath; +var escape = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''', + '`': '`' +}; + +var badChars = /[&<>"'`]/g, + possible = /[&<>"'`]/; + +function escapeChar(chr) { + return escape[chr]; +} + +function extend(obj /* , ...source */) { + for (var i = 1; i < arguments.length; i++) { + for (var key in arguments[i]) { + if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { + obj[key] = arguments[i][key]; + } + } + } + + return obj; +} + +var toString = Object.prototype.toString; + +exports.toString = toString; +// Sourced from lodash +// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt +/*eslint-disable func-style, no-var */ +var isFunction = function isFunction(value) { + return typeof value === 'function'; +}; +// fallback for older versions of Chrome and Safari +/* istanbul ignore next */ +if (isFunction(/x/)) { + exports.isFunction = isFunction = function (value) { + return typeof value === 'function' && toString.call(value) === '[object Function]'; + }; +} +var isFunction; +exports.isFunction = isFunction; +/*eslint-enable func-style, no-var */ + +/* istanbul ignore next */ +var isArray = Array.isArray || function (value) { + return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; +};exports.isArray = isArray; + +function indexOf(array, value) { + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; +} + +function escapeExpression(string) { + if (typeof string !== 'string') { + // don't escape SafeStrings, since they're already safe + if (string && string.toHTML) { + return string.toHTML(); + } else if (string == null) { + return ''; + } else if (!string) { + return string + ''; + } + + // Force a string conversion as this will be done by the append regardless and + // the regex test will do this transparently behind the scenes, causing issues if + // an object's to string has escaped characters in it. + string = '' + string; + } + + if (!possible.test(string)) { + return string; + } + return string.replace(badChars, escapeChar); +} + +function isEmpty(value) { + if (!value && value !== 0) { + return true; + } else if (isArray(value) && value.length === 0) { + return true; + } else { + return false; + } +} + +function blockParams(params, ids) { + params.path = ids; + return params; +} + +function appendContextPath(contextPath, id) { + return (contextPath ? contextPath + '.' : '') + id; +} +},{}],11:[function(require,module,exports){ +// Create a simple path alias to allow browserify to resolve +// the runtime on a supported path. +module.exports = require('./dist/cjs/handlebars.runtime')['default']; + +},{"./dist/cjs/handlebars.runtime":4}]},{},[1]) +//# sourceMappingURL=comicbook.js.map diff --git a/dist/comicbook.js.map b/dist/comicbook.js.map new file mode 100644 index 0000000..8450bec --- /dev/null +++ b/dist/comicbook.js.map @@ -0,0 +1,35 @@ +{ + "version": 3, + "sources": [ + "node_modules/browser-pack/_prelude.js", + "/Users/bala/dev/HTML5-Comic-Book-Reader/app/index.js", + "/Users/bala/dev/HTML5-Comic-Book-Reader/app/view/load-indicator.js", + "app/view/template/load-indicator.handlebars", + "node_modules/handlebars/dist/cjs/handlebars.runtime.js", + "node_modules/handlebars/dist/cjs/handlebars/base.js", + "node_modules/handlebars/dist/cjs/handlebars/exception.js", + "node_modules/handlebars/dist/cjs/handlebars/no-conflict.js", + "node_modules/handlebars/dist/cjs/handlebars/runtime.js", + "node_modules/handlebars/dist/cjs/handlebars/safe-string.js", + "node_modules/handlebars/dist/cjs/handlebars/utils.js", + "node_modules/handlebars/runtime.js" + ], + "names": [], + "mappings": "AAAA;ACAA,YAAY,CAAA;;AAEZ,IAAI,aAAa,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;;AAEpD,SAAS,SAAS,GAAG;AACnB,SAAO;AACL,WAAO,EAAA,iBAAC,QAAQ,EAAE;AAChB,aAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAA;KACvC;GACF,CAAA;CACF;;;ACVD,YAAY,CAAA;;AAEZ,IAAI,QAAQ,GAAG,OAAO,CAAC,sCAAsC,CAAC,CAAA;;AAE9D,MAAM,CAAC,OAAO,GAAG,SAAS,aAAa,GAAG;AACxC,SAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAA;CACxB,CAAA;;;ACND;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjHA;AACA;AACA;AACA", + "file": "generated.js", + "sourceRoot": "", + "sourcesContent": [ + "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o= 2.0.0-beta.1\"],\"main\":function(depth0,helpers,partials,data) {\n return \"\\n
\\n\";\n},\"useData\":true});", + "'use strict';\n\nvar _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };\n\nexports.__esModule = true;\n\nvar _import = require('./handlebars/base');\n\nvar base = _interopRequireWildcard(_import);\n\n// Each of these augment the Handlebars object. No need to setup here.\n// (This is done to easily share code between commonjs and browse envs)\n\nvar _SafeString = require('./handlebars/safe-string');\n\nvar _SafeString2 = _interopRequireWildcard(_SafeString);\n\nvar _Exception = require('./handlebars/exception');\n\nvar _Exception2 = _interopRequireWildcard(_Exception);\n\nvar _import2 = require('./handlebars/utils');\n\nvar Utils = _interopRequireWildcard(_import2);\n\nvar _import3 = require('./handlebars/runtime');\n\nvar runtime = _interopRequireWildcard(_import3);\n\nvar _noConflict = require('./handlebars/no-conflict');\n\nvar _noConflict2 = _interopRequireWildcard(_noConflict);\n\n// For compatibility and usage outside of module systems, make the Handlebars object a namespace\nfunction create() {\n var hb = new base.HandlebarsEnvironment();\n\n Utils.extend(hb, base);\n hb.SafeString = _SafeString2['default'];\n hb.Exception = _Exception2['default'];\n hb.Utils = Utils;\n hb.escapeExpression = Utils.escapeExpression;\n\n hb.VM = runtime;\n hb.template = function (spec) {\n return runtime.template(spec, hb);\n };\n\n return hb;\n}\n\nvar inst = create();\ninst.create = create;\n\n_noConflict2['default'](inst);\n\ninst['default'] = inst;\n\nexports['default'] = inst;\nmodule.exports = exports['default'];", + "'use strict';\n\nvar _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };\n\nexports.__esModule = true;\nexports.HandlebarsEnvironment = HandlebarsEnvironment;\nexports.createFrame = createFrame;\n\nvar _import = require('./utils');\n\nvar Utils = _interopRequireWildcard(_import);\n\nvar _Exception = require('./exception');\n\nvar _Exception2 = _interopRequireWildcard(_Exception);\n\nvar VERSION = '3.0.1';\nexports.VERSION = VERSION;\nvar COMPILER_REVISION = 6;\n\nexports.COMPILER_REVISION = COMPILER_REVISION;\nvar REVISION_CHANGES = {\n 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it\n 2: '== 1.0.0-rc.3',\n 3: '== 1.0.0-rc.4',\n 4: '== 1.x.x',\n 5: '== 2.0.0-alpha.x',\n 6: '>= 2.0.0-beta.1'\n};\n\nexports.REVISION_CHANGES = REVISION_CHANGES;\nvar isArray = Utils.isArray,\n isFunction = Utils.isFunction,\n toString = Utils.toString,\n objectType = '[object Object]';\n\nfunction HandlebarsEnvironment(helpers, partials) {\n this.helpers = helpers || {};\n this.partials = partials || {};\n\n registerDefaultHelpers(this);\n}\n\nHandlebarsEnvironment.prototype = {\n constructor: HandlebarsEnvironment,\n\n logger: logger,\n log: log,\n\n registerHelper: function registerHelper(name, fn) {\n if (toString.call(name) === objectType) {\n if (fn) {\n throw new _Exception2['default']('Arg not supported with multiple helpers');\n }\n Utils.extend(this.helpers, name);\n } else {\n this.helpers[name] = fn;\n }\n },\n unregisterHelper: function unregisterHelper(name) {\n delete this.helpers[name];\n },\n\n registerPartial: function registerPartial(name, partial) {\n if (toString.call(name) === objectType) {\n Utils.extend(this.partials, name);\n } else {\n if (typeof partial === 'undefined') {\n throw new _Exception2['default']('Attempting to register a partial as undefined');\n }\n this.partials[name] = partial;\n }\n },\n unregisterPartial: function unregisterPartial(name) {\n delete this.partials[name];\n }\n};\n\nfunction registerDefaultHelpers(instance) {\n instance.registerHelper('helperMissing', function () {\n if (arguments.length === 1) {\n // A missing field in a {{foo}} constuct.\n return undefined;\n } else {\n // Someone is actually trying to call something, blow up.\n throw new _Exception2['default']('Missing helper: \"' + arguments[arguments.length - 1].name + '\"');\n }\n });\n\n instance.registerHelper('blockHelperMissing', function (context, options) {\n var inverse = options.inverse,\n fn = options.fn;\n\n if (context === true) {\n return fn(this);\n } else if (context === false || context == null) {\n return inverse(this);\n } else if (isArray(context)) {\n if (context.length > 0) {\n if (options.ids) {\n options.ids = [options.name];\n }\n\n return instance.helpers.each(context, options);\n } else {\n return inverse(this);\n }\n } else {\n if (options.data && options.ids) {\n var data = createFrame(options.data);\n data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name);\n options = { data: data };\n }\n\n return fn(context, options);\n }\n });\n\n instance.registerHelper('each', function (context, options) {\n if (!options) {\n throw new _Exception2['default']('Must pass iterator to #each');\n }\n\n var fn = options.fn,\n inverse = options.inverse,\n i = 0,\n ret = '',\n data = undefined,\n contextPath = undefined;\n\n if (options.data && options.ids) {\n contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';\n }\n\n if (isFunction(context)) {\n context = context.call(this);\n }\n\n if (options.data) {\n data = createFrame(options.data);\n }\n\n function execIteration(field, index, last) {\n if (data) {\n data.key = field;\n data.index = index;\n data.first = index === 0;\n data.last = !!last;\n\n if (contextPath) {\n data.contextPath = contextPath + field;\n }\n }\n\n ret = ret + fn(context[field], {\n data: data,\n blockParams: Utils.blockParams([context[field], field], [contextPath + field, null])\n });\n }\n\n if (context && typeof context === 'object') {\n if (isArray(context)) {\n for (var j = context.length; i < j; i++) {\n execIteration(i, i, i === context.length - 1);\n }\n } else {\n var priorKey = undefined;\n\n for (var key in context) {\n if (context.hasOwnProperty(key)) {\n // We're running the iterations one step out of sync so we can detect\n // the last iteration without have to scan the object twice and create\n // an itermediate keys array.\n if (priorKey) {\n execIteration(priorKey, i - 1);\n }\n priorKey = key;\n i++;\n }\n }\n if (priorKey) {\n execIteration(priorKey, i - 1, true);\n }\n }\n }\n\n if (i === 0) {\n ret = inverse(this);\n }\n\n return ret;\n });\n\n instance.registerHelper('if', function (conditional, options) {\n if (isFunction(conditional)) {\n conditional = conditional.call(this);\n }\n\n // Default behavior is to render the positive path if the value is truthy and not empty.\n // The `includeZero` option may be set to treat the condtional as purely not empty based on the\n // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.\n if (!options.hash.includeZero && !conditional || Utils.isEmpty(conditional)) {\n return options.inverse(this);\n } else {\n return options.fn(this);\n }\n });\n\n instance.registerHelper('unless', function (conditional, options) {\n return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });\n });\n\n instance.registerHelper('with', function (context, options) {\n if (isFunction(context)) {\n context = context.call(this);\n }\n\n var fn = options.fn;\n\n if (!Utils.isEmpty(context)) {\n if (options.data && options.ids) {\n var data = createFrame(options.data);\n data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]);\n options = { data: data };\n }\n\n return fn(context, options);\n } else {\n return options.inverse(this);\n }\n });\n\n instance.registerHelper('log', function (message, options) {\n var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;\n instance.log(level, message);\n });\n\n instance.registerHelper('lookup', function (obj, field) {\n return obj && obj[field];\n });\n}\n\nvar logger = {\n methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },\n\n // State enum\n DEBUG: 0,\n INFO: 1,\n WARN: 2,\n ERROR: 3,\n level: 1,\n\n // Can be overridden in the host environment\n log: function log(level, message) {\n if (typeof console !== 'undefined' && logger.level <= level) {\n var method = logger.methodMap[level];\n (console[method] || console.log).call(console, message); // eslint-disable-line no-console\n }\n }\n};\n\nexports.logger = logger;\nvar log = logger.log;\n\nexports.log = log;\n\nfunction createFrame(object) {\n var frame = Utils.extend({}, object);\n frame._parent = object;\n return frame;\n}\n\n/* [args, ]options */", + "'use strict';\n\nexports.__esModule = true;\n\nvar errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];\n\nfunction Exception(message, node) {\n var loc = node && node.loc,\n line = undefined,\n column = undefined;\n if (loc) {\n line = loc.start.line;\n column = loc.start.column;\n\n message += ' - ' + line + ':' + column;\n }\n\n var tmp = Error.prototype.constructor.call(this, message);\n\n // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.\n for (var idx = 0; idx < errorProps.length; idx++) {\n this[errorProps[idx]] = tmp[errorProps[idx]];\n }\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, Exception);\n }\n\n if (loc) {\n this.lineNumber = line;\n this.column = column;\n }\n}\n\nException.prototype = new Error();\n\nexports['default'] = Exception;\nmodule.exports = exports['default'];", + "'use strict';\n\nexports.__esModule = true;\n/*global window */\n\nexports['default'] = function (Handlebars) {\n /* istanbul ignore next */\n var root = typeof global !== 'undefined' ? global : window,\n $Handlebars = root.Handlebars;\n /* istanbul ignore next */\n Handlebars.noConflict = function () {\n if (root.Handlebars === Handlebars) {\n root.Handlebars = $Handlebars;\n }\n };\n};\n\nmodule.exports = exports['default'];", + "'use strict';\n\nvar _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; };\n\nexports.__esModule = true;\nexports.checkRevision = checkRevision;\n\n// TODO: Remove this line and break up compilePartial\n\nexports.template = template;\nexports.wrapProgram = wrapProgram;\nexports.resolvePartial = resolvePartial;\nexports.invokePartial = invokePartial;\nexports.noop = noop;\n\nvar _import = require('./utils');\n\nvar Utils = _interopRequireWildcard(_import);\n\nvar _Exception = require('./exception');\n\nvar _Exception2 = _interopRequireWildcard(_Exception);\n\nvar _COMPILER_REVISION$REVISION_CHANGES$createFrame = require('./base');\n\nfunction checkRevision(compilerInfo) {\n var compilerRevision = compilerInfo && compilerInfo[0] || 1,\n currentRevision = _COMPILER_REVISION$REVISION_CHANGES$createFrame.COMPILER_REVISION;\n\n if (compilerRevision !== currentRevision) {\n if (compilerRevision < currentRevision) {\n var runtimeVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[currentRevision],\n compilerVersions = _COMPILER_REVISION$REVISION_CHANGES$createFrame.REVISION_CHANGES[compilerRevision];\n throw new _Exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');\n } else {\n // Use the embedded version info since the runtime doesn't know about this revision yet\n throw new _Exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');\n }\n }\n}\n\nfunction template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new _Exception2['default']('No environment passed to template');\n }\n if (!templateSpec || !templateSpec.main) {\n throw new _Exception2['default']('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n function invokePartialWrapper(partial, context, options) {\n if (options.hash) {\n context = Utils.extend({}, context, options.hash);\n }\n\n partial = env.VM.resolvePartial.call(this, partial, context, options);\n var result = env.VM.invokePartial.call(this, partial, context, options);\n\n if (result == null && env.compile) {\n options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);\n result = options.partials[options.name](context, options);\n }\n if (result != null) {\n if (options.indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = options.indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new _Exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');\n }\n }\n\n // Just add water\n var container = {\n strict: function strict(obj, name) {\n if (!(name in obj)) {\n throw new _Exception2['default']('\"' + name + '\" not defined in ' + obj);\n }\n return obj[name];\n },\n lookup: function lookup(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function lambda(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function fn(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function program(i, data, declaredBlockParams, blockParams, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths || blockParams || declaredBlockParams) {\n programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = wrapProgram(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function data(value, depth) {\n while (value && depth--) {\n value = value._parent;\n }\n return value;\n },\n merge: function merge(param, common) {\n var obj = param || common;\n\n if (param && common && param !== common) {\n obj = Utils.extend({}, common, param);\n }\n\n return obj;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n function ret(context) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths = undefined,\n blockParams = templateSpec.useBlockParams ? [] : undefined;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths);\n }\n ret.isTop = true;\n\n ret._setup = function (options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function (i, data, blockParams, depths) {\n if (templateSpec.useBlockParams && !blockParams) {\n throw new _Exception2['default']('must pass block params');\n }\n if (templateSpec.useDepths && !depths) {\n throw new _Exception2['default']('must pass parent depths');\n }\n\n return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);\n };\n return ret;\n}\n\nfunction wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {\n function prog(context) {\n var options = arguments[1] === undefined ? {} : arguments[1];\n\n return fn.call(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), depths && [context].concat(depths));\n }\n prog.program = i;\n prog.depth = depths ? depths.length : 0;\n prog.blockParams = declaredBlockParams || 0;\n return prog;\n}\n\nfunction resolvePartial(partial, context, options) {\n if (!partial) {\n partial = options.partials[options.name];\n } else if (!partial.call && !options.name) {\n // This is a dynamic partial that returned a string\n options.name = partial;\n partial = options.partials[partial];\n }\n return partial;\n}\n\nfunction invokePartial(partial, context, options) {\n options.partial = true;\n\n if (partial === undefined) {\n throw new _Exception2['default']('The partial ' + options.name + ' could not be found');\n } else if (partial instanceof Function) {\n return partial(context, options);\n }\n}\n\nfunction noop() {\n return '';\n}\n\nfunction initData(context, data) {\n if (!data || !('root' in data)) {\n data = data ? _COMPILER_REVISION$REVISION_CHANGES$createFrame.createFrame(data) : {};\n data.root = context;\n }\n return data;\n}", + "'use strict';\n\nexports.__esModule = true;\n// Build out our basic SafeString type\nfunction SafeString(string) {\n this.string = string;\n}\n\nSafeString.prototype.toString = SafeString.prototype.toHTML = function () {\n return '' + this.string;\n};\n\nexports['default'] = SafeString;\nmodule.exports = exports['default'];", + "'use strict';\n\nexports.__esModule = true;\nexports.extend = extend;\n\n// Older IE versions do not directly support indexOf so we must implement our own, sadly.\nexports.indexOf = indexOf;\nexports.escapeExpression = escapeExpression;\nexports.isEmpty = isEmpty;\nexports.blockParams = blockParams;\nexports.appendContextPath = appendContextPath;\nvar escape = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n '\\'': ''',\n '`': '`'\n};\n\nvar badChars = /[&<>\"'`]/g,\n possible = /[&<>\"'`]/;\n\nfunction escapeChar(chr) {\n return escape[chr];\n}\n\nfunction extend(obj /* , ...source */) {\n for (var i = 1; i < arguments.length; i++) {\n for (var key in arguments[i]) {\n if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {\n obj[key] = arguments[i][key];\n }\n }\n }\n\n return obj;\n}\n\nvar toString = Object.prototype.toString;\n\nexports.toString = toString;\n// Sourced from lodash\n// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt\n/*eslint-disable func-style, no-var */\nvar isFunction = function isFunction(value) {\n return typeof value === 'function';\n};\n// fallback for older versions of Chrome and Safari\n/* istanbul ignore next */\nif (isFunction(/x/)) {\n exports.isFunction = isFunction = function (value) {\n return typeof value === 'function' && toString.call(value) === '[object Function]';\n };\n}\nvar isFunction;\nexports.isFunction = isFunction;\n/*eslint-enable func-style, no-var */\n\n/* istanbul ignore next */\nvar isArray = Array.isArray || function (value) {\n return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;\n};exports.isArray = isArray;\n\nfunction indexOf(array, value) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n return -1;\n}\n\nfunction escapeExpression(string) {\n if (typeof string !== 'string') {\n // don't escape SafeStrings, since they're already safe\n if (string && string.toHTML) {\n return string.toHTML();\n } else if (string == null) {\n return '';\n } else if (!string) {\n return string + '';\n }\n\n // Force a string conversion as this will be done by the append regardless and\n // the regex test will do this transparently behind the scenes, causing issues if\n // an object's to string has escaped characters in it.\n string = '' + string;\n }\n\n if (!possible.test(string)) {\n return string;\n }\n return string.replace(badChars, escapeChar);\n}\n\nfunction isEmpty(value) {\n if (!value && value !== 0) {\n return true;\n } else if (isArray(value) && value.length === 0) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction blockParams(params, ids) {\n params.path = ids;\n return params;\n}\n\nfunction appendContextPath(contextPath, id) {\n return (contextPath ? contextPath + '.' : '') + id;\n}", + "// Create a simple path alias to allow browserify to resolve\n// the runtime on a supported path.\nmodule.exports = require('./dist/cjs/handlebars.runtime')['default'];\n" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 514c3b6..d18ada7 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "homepage": "http://reader.justforcomics.com", "author": "Bala Clark ", "scripts": { - "pretest": "standard lib/ComicBook.js", - "test": "make test" + "build": "npm run build", + "buildjs": "rm -f dist/*.js && browserify --transform babelify --transform browserify-handlebars app/index.js --debug | exorcist dist/comicbook.js.map > dist/comicbook.js", + "test": "standard" }, "repository": { "type": "git", @@ -23,11 +24,21 @@ "url": "http://www.apache.org/licenses/LICENSE-2.0" } ], + "standard": { + "parser": "babel-eslint", + "ignore": [ + "dist", + "assets" + ] + }, "devDependencies": { + "babel-eslint": "^3.1.23", "babelify": "^6.1.3", "browserify": "^10.2.6", "browserify-handlebars": "^1.0.0", "cssmin": "^0.4.3", + "exorcist": "^0.4.0", + "handlebars": "^3.0.3", "mocha": "^2.2.5", "standard": "^4.5.3", "uglify-js": "^2.4.23"