├── .gitignore
├── .nojekyll
├── Gruntfile.js
├── README.md
├── assets
├── global.min.css
├── global.min.js
└── temp
│ ├── bootstrap.js
│ ├── bootstrap.needed.css
│ ├── script.js
│ └── taboverride.js
├── css
├── bootstrap.css
├── screen.css
└── screen.styl
├── img
├── data.png
├── furley_bg.png
├── html.png
└── jade.png
├── index.html
├── index.jade
├── js
├── bootstrap.js
├── jade.js
├── jquery.js
├── script.coffee
├── script.js
└── taboverride.js
└── package.json
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
--------------------------------------------------------------------------------
/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naltatis/jade-syntax-docs/a8b76f485f42b818a04e5966c939063104869478/.nojekyll
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 | grunt.initConfig({
3 | coffee: {
4 | compile: {
5 | files: {
6 | "js/script.js": "js/script.coffee"
7 | }
8 | }
9 | },
10 | jade: {
11 | compile: {
12 | files: {
13 | "index.html": "index.jade"
14 | }
15 | }
16 | },
17 | stylus: {
18 | compile: {
19 | options: {
20 | compress: true,
21 | paths: ['node_modules']
22 | },
23 | files: {
24 | 'css/screen.css': 'css/screen.styl'
25 | }
26 | }
27 | },
28 | uglify: {
29 | bootstrap: {
30 | src: 'js/bootstrap.js',
31 | dest: 'assets/temp/bootstrap.js'
32 | },
33 | script: {
34 | src: 'js/script.js',
35 | dest: 'assets/temp/script.js'
36 | },
37 | tab: {
38 | src: 'js/taboverride.js',
39 | dest: 'assets/temp/taboverride.js'
40 | }
41 | },
42 | concat: {
43 | dist: {
44 | src: ['js/jquery.js', 'js/jade.js', 'assets/temp/*.js'],
45 | dest: 'assets/global.min.js'
46 | }
47 | },
48 | cssmin: {
49 | compile: {
50 | files: {
51 | "assets/global.min.css": ["assets/temp/bootstrap.needed.css", "css/screen.css"]
52 | }
53 | }
54 | },
55 | connect: {
56 | server: {
57 | options: {
58 | port: 9000,
59 | base: './'
60 | }
61 | }
62 | },
63 | watch: {
64 | files: ['js/server.coffee', 'css/*', 'index.jade'],
65 | tasks: 'compile'
66 | },
67 | uncss: {
68 | dist: {
69 | options: {
70 | stylesheets: ['css/bootstrap.css']
71 | },
72 | files: {
73 | 'assets/temp/bootstrap.needed.css': ['index.html']
74 | }
75 | }
76 | },
77 | inline: {
78 | main: {
79 | options:{
80 | tag: ''
81 | },
82 | files: {
83 | src: ['index.html']
84 | }
85 | }
86 | }
87 | });
88 |
89 | grunt.loadNpmTasks('grunt-contrib-coffee');
90 | grunt.loadNpmTasks('grunt-contrib-connect');
91 | grunt.loadNpmTasks('grunt-contrib-concat');
92 | grunt.loadNpmTasks('grunt-contrib-jade');
93 | grunt.loadNpmTasks('grunt-contrib-cssmin');
94 | grunt.loadNpmTasks('grunt-contrib-stylus');
95 | grunt.loadNpmTasks('grunt-contrib-watch');
96 | grunt.loadNpmTasks('grunt-contrib-uglify');
97 | grunt.loadNpmTasks('grunt-uncss');
98 | grunt.loadNpmTasks('grunt-inline');
99 |
100 | grunt.registerTask('default', ['compile', 'connect', 'watch']);
101 | grunt.registerTask('compile', ['coffee', 'jade', 'uncss', 'stylus', 'uglify', 'cssmin', 'concat', 'inline']);
102 | };
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Jade Template Syntax by Example
2 |
3 |
--------------------------------------------------------------------------------
/assets/global.min.css:
--------------------------------------------------------------------------------
1 | footer,header,section{display:block}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}img{max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}textarea{margin:0;font-size:100%;vertical-align:middle}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}textarea{overflow:auto;vertical-align:top}body{margin:0;font-family:Ubuntu,Tahoma,sans-serif;font-size:13px;line-height:18px;color:#333;background-color:#fff}a{color:#dd4814;text-decoration:none}a:hover{color:#97310e;text-decoration:underline}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;content:""}.row:after{clear:both}[class*=span]{float:left;margin-left:20px}.container{width:940px}.span6{width:460px}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;content:""}.container:after{clear:both}p{margin:0 0 9px}.lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px}h1,h2{margin:0;font-family:inherit;font-weight:700;color:inherit;text-rendering:optimizelegibility}h1 small{font-weight:400;color:#999}h1{font-size:30px;line-height:36px}h1 small{font-size:18px}h2{font-size:24px;line-height:36px}.page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #f5f5f5}ul{padding:0;margin:0 0 9px 25px}ul{list-style:disc}li{line-height:18px}hr{margin:18px 0;border:0;border-top:1px solid #f5f5f5;border-bottom:1px solid #fff}strong{font-weight:700}small{font-size:100%}textarea{font-size:13px;font-weight:400;line-height:18px}textarea{font-family:Ubuntu,Tahoma,sans-serif}textarea{display:inline-block;height:18px;padding:4px;margin-bottom:9px;font-size:13px;line-height:18px;color:#555}textarea{width:210px}textarea{height:auto}textarea{background-color:#fff;border:1px solid #ccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-ms-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus{border-color:rgba(82,168,236,.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6)}textarea{margin-left:0}textarea[readonly]{cursor:not-allowed;background-color:#f5f5f5;border-color:#ddd}:-moz-placeholder{color:#999}:-ms-input-placeholder{color:#999}button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0;border:0}.nav{margin-left:0;margin-bottom:18px;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#f5f5f5}.nav-pills{*zoom:1}.nav-pills:before,.nav-pills:after{display:table;content:""}.nav-pills:after{clear:both}.nav-pills>li{float:left}.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.navbar-search .search-query:-moz-placeholder{color:#fff}.navbar-search .search-query:-ms-input-placeholder{color:#fff}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}body{padding:60px 0 0;background:url(../img/furley_bg.png) center}h1{font-weight:500}.lead{font-size:17px}.lead strong{font-weight:700}.lead a{color:#333;text-decoration:underline}footer{margin-top:20px;padding:10px;text-align:center;background:#f5f5f5;border-top:1px solid #d5d5d5}footer p{display:inline-block;margin:0 20px;vertical-align:top}section{padding:50px 0}section#basics{padding-top:20px}hr{border-color:#e5e5e5}.right{text-align:right}.span6{position:relative}.jadeLabel,.dataLabel,.htmlLabel{-webkit-transition:opacity .4s ease-in 1.5s;-moz-transition:opacity .4s ease-in 1.5s;-o-transition:opacity .4s ease-in 1.5s;-ms-transition:opacity .4s ease-in 1.5s;transition:opacity .4s ease-in 1.5s;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);position:absolute;background-repeat:no-repeat;height:30px}.row.annotate .jadeLabel,.row.annotate .dataLabel,.row.annotate .htmlLabel{opacity:1;-ms-filter:none;filter:none}.jadeLabel{-webkit-transition-delay:1.4s;-moz-transition-delay:1.4s;-o-transition-delay:1.4s;-ms-transition-delay:1.4s;transition-delay:1.4s;right:10%;top:-30px;background-image:url(../img/jade.png);width:132px}.dataLabel{-webkit-transition-delay:1.5s;-moz-transition-delay:1.5s;-o-transition-delay:1.5s;-ms-transition-delay:1.5s;transition-delay:1.5s;right:9%;bottom:-32px;background-image:url(../img/data.png);width:130px}.htmlLabel{-webkit-transition-delay:1.6s;-moz-transition-delay:1.6s;-o-transition-delay:1.6s;-ms-transition-delay:1.6s;transition-delay:1.6s;left:9%;top:-33px;background-image:url(../img/html.png);width:146px}textarea{text-align:left;width:91%;display:inline-block;padding:8.5px;margin:0 0 6px;font-size:15px;line-height:24px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid rgba(0,0,0,.15);-webkit-border-radius:4px;border-radius:4px;font-family:'Droid Sans Mono',sans-serif;color:#333}textarea.html{cursor:default}textarea.error{color:red}textarea.size1{height:24px}textarea.size2{height:48px}textarea.size3{height:72px}textarea.size4{height:96px}textarea.size5{height:120px}textarea.size6{height:144px}textarea.size7{height:168px}textarea.size8{height:192px}textarea.size9{height:216px}.page-header{margin-bottom:0;border:0}.subhead{padding-bottom:0;margin-bottom:30px}.subhead h1{font-size:40px;margin-bottom:30px}.subnav{width:100%;height:36px;background-color:#eee;background-repeat:repeat-x;background-image:-moz-linear-gradient(top,#f5f5f5 0,#eee 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f5f5f5),color-stop(100%,#eee));background-image:-webkit-linear-gradient(top,#f5f5f5 0,#eee 100%);background-image:-ms-linear-gradient(top,#f5f5f5 0,#eee 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#eee 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#f5f5f5),color-stop(1,#eee));background-image:-webkit-linear-gradient(top,#f5f5f5 0,#eee 100%);background-image:-moz-linear-gradient(top,#f5f5f5 0,#eee 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#eee 100%);background-image:-ms-linear-gradient(top,#f5f5f5 0,#eee 100%);background-image:linear-gradient(top,#f5f5f5 0,#eee 100%);border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.subnav .nav{margin-bottom:0}.subnav .nav>li>a{margin:0;padding-top:11px;padding-bottom:11px;border-left:1px solid #f5f5f5;border-right:1px solid #e5e5e5;-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.subnav .nav>.active>a,.subnav .nav>.active>a:hover{padding-left:13px;color:#777;background-color:#e9e9e9;border-right-color:#ddd;border-left:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.05);-moz-box-shadow:inset 0 3px 5px rgba(0,0,0,.05);-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.05);box-shadow:inset 0 3px 5px rgba(0,0,0,.05)}.subnav .nav>.active>a .caret,.subnav .nav>.active>a:hover .caret{border-top-color:#777}.subnav .nav>li:first-child>a,.subnav .nav>li:first-child>a:hover{border-left:0;padding-left:12px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;-webkit-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.subnav .nav>li:last-child>a{border-right:0}.subnav .dropdown-menu{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;-webkit-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}@media (min-width:980px){.subnav-fixed{position:fixed;top:0;left:0;right:0;z-index:1020;border-color:#d5d5d5;border-width:0 0 1px;-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 5px rgba(0,0,0,.1);box-shadow:inset 0 1px 0 #fff,0 1px 5px rgba(0,0,0,.1)}.subnav-fixed .nav{width:938px;margin:0 auto;padding:0 1px}.subnav .nav>li:first-child>a,.subnav .nav>li:first-child>a:hover{-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}}
--------------------------------------------------------------------------------
/assets/temp/bootstrap.js:
--------------------------------------------------------------------------------
1 | !function(t){t(function(){"use strict";t.support.transition=function(){var t=function(){var t,e=document.createElement("bootstrap"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"};for(t in i)if(void 0!==e.style[t])return i[t]}();return t&&{end:t}}()})}(window.jQuery),!function(t){"use strict";var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.prototype.close=function(e){function i(){n.trigger("closed").remove()}var n,s=t(this),o=s.attr("data-target");o||(o=s.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),n=t(o),e&&e.preventDefault(),n.length||(n=s.hasClass("alert")?s:s.parent()),n.trigger(e=t.Event("close")),e.isDefaultPrevented()||(n.removeClass("in"),t.support.transition&&n.hasClass("fade")?n.on(t.support.transition.end,i):i())},t.fn.alert=function(e){return this.each(function(){var n=t(this),s=n.data("alert");s||n.data("alert",s=new i(this)),"string"==typeof e&&s[e].call(n)})},t.fn.alert.Constructor=i,t(function(){t("body").on("click.alert.data-api",e,i.prototype.close)})}(window.jQuery),!function(t){"use strict";var e=function(e,i){this.$element=t(e),this.options=t.extend({},t.fn.button.defaults,i)};e.prototype.setState=function(t){var e="disabled",i=this.$element,n=i.data(),s=i.is("input")?"val":"html";t+="Text",n.resetText||i.data("resetText",i[s]()),i[s](n[t]||this.options[t]),setTimeout(function(){"loadingText"==t?i.addClass(e).attr(e,e):i.removeClass(e).removeAttr(e)},0)},e.prototype.toggle=function(){var t=this.$element.parent('[data-toggle="buttons-radio"]');t&&t.find(".active").removeClass("active"),this.$element.toggleClass("active")},t.fn.button=function(i){return this.each(function(){var n=t(this),s=n.data("button"),o="object"==typeof i&&i;s||n.data("button",s=new e(this,o)),"toggle"==i?s.toggle():i&&s.setState(i)})},t.fn.button.defaults={loadingText:"loading..."},t.fn.button.Constructor=e,t(function(){t("body").on("click.button.data-api","[data-toggle^=button]",function(e){var i=t(e.target);i.hasClass("btn")||(i=i.closest(".btn")),i.button("toggle")})})}(window.jQuery),!function(t){"use strict";var e=function(e,i){this.$element=t(e),this.options=i,this.options.slide&&this.slide(this.options.slide),"hover"==this.options.pause&&this.$element.on("mouseenter",t.proxy(this.pause,this)).on("mouseleave",t.proxy(this.cycle,this))};e.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},to:function(e){var i=this.$element.find(".active"),n=i.parent().children(),s=n.index(i),o=this;if(!(e>n.length-1||0>e))return this.sliding?this.$element.one("slid",function(){o.to(e)}):s==e?this.pause().cycle():this.slide(e>s?"next":"prev",t(n[e]))},pause:function(t){return t||(this.paused=!0),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(e,i){var n=this.$element.find(".active"),s=i||n[e](),o=this.interval,a="next"==e?"left":"right",r="next"==e?"first":"last",h=this,l=t.Event("slide");if(this.sliding=!0,o&&this.pause(),s=s.length?s:this.$element.find(".item")[r](),!s.hasClass("active")){if(t.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(l),l.isDefaultPrevented())return;s.addClass(e),s[0].offsetWidth,n.addClass(a),s.addClass(a),this.$element.one(t.support.transition.end,function(){s.removeClass([e,a].join(" ")).addClass("active"),n.removeClass(["active",a].join(" ")),h.sliding=!1,setTimeout(function(){h.$element.trigger("slid")},0)})}else{if(this.$element.trigger(l),l.isDefaultPrevented())return;n.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return o&&this.cycle(),this}}},t.fn.carousel=function(i){return this.each(function(){var n=t(this),s=n.data("carousel"),o=t.extend({},t.fn.carousel.defaults,"object"==typeof i&&i);s||n.data("carousel",s=new e(this,o)),"number"==typeof i?s.to(i):"string"==typeof i||(i=o.slide)?s[i]():o.interval&&s.cycle()})},t.fn.carousel.defaults={interval:5e3,pause:"hover"},t.fn.carousel.Constructor=e,t(function(){t("body").on("click.carousel.data-api","[data-slide]",function(e){var i,n=t(this),s=t(n.attr("data-target")||(i=n.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),o=!s.data("modal")&&t.extend({},s.data(),n.data());s.carousel(o),e.preventDefault()})})}(window.jQuery),!function(t){"use strict";var e=function(e,i){this.$element=t(e),this.options=t.extend({},t.fn.collapse.defaults,i),this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};e.prototype={constructor:e,dimension:function(){var t=this.$element.hasClass("width");return t?"width":"height"},show:function(){var e,i,n,s;if(!this.transitioning){if(e=this.dimension(),i=t.camelCase(["scroll",e].join("-")),n=this.$parent&&this.$parent.find("> .accordion-group > .in"),n&&n.length){if(s=n.data("collapse"),s&&s.transitioning)return;n.collapse("hide"),s||n.data("collapse",null)}this.$element[e](0),this.transition("addClass",t.Event("show"),"shown"),this.$element[e](this.$element[0][i])}},hide:function(){var e;this.transitioning||(e=this.dimension(),this.reset(this.$element[e]()),this.transition("removeClass",t.Event("hide"),"hidden"),this.$element[e](0))},reset:function(t){var e=this.dimension();return this.$element.removeClass("collapse")[e](t||"auto")[0].offsetWidth,this.$element[null!==t?"addClass":"removeClass"]("collapse"),this},transition:function(e,i,n){var s=this,o=function(){"show"==i.type&&s.reset(),s.transitioning=0,s.$element.trigger(n)};this.$element.trigger(i),i.isDefaultPrevented()||(this.transitioning=1,this.$element[e]("in"),t.support.transition&&this.$element.hasClass("collapse")?this.$element.one(t.support.transition.end,o):o())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},t.fn.collapse=function(i){return this.each(function(){var n=t(this),s=n.data("collapse"),o="object"==typeof i&&i;s||n.data("collapse",s=new e(this,o)),"string"==typeof i&&s[i]()})},t.fn.collapse.defaults={toggle:!0},t.fn.collapse.Constructor=e,t(function(){t("body").on("click.collapse.data-api","[data-toggle=collapse]",function(e){var i,n=t(this),s=n.attr("data-target")||e.preventDefault()||(i=n.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,""),o=t(s).data("collapse")?"toggle":n.data();t(s).collapse(o)})})}(window.jQuery),!function(t){"use strict";function e(){t(i).parent().removeClass("open")}var i='[data-toggle="dropdown"]',n=function(e){var i=t(e).on("click.dropdown.data-api",this.toggle);t("html").on("click.dropdown.data-api",function(){i.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(){var i,n,s,o=t(this);if(!o.is(".disabled, :disabled"))return n=o.attr("data-target"),n||(n=o.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,"")),i=t(n),i.length||(i=o.parent()),s=i.hasClass("open"),e(),s||i.toggleClass("open"),!1}},t.fn.dropdown=function(e){return this.each(function(){var i=t(this),s=i.data("dropdown");s||i.data("dropdown",s=new n(this)),"string"==typeof e&&s[e].call(i)})},t.fn.dropdown.Constructor=n,t(function(){t("html").on("click.dropdown.data-api",e),t("body").on("click.dropdown",".dropdown form",function(t){t.stopPropagation()}).on("click.dropdown.data-api",i,n.prototype.toggle)})}(window.jQuery),!function(t){"use strict";function e(){var e=this,n=setTimeout(function(){e.$element.off(t.support.transition.end),i.call(e)},500);this.$element.one(t.support.transition.end,function(){clearTimeout(n),i.call(e)})}function i(){this.$element.hide().trigger("hidden"),n.call(this)}function n(e){var i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var n=t.support.transition&&i;this.$backdrop=t('
').appendTo(document.body),"static"!=this.options.backdrop&&this.$backdrop.click(t.proxy(this.hide,this)),n&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),n?this.$backdrop.one(t.support.transition.end,e):e()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(t.support.transition.end,t.proxy(s,this)):s.call(this)):e&&e()}function s(){this.$backdrop.remove(),this.$backdrop=null}function o(){var e=this;this.isShown&&this.options.keyboard?t(document).on("keyup.dismiss.modal",function(t){27==t.which&&e.hide()}):this.isShown||t(document).off("keyup.dismiss.modal")}var a=function(e,i){this.options=i,this.$element=t(e).delegate('[data-dismiss="modal"]',"click.dismiss.modal",t.proxy(this.hide,this))};a.prototype={constructor:a,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var e=this,i=t.Event("show");this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(t("body").addClass("modal-open"),this.isShown=!0,o.call(this),n.call(this,function(){var i=t.support.transition&&e.$element.hasClass("fade");e.$element.parent().length||e.$element.appendTo(document.body),e.$element.show(),i&&e.$element[0].offsetWidth,e.$element.addClass("in"),i?e.$element.one(t.support.transition.end,function(){e.$element.trigger("shown")}):e.$element.trigger("shown")}))},hide:function(n){n&&n.preventDefault(),n=t.Event("hide"),this.$element.trigger(n),this.isShown&&!n.isDefaultPrevented()&&(this.isShown=!1,t("body").removeClass("modal-open"),o.call(this),this.$element.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?e.call(this):i.call(this))}},t.fn.modal=function(e){return this.each(function(){var i=t(this),n=i.data("modal"),s=t.extend({},t.fn.modal.defaults,i.data(),"object"==typeof e&&e);n||i.data("modal",n=new a(this,s)),"string"==typeof e?n[e]():s.show&&n.show()})},t.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},t.fn.modal.Constructor=a,t(function(){t("body").on("click.modal.data-api",'[data-toggle="modal"]',function(e){var i,n=t(this),s=t(n.attr("data-target")||(i=n.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),o=s.data("modal")?"toggle":t.extend({},s.data(),n.data());e.preventDefault(),s.modal(o)})})}(window.jQuery),!function(t){"use strict";var e=function(t,e){this.init("tooltip",t,e)};e.prototype={constructor:e,init:function(e,i,n){var s,o;this.type=e,this.$element=t(i),this.options=this.getOptions(n),this.enabled=!0,"manual"!=this.options.trigger&&(s="hover"==this.options.trigger?"mouseenter":"focus",o="hover"==this.options.trigger?"mouseleave":"blur",this.$element.on(s,this.options.selector,t.proxy(this.enter,this)),this.$element.on(o,this.options.selector,t.proxy(this.leave,this))),this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(e){return e=t.extend({},t.fn[this.type].defaults,e,this.$element.data()),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},enter:function(e){var i=t(e.currentTarget)[this.type](this._options).data(this.type);return i.options.delay&&i.options.delay.show?(clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show),void 0):i.show()},leave:function(e){var i=t(e.currentTarget)[this.type](this._options).data(this.type);return this.timeout&&clearTimeout(this.timeout),i.options.delay&&i.options.delay.hide?(i.hoverState="out",this.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide),void 0):i.hide()},show:function(){var t,e,i,n,s,o,a;if(this.hasContent()&&this.enabled){switch(t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),o="function"==typeof this.options.placement?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,e=/in/.test(o),t.remove().css({top:0,left:0,display:"block"}).appendTo(e?this.$element:document.body),i=this.getPosition(e),n=t[0].offsetWidth,s=t[0].offsetHeight,e?o.split(" ")[1]:o){case"bottom":a={top:i.top+i.height,left:i.left+i.width/2-n/2};break;case"top":a={top:i.top-s,left:i.left+i.width/2-n/2};break;case"left":a={top:i.top+i.height/2-s/2,left:i.left-n};break;case"right":a={top:i.top+i.height/2-s/2,left:i.left+i.width}}t.css(a).addClass(o).addClass("in")}},isHTML:function(t){return"string"!=typeof t||"<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3||/^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(t)},setContent:function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.isHTML(e)?"html":"text"](e),t.removeClass("fade in top bottom left right")},hide:function(){function e(){var e=setTimeout(function(){i.off(t.support.transition.end).remove()},500);i.one(t.support.transition.end,function(){clearTimeout(e),i.remove()})}var i=this.tip();i.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?e():i.remove()},fixTitle:function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(e){return t.extend({},e?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},tip:function(){return this.$tip=this.$tip||t(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},t.fn.tooltip=function(i){return this.each(function(){var n=t(this),s=n.data("tooltip"),o="object"==typeof i&&i;s||n.data("tooltip",s=new e(this,o)),"string"==typeof i&&s[i]()})},t.fn.tooltip.Constructor=e,t.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover",title:"",delay:0}}(window.jQuery),!function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype,{constructor:e,setContent:function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.isHTML(e)?"html":"text"](e),t.find(".popover-content > *")[this.isHTML(i)?"html":"text"](i),t.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var t,e=this.$element,i=this.options;return t=e.attr("data-content")||("function"==typeof i.content?i.content.call(e[0]):i.content)},tip:function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip}}),t.fn.popover=function(i){return this.each(function(){var n=t(this),s=n.data("popover"),o="object"==typeof i&&i;s||n.data("popover",s=new e(this,o)),"string"==typeof i&&s[i]()})},t.fn.popover.Constructor=e,t.fn.popover.defaults=t.extend({},t.fn.tooltip.defaults,{placement:"right",content:"",template:''})}(window.jQuery),!function(t){"use strict";function e(e,i){var n,s=t.proxy(this.process,this),o=t(e).is("body")?t(window):t(e);this.options=t.extend({},t.fn.scrollspy.defaults,i),this.$scrollElement=o.on("scroll.scroll.data-api",s),this.selector=(this.options.target||(n=t(e).attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=t("body"),this.refresh(),this.process()}e.prototype={constructor:e,refresh:function(){var e,i=this;this.offsets=t([]),this.targets=t([]),e=this.$body.find(this.selector).map(function(){var e=t(this),i=e.data("target")||e.attr("href"),n=/^#\w/.test(i)&&t(i);return n&&i.length&&[[n.position().top,i]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){i.offsets.push(this[0]),i.targets.push(this[1])})},process:function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=i-this.$scrollElement.height(),s=this.offsets,o=this.targets,a=this.activeTarget;if(e>=n)return a!=(t=o.last()[0])&&this.activate(t);for(t=s.length;t--;)a!=o[t]&&e>=s[t]&&(!s[t+1]||s[t+1]>=e)&&this.activate(o[t])},activate:function(e){var i,n;this.activeTarget=e,t(this.selector).parent(".active").removeClass("active"),n=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',i=t(n).parent("li").addClass("active"),i.parent(".dropdown-menu")&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate")}},t.fn.scrollspy=function(i){return this.each(function(){var n=t(this),s=n.data("scrollspy"),o="object"==typeof i&&i;s||n.data("scrollspy",s=new e(this,o)),"string"==typeof i&&s[i]()})},t.fn.scrollspy.Constructor=e,t.fn.scrollspy.defaults={offset:10},t(function(){t('[data-spy="scroll"]').each(function(){var e=t(this);e.scrollspy(e.data())})})}(window.jQuery),!function(t){"use strict";var e=function(e){this.element=t(e)};e.prototype={constructor:e,show:function(){var e,i,n,s=this.element,o=s.closest("ul:not(.dropdown-menu)"),a=s.attr("data-target");a||(a=s.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,"")),s.parent("li").hasClass("active")||(e=o.find(".active a").last()[0],n=t.Event("show",{relatedTarget:e}),s.trigger(n),n.isDefaultPrevented()||(i=t(a),this.activate(s.parent("li"),o),this.activate(i,i.parent(),function(){s.trigger({type:"shown",relatedTarget:e})})))},activate:function(e,i,n){function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),a?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),n&&n()}var o=i.find("> .active"),a=n&&t.support.transition&&o.hasClass("fade");a?o.one(t.support.transition.end,s):s(),o.removeClass("in")}},t.fn.tab=function(i){return this.each(function(){var n=t(this),s=n.data("tab");s||n.data("tab",s=new e(this)),"string"==typeof i&&s[i]()})},t.fn.tab.Constructor=e,t(function(){t("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault(),t(this).tab("show")})})}(window.jQuery),!function(t){"use strict";var e=function(e,i){this.$element=t(e),this.options=t.extend({},t.fn.typeahead.defaults,i),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=t(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};e.prototype={constructor:e,select:function(){var t=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(t)).change(),this.hide()},updater:function(t){return t},show:function(){var e=t.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:e.top+e.height,left:e.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(){var e,i=this;return this.query=this.$element.val(),this.query?(e=t.grep(this.source,function(t){return i.matcher(t)}),e=this.sorter(e),e.length?this.render(e.slice(0,this.options.items)).show():this.shown?this.hide():this):this.shown?this.hide():this},matcher:function(t){return~t.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(t){for(var e,i=[],n=[],s=[];e=t.shift();)e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?n.push(e):s.push(e):i.push(e);return i.concat(n,s)},highlighter:function(t){var e=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return t.replace(RegExp("("+e+")","ig"),function(t,e){return""+e+" "})},render:function(e){var i=this;return e=t(e).map(function(e,n){return e=t(i.options.item).attr("data-value",n),e.find("a").html(i.highlighter(n)),e[0]}),e.first().addClass("active"),this.$menu.html(e),this},next:function(){var e=this.$menu.find(".active").removeClass("active"),i=e.next();i.length||(i=t(this.$menu.find("li")[0])),i.addClass("active")},prev:function(){var t=this.$menu.find(".active").removeClass("active"),e=t.prev();e.length||(e=this.$menu.find("li").last()),e.addClass("active")},listen:function(){this.$element.on("blur",t.proxy(this.blur,this)).on("keypress",t.proxy(this.keypress,this)).on("keyup",t.proxy(this.keyup,this)),(t.browser.webkit||t.browser.msie)&&this.$element.on("keydown",t.proxy(this.keypress,this)),this.$menu.on("click",t.proxy(this.click,this)).on("mouseenter","li",t.proxy(this.mouseenter,this))},keyup:function(t){switch(t.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}t.stopPropagation(),t.preventDefault()},keypress:function(t){if(this.shown){switch(t.keyCode){case 9:case 13:case 27:t.preventDefault();break;case 38:if("keydown"!=t.type)break;t.preventDefault(),this.prev();break;case 40:if("keydown"!=t.type)break;t.preventDefault(),this.next()}t.stopPropagation()}},blur:function(){var t=this;setTimeout(function(){t.hide()},150)},click:function(t){t.stopPropagation(),t.preventDefault(),this.select()},mouseenter:function(e){this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")}},t.fn.typeahead=function(i){return this.each(function(){var n=t(this),s=n.data("typeahead"),o="object"==typeof i&&i;s||n.data("typeahead",s=new e(this,o)),"string"==typeof i&&s[i]()})},t.fn.typeahead.defaults={source:[],items:8,menu:'',item:' '},t.fn.typeahead.Constructor=e,t(function(){t("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(e){var i=t(this);i.data("typeahead")||(e.preventDefault(),i.typeahead(i.data()))})})}(window.jQuery);
--------------------------------------------------------------------------------
/assets/temp/bootstrap.needed.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Bootstrap v2.0.4
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 | footer,
12 | header,
13 | section {
14 | display: block;
15 | }
16 |
17 | html {
18 | font-size: 100%;
19 | -webkit-text-size-adjust: 100%;
20 | -ms-text-size-adjust: 100%;
21 | }
22 |
23 | a:focus {
24 | outline: thin dotted #333;
25 | outline: 5px auto -webkit-focus-ring-color;
26 | outline-offset: -2px;
27 | }
28 |
29 | a:hover,
30 | a:active {
31 | outline: 0;
32 | }
33 |
34 | img {
35 | max-width: 100%;
36 | vertical-align: middle;
37 | border: 0;
38 | -ms-interpolation-mode: bicubic;
39 | }
40 |
41 | textarea {
42 | margin: 0;
43 | font-size: 100%;
44 | vertical-align: middle;
45 | }
46 |
47 | button::-moz-focus-inner,
48 | input::-moz-focus-inner {
49 | padding: 0;
50 | border: 0;
51 | }
52 |
53 | textarea {
54 | overflow: auto;
55 | vertical-align: top;
56 | }
57 |
58 | body {
59 | margin: 0;
60 | font-family: 'Ubuntu', Tahoma, sans-serif;
61 | font-size: 13px;
62 | line-height: 18px;
63 | color: #333333;
64 | background-color: #ffffff;
65 | }
66 |
67 | a {
68 | color: #dd4814;
69 | text-decoration: none;
70 | }
71 |
72 | a:hover {
73 | color: #97310e;
74 | text-decoration: underline;
75 | }
76 |
77 | .row {
78 | margin-left: -20px;
79 | *zoom: 1;
80 | }
81 |
82 | .row:before,
83 | .row:after {
84 | display: table;
85 | content: "";
86 | }
87 |
88 | .row:after {
89 | clear: both;
90 | }
91 |
92 | [class*="span"] {
93 | float: left;
94 | margin-left: 20px;
95 | }
96 |
97 | .container {
98 | width: 940px;
99 | }
100 |
101 | .span6 {
102 | width: 460px;
103 | }
104 |
105 | .container {
106 | margin-right: auto;
107 | margin-left: auto;
108 | *zoom: 1;
109 | }
110 |
111 | .container:before,
112 | .container:after {
113 | display: table;
114 | content: "";
115 | }
116 |
117 | .container:after {
118 | clear: both;
119 | }
120 |
121 | p {
122 | margin: 0 0 9px;
123 | }
124 |
125 | .lead {
126 | margin-bottom: 18px;
127 | font-size: 20px;
128 | font-weight: 200;
129 | line-height: 27px;
130 | }
131 |
132 | h1,
133 | h2 {
134 | margin: 0;
135 | font-family: inherit;
136 | font-weight: bold;
137 | color: inherit;
138 | text-rendering: optimizelegibility;
139 | }
140 |
141 | h1 small {
142 | font-weight: normal;
143 | color: #999999;
144 | }
145 |
146 | h1 {
147 | font-size: 30px;
148 | line-height: 36px;
149 | }
150 |
151 | h1 small {
152 | font-size: 18px;
153 | }
154 |
155 | h2 {
156 | font-size: 24px;
157 | line-height: 36px;
158 | }
159 |
160 | .page-header {
161 | padding-bottom: 17px;
162 | margin: 18px 0;
163 | border-bottom: 1px solid #f5f5f5;
164 | }
165 |
166 | ul {
167 | padding: 0;
168 | margin: 0 0 9px 25px;
169 | }
170 |
171 | ul {
172 | list-style: disc;
173 | }
174 |
175 | li {
176 | line-height: 18px;
177 | }
178 |
179 | hr {
180 | margin: 18px 0;
181 | border: 0;
182 | border-top: 1px solid #f5f5f5;
183 | border-bottom: 1px solid #ffffff;
184 | }
185 |
186 | strong {
187 | font-weight: bold;
188 | }
189 |
190 | small {
191 | font-size: 100%;
192 | }
193 |
194 | textarea {
195 | font-size: 13px;
196 | font-weight: normal;
197 | line-height: 18px;
198 | }
199 |
200 | textarea {
201 | font-family: 'Ubuntu', Tahoma, sans-serif;
202 | }
203 |
204 | textarea {
205 | display: inline-block;
206 | height: 18px;
207 | padding: 4px;
208 | margin-bottom: 9px;
209 | font-size: 13px;
210 | line-height: 18px;
211 | color: #555555;
212 | }
213 |
214 | textarea {
215 | width: 210px;
216 | }
217 |
218 | textarea {
219 | height: auto;
220 | }
221 |
222 | textarea {
223 | background-color: #ffffff;
224 | border: 1px solid #cccccc;
225 | -webkit-border-radius: 3px;
226 | -moz-border-radius: 3px;
227 | border-radius: 3px;
228 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
229 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
230 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
231 | -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
232 | -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
233 | -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
234 | -o-transition: border linear 0.2s, box-shadow linear 0.2s;
235 | transition: border linear 0.2s, box-shadow linear 0.2s;
236 | }
237 |
238 | textarea:focus {
239 | border-color: rgba(82, 168, 236, 0.8);
240 | outline: 0;
241 | outline: thin dotted \9;
242 | /* IE6-9 */
243 | -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
244 | -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
245 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
246 | }
247 |
248 | textarea {
249 | margin-left: 0;
250 | }
251 |
252 | textarea[readonly] {
253 | cursor: not-allowed;
254 | background-color: #f5f5f5;
255 | border-color: #ddd;
256 | }
257 |
258 | :-moz-placeholder {
259 | color: #999999;
260 | }
261 |
262 | :-ms-input-placeholder {
263 | color: #999999;
264 | }
265 |
266 | button.btn::-moz-focus-inner,
267 | input[type="submit"].btn::-moz-focus-inner {
268 | padding: 0;
269 | border: 0;
270 | }
271 |
272 | .nav {
273 | margin-left: 0;
274 | margin-bottom: 18px;
275 | list-style: none;
276 | }
277 |
278 | .nav > li > a {
279 | display: block;
280 | }
281 |
282 | .nav > li > a:hover {
283 | text-decoration: none;
284 | background-color: #f5f5f5;
285 | }
286 |
287 | .nav-pills {
288 | *zoom: 1;
289 | }
290 |
291 | .nav-pills:before,
292 | .nav-pills:after {
293 | display: table;
294 | content: "";
295 | }
296 |
297 | .nav-pills:after {
298 | clear: both;
299 | }
300 |
301 | .nav-pills > li {
302 | float: left;
303 | }
304 |
305 | .nav-pills > li > a {
306 | padding-right: 12px;
307 | padding-left: 12px;
308 | margin-right: 2px;
309 | line-height: 14px;
310 | }
311 |
312 | .nav-pills > li > a {
313 | padding-top: 8px;
314 | padding-bottom: 8px;
315 | margin-top: 2px;
316 | margin-bottom: 2px;
317 | -webkit-border-radius: 5px;
318 | -moz-border-radius: 5px;
319 | border-radius: 5px;
320 | }
321 |
322 | .navbar-search .search-query:-moz-placeholder {
323 | color: #ffffff;
324 | }
325 |
326 | .navbar-search .search-query:-ms-input-placeholder {
327 | color: #ffffff;
328 | }
329 |
330 | @-webkit-keyframes progress-bar-stripes {
331 | from {
332 | background-position: 40px 0;
333 | }
334 |
335 | to {
336 | background-position: 0 0;
337 | }
338 | }
339 |
340 | @-moz-keyframes progress-bar-stripes {
341 | from {
342 | background-position: 40px 0;
343 | }
344 |
345 | to {
346 | background-position: 0 0;
347 | }
348 | }
349 |
350 | @-ms-keyframes progress-bar-stripes {
351 | from {
352 | background-position: 40px 0;
353 | }
354 |
355 | to {
356 | background-position: 0 0;
357 | }
358 | }
359 |
360 | @-o-keyframes progress-bar-stripes {
361 | from {
362 | background-position: 0 0;
363 | }
364 |
365 | to {
366 | background-position: 40px 0;
367 | }
368 | }
369 |
370 | @keyframes progress-bar-stripes {
371 | from {
372 | background-position: 40px 0;
373 | }
374 |
375 | to {
376 | background-position: 0 0;
377 | }
378 | }
379 |
--------------------------------------------------------------------------------
/assets/temp/script.js:
--------------------------------------------------------------------------------
1 | (function(){$(function(){var t,e,i,n;return e=function(t,e){return jade.compile(t,{pretty:!0,doctype:"5"})(e)},n=function(t){var i,n,s,o,a,r;i=t.siblings(".json"),r=i.val()||"{}",n=t.closest(".row").find("textarea.html"),t.closest(".row").find("textarea").removeClass("error");try{s=JSON.parse(r)}catch(l){return i.addClass("error"),n.val("[json] "+l.message).addClass("error"),void 0}a=t.val();try{o=e(a,s)}catch(l){return t.addClass("error"),n.val("[jade] "+l.message).addClass("error"),void 0}return o=o.trim(),n.val(o)},$("textarea.jade").each(function(){return n($(this).on("keyup",function(){return n($(this))}))}),$("textarea.json").on("keyup",function(){return n($(this).siblings(".jade"))}),$("#basics .row").addClass("annotate"),$.fn.tabOverride.autoIndent=!0,$.fn.tabOverride.tabSize(2),$("textarea.jade, textarea.json").tabOverride(),i=$(".subnav").length&&$(".subnav").offset().top,t=0,$(window).on("scroll",function(){var e,n;return e=void 0,n=$(window).scrollTop(),n>=i&&!t?(t=1,$(".subnav").addClass("subnav-fixed")):i>=n&&t?(t=0,$(".subnav").removeClass("subnav-fixed")):void 0})})}).call(this);
--------------------------------------------------------------------------------
/assets/temp/taboverride.js:
--------------------------------------------------------------------------------
1 | jQuery.fn.tabOverride=function(t){function e(t){var e,i,l,h,c,d,u,p,f,v,m,g,y,$,w,b,C,x,k=t.keyCode;if((9===k||13===k&&o.autoIndent)&&!t.ctrlKey&&!t.altKey){if(r=!1,l=this.value,p=this.scrollTop,document.selection)h=document.selection.createRange(),m=h.text,c=h.duplicate(),c.moveToElementText(this),c.setEndPoint("EndToEnd",h),v=c.text.length,f=v-m.length,s>1?(d=l.slice(0,f).split(n).length-1,u=m.split(n).length-1):d=u=0;else{if(void 0===this.selectionStart)return;f=this.selectionStart,v=this.selectionEnd,m=l.slice(f,v)}if(9===k)e=a,i=e.length,$=0,w=0,b=0,f!==v&&-1!==m.indexOf("\n")?(g=0===f||"\n"===l.charAt(f-1)?f:l.lastIndexOf("\n",f-1)+1,v===l.length||"\n"===l.charAt(v)?y=v:(y=l.indexOf("\n",v),-1===y&&(y=l.length)),t.shiftKey?(0===l.slice(g).indexOf(e)&&(g===f?m=m.slice(i):b=i,w=i),this.value=l.slice(0,g)+l.slice(g+b,f)+m.replace(RegExp("\n"+e,"g"),function(){return $+=1,"\n"})+l.slice(v),h?(h.collapse(),h.moveEnd("character",v-w-$*i-u-d),h.moveStart("character",f-b-d),h.select()):(this.selectionStart=f-b,this.selectionEnd=v-w-$*i)):($=1,this.value=l.slice(0,g)+e+l.slice(g,f)+m.replace(/\n/g,function(){return $+=1,"\n"+e})+l.slice(v),h?(h.collapse(),h.moveEnd("character",v+$*i-u-d),h.moveStart("character",f+i-d),h.select()):(this.selectionStart=f+i,this.selectionEnd=v+$*i,this.scrollTop=p))):t.shiftKey?0===l.slice(f-i).indexOf(e)&&(this.value=l.slice(0,f-i)+l.slice(f),h?(h.move("character",f-i-d),h.select()):(this.selectionEnd=this.selectionStart=f-i,this.scrollTop=p)):h?(h.text=e,h.select()):(this.value=l.slice(0,f)+e+l.slice(v),this.selectionEnd=this.selectionStart=f+i,this.scrollTop=p);else if(o.autoIndent){if(0===f||"\n"===l.charAt(f-1))return r=!0,void 0;if(g=l.lastIndexOf("\n",f-1)+1,y=l.indexOf("\n",f),-1===y&&(y=l.length),C=l.slice(g,y).match(/^[ \t]*/)[0],x=C.length,g+x>f)return r=!0,void 0;h?(h.text="\n"+C,h.select()):(this.value=l.slice(0,f)+"\n"+C+l.slice(v),this.selectionEnd=this.selectionStart=f+s+x,this.scrollTop=p)}t.preventDefault()}}function i(t){var e=t.keyCode;9!==e&&(13!==e||!o.autoIndent||r)||t.ctrlKey||t.altKey||t.preventDefault()}var n,s,o,a=" ",r=!1,l=document.createElement("textarea");return o=function(n){return this.each(function(){t(this).unbind(".tabOverride")}),(!arguments.length||n)&&this.each(function(){this.nodeName&&"textarea"===this.nodeName.toLowerCase()&&t(this).bind("keydown.tabOverride",e).bind("keypress.tabOverride",i)}),this},o.getTabSize=function(){return o.tabSize()},o.setTabSize=function(t){o.tabSize(t)},o.tabSize=function(t){if(!arguments.length)return" "===a?0:a.length;var e;if(t){if("number"==typeof t&&t>0)for(a="",e=0;t>e;e+=1)a+=" "}else a=" "},o.autoIndent=!1,l.value="\n",n=l.value,s=n.length,l=null,o}(jQuery);
--------------------------------------------------------------------------------
/css/screen.css:
--------------------------------------------------------------------------------
1 | body{padding:60px 0 0;background:url("../img/furley_bg.png") center}
2 | h1{font-weight:500}
3 | .lead{font-size:17px;}
4 | .lead strong{font-weight:bold}
5 | .lead a{color:#333;text-decoration:underline}
6 | footer{margin-top:20px;padding:10px;text-align:center;background:#f5f5f5;border-top:1px solid #d5d5d5;}
7 | footer p{display:inline-block;margin:0 20px;vertical-align:top}
8 | section{padding:50px 0;}
9 | section#basics{padding-top:20px}
10 | hr{border-color:#e5e5e5}
11 | .right{text-align:right}
12 | .span6{position:relative}
13 | .jadeLabel,.dataLabel,.htmlLabel{-webkit-transition:opacity .4s ease-in 1.5s;-moz-transition:opacity .4s ease-in 1.5s;-o-transition:opacity .4s ease-in 1.5s;-ms-transition:opacity .4s ease-in 1.5s;transition:opacity .4s ease-in 1.5s;opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);position:absolute;background-repeat:no-repeat;height:30px}
14 | .row.annotate .jadeLabel,.row.annotate .dataLabel,.row.annotate .htmlLabel{opacity:1;-ms-filter:none;filter:none}
15 | .jadeLabel{-webkit-transition-delay:1.4s;-moz-transition-delay:1.4s;-o-transition-delay:1.4s;-ms-transition-delay:1.4s;transition-delay:1.4s;right:10%;top:-30px;background-image:url("../img/jade.png");width:132px}
16 | .dataLabel{-webkit-transition-delay:1.5s;-moz-transition-delay:1.5s;-o-transition-delay:1.5s;-ms-transition-delay:1.5s;transition-delay:1.5s;right:9%;bottom:-32px;background-image:url("../img/data.png");width:130px}
17 | .htmlLabel{-webkit-transition-delay:1.6s;-moz-transition-delay:1.6s;-o-transition-delay:1.6s;-ms-transition-delay:1.6s;transition-delay:1.6s;left:9%;top:-33px;background-image:url("../img/html.png");width:146px}
18 | textarea{text-align:left;width:91%;display:inline-block;padding:8.5px;margin:0 0 6px;font-size:15px;line-height:24px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;border-radius:4px;font-family:'Droid Sans Mono',sans-serif;color:#333;}
19 | textarea.html{cursor:default}
20 | textarea.error{color:#f00}
21 | textarea.size1{height:24px}
22 | textarea.size2{height:48px}
23 | textarea.size3{height:72px}
24 | textarea.size4{height:96px}
25 | textarea.size5{height:120px}
26 | textarea.size6{height:144px}
27 | textarea.size7{height:168px}
28 | textarea.size8{height:192px}
29 | textarea.size9{height:216px}
30 | .page-header{margin-bottom:0;border:none}
31 | .subhead{padding-bottom:0;margin-bottom:30px}
32 | .subhead h1{font-size:40px;margin-bottom:30px}
33 | .subnav{width:100%;height:36px;background-color:#eee;background-repeat:repeat-x;background-image:-moz-linear-gradient(top,#f5f5f5 0%,#eee 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#f5f5f5),color-stop(100%,#eee));background-image:-webkit-linear-gradient(top,#f5f5f5 0%,#eee 100%);background-image:-ms-linear-gradient(top,#f5f5f5 0%,#eee 100%);background-image:-o-linear-gradient(top,#f5f5f5 0%,#eee 100%);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #f5f5f5), color-stop(1, #eee));background-image:-webkit-linear-gradient(top, #f5f5f5 0%, #eee 100%);background-image:-moz-linear-gradient(top, #f5f5f5 0%, #eee 100%);background-image:-o-linear-gradient(top, #f5f5f5 0%, #eee 100%);background-image:-ms-linear-gradient(top, #f5f5f5 0%, #eee 100%);background-image:linear-gradient(top, #f5f5f5 0%, #eee 100%);border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}
34 | .subnav .nav{margin-bottom:0}
35 | .subnav .nav > li > a{margin:0;padding-top:11px;padding-bottom:11px;border-left:1px solid #f5f5f5;border-right:1px solid #e5e5e5;-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}
36 | .subnav .nav > .active > a,.subnav .nav > .active > a:hover{padding-left:13px;color:#777;background-color:#e9e9e9;border-right-color:#ddd;border-left:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 3px 5px rgba(0,0,0,0.05);-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.05);box-shadow:inset 0 3px 5px rgba(0,0,0,0.05)}
37 | .subnav .nav > .active > a .caret,.subnav .nav > .active > a:hover .caret{border-top-color:#777}
38 | .subnav .nav > li:first-child > a,.subnav .nav > li:first-child > a:hover{border-left:0;padding-left:12px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;-webkit-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}
39 | .subnav .nav > li:last-child > a{border-right:0}
40 | .subnav .dropdown-menu{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;-webkit-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}
41 | @media (min-width: 980px){.subnav-fixed{position:fixed;top:0;left:0;right:0;z-index:1020;border-color:#d5d5d5;border-width:0 0 1px;-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:inset 0 1px 0 #fff,0 1px 5px rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 #fff,0 1px 5px rgba(0,0,0,0.1)}
42 | .subnav-fixed .nav{width:938px;margin:0 auto;padding:0 1px}
43 | .subnav .nav > li:first-child > a,.subnav .nav > li:first-child > a:hover{-webkit-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}
44 | }
--------------------------------------------------------------------------------
/css/screen.styl:
--------------------------------------------------------------------------------
1 | @import 'nib'
2 |
3 | body
4 | padding 60px 0 0
5 | background url(../img/furley_bg.png) center
6 |
7 | h1
8 | font-weight 500
9 |
10 | .lead
11 | font-size 17px
12 | strong
13 | font-weight bold
14 | a
15 | color #333
16 | text-decoration underline
17 |
18 | footer
19 | margin-top 20px
20 | padding 10px
21 | text-align center
22 | background #F5F5F5
23 | border-top 1px solid #D5D5D5
24 | p
25 | display inline-block
26 | margin 0 20px
27 | vertical-align top
28 |
29 | section
30 | padding 50px 0
31 | basics
32 | padding-top 20px
33 |
34 | hr
35 | border-color #E5E5E5
36 |
37 | .right
38 | text-align right
39 |
40 | .span6
41 | position relative
42 |
43 | .jadeLabel, .dataLabel, .htmlLabel
44 | transition opacity 0.4s ease-in 1.5s
45 | opacity 0
46 | position absolute
47 | background-repeat no-repeat
48 | height 30px
49 |
50 | .row.annotate
51 | .jadeLabel, .dataLabel, .htmlLabel
52 | opacity 1
53 |
54 | .jadeLabel
55 | transition-delay 1.4s
56 | right 10%
57 | top -30px
58 | background-image url(../img/jade.png)
59 | width 132px
60 |
61 | .dataLabel
62 | transition-delay 1.5s
63 | right 9%
64 | bottom -32px
65 | background-image url(../img/data.png)
66 | width 130px
67 |
68 | .htmlLabel
69 | transition-delay 1.6s
70 | left 9%
71 | top -33px
72 | background-image url(../img/html.png)
73 | width 146px
74 |
75 | textarea
76 | text-align left
77 | width 91%
78 | display inline-block
79 | padding 8.5px
80 | margin 0 0 6px
81 | font-size 15px
82 | $lineHeight = 24px
83 | line-height $lineHeight
84 | word-break break-all
85 | word-wrap break-word
86 | white-space pre
87 | white-space pre-wrap
88 | background-color #f5f5f5
89 | border 1px solid rgba(0, 0, 0, 0.15)
90 | border-radius 4px
91 | font-family 'Droid Sans Mono', sans-serif
92 | color #333333
93 | &.html
94 | cursor default
95 | &.error
96 | color #f00
97 | &.size1
98 | height $lineHeight
99 | &.size2
100 | height $lineHeight * 2
101 | &.size3
102 | height $lineHeight * 3
103 | &.size4
104 | height $lineHeight * 4
105 | &.size5
106 | height $lineHeight * 5
107 | &.size6
108 | height $lineHeight * 6
109 | &.size7
110 | height $lineHeight * 7
111 | &.size8
112 | height $lineHeight * 8
113 | &.size9
114 | height $lineHeight * 9
115 |
116 |
117 | .page-header
118 | margin-bottom 0
119 | border none
120 |
121 |
122 | /* Specific jumbotrons
123 | ------------------------- */
124 | /* supporting docs pages */
125 | .subhead {
126 | padding-bottom: 0;
127 | margin-bottom: 30px;
128 | }
129 | .subhead h1 {
130 | font-size: 40px;
131 | margin-bottom: 30px
132 | }
133 |
134 | /* Subnav */
135 | .subnav {
136 | width: 100%;
137 | height: 36px;
138 | background-color: #eeeeee; /* Old browsers */
139 | background-repeat: repeat-x; /* Repeat the gradient */
140 | background-image: -moz-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* FF3.6+ */
141 | background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */
142 | background-image: -webkit-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Chrome 10+,Safari 5.1+ */
143 | background-image: -ms-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* IE10+ */
144 | background-image: -o-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Opera 11.10+ */
145 | background-image: linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* W3C */
146 | border: 1px solid #e5e5e5;
147 | -webkit-border-radius: 4px;
148 | -moz-border-radius: 4px;
149 | border-radius: 4px;
150 | }
151 | .subnav .nav {
152 | margin-bottom: 0;
153 | }
154 | .subnav .nav > li > a {
155 | margin: 0;
156 | padding-top: 11px;
157 | padding-bottom: 11px;
158 | border-left: 1px solid #f5f5f5;
159 | border-right: 1px solid #e5e5e5;
160 | -webkit-border-radius: 0;
161 | -moz-border-radius: 0;
162 | border-radius: 0;
163 | }
164 | .subnav .nav > .active > a,
165 | .subnav .nav > .active > a:hover {
166 | padding-left: 13px;
167 | color: #777;
168 | background-color: #e9e9e9;
169 | border-right-color: #ddd;
170 | border-left: 0;
171 | -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
172 | -moz-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
173 | box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
174 | }
175 | .subnav .nav > .active > a .caret,
176 | .subnav .nav > .active > a:hover .caret {
177 | border-top-color: #777;
178 | }
179 | .subnav .nav > li:first-child > a,
180 | .subnav .nav > li:first-child > a:hover {
181 | border-left: 0;
182 | padding-left: 12px;
183 | -webkit-border-radius: 4px 0 0 4px;
184 | -moz-border-radius: 4px 0 0 4px;
185 | border-radius: 4px 0 0 4px;
186 | }
187 | .subnav .nav > li:last-child > a {
188 | border-right: 0;
189 | }
190 | .subnav .dropdown-menu {
191 | -webkit-border-radius: 0 0 4px 4px;
192 | -moz-border-radius: 0 0 4px 4px;
193 | border-radius: 0 0 4px 4px;
194 | }
195 |
196 | /* Fixed subnav on scroll, but only for 980px and up (sorry IE!) */
197 | @media (min-width: 980px) {
198 | .subnav-fixed {
199 | position: fixed;
200 | top: 0px;
201 | left: 0;
202 | right: 0;
203 | z-index: 1020; /* 10 less than .navbar-fixed to prevent any overlap */
204 | border-color: #d5d5d5;
205 | border-width: 0 0 1px; /* drop the border on the fixed edges */
206 | -webkit-border-radius: 0;
207 | -moz-border-radius: 0;
208 | border-radius: 0;
209 | box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
210 | }
211 | .subnav-fixed .nav {
212 | width: 938px;
213 | margin: 0 auto;
214 | padding: 0 1px;
215 | }
216 | .subnav .nav > li:first-child > a,
217 | .subnav .nav > li:first-child > a:hover {
218 | -webkit-border-radius: 0;
219 | -moz-border-radius: 0;
220 | border-radius: 0;
221 | }
222 | }
223 |
--------------------------------------------------------------------------------
/img/data.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naltatis/jade-syntax-docs/a8b76f485f42b818a04e5966c939063104869478/img/data.png
--------------------------------------------------------------------------------
/img/furley_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naltatis/jade-syntax-docs/a8b76f485f42b818a04e5966c939063104869478/img/furley_bg.png
--------------------------------------------------------------------------------
/img/html.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naltatis/jade-syntax-docs/a8b76f485f42b818a04e5966c939063104869478/img/html.png
--------------------------------------------------------------------------------
/img/jade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naltatis/jade-syntax-docs/a8b76f485f42b818a04e5966c939063104869478/img/jade.png
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 | Jade Template Syntax Documentation by Example
--------------------------------------------------------------------------------
/index.jade:
--------------------------------------------------------------------------------
1 | doctype 5
2 | html
3 | head
4 | title Jade Template Syntax Documentation by Example
5 | link(href="assets/global.min.css", rel="stylesheet", type="text/css")
6 | meta(name="description", content="An interative Syntax Documentation for the Jade Templating Engine")
7 | link(rel="author", href="https://plus.google.com/u/0/113306279128990179378")
8 | script.
9 | WebFontConfig = {
10 | google: { families: [ 'Droid+Sans+Mono::latin', 'Ubuntu:400,700:latin' ] }
11 | };
12 | (function() {
13 | var wf = document.createElement('script');
14 | wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
15 | '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
16 | wf.type = 'text/javascript';
17 | wf.async = 'true';
18 | var s = document.getElementsByTagName('script')[0];
19 | s.parentNode.insertBefore(wf, s);
20 | })();
21 | body(data-spy="scroll", data-target=".subnav", data-offset="150")
22 | a(href="https://github.com/naltatis/jade-syntax-docs")
23 | img(style="position: absolute; top: 0; right: 0; border: 0;", src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png", alt="Fork me on GitHub")
24 | .container
25 | header.jumbotron.subhead
26 | h1
27 | | Jade Syntax Documentation
28 | small by example
29 | p.lead
30 | | This interactive documentation illustrates the most important features of the Jade templating language.
31 | | You can play around with the examples and watch the html output in real time.
32 | | For more detailed explanations visit the
33 | a(href="http://jade-lang.com/reference/") official documentation.
34 | .subnav
35 | ul.nav.nav-pills
36 | li: a(href="#basics") Basics
37 | li: a(href="#id-classes") id, classes
38 | li: a(href="#nesting") Nesting
39 | li: a(href="#text") Text
40 | li: a(href="#variables") Variables
41 | li: a(href="#escaping") Escaping
42 | li: a(href="#attributes") Attributes
43 | li: a(href="#comments") Comments
44 | li: a(href="#if") if, unless
45 | li: a(href="#for") for, each
46 | li: a(href="#case") case
47 | li: a(href="#mixin") mixin
48 | li: a(href="#about") about
49 | section#basics
50 | .page-header
51 | h2 Basics
52 | .row
53 | .span6
54 | .jadeLabel
55 | textarea.size7.jade.
56 | doctype html
57 | html
58 | head
59 | title my jade template
60 | body
61 | h1 Hello \#{name}
62 | textarea.size1.json.
63 | {"name": "Bob"}
64 | .dataLabel
65 | .span6.right
66 | .htmlLabel
67 | textarea.size9.html(readonly=true)
68 | section#id-classes
69 | .page-header
70 | h2 id & classes
71 | .row
72 | .span6
73 | textarea.size5.jade.
74 | #content
75 | .block
76 | input#bar.foo1.foo2
77 | .span6.right
78 | textarea.size5.html(readonly=true)
79 | section#nesting
80 | .page-header
81 | h2 Nesting
82 | .row
83 | .span6
84 | textarea.size5.jade.
85 | ul#books
86 | li
87 | a(href="#book-a") Book A
88 | li
89 | a(href="#book-b") Book B
90 | .span6.right
91 | textarea.size5.html(readonly=true)
92 | hr
93 | .row
94 | .span6
95 | textarea.size4.jade.
96 | ul#books
97 | li: a(href="#book-a") Book A
98 | li: a(href="#book-b") Book B
99 | .span6.right
100 | textarea.size4.html(readonly=true)
101 | section#text
102 | .page-header
103 | h2 Text
104 | .row
105 | .span6
106 | textarea.size3.jade.
107 | h1 foo
108 | h2= book.name
109 | h3 "\#{book.name}" for \#{book.price} €
110 | textarea.size1.json.
111 | {"book": {"name": "Hello", "price": 12.99}}
112 | .span6.right
113 | textarea.size5.html(readonly=true)
114 | hr
115 | .row
116 | .span6
117 | textarea.size4.jade.
118 | p
119 | | foo bar
120 | | hello world
121 | .span6.right
122 | textarea.size4.html(readonly=true)
123 | hr
124 | .row
125 | .span6
126 | textarea.size4.jade.
127 | p.
128 | foo bar
129 | hello world
130 | .span6.right
131 | textarea.size4.html(readonly=true)
132 |
133 | section#variables
134 | .page-header
135 | h2 Variables
136 | .row
137 | .span6
138 | textarea.size2.jade.
139 | - var foo = "hello world"
140 | h1= foo
141 | .span6.right
142 | textarea.size2.html(readonly=true)
143 | hr
144 | .row
145 | .span6
146 | textarea.size2.jade.
147 | - var foo = book.name + " world"
148 | h1= foo
149 | textarea.size1.json.
150 | {"book": {"name": "hello"}}
151 | .span6.right
152 | textarea.size4.html(readonly=true)
153 | section#escaping
154 | .page-header
155 | h2 Escaping
156 | .row
157 | .span6
158 | textarea.size1.jade.
159 | li Hello World
160 | .span6.right
161 | textarea.size1.html(readonly=true)
162 | hr
163 | .row
164 | .span6
165 | textarea.size2.jade.
166 | li= name
167 | li!= name
168 | textarea.size1.json.
169 | {"name": "Hello World "}
170 | .span6.right
171 | textarea.size4.html(readonly=true)
172 | hr
173 | .row
174 | .span6
175 | textarea.size2.jade.
176 | li Say \#{name}
177 | li Say !{name}
178 | textarea.size1.json.
179 | {"name": "Hello World "}
180 | .span6.right
181 | textarea.size4.html(readonly=true)
182 | section#attributes
183 | .page-header
184 | h2 Attributes
185 | .row
186 | .span6
187 | textarea.size1.jade.
188 | input(type="text", placeholder="your name")
189 | .span6.right
190 | textarea.size1.html(readonly=true)
191 | hr
192 | .row
193 | .span6
194 | textarea.size1.jade.
195 | input(type=type, value='Hello \#{name}')
196 | textarea.size1.json.
197 | {"type": "text", "name": "Bob"}
198 | .span6.right
199 | textarea.size3.html(readonly=true)
200 | hr
201 | .row
202 | .span6
203 | textarea.size1.jade.
204 | input(checked=true, disabled=false)
205 | .span6.right
206 | textarea.size1.html(readonly=true)
207 | section#comments
208 | .page-header
209 | h2 Comments
210 | .row
211 | .span6
212 | textarea.size2.jade.
213 | // single line comment
214 | //- invisible single line comment
215 | .span6.right
216 | textarea.size2.html(readonly=true)
217 | hr
218 | .row
219 | .span6
220 | textarea.size4.jade.
221 | // block comment
222 | h1 hello world
223 | //- invisible block comment
224 | h2 how are you?
225 | .span6.right
226 | textarea.size4.html(readonly=true)
227 | hr
228 | .row
229 | .span6
230 | textarea.size3.jade.
231 |
234 | .span6.right
235 | textarea.size2.html(readonly=true)
236 | section#if
237 | .page-header
238 | h2 if & unless
239 | .row
240 | .span6
241 | textarea.size4.jade.
242 | if name == "Bob"
243 | h1 Hello Bob
244 | else
245 | h1 My name is \#{name}
246 | textarea.size1.json.
247 | {"name": "Bob"}
248 | .span6.right
249 | textarea.size6.html(readonly=true)
250 | hr
251 | .row
252 | .span6
253 | textarea.size2.jade.
254 | unless errors
255 | p no errors
256 | textarea.size1.json.
257 | {"errors": false}
258 | .span6.right
259 | textarea.size4.html(readonly=true)
260 | section#for
261 | .page-header
262 | h2 for & each
263 | .row
264 | .span6
265 | textarea.size3.jade.
266 | select
267 | each book, i in books
268 | option(value=i) Book \#{book}
269 | textarea.size1.json.
270 | {"books": ["A", "B", "C"]}
271 | .span6.right
272 | textarea.size5.html(readonly=true)
273 | hr
274 | .row
275 | .span6
276 | textarea.size5.jade.
277 | ul
278 | for book in books
279 | li= book
280 | else
281 | li sorry, no books!
282 | textarea.size1.json.
283 | {"books": []}
284 | .span6.right
285 | textarea.size7.html(readonly=true)
286 | section#case
287 | .page-header
288 | h2 case
289 | .row
290 | .span6
291 | textarea.size7.jade.
292 | case name
293 | when "Bob"
294 | p Hi Bob!
295 | when "Alice"
296 | p Howdy Alice!
297 | default
298 | p Hello \#{name}!
299 | textarea.size1.json.
300 | {"name": "Bob"}
301 | .span6.right
302 | textarea.size9.html(readonly=true)
303 |
304 | section#mixin
305 | .page-header
306 | h2 mixin
307 | .row
308 | .span6
309 | textarea.size6.jade.
310 | mixin book(name, price)
311 | li \#{name} for \#{price} €
312 |
313 | ul#books
314 | +book("Book A", 12.99)
315 | +book("Book B", 5.99)
316 | .span6.right
317 | textarea.size6.html(readonly=true)
318 | hr
319 | .row
320 | .span6
321 | textarea.size6.jade.
322 | mixin book(name)
323 | div&attributes(attributes)= name
324 |
325 | +book("Book A")#first
326 | +book("Book B")(title="book b")
327 | +book("Book C").last
328 | .span6.right
329 | textarea.size6.html(readonly=true)
330 |
331 | footer#about
332 | p
333 | | by naltatis
334 | p
335 | | follow me on
336 | a(href="https://github.com/naltatis", title="naltatis on github") github
337 | | and
338 | a(href="https://twitter.com/naltatis", title="naltatis on twitter") twitter
339 | p
340 | a.FlattrButton
341 |
342 | //-(rev="flattr;button:compact", href="https://github.com/naltatis/jade-syntax-docs", lang="de", title="interactive Jade Syntax Documentation");
343 |
344 | script(src="assets/global.min.js", async)
345 | script(type="text/javascript")
346 | var _gaq = _gaq || [];
347 | _gaq.push(['_setAccount', 'UA-33399084-1']);
348 | _gaq.push(['_trackPageview']);
349 |
350 | (function() {
351 | var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
352 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
353 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
354 | })();
355 |
--------------------------------------------------------------------------------
/js/bootstrap.js:
--------------------------------------------------------------------------------
1 | /* ===================================================
2 | * bootstrap-transition.js v2.0.4
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 |
21 | !function ($) {
22 |
23 | $(function () {
24 |
25 | "use strict"; // jshint ;_;
26 |
27 |
28 | /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
29 | * ======================================================= */
30 |
31 | $.support.transition = (function () {
32 |
33 | var transitionEnd = (function () {
34 |
35 | var el = document.createElement('bootstrap')
36 | , transEndEventNames = {
37 | 'WebkitTransition' : 'webkitTransitionEnd'
38 | , 'MozTransition' : 'transitionend'
39 | , 'OTransition' : 'oTransitionEnd'
40 | , 'msTransition' : 'MSTransitionEnd'
41 | , 'transition' : 'transitionend'
42 | }
43 | , name
44 |
45 | for (name in transEndEventNames){
46 | if (el.style[name] !== undefined) {
47 | return transEndEventNames[name]
48 | }
49 | }
50 |
51 | }())
52 |
53 | return transitionEnd && {
54 | end: transitionEnd
55 | }
56 |
57 | })()
58 |
59 | })
60 |
61 | }(window.jQuery);/* ==========================================================
62 | * bootstrap-alert.js v2.0.4
63 | * http://twitter.github.com/bootstrap/javascript.html#alerts
64 | * ==========================================================
65 | * Copyright 2012 Twitter, Inc.
66 | *
67 | * Licensed under the Apache License, Version 2.0 (the "License");
68 | * you may not use this file except in compliance with the License.
69 | * You may obtain a copy of the License at
70 | *
71 | * http://www.apache.org/licenses/LICENSE-2.0
72 | *
73 | * Unless required by applicable law or agreed to in writing, software
74 | * distributed under the License is distributed on an "AS IS" BASIS,
75 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
76 | * See the License for the specific language governing permissions and
77 | * limitations under the License.
78 | * ========================================================== */
79 |
80 |
81 | !function ($) {
82 |
83 | "use strict"; // jshint ;_;
84 |
85 |
86 | /* ALERT CLASS DEFINITION
87 | * ====================== */
88 |
89 | var dismiss = '[data-dismiss="alert"]'
90 | , Alert = function (el) {
91 | $(el).on('click', dismiss, this.close)
92 | }
93 |
94 | Alert.prototype.close = function (e) {
95 | var $this = $(this)
96 | , selector = $this.attr('data-target')
97 | , $parent
98 |
99 | if (!selector) {
100 | selector = $this.attr('href')
101 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
102 | }
103 |
104 | $parent = $(selector)
105 |
106 | e && e.preventDefault()
107 |
108 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
109 |
110 | $parent.trigger(e = $.Event('close'))
111 |
112 | if (e.isDefaultPrevented()) return
113 |
114 | $parent.removeClass('in')
115 |
116 | function removeElement() {
117 | $parent
118 | .trigger('closed')
119 | .remove()
120 | }
121 |
122 | $.support.transition && $parent.hasClass('fade') ?
123 | $parent.on($.support.transition.end, removeElement) :
124 | removeElement()
125 | }
126 |
127 |
128 | /* ALERT PLUGIN DEFINITION
129 | * ======================= */
130 |
131 | $.fn.alert = function (option) {
132 | return this.each(function () {
133 | var $this = $(this)
134 | , data = $this.data('alert')
135 | if (!data) $this.data('alert', (data = new Alert(this)))
136 | if (typeof option == 'string') data[option].call($this)
137 | })
138 | }
139 |
140 | $.fn.alert.Constructor = Alert
141 |
142 |
143 | /* ALERT DATA-API
144 | * ============== */
145 |
146 | $(function () {
147 | $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
148 | })
149 |
150 | }(window.jQuery);/* ============================================================
151 | * bootstrap-button.js v2.0.4
152 | * http://twitter.github.com/bootstrap/javascript.html#buttons
153 | * ============================================================
154 | * Copyright 2012 Twitter, Inc.
155 | *
156 | * Licensed under the Apache License, Version 2.0 (the "License");
157 | * you may not use this file except in compliance with the License.
158 | * You may obtain a copy of the License at
159 | *
160 | * http://www.apache.org/licenses/LICENSE-2.0
161 | *
162 | * Unless required by applicable law or agreed to in writing, software
163 | * distributed under the License is distributed on an "AS IS" BASIS,
164 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
165 | * See the License for the specific language governing permissions and
166 | * limitations under the License.
167 | * ============================================================ */
168 |
169 |
170 | !function ($) {
171 |
172 | "use strict"; // jshint ;_;
173 |
174 |
175 | /* BUTTON PUBLIC CLASS DEFINITION
176 | * ============================== */
177 |
178 | var Button = function (element, options) {
179 | this.$element = $(element)
180 | this.options = $.extend({}, $.fn.button.defaults, options)
181 | }
182 |
183 | Button.prototype.setState = function (state) {
184 | var d = 'disabled'
185 | , $el = this.$element
186 | , data = $el.data()
187 | , val = $el.is('input') ? 'val' : 'html'
188 |
189 | state = state + 'Text'
190 | data.resetText || $el.data('resetText', $el[val]())
191 |
192 | $el[val](data[state] || this.options[state])
193 |
194 | // push to event loop to allow forms to submit
195 | setTimeout(function () {
196 | state == 'loadingText' ?
197 | $el.addClass(d).attr(d, d) :
198 | $el.removeClass(d).removeAttr(d)
199 | }, 0)
200 | }
201 |
202 | Button.prototype.toggle = function () {
203 | var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
204 |
205 | $parent && $parent
206 | .find('.active')
207 | .removeClass('active')
208 |
209 | this.$element.toggleClass('active')
210 | }
211 |
212 |
213 | /* BUTTON PLUGIN DEFINITION
214 | * ======================== */
215 |
216 | $.fn.button = function (option) {
217 | return this.each(function () {
218 | var $this = $(this)
219 | , data = $this.data('button')
220 | , options = typeof option == 'object' && option
221 | if (!data) $this.data('button', (data = new Button(this, options)))
222 | if (option == 'toggle') data.toggle()
223 | else if (option) data.setState(option)
224 | })
225 | }
226 |
227 | $.fn.button.defaults = {
228 | loadingText: 'loading...'
229 | }
230 |
231 | $.fn.button.Constructor = Button
232 |
233 |
234 | /* BUTTON DATA-API
235 | * =============== */
236 |
237 | $(function () {
238 | $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
239 | var $btn = $(e.target)
240 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
241 | $btn.button('toggle')
242 | })
243 | })
244 |
245 | }(window.jQuery);/* ==========================================================
246 | * bootstrap-carousel.js v2.0.4
247 | * http://twitter.github.com/bootstrap/javascript.html#carousel
248 | * ==========================================================
249 | * Copyright 2012 Twitter, Inc.
250 | *
251 | * Licensed under the Apache License, Version 2.0 (the "License");
252 | * you may not use this file except in compliance with the License.
253 | * You may obtain a copy of the License at
254 | *
255 | * http://www.apache.org/licenses/LICENSE-2.0
256 | *
257 | * Unless required by applicable law or agreed to in writing, software
258 | * distributed under the License is distributed on an "AS IS" BASIS,
259 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
260 | * See the License for the specific language governing permissions and
261 | * limitations under the License.
262 | * ========================================================== */
263 |
264 |
265 | !function ($) {
266 |
267 | "use strict"; // jshint ;_;
268 |
269 |
270 | /* CAROUSEL CLASS DEFINITION
271 | * ========================= */
272 |
273 | var Carousel = function (element, options) {
274 | this.$element = $(element)
275 | this.options = options
276 | this.options.slide && this.slide(this.options.slide)
277 | this.options.pause == 'hover' && this.$element
278 | .on('mouseenter', $.proxy(this.pause, this))
279 | .on('mouseleave', $.proxy(this.cycle, this))
280 | }
281 |
282 | Carousel.prototype = {
283 |
284 | cycle: function (e) {
285 | if (!e) this.paused = false
286 | this.options.interval
287 | && !this.paused
288 | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
289 | return this
290 | }
291 |
292 | , to: function (pos) {
293 | var $active = this.$element.find('.active')
294 | , children = $active.parent().children()
295 | , activePos = children.index($active)
296 | , that = this
297 |
298 | if (pos > (children.length - 1) || pos < 0) return
299 |
300 | if (this.sliding) {
301 | return this.$element.one('slid', function () {
302 | that.to(pos)
303 | })
304 | }
305 |
306 | if (activePos == pos) {
307 | return this.pause().cycle()
308 | }
309 |
310 | return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
311 | }
312 |
313 | , pause: function (e) {
314 | if (!e) this.paused = true
315 | clearInterval(this.interval)
316 | this.interval = null
317 | return this
318 | }
319 |
320 | , next: function () {
321 | if (this.sliding) return
322 | return this.slide('next')
323 | }
324 |
325 | , prev: function () {
326 | if (this.sliding) return
327 | return this.slide('prev')
328 | }
329 |
330 | , slide: function (type, next) {
331 | var $active = this.$element.find('.active')
332 | , $next = next || $active[type]()
333 | , isCycling = this.interval
334 | , direction = type == 'next' ? 'left' : 'right'
335 | , fallback = type == 'next' ? 'first' : 'last'
336 | , that = this
337 | , e = $.Event('slide')
338 |
339 | this.sliding = true
340 |
341 | isCycling && this.pause()
342 |
343 | $next = $next.length ? $next : this.$element.find('.item')[fallback]()
344 |
345 | if ($next.hasClass('active')) return
346 |
347 | if ($.support.transition && this.$element.hasClass('slide')) {
348 | this.$element.trigger(e)
349 | if (e.isDefaultPrevented()) return
350 | $next.addClass(type)
351 | $next[0].offsetWidth // force reflow
352 | $active.addClass(direction)
353 | $next.addClass(direction)
354 | this.$element.one($.support.transition.end, function () {
355 | $next.removeClass([type, direction].join(' ')).addClass('active')
356 | $active.removeClass(['active', direction].join(' '))
357 | that.sliding = false
358 | setTimeout(function () { that.$element.trigger('slid') }, 0)
359 | })
360 | } else {
361 | this.$element.trigger(e)
362 | if (e.isDefaultPrevented()) return
363 | $active.removeClass('active')
364 | $next.addClass('active')
365 | this.sliding = false
366 | this.$element.trigger('slid')
367 | }
368 |
369 | isCycling && this.cycle()
370 |
371 | return this
372 | }
373 |
374 | }
375 |
376 |
377 | /* CAROUSEL PLUGIN DEFINITION
378 | * ========================== */
379 |
380 | $.fn.carousel = function (option) {
381 | return this.each(function () {
382 | var $this = $(this)
383 | , data = $this.data('carousel')
384 | , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
385 | if (!data) $this.data('carousel', (data = new Carousel(this, options)))
386 | if (typeof option == 'number') data.to(option)
387 | else if (typeof option == 'string' || (option = options.slide)) data[option]()
388 | else if (options.interval) data.cycle()
389 | })
390 | }
391 |
392 | $.fn.carousel.defaults = {
393 | interval: 5000
394 | , pause: 'hover'
395 | }
396 |
397 | $.fn.carousel.Constructor = Carousel
398 |
399 |
400 | /* CAROUSEL DATA-API
401 | * ================= */
402 |
403 | $(function () {
404 | $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
405 | var $this = $(this), href
406 | , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
407 | , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
408 | $target.carousel(options)
409 | e.preventDefault()
410 | })
411 | })
412 |
413 | }(window.jQuery);/* =============================================================
414 | * bootstrap-collapse.js v2.0.4
415 | * http://twitter.github.com/bootstrap/javascript.html#collapse
416 | * =============================================================
417 | * Copyright 2012 Twitter, Inc.
418 | *
419 | * Licensed under the Apache License, Version 2.0 (the "License");
420 | * you may not use this file except in compliance with the License.
421 | * You may obtain a copy of the License at
422 | *
423 | * http://www.apache.org/licenses/LICENSE-2.0
424 | *
425 | * Unless required by applicable law or agreed to in writing, software
426 | * distributed under the License is distributed on an "AS IS" BASIS,
427 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
428 | * See the License for the specific language governing permissions and
429 | * limitations under the License.
430 | * ============================================================ */
431 |
432 |
433 | !function ($) {
434 |
435 | "use strict"; // jshint ;_;
436 |
437 |
438 | /* COLLAPSE PUBLIC CLASS DEFINITION
439 | * ================================ */
440 |
441 | var Collapse = function (element, options) {
442 | this.$element = $(element)
443 | this.options = $.extend({}, $.fn.collapse.defaults, options)
444 |
445 | if (this.options.parent) {
446 | this.$parent = $(this.options.parent)
447 | }
448 |
449 | this.options.toggle && this.toggle()
450 | }
451 |
452 | Collapse.prototype = {
453 |
454 | constructor: Collapse
455 |
456 | , dimension: function () {
457 | var hasWidth = this.$element.hasClass('width')
458 | return hasWidth ? 'width' : 'height'
459 | }
460 |
461 | , show: function () {
462 | var dimension
463 | , scroll
464 | , actives
465 | , hasData
466 |
467 | if (this.transitioning) return
468 |
469 | dimension = this.dimension()
470 | scroll = $.camelCase(['scroll', dimension].join('-'))
471 | actives = this.$parent && this.$parent.find('> .accordion-group > .in')
472 |
473 | if (actives && actives.length) {
474 | hasData = actives.data('collapse')
475 | if (hasData && hasData.transitioning) return
476 | actives.collapse('hide')
477 | hasData || actives.data('collapse', null)
478 | }
479 |
480 | this.$element[dimension](0)
481 | this.transition('addClass', $.Event('show'), 'shown')
482 | this.$element[dimension](this.$element[0][scroll])
483 | }
484 |
485 | , hide: function () {
486 | var dimension
487 | if (this.transitioning) return
488 | dimension = this.dimension()
489 | this.reset(this.$element[dimension]())
490 | this.transition('removeClass', $.Event('hide'), 'hidden')
491 | this.$element[dimension](0)
492 | }
493 |
494 | , reset: function (size) {
495 | var dimension = this.dimension()
496 |
497 | this.$element
498 | .removeClass('collapse')
499 | [dimension](size || 'auto')
500 | [0].offsetWidth
501 |
502 | this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
503 |
504 | return this
505 | }
506 |
507 | , transition: function (method, startEvent, completeEvent) {
508 | var that = this
509 | , complete = function () {
510 | if (startEvent.type == 'show') that.reset()
511 | that.transitioning = 0
512 | that.$element.trigger(completeEvent)
513 | }
514 |
515 | this.$element.trigger(startEvent)
516 |
517 | if (startEvent.isDefaultPrevented()) return
518 |
519 | this.transitioning = 1
520 |
521 | this.$element[method]('in')
522 |
523 | $.support.transition && this.$element.hasClass('collapse') ?
524 | this.$element.one($.support.transition.end, complete) :
525 | complete()
526 | }
527 |
528 | , toggle: function () {
529 | this[this.$element.hasClass('in') ? 'hide' : 'show']()
530 | }
531 |
532 | }
533 |
534 |
535 | /* COLLAPSIBLE PLUGIN DEFINITION
536 | * ============================== */
537 |
538 | $.fn.collapse = function (option) {
539 | return this.each(function () {
540 | var $this = $(this)
541 | , data = $this.data('collapse')
542 | , options = typeof option == 'object' && option
543 | if (!data) $this.data('collapse', (data = new Collapse(this, options)))
544 | if (typeof option == 'string') data[option]()
545 | })
546 | }
547 |
548 | $.fn.collapse.defaults = {
549 | toggle: true
550 | }
551 |
552 | $.fn.collapse.Constructor = Collapse
553 |
554 |
555 | /* COLLAPSIBLE DATA-API
556 | * ==================== */
557 |
558 | $(function () {
559 | $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
560 | var $this = $(this), href
561 | , target = $this.attr('data-target')
562 | || e.preventDefault()
563 | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
564 | , option = $(target).data('collapse') ? 'toggle' : $this.data()
565 | $(target).collapse(option)
566 | })
567 | })
568 |
569 | }(window.jQuery);/* ============================================================
570 | * bootstrap-dropdown.js v2.0.4
571 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns
572 | * ============================================================
573 | * Copyright 2012 Twitter, Inc.
574 | *
575 | * Licensed under the Apache License, Version 2.0 (the "License");
576 | * you may not use this file except in compliance with the License.
577 | * You may obtain a copy of the License at
578 | *
579 | * http://www.apache.org/licenses/LICENSE-2.0
580 | *
581 | * Unless required by applicable law or agreed to in writing, software
582 | * distributed under the License is distributed on an "AS IS" BASIS,
583 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
584 | * See the License for the specific language governing permissions and
585 | * limitations under the License.
586 | * ============================================================ */
587 |
588 |
589 | !function ($) {
590 |
591 | "use strict"; // jshint ;_;
592 |
593 |
594 | /* DROPDOWN CLASS DEFINITION
595 | * ========================= */
596 |
597 | var toggle = '[data-toggle="dropdown"]'
598 | , Dropdown = function (element) {
599 | var $el = $(element).on('click.dropdown.data-api', this.toggle)
600 | $('html').on('click.dropdown.data-api', function () {
601 | $el.parent().removeClass('open')
602 | })
603 | }
604 |
605 | Dropdown.prototype = {
606 |
607 | constructor: Dropdown
608 |
609 | , toggle: function (e) {
610 | var $this = $(this)
611 | , $parent
612 | , selector
613 | , isActive
614 |
615 | if ($this.is('.disabled, :disabled')) return
616 |
617 | selector = $this.attr('data-target')
618 |
619 | if (!selector) {
620 | selector = $this.attr('href')
621 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
622 | }
623 |
624 | $parent = $(selector)
625 | $parent.length || ($parent = $this.parent())
626 |
627 | isActive = $parent.hasClass('open')
628 |
629 | clearMenus()
630 |
631 | if (!isActive) $parent.toggleClass('open')
632 |
633 | return false
634 | }
635 |
636 | }
637 |
638 | function clearMenus() {
639 | $(toggle).parent().removeClass('open')
640 | }
641 |
642 |
643 | /* DROPDOWN PLUGIN DEFINITION
644 | * ========================== */
645 |
646 | $.fn.dropdown = function (option) {
647 | return this.each(function () {
648 | var $this = $(this)
649 | , data = $this.data('dropdown')
650 | if (!data) $this.data('dropdown', (data = new Dropdown(this)))
651 | if (typeof option == 'string') data[option].call($this)
652 | })
653 | }
654 |
655 | $.fn.dropdown.Constructor = Dropdown
656 |
657 |
658 | /* APPLY TO STANDARD DROPDOWN ELEMENTS
659 | * =================================== */
660 |
661 | $(function () {
662 | $('html').on('click.dropdown.data-api', clearMenus)
663 | $('body')
664 | .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
665 | .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
666 | })
667 |
668 | }(window.jQuery);/* =========================================================
669 | * bootstrap-modal.js v2.0.4
670 | * http://twitter.github.com/bootstrap/javascript.html#modals
671 | * =========================================================
672 | * Copyright 2012 Twitter, Inc.
673 | *
674 | * Licensed under the Apache License, Version 2.0 (the "License");
675 | * you may not use this file except in compliance with the License.
676 | * You may obtain a copy of the License at
677 | *
678 | * http://www.apache.org/licenses/LICENSE-2.0
679 | *
680 | * Unless required by applicable law or agreed to in writing, software
681 | * distributed under the License is distributed on an "AS IS" BASIS,
682 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
683 | * See the License for the specific language governing permissions and
684 | * limitations under the License.
685 | * ========================================================= */
686 |
687 |
688 | !function ($) {
689 |
690 | "use strict"; // jshint ;_;
691 |
692 |
693 | /* MODAL CLASS DEFINITION
694 | * ====================== */
695 |
696 | var Modal = function (content, options) {
697 | this.options = options
698 | this.$element = $(content)
699 | .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
700 | }
701 |
702 | Modal.prototype = {
703 |
704 | constructor: Modal
705 |
706 | , toggle: function () {
707 | return this[!this.isShown ? 'show' : 'hide']()
708 | }
709 |
710 | , show: function () {
711 | var that = this
712 | , e = $.Event('show')
713 |
714 | this.$element.trigger(e)
715 |
716 | if (this.isShown || e.isDefaultPrevented()) return
717 |
718 | $('body').addClass('modal-open')
719 |
720 | this.isShown = true
721 |
722 | escape.call(this)
723 | backdrop.call(this, function () {
724 | var transition = $.support.transition && that.$element.hasClass('fade')
725 |
726 | if (!that.$element.parent().length) {
727 | that.$element.appendTo(document.body) //don't move modals dom position
728 | }
729 |
730 | that.$element
731 | .show()
732 |
733 | if (transition) {
734 | that.$element[0].offsetWidth // force reflow
735 | }
736 |
737 | that.$element.addClass('in')
738 |
739 | transition ?
740 | that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
741 | that.$element.trigger('shown')
742 |
743 | })
744 | }
745 |
746 | , hide: function (e) {
747 | e && e.preventDefault()
748 |
749 | var that = this
750 |
751 | e = $.Event('hide')
752 |
753 | this.$element.trigger(e)
754 |
755 | if (!this.isShown || e.isDefaultPrevented()) return
756 |
757 | this.isShown = false
758 |
759 | $('body').removeClass('modal-open')
760 |
761 | escape.call(this)
762 |
763 | this.$element.removeClass('in')
764 |
765 | $.support.transition && this.$element.hasClass('fade') ?
766 | hideWithTransition.call(this) :
767 | hideModal.call(this)
768 | }
769 |
770 | }
771 |
772 |
773 | /* MODAL PRIVATE METHODS
774 | * ===================== */
775 |
776 | function hideWithTransition() {
777 | var that = this
778 | , timeout = setTimeout(function () {
779 | that.$element.off($.support.transition.end)
780 | hideModal.call(that)
781 | }, 500)
782 |
783 | this.$element.one($.support.transition.end, function () {
784 | clearTimeout(timeout)
785 | hideModal.call(that)
786 | })
787 | }
788 |
789 | function hideModal(that) {
790 | this.$element
791 | .hide()
792 | .trigger('hidden')
793 |
794 | backdrop.call(this)
795 | }
796 |
797 | function backdrop(callback) {
798 | var that = this
799 | , animate = this.$element.hasClass('fade') ? 'fade' : ''
800 |
801 | if (this.isShown && this.options.backdrop) {
802 | var doAnimate = $.support.transition && animate
803 |
804 | this.$backdrop = $('
')
805 | .appendTo(document.body)
806 |
807 | if (this.options.backdrop != 'static') {
808 | this.$backdrop.click($.proxy(this.hide, this))
809 | }
810 |
811 | if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
812 |
813 | this.$backdrop.addClass('in')
814 |
815 | doAnimate ?
816 | this.$backdrop.one($.support.transition.end, callback) :
817 | callback()
818 |
819 | } else if (!this.isShown && this.$backdrop) {
820 | this.$backdrop.removeClass('in')
821 |
822 | $.support.transition && this.$element.hasClass('fade')?
823 | this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
824 | removeBackdrop.call(this)
825 |
826 | } else if (callback) {
827 | callback()
828 | }
829 | }
830 |
831 | function removeBackdrop() {
832 | this.$backdrop.remove()
833 | this.$backdrop = null
834 | }
835 |
836 | function escape() {
837 | var that = this
838 | if (this.isShown && this.options.keyboard) {
839 | $(document).on('keyup.dismiss.modal', function ( e ) {
840 | e.which == 27 && that.hide()
841 | })
842 | } else if (!this.isShown) {
843 | $(document).off('keyup.dismiss.modal')
844 | }
845 | }
846 |
847 |
848 | /* MODAL PLUGIN DEFINITION
849 | * ======================= */
850 |
851 | $.fn.modal = function (option) {
852 | return this.each(function () {
853 | var $this = $(this)
854 | , data = $this.data('modal')
855 | , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
856 | if (!data) $this.data('modal', (data = new Modal(this, options)))
857 | if (typeof option == 'string') data[option]()
858 | else if (options.show) data.show()
859 | })
860 | }
861 |
862 | $.fn.modal.defaults = {
863 | backdrop: true
864 | , keyboard: true
865 | , show: true
866 | }
867 |
868 | $.fn.modal.Constructor = Modal
869 |
870 |
871 | /* MODAL DATA-API
872 | * ============== */
873 |
874 | $(function () {
875 | $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
876 | var $this = $(this), href
877 | , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
878 | , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
879 |
880 | e.preventDefault()
881 | $target.modal(option)
882 | })
883 | })
884 |
885 | }(window.jQuery);/* ===========================================================
886 | * bootstrap-tooltip.js v2.0.4
887 | * http://twitter.github.com/bootstrap/javascript.html#tooltips
888 | * Inspired by the original jQuery.tipsy by Jason Frame
889 | * ===========================================================
890 | * Copyright 2012 Twitter, Inc.
891 | *
892 | * Licensed under the Apache License, Version 2.0 (the "License");
893 | * you may not use this file except in compliance with the License.
894 | * You may obtain a copy of the License at
895 | *
896 | * http://www.apache.org/licenses/LICENSE-2.0
897 | *
898 | * Unless required by applicable law or agreed to in writing, software
899 | * distributed under the License is distributed on an "AS IS" BASIS,
900 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
901 | * See the License for the specific language governing permissions and
902 | * limitations under the License.
903 | * ========================================================== */
904 |
905 |
906 | !function ($) {
907 |
908 | "use strict"; // jshint ;_;
909 |
910 |
911 | /* TOOLTIP PUBLIC CLASS DEFINITION
912 | * =============================== */
913 |
914 | var Tooltip = function (element, options) {
915 | this.init('tooltip', element, options)
916 | }
917 |
918 | Tooltip.prototype = {
919 |
920 | constructor: Tooltip
921 |
922 | , init: function (type, element, options) {
923 | var eventIn
924 | , eventOut
925 |
926 | this.type = type
927 | this.$element = $(element)
928 | this.options = this.getOptions(options)
929 | this.enabled = true
930 |
931 | if (this.options.trigger != 'manual') {
932 | eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
933 | eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
934 | this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
935 | this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
936 | }
937 |
938 | this.options.selector ?
939 | (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
940 | this.fixTitle()
941 | }
942 |
943 | , getOptions: function (options) {
944 | options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
945 |
946 | if (options.delay && typeof options.delay == 'number') {
947 | options.delay = {
948 | show: options.delay
949 | , hide: options.delay
950 | }
951 | }
952 |
953 | return options
954 | }
955 |
956 | , enter: function (e) {
957 | var self = $(e.currentTarget)[this.type](this._options).data(this.type)
958 |
959 | if (!self.options.delay || !self.options.delay.show) return self.show()
960 |
961 | clearTimeout(this.timeout)
962 | self.hoverState = 'in'
963 | this.timeout = setTimeout(function() {
964 | if (self.hoverState == 'in') self.show()
965 | }, self.options.delay.show)
966 | }
967 |
968 | , leave: function (e) {
969 | var self = $(e.currentTarget)[this.type](this._options).data(this.type)
970 |
971 | if (this.timeout) clearTimeout(this.timeout)
972 | if (!self.options.delay || !self.options.delay.hide) return self.hide()
973 |
974 | self.hoverState = 'out'
975 | this.timeout = setTimeout(function() {
976 | if (self.hoverState == 'out') self.hide()
977 | }, self.options.delay.hide)
978 | }
979 |
980 | , show: function () {
981 | var $tip
982 | , inside
983 | , pos
984 | , actualWidth
985 | , actualHeight
986 | , placement
987 | , tp
988 |
989 | if (this.hasContent() && this.enabled) {
990 | $tip = this.tip()
991 | this.setContent()
992 |
993 | if (this.options.animation) {
994 | $tip.addClass('fade')
995 | }
996 |
997 | placement = typeof this.options.placement == 'function' ?
998 | this.options.placement.call(this, $tip[0], this.$element[0]) :
999 | this.options.placement
1000 |
1001 | inside = /in/.test(placement)
1002 |
1003 | $tip
1004 | .remove()
1005 | .css({ top: 0, left: 0, display: 'block' })
1006 | .appendTo(inside ? this.$element : document.body)
1007 |
1008 | pos = this.getPosition(inside)
1009 |
1010 | actualWidth = $tip[0].offsetWidth
1011 | actualHeight = $tip[0].offsetHeight
1012 |
1013 | switch (inside ? placement.split(' ')[1] : placement) {
1014 | case 'bottom':
1015 | tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1016 | break
1017 | case 'top':
1018 | tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1019 | break
1020 | case 'left':
1021 | tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1022 | break
1023 | case 'right':
1024 | tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1025 | break
1026 | }
1027 |
1028 | $tip
1029 | .css(tp)
1030 | .addClass(placement)
1031 | .addClass('in')
1032 | }
1033 | }
1034 |
1035 | , isHTML: function(text) {
1036 | // html string detection logic adapted from jQuery
1037 | return typeof text != 'string'
1038 | || ( text.charAt(0) === "<"
1039 | && text.charAt( text.length - 1 ) === ">"
1040 | && text.length >= 3
1041 | ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
1042 | }
1043 |
1044 | , setContent: function () {
1045 | var $tip = this.tip()
1046 | , title = this.getTitle()
1047 |
1048 | $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
1049 | $tip.removeClass('fade in top bottom left right')
1050 | }
1051 |
1052 | , hide: function () {
1053 | var that = this
1054 | , $tip = this.tip()
1055 |
1056 | $tip.removeClass('in')
1057 |
1058 | function removeWithAnimation() {
1059 | var timeout = setTimeout(function () {
1060 | $tip.off($.support.transition.end).remove()
1061 | }, 500)
1062 |
1063 | $tip.one($.support.transition.end, function () {
1064 | clearTimeout(timeout)
1065 | $tip.remove()
1066 | })
1067 | }
1068 |
1069 | $.support.transition && this.$tip.hasClass('fade') ?
1070 | removeWithAnimation() :
1071 | $tip.remove()
1072 | }
1073 |
1074 | , fixTitle: function () {
1075 | var $e = this.$element
1076 | if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1077 | $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
1078 | }
1079 | }
1080 |
1081 | , hasContent: function () {
1082 | return this.getTitle()
1083 | }
1084 |
1085 | , getPosition: function (inside) {
1086 | return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
1087 | width: this.$element[0].offsetWidth
1088 | , height: this.$element[0].offsetHeight
1089 | })
1090 | }
1091 |
1092 | , getTitle: function () {
1093 | var title
1094 | , $e = this.$element
1095 | , o = this.options
1096 |
1097 | title = $e.attr('data-original-title')
1098 | || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1099 |
1100 | return title
1101 | }
1102 |
1103 | , tip: function () {
1104 | return this.$tip = this.$tip || $(this.options.template)
1105 | }
1106 |
1107 | , validate: function () {
1108 | if (!this.$element[0].parentNode) {
1109 | this.hide()
1110 | this.$element = null
1111 | this.options = null
1112 | }
1113 | }
1114 |
1115 | , enable: function () {
1116 | this.enabled = true
1117 | }
1118 |
1119 | , disable: function () {
1120 | this.enabled = false
1121 | }
1122 |
1123 | , toggleEnabled: function () {
1124 | this.enabled = !this.enabled
1125 | }
1126 |
1127 | , toggle: function () {
1128 | this[this.tip().hasClass('in') ? 'hide' : 'show']()
1129 | }
1130 |
1131 | }
1132 |
1133 |
1134 | /* TOOLTIP PLUGIN DEFINITION
1135 | * ========================= */
1136 |
1137 | $.fn.tooltip = function ( option ) {
1138 | return this.each(function () {
1139 | var $this = $(this)
1140 | , data = $this.data('tooltip')
1141 | , options = typeof option == 'object' && option
1142 | if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1143 | if (typeof option == 'string') data[option]()
1144 | })
1145 | }
1146 |
1147 | $.fn.tooltip.Constructor = Tooltip
1148 |
1149 | $.fn.tooltip.defaults = {
1150 | animation: true
1151 | , placement: 'top'
1152 | , selector: false
1153 | , template: ''
1154 | , trigger: 'hover'
1155 | , title: ''
1156 | , delay: 0
1157 | }
1158 |
1159 | }(window.jQuery);
1160 | /* ===========================================================
1161 | * bootstrap-popover.js v2.0.4
1162 | * http://twitter.github.com/bootstrap/javascript.html#popovers
1163 | * ===========================================================
1164 | * Copyright 2012 Twitter, Inc.
1165 | *
1166 | * Licensed under the Apache License, Version 2.0 (the "License");
1167 | * you may not use this file except in compliance with the License.
1168 | * You may obtain a copy of the License at
1169 | *
1170 | * http://www.apache.org/licenses/LICENSE-2.0
1171 | *
1172 | * Unless required by applicable law or agreed to in writing, software
1173 | * distributed under the License is distributed on an "AS IS" BASIS,
1174 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1175 | * See the License for the specific language governing permissions and
1176 | * limitations under the License.
1177 | * =========================================================== */
1178 |
1179 |
1180 | !function ($) {
1181 |
1182 | "use strict"; // jshint ;_;
1183 |
1184 |
1185 | /* POPOVER PUBLIC CLASS DEFINITION
1186 | * =============================== */
1187 |
1188 | var Popover = function ( element, options ) {
1189 | this.init('popover', element, options)
1190 | }
1191 |
1192 |
1193 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1194 | ========================================== */
1195 |
1196 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1197 |
1198 | constructor: Popover
1199 |
1200 | , setContent: function () {
1201 | var $tip = this.tip()
1202 | , title = this.getTitle()
1203 | , content = this.getContent()
1204 |
1205 | $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
1206 | $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
1207 |
1208 | $tip.removeClass('fade top bottom left right in')
1209 | }
1210 |
1211 | , hasContent: function () {
1212 | return this.getTitle() || this.getContent()
1213 | }
1214 |
1215 | , getContent: function () {
1216 | var content
1217 | , $e = this.$element
1218 | , o = this.options
1219 |
1220 | content = $e.attr('data-content')
1221 | || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1222 |
1223 | return content
1224 | }
1225 |
1226 | , tip: function () {
1227 | if (!this.$tip) {
1228 | this.$tip = $(this.options.template)
1229 | }
1230 | return this.$tip
1231 | }
1232 |
1233 | })
1234 |
1235 |
1236 | /* POPOVER PLUGIN DEFINITION
1237 | * ======================= */
1238 |
1239 | $.fn.popover = function (option) {
1240 | return this.each(function () {
1241 | var $this = $(this)
1242 | , data = $this.data('popover')
1243 | , options = typeof option == 'object' && option
1244 | if (!data) $this.data('popover', (data = new Popover(this, options)))
1245 | if (typeof option == 'string') data[option]()
1246 | })
1247 | }
1248 |
1249 | $.fn.popover.Constructor = Popover
1250 |
1251 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1252 | placement: 'right'
1253 | , content: ''
1254 | , template: ''
1255 | })
1256 |
1257 | }(window.jQuery);/* =============================================================
1258 | * bootstrap-scrollspy.js v2.0.4
1259 | * http://twitter.github.com/bootstrap/javascript.html#scrollspy
1260 | * =============================================================
1261 | * Copyright 2012 Twitter, Inc.
1262 | *
1263 | * Licensed under the Apache License, Version 2.0 (the "License");
1264 | * you may not use this file except in compliance with the License.
1265 | * You may obtain a copy of the License at
1266 | *
1267 | * http://www.apache.org/licenses/LICENSE-2.0
1268 | *
1269 | * Unless required by applicable law or agreed to in writing, software
1270 | * distributed under the License is distributed on an "AS IS" BASIS,
1271 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1272 | * See the License for the specific language governing permissions and
1273 | * limitations under the License.
1274 | * ============================================================== */
1275 |
1276 |
1277 | !function ($) {
1278 |
1279 | "use strict"; // jshint ;_;
1280 |
1281 |
1282 | /* SCROLLSPY CLASS DEFINITION
1283 | * ========================== */
1284 |
1285 | function ScrollSpy( element, options) {
1286 | var process = $.proxy(this.process, this)
1287 | , $element = $(element).is('body') ? $(window) : $(element)
1288 | , href
1289 | this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1290 | this.$scrollElement = $element.on('scroll.scroll.data-api', process)
1291 | this.selector = (this.options.target
1292 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1293 | || '') + ' .nav li > a'
1294 | this.$body = $('body')
1295 | this.refresh()
1296 | this.process()
1297 | }
1298 |
1299 | ScrollSpy.prototype = {
1300 |
1301 | constructor: ScrollSpy
1302 |
1303 | , refresh: function () {
1304 | var self = this
1305 | , $targets
1306 |
1307 | this.offsets = $([])
1308 | this.targets = $([])
1309 |
1310 | $targets = this.$body
1311 | .find(this.selector)
1312 | .map(function () {
1313 | var $el = $(this)
1314 | , href = $el.data('target') || $el.attr('href')
1315 | , $href = /^#\w/.test(href) && $(href)
1316 | return ( $href
1317 | && href.length
1318 | && [[ $href.position().top, href ]] ) || null
1319 | })
1320 | .sort(function (a, b) { return a[0] - b[0] })
1321 | .each(function () {
1322 | self.offsets.push(this[0])
1323 | self.targets.push(this[1])
1324 | })
1325 | }
1326 |
1327 | , process: function () {
1328 | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1329 | , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1330 | , maxScroll = scrollHeight - this.$scrollElement.height()
1331 | , offsets = this.offsets
1332 | , targets = this.targets
1333 | , activeTarget = this.activeTarget
1334 | , i
1335 |
1336 | if (scrollTop >= maxScroll) {
1337 | return activeTarget != (i = targets.last()[0])
1338 | && this.activate ( i )
1339 | }
1340 |
1341 | for (i = offsets.length; i--;) {
1342 | activeTarget != targets[i]
1343 | && scrollTop >= offsets[i]
1344 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1345 | && this.activate( targets[i] )
1346 | }
1347 | }
1348 |
1349 | , activate: function (target) {
1350 | var active
1351 | , selector
1352 |
1353 | this.activeTarget = target
1354 |
1355 | $(this.selector)
1356 | .parent('.active')
1357 | .removeClass('active')
1358 |
1359 | selector = this.selector
1360 | + '[data-target="' + target + '"],'
1361 | + this.selector + '[href="' + target + '"]'
1362 |
1363 | active = $(selector)
1364 | .parent('li')
1365 | .addClass('active')
1366 |
1367 | if (active.parent('.dropdown-menu')) {
1368 | active = active.closest('li.dropdown').addClass('active')
1369 | }
1370 |
1371 | active.trigger('activate')
1372 | }
1373 |
1374 | }
1375 |
1376 |
1377 | /* SCROLLSPY PLUGIN DEFINITION
1378 | * =========================== */
1379 |
1380 | $.fn.scrollspy = function ( option ) {
1381 | return this.each(function () {
1382 | var $this = $(this)
1383 | , data = $this.data('scrollspy')
1384 | , options = typeof option == 'object' && option
1385 | if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1386 | if (typeof option == 'string') data[option]()
1387 | })
1388 | }
1389 |
1390 | $.fn.scrollspy.Constructor = ScrollSpy
1391 |
1392 | $.fn.scrollspy.defaults = {
1393 | offset: 10
1394 | }
1395 |
1396 |
1397 | /* SCROLLSPY DATA-API
1398 | * ================== */
1399 |
1400 | $(function () {
1401 | $('[data-spy="scroll"]').each(function () {
1402 | var $spy = $(this)
1403 | $spy.scrollspy($spy.data())
1404 | })
1405 | })
1406 |
1407 | }(window.jQuery);/* ========================================================
1408 | * bootstrap-tab.js v2.0.4
1409 | * http://twitter.github.com/bootstrap/javascript.html#tabs
1410 | * ========================================================
1411 | * Copyright 2012 Twitter, Inc.
1412 | *
1413 | * Licensed under the Apache License, Version 2.0 (the "License");
1414 | * you may not use this file except in compliance with the License.
1415 | * You may obtain a copy of the License at
1416 | *
1417 | * http://www.apache.org/licenses/LICENSE-2.0
1418 | *
1419 | * Unless required by applicable law or agreed to in writing, software
1420 | * distributed under the License is distributed on an "AS IS" BASIS,
1421 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1422 | * See the License for the specific language governing permissions and
1423 | * limitations under the License.
1424 | * ======================================================== */
1425 |
1426 |
1427 | !function ($) {
1428 |
1429 | "use strict"; // jshint ;_;
1430 |
1431 |
1432 | /* TAB CLASS DEFINITION
1433 | * ==================== */
1434 |
1435 | var Tab = function ( element ) {
1436 | this.element = $(element)
1437 | }
1438 |
1439 | Tab.prototype = {
1440 |
1441 | constructor: Tab
1442 |
1443 | , show: function () {
1444 | var $this = this.element
1445 | , $ul = $this.closest('ul:not(.dropdown-menu)')
1446 | , selector = $this.attr('data-target')
1447 | , previous
1448 | , $target
1449 | , e
1450 |
1451 | if (!selector) {
1452 | selector = $this.attr('href')
1453 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1454 | }
1455 |
1456 | if ( $this.parent('li').hasClass('active') ) return
1457 |
1458 | previous = $ul.find('.active a').last()[0]
1459 |
1460 | e = $.Event('show', {
1461 | relatedTarget: previous
1462 | })
1463 |
1464 | $this.trigger(e)
1465 |
1466 | if (e.isDefaultPrevented()) return
1467 |
1468 | $target = $(selector)
1469 |
1470 | this.activate($this.parent('li'), $ul)
1471 | this.activate($target, $target.parent(), function () {
1472 | $this.trigger({
1473 | type: 'shown'
1474 | , relatedTarget: previous
1475 | })
1476 | })
1477 | }
1478 |
1479 | , activate: function ( element, container, callback) {
1480 | var $active = container.find('> .active')
1481 | , transition = callback
1482 | && $.support.transition
1483 | && $active.hasClass('fade')
1484 |
1485 | function next() {
1486 | $active
1487 | .removeClass('active')
1488 | .find('> .dropdown-menu > .active')
1489 | .removeClass('active')
1490 |
1491 | element.addClass('active')
1492 |
1493 | if (transition) {
1494 | element[0].offsetWidth // reflow for transition
1495 | element.addClass('in')
1496 | } else {
1497 | element.removeClass('fade')
1498 | }
1499 |
1500 | if ( element.parent('.dropdown-menu') ) {
1501 | element.closest('li.dropdown').addClass('active')
1502 | }
1503 |
1504 | callback && callback()
1505 | }
1506 |
1507 | transition ?
1508 | $active.one($.support.transition.end, next) :
1509 | next()
1510 |
1511 | $active.removeClass('in')
1512 | }
1513 | }
1514 |
1515 |
1516 | /* TAB PLUGIN DEFINITION
1517 | * ===================== */
1518 |
1519 | $.fn.tab = function ( option ) {
1520 | return this.each(function () {
1521 | var $this = $(this)
1522 | , data = $this.data('tab')
1523 | if (!data) $this.data('tab', (data = new Tab(this)))
1524 | if (typeof option == 'string') data[option]()
1525 | })
1526 | }
1527 |
1528 | $.fn.tab.Constructor = Tab
1529 |
1530 |
1531 | /* TAB DATA-API
1532 | * ============ */
1533 |
1534 | $(function () {
1535 | $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1536 | e.preventDefault()
1537 | $(this).tab('show')
1538 | })
1539 | })
1540 |
1541 | }(window.jQuery);/* =============================================================
1542 | * bootstrap-typeahead.js v2.0.4
1543 | * http://twitter.github.com/bootstrap/javascript.html#typeahead
1544 | * =============================================================
1545 | * Copyright 2012 Twitter, Inc.
1546 | *
1547 | * Licensed under the Apache License, Version 2.0 (the "License");
1548 | * you may not use this file except in compliance with the License.
1549 | * You may obtain a copy of the License at
1550 | *
1551 | * http://www.apache.org/licenses/LICENSE-2.0
1552 | *
1553 | * Unless required by applicable law or agreed to in writing, software
1554 | * distributed under the License is distributed on an "AS IS" BASIS,
1555 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1556 | * See the License for the specific language governing permissions and
1557 | * limitations under the License.
1558 | * ============================================================ */
1559 |
1560 |
1561 | !function($){
1562 |
1563 | "use strict"; // jshint ;_;
1564 |
1565 |
1566 | /* TYPEAHEAD PUBLIC CLASS DEFINITION
1567 | * ================================= */
1568 |
1569 | var Typeahead = function (element, options) {
1570 | this.$element = $(element)
1571 | this.options = $.extend({}, $.fn.typeahead.defaults, options)
1572 | this.matcher = this.options.matcher || this.matcher
1573 | this.sorter = this.options.sorter || this.sorter
1574 | this.highlighter = this.options.highlighter || this.highlighter
1575 | this.updater = this.options.updater || this.updater
1576 | this.$menu = $(this.options.menu).appendTo('body')
1577 | this.source = this.options.source
1578 | this.shown = false
1579 | this.listen()
1580 | }
1581 |
1582 | Typeahead.prototype = {
1583 |
1584 | constructor: Typeahead
1585 |
1586 | , select: function () {
1587 | var val = this.$menu.find('.active').attr('data-value')
1588 | this.$element
1589 | .val(this.updater(val))
1590 | .change()
1591 | return this.hide()
1592 | }
1593 |
1594 | , updater: function (item) {
1595 | return item
1596 | }
1597 |
1598 | , show: function () {
1599 | var pos = $.extend({}, this.$element.offset(), {
1600 | height: this.$element[0].offsetHeight
1601 | })
1602 |
1603 | this.$menu.css({
1604 | top: pos.top + pos.height
1605 | , left: pos.left
1606 | })
1607 |
1608 | this.$menu.show()
1609 | this.shown = true
1610 | return this
1611 | }
1612 |
1613 | , hide: function () {
1614 | this.$menu.hide()
1615 | this.shown = false
1616 | return this
1617 | }
1618 |
1619 | , lookup: function (event) {
1620 | var that = this
1621 | , items
1622 | , q
1623 |
1624 | this.query = this.$element.val()
1625 |
1626 | if (!this.query) {
1627 | return this.shown ? this.hide() : this
1628 | }
1629 |
1630 | items = $.grep(this.source, function (item) {
1631 | return that.matcher(item)
1632 | })
1633 |
1634 | items = this.sorter(items)
1635 |
1636 | if (!items.length) {
1637 | return this.shown ? this.hide() : this
1638 | }
1639 |
1640 | return this.render(items.slice(0, this.options.items)).show()
1641 | }
1642 |
1643 | , matcher: function (item) {
1644 | return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1645 | }
1646 |
1647 | , sorter: function (items) {
1648 | var beginswith = []
1649 | , caseSensitive = []
1650 | , caseInsensitive = []
1651 | , item
1652 |
1653 | while (item = items.shift()) {
1654 | if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1655 | else if (~item.indexOf(this.query)) caseSensitive.push(item)
1656 | else caseInsensitive.push(item)
1657 | }
1658 |
1659 | return beginswith.concat(caseSensitive, caseInsensitive)
1660 | }
1661 |
1662 | , highlighter: function (item) {
1663 | var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
1664 | return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
1665 | return '' + match + ' '
1666 | })
1667 | }
1668 |
1669 | , render: function (items) {
1670 | var that = this
1671 |
1672 | items = $(items).map(function (i, item) {
1673 | i = $(that.options.item).attr('data-value', item)
1674 | i.find('a').html(that.highlighter(item))
1675 | return i[0]
1676 | })
1677 |
1678 | items.first().addClass('active')
1679 | this.$menu.html(items)
1680 | return this
1681 | }
1682 |
1683 | , next: function (event) {
1684 | var active = this.$menu.find('.active').removeClass('active')
1685 | , next = active.next()
1686 |
1687 | if (!next.length) {
1688 | next = $(this.$menu.find('li')[0])
1689 | }
1690 |
1691 | next.addClass('active')
1692 | }
1693 |
1694 | , prev: function (event) {
1695 | var active = this.$menu.find('.active').removeClass('active')
1696 | , prev = active.prev()
1697 |
1698 | if (!prev.length) {
1699 | prev = this.$menu.find('li').last()
1700 | }
1701 |
1702 | prev.addClass('active')
1703 | }
1704 |
1705 | , listen: function () {
1706 | this.$element
1707 | .on('blur', $.proxy(this.blur, this))
1708 | .on('keypress', $.proxy(this.keypress, this))
1709 | .on('keyup', $.proxy(this.keyup, this))
1710 |
1711 | if ($.browser.webkit || $.browser.msie) {
1712 | this.$element.on('keydown', $.proxy(this.keypress, this))
1713 | }
1714 |
1715 | this.$menu
1716 | .on('click', $.proxy(this.click, this))
1717 | .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1718 | }
1719 |
1720 | , keyup: function (e) {
1721 | switch(e.keyCode) {
1722 | case 40: // down arrow
1723 | case 38: // up arrow
1724 | break
1725 |
1726 | case 9: // tab
1727 | case 13: // enter
1728 | if (!this.shown) return
1729 | this.select()
1730 | break
1731 |
1732 | case 27: // escape
1733 | if (!this.shown) return
1734 | this.hide()
1735 | break
1736 |
1737 | default:
1738 | this.lookup()
1739 | }
1740 |
1741 | e.stopPropagation()
1742 | e.preventDefault()
1743 | }
1744 |
1745 | , keypress: function (e) {
1746 | if (!this.shown) return
1747 |
1748 | switch(e.keyCode) {
1749 | case 9: // tab
1750 | case 13: // enter
1751 | case 27: // escape
1752 | e.preventDefault()
1753 | break
1754 |
1755 | case 38: // up arrow
1756 | if (e.type != 'keydown') break
1757 | e.preventDefault()
1758 | this.prev()
1759 | break
1760 |
1761 | case 40: // down arrow
1762 | if (e.type != 'keydown') break
1763 | e.preventDefault()
1764 | this.next()
1765 | break
1766 | }
1767 |
1768 | e.stopPropagation()
1769 | }
1770 |
1771 | , blur: function (e) {
1772 | var that = this
1773 | setTimeout(function () { that.hide() }, 150)
1774 | }
1775 |
1776 | , click: function (e) {
1777 | e.stopPropagation()
1778 | e.preventDefault()
1779 | this.select()
1780 | }
1781 |
1782 | , mouseenter: function (e) {
1783 | this.$menu.find('.active').removeClass('active')
1784 | $(e.currentTarget).addClass('active')
1785 | }
1786 |
1787 | }
1788 |
1789 |
1790 | /* TYPEAHEAD PLUGIN DEFINITION
1791 | * =========================== */
1792 |
1793 | $.fn.typeahead = function (option) {
1794 | return this.each(function () {
1795 | var $this = $(this)
1796 | , data = $this.data('typeahead')
1797 | , options = typeof option == 'object' && option
1798 | if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1799 | if (typeof option == 'string') data[option]()
1800 | })
1801 | }
1802 |
1803 | $.fn.typeahead.defaults = {
1804 | source: []
1805 | , items: 8
1806 | , menu: ''
1807 | , item: ' '
1808 | }
1809 |
1810 | $.fn.typeahead.Constructor = Typeahead
1811 |
1812 |
1813 | /* TYPEAHEAD DATA-API
1814 | * ================== */
1815 |
1816 | $(function () {
1817 | $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1818 | var $this = $(this)
1819 | if ($this.data('typeahead')) return
1820 | e.preventDefault()
1821 | $this.typeahead($this.data())
1822 | })
1823 | })
1824 |
1825 | }(window.jQuery);
--------------------------------------------------------------------------------
/js/script.coffee:
--------------------------------------------------------------------------------
1 | $ ->
2 |
3 | jade2html = (input, data) ->
4 | jade.compile(input, pretty: true, doctype: "5")(data)
5 |
6 | update = ($jade) ->
7 | $data = $jade.siblings(".json")
8 | json = $data.val() || "{}"
9 | $html = $jade.closest(".row").find("textarea.html")
10 | $jade.closest(".row").find("textarea").removeClass("error")
11 | try
12 | data = JSON.parse json
13 | catch error
14 | $data.addClass("error")
15 | $html.val("[json] " + error.message).addClass("error")
16 | return
17 | input = $jade.val()
18 | try
19 | html = jade2html input, data
20 | catch error
21 | $jade.addClass("error")
22 | $html.val("[jade] " + error.message).addClass("error")
23 | return
24 | html = html.trim()
25 | $html.val html
26 |
27 | $("textarea.jade")
28 | .each -> update $(@)
29 | .on "keyup", -> update $(@)
30 |
31 | $("textarea.json").on "keyup", ->
32 | update $(@).siblings(".jade")
33 |
34 | $("#basics .row").addClass "annotate"
35 |
36 | $.fn.tabOverride.autoIndent = true
37 | $.fn.tabOverride.tabSize(2)
38 | $("textarea.jade, textarea.json").tabOverride()
39 |
40 | navTop = $('.subnav').length && $('.subnav').offset().top
41 | isFixed = 0
42 | $(window).on "scroll", ->
43 | i = undefined
44 | scrollTop = $(window).scrollTop()
45 | if scrollTop >= navTop and not isFixed
46 | isFixed = 1
47 | $('.subnav').addClass "subnav-fixed"
48 | else if scrollTop <= navTop and isFixed
49 | isFixed = 0
50 | $('.subnav').removeClass "subnav-fixed"
--------------------------------------------------------------------------------
/js/script.js:
--------------------------------------------------------------------------------
1 | (function() {
2 |
3 | $(function() {
4 | var isFixed, jade2html, navTop, update;
5 | jade2html = function(input, data) {
6 | return jade.compile(input, {
7 | pretty: true,
8 | doctype: "5"
9 | })(data);
10 | };
11 | update = function($jade) {
12 | var $data, $html, data, html, input, json;
13 | $data = $jade.siblings(".json");
14 | json = $data.val() || "{}";
15 | $html = $jade.closest(".row").find("textarea.html");
16 | $jade.closest(".row").find("textarea").removeClass("error");
17 | try {
18 | data = JSON.parse(json);
19 | } catch (error) {
20 | $data.addClass("error");
21 | $html.val("[json] " + error.message).addClass("error");
22 | return;
23 | }
24 | input = $jade.val();
25 | try {
26 | html = jade2html(input, data);
27 | } catch (error) {
28 | $jade.addClass("error");
29 | $html.val("[jade] " + error.message).addClass("error");
30 | return;
31 | }
32 | html = html.trim();
33 | return $html.val(html);
34 | };
35 | $("textarea.jade").each(function() {
36 | return update($(this).on("keyup", function() {
37 | return update($(this));
38 | }));
39 | });
40 | $("textarea.json").on("keyup", function() {
41 | return update($(this).siblings(".jade"));
42 | });
43 | $("#basics .row").addClass("annotate");
44 | $.fn.tabOverride.autoIndent = true;
45 | $.fn.tabOverride.tabSize(2);
46 | $("textarea.jade, textarea.json").tabOverride();
47 | navTop = $('.subnav').length && $('.subnav').offset().top;
48 | isFixed = 0;
49 | return $(window).on("scroll", function() {
50 | var i, scrollTop;
51 | i = void 0;
52 | scrollTop = $(window).scrollTop();
53 | if (scrollTop >= navTop && !isFixed) {
54 | isFixed = 1;
55 | return $('.subnav').addClass("subnav-fixed");
56 | } else if (scrollTop <= navTop && isFixed) {
57 | isFixed = 0;
58 | return $('.subnav').removeClass("subnav-fixed");
59 | }
60 | });
61 | });
62 |
63 | }).call(this);
64 |
--------------------------------------------------------------------------------
/js/taboverride.js:
--------------------------------------------------------------------------------
1 | // Tab Override jQuery Plugin v1.1.1 | wjbryant.com/projects/tab-override/
2 | // Copyright (c) 2012 Bill Bryant | opensource.org/licenses/mit
3 |
4 | /*jslint browser: true, sloppy: true */
5 | /*global jQuery */
6 |
7 | /**
8 | * @fileOverview Tab Override jQuery Plugin
9 | * @author Bill Bryant
10 | * @version 1.1.1
11 | */
12 |
13 | /**
14 | * The global jQuery object
15 | *
16 | * @name jQuery
17 | * @namespace
18 | */
19 |
20 | /**
21 | * The jQuery function "namespace"
22 | *
23 | * @name fn
24 | * @namespace
25 | * @memberOf jQuery
26 | */
27 |
28 | /**
29 | * The tabOverride method. Tabs will be overridden if enable is true (default).
30 | *
31 | * @param {Boolean} enable Whether Tab Override should be enabled for the element(s) (default = true)
32 | * @return {Object} The jQuery object
33 | *
34 | * @function
35 | * @namespace
36 | */
37 | jQuery.fn.tabOverride = (function ($) {
38 | var aTab = '\t', // the string representing a tab
39 | inWhitespace = false, // whether the start of the selection is in the leading whitespace on enter
40 | ta = document.createElement('textarea'), // temp textarea element to get newline character(s)
41 | newline, // the newline character sequence (\n or \r\n)
42 | newlineLen, // the number of characters used for a newline (1 or 2)
43 | tabOverride; // the function that will be returned
44 |
45 | /**
46 | * Inserts / removes tabs and newlines on the keyDown event for the tab or enter key.
47 | *
48 | * @param {Event} e The event object
49 | *
50 | * @memberOf jQuery.fn.tabOverride
51 | * @private
52 | */
53 | function overrideKeyDown(e) {
54 | var key = e.keyCode, // the key code for the key that was pressed
55 | tab, // the string representing a tab
56 | tabLen, // the length of a tab
57 | text, // initial text in the textarea
58 | range, // the IE TextRange object
59 | tempRange, // used to calculate selection start and end positions in IE
60 | preNewlines, // the number of newline character sequences before the selection start (for IE)
61 | selNewlines, // the number of newline character sequences within the selection (for IE)
62 | initScrollTop, // initial scrollTop value used to fix scrolling in Firefox
63 | selStart, // the selection start position
64 | selEnd, // the selection end position
65 | sel, // the selected text
66 | startLine, // for multi-line selections, the first character position of the first line
67 | endLine, // for multi-line selections, the last character position of the last line
68 | numTabs, // the number of tabs inserted / removed in the selection
69 | startTab, // if a tab was removed from the start of the first line
70 | preTab, // if a tab was removed before the start of the selection
71 | whitespace, // the whitespace at the beginning of the first selected line
72 | whitespaceLen; // the length of the whitespace at the beginning of the first selected line
73 |
74 | // don't do any unnecessary work
75 | if ((key !== 9 && (key !== 13 || !tabOverride.autoIndent)) || e.ctrlKey || e.altKey) {
76 | return;
77 | }
78 |
79 | // initialize variables used for tab and enter keys
80 | inWhitespace = false; // this will be set to true if enter is pressed in the leading whitespace
81 | text = this.value;
82 |
83 | // this is really just for Firefox, but will be used by all browsers that support
84 | // selectionStart and selectionEnd - whenever the textarea value property is reset,
85 | // Firefox scrolls back to the top - this is used to set it back to the original value
86 | // scrollTop is nonstandard, but supported by all modern browsers
87 | initScrollTop = this.scrollTop;
88 |
89 | // get the text selection
90 | // prefer the nonstandard document.selection way since it allows for
91 | // automatic scrolling to the cursor via the range.select() method
92 | if (document.selection) { // IE
93 | range = document.selection.createRange();
94 | sel = range.text;
95 | tempRange = range.duplicate();
96 | tempRange.moveToElementText(this);
97 | tempRange.setEndPoint('EndToEnd', range);
98 | selEnd = tempRange.text.length;
99 | selStart = selEnd - sel.length;
100 |
101 | // whenever the value of the textarea is changed, the range needs to be reset
102 | // IE <9 (and Opera) use both \r and \n for newlines - this adds an extra character
103 | // that needs to be accounted for when doing position calculations with ranges
104 | // these values are used to offset the selection start and end positions
105 | if (newlineLen > 1) {
106 | preNewlines = text.slice(0, selStart).split(newline).length - 1;
107 | selNewlines = sel.split(newline).length - 1;
108 | } else {
109 | preNewlines = selNewlines = 0;
110 | }
111 | } else if (typeof this.selectionStart !== 'undefined') {
112 | selStart = this.selectionStart;
113 | selEnd = this.selectionEnd;
114 | sel = text.slice(selStart, selEnd);
115 | } else {
116 | return; // cannot access textarea selection - do nothing
117 | }
118 |
119 | // tab key - insert / remove tab
120 | if (key === 9) {
121 |
122 | // initialize tab variables
123 | tab = aTab;
124 | tabLen = tab.length;
125 | numTabs = 0;
126 | startTab = 0;
127 | preTab = 0;
128 |
129 | // multi-line selection
130 | if (selStart !== selEnd && sel.indexOf('\n') !== -1) {
131 | // for multiple lines, only insert / remove tabs from the beginning of each line
132 |
133 | // find the start of the first selected line
134 | if (selStart === 0 || text.charAt(selStart - 1) === '\n') {
135 | // the selection starts at the beginning of a line
136 | startLine = selStart;
137 | } else {
138 | // the selection starts after the beginning of a line
139 | // set startLine to the beginning of the first partially selected line
140 | // subtract 1 from selStart in case the cursor is at the newline character,
141 | // for instance, if the very end of the previous line was selected
142 | // add 1 to get the next character after the newline
143 | // if there is none before the selection, lastIndexOf returns -1
144 | // when 1 is added to that it becomes 0 and the first character is used
145 | startLine = text.lastIndexOf('\n', selStart - 1) + 1;
146 | }
147 |
148 | // find the end of the last selected line
149 | if (selEnd === text.length || text.charAt(selEnd) === '\n') {
150 | // the selection ends at the end of a line
151 | endLine = selEnd;
152 | } else {
153 | // the selection ends before the end of a line
154 | // set endLine to the end of the last partially selected line
155 | endLine = text.indexOf('\n', selEnd);
156 | if (endLine === -1) {
157 | endLine = text.length;
158 | }
159 | }
160 |
161 | // if the shift key was pressed, remove tabs instead of inserting them
162 | if (e.shiftKey) {
163 | if (text.slice(startLine).indexOf(tab) === 0) {
164 | // is this tab part of the selection?
165 | if (startLine === selStart) {
166 | // it is, remove it
167 | sel = sel.slice(tabLen);
168 | } else {
169 | // the tab comes before the selection
170 | preTab = tabLen;
171 | }
172 | startTab = tabLen;
173 | }
174 |
175 | this.value = text.slice(0, startLine) + text.slice(startLine + preTab, selStart) +
176 | sel.replace(new RegExp('\n' + tab, 'g'), function () {
177 | numTabs += 1;
178 | return '\n';
179 | }) + text.slice(selEnd);
180 |
181 | // set start and end points
182 | if (range) { // IE
183 | // setting end first makes calculations easier
184 | range.collapse();
185 | range.moveEnd('character', selEnd - startTab - (numTabs * tabLen) - selNewlines - preNewlines);
186 | range.moveStart('character', selStart - preTab - preNewlines);
187 | range.select();
188 | } else {
189 | // set start first for Opera
190 | this.selectionStart = selStart - preTab; // preTab is 0 or tabLen
191 | // move the selection end over by the total number of tabs removed
192 | this.selectionEnd = selEnd - startTab - (numTabs * tabLen);
193 | }
194 | } else { // no shift key
195 | numTabs = 1; // for the first tab
196 | // insert tabs at the beginning of each line of the selection
197 | this.value = text.slice(0, startLine) + tab + text.slice(startLine, selStart) +
198 | sel.replace(/\n/g, function () {
199 | numTabs += 1;
200 | return '\n' + tab;
201 | }) + text.slice(selEnd);
202 |
203 | // set start and end points
204 | if (range) { // IE
205 | range.collapse();
206 | range.moveEnd('character', selEnd + (numTabs * tabLen) - selNewlines - preNewlines);
207 | range.moveStart('character', selStart + tabLen - preNewlines);
208 | range.select();
209 | } else {
210 | // the selection start is always moved by 1 character
211 | this.selectionStart = selStart + tabLen;
212 | // move the selection end over by the total number of tabs inserted
213 | this.selectionEnd = selEnd + (numTabs * tabLen);
214 | this.scrollTop = initScrollTop;
215 | }
216 | }
217 | } else { // single line selection
218 | // if the shift key was pressed, remove a tab instead of inserting one
219 | if (e.shiftKey) {
220 | // if the character before the selection is a tab, remove it
221 | if (text.slice(selStart - tabLen).indexOf(tab) === 0) {
222 | this.value = text.slice(0, selStart - tabLen) + text.slice(selStart);
223 |
224 | // set start and end points
225 | if (range) { // IE
226 | // collapses range and moves it by -1 tab
227 | range.move('character', selStart - tabLen - preNewlines);
228 | range.select();
229 | } else {
230 | this.selectionEnd = this.selectionStart = selStart - tabLen;
231 | this.scrollTop = initScrollTop;
232 | }
233 | }
234 | } else { // no shift key - insert a tab
235 | if (range) { // IE
236 | range.text = tab;
237 | range.select();
238 | } else {
239 | this.value = text.slice(0, selStart) + tab + text.slice(selEnd);
240 | this.selectionEnd = this.selectionStart = selStart + tabLen;
241 | this.scrollTop = initScrollTop;
242 | }
243 | }
244 | }
245 | } else if (tabOverride.autoIndent) { // Enter key
246 | // insert a newline and copy the whitespace from the beginning of the line
247 |
248 | // find the start of the first selected line
249 | if (selStart === 0 || text.charAt(selStart - 1) === '\n') {
250 | // the selection starts at the beginning of a line
251 | // do nothing special
252 | inWhitespace = true;
253 | return;
254 | }
255 |
256 | // see explanation under "multi-line selection" above
257 | startLine = text.lastIndexOf('\n', selStart - 1) + 1;
258 |
259 | // find the end of the first selected line
260 | endLine = text.indexOf('\n', selStart);
261 |
262 | // if no newline is found, set endLine to the end of the text
263 | if (endLine === -1) {
264 | endLine = text.length;
265 | }
266 |
267 | // get the whitespace at the beginning of the first selected line (spaces and tabs only)
268 | whitespace = text.slice(startLine, endLine).match(/^[ \t]*/)[0];
269 | whitespaceLen = whitespace.length;
270 |
271 | // the cursor (selStart) is in the whitespace at beginning of the line
272 | // do nothing special
273 | if (selStart < startLine + whitespaceLen) {
274 | inWhitespace = true;
275 | return;
276 | }
277 |
278 | if (range) { // IE
279 | // insert the newline and whitespace
280 | range.text = '\n' + whitespace;
281 | range.select();
282 | } else {
283 | // insert the newline and whitespace
284 | this.value = text.slice(0, selStart) + '\n' + whitespace + text.slice(selEnd);
285 | // Opera uses \r\n for a newline, instead of \n,
286 | // so use newlineLen instead of a hard-coded value
287 | this.selectionEnd = this.selectionStart = selStart + newlineLen + whitespaceLen;
288 | this.scrollTop = initScrollTop;
289 | }
290 | }
291 |
292 | e.preventDefault();
293 | }
294 |
295 | /**
296 | * Prevents the default action for the keyPress event when tab or enter are
297 | * pressed. Opera (and Firefox) also fire a keypress event when the tab or
298 | * enter key is pressed. Opera requires that the default action be prevented
299 | * on this event or the textarea will lose focus.
300 | *
301 | * @param {Event} e The event object
302 | *
303 | * @memberOf jQuery.fn.tabOverride
304 | * @private
305 | */
306 | function overrideKeyPress(e) {
307 | var key = e.keyCode;
308 | if ((key === 9 || (key === 13 && tabOverride.autoIndent && !inWhitespace)) && !e.ctrlKey && !e.altKey) {
309 | e.preventDefault();
310 | }
311 | }
312 |
313 | /**
314 | * The function assigned to jQuery.fn.tabOverride.
315 | *
316 | * @ignore
317 | */
318 | tabOverride = function (enable) {
319 | // unbind the tab override functions so they are not bound more than once
320 | this.each(function () {
321 | $(this).unbind('.tabOverride');
322 | });
323 |
324 | // only bind the tab override functions if the enable argument is not specified or truthy
325 | if (!arguments.length || enable) {
326 | this.each(function () {
327 | if (this.nodeName && this.nodeName.toLowerCase() === 'textarea') {
328 | $(this).bind('keydown.tabOverride', overrideKeyDown).bind('keypress.tabOverride', overrideKeyPress);
329 | }
330 | });
331 | }
332 |
333 | return this; // always return the jQuery object
334 | };
335 |
336 | /**
337 | * Returns the current tab size. 0 represents the tab character.
338 | *
339 | * @return {Number} The size (length) of the tab string or 0 for the tab character
340 | *
341 | * @name getTabSize
342 | * @function
343 | * @memberOf jQuery.fn.tabOverride
344 | */
345 | tabOverride.getTabSize = function () {
346 | return tabOverride.tabSize();
347 | };
348 |
349 | /**
350 | * Sets the tab size for all elements that have Tab Override enabled.
351 | * 0 represents the tab character.
352 | *
353 | * @param {Number} size The tab size (default = 0)
354 | *
355 | * @name setTabSize
356 | * @function
357 | * @memberOf jQuery.fn.tabOverride
358 | */
359 | tabOverride.setTabSize = function (size) {
360 | tabOverride.tabSize(size);
361 | };
362 |
363 | /**
364 | * Gets or sets the tab size for all elements that have Tab Override enabled.
365 | * 0 represents the tab character.
366 | *
367 | * @param {Number} size (optional) The tab size
368 | *
369 | * @name tabSize
370 | * @function
371 | * @memberOf jQuery.fn.tabOverride
372 | */
373 | tabOverride.tabSize = function (size) {
374 | if (arguments.length) {
375 | var i;
376 | if (!size) { // size is 0 (or falsy)
377 | aTab = '\t';
378 | } else if (typeof size === 'number' && size > 0) {
379 | aTab = '';
380 | for (i = 0; i < size; i += 1) {
381 | aTab += ' ';
382 | }
383 | }
384 | } else {
385 | return (aTab === '\t') ? 0 : aTab.length;
386 | }
387 | };
388 |
389 | /**
390 | * Whether each line should be auto indented (default = false).
391 | *
392 | * @name autoIndent
393 | * @memberOf jQuery.fn.tabOverride
394 | */
395 | tabOverride.autoIndent = false;
396 |
397 | // get the characters used for a newline
398 | ta.value = '\n';
399 | newline = ta.value;
400 | newlineLen = newline.length;
401 | ta = null;
402 |
403 | return tabOverride;
404 | }(jQuery));
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jade-syntax-docs",
3 | "version": "1.0.1",
4 | "description": "Jade Syntax Documentation by example",
5 | "main": "Gruntfile.js",
6 | "devDependencies": {
7 | "grunt": "^0.4.5",
8 | "grunt-cli": "^0.1.13",
9 | "grunt-contrib-coffee": "^0.5.0",
10 | "grunt-contrib-concat": "^0.1.3",
11 | "grunt-contrib-connect": "^0.1.2",
12 | "grunt-contrib-cssmin": "^0.4.1",
13 | "grunt-contrib-jade": "^0.4.0",
14 | "grunt-contrib-stylus": "^0.4.1",
15 | "grunt-contrib-uglify": "^0.1.2",
16 | "grunt-contrib-watch": "^0.3.1",
17 | "grunt-inline": "^0.3.2",
18 | "grunt-uncss": "^0.3.7",
19 | "nib": "^0.7.0"
20 | },
21 | "dependencies": {},
22 | "scripts": {
23 | "test": "echo \"Error: no test specified\" && exit 1"
24 | },
25 | "repository": {
26 | "type": "git",
27 | "url": "https://github.com/naltatis/jade-syntax-docs.git"
28 | },
29 | "author": "naltatis",
30 | "license": "MIT",
31 | "bugs": {
32 | "url": "https://github.com/naltatis/jade-syntax-docs/issues"
33 | },
34 | "homepage": "https://github.com/naltatis/jade-syntax-docs"
35 | }
36 |
--------------------------------------------------------------------------------
Comments