├── LICENSE.txt ├── Markdown.Converter.js ├── Markdown.Editor.Icons.fw.png ├── Markdown.Editor.Icons.png ├── Markdown.Editor.js ├── Markdown.Editor.less ├── Markdown.Sanitizer.js ├── README.md └── demo ├── browser ├── bootstrap │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── docs │ │ ├── assets │ │ │ ├── bootstrap.zip │ │ │ ├── css │ │ │ │ ├── bootstrap-responsive.css │ │ │ │ ├── bootstrap.css │ │ │ │ └── docs.css │ │ │ ├── ico │ │ │ │ ├── bootstrap-apple-114x114.png │ │ │ │ ├── bootstrap-apple-57x57.png │ │ │ │ ├── bootstrap-apple-72x72.png │ │ │ │ └── favicon.ico │ │ │ ├── img │ │ │ │ ├── bird.png │ │ │ │ ├── bootstrap-mdo-sfmoma-01.jpg │ │ │ │ ├── bootstrap-mdo-sfmoma-02.jpg │ │ │ │ ├── bootstrap-mdo-sfmoma-03.jpg │ │ │ │ ├── browsers.png │ │ │ │ ├── example-diagram-01.png │ │ │ │ ├── example-diagram-02.png │ │ │ │ ├── example-diagram-03.png │ │ │ │ ├── example-sites │ │ │ │ │ ├── bartop.png │ │ │ │ │ ├── fleetio.png │ │ │ │ │ ├── jshint.png │ │ │ │ │ ├── kippt.png │ │ │ │ │ ├── railwayjs.png │ │ │ │ │ └── totalwireframe.png │ │ │ │ ├── examples │ │ │ │ │ ├── bootstrap-example-fluid.jpg │ │ │ │ │ ├── bootstrap-example-hero.jpg │ │ │ │ │ └── bootstrap-example-starter.jpg │ │ │ │ ├── github-16px.png │ │ │ │ ├── glyphicons-halflings-white.png │ │ │ │ ├── glyphicons-halflings.png │ │ │ │ ├── glyphicons │ │ │ │ │ ├── glyphicons_009_magic.png │ │ │ │ │ ├── glyphicons_042_group.png │ │ │ │ │ ├── glyphicons_079_podium.png │ │ │ │ │ ├── glyphicons_082_roundabout.png │ │ │ │ │ ├── glyphicons_155_show_thumbnails.png │ │ │ │ │ ├── glyphicons_163_iphone.png │ │ │ │ │ ├── glyphicons_214_resize_small.png │ │ │ │ │ └── glyphicons_266_book_open.png │ │ │ │ ├── grid-18px-masked.png │ │ │ │ ├── icon-css3.png │ │ │ │ ├── icon-github.png │ │ │ │ ├── icon-html5.png │ │ │ │ ├── icon-twitter.png │ │ │ │ ├── less-logo-large.png │ │ │ │ ├── less-small.png │ │ │ │ └── responsive-illustrations.png │ │ │ └── js │ │ │ │ ├── README.md │ │ │ │ ├── application.js │ │ │ │ ├── bootstrap-alert.js │ │ │ │ ├── bootstrap-button.js │ │ │ │ ├── bootstrap-carousel.js │ │ │ │ ├── bootstrap-collapse.js │ │ │ │ ├── bootstrap-dropdown.js │ │ │ │ ├── bootstrap-modal.js │ │ │ │ ├── bootstrap-popover.js │ │ │ │ ├── bootstrap-scrollspy.js │ │ │ │ ├── bootstrap-tab.js │ │ │ │ ├── bootstrap-tooltip.js │ │ │ │ ├── bootstrap-transition.js │ │ │ │ ├── bootstrap-typeahead.js │ │ │ │ ├── google-code-prettify │ │ │ │ ├── prettify.css │ │ │ │ └── prettify.js │ │ │ │ └── jquery.js │ │ ├── base-css.html │ │ ├── build │ │ │ ├── index.js │ │ │ ├── node_modules │ │ │ │ ├── .bin │ │ │ │ │ └── hulk │ │ │ │ └── hogan.js │ │ │ │ │ ├── .git_ignore │ │ │ │ │ ├── .gitmodules │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── README.md │ │ │ │ │ ├── bin │ │ │ │ │ └── hulk │ │ │ │ │ ├── lib │ │ │ │ │ ├── compiler.js │ │ │ │ │ ├── hogan.js │ │ │ │ │ └── template.js │ │ │ │ │ ├── package.json │ │ │ │ │ ├── test │ │ │ │ │ ├── html │ │ │ │ │ │ └── list.html │ │ │ │ │ ├── index.html │ │ │ │ │ ├── index.js │ │ │ │ │ ├── mustache.js │ │ │ │ │ ├── spec.js │ │ │ │ │ ├── spec │ │ │ │ │ │ ├── Changes │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── Rakefile │ │ │ │ │ │ ├── TESTING.md │ │ │ │ │ │ └── specs │ │ │ │ │ │ │ ├── comments.json │ │ │ │ │ │ │ ├── comments.yml │ │ │ │ │ │ │ ├── delimiters.json │ │ │ │ │ │ │ ├── delimiters.yml │ │ │ │ │ │ │ ├── interpolation.json │ │ │ │ │ │ │ ├── interpolation.yml │ │ │ │ │ │ │ ├── inverted.json │ │ │ │ │ │ │ ├── inverted.yml │ │ │ │ │ │ │ ├── partials.json │ │ │ │ │ │ │ ├── partials.yml │ │ │ │ │ │ │ ├── sections.json │ │ │ │ │ │ │ ├── sections.yml │ │ │ │ │ │ │ ├── ~lambdas.json │ │ │ │ │ │ │ └── ~lambdas.yml │ │ │ │ │ └── templates │ │ │ │ │ │ └── list.mustache │ │ │ │ │ ├── tools │ │ │ │ │ ├── release.js │ │ │ │ │ └── web_templates.js │ │ │ │ │ ├── web │ │ │ │ │ ├── 1.0.0 │ │ │ │ │ │ ├── hogan.js │ │ │ │ │ │ └── hogan.min.js │ │ │ │ │ ├── builds │ │ │ │ │ │ ├── 1.0.0 │ │ │ │ │ │ │ ├── hogan.js │ │ │ │ │ │ │ └── hogan.min.js │ │ │ │ │ │ ├── 1.0.3 │ │ │ │ │ │ │ ├── hogan.js │ │ │ │ │ │ │ └── hogan.min.js │ │ │ │ │ │ └── 1.0.5 │ │ │ │ │ │ │ ├── hogan-1.0.5.amd.js │ │ │ │ │ │ │ ├── hogan-1.0.5.common.js │ │ │ │ │ │ │ ├── hogan-1.0.5.js │ │ │ │ │ │ │ ├── hogan-1.0.5.min.amd.js │ │ │ │ │ │ │ ├── hogan-1.0.5.min.common.js │ │ │ │ │ │ │ ├── hogan-1.0.5.min.js │ │ │ │ │ │ │ ├── hogan-1.0.5.min.mustache.js │ │ │ │ │ │ │ ├── hogan-1.0.5.mustache.js │ │ │ │ │ │ │ ├── template-1.0.5.js │ │ │ │ │ │ │ └── template-1.0.5.min.js │ │ │ │ │ ├── favicon.ico │ │ │ │ │ ├── images │ │ │ │ │ │ ├── logo.png │ │ │ │ │ │ ├── noise.png │ │ │ │ │ │ ├── small-hogan-icon.png │ │ │ │ │ │ └── stripes.png │ │ │ │ │ ├── index.html.mustache │ │ │ │ │ └── stylesheets │ │ │ │ │ │ ├── layout.css │ │ │ │ │ │ └── skeleton.css │ │ │ │ │ └── wrappers │ │ │ │ │ ├── amd.js.mustache │ │ │ │ │ ├── common.js.mustache │ │ │ │ │ ├── js.mustache │ │ │ │ │ └── mustache.js.mustache │ │ │ └── package.json │ │ ├── components.html │ │ ├── download.html │ │ ├── examples.html │ │ ├── examples │ │ │ ├── fluid.html │ │ │ ├── hero.html │ │ │ └── starter-template.html │ │ ├── index.html │ │ ├── javascript.html │ │ ├── less.html │ │ ├── scaffolding.html │ │ ├── templates │ │ │ ├── layout.mustache │ │ │ └── pages │ │ │ │ ├── base-css.mustache │ │ │ │ ├── components.mustache │ │ │ │ ├── download.mustache │ │ │ │ ├── examples.mustache │ │ │ │ ├── index.mustache │ │ │ │ ├── javascript.mustache │ │ │ │ ├── less.mustache │ │ │ │ ├── scaffolding.mustache │ │ │ │ └── upgrading.mustache │ │ └── upgrading.html │ ├── img │ │ ├── glyphicons-halflings-white.png │ │ └── glyphicons-halflings.png │ ├── js │ │ ├── README.md │ │ ├── bootstrap-alert.js │ │ ├── bootstrap-button.js │ │ ├── bootstrap-carousel.js │ │ ├── bootstrap-collapse.js │ │ ├── bootstrap-dropdown.js │ │ ├── bootstrap-modal.js │ │ ├── bootstrap-popover.js │ │ ├── bootstrap-scrollspy.js │ │ ├── bootstrap-tab.js │ │ ├── bootstrap-tooltip.js │ │ ├── bootstrap-transition.js │ │ ├── bootstrap-typeahead.js │ │ └── tests │ │ │ ├── index.html │ │ │ ├── unit │ │ │ ├── bootstrap-alert.js │ │ │ ├── bootstrap-button.js │ │ │ ├── bootstrap-collapse.js │ │ │ ├── bootstrap-dropdown.js │ │ │ ├── bootstrap-modal.js │ │ │ ├── bootstrap-popover.js │ │ │ ├── bootstrap-scrollspy.js │ │ │ ├── bootstrap-tab.js │ │ │ ├── bootstrap-tooltip.js │ │ │ ├── bootstrap-transition.js │ │ │ └── bootstrap-typeahead.js │ │ │ └── vendor │ │ │ ├── jquery.js │ │ │ ├── qunit.css │ │ │ └── qunit.js │ └── less │ │ ├── accordion.less │ │ ├── alerts.less │ │ ├── bootstrap.less │ │ ├── breadcrumbs.less │ │ ├── button-groups.less │ │ ├── buttons.less │ │ ├── carousel.less │ │ ├── close.less │ │ ├── code.less │ │ ├── component-animations.less │ │ ├── dropdowns.less │ │ ├── forms.less │ │ ├── grid.less │ │ ├── hero-unit.less │ │ ├── labels.less │ │ ├── layouts.less │ │ ├── mixins.less │ │ ├── modals.less │ │ ├── navbar.less │ │ ├── navs.less │ │ ├── pager.less │ │ ├── pagination.less │ │ ├── popovers.less │ │ ├── progress-bars.less │ │ ├── reset.less │ │ ├── responsive.less │ │ ├── scaffolding.less │ │ ├── sprites.less │ │ ├── tables.less │ │ ├── thumbnails.less │ │ ├── tooltip.less │ │ ├── type.less │ │ ├── utilities.less │ │ ├── variables.less │ │ └── wells.less ├── demo.html ├── demo.less └── less │ └── less-1.2.2.min.js └── node └── demo.js /LICENSE.txt: -------------------------------------------------------------------------------- 1 | A javascript port of Markdown, as used on Stack Overflow 2 | and the rest of Stack Exchange network. 3 | 4 | Largely based on showdown.js by John Fraser (Attacklab). 5 | 6 | Original Markdown Copyright (c) 2004-2005 John Gruber 7 | 8 | 9 | 10 | Original Showdown code copyright (c) 2007 John Fraser 11 | 12 | Modifications and bugfixes (c) 2009 Dana Robinson 13 | Modifications and bugfixes (c) 2009-2011 Stack Exchange Inc. 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy 16 | of this software and associated documentation files (the "Software"), to deal 17 | in the Software without restriction, including without limitation the rights 18 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 19 | copies of the Software, and to permit persons to whom the Software is 20 | furnished to do so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in 23 | all copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 31 | THE SOFTWARE. 32 | 33 | -------------------------------------------------------------------------------- /Markdown.Editor.Icons.fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/Markdown.Editor.Icons.fw.png -------------------------------------------------------------------------------- /Markdown.Editor.Icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/Markdown.Editor.Icons.png -------------------------------------------------------------------------------- /Markdown.Editor.less: -------------------------------------------------------------------------------- 1 | 2 | .wmd-panel { 3 | width: 100%; 4 | } 5 | 6 | .wmd-input { 7 | height: 300px; 8 | width: 100%; 9 | box-sizing: border-box; 10 | -webkit-box-sizing:border-box; 11 | -moz-box-sizing: border-box; 12 | -ms-box-sizing: border-box; 13 | } 14 | 15 | .wmd-preview { 16 | .well; 17 | width: 100%; 18 | box-sizing: border-box; 19 | -webkit-box-sizing:border-box; 20 | -moz-box-sizing: border-box; 21 | -ms-box-sizing: border-box; 22 | } 23 | 24 | .wmd-panel .btn-toolbar { 25 | margin-bottom: 0; 26 | padding: 0; 27 | width: 100%; 28 | } 29 | 30 | .icon-link, 31 | .icon-blockquote, 32 | .icon-code, 33 | .icon-bullet-list, 34 | .icon-list, 35 | .icon-header, 36 | .icon-hr-line, 37 | .icon-undo { 38 | background-image: url(Markdown.Editor.Icons.png); 39 | } 40 | .icon-link { background-position: 0 0; } 41 | .icon-blockquote { background-position: -24px 0; } 42 | .icon-code { background-position: -48px 0; } 43 | .icon-bullet-list { background-position: -72px 0; } 44 | .icon-list { background-position: -96px 0; } 45 | .icon-header { background-position: -120px 0; } 46 | .icon-hr-line { background-position: -144px 0; } 47 | .icon-undo { background-position: -168px 0; } 48 | 49 | 50 | 51 | 52 | 53 | .wmd-prompt-background 54 | { 55 | background-color: Black; 56 | } 57 | 58 | .wmd-prompt-dialog 59 | { 60 | border: 1px solid #999999; 61 | background-color: #F5F5F5; 62 | } 63 | 64 | .wmd-prompt-dialog > div { 65 | font-size: 0.8em; 66 | font-family: arial, helvetica, sans-serif; 67 | } 68 | 69 | 70 | .wmd-prompt-dialog > form > input[type="text"] { 71 | border: 1px solid #999999; 72 | color: black; 73 | } 74 | 75 | .wmd-prompt-dialog > form > input[type="button"]{ 76 | border: 1px solid #888888; 77 | font-family: trebuchet MS, helvetica, sans-serif; 78 | font-size: 0.8em; 79 | font-weight: bold; 80 | } 81 | -------------------------------------------------------------------------------- /Markdown.Sanitizer.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var output, Converter; 3 | if (typeof exports === "object" && typeof require === "function") { // we're in a CommonJS (e.g. Node.js) module 4 | output = exports; 5 | Converter = require("./Markdown.Converter").Converter; 6 | } else { 7 | output = window.Markdown; 8 | Converter = output.Converter; 9 | } 10 | 11 | output.getSanitizingConverter = function () { 12 | var converter = new Converter(); 13 | converter.hooks.chain("postConversion", sanitizeHtml); 14 | converter.hooks.chain("postConversion", balanceTags); 15 | return converter; 16 | } 17 | 18 | function sanitizeHtml(html) { 19 | return html.replace(/<[^>]*>?/gi, sanitizeTag); 20 | } 21 | 22 | // (tags that can be opened/closed) | (tags that stand alone) 23 | var basic_tag_whitelist = /^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol|p|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i; 24 | // | 25 | var a_white = /^(]+")?\s?>|<\/a>)$/i; 26 | 27 | // ]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i; 29 | 30 | //
|
for twitter bootstrap 31 | var pre_white = /^(|<\/pre>)$/i; 32 | 33 | function sanitizeTag(tag) { 34 | if (tag.match(basic_tag_whitelist) || tag.match(a_white) || tag.match(img_white) || tag.match(pre_white)) 35 | return tag; 36 | else 37 | return ""; 38 | } 39 | 40 | /// 41 | /// attempt to balance HTML tags in the html string 42 | /// by removing any unmatched opening or closing tags 43 | /// IMPORTANT: we *assume* HTML has *already* been 44 | /// sanitized and is safe/sane before balancing! 45 | /// 46 | /// adapted from CODESNIPPET: A8591DBA-D1D3-11DE-947C-BA5556D89593 47 | /// 48 | function balanceTags(html) { 49 | 50 | if (html == "") 51 | return ""; 52 | 53 | var re = /<\/?\w+[^>]*(\s|$|>)/g; 54 | // convert everything to lower case; this makes 55 | // our case insensitive comparisons easier 56 | var tags = html.toLowerCase().match(re); 57 | 58 | // no HTML tags present? nothing to do; exit now 59 | var tagcount = (tags || []).length; 60 | if (tagcount == 0) 61 | return html; 62 | 63 | var tagname, tag; 64 | var ignoredtags = "



  • "; 65 | var match; 66 | var tagpaired = []; 67 | var tagremove = []; 68 | var needsRemoval = false; 69 | 70 | // loop through matched tags in forward order 71 | for (var ctag = 0; ctag < tagcount; ctag++) { 72 | tagname = tags[ctag].replace(/<\/?(\w+).*/, "$1"); 73 | // skip any already paired tags 74 | // and skip tags in our ignore list; assume they're self-closed 75 | if (tagpaired[ctag] || ignoredtags.search("<" + tagname + ">") > -1) 76 | continue; 77 | 78 | tag = tags[ctag]; 79 | match = -1; 80 | 81 | if (!/^<\//.test(tag)) { 82 | // this is an opening tag 83 | // search forwards (next tags), look for closing tags 84 | for (var ntag = ctag + 1; ntag < tagcount; ntag++) { 85 | if (!tagpaired[ntag] && tags[ntag] == "") { 86 | match = ntag; 87 | break; 88 | } 89 | } 90 | } 91 | 92 | if (match == -1) 93 | needsRemoval = tagremove[ctag] = true; // mark for removal 94 | else 95 | tagpaired[match] = true; // mark paired 96 | } 97 | 98 | if (!needsRemoval) 99 | return html; 100 | 101 | // delete all orphaned tags from the string 102 | 103 | var ctag = 0; 104 | html = html.replace(re, function (match) { 105 | var res = tagremove[ctag] ? "" : match; 106 | ctag++; 107 | return res; 108 | }); 109 | return html; 110 | } 111 | })(); 112 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PageDown-Bootstrap 2 | ================== 3 | 4 | This is a fork of http://code.google.com/p/pagedown/ changed to use Twitter Bootstrap for styling the editor and modal popups. 5 | 6 | The demo is viewable here: http://samwillis.co.uk/pagedown-bootstrap/demo/browser/demo.html 7 | 8 | New icons based on http://glyphicons.com/, http://dribbble.com/shots/365544-Mini-glyphs-12-px-Free-PSD and the origional icons. 9 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Twitter, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /demo/browser/bootstrap/Makefile: -------------------------------------------------------------------------------- 1 | BOOTSTRAP = ./docs/assets/css/bootstrap.css 2 | BOOTSTRAP_LESS = ./less/bootstrap.less 3 | BOOTSTRAP_RESPONSIVE = ./docs/assets/css/bootstrap-responsive.css 4 | BOOTSTRAP_RESPONSIVE_LESS = ./less/responsive.less 5 | LESS_COMPRESSOR ?= `which lessc` 6 | WATCHR ?= `which watchr` 7 | 8 | # 9 | # BUILD DOCS 10 | # 11 | 12 | docs: bootstrap 13 | rm docs/assets/bootstrap.zip 14 | zip -r docs/assets/bootstrap.zip bootstrap 15 | rm -r bootstrap 16 | lessc ${BOOTSTRAP_LESS} > ${BOOTSTRAP} 17 | lessc ${BOOTSTRAP_RESPONSIVE_LESS} > ${BOOTSTRAP_RESPONSIVE} 18 | node docs/build 19 | cp img/* docs/assets/img/ 20 | cp js/*.js docs/assets/js/ 21 | cp js/tests/vendor/jquery.js docs/assets/js/ 22 | 23 | # 24 | # BUILD SIMPLE BOOTSTRAP DIRECTORY 25 | # lessc & uglifyjs are required 26 | # 27 | 28 | bootstrap: 29 | mkdir -p bootstrap/img 30 | mkdir -p bootstrap/css 31 | mkdir -p bootstrap/js 32 | cp img/* bootstrap/img/ 33 | lessc ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.css 34 | lessc --compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css 35 | lessc ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css 36 | lessc --compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css 37 | 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 > bootstrap/js/bootstrap.js 38 | uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.js 39 | 40 | # 41 | # MAKE FOR GH-PAGES 4 FAT & MDO ONLY (O_O ) 42 | # 43 | 44 | gh-pages: docs 45 | rm -f ../bootstrap-gh-pages/assets/bootstrap.zip 46 | node docs/build production 47 | cp -r docs/* ../bootstrap-gh-pages 48 | 49 | # 50 | # WATCH LESS FILES 51 | # 52 | 53 | watch: 54 | echo "Watching less files..."; \ 55 | watchr -e "watch('less/.*\.less') { system 'make' }" 56 | 57 | 58 | .PHONY: dist docs watch gh-pages 59 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/README.md: -------------------------------------------------------------------------------- 1 | TWITTER BOOTSTRAP 2 | ================= 3 | 4 | Bootstrap is Twitter's toolkit for kickstarting CSS for websites, apps, and more. It includes base CSS styles for typography, forms, buttons, tables, grids, navigation, alerts, and more. 5 | 6 | To get started -- checkout http://twitter.github.com/bootstrap! 7 | 8 | 9 | Versioning 10 | ---------- 11 | 12 | For transparency and insight into our release cycle, and for striving to maintain backward compatibility, Bootstrap will be maintained under the Semantic Versioning guidelines as much as possible. 13 | 14 | Releases will be numbered with the follow format: 15 | 16 | `..` 17 | 18 | And constructed with the following guidelines: 19 | 20 | * Breaking backward compatibility bumps the major 21 | * New additions without breaking backward compatibility bumps the minor 22 | * Bug fixes and misc changes bump the patch 23 | 24 | For more information on SemVer, please visit http://semver.org/. 25 | 26 | 27 | Bug tracker 28 | ----------- 29 | 30 | Have a bug? Please create an issue here on GitHub! 31 | 32 | https://github.com/twitter/bootstrap/issues 33 | 34 | 35 | Twitter account 36 | --------------- 37 | 38 | Keep up to date on announcements and more by following Bootstrap on Twitter, @TwBootstrap. 39 | 40 | 41 | Mailing list 42 | ------------ 43 | 44 | Have a question? Ask on our mailing list! 45 | 46 | twitter-bootstrap@googlegroups.com 47 | 48 | http://groups.google.com/group/twitter-bootstrap 49 | 50 | 51 | IRC 52 | --- 53 | 54 | Server: irc.freenode.net 55 | 56 | Channel: ##twitter-bootstrap (the double ## is not a typo) 57 | 58 | 59 | Developers 60 | ---------- 61 | 62 | We have included a makefile with convenience methods for working with the Bootstrap library. 63 | 64 | + **build** - `make` 65 | Runs the LESS compiler to rebuild the `/less` files and compiles the docs pages. Requires lessc and uglify-js. Read more in our docs » 66 | 67 | + **watch** - `make watch` 68 | This is a convenience method for watching just Less files and automatically building them whenever you save. Requires the Watchr gem. 69 | 70 | 71 | Authors 72 | ------- 73 | 74 | **Mark Otto** 75 | 76 | + http://twitter.com/mdo 77 | + http://github.com/markdotto 78 | 79 | **Jacob Thornton** 80 | 81 | + http://twitter.com/fat 82 | + http://github.com/fat 83 | 84 | 85 | Copyright and license 86 | --------------------- 87 | 88 | Copyright 2012 Twitter, Inc. 89 | 90 | Licensed under the Apache License, Version 2.0 (the "License"); 91 | you may not use this work except in compliance with the License. 92 | You may obtain a copy of the License in the LICENSE file, or at: 93 | 94 | http://www.apache.org/licenses/LICENSE-2.0 95 | 96 | Unless required by applicable law or agreed to in writing, software 97 | distributed under the License is distributed on an "AS IS" BASIS, 98 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 99 | See the License for the specific language governing permissions and 100 | limitations under the License. 101 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/bootstrap.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/bootstrap.zip -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/ico/bootstrap-apple-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/ico/bootstrap-apple-114x114.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/ico/bootstrap-apple-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/ico/bootstrap-apple-57x57.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/ico/bootstrap-apple-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/ico/bootstrap-apple-72x72.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/ico/favicon.ico -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/bird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/bird.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/browsers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/browsers.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/example-diagram-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/example-diagram-01.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/example-diagram-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/example-diagram-02.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/example-diagram-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/example-diagram-03.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/example-sites/bartop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/example-sites/bartop.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/example-sites/fleetio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/example-sites/fleetio.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/example-sites/jshint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/example-sites/jshint.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/example-sites/kippt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/example-sites/kippt.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/example-sites/railwayjs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/example-sites/railwayjs.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/example-sites/totalwireframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/example-sites/totalwireframe.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/examples/bootstrap-example-fluid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/examples/bootstrap-example-fluid.jpg -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/examples/bootstrap-example-hero.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/examples/bootstrap-example-hero.jpg -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/examples/bootstrap-example-starter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/examples/bootstrap-example-starter.jpg -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/github-16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/github-16px.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_009_magic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_009_magic.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_042_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_042_group.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_079_podium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_079_podium.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_082_roundabout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_082_roundabout.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_163_iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_163_iphone.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_214_resize_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_214_resize_small.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_266_book_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/glyphicons/glyphicons_266_book_open.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/grid-18px-masked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/grid-18px-masked.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/icon-css3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/icon-css3.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/icon-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/icon-github.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/icon-html5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/icon-html5.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/icon-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/icon-twitter.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/less-logo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/less-logo-large.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/less-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/less-small.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/img/responsive-illustrations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/assets/img/responsive-illustrations.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/js/README.md: -------------------------------------------------------------------------------- 1 | ## 2.0 BOOTSTRAP JS PHILOSOPHY 2 | These are the high-level design rules which guide the development of Bootstrap's plugin apis. 3 | 4 | --- 5 | 6 | ### DATA-ATTRIBUTE API 7 | 8 | We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript. 9 | 10 | We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this: 11 | 12 | $('body').off('.data-api') 13 | 14 | To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this: 15 | 16 | $('body').off('.alert.data-api') 17 | 18 | --- 19 | 20 | ### PROGRAMATIC API 21 | 22 | We also believe you should be able to use all plugins provided by Bootstrap purely through the JS API. 23 | 24 | All public APIs should be single, chainable methods, and return the collection acted upon. 25 | 26 | $(".btn.danger").button("toggle").addClass("fat") 27 | 28 | All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior: 29 | 30 | $("#myModal").modal() // initialized with defaults 31 | $("#myModal").modal({ keyboard: false }) // initialized with now keyboard 32 | $("#myModal").modal('show') // initializes and invokes show immediately afterqwe2 33 | 34 | --- 35 | 36 | ### OPTIONS 37 | 38 | Options should be sparse and add universal value. We should pick the right defaults. 39 | 40 | All plugins should have a default object which can be modified to effect all instance's default options. The defaults object should be available via `$.fn.plugin.defaults`. 41 | 42 | $.fn.modal.defaults = { … } 43 | 44 | An options definition should take the following form: 45 | 46 | *noun*: *adjective* - describes or modifies a quality of an instance 47 | 48 | examples: 49 | 50 | backdrop: true 51 | keyboard: false 52 | placement: 'top' 53 | 54 | --- 55 | 56 | ### EVENTS 57 | 58 | All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action. 59 | 60 | show | shown 61 | hide | hidden 62 | 63 | --- 64 | 65 | ### CONSTRUCTORS 66 | 67 | Each plugin should expose it's raw constructor on a `Constructor` property -- accessed in the following way: 68 | 69 | 70 | $.fn.popover.Constructor 71 | 72 | --- 73 | 74 | ### DATA ACCESSOR 75 | 76 | Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this: 77 | 78 | $('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor 79 | 80 | --- 81 | 82 | ### DATA ATTRIBUTES 83 | 84 | Data attributes should take the following form: 85 | 86 | - data-{{verb}}={{plugin}} - defines main interaction 87 | - data-target || href^=# - defined on "control" element (if element controls an element other than self) 88 | - data-{{noun}} - defines class instance options 89 | 90 | examples: 91 | 92 | // control other targets 93 | data-toggle="modal" data-target="#foo" 94 | data-toggle="collapse" data-target="#foo" data-parent="#bar" 95 | 96 | // defined on element they control 97 | data-spy="scroll" 98 | 99 | data-dismiss="modal" 100 | data-dismiss="alert" 101 | 102 | data-toggle="dropdown" 103 | 104 | data-toggle="button" 105 | data-toggle="buttons-checkbox" 106 | data-toggle="buttons-radio" -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/js/bootstrap-alert.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * bootstrap-alert.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#alerts 4 | * ========================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function( $ ){ 22 | 23 | "use strict" 24 | 25 | /* ALERT CLASS DEFINITION 26 | * ====================== */ 27 | 28 | var dismiss = '[data-dismiss="alert"]' 29 | , Alert = function ( el ) { 30 | $(el).on('click', dismiss, this.close) 31 | } 32 | 33 | Alert.prototype = { 34 | 35 | constructor: Alert 36 | 37 | , close: function ( e ) { 38 | var $this = $(this) 39 | , selector = $this.attr('data-target') 40 | , $parent 41 | 42 | if (!selector) { 43 | selector = $this.attr('href') 44 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 45 | } 46 | 47 | $parent = $(selector) 48 | $parent.trigger('close') 49 | 50 | e && e.preventDefault() 51 | 52 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) 53 | 54 | $parent 55 | .trigger('close') 56 | .removeClass('in') 57 | 58 | function removeElement() { 59 | $parent 60 | .trigger('closed') 61 | .remove() 62 | } 63 | 64 | $.support.transition && $parent.hasClass('fade') ? 65 | $parent.on($.support.transition.end, removeElement) : 66 | removeElement() 67 | } 68 | 69 | } 70 | 71 | 72 | /* ALERT PLUGIN DEFINITION 73 | * ======================= */ 74 | 75 | $.fn.alert = function ( option ) { 76 | return this.each(function () { 77 | var $this = $(this) 78 | , data = $this.data('alert') 79 | if (!data) $this.data('alert', (data = new Alert(this))) 80 | if (typeof option == 'string') data[option].call($this) 81 | }) 82 | } 83 | 84 | $.fn.alert.Constructor = Alert 85 | 86 | 87 | /* ALERT DATA-API 88 | * ============== */ 89 | 90 | $(function () { 91 | $('body').on('click.alert.data-api', dismiss, Alert.prototype.close) 92 | }) 93 | 94 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/js/bootstrap-button.js: -------------------------------------------------------------------------------- 1 | /* ============================================================ 2 | * bootstrap-button.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#buttons 4 | * ============================================================ 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | !function( $ ){ 21 | 22 | "use strict" 23 | 24 | /* BUTTON PUBLIC CLASS DEFINITION 25 | * ============================== */ 26 | 27 | var Button = function ( element, options ) { 28 | this.$element = $(element) 29 | this.options = $.extend({}, $.fn.button.defaults, options) 30 | } 31 | 32 | Button.prototype = { 33 | 34 | constructor: Button 35 | 36 | , setState: function ( state ) { 37 | var d = 'disabled' 38 | , $el = this.$element 39 | , data = $el.data() 40 | , val = $el.is('input') ? 'val' : 'html' 41 | 42 | state = state + 'Text' 43 | data.resetText || $el.data('resetText', $el[val]()) 44 | 45 | $el[val](data[state] || this.options[state]) 46 | 47 | // push to event loop to allow forms to submit 48 | setTimeout(function () { 49 | state == 'loadingText' ? 50 | $el.addClass(d).attr(d, d) : 51 | $el.removeClass(d).removeAttr(d) 52 | }, 0) 53 | } 54 | 55 | , toggle: function () { 56 | var $parent = this.$element.parent('[data-toggle="buttons-radio"]') 57 | 58 | $parent && $parent 59 | .find('.active') 60 | .removeClass('active') 61 | 62 | this.$element.toggleClass('active') 63 | } 64 | 65 | } 66 | 67 | 68 | /* BUTTON PLUGIN DEFINITION 69 | * ======================== */ 70 | 71 | $.fn.button = function ( option ) { 72 | return this.each(function () { 73 | var $this = $(this) 74 | , data = $this.data('button') 75 | , options = typeof option == 'object' && option 76 | if (!data) $this.data('button', (data = new Button(this, options))) 77 | if (option == 'toggle') data.toggle() 78 | else if (option) data.setState(option) 79 | }) 80 | } 81 | 82 | $.fn.button.defaults = { 83 | loadingText: 'loading...' 84 | } 85 | 86 | $.fn.button.Constructor = Button 87 | 88 | 89 | /* BUTTON DATA-API 90 | * =============== */ 91 | 92 | $(function () { 93 | $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) { 94 | var $btn = $(e.target) 95 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 96 | $btn.button('toggle') 97 | }) 98 | }) 99 | 100 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/js/bootstrap-dropdown.js: -------------------------------------------------------------------------------- 1 | /* ============================================================ 2 | * bootstrap-dropdown.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns 4 | * ============================================================ 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | 21 | !function( $ ){ 22 | 23 | "use strict" 24 | 25 | /* DROPDOWN CLASS DEFINITION 26 | * ========================= */ 27 | 28 | var toggle = '[data-toggle="dropdown"]' 29 | , Dropdown = function ( element ) { 30 | var $el = $(element).on('click.dropdown.data-api', this.toggle) 31 | $('html').on('click.dropdown.data-api', function () { 32 | $el.parent().removeClass('open') 33 | }) 34 | } 35 | 36 | Dropdown.prototype = { 37 | 38 | constructor: Dropdown 39 | 40 | , toggle: function ( e ) { 41 | var $this = $(this) 42 | , selector = $this.attr('data-target') 43 | , $parent 44 | , isActive 45 | 46 | if (!selector) { 47 | selector = $this.attr('href') 48 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 49 | } 50 | 51 | $parent = $(selector) 52 | $parent.length || ($parent = $this.parent()) 53 | 54 | isActive = $parent.hasClass('open') 55 | 56 | clearMenus() 57 | !isActive && $parent.toggleClass('open') 58 | 59 | return false 60 | } 61 | 62 | } 63 | 64 | function clearMenus() { 65 | $(toggle).parent().removeClass('open') 66 | } 67 | 68 | 69 | /* DROPDOWN PLUGIN DEFINITION 70 | * ========================== */ 71 | 72 | $.fn.dropdown = function ( option ) { 73 | return this.each(function () { 74 | var $this = $(this) 75 | , data = $this.data('dropdown') 76 | if (!data) $this.data('dropdown', (data = new Dropdown(this))) 77 | if (typeof option == 'string') data[option].call($this) 78 | }) 79 | } 80 | 81 | $.fn.dropdown.Constructor = Dropdown 82 | 83 | 84 | /* APPLY TO STANDARD DROPDOWN ELEMENTS 85 | * =================================== */ 86 | 87 | $(function () { 88 | $('html').on('click.dropdown.data-api', clearMenus) 89 | $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) 90 | }) 91 | 92 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/js/bootstrap-popover.js: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * bootstrap-popover.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#popovers 4 | * =========================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * =========================================================== */ 19 | 20 | 21 | !function( $ ) { 22 | 23 | "use strict" 24 | 25 | var Popover = function ( element, options ) { 26 | this.init('popover', element, options) 27 | } 28 | 29 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js 30 | ========================================== */ 31 | 32 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { 33 | 34 | constructor: Popover 35 | 36 | , setContent: function () { 37 | var $tip = this.tip() 38 | , title = this.getTitle() 39 | , content = this.getContent() 40 | 41 | $tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title) 42 | $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content) 43 | 44 | $tip.removeClass('fade top bottom left right in') 45 | } 46 | 47 | , hasContent: function () { 48 | return this.getTitle() || this.getContent() 49 | } 50 | 51 | , getContent: function () { 52 | var content 53 | , $e = this.$element 54 | , o = this.options 55 | 56 | content = $e.attr('data-content') 57 | || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) 58 | 59 | content = content.toString().replace(/(^\s*|\s*$)/, "") 60 | 61 | return content 62 | } 63 | 64 | , tip: function() { 65 | if (!this.$tip) { 66 | this.$tip = $(this.options.template) 67 | } 68 | return this.$tip 69 | } 70 | 71 | }) 72 | 73 | 74 | /* POPOVER PLUGIN DEFINITION 75 | * ======================= */ 76 | 77 | $.fn.popover = function ( option ) { 78 | return this.each(function () { 79 | var $this = $(this) 80 | , data = $this.data('popover') 81 | , options = typeof option == 'object' && option 82 | if (!data) $this.data('popover', (data = new Popover(this, options))) 83 | if (typeof option == 'string') data[option]() 84 | }) 85 | } 86 | 87 | $.fn.popover.Constructor = Popover 88 | 89 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { 90 | placement: 'right' 91 | , content: '' 92 | , template: '

    ' 93 | }) 94 | 95 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/js/bootstrap-scrollspy.js: -------------------------------------------------------------------------------- 1 | /* ============================================================= 2 | * bootstrap-scrollspy.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#scrollspy 4 | * ============================================================= 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================== */ 19 | 20 | !function ( $ ) { 21 | 22 | "use strict" 23 | 24 | /* SCROLLSPY CLASS DEFINITION 25 | * ========================== */ 26 | 27 | function ScrollSpy( element, options) { 28 | var process = $.proxy(this.process, this) 29 | , $element = $(element).is('body') ? $(window) : $(element) 30 | , href 31 | this.options = $.extend({}, $.fn.scrollspy.defaults, options) 32 | this.$scrollElement = $element.on('scroll.scroll.data-api', process) 33 | this.selector = (this.options.target 34 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 35 | || '') + ' .nav li > a' 36 | this.$body = $('body').on('click.scroll.data-api', this.selector, process) 37 | this.refresh() 38 | this.process() 39 | } 40 | 41 | ScrollSpy.prototype = { 42 | 43 | constructor: ScrollSpy 44 | 45 | , refresh: function () { 46 | this.targets = this.$body 47 | .find(this.selector) 48 | .map(function () { 49 | var href = $(this).attr('href') 50 | return /^#\w/.test(href) && $(href).length ? href : null 51 | }) 52 | 53 | this.offsets = $.map(this.targets, function (id) { 54 | return $(id).position().top 55 | }) 56 | } 57 | 58 | , process: function () { 59 | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 60 | , offsets = this.offsets 61 | , targets = this.targets 62 | , activeTarget = this.activeTarget 63 | , i 64 | 65 | for (i = offsets.length; i--;) { 66 | activeTarget != targets[i] 67 | && scrollTop >= offsets[i] 68 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) 69 | && this.activate( targets[i] ) 70 | } 71 | } 72 | 73 | , activate: function (target) { 74 | var active 75 | 76 | this.activeTarget = target 77 | 78 | this.$body 79 | .find(this.selector).parent('.active') 80 | .removeClass('active') 81 | 82 | active = this.$body 83 | .find(this.selector + '[href="' + target + '"]') 84 | .parent('li') 85 | .addClass('active') 86 | 87 | if ( active.parent('.dropdown-menu') ) { 88 | active.closest('li.dropdown').addClass('active') 89 | } 90 | } 91 | 92 | } 93 | 94 | 95 | /* SCROLLSPY PLUGIN DEFINITION 96 | * =========================== */ 97 | 98 | $.fn.scrollspy = function ( option ) { 99 | return this.each(function () { 100 | var $this = $(this) 101 | , data = $this.data('scrollspy') 102 | , options = typeof option == 'object' && option 103 | if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options))) 104 | if (typeof option == 'string') data[option]() 105 | }) 106 | } 107 | 108 | $.fn.scrollspy.Constructor = ScrollSpy 109 | 110 | $.fn.scrollspy.defaults = { 111 | offset: 10 112 | } 113 | 114 | 115 | /* SCROLLSPY DATA-API 116 | * ================== */ 117 | 118 | $(function () { 119 | $('[data-spy="scroll"]').each(function () { 120 | var $spy = $(this) 121 | $spy.scrollspy($spy.data()) 122 | }) 123 | }) 124 | 125 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/js/bootstrap-tab.js: -------------------------------------------------------------------------------- 1 | /* ======================================================== 2 | * bootstrap-tab.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#tabs 4 | * ======================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ======================================================== */ 19 | 20 | 21 | !function( $ ){ 22 | 23 | "use strict" 24 | 25 | /* TAB CLASS DEFINITION 26 | * ==================== */ 27 | 28 | var Tab = function ( element ) { 29 | this.element = $(element) 30 | } 31 | 32 | Tab.prototype = { 33 | 34 | constructor: Tab 35 | 36 | , show: function () { 37 | var $this = this.element 38 | , $ul = $this.closest('ul:not(.dropdown-menu)') 39 | , selector = $this.attr('data-target') 40 | , previous 41 | , $target 42 | 43 | if (!selector) { 44 | selector = $this.attr('href') 45 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 46 | } 47 | 48 | if ( $this.parent('li').hasClass('active') ) return 49 | 50 | previous = $ul.find('.active a').last()[0] 51 | 52 | $this.trigger({ 53 | type: 'show' 54 | , relatedTarget: previous 55 | }) 56 | 57 | $target = $(selector) 58 | 59 | this.activate($this.parent('li'), $ul) 60 | this.activate($target, $target.parent(), function () { 61 | $this.trigger({ 62 | type: 'shown' 63 | , relatedTarget: previous 64 | }) 65 | }) 66 | } 67 | 68 | , activate: function ( element, container, callback) { 69 | var $active = container.find('> .active') 70 | , transition = callback 71 | && $.support.transition 72 | && $active.hasClass('fade') 73 | 74 | function next() { 75 | $active 76 | .removeClass('active') 77 | .find('> .dropdown-menu > .active') 78 | .removeClass('active') 79 | 80 | element.addClass('active') 81 | 82 | if (transition) { 83 | element[0].offsetWidth // reflow for transition 84 | element.addClass('in') 85 | } else { 86 | element.removeClass('fade') 87 | } 88 | 89 | if ( element.parent('.dropdown-menu') ) { 90 | element.closest('li.dropdown').addClass('active') 91 | } 92 | 93 | callback && callback() 94 | } 95 | 96 | transition ? 97 | $active.one($.support.transition.end, next) : 98 | next() 99 | 100 | $active.removeClass('in') 101 | } 102 | } 103 | 104 | 105 | /* TAB PLUGIN DEFINITION 106 | * ===================== */ 107 | 108 | $.fn.tab = function ( option ) { 109 | return this.each(function () { 110 | var $this = $(this) 111 | , data = $this.data('tab') 112 | if (!data) $this.data('tab', (data = new Tab(this))) 113 | if (typeof option == 'string') data[option]() 114 | }) 115 | } 116 | 117 | $.fn.tab.Constructor = Tab 118 | 119 | 120 | /* TAB DATA-API 121 | * ============ */ 122 | 123 | $(function () { 124 | $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { 125 | e.preventDefault() 126 | $(this).tab('show') 127 | }) 128 | }) 129 | 130 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/js/bootstrap-transition.js: -------------------------------------------------------------------------------- 1 | /* =================================================== 2 | * bootstrap-transition.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#transitions 4 | * =================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | !function( $ ) { 21 | 22 | $(function () { 23 | 24 | "use strict" 25 | 26 | /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) 27 | * ======================================================= */ 28 | 29 | $.support.transition = (function () { 30 | var thisBody = document.body || document.documentElement 31 | , thisStyle = thisBody.style 32 | , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined 33 | 34 | return support && { 35 | end: (function () { 36 | var transitionEnd = "TransitionEnd" 37 | if ( $.browser.webkit ) { 38 | transitionEnd = "webkitTransitionEnd" 39 | } else if ( $.browser.mozilla ) { 40 | transitionEnd = "transitionend" 41 | } else if ( $.browser.opera ) { 42 | transitionEnd = "oTransitionEnd" 43 | } 44 | return transitionEnd 45 | }()) 46 | } 47 | })() 48 | 49 | }) 50 | 51 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/assets/js/google-code-prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .linenums .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 18px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var hogan = require('hogan.js') 3 | , fs = require('fs') 4 | , prod = process.argv[2] == 'production' 5 | 6 | var layout, pages 7 | 8 | // compile layout template 9 | layout = fs.readFileSync(__dirname + '/../templates/layout.mustache', 'utf-8') 10 | layout = hogan.compile(layout, { sectionTags: [{o:'_i', c:'i'}] }) 11 | 12 | // retrieve pages 13 | pages = fs.readdirSync(__dirname + '/../templates/pages') 14 | 15 | // iterate over pages 16 | pages.forEach(function (name) { 17 | 18 | if (!name.match(/\.mustache$/)) return 19 | 20 | var page = fs.readFileSync(__dirname + '/../templates/pages/' + name, 'utf-8') 21 | , context = {} 22 | 23 | context[name.replace(/\.mustache$/, '')] = 'active' 24 | context._i = true 25 | context.production = prod 26 | 27 | page = hogan.compile(page, { sectionTags: [{o:'_i', c:'i'}] }) 28 | page = layout.render(context, { 29 | body: page 30 | }) 31 | 32 | fs.writeFileSync(__dirname + '/../' + name.replace(/mustache$/, 'html'), page, 'utf-8') 33 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/.bin/hulk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * Copyright 2011 Twitter, Inc. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | var hogan = require('../lib/hogan.js'), 19 | path = require('path'), 20 | fs = require('fs'); 21 | 22 | var specials = ['/', '.', '*', '+', '?', '|','(', ')', '[', ']', '{', '}', '\\'], 23 | specialsRegExp = new RegExp('(\\' + specials.join('|\\') + ')', 'g'), 24 | templates; 25 | 26 | 27 | // Escape special regexp characters 28 | function esc(text) { 29 | return text.replace(specialsRegExp, '\\$1'); 30 | } 31 | 32 | 33 | // Check for dirs and correct ext (<3 for windows) 34 | function extractFiles(args) { 35 | var usage = 'USAGE: hulk ./templates/*.mustaches\n' + 36 | 'NOTE: hulk supports the "*" wildcard and allows you to target specific extensions too', 37 | files = []; 38 | 39 | if (!args.length) { 40 | console.log(usage); 41 | process.exit(-1); 42 | } 43 | 44 | args.forEach(function (arg) { 45 | 46 | if (/\*/.test(arg)) { 47 | arg = arg.split('*'); 48 | return files = files.concat( 49 | fs.readdirSync(arg[0] || '.') 50 | .map(function (f) { 51 | return new RegExp(esc(arg[1]) + '$').test(f) && path.join(arg[0], f); 52 | }) 53 | .filter(function (f) { 54 | return f; 55 | }) 56 | ); 57 | } 58 | 59 | files.push(arg); 60 | 61 | }) 62 | 63 | return files; 64 | } 65 | 66 | 67 | // Remove utf-8 byte order mark, http://en.wikipedia.org/wiki/Byte_order_mark 68 | function removeByteOrderMark(text) { 69 | if (text.charCodeAt(0) === 0xfeff) { 70 | return text.substring(1); 71 | } 72 | return text; 73 | } 74 | 75 | 76 | // Write a template foreach file that matches template extension 77 | templates = extractFiles(process.argv.slice(2)) 78 | .map(function (file) { 79 | var openedFile = fs.readFileSync(file, 'utf-8'), name; 80 | if (!openedFile) return; 81 | name = file.replace(/\..*$/, ''); 82 | openedFile = removeByteOrderMark(openedFile.trim()); 83 | return 'templates.' + name + ' = new Hogan.Template(' + hogan.compile(openedFile, { asString: 1 }) + ');'; 84 | }) 85 | .filter(function (t) { 86 | return t; 87 | }); 88 | 89 | 90 | // Output templates 91 | if (!templates.length) return; 92 | console.log('var templates = {};'); 93 | console.log(templates.join('\n')); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/.git_ignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "test/spec"] 2 | path = test/spec 3 | url = https://github.com/mustache/spec.git 4 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/Makefile: -------------------------------------------------------------------------------- 1 | REPO = git@github.com:twitter/hogan.js.git 2 | BUILD := build 3 | VERSION = ${shell node -e 'var s = JSON.parse(require("fs").readFileSync("package.json").toString()).version; console.log(s.substring(0, s.indexOf("-")));'} 4 | 5 | # 6 | # Run command line tests 7 | # 8 | test: 9 | @ node test/index.js 10 | 11 | # 12 | # Run Mustache spec tests 13 | # 14 | spec: 15 | @ node test/spec.js 16 | 17 | # 18 | # Run benchmark 19 | # 20 | benchmark: 21 | @ node benchmark/console/index.js 22 | 23 | clean: 24 | @ rm -rf dist/* 25 | # 26 | # Make a new version of Hogan from the current dev version. 27 | # 28 | release: clean 29 | @ echo "Creating a new version of Hogan." 30 | @ mkdir -p dist/nodejs 31 | @ cp -R lib dist/nodejs/lib 32 | @ node tools/release.js 33 | @ mkdir -p web/builds/$(VERSION) 34 | @ cp dist/*.* web/builds/$(VERSION)/. 35 | # 36 | # Make the gh-pages website 37 | # 38 | # This target builds the hogan.js github website using hogan.js. 39 | # 40 | # cd into build/gh-pages to check in the new site. 41 | # 42 | GH_PAGES = $(BUILD)/gh-pages 43 | web: | pages 44 | @cp -R web/* $(GH_PAGES) 45 | @@ node tools/web_templates.js 46 | @echo 47 | @echo "Website built in $(GH_PAGES)." 48 | 49 | # 50 | # Checkout the gh-pages branch. 51 | # 52 | pages: | $(BUILD) 53 | @if [ ! -d "$(GH_PAGES)" ]; then \ 54 | git clone -b gh-pages $(REPO) $(GH_PAGES); \ 55 | rm -rf $(GH_PAGES)/*; \ 56 | fi; 57 | @mkdir -p $(GH_PAGES)/images 58 | 59 | $(BUILD): 60 | mkdir -p $(BUILD) 61 | 62 | .PHONY: test spec benchmark web release 63 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/README.md: -------------------------------------------------------------------------------- 1 | ## Hogan.js - A mustache compiler. 2 | 3 | [Hogan.js](http://twitter.github.com/hogan.js/) is a compiler for the 4 | [Mustache](http://mustache.github.com/) templating language. For information 5 | on Mustache, see the [manpage](http://mustache.github.com/mustache.5.html) and 6 | the [spec](https://github.com/mustache/spec). 7 | 8 | ## Basics 9 | 10 | Hogan compiles templates to HoganTemplate objects, which have a render method. 11 | 12 | ```js 13 | var data = { 14 | screenName: "dhg", 15 | }; 16 | 17 | var template = Hogan.compile("Follow @{{screenName}}."); 18 | var output = template.render(data); 19 | 20 | // prints "Follow @dhg." 21 | console.log(output); 22 | ``` 23 | 24 | ## Features 25 | 26 | Hogan is fast--try it on your workload. 27 | 28 | Hogan has separate scanning, parsing and code generation phases. This way it's 29 | possible to add new features without touching the scanner at all, and many 30 | different code generation techniques can be tried without changing the parser. 31 | 32 | Hogan exposes scan and parse methods. These can be useful for 33 | pre-processing templates on the server. 34 | 35 | ```js 36 | var text = "{{^check}}{{i18n}}No{{/i18n}}{{/check}}"; 37 | text += "{{#check}}{{i18n}}Yes{{/i18n}}{{/check}}"; 38 | var tree = Hogan.parse(Hogan.scan(text)); 39 | 40 | // outputs "# check" 41 | console.log(tree[0].tag + " " + tree[0].name); 42 | 43 | // outputs "Yes" 44 | console.log(tree[1].nodes[0].nodes[0]); 45 | ``` 46 | 47 | It's also possible to use HoganTemplate objects without the Hogan compiler 48 | present. That means you can pre-compile your templates on the server, and 49 | avoid shipping the compiler. However, the optional lambda features from the 50 | Mustache spec do require the compiler to be present. 51 | 52 | ## Why Hogan.js? 53 | 54 | Why another templating library? 55 | 56 | Hogan.js was written to meet three templating library requirements: good 57 | performance, standalone template objects, and a parser API. 58 | 59 | ## Issues 60 | 61 | Have a bug? Please create an issue here on GitHub! 62 | 63 | https://github.com/twitter/hogan.js/issues 64 | 65 | ## Versioning 66 | 67 | For transparency and insight into our release cycle, releases will be numbered with the follow format: 68 | 69 | `..` 70 | 71 | And constructed with the following guidelines: 72 | 73 | * Breaking backwards compatibility bumps the major 74 | * New additions without breaking backwards compatibility bumps the minor 75 | * Bug fixes and misc changes bump the patch 76 | 77 | For more information on semantic versioning, please visit http://semver.org/. 78 | 79 | ## Authors 80 | 81 | **Robert Sayre** 82 | 83 | + http://github.com/sayrer 84 | 85 | **Jacob Thornton** 86 | 87 | + http://github.com/fat 88 | 89 | ## License 90 | 91 | Copyright 2011 Twitter, Inc. 92 | 93 | Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/bin/hulk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | * Copyright 2011 Twitter, Inc. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | var hogan = require('../lib/hogan.js'), 19 | path = require('path'), 20 | fs = require('fs'); 21 | 22 | var specials = ['/', '.', '*', '+', '?', '|','(', ')', '[', ']', '{', '}', '\\'], 23 | specialsRegExp = new RegExp('(\\' + specials.join('|\\') + ')', 'g'), 24 | templates; 25 | 26 | 27 | // Escape special regexp characters 28 | function esc(text) { 29 | return text.replace(specialsRegExp, '\\$1'); 30 | } 31 | 32 | 33 | // Check for dirs and correct ext (<3 for windows) 34 | function extractFiles(args) { 35 | var usage = 'USAGE: hulk ./templates/*.mustaches\n' + 36 | 'NOTE: hulk supports the "*" wildcard and allows you to target specific extensions too', 37 | files = []; 38 | 39 | if (!args.length) { 40 | console.log(usage); 41 | process.exit(-1); 42 | } 43 | 44 | args.forEach(function (arg) { 45 | 46 | if (/\*/.test(arg)) { 47 | arg = arg.split('*'); 48 | return files = files.concat( 49 | fs.readdirSync(arg[0] || '.') 50 | .map(function (f) { 51 | return new RegExp(esc(arg[1]) + '$').test(f) && path.join(arg[0], f); 52 | }) 53 | .filter(function (f) { 54 | return f; 55 | }) 56 | ); 57 | } 58 | 59 | files.push(arg); 60 | 61 | }) 62 | 63 | return files; 64 | } 65 | 66 | 67 | // Remove utf-8 byte order mark, http://en.wikipedia.org/wiki/Byte_order_mark 68 | function removeByteOrderMark(text) { 69 | if (text.charCodeAt(0) === 0xfeff) { 70 | return text.substring(1); 71 | } 72 | return text; 73 | } 74 | 75 | 76 | // Write a template foreach file that matches template extension 77 | templates = extractFiles(process.argv.slice(2)) 78 | .map(function (file) { 79 | var openedFile = fs.readFileSync(file, 'utf-8'), name; 80 | if (!openedFile) return; 81 | name = file.replace(/\..*$/, ''); 82 | openedFile = removeByteOrderMark(openedFile.trim()); 83 | return 'templates.' + name + ' = new Hogan.Template(' + hogan.compile(openedFile, { asString: 1 }) + ');'; 84 | }) 85 | .filter(function (t) { 86 | return t; 87 | }); 88 | 89 | 90 | // Output templates 91 | if (!templates.length) return; 92 | console.log('var templates = {};'); 93 | console.log(templates.join('\n')); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/lib/hogan.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // This file is for use with Node.js. See dist/ for browser files. 17 | 18 | var Hogan = require('./compiler'); 19 | Hogan.Template = require('./template').Template; 20 | module.exports = Hogan; -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hogan.js" 3 | , "description": "A mustache compiler." 4 | , "version": "1.0.5-dev" 5 | , "keywords": ["mustache", "template"] 6 | , "main": "./lib/hogan.js" 7 | , "homepage": "http://twitter.github.com/hogan.js/" 8 | , "author": "Twitter Inc." 9 | , "repository": { 10 | "type": "git" 11 | , "url": "https://github.com/twitter/hogan.js.git" 12 | } 13 | , "licenses": [ 14 | { "type": "Apache-2.0" 15 | , "url": "http://www.apache.org/licenses/LICENSE-2.0" 16 | } 17 | ] 18 | , "devDependencies": { "uglify-js": "*" } 19 | , "bin" : { "hulk" : "./bin/hulk" } 20 | } 21 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/html/list.html: -------------------------------------------------------------------------------- 1 |
      2 |
    • 3 |
    • 4 |
    • 5 |
    • 6 |
    • 7 |
    • 8 |
    -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | test 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/mustache.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | var doc = this['document']; 17 | var fs = require('fs'); 18 | 19 | var passed = 0; 20 | var failed = 0; 21 | 22 | if (!this['output']) { 23 | var output = function (string) { 24 | return doc ? doc.write(string + '
    ') : console.log(string); 25 | }; 26 | } 27 | 28 | var Hogan = require(__dirname + '/../lib/hogan'); 29 | var template = fs.readFileSync(__dirname + '/../lib/template.js').toString(); 30 | var compiler = fs.readFileSync(__dirname + '/../lib/compiler.js').toString(); 31 | var mustache_wrapper = fs.readFileSync(__dirname + '/../wrappers/mustache.js.mustache').toString(); 32 | 33 | // Create a Mustache.js emulator from the distribution template 34 | var engines = (new Function(Hogan.compile(mustache_wrapper).render({template: template, compiler: compiler}) + 35 | '; return {Hogan: Hogan, Mustache: Mustache};'))(); 36 | 37 | var Mustache = engines.Mustache; 38 | var Hogan2 = engines.Hogan; 39 | 40 | 41 | // sanity check 42 | is(Mustache.hasOwnProperty('to_html'), true, 'Mustache has to_html method.'); 43 | 44 | // Check for Mustache.js partial resolution behavior. 45 | var context = { 46 | foo: 'bar', 47 | mypartial: { 48 | baz: 'qux' 49 | } 50 | } 51 | var text = 'abc {{foo}} def {{>mypartial}} ghi'; 52 | var partialText = '{{baz}}'; 53 | var s = Mustache.to_html(text, context, {'mypartial': partialText}); 54 | is(s, 'abc bar def qux ghi', 'Correct emulation of Mustache.js partial-name-in-context resolution.'); 55 | 56 | // Now check to see that the Hogan resolution is unaffected. 57 | var t = Hogan2.compile(text); 58 | s = t.render(context, {'mypartial': partialText}); 59 | is(s, 'abc bar def ghi', 'Hogan behavior not changed by Mustache.js emulation.'); 60 | 61 | // Check for sendFun behavior 62 | var buf = ""; 63 | function send(s) { 64 | buf += "-FOO " + s + " FOO-"; 65 | } 66 | var s = Mustache.to_html(text, context, {'mypartial': partialText}, send); 67 | is(buf, '-FOO abc bar def qux ghi FOO-', 'Correct emulation of Mustache.js sendFun.'); 68 | 69 | 70 | function is(got, expected, msg) { 71 | if (got === expected) { 72 | output("OK: " + msg); 73 | ++passed; 74 | } else { 75 | output("FAIL: " + msg); 76 | output("Expected |" + expected + "|"); 77 | output(" Got |" + got + "|"); 78 | ++failed; 79 | } 80 | } 81 | 82 | function complete() { 83 | output("\nTests Complete"); 84 | output("--------------"); 85 | output("Passed: " + passed); 86 | output("Failed: " + failed); 87 | output("\n"); 88 | } 89 | 90 | complete(); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | var Hogan = Hogan || require('../lib/hogan'); 17 | var doc = this["document"]; 18 | var fs = require('fs'); 19 | 20 | var passed = 0; 21 | var failed = 0; 22 | 23 | if (!this["output"]) { 24 | var output = function (string) { 25 | return doc ? doc.write(string + '
    ') : console.log(string); 26 | }; 27 | } 28 | 29 | function runTest(tests) { 30 | tests.forEach(function(test) { 31 | var partials = {}; 32 | for (var i in test.partials) { 33 | partials[i] = Hogan.compile(test.partials[i]); 34 | } 35 | var t = Hogan.compile(test.template); 36 | 37 | if (test.data.lambda) { 38 | var func = (new Function ('return ' + test.data.lambda.js)()); 39 | test.data.lambda = function() { return func; }; 40 | } 41 | 42 | var s = t.render(test.data, partials); 43 | is(s, test.expected, test.name + ': ' + test.desc); 44 | }); 45 | } 46 | 47 | var testDir = './test/spec/specs'; 48 | var files = fs.readdirSync(testDir) 49 | .filter(function(f) { return f.indexOf('.json') > 0; }) 50 | .map(function(f) { return testDir + '/' + f}); 51 | 52 | for (var i = 0; i < files.length; i++) { 53 | var test = JSON.parse(fs.readFileSync(files[i]).toString()); 54 | runTest(test.tests); 55 | } 56 | 57 | function is(got, expected, msg) { 58 | if (got === expected) { 59 | output("OK: " + msg); 60 | ++passed; 61 | } else { 62 | output("FAIL: " + msg); 63 | output("Expected |" + expected + "|"); 64 | output(" Got |" + got + "|"); 65 | ++failed; 66 | } 67 | } 68 | 69 | function complete() { 70 | output("\nTests Complete"); 71 | output("--------------"); 72 | output("Passed: " + passed); 73 | output("Failed: " + failed); 74 | output("\n"); 75 | } 76 | 77 | complete(); 78 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec/Changes: -------------------------------------------------------------------------------- 1 | 2011-03-20: v1.1.2 2 | Added tests for standalone tags at string boundaries. 3 | Added tests for rendering lambda returns after delimiter changes. 4 | 5 | 2011-03-20: v1.0.3 6 | Added tests for standalone tags at string boundaries. 7 | Added tests for rendering lambda returns after delimiter changes. 8 | 9 | 2011-03-05: v1.1.1 10 | Added tests for indented inline sections. 11 | Added tests for Windows-style newlines. 12 | 13 | 2011-03-05: v1.0.2 14 | Added tests for indented inline sections. 15 | Added tests for Windows-style newlines. 16 | 17 | 2011-03-04: v1.1.0 18 | Implicit iterators. 19 | A single period (`.`) may now be used as a name in Interpolation tags, 20 | which represents the top of stack (cast as a String). 21 | Dotted names. 22 | Names containing one or more periods should be resolved as chained 23 | properties; naïvely, this is like nesting section tags, but with some 24 | built-in scoping protections. 25 | 26 | 2011-03-02: v1.0.1 27 | Clarifying a point in the README about version compliance. 28 | Adding high-level documentation to each spec file. 29 | 30 | 2011-02-28: v1.0.0 31 | Initial Release 32 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec/README.md: -------------------------------------------------------------------------------- 1 | The repository at https://github.com/mustache/spec is the formal standard for 2 | Mustache. It defines both normal usage and edge-case behavior for libraries 3 | parsing the Mustache templating language (or a superset thereof). 4 | 5 | The specification is developed as a series of YAML files, under the `specs` 6 | directory. 7 | 8 | Versioning 9 | ---------- 10 | This specification is being [semantically versioned](http://semver.org). 11 | Roughly described, major version changes will always represent backwards 12 | incompatible changes, minor version changes will always represent new language 13 | features and will be backwards compatible, and patch ('tiny') version changes 14 | will always be bug fixes. For the purposes of semantic versioning, the public 15 | API is the contents of the `specs` directory and the algorithm for testing 16 | against it. 17 | 18 | Mustache implementations SHOULD report the most recent version of the spec 19 | (major and minor version numbers). If an implementation has support for any 20 | optional modules, they SHOULD indicate so with a remark attached to the 21 | version number (e.g. "vX.Y, including lambdas" or "v.X.Y+λ"). It is 22 | RECOMMENDED that implementations not supporting at least v1.0.0 of this spec 23 | refer to themselves as "Mustache-like", or "Mustache-inspired". 24 | 25 | Alternate Formats 26 | ----------------- 27 | 28 | Since YAML is a reasonably complex format that not every language has good 29 | tools for working with, we also provide JSON versions of the specs on a 30 | best-effort basis. 31 | 32 | These should be identical to the YAML specifications, but if you find the need 33 | to regenerate them, they can be trivially rebuilt by invoking `rake build`. 34 | 35 | It is also worth noting that some specifications (notably, the lambda module) 36 | rely on YAML "tags" to denote special types of data (e.g. source code). Since 37 | JSON offers no way to denote this, a special key ("`__tag__`") is injected 38 | with the name of the tag as its value. See `TESTING.md` for more information 39 | about handling tagged data. 40 | 41 | Optional Modules 42 | ---------------- 43 | 44 | Specification files beginning with a tilde (`~`) describe optional modules. 45 | At present, the only module being described as optional is regarding support 46 | for lambdas. As a guideline, a module may be a candidate for optionality 47 | when: 48 | 49 | * It does not affect the core syntax of the language. 50 | * It does not significantly affect the output of rendered templates. 51 | * It concerns implementation language features or data types that are not 52 | common to or core in every targeted language. 53 | * The lack of support by an implementation does not diminish the usage of 54 | Mustache in the target language. 55 | 56 | As an example, the lambda module is primarily concerned with the handling of a 57 | particular data type (code). This is a type of data that may be difficult to 58 | support in some languages, and users of those languages will not see the lack 59 | as an 'inconsistency' between implementations. 60 | 61 | Support for specific pragmas or syntax extensions, however, are best managed 62 | outside this core specification, as adjunct specifications. 63 | 64 | Implementors are strongly encouraged to support any and all modules they are 65 | reasonably capable of supporting. 66 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec/Rakefile: -------------------------------------------------------------------------------- 1 | require 'json' 2 | require 'yaml' 3 | 4 | # Our custom YAML tags must retain their magic. 5 | %w[ code ].each do |tag| 6 | YAML::add_builtin_type(tag) { |_,val| val.merge(:__tag__ => tag) } 7 | end 8 | 9 | desc 'Build all alternate versions of the specs.' 10 | multitask :build => [ 'build:json' ] 11 | 12 | namespace :build do 13 | note = 'Do not edit this file; changes belong in the appropriate YAML file.' 14 | 15 | desc 'Build JSON versions of the specs.' 16 | task :json do 17 | rm(Dir['specs/*.json'], :verbose => false) 18 | Dir.glob('specs/*.yml').each do |filename| 19 | json_file = filename.gsub('.yml', '.json') 20 | 21 | File.open(json_file, 'w') do |file| 22 | doc = YAML.load_file(filename) 23 | file << doc.merge(:__ATTN__ => note).to_json() 24 | end 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec/TESTING.md: -------------------------------------------------------------------------------- 1 | Testing your Mustache implementation against this specification should be 2 | relatively simple. If you have a readily available testing framework on your 3 | platform, your task may be even simpler. 4 | 5 | In general, the process for each `.yml` file is as follows: 6 | 7 | 1. Use a YAML parser to load the file. 8 | 9 | 2. For each test in the 'tests' array: 10 | 11 | 1. Ensure that each element of the 'partials' hash (if it exists) is 12 | stored in a place where the interpreter will look for it. 13 | 14 | 2. If your implementation will not support lambdas, feel free to skip over 15 | the optional '~lambdas.yml' file. 16 | 17 | 2.1. If your implementation will support lambdas, ensure that each member of 18 | 'data' tagged with '!code' is properly processed into a language- 19 | specific lambda reference. 20 | 21 | * e.g. Given this YAML data hash: 22 | 23 | `{ x: !code { ruby: 'proc { "x" }', perl: 'sub { "x" }' } }` 24 | 25 | a Ruby-based Mustache implementation would process it such that it 26 | was equivalent to this Ruby hash: 27 | 28 | `{ 'x' => proc { "x" } }` 29 | 30 | * If your implementation language does not currently have lambda 31 | examples in the spec, feel free to implement them and send a pull 32 | request. 33 | 34 | * The JSON version of the spec represents these tagged values as a hash 35 | with a '`__tag__`' key of 'code'. 36 | 37 | 3. Render the template (stored in the 'template' key) with the given 'data' 38 | hash. 39 | 40 | 4. Compare the results of your rendering against the 'expected' value; any 41 | differences should be reported, along with any useful debugging 42 | information. 43 | 44 | * Of note, the 'desc' key contains a rough one-line description of the 45 | behavior being tested -- this is most useful in conjunction with the 46 | file name and test 'name'. 47 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec/specs/comments.json: -------------------------------------------------------------------------------- 1 | {"__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."}]} -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec/specs/comments.yml: -------------------------------------------------------------------------------- 1 | overview: | 2 | Comment tags represent content that should never appear in the resulting 3 | output. 4 | 5 | The tag's content may contain any substring (including newlines) EXCEPT the 6 | closing delimiter. 7 | 8 | Comment tags SHOULD be treated as standalone when appropriate. 9 | tests: 10 | - name: Inline 11 | desc: Comment blocks should be removed from the template. 12 | data: { } 13 | template: '12345{{! Comment Block! }}67890' 14 | expected: '1234567890' 15 | 16 | - name: Multiline 17 | desc: Multiline comments should be permitted. 18 | data: { } 19 | template: | 20 | 12345{{! 21 | This is a 22 | multi-line comment... 23 | }}67890 24 | expected: | 25 | 1234567890 26 | 27 | - name: Standalone 28 | desc: All standalone comment lines should be removed. 29 | data: { } 30 | template: | 31 | Begin. 32 | {{! Comment Block! }} 33 | End. 34 | expected: | 35 | Begin. 36 | End. 37 | 38 | - name: Indented Standalone 39 | desc: All standalone comment lines should be removed. 40 | data: { } 41 | template: | 42 | Begin. 43 | {{! Indented Comment Block! }} 44 | End. 45 | expected: | 46 | Begin. 47 | End. 48 | 49 | - name: Standalone Line Endings 50 | desc: '"\r\n" should be considered a newline for standalone tags.' 51 | data: { } 52 | template: "|\r\n{{! Standalone Comment }}\r\n|" 53 | expected: "|\r\n|" 54 | 55 | - name: Standalone Without Previous Line 56 | desc: Standalone tags should not require a newline to precede them. 57 | data: { } 58 | template: " {{! I'm Still Standalone }}\n!" 59 | expected: "!" 60 | 61 | - name: Standalone Without Newline 62 | desc: Standalone tags should not require a newline to follow them. 63 | data: { } 64 | template: "!\n {{! I'm Still Standalone }}" 65 | expected: "!\n" 66 | 67 | - name: Multiline Standalone 68 | desc: All standalone comment lines should be removed. 69 | data: { } 70 | template: | 71 | Begin. 72 | {{! 73 | Something's going on here... 74 | }} 75 | End. 76 | expected: | 77 | Begin. 78 | End. 79 | 80 | - name: Indented Multiline Standalone 81 | desc: All standalone comment lines should be removed. 82 | data: { } 83 | template: | 84 | Begin. 85 | {{! 86 | Something's going on here... 87 | }} 88 | End. 89 | expected: | 90 | Begin. 91 | End. 92 | 93 | - name: Indented Inline 94 | desc: Inline comments should not strip whitespace 95 | data: { } 96 | template: " 12 {{! 34 }}\n" 97 | expected: " 12 \n" 98 | 99 | - name: Surrounding Whitespace 100 | desc: Comment removal should preserve surrounding whitespace. 101 | data: { } 102 | template: '12345 {{! Comment Block! }} 67890' 103 | expected: '12345 67890' 104 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.json: -------------------------------------------------------------------------------- 1 | {"__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."}]} -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec/specs/partials.json: -------------------------------------------------------------------------------- 1 | {"__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":"[]"}}]} -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/spec/specs/partials.yml: -------------------------------------------------------------------------------- 1 | overview: | 2 | Partial tags are used to expand an external template into the current 3 | template. 4 | 5 | The tag's content MUST be a non-whitespace character sequence NOT containing 6 | the current closing delimiter. 7 | 8 | This tag's content names the partial to inject. Set Delimiter tags MUST NOT 9 | affect the parsing of a partial. The partial MUST be rendered against the 10 | context stack local to the tag. If the named partial cannot be found, the 11 | empty string SHOULD be used instead, as in interpolations. 12 | 13 | Partial tags SHOULD be treated as standalone when appropriate. If this tag 14 | is used standalone, any whitespace preceding the tag should treated as 15 | indentation, and prepended to each line of the partial before rendering. 16 | tests: 17 | - name: Basic Behavior 18 | desc: The greater-than operator should expand to the named partial. 19 | data: { } 20 | template: '"{{>text}}"' 21 | partials: { text: 'from partial' } 22 | expected: '"from partial"' 23 | 24 | - name: Failed Lookup 25 | desc: The empty string should be used when the named partial is not found. 26 | data: { } 27 | template: '"{{>text}}"' 28 | partials: { } 29 | expected: '""' 30 | 31 | - name: Context 32 | desc: The greater-than operator should operate within the current context. 33 | data: { text: 'content' } 34 | template: '"{{>partial}}"' 35 | partials: { partial: '*{{text}}*' } 36 | expected: '"*content*"' 37 | 38 | - name: Recursion 39 | desc: The greater-than operator should properly recurse. 40 | data: { content: "X", nodes: [ { content: "Y", nodes: [] } ] } 41 | template: '{{>node}}' 42 | partials: { node: '{{content}}<{{#nodes}}{{>node}}{{/nodes}}>' } 43 | expected: 'X>' 44 | 45 | # Whitespace Sensitivity 46 | 47 | - name: Surrounding Whitespace 48 | desc: The greater-than operator should not alter surrounding whitespace. 49 | data: { } 50 | template: '| {{>partial}} |' 51 | partials: { partial: "\t|\t" } 52 | expected: "| \t|\t |" 53 | 54 | - name: Inline Indentation 55 | desc: Whitespace should be left untouched. 56 | data: { data: '|' } 57 | template: " {{data}} {{> partial}}\n" 58 | partials: { partial: ">\n>" } 59 | expected: " | >\n>\n" 60 | 61 | - name: Standalone Line Endings 62 | desc: '"\r\n" should be considered a newline for standalone tags.' 63 | data: { } 64 | template: "|\r\n{{>partial}}\r\n|" 65 | partials: { partial: ">" } 66 | expected: "|\r\n>|" 67 | 68 | - name: Standalone Without Previous Line 69 | desc: Standalone tags should not require a newline to precede them. 70 | data: { } 71 | template: " {{>partial}}\n>" 72 | partials: { partial: ">\n>"} 73 | expected: " >\n >>" 74 | 75 | - name: Standalone Without Newline 76 | desc: Standalone tags should not require a newline to follow them. 77 | data: { } 78 | template: ">\n {{>partial}}" 79 | partials: { partial: ">\n>" } 80 | expected: ">\n >\n >" 81 | 82 | - name: Standalone Indentation 83 | desc: Each line of the partial should be indented before rendering. 84 | data: { content: "<\n->" } 85 | template: | 86 | \ 87 | {{>partial}} 88 | / 89 | partials: 90 | partial: | 91 | | 92 | {{{content}}} 93 | | 94 | expected: | 95 | \ 96 | | 97 | < 98 | -> 99 | | 100 | / 101 | 102 | # Whitespace Insensitivity 103 | 104 | - name: Padding Whitespace 105 | desc: Superfluous in-tag whitespace should be ignored. 106 | data: { boolean: true } 107 | template: "|{{> partial }}|" 108 | partials: { partial: "[]" } 109 | expected: '|[]|' 110 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/test/templates/list.mustache: -------------------------------------------------------------------------------- 1 |
      2 |
    • 3 |
    • 4 |
    • 5 |
    • 6 |
    • 7 |
    • 8 |
    -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/tools/release.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | var fs = require('fs'); 17 | var path = require('path'); 18 | var Hogan = require(__dirname + '/../lib/hogan'); 19 | var minlicense = '/**\n* @preserve Copyright 2012 Twitter, Inc.\n* @license http://www.apache.org/licenses/LICENSE-2.0.txt\n*/\n'; 20 | 21 | function read(path) { 22 | return fs.readFileSync(path).toString() 23 | } 24 | 25 | // Good enough for little js files 26 | function copy(src, dst) { 27 | return fs.writeFileSync(dst, read(src)); 28 | } 29 | 30 | function uglify(src, dst) { 31 | var jsp = require("uglify-js").parser; 32 | var pro = require("uglify-js").uglify; 33 | var orig_code = read(src); 34 | var ast = jsp.parse(orig_code); // parse code and get the initial AST 35 | ast = pro.ast_mangle(ast); // get a new AST with mangled names 36 | ast = pro.ast_squeeze(ast); // get an AST with compression optimizations 37 | fs.writeFileSync(dst, minlicense + pro.gen_code(ast)); 38 | } 39 | 40 | var packageJSON = JSON.parse(read('package.json')); 41 | var version = packageJSON.version.substring(0, packageJSON.version.indexOf('-')); 42 | 43 | function removeFirstComment(text) { 44 | return text.substring(text.indexOf('*/') + 2); 45 | } 46 | 47 | var context = { 48 | template: removeFirstComment(read(__dirname + '/../lib/template.js')), 49 | compiler: removeFirstComment(read(__dirname + '/../lib/compiler.js')) 50 | }; 51 | 52 | var wrapperPath = '/../wrappers/'; 53 | var wrappers = fs.readdirSync(__dirname + wrapperPath).map(function(f) { 54 | return __dirname + wrapperPath + f; 55 | }); 56 | 57 | var distPath = __dirname + '/../dist/'; 58 | wrappers.forEach(function(wrapper) { 59 | var tail = path.basename(wrapper, '.mustache'); 60 | var target = distPath + 'hogan-' + version + '.' + tail; 61 | var uglified = distPath + 'hogan-' + version + '.min.' + tail; 62 | fs.writeFileSync(target, Hogan.compile(read(wrapper)).render(context)); 63 | uglify(target, uglified); 64 | }); 65 | 66 | // Also release Hogan.Template on its own. 67 | var templateTarget = distPath + 'template-' + version + '.js'; 68 | fs.writeFileSync(templateTarget, read(__dirname + '/../lib/template.js')); 69 | uglify(templateTarget, distPath + 'template-' + version + '.min.js'); 70 | 71 | // Add packageJSON to node distribution 72 | packageJSON.version = version; 73 | fs.writeFileSync(__dirname + '/../dist/nodejs/package.json', 74 | JSON.stringify(packageJSON, null, " ")); 75 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/tools/web_templates.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | var Hogan = require(__dirname + '/../lib/hogan.js'); 17 | var fs = require('fs'); 18 | var path = require('path'); 19 | 20 | // Substitute variables in the homepage with values from package.json 21 | var homeTemplatePath = __dirname + '/../build/gh-pages/index.html.mustache'; 22 | var contextPath = __dirname + '/../dist/nodejs/package.json'; 23 | 24 | var homepage = fs.readFileSync(homeTemplatePath).toString(); 25 | var context = JSON.parse(fs.readFileSync(contextPath).toString()); 26 | 27 | var template = Hogan.compile(homepage); 28 | 29 | fs.writeFileSync(path.dirname(homeTemplatePath) + '/index.html', 30 | template.render(context)); 31 | 32 | fs.unlinkSync(homeTemplatePath); -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve Copyright 2012 Twitter, Inc. 3 | * @license http://www.apache.org/licenses/LICENSE-2.0.txt 4 | */ 5 | 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) -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/favicon.ico -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/images/logo.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/images/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/images/noise.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/images/small-hogan-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/images/small-hogan-icon.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/images/stripes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/docs/build/node_modules/hogan.js/web/images/stripes.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/wrappers/amd.js.mustache: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | {{{template}}} 17 | {{{compiler}}} 18 | 19 | if (typeof define === 'function' && define.amd) { 20 | define(Hogan); 21 | } 22 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/wrappers/common.js.mustache: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | {{{template}}} 17 | {{{compiler}}} 18 | 19 | if (typeof module !== 'undefined' && module.exports) { 20 | module.exports = Hogan; 21 | } 22 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/wrappers/js.mustache: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | {{{template}}} 17 | {{{compiler}}} 18 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/node_modules/hogan.js/wrappers/mustache.js.mustache: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | // A wrapper for compatibility with Mustache.js, quirks and all 17 | 18 | {{{template}}} 19 | {{{compiler}}} 20 | 21 | var Mustache = (function (Hogan) { 22 | 23 | // Mustache.js has non-spec partial context behavior 24 | function mustachePartial(name, context, partials, indent) { 25 | var partialScope = this.f(name, context, partials, 0); 26 | var cx = context; 27 | if (partialScope) { 28 | cx = cx.concat(partialScope); 29 | } 30 | 31 | return Hogan.Template.prototype.rp.call(this, name, cx, partials, indent); 32 | } 33 | 34 | var HoganTemplateWrapper = function(renderFunc, text, compiler){ 35 | this.rp = mustachePartial; 36 | Hogan.Template.call(this, renderFunc, text, compiler); 37 | }; 38 | HoganTemplateWrapper.prototype = Hogan.Template.prototype; 39 | 40 | // Add a wrapper for Hogan's generate method. Mustache and Hogan keep 41 | // separate caches, and Mustache returns wrapped templates. 42 | var wrapper; 43 | var HoganWrapper = function(){ 44 | this.cache = {}; 45 | this.generate = function(code, text, options) { 46 | return new HoganTemplateWrapper(new Function('c', 'p', 'i', code), text, wrapper); 47 | } 48 | }; 49 | HoganWrapper.prototype = Hogan; 50 | wrapper = new HoganWrapper(); 51 | 52 | return { 53 | to_html: function(text, data, partials, sendFun) { 54 | var template = wrapper.compile(text); 55 | var result = template.render(data, partials); 56 | if (!sendFun) { 57 | return result; 58 | } 59 | 60 | sendFun(result); 61 | } 62 | } 63 | 64 | })(Hogan); 65 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/build/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-doc-builder" 3 | , "version": "0.0.1" 4 | , "description": "build bootstrap docs" 5 | , "dependencies": { "hogan.js": "1.0.5-dev" } 6 | } 7 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/examples/starter-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bootstrap, from Twitter 6 | 7 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 52 | 53 |
    54 | 55 |

    Bootstrap starter template

    56 |

    Use this document as a way to quick start any new project.
    All you get is this message and a barebones HTML document.

    57 | 58 |
    59 | 60 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/docs/templates/pages/examples.mustache: -------------------------------------------------------------------------------- 1 | 3 |
    4 |

    {{_i}}Bootstrap examples{{/i}}

    5 |

    {{_i}}We've included a few basic examples as starting points for your work with Bootstrap. We encourage folks to iterate on these examples and not simply use them as an end result.{{/i}}

    6 |
    7 | 8 | 9 |
      10 |
    • 11 | 12 | 13 | 14 |

      {{_i}}Basic marketing site{{/i}}

      15 |

      {{_i}}Featuring a hero unit for a primary message and three supporting elements.{{/i}}

      16 |
    • 17 |
    • 18 | 19 | 20 | 21 |

      {{_i}}Fluid layout{{/i}}

      22 |

      {{_i}}Uses our new responsive, fluid grid system to create seamless liquid layout.{{/i}}

      23 |
    • 24 |
    • 25 | 26 | 27 | 28 |

      {{_i}}Starter template{{/i}}

      29 |

      {{_i}}A barebones HTML document with all the Bootstrap CSS and javascript included.{{/i}}

      30 |
    • 31 |
    32 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samwillis/pagedown-bootstrap/e610161c04cddf03a614991d2a8c7617c1c264ab/demo/browser/bootstrap/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/README.md: -------------------------------------------------------------------------------- 1 | ## 2.0 BOOTSTRAP JS PHILOSOPHY 2 | These are the high-level design rules which guide the development of Bootstrap's plugin apis. 3 | 4 | --- 5 | 6 | ### DATA-ATTRIBUTE API 7 | 8 | We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript. 9 | 10 | We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this: 11 | 12 | $('body').off('.data-api') 13 | 14 | To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this: 15 | 16 | $('body').off('.alert.data-api') 17 | 18 | --- 19 | 20 | ### PROGRAMATIC API 21 | 22 | We also believe you should be able to use all plugins provided by Bootstrap purely through the JS API. 23 | 24 | All public APIs should be single, chainable methods, and return the collection acted upon. 25 | 26 | $(".btn.danger").button("toggle").addClass("fat") 27 | 28 | All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior: 29 | 30 | $("#myModal").modal() // initialized with defaults 31 | $("#myModal").modal({ keyboard: false }) // initialized with now keyboard 32 | $("#myModal").modal('show') // initializes and invokes show immediately afterqwe2 33 | 34 | --- 35 | 36 | ### OPTIONS 37 | 38 | Options should be sparse and add universal value. We should pick the right defaults. 39 | 40 | All plugins should have a default object which can be modified to affect all instances' default options. The defaults object should be available via `$.fn.plugin.defaults`. 41 | 42 | $.fn.modal.defaults = { … } 43 | 44 | An options definition should take the following form: 45 | 46 | *noun*: *adjective* - describes or modifies a quality of an instance 47 | 48 | examples: 49 | 50 | backdrop: true 51 | keyboard: false 52 | placement: 'top' 53 | 54 | --- 55 | 56 | ### EVENTS 57 | 58 | All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action. 59 | 60 | show | shown 61 | hide | hidden 62 | 63 | --- 64 | 65 | ### CONSTRUCTORS 66 | 67 | Each plugin should expose its raw constructor on a `Constructor` property -- accessed in the following way: 68 | 69 | 70 | $.fn.popover.Constructor 71 | 72 | --- 73 | 74 | ### DATA ACCESSOR 75 | 76 | Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this: 77 | 78 | $('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor 79 | 80 | --- 81 | 82 | ### DATA ATTRIBUTES 83 | 84 | Data attributes should take the following form: 85 | 86 | - data-{{verb}}={{plugin}} - defines main interaction 87 | - data-target || href^=# - defined on "control" element (if element controls an element other than self) 88 | - data-{{noun}} - defines class instance options 89 | 90 | examples: 91 | 92 | // control other targets 93 | data-toggle="modal" data-target="#foo" 94 | data-toggle="collapse" data-target="#foo" data-parent="#bar" 95 | 96 | // defined on element they control 97 | data-spy="scroll" 98 | 99 | data-dismiss="modal" 100 | data-dismiss="alert" 101 | 102 | data-toggle="dropdown" 103 | 104 | data-toggle="button" 105 | data-toggle="buttons-checkbox" 106 | data-toggle="buttons-radio" -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/bootstrap-alert.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * bootstrap-alert.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#alerts 4 | * ========================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function( $ ){ 22 | 23 | "use strict" 24 | 25 | /* ALERT CLASS DEFINITION 26 | * ====================== */ 27 | 28 | var dismiss = '[data-dismiss="alert"]' 29 | , Alert = function ( el ) { 30 | $(el).on('click', dismiss, this.close) 31 | } 32 | 33 | Alert.prototype = { 34 | 35 | constructor: Alert 36 | 37 | , close: function ( e ) { 38 | var $this = $(this) 39 | , selector = $this.attr('data-target') 40 | , $parent 41 | 42 | if (!selector) { 43 | selector = $this.attr('href') 44 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 45 | } 46 | 47 | $parent = $(selector) 48 | $parent.trigger('close') 49 | 50 | e && e.preventDefault() 51 | 52 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) 53 | 54 | $parent 55 | .trigger('close') 56 | .removeClass('in') 57 | 58 | function removeElement() { 59 | $parent 60 | .trigger('closed') 61 | .remove() 62 | } 63 | 64 | $.support.transition && $parent.hasClass('fade') ? 65 | $parent.on($.support.transition.end, removeElement) : 66 | removeElement() 67 | } 68 | 69 | } 70 | 71 | 72 | /* ALERT PLUGIN DEFINITION 73 | * ======================= */ 74 | 75 | $.fn.alert = function ( option ) { 76 | return this.each(function () { 77 | var $this = $(this) 78 | , data = $this.data('alert') 79 | if (!data) $this.data('alert', (data = new Alert(this))) 80 | if (typeof option == 'string') data[option].call($this) 81 | }) 82 | } 83 | 84 | $.fn.alert.Constructor = Alert 85 | 86 | 87 | /* ALERT DATA-API 88 | * ============== */ 89 | 90 | $(function () { 91 | $('body').on('click.alert.data-api', dismiss, Alert.prototype.close) 92 | }) 93 | 94 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/bootstrap-button.js: -------------------------------------------------------------------------------- 1 | /* ============================================================ 2 | * bootstrap-button.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#buttons 4 | * ============================================================ 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | !function( $ ){ 21 | 22 | "use strict" 23 | 24 | /* BUTTON PUBLIC CLASS DEFINITION 25 | * ============================== */ 26 | 27 | var Button = function ( element, options ) { 28 | this.$element = $(element) 29 | this.options = $.extend({}, $.fn.button.defaults, options) 30 | } 31 | 32 | Button.prototype = { 33 | 34 | constructor: Button 35 | 36 | , setState: function ( state ) { 37 | var d = 'disabled' 38 | , $el = this.$element 39 | , data = $el.data() 40 | , val = $el.is('input') ? 'val' : 'html' 41 | 42 | state = state + 'Text' 43 | data.resetText || $el.data('resetText', $el[val]()) 44 | 45 | $el[val](data[state] || this.options[state]) 46 | 47 | // push to event loop to allow forms to submit 48 | setTimeout(function () { 49 | state == 'loadingText' ? 50 | $el.addClass(d).attr(d, d) : 51 | $el.removeClass(d).removeAttr(d) 52 | }, 0) 53 | } 54 | 55 | , toggle: function () { 56 | var $parent = this.$element.parent('[data-toggle="buttons-radio"]') 57 | 58 | $parent && $parent 59 | .find('.active') 60 | .removeClass('active') 61 | 62 | this.$element.toggleClass('active') 63 | } 64 | 65 | } 66 | 67 | 68 | /* BUTTON PLUGIN DEFINITION 69 | * ======================== */ 70 | 71 | $.fn.button = function ( option ) { 72 | return this.each(function () { 73 | var $this = $(this) 74 | , data = $this.data('button') 75 | , options = typeof option == 'object' && option 76 | if (!data) $this.data('button', (data = new Button(this, options))) 77 | if (option == 'toggle') data.toggle() 78 | else if (option) data.setState(option) 79 | }) 80 | } 81 | 82 | $.fn.button.defaults = { 83 | loadingText: 'loading...' 84 | } 85 | 86 | $.fn.button.Constructor = Button 87 | 88 | 89 | /* BUTTON DATA-API 90 | * =============== */ 91 | 92 | $(function () { 93 | $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) { 94 | var $btn = $(e.target) 95 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 96 | $btn.button('toggle') 97 | }) 98 | }) 99 | 100 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/bootstrap-collapse.js: -------------------------------------------------------------------------------- 1 | /* ============================================================= 2 | * bootstrap-collapse.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#collapse 4 | * ============================================================= 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | !function( $ ){ 21 | 22 | "use strict" 23 | 24 | var Collapse = function ( element, options ) { 25 | this.$element = $(element) 26 | this.options = $.extend({}, $.fn.collapse.defaults, options) 27 | 28 | if (this.options["parent"]) { 29 | this.$parent = $(this.options["parent"]) 30 | } 31 | 32 | this.options.toggle && this.toggle() 33 | } 34 | 35 | Collapse.prototype = { 36 | 37 | constructor: Collapse 38 | 39 | , dimension: function () { 40 | var hasWidth = this.$element.hasClass('width') 41 | return hasWidth ? 'width' : 'height' 42 | } 43 | 44 | , show: function () { 45 | var dimension = this.dimension() 46 | , scroll = $.camelCase(['scroll', dimension].join('-')) 47 | , actives = this.$parent && this.$parent.find('.in') 48 | , hasData 49 | 50 | if (actives && actives.length) { 51 | hasData = actives.data('collapse') 52 | actives.collapse('hide') 53 | hasData || actives.data('collapse', null) 54 | } 55 | 56 | this.$element[dimension](0) 57 | this.transition('addClass', 'show', 'shown') 58 | this.$element[dimension](this.$element[0][scroll]) 59 | 60 | } 61 | 62 | , hide: function () { 63 | var dimension = this.dimension() 64 | this.reset(this.$element[dimension]()) 65 | this.transition('removeClass', 'hide', 'hidden') 66 | this.$element[dimension](0) 67 | } 68 | 69 | , reset: function ( size ) { 70 | var dimension = this.dimension() 71 | 72 | this.$element 73 | .removeClass('collapse') 74 | [dimension](size || 'auto') 75 | [0].offsetWidth 76 | 77 | this.$element.addClass('collapse') 78 | } 79 | 80 | , transition: function ( method, startEvent, completeEvent ) { 81 | var that = this 82 | , complete = function () { 83 | if (startEvent == 'show') that.reset() 84 | that.$element.trigger(completeEvent) 85 | } 86 | 87 | this.$element 88 | .trigger(startEvent) 89 | [method]('in') 90 | 91 | $.support.transition && this.$element.hasClass('collapse') ? 92 | this.$element.one($.support.transition.end, complete) : 93 | complete() 94 | } 95 | 96 | , toggle: function () { 97 | this[this.$element.hasClass('in') ? 'hide' : 'show']() 98 | } 99 | 100 | } 101 | 102 | /* COLLAPSIBLE PLUGIN DEFINITION 103 | * ============================== */ 104 | 105 | $.fn.collapse = function ( option ) { 106 | return this.each(function () { 107 | var $this = $(this) 108 | , data = $this.data('collapse') 109 | , options = typeof option == 'object' && option 110 | if (!data) $this.data('collapse', (data = new Collapse(this, options))) 111 | if (typeof option == 'string') data[option]() 112 | }) 113 | } 114 | 115 | $.fn.collapse.defaults = { 116 | toggle: true 117 | } 118 | 119 | $.fn.collapse.Constructor = Collapse 120 | 121 | 122 | /* COLLAPSIBLE DATA-API 123 | * ==================== */ 124 | 125 | $(function () { 126 | $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) { 127 | var $this = $(this), href 128 | , target = $this.attr('data-target') 129 | || e.preventDefault() 130 | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 131 | , option = $(target).data('collapse') ? 'toggle' : $this.data() 132 | $(target).collapse(option) 133 | }) 134 | }) 135 | 136 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/bootstrap-dropdown.js: -------------------------------------------------------------------------------- 1 | /* ============================================================ 2 | * bootstrap-dropdown.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns 4 | * ============================================================ 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | 21 | !function( $ ){ 22 | 23 | "use strict" 24 | 25 | /* DROPDOWN CLASS DEFINITION 26 | * ========================= */ 27 | 28 | var toggle = '[data-toggle="dropdown"]' 29 | , Dropdown = function ( element ) { 30 | var $el = $(element).on('click.dropdown.data-api', this.toggle) 31 | $('html').on('click.dropdown.data-api', function () { 32 | $el.parent().removeClass('open') 33 | }) 34 | } 35 | 36 | Dropdown.prototype = { 37 | 38 | constructor: Dropdown 39 | 40 | , toggle: function ( e ) { 41 | var $this = $(this) 42 | , selector = $this.attr('data-target') 43 | , $parent 44 | , isActive 45 | 46 | if (!selector) { 47 | selector = $this.attr('href') 48 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 49 | } 50 | 51 | $parent = $(selector) 52 | $parent.length || ($parent = $this.parent()) 53 | 54 | isActive = $parent.hasClass('open') 55 | 56 | clearMenus() 57 | !isActive && $parent.toggleClass('open') 58 | 59 | return false 60 | } 61 | 62 | } 63 | 64 | function clearMenus() { 65 | $(toggle).parent().removeClass('open') 66 | } 67 | 68 | 69 | /* DROPDOWN PLUGIN DEFINITION 70 | * ========================== */ 71 | 72 | $.fn.dropdown = function ( option ) { 73 | return this.each(function () { 74 | var $this = $(this) 75 | , data = $this.data('dropdown') 76 | if (!data) $this.data('dropdown', (data = new Dropdown(this))) 77 | if (typeof option == 'string') data[option].call($this) 78 | }) 79 | } 80 | 81 | $.fn.dropdown.Constructor = Dropdown 82 | 83 | 84 | /* APPLY TO STANDARD DROPDOWN ELEMENTS 85 | * =================================== */ 86 | 87 | $(function () { 88 | $('html').on('click.dropdown.data-api', clearMenus) 89 | $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) 90 | }) 91 | 92 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/bootstrap-popover.js: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * bootstrap-popover.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#popovers 4 | * =========================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * =========================================================== */ 19 | 20 | 21 | !function( $ ) { 22 | 23 | "use strict" 24 | 25 | var Popover = function ( element, options ) { 26 | this.init('popover', element, options) 27 | } 28 | 29 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js 30 | ========================================== */ 31 | 32 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { 33 | 34 | constructor: Popover 35 | 36 | , setContent: function () { 37 | var $tip = this.tip() 38 | , title = this.getTitle() 39 | , content = this.getContent() 40 | 41 | $tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title) 42 | $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content) 43 | 44 | $tip.removeClass('fade top bottom left right in') 45 | } 46 | 47 | , hasContent: function () { 48 | return this.getTitle() || this.getContent() 49 | } 50 | 51 | , getContent: function () { 52 | var content 53 | , $e = this.$element 54 | , o = this.options 55 | 56 | content = $e.attr('data-content') 57 | || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) 58 | 59 | content = content.toString().replace(/(^\s*|\s*$)/, "") 60 | 61 | return content 62 | } 63 | 64 | , tip: function() { 65 | if (!this.$tip) { 66 | this.$tip = $(this.options.template) 67 | } 68 | return this.$tip 69 | } 70 | 71 | }) 72 | 73 | 74 | /* POPOVER PLUGIN DEFINITION 75 | * ======================= */ 76 | 77 | $.fn.popover = function ( option ) { 78 | return this.each(function () { 79 | var $this = $(this) 80 | , data = $this.data('popover') 81 | , options = typeof option == 'object' && option 82 | if (!data) $this.data('popover', (data = new Popover(this, options))) 83 | if (typeof option == 'string') data[option]() 84 | }) 85 | } 86 | 87 | $.fn.popover.Constructor = Popover 88 | 89 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { 90 | placement: 'right' 91 | , content: '' 92 | , template: '

    ' 93 | }) 94 | 95 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/bootstrap-scrollspy.js: -------------------------------------------------------------------------------- 1 | /* ============================================================= 2 | * bootstrap-scrollspy.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#scrollspy 4 | * ============================================================= 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================== */ 19 | 20 | !function ( $ ) { 21 | 22 | "use strict" 23 | 24 | /* SCROLLSPY CLASS DEFINITION 25 | * ========================== */ 26 | 27 | function ScrollSpy( element, options) { 28 | var process = $.proxy(this.process, this) 29 | , $element = $(element).is('body') ? $(window) : $(element) 30 | , href 31 | this.options = $.extend({}, $.fn.scrollspy.defaults, options) 32 | this.$scrollElement = $element.on('scroll.scroll.data-api', process) 33 | this.selector = (this.options.target 34 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 35 | || '') + ' .nav li > a' 36 | this.$body = $('body').on('click.scroll.data-api', this.selector, process) 37 | this.refresh() 38 | this.process() 39 | } 40 | 41 | ScrollSpy.prototype = { 42 | 43 | constructor: ScrollSpy 44 | 45 | , refresh: function () { 46 | this.targets = this.$body 47 | .find(this.selector) 48 | .map(function () { 49 | var href = $(this).attr('href') 50 | return /^#\w/.test(href) && $(href).length ? href : null 51 | }) 52 | 53 | this.offsets = $.map(this.targets, function (id) { 54 | return $(id).position().top 55 | }) 56 | } 57 | 58 | , process: function () { 59 | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 60 | , offsets = this.offsets 61 | , targets = this.targets 62 | , activeTarget = this.activeTarget 63 | , i 64 | 65 | for (i = offsets.length; i--;) { 66 | activeTarget != targets[i] 67 | && scrollTop >= offsets[i] 68 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) 69 | && this.activate( targets[i] ) 70 | } 71 | } 72 | 73 | , activate: function (target) { 74 | var active 75 | 76 | this.activeTarget = target 77 | 78 | this.$body 79 | .find(this.selector).parent('.active') 80 | .removeClass('active') 81 | 82 | active = this.$body 83 | .find(this.selector + '[href="' + target + '"]') 84 | .parent('li') 85 | .addClass('active') 86 | 87 | if ( active.parent('.dropdown-menu') ) { 88 | active.closest('li.dropdown').addClass('active') 89 | } 90 | } 91 | 92 | } 93 | 94 | 95 | /* SCROLLSPY PLUGIN DEFINITION 96 | * =========================== */ 97 | 98 | $.fn.scrollspy = function ( option ) { 99 | return this.each(function () { 100 | var $this = $(this) 101 | , data = $this.data('scrollspy') 102 | , options = typeof option == 'object' && option 103 | if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options))) 104 | if (typeof option == 'string') data[option]() 105 | }) 106 | } 107 | 108 | $.fn.scrollspy.Constructor = ScrollSpy 109 | 110 | $.fn.scrollspy.defaults = { 111 | offset: 10 112 | } 113 | 114 | 115 | /* SCROLLSPY DATA-API 116 | * ================== */ 117 | 118 | $(function () { 119 | $('[data-spy="scroll"]').each(function () { 120 | var $spy = $(this) 121 | $spy.scrollspy($spy.data()) 122 | }) 123 | }) 124 | 125 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/bootstrap-tab.js: -------------------------------------------------------------------------------- 1 | /* ======================================================== 2 | * bootstrap-tab.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#tabs 4 | * ======================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ======================================================== */ 19 | 20 | 21 | !function( $ ){ 22 | 23 | "use strict" 24 | 25 | /* TAB CLASS DEFINITION 26 | * ==================== */ 27 | 28 | var Tab = function ( element ) { 29 | this.element = $(element) 30 | } 31 | 32 | Tab.prototype = { 33 | 34 | constructor: Tab 35 | 36 | , show: function () { 37 | var $this = this.element 38 | , $ul = $this.closest('ul:not(.dropdown-menu)') 39 | , selector = $this.attr('data-target') 40 | , previous 41 | , $target 42 | 43 | if (!selector) { 44 | selector = $this.attr('href') 45 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 46 | } 47 | 48 | if ( $this.parent('li').hasClass('active') ) return 49 | 50 | previous = $ul.find('.active a').last()[0] 51 | 52 | $this.trigger({ 53 | type: 'show' 54 | , relatedTarget: previous 55 | }) 56 | 57 | $target = $(selector) 58 | 59 | this.activate($this.parent('li'), $ul) 60 | this.activate($target, $target.parent(), function () { 61 | $this.trigger({ 62 | type: 'shown' 63 | , relatedTarget: previous 64 | }) 65 | }) 66 | } 67 | 68 | , activate: function ( element, container, callback) { 69 | var $active = container.find('> .active') 70 | , transition = callback 71 | && $.support.transition 72 | && $active.hasClass('fade') 73 | 74 | function next() { 75 | $active 76 | .removeClass('active') 77 | .find('> .dropdown-menu > .active') 78 | .removeClass('active') 79 | 80 | element.addClass('active') 81 | 82 | if (transition) { 83 | element[0].offsetWidth // reflow for transition 84 | element.addClass('in') 85 | } else { 86 | element.removeClass('fade') 87 | } 88 | 89 | if ( element.parent('.dropdown-menu') ) { 90 | element.closest('li.dropdown').addClass('active') 91 | } 92 | 93 | callback && callback() 94 | } 95 | 96 | transition ? 97 | $active.one($.support.transition.end, next) : 98 | next() 99 | 100 | $active.removeClass('in') 101 | } 102 | } 103 | 104 | 105 | /* TAB PLUGIN DEFINITION 106 | * ===================== */ 107 | 108 | $.fn.tab = function ( option ) { 109 | return this.each(function () { 110 | var $this = $(this) 111 | , data = $this.data('tab') 112 | if (!data) $this.data('tab', (data = new Tab(this))) 113 | if (typeof option == 'string') data[option]() 114 | }) 115 | } 116 | 117 | $.fn.tab.Constructor = Tab 118 | 119 | 120 | /* TAB DATA-API 121 | * ============ */ 122 | 123 | $(function () { 124 | $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { 125 | e.preventDefault() 126 | $(this).tab('show') 127 | }) 128 | }) 129 | 130 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/bootstrap-transition.js: -------------------------------------------------------------------------------- 1 | /* =================================================== 2 | * bootstrap-transition.js v2.0.1 3 | * http://twitter.github.com/bootstrap/javascript.html#transitions 4 | * =================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | !function( $ ) { 21 | 22 | $(function () { 23 | 24 | "use strict" 25 | 26 | /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) 27 | * ======================================================= */ 28 | 29 | $.support.transition = (function () { 30 | var thisBody = document.body || document.documentElement 31 | , thisStyle = thisBody.style 32 | , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined 33 | 34 | return support && { 35 | end: (function () { 36 | var transitionEnd = "TransitionEnd" 37 | if ( $.browser.webkit ) { 38 | transitionEnd = "webkitTransitionEnd" 39 | } else if ( $.browser.mozilla ) { 40 | transitionEnd = "transitionend" 41 | } else if ( $.browser.opera ) { 42 | transitionEnd = "oTransitionEnd" 43 | } 44 | return transitionEnd 45 | }()) 46 | } 47 | })() 48 | 49 | }) 50 | 51 | }( window.jQuery ); -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bootstrap Plugin Test Suite 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 |
    42 |

    Bootstrap Plugin Test Suite

    43 |

    44 |

    45 |
      46 |
      47 |
      48 | 49 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-alert.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-alerts") 4 | 5 | test("should be defined on jquery object", function () { 6 | ok($(document.body).alert, 'alert method is defined') 7 | }) 8 | 9 | test("should return element", function () { 10 | ok($(document.body).alert()[0] == document.body, 'document.body returned') 11 | }) 12 | 13 | test("should fade element out on clicking .close", function () { 14 | var alertHTML = '
      ' 15 | + '×' 16 | + '

      Holy guacamole! Best check yo self, you\'re not looking too good.

      ' 17 | + '
      ' 18 | , alert = $(alertHTML).alert() 19 | 20 | alert.find('.close').click() 21 | 22 | ok(!alert.hasClass('in'), 'remove .in class on .close click') 23 | }) 24 | 25 | test("should remove element when clicking .close", function () { 26 | $.support.transition = false 27 | 28 | var alertHTML = '
      ' 29 | + '×' 30 | + '

      Holy guacamole! Best check yo self, you\'re not looking too good.

      ' 31 | + '
      ' 32 | , alert = $(alertHTML).appendTo('#qunit-fixture').alert() 33 | 34 | ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom') 35 | 36 | alert.find('.close').click() 37 | 38 | ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom') 39 | }) 40 | 41 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-button.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-buttons") 4 | 5 | test("should be defined on jquery object", function () { 6 | ok($(document.body).button, 'button method is defined') 7 | }) 8 | 9 | test("should return element", function () { 10 | ok($(document.body).button()[0] == document.body, 'document.body returned') 11 | }) 12 | 13 | test("should return set state to loading", function () { 14 | var btn = $('') 15 | equals(btn.html(), 'mdo', 'btn text equals mdo') 16 | btn.button('loading') 17 | equals(btn.html(), 'fat', 'btn text equals fat') 18 | stop() 19 | setTimeout(function () { 20 | ok(btn.attr('disabled'), 'btn is disabled') 21 | ok(btn.hasClass('disabled'), 'btn has disabled class') 22 | start() 23 | }, 0) 24 | }) 25 | 26 | test("should return reset state", function () { 27 | var btn = $('') 28 | equals(btn.html(), 'mdo', 'btn text equals mdo') 29 | btn.button('loading') 30 | equals(btn.html(), 'fat', 'btn text equals fat') 31 | stop() 32 | setTimeout(function () { 33 | ok(btn.attr('disabled'), 'btn is disabled') 34 | ok(btn.hasClass('disabled'), 'btn has disabled class') 35 | start() 36 | stop() 37 | }, 0) 38 | btn.button('reset') 39 | equals(btn.html(), 'mdo', 'btn text equals mdo') 40 | setTimeout(function () { 41 | ok(!btn.attr('disabled'), 'btn is not disabled') 42 | ok(!btn.hasClass('disabled'), 'btn does not have disabled class') 43 | start() 44 | }, 0) 45 | }) 46 | 47 | test("should toggle active", function () { 48 | var btn = $('') 49 | ok(!btn.hasClass('active'), 'btn does not have active class') 50 | btn.button('toggle') 51 | ok(btn.hasClass('active'), 'btn has class active') 52 | }) 53 | 54 | test("should toggle active when btn children are clicked", function () { 55 | var btn = $('') 56 | , inner = $('') 57 | btn 58 | .append(inner) 59 | .appendTo($('#qunit-fixture')) 60 | ok(!btn.hasClass('active'), 'btn does not have active class') 61 | inner.click() 62 | ok(btn.hasClass('active'), 'btn has class active') 63 | }) 64 | 65 | test("should toggle active when btn children are clicked within btn-group", function () { 66 | var btngroup = $('
      ') 67 | , btn = $('') 68 | , inner = $('') 69 | btngroup 70 | .append(btn.append(inner)) 71 | .appendTo($('#qunit-fixture')) 72 | ok(!btn.hasClass('active'), 'btn does not have active class') 73 | inner.click() 74 | ok(btn.hasClass('active'), 'btn has class active') 75 | }) 76 | 77 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-collapse.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-collapse") 4 | 5 | test("should be defined on jquery object", function () { 6 | ok($(document.body).collapse, 'collapse method is defined') 7 | }) 8 | 9 | test("should return element", function () { 10 | ok($(document.body).collapse()[0] == document.body, 'document.body returned') 11 | }) 12 | 13 | test("should show a collapsed element", function () { 14 | var el = $('
      ').collapse('show') 15 | ok(el.hasClass('in'), 'has class in') 16 | ok(/height/.test(el.attr('style')), 'has height set') 17 | }) 18 | 19 | test("should hide a collapsed element", function () { 20 | var el = $('
      ').collapse('hide') 21 | ok(!el.hasClass('in'), 'does not have class in') 22 | ok(/height/.test(el.attr('style')), 'has height set') 23 | }) 24 | 25 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-dropdown.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-dropdowns") 4 | 5 | test("should be defined on jquery object", function () { 6 | ok($(document.body).dropdown, 'dropdown method is defined') 7 | }) 8 | 9 | test("should return element", function () { 10 | ok($(document.body).dropdown()[0] == document.body, 'document.body returned') 11 | }) 12 | 13 | test("should add class open to menu if clicked", function () { 14 | var dropdownHTML = '' 25 | , dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click() 26 | 27 | ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') 28 | }) 29 | 30 | test("should remove open class if body clicked", function () { 31 | var dropdownHTML = '' 42 | , dropdown = $(dropdownHTML) 43 | .appendTo('#qunit-fixture') 44 | .find('[data-toggle="dropdown"]') 45 | .dropdown() 46 | .click() 47 | ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click') 48 | $('body').click() 49 | ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class removed') 50 | dropdown.remove() 51 | }) 52 | 53 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-modal.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-modal") 4 | 5 | test("should be defined on jquery object", function () { 6 | var div = $("") 7 | ok(div.modal, 'modal method is defined') 8 | }) 9 | 10 | test("should return element", function () { 11 | var div = $("") 12 | ok(div.modal() == div, 'document.body returned') 13 | $('#modal-test').remove() 14 | }) 15 | 16 | test("should expose defaults var for settings", function () { 17 | ok($.fn.modal.defaults, 'default object exposed') 18 | }) 19 | 20 | test("should insert into dom when show method is called", function () { 21 | stop() 22 | $.support.transition = false 23 | $("") 24 | .bind("shown", function () { 25 | ok($('#modal-test').length, 'modal insterted into dom') 26 | $(this).remove() 27 | start() 28 | }) 29 | .modal("show") 30 | }) 31 | 32 | test("should hide modal when hide is called", function () { 33 | stop() 34 | $.support.transition = false 35 | 36 | $("") 37 | .bind("shown", function () { 38 | ok($('#modal-test').is(":visible"), 'modal visible') 39 | ok($('#modal-test').length, 'modal insterted into dom') 40 | $(this).modal("hide") 41 | }) 42 | .bind("hidden", function() { 43 | ok(!$('#modal-test').is(":visible"), 'modal hidden') 44 | $('#modal-test').remove() 45 | start() 46 | }) 47 | .modal("show") 48 | }) 49 | 50 | test("should toggle when toggle is called", function () { 51 | stop() 52 | $.support.transition = false 53 | var div = $("") 54 | div 55 | .bind("shown", function () { 56 | ok($('#modal-test').is(":visible"), 'modal visible') 57 | ok($('#modal-test').length, 'modal insterted into dom') 58 | div.modal("toggle") 59 | }) 60 | .bind("hidden", function() { 61 | ok(!$('#modal-test').is(":visible"), 'modal hidden') 62 | div.remove() 63 | start() 64 | }) 65 | .modal("toggle") 66 | }) 67 | 68 | test("should remove from dom when click [data-dismiss=modal]", function () { 69 | stop() 70 | $.support.transition = false 71 | var div = $("") 72 | div 73 | .bind("shown", function () { 74 | ok($('#modal-test').is(":visible"), 'modal visible') 75 | ok($('#modal-test').length, 'modal insterted into dom') 76 | div.find('.close').click() 77 | }) 78 | .bind("hidden", function() { 79 | ok(!$('#modal-test').is(":visible"), 'modal hidden') 80 | div.remove() 81 | start() 82 | }) 83 | .modal("toggle") 84 | }) 85 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-popover.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-popover") 4 | 5 | test("should be defined on jquery object", function () { 6 | var div = $('
      ') 7 | ok(div.popover, 'popover method is defined') 8 | }) 9 | 10 | test("should return element", function () { 11 | var div = $('
      ') 12 | ok(div.popover() == div, 'document.body returned') 13 | }) 14 | 15 | test("should render popover element", function () { 16 | $.support.transition = false 17 | var popover = $('@mdo') 18 | .appendTo('#qunit-fixture') 19 | .popover('show') 20 | 21 | ok($('.popover').length, 'popover was inserted') 22 | popover.popover('hide') 23 | ok(!$(".popover").length, 'popover removed') 24 | }) 25 | 26 | test("should store popover instance in popover data object", function () { 27 | $.support.transition = false 28 | var popover = $('@mdo') 29 | .popover() 30 | 31 | ok(!!popover.data('popover'), 'popover instance exists') 32 | }) 33 | 34 | test("should get title and content from options", function () { 35 | $.support.transition = false 36 | var popover = $('@fat') 37 | .appendTo('#qunit-fixture') 38 | .popover({ 39 | title: function () { 40 | return '@fat' 41 | } 42 | , content: function () { 43 | return 'loves writing tests (╯°□°)╯︵ ┻━┻' 44 | } 45 | }) 46 | 47 | popover.popover('show') 48 | 49 | ok($('.popover').length, 'popover was inserted') 50 | equals($('.popover .popover-title').text(), '@fat', 'title correctly inserted') 51 | equals($('.popover .popover-content').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted') 52 | 53 | popover.popover('hide') 54 | ok(!$('.popover').length, 'popover was removed') 55 | $('#qunit-fixture').empty() 56 | }) 57 | 58 | test("should get title and content from attributes", function () { 59 | $.support.transition = false 60 | var popover = $('@mdo') 61 | .appendTo('#qunit-fixture') 62 | .popover() 63 | .popover('show') 64 | 65 | ok($('.popover').length, 'popover was inserted') 66 | equals($('.popover .popover-title').text(), '@mdo', 'title correctly inserted') 67 | equals($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted') 68 | 69 | popover.popover('hide') 70 | ok(!$('.popover').length, 'popover was removed') 71 | $('#qunit-fixture').empty() 72 | }) 73 | 74 | test("should respect custom classes", function() { 75 | $.support.transition = false 76 | var popover = $('@fat') 77 | .appendTo('#qunit-fixture') 78 | .popover({ 79 | title: 'Test' 80 | , content: 'Test' 81 | , template: '

      ' 82 | }) 83 | 84 | popover.popover('show') 85 | 86 | ok($('.popover').length, 'popover was inserted') 87 | ok($('.popover').hasClass('foobar'), 'custom class is present') 88 | 89 | popover.popover('hide') 90 | ok(!$('.popover').length, 'popover was removed') 91 | $('#qunit-fixture').empty() 92 | }) 93 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-scrollspy.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-scrollspy") 4 | 5 | test("should be defined on jquery object", function () { 6 | ok($(document.body).scrollspy, 'scrollspy method is defined') 7 | }) 8 | 9 | test("should return element", function () { 10 | ok($(document.body).scrollspy()[0] == document.body, 'document.body returned') 11 | }) 12 | 13 | test("should switch active class on scroll", function () { 14 | var sectionHTML = '
      ' 15 | , $section = $(sectionHTML).append('#qunit-fixture') 16 | , topbarHTML ='
      ' 17 | + '
      ' 18 | + '
      ' 19 | + '

      Bootstrap

      ' 20 | + '' 23 | + '
      ' 24 | + '
      ' 25 | + '
      ' 26 | , $topbar = $(topbarHTML).scrollspy() 27 | 28 | ok($topbar.find('.active', true)) 29 | }) 30 | 31 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-tab.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-tabs") 4 | 5 | test("should be defined on jquery object", function () { 6 | ok($(document.body).tab, 'tabs method is defined') 7 | }) 8 | 9 | test("should return element", function () { 10 | ok($(document.body).tab()[0] == document.body, 'document.body returned') 11 | }) 12 | 13 | test("should activate element by tab id", function () { 14 | var tabsHTML = 15 | '' 19 | 20 | $('
      ').appendTo("#qunit-fixture") 21 | 22 | $(tabsHTML).find('li:last a').tab('show') 23 | equals($("#qunit-fixture").find('.active').attr('id'), "profile") 24 | 25 | $(tabsHTML).find('li:first a').tab('show') 26 | equals($("#qunit-fixture").find('.active').attr('id'), "home") 27 | }) 28 | 29 | test("should activate element by tab id", function () { 30 | var pillsHTML = 31 | '' 35 | 36 | $('
      ').appendTo("#qunit-fixture") 37 | 38 | $(pillsHTML).find('li:last a').tab('show') 39 | equals($("#qunit-fixture").find('.active').attr('id'), "profile") 40 | 41 | $(pillsHTML).find('li:first a').tab('show') 42 | equals($("#qunit-fixture").find('.active').attr('id'), "home") 43 | }) 44 | 45 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-tooltip.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-tooltip") 4 | 5 | test("should be defined on jquery object", function () { 6 | var div = $("
      ") 7 | ok(div.tooltip, 'popover method is defined') 8 | }) 9 | 10 | test("should return element", function () { 11 | var div = $("
      ") 12 | ok(div.tooltip() == div, 'document.body returned') 13 | }) 14 | 15 | test("should expose default settings", function () { 16 | ok(!!$.fn.tooltip.defaults, 'defaults is defined') 17 | }) 18 | 19 | test("should remove title attribute", function () { 20 | var tooltip = $('').tooltip() 21 | ok(!tooltip.attr('title'), 'title tag was removed') 22 | }) 23 | 24 | test("should add data attribute for referencing original title", function () { 25 | var tooltip = $('').tooltip() 26 | equals(tooltip.attr('data-original-title'), 'Another tooltip', 'original title preserved in data attribute') 27 | }) 28 | 29 | test("should place tooltips relative to placement option", function () { 30 | $.support.transition = false 31 | var tooltip = $('') 32 | .appendTo('#qunit-fixture') 33 | .tooltip({placement: 'bottom'}) 34 | .tooltip('show') 35 | 36 | ok($(".tooltip").hasClass('fade bottom in'), 'has correct classes applied') 37 | tooltip.tooltip('hide') 38 | }) 39 | 40 | test("should always allow html entities", function () { 41 | $.support.transition = false 42 | var tooltip = $('') 43 | .appendTo('#qunit-fixture') 44 | .tooltip('show') 45 | 46 | ok($('.tooltip b').length, 'b tag was inserted') 47 | tooltip.tooltip('hide') 48 | ok(!$(".tooltip").length, 'tooltip removed') 49 | }) 50 | 51 | test("should respect custom classes", function () { 52 | var tooltip = $('') 53 | .appendTo('#qunit-fixture') 54 | .tooltip({ template: '
      '}) 55 | .tooltip('show') 56 | 57 | ok($('.tooltip').hasClass('some-class'), 'custom class is present') 58 | tooltip.tooltip('hide') 59 | ok(!$(".tooltip").length, 'tooltip removed') 60 | }) 61 | 62 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/js/tests/unit/bootstrap-transition.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-transition") 4 | 5 | test("should be defined on jquery support object", function () { 6 | ok($.support.transition != undefined, 'transition object is defined') 7 | }) 8 | 9 | test("should provide an end object", function () { 10 | ok($.support.transition ? $.support.transition.end : true, 'end string is defined') 11 | }) 12 | 13 | }) -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/accordion.less: -------------------------------------------------------------------------------- 1 | // ACCORDION 2 | // --------- 3 | 4 | 5 | // Parent container 6 | .accordion { 7 | margin-bottom: @baseLineHeight; 8 | } 9 | 10 | // Group == heading + body 11 | .accordion-group { 12 | margin-bottom: 2px; 13 | border: 1px solid #e5e5e5; 14 | .border-radius(4px); 15 | } 16 | .accordion-heading { 17 | border-bottom: 0; 18 | } 19 | .accordion-heading .accordion-toggle { 20 | display: block; 21 | padding: 8px 15px; 22 | } 23 | 24 | // Inner needs the styles because you can't animate properly with any styles on the element 25 | .accordion-inner { 26 | padding: 9px 15px; 27 | border-top: 1px solid #e5e5e5; 28 | } 29 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/alerts.less: -------------------------------------------------------------------------------- 1 | // ALERT STYLES 2 | // ------------ 3 | 4 | // Base alert styles 5 | .alert { 6 | padding: 8px 35px 8px 14px; 7 | margin-bottom: @baseLineHeight; 8 | text-shadow: 0 1px 0 rgba(255,255,255,.5); 9 | background-color: @warningBackground; 10 | border: 1px solid @warningBorder; 11 | .border-radius(4px); 12 | } 13 | .alert, 14 | .alert-heading { 15 | color: @warningText; 16 | } 17 | 18 | // Adjust close link position 19 | .alert .close { 20 | position: relative; 21 | top: -2px; 22 | right: -21px; 23 | line-height: 18px; 24 | } 25 | 26 | // Alternate styles 27 | // ---------------- 28 | 29 | .alert-success { 30 | background-color: @successBackground; 31 | border-color: @successBorder; 32 | } 33 | .alert-success, 34 | .alert-success .alert-heading { 35 | color: @successText; 36 | } 37 | .alert-danger, 38 | .alert-error { 39 | background-color: @errorBackground; 40 | border-color: @errorBorder; 41 | } 42 | .alert-danger, 43 | .alert-error, 44 | .alert-danger .alert-heading, 45 | .alert-error .alert-heading { 46 | color: @errorText; 47 | } 48 | .alert-info { 49 | background-color: @infoBackground; 50 | border-color: @infoBorder; 51 | } 52 | .alert-info, 53 | .alert-info .alert-heading { 54 | color: @infoText; 55 | } 56 | 57 | 58 | // Block alerts 59 | // ------------------------ 60 | .alert-block { 61 | padding-top: 14px; 62 | padding-bottom: 14px; 63 | } 64 | .alert-block > p, 65 | .alert-block > ul { 66 | margin-bottom: 0; 67 | } 68 | .alert-block p + p { 69 | margin-top: 5px; 70 | } 71 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/bootstrap.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v2.0.1 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */ 10 | 11 | // CSS Reset 12 | @import "reset.less"; 13 | 14 | // Core variables and mixins 15 | @import "variables.less"; // Modify this for custom colors, font-sizes, etc 16 | @import "mixins.less"; 17 | 18 | // Grid system and page structure 19 | @import "scaffolding.less"; 20 | @import "grid.less"; 21 | @import "layouts.less"; 22 | 23 | // Base CSS 24 | @import "type.less"; 25 | @import "code.less"; 26 | @import "forms.less"; 27 | @import "tables.less"; 28 | 29 | // Components: common 30 | @import "sprites.less"; 31 | @import "dropdowns.less"; 32 | @import "wells.less"; 33 | @import "component-animations.less"; 34 | @import "close.less"; 35 | 36 | // Components: Buttons & Alerts 37 | @import "buttons.less"; 38 | @import "button-groups.less"; 39 | @import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less 40 | 41 | // Components: Nav 42 | @import "navs.less"; 43 | @import "navbar.less"; 44 | @import "breadcrumbs.less"; 45 | @import "pagination.less"; 46 | @import "pager.less"; 47 | 48 | // Components: Popovers 49 | @import "modals.less"; 50 | @import "tooltip.less"; 51 | @import "popovers.less"; 52 | 53 | // Components: Misc 54 | @import "thumbnails.less"; 55 | @import "labels.less"; 56 | @import "progress-bars.less"; 57 | @import "accordion.less"; 58 | @import "carousel.less"; 59 | @import "hero-unit.less"; 60 | 61 | // Utility classes 62 | @import "utilities.less"; // Has to be last to override when necessary 63 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // BREADCRUMBS 2 | // ----------- 3 | 4 | .breadcrumb { 5 | padding: 7px 14px; 6 | margin: 0 0 @baseLineHeight; 7 | #gradient > .vertical(@white, #f5f5f5); 8 | border: 1px solid #ddd; 9 | .border-radius(3px); 10 | .box-shadow(inset 0 1px 0 @white); 11 | li { 12 | display: inline-block; 13 | text-shadow: 0 1px 0 @white; 14 | } 15 | .divider { 16 | padding: 0 5px; 17 | color: @grayLight; 18 | } 19 | .active a { 20 | color: @grayDark; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/button-groups.less: -------------------------------------------------------------------------------- 1 | // BUTTON GROUPS 2 | // ------------- 3 | 4 | 5 | // Make the div behave like a button 6 | .btn-group { 7 | position: relative; 8 | .clearfix(); // clears the floated buttons 9 | .ie7-restore-left-whitespace(); 10 | } 11 | 12 | // Space out series of button groups 13 | .btn-group + .btn-group { 14 | margin-left: 5px; 15 | } 16 | 17 | // Optional: Group multiple button groups together for a toolbar 18 | .btn-toolbar { 19 | margin-top: @baseLineHeight / 2; 20 | margin-bottom: @baseLineHeight / 2; 21 | .btn-group { 22 | display: inline-block; 23 | .ie7-inline-block(); 24 | } 25 | } 26 | 27 | // Float them, remove border radius, then re-add to first and last elements 28 | .btn-group .btn { 29 | position: relative; 30 | float: left; 31 | margin-left: -1px; 32 | .border-radius(0); 33 | } 34 | // Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match 35 | .btn-group .btn:first-child { 36 | margin-left: 0; 37 | -webkit-border-top-left-radius: 4px; 38 | -moz-border-radius-topleft: 4px; 39 | border-top-left-radius: 4px; 40 | -webkit-border-bottom-left-radius: 4px; 41 | -moz-border-radius-bottomleft: 4px; 42 | border-bottom-left-radius: 4px; 43 | } 44 | .btn-group .btn:last-child, 45 | .btn-group .dropdown-toggle { 46 | -webkit-border-top-right-radius: 4px; 47 | -moz-border-radius-topright: 4px; 48 | border-top-right-radius: 4px; 49 | -webkit-border-bottom-right-radius: 4px; 50 | -moz-border-radius-bottomright: 4px; 51 | border-bottom-right-radius: 4px; 52 | } 53 | // Reset corners for large buttons 54 | .btn-group .btn.large:first-child { 55 | margin-left: 0; 56 | -webkit-border-top-left-radius: 6px; 57 | -moz-border-radius-topleft: 6px; 58 | border-top-left-radius: 6px; 59 | -webkit-border-bottom-left-radius: 6px; 60 | -moz-border-radius-bottomleft: 6px; 61 | border-bottom-left-radius: 6px; 62 | } 63 | .btn-group .btn.large:last-child, 64 | .btn-group .large.dropdown-toggle { 65 | -webkit-border-top-right-radius: 6px; 66 | -moz-border-radius-topright: 6px; 67 | border-top-right-radius: 6px; 68 | -webkit-border-bottom-right-radius: 6px; 69 | -moz-border-radius-bottomright: 6px; 70 | border-bottom-right-radius: 6px; 71 | } 72 | 73 | // On hover/focus/active, bring the proper btn to front 74 | .btn-group .btn:hover, 75 | .btn-group .btn:focus, 76 | .btn-group .btn:active, 77 | .btn-group .btn.active { 78 | z-index: 2; 79 | } 80 | 81 | // On active and open, don't show outline 82 | .btn-group .dropdown-toggle:active, 83 | .btn-group.open .dropdown-toggle { 84 | outline: 0; 85 | } 86 | 87 | 88 | 89 | // Split button dropdowns 90 | // ---------------------- 91 | 92 | // Give the line between buttons some depth 93 | .btn-group .dropdown-toggle { 94 | padding-left: 8px; 95 | padding-right: 8px; 96 | @shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); 97 | .box-shadow(@shadow); 98 | *padding-top: 5px; 99 | *padding-bottom: 5px; 100 | } 101 | 102 | .btn-group.open { 103 | // IE7's z-index only goes to the nearest positioned ancestor, which would 104 | // make the menu appear below buttons that appeared later on the page 105 | *z-index: @zindexDropdown; 106 | 107 | // Reposition menu on open and round all corners 108 | .dropdown-menu { 109 | display: block; 110 | margin-top: 1px; 111 | .border-radius(5px); 112 | } 113 | 114 | .dropdown-toggle { 115 | background-image: none; 116 | @shadow: inset 0 1px 6px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); 117 | .box-shadow(@shadow); 118 | } 119 | } 120 | 121 | // Reposition the caret 122 | .btn .caret { 123 | margin-top: 7px; 124 | margin-left: 0; 125 | } 126 | .btn:hover .caret, 127 | .open.btn-group .caret { 128 | .opacity(100); 129 | } 130 | 131 | 132 | // Account for other colors 133 | .btn-primary, 134 | .btn-danger, 135 | .btn-info, 136 | .btn-success, 137 | .btn-inverse { 138 | .caret { 139 | border-top-color: @white; 140 | .opacity(75); 141 | } 142 | } 143 | 144 | // Small button dropdowns 145 | .btn-small .caret { 146 | margin-top: 4px; 147 | } 148 | 149 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/carousel.less: -------------------------------------------------------------------------------- 1 | // CAROUSEL 2 | // -------- 3 | 4 | .carousel { 5 | position: relative; 6 | margin-bottom: @baseLineHeight; 7 | line-height: 1; 8 | } 9 | 10 | .carousel-inner { 11 | overflow: hidden; 12 | width: 100%; 13 | position: relative; 14 | } 15 | 16 | .carousel { 17 | 18 | .item { 19 | display: none; 20 | position: relative; 21 | .transition(.6s ease-in-out left); 22 | } 23 | 24 | // Account for jankitude on images 25 | .item > img { 26 | display: block; 27 | line-height: 1; 28 | } 29 | 30 | .active, 31 | .next, 32 | .prev { display: block; } 33 | 34 | .active { 35 | left: 0; 36 | } 37 | 38 | .next, 39 | .prev { 40 | position: absolute; 41 | top: 0; 42 | width: 100%; 43 | } 44 | 45 | .next { 46 | left: 100%; 47 | } 48 | .prev { 49 | left: -100%; 50 | } 51 | .next.left, 52 | .prev.right { 53 | left: 0; 54 | } 55 | 56 | .active.left { 57 | left: -100%; 58 | } 59 | .active.right { 60 | left: 100%; 61 | } 62 | 63 | } 64 | 65 | // Left/right controls for nav 66 | // --------------------------- 67 | 68 | .carousel-control { 69 | position: absolute; 70 | top: 40%; 71 | left: 15px; 72 | width: 40px; 73 | height: 40px; 74 | margin-top: -20px; 75 | font-size: 60px; 76 | font-weight: 100; 77 | line-height: 30px; 78 | color: @white; 79 | text-align: center; 80 | background: @grayDarker; 81 | border: 3px solid @white; 82 | .border-radius(23px); 83 | .opacity(50); 84 | 85 | // we can't have this transition here 86 | // because webkit cancels the carousel 87 | // animation if you trip this while 88 | // in the middle of another animation 89 | // ;_; 90 | // .transition(opacity .2s linear); 91 | 92 | // Reposition the right one 93 | &.right { 94 | left: auto; 95 | right: 15px; 96 | } 97 | 98 | // Hover state 99 | &:hover { 100 | color: @white; 101 | text-decoration: none; 102 | .opacity(90); 103 | } 104 | } 105 | 106 | // Caption for text below images 107 | // ----------------------------- 108 | 109 | .carousel-caption { 110 | position: absolute; 111 | left: 0; 112 | right: 0; 113 | bottom: 0; 114 | padding: 10px 15px 5px; 115 | background: @grayDark; 116 | background: rgba(0,0,0,.75); 117 | } 118 | .carousel-caption h4, 119 | .carousel-caption p { 120 | color: @white; 121 | } 122 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/close.less: -------------------------------------------------------------------------------- 1 | // CLOSE ICONS 2 | // ----------- 3 | 4 | .close { 5 | float: right; 6 | font-size: 20px; 7 | font-weight: bold; 8 | line-height: @baseLineHeight; 9 | color: @black; 10 | text-shadow: 0 1px 0 rgba(255,255,255,1); 11 | .opacity(20); 12 | &:hover { 13 | color: @black; 14 | text-decoration: none; 15 | .opacity(40); 16 | cursor: pointer; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/code.less: -------------------------------------------------------------------------------- 1 | // Code.less 2 | // Code typography styles for the and
       elements
       3 | // --------------------------------------------------------
       4 | 
       5 | // Inline and block code styles
       6 | code,
       7 | pre {
       8 |   padding: 0 3px 2px;
       9 |   #font > #family > .monospace;
      10 |   font-size: @baseFontSize - 1;
      11 |   color: @grayDark;
      12 |   .border-radius(3px);
      13 | }
      14 | 
      15 | // Inline code
      16 | code {
      17 |   padding: 3px 4px;
      18 |   color: #d14;
      19 |   background-color: #f7f7f9;
      20 |   border: 1px solid #e1e1e8;
      21 | }
      22 | 
      23 | // Blocks of code
      24 | pre {
      25 |   display: block;
      26 |   padding: (@baseLineHeight - 1) / 2;
      27 |   margin: 0 0 @baseLineHeight / 2;
      28 |   font-size: 12px;
      29 |   line-height: @baseLineHeight;
      30 |   background-color: #f5f5f5;
      31 |   border: 1px solid #ccc; // fallback for IE7-8
      32 |   border: 1px solid rgba(0,0,0,.15);
      33 |   .border-radius(4px);
      34 |   white-space: pre;
      35 |   white-space: pre-wrap;
      36 |   word-break: break-all;
      37 |   word-wrap: break-word;
      38 | 
      39 |   // Make prettyprint styles more spaced out for readability
      40 |   &.prettyprint {
      41 |     margin-bottom: @baseLineHeight;
      42 |   }
      43 | 
      44 |   // Account for some code outputs that place code tags in pre tags
      45 |   code {
      46 |     padding: 0;
      47 |     color: inherit;
      48 |     background-color: transparent;
      49 |     border: 0;
      50 |   }
      51 | }
      52 | 
      53 | // Enable scrollable blocks of code
      54 | .pre-scrollable {
      55 |   max-height: 340px;
      56 |   overflow-y: scroll;
      57 | }
      
      
      --------------------------------------------------------------------------------
      /demo/browser/bootstrap/less/component-animations.less:
      --------------------------------------------------------------------------------
       1 | // COMPONENT ANIMATIONS
       2 | // --------------------
       3 | 
       4 | .fade {
       5 |   .transition(opacity .15s linear);
       6 |   opacity: 0;
       7 |   &.in {
       8 |     opacity: 1;
       9 |   }
      10 | }
      11 | 
      12 | .collapse {
      13 |   .transition(height .35s ease);
      14 |   position:relative;
      15 |   overflow:hidden;
      16 |   height: 0;
      17 |   &.in { height: auto; }
      18 | }
      19 | 
      
      
      --------------------------------------------------------------------------------
      /demo/browser/bootstrap/less/dropdowns.less:
      --------------------------------------------------------------------------------
        1 | // DROPDOWN MENUS
        2 | // --------------
        3 | 
        4 | // Use the .menu class on any 
    1. element within the topbar or ul.tabs and you'll get some superfancy dropdowns 5 | .dropdown { 6 | position: relative; 7 | } 8 | .dropdown-toggle { 9 | // The caret makes the toggle a bit too tall in IE7 10 | *margin-bottom: -3px; 11 | } 12 | .dropdown-toggle:active, 13 | .open .dropdown-toggle { 14 | outline: 0; 15 | } 16 | // Dropdown arrow/caret 17 | .caret { 18 | display: inline-block; 19 | width: 0; 20 | height: 0; 21 | text-indent: -99999px; 22 | // IE7 won't do the border trick if there's a text indent, but it doesn't 23 | // do the content that text-indent is hiding, either, so we're ok. 24 | *text-indent: 0; 25 | vertical-align: top; 26 | border-left: 4px solid transparent; 27 | border-right: 4px solid transparent; 28 | border-top: 4px solid @black; 29 | .opacity(30); 30 | content: "\2193"; 31 | } 32 | .dropdown .caret { 33 | margin-top: 8px; 34 | margin-left: 2px; 35 | } 36 | .dropdown:hover .caret, 37 | .open.dropdown .caret { 38 | .opacity(100); 39 | } 40 | // The dropdown menu (ul) 41 | .dropdown-menu { 42 | position: absolute; 43 | top: 100%; 44 | left: 0; 45 | z-index: @zindexDropdown; 46 | float: left; 47 | display: none; // none by default, but block on "open" of the menu 48 | min-width: 160px; 49 | _width: 160px; 50 | padding: 4px 0; 51 | margin: 0; // override default ul 52 | list-style: none; 53 | background-color: @white; 54 | border-color: #ccc; 55 | border-color: rgba(0,0,0,.2); 56 | border-style: solid; 57 | border-width: 1px; 58 | .border-radius(0 0 5px 5px); 59 | .box-shadow(0 5px 10px rgba(0,0,0,.2)); 60 | -webkit-background-clip: padding-box; 61 | -moz-background-clip: padding; 62 | background-clip: padding-box; 63 | *border-right-width: 2px; 64 | *border-bottom-width: 2px; 65 | 66 | // Allow for dropdowns to go bottom up (aka, dropup-menu) 67 | &.bottom-up { 68 | top: auto; 69 | bottom: 100%; 70 | margin-bottom: 2px; 71 | } 72 | 73 | // Dividers (basically an hr) within the dropdown 74 | .divider { 75 | height: 1px; 76 | margin: 5px 1px; 77 | overflow: hidden; 78 | background-color: #e5e5e5; 79 | border-bottom: 1px solid @white; 80 | 81 | // IE7 needs a set width since we gave a height. Restricting just 82 | // to IE7 to keep the 1px left/right space in other browsers. 83 | // It is unclear where IE is getting the extra space that we need 84 | // to negative-margin away, but so it goes. 85 | *width: 100%; 86 | *margin: -5px 0 5px; 87 | } 88 | 89 | // Links within the dropdown menu 90 | a { 91 | display: block; 92 | padding: 3px 15px; 93 | clear: both; 94 | font-weight: normal; 95 | line-height: @baseLineHeight; 96 | color: @gray; 97 | white-space: nowrap; 98 | } 99 | } 100 | 101 | // Hover state 102 | .dropdown-menu li > a:hover, 103 | .dropdown-menu .active > a, 104 | .dropdown-menu .active > a:hover { 105 | color: @white; 106 | text-decoration: none; 107 | background-color: @linkColor; 108 | } 109 | 110 | // Open state for the dropdown 111 | .dropdown.open { 112 | // IE7's z-index only goes to the nearest positioned ancestor, which would 113 | // make the menu appear below buttons that appeared later on the page 114 | *z-index: @zindexDropdown; 115 | 116 | .dropdown-toggle { 117 | color: @white; 118 | background: #ccc; 119 | background: rgba(0,0,0,.3); 120 | } 121 | .dropdown-menu { 122 | display: block; 123 | } 124 | } 125 | 126 | // Typeahead 127 | .typeahead { 128 | margin-top: 2px; // give it some space to breathe 129 | .border-radius(4px); 130 | } 131 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/grid.less: -------------------------------------------------------------------------------- 1 | // GRID SYSTEM 2 | // ----------- 3 | 4 | // Fixed (940px) 5 | #gridSystem > .generate(@gridColumns, @gridColumnWidth, @gridGutterWidth); 6 | 7 | // Fluid (940px) 8 | #fluidGridSystem > .generate(@gridColumns, @fluidGridColumnWidth, @fluidGridGutterWidth); 9 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/hero-unit.less: -------------------------------------------------------------------------------- 1 | // HERO UNIT 2 | // --------- 3 | 4 | .hero-unit { 5 | padding: 60px; 6 | margin-bottom: 30px; 7 | background-color: #f5f5f5; 8 | .border-radius(6px); 9 | h1 { 10 | margin-bottom: 0; 11 | font-size: 60px; 12 | line-height: 1; 13 | letter-spacing: -1px; 14 | } 15 | p { 16 | font-size: 18px; 17 | font-weight: 200; 18 | line-height: @baseLineHeight * 1.5; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/labels.less: -------------------------------------------------------------------------------- 1 | // LABELS 2 | // ------ 3 | 4 | // Base 5 | .label { 6 | padding: 2px 4px 3px; 7 | font-size: @baseFontSize * .85; 8 | font-weight: bold; 9 | color: @white; 10 | text-shadow: 0 -1px 0 rgba(0,0,0,.25); 11 | background-color: @grayLight; 12 | .border-radius(3px); 13 | } 14 | 15 | // Hover state 16 | .label:hover { 17 | color: @white; 18 | text-decoration: none; 19 | } 20 | 21 | // Colors 22 | .label-important { background-color: @errorText; } 23 | .label-important:hover { background-color: darken(@errorText, 10%); } 24 | 25 | .label-warning { background-color: @orange; } 26 | .label-warning:hover { background-color: darken(@orange, 10%); } 27 | 28 | .label-success { background-color: @successText; } 29 | .label-success:hover { background-color: darken(@successText, 10%); } 30 | 31 | .label-info { background-color: @infoText; } 32 | .label-info:hover { background-color: darken(@infoText, 10%); } 33 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/layouts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Layouts 3 | // Fixed-width and fluid (with sidebar) layouts 4 | // -------------------------------------------- 5 | 6 | 7 | // Container (centered, fixed-width layouts) 8 | .container { 9 | .container-fixed(); 10 | } 11 | 12 | // Fluid layouts (left aligned, with sidebar, min- & max-width content) 13 | .container-fluid { 14 | padding-left: @gridGutterWidth; 15 | padding-right: @gridGutterWidth; 16 | .clearfix(); 17 | } -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/modals.less: -------------------------------------------------------------------------------- 1 | // MODALS 2 | // ------ 3 | 4 | // Recalculate z-index where appropriate 5 | .modal-open { 6 | .dropdown-menu { z-index: @zindexDropdown + @zindexModal; } 7 | .dropdown.open { *z-index: @zindexDropdown + @zindexModal; } 8 | .popover { z-index: @zindexPopover + @zindexModal; } 9 | .tooltip { z-index: @zindexTooltip + @zindexModal; } 10 | } 11 | 12 | // Background 13 | .modal-backdrop { 14 | position: fixed; 15 | top: 0; 16 | right: 0; 17 | bottom: 0; 18 | left: 0; 19 | z-index: @zindexModalBackdrop; 20 | background-color: @black; 21 | // Fade for backdrop 22 | &.fade { opacity: 0; } 23 | } 24 | 25 | .modal-backdrop, 26 | .modal-backdrop.fade.in { 27 | .opacity(80); 28 | } 29 | 30 | // Base modal 31 | .modal { 32 | position: fixed; 33 | top: 50%; 34 | left: 50%; 35 | z-index: @zindexModal; 36 | max-height: 500px; 37 | overflow: auto; 38 | width: 560px; 39 | margin: -250px 0 0 -280px; 40 | background-color: @white; 41 | border: 1px solid #999; 42 | border: 1px solid rgba(0,0,0,.3); 43 | *border: 1px solid #999; /* IE6-7 */ 44 | .border-radius(6px); 45 | .box-shadow(0 3px 7px rgba(0,0,0,0.3)); 46 | .background-clip(padding-box); 47 | &.fade { 48 | .transition(e('opacity .3s linear, top .3s ease-out')); 49 | top: -25%; 50 | } 51 | &.fade.in { top: 50%; } 52 | } 53 | .modal-header { 54 | padding: 9px 15px; 55 | border-bottom: 1px solid #eee; 56 | // Close icon 57 | .close { margin-top: 2px; } 58 | } 59 | 60 | // Body (where all modal content resises) 61 | .modal-body { 62 | padding: 15px; 63 | } 64 | // Remove bottom margin if need be 65 | .modal-body .modal-form { 66 | margin-bottom: 0; 67 | } 68 | 69 | // Footer (for actions) 70 | .modal-footer { 71 | padding: 14px 15px 15px; 72 | margin-bottom: 0; 73 | background-color: #f5f5f5; 74 | border-top: 1px solid #ddd; 75 | .border-radius(0 0 6px 6px); 76 | .box-shadow(inset 0 1px 0 @white); 77 | .clearfix(); 78 | .btn { 79 | float: right; 80 | margin-left: 5px; 81 | margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/pager.less: -------------------------------------------------------------------------------- 1 | // PAGER 2 | // ----- 3 | 4 | .pager { 5 | margin-left: 0; 6 | margin-bottom: @baseLineHeight; 7 | list-style: none; 8 | text-align: center; 9 | .clearfix(); 10 | } 11 | .pager li { 12 | display: inline; 13 | } 14 | .pager a { 15 | display: inline-block; 16 | padding: 5px 14px; 17 | background-color: #fff; 18 | border: 1px solid #ddd; 19 | .border-radius(15px); 20 | } 21 | .pager a:hover { 22 | text-decoration: none; 23 | background-color: #f5f5f5; 24 | } 25 | .pager .next a { 26 | float: right; 27 | } 28 | .pager .previous a { 29 | float: left; 30 | } 31 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/pagination.less: -------------------------------------------------------------------------------- 1 | // PAGINATION 2 | // ---------- 3 | 4 | .pagination { 5 | height: @baseLineHeight * 2; 6 | margin: @baseLineHeight 0; 7 | } 8 | .pagination ul { 9 | display: inline-block; 10 | .ie7-inline-block(); 11 | margin-left: 0; 12 | margin-bottom: 0; 13 | .border-radius(3px); 14 | .box-shadow(0 1px 2px rgba(0,0,0,.05)); 15 | } 16 | .pagination li { 17 | display: inline; 18 | } 19 | .pagination a { 20 | float: left; 21 | padding: 0 14px; 22 | line-height: (@baseLineHeight * 2) - 2; 23 | text-decoration: none; 24 | border: 1px solid #ddd; 25 | border-left-width: 0; 26 | } 27 | .pagination a:hover, 28 | .pagination .active a { 29 | background-color: #f5f5f5; 30 | } 31 | .pagination .active a { 32 | color: @grayLight; 33 | cursor: default; 34 | } 35 | .pagination .disabled a, 36 | .pagination .disabled a:hover { 37 | color: @grayLight; 38 | background-color: transparent; 39 | cursor: default; 40 | } 41 | .pagination li:first-child a { 42 | border-left-width: 1px; 43 | .border-radius(3px 0 0 3px); 44 | } 45 | .pagination li:last-child a { 46 | .border-radius(0 3px 3px 0); 47 | } 48 | 49 | // Centered 50 | .pagination-centered { 51 | text-align: center; 52 | } 53 | .pagination-right { 54 | text-align: right; 55 | } 56 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/popovers.less: -------------------------------------------------------------------------------- 1 | // POPOVERS 2 | // -------- 3 | 4 | .popover { 5 | position: absolute; 6 | top: 0; 7 | left: 0; 8 | z-index: @zindexPopover; 9 | display: none; 10 | padding: 5px; 11 | &.top { margin-top: -5px; } 12 | &.right { margin-left: 5px; } 13 | &.bottom { margin-top: 5px; } 14 | &.left { margin-left: -5px; } 15 | &.top .arrow { #popoverArrow > .top(); } 16 | &.right .arrow { #popoverArrow > .right(); } 17 | &.bottom .arrow { #popoverArrow > .bottom(); } 18 | &.left .arrow { #popoverArrow > .left(); } 19 | .arrow { 20 | position: absolute; 21 | width: 0; 22 | height: 0; 23 | } 24 | } 25 | .popover-inner { 26 | padding: 3px; 27 | width: 280px; 28 | overflow: hidden; 29 | background: @black; // has to be full background declaration for IE fallback 30 | background: rgba(0,0,0,.8); 31 | .border-radius(6px); 32 | .box-shadow(0 3px 7px rgba(0,0,0,0.3)); 33 | } 34 | .popover-title { 35 | padding: 9px 15px; 36 | line-height: 1; 37 | background-color: #f5f5f5; 38 | border-bottom:1px solid #eee; 39 | .border-radius(3px 3px 0 0); 40 | } 41 | .popover-content { 42 | padding: 14px; 43 | background-color: @white; 44 | .border-radius(0 0 3px 3px); 45 | .background-clip(padding-box); 46 | p, ul, ol { 47 | margin-bottom: 0; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/progress-bars.less: -------------------------------------------------------------------------------- 1 | // PROGRESS BARS 2 | // ------------- 3 | 4 | 5 | // ANIMATIONS 6 | // ---------- 7 | 8 | // Webkit 9 | @-webkit-keyframes progress-bar-stripes { 10 | from { background-position: 0 0; } 11 | to { background-position: 40px 0; } 12 | } 13 | 14 | // Firefox 15 | @-moz-keyframes progress-bar-stripes { 16 | from { background-position: 0 0; } 17 | to { background-position: 40px 0; } 18 | } 19 | 20 | // Spec 21 | @keyframes progress-bar-stripes { 22 | from { background-position: 0 0; } 23 | to { background-position: 40px 0; } 24 | } 25 | 26 | 27 | 28 | // THE BARS 29 | // -------- 30 | 31 | // Outer container 32 | .progress { 33 | overflow: hidden; 34 | height: 18px; 35 | margin-bottom: 18px; 36 | #gradient > .vertical(#f5f5f5, #f9f9f9); 37 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 38 | .border-radius(4px); 39 | } 40 | 41 | // Bar of progress 42 | .progress .bar { 43 | width: 0%; 44 | height: 18px; 45 | color: @white; 46 | font-size: 12px; 47 | text-align: center; 48 | text-shadow: 0 -1px 0 rgba(0,0,0,.25); 49 | #gradient > .vertical(#149bdf, #0480be); 50 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 51 | .box-sizing(border-box); 52 | .transition(width .6s ease); 53 | } 54 | 55 | // Striped bars 56 | .progress-striped .bar { 57 | #gradient > .striped(#62c462); 58 | .background-size(40px 40px); 59 | } 60 | 61 | // Call animation for the active one 62 | .progress.active .bar { 63 | -webkit-animation: progress-bar-stripes 2s linear infinite; 64 | -moz-animation: progress-bar-stripes 2s linear infinite; 65 | animation: progress-bar-stripes 2s linear infinite; 66 | } 67 | 68 | 69 | 70 | // COLORS 71 | // ------ 72 | 73 | // Danger (red) 74 | .progress-danger .bar { 75 | #gradient > .vertical(#ee5f5b, #c43c35); 76 | } 77 | .progress-danger.progress-striped .bar { 78 | #gradient > .striped(#ee5f5b); 79 | } 80 | 81 | // Success (green) 82 | .progress-success .bar { 83 | #gradient > .vertical(#62c462, #57a957); 84 | } 85 | .progress-success.progress-striped .bar { 86 | #gradient > .striped(#62c462); 87 | } 88 | 89 | // Info (teal) 90 | .progress-info .bar { 91 | #gradient > .vertical(#5bc0de, #339bb9); 92 | } 93 | .progress-info.progress-striped .bar { 94 | #gradient > .striped(#5bc0de); 95 | } 96 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/reset.less: -------------------------------------------------------------------------------- 1 | // Reset.less 2 | // Adapted from Normalize.css http://github.com/necolas/normalize.css 3 | // ------------------------------------------------------------------------ 4 | 5 | // Display in IE6-9 and FF3 6 | // ------------------------- 7 | 8 | article, 9 | aside, 10 | details, 11 | figcaption, 12 | figure, 13 | footer, 14 | header, 15 | hgroup, 16 | nav, 17 | section { 18 | display: block; 19 | } 20 | 21 | // Display block in IE6-9 and FF3 22 | // ------------------------- 23 | 24 | audio, 25 | canvas, 26 | video { 27 | display: inline-block; 28 | *display: inline; 29 | *zoom: 1; 30 | } 31 | 32 | // Prevents modern browsers from displaying 'audio' without controls 33 | // ------------------------- 34 | 35 | audio:not([controls]) { 36 | display: none; 37 | } 38 | 39 | // Base settings 40 | // ------------------------- 41 | 42 | html { 43 | font-size: 100%; 44 | -webkit-text-size-adjust: 100%; 45 | -ms-text-size-adjust: 100%; 46 | } 47 | // Focus states 48 | a:focus { 49 | .tab-focus(); 50 | } 51 | // Hover & Active 52 | a:hover, 53 | a:active { 54 | outline: 0; 55 | } 56 | 57 | // Prevents sub and sup affecting line-height in all browsers 58 | // ------------------------- 59 | 60 | sub, 61 | sup { 62 | position: relative; 63 | font-size: 75%; 64 | line-height: 0; 65 | vertical-align: baseline; 66 | } 67 | sup { 68 | top: -0.5em; 69 | } 70 | sub { 71 | bottom: -0.25em; 72 | } 73 | 74 | // Img border in a's and image quality 75 | // ------------------------- 76 | 77 | img { 78 | max-width: 100%; 79 | height: auto; 80 | border: 0; 81 | -ms-interpolation-mode: bicubic; 82 | } 83 | 84 | // Forms 85 | // ------------------------- 86 | 87 | // Font size in all browsers, margin changes, misc consistency 88 | button, 89 | input, 90 | select, 91 | textarea { 92 | margin: 0; 93 | font-size: 100%; 94 | vertical-align: middle; 95 | } 96 | button, 97 | input { 98 | *overflow: visible; // Inner spacing ie IE6/7 99 | line-height: normal; // FF3/4 have !important on line-height in UA stylesheet 100 | } 101 | button::-moz-focus-inner, 102 | input::-moz-focus-inner { // Inner padding and border oddities in FF3/4 103 | padding: 0; 104 | border: 0; 105 | } 106 | button, 107 | input[type="button"], 108 | input[type="reset"], 109 | input[type="submit"] { 110 | cursor: pointer; // Cursors on all buttons applied consistently 111 | -webkit-appearance: button; // Style clickable inputs in iOS 112 | } 113 | input[type="search"] { // Appearance in Safari/Chrome 114 | -webkit-appearance: textfield; 115 | -webkit-box-sizing: content-box; 116 | -moz-box-sizing: content-box; 117 | box-sizing: content-box; 118 | } 119 | input[type="search"]::-webkit-search-decoration, 120 | input[type="search"]::-webkit-search-cancel-button { 121 | -webkit-appearance: none; // Inner-padding issues in Chrome OSX, Safari 5 122 | } 123 | textarea { 124 | overflow: auto; // Remove vertical scrollbar in IE6-9 125 | vertical-align: top; // Readability and alignment cross-browser 126 | } 127 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/scaffolding.less: -------------------------------------------------------------------------------- 1 | // Scaffolding 2 | // Basic and global styles for generating a grid system, structural layout, and page templates 3 | // ------------------------------------------------------------------------------------------- 4 | 5 | 6 | // STRUCTURAL LAYOUT 7 | // ----------------- 8 | 9 | body { 10 | margin: 0; 11 | font-family: @baseFontFamily; 12 | font-size: @baseFontSize; 13 | line-height: @baseLineHeight; 14 | color: @textColor; 15 | background-color: @white; 16 | } 17 | 18 | 19 | // LINKS 20 | // ----- 21 | 22 | a { 23 | color: @linkColor; 24 | text-decoration: none; 25 | } 26 | a:hover { 27 | color: @linkColorHover; 28 | text-decoration: underline; 29 | } 30 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/tables.less: -------------------------------------------------------------------------------- 1 | // 2 | // Tables.less 3 | // Tables for, you guessed it, tabular data 4 | // ---------------------------------------- 5 | 6 | 7 | // BASE TABLES 8 | // ----------------- 9 | 10 | table { 11 | max-width: 100%; 12 | border-collapse: collapse; 13 | border-spacing: 0; 14 | } 15 | 16 | // BASELINE STYLES 17 | // --------------- 18 | 19 | .table { 20 | width: 100%; 21 | margin-bottom: @baseLineHeight; 22 | // Cells 23 | th, 24 | td { 25 | padding: 8px; 26 | line-height: @baseLineHeight; 27 | text-align: left; 28 | vertical-align: top; 29 | border-top: 1px solid #ddd; 30 | } 31 | th { 32 | font-weight: bold; 33 | } 34 | // Bottom align for column headings 35 | thead th { 36 | vertical-align: bottom; 37 | } 38 | // Remove top border from thead by default 39 | thead:first-child tr th, 40 | thead:first-child tr td { 41 | border-top: 0; 42 | } 43 | // Account for multiple tbody instances 44 | tbody + tbody { 45 | border-top: 2px solid #ddd; 46 | } 47 | } 48 | 49 | 50 | 51 | // CONDENSED TABLE W/ HALF PADDING 52 | // ------------------------------- 53 | 54 | .table-condensed { 55 | th, 56 | td { 57 | padding: 4px 5px; 58 | } 59 | } 60 | 61 | 62 | // BORDERED VERSION 63 | // ---------------- 64 | 65 | .table-bordered { 66 | border: 1px solid #ddd; 67 | border-collapse: separate; // Done so we can round those corners! 68 | *border-collapse: collapsed; // IE7 can't round corners anyway 69 | .border-radius(4px); 70 | th + th, 71 | td + td, 72 | th + td, 73 | td + th { 74 | border-left: 1px solid #ddd; 75 | } 76 | // Prevent a double border 77 | thead:first-child tr:first-child th, 78 | tbody:first-child tr:first-child th, 79 | tbody:first-child tr:first-child td { 80 | border-top: 0; 81 | } 82 | // For first th or td in the first row in the first thead or tbody 83 | thead:first-child tr:first-child th:first-child, 84 | tbody:first-child tr:first-child td:first-child { 85 | .border-radius(4px 0 0 0); 86 | } 87 | thead:first-child tr:first-child th:last-child, 88 | tbody:first-child tr:first-child td:last-child { 89 | .border-radius(0 4px 0 0); 90 | } 91 | // For first th or td in the first row in the first thead or tbody 92 | thead:last-child tr:last-child th:first-child, 93 | tbody:last-child tr:last-child td:first-child { 94 | .border-radius(0 0 0 4px); 95 | } 96 | thead:last-child tr:last-child th:last-child, 97 | tbody:last-child tr:last-child td:last-child { 98 | .border-radius(0 0 4px 0); 99 | } 100 | } 101 | 102 | 103 | // ZEBRA-STRIPING 104 | // -------------- 105 | 106 | // Default zebra-stripe styles (alternating gray and transparent backgrounds) 107 | .table-striped { 108 | tbody { 109 | tr:nth-child(odd) td, 110 | tr:nth-child(odd) th { 111 | background-color: #f9f9f9; 112 | } 113 | } 114 | } 115 | 116 | 117 | // HOVER EFFECT 118 | // ------------ 119 | // Placed here since it has to come after the potential zebra striping 120 | .table { 121 | tbody tr:hover td, 122 | tbody tr:hover th { 123 | background-color: #f5f5f5; 124 | } 125 | } 126 | 127 | 128 | // TABLE CELL SIZING 129 | // ----------------- 130 | 131 | // Change the columns 132 | .tableColumns(@columnSpan: 1) { 133 | float: none; 134 | width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; 135 | margin-left: 0; 136 | } 137 | table { 138 | .span1 { .tableColumns(1); } 139 | .span2 { .tableColumns(2); } 140 | .span3 { .tableColumns(3); } 141 | .span4 { .tableColumns(4); } 142 | .span5 { .tableColumns(5); } 143 | .span6 { .tableColumns(6); } 144 | .span7 { .tableColumns(7); } 145 | .span8 { .tableColumns(8); } 146 | .span9 { .tableColumns(9); } 147 | .span10 { .tableColumns(10); } 148 | .span11 { .tableColumns(11); } 149 | .span12 { .tableColumns(12); } 150 | } 151 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/thumbnails.less: -------------------------------------------------------------------------------- 1 | // THUMBNAILS 2 | // ---------- 3 | 4 | .thumbnails { 5 | margin-left: -@gridGutterWidth; 6 | list-style: none; 7 | .clearfix(); 8 | } 9 | .thumbnails > li { 10 | float: left; 11 | margin: 0 0 @baseLineHeight @gridGutterWidth; 12 | } 13 | .thumbnail { 14 | display: block; 15 | padding: 4px; 16 | line-height: 1; 17 | border: 1px solid #ddd; 18 | .border-radius(4px); 19 | .box-shadow(0 1px 1px rgba(0,0,0,.075)); 20 | } 21 | // Add a hover state for linked versions only 22 | a.thumbnail:hover { 23 | border-color: @linkColor; 24 | .box-shadow(0 1px 4px rgba(0,105,214,.25)); 25 | } 26 | // Images and captions 27 | .thumbnail > img { 28 | display: block; 29 | max-width: 100%; 30 | margin-left: auto; 31 | margin-right: auto; 32 | } 33 | .thumbnail .caption { 34 | padding: 9px; 35 | } 36 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/tooltip.less: -------------------------------------------------------------------------------- 1 | // TOOLTIP 2 | // ------= 3 | 4 | .tooltip { 5 | position: absolute; 6 | z-index: @zindexTooltip; 7 | display: block; 8 | visibility: visible; 9 | padding: 5px; 10 | font-size: 11px; 11 | .opacity(0); 12 | &.in { .opacity(80); } 13 | &.top { margin-top: -2px; } 14 | &.right { margin-left: 2px; } 15 | &.bottom { margin-top: 2px; } 16 | &.left { margin-left: -2px; } 17 | &.top .tooltip-arrow { #popoverArrow > .top(); } 18 | &.left .tooltip-arrow { #popoverArrow > .left(); } 19 | &.bottom .tooltip-arrow { #popoverArrow > .bottom(); } 20 | &.right .tooltip-arrow { #popoverArrow > .right(); } 21 | } 22 | .tooltip-inner { 23 | max-width: 200px; 24 | padding: 3px 8px; 25 | color: @white; 26 | text-align: center; 27 | text-decoration: none; 28 | background-color: @black; 29 | .border-radius(4px); 30 | } 31 | .tooltip-arrow { 32 | position: absolute; 33 | width: 0; 34 | height: 0; 35 | } 36 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/type.less: -------------------------------------------------------------------------------- 1 | // Typography.less 2 | // Headings, body text, lists, code, and more for a versatile and durable typography system 3 | // ---------------------------------------------------------------------------------------- 4 | 5 | 6 | // BODY TEXT 7 | // --------- 8 | 9 | p { 10 | margin: 0 0 @baseLineHeight / 2; 11 | font-family: @baseFontFamily; 12 | font-size: @baseFontSize; 13 | line-height: @baseLineHeight; 14 | small { 15 | font-size: @baseFontSize - 2; 16 | color: @grayLight; 17 | } 18 | } 19 | .lead { 20 | margin-bottom: @baseLineHeight; 21 | font-size: 20px; 22 | font-weight: 200; 23 | line-height: @baseLineHeight * 1.5; 24 | } 25 | 26 | // HEADINGS 27 | // -------- 28 | 29 | h1, h2, h3, h4, h5, h6 { 30 | margin: 0; 31 | font-weight: bold; 32 | color: @grayDark; 33 | text-rendering: optimizelegibility; // Fix the character spacing for headings 34 | small { 35 | font-weight: normal; 36 | color: @grayLight; 37 | } 38 | } 39 | h1 { 40 | font-size: 30px; 41 | line-height: @baseLineHeight * 2; 42 | small { 43 | font-size: 18px; 44 | } 45 | } 46 | h2 { 47 | font-size: 24px; 48 | line-height: @baseLineHeight * 2; 49 | small { 50 | font-size: 18px; 51 | } 52 | } 53 | h3 { 54 | line-height: @baseLineHeight * 1.5; 55 | font-size: 18px; 56 | small { 57 | font-size: 14px; 58 | } 59 | } 60 | h4, h5, h6 { 61 | line-height: @baseLineHeight; 62 | } 63 | h4 { 64 | font-size: 14px; 65 | small { 66 | font-size: 12px; 67 | } 68 | } 69 | h5 { 70 | font-size: 12px; 71 | } 72 | h6 { 73 | font-size: 11px; 74 | color: @grayLight; 75 | text-transform: uppercase; 76 | } 77 | 78 | // Page header 79 | .page-header { 80 | padding-bottom: @baseLineHeight - 1; 81 | margin: @baseLineHeight 0; 82 | border-bottom: 1px solid @grayLighter; 83 | } 84 | .page-header h1 { 85 | line-height: 1; 86 | } 87 | 88 | 89 | 90 | // LISTS 91 | // ----- 92 | 93 | // Unordered and Ordered lists 94 | ul, ol { 95 | padding: 0; 96 | margin: 0 0 @baseLineHeight / 2 25px; 97 | } 98 | ul ul, 99 | ul ol, 100 | ol ol, 101 | ol ul { 102 | margin-bottom: 0; 103 | } 104 | ul { 105 | list-style: disc; 106 | } 107 | ol { 108 | list-style: decimal; 109 | } 110 | li { 111 | line-height: @baseLineHeight; 112 | } 113 | ul.unstyled, 114 | ol.unstyled { 115 | margin-left: 0; 116 | list-style: none; 117 | } 118 | 119 | // Description Lists 120 | dl { 121 | margin-bottom: @baseLineHeight; 122 | } 123 | dt, 124 | dd { 125 | line-height: @baseLineHeight; 126 | } 127 | dt { 128 | font-weight: bold; 129 | } 130 | dd { 131 | margin-left: @baseLineHeight / 2; 132 | } 133 | 134 | // MISC 135 | // ---- 136 | 137 | // Horizontal rules 138 | hr { 139 | margin: @baseLineHeight 0; 140 | border: 0; 141 | border-top: 1px solid @hrBorder; 142 | border-bottom: 1px solid @white; 143 | } 144 | 145 | // Emphasis 146 | strong { 147 | font-weight: bold; 148 | } 149 | em { 150 | font-style: italic; 151 | } 152 | .muted { 153 | color: @grayLight; 154 | } 155 | 156 | // Abbreviations and acronyms 157 | abbr { 158 | font-size: 90%; 159 | text-transform: uppercase; 160 | border-bottom: 1px dotted #ddd; 161 | cursor: help; 162 | } 163 | 164 | // Blockquotes 165 | blockquote { 166 | padding: 0 0 0 15px; 167 | margin: 0 0 @baseLineHeight; 168 | border-left: 5px solid @grayLighter; 169 | p { 170 | margin-bottom: 0; 171 | #font > .shorthand(16px,300,@baseLineHeight * 1.25); 172 | } 173 | small { 174 | display: block; 175 | line-height: @baseLineHeight; 176 | color: @grayLight; 177 | &:before { 178 | content: '\2014 \00A0'; 179 | } 180 | } 181 | 182 | // Float right with text-align: right 183 | &.pull-right { 184 | float: right; 185 | padding-left: 0; 186 | padding-right: 15px; 187 | border-left: 0; 188 | border-right: 5px solid @grayLighter; 189 | p, 190 | small { 191 | text-align: right; 192 | } 193 | } 194 | } 195 | 196 | // Quotes 197 | q:before, 198 | q:after, 199 | blockquote:before, 200 | blockquote:after { 201 | content: ""; 202 | } 203 | 204 | // Addresses 205 | address { 206 | display: block; 207 | margin-bottom: @baseLineHeight; 208 | line-height: @baseLineHeight; 209 | font-style: normal; 210 | } 211 | 212 | // Misc 213 | small { 214 | font-size: 100%; 215 | } 216 | cite { 217 | font-style: normal; 218 | } 219 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/utilities.less: -------------------------------------------------------------------------------- 1 | // UTILITY CLASSES 2 | // --------------- 3 | 4 | // Quick floats 5 | .pull-right { 6 | float: right; 7 | } 8 | .pull-left { 9 | float: left; 10 | } 11 | 12 | // Toggling content 13 | .hide { 14 | display: none; 15 | } 16 | .show { 17 | display: block; 18 | } 19 | 20 | // Visibility 21 | .invisible { 22 | visibility: hidden; 23 | } 24 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/variables.less: -------------------------------------------------------------------------------- 1 | // Variables.less 2 | // Variables to customize the look and feel of Bootstrap 3 | // ----------------------------------------------------- 4 | 5 | 6 | 7 | // GLOBAL VALUES 8 | // -------------------------------------------------- 9 | 10 | // Links 11 | @linkColor: #08c; 12 | @linkColorHover: darken(@linkColor, 15%); 13 | 14 | // Grays 15 | @black: #000; 16 | @grayDarker: #222; 17 | @grayDark: #333; 18 | @gray: #555; 19 | @grayLight: #999; 20 | @grayLighter: #eee; 21 | @white: #fff; 22 | 23 | // Accent colors 24 | @blue: #049cdb; 25 | @blueDark: #0064cd; 26 | @green: #46a546; 27 | @red: #9d261d; 28 | @yellow: #ffc40d; 29 | @orange: #f89406; 30 | @pink: #c3325f; 31 | @purple: #7a43b6; 32 | 33 | // Typography 34 | @baseFontSize: 13px; 35 | @baseFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif; 36 | @baseLineHeight: 18px; 37 | @textColor: @grayDark; 38 | 39 | // Buttons 40 | @primaryButtonBackground: @linkColor; 41 | 42 | 43 | 44 | // COMPONENT VARIABLES 45 | // -------------------------------------------------- 46 | 47 | // Z-index master list 48 | // Used for a bird's eye view of components dependent on the z-axis 49 | // Try to avoid customizing these :) 50 | @zindexDropdown: 1000; 51 | @zindexPopover: 1010; 52 | @zindexTooltip: 1020; 53 | @zindexFixedNavbar: 1030; 54 | @zindexModalBackdrop: 1040; 55 | @zindexModal: 1050; 56 | 57 | // Sprite icons path 58 | @iconSpritePath: "../img/glyphicons-halflings.png"; 59 | @iconWhiteSpritePath: "../img/glyphicons-halflings-white.png"; 60 | 61 | // Input placeholder text color 62 | @placeholderText: @grayLight; 63 | 64 | // Hr border color 65 | @hrBorder: @grayLighter; 66 | 67 | // Navbar 68 | @navbarHeight: 40px; 69 | @navbarBackground: @grayDarker; 70 | @navbarBackgroundHighlight: @grayDark; 71 | @navbarLinkBackgroundHover: transparent; 72 | 73 | @navbarText: @grayLight; 74 | @navbarLinkColor: @grayLight; 75 | @navbarLinkColorHover: @white; 76 | 77 | // Form states and alerts 78 | @warningText: #c09853; 79 | @warningBackground: #fcf8e3; 80 | @warningBorder: darken(spin(@warningBackground, -10), 3%); 81 | 82 | @errorText: #b94a48; 83 | @errorBackground: #f2dede; 84 | @errorBorder: darken(spin(@errorBackground, -10), 3%); 85 | 86 | @successText: #468847; 87 | @successBackground: #dff0d8; 88 | @successBorder: darken(spin(@successBackground, -10), 5%); 89 | 90 | @infoText: #3a87ad; 91 | @infoBackground: #d9edf7; 92 | @infoBorder: darken(spin(@infoBackground, -10), 7%); 93 | 94 | 95 | 96 | // GRID 97 | // -------------------------------------------------- 98 | 99 | // Default 940px grid 100 | @gridColumns: 12; 101 | @gridColumnWidth: 60px; 102 | @gridGutterWidth: 20px; 103 | @gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1)); 104 | 105 | // Fluid grid 106 | @fluidGridColumnWidth: 6.382978723%; 107 | @fluidGridGutterWidth: 2.127659574%; 108 | -------------------------------------------------------------------------------- /demo/browser/bootstrap/less/wells.less: -------------------------------------------------------------------------------- 1 | // WELLS 2 | // ----- 3 | 4 | .well { 5 | min-height: 20px; 6 | padding: 19px; 7 | margin-bottom: 20px; 8 | background-color: #f5f5f5; 9 | border: 1px solid #eee; 10 | border: 1px solid rgba(0,0,0,.05); 11 | .border-radius(4px); 12 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 13 | blockquote { 14 | border-color: #ddd; 15 | border-color: rgba(0,0,0,.15); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /demo/browser/demo.less: -------------------------------------------------------------------------------- 1 | @import "bootstrap/less/bootstrap.less"; 2 | @import "../../Markdown.Editor.less"; 3 | -------------------------------------------------------------------------------- /demo/node/demo.js: -------------------------------------------------------------------------------- 1 | // NOTE: This is just a demo -- in a production environment, 2 | // be sure to spend a few more thoughts on sanitizing user input. 3 | // (also, you probably wouldn't use a get request) 4 | 5 | var http = require("http"), 6 | url = require("url"), 7 | querystring = require("querystring"), 8 | Converter = require("../../Markdown.Converter").Converter, 9 | getSanitizingConverter = require("../../Markdown.Sanitizer").getSanitizingConverter, 10 | conv = new Converter(), 11 | saneConv = getSanitizingConverter(); 12 | 13 | http.createServer(function (req, res) { 14 | 15 | var route = url.parse(req.url); 16 | if (route.pathname !== "/") { 17 | res.writeHead(404); 18 | res.end("Page not found"); 19 | return; 20 | } 21 | 22 | var query = querystring.parse(route.query); 23 | 24 | res.writeHead(200, { "Content-type": "text/html" }); 25 | res.write(""); 26 | 27 | var markdown = query.md || "## Hello!\n\nI'm walking\n\nVisit [Stack Overflow](http://stackoverflow.com)\n\nThis is never closed!"; 28 | 29 | res.write("

      Your output, sanitized:

      \n" + saneConv.makeHtml(markdown)) 30 | res.write("

      Your output, unsanitized:

      \n" + conv.makeHtml(markdown)) 31 | 32 | res.write( 33 | "

      Enter Markdown

      \n" + 34 | "
      " + 35 | "
      " + 38 | "" + 39 | "
      " 40 | ); 41 | 42 | res.end(""); 43 | 44 | }).listen(8000); 45 | --------------------------------------------------------------------------------