diff --git a/.gitignore b/.gitignore index 3b10ffb384..ace28e663f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Ignore compiled docs +_gh_pages + # Numerous always-ignore extensions *.diff *.err diff --git a/Makefile b/Makefile index acc4d11bfb..57393d1049 100644 --- a/Makefile +++ b/Makefile @@ -1,39 +1,36 @@ BOOTSTRAP = ./docs/assets/css/bootstrap.css BOOTSTRAP_LESS = ./less/bootstrap.less DATE=$(shell date +%I:%M%p) -CHECK=\033[32m✔\033[39m -HR=\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\# - +CHECK=\033[32m✔ Done\033[39m +HR=\033[37m--------------------------------------------------\033[39m # # BUILD DOCS # build: - @echo "\n${HR}" - @echo "Building Bootstrap..." - @echo "${HR}\n" + @echo "\n\n" + @echo "\033[36mBuilding Bootstrap...\033[39m" + @echo "${HR}" @jshint js/*.js --config js/.jshintrc @jshint js/tests/unit/*.js --config js/.jshintrc - @echo "Running JSHint on javascript... ${CHECK} Done" + @echo "Running JSHint on javascript... ${CHECK}" @./node_modules/.bin/recess --compile ${BOOTSTRAP_LESS} > ${BOOTSTRAP} - @echo "Compiling LESS with Recess... ${CHECK} Done" - @node docs/build + @echo "Compiling LESS with Recess... ${CHECK}" @cp fonts/* docs/assets/fonts/ @cp js/*.js docs/assets/js/ @cp js/tests/vendor/jquery.js docs/assets/js/ - @echo "Compiling documentation... ${CHECK} Done" + @echo "Prepping fonts and JavaScript... ${CHECK}" @cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > docs/assets/js/bootstrap.js @./node_modules/.bin/uglifyjs -nc docs/assets/js/bootstrap.js > docs/assets/js/bootstrap.min.tmp.js @echo "/**\n* Bootstrap.js v3.0.0 by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js @cat docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js > docs/assets/js/bootstrap.min.js @rm docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js - @echo "Compiling and minifying javascript... ${CHECK} Done" - @echo "\n${HR}" - @echo "Bootstrap successfully built at ${DATE}." - @echo "${HR}\n" - @echo "Thanks for using Bootstrap," - @echo "<3 @mdo and @fat\n" + @echo "Compiling and minifying javascript... ${CHECK}" + @echo "${HR}" + @echo "\033[36mSuccess!\n\033[39m" + @echo "\033[37mThanks for using Bootstrap," + @echo "<3 @mdo and @fat\n\033[39m" # # RUN JSHINT & QUNIT TESTS IN PHANTOMJS diff --git a/README.md b/README.md index 786453e0e5..d1ade87419 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ -# [Bootstrap v3.0.0](http://twitter.github.com/bootstrap) [![Build Status](https://secure.travis-ci.org/twitter/bootstrap.png)](http://travis-ci.org/twitter/bootstrap) +# [Bootstrap v3.0.0](http://getbootstrap.com) [![Build Status](https://secure.travis-ci.org/twitter/bootstrap.png)](http://travis-ci.org/twitter/bootstrap) Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created and maintained by [Mark Otto](http://twitter.com/mdo) and [Jacob Thornton](http://twitter.com/fat). @@ -18,6 +18,8 @@ Three quick start options are available: * Clone the repo: `git clone git://github.com/twitter/bootstrap.git`. * Install with Twitter's [Bower](http://twitter.github.com/bower): `bower install bootstrap`. +Read the [Getting Started page](http://getbootstrap.com/getting-started/) for information on the framework contents, basic template guidelines, and more. + ## Versioning @@ -38,7 +40,7 @@ For more information on SemVer, please visit [http://semver.org/](http://semver. -## Bug tracker +## Bugs and feature requests Have a bug or a feature request? [Please open a new issue](https://github.com/twitter/bootstrap/issues). Before opening any issue, please search for existing issues and read the [Issue Guidelines](https://github.com/necolas/issue-guidelines), written by [Nicolas Gallagher](https://github.com/necolas/). @@ -55,24 +57,31 @@ Keep track of development and community news. -## Developers +## Documentation -We have included a makefile with convenience methods for working with the Bootstrap library. +Bootstrap's docs are built using [Jekyll](http://jekyllrb.com) and hosted on GitHub Pages at [http://getbootstrap.com](http://getbootstrap.com). To view our docs locally, you'll need to [install Jekyll](https://github.com/mojombo/jekyll/wiki/install) to run a local server. -+ **dependencies** -Our makefile depends on you having recess, connect, uglify.js, and jshint installed. To install, just run the following command in npm: +Documentation for [previous versions](https://github.com/twitter/bootstrap/tags) is also available via tags. + + + +## Compiling CSS and JavaScript + +Bootstrap includes a makefile with convenient methods for working with the framework. Before getting started, be sure to install the necessary local dependencies: ``` -$ npm install recess connect uglify-js jshint -g +$ npm install ``` -+ **build** - `make` -Runs the recess compiler to rebuild the `/less` files and compiles the docs pages. Requires recess and uglify-js. +Once installed, you'll be able to run the various make commands provided: -+ **test** - `make test` +#### build - `make` +Runs the recess compiler to rebuild the `/less` files and compiles the docs. Requires recess and uglify-js. + +#### test - `make test` Runs jshint and qunit tests headlessly in [phantomjs](http://code.google.com/p/phantomjs/) (used for ci). Depends on having phantomjs installed. -+ **watch** - `make watch` +#### watch - `make watch` This is a convenience method for watching just Less files and automatically building them whenever you save. Requires the Watchr gem. @@ -81,8 +90,6 @@ This is a convenience method for watching just Less files and automatically buil Please submit all pull requests against *-wip branches. If your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the [Code Guide](http://github.com/mdo/code-guide), maintained by [Mark Otto](http://github.com/mdo). -Thanks! - ## Authors diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000000..df0aece1cf --- /dev/null +++ b/_config.yml @@ -0,0 +1,13 @@ +# Dependencies +markdown: rdiscount +pygments: true + +# Permalinks +permalink: pretty + +# Server +auto: true +source: ./docs +destination: ./_gh_pages +url: http://bootstrap.dev:9001 +server_port: 9001 diff --git a/docs/_includes/colophon.html b/docs/_includes/colophon.html new file mode 100644 index 0000000000..ae92db140c --- /dev/null +++ b/docs/_includes/colophon.html @@ -0,0 +1,35 @@ + + \ No newline at end of file diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html new file mode 100644 index 0000000000..c91c7d00ed --- /dev/null +++ b/docs/_includes/footer.html @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_includes/header.html b/docs/_includes/header.html new file mode 100644 index 0000000000..fe23d008e6 --- /dev/null +++ b/docs/_includes/header.html @@ -0,0 +1,43 @@ + + + + + + + {% if page.title == "Bootstrap" %} + {{ page.title }} + {% else if %} + {{ page.title }} · Bootstrap + {% endif %} + + + + + + + + + + + + + + + + + + + + diff --git a/docs/_includes/masthead.html b/docs/_includes/masthead.html new file mode 100644 index 0000000000..205b244fee --- /dev/null +++ b/docs/_includes/masthead.html @@ -0,0 +1,8 @@ +{% raw %} +
+
+

{{ page.title }}

+

{{ page.description }}

