├── .gitignore
├── Gruntfile.js
├── README.md
├── app
├── README.md
├── app.js
├── assets
│ └── index.html
├── helpers
│ ├── application.js
│ └── home.js
├── initialize.js
├── router.js
├── styles
│ └── application.styl
└── templates
│ ├── application.hbs
│ └── home.hbs
├── bower.json
├── config.coffee
├── examples
└── example.html
├── generators
├── class
│ ├── class.js.hbs
│ └── generator.json
├── helper
│ ├── generator.json
│ ├── helper.js.hbs
│ └── insertHelper.js.hbs
└── template
│ ├── generator.json
│ ├── insertTemplate.js.hbs
│ └── template.js.hbs
├── package.json
└── vendor
├── README.md
├── scripts
├── bootstrap.js
├── console-helper.js
├── ember-latest.js
├── handlebars-1.0.rc.4.js
├── jquery-1.9.1.js
└── skylo.js
└── styles
├── bootstrap.css
└── skylo.css
/.gitignore:
--------------------------------------------------------------------------------
1 | lib-cov
2 | *.seed
3 | *.log
4 | *.csv
5 | *.dat
6 | *.out
7 | *.pid
8 | *.gz
9 | .DS_Store
10 |
11 | public
12 |
13 | pids
14 | logs
15 | results
16 |
17 | aws.json
18 |
19 | node_modules
20 | npm-debug.log
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function (grunt) {
2 |
3 |
4 | // Get path to core grunt dependencies from Sails
5 | grunt.loadNpmTasks('grunt-s3');
6 | grunt.loadNpmTasks('grunt-exec');
7 |
8 |
9 | // Project configuration.
10 | grunt.initConfig({
11 | aws: grunt.file.readJSON('aws.json'),
12 | s3: {
13 | options: {
14 | key: '<%= aws.key %>',
15 | secret: '<%= aws.secret %>',
16 | bucket: '<%= aws.bucket %>',
17 | access: '<%= aws.access %>'
18 | },
19 | dev:{
20 | options: {
21 | encodePaths: true,
22 | maxOperations: 20
23 | },
24 | upload: [{
25 | // Wildcards are valid *for uploads only* until I figure out a good implementation
26 | // for downloads.
27 | src: 'public/javascripts/*',
28 |
29 | // But if you use wildcards, make sure your destination is a directory.
30 | dest: './javascripts/'
31 | },{
32 | // Wildcards are valid *for uploads only* until I figure out a good implementation
33 | // for downloads.
34 | src: 'public/stylesheets/*',
35 |
36 | // But if you use wildcards, make sure your destination is a directory.
37 | dest: './stylesheets/'
38 | },{
39 | // Wildcards are valid *for uploads only* until I figure out a good implementation
40 | // for downloads.
41 | src: 'public/*',
42 |
43 | // But if you use wildcards, make sure your destination is a directory.
44 | dest: './'
45 | }
46 |
47 | ]
48 | }
49 | },
50 | exec: {
51 | brunch_build: {
52 | command: 'brunch build -o'
53 | }
54 | }
55 | });
56 |
57 | grunt.registerTask('deploy',['exec','s3']);
58 |
59 | };
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Skylo
2 | ======
3 |
4 | **Required Library**
5 | - Twitter Bootstrap 2.3.2 or Twitter Bootstrap 3.0
6 |
7 | **Required Files**
8 |
9 | Download [skylo.js](https://github.com/colintoh/skylo/blob/master/vendor/scripts/skylo.js) and [skylo.css](https://github.com/colintoh/skylo/blob/master/vendor/styles/skylo.css). Include them below ```bootstrap.js``` and ```bootstrap.css``` respectively. Check out the examples in the examples folder.
10 |
11 | **Demo And Documentation**
12 |
13 | [Skylo Demo And Docs](http://skylo.s3-website-ap-southeast-1.amazonaws.com/#/home)
14 |
15 | ---
16 |
17 | Options
18 | --------
19 | //Default options
20 | $.skylo({
21 | state: 'info',
22 | inchSpeed: 200,
23 | initialBurst: 5,
24 | flat: false
25 | });
26 |
27 | ```state ["info", "success", "warning", "danger"]``` : Customizes the theme of the progress bar. Uses the same parameters as Bootstrap uses for buttons.
28 |
29 | ```inchSpeed (ms)```: Determine the speed of the inching motion.
30 |
31 | ```initialBurst (1 - 100)```: The initial length of the loader that you want to load.
32 |
33 | ```flat (true/false)```: If ```flat``` is set to true, the animated striped UI of the progress bar will be removed.
34 |
35 | ---
36 |
37 | Methods
38 | -------
39 | ```start```: This will initiate the loader with a initial burst of length.
40 |
41 | $.skylo('start');
42 |
43 | ```end```: The loader will reach 100% and then fade out.
44 |
45 | $.skylo('end');
46 |
47 | ```set(width)```: The loader's width will be animated to the percentage stated. Ranges from 1 - 100.
48 |
49 | $.skylo('set',50); //Set width to 50%
50 |
51 | ```get```: Returns the current loader's width percentage.
52 |
53 | $.skylo('get');
54 |
55 | ```inch```: Loader will inch forward according to the parameters set.
56 |
57 | $.skylo('inch',10); //Inch forward by 10%
58 |
59 | ```show(callback)```: Loader will be inserted into the DOM and a callback function will be called.
60 |
61 | $.skylo('show',function(){
62 | //After inserting Loader, animates width to 30%
63 | $.skylo('set',30);
64 | });
65 |
66 | ```remove```: Remove Loader from the DOM. Normally unused. Just use ```end`` method to complete the animation.
67 |
68 | $.skylo('end');
69 |
70 | ---
71 |
72 | Credits:
73 | --------
74 | Thanks to [2359 Media](http://2359media.com/) for providing the space and time for me to finish this plugin.
--------------------------------------------------------------------------------
/app/README.md:
--------------------------------------------------------------------------------
1 | Application
2 | ===========
3 |
4 | Put your application-specific files here, but leave your third party libraries in the vendor directory.
5 |
6 |
--------------------------------------------------------------------------------
/app/app.js:
--------------------------------------------------------------------------------
1 | // Application bootstrapper
2 |
3 | module.exports = Em.Application.create();
--------------------------------------------------------------------------------
/app/assets/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Skylo: The Sky Loader
10 |
11 |
12 |
13 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
67 |
68 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/app/helpers/application.js:
--------------------------------------------------------------------------------
1 | var App = require('app');
2 |
3 | App.ApplicationController = Em.Controller.extend({
4 | title: "Skylo"
5 | });
6 |
7 |
8 | App.ApplicationView = Em.View.extend({
9 | didInsertElement: function(){
10 |
11 | }
12 | });
--------------------------------------------------------------------------------
/app/helpers/home.js:
--------------------------------------------------------------------------------
1 | var App = require('app');
2 |
3 | App.HomeController = Em.Controller.extend({
4 |
5 | });
6 |
7 |
8 | App.HomeView = Em.View.extend({
9 | didInsertElement:function(){
10 | }
11 | });
--------------------------------------------------------------------------------
/app/initialize.js:
--------------------------------------------------------------------------------
1 | window.App = require('app');
2 |
3 | var regString,
4 | excludeString,
5 | fileList = window.require.list();
6 |
7 | var requireOrder = {
8 | helpers: [
9 | 'application', // Always include application helper first
10 | ],
11 | templates: [
12 | ]
13 | };
14 |
15 | require('router');
16 |
17 | var folderOrder = ['helpers', 'templates'];
18 |
19 | folderOrder.forEach(function(folder){
20 |
21 | //Require before
22 | requireOrder[folder].forEach(function(module){
23 | require( folder + '/' + module);
24 | });
25 |
26 | //Require after
27 | excludeString = requireOrder[folder].join('$|');
28 | regString = '^'+folder+'/(?!' + excludeString + '$)';
29 | fileList.filter(function(module){
30 | return new RegExp(regString).test(module);
31 | }).forEach(function(module){
32 | require(module);
33 | });
34 |
35 | });
--------------------------------------------------------------------------------
/app/router.js:
--------------------------------------------------------------------------------
1 | var App = require('app');
2 |
3 |
4 | App.IndexRoute = Em.Route.extend({
5 | redirect:function(){
6 | this.transitionTo('home');
7 | }
8 | });
9 |
10 | App.Router.map(function(){
11 | this.route('index',{path:'/'});
12 | this.route('home');
13 | });
--------------------------------------------------------------------------------
/app/styles/application.styl:
--------------------------------------------------------------------------------
1 | @import nib
2 |
3 | yellow-txt = rgb(243,177,0)
4 | brown-txt = rgb(81,63,63)
5 | white-txt = rgb(245,245,245)
6 | navy-txt = #363b48
7 | salmon-bg = #f17c71
8 | salmon-txt = #be4344
9 |
10 | body
11 | background: white-txt
12 | font-family: 'Roboto', sans-serif
13 | font-weight: 400
14 |
15 | h1
16 | font-family: 'Sonsie One', cursive;
17 | color: rgb(243,243,243)
18 | text-align: center
19 | font-size: 60px
20 | margin-top: 0
21 | margin-bottom: 20px
22 |
23 | h3
24 | text-align: center
25 | font-family: 'Roboto', sans-serif
26 | font-weight: 400
27 | font-size:40px
28 | margin: 80px 0
29 | color: brown-txt
30 |
31 |
32 | //Overwrite bootstrap
33 |
34 | .navbar
35 | background: rgb(245,245,245)
36 | border-radius: 0
37 | box-shadow: none
38 | border: none
39 |
40 | //Basic
41 |
42 | .heavy
43 | font-weight: 700
44 |
45 | .show-case
46 | background: yellow-txt
47 | padding: 120px 0
48 |
49 | .description
50 | text-align: center
51 | color: rgb(223,153,0)
52 | font-size: 16px
53 | display: block
54 | width: 280px
55 | margin: 0 auto
56 |
57 | .btns-grp
58 | text-align: center
59 | display: block
60 | margin-top: 40px
61 |
62 |
63 | .header-btn
64 | padding: 16px 28px
65 | font-weight: 400
66 | background: #ee9e20
67 | border: none
68 | font-size: 14px
69 | font-weight: 700
70 | margin-right: 10px
71 | color: white-txt
72 |
73 | &:hover
74 | background: rgb(79,64,62)
75 | color: yellow-txt
76 |
77 | &.last
78 | margin: 0
79 |
80 | .white-bg
81 | background: white-txt
82 |
83 | .row
84 | color: #4e4e4e
85 |
86 | .quotes
87 | margin-top: 80px
88 |
89 | .compatibility
90 | p
91 | font-size: 40px
92 |
93 | .methods
94 | background: navy-txt
95 |
96 | .row,h3
97 | color: white-txt
98 |
99 | .btn-method
100 | background: #26ae90
101 | border: none
102 | color: #1c755d
103 | font-weight: 700
104 | text-shadow: 0 1px 1px rgba(255,255,255,0.3)
105 |
106 | &:hover
107 | background: #26ae90
108 | color: #0b4b3a
109 |
110 |
111 | .section
112 | .row
113 | margin-bottom: 40px
114 | font-size: 18px
115 |
116 | .main
117 | background: salmon-bg
118 | color: white-txt
119 |
120 | h3
121 | color: salmon-txt
122 |
123 | .sub-header
124 | color: #d74e4a
125 | font-weight: 700
126 | // text-shadow: 0 1px 0px rgba(190,67,68,0.5)
127 |
128 | .code
129 | font-family: Monaco, Menlo, Consolas, "Courier New", monospace
130 | font-size: 12px;
131 | color: salmon-txt
132 | background: #f5a29a
133 | padding: 5px
134 | border-radius: 5px
135 | display: inline-block
136 |
137 | &.full-code
138 | padding: 10px 20px
139 |
140 | .social
141 | width: 100%
142 | margin-top: 40px
143 | text-align: center
144 |
145 | .feedback
146 | p
147 | font-size: 16px
148 |
149 | footer
150 | padding: 20px
151 |
152 | a
153 | color: yellow-txt
154 | font-weight: 700
155 |
--------------------------------------------------------------------------------
/app/templates/application.hbs:
--------------------------------------------------------------------------------
1 | {{outlet}}
2 |
--------------------------------------------------------------------------------
/app/templates/home.hbs:
--------------------------------------------------------------------------------
1 |
2 |
Skylo
3 |
A Twitter Bootstrap extension to add progress loader at the top of the page.
4 |
5 |
6 |
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | Compatible with both Twitter Bootstrap 2.3.2 and 3.0
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
Methods
39 |
40 |
41 |
42 |
43 |
44 | start()
45 |
46 |
47 |
48 | Start the loader
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | end()
59 |
60 |
61 |
62 | Loader loads to 100% and fade out
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | set(50)
74 |
75 |
76 |
77 | Set position of the loading bar.
78 |
[0 - 100]
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 | get()
90 |
91 |
92 |
93 | Get current position of the loading bar.
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | inch(10)
105 |
106 |
107 |
108 | Loader will inch forward according to the parameters set.
109 |
[0 - 100]
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | These seem to be all over hacker news now, but this is the nicest I've seen. The option to customize the theme of the loader is cool.
124 |
125 | garrettqmartin8
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 | Hmm, haven't noticed those loading bars on Medium or Youtube, but the Chrome browser on my Android has it and I've always liked it. Props to you for noticing this and reacting on it by creating a plugin for a popular framework.
135 |
136 | I like the name to. Sky = top. Lo = LOad. And the design of the demo and doc is nicely done.
137 |
138 | Good job.
139 |
140 |
141 | PaulvdDool
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
Customization
154 |
155 |
174 |
175 |
176 |
177 |
178 |
179 |
183 |
184 | Using Twitter Bootstrap default state, we can switch the theme of the loader.
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
198 |
199 | The loader can inch forward to signify loading. Adjust the inch speed so that the inching can appear fast or slow.
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
212 |
213 | When we start the loader, we set a initial burst of loading so that it kicks off the impression that the loading have begin. Adjust how much initial burst that you wanted.
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
226 |
227 | If true, remove the animated striped UI of the progress bar.
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name":"skylo",
3 | "version":"1.0.1",
4 | "main":[
5 | "vendor/styles/skylo.css",
6 | "vendor/scripts/skylo.js"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/config.coffee:
--------------------------------------------------------------------------------
1 | fs = require 'fs'
2 | path = require 'path'
3 |
4 | # See docs at http://brunch.readthedocs.org/en/latest/config.html.
5 |
6 | exports.config =
7 |
8 | files:
9 |
10 | javascripts:
11 | defaultExtension: 'js',
12 | joinTo:
13 | 'javascripts/app.js': /^app/
14 | 'javascripts/vendor.js': /^vendor/
15 |
16 | order:
17 | before: [
18 | 'vendor/scripts/console-helper.js',
19 | 'vendor/scripts/jquery-1.9.1.js',
20 | 'vendor/scripts/handlebars-1.0.rc.4.js',
21 | 'vendor/scripts/ember-latest.js',
22 | 'vendor/scripts/bootstrap.js',
23 | ]
24 |
25 | stylesheets:
26 | defaultExtension: 'css'
27 | joinTo: 'stylesheets/app.css'
28 | order:
29 | before: ['vendor/styles/bootstrap.css']
30 |
31 | templates:
32 | precompile: true
33 | root: 'templates'
34 | defaultExtension: 'hbs'
35 | joinTo: 'javascripts/app.js' : /^app/
36 | paths:
37 | jquery:'vendor/scripts/jquery-1.9.1.js'
38 | handlebars:'vendor/scripts/handlebars-1.0.rc.4.js'
39 | ember: 'vendor/scripts/ember-latest.js'
40 |
41 | conventions:
42 | ignored: -> false
43 |
44 | plugins:
45 | jshint:
46 | pattern: /^app\/.*\.js$/
47 |
48 | server:
49 | port: 3333
50 | base: '/'
51 | run: no
52 |
--------------------------------------------------------------------------------
/examples/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Skylo: The Sky Loader
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | Skylo
26 |
27 |
Full Demo
28 |
29 |
start
30 |
end
31 |
set(50)
32 |
get
33 |
inch(10)
34 |
35 |
36 |
37 |
Github
38 |
Demo Site
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/generators/class/class.js.hbs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colintoh/skylo/f514a4b6a79b0279e2feeed0b4f6f8f1261428f1/generators/class/class.js.hbs
--------------------------------------------------------------------------------
/generators/class/generator.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [
3 | ],
4 | "dependencies": [
5 | {"name": "helper", "params": "{{name}}"},
6 | {"name": "template", "params": "{{name}}"}
7 | ]
8 | }
--------------------------------------------------------------------------------
/generators/helper/generator.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [
3 | {
4 | "from": "helper.js.hbs",
5 | "to": "app/helpers/{{name}}.js"
6 | },
7 | {
8 | "from": "insertHelper.js.hbs",
9 | "to": "app/helper.js",
10 | "method": "append"
11 | }
12 | ],
13 | "dependencies": []
14 | }
--------------------------------------------------------------------------------
/generators/helper/helper.js.hbs:
--------------------------------------------------------------------------------
1 | var App = require('app');
2 |
3 | App.{{#camelize}}{{name}}{{/camelize}}Controller = Em.Controller.extend({
4 |
5 | });
6 |
7 |
8 | App.{{#camelize}}{{name}}{{/camelize}}View = Em.View.extend({
9 | didInsertElement: function(){
10 | }
11 | });
--------------------------------------------------------------------------------
/generators/helper/insertHelper.js.hbs:
--------------------------------------------------------------------------------
1 |
2 | require('helpers/{{name}}');
--------------------------------------------------------------------------------
/generators/template/generator.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": [
3 | {
4 | "from": "template.js.hbs",
5 | "to": "app/templates/{{name}}.hbs"
6 | },
7 | {
8 | "from": "insertTemplate.js.hbs",
9 | "to": "app/template.js",
10 | "method": "append"
11 | }
12 | ],
13 | "dependencies": []
14 | }
--------------------------------------------------------------------------------
/generators/template/insertTemplate.js.hbs:
--------------------------------------------------------------------------------
1 |
2 | require('templates/{{name}}');
--------------------------------------------------------------------------------
/generators/template/template.js.hbs:
--------------------------------------------------------------------------------
1 | The name of the template: {{name}}
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "Colin Toh",
3 | "name": "skylo",
4 | "description": "A Twitter Bootstrap extension to add progress loader at the top of the page.",
5 | "version": "0.4.0",
6 | "homepage": "http://skylo.s3-website-ap-southeast-1.amazonaws.com/#/home",
7 | "repository": {
8 | "type": "git",
9 | "url": "skylo"
10 | },
11 | "engines": {
12 | "node": "~0.6.10 || 0.8 || 0.9"
13 | },
14 | "scripts": {
15 | "start": "brunch watch --server",
16 | "test": "brunch test"
17 | },
18 | "dependencies": {
19 | "javascript-brunch": ">= 1.0 < 1.5",
20 | "stylus-brunch": "1.5.1",
21 | "css-brunch": ">= 1.0 < 1.5",
22 | "ember-precompiler-brunch": "1.5.1",
23 | "uglify-js-brunch": ">= 1.0 < 1.5",
24 | "clean-css-brunch": ">= 1.0 < 1.5",
25 | "jshint-brunch": "1.6.0",
26 | "auto-reload-brunch": "<=1.5",
27 | "grunt": "~0.4.1",
28 | "grunt-s3": "~0.2.0-alpha.2",
29 | "grunt-exec": "~0.4.2"
30 | },
31 | "devDependencies": {}
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/README.md:
--------------------------------------------------------------------------------
1 | Vendor
2 | ======
3 |
4 | Put your 3rd-party files here, but place your application-specific files in the app directory.
5 |
6 |
--------------------------------------------------------------------------------
/vendor/scripts/bootstrap.js:
--------------------------------------------------------------------------------
1 | /* ===================================================
2 | * bootstrap-transition.js v2.3.2
3 | * http://getbootstrap.com/2.3.2/javascript.html#transitions
4 | * ===================================================
5 | * Copyright 2013 Twitter, Inc.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * ========================================================== */
19 |
20 |
21 | !function ($) {
22 |
23 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
27 | * ======================================================= */
28 |
29 | $(function () {
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 otransitionend'
40 | , 'transition' : 'transitionend'
41 | }
42 | , name
43 |
44 | for (name in transEndEventNames){
45 | if (el.style[name] !== undefined) {
46 | return transEndEventNames[name]
47 | }
48 | }
49 |
50 | }())
51 |
52 | return transitionEnd && {
53 | end: transitionEnd
54 | }
55 |
56 | })()
57 |
58 | })
59 |
60 | }(window.jQuery);
61 | /* =========================================================
62 | * bootstrap-modal.js v2.3.2
63 | * http://getbootstrap.com/2.3.2/javascript.html#modals
64 | * =========================================================
65 | * Copyright 2013 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 | /* MODAL CLASS DEFINITION
87 | * ====================== */
88 |
89 | var Modal = function (element, options) {
90 | this.options = options
91 | this.$element = $(element)
92 | .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
93 | this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
94 | }
95 |
96 | Modal.prototype = {
97 |
98 | constructor: Modal
99 |
100 | , toggle: function () {
101 | return this[!this.isShown ? 'show' : 'hide']()
102 | }
103 |
104 | , show: function () {
105 | var that = this
106 | , e = $.Event('show')
107 |
108 | this.$element.trigger(e)
109 |
110 | if (this.isShown || e.isDefaultPrevented()) return
111 |
112 | this.isShown = true
113 |
114 | this.escape()
115 |
116 | this.backdrop(function () {
117 | var transition = $.support.transition && that.$element.hasClass('fade')
118 |
119 | if (!that.$element.parent().length) {
120 | that.$element.appendTo(document.body) //don't move modals dom position
121 | }
122 |
123 | that.$element.show()
124 |
125 | if (transition) {
126 | that.$element[0].offsetWidth // force reflow
127 | }
128 |
129 | that.$element
130 | .addClass('in')
131 | .attr('aria-hidden', false)
132 |
133 | that.enforceFocus()
134 |
135 | transition ?
136 | that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
137 | that.$element.focus().trigger('shown')
138 |
139 | })
140 | }
141 |
142 | , hide: function (e) {
143 | e && e.preventDefault()
144 |
145 | var that = this
146 |
147 | e = $.Event('hide')
148 |
149 | this.$element.trigger(e)
150 |
151 | if (!this.isShown || e.isDefaultPrevented()) return
152 |
153 | this.isShown = false
154 |
155 | this.escape()
156 |
157 | $(document).off('focusin.modal')
158 |
159 | this.$element
160 | .removeClass('in')
161 | .attr('aria-hidden', true)
162 |
163 | $.support.transition && this.$element.hasClass('fade') ?
164 | this.hideWithTransition() :
165 | this.hideModal()
166 | }
167 |
168 | , enforceFocus: function () {
169 | var that = this
170 | $(document).on('focusin.modal', function (e) {
171 | if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
172 | that.$element.focus()
173 | }
174 | })
175 | }
176 |
177 | , escape: function () {
178 | var that = this
179 | if (this.isShown && this.options.keyboard) {
180 | this.$element.on('keyup.dismiss.modal', function ( e ) {
181 | e.which == 27 && that.hide()
182 | })
183 | } else if (!this.isShown) {
184 | this.$element.off('keyup.dismiss.modal')
185 | }
186 | }
187 |
188 | , hideWithTransition: function () {
189 | var that = this
190 | , timeout = setTimeout(function () {
191 | that.$element.off($.support.transition.end)
192 | that.hideModal()
193 | }, 500)
194 |
195 | this.$element.one($.support.transition.end, function () {
196 | clearTimeout(timeout)
197 | that.hideModal()
198 | })
199 | }
200 |
201 | , hideModal: function () {
202 | var that = this
203 | this.$element.hide()
204 | this.backdrop(function () {
205 | that.removeBackdrop()
206 | that.$element.trigger('hidden')
207 | })
208 | }
209 |
210 | , removeBackdrop: function () {
211 | this.$backdrop && this.$backdrop.remove()
212 | this.$backdrop = null
213 | }
214 |
215 | , backdrop: function (callback) {
216 | var that = this
217 | , animate = this.$element.hasClass('fade') ? 'fade' : ''
218 |
219 | if (this.isShown && this.options.backdrop) {
220 | var doAnimate = $.support.transition && animate
221 |
222 | this.$backdrop = $('
')
223 | .appendTo(document.body)
224 |
225 | this.$backdrop.click(
226 | this.options.backdrop == 'static' ?
227 | $.proxy(this.$element[0].focus, this.$element[0])
228 | : $.proxy(this.hide, this)
229 | )
230 |
231 | if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
232 |
233 | this.$backdrop.addClass('in')
234 |
235 | if (!callback) return
236 |
237 | doAnimate ?
238 | this.$backdrop.one($.support.transition.end, callback) :
239 | callback()
240 |
241 | } else if (!this.isShown && this.$backdrop) {
242 | this.$backdrop.removeClass('in')
243 |
244 | $.support.transition && this.$element.hasClass('fade')?
245 | this.$backdrop.one($.support.transition.end, callback) :
246 | callback()
247 |
248 | } else if (callback) {
249 | callback()
250 | }
251 | }
252 | }
253 |
254 |
255 | /* MODAL PLUGIN DEFINITION
256 | * ======================= */
257 |
258 | var old = $.fn.modal
259 |
260 | $.fn.modal = function (option) {
261 | return this.each(function () {
262 | var $this = $(this)
263 | , data = $this.data('modal')
264 | , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
265 | if (!data) $this.data('modal', (data = new Modal(this, options)))
266 | if (typeof option == 'string') data[option]()
267 | else if (options.show) data.show()
268 | })
269 | }
270 |
271 | $.fn.modal.defaults = {
272 | backdrop: true
273 | , keyboard: true
274 | , show: true
275 | }
276 |
277 | $.fn.modal.Constructor = Modal
278 |
279 |
280 | /* MODAL NO CONFLICT
281 | * ================= */
282 |
283 | $.fn.modal.noConflict = function () {
284 | $.fn.modal = old
285 | return this
286 | }
287 |
288 |
289 | /* MODAL DATA-API
290 | * ============== */
291 |
292 | $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
293 | var $this = $(this)
294 | , href = $this.attr('href')
295 | , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
296 | , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
297 |
298 | e.preventDefault()
299 |
300 | $target
301 | .modal(option)
302 | .one('hide', function () {
303 | $this.focus()
304 | })
305 | })
306 |
307 | }(window.jQuery);
308 |
309 | /* ============================================================
310 | * bootstrap-dropdown.js v2.3.2
311 | * http://getbootstrap.com/2.3.2/javascript.html#dropdowns
312 | * ============================================================
313 | * Copyright 2013 Twitter, Inc.
314 | *
315 | * Licensed under the Apache License, Version 2.0 (the "License");
316 | * you may not use this file except in compliance with the License.
317 | * You may obtain a copy of the License at
318 | *
319 | * http://www.apache.org/licenses/LICENSE-2.0
320 | *
321 | * Unless required by applicable law or agreed to in writing, software
322 | * distributed under the License is distributed on an "AS IS" BASIS,
323 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
324 | * See the License for the specific language governing permissions and
325 | * limitations under the License.
326 | * ============================================================ */
327 |
328 |
329 | !function ($) {
330 |
331 | "use strict"; // jshint ;_;
332 |
333 |
334 | /* DROPDOWN CLASS DEFINITION
335 | * ========================= */
336 |
337 | var toggle = '[data-toggle=dropdown]'
338 | , Dropdown = function (element) {
339 | var $el = $(element).on('click.dropdown.data-api', this.toggle)
340 | $('html').on('click.dropdown.data-api', function () {
341 | $el.parent().removeClass('open')
342 | })
343 | }
344 |
345 | Dropdown.prototype = {
346 |
347 | constructor: Dropdown
348 |
349 | , toggle: function (e) {
350 | var $this = $(this)
351 | , $parent
352 | , isActive
353 |
354 | if ($this.is('.disabled, :disabled')) return
355 |
356 | $parent = getParent($this)
357 |
358 | isActive = $parent.hasClass('open')
359 |
360 | clearMenus()
361 |
362 | if (!isActive) {
363 | if ('ontouchstart' in document.documentElement) {
364 | // if mobile we we use a backdrop because click events don't delegate
365 | $('
').insertBefore($(this)).on('click', clearMenus)
366 | }
367 | $parent.toggleClass('open')
368 | }
369 |
370 | $this.focus()
371 |
372 | return false
373 | }
374 |
375 | , keydown: function (e) {
376 | var $this
377 | , $items
378 | , $active
379 | , $parent
380 | , isActive
381 | , index
382 |
383 | if (!/(38|40|27)/.test(e.keyCode)) return
384 |
385 | $this = $(this)
386 |
387 | e.preventDefault()
388 | e.stopPropagation()
389 |
390 | if ($this.is('.disabled, :disabled')) return
391 |
392 | $parent = getParent($this)
393 |
394 | isActive = $parent.hasClass('open')
395 |
396 | if (!isActive || (isActive && e.keyCode == 27)) {
397 | if (e.which == 27) $parent.find(toggle).focus()
398 | return $this.click()
399 | }
400 |
401 | $items = $('[role=menu] li:not(.divider):visible a', $parent)
402 |
403 | if (!$items.length) return
404 |
405 | index = $items.index($items.filter(':focus'))
406 |
407 | if (e.keyCode == 38 && index > 0) index-- // up
408 | if (e.keyCode == 40 && index < $items.length - 1) index++ // down
409 | if (!~index) index = 0
410 |
411 | $items
412 | .eq(index)
413 | .focus()
414 | }
415 |
416 | }
417 |
418 | function clearMenus() {
419 | $('.dropdown-backdrop').remove()
420 | $(toggle).each(function () {
421 | getParent($(this)).removeClass('open')
422 | })
423 | }
424 |
425 | function getParent($this) {
426 | var selector = $this.attr('data-target')
427 | , $parent
428 |
429 | if (!selector) {
430 | selector = $this.attr('href')
431 | selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
432 | }
433 |
434 | $parent = selector && $(selector)
435 |
436 | if (!$parent || !$parent.length) $parent = $this.parent()
437 |
438 | return $parent
439 | }
440 |
441 |
442 | /* DROPDOWN PLUGIN DEFINITION
443 | * ========================== */
444 |
445 | var old = $.fn.dropdown
446 |
447 | $.fn.dropdown = function (option) {
448 | return this.each(function () {
449 | var $this = $(this)
450 | , data = $this.data('dropdown')
451 | if (!data) $this.data('dropdown', (data = new Dropdown(this)))
452 | if (typeof option == 'string') data[option].call($this)
453 | })
454 | }
455 |
456 | $.fn.dropdown.Constructor = Dropdown
457 |
458 |
459 | /* DROPDOWN NO CONFLICT
460 | * ==================== */
461 |
462 | $.fn.dropdown.noConflict = function () {
463 | $.fn.dropdown = old
464 | return this
465 | }
466 |
467 |
468 | /* APPLY TO STANDARD DROPDOWN ELEMENTS
469 | * =================================== */
470 |
471 | $(document)
472 | .on('click.dropdown.data-api', clearMenus)
473 | .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
474 | .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
475 | .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
476 |
477 | }(window.jQuery);
478 |
479 | /* =============================================================
480 | * bootstrap-scrollspy.js v2.3.2
481 | * http://getbootstrap.com/2.3.2/javascript.html#scrollspy
482 | * =============================================================
483 | * Copyright 2013 Twitter, Inc.
484 | *
485 | * Licensed under the Apache License, Version 2.0 (the "License");
486 | * you may not use this file except in compliance with the License.
487 | * You may obtain a copy of the License at
488 | *
489 | * http://www.apache.org/licenses/LICENSE-2.0
490 | *
491 | * Unless required by applicable law or agreed to in writing, software
492 | * distributed under the License is distributed on an "AS IS" BASIS,
493 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
494 | * See the License for the specific language governing permissions and
495 | * limitations under the License.
496 | * ============================================================== */
497 |
498 |
499 | !function ($) {
500 |
501 | "use strict"; // jshint ;_;
502 |
503 |
504 | /* SCROLLSPY CLASS DEFINITION
505 | * ========================== */
506 |
507 | function ScrollSpy(element, options) {
508 | var process = $.proxy(this.process, this)
509 | , $element = $(element).is('body') ? $(window) : $(element)
510 | , href
511 | this.options = $.extend({}, $.fn.scrollspy.defaults, options)
512 | this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
513 | this.selector = (this.options.target
514 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
515 | || '') + ' .nav li > a'
516 | this.$body = $('body')
517 | this.refresh()
518 | this.process()
519 | }
520 |
521 | ScrollSpy.prototype = {
522 |
523 | constructor: ScrollSpy
524 |
525 | , refresh: function () {
526 | var self = this
527 | , $targets
528 |
529 | this.offsets = $([])
530 | this.targets = $([])
531 |
532 | $targets = this.$body
533 | .find(this.selector)
534 | .map(function () {
535 | var $el = $(this)
536 | , href = $el.data('target') || $el.attr('href')
537 | , $href = /^#\w/.test(href) && $(href)
538 | return ( $href
539 | && $href.length
540 | && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
541 | })
542 | .sort(function (a, b) { return a[0] - b[0] })
543 | .each(function () {
544 | self.offsets.push(this[0])
545 | self.targets.push(this[1])
546 | })
547 | }
548 |
549 | , process: function () {
550 | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
551 | , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
552 | , maxScroll = scrollHeight - this.$scrollElement.height()
553 | , offsets = this.offsets
554 | , targets = this.targets
555 | , activeTarget = this.activeTarget
556 | , i
557 |
558 | if (scrollTop >= maxScroll) {
559 | return activeTarget != (i = targets.last()[0])
560 | && this.activate ( i )
561 | }
562 |
563 | for (i = offsets.length; i--;) {
564 | activeTarget != targets[i]
565 | && scrollTop >= offsets[i]
566 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
567 | && this.activate( targets[i] )
568 | }
569 | }
570 |
571 | , activate: function (target) {
572 | var active
573 | , selector
574 |
575 | this.activeTarget = target
576 |
577 | $(this.selector)
578 | .parent('.active')
579 | .removeClass('active')
580 |
581 | selector = this.selector
582 | + '[data-target="' + target + '"],'
583 | + this.selector + '[href="' + target + '"]'
584 |
585 | active = $(selector)
586 | .parent('li')
587 | .addClass('active')
588 |
589 | if (active.parent('.dropdown-menu').length) {
590 | active = active.closest('li.dropdown').addClass('active')
591 | }
592 |
593 | active.trigger('activate')
594 | }
595 |
596 | }
597 |
598 |
599 | /* SCROLLSPY PLUGIN DEFINITION
600 | * =========================== */
601 |
602 | var old = $.fn.scrollspy
603 |
604 | $.fn.scrollspy = function (option) {
605 | return this.each(function () {
606 | var $this = $(this)
607 | , data = $this.data('scrollspy')
608 | , options = typeof option == 'object' && option
609 | if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
610 | if (typeof option == 'string') data[option]()
611 | })
612 | }
613 |
614 | $.fn.scrollspy.Constructor = ScrollSpy
615 |
616 | $.fn.scrollspy.defaults = {
617 | offset: 10
618 | }
619 |
620 |
621 | /* SCROLLSPY NO CONFLICT
622 | * ===================== */
623 |
624 | $.fn.scrollspy.noConflict = function () {
625 | $.fn.scrollspy = old
626 | return this
627 | }
628 |
629 |
630 | /* SCROLLSPY DATA-API
631 | * ================== */
632 |
633 | $(window).on('load', function () {
634 | $('[data-spy="scroll"]').each(function () {
635 | var $spy = $(this)
636 | $spy.scrollspy($spy.data())
637 | })
638 | })
639 |
640 | }(window.jQuery);
641 | /* ========================================================
642 | * bootstrap-tab.js v2.3.2
643 | * http://getbootstrap.com/2.3.2/javascript.html#tabs
644 | * ========================================================
645 | * Copyright 2013 Twitter, Inc.
646 | *
647 | * Licensed under the Apache License, Version 2.0 (the "License");
648 | * you may not use this file except in compliance with the License.
649 | * You may obtain a copy of the License at
650 | *
651 | * http://www.apache.org/licenses/LICENSE-2.0
652 | *
653 | * Unless required by applicable law or agreed to in writing, software
654 | * distributed under the License is distributed on an "AS IS" BASIS,
655 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
656 | * See the License for the specific language governing permissions and
657 | * limitations under the License.
658 | * ======================================================== */
659 |
660 |
661 | !function ($) {
662 |
663 | "use strict"; // jshint ;_;
664 |
665 |
666 | /* TAB CLASS DEFINITION
667 | * ==================== */
668 |
669 | var Tab = function (element) {
670 | this.element = $(element)
671 | }
672 |
673 | Tab.prototype = {
674 |
675 | constructor: Tab
676 |
677 | , show: function () {
678 | var $this = this.element
679 | , $ul = $this.closest('ul:not(.dropdown-menu)')
680 | , selector = $this.attr('data-target')
681 | , previous
682 | , $target
683 | , e
684 |
685 | if (!selector) {
686 | selector = $this.attr('href')
687 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
688 | }
689 |
690 | if ( $this.parent('li').hasClass('active') ) return
691 |
692 | previous = $ul.find('.active:last a')[0]
693 |
694 | e = $.Event('show', {
695 | relatedTarget: previous
696 | })
697 |
698 | $this.trigger(e)
699 |
700 | if (e.isDefaultPrevented()) return
701 |
702 | $target = $(selector)
703 |
704 | this.activate($this.parent('li'), $ul)
705 | this.activate($target, $target.parent(), function () {
706 | $this.trigger({
707 | type: 'shown'
708 | , relatedTarget: previous
709 | })
710 | })
711 | }
712 |
713 | , activate: function ( element, container, callback) {
714 | var $active = container.find('> .active')
715 | , transition = callback
716 | && $.support.transition
717 | && $active.hasClass('fade')
718 |
719 | function next() {
720 | $active
721 | .removeClass('active')
722 | .find('> .dropdown-menu > .active')
723 | .removeClass('active')
724 |
725 | element.addClass('active')
726 |
727 | if (transition) {
728 | element[0].offsetWidth // reflow for transition
729 | element.addClass('in')
730 | } else {
731 | element.removeClass('fade')
732 | }
733 |
734 | if ( element.parent('.dropdown-menu') ) {
735 | element.closest('li.dropdown').addClass('active')
736 | }
737 |
738 | callback && callback()
739 | }
740 |
741 | transition ?
742 | $active.one($.support.transition.end, next) :
743 | next()
744 |
745 | $active.removeClass('in')
746 | }
747 | }
748 |
749 |
750 | /* TAB PLUGIN DEFINITION
751 | * ===================== */
752 |
753 | var old = $.fn.tab
754 |
755 | $.fn.tab = function ( option ) {
756 | return this.each(function () {
757 | var $this = $(this)
758 | , data = $this.data('tab')
759 | if (!data) $this.data('tab', (data = new Tab(this)))
760 | if (typeof option == 'string') data[option]()
761 | })
762 | }
763 |
764 | $.fn.tab.Constructor = Tab
765 |
766 |
767 | /* TAB NO CONFLICT
768 | * =============== */
769 |
770 | $.fn.tab.noConflict = function () {
771 | $.fn.tab = old
772 | return this
773 | }
774 |
775 |
776 | /* TAB DATA-API
777 | * ============ */
778 |
779 | $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
780 | e.preventDefault()
781 | $(this).tab('show')
782 | })
783 |
784 | }(window.jQuery);
785 | /* ===========================================================
786 | * bootstrap-tooltip.js v2.3.2
787 | * http://getbootstrap.com/2.3.2/javascript.html#tooltips
788 | * Inspired by the original jQuery.tipsy by Jason Frame
789 | * ===========================================================
790 | * Copyright 2013 Twitter, Inc.
791 | *
792 | * Licensed under the Apache License, Version 2.0 (the "License");
793 | * you may not use this file except in compliance with the License.
794 | * You may obtain a copy of the License at
795 | *
796 | * http://www.apache.org/licenses/LICENSE-2.0
797 | *
798 | * Unless required by applicable law or agreed to in writing, software
799 | * distributed under the License is distributed on an "AS IS" BASIS,
800 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
801 | * See the License for the specific language governing permissions and
802 | * limitations under the License.
803 | * ========================================================== */
804 |
805 |
806 | !function ($) {
807 |
808 | "use strict"; // jshint ;_;
809 |
810 |
811 | /* TOOLTIP PUBLIC CLASS DEFINITION
812 | * =============================== */
813 |
814 | var Tooltip = function (element, options) {
815 | this.init('tooltip', element, options)
816 | }
817 |
818 | Tooltip.prototype = {
819 |
820 | constructor: Tooltip
821 |
822 | , init: function (type, element, options) {
823 | var eventIn
824 | , eventOut
825 | , triggers
826 | , trigger
827 | , i
828 |
829 | this.type = type
830 | this.$element = $(element)
831 | this.options = this.getOptions(options)
832 | this.enabled = true
833 |
834 | triggers = this.options.trigger.split(' ')
835 |
836 | for (i = triggers.length; i--;) {
837 | trigger = triggers[i]
838 | if (trigger == 'click') {
839 | this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
840 | } else if (trigger != 'manual') {
841 | eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
842 | eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
843 | this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
844 | this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
845 | }
846 | }
847 |
848 | this.options.selector ?
849 | (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
850 | this.fixTitle()
851 | }
852 |
853 | , getOptions: function (options) {
854 | options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
855 |
856 | if (options.delay && typeof options.delay == 'number') {
857 | options.delay = {
858 | show: options.delay
859 | , hide: options.delay
860 | }
861 | }
862 |
863 | return options
864 | }
865 |
866 | , enter: function (e) {
867 | var defaults = $.fn[this.type].defaults
868 | , options = {}
869 | , self
870 |
871 | this._options && $.each(this._options, function (key, value) {
872 | if (defaults[key] != value) options[key] = value
873 | }, this)
874 |
875 | self = $(e.currentTarget)[this.type](options).data(this.type)
876 |
877 | if (!self.options.delay || !self.options.delay.show) return self.show()
878 |
879 | clearTimeout(this.timeout)
880 | self.hoverState = 'in'
881 | this.timeout = setTimeout(function() {
882 | if (self.hoverState == 'in') self.show()
883 | }, self.options.delay.show)
884 | }
885 |
886 | , leave: function (e) {
887 | var self = $(e.currentTarget)[this.type](this._options).data(this.type)
888 |
889 | if (this.timeout) clearTimeout(this.timeout)
890 | if (!self.options.delay || !self.options.delay.hide) return self.hide()
891 |
892 | self.hoverState = 'out'
893 | this.timeout = setTimeout(function() {
894 | if (self.hoverState == 'out') self.hide()
895 | }, self.options.delay.hide)
896 | }
897 |
898 | , show: function () {
899 | var $tip
900 | , pos
901 | , actualWidth
902 | , actualHeight
903 | , placement
904 | , tp
905 | , e = $.Event('show')
906 |
907 | if (this.hasContent() && this.enabled) {
908 | this.$element.trigger(e)
909 | if (e.isDefaultPrevented()) return
910 | $tip = this.tip()
911 | this.setContent()
912 |
913 | if (this.options.animation) {
914 | $tip.addClass('fade')
915 | }
916 |
917 | placement = typeof this.options.placement == 'function' ?
918 | this.options.placement.call(this, $tip[0], this.$element[0]) :
919 | this.options.placement
920 |
921 | $tip
922 | .detach()
923 | .css({ top: 0, left: 0, display: 'block' })
924 |
925 | this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
926 |
927 | pos = this.getPosition()
928 |
929 | actualWidth = $tip[0].offsetWidth
930 | actualHeight = $tip[0].offsetHeight
931 |
932 | switch (placement) {
933 | case 'bottom':
934 | tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
935 | break
936 | case 'top':
937 | tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
938 | break
939 | case 'left':
940 | tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
941 | break
942 | case 'right':
943 | tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
944 | break
945 | }
946 |
947 | this.applyPlacement(tp, placement)
948 | this.$element.trigger('shown')
949 | }
950 | }
951 |
952 | , applyPlacement: function(offset, placement){
953 | var $tip = this.tip()
954 | , width = $tip[0].offsetWidth
955 | , height = $tip[0].offsetHeight
956 | , actualWidth
957 | , actualHeight
958 | , delta
959 | , replace
960 |
961 | $tip
962 | .offset(offset)
963 | .addClass(placement)
964 | .addClass('in')
965 |
966 | actualWidth = $tip[0].offsetWidth
967 | actualHeight = $tip[0].offsetHeight
968 |
969 | if (placement == 'top' && actualHeight != height) {
970 | offset.top = offset.top + height - actualHeight
971 | replace = true
972 | }
973 |
974 | if (placement == 'bottom' || placement == 'top') {
975 | delta = 0
976 |
977 | if (offset.left < 0){
978 | delta = offset.left * -2
979 | offset.left = 0
980 | $tip.offset(offset)
981 | actualWidth = $tip[0].offsetWidth
982 | actualHeight = $tip[0].offsetHeight
983 | }
984 |
985 | this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
986 | } else {
987 | this.replaceArrow(actualHeight - height, actualHeight, 'top')
988 | }
989 |
990 | if (replace) $tip.offset(offset)
991 | }
992 |
993 | , replaceArrow: function(delta, dimension, position){
994 | this
995 | .arrow()
996 | .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
997 | }
998 |
999 | , setContent: function () {
1000 | var $tip = this.tip()
1001 | , title = this.getTitle()
1002 |
1003 | $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1004 | $tip.removeClass('fade in top bottom left right')
1005 | }
1006 |
1007 | , hide: function () {
1008 | var that = this
1009 | , $tip = this.tip()
1010 | , e = $.Event('hide')
1011 |
1012 | this.$element.trigger(e)
1013 | if (e.isDefaultPrevented()) return
1014 |
1015 | $tip.removeClass('in')
1016 |
1017 | function removeWithAnimation() {
1018 | var timeout = setTimeout(function () {
1019 | $tip.off($.support.transition.end).detach()
1020 | }, 500)
1021 |
1022 | $tip.one($.support.transition.end, function () {
1023 | clearTimeout(timeout)
1024 | $tip.detach()
1025 | })
1026 | }
1027 |
1028 | $.support.transition && this.$tip.hasClass('fade') ?
1029 | removeWithAnimation() :
1030 | $tip.detach()
1031 |
1032 | this.$element.trigger('hidden')
1033 |
1034 | return this
1035 | }
1036 |
1037 | , fixTitle: function () {
1038 | var $e = this.$element
1039 | if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1040 | $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1041 | }
1042 | }
1043 |
1044 | , hasContent: function () {
1045 | return this.getTitle()
1046 | }
1047 |
1048 | , getPosition: function () {
1049 | var el = this.$element[0]
1050 | return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
1051 | width: el.offsetWidth
1052 | , height: el.offsetHeight
1053 | }, this.$element.offset())
1054 | }
1055 |
1056 | , getTitle: function () {
1057 | var title
1058 | , $e = this.$element
1059 | , o = this.options
1060 |
1061 | title = $e.attr('data-original-title')
1062 | || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1063 |
1064 | return title
1065 | }
1066 |
1067 | , tip: function () {
1068 | return this.$tip = this.$tip || $(this.options.template)
1069 | }
1070 |
1071 | , arrow: function(){
1072 | return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
1073 | }
1074 |
1075 | , validate: function () {
1076 | if (!this.$element[0].parentNode) {
1077 | this.hide()
1078 | this.$element = null
1079 | this.options = null
1080 | }
1081 | }
1082 |
1083 | , enable: function () {
1084 | this.enabled = true
1085 | }
1086 |
1087 | , disable: function () {
1088 | this.enabled = false
1089 | }
1090 |
1091 | , toggleEnabled: function () {
1092 | this.enabled = !this.enabled
1093 | }
1094 |
1095 | , toggle: function (e) {
1096 | var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
1097 | self.tip().hasClass('in') ? self.hide() : self.show()
1098 | }
1099 |
1100 | , destroy: function () {
1101 | this.hide().$element.off('.' + this.type).removeData(this.type)
1102 | }
1103 |
1104 | }
1105 |
1106 |
1107 | /* TOOLTIP PLUGIN DEFINITION
1108 | * ========================= */
1109 |
1110 | var old = $.fn.tooltip
1111 |
1112 | $.fn.tooltip = function ( option ) {
1113 | return this.each(function () {
1114 | var $this = $(this)
1115 | , data = $this.data('tooltip')
1116 | , options = typeof option == 'object' && option
1117 | if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1118 | if (typeof option == 'string') data[option]()
1119 | })
1120 | }
1121 |
1122 | $.fn.tooltip.Constructor = Tooltip
1123 |
1124 | $.fn.tooltip.defaults = {
1125 | animation: true
1126 | , placement: 'top'
1127 | , selector: false
1128 | , template: ''
1129 | , trigger: 'hover focus'
1130 | , title: ''
1131 | , delay: 0
1132 | , html: false
1133 | , container: false
1134 | }
1135 |
1136 |
1137 | /* TOOLTIP NO CONFLICT
1138 | * =================== */
1139 |
1140 | $.fn.tooltip.noConflict = function () {
1141 | $.fn.tooltip = old
1142 | return this
1143 | }
1144 |
1145 | }(window.jQuery);
1146 |
1147 | /* ===========================================================
1148 | * bootstrap-popover.js v2.3.2
1149 | * http://getbootstrap.com/2.3.2/javascript.html#popovers
1150 | * ===========================================================
1151 | * Copyright 2013 Twitter, Inc.
1152 | *
1153 | * Licensed under the Apache License, Version 2.0 (the "License");
1154 | * you may not use this file except in compliance with the License.
1155 | * You may obtain a copy of the License at
1156 | *
1157 | * http://www.apache.org/licenses/LICENSE-2.0
1158 | *
1159 | * Unless required by applicable law or agreed to in writing, software
1160 | * distributed under the License is distributed on an "AS IS" BASIS,
1161 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1162 | * See the License for the specific language governing permissions and
1163 | * limitations under the License.
1164 | * =========================================================== */
1165 |
1166 |
1167 | !function ($) {
1168 |
1169 | "use strict"; // jshint ;_;
1170 |
1171 |
1172 | /* POPOVER PUBLIC CLASS DEFINITION
1173 | * =============================== */
1174 |
1175 | var Popover = function (element, options) {
1176 | this.init('popover', element, options)
1177 | }
1178 |
1179 |
1180 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1181 | ========================================== */
1182 |
1183 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1184 |
1185 | constructor: Popover
1186 |
1187 | , setContent: function () {
1188 | var $tip = this.tip()
1189 | , title = this.getTitle()
1190 | , content = this.getContent()
1191 |
1192 | $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1193 | $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
1194 |
1195 | $tip.removeClass('fade top bottom left right in')
1196 | }
1197 |
1198 | , hasContent: function () {
1199 | return this.getTitle() || this.getContent()
1200 | }
1201 |
1202 | , getContent: function () {
1203 | var content
1204 | , $e = this.$element
1205 | , o = this.options
1206 |
1207 | content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1208 | || $e.attr('data-content')
1209 |
1210 | return content
1211 | }
1212 |
1213 | , tip: function () {
1214 | if (!this.$tip) {
1215 | this.$tip = $(this.options.template)
1216 | }
1217 | return this.$tip
1218 | }
1219 |
1220 | , destroy: function () {
1221 | this.hide().$element.off('.' + this.type).removeData(this.type)
1222 | }
1223 |
1224 | })
1225 |
1226 |
1227 | /* POPOVER PLUGIN DEFINITION
1228 | * ======================= */
1229 |
1230 | var old = $.fn.popover
1231 |
1232 | $.fn.popover = function (option) {
1233 | return this.each(function () {
1234 | var $this = $(this)
1235 | , data = $this.data('popover')
1236 | , options = typeof option == 'object' && option
1237 | if (!data) $this.data('popover', (data = new Popover(this, options)))
1238 | if (typeof option == 'string') data[option]()
1239 | })
1240 | }
1241 |
1242 | $.fn.popover.Constructor = Popover
1243 |
1244 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1245 | placement: 'right'
1246 | , trigger: 'click'
1247 | , content: ''
1248 | , template: ''
1249 | })
1250 |
1251 |
1252 | /* POPOVER NO CONFLICT
1253 | * =================== */
1254 |
1255 | $.fn.popover.noConflict = function () {
1256 | $.fn.popover = old
1257 | return this
1258 | }
1259 |
1260 | }(window.jQuery);
1261 |
1262 | /* ==========================================================
1263 | * bootstrap-affix.js v2.3.2
1264 | * http://getbootstrap.com/2.3.2/javascript.html#affix
1265 | * ==========================================================
1266 | * Copyright 2013 Twitter, Inc.
1267 | *
1268 | * Licensed under the Apache License, Version 2.0 (the "License");
1269 | * you may not use this file except in compliance with the License.
1270 | * You may obtain a copy of the License at
1271 | *
1272 | * http://www.apache.org/licenses/LICENSE-2.0
1273 | *
1274 | * Unless required by applicable law or agreed to in writing, software
1275 | * distributed under the License is distributed on an "AS IS" BASIS,
1276 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1277 | * See the License for the specific language governing permissions and
1278 | * limitations under the License.
1279 | * ========================================================== */
1280 |
1281 |
1282 | !function ($) {
1283 |
1284 | "use strict"; // jshint ;_;
1285 |
1286 |
1287 | /* AFFIX CLASS DEFINITION
1288 | * ====================== */
1289 |
1290 | var Affix = function (element, options) {
1291 | this.options = $.extend({}, $.fn.affix.defaults, options)
1292 | this.$window = $(window)
1293 | .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
1294 | .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
1295 | this.$element = $(element)
1296 | this.checkPosition()
1297 | }
1298 |
1299 | Affix.prototype.checkPosition = function () {
1300 | if (!this.$element.is(':visible')) return
1301 |
1302 | var scrollHeight = $(document).height()
1303 | , scrollTop = this.$window.scrollTop()
1304 | , position = this.$element.offset()
1305 | , offset = this.options.offset
1306 | , offsetBottom = offset.bottom
1307 | , offsetTop = offset.top
1308 | , reset = 'affix affix-top affix-bottom'
1309 | , affix
1310 |
1311 | if (typeof offset != 'object') offsetBottom = offsetTop = offset
1312 | if (typeof offsetTop == 'function') offsetTop = offset.top()
1313 | if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
1314 |
1315 | affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
1316 | false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
1317 | 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
1318 | 'top' : false
1319 |
1320 | if (this.affixed === affix) return
1321 |
1322 | this.affixed = affix
1323 | this.unpin = affix == 'bottom' ? position.top - scrollTop : null
1324 |
1325 | this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
1326 | }
1327 |
1328 |
1329 | /* AFFIX PLUGIN DEFINITION
1330 | * ======================= */
1331 |
1332 | var old = $.fn.affix
1333 |
1334 | $.fn.affix = function (option) {
1335 | return this.each(function () {
1336 | var $this = $(this)
1337 | , data = $this.data('affix')
1338 | , options = typeof option == 'object' && option
1339 | if (!data) $this.data('affix', (data = new Affix(this, options)))
1340 | if (typeof option == 'string') data[option]()
1341 | })
1342 | }
1343 |
1344 | $.fn.affix.Constructor = Affix
1345 |
1346 | $.fn.affix.defaults = {
1347 | offset: 0
1348 | }
1349 |
1350 |
1351 | /* AFFIX NO CONFLICT
1352 | * ================= */
1353 |
1354 | $.fn.affix.noConflict = function () {
1355 | $.fn.affix = old
1356 | return this
1357 | }
1358 |
1359 |
1360 | /* AFFIX DATA-API
1361 | * ============== */
1362 |
1363 | $(window).on('load', function () {
1364 | $('[data-spy="affix"]').each(function () {
1365 | var $spy = $(this)
1366 | , data = $spy.data()
1367 |
1368 | data.offset = data.offset || {}
1369 |
1370 | data.offsetBottom && (data.offset.bottom = data.offsetBottom)
1371 | data.offsetTop && (data.offset.top = data.offsetTop)
1372 |
1373 | $spy.affix(data)
1374 | })
1375 | })
1376 |
1377 |
1378 | }(window.jQuery);
1379 | /* ==========================================================
1380 | * bootstrap-alert.js v2.3.2
1381 | * http://getbootstrap.com/2.3.2/javascript.html#alerts
1382 | * ==========================================================
1383 | * Copyright 2013 Twitter, Inc.
1384 | *
1385 | * Licensed under the Apache License, Version 2.0 (the "License");
1386 | * you may not use this file except in compliance with the License.
1387 | * You may obtain a copy of the License at
1388 | *
1389 | * http://www.apache.org/licenses/LICENSE-2.0
1390 | *
1391 | * Unless required by applicable law or agreed to in writing, software
1392 | * distributed under the License is distributed on an "AS IS" BASIS,
1393 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1394 | * See the License for the specific language governing permissions and
1395 | * limitations under the License.
1396 | * ========================================================== */
1397 |
1398 |
1399 | !function ($) {
1400 |
1401 | "use strict"; // jshint ;_;
1402 |
1403 |
1404 | /* ALERT CLASS DEFINITION
1405 | * ====================== */
1406 |
1407 | var dismiss = '[data-dismiss="alert"]'
1408 | , Alert = function (el) {
1409 | $(el).on('click', dismiss, this.close)
1410 | }
1411 |
1412 | Alert.prototype.close = function (e) {
1413 | var $this = $(this)
1414 | , selector = $this.attr('data-target')
1415 | , $parent
1416 |
1417 | if (!selector) {
1418 | selector = $this.attr('href')
1419 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1420 | }
1421 |
1422 | $parent = $(selector)
1423 |
1424 | e && e.preventDefault()
1425 |
1426 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
1427 |
1428 | $parent.trigger(e = $.Event('close'))
1429 |
1430 | if (e.isDefaultPrevented()) return
1431 |
1432 | $parent.removeClass('in')
1433 |
1434 | function removeElement() {
1435 | $parent
1436 | .trigger('closed')
1437 | .remove()
1438 | }
1439 |
1440 | $.support.transition && $parent.hasClass('fade') ?
1441 | $parent.on($.support.transition.end, removeElement) :
1442 | removeElement()
1443 | }
1444 |
1445 |
1446 | /* ALERT PLUGIN DEFINITION
1447 | * ======================= */
1448 |
1449 | var old = $.fn.alert
1450 |
1451 | $.fn.alert = function (option) {
1452 | return this.each(function () {
1453 | var $this = $(this)
1454 | , data = $this.data('alert')
1455 | if (!data) $this.data('alert', (data = new Alert(this)))
1456 | if (typeof option == 'string') data[option].call($this)
1457 | })
1458 | }
1459 |
1460 | $.fn.alert.Constructor = Alert
1461 |
1462 |
1463 | /* ALERT NO CONFLICT
1464 | * ================= */
1465 |
1466 | $.fn.alert.noConflict = function () {
1467 | $.fn.alert = old
1468 | return this
1469 | }
1470 |
1471 |
1472 | /* ALERT DATA-API
1473 | * ============== */
1474 |
1475 | $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
1476 |
1477 | }(window.jQuery);
1478 | /* ============================================================
1479 | * bootstrap-button.js v2.3.2
1480 | * http://getbootstrap.com/2.3.2/javascript.html#buttons
1481 | * ============================================================
1482 | * Copyright 2013 Twitter, Inc.
1483 | *
1484 | * Licensed under the Apache License, Version 2.0 (the "License");
1485 | * you may not use this file except in compliance with the License.
1486 | * You may obtain a copy of the License at
1487 | *
1488 | * http://www.apache.org/licenses/LICENSE-2.0
1489 | *
1490 | * Unless required by applicable law or agreed to in writing, software
1491 | * distributed under the License is distributed on an "AS IS" BASIS,
1492 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1493 | * See the License for the specific language governing permissions and
1494 | * limitations under the License.
1495 | * ============================================================ */
1496 |
1497 |
1498 | !function ($) {
1499 |
1500 | "use strict"; // jshint ;_;
1501 |
1502 |
1503 | /* BUTTON PUBLIC CLASS DEFINITION
1504 | * ============================== */
1505 |
1506 | var Button = function (element, options) {
1507 | this.$element = $(element)
1508 | this.options = $.extend({}, $.fn.button.defaults, options)
1509 | }
1510 |
1511 | Button.prototype.setState = function (state) {
1512 | var d = 'disabled'
1513 | , $el = this.$element
1514 | , data = $el.data()
1515 | , val = $el.is('input') ? 'val' : 'html'
1516 |
1517 | state = state + 'Text'
1518 | data.resetText || $el.data('resetText', $el[val]())
1519 |
1520 | $el[val](data[state] || this.options[state])
1521 |
1522 | // push to event loop to allow forms to submit
1523 | setTimeout(function () {
1524 | state == 'loadingText' ?
1525 | $el.addClass(d).attr(d, d) :
1526 | $el.removeClass(d).removeAttr(d)
1527 | }, 0)
1528 | }
1529 |
1530 | Button.prototype.toggle = function () {
1531 | var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
1532 |
1533 | $parent && $parent
1534 | .find('.active')
1535 | .removeClass('active')
1536 |
1537 | this.$element.toggleClass('active')
1538 | }
1539 |
1540 |
1541 | /* BUTTON PLUGIN DEFINITION
1542 | * ======================== */
1543 |
1544 | var old = $.fn.button
1545 |
1546 | $.fn.button = function (option) {
1547 | return this.each(function () {
1548 | var $this = $(this)
1549 | , data = $this.data('button')
1550 | , options = typeof option == 'object' && option
1551 | if (!data) $this.data('button', (data = new Button(this, options)))
1552 | if (option == 'toggle') data.toggle()
1553 | else if (option) data.setState(option)
1554 | })
1555 | }
1556 |
1557 | $.fn.button.defaults = {
1558 | loadingText: 'loading...'
1559 | }
1560 |
1561 | $.fn.button.Constructor = Button
1562 |
1563 |
1564 | /* BUTTON NO CONFLICT
1565 | * ================== */
1566 |
1567 | $.fn.button.noConflict = function () {
1568 | $.fn.button = old
1569 | return this
1570 | }
1571 |
1572 |
1573 | /* BUTTON DATA-API
1574 | * =============== */
1575 |
1576 | $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
1577 | var $btn = $(e.target)
1578 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
1579 | $btn.button('toggle')
1580 | })
1581 |
1582 | }(window.jQuery);
1583 | /* =============================================================
1584 | * bootstrap-collapse.js v2.3.2
1585 | * http://getbootstrap.com/2.3.2/javascript.html#collapse
1586 | * =============================================================
1587 | * Copyright 2013 Twitter, Inc.
1588 | *
1589 | * Licensed under the Apache License, Version 2.0 (the "License");
1590 | * you may not use this file except in compliance with the License.
1591 | * You may obtain a copy of the License at
1592 | *
1593 | * http://www.apache.org/licenses/LICENSE-2.0
1594 | *
1595 | * Unless required by applicable law or agreed to in writing, software
1596 | * distributed under the License is distributed on an "AS IS" BASIS,
1597 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1598 | * See the License for the specific language governing permissions and
1599 | * limitations under the License.
1600 | * ============================================================ */
1601 |
1602 |
1603 | !function ($) {
1604 |
1605 | "use strict"; // jshint ;_;
1606 |
1607 |
1608 | /* COLLAPSE PUBLIC CLASS DEFINITION
1609 | * ================================ */
1610 |
1611 | var Collapse = function (element, options) {
1612 | this.$element = $(element)
1613 | this.options = $.extend({}, $.fn.collapse.defaults, options)
1614 |
1615 | if (this.options.parent) {
1616 | this.$parent = $(this.options.parent)
1617 | }
1618 |
1619 | this.options.toggle && this.toggle()
1620 | }
1621 |
1622 | Collapse.prototype = {
1623 |
1624 | constructor: Collapse
1625 |
1626 | , dimension: function () {
1627 | var hasWidth = this.$element.hasClass('width')
1628 | return hasWidth ? 'width' : 'height'
1629 | }
1630 |
1631 | , show: function () {
1632 | var dimension
1633 | , scroll
1634 | , actives
1635 | , hasData
1636 |
1637 | if (this.transitioning || this.$element.hasClass('in')) return
1638 |
1639 | dimension = this.dimension()
1640 | scroll = $.camelCase(['scroll', dimension].join('-'))
1641 | actives = this.$parent && this.$parent.find('> .accordion-group > .in')
1642 |
1643 | if (actives && actives.length) {
1644 | hasData = actives.data('collapse')
1645 | if (hasData && hasData.transitioning) return
1646 | actives.collapse('hide')
1647 | hasData || actives.data('collapse', null)
1648 | }
1649 |
1650 | this.$element[dimension](0)
1651 | this.transition('addClass', $.Event('show'), 'shown')
1652 | $.support.transition && this.$element[dimension](this.$element[0][scroll])
1653 | }
1654 |
1655 | , hide: function () {
1656 | var dimension
1657 | if (this.transitioning || !this.$element.hasClass('in')) return
1658 | dimension = this.dimension()
1659 | this.reset(this.$element[dimension]())
1660 | this.transition('removeClass', $.Event('hide'), 'hidden')
1661 | this.$element[dimension](0)
1662 | }
1663 |
1664 | , reset: function (size) {
1665 | var dimension = this.dimension()
1666 |
1667 | this.$element
1668 | .removeClass('collapse')
1669 | [dimension](size || 'auto')
1670 | [0].offsetWidth
1671 |
1672 | this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
1673 |
1674 | return this
1675 | }
1676 |
1677 | , transition: function (method, startEvent, completeEvent) {
1678 | var that = this
1679 | , complete = function () {
1680 | if (startEvent.type == 'show') that.reset()
1681 | that.transitioning = 0
1682 | that.$element.trigger(completeEvent)
1683 | }
1684 |
1685 | this.$element.trigger(startEvent)
1686 |
1687 | if (startEvent.isDefaultPrevented()) return
1688 |
1689 | this.transitioning = 1
1690 |
1691 | this.$element[method]('in')
1692 |
1693 | $.support.transition && this.$element.hasClass('collapse') ?
1694 | this.$element.one($.support.transition.end, complete) :
1695 | complete()
1696 | }
1697 |
1698 | , toggle: function () {
1699 | this[this.$element.hasClass('in') ? 'hide' : 'show']()
1700 | }
1701 |
1702 | }
1703 |
1704 |
1705 | /* COLLAPSE PLUGIN DEFINITION
1706 | * ========================== */
1707 |
1708 | var old = $.fn.collapse
1709 |
1710 | $.fn.collapse = function (option) {
1711 | return this.each(function () {
1712 | var $this = $(this)
1713 | , data = $this.data('collapse')
1714 | , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
1715 | if (!data) $this.data('collapse', (data = new Collapse(this, options)))
1716 | if (typeof option == 'string') data[option]()
1717 | })
1718 | }
1719 |
1720 | $.fn.collapse.defaults = {
1721 | toggle: true
1722 | }
1723 |
1724 | $.fn.collapse.Constructor = Collapse
1725 |
1726 |
1727 | /* COLLAPSE NO CONFLICT
1728 | * ==================== */
1729 |
1730 | $.fn.collapse.noConflict = function () {
1731 | $.fn.collapse = old
1732 | return this
1733 | }
1734 |
1735 |
1736 | /* COLLAPSE DATA-API
1737 | * ================= */
1738 |
1739 | $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
1740 | var $this = $(this), href
1741 | , target = $this.attr('data-target')
1742 | || e.preventDefault()
1743 | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
1744 | , option = $(target).data('collapse') ? 'toggle' : $this.data()
1745 | $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
1746 | $(target).collapse(option)
1747 | })
1748 |
1749 | }(window.jQuery);
1750 | /* ==========================================================
1751 | * bootstrap-carousel.js v2.3.2
1752 | * http://getbootstrap.com/2.3.2/javascript.html#carousel
1753 | * ==========================================================
1754 | * Copyright 2013 Twitter, Inc.
1755 | *
1756 | * Licensed under the Apache License, Version 2.0 (the "License");
1757 | * you may not use this file except in compliance with the License.
1758 | * You may obtain a copy of the License at
1759 | *
1760 | * http://www.apache.org/licenses/LICENSE-2.0
1761 | *
1762 | * Unless required by applicable law or agreed to in writing, software
1763 | * distributed under the License is distributed on an "AS IS" BASIS,
1764 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1765 | * See the License for the specific language governing permissions and
1766 | * limitations under the License.
1767 | * ========================================================== */
1768 |
1769 |
1770 | !function ($) {
1771 |
1772 | "use strict"; // jshint ;_;
1773 |
1774 |
1775 | /* CAROUSEL CLASS DEFINITION
1776 | * ========================= */
1777 |
1778 | var Carousel = function (element, options) {
1779 | this.$element = $(element)
1780 | this.$indicators = this.$element.find('.carousel-indicators')
1781 | this.options = options
1782 | this.options.pause == 'hover' && this.$element
1783 | .on('mouseenter', $.proxy(this.pause, this))
1784 | .on('mouseleave', $.proxy(this.cycle, this))
1785 | }
1786 |
1787 | Carousel.prototype = {
1788 |
1789 | cycle: function (e) {
1790 | if (!e) this.paused = false
1791 | if (this.interval) clearInterval(this.interval);
1792 | this.options.interval
1793 | && !this.paused
1794 | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
1795 | return this
1796 | }
1797 |
1798 | , getActiveIndex: function () {
1799 | this.$active = this.$element.find('.item.active')
1800 | this.$items = this.$active.parent().children()
1801 | return this.$items.index(this.$active)
1802 | }
1803 |
1804 | , to: function (pos) {
1805 | var activeIndex = this.getActiveIndex()
1806 | , that = this
1807 |
1808 | if (pos > (this.$items.length - 1) || pos < 0) return
1809 |
1810 | if (this.sliding) {
1811 | return this.$element.one('slid', function () {
1812 | that.to(pos)
1813 | })
1814 | }
1815 |
1816 | if (activeIndex == pos) {
1817 | return this.pause().cycle()
1818 | }
1819 |
1820 | return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
1821 | }
1822 |
1823 | , pause: function (e) {
1824 | if (!e) this.paused = true
1825 | if (this.$element.find('.next, .prev').length && $.support.transition.end) {
1826 | this.$element.trigger($.support.transition.end)
1827 | this.cycle(true)
1828 | }
1829 | clearInterval(this.interval)
1830 | this.interval = null
1831 | return this
1832 | }
1833 |
1834 | , next: function () {
1835 | if (this.sliding) return
1836 | return this.slide('next')
1837 | }
1838 |
1839 | , prev: function () {
1840 | if (this.sliding) return
1841 | return this.slide('prev')
1842 | }
1843 |
1844 | , slide: function (type, next) {
1845 | var $active = this.$element.find('.item.active')
1846 | , $next = next || $active[type]()
1847 | , isCycling = this.interval
1848 | , direction = type == 'next' ? 'left' : 'right'
1849 | , fallback = type == 'next' ? 'first' : 'last'
1850 | , that = this
1851 | , e
1852 |
1853 | this.sliding = true
1854 |
1855 | isCycling && this.pause()
1856 |
1857 | $next = $next.length ? $next : this.$element.find('.item')[fallback]()
1858 |
1859 | e = $.Event('slide', {
1860 | relatedTarget: $next[0]
1861 | , direction: direction
1862 | })
1863 |
1864 | if ($next.hasClass('active')) return
1865 |
1866 | if (this.$indicators.length) {
1867 | this.$indicators.find('.active').removeClass('active')
1868 | this.$element.one('slid', function () {
1869 | var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
1870 | $nextIndicator && $nextIndicator.addClass('active')
1871 | })
1872 | }
1873 |
1874 | if ($.support.transition && this.$element.hasClass('slide')) {
1875 | this.$element.trigger(e)
1876 | if (e.isDefaultPrevented()) return
1877 | $next.addClass(type)
1878 | $next[0].offsetWidth // force reflow
1879 | $active.addClass(direction)
1880 | $next.addClass(direction)
1881 | this.$element.one($.support.transition.end, function () {
1882 | $next.removeClass([type, direction].join(' ')).addClass('active')
1883 | $active.removeClass(['active', direction].join(' '))
1884 | that.sliding = false
1885 | setTimeout(function () { that.$element.trigger('slid') }, 0)
1886 | })
1887 | } else {
1888 | this.$element.trigger(e)
1889 | if (e.isDefaultPrevented()) return
1890 | $active.removeClass('active')
1891 | $next.addClass('active')
1892 | this.sliding = false
1893 | this.$element.trigger('slid')
1894 | }
1895 |
1896 | isCycling && this.cycle()
1897 |
1898 | return this
1899 | }
1900 |
1901 | }
1902 |
1903 |
1904 | /* CAROUSEL PLUGIN DEFINITION
1905 | * ========================== */
1906 |
1907 | var old = $.fn.carousel
1908 |
1909 | $.fn.carousel = function (option) {
1910 | return this.each(function () {
1911 | var $this = $(this)
1912 | , data = $this.data('carousel')
1913 | , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
1914 | , action = typeof option == 'string' ? option : options.slide
1915 | if (!data) $this.data('carousel', (data = new Carousel(this, options)))
1916 | if (typeof option == 'number') data.to(option)
1917 | else if (action) data[action]()
1918 | else if (options.interval) data.pause().cycle()
1919 | })
1920 | }
1921 |
1922 | $.fn.carousel.defaults = {
1923 | interval: 5000
1924 | , pause: 'hover'
1925 | }
1926 |
1927 | $.fn.carousel.Constructor = Carousel
1928 |
1929 |
1930 | /* CAROUSEL NO CONFLICT
1931 | * ==================== */
1932 |
1933 | $.fn.carousel.noConflict = function () {
1934 | $.fn.carousel = old
1935 | return this
1936 | }
1937 |
1938 | /* CAROUSEL DATA-API
1939 | * ================= */
1940 |
1941 | $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
1942 | var $this = $(this), href
1943 | , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1944 | , options = $.extend({}, $target.data(), $this.data())
1945 | , slideIndex
1946 |
1947 | $target.carousel(options)
1948 |
1949 | if (slideIndex = $this.attr('data-slide-to')) {
1950 | $target.data('carousel').pause().to(slideIndex).cycle()
1951 | }
1952 |
1953 | e.preventDefault()
1954 | })
1955 |
1956 | }(window.jQuery);
1957 | /* =============================================================
1958 | * bootstrap-typeahead.js v2.3.2
1959 | * http://getbootstrap.com/2.3.2/javascript.html#typeahead
1960 | * =============================================================
1961 | * Copyright 2013 Twitter, Inc.
1962 | *
1963 | * Licensed under the Apache License, Version 2.0 (the "License");
1964 | * you may not use this file except in compliance with the License.
1965 | * You may obtain a copy of the License at
1966 | *
1967 | * http://www.apache.org/licenses/LICENSE-2.0
1968 | *
1969 | * Unless required by applicable law or agreed to in writing, software
1970 | * distributed under the License is distributed on an "AS IS" BASIS,
1971 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1972 | * See the License for the specific language governing permissions and
1973 | * limitations under the License.
1974 | * ============================================================ */
1975 |
1976 |
1977 | !function($){
1978 |
1979 | "use strict"; // jshint ;_;
1980 |
1981 |
1982 | /* TYPEAHEAD PUBLIC CLASS DEFINITION
1983 | * ================================= */
1984 |
1985 | var Typeahead = function (element, options) {
1986 | this.$element = $(element)
1987 | this.options = $.extend({}, $.fn.typeahead.defaults, options)
1988 | this.matcher = this.options.matcher || this.matcher
1989 | this.sorter = this.options.sorter || this.sorter
1990 | this.highlighter = this.options.highlighter || this.highlighter
1991 | this.updater = this.options.updater || this.updater
1992 | this.source = this.options.source
1993 | this.$menu = $(this.options.menu)
1994 | this.shown = false
1995 | this.listen()
1996 | }
1997 |
1998 | Typeahead.prototype = {
1999 |
2000 | constructor: Typeahead
2001 |
2002 | , select: function () {
2003 | var val = this.$menu.find('.active').attr('data-value')
2004 | this.$element
2005 | .val(this.updater(val))
2006 | .change()
2007 | return this.hide()
2008 | }
2009 |
2010 | , updater: function (item) {
2011 | return item
2012 | }
2013 |
2014 | , show: function () {
2015 | var pos = $.extend({}, this.$element.position(), {
2016 | height: this.$element[0].offsetHeight
2017 | })
2018 |
2019 | this.$menu
2020 | .insertAfter(this.$element)
2021 | .css({
2022 | top: pos.top + pos.height
2023 | , left: pos.left
2024 | })
2025 | .show()
2026 |
2027 | this.shown = true
2028 | return this
2029 | }
2030 |
2031 | , hide: function () {
2032 | this.$menu.hide()
2033 | this.shown = false
2034 | return this
2035 | }
2036 |
2037 | , lookup: function (event) {
2038 | var items
2039 |
2040 | this.query = this.$element.val()
2041 |
2042 | if (!this.query || this.query.length < this.options.minLength) {
2043 | return this.shown ? this.hide() : this
2044 | }
2045 |
2046 | items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
2047 |
2048 | return items ? this.process(items) : this
2049 | }
2050 |
2051 | , process: function (items) {
2052 | var that = this
2053 |
2054 | items = $.grep(items, function (item) {
2055 | return that.matcher(item)
2056 | })
2057 |
2058 | items = this.sorter(items)
2059 |
2060 | if (!items.length) {
2061 | return this.shown ? this.hide() : this
2062 | }
2063 |
2064 | return this.render(items.slice(0, this.options.items)).show()
2065 | }
2066 |
2067 | , matcher: function (item) {
2068 | return ~item.toLowerCase().indexOf(this.query.toLowerCase())
2069 | }
2070 |
2071 | , sorter: function (items) {
2072 | var beginswith = []
2073 | , caseSensitive = []
2074 | , caseInsensitive = []
2075 | , item
2076 |
2077 | while (item = items.shift()) {
2078 | if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
2079 | else if (~item.indexOf(this.query)) caseSensitive.push(item)
2080 | else caseInsensitive.push(item)
2081 | }
2082 |
2083 | return beginswith.concat(caseSensitive, caseInsensitive)
2084 | }
2085 |
2086 | , highlighter: function (item) {
2087 | var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
2088 | return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
2089 | return '' + match + ' '
2090 | })
2091 | }
2092 |
2093 | , render: function (items) {
2094 | var that = this
2095 |
2096 | items = $(items).map(function (i, item) {
2097 | i = $(that.options.item).attr('data-value', item)
2098 | i.find('a').html(that.highlighter(item))
2099 | return i[0]
2100 | })
2101 |
2102 | items.first().addClass('active')
2103 | this.$menu.html(items)
2104 | return this
2105 | }
2106 |
2107 | , next: function (event) {
2108 | var active = this.$menu.find('.active').removeClass('active')
2109 | , next = active.next()
2110 |
2111 | if (!next.length) {
2112 | next = $(this.$menu.find('li')[0])
2113 | }
2114 |
2115 | next.addClass('active')
2116 | }
2117 |
2118 | , prev: function (event) {
2119 | var active = this.$menu.find('.active').removeClass('active')
2120 | , prev = active.prev()
2121 |
2122 | if (!prev.length) {
2123 | prev = this.$menu.find('li').last()
2124 | }
2125 |
2126 | prev.addClass('active')
2127 | }
2128 |
2129 | , listen: function () {
2130 | this.$element
2131 | .on('focus', $.proxy(this.focus, this))
2132 | .on('blur', $.proxy(this.blur, this))
2133 | .on('keypress', $.proxy(this.keypress, this))
2134 | .on('keyup', $.proxy(this.keyup, this))
2135 |
2136 | if (this.eventSupported('keydown')) {
2137 | this.$element.on('keydown', $.proxy(this.keydown, this))
2138 | }
2139 |
2140 | this.$menu
2141 | .on('click', $.proxy(this.click, this))
2142 | .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
2143 | .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
2144 | }
2145 |
2146 | , eventSupported: function(eventName) {
2147 | var isSupported = eventName in this.$element
2148 | if (!isSupported) {
2149 | this.$element.setAttribute(eventName, 'return;')
2150 | isSupported = typeof this.$element[eventName] === 'function'
2151 | }
2152 | return isSupported
2153 | }
2154 |
2155 | , move: function (e) {
2156 | if (!this.shown) return
2157 |
2158 | switch(e.keyCode) {
2159 | case 9: // tab
2160 | case 13: // enter
2161 | case 27: // escape
2162 | e.preventDefault()
2163 | break
2164 |
2165 | case 38: // up arrow
2166 | e.preventDefault()
2167 | this.prev()
2168 | break
2169 |
2170 | case 40: // down arrow
2171 | e.preventDefault()
2172 | this.next()
2173 | break
2174 | }
2175 |
2176 | e.stopPropagation()
2177 | }
2178 |
2179 | , keydown: function (e) {
2180 | this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
2181 | this.move(e)
2182 | }
2183 |
2184 | , keypress: function (e) {
2185 | if (this.suppressKeyPressRepeat) return
2186 | this.move(e)
2187 | }
2188 |
2189 | , keyup: function (e) {
2190 | switch(e.keyCode) {
2191 | case 40: // down arrow
2192 | case 38: // up arrow
2193 | case 16: // shift
2194 | case 17: // ctrl
2195 | case 18: // alt
2196 | break
2197 |
2198 | case 9: // tab
2199 | case 13: // enter
2200 | if (!this.shown) return
2201 | this.select()
2202 | break
2203 |
2204 | case 27: // escape
2205 | if (!this.shown) return
2206 | this.hide()
2207 | break
2208 |
2209 | default:
2210 | this.lookup()
2211 | }
2212 |
2213 | e.stopPropagation()
2214 | e.preventDefault()
2215 | }
2216 |
2217 | , focus: function (e) {
2218 | this.focused = true
2219 | }
2220 |
2221 | , blur: function (e) {
2222 | this.focused = false
2223 | if (!this.mousedover && this.shown) this.hide()
2224 | }
2225 |
2226 | , click: function (e) {
2227 | e.stopPropagation()
2228 | e.preventDefault()
2229 | this.select()
2230 | this.$element.focus()
2231 | }
2232 |
2233 | , mouseenter: function (e) {
2234 | this.mousedover = true
2235 | this.$menu.find('.active').removeClass('active')
2236 | $(e.currentTarget).addClass('active')
2237 | }
2238 |
2239 | , mouseleave: function (e) {
2240 | this.mousedover = false
2241 | if (!this.focused && this.shown) this.hide()
2242 | }
2243 |
2244 | }
2245 |
2246 |
2247 | /* TYPEAHEAD PLUGIN DEFINITION
2248 | * =========================== */
2249 |
2250 | var old = $.fn.typeahead
2251 |
2252 | $.fn.typeahead = function (option) {
2253 | return this.each(function () {
2254 | var $this = $(this)
2255 | , data = $this.data('typeahead')
2256 | , options = typeof option == 'object' && option
2257 | if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
2258 | if (typeof option == 'string') data[option]()
2259 | })
2260 | }
2261 |
2262 | $.fn.typeahead.defaults = {
2263 | source: []
2264 | , items: 8
2265 | , menu: ''
2266 | , item: ' '
2267 | , minLength: 1
2268 | }
2269 |
2270 | $.fn.typeahead.Constructor = Typeahead
2271 |
2272 |
2273 | /* TYPEAHEAD NO CONFLICT
2274 | * =================== */
2275 |
2276 | $.fn.typeahead.noConflict = function () {
2277 | $.fn.typeahead = old
2278 | return this
2279 | }
2280 |
2281 |
2282 | /* TYPEAHEAD DATA-API
2283 | * ================== */
2284 |
2285 | $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
2286 | var $this = $(this)
2287 | if ($this.data('typeahead')) return
2288 | $this.typeahead($this.data())
2289 | })
2290 |
2291 | }(window.jQuery);
2292 |
--------------------------------------------------------------------------------
/vendor/scripts/console-helper.js:
--------------------------------------------------------------------------------
1 | // Make it safe to do console.log() always.
2 | (function (con) {
3 | var method;
4 | var dummy = function() {};
5 | var methods = ('assert,count,debug,dir,dirxml,error,exception,group,' +
6 | 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,' +
7 | 'time,timeEnd,trace,warn').split(',');
8 | while (method = methods.pop()) {
9 | con[method] = con[method] || dummy;
10 | }
11 | })(window.console = window.console || {});
12 |
--------------------------------------------------------------------------------
/vendor/scripts/handlebars-1.0.rc.4.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Copyright (C) 2011 by Yehuda Katz
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
23 | */
24 |
25 | // lib/handlebars/browser-prefix.js
26 | var Handlebars = {};
27 |
28 | (function(Handlebars, undefined) {
29 | ;
30 | // lib/handlebars/base.js
31 |
32 | Handlebars.VERSION = "1.0.0-rc.4";
33 | Handlebars.COMPILER_REVISION = 3;
34 |
35 | Handlebars.REVISION_CHANGES = {
36 | 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
37 | 2: '== 1.0.0-rc.3',
38 | 3: '>= 1.0.0-rc.4'
39 | };
40 |
41 | Handlebars.helpers = {};
42 | Handlebars.partials = {};
43 |
44 | var toString = Object.prototype.toString,
45 | functionType = '[object Function]',
46 | objectType = '[object Object]';
47 |
48 | Handlebars.registerHelper = function(name, fn, inverse) {
49 | if (toString.call(name) === objectType) {
50 | if (inverse || fn) { throw new Handlebars.Exception('Arg not supported with multiple helpers'); }
51 | Handlebars.Utils.extend(this.helpers, name);
52 | } else {
53 | if (inverse) { fn.not = inverse; }
54 | this.helpers[name] = fn;
55 | }
56 | };
57 |
58 | Handlebars.registerPartial = function(name, str) {
59 | if (toString.call(name) === objectType) {
60 | Handlebars.Utils.extend(this.partials, name);
61 | } else {
62 | this.partials[name] = str;
63 | }
64 | };
65 |
66 | Handlebars.registerHelper('helperMissing', function(arg) {
67 | if(arguments.length === 2) {
68 | return undefined;
69 | } else {
70 | throw new Error("Could not find property '" + arg + "'");
71 | }
72 | });
73 |
74 | Handlebars.registerHelper('blockHelperMissing', function(context, options) {
75 | var inverse = options.inverse || function() {}, fn = options.fn;
76 |
77 | var type = toString.call(context);
78 |
79 | if(type === functionType) { context = context.call(this); }
80 |
81 | if(context === true) {
82 | return fn(this);
83 | } else if(context === false || context == null) {
84 | return inverse(this);
85 | } else if(type === "[object Array]") {
86 | if(context.length > 0) {
87 | return Handlebars.helpers.each(context, options);
88 | } else {
89 | return inverse(this);
90 | }
91 | } else {
92 | return fn(context);
93 | }
94 | });
95 |
96 | Handlebars.K = function() {};
97 |
98 | Handlebars.createFrame = Object.create || function(object) {
99 | Handlebars.K.prototype = object;
100 | var obj = new Handlebars.K();
101 | Handlebars.K.prototype = null;
102 | return obj;
103 | };
104 |
105 | Handlebars.logger = {
106 | DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
107 |
108 | methodMap: {0: 'debug', 1: 'info', 2: 'warn', 3: 'error'},
109 |
110 | // can be overridden in the host environment
111 | log: function(level, obj) {
112 | if (Handlebars.logger.level <= level) {
113 | var method = Handlebars.logger.methodMap[level];
114 | if (typeof console !== 'undefined' && console[method]) {
115 | console[method].call(console, obj);
116 | }
117 | }
118 | }
119 | };
120 |
121 | Handlebars.log = function(level, obj) { Handlebars.logger.log(level, obj); };
122 |
123 | Handlebars.registerHelper('each', function(context, options) {
124 | var fn = options.fn, inverse = options.inverse;
125 | var i = 0, ret = "", data;
126 |
127 | if (options.data) {
128 | data = Handlebars.createFrame(options.data);
129 | }
130 |
131 | if(context && typeof context === 'object') {
132 | if(context instanceof Array){
133 | for(var j = context.length; i 2) {
335 | expected.push("'" + this.terminals_[p] + "'");
336 | }
337 | if (this.lexer.showPosition) {
338 | errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
339 | } else {
340 | errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
341 | }
342 | this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
343 | }
344 | }
345 | if (action[0] instanceof Array && action.length > 1) {
346 | throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
347 | }
348 | switch (action[0]) {
349 | case 1:
350 | stack.push(symbol);
351 | vstack.push(this.lexer.yytext);
352 | lstack.push(this.lexer.yylloc);
353 | stack.push(action[1]);
354 | symbol = null;
355 | if (!preErrorSymbol) {
356 | yyleng = this.lexer.yyleng;
357 | yytext = this.lexer.yytext;
358 | yylineno = this.lexer.yylineno;
359 | yyloc = this.lexer.yylloc;
360 | if (recovering > 0)
361 | recovering--;
362 | } else {
363 | symbol = preErrorSymbol;
364 | preErrorSymbol = null;
365 | }
366 | break;
367 | case 2:
368 | len = this.productions_[action[1]][1];
369 | yyval.$ = vstack[vstack.length - len];
370 | yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
371 | if (ranges) {
372 | yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
373 | }
374 | r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
375 | if (typeof r !== "undefined") {
376 | return r;
377 | }
378 | if (len) {
379 | stack = stack.slice(0, -1 * len * 2);
380 | vstack = vstack.slice(0, -1 * len);
381 | lstack = lstack.slice(0, -1 * len);
382 | }
383 | stack.push(this.productions_[action[1]][0]);
384 | vstack.push(yyval.$);
385 | lstack.push(yyval._$);
386 | newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
387 | stack.push(newState);
388 | break;
389 | case 3:
390 | return true;
391 | }
392 | }
393 | return true;
394 | }
395 | };
396 | /* Jison generated lexer */
397 | var lexer = (function(){
398 | var lexer = ({EOF:1,
399 | parseError:function parseError(str, hash) {
400 | if (this.yy.parser) {
401 | this.yy.parser.parseError(str, hash);
402 | } else {
403 | throw new Error(str);
404 | }
405 | },
406 | setInput:function (input) {
407 | this._input = input;
408 | this._more = this._less = this.done = false;
409 | this.yylineno = this.yyleng = 0;
410 | this.yytext = this.matched = this.match = '';
411 | this.conditionStack = ['INITIAL'];
412 | this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
413 | if (this.options.ranges) this.yylloc.range = [0,0];
414 | this.offset = 0;
415 | return this;
416 | },
417 | input:function () {
418 | var ch = this._input[0];
419 | this.yytext += ch;
420 | this.yyleng++;
421 | this.offset++;
422 | this.match += ch;
423 | this.matched += ch;
424 | var lines = ch.match(/(?:\r\n?|\n).*/g);
425 | if (lines) {
426 | this.yylineno++;
427 | this.yylloc.last_line++;
428 | } else {
429 | this.yylloc.last_column++;
430 | }
431 | if (this.options.ranges) this.yylloc.range[1]++;
432 |
433 | this._input = this._input.slice(1);
434 | return ch;
435 | },
436 | unput:function (ch) {
437 | var len = ch.length;
438 | var lines = ch.split(/(?:\r\n?|\n)/g);
439 |
440 | this._input = ch + this._input;
441 | this.yytext = this.yytext.substr(0, this.yytext.length-len-1);
442 | //this.yyleng -= len;
443 | this.offset -= len;
444 | var oldLines = this.match.split(/(?:\r\n?|\n)/g);
445 | this.match = this.match.substr(0, this.match.length-1);
446 | this.matched = this.matched.substr(0, this.matched.length-1);
447 |
448 | if (lines.length-1) this.yylineno -= lines.length-1;
449 | var r = this.yylloc.range;
450 |
451 | this.yylloc = {first_line: this.yylloc.first_line,
452 | last_line: this.yylineno+1,
453 | first_column: this.yylloc.first_column,
454 | last_column: lines ?
455 | (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length:
456 | this.yylloc.first_column - len
457 | };
458 |
459 | if (this.options.ranges) {
460 | this.yylloc.range = [r[0], r[0] + this.yyleng - len];
461 | }
462 | return this;
463 | },
464 | more:function () {
465 | this._more = true;
466 | return this;
467 | },
468 | less:function (n) {
469 | this.unput(this.match.slice(n));
470 | },
471 | pastInput:function () {
472 | var past = this.matched.substr(0, this.matched.length - this.match.length);
473 | return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
474 | },
475 | upcomingInput:function () {
476 | var next = this.match;
477 | if (next.length < 20) {
478 | next += this._input.substr(0, 20-next.length);
479 | }
480 | return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
481 | },
482 | showPosition:function () {
483 | var pre = this.pastInput();
484 | var c = new Array(pre.length + 1).join("-");
485 | return pre + this.upcomingInput() + "\n" + c+"^";
486 | },
487 | next:function () {
488 | if (this.done) {
489 | return this.EOF;
490 | }
491 | if (!this._input) this.done = true;
492 |
493 | var token,
494 | match,
495 | tempMatch,
496 | index,
497 | col,
498 | lines;
499 | if (!this._more) {
500 | this.yytext = '';
501 | this.match = '';
502 | }
503 | var rules = this._currentRules();
504 | for (var i=0;i < rules.length; i++) {
505 | tempMatch = this._input.match(this.rules[rules[i]]);
506 | if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
507 | match = tempMatch;
508 | index = i;
509 | if (!this.options.flex) break;
510 | }
511 | }
512 | if (match) {
513 | lines = match[0].match(/(?:\r\n?|\n).*/g);
514 | if (lines) this.yylineno += lines.length;
515 | this.yylloc = {first_line: this.yylloc.last_line,
516 | last_line: this.yylineno+1,
517 | first_column: this.yylloc.last_column,
518 | last_column: lines ? lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length};
519 | this.yytext += match[0];
520 | this.match += match[0];
521 | this.matches = match;
522 | this.yyleng = this.yytext.length;
523 | if (this.options.ranges) {
524 | this.yylloc.range = [this.offset, this.offset += this.yyleng];
525 | }
526 | this._more = false;
527 | this._input = this._input.slice(match[0].length);
528 | this.matched += match[0];
529 | token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);
530 | if (this.done && this._input) this.done = false;
531 | if (token) return token;
532 | else return;
533 | }
534 | if (this._input === "") {
535 | return this.EOF;
536 | } else {
537 | return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
538 | {text: "", token: null, line: this.yylineno});
539 | }
540 | },
541 | lex:function lex() {
542 | var r = this.next();
543 | if (typeof r !== 'undefined') {
544 | return r;
545 | } else {
546 | return this.lex();
547 | }
548 | },
549 | begin:function begin(condition) {
550 | this.conditionStack.push(condition);
551 | },
552 | popState:function popState() {
553 | return this.conditionStack.pop();
554 | },
555 | _currentRules:function _currentRules() {
556 | return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
557 | },
558 | topState:function () {
559 | return this.conditionStack[this.conditionStack.length-2];
560 | },
561 | pushState:function begin(condition) {
562 | this.begin(condition);
563 | }});
564 | lexer.options = {};
565 | lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
566 |
567 | var YYSTATE=YY_START
568 | switch($avoiding_name_collisions) {
569 | case 0: yy_.yytext = "\\"; return 14;
570 | break;
571 | case 1:
572 | if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
573 | if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
574 | if(yy_.yytext) return 14;
575 |
576 | break;
577 | case 2: return 14;
578 | break;
579 | case 3:
580 | if(yy_.yytext.slice(-1) !== "\\") this.popState();
581 | if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1);
582 | return 14;
583 |
584 | break;
585 | case 4: yy_.yytext = yy_.yytext.substr(0, yy_.yyleng-4); this.popState(); return 15;
586 | break;
587 | case 5: this.begin("par"); return 24;
588 | break;
589 | case 6: return 16;
590 | break;
591 | case 7: return 20;
592 | break;
593 | case 8: return 19;
594 | break;
595 | case 9: return 19;
596 | break;
597 | case 10: return 23;
598 | break;
599 | case 11: return 23;
600 | break;
601 | case 12: this.popState(); this.begin('com');
602 | break;
603 | case 13: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
604 | break;
605 | case 14: return 22;
606 | break;
607 | case 15: return 36;
608 | break;
609 | case 16: return 35;
610 | break;
611 | case 17: return 35;
612 | break;
613 | case 18: return 39;
614 | break;
615 | case 19: /*ignore whitespace*/
616 | break;
617 | case 20: this.popState(); return 18;
618 | break;
619 | case 21: this.popState(); return 18;
620 | break;
621 | case 22: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 30;
622 | break;
623 | case 23: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\'/g,"'"); return 30;
624 | break;
625 | case 24: yy_.yytext = yy_.yytext.substr(1); return 28;
626 | break;
627 | case 25: return 32;
628 | break;
629 | case 26: return 32;
630 | break;
631 | case 27: return 31;
632 | break;
633 | case 28: return 35;
634 | break;
635 | case 29: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 35;
636 | break;
637 | case 30: return 'INVALID';
638 | break;
639 | case 31: /*ignore whitespace*/
640 | break;
641 | case 32: this.popState(); return 37;
642 | break;
643 | case 33: return 5;
644 | break;
645 | }
646 | };
647 | lexer.rules = [/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$:\-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$\-\/]+)/,/^(?:$)/];
648 | lexer.conditions = {"mu":{"rules":[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33],"inclusive":false},"emu":{"rules":[3],"inclusive":false},"com":{"rules":[4],"inclusive":false},"par":{"rules":[31,32],"inclusive":false},"INITIAL":{"rules":[0,1,2,33],"inclusive":true}};
649 | return lexer;})()
650 | parser.lexer = lexer;
651 | function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;
652 | return new Parser;
653 | })();;
654 | // lib/handlebars/compiler/base.js
655 |
656 | Handlebars.Parser = handlebars;
657 |
658 | Handlebars.parse = function(input) {
659 |
660 | // Just return if an already-compile AST was passed in.
661 | if(input.constructor === Handlebars.AST.ProgramNode) { return input; }
662 |
663 | Handlebars.Parser.yy = Handlebars.AST;
664 | return Handlebars.Parser.parse(input);
665 | };
666 | ;
667 | // lib/handlebars/compiler/ast.js
668 | Handlebars.AST = {};
669 |
670 | Handlebars.AST.ProgramNode = function(statements, inverse) {
671 | this.type = "program";
672 | this.statements = statements;
673 | if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
674 | };
675 |
676 | Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) {
677 | this.type = "mustache";
678 | this.escaped = !unescaped;
679 | this.hash = hash;
680 |
681 | var id = this.id = rawParams[0];
682 | var params = this.params = rawParams.slice(1);
683 |
684 | // a mustache is an eligible helper if:
685 | // * its id is simple (a single part, not `this` or `..`)
686 | var eligibleHelper = this.eligibleHelper = id.isSimple;
687 |
688 | // a mustache is definitely a helper if:
689 | // * it is an eligible helper, and
690 | // * it has at least one parameter or hash segment
691 | this.isHelper = eligibleHelper && (params.length || hash);
692 |
693 | // if a mustache is an eligible helper but not a definite
694 | // helper, it is ambiguous, and will be resolved in a later
695 | // pass or at runtime.
696 | };
697 |
698 | Handlebars.AST.PartialNode = function(partialName, context) {
699 | this.type = "partial";
700 | this.partialName = partialName;
701 | this.context = context;
702 | };
703 |
704 | Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {
705 | var verifyMatch = function(open, close) {
706 | if(open.original !== close.original) {
707 | throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
708 | }
709 | };
710 |
711 | verifyMatch(mustache.id, close);
712 | this.type = "block";
713 | this.mustache = mustache;
714 | this.program = program;
715 | this.inverse = inverse;
716 |
717 | if (this.inverse && !this.program) {
718 | this.isInverse = true;
719 | }
720 | };
721 |
722 | Handlebars.AST.ContentNode = function(string) {
723 | this.type = "content";
724 | this.string = string;
725 | };
726 |
727 | Handlebars.AST.HashNode = function(pairs) {
728 | this.type = "hash";
729 | this.pairs = pairs;
730 | };
731 |
732 | Handlebars.AST.IdNode = function(parts) {
733 | this.type = "ID";
734 | this.original = parts.join(".");
735 |
736 | var dig = [], depth = 0;
737 |
738 | for(var i=0,l=parts.length; i 0) { throw new Handlebars.Exception("Invalid path: " + this.original); }
743 | else if (part === "..") { depth++; }
744 | else { this.isScoped = true; }
745 | }
746 | else { dig.push(part); }
747 | }
748 |
749 | this.parts = dig;
750 | this.string = dig.join('.');
751 | this.depth = depth;
752 |
753 | // an ID is simple if it only has one part, and that part is not
754 | // `..` or `this`.
755 | this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;
756 |
757 | this.stringModeValue = this.string;
758 | };
759 |
760 | Handlebars.AST.PartialNameNode = function(name) {
761 | this.type = "PARTIAL_NAME";
762 | this.name = name;
763 | };
764 |
765 | Handlebars.AST.DataNode = function(id) {
766 | this.type = "DATA";
767 | this.id = id;
768 | };
769 |
770 | Handlebars.AST.StringNode = function(string) {
771 | this.type = "STRING";
772 | this.string = string;
773 | this.stringModeValue = string;
774 | };
775 |
776 | Handlebars.AST.IntegerNode = function(integer) {
777 | this.type = "INTEGER";
778 | this.integer = integer;
779 | this.stringModeValue = Number(integer);
780 | };
781 |
782 | Handlebars.AST.BooleanNode = function(bool) {
783 | this.type = "BOOLEAN";
784 | this.bool = bool;
785 | this.stringModeValue = bool === "true";
786 | };
787 |
788 | Handlebars.AST.CommentNode = function(comment) {
789 | this.type = "comment";
790 | this.comment = comment;
791 | };
792 | ;
793 | // lib/handlebars/utils.js
794 |
795 | var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
796 |
797 | Handlebars.Exception = function(message) {
798 | var tmp = Error.prototype.constructor.apply(this, arguments);
799 |
800 | // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
801 | for (var idx = 0; idx < errorProps.length; idx++) {
802 | this[errorProps[idx]] = tmp[errorProps[idx]];
803 | }
804 | };
805 | Handlebars.Exception.prototype = new Error();
806 |
807 | // Build out our basic SafeString type
808 | Handlebars.SafeString = function(string) {
809 | this.string = string;
810 | };
811 | Handlebars.SafeString.prototype.toString = function() {
812 | return this.string.toString();
813 | };
814 |
815 | var escape = {
816 | "&": "&",
817 | "<": "<",
818 | ">": ">",
819 | '"': """,
820 | "'": "'",
821 | "`": "`"
822 | };
823 |
824 | var badChars = /[&<>"'`]/g;
825 | var possible = /[&<>"'`]/;
826 |
827 | var escapeChar = function(chr) {
828 | return escape[chr] || "&";
829 | };
830 |
831 | Handlebars.Utils = {
832 | extend: function(obj, value) {
833 | for(var key in value) {
834 | if(value.hasOwnProperty(key)) {
835 | obj[key] = value[key];
836 | }
837 | }
838 | },
839 |
840 | escapeExpression: function(string) {
841 | // don't escape SafeStrings, since they're already safe
842 | if (string instanceof Handlebars.SafeString) {
843 | return string.toString();
844 | } else if (string == null || string === false) {
845 | return "";
846 | }
847 |
848 | // Force a string conversion as this will be done by the append regardless and
849 | // the regex test will do this transparently behind the scenes, causing issues if
850 | // an object's to string has escaped characters in it.
851 | string = string.toString();
852 |
853 | if(!possible.test(string)) { return string; }
854 | return string.replace(badChars, escapeChar);
855 | },
856 |
857 | isEmpty: function(value) {
858 | if (!value && value !== 0) {
859 | return true;
860 | } else if(toString.call(value) === "[object Array]" && value.length === 0) {
861 | return true;
862 | } else {
863 | return false;
864 | }
865 | }
866 | };
867 | ;
868 | // lib/handlebars/compiler/compiler.js
869 |
870 | /*jshint eqnull:true*/
871 | var Compiler = Handlebars.Compiler = function() {};
872 | var JavaScriptCompiler = Handlebars.JavaScriptCompiler = function() {};
873 |
874 | // the foundHelper register will disambiguate helper lookup from finding a
875 | // function in a context. This is necessary for mustache compatibility, which
876 | // requires that context functions in blocks are evaluated by blockHelperMissing,
877 | // and then proceed as if the resulting value was provided to blockHelperMissing.
878 |
879 | Compiler.prototype = {
880 | compiler: Compiler,
881 |
882 | disassemble: function() {
883 | var opcodes = this.opcodes, opcode, out = [], params, param;
884 |
885 | for (var i=0, l=opcodes.length; i 0) {
1388 | this.source[1] = this.source[1] + ", " + locals.join(", ");
1389 | }
1390 |
1391 | // Generate minimizer alias mappings
1392 | if (!this.isChild) {
1393 | for (var alias in this.context.aliases) {
1394 | this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
1395 | }
1396 | }
1397 |
1398 | if (this.source[1]) {
1399 | this.source[1] = "var " + this.source[1].substring(2) + ";";
1400 | }
1401 |
1402 | // Merge children
1403 | if (!this.isChild) {
1404 | this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
1405 | }
1406 |
1407 | if (!this.environment.isSimple) {
1408 | this.source.push("return buffer;");
1409 | }
1410 |
1411 | var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
1412 |
1413 | for(var i=0, l=this.environment.depths.list.length; i this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
1946 | return this.topStackName();
1947 | },
1948 | topStackName: function() {
1949 | return "stack" + this.stackSlot;
1950 | },
1951 | flushInline: function() {
1952 | var inlineStack = this.inlineStack;
1953 | if (inlineStack.length) {
1954 | this.inlineStack = [];
1955 | for (var i = 0, len = inlineStack.length; i < len; i++) {
1956 | var entry = inlineStack[i];
1957 | if (entry instanceof Literal) {
1958 | this.compileStack.push(entry);
1959 | } else {
1960 | this.pushStack(entry);
1961 | }
1962 | }
1963 | }
1964 | },
1965 | isInline: function() {
1966 | return this.inlineStack.length;
1967 | },
1968 |
1969 | popStack: function(wrapped) {
1970 | var inline = this.isInline(),
1971 | item = (inline ? this.inlineStack : this.compileStack).pop();
1972 |
1973 | if (!wrapped && (item instanceof Literal)) {
1974 | return item.value;
1975 | } else {
1976 | if (!inline) {
1977 | this.stackSlot--;
1978 | }
1979 | return item;
1980 | }
1981 | },
1982 |
1983 | topStack: function(wrapped) {
1984 | var stack = (this.isInline() ? this.inlineStack : this.compileStack),
1985 | item = stack[stack.length - 1];
1986 |
1987 | if (!wrapped && (item instanceof Literal)) {
1988 | return item.value;
1989 | } else {
1990 | return item;
1991 | }
1992 | },
1993 |
1994 | quotedString: function(str) {
1995 | return '"' + str
1996 | .replace(/\\/g, '\\\\')
1997 | .replace(/"/g, '\\"')
1998 | .replace(/\n/g, '\\n')
1999 | .replace(/\r/g, '\\r')
2000 | .replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
2001 | .replace(/\u2029/g, '\\u2029') + '"';
2002 | },
2003 |
2004 | setupHelper: function(paramSize, name, missingParams) {
2005 | var params = [];
2006 | this.setupParams(paramSize, params, missingParams);
2007 | var foundHelper = this.nameLookup('helpers', name, 'helper');
2008 |
2009 | return {
2010 | params: params,
2011 | name: foundHelper,
2012 | callParams: ["depth0"].concat(params).join(", "),
2013 | helperMissingParams: missingParams && ["depth0", this.quotedString(name)].concat(params).join(", ")
2014 | };
2015 | },
2016 |
2017 | // the params and contexts arguments are passed in arrays
2018 | // to fill in
2019 | setupParams: function(paramSize, params, useRegister) {
2020 | var options = [], contexts = [], types = [], param, inverse, program;
2021 |
2022 | options.push("hash:" + this.popStack());
2023 |
2024 | inverse = this.popStack();
2025 | program = this.popStack();
2026 |
2027 | // Avoid setting fn and inverse if neither are set. This allows
2028 | // helpers to do a check for `if (options.fn)`
2029 | if (program || inverse) {
2030 | if (!program) {
2031 | this.context.aliases.self = "this";
2032 | program = "self.noop";
2033 | }
2034 |
2035 | if (!inverse) {
2036 | this.context.aliases.self = "this";
2037 | inverse = "self.noop";
2038 | }
2039 |
2040 | options.push("inverse:" + inverse);
2041 | options.push("fn:" + program);
2042 | }
2043 |
2044 | for(var i=0; i ', {
51 | "class":"progress-bar bar "+ ((this.options.state) ? ("progress-bar-"+this.options.state+" bar-"+this.options.state):"")
52 | }).append($(" "));
53 |
54 |
55 | $('
',{
56 | "class":"progress "+((this.options.flat) ? "" : "progress-striped active") +" skylo",
57 | }).append(body).appendTo('body');
58 |
59 | this._shown = true;
60 | this._width = 0;
61 | }
62 |
63 | if(typeof callback === "function"){
64 | callback();
65 | }
66 |
67 | };
68 |
69 | Plugin.prototype.remove = function(){
70 | $('.skylo').remove();
71 | this._shown = false;
72 | this._width = 0;
73 | };
74 |
75 | Plugin.prototype.set = function (params) {
76 | // Place initialization logic here
77 | // You already have access to the DOM element and
78 | // the options via the instance, e.g. this.element
79 | // and this.options
80 | clearTimeout(this.interval);
81 | this._width = params;
82 | $('.progress.skylo .bar').width(this.get()+'%');
83 | };
84 |
85 | Plugin.prototype.inch = function(params){
86 | var that = this;
87 | if(params > 0 && that.get() <= 100){
88 | this.interval = setTimeout(function(){
89 | var width = that.get() + 1;
90 | that.set(width);
91 | that.inch(--params);
92 | },that.options.inchSpeed);
93 | } else if(that.get() === 100){
94 | that.end();
95 | }
96 | };
97 |
98 | Plugin.prototype.start = function(){
99 | var that = this;
100 | this.show(function(){
101 | that.set(that.options.initialBurst);
102 | });
103 | };
104 |
105 | Plugin.prototype.end = function () {
106 | var that = this;
107 | clearTimeout(this.interval);
108 | $('.progress.skylo .bar').width('100%');
109 | _disappear(400,function(){
110 | that.remove();
111 | });
112 | };
113 |
114 | Plugin.prototype.get = function(){
115 | return this._width;
116 | }
117 |
118 | function _disappear(delay,callback){
119 |
120 | callback = callback || null;
121 |
122 | setTimeout(function(){
123 | $('.progress.skylo .bar').animate({'opacity':0},1000,callback);
124 | },delay);
125 | }
126 |
127 | function _validate(options){
128 |
129 | var prefix = "Skylo: ";
130 |
131 | if(options.initialBurst > 100 || options.initialBurst <0){
132 | $.error(prefix + 'Initial Burst must range from 0 to 100');
133 | }
134 |
135 | if(options.state !== 'info' && options.state !== 'success' && options.state !== 'danger' && options.state !== 'warning' && options.state !== 'primary' && options.state !== 'default'){
136 | $.error(prefix + 'Invalid state. Please choose one of these states: ["info","success","danger","warning"]');
137 | }
138 |
139 | }
140 |
141 |
142 | // A really lightweight plugin wrapper around the constructor,
143 | // preventing against multiple instantiations
144 | $.skylo = function ( options ) {
145 | var _arguments = arguments;
146 | var retVal = null;
147 |
148 | if (!$.data(document, 'plugin_' + pluginName)) {
149 | $.data(document, 'plugin_' + pluginName,
150 | new Plugin( options ));
151 | }
152 |
153 | var data = $.data(document, 'plugin_'+pluginName);
154 |
155 | if(data[options]){
156 | retVal = data[options].apply(data,Array.prototype.slice.call(_arguments,1));
157 | } else if(typeof options === 'object' || !options){
158 | data.options = $.extend({},data.options,options);
159 | _validate(data.options);
160 | } else {
161 | $.error('Skylo have no such methods');
162 | }
163 |
164 | return retVal;
165 |
166 | }
167 |
168 | })( jQuery, window, document );
169 |
--------------------------------------------------------------------------------
/vendor/styles/skylo.css:
--------------------------------------------------------------------------------
1 | .skylo {
2 | position:fixed;
3 | top: 0;
4 | left: 0;
5 | width: 100%;
6 | background: none;
7 | z-index: 1000;
8 | border-radius: 0;
9 | -webkit-border-radius: 0;
10 | -moz-border-radius: 0;
11 | -ms-border-radius: 0;
12 | }
13 |
14 | .skylo .bar{
15 | width:0%;
16 | height: 5px;
17 | margin:0;
18 | position:relative;
19 | }
20 |
21 | .skylo span{
22 | width:50px;
23 | height: 100%;
24 | display:block;
25 | position:absolute;
26 | top:0;
27 | right:0;
28 | -moz-box-shadow: #0088CC 1px 0 6px 1px;
29 | -ms-box-shadow: #0088CC 1px 0 6px 1px;
30 | -webkit-box-shadow: #0088CC 1px 0 10px 1px;
31 | box-shadow: #0088CC 1px 0 10px 1px;
32 | -moz-border-radius: 50%;
33 | -webkit-border-radius: 50%;
34 | border-radius: 50%;
35 | opacity: 0.6;
36 | }
37 |
38 | .skylo .bar-success span{
39 | -moz-box-shadow: rgb(88,185,87) 1px 0 6px 1px;
40 | -ms-box-shadow: rgb(88,185,87) 1px 0 6px 1px;
41 | -webkit-box-shadow: rgb(88,185,87) 1px 0 10px 1px;
42 | box-shadow: rgb(88,185,87) 1px 0 10px 1px;
43 | }
44 |
45 | .skylo .bar-warning span{
46 | -moz-box-shadow: rgb(242,172,67) 1px 0 6px 1px;
47 | -ms-box-shadow: rgb(242,172,67) 1px 0 6px 1px;
48 | -webkit-box-shadow:rgb(242,172,67) 1px 0 10px 1px;
49 | box-shadow: rgb(242,172,67) 1px 0 10px 1px;
50 | }
51 |
52 | .skylo .bar-danger span{
53 | -moz-box-shadow: rgb(219,82,75) 1px 0 6px 1px;
54 | -ms-box-shadow: rgb(219,82,75) 1px 0 6px 1px;
55 | -webkit-box-shadow:rgb(219,82,75) 1px 0 10px 1px;
56 | box-shadow: rgb(219,82,75) 1px 0 10px 1px;
57 | }
58 |
--------------------------------------------------------------------------------