| @@ -0,0 +1,114 @@ | ||
| /* | ||
| * Social Buttons for Bootstrap | ||
| * | ||
| * Copyright 2013-2014 Panayiotis Lipiridis | ||
| * Licensed under the MIT License | ||
| * | ||
| * https://github.com/lipis/bootstrap-social | ||
| */ | ||
|
|
||
| @bs-height-base: (@line-height-computed + @padding-base-vertical * 2); | ||
| @bs-height-lg: (floor(@font-size-large * @line-height-base) + @padding-large-vertical * 2); | ||
| @bs-height-sm: (floor(@font-size-small * 1.5) + @padding-small-vertical * 2); | ||
| @bs-height-xs: (floor(@font-size-small * 1.2) + @padding-small-vertical + 1); | ||
|
|
||
| .btn-social { | ||
| position: relative; | ||
| padding-left: (@bs-height-base + @padding-base-horizontal); | ||
| text-align: left; | ||
| white-space: nowrap; | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| > :first-child { | ||
| position: absolute; | ||
| left: 0; | ||
| top: 0; | ||
| bottom: 0; | ||
| width: @bs-height-base; | ||
| line-height: (@bs-height-base + 2); | ||
| font-size: 1.6em; | ||
| text-align: center; | ||
| border-right: 1px solid rgba(0, 0, 0, 0.2); | ||
| } | ||
| &.btn-lg { | ||
| padding-left: (@bs-height-lg + @padding-large-horizontal); | ||
| :first-child { | ||
| line-height: @bs-height-lg; | ||
| width: @bs-height-lg; | ||
| font-size: 1.8em; | ||
| } | ||
| } | ||
| &.btn-sm { | ||
| padding-left: (@bs-height-sm + @padding-small-horizontal); | ||
| :first-child { | ||
| line-height: @bs-height-sm; | ||
| width: @bs-height-sm; | ||
| font-size: 1.4em; | ||
| } | ||
| } | ||
| &.btn-xs { | ||
| padding-left: (@bs-height-xs + @padding-small-horizontal); | ||
| :first-child { | ||
| line-height: @bs-height-xs; | ||
| width: @bs-height-xs; | ||
| font-size: 1.2em; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .btn-social-icon { | ||
| .btn-social; | ||
| height: (@bs-height-base + 2); | ||
| width: (@bs-height-base + 2); | ||
| padding: 0; | ||
| :first-child { | ||
| border: none; | ||
| text-align: center; | ||
| width: 100%!important; | ||
| } | ||
| &.btn-lg { | ||
| height: @bs-height-lg; | ||
| width: @bs-height-lg; | ||
| padding-left: 0; | ||
| padding-right: 0; | ||
| } | ||
| &.btn-sm { | ||
| height: (@bs-height-sm + 2); | ||
| width: (@bs-height-sm + 2); | ||
| padding-left: 0; | ||
| padding-right: 0; | ||
| } | ||
| &.btn-xs { | ||
| height: (@bs-height-xs + 2); | ||
| width: (@bs-height-xs + 2); | ||
| padding-left: 0; | ||
| padding-right: 0; | ||
| } | ||
| } | ||
|
|
||
| .btn-social(@color-bg, @color: #fff) { | ||
| background-color: @color-bg; | ||
| .button-variant(@color, @color-bg, rgba(0,0,0,.2)); | ||
| } | ||
|
|
||
|
|
||
| .btn-adn { .btn-social(#d87a68); } | ||
| .btn-bitbucket { .btn-social(#205081); } | ||
| .btn-dropbox { .btn-social(#1087dd); } | ||
| .btn-facebook { .btn-social(#3b5998); } | ||
| .btn-flickr { .btn-social(#ff0084); } | ||
| .btn-foursquare { .btn-social(#f94877); } | ||
| .btn-github { .btn-social(#444444); } | ||
| .btn-google-plus { .btn-social(#dd4b39); } | ||
| .btn-instagram { .btn-social(#3f729b); } | ||
| .btn-linkedin { .btn-social(#007bb6); } | ||
| .btn-microsoft { .btn-social(#2672ec); } | ||
| .btn-openid { .btn-social(#f7931e); } | ||
| .btn-pinterest { .btn-social(#cb2027); } | ||
| .btn-reddit { .btn-social(#eff7ff, #000); } | ||
| .btn-soundcloud { .btn-social(#ff5500); } | ||
| .btn-tumblr { .btn-social(#2c4762); } | ||
| .btn-twitter { .btn-social(#55acee); } | ||
| .btn-vimeo { .btn-social(#1ab7ea); } | ||
| .btn-vk { .btn-social(#587ea3); } | ||
| .btn-yahoo { .btn-social(#720e9e); } |
| @@ -0,0 +1,114 @@ | ||
| /* | ||
| * Social Buttons for Bootstrap | ||
| * | ||
| * Copyright 2013-2014 Panayiotis Lipiridis | ||
| * Licensed under the MIT License | ||
| * | ||
| * https://github.com/lipis/bootstrap-social | ||
| */ | ||
|
|
||
| $bs-height-base: ($line-height-computed + $padding-base-vertical * 2); | ||
| $bs-height-lg: (floor($font-size-large * $line-height-base) + $padding-large-vertical * 2); | ||
| $bs-height-sm: (floor($font-size-small * 1.5) + $padding-small-vertical * 2); | ||
| $bs-height-xs: (floor($font-size-small * 1.2) + $padding-small-vertical + 1); | ||
|
|
||
| .btn-social { | ||
| position: relative; | ||
| padding-left: ($bs-height-base + $padding-base-horizontal); | ||
| text-align: left; | ||
| white-space: nowrap; | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| > :first-child { | ||
| position: absolute; | ||
| left: 0; | ||
| top: 0; | ||
| bottom: 0; | ||
| width: $bs-height-base; | ||
| line-height: ($bs-height-base + 2); | ||
| font-size: 1.6em; | ||
| text-align: center; | ||
| border-right: 1px solid rgba(0, 0, 0, 0.2); | ||
| } | ||
| &.btn-lg { | ||
| padding-left: ($bs-height-lg + $padding-large-horizontal); | ||
| :first-child { | ||
| line-height: $bs-height-lg; | ||
| width: $bs-height-lg; | ||
| font-size: 1.8em; | ||
| } | ||
| } | ||
| &.btn-sm { | ||
| padding-left: ($bs-height-sm + $padding-small-horizontal); | ||
| :first-child { | ||
| line-height: $bs-height-sm; | ||
| width: $bs-height-sm; | ||
| font-size: 1.4em; | ||
| } | ||
| } | ||
| &.btn-xs { | ||
| padding-left: ($bs-height-xs + $padding-small-horizontal); | ||
| :first-child { | ||
| line-height: $bs-height-xs; | ||
| width: $bs-height-xs; | ||
| font-size: 1.2em; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .btn-social-icon { | ||
| @extend .btn-social; | ||
| height: ($bs-height-base + 2); | ||
| width: ($bs-height-base + 2); | ||
| padding: 0; | ||
| :first-child { | ||
| border: none; | ||
| text-align: center; | ||
| width: 100%!important; | ||
| } | ||
| &.btn-lg { | ||
| height: $bs-height-lg; | ||
| width: $bs-height-lg; | ||
| padding-left: 0; | ||
| padding-right: 0; | ||
| } | ||
| &.btn-sm { | ||
| height: ($bs-height-sm + 2); | ||
| width: ($bs-height-sm + 2); | ||
| padding-left: 0; | ||
| padding-right: 0; | ||
| } | ||
| &.btn-xs { | ||
| height: ($bs-height-xs + 2); | ||
| width: ($bs-height-xs + 2); | ||
| padding-left: 0; | ||
| padding-right: 0; | ||
| } | ||
| } | ||
|
|
||
| @mixin btn-social($color-bg, $color: #fff) { | ||
| background-color: $color-bg; | ||
| @include button-variant($color, $color-bg, rgba(0,0,0,.2)); | ||
| } | ||
|
|
||
|
|
||
| .btn-adn { @include btn-social(#d87a68); } | ||
| .btn-bitbucket { @include btn-social(#205081); } | ||
| .btn-dropbox { @include btn-social(#1087dd); } | ||
| .btn-facebook { @include btn-social(#3b5998); } | ||
| .btn-flickr { @include btn-social(#ff0084); } | ||
| .btn-foursquare { @include btn-social(#f94877); } | ||
| .btn-github { @include btn-social(#444444); } | ||
| .btn-google-plus { @include btn-social(#dd4b39); } | ||
| .btn-instagram { @include btn-social(#3f729b); } | ||
| .btn-linkedin { @include btn-social(#007bb6); } | ||
| .btn-microsoft { @include btn-social(#2672ec); } | ||
| .btn-openid { @include btn-social(#f7931e); } | ||
| .btn-pinterest { @include btn-social(#cb2027); } | ||
| .btn-reddit { @include btn-social(#eff7ff, #000); } | ||
| .btn-soundcloud { @include btn-social(#ff5500); } | ||
| .btn-tumblr { @include btn-social(#2c4762); } | ||
| .btn-twitter { @include btn-social(#55acee); } | ||
| .btn-vimeo { @include btn-social(#1ab7ea); } | ||
| .btn-vk { @include btn-social(#587ea3); } | ||
| .btn-yahoo { @include btn-social(#720e9e); } |
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "name": "bootstrap-social", | ||
| "main": "bootstrap-social.css", | ||
| "licence": "MIT", | ||
| "ignore": [ | ||
| "assets", | ||
| "index.html", | ||
| "LICENCE" | ||
| ], | ||
| "dependencies": { | ||
| "bootstrap": "~3", | ||
| "font-awesome": "~4.2" | ||
| } | ||
| } |
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "name": "bootstrap", | ||
| "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", | ||
| "version": "3.3.2", | ||
| "keywords": [ | ||
| "css", | ||
| "js", | ||
| "less", | ||
| "mobile-first", | ||
| "responsive", | ||
| "front-end", | ||
| "framework", | ||
| "web" | ||
| ], | ||
| "homepage": "http://getbootstrap.com", | ||
| "main": [ | ||
| "less/bootstrap.less", | ||
| "dist/css/bootstrap.css", | ||
| "dist/js/bootstrap.js", | ||
| "dist/fonts/glyphicons-halflings-regular.eot", | ||
| "dist/fonts/glyphicons-halflings-regular.svg", | ||
| "dist/fonts/glyphicons-halflings-regular.ttf", | ||
| "dist/fonts/glyphicons-halflings-regular.woff" | ||
| ], | ||
| "ignore": [ | ||
| "/.*", | ||
| "_config.yml", | ||
| "CNAME", | ||
| "composer.json", | ||
| "CONTRIBUTING.md", | ||
| "docs", | ||
| "js/tests", | ||
| "test-infra" | ||
| ], | ||
| "dependencies": { | ||
| "jquery": ">= 1.9.1" | ||
| }, | ||
| "_release": "3.3.2", | ||
| "_resolution": { | ||
| "type": "version", | ||
| "tag": "v3.3.2", | ||
| "commit": "bcf7dd38b5ab180256e2e4fb5da0369551b3f082" | ||
| }, | ||
| "_source": "git://github.com/twbs/bootstrap.git", | ||
| "_target": "~3.3.1", | ||
| "_originalSource": "bootstrap" | ||
| } |
| @@ -0,0 +1,21 @@ | ||
| The MIT License (MIT) | ||
|
|
||
| Copyright (c) 2011-2015 Twitter, Inc | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. |
| @@ -0,0 +1,132 @@ | ||
| # [Bootstrap](http://getbootstrap.com) | ||
|  | ||
| [](https://www.npmjs.com/package/bootstrap) | ||
| [](https://travis-ci.org/twbs/bootstrap) | ||
| [](https://david-dm.org/twbs/bootstrap#info=devDependencies) | ||
| [](https://saucelabs.com/u/bootstrap) | ||
|
|
||
| Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thornton](https://twitter.com/fat), and maintained by the [core team](https://github.com/orgs/twbs/people) with the massive support and involvement of the community. | ||
|
|
||
| To get started, check out <http://getbootstrap.com>! | ||
|
|
||
| ## Table of contents | ||
|
|
||
| - [Quick start](#quick-start) | ||
| - [Bugs and feature requests](#bugs-and-feature-requests) | ||
| - [Documentation](#documentation) | ||
| - [Contributing](#contributing) | ||
| - [Community](#community) | ||
| - [Versioning](#versioning) | ||
| - [Creators](#creators) | ||
| - [Copyright and license](#copyright-and-license) | ||
|
|
||
| ## Quick start | ||
|
|
||
| Four quick start options are available: | ||
|
|
||
| - [Download the latest release](https://github.com/twbs/bootstrap/archive/v3.3.2.zip). | ||
| - Clone the repo: `git clone https://github.com/twbs/bootstrap.git`. | ||
| - Install with [Bower](http://bower.io): `bower install bootstrap`. | ||
| - Install with [npm](https://www.npmjs.org): `npm install bootstrap`. | ||
|
|
||
| Read the [Getting started page](http://getbootstrap.com/getting-started/) for information on the framework contents, templates and examples, and more. | ||
|
|
||
| ### What's included | ||
|
|
||
| Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this: | ||
|
|
||
| ``` | ||
| bootstrap/ | ||
| ├── css/ | ||
| │ ├── bootstrap.css | ||
| │ ├── bootstrap.css.map | ||
| │ ├── bootstrap.min.css | ||
| │ ├── bootstrap-theme.css | ||
| │ ├── bootstrap-theme.css.map | ||
| │ └── bootstrap-theme.min.css | ||
| ├── js/ | ||
| │ ├── bootstrap.js | ||
| │ └── bootstrap.min.js | ||
| └── fonts/ | ||
| ├── glyphicons-halflings-regular.eot | ||
| ├── glyphicons-halflings-regular.svg | ||
| ├── glyphicons-halflings-regular.ttf | ||
| ├── glyphicons-halflings-regular.woff | ||
| └── glyphicons-halflings-regular.woff2 | ||
| ``` | ||
|
|
||
| We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified CSS and JS (`bootstrap.min.*`). CSS [source maps](https://developers.google.com/chrome-developer-tools/docs/css-preprocessors) (`bootstrap.*.map`) are available for use with certain browsers' developer tools. Fonts from Glyphicons are included, as is the optional Bootstrap theme. | ||
|
|
||
|
|
||
|
|
||
| ## Bugs and feature requests | ||
|
|
||
| Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/twbs/bootstrap/issues/new). | ||
|
|
||
|
|
||
| ## Documentation | ||
|
|
||
| Bootstrap's documentation, included in this repo in the root directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at <http://getbootstrap.com>. The docs may also be run locally. | ||
|
|
||
| ### Running documentation locally | ||
|
|
||
| 1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation) (requires v2.5.x). | ||
| - **Windows users:** Read [this unofficial guide](http://jekyll-windows.juthilo.com/) to get Jekyll up and running without problems. | ||
| 2. Install the Ruby-based syntax highlighter, [Rouge](https://github.com/jneen/rouge), with `gem install rouge`. | ||
| 3. From the root `/bootstrap` directory, run `jekyll serve` in the command line. | ||
| 4. Open <http://localhost:9001> in your browser, and voilĂ . | ||
|
|
||
| Learn more about using Jekyll by reading its [documentation](http://jekyllrb.com/docs/home/). | ||
|
|
||
| ### Documentation for previous releases | ||
|
|
||
| Documentation for v2.3.2 has been made available for the time being at <http://getbootstrap.com/2.3.2/> while folks transition to Bootstrap 3. | ||
|
|
||
| [Previous releases](https://github.com/twbs/bootstrap/releases) and their documentation are also available for download. | ||
|
|
||
|
|
||
|
|
||
| ## Contributing | ||
|
|
||
| Please read through our [contributing guidelines](https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development. | ||
|
|
||
| Moreover, if your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the [Code Guide](https://github.com/mdo/code-guide), maintained by [Mark Otto](https://github.com/mdo). | ||
|
|
||
| Editor preferences are available in the [editor config](https://github.com/twbs/bootstrap/blob/master/.editorconfig) for easy use in common text editors. Read more and download plugins at <http://editorconfig.org>. | ||
|
|
||
|
|
||
|
|
||
| ## Community | ||
|
|
||
| Keep track of development and community news. | ||
|
|
||
| - Follow [@twbootstrap on Twitter](https://twitter.com/twbootstrap). | ||
| - Read and subscribe to [The Official Bootstrap Blog](http://blog.getbootstrap.com). | ||
| - Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel. | ||
| - Implementation help may be found at Stack Overflow (tagged [`twitter-bootstrap-3`](http://stackoverflow.com/questions/tagged/twitter-bootstrap-3)). | ||
|
|
||
|
|
||
|
|
||
| ## Versioning | ||
|
|
||
| For transparency into our release cycle and in striving to maintain backward compatibility, Bootstrap is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we'll adhere to those rules whenever possible. | ||
|
|
||
|
|
||
|
|
||
| ## Creators | ||
|
|
||
| **Mark Otto** | ||
|
|
||
| - <https://twitter.com/mdo> | ||
| - <https://github.com/mdo> | ||
|
|
||
| **Jacob Thornton** | ||
|
|
||
| - <https://twitter.com/fat> | ||
| - <https://github.com/fat> | ||
|
|
||
|
|
||
|
|
||
| ## Copyright and license | ||
|
|
||
| Code and documentation copyright 2011-2015 Twitter, Inc. Code released under [the MIT license](https://github.com/twbs/bootstrap/blob/master/LICENSE). Docs released under [Creative Commons](https://github.com/twbs/bootstrap/blob/master/docs/LICENSE). |
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "name": "bootstrap", | ||
| "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", | ||
| "version": "3.3.2", | ||
| "keywords": [ | ||
| "css", | ||
| "js", | ||
| "less", | ||
| "mobile-first", | ||
| "responsive", | ||
| "front-end", | ||
| "framework", | ||
| "web" | ||
| ], | ||
| "homepage": "http://getbootstrap.com", | ||
| "main": [ | ||
| "less/bootstrap.less", | ||
| "dist/css/bootstrap.css", | ||
| "dist/js/bootstrap.js", | ||
| "dist/fonts/glyphicons-halflings-regular.eot", | ||
| "dist/fonts/glyphicons-halflings-regular.svg", | ||
| "dist/fonts/glyphicons-halflings-regular.ttf", | ||
| "dist/fonts/glyphicons-halflings-regular.woff" | ||
| ], | ||
| "ignore": [ | ||
| "/.*", | ||
| "_config.yml", | ||
| "CNAME", | ||
| "composer.json", | ||
| "CONTRIBUTING.md", | ||
| "docs", | ||
| "js/tests", | ||
| "test-infra" | ||
| ], | ||
| "dependencies": { | ||
| "jquery": ">= 1.9.1" | ||
| } | ||
| } |
| @@ -0,0 +1,13 @@ | ||
| // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. | ||
| require('../../js/transition.js') | ||
| require('../../js/alert.js') | ||
| require('../../js/button.js') | ||
| require('../../js/carousel.js') | ||
| require('../../js/collapse.js') | ||
| require('../../js/dropdown.js') | ||
| require('../../js/modal.js') | ||
| require('../../js/tooltip.js') | ||
| require('../../js/popover.js') | ||
| require('../../js/scrollspy.js') | ||
| require('../../js/tab.js') | ||
| require('../../js/affix.js') |
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "extends" : "../js/.jshintrc", | ||
| "asi" : false, | ||
| "browser" : false, | ||
| "es3" : false, | ||
| "node" : true | ||
| } |
| @@ -0,0 +1,23 @@ | ||
| 'use strict'; | ||
| var fs = require('fs'); | ||
| var path = require('path'); | ||
|
|
||
| var COMMONJS_BANNER = '// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.\n'; | ||
|
|
||
| module.exports = function generateCommonJSModule(grunt, srcFiles, destFilepath) { | ||
| var destDir = path.dirname(destFilepath); | ||
|
|
||
| function srcPathToDestRequire(srcFilepath) { | ||
| var requirePath = path.relative(destDir, srcFilepath).replace(/\\/g, '/'); | ||
| return 'require(\'' + requirePath + '\')'; | ||
| } | ||
|
|
||
| var moduleOutputJs = COMMONJS_BANNER + srcFiles.map(srcPathToDestRequire).join('\n'); | ||
| try { | ||
| fs.writeFileSync(destFilepath, moduleOutputJs); | ||
| } | ||
| catch (err) { | ||
| grunt.fail.warn(err); | ||
| } | ||
| grunt.log.writeln('File ' + destFilepath.cyan + ' created.'); | ||
| }; |
| @@ -0,0 +1,41 @@ | ||
| /*! | ||
| * Bootstrap Grunt task for Glyphicons data generation | ||
| * http://getbootstrap.com | ||
| * Copyright 2014 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| */ | ||
| 'use strict'; | ||
| var fs = require('fs'); | ||
|
|
||
| module.exports = function generateGlyphiconsData(grunt) { | ||
| // Pass encoding, utf8, so `readFileSync` will return a string instead of a | ||
| // buffer | ||
| var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8'); | ||
| var glyphiconsLines = glyphiconsFile.split('\n'); | ||
|
|
||
| // Use any line that starts with ".glyphicon-" and capture the class name | ||
| var iconClassName = /^\.(glyphicon-[a-zA-Z0-9-]+)/; | ||
| var glyphiconsData = '# This file is generated via Grunt task. **Do not edit directly.**\n' + | ||
| '# See the \'build-glyphicons-data\' task in Gruntfile.js.\n\n'; | ||
| var glyphiconsYml = 'docs/_data/glyphicons.yml'; | ||
| for (var i = 0, len = glyphiconsLines.length; i < len; i++) { | ||
| var match = glyphiconsLines[i].match(iconClassName); | ||
|
|
||
| if (match !== null) { | ||
| glyphiconsData += '- ' + match[1] + '\n'; | ||
| } | ||
| } | ||
|
|
||
| // Create the `_data` directory if it doesn't already exist | ||
| if (!fs.existsSync('docs/_data')) { | ||
| fs.mkdirSync('docs/_data'); | ||
| } | ||
|
|
||
| try { | ||
| fs.writeFileSync(glyphiconsYml, glyphiconsData); | ||
| } | ||
| catch (err) { | ||
| grunt.fail.warn(err); | ||
| } | ||
| grunt.log.writeln('File ' + glyphiconsYml.cyan + ' created.'); | ||
| }; |
| @@ -0,0 +1,238 @@ | ||
| /*! | ||
| * Bootstrap Grunt task for parsing Less docstrings | ||
| * http://getbootstrap.com | ||
| * Copyright 2014 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| */ | ||
| 'use strict'; | ||
|
|
||
| var Remarkable = require('remarkable'); | ||
|
|
||
| function markdown2html(markdownString) { | ||
| var md = new Remarkable(); | ||
|
|
||
| // the slice removes the <p>...</p> wrapper output by Markdown processor | ||
| return md.render(markdownString.trim()).slice(3, -5); | ||
| } | ||
|
|
||
|
|
||
| /* | ||
| Mini-language: | ||
| //== This is a normal heading, which starts a section. Sections group variables together. | ||
| //## Optional description for the heading | ||
| //=== This is a subheading. | ||
| //** Optional description for the following variable. You **can** use Markdown in descriptions to discuss `<html>` stuff. | ||
| @foo: #fff; | ||
| //-- This is a heading for a section whose variables shouldn't be customizable | ||
| All other lines are ignored completely. | ||
| */ | ||
|
|
||
|
|
||
| var CUSTOMIZABLE_HEADING = /^[/]{2}={2}(.*)$/; | ||
| var UNCUSTOMIZABLE_HEADING = /^[/]{2}-{2}(.*)$/; | ||
| var SUBSECTION_HEADING = /^[/]{2}={3}(.*)$/; | ||
| var SECTION_DOCSTRING = /^[/]{2}#{2}(.+)$/; | ||
| var VAR_ASSIGNMENT = /^(@[a-zA-Z0-9_-]+):[ ]*([^ ;][^;]*);[ ]*$/; | ||
| var VAR_DOCSTRING = /^[/]{2}[*]{2}(.+)$/; | ||
|
|
||
| function Section(heading, customizable) { | ||
| this.heading = heading.trim(); | ||
| this.id = this.heading.replace(/\s+/g, '-').toLowerCase(); | ||
| this.customizable = customizable; | ||
| this.docstring = null; | ||
| this.subsections = []; | ||
| } | ||
|
|
||
| Section.prototype.addSubSection = function (subsection) { | ||
| this.subsections.push(subsection); | ||
| }; | ||
|
|
||
| function SubSection(heading) { | ||
| this.heading = heading.trim(); | ||
| this.id = this.heading.replace(/\s+/g, '-').toLowerCase(); | ||
| this.variables = []; | ||
| } | ||
|
|
||
| SubSection.prototype.addVar = function (variable) { | ||
| this.variables.push(variable); | ||
| }; | ||
|
|
||
| function VarDocstring(markdownString) { | ||
| this.html = markdown2html(markdownString); | ||
| } | ||
|
|
||
| function SectionDocstring(markdownString) { | ||
| this.html = markdown2html(markdownString); | ||
| } | ||
|
|
||
| function Variable(name, defaultValue) { | ||
| this.name = name; | ||
| this.defaultValue = defaultValue; | ||
| this.docstring = null; | ||
| } | ||
|
|
||
| function Tokenizer(fileContent) { | ||
| this._lines = fileContent.split('\n'); | ||
| this._next = undefined; | ||
| } | ||
|
|
||
| Tokenizer.prototype.unshift = function (token) { | ||
| if (this._next !== undefined) { | ||
| throw new Error('Attempted to unshift twice!'); | ||
| } | ||
| this._next = token; | ||
| }; | ||
|
|
||
| Tokenizer.prototype._shift = function () { | ||
| // returning null signals EOF | ||
| // returning undefined means the line was ignored | ||
| if (this._next !== undefined) { | ||
| var result = this._next; | ||
| this._next = undefined; | ||
| return result; | ||
| } | ||
| if (this._lines.length <= 0) { | ||
| return null; | ||
| } | ||
| var line = this._lines.shift(); | ||
| var match = null; | ||
| match = SUBSECTION_HEADING.exec(line); | ||
| if (match !== null) { | ||
| return new SubSection(match[1]); | ||
| } | ||
| match = CUSTOMIZABLE_HEADING.exec(line); | ||
| if (match !== null) { | ||
| return new Section(match[1], true); | ||
| } | ||
| match = UNCUSTOMIZABLE_HEADING.exec(line); | ||
| if (match !== null) { | ||
| return new Section(match[1], false); | ||
| } | ||
| match = SECTION_DOCSTRING.exec(line); | ||
| if (match !== null) { | ||
| return new SectionDocstring(match[1]); | ||
| } | ||
| match = VAR_DOCSTRING.exec(line); | ||
| if (match !== null) { | ||
| return new VarDocstring(match[1]); | ||
| } | ||
| var commentStart = line.lastIndexOf('//'); | ||
| var varLine = (commentStart === -1) ? line : line.slice(0, commentStart); | ||
| match = VAR_ASSIGNMENT.exec(varLine); | ||
| if (match !== null) { | ||
| return new Variable(match[1], match[2]); | ||
| } | ||
| return undefined; | ||
| }; | ||
|
|
||
| Tokenizer.prototype.shift = function () { | ||
| while (true) { | ||
| var result = this._shift(); | ||
| if (result === undefined) { | ||
| continue; | ||
| } | ||
| return result; | ||
| } | ||
| }; | ||
|
|
||
| function Parser(fileContent) { | ||
| this._tokenizer = new Tokenizer(fileContent); | ||
| } | ||
|
|
||
| Parser.prototype.parseFile = function () { | ||
| var sections = []; | ||
| while (true) { | ||
| var section = this.parseSection(); | ||
| if (section === null) { | ||
| if (this._tokenizer.shift() !== null) { | ||
| throw new Error('Unexpected unparsed section of file remains!'); | ||
| } | ||
| return sections; | ||
| } | ||
| sections.push(section); | ||
| } | ||
| }; | ||
|
|
||
| Parser.prototype.parseSection = function () { | ||
| var section = this._tokenizer.shift(); | ||
| if (section === null) { | ||
| return null; | ||
| } | ||
| if (!(section instanceof Section)) { | ||
| throw new Error('Expected section heading; got: ' + JSON.stringify(section)); | ||
| } | ||
| var docstring = this._tokenizer.shift(); | ||
| if (docstring instanceof SectionDocstring) { | ||
| section.docstring = docstring; | ||
| } | ||
| else { | ||
| this._tokenizer.unshift(docstring); | ||
| } | ||
| this.parseSubSections(section); | ||
|
|
||
| return section; | ||
| }; | ||
|
|
||
| Parser.prototype.parseSubSections = function (section) { | ||
| while (true) { | ||
| var subsection = this.parseSubSection(); | ||
| if (subsection === null) { | ||
| if (section.subsections.length === 0) { | ||
| // Presume an implicit initial subsection | ||
| subsection = new SubSection(''); | ||
| this.parseVars(subsection); | ||
| } | ||
| else { | ||
| break; | ||
| } | ||
| } | ||
| section.addSubSection(subsection); | ||
| } | ||
|
|
||
| if (section.subsections.length === 1 && !(section.subsections[0].heading) && section.subsections[0].variables.length === 0) { | ||
| // Ignore lone empty implicit subsection | ||
| section.subsections = []; | ||
| } | ||
| }; | ||
|
|
||
| Parser.prototype.parseSubSection = function () { | ||
| var subsection = this._tokenizer.shift(); | ||
| if (subsection instanceof SubSection) { | ||
| this.parseVars(subsection); | ||
| return subsection; | ||
| } | ||
| this._tokenizer.unshift(subsection); | ||
| return null; | ||
| }; | ||
|
|
||
| Parser.prototype.parseVars = function (subsection) { | ||
| while (true) { | ||
| var variable = this.parseVar(); | ||
| if (variable === null) { | ||
| return; | ||
| } | ||
| subsection.addVar(variable); | ||
| } | ||
| }; | ||
|
|
||
| Parser.prototype.parseVar = function () { | ||
| var docstring = this._tokenizer.shift(); | ||
| if (!(docstring instanceof VarDocstring)) { | ||
| this._tokenizer.unshift(docstring); | ||
| docstring = null; | ||
| } | ||
| var variable = this._tokenizer.shift(); | ||
| if (variable instanceof Variable) { | ||
| variable.docstring = docstring; | ||
| return variable; | ||
| } | ||
| this._tokenizer.unshift(variable); | ||
| return null; | ||
| }; | ||
|
|
||
|
|
||
| module.exports = Parser; |
| @@ -0,0 +1,46 @@ | ||
| /*! | ||
| * Bootstrap Grunt task for generating raw-files.min.js for the Customizer | ||
| * http://getbootstrap.com | ||
| * Copyright 2014 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| */ | ||
|
|
||
| /* global btoa: true */ | ||
|
|
||
| 'use strict'; | ||
| var fs = require('fs'); | ||
| var btoa = require('btoa'); | ||
| var glob = require('glob'); | ||
|
|
||
| function getFiles(type) { | ||
| var files = {}; | ||
| var recursive = (type === 'less'); | ||
| var globExpr = (recursive ? '/**/*' : '/*'); | ||
| glob.sync(type + globExpr) | ||
| .filter(function (path) { | ||
| return type === 'fonts' ? true : new RegExp('\\.' + type + '$').test(path); | ||
| }) | ||
| .forEach(function (fullPath) { | ||
| var relativePath = fullPath.replace(/^[^/]+\//, ''); | ||
| files[relativePath] = (type === 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8')); | ||
| }); | ||
| return 'var __' + type + ' = ' + JSON.stringify(files) + '\n'; | ||
| } | ||
|
|
||
| module.exports = function generateRawFilesJs(grunt, banner) { | ||
| if (!banner) { | ||
| banner = ''; | ||
| } | ||
| var dirs = ['js', 'less', 'fonts']; | ||
| var files = banner + dirs.map(getFiles).reduce(function (combined, file) { | ||
| return combined + file; | ||
| }, ''); | ||
| var rawFilesJs = 'docs/assets/js/raw-files.min.js'; | ||
| try { | ||
| fs.writeFileSync(rawFilesJs, files); | ||
| } | ||
| catch (err) { | ||
| grunt.fail.warn(err); | ||
| } | ||
| grunt.log.writeln('File ' + rawFilesJs.cyan + ' created.'); | ||
| }; |
| @@ -0,0 +1,45 @@ | ||
| { | ||
| "paths": { | ||
| "customizerJs": [ | ||
| "../assets/js/vendor/autoprefixer.js", | ||
| "../assets/js/vendor/less.min.js", | ||
| "../assets/js/vendor/jszip.min.js", | ||
| "../assets/js/vendor/uglify.min.js", | ||
| "../assets/js/vendor/Blob.js", | ||
| "../assets/js/vendor/FileSaver.js", | ||
| "../assets/js/raw-files.min.js", | ||
| "../assets/js/src/customizer.js" | ||
| ], | ||
| "docsJs": [ | ||
| "../assets/js/vendor/holder.js", | ||
| "../assets/js/vendor/ZeroClipboard.min.js", | ||
| "../assets/js/src/application.js" | ||
| ] | ||
| }, | ||
| "config": { | ||
| "autoprefixerBrowsers": [ | ||
| "Android 2.3", | ||
| "Android >= 4", | ||
| "Chrome >= 20", | ||
| "Firefox >= 24", | ||
| "Explorer >= 8", | ||
| "iOS >= 6", | ||
| "Opera >= 12", | ||
| "Safari >= 6" | ||
| ], | ||
| "jqueryCheck": [ | ||
| "if (typeof jQuery === 'undefined') {", | ||
| " throw new Error('Bootstrap\\'s JavaScript requires jQuery')", | ||
| "}\n" | ||
| ], | ||
| "jqueryVersionCheck": [ | ||
| "+function ($) {", | ||
| " 'use strict';", | ||
| " var version = $.fn.jquery.split(' ')[0].split('.')", | ||
| " if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {", | ||
| " throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher')", | ||
| " }", | ||
| "}(jQuery);\n\n" | ||
| ] | ||
| } | ||
| } |
| @@ -0,0 +1,82 @@ | ||
| [ | ||
| # Docs: https://saucelabs.com/docs/platforms/webdriver | ||
|
|
||
| { | ||
| browserName: "safari", | ||
| platform: "OS X 10.10" | ||
| }, | ||
| { | ||
| browserName: "chrome", | ||
| platform: "OS X 10.10" | ||
| }, | ||
| { | ||
| browserName: "firefox", | ||
| platform: "OS X 10.10" | ||
| }, | ||
|
|
||
| # Mac Opera not currently supported by Sauce Labs | ||
|
|
||
| { | ||
| browserName: "internet explorer", | ||
| version: "11", | ||
| platform: "Windows 8.1" | ||
| }, | ||
| { | ||
| browserName: "internet explorer", | ||
| version: "10", | ||
| platform: "Windows 8" | ||
| }, | ||
| { | ||
| browserName: "internet explorer", | ||
| version: "9", | ||
| platform: "Windows 7" | ||
| }, | ||
| { | ||
| browserName: "internet explorer", | ||
| version: "8", | ||
| platform: "Windows 7" | ||
| }, | ||
|
|
||
| # { # Unofficial | ||
| # browserName: "internet explorer", | ||
| # version: "7", | ||
| # platform: "Windows XP" | ||
| # }, | ||
|
|
||
| { | ||
| browserName: "chrome", | ||
| platform: "Windows 8.1" | ||
| }, | ||
| { | ||
| browserName: "firefox", | ||
| platform: "Windows 8.1" | ||
| }, | ||
|
|
||
| # Win Opera 15+ not currently supported by Sauce Labs | ||
|
|
||
| { | ||
| browserName: "iphone", | ||
| platform: "OS X 10.9", | ||
| version: "8.1" | ||
| }, | ||
|
|
||
| # iOS Chrome not currently supported by Sauce Labs | ||
|
|
||
| # Linux (unofficial) | ||
| { | ||
| browserName: "chrome", | ||
| platform: "Linux" | ||
| }, | ||
| { | ||
| browserName: "firefox", | ||
| platform: "Linux" | ||
| } | ||
|
|
||
| # Android Chrome not currently supported by Sauce Labs | ||
|
|
||
| # { # Android Browser (super-unofficial) | ||
| # browserName: "android", | ||
| # version: "4.0", | ||
| # platform: "Linux" | ||
| # } | ||
| ] |
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "disallowEmptyBlocks": true, | ||
| "disallowKeywords": ["with"], | ||
| "disallowMixedSpacesAndTabs": true, | ||
| "disallowMultipleLineStrings": true, | ||
| "disallowMultipleVarDecl": true, | ||
| "disallowQuotedKeysInObjects": "allButReserved", | ||
| "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], | ||
| "disallowSpaceBeforeBinaryOperators": [","], | ||
| "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], | ||
| "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, | ||
| "disallowSpacesInsideArrayBrackets": true, | ||
| "disallowSpacesInsideParentheses": true, | ||
| "disallowTrailingComma": true, | ||
| "disallowTrailingWhitespace": true, | ||
| "requireCamelCaseOrUpperCaseIdentifiers": true, | ||
| "requireCapitalizedConstructors": true, | ||
| "requireCommaBeforeLineBreak": true, | ||
| "requireDotNotation": true, | ||
| "requireLineFeedAtFileEnd": true, | ||
| "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], | ||
| "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], | ||
| "requireSpaceAfterLineComment": true, | ||
| "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], | ||
| "requireSpaceBetweenArguments": true, | ||
| "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true }, | ||
| "requireSpacesInConditionalExpression": true, | ||
| "requireSpacesInForStatement": true, | ||
| "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, | ||
| "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, | ||
| "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, | ||
| "requireSpacesInsideObjectBrackets": "allButNested", | ||
| "validateIndentation": 2, | ||
| "validateLineBreaks": "LF", | ||
| "validateQuoteMarks": "'" | ||
| } |
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "asi" : true, | ||
| "browser" : true, | ||
| "eqeqeq" : false, | ||
| "eqnull" : true, | ||
| "es3" : true, | ||
| "expr" : true, | ||
| "jquery" : true, | ||
| "latedef" : true, | ||
| "laxbreak" : true, | ||
| "nonbsp" : true, | ||
| "strict" : true, | ||
| "undef" : true, | ||
| "unused" : true | ||
| } |
| @@ -0,0 +1,162 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: affix.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#affix | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // AFFIX CLASS DEFINITION | ||
| // ====================== | ||
|
|
||
| var Affix = function (element, options) { | ||
| this.options = $.extend({}, Affix.DEFAULTS, options) | ||
|
|
||
| this.$target = $(this.options.target) | ||
| .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) | ||
| .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) | ||
|
|
||
| this.$element = $(element) | ||
| this.affixed = | ||
| this.unpin = | ||
| this.pinnedOffset = null | ||
|
|
||
| this.checkPosition() | ||
| } | ||
|
|
||
| Affix.VERSION = '3.3.2' | ||
|
|
||
| Affix.RESET = 'affix affix-top affix-bottom' | ||
|
|
||
| Affix.DEFAULTS = { | ||
| offset: 0, | ||
| target: window | ||
| } | ||
|
|
||
| Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { | ||
| var scrollTop = this.$target.scrollTop() | ||
| var position = this.$element.offset() | ||
| var targetHeight = this.$target.height() | ||
|
|
||
| if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false | ||
|
|
||
| if (this.affixed == 'bottom') { | ||
| if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom' | ||
| return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' | ||
| } | ||
|
|
||
| var initializing = this.affixed == null | ||
| var colliderTop = initializing ? scrollTop : position.top | ||
| var colliderHeight = initializing ? targetHeight : height | ||
|
|
||
| if (offsetTop != null && scrollTop <= offsetTop) return 'top' | ||
| if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom' | ||
|
|
||
| return false | ||
| } | ||
|
|
||
| Affix.prototype.getPinnedOffset = function () { | ||
| if (this.pinnedOffset) return this.pinnedOffset | ||
| this.$element.removeClass(Affix.RESET).addClass('affix') | ||
| var scrollTop = this.$target.scrollTop() | ||
| var position = this.$element.offset() | ||
| return (this.pinnedOffset = position.top - scrollTop) | ||
| } | ||
|
|
||
| Affix.prototype.checkPositionWithEventLoop = function () { | ||
| setTimeout($.proxy(this.checkPosition, this), 1) | ||
| } | ||
|
|
||
| Affix.prototype.checkPosition = function () { | ||
| if (!this.$element.is(':visible')) return | ||
|
|
||
| var height = this.$element.height() | ||
| var offset = this.options.offset | ||
| var offsetTop = offset.top | ||
| var offsetBottom = offset.bottom | ||
| var scrollHeight = $('body').height() | ||
|
|
||
| if (typeof offset != 'object') offsetBottom = offsetTop = offset | ||
| if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) | ||
| if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) | ||
|
|
||
| var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom) | ||
|
|
||
| if (this.affixed != affix) { | ||
| if (this.unpin != null) this.$element.css('top', '') | ||
|
|
||
| var affixType = 'affix' + (affix ? '-' + affix : '') | ||
| var e = $.Event(affixType + '.bs.affix') | ||
|
|
||
| this.$element.trigger(e) | ||
|
|
||
| if (e.isDefaultPrevented()) return | ||
|
|
||
| this.affixed = affix | ||
| this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null | ||
|
|
||
| this.$element | ||
| .removeClass(Affix.RESET) | ||
| .addClass(affixType) | ||
| .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') | ||
| } | ||
|
|
||
| if (affix == 'bottom') { | ||
| this.$element.offset({ | ||
| top: scrollHeight - height - offsetBottom | ||
| }) | ||
| } | ||
| } | ||
|
|
||
|
|
||
| // AFFIX PLUGIN DEFINITION | ||
| // ======================= | ||
|
|
||
| function Plugin(option) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.affix') | ||
| var options = typeof option == 'object' && option | ||
|
|
||
| if (!data) $this.data('bs.affix', (data = new Affix(this, options))) | ||
| if (typeof option == 'string') data[option]() | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.affix | ||
|
|
||
| $.fn.affix = Plugin | ||
| $.fn.affix.Constructor = Affix | ||
|
|
||
|
|
||
| // AFFIX NO CONFLICT | ||
| // ================= | ||
|
|
||
| $.fn.affix.noConflict = function () { | ||
| $.fn.affix = old | ||
| return this | ||
| } | ||
|
|
||
|
|
||
| // AFFIX DATA-API | ||
| // ============== | ||
|
|
||
| $(window).on('load', function () { | ||
| $('[data-spy="affix"]').each(function () { | ||
| var $spy = $(this) | ||
| var data = $spy.data() | ||
|
|
||
| data.offset = data.offset || {} | ||
|
|
||
| if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom | ||
| if (data.offsetTop != null) data.offset.top = data.offsetTop | ||
|
|
||
| Plugin.call($spy, data) | ||
| }) | ||
| }) | ||
|
|
||
| }(jQuery); |
| @@ -0,0 +1,94 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: alert.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#alerts | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // ALERT CLASS DEFINITION | ||
| // ====================== | ||
|
|
||
| var dismiss = '[data-dismiss="alert"]' | ||
| var Alert = function (el) { | ||
| $(el).on('click', dismiss, this.close) | ||
| } | ||
|
|
||
| Alert.VERSION = '3.3.2' | ||
|
|
||
| Alert.TRANSITION_DURATION = 150 | ||
|
|
||
| Alert.prototype.close = function (e) { | ||
| var $this = $(this) | ||
| var selector = $this.attr('data-target') | ||
|
|
||
| if (!selector) { | ||
| selector = $this.attr('href') | ||
| selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 | ||
| } | ||
|
|
||
| var $parent = $(selector) | ||
|
|
||
| if (e) e.preventDefault() | ||
|
|
||
| if (!$parent.length) { | ||
| $parent = $this.closest('.alert') | ||
| } | ||
|
|
||
| $parent.trigger(e = $.Event('close.bs.alert')) | ||
|
|
||
| if (e.isDefaultPrevented()) return | ||
|
|
||
| $parent.removeClass('in') | ||
|
|
||
| function removeElement() { | ||
| // detach from parent, fire event then clean up data | ||
| $parent.detach().trigger('closed.bs.alert').remove() | ||
| } | ||
|
|
||
| $.support.transition && $parent.hasClass('fade') ? | ||
| $parent | ||
| .one('bsTransitionEnd', removeElement) | ||
| .emulateTransitionEnd(Alert.TRANSITION_DURATION) : | ||
| removeElement() | ||
| } | ||
|
|
||
|
|
||
| // ALERT PLUGIN DEFINITION | ||
| // ======================= | ||
|
|
||
| function Plugin(option) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.alert') | ||
|
|
||
| if (!data) $this.data('bs.alert', (data = new Alert(this))) | ||
| if (typeof option == 'string') data[option].call($this) | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.alert | ||
|
|
||
| $.fn.alert = Plugin | ||
| $.fn.alert.Constructor = Alert | ||
|
|
||
|
|
||
| // ALERT NO CONFLICT | ||
| // ================= | ||
|
|
||
| $.fn.alert.noConflict = function () { | ||
| $.fn.alert = old | ||
| return this | ||
| } | ||
|
|
||
|
|
||
| // ALERT DATA-API | ||
| // ============== | ||
|
|
||
| $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) | ||
|
|
||
| }(jQuery); |
| @@ -0,0 +1,116 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: button.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#buttons | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // BUTTON PUBLIC CLASS DEFINITION | ||
| // ============================== | ||
|
|
||
| var Button = function (element, options) { | ||
| this.$element = $(element) | ||
| this.options = $.extend({}, Button.DEFAULTS, options) | ||
| this.isLoading = false | ||
| } | ||
|
|
||
| Button.VERSION = '3.3.2' | ||
|
|
||
| Button.DEFAULTS = { | ||
| loadingText: 'loading...' | ||
| } | ||
|
|
||
| Button.prototype.setState = function (state) { | ||
| var d = 'disabled' | ||
| var $el = this.$element | ||
| var val = $el.is('input') ? 'val' : 'html' | ||
| var data = $el.data() | ||
|
|
||
| state = state + 'Text' | ||
|
|
||
| if (data.resetText == null) $el.data('resetText', $el[val]()) | ||
|
|
||
| // push to event loop to allow forms to submit | ||
| setTimeout($.proxy(function () { | ||
| $el[val](data[state] == null ? this.options[state] : data[state]) | ||
|
|
||
| if (state == 'loadingText') { | ||
| this.isLoading = true | ||
| $el.addClass(d).attr(d, d) | ||
| } else if (this.isLoading) { | ||
| this.isLoading = false | ||
| $el.removeClass(d).removeAttr(d) | ||
| } | ||
| }, this), 0) | ||
| } | ||
|
|
||
| Button.prototype.toggle = function () { | ||
| var changed = true | ||
| var $parent = this.$element.closest('[data-toggle="buttons"]') | ||
|
|
||
| if ($parent.length) { | ||
| var $input = this.$element.find('input') | ||
| if ($input.prop('type') == 'radio') { | ||
| if ($input.prop('checked') && this.$element.hasClass('active')) changed = false | ||
| else $parent.find('.active').removeClass('active') | ||
| } | ||
| if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') | ||
| } else { | ||
| this.$element.attr('aria-pressed', !this.$element.hasClass('active')) | ||
| } | ||
|
|
||
| if (changed) this.$element.toggleClass('active') | ||
| } | ||
|
|
||
|
|
||
| // BUTTON PLUGIN DEFINITION | ||
| // ======================== | ||
|
|
||
| function Plugin(option) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.button') | ||
| var options = typeof option == 'object' && option | ||
|
|
||
| if (!data) $this.data('bs.button', (data = new Button(this, options))) | ||
|
|
||
| if (option == 'toggle') data.toggle() | ||
| else if (option) data.setState(option) | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.button | ||
|
|
||
| $.fn.button = Plugin | ||
| $.fn.button.Constructor = Button | ||
|
|
||
|
|
||
| // BUTTON NO CONFLICT | ||
| // ================== | ||
|
|
||
| $.fn.button.noConflict = function () { | ||
| $.fn.button = old | ||
| return this | ||
| } | ||
|
|
||
|
|
||
| // BUTTON DATA-API | ||
| // =============== | ||
|
|
||
| $(document) | ||
| .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { | ||
| var $btn = $(e.target) | ||
| if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') | ||
| Plugin.call($btn, 'toggle') | ||
| e.preventDefault() | ||
| }) | ||
| .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { | ||
| $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) | ||
| }) | ||
|
|
||
| }(jQuery); |
| @@ -0,0 +1,237 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: carousel.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#carousel | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // CAROUSEL CLASS DEFINITION | ||
| // ========================= | ||
|
|
||
| var Carousel = function (element, options) { | ||
| this.$element = $(element) | ||
| this.$indicators = this.$element.find('.carousel-indicators') | ||
| this.options = options | ||
| this.paused = | ||
| this.sliding = | ||
| this.interval = | ||
| this.$active = | ||
| this.$items = null | ||
|
|
||
| this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)) | ||
|
|
||
| this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element | ||
| .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) | ||
| .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) | ||
| } | ||
|
|
||
| Carousel.VERSION = '3.3.2' | ||
|
|
||
| Carousel.TRANSITION_DURATION = 600 | ||
|
|
||
| Carousel.DEFAULTS = { | ||
| interval: 5000, | ||
| pause: 'hover', | ||
| wrap: true, | ||
| keyboard: true | ||
| } | ||
|
|
||
| Carousel.prototype.keydown = function (e) { | ||
| if (/input|textarea/i.test(e.target.tagName)) return | ||
| switch (e.which) { | ||
| case 37: this.prev(); break | ||
| case 39: this.next(); break | ||
| default: return | ||
| } | ||
|
|
||
| e.preventDefault() | ||
| } | ||
|
|
||
| Carousel.prototype.cycle = function (e) { | ||
| e || (this.paused = false) | ||
|
|
||
| this.interval && clearInterval(this.interval) | ||
|
|
||
| this.options.interval | ||
| && !this.paused | ||
| && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) | ||
|
|
||
| return this | ||
| } | ||
|
|
||
| Carousel.prototype.getItemIndex = function (item) { | ||
| this.$items = item.parent().children('.item') | ||
| return this.$items.index(item || this.$active) | ||
| } | ||
|
|
||
| Carousel.prototype.getItemForDirection = function (direction, active) { | ||
| var activeIndex = this.getItemIndex(active) | ||
| var willWrap = (direction == 'prev' && activeIndex === 0) | ||
| || (direction == 'next' && activeIndex == (this.$items.length - 1)) | ||
| if (willWrap && !this.options.wrap) return active | ||
| var delta = direction == 'prev' ? -1 : 1 | ||
| var itemIndex = (activeIndex + delta) % this.$items.length | ||
| return this.$items.eq(itemIndex) | ||
| } | ||
|
|
||
| Carousel.prototype.to = function (pos) { | ||
| var that = this | ||
| var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) | ||
|
|
||
| if (pos > (this.$items.length - 1) || pos < 0) return | ||
|
|
||
| if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" | ||
| if (activeIndex == pos) return this.pause().cycle() | ||
|
|
||
| return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) | ||
| } | ||
|
|
||
| Carousel.prototype.pause = function (e) { | ||
| e || (this.paused = true) | ||
|
|
||
| if (this.$element.find('.next, .prev').length && $.support.transition) { | ||
| this.$element.trigger($.support.transition.end) | ||
| this.cycle(true) | ||
| } | ||
|
|
||
| this.interval = clearInterval(this.interval) | ||
|
|
||
| return this | ||
| } | ||
|
|
||
| Carousel.prototype.next = function () { | ||
| if (this.sliding) return | ||
| return this.slide('next') | ||
| } | ||
|
|
||
| Carousel.prototype.prev = function () { | ||
| if (this.sliding) return | ||
| return this.slide('prev') | ||
| } | ||
|
|
||
| Carousel.prototype.slide = function (type, next) { | ||
| var $active = this.$element.find('.item.active') | ||
| var $next = next || this.getItemForDirection(type, $active) | ||
| var isCycling = this.interval | ||
| var direction = type == 'next' ? 'left' : 'right' | ||
| var that = this | ||
|
|
||
| if ($next.hasClass('active')) return (this.sliding = false) | ||
|
|
||
| var relatedTarget = $next[0] | ||
| var slideEvent = $.Event('slide.bs.carousel', { | ||
| relatedTarget: relatedTarget, | ||
| direction: direction | ||
| }) | ||
| this.$element.trigger(slideEvent) | ||
| if (slideEvent.isDefaultPrevented()) return | ||
|
|
||
| this.sliding = true | ||
|
|
||
| isCycling && this.pause() | ||
|
|
||
| if (this.$indicators.length) { | ||
| this.$indicators.find('.active').removeClass('active') | ||
| var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]) | ||
| $nextIndicator && $nextIndicator.addClass('active') | ||
| } | ||
|
|
||
| var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid" | ||
| if ($.support.transition && this.$element.hasClass('slide')) { | ||
| $next.addClass(type) | ||
| $next[0].offsetWidth // force reflow | ||
| $active.addClass(direction) | ||
| $next.addClass(direction) | ||
| $active | ||
| .one('bsTransitionEnd', function () { | ||
| $next.removeClass([type, direction].join(' ')).addClass('active') | ||
| $active.removeClass(['active', direction].join(' ')) | ||
| that.sliding = false | ||
| setTimeout(function () { | ||
| that.$element.trigger(slidEvent) | ||
| }, 0) | ||
| }) | ||
| .emulateTransitionEnd(Carousel.TRANSITION_DURATION) | ||
| } else { | ||
| $active.removeClass('active') | ||
| $next.addClass('active') | ||
| this.sliding = false | ||
| this.$element.trigger(slidEvent) | ||
| } | ||
|
|
||
| isCycling && this.cycle() | ||
|
|
||
| return this | ||
| } | ||
|
|
||
|
|
||
| // CAROUSEL PLUGIN DEFINITION | ||
| // ========================== | ||
|
|
||
| function Plugin(option) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.carousel') | ||
| var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) | ||
| var action = typeof option == 'string' ? option : options.slide | ||
|
|
||
| if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) | ||
| if (typeof option == 'number') data.to(option) | ||
| else if (action) data[action]() | ||
| else if (options.interval) data.pause().cycle() | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.carousel | ||
|
|
||
| $.fn.carousel = Plugin | ||
| $.fn.carousel.Constructor = Carousel | ||
|
|
||
|
|
||
| // CAROUSEL NO CONFLICT | ||
| // ==================== | ||
|
|
||
| $.fn.carousel.noConflict = function () { | ||
| $.fn.carousel = old | ||
| return this | ||
| } | ||
|
|
||
|
|
||
| // CAROUSEL DATA-API | ||
| // ================= | ||
|
|
||
| var clickHandler = function (e) { | ||
| var href | ||
| var $this = $(this) | ||
| var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7 | ||
| if (!$target.hasClass('carousel')) return | ||
| var options = $.extend({}, $target.data(), $this.data()) | ||
| var slideIndex = $this.attr('data-slide-to') | ||
| if (slideIndex) options.interval = false | ||
|
|
||
| Plugin.call($target, options) | ||
|
|
||
| if (slideIndex) { | ||
| $target.data('bs.carousel').to(slideIndex) | ||
| } | ||
|
|
||
| e.preventDefault() | ||
| } | ||
|
|
||
| $(document) | ||
| .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) | ||
| .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler) | ||
|
|
||
| $(window).on('load', function () { | ||
| $('[data-ride="carousel"]').each(function () { | ||
| var $carousel = $(this) | ||
| Plugin.call($carousel, $carousel.data()) | ||
| }) | ||
| }) | ||
|
|
||
| }(jQuery); |
| @@ -0,0 +1,211 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: collapse.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#collapse | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // COLLAPSE PUBLIC CLASS DEFINITION | ||
| // ================================ | ||
|
|
||
| var Collapse = function (element, options) { | ||
| this.$element = $(element) | ||
| this.options = $.extend({}, Collapse.DEFAULTS, options) | ||
| this.$trigger = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]') | ||
| this.transitioning = null | ||
|
|
||
| if (this.options.parent) { | ||
| this.$parent = this.getParent() | ||
| } else { | ||
| this.addAriaAndCollapsedClass(this.$element, this.$trigger) | ||
| } | ||
|
|
||
| if (this.options.toggle) this.toggle() | ||
| } | ||
|
|
||
| Collapse.VERSION = '3.3.2' | ||
|
|
||
| Collapse.TRANSITION_DURATION = 350 | ||
|
|
||
| Collapse.DEFAULTS = { | ||
| toggle: true, | ||
| trigger: '[data-toggle="collapse"]' | ||
| } | ||
|
|
||
| Collapse.prototype.dimension = function () { | ||
| var hasWidth = this.$element.hasClass('width') | ||
| return hasWidth ? 'width' : 'height' | ||
| } | ||
|
|
||
| Collapse.prototype.show = function () { | ||
| if (this.transitioning || this.$element.hasClass('in')) return | ||
|
|
||
| var activesData | ||
| var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') | ||
|
|
||
| if (actives && actives.length) { | ||
| activesData = actives.data('bs.collapse') | ||
| if (activesData && activesData.transitioning) return | ||
| } | ||
|
|
||
| var startEvent = $.Event('show.bs.collapse') | ||
| this.$element.trigger(startEvent) | ||
| if (startEvent.isDefaultPrevented()) return | ||
|
|
||
| if (actives && actives.length) { | ||
| Plugin.call(actives, 'hide') | ||
| activesData || actives.data('bs.collapse', null) | ||
| } | ||
|
|
||
| var dimension = this.dimension() | ||
|
|
||
| this.$element | ||
| .removeClass('collapse') | ||
| .addClass('collapsing')[dimension](0) | ||
| .attr('aria-expanded', true) | ||
|
|
||
| this.$trigger | ||
| .removeClass('collapsed') | ||
| .attr('aria-expanded', true) | ||
|
|
||
| this.transitioning = 1 | ||
|
|
||
| var complete = function () { | ||
| this.$element | ||
| .removeClass('collapsing') | ||
| .addClass('collapse in')[dimension]('') | ||
| this.transitioning = 0 | ||
| this.$element | ||
| .trigger('shown.bs.collapse') | ||
| } | ||
|
|
||
| if (!$.support.transition) return complete.call(this) | ||
|
|
||
| var scrollSize = $.camelCase(['scroll', dimension].join('-')) | ||
|
|
||
| this.$element | ||
| .one('bsTransitionEnd', $.proxy(complete, this)) | ||
| .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) | ||
| } | ||
|
|
||
| Collapse.prototype.hide = function () { | ||
| if (this.transitioning || !this.$element.hasClass('in')) return | ||
|
|
||
| var startEvent = $.Event('hide.bs.collapse') | ||
| this.$element.trigger(startEvent) | ||
| if (startEvent.isDefaultPrevented()) return | ||
|
|
||
| var dimension = this.dimension() | ||
|
|
||
| this.$element[dimension](this.$element[dimension]())[0].offsetHeight | ||
|
|
||
| this.$element | ||
| .addClass('collapsing') | ||
| .removeClass('collapse in') | ||
| .attr('aria-expanded', false) | ||
|
|
||
| this.$trigger | ||
| .addClass('collapsed') | ||
| .attr('aria-expanded', false) | ||
|
|
||
| this.transitioning = 1 | ||
|
|
||
| var complete = function () { | ||
| this.transitioning = 0 | ||
| this.$element | ||
| .removeClass('collapsing') | ||
| .addClass('collapse') | ||
| .trigger('hidden.bs.collapse') | ||
| } | ||
|
|
||
| if (!$.support.transition) return complete.call(this) | ||
|
|
||
| this.$element | ||
| [dimension](0) | ||
| .one('bsTransitionEnd', $.proxy(complete, this)) | ||
| .emulateTransitionEnd(Collapse.TRANSITION_DURATION) | ||
| } | ||
|
|
||
| Collapse.prototype.toggle = function () { | ||
| this[this.$element.hasClass('in') ? 'hide' : 'show']() | ||
| } | ||
|
|
||
| Collapse.prototype.getParent = function () { | ||
| return $(this.options.parent) | ||
| .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') | ||
| .each($.proxy(function (i, element) { | ||
| var $element = $(element) | ||
| this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) | ||
| }, this)) | ||
| .end() | ||
| } | ||
|
|
||
| Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { | ||
| var isOpen = $element.hasClass('in') | ||
|
|
||
| $element.attr('aria-expanded', isOpen) | ||
| $trigger | ||
| .toggleClass('collapsed', !isOpen) | ||
| .attr('aria-expanded', isOpen) | ||
| } | ||
|
|
||
| function getTargetFromTrigger($trigger) { | ||
| var href | ||
| var target = $trigger.attr('data-target') | ||
| || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 | ||
|
|
||
| return $(target) | ||
| } | ||
|
|
||
|
|
||
| // COLLAPSE PLUGIN DEFINITION | ||
| // ========================== | ||
|
|
||
| function Plugin(option) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.collapse') | ||
| var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) | ||
|
|
||
| if (!data && options.toggle && option == 'show') options.toggle = false | ||
| if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) | ||
| if (typeof option == 'string') data[option]() | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.collapse | ||
|
|
||
| $.fn.collapse = Plugin | ||
| $.fn.collapse.Constructor = Collapse | ||
|
|
||
|
|
||
| // COLLAPSE NO CONFLICT | ||
| // ==================== | ||
|
|
||
| $.fn.collapse.noConflict = function () { | ||
| $.fn.collapse = old | ||
| return this | ||
| } | ||
|
|
||
|
|
||
| // COLLAPSE DATA-API | ||
| // ================= | ||
|
|
||
| $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { | ||
| var $this = $(this) | ||
|
|
||
| if (!$this.attr('data-target')) e.preventDefault() | ||
|
|
||
| var $target = getTargetFromTrigger($this) | ||
| var data = $target.data('bs.collapse') | ||
| var option = data ? 'toggle' : $.extend({}, $this.data(), { trigger: this }) | ||
|
|
||
| Plugin.call($target, option) | ||
| }) | ||
|
|
||
| }(jQuery); |
| @@ -0,0 +1,161 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: dropdown.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#dropdowns | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // DROPDOWN CLASS DEFINITION | ||
| // ========================= | ||
|
|
||
| var backdrop = '.dropdown-backdrop' | ||
| var toggle = '[data-toggle="dropdown"]' | ||
| var Dropdown = function (element) { | ||
| $(element).on('click.bs.dropdown', this.toggle) | ||
| } | ||
|
|
||
| Dropdown.VERSION = '3.3.2' | ||
|
|
||
| Dropdown.prototype.toggle = function (e) { | ||
| var $this = $(this) | ||
|
|
||
| if ($this.is('.disabled, :disabled')) return | ||
|
|
||
| var $parent = getParent($this) | ||
| var isActive = $parent.hasClass('open') | ||
|
|
||
| clearMenus() | ||
|
|
||
| if (!isActive) { | ||
| if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { | ||
| // if mobile we use a backdrop because click events don't delegate | ||
| $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) | ||
| } | ||
|
|
||
| var relatedTarget = { relatedTarget: this } | ||
| $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) | ||
|
|
||
| if (e.isDefaultPrevented()) return | ||
|
|
||
| $this | ||
| .trigger('focus') | ||
| .attr('aria-expanded', 'true') | ||
|
|
||
| $parent | ||
| .toggleClass('open') | ||
| .trigger('shown.bs.dropdown', relatedTarget) | ||
| } | ||
|
|
||
| return false | ||
| } | ||
|
|
||
| Dropdown.prototype.keydown = function (e) { | ||
| if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return | ||
|
|
||
| var $this = $(this) | ||
|
|
||
| e.preventDefault() | ||
| e.stopPropagation() | ||
|
|
||
| if ($this.is('.disabled, :disabled')) return | ||
|
|
||
| var $parent = getParent($this) | ||
| var isActive = $parent.hasClass('open') | ||
|
|
||
| if ((!isActive && e.which != 27) || (isActive && e.which == 27)) { | ||
| if (e.which == 27) $parent.find(toggle).trigger('focus') | ||
| return $this.trigger('click') | ||
| } | ||
|
|
||
| var desc = ' li:not(.divider):visible a' | ||
| var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc) | ||
|
|
||
| if (!$items.length) return | ||
|
|
||
| var index = $items.index(e.target) | ||
|
|
||
| if (e.which == 38 && index > 0) index-- // up | ||
| if (e.which == 40 && index < $items.length - 1) index++ // down | ||
| if (!~index) index = 0 | ||
|
|
||
| $items.eq(index).trigger('focus') | ||
| } | ||
|
|
||
| function clearMenus(e) { | ||
| if (e && e.which === 3) return | ||
| $(backdrop).remove() | ||
| $(toggle).each(function () { | ||
| var $this = $(this) | ||
| var $parent = getParent($this) | ||
| var relatedTarget = { relatedTarget: this } | ||
|
|
||
| if (!$parent.hasClass('open')) return | ||
|
|
||
| $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) | ||
|
|
||
| if (e.isDefaultPrevented()) return | ||
|
|
||
| $this.attr('aria-expanded', 'false') | ||
| $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) | ||
| }) | ||
| } | ||
|
|
||
| function getParent($this) { | ||
| var selector = $this.attr('data-target') | ||
|
|
||
| if (!selector) { | ||
| selector = $this.attr('href') | ||
| selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 | ||
| } | ||
|
|
||
| var $parent = selector && $(selector) | ||
|
|
||
| return $parent && $parent.length ? $parent : $this.parent() | ||
| } | ||
|
|
||
|
|
||
| // DROPDOWN PLUGIN DEFINITION | ||
| // ========================== | ||
|
|
||
| function Plugin(option) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.dropdown') | ||
|
|
||
| if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) | ||
| if (typeof option == 'string') data[option].call($this) | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.dropdown | ||
|
|
||
| $.fn.dropdown = Plugin | ||
| $.fn.dropdown.Constructor = Dropdown | ||
|
|
||
|
|
||
| // DROPDOWN NO CONFLICT | ||
| // ==================== | ||
|
|
||
| $.fn.dropdown.noConflict = function () { | ||
| $.fn.dropdown = old | ||
| return this | ||
| } | ||
|
|
||
|
|
||
| // APPLY TO STANDARD DROPDOWN ELEMENTS | ||
| // =================================== | ||
|
|
||
| $(document) | ||
| .on('click.bs.dropdown.data-api', clearMenus) | ||
| .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) | ||
| .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) | ||
| .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) | ||
| .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown) | ||
| .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown) | ||
|
|
||
| }(jQuery); |
| @@ -0,0 +1,324 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: modal.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#modals | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // MODAL CLASS DEFINITION | ||
| // ====================== | ||
|
|
||
| var Modal = function (element, options) { | ||
| this.options = options | ||
| this.$body = $(document.body) | ||
| this.$element = $(element) | ||
| this.$backdrop = | ||
| this.isShown = null | ||
| this.scrollbarWidth = 0 | ||
|
|
||
| if (this.options.remote) { | ||
| this.$element | ||
| .find('.modal-content') | ||
| .load(this.options.remote, $.proxy(function () { | ||
| this.$element.trigger('loaded.bs.modal') | ||
| }, this)) | ||
| } | ||
| } | ||
|
|
||
| Modal.VERSION = '3.3.2' | ||
|
|
||
| Modal.TRANSITION_DURATION = 300 | ||
| Modal.BACKDROP_TRANSITION_DURATION = 150 | ||
|
|
||
| Modal.DEFAULTS = { | ||
| backdrop: true, | ||
| keyboard: true, | ||
| show: true | ||
| } | ||
|
|
||
| Modal.prototype.toggle = function (_relatedTarget) { | ||
| return this.isShown ? this.hide() : this.show(_relatedTarget) | ||
| } | ||
|
|
||
| Modal.prototype.show = function (_relatedTarget) { | ||
| var that = this | ||
| var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) | ||
|
|
||
| this.$element.trigger(e) | ||
|
|
||
| if (this.isShown || e.isDefaultPrevented()) return | ||
|
|
||
| this.isShown = true | ||
|
|
||
| this.checkScrollbar() | ||
| this.setScrollbar() | ||
| this.$body.addClass('modal-open') | ||
|
|
||
| this.escape() | ||
| this.resize() | ||
|
|
||
| this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) | ||
|
|
||
| this.backdrop(function () { | ||
| var transition = $.support.transition && that.$element.hasClass('fade') | ||
|
|
||
| if (!that.$element.parent().length) { | ||
| that.$element.appendTo(that.$body) // don't move modals dom position | ||
| } | ||
|
|
||
| that.$element | ||
| .show() | ||
| .scrollTop(0) | ||
|
|
||
| if (that.options.backdrop) that.adjustBackdrop() | ||
| that.adjustDialog() | ||
|
|
||
| if (transition) { | ||
| that.$element[0].offsetWidth // force reflow | ||
| } | ||
|
|
||
| that.$element | ||
| .addClass('in') | ||
| .attr('aria-hidden', false) | ||
|
|
||
| that.enforceFocus() | ||
|
|
||
| var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) | ||
|
|
||
| transition ? | ||
| that.$element.find('.modal-dialog') // wait for modal to slide in | ||
| .one('bsTransitionEnd', function () { | ||
| that.$element.trigger('focus').trigger(e) | ||
| }) | ||
| .emulateTransitionEnd(Modal.TRANSITION_DURATION) : | ||
| that.$element.trigger('focus').trigger(e) | ||
| }) | ||
| } | ||
|
|
||
| Modal.prototype.hide = function (e) { | ||
| if (e) e.preventDefault() | ||
|
|
||
| e = $.Event('hide.bs.modal') | ||
|
|
||
| this.$element.trigger(e) | ||
|
|
||
| if (!this.isShown || e.isDefaultPrevented()) return | ||
|
|
||
| this.isShown = false | ||
|
|
||
| this.escape() | ||
| this.resize() | ||
|
|
||
| $(document).off('focusin.bs.modal') | ||
|
|
||
| this.$element | ||
| .removeClass('in') | ||
| .attr('aria-hidden', true) | ||
| .off('click.dismiss.bs.modal') | ||
|
|
||
| $.support.transition && this.$element.hasClass('fade') ? | ||
| this.$element | ||
| .one('bsTransitionEnd', $.proxy(this.hideModal, this)) | ||
| .emulateTransitionEnd(Modal.TRANSITION_DURATION) : | ||
| this.hideModal() | ||
| } | ||
|
|
||
| Modal.prototype.enforceFocus = function () { | ||
| $(document) | ||
| .off('focusin.bs.modal') // guard against infinite focus loop | ||
| .on('focusin.bs.modal', $.proxy(function (e) { | ||
| if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { | ||
| this.$element.trigger('focus') | ||
| } | ||
| }, this)) | ||
| } | ||
|
|
||
| Modal.prototype.escape = function () { | ||
| if (this.isShown && this.options.keyboard) { | ||
| this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { | ||
| e.which == 27 && this.hide() | ||
| }, this)) | ||
| } else if (!this.isShown) { | ||
| this.$element.off('keydown.dismiss.bs.modal') | ||
| } | ||
| } | ||
|
|
||
| Modal.prototype.resize = function () { | ||
| if (this.isShown) { | ||
| $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) | ||
| } else { | ||
| $(window).off('resize.bs.modal') | ||
| } | ||
| } | ||
|
|
||
| Modal.prototype.hideModal = function () { | ||
| var that = this | ||
| this.$element.hide() | ||
| this.backdrop(function () { | ||
| that.$body.removeClass('modal-open') | ||
| that.resetAdjustments() | ||
| that.resetScrollbar() | ||
| that.$element.trigger('hidden.bs.modal') | ||
| }) | ||
| } | ||
|
|
||
| Modal.prototype.removeBackdrop = function () { | ||
| this.$backdrop && this.$backdrop.remove() | ||
| this.$backdrop = null | ||
| } | ||
|
|
||
| Modal.prototype.backdrop = function (callback) { | ||
| var that = this | ||
| var animate = this.$element.hasClass('fade') ? 'fade' : '' | ||
|
|
||
| if (this.isShown && this.options.backdrop) { | ||
| var doAnimate = $.support.transition && animate | ||
|
|
||
| this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') | ||
| .prependTo(this.$element) | ||
| .on('click.dismiss.bs.modal', $.proxy(function (e) { | ||
| if (e.target !== e.currentTarget) return | ||
| this.options.backdrop == 'static' | ||
| ? this.$element[0].focus.call(this.$element[0]) | ||
| : this.hide.call(this) | ||
| }, this)) | ||
|
|
||
| if (doAnimate) this.$backdrop[0].offsetWidth // force reflow | ||
|
|
||
| this.$backdrop.addClass('in') | ||
|
|
||
| if (!callback) return | ||
|
|
||
| doAnimate ? | ||
| this.$backdrop | ||
| .one('bsTransitionEnd', callback) | ||
| .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : | ||
| callback() | ||
|
|
||
| } else if (!this.isShown && this.$backdrop) { | ||
| this.$backdrop.removeClass('in') | ||
|
|
||
| var callbackRemove = function () { | ||
| that.removeBackdrop() | ||
| callback && callback() | ||
| } | ||
| $.support.transition && this.$element.hasClass('fade') ? | ||
| this.$backdrop | ||
| .one('bsTransitionEnd', callbackRemove) | ||
| .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : | ||
| callbackRemove() | ||
|
|
||
| } else if (callback) { | ||
| callback() | ||
| } | ||
| } | ||
|
|
||
| // these following methods are used to handle overflowing modals | ||
|
|
||
| Modal.prototype.handleUpdate = function () { | ||
| if (this.options.backdrop) this.adjustBackdrop() | ||
| this.adjustDialog() | ||
| } | ||
|
|
||
| Modal.prototype.adjustBackdrop = function () { | ||
| this.$backdrop | ||
| .css('height', 0) | ||
| .css('height', this.$element[0].scrollHeight) | ||
| } | ||
|
|
||
| Modal.prototype.adjustDialog = function () { | ||
| var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight | ||
|
|
||
| this.$element.css({ | ||
| paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', | ||
| paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' | ||
| }) | ||
| } | ||
|
|
||
| Modal.prototype.resetAdjustments = function () { | ||
| this.$element.css({ | ||
| paddingLeft: '', | ||
| paddingRight: '' | ||
| }) | ||
| } | ||
|
|
||
| Modal.prototype.checkScrollbar = function () { | ||
| this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight | ||
| this.scrollbarWidth = this.measureScrollbar() | ||
| } | ||
|
|
||
| Modal.prototype.setScrollbar = function () { | ||
| var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) | ||
| if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) | ||
| } | ||
|
|
||
| Modal.prototype.resetScrollbar = function () { | ||
| this.$body.css('padding-right', '') | ||
| } | ||
|
|
||
| Modal.prototype.measureScrollbar = function () { // thx walsh | ||
| var scrollDiv = document.createElement('div') | ||
| scrollDiv.className = 'modal-scrollbar-measure' | ||
| this.$body.append(scrollDiv) | ||
| var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth | ||
| this.$body[0].removeChild(scrollDiv) | ||
| return scrollbarWidth | ||
| } | ||
|
|
||
|
|
||
| // MODAL PLUGIN DEFINITION | ||
| // ======================= | ||
|
|
||
| function Plugin(option, _relatedTarget) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.modal') | ||
| var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) | ||
|
|
||
| if (!data) $this.data('bs.modal', (data = new Modal(this, options))) | ||
| if (typeof option == 'string') data[option](_relatedTarget) | ||
| else if (options.show) data.show(_relatedTarget) | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.modal | ||
|
|
||
| $.fn.modal = Plugin | ||
| $.fn.modal.Constructor = Modal | ||
|
|
||
|
|
||
| // MODAL NO CONFLICT | ||
| // ================= | ||
|
|
||
| $.fn.modal.noConflict = function () { | ||
| $.fn.modal = old | ||
| return this | ||
| } | ||
|
|
||
|
|
||
| // MODAL DATA-API | ||
| // ============== | ||
|
|
||
| $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { | ||
| var $this = $(this) | ||
| var href = $this.attr('href') | ||
| var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7 | ||
| var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) | ||
|
|
||
| if ($this.is('a')) e.preventDefault() | ||
|
|
||
| $target.one('show.bs.modal', function (showEvent) { | ||
| if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown | ||
| $target.one('hidden.bs.modal', function () { | ||
| $this.is(':visible') && $this.trigger('focus') | ||
| }) | ||
| }) | ||
| Plugin.call($target, option, this) | ||
| }) | ||
|
|
||
| }(jQuery); |
| @@ -0,0 +1,113 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: popover.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#popovers | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // POPOVER PUBLIC CLASS DEFINITION | ||
| // =============================== | ||
|
|
||
| var Popover = function (element, options) { | ||
| this.init('popover', element, options) | ||
| } | ||
|
|
||
| if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') | ||
|
|
||
| Popover.VERSION = '3.3.2' | ||
|
|
||
| Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { | ||
| placement: 'right', | ||
| trigger: 'click', | ||
| content: '', | ||
| template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' | ||
| }) | ||
|
|
||
|
|
||
| // NOTE: POPOVER EXTENDS tooltip.js | ||
| // ================================ | ||
|
|
||
| Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) | ||
|
|
||
| Popover.prototype.constructor = Popover | ||
|
|
||
| Popover.prototype.getDefaults = function () { | ||
| return Popover.DEFAULTS | ||
| } | ||
|
|
||
| Popover.prototype.setContent = function () { | ||
| var $tip = this.tip() | ||
| var title = this.getTitle() | ||
| var content = this.getContent() | ||
|
|
||
| $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) | ||
| $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events | ||
| this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' | ||
| ](content) | ||
|
|
||
| $tip.removeClass('fade top bottom left right in') | ||
|
|
||
| // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do | ||
| // this manually by checking the contents. | ||
| if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() | ||
| } | ||
|
|
||
| Popover.prototype.hasContent = function () { | ||
| return this.getTitle() || this.getContent() | ||
| } | ||
|
|
||
| Popover.prototype.getContent = function () { | ||
| var $e = this.$element | ||
| var o = this.options | ||
|
|
||
| return $e.attr('data-content') | ||
| || (typeof o.content == 'function' ? | ||
| o.content.call($e[0]) : | ||
| o.content) | ||
| } | ||
|
|
||
| Popover.prototype.arrow = function () { | ||
| return (this.$arrow = this.$arrow || this.tip().find('.arrow')) | ||
| } | ||
|
|
||
| Popover.prototype.tip = function () { | ||
| if (!this.$tip) this.$tip = $(this.options.template) | ||
| return this.$tip | ||
| } | ||
|
|
||
|
|
||
| // POPOVER PLUGIN DEFINITION | ||
| // ========================= | ||
|
|
||
| function Plugin(option) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.popover') | ||
| var options = typeof option == 'object' && option | ||
|
|
||
| if (!data && option == 'destroy') return | ||
| if (!data) $this.data('bs.popover', (data = new Popover(this, options))) | ||
| if (typeof option == 'string') data[option]() | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.popover | ||
|
|
||
| $.fn.popover = Plugin | ||
| $.fn.popover.Constructor = Popover | ||
|
|
||
|
|
||
| // POPOVER NO CONFLICT | ||
| // =================== | ||
|
|
||
| $.fn.popover.noConflict = function () { | ||
| $.fn.popover = old | ||
| return this | ||
| } | ||
|
|
||
| }(jQuery); |
| @@ -0,0 +1,175 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: scrollspy.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#scrollspy | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // SCROLLSPY CLASS DEFINITION | ||
| // ========================== | ||
|
|
||
| function ScrollSpy(element, options) { | ||
| var process = $.proxy(this.process, this) | ||
|
|
||
| this.$body = $('body') | ||
| this.$scrollElement = $(element).is('body') ? $(window) : $(element) | ||
| this.options = $.extend({}, ScrollSpy.DEFAULTS, options) | ||
| this.selector = (this.options.target || '') + ' .nav li > a' | ||
| this.offsets = [] | ||
| this.targets = [] | ||
| this.activeTarget = null | ||
| this.scrollHeight = 0 | ||
|
|
||
| this.$scrollElement.on('scroll.bs.scrollspy', process) | ||
| this.refresh() | ||
| this.process() | ||
| } | ||
|
|
||
| ScrollSpy.VERSION = '3.3.2' | ||
|
|
||
| ScrollSpy.DEFAULTS = { | ||
| offset: 10 | ||
| } | ||
|
|
||
| ScrollSpy.prototype.getScrollHeight = function () { | ||
| return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) | ||
| } | ||
|
|
||
| ScrollSpy.prototype.refresh = function () { | ||
| var offsetMethod = 'offset' | ||
| var offsetBase = 0 | ||
|
|
||
| if (!$.isWindow(this.$scrollElement[0])) { | ||
| offsetMethod = 'position' | ||
| offsetBase = this.$scrollElement.scrollTop() | ||
| } | ||
|
|
||
| this.offsets = [] | ||
| this.targets = [] | ||
| this.scrollHeight = this.getScrollHeight() | ||
|
|
||
| var self = this | ||
|
|
||
| this.$body | ||
| .find(this.selector) | ||
| .map(function () { | ||
| var $el = $(this) | ||
| var href = $el.data('target') || $el.attr('href') | ||
| var $href = /^#./.test(href) && $(href) | ||
|
|
||
| return ($href | ||
| && $href.length | ||
| && $href.is(':visible') | ||
| && [[$href[offsetMethod]().top + offsetBase, href]]) || null | ||
| }) | ||
| .sort(function (a, b) { return a[0] - b[0] }) | ||
| .each(function () { | ||
| self.offsets.push(this[0]) | ||
| self.targets.push(this[1]) | ||
| }) | ||
| } | ||
|
|
||
| ScrollSpy.prototype.process = function () { | ||
| var scrollTop = this.$scrollElement.scrollTop() + this.options.offset | ||
| var scrollHeight = this.getScrollHeight() | ||
| var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() | ||
| var offsets = this.offsets | ||
| var targets = this.targets | ||
| var activeTarget = this.activeTarget | ||
| var i | ||
|
|
||
| if (this.scrollHeight != scrollHeight) { | ||
| this.refresh() | ||
| } | ||
|
|
||
| if (scrollTop >= maxScroll) { | ||
| return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) | ||
| } | ||
|
|
||
| if (activeTarget && scrollTop < offsets[0]) { | ||
| this.activeTarget = null | ||
| return this.clear() | ||
| } | ||
|
|
||
| for (i = offsets.length; i--;) { | ||
| activeTarget != targets[i] | ||
| && scrollTop >= offsets[i] | ||
| && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) | ||
| && this.activate(targets[i]) | ||
| } | ||
| } | ||
|
|
||
| ScrollSpy.prototype.activate = function (target) { | ||
| this.activeTarget = target | ||
|
|
||
| this.clear() | ||
|
|
||
| var selector = this.selector + | ||
| '[data-target="' + target + '"],' + | ||
| this.selector + '[href="' + target + '"]' | ||
|
|
||
| var active = $(selector) | ||
| .parents('li') | ||
| .addClass('active') | ||
|
|
||
| if (active.parent('.dropdown-menu').length) { | ||
| active = active | ||
| .closest('li.dropdown') | ||
| .addClass('active') | ||
| } | ||
|
|
||
| active.trigger('activate.bs.scrollspy') | ||
| } | ||
|
|
||
| ScrollSpy.prototype.clear = function () { | ||
| $(this.selector) | ||
| .parentsUntil(this.options.target, '.active') | ||
| .removeClass('active') | ||
| } | ||
|
|
||
|
|
||
| // SCROLLSPY PLUGIN DEFINITION | ||
| // =========================== | ||
|
|
||
| function Plugin(option) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.scrollspy') | ||
| var options = typeof option == 'object' && option | ||
|
|
||
| if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) | ||
| if (typeof option == 'string') data[option]() | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.scrollspy | ||
|
|
||
| $.fn.scrollspy = Plugin | ||
| $.fn.scrollspy.Constructor = ScrollSpy | ||
|
|
||
|
|
||
| // SCROLLSPY NO CONFLICT | ||
| // ===================== | ||
|
|
||
| $.fn.scrollspy.noConflict = function () { | ||
| $.fn.scrollspy = old | ||
| return this | ||
| } | ||
|
|
||
|
|
||
| // SCROLLSPY DATA-API | ||
| // ================== | ||
|
|
||
| $(window).on('load.bs.scrollspy.data-api', function () { | ||
| $('[data-spy="scroll"]').each(function () { | ||
| var $spy = $(this) | ||
| Plugin.call($spy, $spy.data()) | ||
| }) | ||
| }) | ||
|
|
||
| }(jQuery); |
| @@ -0,0 +1,153 @@ | ||
| /* ======================================================================== | ||
| * Bootstrap: tab.js v3.3.2 | ||
| * http://getbootstrap.com/javascript/#tabs | ||
| * ======================================================================== | ||
| * Copyright 2011-2015 Twitter, Inc. | ||
| * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
| * ======================================================================== */ | ||
|
|
||
|
|
||
| +function ($) { | ||
| 'use strict'; | ||
|
|
||
| // TAB CLASS DEFINITION | ||
| // ==================== | ||
|
|
||
| var Tab = function (element) { | ||
| this.element = $(element) | ||
| } | ||
|
|
||
| Tab.VERSION = '3.3.2' | ||
|
|
||
| Tab.TRANSITION_DURATION = 150 | ||
|
|
||
| Tab.prototype.show = function () { | ||
| var $this = this.element | ||
| var $ul = $this.closest('ul:not(.dropdown-menu)') | ||
| var selector = $this.data('target') | ||
|
|
||
| if (!selector) { | ||
| selector = $this.attr('href') | ||
| selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 | ||
| } | ||
|
|
||
| if ($this.parent('li').hasClass('active')) return | ||
|
|
||
| var $previous = $ul.find('.active:last a') | ||
| var hideEvent = $.Event('hide.bs.tab', { | ||
| relatedTarget: $this[0] | ||
| }) | ||
| var showEvent = $.Event('show.bs.tab', { | ||
| relatedTarget: $previous[0] | ||
| }) | ||
|
|
||
| $previous.trigger(hideEvent) | ||
| $this.trigger(showEvent) | ||
|
|
||
| if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return | ||
|
|
||
| var $target = $(selector) | ||
|
|
||
| this.activate($this.closest('li'), $ul) | ||
| this.activate($target, $target.parent(), function () { | ||
| $previous.trigger({ | ||
| type: 'hidden.bs.tab', | ||
| relatedTarget: $this[0] | ||
| }) | ||
| $this.trigger({ | ||
| type: 'shown.bs.tab', | ||
| relatedTarget: $previous[0] | ||
| }) | ||
| }) | ||
| } | ||
|
|
||
| Tab.prototype.activate = function (element, container, callback) { | ||
| var $active = container.find('> .active') | ||
| var transition = callback | ||
| && $.support.transition | ||
| && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length) | ||
|
|
||
| function next() { | ||
| $active | ||
| .removeClass('active') | ||
| .find('> .dropdown-menu > .active') | ||
| .removeClass('active') | ||
| .end() | ||
| .find('[data-toggle="tab"]') | ||
| .attr('aria-expanded', false) | ||
|
|
||
| element | ||
| .addClass('active') | ||
| .find('[data-toggle="tab"]') | ||
| .attr('aria-expanded', true) | ||
|
|
||
| if (transition) { | ||
| element[0].offsetWidth // reflow for transition | ||
| element.addClass('in') | ||
| } else { | ||
| element.removeClass('fade') | ||
| } | ||
|
|
||
| if (element.parent('.dropdown-menu')) { | ||
| element | ||
| .closest('li.dropdown') | ||
| .addClass('active') | ||
| .end() | ||
| .find('[data-toggle="tab"]') | ||
| .attr('aria-expanded', true) | ||
| } | ||
|
|
||
| callback && callback() | ||
| } | ||
|
|
||
| $active.length && transition ? | ||
| $active | ||
| .one('bsTransitionEnd', next) | ||
| .emulateTransitionEnd(Tab.TRANSITION_DURATION) : | ||
| next() | ||
|
|
||
| $active.removeClass('in') | ||
| } | ||
|
|
||
|
|
||
| // TAB PLUGIN DEFINITION | ||
| // ===================== | ||
|
|
||
| function Plugin(option) { | ||
| return this.each(function () { | ||
| var $this = $(this) | ||
| var data = $this.data('bs.tab') | ||
|
|
||
| if (!data) $this.data('bs.tab', (data = new Tab(this))) | ||
| if (typeof option == 'string') data[option]() | ||
| }) | ||
| } | ||
|
|
||
| var old = $.fn.tab | ||
|
|
||
| $.fn.tab = Plugin | ||
| $.fn.tab.Constructor = Tab | ||
|
|
||
|
|
||
| // TAB NO CONFLICT | ||
| // =============== | ||
|
|
||
| $.fn.tab.noConflict = function () { | ||
| $.fn.tab = old | ||
| return this | ||
| } | ||
|
|
||
|
|
||
| // TAB DATA-API | ||
| // ============ | ||
|
|
||
| var clickHandler = function (e) { | ||
| e.preventDefault() | ||
| Plugin.call($(this), 'show') | ||
| } | ||
|
|
||
| $(document) | ||
| .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) | ||
| .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) | ||
|
|
||
| }(jQuery); |