+
+
+{% endraw %} \ No newline at end of file diff --git a/docs/_includes/navbar.html b/docs/_includes/navbar.html new file mode 100644 index 0000000000..b9d5f02792 --- /dev/null +++ b/docs/_includes/navbar.html @@ -0,0 +1,37 @@ + + diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html new file mode 100644 index 0000000000..536dae1ba2 --- /dev/null +++ b/docs/_layouts/default.html @@ -0,0 +1,23 @@ + + + + + {% include header.html %} + + + + + + {% include navbar.html %} + + + {{ content }} + + + {% include colophon.html %} + + + {% include footer.html %} + + + \ No newline at end of file diff --git a/docs/_layouts/example.html b/docs/_layouts/example.html new file mode 100644 index 0000000000..38510f13a6 --- /dev/null +++ b/docs/_layouts/example.html @@ -0,0 +1,17 @@ + + + + + {% include header.html %} + + + + + + {{ content }} + + + {% include footer.html %} + + + \ No newline at end of file diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 9ea76f713e..42d53fdd64 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -3254,7 +3254,7 @@ button.close { .navbar-inverse .nav > .active > a:hover, .navbar-inverse .nav > .active > a:focus { color: #ffffff; - background-color: #222222; + background-color: #080808; } .navbar-inverse .btn-navbar { @@ -3270,7 +3270,7 @@ button.close { .navbar-inverse .nav li.dropdown.active > .dropdown-toggle, .navbar-inverse .nav li.dropdown.open.active > .dropdown-toggle { color: #ffffff; - background-color: #222222; + background-color: #080808; } .navbar-inverse .nav li.dropdown > a:hover .caret { diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index c4e3645594..8c3c090a3d 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -198,6 +198,8 @@ section > ul li { padding: 39px 14px 14px; margin-bottom: -1px; border: 1px solid #ddd; + border-top-left-radius: 4px; + border-top-right-radius: 4px; } /* Echo out a label for the example */ .bs-docs-example:after { @@ -211,10 +213,13 @@ section > ul li { color: #9da0a4; background-color: #f5f5f5; border: 1px solid #ddd; + border-top-left-radius: 4px; + border-bottom-right-radius: 4px; } /* Tweak display of the examples */ -.bs-docs-example + .prettyprint { +.bs-docs-example + .prettyprint, +.bs-docs-example + .highlight { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; @@ -485,6 +490,33 @@ input.focused { overflow: auto; } +.highlight { + padding: 9px 14px; + margin-bottom: 14px; + background-color: #f7f7f9; + border: 1px solid #e1e1e8; + border-radius: 4px; + box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; +} +.highlight pre { + padding: 0; + margin-bottom: 0; + background-color: transparent; + border: 0; +} +.highlight pre code { + font-size: inherit; + color: #333; /* Effectively the base text color */ +} +.highlight pre .lineno { + display: inline-block; + width: 18px; + padding-right: 5px; + margin-right: 10px; + text-align: right; + color: #bebec5; +} + /* Docs gallery diff --git a/docs/assets/css/pygments-manni.css b/docs/assets/css/pygments-manni.css new file mode 100644 index 0000000000..859a67320a --- /dev/null +++ b/docs/assets/css/pygments-manni.css @@ -0,0 +1,62 @@ +.hll { background-color: #ffffcc } + { background: #f0f3f3; } +.c { color: #999; } /* Comment */ +.err { color: #AA0000; background-color: #FFAAAA } /* Error */ +.k { color: #006699; } /* Keyword */ +.o { color: #555555 } /* Operator */ +.cm { color: #0099FF; font-style: italic } /* Comment.Multiline */ +.cp { color: #009999 } /* Comment.Preproc */ +.c1 { color: #999; } /* Comment.Single */ +.cs { color: #999; } /* Comment.Special */ +.gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #003300; } /* Generic.Heading */ +.gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */ +.go { color: #AAAAAA } /* Generic.Output */ +.gp { color: #000099; } /* Generic.Prompt */ +.gs { } /* Generic.Strong */ +.gu { color: #003300; } /* Generic.Subheading */ +.gt { color: #99CC66 } /* Generic.Traceback */ +.kc { color: #006699; } /* Keyword.Constant */ +.kd { color: #006699; } /* Keyword.Declaration */ +.kn { color: #006699; } /* Keyword.Namespace */ +.kp { color: #006699 } /* Keyword.Pseudo */ +.kr { color: #006699; } /* Keyword.Reserved */ +.kt { color: #007788; } /* Keyword.Type */ +.m { color: #FF6600 } /* Literal.Number */ +.s { color: #d44950 } /* Literal.String */ +.na { color: #4f9fcf } /* Name.Attribute */ +.nb { color: #336666 } /* Name.Builtin */ +.nc { color: #00AA88; } /* Name.Class */ +.no { color: #336600 } /* Name.Constant */ +.nd { color: #9999FF } /* Name.Decorator */ +.ni { color: #999999; } /* Name.Entity */ +.ne { color: #CC0000; } /* Name.Exception */ +.nf { color: #CC00FF } /* Name.Function */ +.nl { color: #9999FF } /* Name.Label */ +.nn { color: #00CCFF; } /* Name.Namespace */ +.nt { color: #2f6f9f; } /* Name.Tag */ +.nv { color: #003333 } /* Name.Variable */ +.ow { color: #000000; } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mf { color: #FF6600 } /* Literal.Number.Float */ +.mh { color: #FF6600 } /* Literal.Number.Hex */ +.mi { color: #FF6600 } /* Literal.Number.Integer */ +.mo { color: #FF6600 } /* Literal.Number.Oct */ +.sb { color: #CC3300 } /* Literal.String.Backtick */ +.sc { color: #CC3300 } /* Literal.String.Char */ +.sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #CC3300 } /* Literal.String.Double */ +.se { color: #CC3300; } /* Literal.String.Escape */ +.sh { color: #CC3300 } /* Literal.String.Heredoc */ +.si { color: #AA0000 } /* Literal.String.Interpol */ +.sx { color: #CC3300 } /* Literal.String.Other */ +.sr { color: #33AAAA } /* Literal.String.Regex */ +.s1 { color: #CC3300 } /* Literal.String.Single */ +.ss { color: #FFCC33 } /* Literal.String.Symbol */ +.bp { color: #336666 } /* Name.Builtin.Pseudo */ +.vc { color: #003333 } /* Name.Variable.Class */ +.vg { color: #003333 } /* Name.Variable.Global */ +.vi { color: #003333 } /* Name.Variable.Instance */ +.il { color: #FF6600 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/assets/img/examples/bootstrap-example-sticky-footer-navbar.png b/docs/assets/img/examples/bootstrap-example-sticky-footer-navbar.png new file mode 100644 index 0000000000..4ad0e86819 Binary files /dev/null and b/docs/assets/img/examples/bootstrap-example-sticky-footer-navbar.png differ diff --git a/docs/assets/img/examples/browser-icon-firefox.png b/docs/assets/img/examples/browser-icon-firefox.png index 3dd68b1133..2af3cd8560 100644 Binary files a/docs/assets/img/examples/browser-icon-firefox.png and b/docs/assets/img/examples/browser-icon-firefox.png differ diff --git a/docs/assets/img/examples/browser-icon-safari.png b/docs/assets/img/examples/browser-icon-safari.png index 7aaa29a793..880e31daaa 100644 Binary files a/docs/assets/img/examples/browser-icon-safari.png and b/docs/assets/img/examples/browser-icon-safari.png differ diff --git a/docs/assets/js/google-code-prettify/prettify.css b/docs/assets/js/google-code-prettify/prettify.css deleted file mode 100644 index 7d84066548..0000000000 --- a/docs/assets/js/google-code-prettify/prettify.css +++ /dev/null @@ -1,30 +0,0 @@ -.com { color: #93a1a1; } -.lit { color: #195f91; } -.pun, .opn, .clo { color: #93a1a1; } -.fun { color: #dc322f; } -.str, .atv { color: #D14; } -.kwd, .prettyprint .tag { color: #1e347b; } -.typ, .atn, .dec, .var { color: teal; } -.pln { color: #48484c; } - -.prettyprint { - padding: 8px; - background-color: #f7f7f9; - border: 1px solid #e1e1e8; -} -.prettyprint.linenums { - -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; - -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; - box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; -} - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { - margin: 0 0 0 40px; /* IE indents via margin-left */ -} -ol.linenums li { - padding-left: 12px; - color: #bebec5; - line-height: 20px; - text-shadow: 0 1px 0 #fff; -} \ No newline at end of file diff --git a/docs/assets/js/google-code-prettify/prettify.js b/docs/assets/js/google-code-prettify/prettify.js deleted file mode 100644 index eef5ad7e6a..0000000000 --- a/docs/assets/js/google-code-prettify/prettify.js +++ /dev/null @@ -1,28 +0,0 @@ -var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; -(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= -[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), -l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, -q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, -q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, -"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), -a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} -for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], -H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], -J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ -I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), -["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", -/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), -["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", -hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= -!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p..` - -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/docs/build/node_modules/hogan.js/bin/hulk b/docs/build/node_modules/hogan.js/bin/hulk deleted file mode 100755 index dd5c4a60d0..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/lib/compiler.js b/docs/build/node_modules/hogan.js/lib/compiler.js deleted file mode 100644 index 2cd65f6fdf..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/lib/hogan.js b/docs/build/node_modules/hogan.js/lib/hogan.js deleted file mode 100644 index f0119b5291..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/lib/template.js b/docs/build/node_modules/hogan.js/lib/template.js deleted file mode 100644 index 8958a70a16..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/package.json b/docs/build/node_modules/hogan.js/package.json deleted file mode 100644 index a09dede094..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/html/list.html b/docs/build/node_modules/hogan.js/test/html/list.html deleted file mode 100644 index 9bb653a3be..0000000000 --- a/docs/build/node_modules/hogan.js/test/html/list.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -
  • -
  • -
  • -
  • -
  • -
  • -
\ No newline at end of file diff --git a/docs/build/node_modules/hogan.js/test/index.html b/docs/build/node_modules/hogan.js/test/index.html deleted file mode 100644 index 6f0e7438b7..0000000000 --- a/docs/build/node_modules/hogan.js/test/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - test - - - - - - - - - - \ No newline at end of file diff --git a/docs/build/node_modules/hogan.js/test/index.js b/docs/build/node_modules/hogan.js/test/index.js deleted file mode 100644 index 9b235ebe7e..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/mustache.js b/docs/build/node_modules/hogan.js/test/mustache.js deleted file mode 100644 index b2d8ebc51a..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec.js b/docs/build/node_modules/hogan.js/test/spec.js deleted file mode 100644 index 15b4d8e19a..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/Changes b/docs/build/node_modules/hogan.js/test/spec/Changes deleted file mode 100644 index bb39b9823e..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/README.md b/docs/build/node_modules/hogan.js/test/spec/README.md deleted file mode 100644 index b01b1bbdb7..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/Rakefile b/docs/build/node_modules/hogan.js/test/spec/Rakefile deleted file mode 100644 index 5254ce65ad..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/TESTING.md b/docs/build/node_modules/hogan.js/test/spec/TESTING.md deleted file mode 100644 index d2ca374953..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/comments.json b/docs/build/node_modules/hogan.js/test/spec/specs/comments.json deleted file mode 100644 index 30cb927e62..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/comments.yml b/docs/build/node_modules/hogan.js/test/spec/specs/comments.yml deleted file mode 100644 index 7b14c7f327..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.json b/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.json deleted file mode 100644 index fcf95888db..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.yml b/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.yml deleted file mode 100644 index ce80b17cd1..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.json b/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.json deleted file mode 100644 index d1a1a32897..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.yml b/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.yml deleted file mode 100644 index 2237b55f8d..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/inverted.json b/docs/build/node_modules/hogan.js/test/spec/specs/inverted.json deleted file mode 100644 index c9b550b964..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/inverted.yml b/docs/build/node_modules/hogan.js/test/spec/specs/inverted.yml deleted file mode 100644 index 5f8e2b2f3c..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/partials.json b/docs/build/node_modules/hogan.js/test/spec/specs/partials.json deleted file mode 100644 index e5f21a2a48..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/partials.yml b/docs/build/node_modules/hogan.js/test/spec/specs/partials.yml deleted file mode 100644 index 8c415439f2..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/sections.json b/docs/build/node_modules/hogan.js/test/spec/specs/sections.json deleted file mode 100644 index b0aa352e10..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/sections.yml b/docs/build/node_modules/hogan.js/test/spec/specs/sections.yml deleted file mode 100644 index f62d9cb30a..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.json b/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.json deleted file mode 100644 index 3c58bf851e..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml b/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml deleted file mode 100644 index b9fb4d0f85..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/test/templates/list.mustache b/docs/build/node_modules/hogan.js/test/templates/list.mustache deleted file mode 100644 index 9bb653a3be..0000000000 --- a/docs/build/node_modules/hogan.js/test/templates/list.mustache +++ /dev/null @@ -1,8 +0,0 @@ -
    -
  • -
  • -
  • -
  • -
  • -
  • -
\ No newline at end of file diff --git a/docs/build/node_modules/hogan.js/tools/release.js b/docs/build/node_modules/hogan.js/tools/release.js deleted file mode 100644 index dda0d3f871..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/tools/web_templates.js b/docs/build/node_modules/hogan.js/tools/web_templates.js deleted file mode 100644 index f00acd3c3e..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/1.0.0/hogan.js b/docs/build/node_modules/hogan.js/web/1.0.0/hogan.js deleted file mode 100644 index 09170d635f..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/1.0.0/hogan.min.js b/docs/build/node_modules/hogan.js/web/1.0.0/hogan.min.js deleted file mode 100644 index 13ec535aae..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js b/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js deleted file mode 100644 index 09170d635f..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js b/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js deleted file mode 100644 index 13ec535aae..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js b/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js deleted file mode 100644 index 4f6f6d22f1..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js b/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js deleted file mode 100644 index 0af8a36fdd..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js b/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js deleted file mode 100644 index ec55a5d3ab..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js b/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js deleted file mode 100644 index 7520652356..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js b/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js deleted file mode 100644 index 1807562608..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js b/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js deleted file mode 100644 index aee5922bc2..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js b/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js deleted file mode 100644 index 8958a70a16..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js b/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js deleted file mode 100644 index 4ec5796047..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/favicon.ico b/docs/build/node_modules/hogan.js/web/favicon.ico deleted file mode 100644 index 627ee837aa..0000000000 Binary files a/docs/build/node_modules/hogan.js/web/favicon.ico and /dev/null differ diff --git a/docs/build/node_modules/hogan.js/web/images/logo.png b/docs/build/node_modules/hogan.js/web/images/logo.png deleted file mode 100644 index b6c3e02f35..0000000000 Binary files a/docs/build/node_modules/hogan.js/web/images/logo.png and /dev/null differ diff --git a/docs/build/node_modules/hogan.js/web/images/noise.png b/docs/build/node_modules/hogan.js/web/images/noise.png deleted file mode 100644 index dca6fce43b..0000000000 Binary files a/docs/build/node_modules/hogan.js/web/images/noise.png and /dev/null differ diff --git a/docs/build/node_modules/hogan.js/web/images/small-hogan-icon.png b/docs/build/node_modules/hogan.js/web/images/small-hogan-icon.png deleted file mode 100644 index 01ec4ad4cd..0000000000 Binary files a/docs/build/node_modules/hogan.js/web/images/small-hogan-icon.png and /dev/null differ diff --git a/docs/build/node_modules/hogan.js/web/images/stripes.png b/docs/build/node_modules/hogan.js/web/images/stripes.png deleted file mode 100644 index 8618ee91a4..0000000000 Binary files a/docs/build/node_modules/hogan.js/web/images/stripes.png and /dev/null differ diff --git a/docs/build/node_modules/hogan.js/web/index.html.mustache b/docs/build/node_modules/hogan.js/web/index.html.mustache deleted file mode 100755 index 75fcbfb6c1..0000000000 --- a/docs/build/node_modules/hogan.js/web/index.html.mustache +++ /dev/null @@ -1,139 +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/docs/build/node_modules/hogan.js/web/stylesheets/layout.css b/docs/build/node_modules/hogan.js/web/stylesheets/layout.css deleted file mode 100755 index c9e3e350d2..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/web/stylesheets/skeleton.css b/docs/build/node_modules/hogan.js/web/stylesheets/skeleton.css deleted file mode 100755 index d0264a40b3..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/wrappers/amd.js.mustache b/docs/build/node_modules/hogan.js/wrappers/amd.js.mustache deleted file mode 100644 index d91ef77ca2..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/wrappers/common.js.mustache b/docs/build/node_modules/hogan.js/wrappers/common.js.mustache deleted file mode 100644 index e823e83a08..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/wrappers/js.mustache b/docs/build/node_modules/hogan.js/wrappers/js.mustache deleted file mode 100644 index 9f311f08d4..0000000000 --- a/docs/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/docs/build/node_modules/hogan.js/wrappers/mustache.js.mustache b/docs/build/node_modules/hogan.js/wrappers/mustache.js.mustache deleted file mode 100644 index d3a3d70df9..0000000000 --- a/docs/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/docs/build/package.json b/docs/build/package.json deleted file mode 100644 index 97ab25909b..0000000000 --- a/docs/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/docs/components.html b/docs/components.html index e74e6d2235..0aea4113ec 100644 --- a/docs/components.html +++ b/docs/components.html @@ -1,70 +1,8 @@ - - - - - Components · Bootstrap - - - +--- +layout: default +title: Components +--- - - - - - - - - - - - - - - - - - - - - - - - @@ -123,27 +61,27 @@
  • Separated link
  • -
    -
    -<div class="dropdown">
    -  <!-- Link or button to toggle dropdown -->
    -  <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
    -    <li><a tabindex="-1" href="#">Action</a></li>
    -    <li><a tabindex="-1" href="#">Another action</a></li>
    -    <li><a tabindex="-1" href="#">Something else here</a></li>
    -    <li class="divider"></li>
    -    <li><a tabindex="-1" href="#">Separated link</a></li>
    -  </ul>
    -</div>
    -
    +
    +{% highlight html linenos %} + +{% endhighlight %}

    Aligning the menus

    Add .pull-right to a .dropdown-menu to right align the dropdown menu.

    -
    -<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dLabel">
    +{% highlight html linenos %}
    +
    + +{% endhighlight %}

    Disabled menu options

    Add .disabled to a <li> in the dropdown to disable the link.

    @@ -155,14 +93,14 @@
  • Another link
  • -
    -
    -<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
    -  <li><a tabindex="-1" href="#">Regular link</a></li>
    -  <li class="disabled"><a tabindex="-1" href="#">Disabled link</a></li>
    -  <li><a tabindex="-1" href="#">Another link</a></li>
    -</ul>
    -
    +
    +{% highlight html linenos %} + +{% endhighlight %} @@ -180,46 +118,46 @@

    Wrap a series of buttons with .btn in .btn-group.

    - - - + + +
    -
    -<div class="btn-group">
    -  <button class="btn">Left</button>
    -  <button class="btn">Middle</button>
    -  <button class="btn">Right</button>
    -</div>
    -
    +{% highlight html linenos %} +
    + + + +
    +{% endhighlight %}

    Multiple button groups

    Combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex components.

    - - - - + + + +
    - - - + + +
    - +
    -
    -<div class="btn-toolbar">
    -  <div class="btn-group">
    -    ...
    -  </div>
    -</div>
    -
    +{% highlight html linenos %} +
    +
    ...
    +
    ...
    +
    ...
    +
    +{% endhighlight %}

    Vertical button groups

    Make a set of buttons appear vertically stacked rather than horizontally.

    @@ -231,11 +169,11 @@ -
    -<div class="btn-group btn-group-vertical">
    +{% highlight html linenos %}
    +
    ... -</div> -
    + +{% endhighlight %}

    Justified button groups

    Make a group of buttons stretch at the same size to span the entire width of its parent. This only works with <a> elements as the <button> doesn't pick up these styles.

    @@ -246,11 +184,11 @@ Middle -
    -<div class="btn-group btn-group-justified">
    +{% highlight html linenos %}
    +
    ... -</div> -
    + +{% endhighlight %} @@ -378,36 +316,45 @@ -
    -<-- Single button -->
    -<div class="btn-group">
    -  <button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
    -    Action
    -    <span class="caret"></span>
    -  </button>
    -  <ul class="dropdown-menu">
    -    <!-- dropdown menu links -->
    -  </ul>
    -</div>
    +{% highlight html linenos %}
    +
    +
     
    -<-- Split button -->
    -<div class="btn-group">
    -  <button class="btn">Action</button>
    -  <button class="btn dropdown-toggle" data-toggle="dropdown">
    -    <span class="caret"></span>
    -  </button>
    -  <ul class="dropdown-menu">
    -    <!-- dropdown menu links -->
    -  </ul>
    -</div>
    -
    + + +{% endhighlight %}

    Works with all button sizes

    Button dropdowns work at any size: .btn-large, .btn-small, or .btn-mini.

    - +
    - +
    - +
    -
    + +{% highlight html linenos %} + +
    + + +
    + + +
    + + +
    + + +
    + + +
    +{% endhighlight %}

    Dropup buttons

    Trigger dropdown menus above elements by adding .dropup to the parent.

    @@ -466,18 +448,18 @@ - -
    -<div class="btn-group dropup">
    -  <button class="btn">Dropup</button>
    -  <button class="btn dropdown-toggle" data-toggle="dropdown">
    -    <span class="caret"></span>
    -  </button>
    -  <ul class="dropdown-menu">
    -    <!-- dropdown menu links -->
    -  </ul>
    -</div>
    -
    + +{% highlight html linenos %} +
    + + + +
    +{% endhighlight %} @@ -501,15 +483,13 @@
  • Messages
  • -
    -<ul class="nav nav-tabs">
    -  <li class="active">
    -    <a href="#">Home</a>
    -  </li>
    -  <li><a href="#">...</a></li>
    -  <li><a href="#">...</a></li>
    -</ul>
    -
    +{% highlight html linenos %} + +{% endhighlight %}

    List

    Swap the tabs class for .nav-list.

    @@ -520,15 +500,13 @@
  • Messages
  • -
    -<ul class="nav nav-list">
    -  <li class="active">
    -    <a href="#">Home</a>
    -  </li>
    -  <li><a href="#">...</a></li>
    -  <li><a href="#">...</a></li>
    -</ul>
    -
    +{% highlight html linenos %} + +{% endhighlight %}

    Pills

    Take that same HTML, but use .nav-pills instead:

    @@ -539,15 +517,13 @@
  • Messages
  • -
    -<ul class="nav nav-pills">
    -  <li class="active">
    -    <a href="#">Home</a>
    -  </li>
    -  <li><a href="#">...</a></li>
    -  <li><a href="#">...</a></li>
    -</ul>
    -
    +{% highlight html linenos %} + +{% endhighlight %}

    Pills are also vertically stackable. Just add .nav-stacked.

    -
    -<ul class="nav nav-pills nav-stacked">
    +{% highlight html linenos %}
    +
    + +{% endhighlight %}

    Options

    @@ -579,15 +555,14 @@
  • Messages
  • -
    -<ul class="nav nav-tabs nav-justified">
    +{% highlight html linenos %}
    +
    +
    + +{% endhighlight %}

    Disabled state

    For any nav component (tabs, pills, or list), add .disabled for gray links and no hover effects. Links will remain clickable, however, unless you remove the href attribute. Alternatively, you could implement custom JavaScript to prevent those clicks.

    @@ -598,13 +573,14 @@
  • Disabled link
  • -
    -<ul class="nav nav-pills">
    +{% highlight html linenos %}
    +
    + +{% endhighlight %} +

    Component alignment

    To align nav links, use the .pull-left or .pull-right utility classes. Both classes will add a CSS float in the specified direction.

    @@ -622,7 +598,9 @@
  • Home
  • Help
  • Home
  • Help
  • - -
    -<ul class="nav nav-pills">
    -  <li class="dropdown">
    -    <a class="dropdown-toggle"
    -       data-toggle="dropdown"
    -       href="#">
    -        Dropdown
    -        <b class="caret"></b>
    -      </a>
    -    <ul class="dropdown-menu">
    -      <!-- links -->
    -    </ul>
    -  </li>
    -</ul>
    -
    + +{% highlight html linenos %} + +{% endhighlight %} @@ -705,21 +683,17 @@
  • Link
  • - -
    -<div class="navbar">
    -  <a class="brand" href="#">Title</a>
    -  <ul class="nav">
    -    <li class="active"><a href="#">Home</a></li>
    -    <li><a href="#">Link</a></li>
    -    <li><a href="#">Link</a></li>
    -  </ul>
    -</div>
    -
    - - -
    - + +{% highlight html linenos %} + +{% endhighlight %}

    Navbar components

    @@ -729,10 +703,10 @@ - -
    -<a class="brand" href="#">Project name</a>
    -
    + +{% highlight html linenos %} +Title +{% endhighlight %}

    Nav links

    Nav items are simple to add via unordered lists.

    @@ -744,16 +718,14 @@
  • Link
  • - -
    -<ul class="nav">
    -  <li class="active">
    -    <a href="#">Home</a>
    -  </li>
    -  <li><a href="#">Link</a></li>
    -  <li><a href="#">Link</a></li>
    -</ul>
    -
    + +{% highlight html linenos %} + +{% endhighlight %}

    You can easily add dividers to your nav links with an empty list item and a simple class. Just add the appropriate class to <li> elements between links. Dividers will be horizontal to start, but at resolutions above 768px they become vertical with the navigation.

    - -
    -<ul class="nav">
    +          
    +{% highlight html linenos %}
    +
    + +{% endhighlight %}

    Forms

    To properly style and position a form within the navbar, add the appropriate classes as shown below. For a default form, include .navbar-form and either .pull-left or .pull-right to properly align it.

    @@ -786,41 +758,24 @@ - -
    -<form class="pull-left">
    -  <input type="text" style="width: 200px;">
    -  <button type="submit" class="btn">Submit</button>
    -</form>
    -
    + +{% highlight html linenos %} + +{% endhighlight %}

    Component alignment

    Align nav links, search form, or text, use the .pull-left or .pull-right utility classes. Both classes will add a CSS float in the specified direction.

    Using dropdowns

    Add dropdowns and dropups to the nav with a bit of markup and the dropdowns JavaScript plugin.

    -
    -<ul class="nav">
    -  <li class="dropdown">
    -    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
    -      Account
    -      <b class="caret"></b>
    -    </a>
    -    <ul class="dropdown-menu">
    -      ...
    -    </ul>
    -  </li>
    -</ul>
    -
    -

    Visit the JavaScript dropdowns documentation for more markup and information on calling dropdowns.

    Text

    Wrap strings of text in an element with .navbar-text, usually on a <p> tag for proper leading and color.

    -
    - -

    Optional display variations

    Fix the navbar to the top or bottom of the viewport with an additional class on the outermost div, .navbar.

    @@ -837,12 +792,12 @@ - -
    -<div class="navbar navbar-fixed-top">
    +          
    +{% highlight html linenos %}
    +
    + +{% endhighlight %}

    Fixed to bottom

    Add .navbar-fixed-bottom instead.

    @@ -857,12 +812,12 @@ - -
    -<div class="navbar navbar-fixed-bottom">
    +          
    +{% highlight html linenos %}
    +
    + +{% endhighlight %}

    Static top navbar

    Create a full-width navbar that scrolls away with the page by adding .navbar-static-top. Unlike the .navbar-fixed-top class, you do not need to change any padding on the body.

    @@ -877,15 +832,12 @@ - -
    -<div class="navbar navbar-static-top">
    +          
    +{% highlight html linenos %}
    +
    - - -
    + +{% endhighlight %}

    Responsive navbar

    @@ -935,40 +887,36 @@ - + + + +{% highlight html linenos %} + -
    -<div class="navbar">
    -  <div class="container">
    +    
    +    
    +      
    +      
    +      
    +    
     
    -    <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
    -    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
    -      <span class="icon-bar"></span>
    -      <span class="icon-bar"></span>
    -      <span class="icon-bar"></span>
    -    </a>
    +    
    +    Title
     
    -    <!-- Be sure to leave the brand out there if you want it shown -->
    -    <a class="brand" href="#">Project name</a>
    +    
    +    
    +  
    +
    +{% endhighlight %}
     
    -    <!-- Everything you want hidden at 940px or less, place within here -->
    -    <div class="nav-collapse collapse">
    -      <!-- .nav, .navbar-search, .navbar-form, etc -->
    -    </div>
    -
    -  </div>
    -</div>
    -
    Heads up! The responsive navbar requires the collapse plugin and responsive Bootstrap CSS file.
    -
    - -

    Inverted variation

    Modify the look of the navbar by adding .navbar-inverse.

    @@ -1018,12 +966,12 @@
    - -
    -<div class="navbar navbar-inverse">
    +          
    +{% highlight html linenos %}
    +
    + +{% endhighlight %} @@ -1051,13 +999,14 @@
  • Data
  • -
    -<ul class="breadcrumb">
    -  <li><a href="#">Home</a></li>
    -  <li><a href="#">Library</a></li>
    -  <li class="active">Data</li>
    -</ul>
    -
    +{% highlight html linenos %} + +{% endhighlight %} + @@ -1084,17 +1033,17 @@
  • »
  • -
    -<ul class="pagination">
    -  <li><a href="#">Prev</a></li>
    -  <li><a href="#">1</a></li>
    -  <li><a href="#">2</a></li>
    -  <li><a href="#">3</a></li>
    -  <li><a href="#">4</a></li>
    -  <li><a href="#">5</a></li>
    -  <li><a href="#">Next</a></li>
    -</ul>
    -
    +{% highlight html linenos %} + +{% endhighlight %}

    Disabled and active states

    Links are customizable for different circumstances. Use .disabled for unclickable links and .active to indicate the current page.

    @@ -1109,21 +1058,22 @@
  • »
  • -
    -<ul class="pagination">
    -  <li class="disabled"><a href="#">&laquo;</a></li>
    -  <li class="active"><a href="#">1</a></li>
    +{% highlight html linenos %}
    +
      +
    • «
    • +
    • 1
    • ... -</ul> -
    -

    You can optionally swap out active or disabled anchors for spans to remove click functionality while retaining intended styles.

    -
    -<ul class="pagination">
    -  <li class="disabled"><span>&laquo;</span></li>
    -  <li class="active"><span>1</span></li>
    +
    +{% endhighlight %}
    +          

    You can optionally swap out active or disabled anchors for <span> to remove click functionality while retaining intended styles.

    +{% highlight html linenos %} +
      +
    • «
    • +
    • 1
    • ... -</ul> -
    + +{% endhighlight %} +

    Sizes

    Fancy larger or smaller pagination? Add .pagination-large, .pagination-small, or .pagination-mini for additional sizes.

    @@ -1173,20 +1123,13 @@ -
    -<ul class="pagination pagination-large">
    -  ...
    -</ul>
    -<ul class="pagination">
    -  ...
    -</ul>
    -<ul class="pagination pagination-small">
    -  ...
    -</ul>
    -<ul class="pagination pagination-mini">
    -  ...
    -</ul>
    -
    +{% highlight html linenos %} +
      ...
    +
      ...
    +
      ...
    +
      ...
    +{% endhighlight %} +

    Pager

    Quick previous and next links for simple pagination implementations with light markup and styles. It's great for simple sites like blogs or magazines.

    @@ -1199,12 +1142,12 @@
  • Next
  • -
    -<ul class="pager">
    -  <li><a href="#">Previous</a></li>
    -  <li><a href="#">Next</a></li>
    -</ul>
    -
    +{% highlight html linenos %} + +{% endhighlight %}

    Aligned links

    Alternatively, you can align each link to the sides:

    @@ -1214,16 +1157,13 @@ -
    -<ul class="pager">
    -  <li class="previous">
    -    <a href="#">&larr; Older</a>
    -  </li>
    -  <li class="next">
    -    <a href="#">Newer &rarr;</a>
    -  </li>
    -</ul>
    -
    +{% highlight html linenos %} + +{% endhighlight %} +

    Optional disabled state

    Pager links also use the general .disabled utility class from the pagination.

    @@ -1233,14 +1173,13 @@ -
    -<ul class="pager">
    -  <li class="previous disabled">
    -    <a href="#">&larr; Older</a>
    -  </li>
    -  ...
    -</ul>
    -
    +{% highlight html linenos %} + +{% endhighlight %} + @@ -1257,12 +1196,9 @@ -
    -<a href="#">
    -  Inbox
    -  <span class="counter">42</span>
    -</a>
    -
    +{% highlight html linenos %} +Inbox 42 +{% endhighlight %}

    Self collapsing

    When there are no new or unread items, counters will simply collapse (via CSS's :empty selector) provided no content exists within.

    @@ -1292,15 +1228,17 @@ -
    -<ul class="nav nav-list">
    -  <li class="active">
    -    <a href="#">Home</a>
    -  </li>
    -  <li><a href="#">...</a></li>
    -  <li><a href="#">...</a></li>
    -</ul>
    -
    +{% highlight html linenos %} + +{% endhighlight %} @@ -1322,17 +1260,13 @@

    Learn more

    -
    -<div class="jumbotron">
    -  <h1>Heading</h1>
    -  <p>Tagline</p>
    -  <p>
    -    <a class="btn btn-primary btn-large">
    -      Learn more
    -    </a>
    -  </p>
    -</div>
    -
    +{% highlight html linenos %} +
    +

    Hello, world!

    +

    ...

    +

    Learn more

    +
    +{% endhighlight %}

    Page header

    A simple shell for an h1 to appropriately space out and segment sections of content on a page. It can utilize the h1's default small, element as well most other components (with additional styles).

    @@ -1341,11 +1275,11 @@

    Example page header Subtext for header

    -
    -<div class="page-header">
    -  <h1>Example page header <small>Subtext for header</small></h1>
    -</div>
    -
    +{% highlight html linenos %} + +{% endhighlight %} @@ -1384,17 +1318,17 @@ - -
    -<div class="row">
    -  <div class="span3">
    -    <a href="#" class="thumbnail">
    -      <img src="holder.js/260x180" alt="">
    -    </a>
    -  </div>
    +          
    +{% highlight html linenos %}
    +
    +
    + + + +
    ... -</div> -
    + +{% endhighlight %}

    Custom content thumbnails

    With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.

    @@ -1431,19 +1365,23 @@ - -
    -<div class="row">
    -  <div class="span4">
    -    <div class="thumbnail">
    -      <img data-src="holder.js/300x200" alt="">
    -      <h3>Thumbnail label</h3>
    -      <p>Thumbnail caption...</p>
    -    </div>
    -  </div>
    +          
    +{% highlight html linenos %}
    +
    +
    +
    + +
    +

    Thumbnail label

    +

    ...

    +

    Action Action

    +
    +
    +
    ... -</div> -
    + +{% endhighlight %} + @@ -1466,12 +1404,12 @@ Warning! Best check yo self, you're not looking too good. -
    -<div class="alert">
    -  <button type="button" class="close" data-dismiss="alert">&times;</button>
    -  <strong>Warning!</strong> Best check yo self, you're not looking too good.
    -</div>
    -
    +{% highlight html linenos %} +
    + + Warning! Best check yo self, you're not looking too good. +
    +{% endhighlight %}

    Block alerts

    For longer messages, increase the padding on the top and bottom of the alert wrapper by adding .alert-block.

    @@ -1482,13 +1420,13 @@

    Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

    -
    -<div class="alert alert-block">
    -  <button type="button" class="close" data-dismiss="alert">&times;</button>
    -  <h4>Warning!</h4>
    -  Best check yo self, you're not...
    -</div>
    -
    +{% highlight html linenos %} +
    + +

    Warning!

    +

    ...

    +
    +{% endhighlight %}

    Contextual alternatives

    Add optional classes to change an alert's connotation.

    @@ -1506,11 +1444,11 @@ Heads up! This alert needs your attention, but it's not super important. -
    -<div class="alert alert-error">... </div>
    -<div class="alert alert-success">...</div>
    -<div class="alert alert-info">...</div>
    -
    +{% highlight html linenos %} +
    ...
    +
    ...
    +
    ...
    +{% endhighlight %} @@ -1533,11 +1471,11 @@
    -
    -<div class="progress">
    -  <div class="progress-bar" style="width: 60%;"></div>
    -</div>
    -
    +{% highlight html linenos %} +
    +
    +
    +{% endhighlight %}

    Additional colors

    Progress bars use some of the same button and alert classes for consistent styles.

    @@ -1555,20 +1493,20 @@
    -
    -<div class="progress">
    -  <div class="progress-bar progress-bar-info" style="width: 20%"></div>
    -</div>
    -<div class="progress">
    -  <div class="progress-bar progress-bar-success" style="width: 40%"></div>
    -</div>
    -<div class="progress">
    -  <div class="progress-bar progress-bar-warning" style="width: 60%"></div>
    -</div>
    -<div class="progress">
    -  <div class="progress-bar progress-bar-danger" style="width: 80%"></div>
    -</div>
    -
    +{% highlight html linenos %} +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +{% endhighlight %}

    Striped

    Uses a gradient to create a striped effect. Not available in IE8.

    @@ -1586,20 +1524,20 @@
    -
    -<div class="progress progress-striped">
    -  <div class="progress-bar progress-bar-info" style="width: 20%"></div>
    -</div>
    -<div class="progress progress-striped">
    -  <div class="progress-bar progress-bar-success" style="width: 40%"></div>
    -</div>
    -<div class="progress progress-striped">
    -  <div class="progress-bar progress-bar-warning" style="width: 60%"></div>
    -</div>
    -<div class="progress progress-striped">
    -  <div class="progress-bar progress-bar-danger" style="width: 80%"></div>
    -</div>
    -
    +{% highlight html linenos %} +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +{% endhighlight %}

    Animated

    Add .active to .progress-striped to animate the stripes right to left. Not available in all versions of IE.

    @@ -1608,11 +1546,11 @@
    -
    -<div class="progress progress-striped active">
    -  <div class="progress-bar" style="width: 40%;"></div>
    -</div>
    -
    +{% highlight html linenos %} +
    +
    +
    +{% endhighlight %}

    Stacked

    Place multiple bars into the same .progress to stack them.

    @@ -1623,13 +1561,13 @@
    -
    -<div class="progress">
    -  <div class="progress-bar progress-bar-success" style="width: 35%;"></div>
    -  <div class="progress-bar progress-bar-warning" style="width: 20%;"></div>
    -  <div class="progress-bar progress-bar-danger" style="width: 10%;"></div>
    -</div>
    -
    +{% highlight html linenos %} +
    +
    +
    +
    +
    +{% endhighlight %} @@ -1674,23 +1612,18 @@ - -
    -<div class="media">
    -  <a class="pull-left" href="#">
    -    <img class="media-object" data-src="holder.js/64x64">
    -  </a>
    -  <div class="media-body">
    -    <h4 class="media-heading">Media heading</h4>
    +          
    +{% highlight html linenos %}
    +
    + + + +
    +

    Media heading

    ... - - <!-- Nested media object --> - <div class="media"> - ... - </div> - </div> -</div> -
    + + +{% endhighlight %}

    Media list

    With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).

    @@ -1746,24 +1679,19 @@ -
    -<ul class="media-list">
    -  <li class="media">
    -    <a class="pull-left" href="#">
    -      <img class="media-object" data-src="holder.js/64x64">
    -    </a>
    -    <div class="media-body">
    -      <h4 class="media-heading">Media heading</h4>
    +{% highlight html linenos %}
    +
      +
    • + + + +
      +

      Media heading

      ... - - <!-- Nested media object --> - <div class="media"> - ... - </div> - </div> - </li> -</ul> -
    + + + +{% endhighlight %} @@ -1785,11 +1713,9 @@ Look, I'm in a well! -
    -<div class="well">
    -  ...
    -</div>
    -
    +{% highlight html linenos %} +
    ...
    +{% endhighlight %}

    Optional classes

    Control padding and rounded corners with two optional modifier classes.

    @@ -1797,73 +1723,72 @@ Look, I'm in a well!
    -
    -<div class="well well-large">
    -  ...
    -</div>
    -
    +{% highlight html linenos %} +
    ...
    +{% endhighlight %} +
    Look, I'm in a well!
    -
    -<div class="well well-small">
    -  ...
    -</div>
    -
    +{% highlight html linenos %} +
    ...
    +{% endhighlight %} +

    Close icon

    Use the generic close icon for dismissing content like modals and alerts.

    -
    <button class="close">&times;</button>
    -

    iOS devices require an href="#" for click events if you would rather use an anchor.

    -
    <a class="close" href="#">&times;</a>
    +{% highlight html linenos %} + +{% endhighlight %}

    Helper classes

    Simple, focused classes for small display or behavior tweaks.

    .pull-left

    Float an element left

    -
    -class="pull-left"
    -
    -
    +{% highlight html linenos %}
    +
    ...
    +{% endhighlight %} +{% highlight css linenos %} .pull-left { float: left; } -
    +{% endhighlight %}

    .pull-right

    Float an element right

    -
    -class="pull-right"
    -
    -
    +{% highlight html linenos %}
    +
    ...
    +{% endhighlight %} +{% highlight css linenos %} .pull-right { float: right; } -
    +{% endhighlight %}

    .muted

    Change an element's color to #999

    -
    -class="muted"
    -
    -
    +{% highlight html linenos %}
    +

    ...

    +{% endhighlight %} +{% highlight css linenos %} .muted { color: #999; } -
    +{% endhighlight %} +

    .clearfix

    Clear the float on any element. Utilizes the micro clearfix as popularized by Nicolas Gallagher.

    -
    -class="clearfix"
    -
    -
    +{% highlight html linenos %}
    +
    ...
    +{% endhighlight %} +{% highlight css linenos %} .clearfix { &:before, &:after { @@ -1874,81 +1799,14 @@ class="clearfix" clear: both; } } -
    +{% endhighlight %} + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/docs/customize.html b/docs/customize.html index 8b91f1d88e..4f3e7fe2db 100644 --- a/docs/customize.html +++ b/docs/customize.html @@ -1,70 +1,8 @@ - - - - - Customize · Bootstrap - - - +--- +layout: default +title: Customize and download +--- - - - - - - - - - - - - - - - - - - - - - - - @@ -423,7 +361,7 @@
    - Customize and Download + Customize and Download

    What's included?

    Downloads include compiled CSS, compiled and minified CSS, and compiled jQuery plugins, all nicely packed up into a zipball for your convenience.

    @@ -432,75 +370,7 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/docs/examples/carousel.html b/docs/examples/carousel.html index 81d1a28a18..eb45fe41ee 100644 --- a/docs/examples/carousel.html +++ b/docs/examples/carousel.html @@ -1,454 +1,403 @@ - - - - - Carousel Template · Bootstrap - - - +--- +layout: example +title: Carousel template +--- - - - - - - - - - - - - - - - - - +} + - - - - - +

    Within tabs

    @@ -493,7 +444,7 @@ $('#myModal').on('hidden', function () { -
    +
    @@ -503,30 +454,31 @@ $('#myModal').on('hidden', function () {

    Via data attributes

    Add data-toggle="dropdown" to a link or button to toggle a dropdown.

    -
    -<div class="dropdown">
    -  <a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown trigger</a>
    -  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
    +{% highlight html linenos %}
    +
    + + +{% endhighlight %}

    To keep URLs intact, use the data-target attribute instead of href="#".

    -
    -<div class="dropdown">
    -  <a class="dropdown-toggle" id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="/page.html">
    -    Dropdown
    -    <b class="caret"></b>
    -  </a>
    -  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
    +{% highlight html linenos %}
    +
    + + +{% endhighlight %}

    Via JavaScript

    Call the dropdowns via JavaScript:

    -
    $('.dropdown-toggle').dropdown()
    +{% highlight js linenos %} +$('.dropdown-toggle').dropdown() +{% endhighlight %}

    Options

    None

    @@ -583,7 +535,7 @@ $('#myModal').on('hidden', function () {

    Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats.

    - +
    @@ -593,11 +545,17 @@ $('#myModal').on('hidden', function () {

    Via data attributes

    To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body) and data-target=".navbar" to select which nav to use. You'll want to use scrollspy with a .nav component.

    -
    <body data-spy="scroll" data-target=".navbar">...</body>
    +{% highlight html linenos %} + + ... + +{% endhighlight %}

    Via JavaScript

    Call the scrollspy via JavaScript:

    -
    $('#navbar').scrollspy()
    +{% highlight js linenos %} +$('#navbar').scrollspy() +{% endhighlight %}
    Heads up! @@ -607,11 +565,12 @@ $('#myModal').on('hidden', function () {

    Methods

    .scrollspy('refresh')

    When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh method like so:

    -
    +{% highlight js linenos %}
     $('[data-spy="scroll"]').each(function () {
       var $spy = $(this).scrollspy('refresh')
     });
    -
    +{% endhighlight %} +

    Options

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset="".

    @@ -689,7 +648,7 @@ $('[data-spy="scroll"]').each(function () {

    Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.

    - +
    @@ -697,28 +656,32 @@ $('[data-spy="scroll"]').each(function () {

    Usage

    Enable tabbable tabs via JavaScript (each tab needs to be activated individually):

    -
    +{% highlight js linenos %}
     $('#myTab a').click(function (e) {
       e.preventDefault();
       $(this).tab('show');
    -})
    +}) +{% endhighlight %} +

    You can activate individual tabs in several ways:

    -
    +{% highlight js linenos %}
     $('#myTab a[href="#profile"]').tab('show'); // Select tab by name
     $('#myTab a:first').tab('show'); // Select first tab
     $('#myTab a:last').tab('show'); // Select last tab
     $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
    -
    +{% endhighlight %}

    Markup

    You can activate a tab or pill navigation without writing any JavaScript by simply specifying data-toggle="tab" or data-toggle="pill" on an element. Adding the nav and nav-tabs classes to the tab ul will apply the Bootstrap tab styling.

    -
    -<ul class="nav nav-tabs">
    -  <li><a href="#home" data-toggle="tab">Home</a></li>
    -  <li><a href="#profile" data-toggle="tab">Profile</a></li>
    -  <li><a href="#messages" data-toggle="tab">Messages</a></li>
    -  <li><a href="#settings" data-toggle="tab">Settings</a></li>
    -</ul>
    +{% highlight html linenos %} + +{% endhighlight %} +

    To make tabs fade in, add .fade to each .tab-pane.

    Methods

    @@ -726,27 +689,27 @@ $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)

    Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM.

    -
    -<ul class="nav nav-tabs" id="myTab">
    -  <li class="active"><a href="#home">Home</a></li>
    -  <li><a href="#profile">Profile</a></li>
    -  <li><a href="#messages">Messages</a></li>
    -  <li><a href="#settings">Settings</a></li>
    -</ul>
    +{% highlight html linenos %}
    +
     
    -<div class="tab-content">
    -  <div class="tab-pane active" id="home">...</div>
    -  <div class="tab-pane" id="profile">...</div>
    -  <div class="tab-pane" id="messages">...</div>
    -  <div class="tab-pane" id="settings">...</div>
    -</div>
    +
    +
    ...
    +
    ...
    +
    ...
    +
    ...
    +
    -<script> + +{% endhighlight %}

    Events

    @@ -767,12 +730,12 @@ $('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
    -
    +{% highlight js linenos %}
     $('a[data-toggle="tab"]').on('shown', function (e) {
       e.target // activated tab
       e.relatedTarget // previous tab
     })
    -
    +{% endhighlight %} @@ -790,7 +753,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {

    Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.

    -
    +

    Four directions

    @@ -800,7 +763,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
  • Tooltip on bottom
  • Tooltip on left
  • -
    +

    Tooltips in input groups

    @@ -811,7 +774,9 @@ $('a[data-toggle="tab"]').on('shown', function (e) {

    Usage

    Trigger the tooltip via JavaScript:

    -
    $('#example').tooltip(options)
    +{% highlight js linenos %} +$('#example').tooltip(options) +{% endhighlight %}

    Options

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".

    @@ -887,23 +852,30 @@ $('a[data-toggle="tab"]').on('shown', function (e) {

    Markup

    -
    <a href="#" data-toggle="tooltip" title="first tooltip">hover over me</a>
    +{% highlight html linenos %} +Hover over me +{% endhighlight %}

    Methods

    +

    $().tooltip(options)

    Attaches a tooltip handler to an element collection.

    +

    .tooltip('show')

    Reveals an element's tooltip.

    -
    $('#element').tooltip('show')
    + {% highlight js linenos %}$('#element').tooltip('show'){% endhighlight %} +

    .tooltip('hide')

    Hides an element's tooltip.

    -
    $('#element').tooltip('hide')
    + {% highlight js linenos %}$('#element').tooltip('hide'){% endhighlight %} +

    .tooltip('toggle')

    Toggles an element's tooltip.

    -
    $('#element').tooltip('toggle')
    + {% highlight js linenos %}$('#element').tooltip('toggle'){% endhighlight %} +

    .tooltip('destroy')

    Hides and destroys an element's tooltip.

    -
    $('#element').tooltip('destroy')
    + {% highlight js linenos %}$('#element').tooltip('destroy'){% endhighlight %} @@ -970,7 +942,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
  • Popover on bottom
  • Popover on left
  • - +
    @@ -978,7 +950,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {

    Usage

    Enable popovers via JavaScript:

    -
    $('#example').popover(options)
    + {% highlight js linenos %}$('#example').popover(options){% endhighlight %}

    Options

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".

    @@ -1065,18 +1037,22 @@ $('a[data-toggle="tab"]').on('shown', function (e) {

    Methods

    $().popover(options)

    Initializes popovers for an element collection.

    +

    .popover('show')

    Reveals an elements popover.

    -
    $('#element').popover('show')
    + {% highlight js linenos %}$('#element').popover('show'){% endhighlight %} +

    .popover('hide')

    Hides an elements popover.

    -
    $('#element').popover('hide')
    + {% highlight js linenos %}$('#element').popover('hide'){% endhighlight %} +

    .popover('toggle')

    Toggles an elements popover.

    -
    $('#element').popover('toggle')
    + {% highlight js linenos %}$('#element').popover('toggle'){% endhighlight %} +

    .popover('destroy')

    Hides and destroys an element's popover.

    -
    $('#element').popover('destroy')
    + {% highlight js linenos %}$('#element').popover('destroy'){% endhighlight %} @@ -1096,7 +1072,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) { Holy guacamole! Best check yo self, you're not looking too good. - +
    @@ -1107,7 +1083,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) { Take this action Or do this

    -
    +
    @@ -1115,18 +1091,20 @@ $('a[data-toggle="tab"]').on('shown', function (e) {

    Usage

    Enable dismissal of an alert via JavaScript:

    -
    $(".alert").alert()
    + {% highlight js linenos %}$(".alert").alert(){% endhighlight %}

    Markup

    Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

    -
    <a class="close" data-dismiss="alert" href="#">&times;</a>
    + {% highlight html linenos %}×{% endhighlight %}

    Methods

    +

    $().alert()

    Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

    +

    .alert('close')

    Closes an alert.

    -
    $(".alert").alert('close')
    + {% highlight js linenos %}$(".alert").alert('close'){% endhighlight %}

    Events

    @@ -1149,11 +1127,11 @@ $('a[data-toggle="tab"]').on('shown', function (e) { -
    +{% highlight js linenos %}
     $('#my-alert').bind('closed', function () {
       // do something…
     })
    -
    +{% endhighlight %} @@ -1171,18 +1149,24 @@ $('#my-alert').bind('closed', function () {

    Stateful

    Add data-loading-text="Loading..." to use a loading state on a button.

    - -
    -
    <button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>
    + +{% highlight html linenos %} + +{% endhighlight %}

    Single toggle

    Add data-toggle="button" to activate toggling on a single button.

    - -
    -
    <button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button>
    + + +{% highlight html linenos %} + +{% endhighlight %}

    Checkbox

    Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.

    @@ -1192,14 +1176,14 @@ $('#my-alert').bind('closed', function () { - -
    -<div class="btn-group" data-toggle="buttons-checkbox">
    -  <button type="button" class="btn btn-primary">Left</button>
    -  <button type="button" class="btn btn-primary">Middle</button>
    -  <button type="button" class="btn btn-primary">Right</button>
    -</div>
    -
    + +{% highlight html linenos %} +
    + + + +
    +{% endhighlight %}

    Radio

    Add data-toggle="buttons-radio" for radio style toggling on btn-group.

    @@ -1209,14 +1193,14 @@ $('#my-alert').bind('closed', function () { - -
    -<div class="btn-group" data-toggle="buttons-radio">
    -  <button type="button" class="btn btn-primary">Left</button>
    -  <button type="button" class="btn btn-primary">Middle</button>
    -  <button type="button" class="btn btn-primary">Right</button>
    -</div>
    -
    + +{% highlight html linenos %} +
    + + + +
    +{% endhighlight %}
    @@ -1224,7 +1208,9 @@ $('#my-alert').bind('closed', function () {

    Usage

    Enable buttons via JavaScript:

    -
    $('.nav-tabs').button()
    +{% highlight js linenos %} +$('.nav-tabs').button() +{% endhighlight %}

    Markup

    Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

    @@ -1233,30 +1219,40 @@ $('#my-alert').bind('closed', function () {

    None

    Methods

    +

    $().button('toggle')

    Toggles push state. Gives the button the appearance that it has been activated.

    Heads up! You can enable auto toggling of a button by using the data-toggle attribute.
    -
    <button type="button" class="btn" data-toggle="button" >…</button>
    +{% highlight html linenos %} + +{% endhighlight %} +

    $().button('loading')

    Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text.

    -
    <button type="button" class="btn" data-loading-text="loading stuff..." >...</button>
    +{% highlight html linenos %} + +{% endhighlight %} +
    Heads up! Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off".
    +

    $().button('reset')

    Resets button state - swaps text to original text.

    +

    $().button(string)

    Resets button state - swaps text to any data defined text state.

    -
    <button type="button" class="btn" data-complete-text="finished!" >...</button>
    -<script>
    +{% highlight html linenos %}
    +
    +
    +{% endhighlight %}
               
     
     
    @@ -1314,44 +1310,56 @@ $('#my-alert').bind('closed', function () {
                       
                     
                   
    -            
    -
    -<div class="accordion" id="accordion2">
    -  <div class="accordion-group">
    -    <div class="accordion-heading">
    -      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
    +            
    +{% highlight html linenos %}
    +
    -

    You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element.

    -
    -<button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
    -  simple collapsible
    -</button>
    +      
    +    
    +    
    +
    + ... +
    +
    + +
    + +
    +
    + ... +
    +
    +
    + +{% endhighlight %} -<div id="demo" class="collapse in"> … </div> -
    +

    You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element.

    +{% highlight html linenos %} + + +
    ...
    +{% endhighlight %}
    @@ -1365,7 +1373,9 @@ $('#my-alert').bind('closed', function () {

    Via JavaScript

    Enable manually with:

    -
    $(".collapse").collapse()
    +{% highlight js linenos %} +$(".collapse").collapse() +{% endhighlight %}

    Options

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-parent="".

    @@ -1396,17 +1406,21 @@ $('#my-alert').bind('closed', function () {

    Methods

    +

    .collapse(options)

    Activates your content as a collapsible element. Accepts an optional options object. -

    +{% highlight js linenos %}
     $('#myCollapsible').collapse({
       toggle: false
     })
    -
    +{% endhighlight %} +

    .collapse('toggle')

    Toggles a collapsible element to shown or hidden.

    +

    .collapse('show')

    Shows a collapsible element.

    +

    .collapse('hide')

    Hides a collapsible element.

    @@ -1440,10 +1454,11 @@ $('#myCollapsible').collapse({ -
    +{% highlight js linenos %}
     $('#myCollapsible').on('hidden', function () {
       // do something…
    -})
    +}) +{% endhighlight %} @@ -1494,25 +1509,36 @@ $('#myCollapsible').on('hidden', function () { - -
    -<div id="myCarousel" class="carousel slide">
    -  <ol class="carousel-indicators">
    -    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
    -    <li data-target="#myCarousel" data-slide-to="1"></li>
    -    <li data-target="#myCarousel" data-slide-to="2"></li>
    -  </ol>
    -  <!-- Carousel items -->
    -  <div class="carousel-inner">
    -    <div class="active item">…</div>
    -    <div class="item">…</div>
    -    <div class="item">…</div>
    -  </div>
    -  <!-- Carousel nav -->
    -  <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
    -  <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
    -</div>
    -
    + +{% highlight html linenos %} + +{% endhighlight %}
    Heads up! @@ -1530,7 +1556,9 @@ $('#myCollapsible').on('hidden', function () {

    Via JavaScript

    Call carousel manually with:

    -
    $('.carousel').carousel()
    +{% highlight js linenos %} +$('.carousel').carousel() +{% endhighlight %}

    Options

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-interval="".

    @@ -1560,21 +1588,27 @@ $('#myCollapsible').on('hidden', function () {

    Methods

    +

    .carousel(options)

    Initializes the carousel with an optional options object and starts cycling through items.

    -
    +{% highlight html linenos %}
     $('.carousel').carousel({
       interval: 2000
     })
    -
    +{% endhighlight %} +

    .carousel('cycle')

    Cycles through the carousel items from left to right.

    +

    .carousel('pause')

    Stops the carousel from cycling through items.

    +

    .carousel(number)

    Cycles the carousel to a particular frame (0 based, similar to an array).

    +

    .carousel('prev')

    Cycles to the previous item.

    +

    .carousel('next')

    Cycles to the next item.

    @@ -1614,8 +1648,11 @@ $('.carousel').carousel({

    A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

    -
    -
    <input type="text" data-provide="typeahead">
    +
    +{% highlight html linenos %} + +{% endhighlight %} +

    You'll want to set autocomplete="off" to prevent default browser menus from appearing over the Bootstrap typeahead dropdown.


    @@ -1628,7 +1665,9 @@ $('.carousel').carousel({

    Via JavaScript

    Call the typeahead manually with:

    -
    $('.typeahead').typeahead()
    +{% highlight js linenos %} +$('.typeahead').typeahead() +{% endhighlight %}

    Options

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-source="".

    @@ -1711,7 +1750,9 @@ $('.carousel').carousel({

    Via data attributes

    To easily add affix behavior to any element, just add data-spy="affix" to the element you want to spy on. Then use offsets to define when to toggle the pinning of an element on and off.

    -
    <div data-spy="affix" data-offset-top="200">...</div>
    +{% highlight html linenos %} +
    ...
    +{% endhighlight %}
    Heads up! @@ -1720,16 +1761,19 @@ $('.carousel').carousel({

    Via JavaScript

    Call the affix plugin via JavaScript:

    -
    $('#navbar').affix()
    +{% highlight js linenos %} +$('#navbar').affix() +{% endhighlight %}

    Methods

    .affix('refresh')

    When using affix in conjunction with adding or removing of elements from the DOM, you'll want to call the refresh method:

    -
    +{% highlight js linenos %}
     $('[data-spy="affix"]').each(function () {
       $(this).affix('refresh')
     });
    -
    +{% endhighlight %} +

    Options

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset-top="200".

    @@ -1755,75 +1799,7 @@ $('[data-spy="affix"]').each(function () { -
    - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/docs/scaffolding.html b/docs/scaffolding.html deleted file mode 100644 index 87a9bb0031..0000000000 --- a/docs/scaffolding.html +++ /dev/null @@ -1,602 +0,0 @@ - - - - - Scaffolding · Bootstrap - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -

    Scaffolding

    -

    Bootstrap is built on responsive 12-column grids, layouts, and components.

    -
    -
    - -
    - - -
    - -
    - - - - -
    - - -

    Requires HTML5 doctype

    -

    Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects.

    -
    -<!DOCTYPE html>
    -<html lang="en">
    -  ...
    -</html>
    -
    - -

    Typography and links

    -

    Bootstrap sets basic global display, typography, and link styles. Specifically, we:

    -
      -
    • Remove margin on the body
    • -
    • Set background-color: white; on the body
    • -
    • Use the @baseFontFamily, @baseFontSize, and @baseLineHeight attributes as our typographic base
    • -
    • Set the global link color via @linkColor and apply link underlines only on :hover
    • -
    -

    These styles can be found within scaffolding.less.

    - -

    Reset via Normalize

    -

    With Bootstrap 2, the old reset block has been dropped in favor of Normalize.css, a project by Nicolas Gallagher and Jonathan Neal that also powers the HTML5 Boilerplate. While we use much of Normalize within our reset.less, we have removed some elements specifically for Bootstrap.

    - -
    - - - - - -
    - - -

    Live grid example

    -

    The default Bootstrap grid system utilizes 12 columns, making for a 940px wide container without responsive features enabled. With the responsive CSS file added, the grid adapts to be 724px and 1170px wide depending on your viewport. Below 767px viewports, the columns become fluid and stack vertically.

    -
    -
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    -
    -
    2
    -
    3
    -
    4
    -
    -
    -
    4
    -
    5
    -
    -
    -
    9
    -
    -
    - -

    Basic grid HTML

    -

    For a simple two column layout, create a .row and add the appropriate number of .span* columns. As this is a 12-column grid, each .span* spans a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent).

    -
    -<div class="row">
    -  <div class="span4">...</div>
    -  <div class="span8">...</div>
    -</div>
    -
    -

    Given this example, we have .span4 and .span8, making for 12 total columns and a complete row.

    - -

    Offsetting columns

    -

    Move columns to the right using .offset* classes. Each class increases the left margin of a column by a whole column. For example, .offset4 moves .span4 over four columns.

    -
    -
    -
    4
    -
    3 offset 2
    -
    -
    -
    3 offset 1
    -
    3 offset 2
    -
    -
    -
    6 offset 3
    -
    -
    -
    -<div class="row">
    -  <div class="span4">...</div>
    -  <div class="span3 offset2">...</div>
    -</div>
    -
    - -

    Nesting columns

    -

    To nest your content with the default grid, add a new .row and set of .span* columns within an existing .span* column. Nested rows should include a set of columns that add up to the number of columns of its parent.

    -
    -
    - Level 1 column -
    -
    - Level 2 -
    -
    - Level 2 -
    -
    -
    -
    -
    -<div class="row">
    -  <div class="span9">
    -    Level 1 column
    -    <div class="row">
    -      <div class="span6">Level 2</div>
    -      <div class="span3">Level 2</div>
    -    </div>
    -  </div>
    -</div>
    -
    -
    - - - - -
    - - -

    Live fluid grid example

    -

    The fluid grid system uses percents instead of pixels for column widths. It has the same responsive capabilities as our fixed grid system, ensuring proper proportions for key screen resolutions and devices.

    -
    -
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    -
    -
    4
    -
    4
    -
    4
    -
    -
    -
    4
    -
    8
    -
    -
    -
    6
    -
    6
    -
    -
    -
    12
    -
    -
    - -

    Basic fluid grid HTML

    -

    Make any row "fluid" by changing .row to .row-fluid. The column classes stay the exact same, making it easy to flip between fixed and fluid grids.

    -
    -<div class="row-fluid">
    -  <div class="span4">...</div>
    -  <div class="span8">...</div>
    -</div>
    -
    - -

    Fluid offsetting

    -

    Operates the same way as the fixed grid system offsetting: add .offset* to any column to offset by that many columns.

    -
    -
    -
    4
    -
    4 offset 4
    -
    -
    -
    3 offset 3
    -
    3 offset 3
    -
    -
    -
    6 offset 6
    -
    -
    -
    -<div class="row-fluid">
    -  <div class="span4">...</div>
    -  <div class="span4 offset2">...</div>
    -</div>
    -
    - -

    Fluid nesting

    -

    Fluid grids utilize nesting differently: each nested level of columns should add up to 12 columns. This is because the fluid grid uses percentages, not pixels, for setting widths.

    -
    -
    - Fluid 12 -
    -
    - Fluid 6 -
    -
    - Fluid 6 -
    -
    - Fluid 6 -
    -
    -
    -
    - Fluid 6 -
    -
    -
    -
    -
    -<div class="row-fluid">
    -  <div class="span12">
    -    Fluid 12
    -    <div class="row-fluid">
    -      <div class="span6">
    -        Fluid 6
    -        <div class="row-fluid">
    -          <div class="span6">Fluid 6</div>
    -          <div class="span6">Fluid 6</div>
    -        </div>
    -      </div>
    -      <div class="span6">Fluid 6</div>
    -    </div>
    -  </div>
    -</div>
    -
    - -
    - - - - - -
    - - -

    Fixed layout

    -

    Provides a common fixed-width (and optionally responsive) layout with only <div class="container"> required.

    -
    -
    -
    -
    -<body>
    -  <div class="container">
    -    ...
    -  </div>
    -</body>
    -
    - -

    Fluid layout

    -

    Create a fluid, two-column page with <div class="container-fluid">—great for applications and docs.

    -
    -
    -
    -
    -
    -<div class="container-fluid">
    -  <div class="row-fluid">
    -    <div class="span2">
    -      <!--Sidebar content-->
    -    </div>
    -    <div class="span10">
    -      <!--Body content-->
    -    </div>
    -  </div>
    -</div>
    -
    -
    - - - - - -
    - - -

    Enabling responsive features

    -

    Turn on responsive CSS in your project by including the proper meta tag and additional stylesheet within the <head> of your document. If you've compiled Bootstrap from the Customize page, you need only include the meta tag.

    -
    -<meta name="viewport" content="width=device-width, initial-scale=1.0">
    -<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
    -
    -

    Heads up! Bootstrap doesn't include responsive features by default at this time as not everything needs to be responsive. Instead of encouraging developers to remove this feature, we figure it best to enable it as needed.

    - -

    About responsive Bootstrap

    - Responsive devices -

    Media queries allow for custom CSS based on a number of conditions—ratios, widths, display type, etc—but usually focuses around min-width and max-width.

    -
      -
    • Modify the width of column in our grid
    • -
    • Stack elements instead of float wherever necessary
    • -
    • Resize headings and text to be more appropriate for devices
    • -
    -

    Use media queries responsibly and only as a start to your mobile audiences. For larger projects, do consider dedicated code bases and not layers of media queries.

    - -

    Supported devices

    -

    Bootstrap supports a handful of media queries in a single file to help make your projects more appropriate on different devices and screen resolutions. Here's what's included:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    LabelLayout widthColumn widthGutter width
    Large display1200px and up70px30px
    Default980px and up60px20px
    Portrait tablets768px and above42px20px
    Phones to tablets767px and belowFluid columns, no fixed widths
    Phones480px and belowFluid columns, no fixed widths
    -
    -/* Large desktop */
    -@media (min-width: 1200px) { ... }
    -
    -/* Portrait tablet to landscape and desktop */
    -@media (min-width: 768px) and (max-width: 979px) { ... }
    -
    -/* Landscape phone to portrait tablet */
    -@media (max-width: 767px) { ... }
    -
    -/* Landscape phones and down */
    -@media (max-width: 480px) { ... }
    -
    - - -

    Responsive utility classes

    -

    For faster mobile-friendly development, use these utility classes for showing and hiding content by device. Below is a table of the available classes and their effect on a given media query layout (labeled by device). They can be found in responsive.less.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ClassPhones 767px and belowTablets 979px to 768pxDesktops Default
    .visible-phoneVisible
    .visible-tabletVisible
    .visible-desktopVisible
    .hidden-phoneVisibleVisible
    .hidden-tabletVisibleVisible
    .hidden-desktopVisibleVisible
    - -

    When to use

    -

    Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation. Responsive utilities should not be used with tables, and as such are not supported.

    - -

    Responsive utilities test case

    -

    Resize your browser or load on different devices to test the above classes.

    -

    Visible on...

    -

    Green checkmarks indicate that class is visible in your current viewport.

    -
      -
    • Phone✔ Phone
    • -
    • Tablet✔ Tablet
    • -
    • Desktop✔ Desktop
    • -
    -

    Hidden on...

    -

    Here, green checkmarks indicate that class is hidden in your current viewport.

    -
      -
    • Phone✔ Phone
    • -
    • Tablet✔ Tablet
    • -
    • Desktop✔ Desktop
    • -
    - -
    - - - -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/templates/layout.mustache b/docs/templates/layout.mustache deleted file mode 100644 index 8614dea4bf..0000000000 --- a/docs/templates/layout.mustache +++ /dev/null @@ -1,167 +0,0 @@ - - - - - {{title}} - - - - - - - - - - - - - - - - - - - - - - {{! Analytics for Bootstrap docs only }} - {{#production}} - - {{/production}} - - - - - - - -{{>body}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{#production}} - - - {{/production}} - - - diff --git a/docs/templates/pages/components.mustache b/docs/templates/pages/components.mustache deleted file mode 100644 index 1562d9d4db..0000000000 --- a/docs/templates/pages/components.mustache +++ /dev/null @@ -1,1818 +0,0 @@ - -
    -
    -

    Components

    -

    Dozens of reusable components built to provide navigation, alerts, popovers, and more.

    -
    -
    - - -
    - - -
    - -
    - - - - - - - - - - -
    - -

    Group a series of buttons together on a single line with the button group. Add on optional JavaScript radio and checkbox style behavior with our buttons plugin.

    - -

    Single button group

    -

    Wrap a series of buttons with .btn in .btn-group.

    -
    -
    - - - -
    -
    -
    -<div class="btn-group">
    -  <button class="btn">Left</button>
    -  <button class="btn">Middle</button>
    -  <button class="btn">Right</button>
    -</div>
    -
    - -

    Multiple button groups

    -

    Combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex components.

    -
    -
    -
    - - - - -
    -
    - - - -
    -
    - -
    -
    -
    -
    -<div class="btn-toolbar">
    -  <div class="btn-group">
    -    ...
    -  </div>
    -</div>
    -
    - -

    Vertical button groups

    -

    Make a set of buttons appear vertically stacked rather than horizontally.

    -
    -
    - - - - -
    -
    -
    -<div class="btn-group btn-group-vertical">
    -  ...
    -</div>
    -
    - -

    Justified button groups

    -

    Make a group of buttons stretch at the same size to span the entire width of its parent. This only works with <a> elements as the <button> doesn't pick up these styles.

    -
    -
    - Left - Right - Middle -
    -
    -
    -<div class="btn-group btn-group-justified">
    -  ...
    -</div>
    -
    - -
    - - - - -
    - -

    Use any button to trigger a dropdown menu by placing it within a .btn-group and providing the proper menu markup. Requires the Bootstrap dropdown plugin.

    - -

    Single or split button

    -

    Turn a button into dropdown toggle, or add a second button to toggle the dropdown while retaining the primary button action.

    - -
    -<-- Single button -->
    -<div class="btn-group">
    -  <button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
    -    Action
    -    <span class="caret"></span>
    -  </button>
    -  <ul class="dropdown-menu">
    -    <!-- dropdown menu links -->
    -  </ul>
    -</div>
    -
    -<-- Split button -->
    -<div class="btn-group">
    -  <button class="btn">Action</button>
    -  <button class="btn dropdown-toggle" data-toggle="dropdown">
    -    <span class="caret"></span>
    -  </button>
    -  <ul class="dropdown-menu">
    -    <!-- dropdown menu links -->
    -  </ul>
    -</div>
    -
    - -

    Works with all button sizes

    -

    Button dropdowns work at any size: .btn-large, .btn-small, or .btn-mini.

    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    {{! /example }} - -

    Dropup buttons

    -

    Trigger dropdown menus above elements by adding .dropup to the parent.

    -
    -
    - -
    - - - -
    -
    -
    {{! /example }} -
    -<div class="btn-group dropup">
    -  <button class="btn">Dropup</button>
    -  <button class="btn dropdown-toggle" data-toggle="dropdown">
    -    <span class="caret"></span>
    -  </button>
    -  <ul class="dropdown-menu">
    -    <!-- dropdown menu links -->
    -  </ul>
    -</div>
    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - -

    Provide pagination links for your site or app with the multi-page pagination component, or the simpler pager alternative.

    - -

    Standard pagination

    -

    Simple pagination inspired by Rdio, great for apps and search results. The large block is hard to miss, easily scalable, and provides large click areas.

    -
    - -
    -
    -<ul class="pagination">
    -  <li><a href="#">Prev</a></li>
    -  <li><a href="#">1</a></li>
    -  <li><a href="#">2</a></li>
    -  <li><a href="#">3</a></li>
    -  <li><a href="#">4</a></li>
    -  <li><a href="#">5</a></li>
    -  <li><a href="#">Next</a></li>
    -</ul>
    -
    - -

    Disabled and active states

    -

    Links are customizable for different circumstances. Use .disabled for unclickable links and .active to indicate the current page.

    -
    - -
    -
    -<ul class="pagination">
    -  <li class="disabled"><a href="#">&laquo;</a></li>
    -  <li class="active"><a href="#">1</a></li>
    -  ...
    -</ul>
    -
    -

    You can optionally swap out active or disabled anchors for spans to remove click functionality while retaining intended styles.

    -
    -<ul class="pagination">
    -  <li class="disabled"><span>&laquo;</span></li>
    -  <li class="active"><span>1</span></li>
    -  ...
    -</ul>
    -
    - -

    Sizes

    -

    Fancy larger or smaller pagination? Add .pagination-large, .pagination-small, or .pagination-mini for additional sizes.

    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -<ul class="pagination pagination-large">
    -  ...
    -</ul>
    -<ul class="pagination">
    -  ...
    -</ul>
    -<ul class="pagination pagination-small">
    -  ...
    -</ul>
    -<ul class="pagination pagination-mini">
    -  ...
    -</ul>
    -
    - -

    Pager

    -

    Quick previous and next links for simple pagination implementations with light markup and styles. It's great for simple sites like blogs or magazines.

    - -

    Default example

    -

    By default, the pager centers links.

    -
    - -
    -
    -<ul class="pager">
    -  <li><a href="#">Previous</a></li>
    -  <li><a href="#">Next</a></li>
    -</ul>
    -
    - -

    Aligned links

    -

    Alternatively, you can align each link to the sides:

    -
    - -
    -
    -<ul class="pager">
    -  <li class="previous">
    -    <a href="#">&larr; Older</a>
    -  </li>
    -  <li class="next">
    -    <a href="#">Newer &rarr;</a>
    -  </li>
    -</ul>
    -
    - -

    Optional disabled state

    -

    Pager links also use the general .disabled utility class from the pagination.

    -
    - -
    -
    -<ul class="pager">
    -  <li class="previous disabled">
    -    <a href="#">&larr; Older</a>
    -  </li>
    -  ...
    -</ul>
    -
    - -
    - - - - -
    - -

    Easily highlight new or unread items by adding a <span class="counter"> to links, Bootstrap navs, and more.

    - -
    - Inbox 42 -
    -
    -<a href="#">
    -  Inbox
    -  <span class="counter">42</span>
    -</a>
    -
    - -

    Self collapsing

    -

    When there are no new or unread items, counters will simply collapse (via CSS's :empty selector) provided no content exists within.

    - -

    Adapts to active nav states

    -

    Built-in styles are included for placing counters in active states in pill and list navigations.

    - -
    -<ul class="nav nav-list">
    -  <li class="active">
    -    <a href="#">Home</a>
    -  </li>
    -  <li><a href="#">...</a></li>
    -  <li><a href="#">...</a></li>
    -</ul>
    -
    - -
    - - - - -
    - - -

    Jumbotron

    -

    A lightweight, flexible component to showcase key content on your site. It works well on marketing and content-heavy sites.

    -
    -
    -

    Hello, world!

    -

    This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

    -

    Learn more

    -
    -
    -
    -<div class="jumbotron">
    -  <h1>Heading</h1>
    -  <p>Tagline</p>
    -  <p>
    -    <a class="btn btn-primary btn-large">
    -      Learn more
    -    </a>
    -  </p>
    -</div>
    -
    - -

    Page header

    -

    A simple shell for an h1 to appropriately space out and segment sections of content on a page. It can utilize the h1's default small, element as well most other components (with additional styles).

    -
    - -
    -
    -<div class="page-header">
    -  <h1>Example page header <small>Subtext for header</small></h1>
    -</div>
    -
    - -
    - - - - -
    - -

    Extend Bootstrap's grid system with the thumbnail component to easily display grids of images, videos, text, and more.

    - -

    Default thumbnails

    -

    By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.

    -
    -
    -
    - - - -
    -
    - - - -
    -
    - - - -
    -
    - - - -
    -
    -
    {{! /.bs-docs-example }} -
    -<div class="row">
    -  <div class="span3">
    -    <a href="#" class="thumbnail">
    -      <img src="holder.js/260x180" alt="">
    -    </a>
    -  </div>
    -  ...
    -</div>
    -
    - -

    Custom content thumbnails

    -

    With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.

    -
    -
    -
    -
    - -
    -

    Thumbnail label

    -

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    -

    Action Action

    -
    -
    -
    -
    -
    - -
    -

    Thumbnail label

    -

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    -

    Action Action

    -
    -
    -
    -
    -
    - -
    -

    Thumbnail label

    -

    Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.

    -

    Action Action

    -
    -
    -
    -
    -
    {{! /.bs-docs-example }} -
    -<div class="row">
    -  <div class="span4">
    -    <div class="thumbnail">
    -      <img data-src="holder.js/300x200" alt="">
    -      <h3>Thumbnail label</h3>
    -      <p>Thumbnail caption...</p>
    -    </div>
    -  </div>
    -  ...
    -</div>
    -
    - -
    - - - - - -
    - -

    Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. For inline dismissal, use the alerts jQuery plugin.

    - -

    Default alert

    -

    Wrap any text and an optional dismiss button in .alert for a basic warning alert message. To ensure proper behavior across all devices, be sure to use <button> element with the data-dismiss="alert" data attribute.

    -
    -
    - - Warning! Best check yo self, you're not looking too good. -
    -
    -
    -<div class="alert">
    -  <button type="button" class="close" data-dismiss="alert">&times;</button>
    -  <strong>Warning!</strong> Best check yo self, you're not looking too good.
    -</div>
    -
    - -

    Block alerts

    -

    For longer messages, increase the padding on the top and bottom of the alert wrapper by adding .alert-block.

    -
    -
    - -

    Warning!

    -

    Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

    -
    -
    -
    -<div class="alert alert-block">
    -  <button type="button" class="close" data-dismiss="alert">&times;</button>
    -  <h4>Warning!</h4>
    -  Best check yo self, you're not...
    -</div>
    -
    - -

    Contextual alternatives

    -

    Add optional classes to change an alert's connotation.

    -
    -
    - - Oh snap! Change a few things up and try submitting again. -
    -
    - - Well done! You successfully read this important alert message. -
    -
    - - Heads up! This alert needs your attention, but it's not super important. -
    -
    -
    -<div class="alert alert-error">... </div>
    -<div class="alert alert-success">...</div>
    -<div class="alert alert-info">...</div>
    -
    -
    - - - - - -
    - -

    Provide up-to-date feedback on the progress of a workflow or action with simple yet flexible progress bars.

    - -

    Progress bars use CSS3 transitions and animations to achieve some of their effects. These features are not supported in IE8-9 or older versions of Firefox. Internet Explorer 10 and below, as well as Opera 12, do not support animations.

    - -

    Basic

    -

    Default progress bar with a vertical gradient.

    -
    -
    -
    -
    -
    -
    -<div class="progress">
    -  <div class="progress-bar" style="width: 60%;"></div>
    -</div>
    -
    - -

    Additional colors

    -

    Progress bars use some of the same button and alert classes for consistent styles.

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -<div class="progress">
    -  <div class="progress-bar progress-bar-info" style="width: 20%"></div>
    -</div>
    -<div class="progress">
    -  <div class="progress-bar progress-bar-success" style="width: 40%"></div>
    -</div>
    -<div class="progress">
    -  <div class="progress-bar progress-bar-warning" style="width: 60%"></div>
    -</div>
    -<div class="progress">
    -  <div class="progress-bar progress-bar-danger" style="width: 80%"></div>
    -</div>
    -
    - -

    Striped

    -

    Uses a gradient to create a striped effect. Not available in IE8.

    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -<div class="progress progress-striped">
    -  <div class="progress-bar progress-bar-info" style="width: 20%"></div>
    -</div>
    -<div class="progress progress-striped">
    -  <div class="progress-bar progress-bar-success" style="width: 40%"></div>
    -</div>
    -<div class="progress progress-striped">
    -  <div class="progress-bar progress-bar-warning" style="width: 60%"></div>
    -</div>
    -<div class="progress progress-striped">
    -  <div class="progress-bar progress-bar-danger" style="width: 80%"></div>
    -</div>
    -
    - -

    Animated

    -

    Add .active to .progress-striped to animate the stripes right to left. Not available in all versions of IE.

    -
    -
    -
    -
    -
    -
    -<div class="progress progress-striped active">
    -  <div class="progress-bar" style="width: 40%;"></div>
    -</div>
    -
    - -

    Stacked

    -

    Place multiple bars into the same .progress to stack them.

    -
    -
    -
    -
    -
    -
    -
    -
    -<div class="progress">
    -  <div class="progress-bar progress-bar-success" style="width: 35%;"></div>
    -  <div class="progress-bar progress-bar-warning" style="width: 20%;"></div>
    -  <div class="progress-bar progress-bar-danger" style="width: 10%;"></div>
    -</div>
    -
    - -
    - - - - - -
    - -

    Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content.

    - -

    Default example

    -

    The default media allow to float a media object (images, video, audio) to the left or right of a content block.

    -
    -
    - - - -
    -

    Media heading

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. -
    -
    -
    - - - -
    -

    Media heading

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. -
    - - - -
    -

    Media heading

    - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. -
    -
    -
    -
    -
    {{! /.bs-docs-example }} -
    -<div class="media">
    -  <a class="pull-left" href="#">
    -    <img class="media-object" data-src="holder.js/64x64">
    -  </a>
    -  <div class="media-body">
    -    <h4 class="media-heading">Media heading</h4>
    -    ...
    -
    -    <!-- Nested media object -->
    -    <div class="media">
    -      ...
    -    </div>
    -  </div>
    -</div>
    -
    - -

    Media list

    -

    With a bit of extra markup, you can use media inside list (useful for comment threads or articles lists).

    -
    -
      -
    • - - - -
      -

      Media heading

      -

      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.

      - -
      - - - -
      -

      Nested media heading

      - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. - -
      - - - -
      -

      Nested media heading

      - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. -
      -
      -
      -
      - -
      - - - -
      -

      Nested media heading

      - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. -
      -
      -
      -
    • -
    • - - - -
      -

      Media heading

      - Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. -
      -
    • -
    -
    -
    -<ul class="media-list">
    -  <li class="media">
    -    <a class="pull-left" href="#">
    -      <img class="media-object" data-src="holder.js/64x64">
    -    </a>
    -    <div class="media-body">
    -      <h4 class="media-heading">Media heading</h4>
    -      ...
    -
    -      <!-- Nested media object -->
    -      <div class="media">
    -        ...
    -     </div>
    -    </div>
    -  </li>
    -</ul>
    -
    - -
    - - - - - - -
    - - -

    Wells

    -

    Use the well as a simple effect on an element to give it an inset effect.

    -
    -
    - Look, I'm in a well! -
    -
    -
    -<div class="well">
    -  ...
    -</div>
    -
    -

    Optional classes

    -

    Control padding and rounded corners with two optional modifier classes.

    -
    -
    - Look, I'm in a well! -
    -
    -
    -<div class="well well-large">
    -  ...
    -</div>
    -
    -
    -
    - Look, I'm in a well! -
    -
    -
    -<div class="well well-small">
    -  ...
    -</div>
    -
    - -

    Close icon

    -

    Use the generic close icon for dismissing content like modals and alerts.

    -
    -

    -
    -
    <button class="close">&times;</button>
    -

    iOS devices require an href="#" for click events if you would rather use an anchor.

    -
    <a class="close" href="#">&times;</a>
    - -

    Helper classes

    -

    Simple, focused classes for small display or behavior tweaks.

    - -

    .pull-left

    -

    Float an element left

    -
    -class="pull-left"
    -
    -
    -.pull-left {
    -  float: left;
    -}
    -
    - -

    .pull-right

    -

    Float an element right

    -
    -class="pull-right"
    -
    -
    -.pull-right {
    -  float: right;
    -}
    -
    - -

    .muted

    -

    Change an element's color to #999

    -
    -class="muted"
    -
    -
    -.muted {
    -  color: #999;
    -}
    -
    - -

    .clearfix

    -

    Clear the float on any element. Utilizes the micro clearfix as popularized by Nicolas Gallagher.

    -
    -class="clearfix"
    -
    -
    -.clearfix {
    -  &:before,
    -  &:after {
    -    content: " ";
    -    display: table;
    -  }
    -  &:after {
    -    clear: both;
    -  }
    -}
    -
    - -
    - - - -
    {{! /span9 }} -
    {{! row}} - -
    {{! /.container }} diff --git a/docs/templates/pages/css.mustache b/docs/templates/pages/css.mustache deleted file mode 100644 index 8ee3833cf8..0000000000 --- a/docs/templates/pages/css.mustache +++ /dev/null @@ -1,2258 +0,0 @@ - -
    -
    -

    CSS

    -

    Fundamental HTML elements styled and enhanced with extensible classes.

    -
    -
    - - -
    - - -
    - -
    - - - - -
    - -

    Get the lowdown on the key pieces of Bootstrap's infrastructure, including our approach to better, faster, stronger web development.

    - -

    Requires HTML5 doctype

    -

    Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects.

    -
    -<!DOCTYPE html>
    -<html lang="en">
    -  ...
    -</html>
    -
    - -

    Mobile first

    -

    With Bootstrap 2, we added optional mobile friendly styles for key aspects of the framework. With Bootstrap 3, we've rewritten the project to be mobile friendly from the start. Instead of adding on optional mobile styles, they're baked right into the core. In fact, Bootstrap is mobile first. Mobile first styles can be found throughout the entire library instead of in separate files.

    -

    To ensure proper rendering and touch zooming, add the viewport meta tag to your <head>.

    -
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    - -

    Typography and links

    -

    Bootstrap sets basic global display, typography, and link styles. Specifically, we:

    -
      -
    • Remove margin on the body
    • -
    • Set background-color: white; on the body
    • -
    • Use the @font-family-base, @font-size-base, and @line-height-base attributes as our typographic base
    • -
    • Set the global link color via @link-color and apply link underlines only on :hover
    • -
    -

    These styles can be found within scaffolding.less.

    - -

    Normalize reset

    -

    For improved cross-browser rendering, we use Normalize, a project by Nicolas Gallagher and Jonathan Neal.

    - -
    - - - - - -
    - - - {{! Headings }} -

    Headings

    -

    All HTML headings, <h1> through <h6> are available.

    -
    -

    h1. Heading 1

    -

    h2. Heading 2

    -

    h3. Heading 3

    -

    h4. Heading 4

    -
    h5. Heading 5
    -
    h6. Heading 6
    -
    - - {{! Body copy }} -

    Body copy

    -

    Bootstrap's global default font-size is 14px, with a line-height of 20px. This is applied to the <body> and all paragraphs. In addition, <p> (paragraphs) receive a bottom margin of half their line-height (10px by default).

    -
    -

    Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

    -

    Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.

    -

    Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.

    -
    -
    <p>...</p>
    - - {{! Body copy .lead }} -

    Lead body copy

    -

    Make a paragraph stand out by adding .lead.

    -
    -

    Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.

    -
    -
    <p class="lead">...</p>
    - - {{! Using LESS }} -

    Built with Less

    -

    The typographic scale is based on two LESS variables in variables.less: @font-size-base and @line-height-base. The first is the base font-size used throughout and the second is the base line-height. We use those variables and some simple math to create the margins, paddings, and line-heights of all our type and more. Customize them and Bootstrap adapts.

    - - - {{! Emphasis }} -

    Emphasis

    -

    Make use of HTML's default emphasis tags with lightweight styles.

    - -

    <small>

    -

    For de-emphasizing inline or blocks of text, use the small tag.

    -
    -

    This line of text is meant to be treated as fine print.

    -
    -
    -<p>
    -  <small>This line of text is meant to be treated as fine print.</small>
    -</p>
    -
    - -

    Bold

    -

    For emphasizing a snippet of text with a heavier font-weight.

    -
    -

    The following snippet of text is rendered as bold text.

    -
    -
    <strong>rendered as bold text</strong>
    - -

    Italics

    -

    For emphasizing a snippet of text with italics.

    -
    -

    The following snippet of text is rendered as italicized text.

    -
    -
    <em>rendered as italicized text</em>
    - -

    Feel free to use <b> and <i> in HTML5. <b> is meant to highlight words or phrases without conveying additional importance while <i> is mostly for voice, technical terms, etc.

    - -

    Alignment classes

    -

    Easily realign text to components with text alignment classes.

    -
    -

    Left aligned text.

    -

    Center aligned text.

    -

    Right aligned text.

    -
    -
    -<p class="text-left">Left aligned text.</p>
    -<p class="text-center">Center aligned text.</p>
    -<p class="text-right">Right aligned text.</p>
    -
    - -

    Emphasis classes

    -

    Convey meaning through color with a handful of emphasis utility classes.

    -
    -

    Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.

    -

    Etiam porta sem malesuada magna mollis euismod.

    -

    Donec ullamcorper nulla non metus auctor fringilla.

    -

    Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

    -
    -
    -<p class="muted">Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.</p>
    -<p class="text-warning">Etiam porta sem malesuada magna mollis euismod.</p>
    -<p class="text-error">Donec ullamcorper nulla non metus auctor fringilla.</p>
    -<p class="text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
    -
    - - - {{! Abbreviations }} -

    Abbreviations

    -

    Stylized implementation of HTML's <abbr> element for abbreviations and acronyms to show the expanded version on hover. Abbreviations with a title attribute have a light dotted bottom border and a help cursor on hover, providing additional context on hover.

    - -

    <abbr>

    -

    For expanded text on long hover of an abbreviation, include the title attribute.

    -
    -

    An abbreviation of the word attribute is attr.

    -
    -
    <abbr title="attribute">attr</abbr>
    - -

    <abbr class="initialism">

    -

    Add .initialism to an abbreviation for a slightly smaller font-size.

    -
    -

    HTML is the best thing since sliced bread.

    -
    -
    <abbr title="HyperText Markup Language" class="initialism">HTML</abbr>
    - - - {{! Addresses }} -

    Addresses

    -

    Present contact information for the nearest ancestor or the entire body of work.

    - -

    <address>

    -

    Preserve formatting by ending all lines with <br>.

    -
    -
    - Twitter, Inc.
    - 795 Folsom Ave, Suite 600
    - San Francisco, CA 94107
    - P: (123) 456-7890 -
    -
    - Full Name
    - first.last@example.com -
    -
    -
    -<address>
    -  <strong>Twitter, Inc.</strong><br>
    -  795 Folsom Ave, Suite 600<br>
    -  San Francisco, CA 94107<br>
    -  <abbr title="Phone">P:</abbr> (123) 456-7890
    -</address>
    -
    -<address>
    -  <strong>Full Name</strong><br>
    -  <a href="mailto:#">first.last@example.com</a>
    -</address>
    -
    - - - {{! Blockquotes }} -

    Blockquotes

    -

    For quoting blocks of content from another source within your document.

    - -

    Default blockquote

    -

    Wrap <blockquote> around any HTML as the quote. For straight quotes we recommend a <p>.

    -
    -
    -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

    -
    -
    -
    -<blockquote>
    -  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
    -</blockquote>
    -
    - -

    Blockquote options

    -

    Style and content changes for simple variations on a standard blockquote.

    - -

    Naming a source

    -

    Add <small> tag for identifying the source. Wrap the name of the source work in <cite>.

    -
    -
    -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

    - Someone famous in Source Title -
    -
    -
    -<blockquote>
    -  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
    -  <small>Someone famous <cite title="Source Title">Source Title</cite></small>
    -</blockquote>
    -
    - -

    Alternate displays

    -

    Use .pull-right for a floated, right-aligned blockquote.

    -
    -
    -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

    - Someone famous in Source Title -
    -
    -
    -<blockquote class="pull-right">
    -  ...
    -</blockquote>
    -
    - - - -

    Lists

    - -

    Unordered

    -

    A list of items in which the order does not explicitly matter.

    -
    -
      -
    • Lorem ipsum dolor sit amet
    • -
    • Consectetur adipiscing elit
    • -
    • Integer molestie lorem at massa
    • -
    • Facilisis in pretium nisl aliquet
    • -
    • Nulla volutpat aliquam velit -
        -
      • Phasellus iaculis neque
      • -
      • Purus sodales ultricies
      • -
      • Vestibulum laoreet porttitor sem
      • -
      • Ac tristique libero volutpat at
      • -
      -
    • -
    • Faucibus porta lacus fringilla vel
    • -
    • Aenean sit amet erat nunc
    • -
    • Eget porttitor lorem
    • -
    -
    -
    -<ul>
    -  <li>...</li>
    -</ul>
    -
    - -

    Ordered

    -

    A list of items in which the order does explicitly matter.

    -
    -
      -
    1. Lorem ipsum dolor sit amet
    2. -
    3. Consectetur adipiscing elit
    4. -
    5. Integer molestie lorem at massa
    6. -
    7. Facilisis in pretium nisl aliquet
    8. -
    9. Nulla volutpat aliquam velit
    10. -
    11. Faucibus porta lacus fringilla vel
    12. -
    13. Aenean sit amet erat nunc
    14. -
    15. Eget porttitor lorem
    16. -
    -
    -
    -<ol>
    -  <li>...</li>
    -</ol>
    -
    - -

    Unstyled

    -

    Remove the default list-style and left padding on list items (immediate children only).

    -
    -
      -
    • Lorem ipsum dolor sit amet
    • -
    • Consectetur adipiscing elit
    • -
    • Integer molestie lorem at massa
    • -
    • Facilisis in pretium nisl aliquet
    • -
    • Nulla volutpat aliquam velit -
        -
      • Phasellus iaculis neque
      • -
      • Purus sodales ultricies
      • -
      • Vestibulum laoreet porttitor sem
      • -
      • Ac tristique libero volutpat at
      • -
      -
    • -
    • Faucibus porta lacus fringilla vel
    • -
    • Aenean sit amet erat nunc
    • -
    • Eget porttitor lorem
    • -
    -
    -
    -<ul class="list-unstyled">
    -  <li>...</li>
    -</ul>
    -
    - -

    Inline

    -

    Place all list items on a single line with inline-block and some light padding.

    -
    -
      -
    • Lorem ipsum
    • -
    • Phasellus iaculis
    • -
    • Nulla volutpat
    • -
    -
    -
    -<ul class="list-inline">
    -  <li>...</li>
    -</ul>
    -
    - -

    Description

    -

    A list of terms with their associated descriptions.

    -
    -
    -
    Description lists
    -
    A description list is perfect for defining terms.
    -
    Euismod
    -
    Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
    -
    Donec id elit non mi porta gravida at eget metus.
    -
    Malesuada porta
    -
    Etiam porta sem malesuada magna mollis euismod.
    -
    -
    -
    -<dl>
    -  <dt>...</dt>
    -  <dd>...</dd>
    -</dl>
    -
    - -

    Horizontal description

    -

    Make terms and descriptions in <dl> line up side-by-side.

    -
    -
    -
    Description lists
    -
    A description list is perfect for defining terms.
    -
    Euismod
    -
    Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
    -
    Donec id elit non mi porta gravida at eget metus.
    -
    Malesuada porta
    -
    Etiam porta sem malesuada magna mollis euismod.
    -
    Felis euismod semper eget lacinia
    -
    Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
    -
    -
    -
    -<dl class="dl-horizontal">
    -  <dt>...</dt>
    -  <dd>...</dd>
    -</dl>
    -
    -
    Auto-truncating
    -

    - Horizontal description lists will truncate terms that are too long to fit in the left column fix text-overflow. In narrower viewports, they will change to the default stacked layout. -

    -
    - - - - -
    - - -

    Live grid example

    -

    The default Bootstrap grid system utilizes 12 columns, making for a 940px wide container without responsive features enabled. With the responsive CSS file added, the grid adapts to be 724px and 1170px wide depending on your viewport. Below 767px viewports, the columns become fluid and stack vertically.

    -
    -
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    1
    -
    -
    -
    4
    -
    4
    -
    4
    -
    -
    -
    6
    -
    6
    -
    -
    - -

    Basic grid HTML

    -

    For a simple two column layout, create a .row and add the appropriate number of .span* columns. As this is a 12-column grid, each .span* spans a number of those 12 columns, and should always add up to 12 for each row (or the number of columns in the parent).

    -
    -<div class="row">
    -  <div class="span4">...</div>
    -  <div class="span8">...</div>
    -</div>
    -
    -

    Given this example, we have .span4 and .span8, making for 12 total columns and a complete row.

    - -

    Offsetting columns

    -

    Move columns to the right using .offset* classes. Each class increases the left margin of a column by a whole column. For example, .offset4 moves .span4 over four columns.

    -
    -
    -
    4
    -
    4 offset 4
    -
    -
    -
    3 offset 3
    -
    3 offset 3
    -
    -
    -
    6 offset 6
    -
    -
    -
    -<div class="row">
    -  <div class="span4">...</div>
    -  <div class="span4 offset4">...</div>
    -</div>
    -
    - - -

    Nesting columns

    -

    To nest your content with the default grid, add a new .row and set of .span* columns within an existing .span* column. Nested rows should include a set of columns that add up to 12.

    -
    -
    - Level 1: 9 columns -
    -
    - Level 2: 6 columns -
    -
    - Level 2: 6 columns -
    -
    -
    -
    -
    -<div class="row">
    -  <div class="span9">
    -    Level 1: 9 columns
    -    <div class="row">
    -      <div class="span6">Level 2: 6 columns</div>
    -      <div class="span6">Level 2: 6 columns</div>
    -    </div>
    -  </div>
    -</div>
    -
    -
    - - - - - - -
    - - -

    Inline

    -

    Wrap inline snippets of code with <code>.

    -
    - For example, <section> should be wrapped as inline. -
    -
    -For example, <code>&lt;section&gt;</code> should be wrapped as inline.
    -
    - -

    Basic block

    -

    Use <pre> for multiple lines of code. Be sure to escape any angle brackets in the code for proper rendering.

    -
    -
    <p>Sample text here...</p>
    -
    -
    -<pre>
    -  &lt;p&gt;Sample text here...&lt;/p&gt;
    -</pre>
    -
    -

    You may optionally add the .pre-scrollable class which will set a max-height of 350px and provide a y-axis scrollbar.

    -
    - - - - -
    - - -

    Default styles

    -

    For basic styling—light padding and only horizontal dividers—add the base class .table to any <table>.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #First NameLast NameUsername
    1MarkOtto@mdo
    2JacobThornton@fat
    3Larrythe Bird@twitter
    -
    {{! /example }} -
    -<table class="table">
    -  …
    -</table>
    -
    - - -

    Optional classes

    -

    Add any of the following classes to the .table base class.

    - -

    .table-striped

    -

    Adds zebra-striping to any table row within the <tbody> via the :nth-child CSS selector (not available in IE8).

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #First NameLast NameUsername
    1MarkOtto@mdo
    2JacobThornton@fat
    3Larrythe Bird@twitter
    -
    {{! /example }} -
    -<table class="table table-striped">
    -  …
    -</table>
    -
    - -

    .table-bordered

    -

    Add borders and rounded corners to the table.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #First NameLast NameUsername
    1MarkOtto@mdo
    MarkOtto@TwBootstrap
    2JacobThornton@fat
    3Larry the Bird@twitter
    -
    {{! /example }} -
    -<table class="table table-bordered">
    -  …
    -</table>
    -
    - -

    .table-hover

    -

    Enable a hover state on table rows within a <tbody>.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #First NameLast NameUsername
    1MarkOtto@mdo
    2JacobThornton@fat
    3Larry the Bird@twitter
    -
    {{! /example }} -
    -<table class="table table-hover">
    -  …
    -</table>
    -
    - -

    .table-condensed

    -

    Makes tables more compact by cutting cell padding in half.

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #First NameLast NameUsername
    1MarkOtto@mdo
    2JacobThornton@fat
    3Larry the Bird@twitter
    -
    {{! /example }} -
    -<table class="table table-condensed">
    -  …
    -</table>
    -
    - - -

    Optional row classes

    -

    Use contextual classes to color table rows.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ClassDescription
    - .success - Indicates a successful or positive action.
    - .error - Indicates a dangerous or potentially negative action.
    - .warning - Indicates a warning that might need attention.
    - .info - Used as an alternative to the default styles.
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    #ProductPayment TakenStatus
    1TB - Monthly01/04/2012Approved
    2TB - Monthly02/04/2012Declined
    3TB - Monthly03/04/2012Pending
    4TB - Monthly04/04/2012Call in to confirm
    -
    {{! /example }} -
    -...
    -  <tr class="success">
    -    <td>1</td>
    -    <td>TB - Monthly</td>
    -    <td>01/04/2012</td>
    -    <td>Approved</td>
    -  </tr>
    -...
    -
    - - -

    Supported table markup

    -

    List of supported table HTML elements and how they should be used.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TagDescription
    - <table> - - Wrapping element for displaying data in a tabular format -
    - <thead> - - Container element for table header rows (<tr>) to label table columns -
    - <tbody> - - Container element for table rows (<tr>) in the body of the table -
    - <tr> - - Container element for a set of table cells (<td> or <th>) that appears on a single row -
    - <td> - - Default table cell -
    - <th> - - Special table cell for column (or row, depending on scope and placement) labels -
    - <caption> - - Description or summary of what the table holds, especially useful for screen readers -
    -
    -<table>
    -  <caption>...</caption>
    -  <thead>
    -    <tr>
    -      <th>...</th>
    -      <th>...</th>
    -    </tr>
    -  </thead>
    -  <tbody>
    -    <tr>
    -      <td>...</td>
    -      <td>...</td>
    -    </tr>
    -  </tbody>
    -</table>
    -
    - -
    - - - - -
    - - -

    Default styles

    -

    Individual form controls automatically receive some global styling. By default, inputs are set to width: 100%;.

    -
    -
    - Legend - - -

    Example block-level help text here.

    -
    - -
    - -
    -
    {{! /example }} -
    -<form>
    -  <fieldset>
    -    <legend>Legend</legend>
    -    <label>Label name</label>
    -    <input type="text" placeholder="Type something…">
    -    <span class="help-block">Example block-level help text here.</span>
    -    <div class="checkbox">
    -      <label>
    -        <input type="checkbox"> Check me out
    -      </label>
    -    </div>
    -    <button type="submit" class="btn">Submit</button>
    -  </fieldset>
    -</form>
    -
    - - -

    Optional layouts

    -

    Included with Bootstrap are optional form layouts for common use cases.

    - -

    Inline form

    -

    Add .form-inline for left-aligned labels and inline-block controls for a compact layout.

    -
    - - -
    - -
    - -
    {{! /example }} -
    -<form class="form-inline">
    -  <input type="text" class="span3" placeholder="Email">
    -  <input type="password" class="span3" placeholder="Password">
    -    <div class="checkbox">
    -      <label>
    -        <input type="checkbox"> Remember me
    -      </label>
    -    </div>
    -  <button type="submit" class="btn">Sign in</button>
    -</form>
    -
    - -

    Horizontal form

    -

    Right align labels and float them to the left to make them appear on the same line as controls. Requires the most markup changes from a default form:

    -
      -
    • Add .form-horizontal to the form
    • -
    • Wrap labels and controls in .control-group
    • -
    • Add .control-label to the label
    • -
    • Wrap any associated controls in .controls for proper alignment
    • -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -<form class="form-horizontal">
    -  <div class="control-group">
    -    <label class="control-label" for="inputEmail">Email</label>
    -    <div class="controls">
    -      <input type="text" id="inputEmail" placeholder="Email">
    -    </div>
    -  </div>
    -  <div class="control-group">
    -    <label class="control-label" for="inputPassword">Password</label>
    -    <div class="controls">
    -      <input type="password" id="inputPassword" placeholder="Password">
    -    </div>
    -  </div>
    -  <div class="control-group">
    -    <div class="controls">
    -      <div class="checkbox">
    -        <label>
    -          <input type="checkbox"> Remember me
    -        </label>
    -      </div>
    -      <button type="submit" class="btn">Sign in</button>
    -    </div>
    -  </div>
    -</form>
    -
    - - -

    Supported form controls

    -

    Examples of standard form controls supported in an example form layout.

    - -

    Inputs

    -

    Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.

    -

    Requires the use of a specified type at all times.

    -
    - -
    -
    -<input type="text" placeholder="Text input">
    -
    - -

    Textarea

    -

    Form control which supports multiple lines of text. Change rows attribute as necessary.

    -
    - -
    -
    -<textarea rows="3"></textarea>
    -
    - -

    Checkboxes and radios

    -

    Checkboxes are for selecting one or several options in a list while radios are for selecting one option from many.

    -

    Default (stacked)

    -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -<div class="checkbox">
    -  <label>
    -    <input type="checkbox" value="">
    -    Option one is this and that—be sure to include why it's great
    -  </label>
    -</div>
    -
    -<div class="radio">
    -  <label>
    -    <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
    -    Option one is this and that—be sure to include why it's great
    -  </label>
    -</div>
    -<div class="radio">
    -  <label>
    -    <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
    -    Option two can be something else and selecting it will deselect option one
    -  </label>
    -</div>
    -
    - -

    Inline checkboxes

    -

    Use .checkbox-inline or .radio-inline class to a series of checkboxes or radios for controls appear on the same line.

    -
    - - - -
    -
    -<label class="checkbox-inline">
    -  <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
    -</label>
    -<label class="checkbox-inline">
    -  <input type="checkbox" id="inlineCheckbox2" value="option2"> 2
    -</label>
    -<label class="checkbox-inline">
    -  <input type="checkbox" id="inlineCheckbox3" value="option3"> 3
    -</label>
    -
    - -

    Selects

    -

    Use the default option or specify a multiple="multiple" to show multiple options at once.

    -
    - -
    - -
    -
    -<select>
    -  <option>1</option>
    -  <option>2</option>
    -  <option>3</option>
    -  <option>4</option>
    -  <option>5</option>
    -</select>
    -
    -<select multiple="multiple">
    -  <option>1</option>
    -  <option>2</option>
    -  <option>3</option>
    -  <option>4</option>
    -  <option>5</option>
    -</select>
    -
    - - - -

    Form control states

    -

    Provide feedback to users or visitors with basic feedback states on form controls and labels.

    - -

    Input focus

    -

    We remove the default outline styles on some form controls and apply a box-shadow in its place for :focus.

    -
    - -
    -
    -<input id="focusedInput" type="text" value="This is focused...">
    -
    - -

    Invalid inputs

    -

    Style inputs via default browser functionality with :invalid. Specify a type, add the required attribute if the field is not optional, and (if applicable) specify a pattern.

    -

    This is not available in versions of Internet Explorer 7-9 due to lack of support for CSS pseudo selectors.

    -
    - -
    -
    -<input class="span3" type="email" required>
    -
    - -

    Disabled inputs

    -

    Add the disabled attribute on an input to prevent user input and trigger a slightly different look.

    -
    - -
    -
    -<input class="input-xlarge" id="disabledInput" type="text" placeholder="Disabled input here..." disabled>
    -
    - -

    Disabled fieldsets

    -

    Add the disabled attribute to a <fieldset> to disable all the controls within the <fieldset> at once. Link buttons (with the <a> element) will be aesthetically disabled, but you will need custom JavaScript to disable their behavior.

    -
    -
    -
    - -
    -
    - -
    -
    - -
    - -
    -
    -
    -<form class="form-inline">
    -  <fieldset disabled>
    -    <input type="text" class="span4" placeholder="Disabled input">
    -    <select class="span4">
    -      <option>Disabled select</option>
    -    </select>
    -    <div class="checkbox">
    -      <label>
    -        <input type="checkbox"> Can't check this
    -      </label>
    -    </div>
    -    <button type="submit" class="btn btn-primary">Submit</button>
    -  </fieldset>
    -</form>
    -
    - -

    Validation states

    -

    Bootstrap includes validation styles for error, warning, info, and success messages. To use:

    -
      -
    • Add .has-warning, .has-error, or .has-success to the parent element
    • -
    • Add .input-with-feedback to the field(s) in question
    • -
    -

    Validation styles are applied on a per-input basis. With horizontal forms, the <label class="control-label"> will always be styled.

    - -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -<div class="control-group has-warning">
    -  <label class="control-label" for="inputWarning">Input with warning</label>
    -  <div class="controls">
    -    <input type="text" class="input-with-feedback" id="inputWarning">
    -  </div>
    -</div>
    -<div class="control-group has-error">
    -  <label class="control-label" for="inputError">Input with error</label>
    -  <div class="controls">
    -    <input type="text" class="input-with-feedback" id="inputError">
    -  </div>
    -</div>
    -<div class="control-group has-success">
    -  <label class="control-label" for="inputSuccess">Input with success</label>
    -  <div class="controls">
    -    <input type="text" class="input-with-feedback id="inputSuccess"">
    -  </div>
    -</div>
    -
    - - - -

    Extending form controls

    -

    Adding on top of existing browser controls, Bootstrap includes other useful form components.

    - -

    Input groups

    -

    Add text or buttons before, after, or on both sides of any text-based input. Use .input-group with a .add-on to prepend or append elements to an <input>.

    -

    Avoid using <select> elements here as they cannot be fully styled in WebKit browsers.

    -
    -
    - @ - -
    -
    -
    - - .00 -
    -
    -
    - $ - - .00 -
    -
    -
    -<div class="input-group span9">
    -  <span class="input-group-addon">@</span>
    -  <input type="text" placeholder="Username">
    -</div>
    -
    -<div class="input-group span6">
    -  <input type="text">
    -  <span class="input-group-addon">.00</span>
    -</div>
    -
    -<div class="input-group span3">
    -  <span class="input-group-addon">$</span>
    -  <input type="text">
    -  <span class="input-group-addon">.00</span>
    -</div>
    -
    - -

    Optional sizes

    -

    Add the relative form sizing classes to the `.input-group-addon`.

    -
    -
    - @ - -
    -
    -
    - @ - -
    -
    -
    - @ - -
    -
    -
    -<div class="input-group span9">
    -  <span class="input-group-addon input-large">@</span>
    -  <input type="text" class="input-large" placeholder="Username">
    -</div>
    -<div class="input-group span9">
    -  <span class="input-group-addon">@</span>
    -  <input type="text" placeholder="Username">
    -</div>
    -<div class="input-group span9">
    -  <span class="input-group-addon input-small">@</span>
    -  <input type="text" class="input-small" placeholder="Username">
    -</div>
    -
    - -

    Buttons instead of text

    -

    Buttons in input groups are a bit different and require one extra level of nesting. Instead of .input-group-addon, you'll need to use .input-group-btn to wrap the buttons. This is required due to default browser styles that cannot be overridden.

    -
    -
    - - - - -
    -
    -
    - - - - -
    -
    -
    -<div class="input-group span7">
    -  <span class="input-group-btn">
    -    <button class="btn" type="button">Go!</button>
    -  </span>
    -  <input type="text">
    -</div>
    -
    -<div class="input-group span7">
    -  <input type="text">
    -  <span class="input-group-btn">
    -    <button class="btn" type="button">Go!</button>
    -  </span>
    -</div>
    -
    - -

    Button dropdowns

    -

    -
    -
    - - -
    -
    -
    - - -
    -
    -
    -<div class="input-group span7">
    -  <div class="input-group-btn btn-group">
    -    <button class="btn dropdown-toggle" data-toggle="dropdown">
    -      Action
    -      <span class="caret"></span>
    -    </button>
    -    <ul class="dropdown-menu">
    -      ...
    -    </ul>
    -  </div>
    -  <input type="text">
    -</div>
    -
    -<div class="input-group span7">
    -  <input type="text">
    -  <div class="input-group-btn btn-group">
    -    <button class="btn dropdown-toggle" data-toggle="dropdown">
    -      Action
    -      <span class="caret"></span>
    -    </button>
    -    <ul class="dropdown-menu">
    -      ...
    -    </ul>
    -  </div>
    -</div>
    -
    - -

    Segmented dropdown groups

    -
    -
    -
    - - - -
    - -
    - -
    - -
    - -
    - - - -
    -
    -
    -
    -<div class="input-prepend">
    -  <div class="btn-group">...</div>
    -  <input type="text" class="span3">
    -</div>
    -<div class="input-append">
    -  <input type="text" class="span3">
    -  <div class="btn-group">...</div>
    -</div>
    -
    - -

    Control sizing

    -

    Use relative sizing classes like .input-large or match your inputs to the grid column sizes using .span* classes.

    - -

    Relative sizing

    -

    Create larger or smaller form controls that match button sizes.

    -
    -
    - - - -
    -
    -
    -<input class="input-large" type="text" placeholder=".input-large">
    -<input type="text" placeholder="Default input">
    -<input class="input-small" type="text" placeholder=".input-small">
    -
    - -

    Column sizing

    -

    Use .span1 to .span12 for setting widths on inputs that match Bootstrap's grid system.

    -
    -
    - - - - - - -
    -
    -
    -<input class="span1" type="text" placeholder=".span1">
    -<input class="span2" type="text" placeholder=".span2">
    -<input class="span3" type="text" placeholder=".span3">
    -<select class="span1">
    -  ...
    -</select>
    -<select class="span2">
    -  ...
    -</select>
    -<select class="span3">
    -  ...
    -</select>
    -
    -

    If you need multiple inputs on the same line, wrap them in the standard grid markup (with .row and .span* classes). Each input should have it's own column and will expand to fill the available width automatically.

    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -<div class="row">
    -  <div class="span4">
    -    <input type="text" placeholder=".span4">
    -  </div>
    -  <div class="span4">
    -    <input type="text" placeholder=".span4">
    -  </div>
    -  <div class="span4">
    -    <input type="text" placeholder=".span4">
    -  </div>
    -</div>
    -
    - -

    Uneditable inputs

    -

    Present data in a form that's not editable without using actual form markup.

    -
    - Some value here -
    -
    -<span class="input-xlarge uneditable-input">Some value here</span>
    -
    - -

    Form actions

    -

    End a form with a group of actions (buttons). When placed within a .form-horizontal, the buttons will automatically indent to line up with the form controls.

    -
    -
    - - -
    -
    -
    -<div class="form-actions">
    -  <button type="submit" class="btn btn-primary">Save changes</button>
    -  <button type="button" class="btn">Cancel</button>
    -</div>
    -
    - -

    Help text

    -

    Inline and block level support for help text that appears around form controls.

    -

    Inline help

    -
    - Inline help text -
    -
    -<input type="text"><span class="help-inline">Inline help text</span>
    -
    - -

    Block help

    -
    - - A longer block of help text that breaks onto a new line and may extend beyond one line. -
    -
    -<input type="text"><span class="help-block">A longer block of help text that breaks onto a new line and may extend beyond one line.</span>
    -
    - -
    - - - - -
    - - -

    Default buttons

    -

    Button styles can be applied to anything with the .btn class applied. However, typically you'll want to apply these to only <a> and <button> elements for the best rendering.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Buttonclass=""Description
    btnStandard gray button with gradient
    btn btn-primaryProvides extra visual weight and identifies the primary action in a set of buttons
    btn btn-successIndicates a successful or positive action
    btn btn-infoContextual button for informational alert messages
    btn btn-warningIndicates caution should be taken with this action
    btn btn-dangerIndicates a dangerous or potentially negative action
    btn btn-linkDeemphasize a button by making it look like a link while maintaining button behavior
    - -

    Cross browser compatibility

    -

    IE9 doesn't crop background gradients on rounded corners, so we remove it. Related, IE9 jankifies disabled button elements, rendering text gray with a nasty text-shadow that we cannot fix.

    - - -

    Button sizes

    -

    Fancy larger or smaller buttons? Add .btn-large, .btn-small, or .btn-mini for additional sizes.

    -
    -

    - - -

    -

    - - -

    -

    - - -

    -

    - - -

    -
    -
    -<p>
    -  <button class="btn btn-large btn-primary" type="button">Large button</button>
    -  <button class="btn btn-large" type="button">Large button</button>
    -</p>
    -<p>
    -  <button class="btn btn-primary" type="button">Default button</button>
    -  <button class="btn" type="button">Default button</button>
    -</p>
    -<p>
    -  <button class="btn btn-small btn-primary" type="button">Small button</button>
    -  <button class="btn btn-small" type="button">Small button</button>
    -</p>
    -<p>
    -  <button class="btn btn-mini btn-primary" type="button">Mini button</button>
    -  <button class="btn btn-mini" type="button">Mini button</button>
    -</p>
    -
    -

    Create block level buttons—those that span the full width of a parent— by adding .btn-block.

    -
    -
    - - -
    -
    -
    -<button class="btn btn-large btn-block btn-primary" type="button">Block level button</button>
    -<button class="btn btn-large btn-block" type="button">Block level button</button>
    -
    - - -

    Disabled state

    -

    Make buttons look unclickable by fading them back 50%.

    - -

    Anchor element

    -

    Add the .disabled class to <a> buttons.

    -

    - Primary link - Link -

    -
    -<a href="#" class="btn btn-large btn-primary disabled">Primary link</a>
    -<a href="#" class="btn btn-large disabled">Link</a>
    -
    -

    - We use .disabled as a utility class here, similar to the common .active class, so no prefix is required. Also, this class is only for aesthetic; you must use custom JavaScript to disable links here. -

    - -

    Button element

    -

    Add the disabled attribute to <button> buttons.

    -

    - - -

    -
    -<button type="button" class="btn btn-large btn-primary disabled" disabled="disabled">Primary button</button>
    -<button type="button" class="btn btn-large" disabled>Button</button>
    -
    - - -

    One class, multiple tags

    -

    Use the .btn class on an <a>, <button>, or <input> element.

    -
    - Link - - - -
    -
    -<a class="btn" href="">Link</a>
    -<button class="btn" type="submit">Button</button>
    -<input class="btn" type="button" value="Input">
    -<input class="btn" type="submit" value="Submit">
    -
    -

    As a best practice, try to match the element for your context to ensure matching cross-browser rendering. If you have an input, use an <input type="submit"> for your button.

    - -
    - - - - -
    - - -

    Add classes to an <img> element to easily style images in any project. Rounded corners are not available in IE8.

    -
    - - - -
    -
    -<img src="..." class="img-rounded">
    -<img src="..." class="img-circle">
    -<img src="..." class="img-thumbnail">
    -
    - -
    - - - - -
    - - -

    Included glyphs

    -

    Bootstrap comes with all 160 of Glyphicons Halflings set, all available in font formats for easy coloring, sizing, and placement.

    - -
      -
    • glyphicon-glass
    • -
    • glyphicon-music
    • -
    • glyphicon-search
    • -
    • glyphicon-envelope
    • -
    • glyphicon-heart
    • -
    • glyphicon-star
    • -
    • glyphicon-star-empty
    • -
    • glyphicon-user
    • -
    • glyphicon-film
    • -
    • glyphicon-th-large
    • -
    • glyphicon-th
    • -
    • glyphicon-th-list
    • -
    • glyphicon-ok
    • -
    • glyphicon-remove
    • -
    • glyphicon-zoom-in
    • -
    • glyphicon-zoom-out
    • -
    • glyphicon-off
    • -
    • glyphicon-signal
    • -
    • glyphicon-cog
    • -
    • glyphicon-trash
    • -
    • glyphicon-home
    • -
    • glyphicon-file
    • -
    • glyphicon-time
    • -
    • glyphicon-road
    • -
    • glyphicon-download-alt
    • -
    • glyphicon-download
    • -
    • glyphicon-upload
    • -
    • glyphicon-inbox
    • - -
    • glyphicon-play-circle
    • -
    • glyphicon-repeat
    • -
    • glyphicon-refresh
    • -
    • glyphicon-list-alt
    • -
    • glyphicon-lock
    • -
    • glyphicon-flag
    • -
    • glyphicon-headphones
    • -
    • glyphicon-volume-off
    • -
    • glyphicon-volume-down
    • -
    • glyphicon-volume-up
    • -
    • glyphicon-qrcode
    • -
    • glyphicon-barcode
    • -
    • glyphicon-tag
    • -
    • glyphicon-tags
    • -
    • glyphicon-book
    • -
    • glyphicon-bookmark
    • -
    • glyphicon-print
    • -
    • glyphicon-camera
    • -
    • glyphicon-font
    • -
    • glyphicon-bold
    • -
    • glyphicon-italic
    • -
    • glyphicon-text-height
    • -
    • glyphicon-text-width
    • -
    • glyphicon-align-left
    • -
    • glyphicon-align-center
    • -
    • glyphicon-align-right
    • -
    • glyphicon-align-justify
    • -
    • glyphicon-list
    • - -
    • glyphicon-indent-left
    • -
    • glyphicon-indent-right
    • -
    • glyphicon-facetime-video
    • -
    • glyphicon-picture
    • -
    • glyphicon-pencil
    • -
    • glyphicon-map-marker
    • -
    • glyphicon-adjust
    • -
    • glyphicon-tint
    • -
    • glyphicon-edit
    • -
    • glyphicon-share
    • -
    • glyphicon-check
    • -
    • glyphicon-move
    • -
    • glyphicon-step-backward
    • -
    • glyphicon-fast-backward
    • -
    • glyphicon-backward
    • -
    • glyphicon-play
    • -
    • glyphicon-pause
    • -
    • glyphicon-stop
    • -
    • glyphicon-forward
    • -
    • glyphicon-fast-forward
    • -
    • glyphicon-step-forward
    • -
    • glyphicon-eject
    • -
    • glyphicon-chevron-left
    • -
    • glyphicon-chevron-right
    • -
    • glyphicon-plus-sign
    • -
    • glyphicon-minus-sign
    • -
    • glyphicon-remove-sign
    • -
    • glyphicon-ok-sign
    • - -
    • glyphicon-question-sign
    • -
    • glyphicon-info-sign
    • -
    • glyphicon-screenshot
    • -
    • glyphicon-remove-circle
    • -
    • glyphicon-ok-circle
    • -
    • glyphicon-ban-circle
    • -
    • glyphicon-arrow-left
    • -
    • glyphicon-arrow-right
    • -
    • glyphicon-arrow-up
    • -
    • glyphicon-arrow-down
    • -
    • glyphicon-share-alt
    • -
    • glyphicon-resize-full
    • -
    • glyphicon-resize-small
    • -
    • glyphicon-plus
    • -
    • glyphicon-minus
    • -
    • glyphicon-asterisk
    • -
    • glyphicon-exclamation-sign
    • -
    • glyphicon-gift
    • -
    • glyphicon-leaf
    • -
    • glyphicon-fire
    • -
    • glyphicon-eye-open
    • -
    • glyphicon-eye-close
    • -
    • glyphicon-warning-sign
    • -
    • glyphicon-plane
    • -
    • glyphicon-calendar
    • -
    • glyphicon-random
    • -
    • glyphicon-comment
    • -
    • glyphicon-magnet
    • - -
    • glyphicon-chevron-up
    • -
    • glyphicon-chevron-down
    • -
    • glyphicon-retweet
    • -
    • glyphicon-shopping-cart
    • -
    • glyphicon-folder-close
    • -
    • glyphicon-folder-open
    • -
    • glyphicon-resize-vertical
    • -
    • glyphicon-resize-horizontal
    • -
    • glyphicon-hdd
    • -
    • glyphicon-bullhorn
    • -
    • glyphicon-bell
    • -
    • glyphicon-certificate
    • -
    • glyphicon-thumbs-up
    • -
    • glyphicon-thumbs-down
    • -
    • glyphicon-hand-right
    • -
    • glyphicon-hand-left
    • -
    • glyphicon-hand-up
    • -
    • glyphicon-hand-down
    • -
    • glyphicon-circle-arrow-right
    • -
    • glyphicon-circle-arrow-left
    • -
    • glyphicon-circle-arrow-up
    • -
    • glyphicon-circle-arrow-down
    • -
    • glyphicon-globe
    • -
    • glyphicon-wrench
    • -
    • glyphicon-tasks
    • -
    • glyphicon-filter
    • -
    • glyphicon-briefcase
    • -
    • glyphicon-fullscreen
    • - -
    • glyphicon-dashboard
    • -
    • glyphicon-paperclip
    • -
    • glyphicon-heart-empty
    • -
    • glyphicon-link
    • -
    • glyphicon-phone
    • -
    • glyphicon-pushpin
    • -
    • glyphicon-euro
    • -
    • glyphicon-usd
    • -
    • glyphicon-gbp
    • -
    • glyphicon-sort
    • -
    • glyphicon-sort-by-alphabet
    • -
    • glyphicon-sort-by-alphabet-alt
    • -
    • glyphicon-sort-by-order
    • -
    • glyphicon-sort-by-order-alt
    • -
    • glyphicon-sort-by-attributes
    • -
    • glyphicon-sort-by-attributes-alt
    • -
    • glyphicon-unchecked
    • -
    • glyphicon-expand
    • -
    • glyphicon-collapse
    • -
    • glyphicon-collapse-top
    • - -
    - -

    Glyphicons attribution

    -

    Glyphicons Halflings are normally not available for free, but an arrangement between Bootstrap and the Glyphicons creator have made this possible at no cost to you as developers. As a thank you, we ask you to include an optional link back to Glyphicons whenever practical.

    - - -

    How to use

    -

    Add the appropriate class to any inline element. All icon classes are prefixed with glyphicon- for easy styling. To use, place the following code just about anywhere:

    -
    -<i class="glyphicon-search"></i>
    -
    -

    Want to change the icon color? Just change the color of the parent element.

    -

    When using beside strings of text, as in buttons or nav links, be sure to leave a space after the icon for proper spacing.

    - - -

    Icon examples

    -

    Use them in buttons, button groups for a toolbar, navigation, or prepended form inputs.

    - -

    Buttons

    - -
    Button group in a button toolbar
    -
    -
    -
    - - - - -
    -
    -
    {{! /bs-docs-example }} -
    -<div class="btn-toolbar">
    -  <div class="btn-group">
    -
    -    <a class="btn" href="#"><i class="glyphicon-align-left"></i></a>
    -    <a class="btn" href="#"><i class="glyphicon-align-center"></i></a>
    -    <a class="btn" href="#"><i class="glyphicon-align-right"></i></a>
    -    <a class="btn" href="#"><i class="glyphicon-align-justify"></i></a>
    -  </div>
    -</div>
    -
    - -
    Dropdown in a button group
    -
    - -
    {{! /bs-docs-example }} -
    -<div class="btn-group">
    -  <a class="btn btn-primary" href="#"><i class="glyphicon-user icon-white"></i> User</a>
    -  <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
    -  <ul class="dropdown-menu">
    -    <li><a href="#"><i class="glyphicon-pencil"></i> Edit</a></li>
    -    <li><a href="#"><i class="glyphicon-trash"></i> Delete</a></li>
    -    <li><a href="#"><i class="glyphicon-ban-circle"></i> Ban</a></li>
    -    <li class="divider"></li>
    -    <li><a href="#"><i class="i"></i> Make admin</a></li>
    -  </ul>
    -</div>
    -
    - -
    Large button
    -
    - Star -
    {{! /bs-docs-example }} -
    -<a class="btn btn-large" href="#"><i class="glyphicon-star"></i> Star</a>
    -
    - -
    Small button
    -
    - -
    {{! /bs-docs-example }} -
    -<a class="btn btn-small" href="#"><i class="glyphicon-star"></i></a>
    -
    - - -

    Navigation

    - {{! /bs-docs-example }} -
    -<ul class="nav nav-list">
    -  <li class="active"><a href="#"><i class="glyphicon-home icon-white"></i> Home</a></li>
    -  <li><a href="#"><i class="glyphicon-book"></i> Library</a></li>
    -  <li><a href="#"><i class="glyphicon-pencil"></i> Applications</a></li>
    -  <li><a href="#"><i class="i"></i> Misc</a></li>
    -</ul>
    -
    - -

    Form fields

    -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    -<div class="control-group">
    -  <label class="control-label" for="inputIcon">Email address</label>
    -  <div class="controls">
    -    <div class="input-group">
    -      <span class="input-group-addon"><i class="glyphicon-envelope"></i></span>
    -      <input class="span2" id="inputIcon" type="text">
    -    </div>
    -  </div>
    -</div>
    -
    - -
    - - - - -
    - -

    For faster mobile-friendly development, use these utility classes for showing and hiding content by device via media query.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ClassPhones 767px and belowTablets 979px to 768pxDesktops Default
    .visible-phoneVisible
    .visible-tabletVisible
    .visible-desktopVisible
    .hidden-phoneVisibleVisible
    .hidden-tabletVisibleVisible
    .hidden-desktopVisibleVisible
    - -

    When to use

    -

    Use on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation. Responsive utilities should not be used with tables, and as such are not supported.

    - -

    Responsive utilities test case

    -

    Resize your browser or load on different devices to test the above classes.

    -

    Visible on...

    -

    Green checkmarks indicate that class is visible in your current viewport.

    -
      -
    • Phone✔ Phone
    • -
    • Tablet✔ Tablet
    • -
    • Desktop✔ Desktop
    • -
    -

    Hidden on...

    -

    Here, green checkmarks indicate that class is hidden in your current viewport.

    -
      -
    • Phone✔ Phone
    • -
    • Tablet✔ Tablet
    • -
    • Desktop✔ Desktop
    • -
    - -
    - - - -
    {{! /span9 }} -
    {{! row}} - -
    {{! /.container }} diff --git a/docs/templates/pages/customize.mustache b/docs/templates/pages/customize.mustache deleted file mode 100644 index 93c393f83c..0000000000 --- a/docs/templates/pages/customize.mustache +++ /dev/null @@ -1,370 +0,0 @@ - -
    -
    -

    Customize and download

    -

    Download Bootstrap or customize variables, components, JavaScript plugins, and more.

    -
    -
    - - -
    - - -
    - -
    - - - -
    -
    - -
    -
    -

    Scaffolding

    - - - - -

    Base CSS

    - - - - - - - -
    -
    -

    Components

    - - - - - - - - - - - -

    JS Components

    - - - - - - -
    -
    -

    Miscellaneous

    - - - - -

    Responsive

    - - - - - -
    -
    -
    - -
    - -
    -
    - - - - - - - -
    -
    - - - - - - -
    -
    -

    Heads up!

    -

    All checked plugins will be compiled into a single file, bootstrap.js. All plugins require the latest version of jQuery to be included.

    -
    -
    -
    - - -
    - -
    -
    -

    Scaffolding

    - - - - - -

    Links

    - - - - - -

    Grid system

    - - - - - - - - - - - - - - - -
    -
    - -

    Typography

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Tables

    - - - - - - - - - -

    Forms

    - - - - - - - - - - - - - - - - - -
    -
    - -

    Form states & alerts

    - - - - - - - - - - - - - - - - - -

    Navbar

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Dropdowns

    - - - - - - - - - - -
    -
    -
    - -
    - -
    - Customize and Download -

    What's included?

    -

    Downloads include compiled CSS, compiled and minified CSS, and compiled jQuery plugins, all nicely packed up into a zipball for your convenience.

    -
    -
    -
    - - - -
    {{! /span9 }} -
    {{! row}} - -
    {{! /.container }} diff --git a/docs/templates/pages/gallery.mustache b/docs/templates/pages/gallery.mustache deleted file mode 100644 index a3ba5d3de8..0000000000 --- a/docs/templates/pages/gallery.mustache +++ /dev/null @@ -1,119 +0,0 @@ - -
    -
    -

    Gallery

    -

    Showcase of sites using Bootstrap.

    -
    -
    - - -
    - - - -
    {{! /.container }} diff --git a/docs/templates/pages/getting-started.mustache b/docs/templates/pages/getting-started.mustache deleted file mode 100644 index fb23b76056..0000000000 --- a/docs/templates/pages/getting-started.mustache +++ /dev/null @@ -1,244 +0,0 @@ - -
    -
    -

    Getting started

    -

    Overview of the project, its contents, and how to get started with a simple template.

    -
    -
    - - -
    - - -
    - -
    - - - - -
    - -

    Before downloading, be sure to have a code editor (we recommend Sublime Text 2) and some working knowledge of HTML and CSS. We won't walk through the source files here, but they are available for download. We'll focus on getting started with the compiled Bootstrap files.

    - -
    -
    -

    Download compiled

    -

    Fastest way to get started: get the compiled and minified versions of our CSS, JS, and images. No docs or original source files.

    -

    Download Bootstrap

    -
    -
    -

    Download source

    -

    Get the original files for all CSS and JavaScript, along with a local copy of the docs by downloading the latest version directly from GitHub.

    -

    Download Bootstrap source

    -
    -
    -
    - - - - -
    - -

    Within the download you'll find the following file structure and contents, logically grouping common assets and providing both compiled and minified variations.

    -

    Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this:

    -
    -  bootstrap/
    -  ├── css/
    -  │   ├── bootstrap.css
    -  │   ├── bootstrap.min.css
    -  ├── js/
    -  │   ├── bootstrap.js
    -  │   ├── bootstrap.min.js
    -  └── fonts/
    -      ├── glyphiconshalflings-regular.eot
    -      ├── glyphiconshalflings-regular.otf
    -      ├── glyphiconshalflings-regular.svg
    -      ├── glyphiconshalflings-regular.ttf
    -      └── glyphiconshalflings-regular.woff
    -
    -

    This is the most basic form of Bootstrap: compiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (bootstrap.*), as well as compiled and minified CSS and JS (bootstrap.min.*). The image files are compressed using ImageOptim, a Mac app for compressing PNGs.

    -

    Please note that all JavaScript plugins require jQuery to be included.

    -
    - - - - -
    - -

    Bootstrap comes equipped with HTML, CSS, and JS for all sorts of things, but they can be summarized with a handful of categories visible at the top of the Bootstrap documentation.

    - -

    Docs sections

    -

    In addition to the getting started documentation you're reading now, the Bootstrap docs are broken into a few key pages.

    - -

    Core CSS

    -

    Global styles for the body, Normalize, links, grid system, tables, forms, buttons, icons, and more.

    -

    Components

    -

    Basic styles for common interface components like tabs and pills, navbar, alerts, page headers, and more. Head here to see what kind of custom components Bootstrap has to offer beyond basic HTML elements.

    -

    JavaScript plugins

    -

    Similar to Components, these JavaScript plugins are interactive components for things like tooltips, popovers, modals, and more.

    -
    - - - - -
    - -

    With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the File structure.

    -

    Now, here's a look at a typical HTML file:

    -
    -<!DOCTYPE html>
    -<html>
    -  <head>
    -    <title>Bootstrap 101 Template</title>
    -    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    -  </head>
    -  <body>
    -    <h1>Hello, world!</h1>
    -    <script src="http://code.jquery.com/jquery.js"></script>
    -  </body>
    -</html>
    -
    -

    To make this a Bootstrapped template, just include the appropriate CSS and JS files:

    -
    -<!DOCTYPE html>
    -<html>
    -  <head>
    -    <title>Bootstrap 101 Template</title>
    -    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    -    <!-- Bootstrap -->
    -    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    -  </head>
    -  <body>
    -    <h1>Hello, world!</h1>
    -    <script src="http://code.jquery.com/jquery.js"></script>
    -    <script src="js/bootstrap.min.js"></script>
    -  </body>
    -</html>
    -
    -

    And you're set! With those two files added, you can begin to develop any site or application with Bootstrap.

    - -
    - -

    Responsive features in IE8

    -

    Internet Explorer 8 lacks support for media queries, the method by which we deliver responsive CSS to folks. To enable that, you need to include a third party tool (which we include in the project repository) called Respond.js.

    -
    -<!--[if lt IE 9]>
    -  <script src="assets/js/respond/respond.js"></script>
    -<![endif]-->
    -
    -
    - - - - -
    - -

    Move beyond the base template with a few example layouts. We encourage folks to iterate on these examples and not simply use them as an end result.

    -
    -
    - - - -

    Starter template

    -

    A barebones HTML document with all the Bootstrap CSS and JavaScript included.

    -
    -
    - - - -

    Basic marketing site

    -

    Featuring a hero unit for a primary message and three supporting elements.

    -
    -
    - - - -

    Narrow marketing

    -

    Slim, lightweight marketing template for small projects or teams.

    -
    -
    - - - -

    {{_i}}Justified nav{{/i}}

    -

    {{_i}}Marketing page with equal-width navigation links in a modified navbar.{{/i}}

    -
    -
    - - - -

    Sign in

    -

    Barebones sign in form with custom, larger form controls and a flexible layout.

    -
    -
    - - - -

    Sticky footer

    -

    Pin a fixed-height footer to the bottom of the user's viewport.

    -
    -
    - - - -

    Sticky footer w/ navbar

    -

    Add a fixed navbar to the default sticky footer template.

    -
    -
    - - - -

    Carousel jumbotron

    -

    An interactive riff on the basic marketing site featuring a prominent carousel.

    -
    -
    -
    - - - - - -
    - -

    Head to the docs for information, examples, and code snippets, or take the next leap and customize Bootstrap for any upcoming project.

    - Visit the Bootstrap docs - Customize Bootstrap -
    - - - - -
    {{! /span9 }} -
    {{! row}} - -
    {{! /.container }} diff --git a/docs/templates/pages/index.mustache b/docs/templates/pages/index.mustache deleted file mode 100644 index 95f3a73dca..0000000000 --- a/docs/templates/pages/index.mustache +++ /dev/null @@ -1,72 +0,0 @@ -
    -
    -

    Bootstrap

    -

    Sleek, intuitive, and powerful mobile-first front-end framework for faster and easier web development.

    -

    - Download Bootstrap -

    - -
    -
    - -
    - -
    - -

    Introducing Bootstrap.

    - - -
    -
    - -

    By nerds, for nerds.

    -

    Built at Twitter by @mdo and @fat, Bootstrap utilizes LESS CSS, is compiled via Node, and is managed through GitHub to help nerds do awesome stuff on the web.

    -
    -
    - -

    Made for everyone.

    -

    Bootstrap 3 has been rebuilt from the ground up to push the Web forward. It looks and behaves great on the latest smartphones, tablets, and desktops (including support for IE8+).

    -
    -
    - -

    Packed with features.

    -

    A 12-column responsive grid, dozens of components, JavaScript plugins, typography, form controls, and even a web-based Customizer to make Bootstrap your own.

    -
    -
    - -

    Built with Bootstrap.

    - -
    -
    - - - -
    -
    - - SoundReady.fm - -
    -
    - - Kippt - -
    -
    - - Gather Content - -
    -
    - -
    {{! /.marketing }} - -
    {{! /.container }} diff --git a/docs/templates/pages/javascript.mustache b/docs/templates/pages/javascript.mustache deleted file mode 100644 index 7dd97087be..0000000000 --- a/docs/templates/pages/javascript.mustache +++ /dev/null @@ -1,1694 +0,0 @@ - -
    -
    -

    JavaScript

    -

    Bring Bootstrap's components to life—now with 13 custom jQuery plugins. -

    -
    - -
    - - -
    - -
    - - - -
    - - -

    Individual or compiled

    -

    Plugins can be included individually (though some have required dependencies), or all at once. Both bootstrap.js and bootstrap.min.js contain all plugins in a single file.

    - -

    Data attributes

    -

    You can use all Bootstrap plugins purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API and should be your first consideration when using a plugin.

    - -

    That said, in some situations it may be desirable to turn this functionality off. Therefore, we also provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this: -

    $('body').off('.data-api')
    - -

    Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this:

    -
    $('body').off('.alert.data-api')
    - -

    Programmatic API

    -

    We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API. All public APIs are single, chainable methods, and return the collection acted upon.

    -
    $(".btn.danger").button("toggle").addClass("fat")
    -

    All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior):

    -
    -$("#myModal").modal()                       // initialized with defaults
    -$("#myModal").modal({ keyboard: false })   // initialized with no keyboard
    -$("#myModal").modal('show')                // initializes and invokes show immediately

    -
    -

    Each plugin also exposes its raw constructor on a `Constructor` property: $.fn.popover.Constructor. If you'd like to get a particular plugin instance, retrieve it directly from an element: $('[rel=popover]').data('popover').

    - -

    No conflict

    -

    Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call .noConflict on the plugin you wish to revert the value of.

    - -
    -var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value
    -$.fn.bootstrapBtn = bootstrapButton            // give $().bootstrapBtn the bootstrap functionality
    -
    - -

    Events

    -

    Bootstrap provides custom events for most plugin's unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. show) is triggered at the start of an event, and its past participle form (ex. shown) is trigger on the completion of an action.

    -

    All infinitive events provide preventDefault functionality. This provides the ability to stop the execution of an action before it starts.

    -
    -$('#myModal').on('show', function (e) {
    -    if (!data) return e.preventDefault() // stops modal from being shown
    -})
    -
    -
    - - - - -
    - -

    About transitions

    -

    For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.

    -

    Use cases

    -

    A few examples of the transition plugin:

    -
      -
    • Sliding or fading in modals
    • -
    • Fading out tabs
    • -
    • Fading out alerts
    • -
    • Sliding carousel panes
    • -
    - - {{! Ideas: include docs for .fade.in, .slide.in, etc }} -
    - - - - -
    - - - -

    Examples

    -

    Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

    - -

    Static example

    -

    A rendered modal with header, body, and set of actions in the footer.

    -
    - - - -
    {{! /example }} -
    -<div class="modal fade">
    -  <div class="modal-dialog">
    -    <div class="modal-content">
    -
    -      <div class="modal-header">
    -        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    -        <h4 class="modal-title">Modal title</h4>
    -      </div>
    -      <div class="modal-body">
    -        <p>One fine body…</p>
    -      </div>
    -      <div class="modal-footer">
    -        <a href="#" class="btn">Close</a>
    -        <a href="#" class="btn btn-primary">Save changes</a>
    -      </div>
    -
    -    </div>
    -  </div>
    -</div>
    -
    - -

    Live demo

    -

    Toggle a modal via JavaScript by clicking the button below. It will slide down and fade in from the top of the page.

    - - - - {{! /example }} -
    -<!-- Button to trigger modal -->
    -<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
    -
    -<!-- Modal -->
    -<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    -  <div class="modal-dialog">
    -    <div class="modal-content">
    -
    -      <div class="modal-header">
    -        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    -        <h4 class="modal-title">Modal title</h4>
    -      </div>
    -      <div class="modal-body">
    -        ...
    -      </div>
    -      <div class="modal-footer">
    -        <a href="#" class="btn">Close</a>
    -        <a href="#" class="btn btn-primary">Save changes</a>
    -      </div>
    -
    -    </div>
    -  </div>
    -</div>
    -
    - - -

    Usage

    - -

    Via data attributes

    -

    Activate a modal without writing JavaScript. Set data-toggle="modal" on a controller element, like a button, along with a data-target="#foo" or href="#foo" to target a specific modal to toggle.

    -
    <button type="button" data-toggle="modal" data-target="#myModal">Launch modal</button>
    - -

    Via JavaScript

    -

    Call a modal with id myModal with a single line of JavaScript:

    -
    $('#myModal').modal(options)
    - -

    Options

    -

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-backdrop="".

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    backdropbooleantrueIncludes a modal-backdrop element. Alternatively, specify static for a backdrop which doesn't close the modal on click.
    keyboardbooleantrueCloses the modal when escape key is pressed
    showbooleantrueShows the modal when initialized.
    remotepathfalse

    If a remote url is provided, content will be loaded via jQuery's load method and injected into the .modal-body. If you're using the data api, you may alternatively use the href tag to specify the remote source. An example of this is shown below:

    -
    <a data-toggle="modal" href="remote.html" data-target="#modal">click me</a>
    - -

    Methods

    -

    .modal(options)

    -

    Activates your content as a modal. Accepts an optional options object.

    -
    -$('#myModal').modal({
    -  keyboard: false
    -})
    -
    -

    .modal('toggle')

    -

    Manually toggles a modal.

    -
    $('#myModal').modal('toggle')
    -

    .modal('show')

    -

    Manually opens a modal.

    -
    $('#myModal').modal('show')
    -

    .modal('hide')

    -

    Manually hides a modal.

    -
    $('#myModal').modal('hide')
    -

    Events

    -

    Bootstrap's modal class exposes a few events for hooking into modal functionality.

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when the modal has been made visible to the user (will wait for css transitions to complete).
    hideThis event is fired immediately when the hide instance method has been called.
    hiddenThis event is fired when the modal has finished being hidden from the user (will wait for css transitions to complete).
    -
    -$('#myModal').on('hidden', function () {
    -  // do something…
    -})
    -
    -
    - - - - - - - - - -
    - - - -

    Example in navbar

    -

    The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.

    -
    - -
    -

    @fat

    -

    Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

    -

    @mdo

    -

    Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard. Freegan beard aliqua cupidatat mcsweeney's vero. Cupidatat four loko nisi, ea helvetica nulla carles. Tattooed cosby sweater food truck, mcsweeney's quis non freegan vinyl. Lo-fi wes anderson +1 sartorial. Carles non aesthetic exercitation quis gentrify. Brooklyn adipisicing craft beer vice keytar deserunt.

    -

    one

    -

    Occaecat commodo aliqua delectus. Fap craft beer deserunt skateboard ea. Lomo bicycle rights adipisicing banh mi, velit ea sunt next level locavore single-origin coffee in magna veniam. High life id vinyl, echo park consequat quis aliquip banh mi pitchfork. Vero VHS est adipisicing. Consectetur nisi DIY minim messenger bag. Cred ex in, sustainable delectus consectetur fanny pack iphone.

    -

    two

    -

    In incididunt echo park, officia deserunt mcsweeney's proident master cleanse thundercats sapiente veniam. Excepteur VHS elit, proident shoreditch +1 biodiesel laborum craft beer. Single-origin coffee wayfarers irure four loko, cupidatat terry richardson master cleanse. Assumenda you probably haven't heard of them art party fanny pack, tattooed nulla cardigan tempor ad. Proident wolf nesciunt sartorial keffiyeh eu banh mi sustainable. Elit wolf voluptate, lo-fi ea portland before they sold out four loko. Locavore enim nostrud mlkshk brooklyn nesciunt.

    -

    three

    -

    Ad leggings keytar, brunch id art party dolor labore. Pitchfork yr enim lo-fi before they sold out qui. Tumblr farm-to-table bicycle rights whatever. Anim keffiyeh carles cardigan. Velit seitan mcsweeney's photo booth 3 wolf moon irure. Cosby sweater lomo jean shorts, williamsburg hoodie minim qui you probably haven't heard of them et cardigan trust fund culpa biodiesel wes anderson aesthetic. Nihil tattooed accusamus, cred irony biodiesel keffiyeh artisan ullamco consequat.

    -

    Keytar twee blog, culpa messenger bag marfa whatever delectus food truck. Sapiente synth id assumenda. Locavore sed helvetica cliche irony, thundercats you probably haven't heard of them consequat hoodie gluten-free lo-fi fap aliquip. Labore elit placeat before they sold out, terry richardson proident brunch nesciunt quis cosby sweater pariatur keffiyeh ut helvetica artisan. Cardigan craft beer seitan readymade velit. VHS chambray laboris tempor veniam. Anim mollit minim commodo ullamco thundercats. -

    -
    -
    {{! /example }} - - -
    - - -

    Usage

    - -

    Via data attributes

    -

    To easily add scrollspy behavior to your topbar navigation, just add data-spy="scroll" to the element you want to spy on (most typically this would be the body) and data-target=".navbar" to select which nav to use. You'll want to use scrollspy with a .nav component.

    -
    <body data-spy="scroll" data-target=".navbar">...</body>
    - -

    Via JavaScript

    -

    Call the scrollspy via JavaScript:

    -
    $('#navbar').scrollspy()
    - -
    - Heads up! - Navbar links must have resolvable id targets. For example, a <a href="#home">home</a> must correspond to something in the dom like <div id="home"></div>. -
    - -

    Methods

    -

    .scrollspy('refresh')

    -

    When using scrollspy in conjunction with adding or removing of elements from the DOM, you'll need to call the refresh method like so:

    -
    -$('[data-spy="scroll"]').each(function () {
    -  var $spy = $(this).scrollspy('refresh')
    -});
    -
    - -

    Options

    -

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset="".

    - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    offsetnumber10Pixels to offset from top when calculating position of scroll.
    - -

    Events

    - - - - - - - - - - - - - -
    EventDescription
    activateThis event fires whenever a new item becomes activated by the scrollspy.
    -
    - - - - -
    - - - -

    Example tabs

    -

    Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.

    -
    - -
    -
    -

    Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

    -
    -
    -

    Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

    -
    - - -
    -
    {{! /example }} - - -
    - - -

    Usage

    -

    Enable tabbable tabs via JavaScript (each tab needs to be activated individually):

    -
    -$('#myTab a').click(function (e) {
    -  e.preventDefault();
    -  $(this).tab('show');
    -})
    -

    You can activate individual tabs in several ways:

    -
    -$('#myTab a[href="#profile"]').tab('show'); // Select tab by name
    -$('#myTab a:first').tab('show'); // Select first tab
    -$('#myTab a:last').tab('show'); // Select last tab
    -$('#myTab li:eq(2) a').tab('show'); // Select third tab (0-indexed)
    -
    - -

    Markup

    -

    You can activate a tab or pill navigation without writing any JavaScript by simply specifying data-toggle="tab" or data-toggle="pill" on an element. Adding the nav and nav-tabs classes to the tab ul will apply the Bootstrap tab styling.

    -
    -<ul class="nav nav-tabs">
    -  <li><a href="#home" data-toggle="tab">Home</a></li>
    -  <li><a href="#profile" data-toggle="tab">Profile</a></li>
    -  <li><a href="#messages" data-toggle="tab">Messages</a></li>
    -  <li><a href="#settings" data-toggle="tab">Settings</a></li>
    -</ul>
    -

    To make tabs fade in, add .fade to each .tab-pane.

    - -

    Methods

    -

    $().tab

    -

    - Activates a tab element and content container. Tab should have either a data-target or an href targeting a container node in the DOM. -

    -
    -<ul class="nav nav-tabs" id="myTab">
    -  <li class="active"><a href="#home">Home</a></li>
    -  <li><a href="#profile">Profile</a></li>
    -  <li><a href="#messages">Messages</a></li>
    -  <li><a href="#settings">Settings</a></li>
    -</ul>
    -
    -<div class="tab-content">
    -  <div class="tab-pane active" id="home">...</div>
    -  <div class="tab-pane" id="profile">...</div>
    -  <div class="tab-pane" id="messages">...</div>
    -  <div class="tab-pane" id="settings">...</div>
    -</div>
    -
    -<script>
    -  $(function () {
    -    $('#myTab a:last').tab('show');
    -  })
    -</script>
    -
    - -

    Events

    - - - - - - - - - - - - - - - - - -
    EventDescription
    showThis event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    shownThis event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively.
    -
    -$('a[data-toggle="tab"]').on('shown', function (e) {
    -  e.target // activated tab
    -  e.relatedTarget // previous tab
    -})
    -
    -
    - - - -
    - - - -

    Examples

    -

    Inspired by the excellent jQuery.tipsy plugin written by Jason Frame; Tooltips are an updated version, which don't rely on images, use CSS3 for animations, and data-attributes for local title storage.

    -

    Hover over the links below to see tooltips:

    -
    -

    Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral. -

    -
    {{! /example }} - -

    Four directions

    - {{! /example }} - - -

    {{_i}}Tooltips in input groups{{/i}}

    -

    {{_i}}When using tooltips and popovers with the Bootstrap input groups, you'll have to set the container (documented below) option to avoid unwanted side effects.{{/i}}

    - -
    - - -

    Usage

    -

    Trigger the tooltip via JavaScript:

    -
    $('#example').tooltip(options)
    - -

    Options

    -

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    htmlbooleanfalseInsert html into the tooltip. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
    placementstring | function'top'how to position the tooltip - top | bottom | left | right
    selectorstringfalseIf a selector is provided, tooltip objects will be delegated to the specified targets.
    titlestring | function''default title value if `title` tag isn't present
    triggerstring'hover focus'how tooltip is triggered - click | hover | focus | manual. Note you case pass trigger mutliple, space seperated, trigger types.
    delaynumber | object0 -

    delay showing and hiding the tooltip (ms) - does not apply to manual trigger type

    -

    If a number is supplied, delay is applied to both hide/show

    -

    Object structure is: delay: { show: 500, hide: 100 }

    -
    containerstring | falsefalse -

    Appends the tooltip to a specific element container: 'body'

    -
    -
    - Heads up! - Options for individual tooltips can alternatively be specified through the use of data attributes. -
    - -

    Markup

    -
    <a href="#" data-toggle="tooltip" title="first tooltip">hover over me</a>
    - -

    Methods

    -

    $().tooltip(options)

    -

    Attaches a tooltip handler to an element collection.

    -

    .tooltip('show')

    -

    Reveals an element's tooltip.

    -
    $('#element').tooltip('show')
    -

    .tooltip('hide')

    -

    Hides an element's tooltip.

    -
    $('#element').tooltip('hide')
    -

    .tooltip('toggle')

    -

    Toggles an element's tooltip.

    -
    $('#element').tooltip('toggle')
    -

    .tooltip('destroy')

    -

    Hides and destroys an element's tooltip.

    -
    $('#element').tooltip('destroy')
    -
    - - - - -
    - - -

    Examples

    -

    Add small overlays of content, like those on the iPad, to any element for housing secondary information. Hover over the button to trigger the popover. Requires Tooltip to be included.

    - -

    Static popover

    -

    Four options are available: top, right, bottom, and left aligned.

    -
    -
    -
    -

    Popover top

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    -
    -
    - -
    -
    -

    Popover right

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    -
    -
    - -
    -
    -

    Popover bottom

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    -
    -
    - -
    -
    -

    Popover left

    -
    -

    Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

    -
    -
    - -
    -
    -

    No markup shown as popovers are generated from JavaScript and content within a data attribute.

    - -

    Live demo

    - - -

    Four directions

    - {{! /example }} - - -
    - - -

    Usage

    -

    Enable popovers via JavaScript:

    -
    $('#example').popover(options)
    - -

    Options

    -

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    animationbooleantrueapply a css fade transition to the tooltip
    htmlbooleanfalseInsert html into the popover. If false, jquery's text method will be used to insert content into the dom. Use text if you're worried about XSS attacks.
    placementstring | function'right'how to position the popover - top | bottom | left | right
    selectorstringfalseif a selector is provided, tooltip objects will be delegated to the specified targets
    triggerstring'click'how popover is triggered - click | hover | focus | manual
    titlestring | function''default title value if `title` attribute isn't present
    contentstring | function''default content value if `data-content` attribute isn't present
    delaynumber | object0 -

    delay showing and hiding the popover (ms) - does not apply to manual trigger type

    -

    If a number is supplied, delay is applied to both hide/show

    -

    Object structure is: delay: { show: 500, hide: 100 }

    -
    {{_i}}container{{/i}}{{_i}}string | false{{/i}}{{_i}}false{{/i}} -

    {{_i}}Appends the popover to a specific element container: 'body'{{/i}}

    -
    -
    - Heads up! - Options for individual popovers can alternatively be specified through the use of data attributes. -
    - -

    Markup

    -

    For performance reasons, the Tooltip and Popover data-apis are opt in. If you would like to use them just specify a selector option.

    - -

    Methods

    -

    $().popover(options)

    -

    Initializes popovers for an element collection.

    -

    .popover('show')

    -

    Reveals an elements popover.

    -
    $('#element').popover('show')
    -

    .popover('hide')

    -

    Hides an elements popover.

    -
    $('#element').popover('hide')
    -

    .popover('toggle')

    -

    Toggles an elements popover.

    -
    $('#element').popover('toggle')
    -

    .popover('destroy')

    -

    Hides and destroys an element's popover.

    -
    $('#element').popover('destroy')
    -
    - - - - -
    - - - -

    Example alerts

    -

    Add dismiss functionality to all alert messages with this plugin.

    -
    -
    - - Holy guacamole! Best check yo self, you're not looking too good. -
    -
    {{! /example }} - -
    -
    - -

    Oh snap! You got an error!

    -

    Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

    -

    - Take this action Or do this -

    -
    -
    {{! /example }} - - -
    - - -

    Usage

    -

    Enable dismissal of an alert via JavaScript:

    -
    $(".alert").alert()
    - -

    Markup

    -

    Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

    -
    <a class="close" data-dismiss="alert" href="#">&times;</a>
    - -

    Methods

    -

    $().alert()

    -

    Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

    -

    .alert('close')

    -

    Closes an alert.

    -
    $(".alert").alert('close')
    - - -

    Events

    -

    Bootstrap's alert class exposes a few events for hooking into alert functionality.

    - - - - - - - - - - - - - - - - - -
    EventDescription
    closeThis event fires immediately when the close instance method is called.
    closedThis event is fired when the alert has been closed (will wait for css transitions to complete).
    -
    -$('#my-alert').bind('closed', function () {
    -  // do something…
    -})
    -
    -
    - - - - -
    - - -

    Example uses

    -

    Do more with buttons. Control button states or create groups of buttons for more components like toolbars.

    - -

    Stateful

    -

    Add data-loading-text="Loading..." to use a loading state on a button.

    -
    - -
    {{! /example }} -
    <button type="button" class="btn btn-primary" data-loading-text="Loading...">Loading state</button>
    - -

    Single toggle

    -

    Add data-toggle="button" to activate toggling on a single button.

    -
    - -
    {{! /example }} -
    <button type="button" class="btn btn-primary" data-toggle="button">Single Toggle</button>
    - -

    Checkbox

    -

    Add data-toggle="buttons-checkbox" for checkbox style toggling on btn-group.

    -
    -
    - - - -
    -
    {{! /example }} -
    -<div class="btn-group" data-toggle="buttons-checkbox">
    -  <button type="button" class="btn btn-primary">Left</button>
    -  <button type="button" class="btn btn-primary">Middle</button>
    -  <button type="button" class="btn btn-primary">Right</button>
    -</div>
    -
    - -

    Radio

    -

    Add data-toggle="buttons-radio" for radio style toggling on btn-group.

    -
    -
    - - - -
    -
    {{! /example }} -
    -<div class="btn-group" data-toggle="buttons-radio">
    -  <button type="button" class="btn btn-primary">Left</button>
    -  <button type="button" class="btn btn-primary">Middle</button>
    -  <button type="button" class="btn btn-primary">Right</button>
    -</div>
    -
    - - -
    - - -

    Usage

    -

    Enable buttons via JavaScript:

    -
    $('.nav-tabs').button()
    - -

    Markup

    -

    Data attributes are integral to the button plugin. Check out the example code below for the various markup types.

    - -

    Options

    -

    None

    - -

    Methods

    -

    $().button('toggle')

    -

    Toggles push state. Gives the button the appearance that it has been activated.

    -
    - Heads up! - You can enable auto toggling of a button by using the data-toggle attribute. -
    -
    <button type="button" class="btn" data-toggle="button" >…</button>
    -

    $().button('loading')

    -

    Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. -

    -
    <button type="button" class="btn" data-loading-text="loading stuff..." >...</button>
    -
    - Heads up! - Firefox persists the disabled state across page loads. A workaround for this is to use autocomplete="off". -
    -

    $().button('reset')

    -

    Resets button state - swaps text to original text.

    -

    $().button(string)

    -

    Resets button state - swaps text to any data defined text state.

    -
    <button type="button" class="btn" data-complete-text="finished!" >...</button>
    -<script>
    -  $('.btn').button('complete')
    -</script>
    -
    -
    - - - - -
    - - -

    About

    -

    Get base styles and flexible support for collapsible components like accordions and navigation.

    -

    * Requires the Transitions plugin to be included.

    - -

    Example accordion

    -

    Using the collapse plugin, we built a simple accordion style widget:

    - -
    -
    -
    - -
    -
    - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
    -
    -
    -
    - -
    -
    - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
    -
    -
    -
    - -
    -
    - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. -
    -
    -
    -
    -
    {{! /example }} -
    -<div class="accordion" id="accordion2">
    -  <div class="accordion-group">
    -    <div class="accordion-heading">
    -      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
    -        Collapsible Group Item #1
    -      </a>
    -    </div>
    -    <div id="collapseOne" class="accordion-body collapse in">
    -      <div class="accordion-inner">
    -        Anim pariatur cliche...
    -      </div>
    -    </div>
    -  </div>
    -  <div class="accordion-group">
    -    <div class="accordion-heading">
    -      <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
    -        Collapsible Group Item #2
    -      </a>
    -    </div>
    -    <div id="collapseTwo" class="accordion-body collapse">
    -      <div class="accordion-inner">
    -        Anim pariatur cliche...
    -      </div>
    -    </div>
    -  </div>
    -</div>
    -...
    -
    -

    You can also use the plugin without the accordion markup. Make a button toggle the expanding and collapsing of another element.

    -
    -<button type="button" class="btn btn-danger" data-toggle="collapse" data-target="#demo">
    -  simple collapsible
    -</button>
    -
    -<div id="demo" class="collapse in"> … </div>
    -
    - - -
    - - -

    Usage

    - -

    Via data attributes

    -

    Just add data-toggle="collapse" and a data-target to element to automatically assign control of a collapsible element. The data-target attribute accepts a css selector to apply the collapse to. Be sure to add the class collapse to the collapsible element. If you'd like it to default open, add the additional class in.

    -

    To add accordion-like group management to a collapsible control, add the data attribute data-parent="#selector". Refer to the demo to see this in action.

    - -

    Via JavaScript

    -

    Enable manually with:

    -
    $(".collapse").collapse()
    - -

    Options

    -

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-parent="".

    - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    parentselectorfalseIf selector then all collapsible elements under the specified parent will be closed when this collapsible item is shown. (similar to traditional accordion behavior)
    togglebooleantrueToggles the collapsible element on invocation
    - - -

    Methods

    -

    .collapse(options)

    -

    Activates your content as a collapsible element. Accepts an optional options object. -

    -$('#myCollapsible').collapse({
    -  toggle: false
    -})
    -
    -

    .collapse('toggle')

    -

    Toggles a collapsible element to shown or hidden.

    -

    .collapse('show')

    -

    Shows a collapsible element.

    -

    .collapse('hide')

    -

    Hides a collapsible element.

    - -

    Events

    -

    Bootstrap's collapse class exposes a few events for hooking into collapse functionality.

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    EventDescription
    showThis event fires immediately when the show instance method is called.
    shownThis event is fired when a collapse element has been made visible to the user (will wait for css transitions to complete).
    hide - This event is fired immediately when the hide method has been called. -
    hiddenThis event is fired when a collapse element has been hidden from the user (will wait for css transitions to complete).
    -
    -$('#myCollapsible').on('hidden', function () {
    -  // do something…
    -})
    -
    - - - - - - - - - -
    - - - -

    Example

    -

    A basic, easily extended plugin for quickly creating elegant typeaheads with any form text input.

    -
    - -
    {{! /example }} -
    <input type="text" data-provide="typeahead">
    -

    You'll want to set autocomplete="off" to prevent default browser menus from appearing over the Bootstrap typeahead dropdown.

    - -
    - - -

    Usage

    - -

    Via data attributes

    -

    Add data attributes to register an element with typeahead functionality as shown in the example above.

    - -

    Via JavaScript

    -

    Call the typeahead manually with:

    -
    $('.typeahead').typeahead()
    - -

    Options

    -

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-source="".

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    sourcearray, function[ ]The data source to query against. May be an array of strings or a function. The function is passed two arguments, the query value in the input field and the process callback. The function may be used synchronously by returning the data source directly or asynchronously via the process callback's single argument.
    itemsnumber8The max number of items to display in the dropdown.
    minLengthnumber1The minimum character length needed before triggering autocomplete suggestions
    matcherfunctioncase insensitiveThe method used to determine if a query matches an item. Accepts a single argument, the item against which to test the query. Access the current query with this.query. Return a boolean true if query is a match.
    sorterfunctionexact match,
    case sensitive,
    case insensitive
    Method used to sort autocomplete results. Accepts a single argument items and has the scope of the typeahead instance. Reference the current query with this.query.
    updaterfunctionreturns selected itemThe method used to return selected item. Accepts a single argument, the item and has the scope of the typeahead instance.
    highlighterfunctionhighlights all default matchesMethod used to highlight autocomplete results. Accepts a single argument item and has the scope of the typeahead instance. Should return html.
    - -

    Methods

    -

    .typeahead(options)

    -

    Initializes an input with a typeahead.

    -
    - - - - -
    - - -

    Example

    -

    The subnavigation on the left is a live demo of the affix plugin.

    - -
    - -

    Usage

    - -

    Via data attributes

    -

    To easily add affix behavior to any element, just add data-spy="affix" to the element you want to spy on. Then use offsets to define when to toggle the pinning of an element on and off.

    - -
    <div data-spy="affix" data-offset-top="200">...</div>
    - -
    - Heads up! - You must manage the position of a pinned element and the behavior of its immediate parent. Position is controlled by affix, affix-top, and affix-bottom. Remember to check for a potentially collapsed parent when the affix kicks in as it's removing content from the normal flow of the page. -
    - -

    Via JavaScript

    -

    Call the affix plugin via JavaScript:

    -
    $('#navbar').affix()
    - -

    Methods

    -

    .affix('refresh')

    -

    When using affix in conjunction with adding or removing of elements from the DOM, you'll want to call the refresh method:

    -
    -$('[data-spy="affix"]').each(function () {
    -  $(this).affix('refresh')
    -});
    -
    -

    Options

    -

    Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-offset-top="200".

    - - - - - - - - - - - - - - - - - - -
    Nametypedefaultdescription
    offsetnumber | function | object10Pixels to offset from screen when calculating position of scroll. If a single number is provided, the offset will be applied in both top and left directions. To listen for a single direction, or multiple unique offsets, just provide an object offset: { x: 10 }. Use a function when you need to dynamically provide an offset (useful for some responsive designs).
    -
    - - - -
    {{! /span9 }} -
    {{! row}} - -
    {{! /.container }} diff --git a/less/variables.less b/less/variables.less index 627b1a86e0..9eb84ddaaa 100644 --- a/less/variables.less +++ b/less/variables.less @@ -207,7 +207,7 @@ @navbar-inverse-link-color-hover: #fff; @navbar-inverse-link-color-active: @navbar-inverse-link-color-hover; @navbar-inverse-link-bg-hover: transparent; -@navbar-inverse-link-bg-active: @navbar-inverse-bg; +@navbar-inverse-link-bg-active: darken(@navbar-inverse-bg, 10%); // Inverted navbar search // Normal navbar needs no special styles or vars diff --git a/package.json b/package.json index 2941c29636..84fc2166ee 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,5 @@ , "jshint": "0.9.1" , "recess": "1.1.6" , "connect": "2.1.3" - , "hogan.js": "2.0.0" } }