From 732a9e5ca04ab1e69eb1886de1d28020623e143a Mon Sep 17 00:00:00 2001 From: Matthias BUSSONNIER Date: Sat, 1 Sep 2012 20:12:36 +0200 Subject: [PATCH] start to getting rid of JS --- Makefile | 2 +- gist.py | 10 +- githubapp.py | 3 + hlog | 3 - static/404.html | 108 --- static/500.html | 109 --- static/build/index.js | 44 - static/build/node_modules/.bin/hulk | 93 -- .../build/node_modules/hogan.js/.git_ignore | 1 - .../build/node_modules/hogan.js/.gitmodules | 3 - static/build/node_modules/hogan.js/LICENSE | 177 ---- static/build/node_modules/hogan.js/Makefile | 62 -- static/build/node_modules/hogan.js/README.md | 93 -- static/build/node_modules/hogan.js/bin/hulk | 93 -- .../node_modules/hogan.js/lib/compiler.js | 348 ------- .../build/node_modules/hogan.js/lib/hogan.js | 20 - .../node_modules/hogan.js/lib/template.js | 233 ----- .../build/node_modules/hogan.js/package.json | 20 - .../node_modules/hogan.js/test/html/list.html | 8 - .../node_modules/hogan.js/test/index.html | 13 - .../build/node_modules/hogan.js/test/index.js | 848 ------------------ .../node_modules/hogan.js/test/mustache.js | 90 -- .../build/node_modules/hogan.js/test/spec.js | 77 -- .../node_modules/hogan.js/test/spec/Changes | 31 - .../node_modules/hogan.js/test/spec/README.md | 65 -- .../node_modules/hogan.js/test/spec/Rakefile | 27 - .../hogan.js/test/spec/TESTING.md | 46 - .../hogan.js/test/spec/specs/comments.json | 1 - .../hogan.js/test/spec/specs/comments.yml | 103 --- .../hogan.js/test/spec/specs/delimiters.json | 1 - .../hogan.js/test/spec/specs/delimiters.yml | 158 ---- .../test/spec/specs/interpolation.json | 1 - .../test/spec/specs/interpolation.yml | 230 ----- .../hogan.js/test/spec/specs/inverted.json | 1 - .../hogan.js/test/spec/specs/inverted.yml | 193 ---- .../hogan.js/test/spec/specs/partials.json | 1 - .../hogan.js/test/spec/specs/partials.yml | 109 --- .../hogan.js/test/spec/specs/sections.json | 1 - .../hogan.js/test/spec/specs/sections.yml | 256 ------ .../hogan.js/test/spec/specs/~lambdas.json | 1 - .../hogan.js/test/spec/specs/~lambdas.yml | 149 --- .../hogan.js/test/templates/list.mustache | 8 - .../node_modules/hogan.js/tools/release.js | 74 -- .../hogan.js/tools/web_templates.js | 32 - .../node_modules/hogan.js/web/1.0.0/hogan.js | 500 ----------- .../hogan.js/web/1.0.0/hogan.min.js | 14 - .../hogan.js/web/builds/1.0.0/hogan.js | 500 ----------- .../hogan.js/web/builds/1.0.0/hogan.min.js | 14 - .../hogan.js/web/builds/1.0.3/hogan.js | 545 ----------- .../hogan.js/web/builds/1.0.3/hogan.min.js | 5 - .../web/builds/1.0.5/hogan-1.0.5.amd.js | 576 ------------ .../web/builds/1.0.5/hogan-1.0.5.common.js | 576 ------------ .../hogan.js/web/builds/1.0.5/hogan-1.0.5.js | 572 ------------ .../web/builds/1.0.5/hogan-1.0.5.min.amd.js | 5 - .../builds/1.0.5/hogan-1.0.5.min.common.js | 5 - .../web/builds/1.0.5/hogan-1.0.5.min.js | 5 - .../builds/1.0.5/hogan-1.0.5.min.mustache.js | 5 - .../web/builds/1.0.5/hogan-1.0.5.mustache.js | 619 ------------- .../web/builds/1.0.5/template-1.0.5.js | 233 ----- .../web/builds/1.0.5/template-1.0.5.min.js | 5 - .../node_modules/hogan.js/web/favicon.ico | Bin 1150 -> 0 bytes .../node_modules/hogan.js/web/images/logo.png | Bin 3389 -> 0 bytes .../hogan.js/web/images/noise.png | Bin 10378 -> 0 bytes .../hogan.js/web/images/small-hogan-icon.png | Bin 472 -> 0 bytes .../hogan.js/web/images/stripes.png | Bin 115 -> 0 bytes .../hogan.js/web/index.html.mustache | 138 --- .../hogan.js/web/stylesheets/layout.css | 206 ----- .../hogan.js/web/stylesheets/skeleton.css | 236 ----- .../hogan.js/wrappers/amd.js.mustache | 21 - .../hogan.js/wrappers/common.js.mustache | 21 - .../hogan.js/wrappers/js.mustache | 17 - .../hogan.js/wrappers/mustache.js.mustache | 64 -- static/build/package.json | 6 - static/index.html | 137 --- static/js/bootstrap.min.js | 2 +- static/unknown_filetype.html | 108 --- templates/{pages/404.mustache => 404.html} | 7 +- templates/{pages/500.mustache => 500.html} | 6 +- .../{pages/index.mustache => index.html} | 11 +- templates/layout.mustache | 99 -- ...iletype.mustache => unknown_filetype.html} | 6 +- 81 files changed, 32 insertions(+), 9178 deletions(-) delete mode 100644 hlog delete mode 100644 static/404.html delete mode 100644 static/500.html delete mode 100644 static/build/index.js delete mode 100755 static/build/node_modules/.bin/hulk delete mode 100644 static/build/node_modules/hogan.js/.git_ignore delete mode 100644 static/build/node_modules/hogan.js/.gitmodules delete mode 100644 static/build/node_modules/hogan.js/LICENSE delete mode 100644 static/build/node_modules/hogan.js/Makefile delete mode 100644 static/build/node_modules/hogan.js/README.md delete mode 100755 static/build/node_modules/hogan.js/bin/hulk delete mode 100644 static/build/node_modules/hogan.js/lib/compiler.js delete mode 100644 static/build/node_modules/hogan.js/lib/hogan.js delete mode 100644 static/build/node_modules/hogan.js/lib/template.js delete mode 100644 static/build/node_modules/hogan.js/package.json delete mode 100644 static/build/node_modules/hogan.js/test/html/list.html delete mode 100644 static/build/node_modules/hogan.js/test/index.html delete mode 100644 static/build/node_modules/hogan.js/test/index.js delete mode 100644 static/build/node_modules/hogan.js/test/mustache.js delete mode 100644 static/build/node_modules/hogan.js/test/spec.js delete mode 100644 static/build/node_modules/hogan.js/test/spec/Changes delete mode 100644 static/build/node_modules/hogan.js/test/spec/README.md delete mode 100644 static/build/node_modules/hogan.js/test/spec/Rakefile delete mode 100644 static/build/node_modules/hogan.js/test/spec/TESTING.md delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/comments.json delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/comments.yml delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/delimiters.json delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/delimiters.yml delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/interpolation.json delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/interpolation.yml delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/inverted.json delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/inverted.yml delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/partials.json delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/partials.yml delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/sections.json delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/sections.yml delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/~lambdas.json delete mode 100644 static/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml delete mode 100644 static/build/node_modules/hogan.js/test/templates/list.mustache delete mode 100644 static/build/node_modules/hogan.js/tools/release.js delete mode 100644 static/build/node_modules/hogan.js/tools/web_templates.js delete mode 100644 static/build/node_modules/hogan.js/web/1.0.0/hogan.js delete mode 100644 static/build/node_modules/hogan.js/web/1.0.0/hogan.min.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.common.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.mustache.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.mustache.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js delete mode 100644 static/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js delete mode 100644 static/build/node_modules/hogan.js/web/favicon.ico delete mode 100644 static/build/node_modules/hogan.js/web/images/logo.png delete mode 100644 static/build/node_modules/hogan.js/web/images/noise.png delete mode 100644 static/build/node_modules/hogan.js/web/images/small-hogan-icon.png delete mode 100644 static/build/node_modules/hogan.js/web/images/stripes.png delete mode 100755 static/build/node_modules/hogan.js/web/index.html.mustache delete mode 100755 static/build/node_modules/hogan.js/web/stylesheets/layout.css delete mode 100755 static/build/node_modules/hogan.js/web/stylesheets/skeleton.css delete mode 100644 static/build/node_modules/hogan.js/wrappers/amd.js.mustache delete mode 100644 static/build/node_modules/hogan.js/wrappers/common.js.mustache delete mode 100644 static/build/node_modules/hogan.js/wrappers/js.mustache delete mode 100644 static/build/node_modules/hogan.js/wrappers/mustache.js.mustache delete mode 100644 static/build/package.json delete mode 100644 static/index.html delete mode 100644 static/unknown_filetype.html rename templates/{pages/404.mustache => 404.html} (81%) rename templates/{pages/500.mustache => 500.html} (85%) rename templates/{pages/index.mustache => index.html} (89%) delete mode 100644 templates/layout.mustache rename templates/{pages/unknown_filetype.mustache => unknown_filetype.html} (83%) diff --git a/Makefile b/Makefile index 75424329..3b274dca 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ HR=\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\ # # BUILD DOCS # +.PHONY: build build: @echo "\n${HR}" @@ -21,7 +22,6 @@ build: @recess --compile ${BOOTSTRAP_LESS} > ${BOOTSTRAP} @recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > ${BOOTSTRAP_RESPONSIVE} @echo "Compiling LESS with Recess... ${CHECK} Done" - @node static/build @cp img/* static/img/ @cp js/*.js static/js/ @cp js/tests/vendor/jquery.js static/js/ diff --git a/gist.py b/gist.py index 8f927c6a..a0912425 100644 --- a/gist.py +++ b/gist.py @@ -42,7 +42,7 @@ def static(strng) : @app.route('/') def hello(): - return static('index.html') + return render_template('index.html') @app.route('/assets/') @@ -52,12 +52,12 @@ def sitemap(path): @app.errorhandler(500) -def page_not_found(error): - return static('500.html'),500 +def internal_error(error): + return render_template('500.html'),500 @app.errorhandler(404) def page_not_found(error): - return static('404.html'),404 + return render_template('404.html'),404 @app.route('/404') def four_o_foru(): @@ -83,7 +83,7 @@ def create(v=None): if value.startswith('http://') and value.endswith('.ipynb'): return redirect('/url/'+value[7:]) - return static('unknown_filetype.html') + return render_template('unknown_filetype.html') #https ! @cachedfirstparam diff --git a/githubapp.py b/githubapp.py index 130ff931..062a89d0 100644 --- a/githubapp.py +++ b/githubapp.py @@ -65,6 +65,9 @@ def dummy1(user,repo,tree,branch): #return open('static/%s/%s/%s'%(repo,tree,branch)).read() return browse_tree_blob(user,repo,tree,branch,None) +@app.errorhandler(500) +def internal_error(error): + return render_template('500.html'),500 #@app.route('///tree//') def bowse_tree(user,repo,branch,subfile, parent=None): diff --git a/hlog b/hlog deleted file mode 100644 index 5d605b94..00000000 --- a/hlog +++ /dev/null @@ -1,3 +0,0 @@ -Creating secret-sands-6966... done, stack is cedar -http://secret-sands-6966.herokuapp.com/ | git@heroku.com:secret-sands-6966.git -Git remote heroku added diff --git a/static/404.html b/static/404.html deleted file mode 100644 index 1ce6b441..00000000 --- a/static/404.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - 404 · nbviewer - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
-

404 : Not found !

-

You are requesting a page that does not exist !

- -
- -
- - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/500.html b/static/500.html deleted file mode 100644 index 43a75245..00000000 --- a/static/500.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - 500 · nbviewer - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
-

500 : Server error !

-

You Broke The internet !

- - -
- -
- - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/build/index.js b/static/build/index.js deleted file mode 100644 index accbdcfc..00000000 --- a/static/build/index.js +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env node -var hogan = require('hogan.js') - , fs = require('fs') - , prod = process.argv[2] == 'production' - , title = 'nbviewer' - -var layout, pages - -// compile layout template -layout = fs.readFileSync(__dirname + '/../../templates/layout.mustache', 'utf-8') -layout = hogan.compile(layout, { sectionTags: [{o:'_i', c:'i'}] }) - -// retrieve pages -pages = fs.readdirSync(__dirname + '/../../templates/pages') - -// iterate over pages -pages.forEach(function (name) { - - if (!name.match(/\.mustache$/)) return - - var page = fs.readFileSync(__dirname + '/../../templates/pages/' + name, 'utf-8') - , context = {} - - context[name.replace(/\.mustache$/, '')] = 'active' - context._i = true - context.production = prod - context.title = name - .replace(/\.mustache/, '') - .replace(/\-.*/, '') - .replace(/(.)/, function ($1) { return $1.toUpperCase() }) - - if (context.title == 'Index') { - context.title = title - } else { - context.title += ' · ' + title - } - - page = hogan.compile(page, { sectionTags: [{o:'_i', c:'i'}] }) - page = layout.render(context, { - body: page - }) - - fs.writeFileSync(__dirname + '/../' + name.replace(/mustache$/, 'html'), page, 'utf-8') -}) diff --git a/static/build/node_modules/.bin/hulk b/static/build/node_modules/.bin/hulk deleted file mode 100755 index dd5c4a60..00000000 --- a/static/build/node_modules/.bin/hulk +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env node - -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var hogan = require('../lib/hogan.js'), - path = require('path'), - fs = require('fs'); - -var specials = ['/', '.', '*', '+', '?', '|','(', ')', '[', ']', '{', '}', '\\'], - specialsRegExp = new RegExp('(\\' + specials.join('|\\') + ')', 'g'), - templates; - - -// Escape special regexp characters -function esc(text) { - return text.replace(specialsRegExp, '\\$1'); -} - - -// Check for dirs and correct ext (<3 for windows) -function extractFiles(args) { - var usage = 'USAGE: hulk ./templates/*.mustaches\n' + - 'NOTE: hulk supports the "*" wildcard and allows you to target specific extensions too', - files = []; - - if (!args.length) { - console.log(usage); - process.exit(-1); - } - - args.forEach(function (arg) { - - if (/\*/.test(arg)) { - arg = arg.split('*'); - return files = files.concat( - fs.readdirSync(arg[0] || '.') - .map(function (f) { - return new RegExp(esc(arg[1]) + '$').test(f) && path.join(arg[0], f); - }) - .filter(function (f) { - return f; - }) - ); - } - - files.push(arg); - - }) - - return files; -} - - -// Remove utf-8 byte order mark, http://en.wikipedia.org/wiki/Byte_order_mark -function removeByteOrderMark(text) { - if (text.charCodeAt(0) === 0xfeff) { - return text.substring(1); - } - return text; -} - - -// Write a template foreach file that matches template extension -templates = extractFiles(process.argv.slice(2)) - .map(function (file) { - var openedFile = fs.readFileSync(file, 'utf-8'), name; - if (!openedFile) return; - name = file.replace(/\..*$/, ''); - openedFile = removeByteOrderMark(openedFile.trim()); - return 'templates.' + name + ' = new Hogan.Template(' + hogan.compile(openedFile, { asString: 1 }) + ');'; - }) - .filter(function (t) { - return t; - }); - - -// Output templates -if (!templates.length) return; -console.log('var templates = {};'); -console.log(templates.join('\n')); \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/.git_ignore b/static/build/node_modules/hogan.js/.git_ignore deleted file mode 100644 index 3c3629e6..00000000 --- a/static/build/node_modules/hogan.js/.git_ignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/static/build/node_modules/hogan.js/.gitmodules b/static/build/node_modules/hogan.js/.gitmodules deleted file mode 100644 index 6bfdc18e..00000000 --- a/static/build/node_modules/hogan.js/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "test/spec"] - path = test/spec - url = https://github.com/mustache/spec.git diff --git a/static/build/node_modules/hogan.js/LICENSE b/static/build/node_modules/hogan.js/LICENSE deleted file mode 100644 index 4947287f..00000000 --- a/static/build/node_modules/hogan.js/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/Makefile b/static/build/node_modules/hogan.js/Makefile deleted file mode 100644 index 922fdead..00000000 --- a/static/build/node_modules/hogan.js/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -REPO = git@github.com:twitter/hogan.js.git -BUILD := build -VERSION = ${shell node -e 'var s = JSON.parse(require("fs").readFileSync("package.json").toString()).version; console.log(s.substring(0, s.indexOf("-")));'} - -# -# Run command line tests -# -test: - @ node test/index.js - -# -# Run Mustache spec tests -# -spec: - @ node test/spec.js - -# -# Run benchmark -# -benchmark: - @ node benchmark/console/index.js - -clean: - @ rm -rf dist/* -# -# Make a new version of Hogan from the current dev version. -# -release: clean - @ echo "Creating a new version of Hogan." - @ mkdir -p dist/nodejs - @ cp -R lib dist/nodejs/lib - @ node tools/release.js - @ mkdir -p web/builds/$(VERSION) - @ cp dist/*.* web/builds/$(VERSION)/. -# -# Make the gh-pages website -# -# This target builds the hogan.js github website using hogan.js. -# -# cd into build/gh-pages to check in the new site. -# -GH_PAGES = $(BUILD)/gh-pages -web: | pages - @cp -R web/* $(GH_PAGES) - @@ node tools/web_templates.js - @echo - @echo "Website built in $(GH_PAGES)." - -# -# Checkout the gh-pages branch. -# -pages: | $(BUILD) - @if [ ! -d "$(GH_PAGES)" ]; then \ - git clone -b gh-pages $(REPO) $(GH_PAGES); \ - rm -rf $(GH_PAGES)/*; \ - fi; - @mkdir -p $(GH_PAGES)/images - -$(BUILD): - mkdir -p $(BUILD) - -.PHONY: test spec benchmark web release diff --git a/static/build/node_modules/hogan.js/README.md b/static/build/node_modules/hogan.js/README.md deleted file mode 100644 index e879894b..00000000 --- a/static/build/node_modules/hogan.js/README.md +++ /dev/null @@ -1,93 +0,0 @@ -## Hogan.js - A mustache compiler. - -[Hogan.js](http://twitter.github.com/hogan.js/) is a compiler for the -[Mustache](http://mustache.github.com/) templating language. For information -on Mustache, see the [manpage](http://mustache.github.com/mustache.5.html) and -the [spec](https://github.com/mustache/spec). - -## Basics - -Hogan compiles templates to HoganTemplate objects, which have a render method. - -```js -var data = { - screenName: "dhg", -}; - -var template = Hogan.compile("Follow @{{screenName}}."); -var output = template.render(data); - -// prints "Follow @dhg." -console.log(output); -``` - -## Features - -Hogan is fast--try it on your workload. - -Hogan has separate scanning, parsing and code generation phases. This way it's -possible to add new features without touching the scanner at all, and many -different code generation techniques can be tried without changing the parser. - -Hogan exposes scan and parse methods. These can be useful for -pre-processing templates on the server. - -```js -var text = "{{^check}}{{i18n}}No{{/i18n}}{{/check}}"; -text += "{{#check}}{{i18n}}Yes{{/i18n}}{{/check}}"; -var tree = Hogan.parse(Hogan.scan(text)); - -// outputs "# check" -console.log(tree[0].tag + " " + tree[0].name); - -// outputs "Yes" -console.log(tree[1].nodes[0].nodes[0]); -``` - -It's also possible to use HoganTemplate objects without the Hogan compiler -present. That means you can pre-compile your templates on the server, and -avoid shipping the compiler. However, the optional lambda features from the -Mustache spec do require the compiler to be present. - -## Why Hogan.js? - -Why another templating library? - -Hogan.js was written to meet three templating library requirements: good -performance, standalone template objects, and a parser API. - -## Issues - -Have a bug? Please create an issue here on GitHub! - -https://github.com/twitter/hogan.js/issues - -## Versioning - -For transparency and insight into our release cycle, releases will be numbered with the follow format: - -`..` - -And constructed with the following guidelines: - -* Breaking backwards compatibility bumps the major -* New additions without breaking backwards compatibility bumps the minor -* Bug fixes and misc changes bump the patch - -For more information on semantic versioning, please visit http://semver.org/. - -## Authors - -**Robert Sayre** - -+ http://github.com/sayrer - -**Jacob Thornton** - -+ http://github.com/fat - -## License - -Copyright 2011 Twitter, Inc. - -Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/bin/hulk b/static/build/node_modules/hogan.js/bin/hulk deleted file mode 100755 index dd5c4a60..00000000 --- a/static/build/node_modules/hogan.js/bin/hulk +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env node - -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var hogan = require('../lib/hogan.js'), - path = require('path'), - fs = require('fs'); - -var specials = ['/', '.', '*', '+', '?', '|','(', ')', '[', ']', '{', '}', '\\'], - specialsRegExp = new RegExp('(\\' + specials.join('|\\') + ')', 'g'), - templates; - - -// Escape special regexp characters -function esc(text) { - return text.replace(specialsRegExp, '\\$1'); -} - - -// Check for dirs and correct ext (<3 for windows) -function extractFiles(args) { - var usage = 'USAGE: hulk ./templates/*.mustaches\n' + - 'NOTE: hulk supports the "*" wildcard and allows you to target specific extensions too', - files = []; - - if (!args.length) { - console.log(usage); - process.exit(-1); - } - - args.forEach(function (arg) { - - if (/\*/.test(arg)) { - arg = arg.split('*'); - return files = files.concat( - fs.readdirSync(arg[0] || '.') - .map(function (f) { - return new RegExp(esc(arg[1]) + '$').test(f) && path.join(arg[0], f); - }) - .filter(function (f) { - return f; - }) - ); - } - - files.push(arg); - - }) - - return files; -} - - -// Remove utf-8 byte order mark, http://en.wikipedia.org/wiki/Byte_order_mark -function removeByteOrderMark(text) { - if (text.charCodeAt(0) === 0xfeff) { - return text.substring(1); - } - return text; -} - - -// Write a template foreach file that matches template extension -templates = extractFiles(process.argv.slice(2)) - .map(function (file) { - var openedFile = fs.readFileSync(file, 'utf-8'), name; - if (!openedFile) return; - name = file.replace(/\..*$/, ''); - openedFile = removeByteOrderMark(openedFile.trim()); - return 'templates.' + name + ' = new Hogan.Template(' + hogan.compile(openedFile, { asString: 1 }) + ');'; - }) - .filter(function (t) { - return t; - }); - - -// Output templates -if (!templates.length) return; -console.log('var templates = {};'); -console.log(templates.join('\n')); \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/lib/compiler.js b/static/build/node_modules/hogan.js/lib/compiler.js deleted file mode 100644 index 2cd65f6f..00000000 --- a/static/build/node_modules/hogan.js/lib/compiler.js +++ /dev/null @@ -1,348 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -(function (Hogan) { - // Setup regex assignments - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/, - rQuot = /\"/g, - rNewline = /\n/g, - rCr = /\r/g, - rSlash = /\\/g, - tagTypes = { - '#': 1, '^': 2, '/': 3, '!': 4, '>': 5, - '<': 6, '=': 7, '_v': 8, '{': 9, '&': 10 - }; - - Hogan.scan = function scan(text, delimiters) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - tag = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push(new String(buf)); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (tokens[j].tag && tagTypes[tokens[j].tag] < tagTypes['_v']) || - (!tokens[j].tag && tokens[j].match(rIsWhitespace) === null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (!tokens[j].tag) { - if ((next = tokens[j+1]) && next.tag == '>') { - // set indent to token value - next.indent = tokens[j].toString() - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}); - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag, - closeIndex = text.indexOf(close, index), - delimiters = trim( - text.substring(text.indexOf('=', index) + 1, closeIndex) - ).split(' '); - - otag = delimiters[0]; - ctag = delimiters[1]; - - return closeIndex + close.length - 1; - } - - if (delimiters) { - delimiters = delimiters.split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text.charAt(i) == '\n') { - filterLine(seenTag); - } else { - buf += text.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag = tagTypes[text.charAt(i + 1)]; - tagType = tag ? text.charAt(i + 1) : '_v'; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text, i)) { - tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag, - i: (tagType == '/') ? seenTag - ctag.length : i + otag.length}); - buf = ''; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == '{') { - if (ctag == '}}') { - i++; - } else { - cleanTripleStache(tokens[tokens.length - 1]); - } - } - } else { - buf += text.charAt(i); - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function cleanTripleStache(token) { - if (token.n.substr(token.n.length - 1) === '}') { - token.n = token.n.substring(0, token.n.length - 1); - } - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - function tagChange(tag, text, index) { - if (text.charAt(index) != tag.charAt(0)) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text.charAt(index + i) != tag.charAt(i)) { - return false; - } - } - - return true; - } - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - token = null; - - while (tokens.length > 0) { - token = tokens.shift(); - if (token.tag == '#' || token.tag == '^' || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - instructions.push(token); - } else if (token.tag == '/') { - if (stack.length === 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else { - instructions.push(token); - } - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function writeCode(tree) { - return 'i = i || "";var b = i + "";var _ = this;' + walk(tree) + 'return b;'; - } - - Hogan.generate = function (code, text, options) { - if (options.asString) { - return 'function(c,p,i){' + code + ';}'; - } - - return new Hogan.Template(new Function('c', 'p', 'i', code), text, Hogan); - } - - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r'); - } - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function walk(tree) { - var code = ''; - for (var i = 0, l = tree.length; i < l; i++) { - var tag = tree[i].tag; - if (tag == '#') { - code += section(tree[i].nodes, tree[i].n, chooseMethod(tree[i].n), - tree[i].i, tree[i].end, tree[i].otag + " " + tree[i].ctag); - } else if (tag == '^') { - code += invertedSection(tree[i].nodes, tree[i].n, - chooseMethod(tree[i].n)); - } else if (tag == '<' || tag == '>') { - code += partial(tree[i]); - } else if (tag == '{' || tag == '&') { - code += tripleStache(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag == '\n') { - code += text('"\\n"' + (tree.length-1 == i ? '' : ' + i')); - } else if (tag == '_v') { - code += variable(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag === undefined) { - code += text('"' + esc(tree[i]) + '"'); - } - } - return code; - } - - function section(nodes, id, method, start, end, tags) { - return 'if(_.s(_.' + method + '("' + esc(id) + '",c,p,1),' + - 'c,p,0,' + start + ',' + end + ', "' + tags + '")){' + - 'b += _.rs(c,p,' + - 'function(c,p){ var b = "";' + - walk(nodes) + - 'return b;});c.pop();}' + - 'else{b += _.b; _.b = ""};'; - } - - function invertedSection(nodes, id, method) { - return 'if (!_.s(_.' + method + '("' + esc(id) + '",c,p,1),c,p,1,0,0,"")){' + - walk(nodes) + - '};'; - } - - function partial(tok) { - return 'b += _.rp("' + esc(tok.n) + '",c,p,"' + (tok.indent || '') + '");'; - } - - function tripleStache(id, method) { - return 'b += (_.' + method + '("' + esc(id) + '",c,p,0));'; - } - - function variable(id, method) { - return 'b += (_.v(_.' + method + '("' + esc(id) + '",c,p,0)));'; - } - - function text(id) { - return 'b += ' + id + ';'; - } - - Hogan.parse = function(tokens, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - }, - - Hogan.cache = {}; - - Hogan.compile = function(text, options) { - // options - // - // asString: false (default) - // - // sectionTags: [{o: '_foo', c: 'foo'}] - // An array of object with o and c fields that indicate names for custom - // section tags. The example above allows parsing of {{_foo}}{{/foo}}. - // - // delimiters: A string that overrides the default delimiters. - // Example: "<% %>" - // - options = options || {}; - - var key = text + '||' + !!options.asString; - - var t = this.cache[key]; - - if (t) { - return t; - } - - t = this.generate(writeCode(this.parse(this.scan(text, options.delimiters), options)), text, options); - return this.cache[key] = t; - }; -})(typeof exports !== 'undefined' ? exports : Hogan); diff --git a/static/build/node_modules/hogan.js/lib/hogan.js b/static/build/node_modules/hogan.js/lib/hogan.js deleted file mode 100644 index f0119b52..00000000 --- a/static/build/node_modules/hogan.js/lib/hogan.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// This file is for use with Node.js. See dist/ for browser files. - -var Hogan = require('./compiler'); -Hogan.Template = require('./template').Template; -module.exports = Hogan; \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/lib/template.js b/static/build/node_modules/hogan.js/lib/template.js deleted file mode 100644 index 8958a70a..00000000 --- a/static/build/node_modules/hogan.js/lib/template.js +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var Hogan = {}; - -(function (Hogan) { - Hogan.Template = function constructor(renderFunc, text, compiler) { - if (renderFunc) { - this.r = renderFunc; - } - this.c = compiler; - this.text = text || ''; - } - - Hogan.Template.prototype = { - // render: replaced by generated code. - r: function (context, partials, indent) { return ''; }, - - // variable escaping - v: hoganEscape, - - render: function render(context, partials, indent) { - return this.ri([context], partials || {}, indent); - }, - - // render internal -- a hook for overrides that catches partials too - ri: function (context, partials, indent) { - return this.r(context, partials, indent); - }, - - // tries to find a partial in the curent scope and render it - rp: function(name, context, partials, indent) { - var partial = partials[name]; - - if (!partial) { - return ''; - } - - if (this.c && typeof partial == 'string') { - partial = this.c.compile(partial); - } - - return partial.ri(context, partials, indent); - }, - - // render a section - rs: function(context, partials, section) { - var buf = '', - tail = context[context.length - 1]; - - if (!isArray(tail)) { - return buf = section(context, partials); - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - buf += section(context, partials); - context.pop(); - } - - return buf; - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - - if (isArray(val) && val.length === 0) { - return false; - } - - if (typeof val == 'function') { - val = this.ls(val, ctx, partials, inverted, start, end, tags); - } - - pass = (val === '') || !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - var names = key.split('.'), - val = this.f(names[0], ctx, partials, returnFound), - cx = null; - - if (key === '.' && isArray(ctx[ctx.length - 2])) { - return ctx[ctx.length - 1]; - } - - for (var i = 1; i < names.length; i++) { - if (val && typeof val == 'object' && names[i] in val) { - cx = val; - val = val[names[i]]; - } else { - val = ''; - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.lv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false, - v = null, - found = false; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - if (v && typeof v == 'object' && key in v) { - val = v[key]; - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.lv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ho: function(val, cx, partials, text, tags) { - var compiler = this.c; - var t = val.call(cx, text, function(t) { - return compiler.compile(t, {delimiters: tags}).render(cx, partials); - }); - var s = compiler.compile(t.toString(), {delimiters: tags}).render(cx, partials); - this.b = s; - return false; - }, - - // higher order template result buffer - b: '', - - // lambda replace section - ls: function(val, ctx, partials, inverted, start, end, tags) { - var cx = ctx[ctx.length - 1], - t = null; - - if (!inverted && this.c && val.length > 0) { - return this.ho(val, cx, partials, this.text.substring(start, end), tags); - } - - t = val.call(cx); - - if (typeof t == 'function') { - if (inverted) { - return true; - } else if (this.c) { - return this.ho(t, cx, partials, this.text.substring(start, end), tags); - } - } - - return t; - }, - - // lambda replace variable - lv: function(val, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = val.call(cx); - if (typeof result == 'function') { - result = result.call(cx); - } - result = result.toString(); - - if (this.c && ~result.indexOf("{{")) { - return this.c.compile(result).render(cx, partials); - } - - return result; - } - - }; - - var rAmp = /&/g, - rLt = //g, - rApos =/\'/g, - rQuot = /\"/g, - hChars =/[&<>\"\']/; - - function hoganEscape(str) { - str = String((str === null || str === undefined) ? '' : str); - return hChars.test(str) ? - str - .replace(rAmp,'&') - .replace(rLt,'<') - .replace(rGt,'>') - .replace(rApos,''') - .replace(rQuot, '"') : - str; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }; - -})(typeof exports !== 'undefined' ? exports : Hogan); - diff --git a/static/build/node_modules/hogan.js/package.json b/static/build/node_modules/hogan.js/package.json deleted file mode 100644 index a09dede0..00000000 --- a/static/build/node_modules/hogan.js/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "hogan.js" - , "description": "A mustache compiler." - , "version": "1.0.5-dev" - , "keywords": ["mustache", "template"] - , "main": "./lib/hogan.js" - , "homepage": "http://twitter.github.com/hogan.js/" - , "author": "Twitter Inc." - , "repository": { - "type": "git" - , "url": "https://github.com/twitter/hogan.js.git" - } - , "licenses": [ - { "type": "Apache-2.0" - , "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ] - , "devDependencies": { "uglify-js": "*" } - , "bin" : { "hulk" : "./bin/hulk" } -} diff --git a/static/build/node_modules/hogan.js/test/html/list.html b/static/build/node_modules/hogan.js/test/html/list.html deleted file mode 100644 index 9bb653a3..00000000 --- a/static/build/node_modules/hogan.js/test/html/list.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -
  • -
  • -
  • -
  • -
  • -
  • -
\ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/index.html b/static/build/node_modules/hogan.js/test/index.html deleted file mode 100644 index 6f0e7438..00000000 --- a/static/build/node_modules/hogan.js/test/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - test - - - - - - - - - - \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/index.js b/static/build/node_modules/hogan.js/test/index.js deleted file mode 100644 index 9b235ebe..00000000 --- a/static/build/node_modules/hogan.js/test/index.js +++ /dev/null @@ -1,848 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var Hogan = Hogan || require('../lib/hogan') - , doc = this["document"] - -function testScanTextNoTags() { - var text = "

hi

"; - var tokens = Hogan.scan(text); - is(tokens.length, 1, "One token"); - is(tokens[0]+'', text, "text is equal to first token"); -} - -function testScanOneTag() { - var text = "{{hmm}}"; - var tokens = Hogan.scan(text); - is(tokens.length, 1, "One token"); - is(tokens[0].n, "hmm", "First token content is variable name."); -} - -function testScanMultipleTags() { - var text = "asdf{{hmm}}asdf2{{hmm2}}asdf3"; - var tokens = Hogan.scan(text); - is(tokens.length, 5, "3 text tokens, 2 tag tokens."); - is(tokens[0]+'', "asdf", "first token is text"); - is(tokens[1].n, "hmm", "second token is tag"); - is(tokens[1].tag, "_v", "second token is a variable"); - is(tokens[2]+'', "asdf2", "third token is text"); - is(tokens[3].n, "hmm2", "fourth token is tag"); - is(tokens[3].tag, "_v", "fourth token is a variable"); - is(tokens[4]+'', "asdf3", "Fifth token is text"); -} - -function testScanSectionOpen() { - var text = "{{#hmm}}"; - var tokens = Hogan.scan(text); - is(tokens.length, 1, "One token"); - is(tokens[0].n, "hmm", "First token content is variable name."); - is(tokens[0].tag, "#", "First token is a section."); -} - -function testScanSectionClose() { - var text = "{{/hmm}}"; - var tokens = Hogan.scan(text); - is(tokens.length, 1, "One token"); - is(tokens[0].n, "hmm", "First token content is variable name."); - is(tokens[0].tag, "/", "First token is a section."); -} - -function testScanSection() { - var text = "{{#hmm}}{{/hmm}}"; - var tokens = Hogan.scan(text); - is(tokens.length, 2, "One token"); - is(tokens[0].n, "hmm", "First token content is variable name."); - is(tokens[0].tag, "#", "First token is a section."); - is(tokens[1].n, "hmm", "Second token content is variable name."); - is(tokens[1].tag, "/", "Second token is a section."); -} - -function testScanSectionInContent() { - var text = "abc{{#hmm}}def{{/hmm}}ghi"; - var tokens = Hogan.scan(text); - is(tokens.length, 5, "3 text tokens, 2 tag tokens."); - is(tokens[0]+'', "abc", "first token is text"); - is(tokens[1].n, "hmm", "second token is tag"); - is(tokens[1].tag, "#", "second token is a variable"); - is(tokens[2]+'', "def", "third token is text"); - is(tokens[3].n, "hmm", "fourth token is tag"); - is(tokens[3].tag, "/", "fourth token is a variable"); - is(tokens[4]+'', "ghi", "Fifth token is text"); -} - -function testScanNegativeSection() { - var text = "{{^hmm}}{{/hmm}}"; - var tokens = Hogan.scan(text); - is(tokens.length, 2, "One token"); - is(tokens[0].n, "hmm", "First token content is variable name."); - is(tokens[0].tag, "^", "First token is a negative section."); - is(tokens[1].n, "hmm", "First token content is variable name."); - is(tokens[1].tag, "/", "Second token is a section."); -} - -function testScanPartial() { - var text = "{{>hmm}}"; - var tokens = Hogan.scan(text); - is(tokens.length, 1, "One token"); - is(tokens[0].n, "hmm", "First token content is variable name."); - is(tokens[0].tag, ">", "First token is a partial."); -} - - -function testScanBackwardPartial() { - var text = "{{
\' \" &"}); - is(s, "< > <div> ' " &", "input correctly escaped."); - - var ec ={ "'": "'", '"': """, "<": "<", ">": ">", "&": "&"} - for (var char in ec) { - var s = t.render({foo: char + " just me"}); - is(s, ec[char] + " just me", "input correctly escaped."); - } - -} - -function testMustacheInjection() { - var text = "{{foo}}"; - var t = Hogan.compile(text); - s = t.render({foo:"{{{<42}}}"}) - is(s, "{{{<42}}}", "Can't inject mustache"); -} - -function testTripleStache() { - var text = "{{{foo}}}"; - var t = Hogan.compile(text); - var s = t.render({foo: "< >
\' \" &"}); - is(s, "< >
\' \" &", "input correctly not-escaped."); -} - -function testAmpNoEscaping() { - var text = "{{&foo}}"; - var t = Hogan.compile(text); - var s = t.render({foo: "< >
\' \" &"}); - is(s, "< >
\' \" &", "input correctly not-escaped."); -} - -function testPartial() { - var partialText = "this is text from the partial--the magic number {{foo}} is from a variable"; - var p = Hogan.compile(partialText); - - var text = "This template contains a partial ({{>testPartial}})." - var t = Hogan.compile(text); - - var s = t.render({foo: 42}, {testPartial: p}); - is(s, "This template contains a partial (this is text from the partial--the magic number 42 is from a variable).", "partials work"); -} - -function testNestedPartials() { - var partialText = "this is text from the partial--the magic number {{foo}} is from a variable"; - var p = Hogan.compile(partialText); - - var partialText2 = "This template contains a partial ({{>testPartial}})." - var p2 = Hogan.compile(partialText2); - - var text = "This template contains a partial that contains a partial [{{>testPartial2}}]." - var t = Hogan.compile(text); - - var s = t.render({foo: 42}, {testPartial: p, testPartial2: p2}); - is(s, "This template contains a partial that contains a partial [This template contains a partial (this is text from the partial--the magic number 42 is from a variable).].", "nested partials work"); -} - -function testNegativeSection() { - var text = "This template {{^foo}}BOO {{/foo}}contains an inverted section." - var t = Hogan.compile(text); - var s = t.render(); - is(s, "This template BOO contains an inverted section.", "inverted sections with no context work"); - - s = t.render({foo:[]}); - is(s, "This template BOO contains an inverted section.", "inverted sections with empty list context work"); - - s = t.render({ foo:false }); - is(s, "This template BOO contains an inverted section.", "inverted sections with false context work"); - - s = t.render({foo:''}); - is(s, "This template contains an inverted section.", "inverted sections with empty string context work"); - - s = t.render({foo:true}); - is(s, "This template contains an inverted section.", "inverted sections with true context work"); - - s = t.render({foo: function() { return false; }}); - is(s, "This template BOO contains an inverted section.", "inverted sections with false returning method in context work"); -} - -function testSectionElision() { - var text = "This template {{#foo}}BOO {{/foo}}contains a section." - var t = Hogan.compile(text); - var s = t.render(); - is(s, "This template contains a section.", "sections with no context work"); - - s = t.render({foo:[]}); - is(s, "This template contains a section.", "sections with empty list context work"); - - s = t.render({foo:false}); - is(s, "This template contains a section.", "sections with false context work"); -} - -function testSectionObjectContext() { - var text = "This template {{#foo}}{{bar}} {{/foo}}contains a section." - var t = Hogan.compile(text); - var s = t.render({foo:{bar:42}}); - is(s, "This template 42 contains a section.", "sections with object context work"); -} - -function testSectionArrayContext() { - var text = "This template {{#foo}}{{bar}} {{/foo}}contains a section." - var t = Hogan.compile(text); - var s = t.render({foo:[{bar:42}, {bar:43}, {bar:44}]}); - is(s, "This template 42 43 44 contains a section.", "sections with object ctx and array values work"); -} - -function testFalsyVariableNoRender() { - var text = "I ({{cannot}}) be seen!"; - var t = Hogan.compile(text); - var s = t.render(); - is(s, "I () be seen!", "missing value doesn't render."); -} - -function testSectionExtensions() { - var text = "Test {{_//|__foo}}bar{{/foo}}"; - var options = {sectionTags:[{o:'_//|__foo', c:'foo'}]}; - var tree = Hogan.parse(Hogan.scan(text), options); - is(tree[1].tag, "#", "_//|__foo node transformed to section"); - is(tree[1].n, "_//|__foo", "_//|__foo node transformed to section"); - - var t = Hogan.compile(text, options ); - var s = t.render({'_//|__foo':true}); - is(s, "Test bar", "Custom sections work"); -} - -function testMisnestedSectionExtensions() { - var text = "Test {{__foo}}bar{{/bar}}"; - var options = {sectionTags:[{o:'__foo', c:'foo'}, {o:'__bar', c:'bar'}]}; - var msg = ''; - try { - var tree = Hogan.parse(Hogan.scan(text), options); - } catch (e) { - msg = e.message; - } - is(msg, "Nesting error: __foo vs. bar", "Error is generated"); -} - -function testNestedSection() { - var text = "{{#foo}}{{#bar}}{{baz}}{{/bar}}{{/foo}}"; - var t = Hogan.compile(text); - var s = t.render({foo: 42, bar: 42, baz:42}); - is(s, "42", "can reach up context stack"); -} - -function testDottedNames() { - var text = '"{{person.name}}" == "{{#person}}{{name}}{{/person}}"'; - var t = Hogan.compile(text); - var s = t.render({person:{name:'Joe'}}); - is(s, '"Joe" == "Joe"', "dotted names work"); -} - -function testImplicitIterator() { - var text = '{{#stuff}} {{.}} {{/stuff}}'; - var t = Hogan.compile(text); - var s = t.render({stuff:[42,43,44]}); - is(s, " 42 43 44 ", "implicit iterators work"); -} - -function testPartialsAndDelimiters() { - var text = '{{>include}}*\n{{= | | =}}\n*|>include|'; - var partialText = ' .{{value}}. '; - var partial = Hogan.compile(partialText); - var t = Hogan.compile(text); - var s = t.render({value:"yes"}, {'include':partial}); - is(s, " .yes. *\n* .yes. ", "partials work around delimiters"); -} - -function testStringPartials() { - var text = "foo{{>mypartial}}baz"; - var partialText = " bar "; - var t = Hogan.compile(text); - var s = t.render({}, {'mypartial': partialText}); - is(s, "foo bar baz", "string partial works."); -} - -function testMissingPartials() { - var text = "foo{{>mypartial}} bar"; - var t = Hogan.compile(text); - var s = t.render({}); - is(s, "foo bar", "missing partial works."); -} - -function testIndentedStandaloneComment() { - var text = 'Begin.\n {{! Indented Comment Block! }}\nEnd.'; - var t = Hogan.compile(text); - var s = t.render(); - is(s, 'Begin.\nEnd.', "Standalone comment blocks are removed."); -} - -function testNewLineBetweenDelimiterChanges() { - var data = { section: true, data: 'I got interpolated.' }; - var text = '\n{{#section}}\n {{data}}\n |data|\n{{/section}}x\n\n{{= | | =}}\n|#section|\n {{data}}\n |data|\n|/section|'; - var t = Hogan.compile(text); - var s = t.render(data); - is(s, '\n I got interpolated.\n |data|\nx\n\n {{data}}\n I got interpolated.\n', 'render correct') -} - -function testMustacheJSApostrophe() { - var text = '{{apos}}{{control}}'; - var t = Hogan.compile(text); - var s = t.render({'apos':"'", 'control':"X"}); - is(s, ''X', 'Apostrophe is escaped.'); -} - -function testMustacheJSArrayOfImplicitPartials() { - var text = 'Here is some stuff!\n{{#numbers}}\n{{>partial}}\n{{/numbers}}\n'; - var partialText = '{{.}}\n'; - var t = Hogan.compile(text); - var s = t.render({numbers:[1,2,3,4]}, {partial: partialText}); - is(s, 'Here is some stuff!\n1\n2\n3\n4\n', 'Partials with implicit iterators work.'); -} - -function testMustacheJSArrayOfPartials() { - var text = 'Here is some stuff!\n{{#numbers}}\n{{>partial}}\n{{/numbers}}\n'; - var partialText = '{{i}}\n'; - var t = Hogan.compile(text); - var s = t.render({numbers:[{i:1},{i:2},{i:3},{i:4}]}, {partial: partialText}); - is(s, 'Here is some stuff!\n1\n2\n3\n4\n', 'Partials with arrays work.'); -} - -function testMustacheJSArrayOfStrings() { - var text = '{{#strings}}{{.}} {{/strings}}'; - var t = Hogan.compile(text); - var s = t.render({strings:['foo', 'bar', 'baz']}); - is(s, 'foo bar baz ', 'array of strings works with implicit iterators.'); -} - -function testMustacheJSUndefinedString() { - var text = 'foo{{bar}}baz'; - var t = Hogan.compile(text); - var s = t.render({bar:undefined}); - is(s, 'foobaz', 'undefined value does not render.'); -} - -function testMustacheJSTripleStacheAltDelimiter() { - var text = '{{=<% %>=}}<% foo %> {{foo}} <%{bar}%> {{{bar}}}'; - var t = Hogan.compile(text); - var s = t.render({foo:'yeah', bar:'hmm'}); - is(s, 'yeah {{foo}} hmm {{{bar}}}', 'triple stache inside alternate delimiter works.'); -} - -/* shootout benchmark tests */ - -function testShootOutString() { - var text = "Hello World!"; - var expected = "Hello World!" - var t = Hogan.compile(text) - var s = t.render({}) - is(s, expected, "Shootout String compiled correctly"); -} - -function testShootOutReplace() { - var text = "Hello {{name}}! You have {{count}} new messages."; - var expected = "Hello Mick! You have 30 new messages."; - var t = Hogan.compile(text) - var s = t.render({ name: "Mick", count: 30 }) - is(s, expected, "Shootout Replace compiled correctly"); -} - -function testShootOutArray() { - var text = "{{#names}}{{name}}{{/names}}"; - var expected = "MoeLarryCurlyShemp"; - var t = Hogan.compile(text); - var s = t.render({ names: [{name: "Moe"}, {name: "Larry"}, {name: "Curly"}, {name: "Shemp"}] }) - is(s, expected, "Shootout Array compiled correctly"); -} - -function testShootOutObject() { - var text = "{{#person}}{{name}}{{age}}{{/person}}"; - var expected = "Larry45"; - var t = Hogan.compile(text) - var s = t.render({ person: { name: "Larry", age: 45 } }) - is(s, expected, "Shootout Object compiled correctly"); -} - -function testShootOutPartial() { - var text = "{{#peeps}}{{>replace}}{{/peeps}}"; - var t = Hogan.compile(text); - var partial = Hogan.compile(" Hello {{name}}! You have {{count}} new messages."); - var s = t.render({ peeps: [{name: "Moe", count: 15}, {name: "Larry", count: 5}, {name: "Curly", count: 2}] }, { replace: partial }); - var expected = " Hello Moe! You have 15 new messages. Hello Larry! You have 5 new messages. Hello Curly! You have 2 new messages."; - is(s, expected, "Shootout Partial compiled correctly"); -} - -function testShootOutRecurse() { - var text = "{{name}}{{#kids}}{{>recursion}}{{/kids}}"; - var t = Hogan.compile(text); - var partial = Hogan.compile("{{name}}{{#kids}}{{>recursion}}{{/kids}}"); - var s = t.render({ - name: '1', - kids: [ - { - name: '1.1', - kids: [ - { name: '1.1.1', kids: [] } - ] - } - ] - }, { recursion: partial }); - var expected = "11.11.1.1"; - is(s, expected, "Shootout Recurse compiled correctly"); -} - -function testShootOutFilter() { - var text = "{{#filter}}foo {{bar}}{{/filter}}"; - var t = Hogan.compile(text); - var s = t.render({ - filter: function() { - return function(text, render) { - return render(text).toUpperCase(); - } - }, - bar: "bar" - }); - var expected = "FOO BAR" - is(s, expected, "Shootout Filter compiled correctly"); -} - -function testShootOutComplex() { - var text = - "

{{header}}

" + - "{{#hasItems}}" + - "
    " + - "{{#items}}" + - "{{#current}}" + - "
  • {{name}}
  • " + - "{{/current}}" + - "{{^current}}" + - "
  • {{name}}
  • " + - "{{/current}}" + - "{{/items}}" + - "
" + - "{{/hasItems}}" + - "{{^hasItems}}" + - "

The list is empty.

" + - "{{/hasItems}}"; - - var expected = "

Colors

"; - var t = Hogan.compile(text) - var s = t.render({ - header: function() { - return "Colors"; - }, - items: [ - {name: "red", current: true, url: "#Red"}, - {name: "green", current: false, url: "#Green"}, - {name: "blue", current: false, url: "#Blue"} - ], - hasItems: function() { - return this.items.length !== 0; - }, - empty: function() { - return this.items.length === 0; - } - }) - - is(s, expected, "Shootout Complex compiled correctly"); -} - -function testRenderOutput() { - if (doc) return - var fs = require('fs'); - var inPath = 'test/templates'; - var outPath = 'test/html'; - - fs.readdirSync(inPath).forEach(function (file) { - var i = fs.readFileSync([inPath, file].join('/'), 'utf-8'); - var t = Hogan.compile(i); - var r = t.render({}); - var o = fs.readFileSync([outPath, file].join('/').replace(/mustache$/, 'html')).toString(); - is(r === o, true, file + ' should correctly render html') - }) -} - -function testDefaultRenderImpl() { - var ht = new Hogan.Template(); - is(ht.render() === '', true, 'default renderImpl returns an array.'); -} - - -function appendText(el, text) { - var textNode = document.createTextNode(text); - el.appendChild(textNode); - el.appendChild(document.createElement('br')); -} - -if (!this["output"]) { - var output = function (s) { - return doc ? appendText(doc.getElementById('console'), s) : console.log(s); - }; -} -var passed = 0; -var failed = 0; - -function is(got, expected, msg) { - if (got === expected) { - output("OK: " + msg); - ++passed; - } else { - output("FAIL: " + msg); - output("Expected |" + expected + "|"); - output(" Got |" + got + "|"); - ++failed; - } -} - -function complete() { - output("\nTests Complete"); - output("--------------"); - output("Passed: " + passed); - output("Failed: " + failed); - output("\n"); -} - -function runTests() { - output("Tests Starting"); - output("--------------"); - testScanTextNoTags(); - testScanOneTag(); - testScanMultipleTags(); - testScanSectionOpen(); - testScanSectionClose(); - testScanSection(); - testScanSectionInContent(); - testScanNegativeSection(); - testScanPartial(); - testScanBackwardPartial(); - testScanAmpersandNoEscapeTag(); - testScanTripleStache(); - testScanSectionWithTripleStacheInside(); - testScanSetDelimiter(); - testScanResetDelimiter(); - testSetDelimiterWithWhitespace(); - testSingleCharDelimiter(); - testParseBasic(); - testParseVariables(); - testParseSection(); - testParseIndexes(); - testParseNegativeSection(); - testParseNestedSections(); - testMissingClosingTag(); - testBadNesting(); - testBasicOutput(); - //testBasicOutputAsString(); - testOneVariable(); - //testOneVariableAsString(); - testMultipleVariables(); - testNumberValues(); - testObjectRender(); - testObjectToStringRender(); - testArrayRender(); - testEscaping(); - testMustacheInjection(); - testTripleStache(); - testAmpNoEscaping(); - testPartial(); - testNestedPartials(); - testNegativeSection(); - testSectionElision(); - testSectionObjectContext(); - testSectionArrayContext(); - testRenderWithWhitespace(); - testRenderWithWhitespaceAroundTripleStache(); - testRenderWithWhitespaceAroundAmpersand(); - testFalsyVariableNoRender(); - testRenderOutput(); - testDefaultRenderImpl(); - testSectionExtensions(); - testMisnestedSectionExtensions(); - testNestedSection(); - testShootOutString(); - testShootOutReplace(); - testShootOutArray(); - testShootOutObject(); - testShootOutPartial(); - testShootOutRecurse(); - testShootOutFilter(); - testShootOutComplex(); - testDottedNames(); - testImplicitIterator(); - testPartialsAndDelimiters(); - testStringPartials(); - testMissingPartials(); - testIndentedStandaloneComment(); - testNewLineBetweenDelimiterChanges(); - testMustacheJSApostrophe(); - testMustacheJSArrayOfImplicitPartials(); - testMustacheJSArrayOfPartials(); - testMustacheJSArrayOfStrings(); - testMustacheJSUndefinedString(); - testMustacheJSTripleStacheAltDelimiter(); - complete(); -} - -if (doc) { - window.onload = runTests; -} else { - runTests(); -} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/mustache.js b/static/build/node_modules/hogan.js/test/mustache.js deleted file mode 100644 index b2d8ebc5..00000000 --- a/static/build/node_modules/hogan.js/test/mustache.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var doc = this['document']; -var fs = require('fs'); - -var passed = 0; -var failed = 0; - -if (!this['output']) { - var output = function (string) { - return doc ? doc.write(string + '
') : console.log(string); - }; -} - -var Hogan = require(__dirname + '/../lib/hogan'); -var template = fs.readFileSync(__dirname + '/../lib/template.js').toString(); -var compiler = fs.readFileSync(__dirname + '/../lib/compiler.js').toString(); -var mustache_wrapper = fs.readFileSync(__dirname + '/../wrappers/mustache.js.mustache').toString(); - -// Create a Mustache.js emulator from the distribution template -var engines = (new Function(Hogan.compile(mustache_wrapper).render({template: template, compiler: compiler}) + - '; return {Hogan: Hogan, Mustache: Mustache};'))(); - -var Mustache = engines.Mustache; -var Hogan2 = engines.Hogan; - - -// sanity check -is(Mustache.hasOwnProperty('to_html'), true, 'Mustache has to_html method.'); - -// Check for Mustache.js partial resolution behavior. -var context = { - foo: 'bar', - mypartial: { - baz: 'qux' - } -} -var text = 'abc {{foo}} def {{>mypartial}} ghi'; -var partialText = '{{baz}}'; -var s = Mustache.to_html(text, context, {'mypartial': partialText}); -is(s, 'abc bar def qux ghi', 'Correct emulation of Mustache.js partial-name-in-context resolution.'); - -// Now check to see that the Hogan resolution is unaffected. -var t = Hogan2.compile(text); -s = t.render(context, {'mypartial': partialText}); -is(s, 'abc bar def ghi', 'Hogan behavior not changed by Mustache.js emulation.'); - -// Check for sendFun behavior -var buf = ""; -function send(s) { - buf += "-FOO " + s + " FOO-"; -} -var s = Mustache.to_html(text, context, {'mypartial': partialText}, send); -is(buf, '-FOO abc bar def qux ghi FOO-', 'Correct emulation of Mustache.js sendFun.'); - - -function is(got, expected, msg) { - if (got === expected) { - output("OK: " + msg); - ++passed; - } else { - output("FAIL: " + msg); - output("Expected |" + expected + "|"); - output(" Got |" + got + "|"); - ++failed; - } -} - -function complete() { - output("\nTests Complete"); - output("--------------"); - output("Passed: " + passed); - output("Failed: " + failed); - output("\n"); -} - -complete(); \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/spec.js b/static/build/node_modules/hogan.js/test/spec.js deleted file mode 100644 index 15b4d8e1..00000000 --- a/static/build/node_modules/hogan.js/test/spec.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var Hogan = Hogan || require('../lib/hogan'); -var doc = this["document"]; -var fs = require('fs'); - -var passed = 0; -var failed = 0; - -if (!this["output"]) { - var output = function (string) { - return doc ? doc.write(string + '
') : console.log(string); - }; -} - -function runTest(tests) { - tests.forEach(function(test) { - var partials = {}; - for (var i in test.partials) { - partials[i] = Hogan.compile(test.partials[i]); - } - var t = Hogan.compile(test.template); - - if (test.data.lambda) { - var func = (new Function ('return ' + test.data.lambda.js)()); - test.data.lambda = function() { return func; }; - } - - var s = t.render(test.data, partials); - is(s, test.expected, test.name + ': ' + test.desc); - }); -} - -var testDir = './test/spec/specs'; -var files = fs.readdirSync(testDir) - .filter(function(f) { return f.indexOf('.json') > 0; }) - .map(function(f) { return testDir + '/' + f}); - -for (var i = 0; i < files.length; i++) { - var test = JSON.parse(fs.readFileSync(files[i]).toString()); - runTest(test.tests); -} - -function is(got, expected, msg) { - if (got === expected) { - output("OK: " + msg); - ++passed; - } else { - output("FAIL: " + msg); - output("Expected |" + expected + "|"); - output(" Got |" + got + "|"); - ++failed; - } -} - -function complete() { - output("\nTests Complete"); - output("--------------"); - output("Passed: " + passed); - output("Failed: " + failed); - output("\n"); -} - -complete(); diff --git a/static/build/node_modules/hogan.js/test/spec/Changes b/static/build/node_modules/hogan.js/test/spec/Changes deleted file mode 100644 index bb39b982..00000000 --- a/static/build/node_modules/hogan.js/test/spec/Changes +++ /dev/null @@ -1,31 +0,0 @@ -2011-03-20: v1.1.2 - Added tests for standalone tags at string boundaries. - Added tests for rendering lambda returns after delimiter changes. - -2011-03-20: v1.0.3 - Added tests for standalone tags at string boundaries. - Added tests for rendering lambda returns after delimiter changes. - -2011-03-05: v1.1.1 - Added tests for indented inline sections. - Added tests for Windows-style newlines. - -2011-03-05: v1.0.2 - Added tests for indented inline sections. - Added tests for Windows-style newlines. - -2011-03-04: v1.1.0 - Implicit iterators. - A single period (`.`) may now be used as a name in Interpolation tags, - which represents the top of stack (cast as a String). - Dotted names. - Names containing one or more periods should be resolved as chained - properties; naïvely, this is like nesting section tags, but with some - built-in scoping protections. - -2011-03-02: v1.0.1 - Clarifying a point in the README about version compliance. - Adding high-level documentation to each spec file. - -2011-02-28: v1.0.0 - Initial Release diff --git a/static/build/node_modules/hogan.js/test/spec/README.md b/static/build/node_modules/hogan.js/test/spec/README.md deleted file mode 100644 index b01b1bbd..00000000 --- a/static/build/node_modules/hogan.js/test/spec/README.md +++ /dev/null @@ -1,65 +0,0 @@ -The repository at https://github.com/mustache/spec is the formal standard for -Mustache. It defines both normal usage and edge-case behavior for libraries -parsing the Mustache templating language (or a superset thereof). - -The specification is developed as a series of YAML files, under the `specs` -directory. - -Versioning ----------- -This specification is being [semantically versioned](http://semver.org). -Roughly described, major version changes will always represent backwards -incompatible changes, minor version changes will always represent new language -features and will be backwards compatible, and patch ('tiny') version changes -will always be bug fixes. For the purposes of semantic versioning, the public -API is the contents of the `specs` directory and the algorithm for testing -against it. - -Mustache implementations SHOULD report the most recent version of the spec -(major and minor version numbers). If an implementation has support for any -optional modules, they SHOULD indicate so with a remark attached to the -version number (e.g. "vX.Y, including lambdas" or "v.X.Y+λ"). It is -RECOMMENDED that implementations not supporting at least v1.0.0 of this spec -refer to themselves as "Mustache-like", or "Mustache-inspired". - -Alternate Formats ------------------ - -Since YAML is a reasonably complex format that not every language has good -tools for working with, we also provide JSON versions of the specs on a -best-effort basis. - -These should be identical to the YAML specifications, but if you find the need -to regenerate them, they can be trivially rebuilt by invoking `rake build`. - -It is also worth noting that some specifications (notably, the lambda module) -rely on YAML "tags" to denote special types of data (e.g. source code). Since -JSON offers no way to denote this, a special key ("`__tag__`") is injected -with the name of the tag as its value. See `TESTING.md` for more information -about handling tagged data. - -Optional Modules ----------------- - -Specification files beginning with a tilde (`~`) describe optional modules. -At present, the only module being described as optional is regarding support -for lambdas. As a guideline, a module may be a candidate for optionality -when: - - * It does not affect the core syntax of the language. - * It does not significantly affect the output of rendered templates. - * It concerns implementation language features or data types that are not - common to or core in every targeted language. - * The lack of support by an implementation does not diminish the usage of - Mustache in the target language. - -As an example, the lambda module is primarily concerned with the handling of a -particular data type (code). This is a type of data that may be difficult to -support in some languages, and users of those languages will not see the lack -as an 'inconsistency' between implementations. - -Support for specific pragmas or syntax extensions, however, are best managed -outside this core specification, as adjunct specifications. - -Implementors are strongly encouraged to support any and all modules they are -reasonably capable of supporting. diff --git a/static/build/node_modules/hogan.js/test/spec/Rakefile b/static/build/node_modules/hogan.js/test/spec/Rakefile deleted file mode 100644 index 5254ce65..00000000 --- a/static/build/node_modules/hogan.js/test/spec/Rakefile +++ /dev/null @@ -1,27 +0,0 @@ -require 'json' -require 'yaml' - -# Our custom YAML tags must retain their magic. -%w[ code ].each do |tag| - YAML::add_builtin_type(tag) { |_,val| val.merge(:__tag__ => tag) } -end - -desc 'Build all alternate versions of the specs.' -multitask :build => [ 'build:json' ] - -namespace :build do - note = 'Do not edit this file; changes belong in the appropriate YAML file.' - - desc 'Build JSON versions of the specs.' - task :json do - rm(Dir['specs/*.json'], :verbose => false) - Dir.glob('specs/*.yml').each do |filename| - json_file = filename.gsub('.yml', '.json') - - File.open(json_file, 'w') do |file| - doc = YAML.load_file(filename) - file << doc.merge(:__ATTN__ => note).to_json() - end - end - end -end diff --git a/static/build/node_modules/hogan.js/test/spec/TESTING.md b/static/build/node_modules/hogan.js/test/spec/TESTING.md deleted file mode 100644 index d2ca3749..00000000 --- a/static/build/node_modules/hogan.js/test/spec/TESTING.md +++ /dev/null @@ -1,46 +0,0 @@ -Testing your Mustache implementation against this specification should be -relatively simple. If you have a readily available testing framework on your -platform, your task may be even simpler. - -In general, the process for each `.yml` file is as follows: - -1. Use a YAML parser to load the file. - -2. For each test in the 'tests' array: - - 1. Ensure that each element of the 'partials' hash (if it exists) is - stored in a place where the interpreter will look for it. - - 2. If your implementation will not support lambdas, feel free to skip over - the optional '~lambdas.yml' file. - - 2.1. If your implementation will support lambdas, ensure that each member of - 'data' tagged with '!code' is properly processed into a language- - specific lambda reference. - - * e.g. Given this YAML data hash: - - `{ x: !code { ruby: 'proc { "x" }', perl: 'sub { "x" }' } }` - - a Ruby-based Mustache implementation would process it such that it - was equivalent to this Ruby hash: - - `{ 'x' => proc { "x" } }` - - * If your implementation language does not currently have lambda - examples in the spec, feel free to implement them and send a pull - request. - - * The JSON version of the spec represents these tagged values as a hash - with a '`__tag__`' key of 'code'. - - 3. Render the template (stored in the 'template' key) with the given 'data' - hash. - - 4. Compare the results of your rendering against the 'expected' value; any - differences should be reported, along with any useful debugging - information. - - * Of note, the 'desc' key contains a rough one-line description of the - behavior being tested -- this is most useful in conjunction with the - file name and test 'name'. diff --git a/static/build/node_modules/hogan.js/test/spec/specs/comments.json b/static/build/node_modules/hogan.js/test/spec/specs/comments.json deleted file mode 100644 index 30cb927e..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/comments.json +++ /dev/null @@ -1 +0,0 @@ -{"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file.","overview":"Comment tags represent content that should never appear in the resulting\noutput.\n\nThe tag's content may contain any substring (including newlines) EXCEPT the\nclosing delimiter.\n\nComment tags SHOULD be treated as standalone when appropriate.\n","tests":[{"name":"Inline","data":{},"expected":"1234567890","template":"12345{{! Comment Block! }}67890","desc":"Comment blocks should be removed from the template."},{"name":"Multiline","data":{},"expected":"1234567890\n","template":"12345{{!\n This is a\n multi-line comment...\n}}67890\n","desc":"Multiline comments should be permitted."},{"name":"Standalone","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n{{! Comment Block! }}\nEnd.\n","desc":"All standalone comment lines should be removed."},{"name":"Indented Standalone","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n {{! Indented Comment Block! }}\nEnd.\n","desc":"All standalone comment lines should be removed."},{"name":"Standalone Line Endings","data":{},"expected":"|\r\n|","template":"|\r\n{{! Standalone Comment }}\r\n|","desc":"\"\\r\\n\" should be considered a newline for standalone tags."},{"name":"Standalone Without Previous Line","data":{},"expected":"!","template":" {{! I'm Still Standalone }}\n!","desc":"Standalone tags should not require a newline to precede them."},{"name":"Standalone Without Newline","data":{},"expected":"!\n","template":"!\n {{! I'm Still Standalone }}","desc":"Standalone tags should not require a newline to follow them."},{"name":"Multiline Standalone","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n{{!\nSomething's going on here...\n}}\nEnd.\n","desc":"All standalone comment lines should be removed."},{"name":"Indented Multiline Standalone","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n {{!\n Something's going on here...\n }}\nEnd.\n","desc":"All standalone comment lines should be removed."},{"name":"Indented Inline","data":{},"expected":" 12 \n","template":" 12 {{! 34 }}\n","desc":"Inline comments should not strip whitespace"},{"name":"Surrounding Whitespace","data":{},"expected":"12345 67890","template":"12345 {{! Comment Block! }} 67890","desc":"Comment removal should preserve surrounding whitespace."}]} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/spec/specs/comments.yml b/static/build/node_modules/hogan.js/test/spec/specs/comments.yml deleted file mode 100644 index 7b14c7f3..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/comments.yml +++ /dev/null @@ -1,103 +0,0 @@ -overview: | - Comment tags represent content that should never appear in the resulting - output. - - The tag's content may contain any substring (including newlines) EXCEPT the - closing delimiter. - - Comment tags SHOULD be treated as standalone when appropriate. -tests: - - name: Inline - desc: Comment blocks should be removed from the template. - data: { } - template: '12345{{! Comment Block! }}67890' - expected: '1234567890' - - - name: Multiline - desc: Multiline comments should be permitted. - data: { } - template: | - 12345{{! - This is a - multi-line comment... - }}67890 - expected: | - 1234567890 - - - name: Standalone - desc: All standalone comment lines should be removed. - data: { } - template: | - Begin. - {{! Comment Block! }} - End. - expected: | - Begin. - End. - - - name: Indented Standalone - desc: All standalone comment lines should be removed. - data: { } - template: | - Begin. - {{! Indented Comment Block! }} - End. - expected: | - Begin. - End. - - - name: Standalone Line Endings - desc: '"\r\n" should be considered a newline for standalone tags.' - data: { } - template: "|\r\n{{! Standalone Comment }}\r\n|" - expected: "|\r\n|" - - - name: Standalone Without Previous Line - desc: Standalone tags should not require a newline to precede them. - data: { } - template: " {{! I'm Still Standalone }}\n!" - expected: "!" - - - name: Standalone Without Newline - desc: Standalone tags should not require a newline to follow them. - data: { } - template: "!\n {{! I'm Still Standalone }}" - expected: "!\n" - - - name: Multiline Standalone - desc: All standalone comment lines should be removed. - data: { } - template: | - Begin. - {{! - Something's going on here... - }} - End. - expected: | - Begin. - End. - - - name: Indented Multiline Standalone - desc: All standalone comment lines should be removed. - data: { } - template: | - Begin. - {{! - Something's going on here... - }} - End. - expected: | - Begin. - End. - - - name: Indented Inline - desc: Inline comments should not strip whitespace - data: { } - template: " 12 {{! 34 }}\n" - expected: " 12 \n" - - - name: Surrounding Whitespace - desc: Comment removal should preserve surrounding whitespace. - data: { } - template: '12345 {{! Comment Block! }} 67890' - expected: '12345 67890' diff --git a/static/build/node_modules/hogan.js/test/spec/specs/delimiters.json b/static/build/node_modules/hogan.js/test/spec/specs/delimiters.json deleted file mode 100644 index fcf95888..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/delimiters.json +++ /dev/null @@ -1 +0,0 @@ -{"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file.","overview":"Set Delimiter tags are used to change the tag delimiters for all content\nfollowing the tag in the current compilation unit.\n\nThe tag's content MUST be any two non-whitespace sequences (separated by\nwhitespace) EXCEPT an equals sign ('=') followed by the current closing\ndelimiter.\n\nSet Delimiter tags SHOULD be treated as standalone when appropriate.\n","tests":[{"name":"Pair Behavior","data":{"text":"Hey!"},"expected":"(Hey!)","template":"{{=<% %>=}}(<%text%>)","desc":"The equals sign (used on both sides) should permit delimiter changes."},{"name":"Special Characters","data":{"text":"It worked!"},"expected":"(It worked!)","template":"({{=[ ]=}}[text])","desc":"Characters with special meaning regexen should be valid delimiters."},{"name":"Sections","data":{"section":true,"data":"I got interpolated."},"expected":"[\n I got interpolated.\n |data|\n\n {{data}}\n I got interpolated.\n]\n","template":"[\n{{#section}}\n {{data}}\n |data|\n{{/section}}\n\n{{= | | =}}\n|#section|\n {{data}}\n |data|\n|/section|\n]\n","desc":"Delimiters set outside sections should persist."},{"name":"Inverted Sections","data":{"section":false,"data":"I got interpolated."},"expected":"[\n I got interpolated.\n |data|\n\n {{data}}\n I got interpolated.\n]\n","template":"[\n{{^section}}\n {{data}}\n |data|\n{{/section}}\n\n{{= | | =}}\n|^section|\n {{data}}\n |data|\n|/section|\n]\n","desc":"Delimiters set outside inverted sections should persist."},{"name":"Partial Inheritence","data":{"value":"yes"},"expected":"[ .yes. ]\n[ .yes. ]\n","template":"[ {{>include}} ]\n{{= | | =}}\n[ |>include| ]\n","desc":"Delimiters set in a parent template should not affect a partial.","partials":{"include":".{{value}}."}},{"name":"Post-Partial Behavior","data":{"value":"yes"},"expected":"[ .yes. .yes. ]\n[ .yes. .|value|. ]\n","template":"[ {{>include}} ]\n[ .{{value}}. .|value|. ]\n","desc":"Delimiters set in a partial should not affect the parent template.","partials":{"include":".{{value}}. {{= | | =}} .|value|."}},{"name":"Surrounding Whitespace","data":{},"expected":"| |","template":"| {{=@ @=}} |","desc":"Surrounding whitespace should be left untouched."},{"name":"Outlying Whitespace (Inline)","data":{},"expected":" | \n","template":" | {{=@ @=}}\n","desc":"Whitespace should be left untouched."},{"name":"Standalone Tag","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n{{=@ @=}}\nEnd.\n","desc":"Standalone lines should be removed from the template."},{"name":"Indented Standalone Tag","data":{},"expected":"Begin.\nEnd.\n","template":"Begin.\n {{=@ @=}}\nEnd.\n","desc":"Indented standalone lines should be removed from the template."},{"name":"Standalone Line Endings","data":{},"expected":"|\r\n|","template":"|\r\n{{= @ @ =}}\r\n|","desc":"\"\\r\\n\" should be considered a newline for standalone tags."},{"name":"Standalone Without Previous Line","data":{},"expected":"=","template":" {{=@ @=}}\n=","desc":"Standalone tags should not require a newline to precede them."},{"name":"Standalone Without Newline","data":{},"expected":"=\n","template":"=\n {{=@ @=}}","desc":"Standalone tags should not require a newline to follow them."},{"name":"Pair with Padding","data":{},"expected":"||","template":"|{{= @ @ =}}|","desc":"Superfluous in-tag whitespace should be ignored."}]} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/spec/specs/delimiters.yml b/static/build/node_modules/hogan.js/test/spec/specs/delimiters.yml deleted file mode 100644 index ce80b17c..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/delimiters.yml +++ /dev/null @@ -1,158 +0,0 @@ -overview: | - Set Delimiter tags are used to change the tag delimiters for all content - following the tag in the current compilation unit. - - The tag's content MUST be any two non-whitespace sequences (separated by - whitespace) EXCEPT an equals sign ('=') followed by the current closing - delimiter. - - Set Delimiter tags SHOULD be treated as standalone when appropriate. -tests: - - name: Pair Behavior - desc: The equals sign (used on both sides) should permit delimiter changes. - data: { text: 'Hey!' } - template: '{{=<% %>=}}(<%text%>)' - expected: '(Hey!)' - - - name: Special Characters - desc: Characters with special meaning regexen should be valid delimiters. - data: { text: 'It worked!' } - template: '({{=[ ]=}}[text])' - expected: '(It worked!)' - - - name: Sections - desc: Delimiters set outside sections should persist. - data: { section: true, data: 'I got interpolated.' } - template: | - [ - {{#section}} - {{data}} - |data| - {{/section}} - - {{= | | =}} - |#section| - {{data}} - |data| - |/section| - ] - expected: | - [ - I got interpolated. - |data| - - {{data}} - I got interpolated. - ] - - - name: Inverted Sections - desc: Delimiters set outside inverted sections should persist. - data: { section: false, data: 'I got interpolated.' } - template: | - [ - {{^section}} - {{data}} - |data| - {{/section}} - - {{= | | =}} - |^section| - {{data}} - |data| - |/section| - ] - expected: | - [ - I got interpolated. - |data| - - {{data}} - I got interpolated. - ] - - - name: Partial Inheritence - desc: Delimiters set in a parent template should not affect a partial. - data: { value: 'yes' } - partials: - include: '.{{value}}.' - template: | - [ {{>include}} ] - {{= | | =}} - [ |>include| ] - expected: | - [ .yes. ] - [ .yes. ] - - - name: Post-Partial Behavior - desc: Delimiters set in a partial should not affect the parent template. - data: { value: 'yes' } - partials: - include: '.{{value}}. {{= | | =}} .|value|.' - template: | - [ {{>include}} ] - [ .{{value}}. .|value|. ] - expected: | - [ .yes. .yes. ] - [ .yes. .|value|. ] - - # Whitespace Sensitivity - - - name: Surrounding Whitespace - desc: Surrounding whitespace should be left untouched. - data: { } - template: '| {{=@ @=}} |' - expected: '| |' - - - name: Outlying Whitespace (Inline) - desc: Whitespace should be left untouched. - data: { } - template: " | {{=@ @=}}\n" - expected: " | \n" - - - name: Standalone Tag - desc: Standalone lines should be removed from the template. - data: { } - template: | - Begin. - {{=@ @=}} - End. - expected: | - Begin. - End. - - - name: Indented Standalone Tag - desc: Indented standalone lines should be removed from the template. - data: { } - template: | - Begin. - {{=@ @=}} - End. - expected: | - Begin. - End. - - - name: Standalone Line Endings - desc: '"\r\n" should be considered a newline for standalone tags.' - data: { } - template: "|\r\n{{= @ @ =}}\r\n|" - expected: "|\r\n|" - - - name: Standalone Without Previous Line - desc: Standalone tags should not require a newline to precede them. - data: { } - template: " {{=@ @=}}\n=" - expected: "=" - - - name: Standalone Without Newline - desc: Standalone tags should not require a newline to follow them. - data: { } - template: "=\n {{=@ @=}}" - expected: "=\n" - - # Whitespace Insensitivity - - - name: Pair with Padding - desc: Superfluous in-tag whitespace should be ignored. - data: { } - template: '|{{= @ @ =}}|' - expected: '||' diff --git a/static/build/node_modules/hogan.js/test/spec/specs/interpolation.json b/static/build/node_modules/hogan.js/test/spec/specs/interpolation.json deleted file mode 100644 index d1a1a328..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/interpolation.json +++ /dev/null @@ -1 +0,0 @@ -{"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file.","overview":"Interpolation tags are used to integrate dynamic content into the template.\n\nThe tag's content MUST be a non-whitespace character sequence NOT containing\nthe current closing delimiter.\n\nThis tag's content names the data to replace the tag. A single period (`.`)\nindicates that the item currently sitting atop the context stack should be\nused; otherwise, name resolution is as follows:\n 1) Split the name on periods; the first part is the name to resolve, any\n remaining parts should be retained.\n 2) Walk the context stack from top to bottom, finding the first context\n that is a) a hash containing the name as a key OR b) an object responding\n to a method with the given name.\n 3) If the context is a hash, the data is the value associated with the\n name.\n 4) If the context is an object, the data is the value returned by the\n method with the given name.\n 5) If any name parts were retained in step 1, each should be resolved\n against a context stack containing only the result from the former\n resolution. If any part fails resolution, the result should be considered\n falsey, and should interpolate as the empty string.\nData should be coerced into a string (and escaped, if appropriate) before\ninterpolation.\n\nThe Interpolation tags MUST NOT be treated as standalone.\n","tests":[{"name":"No Interpolation","data":{},"expected":"Hello from {Mustache}!\n","template":"Hello from {Mustache}!\n","desc":"Mustache-free templates should render as-is."},{"name":"Basic Interpolation","data":{"subject":"world"},"expected":"Hello, world!\n","template":"Hello, {{subject}}!\n","desc":"Unadorned tags should interpolate content into the template."},{"name":"HTML Escaping","data":{"forbidden":"& \" < >"},"expected":"These characters should be HTML escaped: & " < >\n","template":"These characters should be HTML escaped: {{forbidden}}\n","desc":"Basic interpolation should be HTML escaped."},{"name":"Triple Mustache","data":{"forbidden":"& \" < >"},"expected":"These characters should not be HTML escaped: & \" < >\n","template":"These characters should not be HTML escaped: {{{forbidden}}}\n","desc":"Triple mustaches should interpolate without HTML escaping."},{"name":"Ampersand","data":{"forbidden":"& \" < >"},"expected":"These characters should not be HTML escaped: & \" < >\n","template":"These characters should not be HTML escaped: {{&forbidden}}\n","desc":"Ampersand should interpolate without HTML escaping."},{"name":"Basic Integer Interpolation","data":{"mph":85},"expected":"\"85 miles an hour!\"","template":"\"{{mph}} miles an hour!\"","desc":"Integers should interpolate seamlessly."},{"name":"Triple Mustache Integer Interpolation","data":{"mph":85},"expected":"\"85 miles an hour!\"","template":"\"{{{mph}}} miles an hour!\"","desc":"Integers should interpolate seamlessly."},{"name":"Ampersand Integer Interpolation","data":{"mph":85},"expected":"\"85 miles an hour!\"","template":"\"{{&mph}} miles an hour!\"","desc":"Integers should interpolate seamlessly."},{"name":"Basic Decimal Interpolation","data":{"power":1.21},"expected":"\"1.21 jiggawatts!\"","template":"\"{{power}} jiggawatts!\"","desc":"Decimals should interpolate seamlessly with proper significance."},{"name":"Triple Mustache Decimal Interpolation","data":{"power":1.21},"expected":"\"1.21 jiggawatts!\"","template":"\"{{{power}}} jiggawatts!\"","desc":"Decimals should interpolate seamlessly with proper significance."},{"name":"Ampersand Decimal Interpolation","data":{"power":1.21},"expected":"\"1.21 jiggawatts!\"","template":"\"{{&power}} jiggawatts!\"","desc":"Decimals should interpolate seamlessly with proper significance."},{"name":"Basic Context Miss Interpolation","data":{},"expected":"I () be seen!","template":"I ({{cannot}}) be seen!","desc":"Failed context lookups should default to empty strings."},{"name":"Triple Mustache Context Miss Interpolation","data":{},"expected":"I () be seen!","template":"I ({{{cannot}}}) be seen!","desc":"Failed context lookups should default to empty strings."},{"name":"Ampersand Context Miss Interpolation","data":{},"expected":"I () be seen!","template":"I ({{&cannot}}) be seen!","desc":"Failed context lookups should default to empty strings."},{"name":"Dotted Names - Basic Interpolation","data":{"person":{"name":"Joe"}},"expected":"\"Joe\" == \"Joe\"","template":"\"{{person.name}}\" == \"{{#person}}{{name}}{{/person}}\"","desc":"Dotted names should be considered a form of shorthand for sections."},{"name":"Dotted Names - Triple Mustache Interpolation","data":{"person":{"name":"Joe"}},"expected":"\"Joe\" == \"Joe\"","template":"\"{{{person.name}}}\" == \"{{#person}}{{{name}}}{{/person}}\"","desc":"Dotted names should be considered a form of shorthand for sections."},{"name":"Dotted Names - Ampersand Interpolation","data":{"person":{"name":"Joe"}},"expected":"\"Joe\" == \"Joe\"","template":"\"{{&person.name}}\" == \"{{#person}}{{&name}}{{/person}}\"","desc":"Dotted names should be considered a form of shorthand for sections."},{"name":"Dotted Names - Arbitrary Depth","data":{"a":{"b":{"c":{"d":{"e":{"name":"Phil"}}}}}},"expected":"\"Phil\" == \"Phil\"","template":"\"{{a.b.c.d.e.name}}\" == \"Phil\"","desc":"Dotted names should be functional to any level of nesting."},{"name":"Dotted Names - Broken Chains","data":{"a":{}},"expected":"\"\" == \"\"","template":"\"{{a.b.c}}\" == \"\"","desc":"Any falsey value prior to the last part of the name should yield ''."},{"name":"Dotted Names - Broken Chain Resolution","data":{"a":{"b":{}},"c":{"name":"Jim"}},"expected":"\"\" == \"\"","template":"\"{{a.b.c.name}}\" == \"\"","desc":"Each part of a dotted name should resolve only against its parent."},{"name":"Dotted Names - Initial Resolution","data":{"a":{"b":{"c":{"d":{"e":{"name":"Phil"}}}}},"b":{"c":{"d":{"e":{"name":"Wrong"}}}}},"expected":"\"Phil\" == \"Phil\"","template":"\"{{#a}}{{b.c.d.e.name}}{{/a}}\" == \"Phil\"","desc":"The first part of a dotted name should resolve as any other name."},{"name":"Interpolation - Surrounding Whitespace","data":{"string":"---"},"expected":"| --- |","template":"| {{string}} |","desc":"Interpolation should not alter surrounding whitespace."},{"name":"Triple Mustache - Surrounding Whitespace","data":{"string":"---"},"expected":"| --- |","template":"| {{{string}}} |","desc":"Interpolation should not alter surrounding whitespace."},{"name":"Ampersand - Surrounding Whitespace","data":{"string":"---"},"expected":"| --- |","template":"| {{&string}} |","desc":"Interpolation should not alter surrounding whitespace."},{"name":"Interpolation - Standalone","data":{"string":"---"},"expected":" ---\n","template":" {{string}}\n","desc":"Standalone interpolation should not alter surrounding whitespace."},{"name":"Triple Mustache - Standalone","data":{"string":"---"},"expected":" ---\n","template":" {{{string}}}\n","desc":"Standalone interpolation should not alter surrounding whitespace."},{"name":"Ampersand - Standalone","data":{"string":"---"},"expected":" ---\n","template":" {{&string}}\n","desc":"Standalone interpolation should not alter surrounding whitespace."},{"name":"Interpolation With Padding","data":{"string":"---"},"expected":"|---|","template":"|{{ string }}|","desc":"Superfluous in-tag whitespace should be ignored."},{"name":"Triple Mustache With Padding","data":{"string":"---"},"expected":"|---|","template":"|{{{ string }}}|","desc":"Superfluous in-tag whitespace should be ignored."},{"name":"Ampersand With Padding","data":{"string":"---"},"expected":"|---|","template":"|{{& string }}|","desc":"Superfluous in-tag whitespace should be ignored."}]} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/spec/specs/interpolation.yml b/static/build/node_modules/hogan.js/test/spec/specs/interpolation.yml deleted file mode 100644 index 2237b55f..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/interpolation.yml +++ /dev/null @@ -1,230 +0,0 @@ -overview: | - Interpolation tags are used to integrate dynamic content into the template. - - The tag's content MUST be a non-whitespace character sequence NOT containing - the current closing delimiter. - - This tag's content names the data to replace the tag. A single period (`.`) - indicates that the item currently sitting atop the context stack should be - used; otherwise, name resolution is as follows: - 1) Split the name on periods; the first part is the name to resolve, any - remaining parts should be retained. - 2) Walk the context stack from top to bottom, finding the first context - that is a) a hash containing the name as a key OR b) an object responding - to a method with the given name. - 3) If the context is a hash, the data is the value associated with the - name. - 4) If the context is an object, the data is the value returned by the - method with the given name. - 5) If any name parts were retained in step 1, each should be resolved - against a context stack containing only the result from the former - resolution. If any part fails resolution, the result should be considered - falsey, and should interpolate as the empty string. - Data should be coerced into a string (and escaped, if appropriate) before - interpolation. - - The Interpolation tags MUST NOT be treated as standalone. -tests: - - name: No Interpolation - desc: Mustache-free templates should render as-is. - data: { } - template: | - Hello from {Mustache}! - expected: | - Hello from {Mustache}! - - - name: Basic Interpolation - desc: Unadorned tags should interpolate content into the template. - data: { subject: "world" } - template: | - Hello, {{subject}}! - expected: | - Hello, world! - - - name: HTML Escaping - desc: Basic interpolation should be HTML escaped. - data: { forbidden: '& " < >' } - template: | - These characters should be HTML escaped: {{forbidden}} - expected: | - These characters should be HTML escaped: & " < > - - - name: Triple Mustache - desc: Triple mustaches should interpolate without HTML escaping. - data: { forbidden: '& " < >' } - template: | - These characters should not be HTML escaped: {{{forbidden}}} - expected: | - These characters should not be HTML escaped: & " < > - - - name: Ampersand - desc: Ampersand should interpolate without HTML escaping. - data: { forbidden: '& " < >' } - template: | - These characters should not be HTML escaped: {{&forbidden}} - expected: | - These characters should not be HTML escaped: & " < > - - - name: Basic Integer Interpolation - desc: Integers should interpolate seamlessly. - data: { mph: 85 } - template: '"{{mph}} miles an hour!"' - expected: '"85 miles an hour!"' - - - name: Triple Mustache Integer Interpolation - desc: Integers should interpolate seamlessly. - data: { mph: 85 } - template: '"{{{mph}}} miles an hour!"' - expected: '"85 miles an hour!"' - - - name: Ampersand Integer Interpolation - desc: Integers should interpolate seamlessly. - data: { mph: 85 } - template: '"{{&mph}} miles an hour!"' - expected: '"85 miles an hour!"' - - - name: Basic Decimal Interpolation - desc: Decimals should interpolate seamlessly with proper significance. - data: { power: 1.210 } - template: '"{{power}} jiggawatts!"' - expected: '"1.21 jiggawatts!"' - - - name: Triple Mustache Decimal Interpolation - desc: Decimals should interpolate seamlessly with proper significance. - data: { power: 1.210 } - template: '"{{{power}}} jiggawatts!"' - expected: '"1.21 jiggawatts!"' - - - name: Ampersand Decimal Interpolation - desc: Decimals should interpolate seamlessly with proper significance. - data: { power: 1.210 } - template: '"{{&power}} jiggawatts!"' - expected: '"1.21 jiggawatts!"' - - # Context Misses - - - name: Basic Context Miss Interpolation - desc: Failed context lookups should default to empty strings. - data: { } - template: "I ({{cannot}}) be seen!" - expected: "I () be seen!" - - - name: Triple Mustache Context Miss Interpolation - desc: Failed context lookups should default to empty strings. - data: { } - template: "I ({{{cannot}}}) be seen!" - expected: "I () be seen!" - - - name: Ampersand Context Miss Interpolation - desc: Failed context lookups should default to empty strings. - data: { } - template: "I ({{&cannot}}) be seen!" - expected: "I () be seen!" - - # Dotted Names - - - name: Dotted Names - Basic Interpolation - desc: Dotted names should be considered a form of shorthand for sections. - data: { person: { name: 'Joe' } } - template: '"{{person.name}}" == "{{#person}}{{name}}{{/person}}"' - expected: '"Joe" == "Joe"' - - - name: Dotted Names - Triple Mustache Interpolation - desc: Dotted names should be considered a form of shorthand for sections. - data: { person: { name: 'Joe' } } - template: '"{{{person.name}}}" == "{{#person}}{{{name}}}{{/person}}"' - expected: '"Joe" == "Joe"' - - - name: Dotted Names - Ampersand Interpolation - desc: Dotted names should be considered a form of shorthand for sections. - data: { person: { name: 'Joe' } } - template: '"{{&person.name}}" == "{{#person}}{{&name}}{{/person}}"' - expected: '"Joe" == "Joe"' - - - name: Dotted Names - Arbitrary Depth - desc: Dotted names should be functional to any level of nesting. - data: - a: { b: { c: { d: { e: { name: 'Phil' } } } } } - template: '"{{a.b.c.d.e.name}}" == "Phil"' - expected: '"Phil" == "Phil"' - - - name: Dotted Names - Broken Chains - desc: Any falsey value prior to the last part of the name should yield ''. - data: - a: { } - template: '"{{a.b.c}}" == ""' - expected: '"" == ""' - - - name: Dotted Names - Broken Chain Resolution - desc: Each part of a dotted name should resolve only against its parent. - data: - a: { b: { } } - c: { name: 'Jim' } - template: '"{{a.b.c.name}}" == ""' - expected: '"" == ""' - - - name: Dotted Names - Initial Resolution - desc: The first part of a dotted name should resolve as any other name. - data: - a: { b: { c: { d: { e: { name: 'Phil' } } } } } - b: { c: { d: { e: { name: 'Wrong' } } } } - template: '"{{#a}}{{b.c.d.e.name}}{{/a}}" == "Phil"' - expected: '"Phil" == "Phil"' - - # Whitespace Sensitivity - - - name: Interpolation - Surrounding Whitespace - desc: Interpolation should not alter surrounding whitespace. - data: { string: '---' } - template: '| {{string}} |' - expected: '| --- |' - - - name: Triple Mustache - Surrounding Whitespace - desc: Interpolation should not alter surrounding whitespace. - data: { string: '---' } - template: '| {{{string}}} |' - expected: '| --- |' - - - name: Ampersand - Surrounding Whitespace - desc: Interpolation should not alter surrounding whitespace. - data: { string: '---' } - template: '| {{&string}} |' - expected: '| --- |' - - - name: Interpolation - Standalone - desc: Standalone interpolation should not alter surrounding whitespace. - data: { string: '---' } - template: " {{string}}\n" - expected: " ---\n" - - - name: Triple Mustache - Standalone - desc: Standalone interpolation should not alter surrounding whitespace. - data: { string: '---' } - template: " {{{string}}}\n" - expected: " ---\n" - - - name: Ampersand - Standalone - desc: Standalone interpolation should not alter surrounding whitespace. - data: { string: '---' } - template: " {{&string}}\n" - expected: " ---\n" - - # Whitespace Insensitivity - - - name: Interpolation With Padding - desc: Superfluous in-tag whitespace should be ignored. - data: { string: "---" } - template: '|{{ string }}|' - expected: '|---|' - - - name: Triple Mustache With Padding - desc: Superfluous in-tag whitespace should be ignored. - data: { string: "---" } - template: '|{{{ string }}}|' - expected: '|---|' - - - name: Ampersand With Padding - desc: Superfluous in-tag whitespace should be ignored. - data: { string: "---" } - template: '|{{& string }}|' - expected: '|---|' diff --git a/static/build/node_modules/hogan.js/test/spec/specs/inverted.json b/static/build/node_modules/hogan.js/test/spec/specs/inverted.json deleted file mode 100644 index c9b550b9..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/inverted.json +++ /dev/null @@ -1 +0,0 @@ -{"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file.","overview":"Inverted Section tags and End Section tags are used in combination to wrap a\nsection of the template.\n\nThese tags' content MUST be a non-whitespace character sequence NOT\ncontaining the current closing delimiter; each Inverted Section tag MUST be\nfollowed by an End Section tag with the same content within the same\nsection.\n\nThis tag's content names the data to replace the tag. Name resolution is as\nfollows:\n 1) Split the name on periods; the first part is the name to resolve, any\n remaining parts should be retained.\n 2) Walk the context stack from top to bottom, finding the first context\n that is a) a hash containing the name as a key OR b) an object responding\n to a method with the given name.\n 3) If the context is a hash, the data is the value associated with the\n name.\n 4) If the context is an object and the method with the given name has an\n arity of 1, the method SHOULD be called with a String containing the\n unprocessed contents of the sections; the data is the value returned.\n 5) Otherwise, the data is the value returned by calling the method with\n the given name.\n 6) If any name parts were retained in step 1, each should be resolved\n against a context stack containing only the result from the former\n resolution. If any part fails resolution, the result should be considered\n falsey, and should interpolate as the empty string.\nIf the data is not of a list type, it is coerced into a list as follows: if\nthe data is truthy (e.g. `!!data == true`), use a single-element list\ncontaining the data, otherwise use an empty list.\n\nThis section MUST NOT be rendered unless the data list is empty.\n\nInverted Section and End Section tags SHOULD be treated as standalone when\nappropriate.\n","tests":[{"name":"Falsey","data":{"boolean":false},"expected":"\"This should be rendered.\"","template":"\"{{^boolean}}This should be rendered.{{/boolean}}\"","desc":"Falsey sections should have their contents rendered."},{"name":"Truthy","data":{"boolean":true},"expected":"\"\"","template":"\"{{^boolean}}This should not be rendered.{{/boolean}}\"","desc":"Truthy sections should have their contents omitted."},{"name":"Context","data":{"context":{"name":"Joe"}},"expected":"\"\"","template":"\"{{^context}}Hi {{name}}.{{/context}}\"","desc":"Objects and hashes should behave like truthy values."},{"name":"List","data":{"list":[{"n":1},{"n":2},{"n":3}]},"expected":"\"\"","template":"\"{{^list}}{{n}}{{/list}}\"","desc":"Lists should behave like truthy values."},{"name":"Empty List","data":{"list":[]},"expected":"\"Yay lists!\"","template":"\"{{^list}}Yay lists!{{/list}}\"","desc":"Empty lists should behave like falsey values."},{"name":"Doubled","data":{"two":"second","bool":false},"expected":"* first\n* second\n* third\n","template":"{{^bool}}\n* first\n{{/bool}}\n* {{two}}\n{{^bool}}\n* third\n{{/bool}}\n","desc":"Multiple inverted sections per template should be permitted."},{"name":"Nested (Falsey)","data":{"bool":false},"expected":"| A B C D E |","template":"| A {{^bool}}B {{^bool}}C{{/bool}} D{{/bool}} E |","desc":"Nested falsey sections should have their contents rendered."},{"name":"Nested (Truthy)","data":{"bool":true},"expected":"| A E |","template":"| A {{^bool}}B {{^bool}}C{{/bool}} D{{/bool}} E |","desc":"Nested truthy sections should be omitted."},{"name":"Context Misses","data":{},"expected":"[Cannot find key 'missing'!]","template":"[{{^missing}}Cannot find key 'missing'!{{/missing}}]","desc":"Failed context lookups should be considered falsey."},{"name":"Dotted Names - Truthy","data":{"a":{"b":{"c":true}}},"expected":"\"\" == \"\"","template":"\"{{^a.b.c}}Not Here{{/a.b.c}}\" == \"\"","desc":"Dotted names should be valid for Inverted Section tags."},{"name":"Dotted Names - Falsey","data":{"a":{"b":{"c":false}}},"expected":"\"Not Here\" == \"Not Here\"","template":"\"{{^a.b.c}}Not Here{{/a.b.c}}\" == \"Not Here\"","desc":"Dotted names should be valid for Inverted Section tags."},{"name":"Dotted Names - Broken Chains","data":{"a":{}},"expected":"\"Not Here\" == \"Not Here\"","template":"\"{{^a.b.c}}Not Here{{/a.b.c}}\" == \"Not Here\"","desc":"Dotted names that cannot be resolved should be considered falsey."},{"name":"Surrounding Whitespace","data":{"boolean":false},"expected":" | \t|\t | \n","template":" | {{^boolean}}\t|\t{{/boolean}} | \n","desc":"Inverted sections should not alter surrounding whitespace."},{"name":"Internal Whitespace","data":{"boolean":false},"expected":" | \n | \n","template":" | {{^boolean}} {{! Important Whitespace }}\n {{/boolean}} | \n","desc":"Inverted should not alter internal whitespace."},{"name":"Indented Inline Sections","data":{"boolean":false},"expected":" NO\n WAY\n","template":" {{^boolean}}NO{{/boolean}}\n {{^boolean}}WAY{{/boolean}}\n","desc":"Single-line sections should not alter surrounding whitespace."},{"name":"Standalone Lines","data":{"boolean":false},"expected":"| This Is\n|\n| A Line\n","template":"| This Is\n{{^boolean}}\n|\n{{/boolean}}\n| A Line\n","desc":"Standalone lines should be removed from the template."},{"name":"Standalone Indented Lines","data":{"boolean":false},"expected":"| This Is\n|\n| A Line\n","template":"| This Is\n {{^boolean}}\n|\n {{/boolean}}\n| A Line\n","desc":"Standalone indented lines should be removed from the template."},{"name":"Standalone Line Endings","data":{"boolean":false},"expected":"|\r\n|","template":"|\r\n{{^boolean}}\r\n{{/boolean}}\r\n|","desc":"\"\\r\\n\" should be considered a newline for standalone tags."},{"name":"Standalone Without Previous Line","data":{"boolean":false},"expected":"^\n/","template":" {{^boolean}}\n^{{/boolean}}\n/","desc":"Standalone tags should not require a newline to precede them."},{"name":"Standalone Without Newline","data":{"boolean":false},"expected":"^\n/\n","template":"^{{^boolean}}\n/\n {{/boolean}}","desc":"Standalone tags should not require a newline to follow them."},{"name":"Padding","data":{"boolean":false},"expected":"|=|","template":"|{{^ boolean }}={{/ boolean }}|","desc":"Superfluous in-tag whitespace should be ignored."}]} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/spec/specs/inverted.yml b/static/build/node_modules/hogan.js/test/spec/specs/inverted.yml deleted file mode 100644 index 5f8e2b2f..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/inverted.yml +++ /dev/null @@ -1,193 +0,0 @@ -overview: | - Inverted Section tags and End Section tags are used in combination to wrap a - section of the template. - - These tags' content MUST be a non-whitespace character sequence NOT - containing the current closing delimiter; each Inverted Section tag MUST be - followed by an End Section tag with the same content within the same - section. - - This tag's content names the data to replace the tag. Name resolution is as - follows: - 1) Split the name on periods; the first part is the name to resolve, any - remaining parts should be retained. - 2) Walk the context stack from top to bottom, finding the first context - that is a) a hash containing the name as a key OR b) an object responding - to a method with the given name. - 3) If the context is a hash, the data is the value associated with the - name. - 4) If the context is an object and the method with the given name has an - arity of 1, the method SHOULD be called with a String containing the - unprocessed contents of the sections; the data is the value returned. - 5) Otherwise, the data is the value returned by calling the method with - the given name. - 6) If any name parts were retained in step 1, each should be resolved - against a context stack containing only the result from the former - resolution. If any part fails resolution, the result should be considered - falsey, and should interpolate as the empty string. - If the data is not of a list type, it is coerced into a list as follows: if - the data is truthy (e.g. `!!data == true`), use a single-element list - containing the data, otherwise use an empty list. - - This section MUST NOT be rendered unless the data list is empty. - - Inverted Section and End Section tags SHOULD be treated as standalone when - appropriate. -tests: - - name: Falsey - desc: Falsey sections should have their contents rendered. - data: { boolean: false } - template: '"{{^boolean}}This should be rendered.{{/boolean}}"' - expected: '"This should be rendered."' - - - name: Truthy - desc: Truthy sections should have their contents omitted. - data: { boolean: true } - template: '"{{^boolean}}This should not be rendered.{{/boolean}}"' - expected: '""' - - - name: Context - desc: Objects and hashes should behave like truthy values. - data: { context: { name: 'Joe' } } - template: '"{{^context}}Hi {{name}}.{{/context}}"' - expected: '""' - - - name: List - desc: Lists should behave like truthy values. - data: { list: [ { n: 1 }, { n: 2 }, { n: 3 } ] } - template: '"{{^list}}{{n}}{{/list}}"' - expected: '""' - - - name: Empty List - desc: Empty lists should behave like falsey values. - data: { list: [ ] } - template: '"{{^list}}Yay lists!{{/list}}"' - expected: '"Yay lists!"' - - - name: Doubled - desc: Multiple inverted sections per template should be permitted. - data: { bool: false, two: 'second' } - template: | - {{^bool}} - * first - {{/bool}} - * {{two}} - {{^bool}} - * third - {{/bool}} - expected: | - * first - * second - * third - - - name: Nested (Falsey) - desc: Nested falsey sections should have their contents rendered. - data: { bool: false } - template: "| A {{^bool}}B {{^bool}}C{{/bool}} D{{/bool}} E |" - expected: "| A B C D E |" - - - name: Nested (Truthy) - desc: Nested truthy sections should be omitted. - data: { bool: true } - template: "| A {{^bool}}B {{^bool}}C{{/bool}} D{{/bool}} E |" - expected: "| A E |" - - - name: Context Misses - desc: Failed context lookups should be considered falsey. - data: { } - template: "[{{^missing}}Cannot find key 'missing'!{{/missing}}]" - expected: "[Cannot find key 'missing'!]" - - # Dotted Names - - - name: Dotted Names - Truthy - desc: Dotted names should be valid for Inverted Section tags. - data: { a: { b: { c: true } } } - template: '"{{^a.b.c}}Not Here{{/a.b.c}}" == ""' - expected: '"" == ""' - - - name: Dotted Names - Falsey - desc: Dotted names should be valid for Inverted Section tags. - data: { a: { b: { c: false } } } - template: '"{{^a.b.c}}Not Here{{/a.b.c}}" == "Not Here"' - expected: '"Not Here" == "Not Here"' - - - name: Dotted Names - Broken Chains - desc: Dotted names that cannot be resolved should be considered falsey. - data: { a: { } } - template: '"{{^a.b.c}}Not Here{{/a.b.c}}" == "Not Here"' - expected: '"Not Here" == "Not Here"' - - # Whitespace Sensitivity - - - name: Surrounding Whitespace - desc: Inverted sections should not alter surrounding whitespace. - data: { boolean: false } - template: " | {{^boolean}}\t|\t{{/boolean}} | \n" - expected: " | \t|\t | \n" - - - name: Internal Whitespace - desc: Inverted should not alter internal whitespace. - data: { boolean: false } - template: " | {{^boolean}} {{! Important Whitespace }}\n {{/boolean}} | \n" - expected: " | \n | \n" - - - name: Indented Inline Sections - desc: Single-line sections should not alter surrounding whitespace. - data: { boolean: false } - template: " {{^boolean}}NO{{/boolean}}\n {{^boolean}}WAY{{/boolean}}\n" - expected: " NO\n WAY\n" - - - name: Standalone Lines - desc: Standalone lines should be removed from the template. - data: { boolean: false } - template: | - | This Is - {{^boolean}} - | - {{/boolean}} - | A Line - expected: | - | This Is - | - | A Line - - - name: Standalone Indented Lines - desc: Standalone indented lines should be removed from the template. - data: { boolean: false } - template: | - | This Is - {{^boolean}} - | - {{/boolean}} - | A Line - expected: | - | This Is - | - | A Line - - - name: Standalone Line Endings - desc: '"\r\n" should be considered a newline for standalone tags.' - data: { boolean: false } - template: "|\r\n{{^boolean}}\r\n{{/boolean}}\r\n|" - expected: "|\r\n|" - - - name: Standalone Without Previous Line - desc: Standalone tags should not require a newline to precede them. - data: { boolean: false } - template: " {{^boolean}}\n^{{/boolean}}\n/" - expected: "^\n/" - - - name: Standalone Without Newline - desc: Standalone tags should not require a newline to follow them. - data: { boolean: false } - template: "^{{^boolean}}\n/\n {{/boolean}}" - expected: "^\n/\n" - - # Whitespace Insensitivity - - - name: Padding - desc: Superfluous in-tag whitespace should be ignored. - data: { boolean: false } - template: '|{{^ boolean }}={{/ boolean }}|' - expected: '|=|' diff --git a/static/build/node_modules/hogan.js/test/spec/specs/partials.json b/static/build/node_modules/hogan.js/test/spec/specs/partials.json deleted file mode 100644 index e5f21a2a..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/partials.json +++ /dev/null @@ -1 +0,0 @@ -{"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file.","overview":"Partial tags are used to expand an external template into the current\ntemplate.\n\nThe tag's content MUST be a non-whitespace character sequence NOT containing\nthe current closing delimiter.\n\nThis tag's content names the partial to inject. Set Delimiter tags MUST NOT\naffect the parsing of a partial. The partial MUST be rendered against the\ncontext stack local to the tag. If the named partial cannot be found, the\nempty string SHOULD be used instead, as in interpolations.\n\nPartial tags SHOULD be treated as standalone when appropriate. If this tag\nis used standalone, any whitespace preceding the tag should treated as\nindentation, and prepended to each line of the partial before rendering.\n","tests":[{"name":"Basic Behavior","data":{},"expected":"\"from partial\"","template":"\"{{>text}}\"","desc":"The greater-than operator should expand to the named partial.","partials":{"text":"from partial"}},{"name":"Failed Lookup","data":{},"expected":"\"\"","template":"\"{{>text}}\"","desc":"The empty string should be used when the named partial is not found.","partials":{}},{"name":"Context","data":{"text":"content"},"expected":"\"*content*\"","template":"\"{{>partial}}\"","desc":"The greater-than operator should operate within the current context.","partials":{"partial":"*{{text}}*"}},{"name":"Recursion","data":{"content":"X","nodes":[{"content":"Y","nodes":[]}]},"expected":"X>","template":"{{>node}}","desc":"The greater-than operator should properly recurse.","partials":{"node":"{{content}}<{{#nodes}}{{>node}}{{/nodes}}>"}},{"name":"Surrounding Whitespace","data":{},"expected":"| \t|\t |","template":"| {{>partial}} |","desc":"The greater-than operator should not alter surrounding whitespace.","partials":{"partial":"\t|\t"}},{"name":"Inline Indentation","data":{"data":"|"},"expected":" | >\n>\n","template":" {{data}} {{> partial}}\n","desc":"Whitespace should be left untouched.","partials":{"partial":">\n>"}},{"name":"Standalone Line Endings","data":{},"expected":"|\r\n>|","template":"|\r\n{{>partial}}\r\n|","desc":"\"\\r\\n\" should be considered a newline for standalone tags.","partials":{"partial":">"}},{"name":"Standalone Without Previous Line","data":{},"expected":" >\n >>","template":" {{>partial}}\n>","desc":"Standalone tags should not require a newline to precede them.","partials":{"partial":">\n>"}},{"name":"Standalone Without Newline","data":{},"expected":">\n >\n >","template":">\n {{>partial}}","desc":"Standalone tags should not require a newline to follow them.","partials":{"partial":">\n>"}},{"name":"Standalone Indentation","data":{"content":"<\n->"},"expected":"\\\n |\n <\n->\n |\n/\n","template":"\\\n {{>partial}}\n/\n","desc":"Each line of the partial should be indented before rendering.","partials":{"partial":"|\n{{{content}}}\n|\n"}},{"name":"Padding Whitespace","data":{"boolean":true},"expected":"|[]|","template":"|{{> partial }}|","desc":"Superfluous in-tag whitespace should be ignored.","partials":{"partial":"[]"}}]} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/spec/specs/partials.yml b/static/build/node_modules/hogan.js/test/spec/specs/partials.yml deleted file mode 100644 index 8c415439..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/partials.yml +++ /dev/null @@ -1,109 +0,0 @@ -overview: | - Partial tags are used to expand an external template into the current - template. - - The tag's content MUST be a non-whitespace character sequence NOT containing - the current closing delimiter. - - This tag's content names the partial to inject. Set Delimiter tags MUST NOT - affect the parsing of a partial. The partial MUST be rendered against the - context stack local to the tag. If the named partial cannot be found, the - empty string SHOULD be used instead, as in interpolations. - - Partial tags SHOULD be treated as standalone when appropriate. If this tag - is used standalone, any whitespace preceding the tag should treated as - indentation, and prepended to each line of the partial before rendering. -tests: - - name: Basic Behavior - desc: The greater-than operator should expand to the named partial. - data: { } - template: '"{{>text}}"' - partials: { text: 'from partial' } - expected: '"from partial"' - - - name: Failed Lookup - desc: The empty string should be used when the named partial is not found. - data: { } - template: '"{{>text}}"' - partials: { } - expected: '""' - - - name: Context - desc: The greater-than operator should operate within the current context. - data: { text: 'content' } - template: '"{{>partial}}"' - partials: { partial: '*{{text}}*' } - expected: '"*content*"' - - - name: Recursion - desc: The greater-than operator should properly recurse. - data: { content: "X", nodes: [ { content: "Y", nodes: [] } ] } - template: '{{>node}}' - partials: { node: '{{content}}<{{#nodes}}{{>node}}{{/nodes}}>' } - expected: 'X>' - - # Whitespace Sensitivity - - - name: Surrounding Whitespace - desc: The greater-than operator should not alter surrounding whitespace. - data: { } - template: '| {{>partial}} |' - partials: { partial: "\t|\t" } - expected: "| \t|\t |" - - - name: Inline Indentation - desc: Whitespace should be left untouched. - data: { data: '|' } - template: " {{data}} {{> partial}}\n" - partials: { partial: ">\n>" } - expected: " | >\n>\n" - - - name: Standalone Line Endings - desc: '"\r\n" should be considered a newline for standalone tags.' - data: { } - template: "|\r\n{{>partial}}\r\n|" - partials: { partial: ">" } - expected: "|\r\n>|" - - - name: Standalone Without Previous Line - desc: Standalone tags should not require a newline to precede them. - data: { } - template: " {{>partial}}\n>" - partials: { partial: ">\n>"} - expected: " >\n >>" - - - name: Standalone Without Newline - desc: Standalone tags should not require a newline to follow them. - data: { } - template: ">\n {{>partial}}" - partials: { partial: ">\n>" } - expected: ">\n >\n >" - - - name: Standalone Indentation - desc: Each line of the partial should be indented before rendering. - data: { content: "<\n->" } - template: | - \ - {{>partial}} - / - partials: - partial: | - | - {{{content}}} - | - expected: | - \ - | - < - -> - | - / - - # Whitespace Insensitivity - - - name: Padding Whitespace - desc: Superfluous in-tag whitespace should be ignored. - data: { boolean: true } - template: "|{{> partial }}|" - partials: { partial: "[]" } - expected: '|[]|' diff --git a/static/build/node_modules/hogan.js/test/spec/specs/sections.json b/static/build/node_modules/hogan.js/test/spec/specs/sections.json deleted file mode 100644 index b0aa352e..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/sections.json +++ /dev/null @@ -1 +0,0 @@ -{"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file.","overview":"Section tags and End Section tags are used in combination to wrap a section\nof the template for iteration\n\nThese tags' content MUST be a non-whitespace character sequence NOT\ncontaining the current closing delimiter; each Section tag MUST be followed\nby an End Section tag with the same content within the same section.\n\nThis tag's content names the data to replace the tag. Name resolution is as\nfollows:\n 1) Split the name on periods; the first part is the name to resolve, any\n remaining parts should be retained.\n 2) Walk the context stack from top to bottom, finding the first context\n that is a) a hash containing the name as a key OR b) an object responding\n to a method with the given name.\n 3) If the context is a hash, the data is the value associated with the\n name.\n 4) If the context is an object and the method with the given name has an\n arity of 1, the method SHOULD be called with a String containing the\n unprocessed contents of the sections; the data is the value returned.\n 5) Otherwise, the data is the value returned by calling the method with\n the given name.\n 6) If any name parts were retained in step 1, each should be resolved\n against a context stack containing only the result from the former\n resolution. If any part fails resolution, the result should be considered\n falsey, and should interpolate as the empty string.\nIf the data is not of a list type, it is coerced into a list as follows: if\nthe data is truthy (e.g. `!!data == true`), use a single-element list\ncontaining the data, otherwise use an empty list.\n\nFor each element in the data list, the element MUST be pushed onto the\ncontext stack, the section MUST be rendered, and the element MUST be popped\noff the context stack.\n\nSection and End Section tags SHOULD be treated as standalone when\nappropriate.\n","tests":[{"name":"Truthy","data":{"boolean":true},"expected":"\"This should be rendered.\"","template":"\"{{#boolean}}This should be rendered.{{/boolean}}\"","desc":"Truthy sections should have their contents rendered."},{"name":"Falsey","data":{"boolean":false},"expected":"\"\"","template":"\"{{#boolean}}This should not be rendered.{{/boolean}}\"","desc":"Falsey sections should have their contents omitted."},{"name":"Context","data":{"context":{"name":"Joe"}},"expected":"\"Hi Joe.\"","template":"\"{{#context}}Hi {{name}}.{{/context}}\"","desc":"Objects and hashes should be pushed onto the context stack."},{"name":"Deeply Nested Contexts","data":{"a":{"one":1},"b":{"two":2},"c":{"three":3},"d":{"four":4},"e":{"five":5}},"expected":"1\n121\n12321\n1234321\n123454321\n1234321\n12321\n121\n1\n","template":"{{#a}}\n{{one}}\n{{#b}}\n{{one}}{{two}}{{one}}\n{{#c}}\n{{one}}{{two}}{{three}}{{two}}{{one}}\n{{#d}}\n{{one}}{{two}}{{three}}{{four}}{{three}}{{two}}{{one}}\n{{#e}}\n{{one}}{{two}}{{three}}{{four}}{{five}}{{four}}{{three}}{{two}}{{one}}\n{{/e}}\n{{one}}{{two}}{{three}}{{four}}{{three}}{{two}}{{one}}\n{{/d}}\n{{one}}{{two}}{{three}}{{two}}{{one}}\n{{/c}}\n{{one}}{{two}}{{one}}\n{{/b}}\n{{one}}\n{{/a}}\n","desc":"All elements on the context stack should be accessible."},{"name":"List","data":{"list":[{"item":1},{"item":2},{"item":3}]},"expected":"\"123\"","template":"\"{{#list}}{{item}}{{/list}}\"","desc":"Lists should be iterated; list items should visit the context stack."},{"name":"Empty List","data":{"list":[]},"expected":"\"\"","template":"\"{{#list}}Yay lists!{{/list}}\"","desc":"Empty lists should behave like falsey values."},{"name":"Doubled","data":{"two":"second","bool":true},"expected":"* first\n* second\n* third\n","template":"{{#bool}}\n* first\n{{/bool}}\n* {{two}}\n{{#bool}}\n* third\n{{/bool}}\n","desc":"Multiple sections per template should be permitted."},{"name":"Nested (Truthy)","data":{"bool":true},"expected":"| A B C D E |","template":"| A {{#bool}}B {{#bool}}C{{/bool}} D{{/bool}} E |","desc":"Nested truthy sections should have their contents rendered."},{"name":"Nested (Falsey)","data":{"bool":false},"expected":"| A E |","template":"| A {{#bool}}B {{#bool}}C{{/bool}} D{{/bool}} E |","desc":"Nested falsey sections should be omitted."},{"name":"Context Misses","data":{},"expected":"[]","template":"[{{#missing}}Found key 'missing'!{{/missing}}]","desc":"Failed context lookups should be considered falsey."},{"name":"Implicit Iterator - String","data":{"list":["a","b","c","d","e"]},"expected":"\"(a)(b)(c)(d)(e)\"","template":"\"{{#list}}({{.}}){{/list}}\"","desc":"Implicit iterators should directly interpolate strings."},{"name":"Implicit Iterator - Integer","data":{"list":[1,2,3,4,5]},"expected":"\"(1)(2)(3)(4)(5)\"","template":"\"{{#list}}({{.}}){{/list}}\"","desc":"Implicit iterators should cast integers to strings and interpolate."},{"name":"Implicit Iterator - Decimal","data":{"list":[1.1,2.2,3.3,4.4,5.5]},"expected":"\"(1.1)(2.2)(3.3)(4.4)(5.5)\"","template":"\"{{#list}}({{.}}){{/list}}\"","desc":"Implicit iterators should cast decimals to strings and interpolate."},{"name":"Dotted Names - Truthy","data":{"a":{"b":{"c":true}}},"expected":"\"Here\" == \"Here\"","template":"\"{{#a.b.c}}Here{{/a.b.c}}\" == \"Here\"","desc":"Dotted names should be valid for Section tags."},{"name":"Dotted Names - Falsey","data":{"a":{"b":{"c":false}}},"expected":"\"\" == \"\"","template":"\"{{#a.b.c}}Here{{/a.b.c}}\" == \"\"","desc":"Dotted names should be valid for Section tags."},{"name":"Dotted Names - Broken Chains","data":{"a":{}},"expected":"\"\" == \"\"","template":"\"{{#a.b.c}}Here{{/a.b.c}}\" == \"\"","desc":"Dotted names that cannot be resolved should be considered falsey."},{"name":"Surrounding Whitespace","data":{"boolean":true},"expected":" | \t|\t | \n","template":" | {{#boolean}}\t|\t{{/boolean}} | \n","desc":"Sections should not alter surrounding whitespace."},{"name":"Internal Whitespace","data":{"boolean":true},"expected":" | \n | \n","template":" | {{#boolean}} {{! Important Whitespace }}\n {{/boolean}} | \n","desc":"Sections should not alter internal whitespace."},{"name":"Indented Inline Sections","data":{"boolean":true},"expected":" YES\n GOOD\n","template":" {{#boolean}}YES{{/boolean}}\n {{#boolean}}GOOD{{/boolean}}\n","desc":"Single-line sections should not alter surrounding whitespace."},{"name":"Standalone Lines","data":{"boolean":true},"expected":"| This Is\n|\n| A Line\n","template":"| This Is\n{{#boolean}}\n|\n{{/boolean}}\n| A Line\n","desc":"Standalone lines should be removed from the template."},{"name":"Indented Standalone Lines","data":{"boolean":true},"expected":"| This Is\n|\n| A Line\n","template":"| This Is\n {{#boolean}}\n|\n {{/boolean}}\n| A Line\n","desc":"Indented standalone lines should be removed from the template."},{"name":"Standalone Line Endings","data":{"boolean":true},"expected":"|\r\n|","template":"|\r\n{{#boolean}}\r\n{{/boolean}}\r\n|","desc":"\"\\r\\n\" should be considered a newline for standalone tags."},{"name":"Standalone Without Previous Line","data":{"boolean":true},"expected":"#\n/","template":" {{#boolean}}\n#{{/boolean}}\n/","desc":"Standalone tags should not require a newline to precede them."},{"name":"Standalone Without Newline","data":{"boolean":true},"expected":"#\n/\n","template":"#{{#boolean}}\n/\n {{/boolean}}","desc":"Standalone tags should not require a newline to follow them."},{"name":"Padding","data":{"boolean":true},"expected":"|=|","template":"|{{# boolean }}={{/ boolean }}|","desc":"Superfluous in-tag whitespace should be ignored."}]} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/spec/specs/sections.yml b/static/build/node_modules/hogan.js/test/spec/specs/sections.yml deleted file mode 100644 index f62d9cb3..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/sections.yml +++ /dev/null @@ -1,256 +0,0 @@ -overview: | - Section tags and End Section tags are used in combination to wrap a section - of the template for iteration - - These tags' content MUST be a non-whitespace character sequence NOT - containing the current closing delimiter; each Section tag MUST be followed - by an End Section tag with the same content within the same section. - - This tag's content names the data to replace the tag. Name resolution is as - follows: - 1) Split the name on periods; the first part is the name to resolve, any - remaining parts should be retained. - 2) Walk the context stack from top to bottom, finding the first context - that is a) a hash containing the name as a key OR b) an object responding - to a method with the given name. - 3) If the context is a hash, the data is the value associated with the - name. - 4) If the context is an object and the method with the given name has an - arity of 1, the method SHOULD be called with a String containing the - unprocessed contents of the sections; the data is the value returned. - 5) Otherwise, the data is the value returned by calling the method with - the given name. - 6) If any name parts were retained in step 1, each should be resolved - against a context stack containing only the result from the former - resolution. If any part fails resolution, the result should be considered - falsey, and should interpolate as the empty string. - If the data is not of a list type, it is coerced into a list as follows: if - the data is truthy (e.g. `!!data == true`), use a single-element list - containing the data, otherwise use an empty list. - - For each element in the data list, the element MUST be pushed onto the - context stack, the section MUST be rendered, and the element MUST be popped - off the context stack. - - Section and End Section tags SHOULD be treated as standalone when - appropriate. -tests: - - name: Truthy - desc: Truthy sections should have their contents rendered. - data: { boolean: true } - template: '"{{#boolean}}This should be rendered.{{/boolean}}"' - expected: '"This should be rendered."' - - - name: Falsey - desc: Falsey sections should have their contents omitted. - data: { boolean: false } - template: '"{{#boolean}}This should not be rendered.{{/boolean}}"' - expected: '""' - - - name: Context - desc: Objects and hashes should be pushed onto the context stack. - data: { context: { name: 'Joe' } } - template: '"{{#context}}Hi {{name}}.{{/context}}"' - expected: '"Hi Joe."' - - - name: Deeply Nested Contexts - desc: All elements on the context stack should be accessible. - data: - a: { one: 1 } - b: { two: 2 } - c: { three: 3 } - d: { four: 4 } - e: { five: 5 } - template: | - {{#a}} - {{one}} - {{#b}} - {{one}}{{two}}{{one}} - {{#c}} - {{one}}{{two}}{{three}}{{two}}{{one}} - {{#d}} - {{one}}{{two}}{{three}}{{four}}{{three}}{{two}}{{one}} - {{#e}} - {{one}}{{two}}{{three}}{{four}}{{five}}{{four}}{{three}}{{two}}{{one}} - {{/e}} - {{one}}{{two}}{{three}}{{four}}{{three}}{{two}}{{one}} - {{/d}} - {{one}}{{two}}{{three}}{{two}}{{one}} - {{/c}} - {{one}}{{two}}{{one}} - {{/b}} - {{one}} - {{/a}} - expected: | - 1 - 121 - 12321 - 1234321 - 123454321 - 1234321 - 12321 - 121 - 1 - - - name: List - desc: Lists should be iterated; list items should visit the context stack. - data: { list: [ { item: 1 }, { item: 2 }, { item: 3 } ] } - template: '"{{#list}}{{item}}{{/list}}"' - expected: '"123"' - - - name: Empty List - desc: Empty lists should behave like falsey values. - data: { list: [ ] } - template: '"{{#list}}Yay lists!{{/list}}"' - expected: '""' - - - name: Doubled - desc: Multiple sections per template should be permitted. - data: { bool: true, two: 'second' } - template: | - {{#bool}} - * first - {{/bool}} - * {{two}} - {{#bool}} - * third - {{/bool}} - expected: | - * first - * second - * third - - - name: Nested (Truthy) - desc: Nested truthy sections should have their contents rendered. - data: { bool: true } - template: "| A {{#bool}}B {{#bool}}C{{/bool}} D{{/bool}} E |" - expected: "| A B C D E |" - - - name: Nested (Falsey) - desc: Nested falsey sections should be omitted. - data: { bool: false } - template: "| A {{#bool}}B {{#bool}}C{{/bool}} D{{/bool}} E |" - expected: "| A E |" - - - name: Context Misses - desc: Failed context lookups should be considered falsey. - data: { } - template: "[{{#missing}}Found key 'missing'!{{/missing}}]" - expected: "[]" - - # Implicit Iterators - - - name: Implicit Iterator - String - desc: Implicit iterators should directly interpolate strings. - data: - list: [ 'a', 'b', 'c', 'd', 'e' ] - template: '"{{#list}}({{.}}){{/list}}"' - expected: '"(a)(b)(c)(d)(e)"' - - - name: Implicit Iterator - Integer - desc: Implicit iterators should cast integers to strings and interpolate. - data: - list: [ 1, 2, 3, 4, 5 ] - template: '"{{#list}}({{.}}){{/list}}"' - expected: '"(1)(2)(3)(4)(5)"' - - - name: Implicit Iterator - Decimal - desc: Implicit iterators should cast decimals to strings and interpolate. - data: - list: [ 1.10, 2.20, 3.30, 4.40, 5.50 ] - template: '"{{#list}}({{.}}){{/list}}"' - expected: '"(1.1)(2.2)(3.3)(4.4)(5.5)"' - - # Dotted Names - - - name: Dotted Names - Truthy - desc: Dotted names should be valid for Section tags. - data: { a: { b: { c: true } } } - template: '"{{#a.b.c}}Here{{/a.b.c}}" == "Here"' - expected: '"Here" == "Here"' - - - name: Dotted Names - Falsey - desc: Dotted names should be valid for Section tags. - data: { a: { b: { c: false } } } - template: '"{{#a.b.c}}Here{{/a.b.c}}" == ""' - expected: '"" == ""' - - - name: Dotted Names - Broken Chains - desc: Dotted names that cannot be resolved should be considered falsey. - data: { a: { } } - template: '"{{#a.b.c}}Here{{/a.b.c}}" == ""' - expected: '"" == ""' - - # Whitespace Sensitivity - - - name: Surrounding Whitespace - desc: Sections should not alter surrounding whitespace. - data: { boolean: true } - template: " | {{#boolean}}\t|\t{{/boolean}} | \n" - expected: " | \t|\t | \n" - - - name: Internal Whitespace - desc: Sections should not alter internal whitespace. - data: { boolean: true } - template: " | {{#boolean}} {{! Important Whitespace }}\n {{/boolean}} | \n" - expected: " | \n | \n" - - - name: Indented Inline Sections - desc: Single-line sections should not alter surrounding whitespace. - data: { boolean: true } - template: " {{#boolean}}YES{{/boolean}}\n {{#boolean}}GOOD{{/boolean}}\n" - expected: " YES\n GOOD\n" - - - name: Standalone Lines - desc: Standalone lines should be removed from the template. - data: { boolean: true } - template: | - | This Is - {{#boolean}} - | - {{/boolean}} - | A Line - expected: | - | This Is - | - | A Line - - - name: Indented Standalone Lines - desc: Indented standalone lines should be removed from the template. - data: { boolean: true } - template: | - | This Is - {{#boolean}} - | - {{/boolean}} - | A Line - expected: | - | This Is - | - | A Line - - - name: Standalone Line Endings - desc: '"\r\n" should be considered a newline for standalone tags.' - data: { boolean: true } - template: "|\r\n{{#boolean}}\r\n{{/boolean}}\r\n|" - expected: "|\r\n|" - - - name: Standalone Without Previous Line - desc: Standalone tags should not require a newline to precede them. - data: { boolean: true } - template: " {{#boolean}}\n#{{/boolean}}\n/" - expected: "#\n/" - - - name: Standalone Without Newline - desc: Standalone tags should not require a newline to follow them. - data: { boolean: true } - template: "#{{#boolean}}\n/\n {{/boolean}}" - expected: "#\n/\n" - - # Whitespace Insensitivity - - - name: Padding - desc: Superfluous in-tag whitespace should be ignored. - data: { boolean: true } - template: '|{{# boolean }}={{/ boolean }}|' - expected: '|=|' diff --git a/static/build/node_modules/hogan.js/test/spec/specs/~lambdas.json b/static/build/node_modules/hogan.js/test/spec/specs/~lambdas.json deleted file mode 100644 index 3c58bf85..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/~lambdas.json +++ /dev/null @@ -1 +0,0 @@ -{"__ATTN__":"Do not edit this file; changes belong in the appropriate YAML file.","overview":"Lambdas are a special-cased data type for use in interpolations and\nsections.\n\nWhen used as the data value for an Interpolation tag, the lambda MUST be\ntreatable as an arity 0 function, and invoked as such. The returned value\nMUST be rendered against the default delimiters, then interpolated in place\nof the lambda.\n\nWhen used as the data value for a Section tag, the lambda MUST be treatable\nas an arity 1 function, and invoked as such (passing a String containing the\nunprocessed section contents). The returned value MUST be rendered against\nthe current delimiters, then interpolated in place of the section.\n","tests":[{"name":"Interpolation","data":{"lambda":{"php":"return \"world\";","clojure":"(fn [] \"world\")","__tag__":"code","perl":"sub { \"world\" }","python":"lambda: \"world\"","ruby":"proc { \"world\" }","js":"function() { return \"world\" }"}},"expected":"Hello, world!","template":"Hello, {{lambda}}!","desc":"A lambda's return value should be interpolated."},{"name":"Interpolation - Expansion","data":{"planet":"world","lambda":{"php":"return \"{{planet}}\";","clojure":"(fn [] \"{{planet}}\")","__tag__":"code","perl":"sub { \"{{planet}}\" }","python":"lambda: \"{{planet}}\"","ruby":"proc { \"{{planet}}\" }","js":"function() { return \"{{planet}}\" }"}},"expected":"Hello, world!","template":"Hello, {{lambda}}!","desc":"A lambda's return value should be parsed."},{"name":"Interpolation - Alternate Delimiters","data":{"planet":"world","lambda":{"php":"return \"|planet| => {{planet}}\";","clojure":"(fn [] \"|planet| => {{planet}}\")","__tag__":"code","perl":"sub { \"|planet| => {{planet}}\" }","python":"lambda: \"|planet| => {{planet}}\"","ruby":"proc { \"|planet| => {{planet}}\" }","js":"function() { return \"|planet| => {{planet}}\" }"}},"expected":"Hello, (|planet| => world)!","template":"{{= | | =}}\nHello, (|&lambda|)!","desc":"A lambda's return value should parse with the default delimiters."},{"name":"Interpolation - Multiple Calls","data":{"lambda":{"php":"global $calls; return ++$calls;","clojure":"(def g (atom 0)) (fn [] (swap! g inc))","__tag__":"code","perl":"sub { no strict; $calls += 1 }","python":"lambda: globals().update(calls=globals().get(\"calls\",0)+1) or calls","ruby":"proc { $calls ||= 0; $calls += 1 }","js":"function() { return (g=(function(){return this})()).calls=(g.calls||0)+1 }"}},"expected":"1 == 2 == 3","template":"{{lambda}} == {{{lambda}}} == {{lambda}}","desc":"Interpolated lambdas should not be cached."},{"name":"Escaping","data":{"lambda":{"php":"return \">\";","clojure":"(fn [] \">\")","__tag__":"code","perl":"sub { \">\" }","python":"lambda: \">\"","ruby":"proc { \">\" }","js":"function() { return \">\" }"}},"expected":"<>>","template":"<{{lambda}}{{{lambda}}}","desc":"Lambda results should be appropriately escaped."},{"name":"Section","data":{"x":"Error!","lambda":{"php":"return ($text == \"{{x}}\") ? \"yes\" : \"no\";","clojure":"(fn [text] (if (= text \"{{x}}\") \"yes\" \"no\"))","__tag__":"code","perl":"sub { $_[0] eq \"{{x}}\" ? \"yes\" : \"no\" }","python":"lambda text: text == \"{{x}}\" and \"yes\" or \"no\"","ruby":"proc { |text| text == \"{{x}}\" ? \"yes\" : \"no\" }","js":"function(txt) { return (txt == \"{{x}}\" ? \"yes\" : \"no\") }"}},"expected":"","template":"<{{#lambda}}{{x}}{{/lambda}}>","desc":"Lambdas used for sections should receive the raw section string."},{"name":"Section - Expansion","data":{"planet":"Earth","lambda":{"php":"return $text . \"{{planet}}\" . $text;","clojure":"(fn [text] (str text \"{{planet}}\" text))","__tag__":"code","perl":"sub { $_[0] . \"{{planet}}\" . $_[0] }","python":"lambda text: \"%s{{planet}}%s\" % (text, text)","ruby":"proc { |text| \"#{text}{{planet}}#{text}\" }","js":"function(txt) { return txt + \"{{planet}}\" + txt }"}},"expected":"<-Earth->","template":"<{{#lambda}}-{{/lambda}}>","desc":"Lambdas used for sections should have their results parsed."},{"name":"Section - Alternate Delimiters","data":{"planet":"Earth","lambda":{"php":"return $text . \"{{planet}} => |planet|\" . $text;","clojure":"(fn [text] (str text \"{{planet}} => |planet|\" text))","__tag__":"code","perl":"sub { $_[0] . \"{{planet}} => |planet|\" . $_[0] }","python":"lambda text: \"%s{{planet}} => |planet|%s\" % (text, text)","ruby":"proc { |text| \"#{text}{{planet}} => |planet|#{text}\" }","js":"function(txt) { return txt + \"{{planet}} => |planet|\" + txt }"}},"expected":"<-{{planet}} => Earth->","template":"{{= | | =}}<|#lambda|-|/lambda|>","desc":"Lambdas used for sections should parse with the current delimiters."},{"name":"Section - Multiple Calls","data":{"lambda":{"php":"return \"__\" . $text . \"__\";","clojure":"(fn [text] (str \"__\" text \"__\"))","__tag__":"code","perl":"sub { \"__\" . $_[0] . \"__\" }","python":"lambda text: \"__%s__\" % (text)","ruby":"proc { |text| \"__#{text}__\" }","js":"function(txt) { return \"__\" + txt + \"__\" }"}},"expected":"__FILE__ != __LINE__","template":"{{#lambda}}FILE{{/lambda}} != {{#lambda}}LINE{{/lambda}}","desc":"Lambdas used for sections should not be cached."},{"name":"Inverted Section","data":{"static":"static","lambda":{"php":"return false;","clojure":"(fn [text] false)","__tag__":"code","perl":"sub { 0 }","python":"lambda text: 0","ruby":"proc { |text| false }","js":"function(txt) { return false }"}},"expected":"<>","template":"<{{^lambda}}{{static}}{{/lambda}}>","desc":"Lambdas used for inverted sections should be considered truthy."}]} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml b/static/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml deleted file mode 100644 index b9fb4d0f..00000000 --- a/static/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml +++ /dev/null @@ -1,149 +0,0 @@ -overview: | - Lambdas are a special-cased data type for use in interpolations and - sections. - - When used as the data value for an Interpolation tag, the lambda MUST be - treatable as an arity 0 function, and invoked as such. The returned value - MUST be rendered against the default delimiters, then interpolated in place - of the lambda. - - When used as the data value for a Section tag, the lambda MUST be treatable - as an arity 1 function, and invoked as such (passing a String containing the - unprocessed section contents). The returned value MUST be rendered against - the current delimiters, then interpolated in place of the section. -tests: - - name: Interpolation - desc: A lambda's return value should be interpolated. - data: - lambda: !code - ruby: 'proc { "world" }' - perl: 'sub { "world" }' - js: 'function() { return "world" }' - php: 'return "world";' - python: 'lambda: "world"' - clojure: '(fn [] "world")' - template: "Hello, {{lambda}}!" - expected: "Hello, world!" - - - name: Interpolation - Expansion - desc: A lambda's return value should be parsed. - data: - planet: "world" - lambda: !code - ruby: 'proc { "{{planet}}" }' - perl: 'sub { "{{planet}}" }' - js: 'function() { return "{{planet}}" }' - php: 'return "{{planet}}";' - python: 'lambda: "{{planet}}"' - clojure: '(fn [] "{{planet}}")' - template: "Hello, {{lambda}}!" - expected: "Hello, world!" - - - name: Interpolation - Alternate Delimiters - desc: A lambda's return value should parse with the default delimiters. - data: - planet: "world" - lambda: !code - ruby: 'proc { "|planet| => {{planet}}" }' - perl: 'sub { "|planet| => {{planet}}" }' - js: 'function() { return "|planet| => {{planet}}" }' - php: 'return "|planet| => {{planet}}";' - python: 'lambda: "|planet| => {{planet}}"' - clojure: '(fn [] "|planet| => {{planet}}")' - template: "{{= | | =}}\nHello, (|&lambda|)!" - expected: "Hello, (|planet| => world)!" - - - name: Interpolation - Multiple Calls - desc: Interpolated lambdas should not be cached. - data: - lambda: !code - ruby: 'proc { $calls ||= 0; $calls += 1 }' - perl: 'sub { no strict; $calls += 1 }' - js: 'function() { return (g=(function(){return this})()).calls=(g.calls||0)+1 }' - php: 'global $calls; return ++$calls;' - python: 'lambda: globals().update(calls=globals().get("calls",0)+1) or calls' - clojure: '(def g (atom 0)) (fn [] (swap! g inc))' - template: '{{lambda}} == {{{lambda}}} == {{lambda}}' - expected: '1 == 2 == 3' - - - name: Escaping - desc: Lambda results should be appropriately escaped. - data: - lambda: !code - ruby: 'proc { ">" }' - perl: 'sub { ">" }' - js: 'function() { return ">" }' - php: 'return ">";' - python: 'lambda: ">"' - clojure: '(fn [] ">")' - template: "<{{lambda}}{{{lambda}}}" - expected: "<>>" - - - name: Section - desc: Lambdas used for sections should receive the raw section string. - data: - x: 'Error!' - lambda: !code - ruby: 'proc { |text| text == "{{x}}" ? "yes" : "no" }' - perl: 'sub { $_[0] eq "{{x}}" ? "yes" : "no" }' - js: 'function(txt) { return (txt == "{{x}}" ? "yes" : "no") }' - php: 'return ($text == "{{x}}") ? "yes" : "no";' - python: 'lambda text: text == "{{x}}" and "yes" or "no"' - clojure: '(fn [text] (if (= text "{{x}}") "yes" "no"))' - template: "<{{#lambda}}{{x}}{{/lambda}}>" - expected: "" - - - name: Section - Expansion - desc: Lambdas used for sections should have their results parsed. - data: - planet: "Earth" - lambda: !code - ruby: 'proc { |text| "#{text}{{planet}}#{text}" }' - perl: 'sub { $_[0] . "{{planet}}" . $_[0] }' - js: 'function(txt) { return txt + "{{planet}}" + txt }' - php: 'return $text . "{{planet}}" . $text;' - python: 'lambda text: "%s{{planet}}%s" % (text, text)' - clojure: '(fn [text] (str text "{{planet}}" text))' - template: "<{{#lambda}}-{{/lambda}}>" - expected: "<-Earth->" - - - name: Section - Alternate Delimiters - desc: Lambdas used for sections should parse with the current delimiters. - data: - planet: "Earth" - lambda: !code - ruby: 'proc { |text| "#{text}{{planet}} => |planet|#{text}" }' - perl: 'sub { $_[0] . "{{planet}} => |planet|" . $_[0] }' - js: 'function(txt) { return txt + "{{planet}} => |planet|" + txt }' - php: 'return $text . "{{planet}} => |planet|" . $text;' - python: 'lambda text: "%s{{planet}} => |planet|%s" % (text, text)' - clojure: '(fn [text] (str text "{{planet}} => |planet|" text))' - template: "{{= | | =}}<|#lambda|-|/lambda|>" - expected: "<-{{planet}} => Earth->" - - - name: Section - Multiple Calls - desc: Lambdas used for sections should not be cached. - data: - lambda: !code - ruby: 'proc { |text| "__#{text}__" }' - perl: 'sub { "__" . $_[0] . "__" }' - js: 'function(txt) { return "__" + txt + "__" }' - php: 'return "__" . $text . "__";' - python: 'lambda text: "__%s__" % (text)' - clojure: '(fn [text] (str "__" text "__"))' - template: '{{#lambda}}FILE{{/lambda}} != {{#lambda}}LINE{{/lambda}}' - expected: '__FILE__ != __LINE__' - - - name: Inverted Section - desc: Lambdas used for inverted sections should be considered truthy. - data: - static: 'static' - lambda: !code - ruby: 'proc { |text| false }' - perl: 'sub { 0 }' - js: 'function(txt) { return false }' - php: 'return false;' - python: 'lambda text: 0' - clojure: '(fn [text] false)' - template: "<{{^lambda}}{{static}}{{/lambda}}>" - expected: "<>" diff --git a/static/build/node_modules/hogan.js/test/templates/list.mustache b/static/build/node_modules/hogan.js/test/templates/list.mustache deleted file mode 100644 index 9bb653a3..00000000 --- a/static/build/node_modules/hogan.js/test/templates/list.mustache +++ /dev/null @@ -1,8 +0,0 @@ -
    -
  • -
  • -
  • -
  • -
  • -
  • -
\ No newline at end of file diff --git a/static/build/node_modules/hogan.js/tools/release.js b/static/build/node_modules/hogan.js/tools/release.js deleted file mode 100644 index dda0d3f8..00000000 --- a/static/build/node_modules/hogan.js/tools/release.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var fs = require('fs'); -var path = require('path'); -var Hogan = require(__dirname + '/../lib/hogan'); -var minlicense = '/**\n* @preserve Copyright 2012 Twitter, Inc.\n* @license http://www.apache.org/licenses/LICENSE-2.0.txt\n*/\n'; - -function read(path) { - return fs.readFileSync(path).toString() -} - -// Good enough for little js files -function copy(src, dst) { - return fs.writeFileSync(dst, read(src)); -} - -function uglify(src, dst) { - var jsp = require("uglify-js").parser; - var pro = require("uglify-js").uglify; - var orig_code = read(src); - var ast = jsp.parse(orig_code); // parse code and get the initial AST - ast = pro.ast_mangle(ast); // get a new AST with mangled names - ast = pro.ast_squeeze(ast); // get an AST with compression optimizations - fs.writeFileSync(dst, minlicense + pro.gen_code(ast)); -} - -var packageJSON = JSON.parse(read('package.json')); -var version = packageJSON.version.substring(0, packageJSON.version.indexOf('-')); - -function removeFirstComment(text) { - return text.substring(text.indexOf('*/') + 2); -} - -var context = { - template: removeFirstComment(read(__dirname + '/../lib/template.js')), - compiler: removeFirstComment(read(__dirname + '/../lib/compiler.js')) -}; - -var wrapperPath = '/../wrappers/'; -var wrappers = fs.readdirSync(__dirname + wrapperPath).map(function(f) { - return __dirname + wrapperPath + f; -}); - -var distPath = __dirname + '/../dist/'; -wrappers.forEach(function(wrapper) { - var tail = path.basename(wrapper, '.mustache'); - var target = distPath + 'hogan-' + version + '.' + tail; - var uglified = distPath + 'hogan-' + version + '.min.' + tail; - fs.writeFileSync(target, Hogan.compile(read(wrapper)).render(context)); - uglify(target, uglified); -}); - -// Also release Hogan.Template on its own. -var templateTarget = distPath + 'template-' + version + '.js'; -fs.writeFileSync(templateTarget, read(__dirname + '/../lib/template.js')); -uglify(templateTarget, distPath + 'template-' + version + '.min.js'); - -// Add packageJSON to node distribution -packageJSON.version = version; -fs.writeFileSync(__dirname + '/../dist/nodejs/package.json', - JSON.stringify(packageJSON, null, " ")); diff --git a/static/build/node_modules/hogan.js/tools/web_templates.js b/static/build/node_modules/hogan.js/tools/web_templates.js deleted file mode 100644 index f00acd3c..00000000 --- a/static/build/node_modules/hogan.js/tools/web_templates.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var Hogan = require(__dirname + '/../lib/hogan.js'); -var fs = require('fs'); -var path = require('path'); - -// Substitute variables in the homepage with values from package.json -var homeTemplatePath = __dirname + '/../build/gh-pages/index.html.mustache'; -var contextPath = __dirname + '/../dist/nodejs/package.json'; - -var homepage = fs.readFileSync(homeTemplatePath).toString(); -var context = JSON.parse(fs.readFileSync(contextPath).toString()); - -var template = Hogan.compile(homepage); - -fs.writeFileSync(path.dirname(homeTemplatePath) + '/index.html', - template.render(context)); - -fs.unlinkSync(homeTemplatePath); \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/web/1.0.0/hogan.js b/static/build/node_modules/hogan.js/web/1.0.0/hogan.js deleted file mode 100644 index 09170d63..00000000 --- a/static/build/node_modules/hogan.js/web/1.0.0/hogan.js +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var HoganTemplate = (function () { - - function constructor(text) { - this.text = text; - }; - - constructor.prototype = { - // render: replaced by generated code. - r: function (context, partials) { return ''; }, - - // variable escaping - v: hoganEscape, - - render: function render(context, partials) { - return this.r(context, partials); - }, - - // tries to find a partial in the curent scope and render it - rp: function(name, context, partials, indent) { - var partial = partials[name]; - - if (!partial) { - return ''; - } - - return partial.render(context, partials); - }, - - // render a section - rs: function(context, partials, section) { - var buf = ''; - var tail = context[context.length - 1]; - if (!isArray(tail)) { - buf = section(context, partials); - return buf; - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - buf += section(context, partials); - context.pop(); - } - return buf; - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end) { - if (isArray(val) && val.length === 0) { - return false; - } - - if (!inverted && typeof val == 'function') { - val = this.ls(val, ctx, partials, start, end); - } - - var pass = (val === '') || !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - if (key === '.' && isArray(ctx[ctx.length - 2])) { - return ctx[ctx.length - 1]; - } - - var names = key.split('.'); - var val = this.f(names[0], ctx, partials, returnFound); - var cx = null; - for (var i = 1; i < names.length; i++) { - if (val && typeof val == 'object' && names[i] in val) { - cx = val; - val = val[names[i]]; - } else { - val = ''; - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.lv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false; - var v = null; - var found = false; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - if (v && typeof v == 'object' && key in v) { - val = v[key]; - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.lv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ho: function(val, cx, partials, text) { - var t = val.call(cx, text, function(t) { - return Hogan.compile(t).render(cx); - }); - var s = Hogan.compile(t.toString()).render(cx, partials); - this.b = s; - return false; - }, - - // higher order template result buffer - b: '', - - // lambda replace section - ls: function(val, ctx, partials, start, end) { - var cx = ctx[ctx.length - 1]; - if (val.length > 0) { - return this.ho(val, cx, partials, this.text.substring(start, end)); - } - var t = val.call(cx); - if (typeof t == 'function') { - return this.ho(t, cx, partials, this.text.substring(start, end)); - } - return t; - }, - - // lambda replace variable - lv: function(val, ctx, partials) { - var cx = ctx[ctx.length - 1]; - return Hogan.compile(val.call(cx).toString()).render(cx, partials); - } - }; - - var rAmp = /&/g, rLt = //g, rApos =/\'/g, - rQuot = /\"/g, hChars =/[&<>\"\']/; - function hoganEscape(str) { - var s = String(str === null ? '' : str); - return hChars.test(s) ? s.replace(rAmp,'&') - .replace(rLt,'<').replace(rGt,'>') - .replace(rApos,''').replace(rQuot, '"') : s; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - } - - return constructor; -})(); - -var Hogan = (function () { - - function scan(text) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push(new String(buf)); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (tokens[j].tag && tagTypes[tokens[j].tag] < tagTypes['_v']) || - (!tokens[j].tag && tokens[j].match(rIsWhitespace) == null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart; j < tokens.length; j++) { - if (!tokens[j].tag) { - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}) - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag; - var closeIndex = text.indexOf(close, index); - var delimiters = trim(text.substring(text.indexOf('=', index) + 1, - closeIndex)).split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - return closeIndex + close.length - 1; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text[i] == '\n') { - filterLine(seenTag); - } else { - buf += text[i]; - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - var tag = tagTypes[text[i + 1]]; - tagType = tag ? text[i + 1] : '_v'; - seenTag = i; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - } else { - if (tagChange(ctag, text, i)) { - i += ctag.length - 1; - tokens.push({tag: tagType, n: trim(buf), - i: (tagType == '/') ? seenTag - 1 : i + 1}); - buf = ''; - state = IN_TEXT; - if (tagType == '{') { - i++; - } - } else { - buf += text[i]; - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/; - - var tagTypes = { - '#': 1, '^': 2, '/': 3, '!': 4, '>': 5, - '<': 6, '=': 7, '_v': 8, '{': 9, '&': 10 - }; - - function tagChange(tag, text, index) { - if (text[index] != tag[0]) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text[index + i] != tag[i]) { - return false; - } - } - - return true; - } - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - token = null; - - while (tokens.length > 0) { - token = tokens.shift(); - if (token.tag == '#' || token.tag == '^' || - isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - instructions.push(token); - } else if (token.tag == '/') { - if (stack.length == 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else { - instructions.push(token); - } - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function generate(tree, text, options) { - var code = 'var c = [cx];var b = "";var _ = this;' + - walk(tree) + 'return b;'; - if (options.asString) { - return 'function(cx,p){' + code + ';};'; - } - - var template = new HoganTemplate(text); - template.r = new Function('cx', 'p', code); - return template; - } - - var rQuot = /\"/g, rNewline = /\n/g, rCr = /\r/g, rSlash = /\\/g; - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r') - }; - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function walk(tree) { - var code = ''; - for (var i = 0, l = tree.length; i < l; i++) { - var tag = tree[i].tag; - if (tag == '#') { - code += section(tree[i].nodes, tree[i].n, chooseMethod(tree[i].n), - tree[i].i, tree[i].end); - } else if (tag == '^') { - code += invertedSection(tree[i].nodes, tree[i].n, - chooseMethod(tree[i].n)); - } else if (tag == '<' || tag == '>') { - code += partial(tree[i].n); - } else if (tag == '{' || tag == '&') { - code += tripleStache(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag == '\n') { - code += text('\n'); - } else if (tag == '_v') { - code += variable(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag === undefined) { - code += text(tree[i]); - } - } - return code; - } - - function section(nodes, id, method, start, end) { - var code = 'if(_.s(_.' + method + '("' + esc(id) + '",c,p,1),'; - code += 'c,p,0,' + start + ',' + end + ')){'; - code += 'b += _.rs(c,p,'; - code += 'function(c,p){ var b = "";'; - code += walk(nodes); - code += 'return b;});c.pop();}'; - code += 'else{b += _.b; _.b = ""};'; - return code; - } - - function invertedSection(nodes, id, method) { - var code = 'if (!_.s(_.' + method + '("' + esc(id) + '",c,p,1),c,p,1,0,0)){'; - code += walk(nodes); - code += '};'; - return code; - } - - function partial(id) { - return 'b += _.rp("' + esc(id) + '",c[c.length - 1],p);'; - } - - function tripleStache(id, method) { - return 'b += (_.' + method + '("' + esc(id) + '",c,p,0));'; - } - - function variable(id, method) { - return 'b += (_.v(_.' + method + '("' + esc(id) + '",c,p,0)));'; - } - - function text(id) { - return 'b += "' + esc(id) + '";'; - } - - return ({ - scan: scan, - - parse: function(tokens, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - }, - - cache: {}, - - compile: function(text, options) { - // options - // - // asString: false (default) - // - // sectionTags: [{o: '_foo', c: 'foo'}] - // An array of object with o and c fields that indicate names for custom - // section tags. The example above allows parsing of {{_foo}}{{/foo}}. - // - options = options || {}; - - var t = this.cache[text]; - if (t) { - return t; - } - t = generate(this.parse(scan(text), options), text, options); - return this.cache[text] = t; - } - }); -})(); - -// Export the hogan constructor for Node.js and CommonJS. -if (typeof module !== 'undefined' && module.exports) { - module.exports = Hogan; - module.exports.Template = HoganTemplate; -} else if (typeof exports !== 'undefined') { - exports.Hogan = Hogan; - exports.HoganTemplate = HoganTemplate; -} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/web/1.0.0/hogan.min.js b/static/build/node_modules/hogan.js/web/1.0.0/hogan.min.js deleted file mode 100644 index 13ec535a..00000000 --- a/static/build/node_modules/hogan.js/web/1.0.0/hogan.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var HoganTemplate=function(){function a(a){this.text=a}function h(a){var h=String(a===null?"":a);return g.test(h)?h.replace(b,"&").replace(c,"<").replace(d,">").replace(e,"'").replace(f,"""):h}a.prototype={r:function(a,b){return""},v:h,render:function(a,b){return this.r(a,b)},rp:function(a,b,c,d){var e=c[a];return e?e.render(b,c):""},rs:function(a,b,c){var d="",e=a[a.length-1];if(!i(e))return d=c(a,b),d;for(var f=0;f=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d){var e=a.call(b,d,function(a){return Hogan.compile(a).render(b)}),f=Hogan.compile(e.toString()).render(b,c);return this.b=f,!1},b:"",ls:function(a,b,c,d,e){var f=b[b.length-1];if(a.length>0)return this.ho(a,f,c,this.text.substring(d,e));var g=a.call(f);return typeof g=="function"?this.ho(g,f,c,this.text.substring(d,e)):g},lv:function(a,b,c){var d=b[b.length-1];return Hogan.compile(a.call(d).toString()).render(d,c)}};var b=/&/g,c=//g,e=/\'/g,f=/\"/g,g=/[&<>\"\']/,i=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};return a}(),Hogan=function(){function a(a){function s(){l.length>0&&(m.push(new String(l)),l="")}function t(){var a=!0;for(var b=p;b0){j=a.shift();if(j.tag=="#"||j.tag=="^"||g(j,d))c.push(j),j.nodes=f(a,j.tag,c,d),e.push(j);else{if(j.tag=="/"){if(c.length==0)throw new Error("Closing tag without opener: /"+j.n);i=c.pop();if(j.n!=i.n&&!h(j.n,i.n,d))throw new Error("Nesting error: "+i.n+" vs. "+j.n);return i.end=j.i,e}e.push(j)}}if(c.length>0)throw new Error("missing closing tag: "+c.pop().n);return e}function g(a,b){for(var c=0,d=b.length;c"?b+=s(a[c].n):e=="{"||e=="&"?b+=t(a[c].n,o(a[c].n)):e=="\n"?b+=v("\n"):e=="_v"?b+=u(a[c].n,o(a[c].n)):e===undefined&&(b+=v(a[c]))}return b}function q(a,b,c,d,e){var f="if(_.s(_."+c+'("'+n(b)+'",c,p,1),';return f+="c,p,0,"+d+","+e+")){",f+="b += _.rs(c,p,",f+='function(c,p){ var b = "";',f+=p(a),f+="return b;});c.pop();}",f+='else{b += _.b; _.b = ""};',f}function r(a,b,c){var d="if (!_.s(_."+c+'("'+n(b)+'",c,p,1),c,p,1,0,0)){';return d+=p(a),d+="};",d}function s(a){return'b += _.rp("'+n(a)+'",c[c.length - 1],p);'}function t(a,b){return"b += (_."+b+'("'+n(a)+'",c,p,0));'}function u(a,b){return"b += (_.v(_."+b+'("'+n(a)+'",c,p,0)));'}function v(a){return'b += "'+n(a)+'";'}var c=/\S/,d={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10},j=/\"/g,k=/\n/g,l=/\r/g,m=/\\/g;return{scan:a,parse:function(a,b){return b=b||{},f(a,"",[],b.sectionTags||[])},cache:{},compile:function(b,c){c=c||{};var d=this.cache[b];return d?d:(d=i(this.parse(a(b),c),b,c),this.cache[b]=d)}}}();typeof module!="undefined"&&module.exports?(module.exports=Hogan,module.exports.Template=HoganTemplate):typeof exports!="undefined"&&(exports.Hogan=Hogan,exports.HoganTemplate=HoganTemplate); \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js b/static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js deleted file mode 100644 index 09170d63..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var HoganTemplate = (function () { - - function constructor(text) { - this.text = text; - }; - - constructor.prototype = { - // render: replaced by generated code. - r: function (context, partials) { return ''; }, - - // variable escaping - v: hoganEscape, - - render: function render(context, partials) { - return this.r(context, partials); - }, - - // tries to find a partial in the curent scope and render it - rp: function(name, context, partials, indent) { - var partial = partials[name]; - - if (!partial) { - return ''; - } - - return partial.render(context, partials); - }, - - // render a section - rs: function(context, partials, section) { - var buf = ''; - var tail = context[context.length - 1]; - if (!isArray(tail)) { - buf = section(context, partials); - return buf; - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - buf += section(context, partials); - context.pop(); - } - return buf; - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end) { - if (isArray(val) && val.length === 0) { - return false; - } - - if (!inverted && typeof val == 'function') { - val = this.ls(val, ctx, partials, start, end); - } - - var pass = (val === '') || !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - if (key === '.' && isArray(ctx[ctx.length - 2])) { - return ctx[ctx.length - 1]; - } - - var names = key.split('.'); - var val = this.f(names[0], ctx, partials, returnFound); - var cx = null; - for (var i = 1; i < names.length; i++) { - if (val && typeof val == 'object' && names[i] in val) { - cx = val; - val = val[names[i]]; - } else { - val = ''; - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.lv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false; - var v = null; - var found = false; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - if (v && typeof v == 'object' && key in v) { - val = v[key]; - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.lv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ho: function(val, cx, partials, text) { - var t = val.call(cx, text, function(t) { - return Hogan.compile(t).render(cx); - }); - var s = Hogan.compile(t.toString()).render(cx, partials); - this.b = s; - return false; - }, - - // higher order template result buffer - b: '', - - // lambda replace section - ls: function(val, ctx, partials, start, end) { - var cx = ctx[ctx.length - 1]; - if (val.length > 0) { - return this.ho(val, cx, partials, this.text.substring(start, end)); - } - var t = val.call(cx); - if (typeof t == 'function') { - return this.ho(t, cx, partials, this.text.substring(start, end)); - } - return t; - }, - - // lambda replace variable - lv: function(val, ctx, partials) { - var cx = ctx[ctx.length - 1]; - return Hogan.compile(val.call(cx).toString()).render(cx, partials); - } - }; - - var rAmp = /&/g, rLt = //g, rApos =/\'/g, - rQuot = /\"/g, hChars =/[&<>\"\']/; - function hoganEscape(str) { - var s = String(str === null ? '' : str); - return hChars.test(s) ? s.replace(rAmp,'&') - .replace(rLt,'<').replace(rGt,'>') - .replace(rApos,''').replace(rQuot, '"') : s; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - } - - return constructor; -})(); - -var Hogan = (function () { - - function scan(text) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push(new String(buf)); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (tokens[j].tag && tagTypes[tokens[j].tag] < tagTypes['_v']) || - (!tokens[j].tag && tokens[j].match(rIsWhitespace) == null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart; j < tokens.length; j++) { - if (!tokens[j].tag) { - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}) - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag; - var closeIndex = text.indexOf(close, index); - var delimiters = trim(text.substring(text.indexOf('=', index) + 1, - closeIndex)).split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - return closeIndex + close.length - 1; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text[i] == '\n') { - filterLine(seenTag); - } else { - buf += text[i]; - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - var tag = tagTypes[text[i + 1]]; - tagType = tag ? text[i + 1] : '_v'; - seenTag = i; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - } else { - if (tagChange(ctag, text, i)) { - i += ctag.length - 1; - tokens.push({tag: tagType, n: trim(buf), - i: (tagType == '/') ? seenTag - 1 : i + 1}); - buf = ''; - state = IN_TEXT; - if (tagType == '{') { - i++; - } - } else { - buf += text[i]; - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/; - - var tagTypes = { - '#': 1, '^': 2, '/': 3, '!': 4, '>': 5, - '<': 6, '=': 7, '_v': 8, '{': 9, '&': 10 - }; - - function tagChange(tag, text, index) { - if (text[index] != tag[0]) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text[index + i] != tag[i]) { - return false; - } - } - - return true; - } - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - token = null; - - while (tokens.length > 0) { - token = tokens.shift(); - if (token.tag == '#' || token.tag == '^' || - isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - instructions.push(token); - } else if (token.tag == '/') { - if (stack.length == 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else { - instructions.push(token); - } - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function generate(tree, text, options) { - var code = 'var c = [cx];var b = "";var _ = this;' + - walk(tree) + 'return b;'; - if (options.asString) { - return 'function(cx,p){' + code + ';};'; - } - - var template = new HoganTemplate(text); - template.r = new Function('cx', 'p', code); - return template; - } - - var rQuot = /\"/g, rNewline = /\n/g, rCr = /\r/g, rSlash = /\\/g; - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r') - }; - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function walk(tree) { - var code = ''; - for (var i = 0, l = tree.length; i < l; i++) { - var tag = tree[i].tag; - if (tag == '#') { - code += section(tree[i].nodes, tree[i].n, chooseMethod(tree[i].n), - tree[i].i, tree[i].end); - } else if (tag == '^') { - code += invertedSection(tree[i].nodes, tree[i].n, - chooseMethod(tree[i].n)); - } else if (tag == '<' || tag == '>') { - code += partial(tree[i].n); - } else if (tag == '{' || tag == '&') { - code += tripleStache(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag == '\n') { - code += text('\n'); - } else if (tag == '_v') { - code += variable(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag === undefined) { - code += text(tree[i]); - } - } - return code; - } - - function section(nodes, id, method, start, end) { - var code = 'if(_.s(_.' + method + '("' + esc(id) + '",c,p,1),'; - code += 'c,p,0,' + start + ',' + end + ')){'; - code += 'b += _.rs(c,p,'; - code += 'function(c,p){ var b = "";'; - code += walk(nodes); - code += 'return b;});c.pop();}'; - code += 'else{b += _.b; _.b = ""};'; - return code; - } - - function invertedSection(nodes, id, method) { - var code = 'if (!_.s(_.' + method + '("' + esc(id) + '",c,p,1),c,p,1,0,0)){'; - code += walk(nodes); - code += '};'; - return code; - } - - function partial(id) { - return 'b += _.rp("' + esc(id) + '",c[c.length - 1],p);'; - } - - function tripleStache(id, method) { - return 'b += (_.' + method + '("' + esc(id) + '",c,p,0));'; - } - - function variable(id, method) { - return 'b += (_.v(_.' + method + '("' + esc(id) + '",c,p,0)));'; - } - - function text(id) { - return 'b += "' + esc(id) + '";'; - } - - return ({ - scan: scan, - - parse: function(tokens, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - }, - - cache: {}, - - compile: function(text, options) { - // options - // - // asString: false (default) - // - // sectionTags: [{o: '_foo', c: 'foo'}] - // An array of object with o and c fields that indicate names for custom - // section tags. The example above allows parsing of {{_foo}}{{/foo}}. - // - options = options || {}; - - var t = this.cache[text]; - if (t) { - return t; - } - t = generate(this.parse(scan(text), options), text, options); - return this.cache[text] = t; - } - }); -})(); - -// Export the hogan constructor for Node.js and CommonJS. -if (typeof module !== 'undefined' && module.exports) { - module.exports = Hogan; - module.exports.Template = HoganTemplate; -} else if (typeof exports !== 'undefined') { - exports.Hogan = Hogan; - exports.HoganTemplate = HoganTemplate; -} \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js b/static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js deleted file mode 100644 index 13ec535a..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */var HoganTemplate=function(){function a(a){this.text=a}function h(a){var h=String(a===null?"":a);return g.test(h)?h.replace(b,"&").replace(c,"<").replace(d,">").replace(e,"'").replace(f,"""):h}a.prototype={r:function(a,b){return""},v:h,render:function(a,b){return this.r(a,b)},rp:function(a,b,c,d){var e=c[a];return e?e.render(b,c):""},rs:function(a,b,c){var d="",e=a[a.length-1];if(!i(e))return d=c(a,b),d;for(var f=0;f=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d){var e=a.call(b,d,function(a){return Hogan.compile(a).render(b)}),f=Hogan.compile(e.toString()).render(b,c);return this.b=f,!1},b:"",ls:function(a,b,c,d,e){var f=b[b.length-1];if(a.length>0)return this.ho(a,f,c,this.text.substring(d,e));var g=a.call(f);return typeof g=="function"?this.ho(g,f,c,this.text.substring(d,e)):g},lv:function(a,b,c){var d=b[b.length-1];return Hogan.compile(a.call(d).toString()).render(d,c)}};var b=/&/g,c=//g,e=/\'/g,f=/\"/g,g=/[&<>\"\']/,i=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};return a}(),Hogan=function(){function a(a){function s(){l.length>0&&(m.push(new String(l)),l="")}function t(){var a=!0;for(var b=p;b0){j=a.shift();if(j.tag=="#"||j.tag=="^"||g(j,d))c.push(j),j.nodes=f(a,j.tag,c,d),e.push(j);else{if(j.tag=="/"){if(c.length==0)throw new Error("Closing tag without opener: /"+j.n);i=c.pop();if(j.n!=i.n&&!h(j.n,i.n,d))throw new Error("Nesting error: "+i.n+" vs. "+j.n);return i.end=j.i,e}e.push(j)}}if(c.length>0)throw new Error("missing closing tag: "+c.pop().n);return e}function g(a,b){for(var c=0,d=b.length;c"?b+=s(a[c].n):e=="{"||e=="&"?b+=t(a[c].n,o(a[c].n)):e=="\n"?b+=v("\n"):e=="_v"?b+=u(a[c].n,o(a[c].n)):e===undefined&&(b+=v(a[c]))}return b}function q(a,b,c,d,e){var f="if(_.s(_."+c+'("'+n(b)+'",c,p,1),';return f+="c,p,0,"+d+","+e+")){",f+="b += _.rs(c,p,",f+='function(c,p){ var b = "";',f+=p(a),f+="return b;});c.pop();}",f+='else{b += _.b; _.b = ""};',f}function r(a,b,c){var d="if (!_.s(_."+c+'("'+n(b)+'",c,p,1),c,p,1,0,0)){';return d+=p(a),d+="};",d}function s(a){return'b += _.rp("'+n(a)+'",c[c.length - 1],p);'}function t(a,b){return"b += (_."+b+'("'+n(a)+'",c,p,0));'}function u(a,b){return"b += (_.v(_."+b+'("'+n(a)+'",c,p,0)));'}function v(a){return'b += "'+n(a)+'";'}var c=/\S/,d={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10},j=/\"/g,k=/\n/g,l=/\r/g,m=/\\/g;return{scan:a,parse:function(a,b){return b=b||{},f(a,"",[],b.sectionTags||[])},cache:{},compile:function(b,c){c=c||{};var d=this.cache[b];return d?d:(d=i(this.parse(a(b),c),b,c),this.cache[b]=d)}}}();typeof module!="undefined"&&module.exports?(module.exports=Hogan,module.exports.Template=HoganTemplate):typeof exports!="undefined"&&(exports.Hogan=Hogan,exports.HoganTemplate=HoganTemplate); \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js b/static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js deleted file mode 100644 index 4f6f6d22..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js +++ /dev/null @@ -1,545 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var HoganTemplate = (function () { - - function constructor(text) { - this.text = text; - } - - constructor.prototype = { - - // render: replaced by generated code. - r: function (context, partials, indent) { return ''; }, - - // variable escaping - v: hoganEscape, - - render: function render(context, partials, indent) { - return this.r(context, partials, indent); - }, - - // tries to find a partial in the curent scope and render it - rp: function(name, context, partials, indent) { - var partial = partials[name]; - - if (!partial) { - return ''; - } - - return partial.r(context, partials, indent); - }, - - // render a section - rs: function(context, partials, section) { - var buf = '', - tail = context[context.length - 1]; - - if (!isArray(tail)) { - return buf = section(context, partials); - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - buf += section(context, partials); - context.pop(); - } - - return buf; - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - - if (isArray(val) && val.length === 0) { - return false; - } - - if (!inverted && typeof val == 'function') { - val = this.ls(val, ctx, partials, start, end, tags); - } - - pass = (val === '') || !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - - var names = key.split('.'), - val = this.f(names[0], ctx, partials, returnFound), - cx = null; - - if (key === '.' && isArray(ctx[ctx.length - 2])) { - return ctx[ctx.length - 1]; - } - - for (var i = 1; i < names.length; i++) { - if (val && typeof val == 'object' && names[i] in val) { - cx = val; - val = val[names[i]]; - } else { - val = ''; - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.lv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false, - v = null, - found = false; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - if (v && typeof v == 'object' && key in v) { - val = v[key]; - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.lv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ho: function(val, cx, partials, text, tags) { - var t = val.call(cx, text, function(t) { - return Hogan.compile(t, {delimiters: tags}).render(cx, partials); - }); - var s = Hogan.compile(t.toString(), {delimiters: tags}).render(cx, partials); - this.b = s; - return false; - }, - - // higher order template result buffer - b: '', - - // lambda replace section - ls: function(val, ctx, partials, start, end, tags) { - var cx = ctx[ctx.length - 1], - t = val.call(cx); - - if (val.length > 0) { - return this.ho(val, cx, partials, this.text.substring(start, end), tags); - } - - if (typeof t == 'function') { - return this.ho(t, cx, partials, this.text.substring(start, end), tags); - } - - return t; - }, - - // lambda replace variable - lv: function(val, ctx, partials) { - var cx = ctx[ctx.length - 1]; - return Hogan.compile(val.call(cx).toString()).render(cx, partials); - } - - }; - - var rAmp = /&/g, - rLt = //g, - rApos =/\'/g, - rQuot = /\"/g, - hChars =/[&<>\"\']/; - - function hoganEscape(str) { - str = String(str === null ? '' : str); - return hChars.test(str) ? - str - .replace(rAmp,'&') - .replace(rLt,'<') - .replace(rGt,'>') - .replace(rApos,''') - .replace(rQuot, '"') : - str; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }; - - return constructor; - -})(); - -var Hogan = (function () { - - // Setup regex assignments - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/, - rQuot = /\"/g, - rNewline = /\n/g, - rCr = /\r/g, - rSlash = /\\/g, - tagTypes = { - '#': 1, '^': 2, '/': 3, '!': 4, '>': 5, - '<': 6, '=': 7, '_v': 8, '{': 9, '&': 10 - }; - - function scan(text, delimiters) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - tag = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push(new String(buf)); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (tokens[j].tag && tagTypes[tokens[j].tag] < tagTypes['_v']) || - (!tokens[j].tag && tokens[j].match(rIsWhitespace) === null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (!tokens[j].tag) { - if ((next = tokens[j+1]) && next.tag == '>') { - // set indent to token value - next.indent = tokens[j].toString() - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}); - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag, - closeIndex = text.indexOf(close, index), - delimiters = trim( - text.substring(text.indexOf('=', index) + 1, closeIndex) - ).split(' '); - - otag = delimiters[0]; - ctag = delimiters[1]; - - return closeIndex + close.length - 1; - } - - if (delimiters) { - delimiters = delimiters.split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text.charAt(i) == '\n') { - filterLine(seenTag); - } else { - buf += text.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag = tagTypes[text.charAt(i + 1)]; - tagType = tag ? text.charAt(i + 1) : '_v'; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text, i)) { - tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag, - i: (tagType == '/') ? seenTag - ctag.length : i + otag.length}); - buf = ''; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == '{') { - i++; - } - } else { - buf += text.charAt(i); - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - function tagChange(tag, text, index) { - if (text.charAt(index) != tag.charAt(0)) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text.charAt(index + i) != tag.charAt(i)) { - return false; - } - } - - return true; - } - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - token = null; - - while (tokens.length > 0) { - token = tokens.shift(); - if (token.tag == '#' || token.tag == '^' || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - instructions.push(token); - } else if (token.tag == '/') { - if (stack.length === 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else { - instructions.push(token); - } - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function generate(tree, text, options) { - var code = 'i = i || "";var c = [cx];var b = i + "";var _ = this;' - + walk(tree) - + 'return b;'; - - if (options.asString) { - return 'function(cx,p,i){' + code + ';}'; - } - - var template = new HoganTemplate(text); - template.r = new Function('cx', 'p', 'i', code); - return template; - } - - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r'); - } - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function walk(tree) { - var code = ''; - for (var i = 0, l = tree.length; i < l; i++) { - var tag = tree[i].tag; - if (tag == '#') { - code += section(tree[i].nodes, tree[i].n, chooseMethod(tree[i].n), - tree[i].i, tree[i].end, tree[i].otag + " " + tree[i].ctag); - } else if (tag == '^') { - code += invertedSection(tree[i].nodes, tree[i].n, - chooseMethod(tree[i].n)); - } else if (tag == '<' || tag == '>') { - code += partial(tree[i]); - } else if (tag == '{' || tag == '&') { - code += tripleStache(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag == '\n') { - code += text('"\\n"' + (tree.length-1 == i ? '' : ' + i')); - } else if (tag == '_v') { - code += variable(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag === undefined) { - code += text('"' + esc(tree[i]) + '"'); - } - } - return code; - } - - function section(nodes, id, method, start, end, tags) { - return 'if(_.s(_.' + method + '("' + esc(id) + '",c,p,1),' + - 'c,p,0,' + start + ',' + end + ', "' + tags + '")){' + - 'b += _.rs(c,p,' + - 'function(c,p){ var b = "";' + - walk(nodes) + - 'return b;});c.pop();}' + - 'else{b += _.b; _.b = ""};'; - } - - function invertedSection(nodes, id, method) { - return 'if (!_.s(_.' + method + '("' + esc(id) + '",c,p,1),c,p,1,0,0,"")){' + - walk(nodes) + - '};'; - } - - function partial(tok) { - return 'b += _.rp("' + esc(tok.n) + '",c[c.length - 1],p,"' + (tok.indent || '') + '");'; - } - - function tripleStache(id, method) { - return 'b += (_.' + method + '("' + esc(id) + '",c,p,0));'; - } - - function variable(id, method) { - return 'b += (_.v(_.' + method + '("' + esc(id) + '",c,p,0)));'; - } - - function text(id) { - return 'b += ' + id + ';'; - } - - return ({ - scan: scan, - - parse: function(tokens, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - }, - - cache: {}, - - compile: function(text, options) { - // options - // - // asString: false (default) - // - // sectionTags: [{o: '_foo', c: 'foo'}] - // An array of object with o and c fields that indicate names for custom - // section tags. The example above allows parsing of {{_foo}}{{/foo}}. - // - // delimiters: A string that overrides the default delimiters. - // Example: "<% %>" - // - options = options || {}; - - var t = this.cache[text]; - - if (t) { - return t; - } - - t = generate(this.parse(scan(text, options.delimiters), options), text, options); - return this.cache[text] = t; - } - }); -})(); - -// Export the hogan constructor for Node.js and CommonJS. -if (typeof module !== 'undefined' && module.exports) { - module.exports = Hogan; - module.exports.Template = HoganTemplate; -} else if (typeof define === 'function' && define.amd) { - define(function () { return Hogan; }); -} else if (typeof exports !== 'undefined') { - exports.Hogan = Hogan; - exports.HoganTemplate = HoganTemplate; -} diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js b/static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js deleted file mode 100644 index 0af8a36f..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/** -* @preserve Copyright 2012 Twitter, Inc. -* @license http://www.apache.org/licenses/LICENSE-2.0.txt -*/ -var HoganTemplate=function(){function a(a){this.text=a}function h(a){return a=String(a===null?"":a),g.test(a)?a.replace(b,"&").replace(c,"<").replace(d,">").replace(e,"'").replace(f,"""):a}a.prototype={r:function(a,b,c){return""},v:h,render:function(b,c,d){return this.r(b,c,d)},rp:function(a,b,c,d){var e=c[a];return e?e.r(b,c,d):""},rs:function(a,b,c){var d="",e=a[a.length-1];if(!i(e))return d=c(a,b);for(var f=0;f=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d,e){var f=a.call(b,d,function(a){return Hogan.compile(a,{delimiters:e}).render(b,c)}),g=Hogan.compile(f.toString(),{delimiters:e}).render(b,c);return this.b=g,!1},b:"",ls:function(a,b,c,d,e,f){var g=b[b.length-1],h=a.call(g);return a.length>0?this.ho(a,g,c,this.text.substring(d,e),f):typeof h=="function"?this.ho(h,g,c,this.text.substring(d,e),f):h},lv:function(a,b,c){var d=b[b.length-1];return Hogan.compile(a.call(d).toString()).render(d,c)}};var b=/&/g,c=//g,e=/\'/g,f=/\"/g,g=/[&<>\"\']/,i=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};return a}(),Hogan=function(){function g(b,c){function u(){n.length>0&&(o.push(new String(n)),n="")}function v(){var b=!0;for(var c=r;c"&&(d.indent=o[c].toString()),o.splice(c,1));else b||o.push({tag:"\n"});p=!1,r=o.length}function x(a,b){var c="="+t,d=a.indexOf(c,b),e=h(a.substring(a.indexOf("=",b)+1,d)).split(" ");return s=e[0],t=e[1],d+c.length-1}var d=b.length,e=0,g=1,j=2,k=e,l=null,m=null,n="",o=[],p=!1,q=0,r=0,s="{{",t="}}";c&&(c=c.split(" "),s=c[0],t=c[1]);for(q=0;q0){g=a.shift();if(g.tag=="#"||g.tag=="^"||k(g,d))c.push(g),g.nodes=j(a,g.tag,c,d),e.push(g);else{if(g.tag=="/"){if(c.length===0)throw new Error("Closing tag without opener: /"+g.n);f=c.pop();if(g.n!=f.n&&!l(g.n,f.n,d))throw new Error("Nesting error: "+f.n+" vs. "+g.n);return f.end=g.i,e}e.push(g)}}if(c.length>0)throw new Error("missing closing tag: "+c.pop().n);return e}function k(a,b){for(var c=0,d=b.length;c"?b+=s(a[c]):e=="{"||e=="&"?b+=t(a[c].n,o(a[c].n)):e=="\n"?b+=v('"\\n"'+(a.length-1==c?"":" + i")):e=="_v"?b+=u(a[c].n,o(a[c].n)):e===undefined&&(b+=v('"'+n(a[c])+'"'))}return b}function q(a,b,c,d,e,f){return"if(_.s(_."+c+'("'+n(b)+'",c,p,1),'+"c,p,0,"+d+","+e+', "'+f+'")){'+"b += _.rs(c,p,"+'function(c,p){ var b = "";'+p(a)+"return b;});c.pop();}"+'else{b += _.b; _.b = ""};'}function r(a,b,c){return"if (!_.s(_."+c+'("'+n(b)+'",c,p,1),c,p,1,0,0,"")){'+p(a)+"};"}function s(a){return'b += _.rp("'+n(a.n)+'",c[c.length - 1],p,"'+(a.indent||"")+'");'}function t(a,b){return"b += (_."+b+'("'+n(a)+'",c,p,0));'}function u(a,b){return"b += (_.v(_."+b+'("'+n(a)+'",c,p,0)));'}function v(a){return"b += "+a+";"}var a=/\S/,b=/\"/g,c=/\n/g,d=/\r/g,e=/\\/g,f={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10};return{scan:g,parse:function(a,b){return b=b||{},j(a,"",[],b.sectionTags||[])},cache:{},compile:function(a,b){b=b||{};var c=this.cache[a];return c?c:(c=m(this.parse(g(a,b.delimiters),b),a,b),this.cache[a]=c)}}}();typeof module!="undefined"&&module.exports?(module.exports=Hogan,module.exports.Template=HoganTemplate):typeof define=="function"&&define.amd?define(function(){return Hogan}):typeof exports!="undefined"&&(exports.Hogan=Hogan,exports.HoganTemplate=HoganTemplate) \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js b/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js deleted file mode 100644 index ec55a5d3..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js +++ /dev/null @@ -1,576 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -var Hogan = {}; - -(function (Hogan) { - Hogan.Template = function constructor(renderFunc, text, compiler) { - if (renderFunc) { - this.r = renderFunc; - } - this.c = compiler; - this.text = text || ''; - } - - Hogan.Template.prototype = { - // render: replaced by generated code. - r: function (context, partials, indent) { return ''; }, - - // variable escaping - v: hoganEscape, - - render: function render(context, partials, indent) { - return this.ri([context], partials || {}, indent); - }, - - // render internal -- a hook for overrides that catches partials too - ri: function (context, partials, indent) { - return this.r(context, partials, indent); - }, - - // tries to find a partial in the curent scope and render it - rp: function(name, context, partials, indent) { - var partial = partials[name]; - - if (!partial) { - return ''; - } - - if (this.c && typeof partial == 'string') { - partial = this.c.compile(partial); - } - - return partial.ri(context, partials, indent); - }, - - // render a section - rs: function(context, partials, section) { - var buf = '', - tail = context[context.length - 1]; - - if (!isArray(tail)) { - return buf = section(context, partials); - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - buf += section(context, partials); - context.pop(); - } - - return buf; - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - - if (isArray(val) && val.length === 0) { - return false; - } - - if (typeof val == 'function') { - val = this.ls(val, ctx, partials, inverted, start, end, tags); - } - - pass = (val === '') || !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - var names = key.split('.'), - val = this.f(names[0], ctx, partials, returnFound), - cx = null; - - if (key === '.' && isArray(ctx[ctx.length - 2])) { - return ctx[ctx.length - 1]; - } - - for (var i = 1; i < names.length; i++) { - if (val && typeof val == 'object' && names[i] in val) { - cx = val; - val = val[names[i]]; - } else { - val = ''; - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.lv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false, - v = null, - found = false; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - if (v && typeof v == 'object' && key in v) { - val = v[key]; - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.lv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ho: function(val, cx, partials, text, tags) { - var compiler = this.c; - var t = val.call(cx, text, function(t) { - return compiler.compile(t, {delimiters: tags}).render(cx, partials); - }); - var s = compiler.compile(t.toString(), {delimiters: tags}).render(cx, partials); - this.b = s; - return false; - }, - - // higher order template result buffer - b: '', - - // lambda replace section - ls: function(val, ctx, partials, inverted, start, end, tags) { - var cx = ctx[ctx.length - 1], - t = null; - - if (!inverted && this.c && val.length > 0) { - return this.ho(val, cx, partials, this.text.substring(start, end), tags); - } - - t = val.call(cx); - - if (typeof t == 'function') { - if (inverted) { - return true; - } else if (this.c) { - return this.ho(t, cx, partials, this.text.substring(start, end), tags); - } - } - - return t; - }, - - // lambda replace variable - lv: function(val, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = val.call(cx); - if (typeof result == 'function') { - result = result.call(cx); - } - result = result.toString(); - - if (this.c && ~result.indexOf("{{")) { - return this.c.compile(result).render(cx, partials); - } - - return result; - } - - }; - - var rAmp = /&/g, - rLt = //g, - rApos =/\'/g, - rQuot = /\"/g, - hChars =/[&<>\"\']/; - - function hoganEscape(str) { - str = String((str === null || str === undefined) ? '' : str); - return hChars.test(str) ? - str - .replace(rAmp,'&') - .replace(rLt,'<') - .replace(rGt,'>') - .replace(rApos,''') - .replace(rQuot, '"') : - str; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }; - -})(typeof exports !== 'undefined' ? exports : Hogan); - - - - -(function (Hogan) { - // Setup regex assignments - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/, - rQuot = /\"/g, - rNewline = /\n/g, - rCr = /\r/g, - rSlash = /\\/g, - tagTypes = { - '#': 1, '^': 2, '/': 3, '!': 4, '>': 5, - '<': 6, '=': 7, '_v': 8, '{': 9, '&': 10 - }; - - Hogan.scan = function scan(text, delimiters) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - tag = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push(new String(buf)); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (tokens[j].tag && tagTypes[tokens[j].tag] < tagTypes['_v']) || - (!tokens[j].tag && tokens[j].match(rIsWhitespace) === null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (!tokens[j].tag) { - if ((next = tokens[j+1]) && next.tag == '>') { - // set indent to token value - next.indent = tokens[j].toString() - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}); - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag, - closeIndex = text.indexOf(close, index), - delimiters = trim( - text.substring(text.indexOf('=', index) + 1, closeIndex) - ).split(' '); - - otag = delimiters[0]; - ctag = delimiters[1]; - - return closeIndex + close.length - 1; - } - - if (delimiters) { - delimiters = delimiters.split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text.charAt(i) == '\n') { - filterLine(seenTag); - } else { - buf += text.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag = tagTypes[text.charAt(i + 1)]; - tagType = tag ? text.charAt(i + 1) : '_v'; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text, i)) { - tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag, - i: (tagType == '/') ? seenTag - ctag.length : i + otag.length}); - buf = ''; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == '{') { - if (ctag == '}}') { - i++; - } else { - cleanTripleStache(tokens[tokens.length - 1]); - } - } - } else { - buf += text.charAt(i); - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function cleanTripleStache(token) { - if (token.n.substr(token.n.length - 1) === '}') { - token.n = token.n.substring(0, token.n.length - 1); - } - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - function tagChange(tag, text, index) { - if (text.charAt(index) != tag.charAt(0)) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text.charAt(index + i) != tag.charAt(i)) { - return false; - } - } - - return true; - } - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - token = null; - - while (tokens.length > 0) { - token = tokens.shift(); - if (token.tag == '#' || token.tag == '^' || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - instructions.push(token); - } else if (token.tag == '/') { - if (stack.length === 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else { - instructions.push(token); - } - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function writeCode(tree) { - return 'i = i || "";var b = i + "";var _ = this;' + walk(tree) + 'return b;'; - } - - Hogan.generate = function (code, text, options) { - if (options.asString) { - return 'function(c,p,i){' + code + ';}'; - } - - return new Hogan.Template(new Function('c', 'p', 'i', code), text, Hogan); - } - - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r'); - } - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function walk(tree) { - var code = ''; - for (var i = 0, l = tree.length; i < l; i++) { - var tag = tree[i].tag; - if (tag == '#') { - code += section(tree[i].nodes, tree[i].n, chooseMethod(tree[i].n), - tree[i].i, tree[i].end, tree[i].otag + " " + tree[i].ctag); - } else if (tag == '^') { - code += invertedSection(tree[i].nodes, tree[i].n, - chooseMethod(tree[i].n)); - } else if (tag == '<' || tag == '>') { - code += partial(tree[i]); - } else if (tag == '{' || tag == '&') { - code += tripleStache(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag == '\n') { - code += text('"\\n"' + (tree.length-1 == i ? '' : ' + i')); - } else if (tag == '_v') { - code += variable(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag === undefined) { - code += text('"' + esc(tree[i]) + '"'); - } - } - return code; - } - - function section(nodes, id, method, start, end, tags) { - return 'if(_.s(_.' + method + '("' + esc(id) + '",c,p,1),' + - 'c,p,0,' + start + ',' + end + ', "' + tags + '")){' + - 'b += _.rs(c,p,' + - 'function(c,p){ var b = "";' + - walk(nodes) + - 'return b;});c.pop();}' + - 'else{b += _.b; _.b = ""};'; - } - - function invertedSection(nodes, id, method) { - return 'if (!_.s(_.' + method + '("' + esc(id) + '",c,p,1),c,p,1,0,0,"")){' + - walk(nodes) + - '};'; - } - - function partial(tok) { - return 'b += _.rp("' + esc(tok.n) + '",c,p,"' + (tok.indent || '') + '");'; - } - - function tripleStache(id, method) { - return 'b += (_.' + method + '("' + esc(id) + '",c,p,0));'; - } - - function variable(id, method) { - return 'b += (_.v(_.' + method + '("' + esc(id) + '",c,p,0)));'; - } - - function text(id) { - return 'b += ' + id + ';'; - } - - Hogan.parse = function(tokens, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - }, - - Hogan.cache = {}; - - Hogan.compile = function(text, options) { - // options - // - // asString: false (default) - // - // sectionTags: [{o: '_foo', c: 'foo'}] - // An array of object with o and c fields that indicate names for custom - // section tags. The example above allows parsing of {{_foo}}{{/foo}}. - // - // delimiters: A string that overrides the default delimiters. - // Example: "<% %>" - // - options = options || {}; - - var key = text + '||' + !!options.asString; - - var t = this.cache[key]; - - if (t) { - return t; - } - - t = this.generate(writeCode(this.parse(this.scan(text, options.delimiters), options)), text, options); - return this.cache[key] = t; - }; -})(typeof exports !== 'undefined' ? exports : Hogan); - - -if (typeof define === 'function' && define.amd) { - define(Hogan); -} diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js b/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js deleted file mode 100644 index 75206523..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js +++ /dev/null @@ -1,576 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -var Hogan = {}; - -(function (Hogan) { - Hogan.Template = function constructor(renderFunc, text, compiler) { - if (renderFunc) { - this.r = renderFunc; - } - this.c = compiler; - this.text = text || ''; - } - - Hogan.Template.prototype = { - // render: replaced by generated code. - r: function (context, partials, indent) { return ''; }, - - // variable escaping - v: hoganEscape, - - render: function render(context, partials, indent) { - return this.ri([context], partials || {}, indent); - }, - - // render internal -- a hook for overrides that catches partials too - ri: function (context, partials, indent) { - return this.r(context, partials, indent); - }, - - // tries to find a partial in the curent scope and render it - rp: function(name, context, partials, indent) { - var partial = partials[name]; - - if (!partial) { - return ''; - } - - if (this.c && typeof partial == 'string') { - partial = this.c.compile(partial); - } - - return partial.ri(context, partials, indent); - }, - - // render a section - rs: function(context, partials, section) { - var buf = '', - tail = context[context.length - 1]; - - if (!isArray(tail)) { - return buf = section(context, partials); - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - buf += section(context, partials); - context.pop(); - } - - return buf; - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - - if (isArray(val) && val.length === 0) { - return false; - } - - if (typeof val == 'function') { - val = this.ls(val, ctx, partials, inverted, start, end, tags); - } - - pass = (val === '') || !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - var names = key.split('.'), - val = this.f(names[0], ctx, partials, returnFound), - cx = null; - - if (key === '.' && isArray(ctx[ctx.length - 2])) { - return ctx[ctx.length - 1]; - } - - for (var i = 1; i < names.length; i++) { - if (val && typeof val == 'object' && names[i] in val) { - cx = val; - val = val[names[i]]; - } else { - val = ''; - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.lv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false, - v = null, - found = false; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - if (v && typeof v == 'object' && key in v) { - val = v[key]; - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.lv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ho: function(val, cx, partials, text, tags) { - var compiler = this.c; - var t = val.call(cx, text, function(t) { - return compiler.compile(t, {delimiters: tags}).render(cx, partials); - }); - var s = compiler.compile(t.toString(), {delimiters: tags}).render(cx, partials); - this.b = s; - return false; - }, - - // higher order template result buffer - b: '', - - // lambda replace section - ls: function(val, ctx, partials, inverted, start, end, tags) { - var cx = ctx[ctx.length - 1], - t = null; - - if (!inverted && this.c && val.length > 0) { - return this.ho(val, cx, partials, this.text.substring(start, end), tags); - } - - t = val.call(cx); - - if (typeof t == 'function') { - if (inverted) { - return true; - } else if (this.c) { - return this.ho(t, cx, partials, this.text.substring(start, end), tags); - } - } - - return t; - }, - - // lambda replace variable - lv: function(val, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = val.call(cx); - if (typeof result == 'function') { - result = result.call(cx); - } - result = result.toString(); - - if (this.c && ~result.indexOf("{{")) { - return this.c.compile(result).render(cx, partials); - } - - return result; - } - - }; - - var rAmp = /&/g, - rLt = //g, - rApos =/\'/g, - rQuot = /\"/g, - hChars =/[&<>\"\']/; - - function hoganEscape(str) { - str = String((str === null || str === undefined) ? '' : str); - return hChars.test(str) ? - str - .replace(rAmp,'&') - .replace(rLt,'<') - .replace(rGt,'>') - .replace(rApos,''') - .replace(rQuot, '"') : - str; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }; - -})(typeof exports !== 'undefined' ? exports : Hogan); - - - - -(function (Hogan) { - // Setup regex assignments - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/, - rQuot = /\"/g, - rNewline = /\n/g, - rCr = /\r/g, - rSlash = /\\/g, - tagTypes = { - '#': 1, '^': 2, '/': 3, '!': 4, '>': 5, - '<': 6, '=': 7, '_v': 8, '{': 9, '&': 10 - }; - - Hogan.scan = function scan(text, delimiters) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - tag = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push(new String(buf)); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (tokens[j].tag && tagTypes[tokens[j].tag] < tagTypes['_v']) || - (!tokens[j].tag && tokens[j].match(rIsWhitespace) === null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (!tokens[j].tag) { - if ((next = tokens[j+1]) && next.tag == '>') { - // set indent to token value - next.indent = tokens[j].toString() - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}); - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag, - closeIndex = text.indexOf(close, index), - delimiters = trim( - text.substring(text.indexOf('=', index) + 1, closeIndex) - ).split(' '); - - otag = delimiters[0]; - ctag = delimiters[1]; - - return closeIndex + close.length - 1; - } - - if (delimiters) { - delimiters = delimiters.split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text.charAt(i) == '\n') { - filterLine(seenTag); - } else { - buf += text.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag = tagTypes[text.charAt(i + 1)]; - tagType = tag ? text.charAt(i + 1) : '_v'; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text, i)) { - tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag, - i: (tagType == '/') ? seenTag - ctag.length : i + otag.length}); - buf = ''; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == '{') { - if (ctag == '}}') { - i++; - } else { - cleanTripleStache(tokens[tokens.length - 1]); - } - } - } else { - buf += text.charAt(i); - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function cleanTripleStache(token) { - if (token.n.substr(token.n.length - 1) === '}') { - token.n = token.n.substring(0, token.n.length - 1); - } - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - function tagChange(tag, text, index) { - if (text.charAt(index) != tag.charAt(0)) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text.charAt(index + i) != tag.charAt(i)) { - return false; - } - } - - return true; - } - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - token = null; - - while (tokens.length > 0) { - token = tokens.shift(); - if (token.tag == '#' || token.tag == '^' || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - instructions.push(token); - } else if (token.tag == '/') { - if (stack.length === 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else { - instructions.push(token); - } - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function writeCode(tree) { - return 'i = i || "";var b = i + "";var _ = this;' + walk(tree) + 'return b;'; - } - - Hogan.generate = function (code, text, options) { - if (options.asString) { - return 'function(c,p,i){' + code + ';}'; - } - - return new Hogan.Template(new Function('c', 'p', 'i', code), text, Hogan); - } - - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r'); - } - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function walk(tree) { - var code = ''; - for (var i = 0, l = tree.length; i < l; i++) { - var tag = tree[i].tag; - if (tag == '#') { - code += section(tree[i].nodes, tree[i].n, chooseMethod(tree[i].n), - tree[i].i, tree[i].end, tree[i].otag + " " + tree[i].ctag); - } else if (tag == '^') { - code += invertedSection(tree[i].nodes, tree[i].n, - chooseMethod(tree[i].n)); - } else if (tag == '<' || tag == '>') { - code += partial(tree[i]); - } else if (tag == '{' || tag == '&') { - code += tripleStache(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag == '\n') { - code += text('"\\n"' + (tree.length-1 == i ? '' : ' + i')); - } else if (tag == '_v') { - code += variable(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag === undefined) { - code += text('"' + esc(tree[i]) + '"'); - } - } - return code; - } - - function section(nodes, id, method, start, end, tags) { - return 'if(_.s(_.' + method + '("' + esc(id) + '",c,p,1),' + - 'c,p,0,' + start + ',' + end + ', "' + tags + '")){' + - 'b += _.rs(c,p,' + - 'function(c,p){ var b = "";' + - walk(nodes) + - 'return b;});c.pop();}' + - 'else{b += _.b; _.b = ""};'; - } - - function invertedSection(nodes, id, method) { - return 'if (!_.s(_.' + method + '("' + esc(id) + '",c,p,1),c,p,1,0,0,"")){' + - walk(nodes) + - '};'; - } - - function partial(tok) { - return 'b += _.rp("' + esc(tok.n) + '",c,p,"' + (tok.indent || '') + '");'; - } - - function tripleStache(id, method) { - return 'b += (_.' + method + '("' + esc(id) + '",c,p,0));'; - } - - function variable(id, method) { - return 'b += (_.v(_.' + method + '("' + esc(id) + '",c,p,0)));'; - } - - function text(id) { - return 'b += ' + id + ';'; - } - - Hogan.parse = function(tokens, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - }, - - Hogan.cache = {}; - - Hogan.compile = function(text, options) { - // options - // - // asString: false (default) - // - // sectionTags: [{o: '_foo', c: 'foo'}] - // An array of object with o and c fields that indicate names for custom - // section tags. The example above allows parsing of {{_foo}}{{/foo}}. - // - // delimiters: A string that overrides the default delimiters. - // Example: "<% %>" - // - options = options || {}; - - var key = text + '||' + !!options.asString; - - var t = this.cache[key]; - - if (t) { - return t; - } - - t = this.generate(writeCode(this.parse(this.scan(text, options.delimiters), options)), text, options); - return this.cache[key] = t; - }; -})(typeof exports !== 'undefined' ? exports : Hogan); - - -if (typeof module !== 'undefined' && module.exports) { - module.exports = Hogan; -} diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js b/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js deleted file mode 100644 index 18075626..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js +++ /dev/null @@ -1,572 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - - -var Hogan = {}; - -(function (Hogan) { - Hogan.Template = function constructor(renderFunc, text, compiler) { - if (renderFunc) { - this.r = renderFunc; - } - this.c = compiler; - this.text = text || ''; - } - - Hogan.Template.prototype = { - // render: replaced by generated code. - r: function (context, partials, indent) { return ''; }, - - // variable escaping - v: hoganEscape, - - render: function render(context, partials, indent) { - return this.ri([context], partials || {}, indent); - }, - - // render internal -- a hook for overrides that catches partials too - ri: function (context, partials, indent) { - return this.r(context, partials, indent); - }, - - // tries to find a partial in the curent scope and render it - rp: function(name, context, partials, indent) { - var partial = partials[name]; - - if (!partial) { - return ''; - } - - if (this.c && typeof partial == 'string') { - partial = this.c.compile(partial); - } - - return partial.ri(context, partials, indent); - }, - - // render a section - rs: function(context, partials, section) { - var buf = '', - tail = context[context.length - 1]; - - if (!isArray(tail)) { - return buf = section(context, partials); - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - buf += section(context, partials); - context.pop(); - } - - return buf; - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - - if (isArray(val) && val.length === 0) { - return false; - } - - if (typeof val == 'function') { - val = this.ls(val, ctx, partials, inverted, start, end, tags); - } - - pass = (val === '') || !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - var names = key.split('.'), - val = this.f(names[0], ctx, partials, returnFound), - cx = null; - - if (key === '.' && isArray(ctx[ctx.length - 2])) { - return ctx[ctx.length - 1]; - } - - for (var i = 1; i < names.length; i++) { - if (val && typeof val == 'object' && names[i] in val) { - cx = val; - val = val[names[i]]; - } else { - val = ''; - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.lv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false, - v = null, - found = false; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - if (v && typeof v == 'object' && key in v) { - val = v[key]; - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.lv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ho: function(val, cx, partials, text, tags) { - var compiler = this.c; - var t = val.call(cx, text, function(t) { - return compiler.compile(t, {delimiters: tags}).render(cx, partials); - }); - var s = compiler.compile(t.toString(), {delimiters: tags}).render(cx, partials); - this.b = s; - return false; - }, - - // higher order template result buffer - b: '', - - // lambda replace section - ls: function(val, ctx, partials, inverted, start, end, tags) { - var cx = ctx[ctx.length - 1], - t = null; - - if (!inverted && this.c && val.length > 0) { - return this.ho(val, cx, partials, this.text.substring(start, end), tags); - } - - t = val.call(cx); - - if (typeof t == 'function') { - if (inverted) { - return true; - } else if (this.c) { - return this.ho(t, cx, partials, this.text.substring(start, end), tags); - } - } - - return t; - }, - - // lambda replace variable - lv: function(val, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = val.call(cx); - if (typeof result == 'function') { - result = result.call(cx); - } - result = result.toString(); - - if (this.c && ~result.indexOf("{{")) { - return this.c.compile(result).render(cx, partials); - } - - return result; - } - - }; - - var rAmp = /&/g, - rLt = //g, - rApos =/\'/g, - rQuot = /\"/g, - hChars =/[&<>\"\']/; - - function hoganEscape(str) { - str = String((str === null || str === undefined) ? '' : str); - return hChars.test(str) ? - str - .replace(rAmp,'&') - .replace(rLt,'<') - .replace(rGt,'>') - .replace(rApos,''') - .replace(rQuot, '"') : - str; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }; - -})(typeof exports !== 'undefined' ? exports : Hogan); - - - - -(function (Hogan) { - // Setup regex assignments - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/, - rQuot = /\"/g, - rNewline = /\n/g, - rCr = /\r/g, - rSlash = /\\/g, - tagTypes = { - '#': 1, '^': 2, '/': 3, '!': 4, '>': 5, - '<': 6, '=': 7, '_v': 8, '{': 9, '&': 10 - }; - - Hogan.scan = function scan(text, delimiters) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - tag = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push(new String(buf)); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (tokens[j].tag && tagTypes[tokens[j].tag] < tagTypes['_v']) || - (!tokens[j].tag && tokens[j].match(rIsWhitespace) === null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (!tokens[j].tag) { - if ((next = tokens[j+1]) && next.tag == '>') { - // set indent to token value - next.indent = tokens[j].toString() - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}); - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag, - closeIndex = text.indexOf(close, index), - delimiters = trim( - text.substring(text.indexOf('=', index) + 1, closeIndex) - ).split(' '); - - otag = delimiters[0]; - ctag = delimiters[1]; - - return closeIndex + close.length - 1; - } - - if (delimiters) { - delimiters = delimiters.split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text.charAt(i) == '\n') { - filterLine(seenTag); - } else { - buf += text.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag = tagTypes[text.charAt(i + 1)]; - tagType = tag ? text.charAt(i + 1) : '_v'; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text, i)) { - tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag, - i: (tagType == '/') ? seenTag - ctag.length : i + otag.length}); - buf = ''; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == '{') { - if (ctag == '}}') { - i++; - } else { - cleanTripleStache(tokens[tokens.length - 1]); - } - } - } else { - buf += text.charAt(i); - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function cleanTripleStache(token) { - if (token.n.substr(token.n.length - 1) === '}') { - token.n = token.n.substring(0, token.n.length - 1); - } - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - function tagChange(tag, text, index) { - if (text.charAt(index) != tag.charAt(0)) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text.charAt(index + i) != tag.charAt(i)) { - return false; - } - } - - return true; - } - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - token = null; - - while (tokens.length > 0) { - token = tokens.shift(); - if (token.tag == '#' || token.tag == '^' || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - instructions.push(token); - } else if (token.tag == '/') { - if (stack.length === 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else { - instructions.push(token); - } - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function writeCode(tree) { - return 'i = i || "";var b = i + "";var _ = this;' + walk(tree) + 'return b;'; - } - - Hogan.generate = function (code, text, options) { - if (options.asString) { - return 'function(c,p,i){' + code + ';}'; - } - - return new Hogan.Template(new Function('c', 'p', 'i', code), text, Hogan); - } - - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r'); - } - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function walk(tree) { - var code = ''; - for (var i = 0, l = tree.length; i < l; i++) { - var tag = tree[i].tag; - if (tag == '#') { - code += section(tree[i].nodes, tree[i].n, chooseMethod(tree[i].n), - tree[i].i, tree[i].end, tree[i].otag + " " + tree[i].ctag); - } else if (tag == '^') { - code += invertedSection(tree[i].nodes, tree[i].n, - chooseMethod(tree[i].n)); - } else if (tag == '<' || tag == '>') { - code += partial(tree[i]); - } else if (tag == '{' || tag == '&') { - code += tripleStache(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag == '\n') { - code += text('"\\n"' + (tree.length-1 == i ? '' : ' + i')); - } else if (tag == '_v') { - code += variable(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag === undefined) { - code += text('"' + esc(tree[i]) + '"'); - } - } - return code; - } - - function section(nodes, id, method, start, end, tags) { - return 'if(_.s(_.' + method + '("' + esc(id) + '",c,p,1),' + - 'c,p,0,' + start + ',' + end + ', "' + tags + '")){' + - 'b += _.rs(c,p,' + - 'function(c,p){ var b = "";' + - walk(nodes) + - 'return b;});c.pop();}' + - 'else{b += _.b; _.b = ""};'; - } - - function invertedSection(nodes, id, method) { - return 'if (!_.s(_.' + method + '("' + esc(id) + '",c,p,1),c,p,1,0,0,"")){' + - walk(nodes) + - '};'; - } - - function partial(tok) { - return 'b += _.rp("' + esc(tok.n) + '",c,p,"' + (tok.indent || '') + '");'; - } - - function tripleStache(id, method) { - return 'b += (_.' + method + '("' + esc(id) + '",c,p,0));'; - } - - function variable(id, method) { - return 'b += (_.v(_.' + method + '("' + esc(id) + '",c,p,0)));'; - } - - function text(id) { - return 'b += ' + id + ';'; - } - - Hogan.parse = function(tokens, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - }, - - Hogan.cache = {}; - - Hogan.compile = function(text, options) { - // options - // - // asString: false (default) - // - // sectionTags: [{o: '_foo', c: 'foo'}] - // An array of object with o and c fields that indicate names for custom - // section tags. The example above allows parsing of {{_foo}}{{/foo}}. - // - // delimiters: A string that overrides the default delimiters. - // Example: "<% %>" - // - options = options || {}; - - var key = text + '||' + !!options.asString; - - var t = this.cache[key]; - - if (t) { - return t; - } - - t = this.generate(writeCode(this.parse(this.scan(text, options.delimiters), options)), text, options); - return this.cache[key] = t; - }; -})(typeof exports !== 'undefined' ? exports : Hogan); - diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js b/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js deleted file mode 100644 index aee5922b..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js +++ /dev/null @@ -1,5 +0,0 @@ -/** -* @preserve Copyright 2012 Twitter, Inc. -* @license http://www.apache.org/licenses/LICENSE-2.0.txt -*/ -var Hogan={};(function(a){function h(a){return a=String(a===null||a===undefined?"":a),g.test(a)?a.replace(b,"&").replace(c,"<").replace(d,">").replace(e,"'").replace(f,"""):a}a.Template=function j(a,b,c){a&&(this.r=a),this.c=c,this.text=b||""},a.Template.prototype={r:function(a,b,c){return""},v:h,render:function(b,c,d){return this.ri([b],c||{},d)},ri:function(a,b,c){return this.r(a,b,c)},rp:function(a,b,c,d){var e=c[a];return e?(this.c&&typeof e=="string"&&(e=this.c.compile(e)),e.ri(b,c,d)):""},rs:function(a,b,c){var d="",e=a[a.length-1];if(!i(e))return d=c(a,b);for(var f=0;f=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d,e){var f=this.c,g=a.call(b,d,function(a){return f.compile(a,{delimiters:e}).render(b,c)}),h=f.compile(g.toString(),{delimiters:e}).render(b,c);return this.b=h,!1},b:"",ls:function(a,b,c,d,e,f,g){var h=b[b.length-1],i=null;if(!d&&this.c&&a.length>0)return this.ho(a,h,c,this.text.substring(e,f),g);i=a.call(h);if(typeof i=="function"){if(d)return!0;if(this.c)return this.ho(i,h,c,this.text.substring(e,f),g)}return i},lv:function(a,b,c){var d=b[b.length-1],e=a.call(d);return typeof e=="function"&&(e=e.call(d)),e=e.toString(),this.c&&~e.indexOf("{{")?this.c.compile(e).render(d,c):e}};var b=/&/g,c=//g,e=/\'/g,f=/\"/g,g=/[&<>\"\']/,i=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}})(typeof exports!="undefined"?exports:Hogan),function(a){function h(a){a.n.substr(a.n.length-1)==="}"&&(a.n=a.n.substring(0,a.n.length-1))}function i(a){return a.trim?a.trim():a.replace(/^\s*|\s*$/g,"")}function j(a,b,c){if(b.charAt(c)!=a.charAt(0))return!1;for(var d=1,e=a.length;d0){g=a.shift();if(g.tag=="#"||g.tag=="^"||l(g,d))c.push(g),g.nodes=k(a,g.tag,c,d),e.push(g);else{if(g.tag=="/"){if(c.length===0)throw new Error("Closing tag without opener: /"+g.n);f=c.pop();if(g.n!=f.n&&!m(g.n,f.n,d))throw new Error("Nesting error: "+f.n+" vs. "+g.n);return f.end=g.i,e}e.push(g)}}if(c.length>0)throw new Error("missing closing tag: "+c.pop().n);return e}function l(a,b){for(var c=0,d=b.length;c"?b+=t(a[c]):e=="{"||e=="&"?b+=u(a[c].n,p(a[c].n)):e=="\n"?b+=w('"\\n"'+(a.length-1==c?"":" + i")):e=="_v"?b+=v(a[c].n,p(a[c].n)):e===undefined&&(b+=w('"'+o(a[c])+'"'))}return b}function r(a,b,c,d,e,f){return"if(_.s(_."+c+'("'+o(b)+'",c,p,1),'+"c,p,0,"+d+","+e+', "'+f+'")){'+"b += _.rs(c,p,"+'function(c,p){ var b = "";'+q(a)+"return b;});c.pop();}"+'else{b += _.b; _.b = ""};'}function s(a,b,c){return"if (!_.s(_."+c+'("'+o(b)+'",c,p,1),c,p,1,0,0,"")){'+q(a)+"};"}function t(a){return'b += _.rp("'+o(a.n)+'",c,p,"'+(a.indent||"")+'");'}function u(a,b){return"b += (_."+b+'("'+o(a)+'",c,p,0));'}function v(a,b){return"b += (_.v(_."+b+'("'+o(a)+'",c,p,0)));'}function w(a){return"b += "+a+";"}var b=/\S/,c=/\"/g,d=/\n/g,e=/\r/g,f=/\\/g,g={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10};a.scan=function(c,d){function w(){p.length>0&&(q.push(new String(p)),p="")}function x(){var a=!0;for(var c=t;c"&&(d.indent=q[c].toString()),q.splice(c,1));else b||q.push({tag:"\n"});r=!1,t=q.length}function z(a,b){var c="="+v,d=a.indexOf(c,b),e=i(a.substring(a.indexOf("=",b)+1,d)).split(" ");return u=e[0],v=e[1],d+c.length-1}var e=c.length,f=0,k=1,l=2,m=f,n=null,o=null,p="",q=[],r=!1,s=0,t=0,u="{{",v="}}";d&&(d=d.split(" "),u=d[0],v=d[1]);for(s=0;s=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d,e){var f=this.c,g=a.call(b,d,function(a){return f.compile(a,{delimiters:e}).render(b,c)}),h=f.compile(g.toString(),{delimiters:e}).render(b,c);return this.b=h,!1},b:"",ls:function(a,b,c,d,e,f,g){var h=b[b.length-1],i=null;if(!d&&this.c&&a.length>0)return this.ho(a,h,c,this.text.substring(e,f),g);i=a.call(h);if(typeof i=="function"){if(d)return!0;if(this.c)return this.ho(i,h,c,this.text.substring(e,f),g)}return i},lv:function(a,b,c){var d=b[b.length-1],e=a.call(d);return typeof e=="function"&&(e=e.call(d)),e=e.toString(),this.c&&~e.indexOf("{{")?this.c.compile(e).render(d,c):e}};var b=/&/g,c=//g,e=/\'/g,f=/\"/g,g=/[&<>\"\']/,i=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}})(typeof exports!="undefined"?exports:Hogan),function(a){function h(a){a.n.substr(a.n.length-1)==="}"&&(a.n=a.n.substring(0,a.n.length-1))}function i(a){return a.trim?a.trim():a.replace(/^\s*|\s*$/g,"")}function j(a,b,c){if(b.charAt(c)!=a.charAt(0))return!1;for(var d=1,e=a.length;d0){g=a.shift();if(g.tag=="#"||g.tag=="^"||l(g,d))c.push(g),g.nodes=k(a,g.tag,c,d),e.push(g);else{if(g.tag=="/"){if(c.length===0)throw new Error("Closing tag without opener: /"+g.n);f=c.pop();if(g.n!=f.n&&!m(g.n,f.n,d))throw new Error("Nesting error: "+f.n+" vs. "+g.n);return f.end=g.i,e}e.push(g)}}if(c.length>0)throw new Error("missing closing tag: "+c.pop().n);return e}function l(a,b){for(var c=0,d=b.length;c"?b+=t(a[c]):e=="{"||e=="&"?b+=u(a[c].n,p(a[c].n)):e=="\n"?b+=w('"\\n"'+(a.length-1==c?"":" + i")):e=="_v"?b+=v(a[c].n,p(a[c].n)):e===undefined&&(b+=w('"'+o(a[c])+'"'))}return b}function r(a,b,c,d,e,f){return"if(_.s(_."+c+'("'+o(b)+'",c,p,1),'+"c,p,0,"+d+","+e+', "'+f+'")){'+"b += _.rs(c,p,"+'function(c,p){ var b = "";'+q(a)+"return b;});c.pop();}"+'else{b += _.b; _.b = ""};'}function s(a,b,c){return"if (!_.s(_."+c+'("'+o(b)+'",c,p,1),c,p,1,0,0,"")){'+q(a)+"};"}function t(a){return'b += _.rp("'+o(a.n)+'",c,p,"'+(a.indent||"")+'");'}function u(a,b){return"b += (_."+b+'("'+o(a)+'",c,p,0));'}function v(a,b){return"b += (_.v(_."+b+'("'+o(a)+'",c,p,0)));'}function w(a){return"b += "+a+";"}var b=/\S/,c=/\"/g,d=/\n/g,e=/\r/g,f=/\\/g,g={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10};a.scan=function(c,d){function w(){p.length>0&&(q.push(new String(p)),p="")}function x(){var a=!0;for(var c=t;c"&&(d.indent=q[c].toString()),q.splice(c,1));else b||q.push({tag:"\n"});r=!1,t=q.length}function z(a,b){var c="="+v,d=a.indexOf(c,b),e=i(a.substring(a.indexOf("=",b)+1,d)).split(" ");return u=e[0],v=e[1],d+c.length-1}var e=c.length,f=0,k=1,l=2,m=f,n=null,o=null,p="",q=[],r=!1,s=0,t=0,u="{{",v="}}";d&&(d=d.split(" "),u=d[0],v=d[1]);for(s=0;s=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d,e){var f=this.c,g=a.call(b,d,function(a){return f.compile(a,{delimiters:e}).render(b,c)}),h=f.compile(g.toString(),{delimiters:e}).render(b,c);return this.b=h,!1},b:"",ls:function(a,b,c,d,e,f,g){var h=b[b.length-1],i=null;if(!d&&this.c&&a.length>0)return this.ho(a,h,c,this.text.substring(e,f),g);i=a.call(h);if(typeof i=="function"){if(d)return!0;if(this.c)return this.ho(i,h,c,this.text.substring(e,f),g)}return i},lv:function(a,b,c){var d=b[b.length-1],e=a.call(d);return typeof e=="function"&&(e=e.call(d)),e=e.toString(),this.c&&~e.indexOf("{{")?this.c.compile(e).render(d,c):e}};var b=/&/g,c=//g,e=/\'/g,f=/\"/g,g=/[&<>\"\']/,i=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}})(typeof exports!="undefined"?exports:Hogan),function(a){function h(a){a.n.substr(a.n.length-1)==="}"&&(a.n=a.n.substring(0,a.n.length-1))}function i(a){return a.trim?a.trim():a.replace(/^\s*|\s*$/g,"")}function j(a,b,c){if(b.charAt(c)!=a.charAt(0))return!1;for(var d=1,e=a.length;d0){g=a.shift();if(g.tag=="#"||g.tag=="^"||l(g,d))c.push(g),g.nodes=k(a,g.tag,c,d),e.push(g);else{if(g.tag=="/"){if(c.length===0)throw new Error("Closing tag without opener: /"+g.n);f=c.pop();if(g.n!=f.n&&!m(g.n,f.n,d))throw new Error("Nesting error: "+f.n+" vs. "+g.n);return f.end=g.i,e}e.push(g)}}if(c.length>0)throw new Error("missing closing tag: "+c.pop().n);return e}function l(a,b){for(var c=0,d=b.length;c"?b+=t(a[c]):e=="{"||e=="&"?b+=u(a[c].n,p(a[c].n)):e=="\n"?b+=w('"\\n"'+(a.length-1==c?"":" + i")):e=="_v"?b+=v(a[c].n,p(a[c].n)):e===undefined&&(b+=w('"'+o(a[c])+'"'))}return b}function r(a,b,c,d,e,f){return"if(_.s(_."+c+'("'+o(b)+'",c,p,1),'+"c,p,0,"+d+","+e+', "'+f+'")){'+"b += _.rs(c,p,"+'function(c,p){ var b = "";'+q(a)+"return b;});c.pop();}"+'else{b += _.b; _.b = ""};'}function s(a,b,c){return"if (!_.s(_."+c+'("'+o(b)+'",c,p,1),c,p,1,0,0,"")){'+q(a)+"};"}function t(a){return'b += _.rp("'+o(a.n)+'",c,p,"'+(a.indent||"")+'");'}function u(a,b){return"b += (_."+b+'("'+o(a)+'",c,p,0));'}function v(a,b){return"b += (_.v(_."+b+'("'+o(a)+'",c,p,0)));'}function w(a){return"b += "+a+";"}var b=/\S/,c=/\"/g,d=/\n/g,e=/\r/g,f=/\\/g,g={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10};a.scan=function(c,d){function w(){p.length>0&&(q.push(new String(p)),p="")}function x(){var a=!0;for(var c=t;c"&&(d.indent=q[c].toString()),q.splice(c,1));else b||q.push({tag:"\n"});r=!1,t=q.length}function z(a,b){var c="="+v,d=a.indexOf(c,b),e=i(a.substring(a.indexOf("=",b)+1,d)).split(" ");return u=e[0],v=e[1],d+c.length-1}var e=c.length,f=0,k=1,l=2,m=f,n=null,o=null,p="",q=[],r=!1,s=0,t=0,u="{{",v="}}";d&&(d=d.split(" "),u=d[0],v=d[1]);for(s=0;s=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d,e){var f=this.c,g=a.call(b,d,function(a){return f.compile(a,{delimiters:e}).render(b,c)}),h=f.compile(g.toString(),{delimiters:e}).render(b,c);return this.b=h,!1},b:"",ls:function(a,b,c,d,e,f,g){var h=b[b.length-1],i=null;if(!d&&this.c&&a.length>0)return this.ho(a,h,c,this.text.substring(e,f),g);i=a.call(h);if(typeof i=="function"){if(d)return!0;if(this.c)return this.ho(i,h,c,this.text.substring(e,f),g)}return i},lv:function(a,b,c){var d=b[b.length-1],e=a.call(d);return typeof e=="function"&&(e=e.call(d)),e=e.toString(),this.c&&~e.indexOf("{{")?this.c.compile(e).render(d,c):e}};var b=/&/g,c=//g,e=/\'/g,f=/\"/g,g=/[&<>\"\']/,i=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}})(typeof exports!="undefined"?exports:Hogan),function(a){function h(a){a.n.substr(a.n.length-1)==="}"&&(a.n=a.n.substring(0,a.n.length-1))}function i(a){return a.trim?a.trim():a.replace(/^\s*|\s*$/g,"")}function j(a,b,c){if(b.charAt(c)!=a.charAt(0))return!1;for(var d=1,e=a.length;d0){g=a.shift();if(g.tag=="#"||g.tag=="^"||l(g,d))c.push(g),g.nodes=k(a,g.tag,c,d),e.push(g);else{if(g.tag=="/"){if(c.length===0)throw new Error("Closing tag without opener: /"+g.n);f=c.pop();if(g.n!=f.n&&!m(g.n,f.n,d))throw new Error("Nesting error: "+f.n+" vs. "+g.n);return f.end=g.i,e}e.push(g)}}if(c.length>0)throw new Error("missing closing tag: "+c.pop().n);return e}function l(a,b){for(var c=0,d=b.length;c"?b+=t(a[c]):e=="{"||e=="&"?b+=u(a[c].n,p(a[c].n)):e=="\n"?b+=w('"\\n"'+(a.length-1==c?"":" + i")):e=="_v"?b+=v(a[c].n,p(a[c].n)):e===undefined&&(b+=w('"'+o(a[c])+'"'))}return b}function r(a,b,c,d,e,f){return"if(_.s(_."+c+'("'+o(b)+'",c,p,1),'+"c,p,0,"+d+","+e+', "'+f+'")){'+"b += _.rs(c,p,"+'function(c,p){ var b = "";'+q(a)+"return b;});c.pop();}"+'else{b += _.b; _.b = ""};'}function s(a,b,c){return"if (!_.s(_."+c+'("'+o(b)+'",c,p,1),c,p,1,0,0,"")){'+q(a)+"};"}function t(a){return'b += _.rp("'+o(a.n)+'",c,p,"'+(a.indent||"")+'");'}function u(a,b){return"b += (_."+b+'("'+o(a)+'",c,p,0));'}function v(a,b){return"b += (_.v(_."+b+'("'+o(a)+'",c,p,0)));'}function w(a){return"b += "+a+";"}var b=/\S/,c=/\"/g,d=/\n/g,e=/\r/g,f=/\\/g,g={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10};a.scan=function(c,d){function w(){p.length>0&&(q.push(new String(p)),p="")}function x(){var a=!0;for(var c=t;c"&&(d.indent=q[c].toString()),q.splice(c,1));else b||q.push({tag:"\n"});r=!1,t=q.length}function z(a,b){var c="="+v,d=a.indexOf(c,b),e=i(a.substring(a.indexOf("=",b)+1,d)).split(" ");return u=e[0],v=e[1],d+c.length-1}var e=c.length,f=0,k=1,l=2,m=f,n=null,o=null,p="",q=[],r=!1,s=0,t=0,u="{{",v="}}";d&&(d=d.split(" "),u=d[0],v=d[1]);for(s=0;s= 0; i--) { - v = ctx[i]; - if (v && typeof v == 'object' && key in v) { - val = v[key]; - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.lv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ho: function(val, cx, partials, text, tags) { - var compiler = this.c; - var t = val.call(cx, text, function(t) { - return compiler.compile(t, {delimiters: tags}).render(cx, partials); - }); - var s = compiler.compile(t.toString(), {delimiters: tags}).render(cx, partials); - this.b = s; - return false; - }, - - // higher order template result buffer - b: '', - - // lambda replace section - ls: function(val, ctx, partials, inverted, start, end, tags) { - var cx = ctx[ctx.length - 1], - t = null; - - if (!inverted && this.c && val.length > 0) { - return this.ho(val, cx, partials, this.text.substring(start, end), tags); - } - - t = val.call(cx); - - if (typeof t == 'function') { - if (inverted) { - return true; - } else if (this.c) { - return this.ho(t, cx, partials, this.text.substring(start, end), tags); - } - } - - return t; - }, - - // lambda replace variable - lv: function(val, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = val.call(cx); - if (typeof result == 'function') { - result = result.call(cx); - } - result = result.toString(); - - if (this.c && ~result.indexOf("{{")) { - return this.c.compile(result).render(cx, partials); - } - - return result; - } - - }; - - var rAmp = /&/g, - rLt = //g, - rApos =/\'/g, - rQuot = /\"/g, - hChars =/[&<>\"\']/; - - function hoganEscape(str) { - str = String((str === null || str === undefined) ? '' : str); - return hChars.test(str) ? - str - .replace(rAmp,'&') - .replace(rLt,'<') - .replace(rGt,'>') - .replace(rApos,''') - .replace(rQuot, '"') : - str; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }; - -})(typeof exports !== 'undefined' ? exports : Hogan); - - - - -(function (Hogan) { - // Setup regex assignments - // remove whitespace according to Mustache spec - var rIsWhitespace = /\S/, - rQuot = /\"/g, - rNewline = /\n/g, - rCr = /\r/g, - rSlash = /\\/g, - tagTypes = { - '#': 1, '^': 2, '/': 3, '!': 4, '>': 5, - '<': 6, '=': 7, '_v': 8, '{': 9, '&': 10 - }; - - Hogan.scan = function scan(text, delimiters) { - var len = text.length, - IN_TEXT = 0, - IN_TAG_TYPE = 1, - IN_TAG = 2, - state = IN_TEXT, - tagType = null, - tag = null, - buf = '', - tokens = [], - seenTag = false, - i = 0, - lineStart = 0, - otag = '{{', - ctag = '}}'; - - function addBuf() { - if (buf.length > 0) { - tokens.push(new String(buf)); - buf = ''; - } - } - - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = - (tokens[j].tag && tagTypes[tokens[j].tag] < tagTypes['_v']) || - (!tokens[j].tag && tokens[j].match(rIsWhitespace) === null); - if (!isAllWhitespace) { - return false; - } - } - - return isAllWhitespace; - } - - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (!tokens[j].tag) { - if ((next = tokens[j+1]) && next.tag == '>') { - // set indent to token value - next.indent = tokens[j].toString() - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({tag:'\n'}); - } - - seenTag = false; - lineStart = tokens.length; - } - - function changeDelimiters(text, index) { - var close = '=' + ctag, - closeIndex = text.indexOf(close, index), - delimiters = trim( - text.substring(text.indexOf('=', index) + 1, closeIndex) - ).split(' '); - - otag = delimiters[0]; - ctag = delimiters[1]; - - return closeIndex + close.length - 1; - } - - if (delimiters) { - delimiters = delimiters.split(' '); - otag = delimiters[0]; - ctag = delimiters[1]; - } - - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text.charAt(i) == '\n') { - filterLine(seenTag); - } else { - buf += text.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag = tagTypes[text.charAt(i + 1)]; - tagType = tag ? text.charAt(i + 1) : '_v'; - if (tagType == '=') { - i = changeDelimiters(text, i); - state = IN_TEXT; - } else { - if (tag) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text, i)) { - tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag, - i: (tagType == '/') ? seenTag - ctag.length : i + otag.length}); - buf = ''; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == '{') { - if (ctag == '}}') { - i++; - } else { - cleanTripleStache(tokens[tokens.length - 1]); - } - } - } else { - buf += text.charAt(i); - } - } - } - - filterLine(seenTag, true); - - return tokens; - } - - function cleanTripleStache(token) { - if (token.n.substr(token.n.length - 1) === '}') { - token.n = token.n.substring(0, token.n.length - 1); - } - } - - function trim(s) { - if (s.trim) { - return s.trim(); - } - - return s.replace(/^\s*|\s*$/g, ''); - } - - function tagChange(tag, text, index) { - if (text.charAt(index) != tag.charAt(0)) { - return false; - } - - for (var i = 1, l = tag.length; i < l; i++) { - if (text.charAt(index + i) != tag.charAt(i)) { - return false; - } - } - - return true; - } - - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], - opener = null, - token = null; - - while (tokens.length > 0) { - token = tokens.shift(); - if (token.tag == '#' || token.tag == '^' || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - instructions.push(token); - } else if (token.tag == '/') { - if (stack.length === 0) { - throw new Error('Closing tag without opener: /' + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); - } - opener.end = token.i; - return instructions; - } else { - instructions.push(token); - } - } - - if (stack.length > 0) { - throw new Error('missing closing tag: ' + stack.pop().n); - } - - return instructions; - } - - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = '#'; - return true; - } - } - } - - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - - function writeCode(tree) { - return 'i = i || "";var b = i + "";var _ = this;' + walk(tree) + 'return b;'; - } - - Hogan.generate = function (code, text, options) { - if (options.asString) { - return 'function(c,p,i){' + code + ';}'; - } - - return new Hogan.Template(new Function('c', 'p', 'i', code), text, Hogan); - } - - function esc(s) { - return s.replace(rSlash, '\\\\') - .replace(rQuot, '\\\"') - .replace(rNewline, '\\n') - .replace(rCr, '\\r'); - } - - function chooseMethod(s) { - return (~s.indexOf('.')) ? 'd' : 'f'; - } - - function walk(tree) { - var code = ''; - for (var i = 0, l = tree.length; i < l; i++) { - var tag = tree[i].tag; - if (tag == '#') { - code += section(tree[i].nodes, tree[i].n, chooseMethod(tree[i].n), - tree[i].i, tree[i].end, tree[i].otag + " " + tree[i].ctag); - } else if (tag == '^') { - code += invertedSection(tree[i].nodes, tree[i].n, - chooseMethod(tree[i].n)); - } else if (tag == '<' || tag == '>') { - code += partial(tree[i]); - } else if (tag == '{' || tag == '&') { - code += tripleStache(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag == '\n') { - code += text('"\\n"' + (tree.length-1 == i ? '' : ' + i')); - } else if (tag == '_v') { - code += variable(tree[i].n, chooseMethod(tree[i].n)); - } else if (tag === undefined) { - code += text('"' + esc(tree[i]) + '"'); - } - } - return code; - } - - function section(nodes, id, method, start, end, tags) { - return 'if(_.s(_.' + method + '("' + esc(id) + '",c,p,1),' + - 'c,p,0,' + start + ',' + end + ', "' + tags + '")){' + - 'b += _.rs(c,p,' + - 'function(c,p){ var b = "";' + - walk(nodes) + - 'return b;});c.pop();}' + - 'else{b += _.b; _.b = ""};'; - } - - function invertedSection(nodes, id, method) { - return 'if (!_.s(_.' + method + '("' + esc(id) + '",c,p,1),c,p,1,0,0,"")){' + - walk(nodes) + - '};'; - } - - function partial(tok) { - return 'b += _.rp("' + esc(tok.n) + '",c,p,"' + (tok.indent || '') + '");'; - } - - function tripleStache(id, method) { - return 'b += (_.' + method + '("' + esc(id) + '",c,p,0));'; - } - - function variable(id, method) { - return 'b += (_.v(_.' + method + '("' + esc(id) + '",c,p,0)));'; - } - - function text(id) { - return 'b += ' + id + ';'; - } - - Hogan.parse = function(tokens, options) { - options = options || {}; - return buildTree(tokens, '', [], options.sectionTags || []); - }, - - Hogan.cache = {}; - - Hogan.compile = function(text, options) { - // options - // - // asString: false (default) - // - // sectionTags: [{o: '_foo', c: 'foo'}] - // An array of object with o and c fields that indicate names for custom - // section tags. The example above allows parsing of {{_foo}}{{/foo}}. - // - // delimiters: A string that overrides the default delimiters. - // Example: "<% %>" - // - options = options || {}; - - var key = text + '||' + !!options.asString; - - var t = this.cache[key]; - - if (t) { - return t; - } - - t = this.generate(writeCode(this.parse(this.scan(text, options.delimiters), options)), text, options); - return this.cache[key] = t; - }; -})(typeof exports !== 'undefined' ? exports : Hogan); - - -var Mustache = (function (Hogan) { - - // Mustache.js has non-spec partial context behavior - function mustachePartial(name, context, partials, indent) { - var partialScope = this.f(name, context, partials, 0); - var cx = context; - if (partialScope) { - cx = cx.concat(partialScope); - } - - return Hogan.Template.prototype.rp.call(this, name, cx, partials, indent); - } - - var HoganTemplateWrapper = function(renderFunc, text, compiler){ - this.rp = mustachePartial; - Hogan.Template.call(this, renderFunc, text, compiler); - }; - HoganTemplateWrapper.prototype = Hogan.Template.prototype; - - // Add a wrapper for Hogan's generate method. Mustache and Hogan keep - // separate caches, and Mustache returns wrapped templates. - var wrapper; - var HoganWrapper = function(){ - this.cache = {}; - this.generate = function(code, text, options) { - return new HoganTemplateWrapper(new Function('c', 'p', 'i', code), text, wrapper); - } - }; - HoganWrapper.prototype = Hogan; - wrapper = new HoganWrapper(); - - return { - to_html: function(text, data, partials, sendFun) { - var template = wrapper.compile(text); - var result = template.render(data, partials); - if (!sendFun) { - return result; - } - - sendFun(result); - } - } - -})(Hogan); diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js b/static/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js deleted file mode 100644 index 8958a70a..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var Hogan = {}; - -(function (Hogan) { - Hogan.Template = function constructor(renderFunc, text, compiler) { - if (renderFunc) { - this.r = renderFunc; - } - this.c = compiler; - this.text = text || ''; - } - - Hogan.Template.prototype = { - // render: replaced by generated code. - r: function (context, partials, indent) { return ''; }, - - // variable escaping - v: hoganEscape, - - render: function render(context, partials, indent) { - return this.ri([context], partials || {}, indent); - }, - - // render internal -- a hook for overrides that catches partials too - ri: function (context, partials, indent) { - return this.r(context, partials, indent); - }, - - // tries to find a partial in the curent scope and render it - rp: function(name, context, partials, indent) { - var partial = partials[name]; - - if (!partial) { - return ''; - } - - if (this.c && typeof partial == 'string') { - partial = this.c.compile(partial); - } - - return partial.ri(context, partials, indent); - }, - - // render a section - rs: function(context, partials, section) { - var buf = '', - tail = context[context.length - 1]; - - if (!isArray(tail)) { - return buf = section(context, partials); - } - - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - buf += section(context, partials); - context.pop(); - } - - return buf; - }, - - // maybe start a section - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - - if (isArray(val) && val.length === 0) { - return false; - } - - if (typeof val == 'function') { - val = this.ls(val, ctx, partials, inverted, start, end, tags); - } - - pass = (val === '') || !!val; - - if (!inverted && pass && ctx) { - ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); - } - - return pass; - }, - - // find values with dotted names - d: function(key, ctx, partials, returnFound) { - var names = key.split('.'), - val = this.f(names[0], ctx, partials, returnFound), - cx = null; - - if (key === '.' && isArray(ctx[ctx.length - 2])) { - return ctx[ctx.length - 1]; - } - - for (var i = 1; i < names.length; i++) { - if (val && typeof val == 'object' && names[i] in val) { - cx = val; - val = val[names[i]]; - } else { - val = ''; - } - } - - if (returnFound && !val) { - return false; - } - - if (!returnFound && typeof val == 'function') { - ctx.push(cx); - val = this.lv(val, ctx, partials); - ctx.pop(); - } - - return val; - }, - - // find values with normal names - f: function(key, ctx, partials, returnFound) { - var val = false, - v = null, - found = false; - - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - if (v && typeof v == 'object' && key in v) { - val = v[key]; - found = true; - break; - } - } - - if (!found) { - return (returnFound) ? false : ""; - } - - if (!returnFound && typeof val == 'function') { - val = this.lv(val, ctx, partials); - } - - return val; - }, - - // higher order templates - ho: function(val, cx, partials, text, tags) { - var compiler = this.c; - var t = val.call(cx, text, function(t) { - return compiler.compile(t, {delimiters: tags}).render(cx, partials); - }); - var s = compiler.compile(t.toString(), {delimiters: tags}).render(cx, partials); - this.b = s; - return false; - }, - - // higher order template result buffer - b: '', - - // lambda replace section - ls: function(val, ctx, partials, inverted, start, end, tags) { - var cx = ctx[ctx.length - 1], - t = null; - - if (!inverted && this.c && val.length > 0) { - return this.ho(val, cx, partials, this.text.substring(start, end), tags); - } - - t = val.call(cx); - - if (typeof t == 'function') { - if (inverted) { - return true; - } else if (this.c) { - return this.ho(t, cx, partials, this.text.substring(start, end), tags); - } - } - - return t; - }, - - // lambda replace variable - lv: function(val, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = val.call(cx); - if (typeof result == 'function') { - result = result.call(cx); - } - result = result.toString(); - - if (this.c && ~result.indexOf("{{")) { - return this.c.compile(result).render(cx, partials); - } - - return result; - } - - }; - - var rAmp = /&/g, - rLt = //g, - rApos =/\'/g, - rQuot = /\"/g, - hChars =/[&<>\"\']/; - - function hoganEscape(str) { - str = String((str === null || str === undefined) ? '' : str); - return hChars.test(str) ? - str - .replace(rAmp,'&') - .replace(rLt,'<') - .replace(rGt,'>') - .replace(rApos,''') - .replace(rQuot, '"') : - str; - } - - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === '[object Array]'; - }; - -})(typeof exports !== 'undefined' ? exports : Hogan); - diff --git a/static/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js b/static/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js deleted file mode 100644 index 4ec57960..00000000 --- a/static/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/** -* @preserve Copyright 2012 Twitter, Inc. -* @license http://www.apache.org/licenses/LICENSE-2.0.txt -*/ -var Hogan={};(function(a){function h(a){return a=String(a===null||a===undefined?"":a),g.test(a)?a.replace(b,"&").replace(c,"<").replace(d,">").replace(e,"'").replace(f,"""):a}a.Template=function j(a,b,c){a&&(this.r=a),this.c=c,this.text=b||""},a.Template.prototype={r:function(a,b,c){return""},v:h,render:function(b,c,d){return this.ri([b],c||{},d)},ri:function(a,b,c){return this.r(a,b,c)},rp:function(a,b,c,d){var e=c[a];return e?(this.c&&typeof e=="string"&&(e=this.c.compile(e)),e.ri(b,c,d)):""},rs:function(a,b,c){var d="",e=a[a.length-1];if(!i(e))return d=c(a,b);for(var f=0;f=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d,e){var f=this.c,g=a.call(b,d,function(a){return f.compile(a,{delimiters:e}).render(b,c)}),h=f.compile(g.toString(),{delimiters:e}).render(b,c);return this.b=h,!1},b:"",ls:function(a,b,c,d,e,f,g){var h=b[b.length-1],i=null;if(!d&&this.c&&a.length>0)return this.ho(a,h,c,this.text.substring(e,f),g);i=a.call(h);if(typeof i=="function"){if(d)return!0;if(this.c)return this.ho(i,h,c,this.text.substring(e,f),g)}return i},lv:function(a,b,c){var d=b[b.length-1],e=a.call(d);return typeof e=="function"&&(e=e.call(d)),e=e.toString(),this.c&&~e.indexOf("{{")?this.c.compile(e).render(d,c):e}};var b=/&/g,c=//g,e=/\'/g,f=/\"/g,g=/[&<>\"\']/,i=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}})(typeof exports!="undefined"?exports:Hogan) \ No newline at end of file diff --git a/static/build/node_modules/hogan.js/web/favicon.ico b/static/build/node_modules/hogan.js/web/favicon.ico deleted file mode 100644 index 627ee837aaaadef98491f3fd9fd66009a087c83c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1150 zcmZQzU<5(|0R|wcz>vYhz#zuJz@P!dKp~(AL>x#lFaYJy!Tx$`aybN>htpQCaS5a z-GuRpvH#DXKa4Q-5)u;6`S|!g!1y4y5wag7&%wd*9i~S`Mddb#&BVm?ml(YuH6Z_k z^oWRvyz=w&+X&PD>eVZeTeohhELyZE2IRL(mo8~Pd-hDCqN1XG!h{KVAU??dps)t% z0fphVZQDFRY-|{0zJh|nJ#2Cyu@x&;gn``C($Z21a}zGL$l{_}{E$be2k8L-mI{3y diff --git a/static/build/node_modules/hogan.js/web/images/logo.png b/static/build/node_modules/hogan.js/web/images/logo.png deleted file mode 100644 index d25879da6a9595111aa389b4b98e56762a4179c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3389 zcmV-D4Z`w?P)u*R4AB)j6k5ow{^>ehv%< zgV991fxCdgU@(C(7z{?q*xCC3P)J1h{5U|HdO`+-zh4Sj@K7=scj3_R?-C)?CcfaM ztr*x`NKE;BfHuY04pWQ*5h;VwbeIOXr2(+VE+m7&U@(C(7z_pz7=yuJ0%I^33??uJ zgTY_|V=x#DCNKtr(OB$o7cdyDg=ubA!UV=(FzSZZpHN{JlEGjwfiV~i1``;A!C)AI zV_@m%qeR-jI#!x2@!zr`+awRZ_fp!Zw{20g{#3;RvWf;QQrfI9V%GR3+E^}qj4cz`2C~BkC=v0qD^%KP35qM*IRx{PLkYHRoYJ-#Nu+OVpKuq6ziSJGw-vRcG>G(!l z{j{xL^uChibTpZt(*OY^Cbr?w@%x5CPS5>8_F+Fjzw|A}r>L*y0s6S-p`CeKZ5 zohjk~?=cY)1)3|q-g{1XrhJ#9Kx2EdH3o&!Zjn+!gc#0CLPb!8#;JUyq%iFxGFDmVgni@B(; znh2la5U=Cmx(nH)OC|dike5zk(uH^k%(jf9651MhP|BXgq*ND3s5A-vS!!pCN=WiE zV^2B~66*bC4VpJS;sT|1y_cTGSCZIXC<1Ge32YOCSZageIuJc1rTsuFUY6qYv8^E{ zCpG27gV+IB*!$0 zI>2O$|IlKqJ~n*r8S&Y%K^g)T#|B&VF>X`)?Bi3<<77K#XP(jt(%Kvq^y#UEZZ#>5 zVon$XO1enjhwgMC1{M+BoF%$?CP{T;gB6Dw2cgE34$!Jg46KMfxI0nP#oaQsKvotO z(v&#HK9Qgfj0^g8K?n=zmUxrUBg~tGIL}PSI5S(I3j{{FtaoKWNK2sIsTV_j`o@qr z$*07Lxd(nu3-pNXv>}nIve?H2qECRH#U3|k{!p^)Z9+6oZRkP_j6w(pV0SJ{9mOz> z+YB-$XG~B8n~9@7C*N~kl44U7wGObg7OUE+s|(b5NXl3*EOodu1V(Xl7LF_a6x~A; zB_1G&xU9@Y?oH9Vt{mN&F@(Pny$V8@IrQm(pqFhdHaN#{hUvSlTy?1JE@WJS;_8;o zj4(0d48<<1z0(GaUB80wwI!BiOXm>fy;RQQ9B82%Ca@Y17*+ZE4(;8}p=#5FQ=2YT z9lfz7u%xAPXkj_;WXjMPY|b{?RC!?+l0XPP6maR#Hp<|xDx9dkq4Mff3?+u@Vo5GK z(AN52Dm3C^M8sSDw9x)_T1Z_9>{1}BY3}J+QOU};a%daHU0QgYuw{^iN=DQRME0S6 zLGQM@fv!3|27kw(wln)x=tae#NsCCEEwH#E#a$YbQCyP=8=@Tp&6?^n2Q(fdZ9GGS z3{=s`yyBaw;F|dU;}=Os`>?0QJ&tk3X7Xwe_8|Pmk0LW!Q_d(Yg$XPhmxX*r$j^k_ zyY;)9LcS~H&D>3|LlrVCW#@@e84kc-BD9H46_)T}0!zmuLjEM=OG4f+ka4PA%_0lwaTFGpWCB~`-}vu+I3a&0jwBR0N|uB2#0v z2eji?R1(W9E!E~AzDZ}^7V<42KS0Y$T2ogt{#O3{!JJP1y^x;@`K*w?2>BS~pOIXq zOk&EQR&B)%EXhm1c5KB~R%^&?v9&Pjn>djNT}wTt)Mg7Tix6ax`KvJ9~bgxbUVK+;KR$*a|brYg1Q7Me@! zY}iE?QlB7_L_Q(ptwR1OIbDbry-=M`M<618X`HGNtl<@sBruJ#H%A||>G+Jhm zF_|d@=Cb2Qxr{Uol-L=y`4=5li7b?kJYvn0MLXhV^ddqp;rP zTx6_NrcibB_lfQ3f%~pu=vrVlM9J_E)9m}1g>}6`-92?_VA~072Akc)Cu-21YiRv_ zF=N10P}?-VH9!(OAducM__@r(#*Gj49c=;iy*%lX2=OL{ZsVN@s z4}GF_ybMfWrsUFx@E4UNT_i9-ckS&NzmvO>GA{KXlGGI(jO%DENd=Js|DS80nd9#t zflXS)Efh(FGPd@DkjI4l1lGx~+xWPUPvsC8_0GltY;L>Jm0Imq+FVuUb5c^RFzP)9 zj4&`IN4YrK7T7ekIG0@|un%Ya{8c2c=QSdF89PemhJ8)Qe=|P&9Lk$uojM`YCT?yK z<%f{?KA7_P$8!h_P#Go`lYUq;#a84>C9tw?PG|UW|83*3hlFuXjSqJr6aTS{pZ^ct zJUuz}J|v?b!+N*!D8+AoT=sVT9_ zzCG!v`&dWJ2s$!A@1#f23yQnkNdmi^<35_YF>+AOHIcg}#|D$~Kaigod%fWE`+?&d zE=ND8@s0^>$_)2&7K9Vv3Kn%j0<@a-G0u-kM%W^T&B1>vd3Dl-lvdC^8NZXstFHw7 z?pGl@kS}q+f%5Ew!HIlJ*I)$pg(Gctk75X$77+oToeZ_mQEzr1dJbn~?y|St0=ru9 z`+JdSsvt0v?0-o#yWqdz;+`kPt`pdD3x_HX*5{t!=z2AZkOWrbLS81A@eiTJ2Ng0$OZrrG0i> zwt_i6o3g9L7FanXR>q>DE?+Lx*S5#NBuTuICA8y-2?NyvLql6z+@VQ zEC+op<#!)|i^qg~;l*FVgjony5K^}jC)zg@D~{_WJsiu z*R+7Vjtot5Nhk*nZ8Nn16DF@lq7&6Tb~-Yczl8O<$7i>Gemn5@$^+v1ks;}>-Y`%+ z(}YjkGQE^@lkDC#6P-AYwbP*im6nYR=*x>cwlz7-(gBY->C*nx}JYfiWsyRg)9~ zR4zu}LaD1bKEf#10+Zu=wW%+^!{c8|sB?zYs-zM4srsOfaxi(dALAxBo?XcLVg%I$ z&=V-{%p0Rx$Q|rPUwOv_R&VT=tY9l9ug*Z#n`^X{%>-6|B|88=rF2YO3F>8|jAlYw z_PcEuYbLN}K#@xbYitJo>Wwk#?Jg=kYR%>h??N^YDvO?4=2wT>shk2I6KaD#s7f4Z zq@^F6ZXKAwnyA?tux6!C*8N90Ox87))Rc27^&HUK3yd#{Nf{ Tt?cq#00000NkvXXu0mjfsB&2y diff --git a/static/build/node_modules/hogan.js/web/images/noise.png b/static/build/node_modules/hogan.js/web/images/noise.png deleted file mode 100644 index 99ce7572c2c8e392f775c134c111a19e07888492..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10378 zcmV;5D0SC~P)VmhR7mLMW zNxQ~1uCe^jfBv($-u14xJk4oNGwlE9M?c!aZ|u80&T)=2Y;SUtn+#ijd*A~fxcWPf zU-`;cULC*4MJ}?u(1k8E{C%Sv-Du5yuYK)nFWvwB?|;8|%wrz2y6%G?{NOgWPk;K; zhhulS%UxE#o%O6|9ri!_+0X8C)vI20b^QG2KmYRn_rL#|cY5bL-?`mq`0S5-Lp^EmAluXx1{whwr~1J=AJ?Py0k+VZ3)J?Zk{4}bW&Z+^!+-m!YdSHJqzt-deE zZ+`QeFYCGaE{}fnqt`u)#(2E%eec`$y4SsK$0aX$$<;Yu_`(^hzw|Mq2?I5 z;9GwB)1MAwNFRRr%U|B767Xhau#0=%^Pa=OAO7%%Ti*D_Hx35v`qQuDXj4RU_q*SH^t^9>``cUHcQV>;eB&E0AN8n54aYw5iBAlZ z=S44i(eTW-zy0mo8Q>fY?ltxvbna(9^O=2_gj4Sa(K@(J%)HlI-}=_=V;nan1Ao8t zr7vA`T{5q{_6SEf!m^p)p=W->MZfyhueRh%OPG1goAEMZgqr8eC9=^$k9*wX)*Xis z=O(}@PH~Fm)TFXWpu6n&v5K~=R4oJ=cA6C_q^v_9fzAg^O?^a{=VZK z?>KBved<#WszJWr{`>F0t{-0ZvX|}P?=e;GArE=TD2J5Wj`gG5&A%BJwjcV?hgKZ% zC`UQUn&&+J@sD2~=}1Q!?s2VaU2DlVf9qS{+WP$GKYw&0K^#i2BOdXH%lh7xv#TD_ z{_>Zhd5?SCW0~UyeNK%# z-!?V2NsrmDGWq5hkkFT6S?s3B#-f-A{Q&;sK z$3FJ4m)Rk-efQmW_`4GGEpK_tbz(3L#+F?zfBMtIfS>Y| zr(9}CS7TnIkAZ`b^PR79m8&f0Y=AuXcDK9TYBC^ou735a4+b~eYAkY%lK}$tH@Uox z{zW1y>1?PWN@=9bpa1;lHSc%Pi(Yh4p^yUn{i#oVYF`X^2u(X^?7LDTKod8(!3~y3 z%PJ|y8umb)G)Zf7le>Z%IiVO=_P_SEuWhZ2b!_VxjxnR({N^`X=m#0Wt!{OzrQ^T2 z_{A^2?j`6jW-Y&sS@$o0`OAk6d+lpqyTcjIO&K6MZ>pmioO7M)T&v&z_{TpE+xNcr zz1zk*>Si~)*{CFY^PAtiW21qAGr$$>1FwSRNJ?0ck(z=6_Mq$_P4#^Q-jeB!F#nT%uo zg;q2eSruVXBwqje*I#br`1#@&zqk*C?Faw($3Na87xR3LTAEn16J?)$_F1R0z*#|e z_$Y|Mfwh6bWB66n4Gx#;($%hZwUw@F6B#);6RS4A@$#3y{OTO^eXjwD8N1(QE_0dT zJ<)YxN?W#U8B|iQgIT~`$NVNt1egYY)3+MTs1syf)`P<+B{`WQS zhGw9qU~8sX9EFN7PGHh}|NGw`h(HKbB;?hve)W#y9q)L<{;5uNs%1iOT&s8Zoaa2} zng<>K_{SeQq(YWr->J$}LPi(9!WFJC7@625zx?Gdw@3s`Fq~V6enoqJIC{6LM0Jeu z`_`>nM^QWWQ~&3gdfX-Snz5=Q`I}YB*o;f)`xl3z@?15%c*l#Vk!*MlL(`g4yY+ z3=kB$cMWC083kspjR04o^ODDkvK~IdXGecR6A7xrwH$x-~8qp0Ks>|W?<5L9Ge6K`Lw4!?Q%@* z!*H+k1Jm_frMd54n^G(9aiSBQXx%%jwylvM_z=M9(VsP1Q#}%gPTf4i5YBkUGp=T= z?aXIB^YB9Gg2`Qy7?@~G2#jJJe4IDd(V{N=#(8v>aXm@Ih-F2x$KyG>U}r{A)zMuJ5p+lInm#26S)H2 z(MSfn=lM)RkgGIm-N%>XwK9h!9{o;m>M6npv>E#?C1S>Hn*hU{^w>yq>hOY&t=g+%s}64P>Y5Kgg+WR{P>Imw;OMbdVrUpk zJg8+(xO_PG#(n{ArBhKQ#t0)l%eC=r(1*M)Ac3M)V-JZ3_e3w9B4&s;@&B<$6R+#5OzJ2wZIyfeUnOkfSljm-_mgs_Nemv-{~u#>mHhOHY1{{6(@tNO^DG z7wuwdlB<#cBX1N5ES#>iNEO?0u*q1)#t$Z42^&PvzoD}P3X+M}cS3tH>Y+-XVFK;O zF)-`YHYNzibzphl3PaZLk0jW9A8e6pUh|rxgG$GF9^A0%^#Bxd<0(V9{_SAUkY)_3 z-gCayJ{9K0z)$cZ?G;qG1Tw~m6W6x#@?L^jEvWfi7Ay8vm-xV9AqKA6-b#P8KP&y@R z?Q5ZO$07~id_N{6TOikjjggS4MyH*_`#A>KkI6V?DA=iJCOeBrW$YT?gG~mi$oYof zK-X0|VHbKG?}2L9hUQ*iXf{ND$RYYg2ecjffHuQ!Hi`qP-=VWFk7+Ec7RmWG@>g^; z_WvdtyLHlosgsTo0xAUX^H}Ux1~BrTMjtS-Gi-xzsoraCt%~wtzvOrGt#a*r2N?v{ z8|x;@mxPfXY0yDb)r^Fww1L0E@DQX2eN^qoyhaIUET1T)9)6gC@1w6PpNnJ@l_cJ( z(m|E9x46YER?ipl%J6&N4{)IRJ$TL^5^#+r)(QElJ8eJL^n%*h z0xPu>9DvAVgw_+_e!|olDC+x}#FiQfc39@mo0Fbum;MoJ7$EIo%5_p{C&7Fw66v!K zQPeu<1UF$as1j7~FAZ-e);>~%(D1Yi=IUf^l&7vkuAa*TN)(OX62?TeKwa9%c*jYY zI(;oaBXKJo{7nNe)d&7Y70tpEUZ=z`mwh8i$>efCGQ$s*f@{ci&m8ZuzSO}A!O$P* z=1LeGYf6-y6b39>MTPc=M?7Mkt)_p%#45ha`{)gy0|T;2W6%sLPc3|rTOEO@TB=>x zL#fFKJyS#i829Ht|M_tL>c}RgAtRz|9||U=+PKbM=`_<$Gws~`X$@r2IUJqC(J10H zin!=}fkT%spnWrz>s{4URfr^NkRu2_^SJYUy*D6)zawqb>(l2_C8CVRd#H=6>pMw7 zZKl-W<$wSAE)tq`$?#7VJAo^+1{)6@(?5;}>$b718;eCuu&TQ8Vdl^$Lp|>;# zP~Yl%0Ue8SH8D0Z?l#0Y1$}cJKB=Um43){Ys|&F&Itq1jMxoZ&Fl(IUGsaLP{Y|J{ zGN6Q{voVeUB7Qpn2Du-3PEC=Xn*6(Ky7!`19D#^2RH<}bbyy9vE;QGL=Jpl@aM6R% zFl;-5XC1+eRcB_Z&g?mHF=K?I6fk$acC=}x!qcg0W&JOL=UBo(qO&Mn%^^rt zG$*|8GGaXDLrjAz6>)3S|&Ax;je~beQ5$6Q6(~tmJ_B3q@z=ky;0tZ#LAZ%TU z0JrnET(st(+~YMw*AlfQDiU?k`2lSQwH-8V2X!@)u13sB{3(Lf2#4GI_=Qzi*6Y2gR zuvxTT-+FzobUeM%al?DP5>^)|pDR$_hH4wCU2}Lk%&N2LI-71fo9-YxQxCRkt>;3h zOfm~ZRIaV+HKh)zH5h}JDiZrO2gM4K>Hl(qWZByKea3t_sSN-%VjUq+%i^v}x$Wf! zdbxq!VYvYS0nV|!YNmigFBvR3RqHv+hjKlP!4!v`Nl|dzRuiNl&qlr)`5H&Q7L7VJ z>a>|qC;K&l6ID6yP0cZ@(a(MVYJ&9ATnB$?F5{x|8S3kakT8I?Kiy}LFi3HriemXY z96tNbZ=J*U(*~SV4^3#BQ#pY86V*#Q(Pq3^LjRksjBQs|?8=H=S#hJvip{OM=yn&~ z9uKNrG<|J1 z(61vMFAV&bFl24&*?bVNEh02KEFnbSE zP<2A2*!TCk1f7x0nN3&gh-LLiwpkHU&Z{$31kFHA2Abed2tXqjgI=FYElSZ9YYth( zn&!;SnLBxHCV8zf_y!vqY?uQZdhy2b#T#4gY_)TEhmK)t5TaGxX;pX8>uB^k8ePDA zx`6qbgE(HQSf^!Jw>M40CWG-(#lk*e@R;dvFQpJMPj+Y>R09$rF7@X0scaOW=)NHc z+++X!_g@myLC4q74s}>nEPOI!eh7_X7)7!2{A_h2ccl5*PB5o zyabtHb2D5$Hgh*@hB!{g}(HSQhYB`g$+D^OZ)@R&X-s-(xm0+XSIxUZ~0VbU?R&*X#8I zjq@THKyU$I#JRBT3{B88Y1yFKNrVE74WJIgIRlpu;N>-_>iIax@|ey{K5`6D@Z6e* zAmj(PtX|)-$&Kx?(F#$7jriUPtBSjes2F~cWpM;0GIX7Z3i?F<6ZBV!I>Y3>2ew5L zTtoPW9K!GAyLw55UQ%JE=2{m}>jG*!S3vEc;|axUgQ&|_WGQXGv2`Z1f9q0vQxi1_ z992)7Qu|NUa#y91FS^W5+e>XPP1{Rdm9N)e@5N7N7C-HE$$MS$UJ`r8re5?~Annm_ zkN&hre>1OdJxD{i0BF@%^yyfF&{*jj)e83$D@Sse-KOqd!>|Dv3kZ-aiu zpl^)4ORaXP)tTaj3k}!WstOS{T%SmOLv4)}s9l?W{r_PqJhx)##AUX%@Ku-nORj!-;sBfiCQoYvgUQ>d#Ckc0{?_Cp+l7^gIHN++jY5i0JHT&(i-zusb>26`^Of1vr zcH9oD)tMI^57a5Wozgoq-n~>nFBPz>mI|n`R;KG_S_BdpnxS8f2*7BU!8*z3=m{oW z30VfDnlGfB!K>96Pt~2iLb{^nrux_FN2?!)SpCQZw!BBpQOAvt31!~5qEj_2rUn*z z9X`0J8VS34&CO1;>`IBfEW_Ng484qUM*(*f@HE2N_C?zld#!yzsE(2?r6L;BYH9Ee z%jmF-UT%A)RBh|#t($MACDZ00TPM08#MnJjDhwKeK0)pD}n(5F~5na&9s;?4vAFmy8eTVSgiuyie`Bl%~d-)%zj2YfY>yB0;}f z6p#w>*~k2z&wzoU(%|b+LNehTnZtSwoGYLmT~O)qBCtMN{+#@j)KjmkADH-pOc05xpddF^v~?YpW(qbdpN zf~r)Is;k7zREcT4zCGbxUu?R-$D$fXISaWsBW2A^uLdJrG4mfJ9Acd|T4)FHm=Uf< zuDT!$eupVS(YJ5kz6zg47xw)6d{^hy)*4f@Y#O)#3`}BF zA0!ILsE(f%>+82v|45d1tpEswj;)7X0W!nya97oe+LBRdufXv^mCRkSL~B)Tvsp5B zijk^H@2Sxm-Eke}()QYny*7yt69OX9)|mgXLe&Wcngbx`OyVA!45(){$tg<>ss7a_ zoQyh`UfsG@dTnGdT8%|yW-O{xoj;KxJC8odoQqy>esiujzvwcTyHA%DnsUi!x^b$#|&4rabcofwH_8~430R{7&G0~Ou%YbIVhILp9>H~eW24EIODZ) z$$?&0u9ubD6?F_c(69pyH*KI{9S@=E^y0Hk&wLdaiw*^EXt|-~8EAQTNsix0^~e;= zj19w3_BY{8g7#`a-T?<3FdQEwu!ALcddk!;TmHFtv#M~gyGDN zfyF4YV7B{6j|44DwY5r0suk++FgevskwNW-bo$lF4I{}ovRt4w?Th?qsH(SwM-$RBru%+;|HKvS-B41q3I0UK#$#>Pj+gbH$YT~QfN_4>9L^2o~ zMwugtyM0!Nz0YdVgVK(~b|g;w!@8r}@z{>X8OP(Iol%FsGb;NLqTw3)L7z%GUB~iK zn9xG$ATN~=fX>yitJ61|lb{l9`mhWo_Z%FXOgITSb4v__O+*R6U@CTs37_}K{&F&k zj7~0i6YnOSBK4V+l?Jh2lff~$QM(K5z4unlYha*(fsKHHF2dGD*beiG>E@vT%jf<0 z)~vDYalQdx6t-hJ2-QMZx=sIGN_r;*@Hn)D_M;>jW^Fl^_fxwrX-_!wKl~nm2>2KkO=Nm{SdVl z$uXuzBE^{qV@ti|y?uV#fnBitVB`@w5ro4i_LT*#!KW=3sgB0Jv)$Chilrxqs`xVv z)S{LfC7m}z37E7X6=NYJ>ZBEVlw(azC?{?@rxerJK^})#(Q$!u$0jO! z^8ITw!>z_w)$=UvS(_?u?eiM@RQtN>+%^9{{V+CtD@r!@^&u!VRJ}Kyy55OPow(FB zv8J8Ki}o9|-=NpLpI-C+aC70;zcacQ2Oxe8AvQBO~*clqvhFgH!b36k;vt`+iFOjNAY~NS~2FQX*!V4gkPG)HSenoy;2eNSZ1jd^YzwDD3C|1L3?_ zg9$Hk=13?WX&DdH27Vj(o7uo`j&vAvB%V`4QkcLx0#lM_{s>__HPFuLkc?A}Q|o2* zcFmeFi%!?80T(m*m26d~i z)9PzG?b>PAnV&P6pG_=HES)AilP0{_U6?E&F@;a=Nyt=;9VN_o!tDBo> z#or<^?7JWjQ4CokRq!A~?#Xk{cf_y5K9i+=Tf5Y^b@-+<_R3Yga@Fo!EU>GWboG+1 zUNTcEcF}=vhh5+s>Q6>CSE9l3Dx}PWp^vHonb!z=>QI%_8nKIG)%QuF@E$NMp<8wJ zDaRcRyU1%Z-BxMg`yp*=m`h4RvmvYcUY{{W6H0gNJ2NB`TF=HfqLTUT82R{8@*Lpm zxggp_d&1ijzL`DY=^RGuz@7yp;5}dpnL6#gK+#|T2!NH&mk$$NNF5nss2=)GNh|0b`{00qG%Px|8AKW$&|bP zRoB1j`d4M#v(nEn$a32{NTkB%0y-Fhc{B7!Rg|$N8h|km`olvr_%BQIVak zIvrp|KZNW1*8oKFZm^j^^)M{QzQ>U9vBtCOw+KGa2NEzUAF5_DimKKz0nWP^ITKwEY^omEqH85} z1(mL#GF?HXId5~`uEaRw{9aT;#s=q=SitUGe~-}Wji66DKUX>G!gL*uzo&-dFPc*} zr|dAH=`f*2ej54N<;V~F>D0uZW6T#$(XllXu}@8}&9IuRNl@uVM(45<8^N}!?+LeK zQp{EMS#;WKr@c0OKFvfI9Tu^9!XjX1$#4=GQ_Zm2NhSwbZ3H`^7KE5nt+fOE9#A|c z3g>SY2lS$Cinb{_^CZA&au)m9#6v) zu0?3IoKoGTyypt z^iu;`;ofQI&V|}D5oKiBp3)TeaNH|>&e?BcLSmtAFFdzVnH;wS-c3EsKr?d-s^NX$ zfd_7_rB*a%r;v|?{pxc~))CT7sg}eKys7x+JUh{jMM790IibRYAL}yM7}=@<>|26{ z{xKJVkeE~%Yxy8xUDP?w5tdG;8fZUktixo;q8mPArA z3BjA#h17#NCLCR?AyE*jd;tAbF+A3+9+>ButFjRxOyypn zR>>H~B3j3`8Rk$8XS~bwgGMV}aM2Mb_newH_8l6&c}!KUftLRr(6VU#xnbRgb*FuQ zi~m_o)0u#{dR(2}()45Z$jD(p0JGlskh~v8e%c5g=NsTY=-^q?NqZ+D)-0havBG)C zwnI0TV7lnu<}bR}I)3Z;oeVaY4A%O3>+9_popy}w@)X5}e;fYYOz`ibml{6&mm2PB zGP`dznIR>yMv9IN0NI2ap$&AJ4^HS+l*0kDQeqZi6A{U!x)9+IH@Y`ImKq0?x~})2 z^D{<=1_)78F=-j{lB=cGI<++|7M++$1=GMjQVI|~tWjT4Fx5uTI91ME25uuY(tRf$ z_aIUhV#a2xM6EHe8Un)_TRN>_{&};ZYcTba$UD6xve#$0QL0F;CAksgi?jlPiFkF&ZKvFJ%I!uex1E^O ziAlW__4rcM8?KMg3u^X)n!C+{numk)dC?WccfX3_OcV*7#zHedzzkfLAW8?Q175@M z`F-owt;?xNlLju&)cNMhSgG_n z%D(ek=a_K9{Byo8SL~Y5LYhl;h)jpbOoqsGRr5yF8c~}?)Or!kUPN>ET|_gFr|Mo? zhQlZ&b#8M^PzOd;$7~M4?clu*-s?*4b74}gllEHaT@-w}D0o-?=#=A5N0`xQ7Gqo> zKUgA3=T{w2xt4^jUg`SWK&92WmM@yl!z${T&7Moe^C=Ea#+>g|E3}MFG&#cB8^CW_m<@z&PckDXs4ZXeEDr2ab%pqY_IWK+S3c;1Ak>Cl_ z3o78K(-8|(^tS{fI9^qh8l9b!|c`SY((vL;nf;1SL;RFhg_Gg0%2(V zcgFR>bPV~={#~u{-Z=O?4xRn^*D&!?U6w)O)ZHlG z2Pv%MH{aj96d3AMGzaf8)=xm_HD70CCbV(h#(5j((>Y9gObJMj={!W*pu(Yxqchj* zlQSB>lQ|xon@L%8N~$24xJ8hrA{n^Q`_#Tm$W!lmy6P)(q+6$0Vp$^k{`fxDc%!$| zYrlNVc<;@8e}Cq^>GOTxF;oI?L`XbkGT>;#J3Yh182|R)+a0)KL zunp58a18EgtdytGV8>VyJb`^yplj1Ha0s5knq#gMTkr;U!N_l>65Sr7mGW(Xv=dKR zu+5-vc%M;|NnQuQRa9hu)Hs<1Gx7ndOe--A+g+}o1Uo8IF2ZE007DMlqmX(v-0*TP%7N{CTUnWudpplaFbxz7Vty%nHsh@#ntmv|I zy3@yoQkt>6n0lItj3raumh;?*tZbQPbyXD8reTD(GHr@!qsOL!%l&3jmN?S2sV=5R z;Il_PeFZf!ZGlzifAk$X}{yZ<4`g@0M|13BftRE#6pKlv1950 O00008U}fi7AzZCsS>JibOqK978H@B_$*z82tPH-=3L+nMHy@eixgbQMGm{PyvId LtDnm{r-UW|2Jap= diff --git a/static/build/node_modules/hogan.js/web/index.html.mustache b/static/build/node_modules/hogan.js/web/index.html.mustache deleted file mode 100755 index 2350c71c..00000000 --- a/static/build/node_modules/hogan.js/web/index.html.mustache +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - Hogan.js - - - - - - - - - - - - - - - - - - -
-
-
-
-

Hogan.js

-

JavaScript templating from Twitter.

- View on Github -
-
-
- - -
-

Getting started

-

- Hogan.js is a 2.5k JS templating engine developed at Twitter. Use it as a part of your asset packager to compile templates ahead of time or include it in your browser to handle dynamic templates. -

-

- If you're developing with Node.js, just use NPM to add the Hogan package. -

-
$ npm install hogan.js
-

- Alternatively, drop hogan.js in your browser by adding the following script. -

-
<script src="http://twitter.github.com/hogan.js/builds/{{version}}/hogan.js"></script>
- -
-
- -
-
-
-
- - -
-

Templates

-

- Hogan.js was developed against the mustache test suite, so everything that holds true for templates as specified here, is also the case for hogan.js. -

-

- That means you get variables, sections, lambdas, partials, filters, and everything else you've come to expect from mustache templating - only much, much faster. -

-
-
- -
-
-
-
- - -
-

Compiling

-

- Use hogan.compile() to precompile your templates into vanilla JS. -

-

- It's best to serve your templates precompiled whenever you can (rather than the raw templates), as parsing is the most time consuming operation. -

-

-

-
-
- -
-
-
-
- - -
-

Rendering

-

- Once compiled, call the render() method with a context and optional partials object. -

-

- If supplying partials, you can compile them ahead of time, or pass string templates.

-

-

-
-
- -
- - - - - -
- - - - - diff --git a/static/build/node_modules/hogan.js/web/stylesheets/layout.css b/static/build/node_modules/hogan.js/web/stylesheets/layout.css deleted file mode 100755 index c9e3e350..00000000 --- a/static/build/node_modules/hogan.js/web/stylesheets/layout.css +++ /dev/null @@ -1,206 +0,0 @@ - - -/* #Reset & Basics (Inspired by E. Meyers) -================================================== */ - html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; } - article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { - display: block; } - body { - line-height: 1; } - ol, ul { - list-style: none; } - blockquote, q { - quotes: none; } - blockquote:before, blockquote:after, - q:before, q:after { - content: ''; - content: none; } - table { - border-collapse: collapse; - border-spacing: 0; } - - -/* #Basic Styles -================================================== */ - body { - background: #fff; - font: 14px/24px "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif; - color: #000; - -webkit-font-smoothing: antialiased; /* Fix for webkit rendering */ - -webkit-text-size-adjust: 100%; - } - a { - color: #999113; - text-decoration: none; - } - a:hover { - color: #7b750e; - text-decoration: underline; - } - - -/* #Typography -================================================== */ - h1, h2, h3, h4, h5, h6 { - font-weight: bold; } - h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-weight: inherit; } - h1 { font-size: 75px; line-height: 80px; margin-bottom: 14px;} - h2 { font-size: 35px; line-height: 40px; margin-bottom: 10px; } - h3 { font-size: 28px; line-height: 34px; margin-bottom: 8px; } - h4 { font-size: 21px; line-height: 30px; margin-bottom: 4px; } - h5 { font-size: 17px; line-height: 24px; } - h6 { font-size: 14px; line-height: 21px; } - p { margin-bottom: 22px; } - - -/* #Main styles -================================================== */ - -/* Hogan Hero */ -.hogan-hero { - position: relative; - background: #333; /* Old browsers */ - background: -moz-radial-gradient(center, ellipse cover, #333 0%, #000 100%); /* FF3.6+ */ - background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#333), color-stop(100%,#000)); /* Chrome,Safari4+ */ - background: -webkit-radial-gradient(center, ellipse cover, #333 0%,#000 100%); /* Chrome10+,Safari5.1+ */ - background: -o-radial-gradient(center, ellipse cover, #333 0%,#000 100%); /* Opera 12+ */ - background: -ms-radial-gradient(center, ellipse cover, #333 0%,#000 100%); /* IE10+ */ - background: radial-gradient(center, ellipse cover, #333 0%,#000 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#333', endColorstr='#000',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ -} -.hogan-hero .container { - padding: 180px 0; -} -.hogan-hero h1 { - letter-spacing: -3px; - color: #fff; - position: relative; - margin-bottom: 5px; -} -.hogan-hero h3 { - max-width: 650px; - margin-bottom: 20px; - color: #fff; -} -.hogan-hero .noise, -.hogan-hero .stripes { - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; -} -.hogan-hero .noise { - background: url(../images/noise.png) repeat; -} -.hogan-hero .stripes { - background: url(../images/stripes.png) repeat; -} - -/* Primary content container */ -.primary.container { - padding-top: 100px; -} - -/*Hogan divider */ -.hogan-divider { - padding-top: 60px; - border-bottom: 1px solid #ddd; - margin-bottom: 60px; - clear: both; - position: relative; -} -.hogan-icon { - width: 40px; - height: 30px; - position: absolute; - left: 50%; - top: 46px; - margin-left: -20px; - background: url('../images/small-hogan-icon.png') white no-repeat center center; -} - -/* Button style */ -.button { - display: inline-block; - cursor: pointer; - background: #dfd52e; - border-radius: 3px; - margin-bottom: 20px; - color: #000; - text-transform: uppercase; - text-decoration: none; - font-size: 15px; - padding: 0 34px; - line-height: 46px; - font-weight: bold; - -webkit-transition: background-color .3s ease-in-out; - -moz-transition: background-color .3s ease-in-out; - transition: background-color .3s ease-in-out; - -} -.button:hover { - text-decoration: inherit; - color: inherit; - background-color: #f5e810; -} - -/* Hogan footer */ -.hogan-footer { - border-top: 1px solid #ddd; - margin-top: 60px; - padding: 20px 0 40px; - color: #999; - font-size: 12px; -} -.hogan-footer .copyright { - float: left; -} -.hogan-footer .colophon { - float: right; -} - -pre, code { - background: #F8F8FF; - border: 1px solid #DDD; - padding: 5px 10px; - margin-bottom: 20px; - font-family: courier; - overflow: hidden; -} - -pre code { - border: 0; - padding: 0; - margin-bottom: 0; -} - - -/* #Media Queries -================================================== */ - - /* Smaller than standard 960 (devices and browsers) */ - @media only screen and (max-width: 959px) {} - - /* Tablet Portrait size to standard 960 (devices and browsers) */ - @media only screen and (min-width: 768px) and (max-width: 959px) {} - - /* All Mobile Sizes (devices and browser) */ - @media only screen and (max-width: 767px) { - .hogan-hero .container { - padding: 100px 0; - } - } - - /* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ - @media only screen and (min-width: 480px) and (max-width: 767px) {} - - /* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */ - @media only screen and (max-width: 479px) {} - diff --git a/static/build/node_modules/hogan.js/web/stylesheets/skeleton.css b/static/build/node_modules/hogan.js/web/stylesheets/skeleton.css deleted file mode 100755 index d0264a40..00000000 --- a/static/build/node_modules/hogan.js/web/stylesheets/skeleton.css +++ /dev/null @@ -1,236 +0,0 @@ -/* -* Skeleton V1.1 -* Copyright 2011, Dave Gamache -* www.getskeleton.com -* Free to use under the MIT license. -* http://www.opensource.org/licenses/mit-license.php -* 8/17/2011 -*/ - - -/* Table of Contents -================================================== - #Base 960 Grid - #Tablet (Portrait) - #Mobile (Portrait) - #Mobile (Landscape) - #Clearing */ - - - -/* #Base 960 Grid -================================================== */ - - .container { position: relative; width: 960px; margin: 0 auto; padding: 0; } - .column, .columns { float: left; display: inline; margin-left: 10px; margin-right: 10px; } - .row { margin-bottom: 20px; } - - /* Nested Column Classes */ - .column.alpha, .columns.alpha { margin-left: 0; } - .column.omega, .columns.omega { margin-right: 0; } - - /* Base Grid */ - .container .one.column { width: 40px; } - .container .two.columns { width: 100px; } - .container .three.columns { width: 160px; } - .container .four.columns { width: 220px; } - .container .five.columns { width: 280px; } - .container .six.columns { width: 340px; } - .container .seven.columns { width: 400px; } - .container .eight.columns { width: 460px; } - .container .nine.columns { width: 520px; } - .container .ten.columns { width: 580px; } - .container .eleven.columns { width: 640px; } - .container .twelve.columns { width: 700px; } - .container .thirteen.columns { width: 760px; } - .container .fourteen.columns { width: 820px; } - .container .fifteen.columns { width: 880px; } - .container .sixteen.columns { width: 940px; } - - .container .one-third.column { width: 300px; } - .container .two-thirds.column { width: 620px; } - - /* Offsets */ - .container .offset-by-one { padding-left: 60px; } - .container .offset-by-two { padding-left: 120px; } - .container .offset-by-three { padding-left: 180px; } - .container .offset-by-four { padding-left: 240px; } - .container .offset-by-five { padding-left: 300px; } - .container .offset-by-six { padding-left: 360px; } - .container .offset-by-seven { padding-left: 420px; } - .container .offset-by-eight { padding-left: 480px; } - .container .offset-by-nine { padding-left: 540px; } - .container .offset-by-ten { padding-left: 600px; } - .container .offset-by-eleven { padding-left: 660px; } - .container .offset-by-twelve { padding-left: 720px; } - .container .offset-by-thirteen { padding-left: 780px; } - .container .offset-by-fourteen { padding-left: 840px; } - .container .offset-by-fifteen { padding-left: 900px; } - - - -/* #Tablet (Portrait) -================================================== */ - - /* Note: Design for a width of 768px */ - - @media only screen and (min-width: 768px) and (max-width: 959px) { - .container { width: 768px; } - .container .column, - .container .columns { margin-left: 10px; margin-right: 10px; } - .column.alpha, .columns.alpha { margin-left: 0; margin-right: 10px; } - .column.omega, .columns.omega { margin-right: 0; margin-left: 10px; } - - .container .one.column { width: 28px; } - .container .two.columns { width: 76px; } - .container .three.columns { width: 124px; } - .container .four.columns { width: 172px; } - .container .five.columns { width: 220px; } - .container .six.columns { width: 268px; } - .container .seven.columns { width: 316px; } - .container .eight.columns { width: 364px; } - .container .nine.columns { width: 412px; } - .container .ten.columns { width: 460px; } - .container .eleven.columns { width: 508px; } - .container .twelve.columns { width: 556px; } - .container .thirteen.columns { width: 604px; } - .container .fourteen.columns { width: 652px; } - .container .fifteen.columns { width: 700px; } - .container .sixteen.columns { width: 748px; } - - .container .one-third.column { width: 236px; } - .container .two-thirds.column { width: 492px; } - - /* Offsets */ - .container .offset-by-one { padding-left: 48px; } - .container .offset-by-two { padding-left: 96px; } - .container .offset-by-three { padding-left: 144px; } - .container .offset-by-four { padding-left: 192px; } - .container .offset-by-five { padding-left: 240px; } - .container .offset-by-six { padding-left: 288px; } - .container .offset-by-seven { padding-left: 336px; } - .container .offset-by-eight { padding-left: 348px; } - .container .offset-by-nine { padding-left: 432px; } - .container .offset-by-ten { padding-left: 480px; } - .container .offset-by-eleven { padding-left: 528px; } - .container .offset-by-twelve { padding-left: 576px; } - .container .offset-by-thirteen { padding-left: 624px; } - .container .offset-by-fourteen { padding-left: 672px; } - .container .offset-by-fifteen { padding-left: 720px; } - } - - -/* #Mobile (Portrait) -================================================== */ - - /* Note: Design for a width of 320px */ - - @media only screen and (max-width: 767px) { - .container { width: 300px; } - .columns, .column { margin: 0; } - - .container .one.column, - .container .two.columns, - .container .three.columns, - .container .four.columns, - .container .five.columns, - .container .six.columns, - .container .seven.columns, - .container .eight.columns, - .container .nine.columns, - .container .ten.columns, - .container .eleven.columns, - .container .twelve.columns, - .container .thirteen.columns, - .container .fourteen.columns, - .container .fifteen.columns, - .container .sixteen.columns, - .container .one-third.column, - .container .two-thirds.column { width: 300px; } - - /* Offsets */ - .container .offset-by-one, - .container .offset-by-two, - .container .offset-by-three, - .container .offset-by-four, - .container .offset-by-five, - .container .offset-by-six, - .container .offset-by-seven, - .container .offset-by-eight, - .container .offset-by-nine, - .container .offset-by-ten, - .container .offset-by-eleven, - .container .offset-by-twelve, - .container .offset-by-thirteen, - .container .offset-by-fourteen, - .container .offset-by-fifteen { padding-left: 0; } - - } - - -/* #Mobile (Landscape) -================================================== */ - - /* Note: Design for a width of 480px */ - - @media only screen and (min-width: 480px) and (max-width: 767px) { - .container { width: 420px; } - .columns, .column { margin: 0; } - - .container .one.column, - .container .two.columns, - .container .three.columns, - .container .four.columns, - .container .five.columns, - .container .six.columns, - .container .seven.columns, - .container .eight.columns, - .container .nine.columns, - .container .ten.columns, - .container .eleven.columns, - .container .twelve.columns, - .container .thirteen.columns, - .container .fourteen.columns, - .container .fifteen.columns, - .container .sixteen.columns, - .container .one-third.column, - .container .two-thirds.column { width: 420px; } - } - - -/* #Clearing -================================================== */ - - /* Self Clearing Goodness */ - .container:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; } - - /* Use clearfix class on parent to clear nested columns, - or wrap each row of columns in a
*/ - .clearfix:before, - .clearfix:after, - .row:before, - .row:after { - content: '\0020'; - display: block; - overflow: hidden; - visibility: hidden; - width: 0; - height: 0; } - .row:after, - .clearfix:after { - clear: both; } - .row, - .clearfix { - zoom: 1; } - - /* You can also use a
to clear columns */ - .clear { - clear: both; - display: block; - overflow: hidden; - visibility: hidden; - width: 0; - height: 0; - } - - diff --git a/static/build/node_modules/hogan.js/wrappers/amd.js.mustache b/static/build/node_modules/hogan.js/wrappers/amd.js.mustache deleted file mode 100644 index d91ef77c..00000000 --- a/static/build/node_modules/hogan.js/wrappers/amd.js.mustache +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{{{template}}} -{{{compiler}}} - -if (typeof define === 'function' && define.amd) { - define(Hogan); -} diff --git a/static/build/node_modules/hogan.js/wrappers/common.js.mustache b/static/build/node_modules/hogan.js/wrappers/common.js.mustache deleted file mode 100644 index e823e83a..00000000 --- a/static/build/node_modules/hogan.js/wrappers/common.js.mustache +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{{{template}}} -{{{compiler}}} - -if (typeof module !== 'undefined' && module.exports) { - module.exports = Hogan; -} diff --git a/static/build/node_modules/hogan.js/wrappers/js.mustache b/static/build/node_modules/hogan.js/wrappers/js.mustache deleted file mode 100644 index 9f311f08..00000000 --- a/static/build/node_modules/hogan.js/wrappers/js.mustache +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{{{template}}} -{{{compiler}}} diff --git a/static/build/node_modules/hogan.js/wrappers/mustache.js.mustache b/static/build/node_modules/hogan.js/wrappers/mustache.js.mustache deleted file mode 100644 index d3a3d70d..00000000 --- a/static/build/node_modules/hogan.js/wrappers/mustache.js.mustache +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2011 Twitter, Inc. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// A wrapper for compatibility with Mustache.js, quirks and all - -{{{template}}} -{{{compiler}}} - -var Mustache = (function (Hogan) { - - // Mustache.js has non-spec partial context behavior - function mustachePartial(name, context, partials, indent) { - var partialScope = this.f(name, context, partials, 0); - var cx = context; - if (partialScope) { - cx = cx.concat(partialScope); - } - - return Hogan.Template.prototype.rp.call(this, name, cx, partials, indent); - } - - var HoganTemplateWrapper = function(renderFunc, text, compiler){ - this.rp = mustachePartial; - Hogan.Template.call(this, renderFunc, text, compiler); - }; - HoganTemplateWrapper.prototype = Hogan.Template.prototype; - - // Add a wrapper for Hogan's generate method. Mustache and Hogan keep - // separate caches, and Mustache returns wrapped templates. - var wrapper; - var HoganWrapper = function(){ - this.cache = {}; - this.generate = function(code, text, options) { - return new HoganTemplateWrapper(new Function('c', 'p', 'i', code), text, wrapper); - } - }; - HoganWrapper.prototype = Hogan; - wrapper = new HoganWrapper(); - - return { - to_html: function(text, data, partials, sendFun) { - var template = wrapper.compile(text); - var result = template.render(data, partials); - if (!sendFun) { - return result; - } - - sendFun(result); - } - } - -})(Hogan); diff --git a/static/build/package.json b/static/build/package.json deleted file mode 100644 index 97ab2590..00000000 --- a/static/build/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "bootstrap-doc-builder" -, "version": "0.0.1" -, "description": "build bootstrap docs" -, "dependencies": { "hogan.js": "1.0.5-dev" } -} diff --git a/static/index.html b/static/index.html deleted file mode 100644 index 8ad75d27..00000000 --- a/static/index.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - - nbviewer - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
-

IPython Notebook Viewer

-

A Simple way share your IP[y]thon Notebook as Gists.

- -
-
-
- -
-
-
-
- -
- -
-
    -
  • - - - - -
  • -
  • - - - Kippt - -
  • -
- -
- -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/js/bootstrap.min.js b/static/js/bootstrap.min.js index df4c4809..d5ccdee2 100644 --- a/static/js/bootstrap.min.js +++ b/static/js/bootstrap.min.js @@ -3,4 +3,4 @@ * Copyright 2012 Twitter, Inc. * http://www.apache.org/licenses/LICENSE-2.0.txt */ -!function(e){e(function(){"use strict";e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()},e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e(function(){e("body").on("click.alert.data-api",t,n.prototype.close)})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.parent('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")},e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e(function(){e("body").on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=n,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},to:function(t){var n=this.$element.find(".active"),r=n.parent().children(),i=r.index(n),s=this;if(t>r.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){s.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(r[t]))},pause:function(e){return e||(this.paused=!0),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f=e.Event("slide");this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u]();if(i.hasClass("active"))return;if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}},e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n);i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):typeof n=="string"||(n=s.slide)?i[n]():s.interval&&i.cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e(function(){e("body").on("click.carousel.data-api","[data-slide]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=!i.data("modal")&&e.extend({},i.data(),n.data());i.carousel(s),t.preventDefault()})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning)return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning)return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=typeof n=="object"&&n;i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e(function(){e("body").on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();e(i).collapse(s)})})}(window.jQuery),!function(e){"use strict";function r(){e(t).parent().removeClass("open")}var t='[data-toggle="dropdown"]',n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),i,s,o;if(n.is(".disabled, :disabled"))return;return s=n.attr("data-target"),s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,"")),i=e(s),i.length||(i=n.parent()),o=i.hasClass("open"),r(),o||i.toggleClass("open"),!1}},e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e(function(){e("html").on("click.dropdown.data-api",r),e("body").on("click.dropdown",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle)})}(window.jQuery),!function(e){"use strict";function n(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),r.call(t)},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),r.call(t)})}function r(e){this.$element.hide().trigger("hidden"),i.call(this)}function i(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('