mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 12:59:05 +02:00
Merge remote-tracking branch 'bootstrap/3.0.0-wip' into 3.0.0-wip
Conflicts: js/bootstrap-collapse.js
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
# Ignore compiled docs
|
||||
_gh_pages
|
||||
_site
|
||||
|
||||
# Numerous always-ignore extensions
|
||||
*.diff
|
||||
|
@@ -196,7 +196,7 @@ Running makefile now require JSHint and Recess.
|
||||
|
||||
- Add jshint support
|
||||
- Add travis-ci support w/ headless phantom integration
|
||||
- Replace UA sniffing in bootstrap-transitions.js
|
||||
- Replace UA sniffing in transitions.js
|
||||
- Add MSTransitionEnd event to transition plugin
|
||||
- Fix pause method in carousel (shouldn't restart when hovering over controls)
|
||||
- Fix crazy opera bug #1776
|
||||
|
@@ -23,12 +23,6 @@ We only accept issues that are bug reports or feature requests. Bugs must be iso
|
||||
|
||||
|
||||
|
||||
## Notes on the repo
|
||||
|
||||
As of v2.0.0, Bootstrap's documentation is powered by Mustache templates and built via `make` before each commit and release. This was done to enable internationalization (translation) in a future release by uploading our strings to the [Twitter Translation Center](http://translate.twttr.com/). Any edits to the docs should be first done in the Mustache files and then recompiled into the HTML.
|
||||
|
||||
|
||||
|
||||
## Pull requests
|
||||
|
||||
- Try to submit pull requests against the latest `*-wip` branch for easier merging
|
||||
@@ -40,16 +34,16 @@ As of v2.0.0, Bootstrap's documentation is powered by Mustache templates and bui
|
||||
|
||||
|
||||
|
||||
## Coding standards: HTML
|
||||
## Coding standards
|
||||
|
||||
### HTML
|
||||
|
||||
- Two spaces for indentation, never tabs
|
||||
- Double quotes only, never single quotes
|
||||
- Always use proper indentation
|
||||
- Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags)
|
||||
|
||||
|
||||
|
||||
## Coding standards: CSS
|
||||
### CSS
|
||||
|
||||
- Adhere to the [Recess CSS property order](http://markdotto.com/2011/11/29/css-property-order/)
|
||||
- Multiple-line approach (one property and value per line)
|
||||
@@ -58,9 +52,7 @@ As of v2.0.0, Bootstrap's documentation is powered by Mustache templates and bui
|
||||
- For multiple, comma-separated selectors, place each selector on it's own line
|
||||
- Attribute selectors, like `input[type="text"]` should always wrap the attribute's value in double quotes, for consistency and safety (see this [blog post on unquoted attribute values](http://mathiasbynens.be/notes/unquoted-attribute-values) that can lead to XSS attacks).
|
||||
|
||||
|
||||
|
||||
## Coding standards: JS
|
||||
### JS
|
||||
|
||||
- No semicolons
|
||||
- Comma first
|
||||
|
25
Makefile
25
Makefile
@@ -23,11 +23,10 @@ build:
|
||||
@echo " ${CHECK}"
|
||||
@printf "Prepping documentation assets..."
|
||||
@cp fonts/* docs/assets/fonts/
|
||||
@cp js/*.js docs/assets/js/
|
||||
@cp js/tests/vendor/jquery.js docs/assets/js/
|
||||
@echo " ${CHECK}"
|
||||
@printf "Compiling and minifying JavaScript..."
|
||||
@cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > docs/assets/js/bootstrap.js
|
||||
@cat js/transition.js js/alert.js js/button.js js/carousel.js js/collapse.js js/dropdown.js js/modal.js js/tooltip.js js/popover.js js/scrollspy.js js/tab.js js/affix.js > docs/assets/js/bootstrap.js
|
||||
@uglifyjs -nc docs/assets/js/bootstrap.js > docs/assets/js/bootstrap.min.tmp.js
|
||||
@echo "/**\n* Bootstrap.js v3.0.0 by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js
|
||||
@cat docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js > docs/assets/js/bootstrap.min.js
|
||||
@@ -72,14 +71,14 @@ bootstrap-js: bootstrap/js/*.js
|
||||
|
||||
bootstrap/js/*.js: js/*.js
|
||||
mkdir -p bootstrap/js
|
||||
cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > bootstrap/js/bootstrap.js
|
||||
cat js/transition.js js/alert.js js/button.js js/carousel.js js/collapse.js js/dropdown.js js/modal.js js/tooltip.js js/popover.js js/scrollspy.js js/tab.js js/affix.js > bootstrap/js/bootstrap.js
|
||||
uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
|
||||
echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
|
||||
cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
|
||||
rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js
|
||||
|
||||
#
|
||||
# CSS COMPLILE
|
||||
# CSS COMPILE
|
||||
#
|
||||
|
||||
bootstrap-css: bootstrap/css/*.css
|
||||
@@ -100,18 +99,6 @@ bootstrap/fonts/*: fonts/*
|
||||
cp fonts/* bootstrap/fonts/
|
||||
|
||||
|
||||
#
|
||||
# MAKE FOR GH-PAGES 4 FAT & MDO ONLY (O_O )
|
||||
#
|
||||
|
||||
gh-pages: bootstrap docs
|
||||
rm -f docs/assets/bootstrap.zip
|
||||
zip -r docs/assets/bootstrap.zip bootstrap
|
||||
rm -r bootstrap
|
||||
rm -f ../bootstrap-gh-pages/assets/bootstrap.zip
|
||||
node docs/build production
|
||||
cp -r docs/* ../bootstrap-gh-pages
|
||||
|
||||
#
|
||||
# WATCH LESS FILES
|
||||
#
|
||||
@@ -120,5 +107,11 @@ watch:
|
||||
echo "Watching less files..."; \
|
||||
watchr -e "watch('less/.*\.less') { system 'make' }"
|
||||
|
||||
#
|
||||
# BUILD AND START SERVER
|
||||
#
|
||||
|
||||
run: build
|
||||
jekyll build && jekyll server
|
||||
|
||||
.PHONY: docs watch gh-pages bootstrap-img bootstrap-css bootstrap-js
|
||||
|
45
README.md
45
README.md
@@ -12,18 +12,9 @@ Three quick start options are available:
|
||||
|
||||
* [Download the latest release](https://github.com/twitter/bootstrap/zipball/master).
|
||||
* Clone the repo: `git clone git://github.com/twitter/bootstrap.git`.
|
||||
* Install with Twitter's [Bower](http://github.com/bower/bower): `bower install bootstrap`.
|
||||
* Install with [Bower](http://bower.io): `bower install bootstrap`.
|
||||
|
||||
Read the [Getting Started page](http://getbootstrap.com/getting-started/) for information on the framework contents, basic template guidelines, and more.
|
||||
|
||||
|
||||
## Bootstrap elsewhere
|
||||
|
||||
Beyond getting started with the Bootstrap core, there are ways to use Bootstrap in other tools and services:
|
||||
|
||||
* [Roots WordPress theme](https://github.com/retlehs/roots) - A WordPress starter theme based on HTML5 Boilerplate & Bootstrap from Twitter.
|
||||
|
||||
Have suggestions? Let us know with a [new issue](https://github.com/twitter/bootstrap/issues).
|
||||
Read the [Getting Started page](http://getbootstrap.com/getting-started/) for information on the framework contents, templates and examples, and more.
|
||||
|
||||
|
||||
|
||||
@@ -35,21 +26,35 @@ Have a bug or a feature request? [Please open a new issue](https://github.com/tw
|
||||
|
||||
## Documentation
|
||||
|
||||
Bootstrap's docs are built using [Jekyll](http://jekyllrb.com) and hosted on GitHub Pages at [http://getbootstrap.com](http://getbootstrap.com). To view our docs locally, you'll need to [install Jekyll](https://github.com/mojombo/jekyll/wiki/install) to run a local server.
|
||||
Bootstrap's documentation, included in this repo in the `/docs` directory, is built with [Jekyll](http://jekyllrb.com) and publicly hosted on GitHub Pages at [http://getbootstrap.com](http://getbootstrap.com). The docs maybe also be run locally.
|
||||
|
||||
Documentation for [previous versions](https://github.com/twitter/bootstrap/tags) is also available via tags.
|
||||
### Running documentation locally
|
||||
|
||||
1. If necessary, [install Jekyll](http://jekyllrb.com/docs/installation).
|
||||
2. From the `/bootstrap` directory, run `jekyll serve` in the command line.
|
||||
3. Open [http://getbootstrap.dev:9001](http://getbootstrap.dev:9001) in your browser, and voilà.
|
||||
|
||||
Learn more about using Jekyll by reading their [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/docs](http://getbootstrap.com/2.3.2/docs) while folks transition to Bootstrap 3.
|
||||
|
||||
For previous releases, documentation is available for [download via Git tags](https://github.com/twitter/bootstrap/tags).
|
||||
|
||||
|
||||
|
||||
## Compiling CSS and JavaScript
|
||||
|
||||
Bootstrap includes a [makefile](Makefile) with convenient methods for working with the framework. Before getting started, be sure to install [the necessary local dependencies](package.json):
|
||||
Bootstrap includes a [makefile](Makefile) with convenient methods for working with the framework. Before getting started, install [the necessary local dependencies](package.json):
|
||||
|
||||
```
|
||||
$ npm install
|
||||
```
|
||||
|
||||
When completed, you'll be able to run the various make commands provided:
|
||||
When completed, you'll be able to run the various make commands provided.
|
||||
|
||||
### Available makefile commands
|
||||
|
||||
#### Build - `make`
|
||||
`make` runs the Recess compiler to rebuild the `/less` files and compile the docs. **Requires recess and uglify-js.**
|
||||
@@ -63,15 +68,19 @@ Runs jshint and qunit tests headlessly in [phantomjs](http://code.google.com/p/p
|
||||
#### Watch - `make watch`
|
||||
This is a convenience method for watching just Less files and automatically building them whenever you save. **Requires the watchr gem.**
|
||||
|
||||
Should you encounter problems with installing dependencies or running the makefile commands, uninstall any previous versions (global and local) you may have installed, and then rerun `npm install`.
|
||||
### Troubleshooting dependencies
|
||||
|
||||
Should you encounter problems with installing dependencies or running makefile commands, uninstall all previous dependency versions (global and local). Then, rerun `npm install`.
|
||||
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
Please submit all pull requests against *-wip branches. If your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the [Code Guide](http://github.com/mdo/code-guide), maintained by [Mark Otto](http://github.com/mdo).
|
||||
Please read through our guidelines for contributing to Bootstrap. Included are directions for opening issues, coding standards, and notes on development.
|
||||
|
||||
Editor preferences are also available in the [editor config](.editorconfig) for easy application in common text editors. Read more and download plugins at [http://editorconfig.com](http://editorconfig.com).
|
||||
More over, if your pull request contains JavaScript patches or features, you must include relevant unit tests. All HTML and CSS should conform to the [Code Guide](http://github.com/mdo/code-guide), maintained by [Mark Otto](http://github.com/mdo).
|
||||
|
||||
Editor preferences are available in the [editor config](.editorconfig) for easy use in common text editors. Read more and download plugins at [http://editorconfig.com](http://editorconfig.com).
|
||||
|
||||
|
||||
|
||||
|
@@ -8,5 +8,5 @@ permalink: pretty
|
||||
# Server
|
||||
source: ./docs
|
||||
destination: ./_gh_pages
|
||||
url: http://bootstrap.dev:9001
|
||||
server_port: 9001
|
||||
port: 9001
|
||||
url: http://getbootstrap.dev:9001
|
||||
|
@@ -1,35 +1,16 @@
|
||||
<!-- Footer
|
||||
================================================== -->
|
||||
<footer class="bs-docs-footer">
|
||||
<div class="bs-docs-container">
|
||||
<footer class="bs-footer">
|
||||
{% include social-buttons.html %}
|
||||
|
||||
<div class="bs-docs-social">
|
||||
<ul class="bs-docs-social-buttons">
|
||||
<li>
|
||||
<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=twitter&repo=bootstrap&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
|
||||
</li>
|
||||
<li>
|
||||
<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=twitter&repo=bootstrap&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="102px" height="20px"></iframe>
|
||||
</li>
|
||||
<li class="follow-btn">
|
||||
<a href="https://twitter.com/twbootstrap" class="twitter-follow-button" data-link-color="#0069D6" data-show-count="true">Follow @twbootstrap</a>
|
||||
</li>
|
||||
<li class="tweet-btn">
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://twitter.github.com/bootstrap/" data-count="horizontal" data-via="twbootstrap" data-related="mdo:Creator of Twitter Bootstrap">Tweet</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<p>Designed and built with all the love in the world by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>.</p>
|
||||
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
|
||||
<p><a href="http://glyphicons.com">Glyphicons Free</a> licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
|
||||
<ul class="footer-links">
|
||||
<li><a href="http://blog.getbootstrap.com">Blog</a></li>
|
||||
<li class="muted">·</li>
|
||||
<li><a href="https://github.com/twitter/bootstrap/issues?state=open">Issues</a></li>
|
||||
<li class="muted">·</li>
|
||||
<li><a href="https://github.com/twitter/bootstrap/blob/master/CHANGELOG.md">Changelog</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p>Designed and built with all the love in the world by <a href="http://twitter.com/mdo" target="_blank">@mdo</a> and <a href="http://twitter.com/fat" target="_blank">@fat</a>.</p>
|
||||
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
|
||||
<p><a href="http://glyphicons.com">Glyphicons Free</a> licensed under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
|
||||
<ul class="footer-links">
|
||||
<li><a href="http://blog.getbootstrap.com">Blog</a></li>
|
||||
<li class="muted">·</li>
|
||||
<li><a href="https://github.com/twitter/bootstrap/issues?state=open">Issues</a></li>
|
||||
<li class="muted">·</li>
|
||||
<li><a href="https://github.com/twitter/bootstrap/blob/master/CHANGELOG.md">Changelog</a></li>
|
||||
</ul>
|
||||
</footer>
|
||||
|
@@ -1,226 +0,0 @@
|
||||
<div class="bs-docs-sidebar">
|
||||
<ul class="nav bs-docs-sidenav">
|
||||
<h3 class="bs-docs-sidenav-heading"><a href="/">Bootstrap</a></h3>
|
||||
|
||||
<li><a href="#welcome">Welcome!</a></li>
|
||||
<li><a href="#getting-started">Getting started</a></li>
|
||||
<li><a href="#whats-included">What's included</a></li>
|
||||
<li><a href="#examples">Templates and examples</a></li>
|
||||
<li><a href="#customizing">Customizing Bootstrap</a></li>
|
||||
|
||||
<!-- CSS -->
|
||||
<li><a class="nav-header" href="#css">CSS</a></li>
|
||||
<li><a href="#css-overview">Overview</a></li>
|
||||
<li>
|
||||
<a href="#grid">Grid system</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#grid-example">Example usage</a></li>
|
||||
<li><a href="#grid-offsetting">Offset columns</a></li>
|
||||
<li><a href="#grid-nesting">Nested columns</a></li>
|
||||
<li><a href="#grid-column-ordering">Column ordering</a></li>
|
||||
<li><a href="#grid-small">Small device grid</a></li>
|
||||
<li><a href="#grid-less">LESS mixins and variables</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#type">Typography</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#type-headings">Headings</a></li>
|
||||
<li><a href="#type-body-copy">Body copy</a></li>
|
||||
<li><a href="#type-emphasis">Emphasis</a></li>
|
||||
<li><a href="#type-abbreviations">Abbreviations</a></li>
|
||||
<li><a href="#type-addresses">Addresses</a></li>
|
||||
<li><a href="#type-blockquotes">Blockquotes</a></li>
|
||||
<li><a href="#type-lists">Lists</a></li>
|
||||
<li><a href="#type-"></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#code">Code</a></li>
|
||||
<li>
|
||||
<a href="#tables">Tables</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#tables-example">Basic example</a></li>
|
||||
<li><a href="#tables-striped">Zebra striping</a></li>
|
||||
<li><a href="#tables-bordered">Bordered tables</a></li>
|
||||
<li><a href="#tables-hover-rows">Hover rows</a></li>
|
||||
<li><a href="#tables-condensed">Condensed tables</a></li>
|
||||
<li><a href="#tables-row-classes">Contextual row classes</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#forms">Forms</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#forms-example">Basic example</a></li>
|
||||
<li><a href="#forms-inline">Inline variation</a></li>
|
||||
<li><a href="#forms-horizontal">Horizontal variation</a></li>
|
||||
<li><a href="#forms-controls">Supported controls</a></li>
|
||||
<li><a href="#forms-control-states">Control states</a></li>
|
||||
<li><a href="#forms-input-groups">Input groups</a></li>
|
||||
<li><a href="#forms-control-sizes">Control sizing</a></li>
|
||||
<li><a href="#forms-actions">Form actions</a></li>
|
||||
<li><a href="#forms-help-text">Help text</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#buttons">Buttons</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#buttons-options">Button options</a></li>
|
||||
<li><a href="#buttons-sizes">Sizes</a></li>
|
||||
<li><a href="#buttons-disabled">Disabled</a></li>
|
||||
<li><a href="#buttons-tags">Button tags</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#images">Images</a></li>
|
||||
<li><a href="#helper-classes">Helper classes</a></li>
|
||||
<li><a href="#responsive-utilities">Responsive utilities</a></li>
|
||||
|
||||
<!-- Components -->
|
||||
<li><a class="nav-header" href="#components">Components</a></li>
|
||||
<li><a href="#icons">Glyphicons</a></li>
|
||||
<li>
|
||||
<a href="#dropdowns">Dropdowns</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#dropdowns-example">Example</a></li>
|
||||
<li><a href="#dropdowns-alignment">Alignment options</a></li>
|
||||
<li><a href="#dropdowns-disabled">Disabled menu items</a></li>
|
||||
<li><a href="#dropdowns-submenus">Submenus</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#btn-groups">Button groups</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#btn-groups-single">Basic button group</a></li>
|
||||
<li><a href="#btn-groups-toolbar">Button toolbar</a></li>
|
||||
<li><a href="#btn-groups-vertical">Vertical variation</a></li>
|
||||
<li><a href="#btn-groups-justified">Justified link buttons</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#btn-dropdowns">Button dropdowns</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#btn-dropdowns-single">Single button dropdown</a></li>
|
||||
<li><a href="#btn-dropdowns-split">Split button dropdown</a></li>
|
||||
<li><a href="#btn-dropdowns-sizes">Button sizes</a></li>
|
||||
<li><a href="#btn-dropdowns-dropup">Dropup variation</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#nav">Navs</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#nav-tabs">Tabs nav</a></li>
|
||||
<li><a href="#nav-pills">Pills nav</a></li>
|
||||
<li><a href="#nav-justified">Justified nav</a></li>
|
||||
<li><a href="#nav-disabled-links">Disabled links</a></li>
|
||||
<li><a href="#nav-alignment">Alignment options</a></li>
|
||||
<li><a href="#nav-dropdowns">Using dropdowns</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#navbar">Navbar</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#navbar-basic">Basic navbar</a></li>
|
||||
<li><a href="#navbar-nav">Nav links</a></li>
|
||||
<li><a href="#navbar-forms">Forms in navbars</a></li>
|
||||
<li><a href="#navbar-buttons">Buttons in navbars</a></li>
|
||||
<li><a href="#navbar-text">Text in navbars</a></li>
|
||||
<li><a href="#navbar-links">Links in navbars</a></li>
|
||||
<li><a href="#navbar-component-alignment">Component alignment</a></li>
|
||||
<li><a href="#navbar-fixed-top">Fixed top navbar</a></li>
|
||||
<li><a href="#navbar-fixed-bottom">Fixed bottom navbar</a></li>
|
||||
<li><a href="#navbar-static-top">Static top navbar</a></li>
|
||||
<li><a href="#navbar-responsive">Responsive navbar</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#breadcrumbs">Breadcrumbs</a></li>
|
||||
<li>
|
||||
<a href="#pagination">Pagination</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#pagination-default">Default pagination</a></li>
|
||||
<li><a href="#pagination-pager">Pager</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#labels">Labels</a></li>
|
||||
<li><a href="#badges">Badges</a></li>
|
||||
<li>
|
||||
<a href="#type-components">Typography</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#type-components-jumbotron">Jumbotron</a></li>
|
||||
<li><a href="#type-components-page-header">Page header</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#thumbnails">Thumbnails</a></li>
|
||||
<li>
|
||||
<a href="#alerts">Alerts</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#alerts-default">Default alert</a></li>
|
||||
<li><a href="#alerts-block">Block alerts</a></li>
|
||||
<li><a href="#alerts-alternatives">Contextual alternatives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#progress">Progress bars</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#progress-basic">Basic progress bar</a></li>
|
||||
<li><a href="#progress-alternatives">Contextual alternatives</a></li>
|
||||
<li><a href="#progress-striped">Striped</a></li>
|
||||
<li><a href="#progress-animated">Animated</a></li>
|
||||
<li><a href="#progress-stacked">Stacked</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#media">Media object</a></li>
|
||||
<li>
|
||||
<a href="#list-group">List group</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#list-group-basic">Basic list group</a></li>
|
||||
<li><a href="#list-group-chevrons">Chevrons</a></li>
|
||||
<li><a href="#list-group-badges">Badges</a></li>
|
||||
<li><a href="#list-group-badges-chevrons">Badges and chevrons</a></li>
|
||||
<li><a href="#list-group-linked">Linked items</a></li>
|
||||
<li><a href="#list-group-custom-content">Custom content</a></li>
|
||||
<!-- <li><a href="#list-group-pic">Leading picture</a></li> -->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#panels">Panels</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#panels-basic">Basic panel</a></li>
|
||||
<li><a href="#panels-heading">Panel with heading</a></li>
|
||||
<li><a href="#panels-alternatives">Contextual alternatives</a></li>
|
||||
<li><a href="#panels-list-group">With list groups</a>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#wells">Wells</a></li>
|
||||
|
||||
<!-- JavaScript -->
|
||||
<li><a class="nav-header" href="#js">JavaScript</a></li>
|
||||
<li>
|
||||
<a href="#js-overview">Overview</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#js-individual-compiled">Individual or compiled</a></li>
|
||||
<li><a href="#js-data-attributes">Data attributes</a></li>
|
||||
<li><a href="#js-programmatic-api">Programmatic API</a></li>
|
||||
<li><a href="#js-noconflict">No Conflict</a></li>
|
||||
<li><a href="#js-events">Evens</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#transitions">Transitions</a></li>
|
||||
<li>
|
||||
<a href="#modals">Modal</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#modals-examples">Examples</a></li>
|
||||
<li><a href="#modals-usage">Usage</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#dropdowns">Dropdown</a></li>
|
||||
<li><a href="#scrollspy">Scrollspy</a></li>
|
||||
<li><a href="#tabs">Tab</a></li>
|
||||
<li><a href="#tooltips">Tooltip</a></li>
|
||||
<li><a href="#popovers">Popover</a></li>
|
||||
<li><a href="#js-alerts">Alert</a></li>
|
||||
<li><a href="#js-buttons">Button</a></li>
|
||||
<li><a href="#collapse">Collapse</a></li>
|
||||
<li><a href="#carousel">Carousel</a></li>
|
||||
<li><a href="#typeahead">Typeahead</a></li>
|
||||
<li><a href="#affix">Affix</a></li>
|
||||
</ul>
|
||||
</div>
|
@@ -2,19 +2,7 @@
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="/assets/js/jquery.js"></script>
|
||||
<script src="/assets/js/bootstrap-transition.js"></script>
|
||||
<script src="/assets/js/bootstrap-alert.js"></script>
|
||||
<script src="/assets/js/bootstrap-modal.js"></script>
|
||||
<script src="/assets/js/bootstrap-dropdown.js"></script>
|
||||
<script src="/assets/js/bootstrap-scrollspy.js"></script>
|
||||
<script src="/assets/js/bootstrap-tab.js"></script>
|
||||
<script src="/assets/js/bootstrap-tooltip.js"></script>
|
||||
<script src="/assets/js/bootstrap-popover.js"></script>
|
||||
<script src="/assets/js/bootstrap-button.js"></script>
|
||||
<script src="/assets/js/bootstrap-collapse.js"></script>
|
||||
<script src="/assets/js/bootstrap-carousel.js"></script>
|
||||
<script src="/assets/js/bootstrap-typeahead.js"></script>
|
||||
<script src="/assets/js/bootstrap-affix.js"></script>
|
||||
<script src="/assets/js/bootstrap.js"></script>
|
||||
|
||||
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
|
||||
<script src="/assets/js/holder/holder.js"></script>
|
||||
|
122
docs/_includes/nav-components.html
Normal file
122
docs/_includes/nav-components.html
Normal file
@@ -0,0 +1,122 @@
|
||||
<li>
|
||||
<a href="#icons">Glyphicons</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#icons-list">Icon list</a></li>
|
||||
<li><a href="#icons-how-to">How to use</a></li>
|
||||
<li><a href="#icons-examples">Examples</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#dropdowns">Dropdowns</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#dropdowns-example">Example</a></li>
|
||||
<li><a href="#dropdowns-alignment">Alignment options</a></li>
|
||||
<li><a href="#dropdowns-disabled">Disabled menu items</a></li>
|
||||
<li><a href="#dropdowns-submenus">Submenus</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#btn-groups">Button groups</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#btn-groups-single">Basic button group</a></li>
|
||||
<li><a href="#btn-groups-toolbar">Button toolbar</a></li>
|
||||
<li><a href="#btn-groups-vertical">Vertical variation</a></li>
|
||||
<li><a href="#btn-groups-justified">Justified link buttons</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#btn-dropdowns">Button dropdowns</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#btn-dropdowns-single">Single button dropdown</a></li>
|
||||
<li><a href="#btn-dropdowns-split">Split button dropdown</a></li>
|
||||
<li><a href="#btn-dropdowns-sizes">Button sizes</a></li>
|
||||
<li><a href="#btn-dropdowns-dropup">Dropup variation</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#nav">Navs</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#nav-tabs">Tabs nav</a></li>
|
||||
<li><a href="#nav-pills">Pills nav</a></li>
|
||||
<li><a href="#nav-justified">Justified nav</a></li>
|
||||
<li><a href="#nav-disabled-links">Disabled links</a></li>
|
||||
<li><a href="#nav-alignment">Alignment options</a></li>
|
||||
<li><a href="#nav-dropdowns">Using dropdowns</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#navbar">Navbar</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#navbar-basic">Basic navbar</a></li>
|
||||
<li><a href="#navbar-nav">Nav links</a></li>
|
||||
<li><a href="#navbar-forms">Forms in navbars</a></li>
|
||||
<li><a href="#navbar-buttons">Buttons in navbars</a></li>
|
||||
<li><a href="#navbar-text">Text in navbars</a></li>
|
||||
<li><a href="#navbar-links">Links in navbars</a></li>
|
||||
<li><a href="#navbar-component-alignment">Component alignment</a></li>
|
||||
<li><a href="#navbar-fixed-top">Fixed top navbar</a></li>
|
||||
<li><a href="#navbar-fixed-bottom">Fixed bottom navbar</a></li>
|
||||
<li><a href="#navbar-static-top">Static top navbar</a></li>
|
||||
<li><a href="#navbar-responsive">Responsive navbar</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#breadcrumbs">Breadcrumbs</a></li>
|
||||
<li>
|
||||
<a href="#pagination">Pagination</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#pagination-default">Default pagination</a></li>
|
||||
<li><a href="#pagination-pager">Pager</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#labels">Labels</a></li>
|
||||
<li><a href="#badges">Badges</a></li>
|
||||
<li>
|
||||
<a href="#type-components">Typography</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#type-components-jumbotron">Jumbotron</a></li>
|
||||
<li><a href="#type-components-page-header">Page header</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#thumbnails">Thumbnails</a></li>
|
||||
<li>
|
||||
<a href="#alerts">Alerts</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#alerts-default">Default alert</a></li>
|
||||
<li><a href="#alerts-block">Block alerts</a></li>
|
||||
<li><a href="#alerts-alternatives">Contextual alternatives</a></li>
|
||||
<li><a href="#alerts-links">Links in alerts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#progress">Progress bars</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#progress-basic">Basic progress bar</a></li>
|
||||
<li><a href="#progress-alternatives">Contextual alternatives</a></li>
|
||||
<li><a href="#progress-striped">Striped</a></li>
|
||||
<li><a href="#progress-animated">Animated</a></li>
|
||||
<li><a href="#progress-stacked">Stacked</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#media">Media object</a></li>
|
||||
<li>
|
||||
<a href="#list-group">List group</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#list-group-basic">Basic list group</a></li>
|
||||
<li><a href="#list-group-chevrons">Chevrons</a></li>
|
||||
<li><a href="#list-group-badges">Badges</a></li>
|
||||
<li><a href="#list-group-badges-chevrons">Badges and chevrons</a></li>
|
||||
<li><a href="#list-group-linked">Linked items</a></li>
|
||||
<li><a href="#list-group-custom-content">Custom content</a></li>
|
||||
<!-- <li><a href="#list-group-pic">Leading picture</a></li> -->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#panels">Panels</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#panels-basic">Basic panel</a></li>
|
||||
<li><a href="#panels-heading">Panel with heading</a></li>
|
||||
<li><a href="#panels-alternatives">Contextual alternatives</a></li>
|
||||
<li><a href="#panels-list-group">With list groups</a>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#wells">Wells</a></li>
|
71
docs/_includes/nav-css.html
Normal file
71
docs/_includes/nav-css.html
Normal file
@@ -0,0 +1,71 @@
|
||||
<li>
|
||||
<a href="#overview">Overview</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#overview-doctype">HTML5 doctype</a></li>
|
||||
<li><a href="#overview-mobile">Mobile first</a></li>
|
||||
<li><a href="#overview-responsive-images">Responsive images</a></li>
|
||||
<li><a href="#overview-type-links">Type and links</a></li>
|
||||
<li><a href="#overview-normalize">Normalize</a></li>
|
||||
<li><a href="#overview-container">Container</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#grid">Grid system</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#grid-example">Example usage</a></li>
|
||||
<li><a href="#grid-offsetting">Offset columns</a></li>
|
||||
<li><a href="#grid-nesting">Nested columns</a></li>
|
||||
<li><a href="#grid-column-ordering">Column ordering</a></li>
|
||||
<li><a href="#grid-small">Small device grid</a></li>
|
||||
<li><a href="#grid-less">LESS mixins and variables</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#type">Typography</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#type-headings">Headings</a></li>
|
||||
<li><a href="#type-body-copy">Body copy</a></li>
|
||||
<li><a href="#type-emphasis">Emphasis</a></li>
|
||||
<li><a href="#type-abbreviations">Abbreviations</a></li>
|
||||
<li><a href="#type-addresses">Addresses</a></li>
|
||||
<li><a href="#type-blockquotes">Blockquotes</a></li>
|
||||
<li><a href="#type-lists">Lists</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#code">Code</a></li>
|
||||
<li>
|
||||
<a href="#tables">Tables</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#tables-example">Basic example</a></li>
|
||||
<li><a href="#tables-striped">Zebra striping</a></li>
|
||||
<li><a href="#tables-bordered">Bordered tables</a></li>
|
||||
<li><a href="#tables-hover-rows">Hover rows</a></li>
|
||||
<li><a href="#tables-condensed">Condensed tables</a></li>
|
||||
<li><a href="#tables-row-classes">Contextual row classes</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#forms">Forms</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#forms-example">Basic example</a></li>
|
||||
<li><a href="#forms-inline">Inline variation</a></li>
|
||||
<li><a href="#forms-horizontal">Horizontal variation</a></li>
|
||||
<li><a href="#forms-controls">Supported controls</a></li>
|
||||
<li><a href="#forms-control-states">Control states</a></li>
|
||||
<li><a href="#forms-input-groups">Input groups</a></li>
|
||||
<li><a href="#forms-control-sizes">Control sizing</a></li>
|
||||
<li><a href="#forms-help-text">Help text</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#buttons">Buttons</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#buttons-options">Button options</a></li>
|
||||
<li><a href="#buttons-sizes">Sizes</a></li>
|
||||
<li><a href="#buttons-disabled">Disabled</a></li>
|
||||
<li><a href="#buttons-tags">Button tags</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#images">Images</a></li>
|
||||
<li><a href="#helper-classes">Helper classes</a></li>
|
||||
<li><a href="#responsive-utilities">Responsive utilities</a></li>
|
32
docs/_includes/nav-customize.html
Normal file
32
docs/_includes/nav-customize.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<li>
|
||||
<a href="#less">LESS components</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#plugins">jQuery plugins</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#variables">LESS variables</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#variables-basics">Basics</a></li>
|
||||
<li><a href="#variables-buttons">Buttons</a></li>
|
||||
<li><a href="#variables-form-states">Form states</a></li>
|
||||
<li><a href="#variables-alerts">Alerts</a></li>
|
||||
<li><a href="#variables-navbar">Navbar</a></li>
|
||||
<li><a href="#variables-tables">Tables</a></li>
|
||||
<li><a href="#variables-forms">Forms</a></li>
|
||||
<li><a href="#variables-dropdowns">Dropdowns</a></li>
|
||||
<li><a href="#variables-panels-wells">Panels and wells</a></li>
|
||||
<li><a href="#variables-jumbotron">Jumbotron</a></li>
|
||||
<li><a href="#variables-modals">Modals</a></li>
|
||||
<li><a href="#variables-list-group">List group</a></li>
|
||||
<li><a href="#variables-thumbnails">Thumbnails</a></li>
|
||||
<li><a href="#variables-progress">Progress bars</a></li>
|
||||
<li><a href="#variables-pagination">Pagination</a></li>
|
||||
<li><a href="#variables-labels">Labels</a></li>
|
||||
<li><a href="#variables-tooltips-popovers">Tooltips and popovers</a></li>
|
||||
<li><a href="#variables-other">Other</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#download">Download</a>
|
||||
</li>
|
20
docs/_includes/nav-getting-started.html
Normal file
20
docs/_includes/nav-getting-started.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<li>
|
||||
<a href="#download">Download Bootstrap</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#download-options">Download options</a></li>
|
||||
<li><a href="#download-cdn">Bootstrap CDN</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#whats-included">What's included</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#examples">Templates and examples</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#examples-template">HTML template</a></li>
|
||||
<li><a href="#examples-list">List of examples</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#customizing">Customizing Bootstrap</a>
|
||||
</li>
|
28
docs/_includes/nav-javascript.html
Normal file
28
docs/_includes/nav-javascript.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<li>
|
||||
<a href="#js-overview">Overview</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#js-individual-compiled">Individual or compiled</a></li>
|
||||
<li><a href="#js-data-attributes">Data attributes</a></li>
|
||||
<li><a href="#js-programmatic-api">Programmatic API</a></li>
|
||||
<li><a href="#js-noconflict">No Conflict</a></li>
|
||||
<li><a href="#js-events">Events</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#transitions">Transitions</a></li>
|
||||
<li>
|
||||
<a href="#modals">Modal</a>
|
||||
<ul class="nav">
|
||||
<li><a href="#modals-examples">Examples</a></li>
|
||||
<li><a href="#modals-usage">Usage</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#dropdowns">Dropdown</a></li>
|
||||
<li><a href="#scrollspy">Scrollspy</a></li>
|
||||
<li><a href="#tabs">Tab</a></li>
|
||||
<li><a href="#tooltips">Tooltip</a></li>
|
||||
<li><a href="#popovers">Popover</a></li>
|
||||
<li><a href="#js-alerts">Alert</a></li>
|
||||
<li><a href="#js-buttons">Button</a></li>
|
||||
<li><a href="#collapse">Collapse</a></li>
|
||||
<li><a href="#carousel">Carousel</a></li>
|
||||
<li><a href="#affix">Affix</a></li>
|
29
docs/_includes/nav-main.html
Normal file
29
docs/_includes/nav-main.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="navbar navbar-inverse navbar-fixed-top bs-docs-nav">
|
||||
<div class="container">
|
||||
<a href="/" class="navbar-brand">Bootstrap</a>
|
||||
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<div class="nav-collapse collapse bs-navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li{% if page.slug == "getting-started" %} class="active"{% endif %}>
|
||||
<a href="/getting-started">Getting started</a>
|
||||
</li>
|
||||
<li{% if page.slug == "css" %} class="active"{% endif %}>
|
||||
<a href="/css">CSS</a>
|
||||
</li>
|
||||
<li{% if page.slug == "components" %} class="active"{% endif %}>
|
||||
<a href="/components">Components</a>
|
||||
</li>
|
||||
<li{% if page.slug == "js" %} class="active"{% endif %}>
|
||||
<a href="/javascript">JavaScript</a>
|
||||
</li>
|
||||
<li{% if page.slug == "customize" %} class="active"{% endif %}>
|
||||
<a href="/customize">Customize</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -1,34 +0,0 @@
|
||||
<!-- Navbar
|
||||
================================================== -->
|
||||
<div class="navbar navbar-inverse navbar-fixed-left bs-docs-navbar">
|
||||
<div class="container">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/">B</a>
|
||||
<div class="nav-collapse collapse">
|
||||
<ul class="nav">
|
||||
<!-- <li {% if page.title == "Bootstrap" %}class="active"{% endif %}>
|
||||
<a href="/"><span class="glyphicon glyphicon-home"></span></a>
|
||||
</li>
|
||||
--> <li {% if page.title == "Getting started" %}class="active"{% endif %}>
|
||||
<a href="/getting-started" data-toggle="tooltip" data-placement="right" title="Getting started"><span class="glyphicon glyphicon-list"></span></a>
|
||||
</li>
|
||||
<li {% if page.title == "CSS" %}class="active"{% endif %}>
|
||||
<a href="/css" data-toggle="tooltip" data-placement="right" title="CSS"><span class="glyphicon glyphicon-tint"></span></a>
|
||||
</li>
|
||||
<li {% if page.title == "Components" %}class="active"{% endif %}>
|
||||
<a href="/components" data-toggle="tooltip" data-placement="right" title="Components"><span class="glyphicon glyphicon-fire"></span></a>
|
||||
</li>
|
||||
<li {% if page.title == "JavaScript plugins" %}class="active"{% endif %}>
|
||||
<a href="/javascript" data-toggle="tooltip" data-placement="right" title="JavaScript plugins"><span class="glyphicon glyphicon-dashboard"></span></a>
|
||||
</li>
|
||||
<li {% if page.title == "Customize and download" %}class="active"{% endif %}>
|
||||
<a href="/customize" data-toggle="tooltip" data-placement="right" title="Customize"><span class="glyphicon glyphicon-cog"></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
16
docs/_includes/social-buttons.html
Normal file
16
docs/_includes/social-buttons.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="bs-social">
|
||||
<ul class="bs-social-buttons">
|
||||
<li>
|
||||
<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=twitter&repo=bootstrap&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
|
||||
</li>
|
||||
<li>
|
||||
<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=twitter&repo=bootstrap&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="102px" height="20px"></iframe>
|
||||
</li>
|
||||
<li class="follow-btn">
|
||||
<a href="https://twitter.com/twbootstrap" class="twitter-follow-button" data-link-color="#0069D6" data-show-count="true">Follow @twbootstrap</a>
|
||||
</li>
|
||||
<li class="tweet-btn">
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://twitter.github.com/bootstrap/" data-count="horizontal" data-via="twbootstrap" data-related="mdo:Creator of Twitter Bootstrap">Tweet</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
@@ -5,13 +5,49 @@
|
||||
{% include header.html %}
|
||||
<!-- Place anything custom after this. -->
|
||||
</head>
|
||||
<body class="bs-docs-docs" data-spy="scroll" data-target=".bs-docs-sidebar">
|
||||
<body data-spy="scroll" data-target=".bs-sidebar">
|
||||
|
||||
<!-- Docs nav -->
|
||||
{% include docs-nav.html %}
|
||||
<!-- Docs master nav -->
|
||||
{% include nav-main.html %}
|
||||
|
||||
<!-- Page content of course! -->
|
||||
{{ content }}
|
||||
<!-- Docs page layout -->
|
||||
<div class="bs-header">
|
||||
<div class="container">
|
||||
<h1>{{ page.title }}</h1>
|
||||
<p>{{ page.lead }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container bs-docs-container">
|
||||
<div class="row">
|
||||
<div class="col col-lg-3">
|
||||
<div class="bs-sidebar">
|
||||
<ul class="nav bs-sidenav">
|
||||
{% if page.slug == "getting-started" %}
|
||||
{% include nav-getting-started.html %}
|
||||
{% elsif page.slug == "css" %}
|
||||
{% include nav-css.html %}
|
||||
{% elsif page.slug == "components" %}
|
||||
{% include nav-components.html %}
|
||||
{% elsif page.slug == "js" %}
|
||||
{% include nav-javascript.html %}
|
||||
{% elsif page.slug == "customize" %}
|
||||
{% include nav-customize.html %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-lg-9">
|
||||
{{ content }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Quick back to top -->
|
||||
<a href="#" class="bs-top">
|
||||
Back to top
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Main docs footer (social buttons, copyright, etc). -->
|
||||
{% include colophon.html %}
|
||||
|
@@ -7,6 +7,9 @@
|
||||
</head>
|
||||
<body class="bs-docs-home">
|
||||
|
||||
<!-- Docs master nav -->
|
||||
{% include nav-main.html %}
|
||||
|
||||
<!-- Page content of course! -->
|
||||
{{ content }}
|
||||
|
||||
|
900
docs/assets/css/bootstrap.css
vendored
900
docs/assets/css/bootstrap.css
vendored
File diff suppressed because it is too large
Load Diff
@@ -10,94 +10,60 @@
|
||||
|
||||
body {
|
||||
position: relative; /* For scrollyspy */
|
||||
/* We add the padding to the body for >768px only */
|
||||
}
|
||||
|
||||
hr {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.bs-docs-dl-options h4 {
|
||||
margin-top: 15px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.bs-docs-container,
|
||||
.bs-home-container {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
.bs-docs-container {
|
||||
max-width: 860px;
|
||||
}
|
||||
.bs-docs-container .row {
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
}
|
||||
|
||||
/* Side notes for calling out things */
|
||||
.bs-docs-sidenote {
|
||||
margin: 20px 0;
|
||||
padding: 15px 30px 15px 15px;
|
||||
background-color: #fcf2f2;
|
||||
border-left: 5px solid #df7c7b;
|
||||
}
|
||||
.bs-docs-sidenote h4 {
|
||||
margin-top: 0;
|
||||
}
|
||||
.bs-docs-sidenote p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.bs-docs-sidenote code,
|
||||
.bs-docs-sidenote .highlight {
|
||||
background-color: #fff;
|
||||
padding-top: 50px; /* Account for fixed navbar */
|
||||
}
|
||||
|
||||
|
||||
/* Sections
|
||||
|
||||
/* Top nav and header
|
||||
-------------------------------------------------- */
|
||||
|
||||
/* Padding for in-page bookmarks */
|
||||
section,
|
||||
.bs-docs-section {
|
||||
padding-top: 30px;
|
||||
.bs-docs-nav {
|
||||
background-color: #b94a48;
|
||||
}
|
||||
|
||||
/* Few stylistic typography tweaks */
|
||||
section > .page-header,
|
||||
section > .lead {
|
||||
color: #5a5a5a;
|
||||
.bs-docs-nav .navbar-brand {
|
||||
color: #fff;
|
||||
}
|
||||
section > ul li {
|
||||
margin-bottom: 5px;
|
||||
.bs-docs-nav .navbar-nav > li > a {
|
||||
color: #e6cac8;
|
||||
}
|
||||
.bs-docs-nav .navbar-nav > li > a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.bs-docs-nav .navbar-nav > .active > a,
|
||||
.bs-docs-nav .navbar-nav > .active > a:hover {
|
||||
color: #fff;
|
||||
background-color: #993c3a;
|
||||
}
|
||||
.bs-docs-nav .navbar-toggle {
|
||||
border-color: #b94a48;
|
||||
}
|
||||
.bs-docs-nav .navbar-toggle:hover {
|
||||
background-color: #993c3a;
|
||||
border-color: #993c3a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Jumbotrons
|
||||
/* Homepage masthead
|
||||
-------------------------------------------------- */
|
||||
|
||||
.bs-docs-section-header {
|
||||
padding-top: 60px;
|
||||
color: #b94a48;
|
||||
border-bottom: 5px solid #b94a48;
|
||||
}
|
||||
|
||||
/* Base class */
|
||||
.bs-docs-jumbotron {
|
||||
.bs-masthead {
|
||||
position: relative;
|
||||
margin-bottom: 20px;
|
||||
padding: 30px 15px;
|
||||
text-align: center;
|
||||
}
|
||||
.bs-docs-jumbotron h1 {
|
||||
.bs-masthead h1 {
|
||||
font-size: 50px;
|
||||
line-height: 1;
|
||||
}
|
||||
.bs-masthead .bs-social {
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
/* Download button */
|
||||
.bs-docs-jumbotron .btn {
|
||||
.bs-masthead .btn {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
padding: 18px 24px;
|
||||
@@ -106,28 +72,174 @@ section > ul li {
|
||||
background-color: #fff;
|
||||
border-color: #e5e5e5;
|
||||
}
|
||||
.bs-docs-jumbotron .btn:hover,
|
||||
.bs-docs-jumbotron .btn:active {
|
||||
.bs-masthead .btn:hover,
|
||||
.bs-masthead .btn:active {
|
||||
color: #fff; /* redeclare to override the `.jumbotron a` */
|
||||
background-color: #b94a48;
|
||||
border-color: #b94a48;
|
||||
}
|
||||
|
||||
/* Textual links in masthead */
|
||||
.masthead-links {
|
||||
/* Textual links */
|
||||
.bs-masthead-links {
|
||||
margin: 20px 0;
|
||||
list-style: none;
|
||||
}
|
||||
.masthead-links li {
|
||||
.bs-masthead-links li {
|
||||
display: inline;
|
||||
color: #999;
|
||||
}
|
||||
.masthead-links li + li {
|
||||
.bs-masthead-links li + li {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Customize and Download button
|
||||
-------------------------------------------------- */
|
||||
|
||||
.bs-customizer {
|
||||
|
||||
}
|
||||
.bs-customizer .toggle {
|
||||
float: right;
|
||||
}
|
||||
.bs-customizer label {
|
||||
margin-top: 10px;
|
||||
font-weight: 500;
|
||||
color: #555;
|
||||
}
|
||||
.bs-customizer h4 {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.bs-customizer input[type="text"] {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
|
||||
.bs-customize-download {
|
||||
text-align:center;
|
||||
}
|
||||
.bs-customize-download .btn {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
padding: 18px 24px;
|
||||
font-size: 21px;
|
||||
color: #b94a48;
|
||||
background-color: #fff;
|
||||
border-color: #b94a48;
|
||||
}
|
||||
.bs-customize-download .btn:hover,
|
||||
.bs-customize-download .btn:active {
|
||||
color: #fff;
|
||||
background-color: #b94a48;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Docs pages and sections
|
||||
-------------------------------------------------- */
|
||||
|
||||
/* Page headers */
|
||||
.bs-header {
|
||||
padding: 30px 30px 40px;
|
||||
font-size: 16px;
|
||||
color: #5a5a5a;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
.bs-header h1 {
|
||||
color: #b94a48;
|
||||
}
|
||||
.bs-header p {
|
||||
font-weight: 300;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* Padding for in-page bookmarks */
|
||||
.bs-docs-section {
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Docs sidebar
|
||||
-------------------------------------------------- */
|
||||
|
||||
/* By default it's not affixed in mobile views, so undo that */
|
||||
.bs-sidebar.affix {
|
||||
position: static;
|
||||
}
|
||||
|
||||
/* First level of nav */
|
||||
.bs-sidenav {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/* All levels of nav */
|
||||
.bs-sidebar .nav > li > a {
|
||||
display: block;
|
||||
color: #666;
|
||||
padding: 4px 20px;
|
||||
}
|
||||
.bs-sidebar .nav > li > a:hover,
|
||||
.bs-sidebar .nav > li > a:focus {
|
||||
text-decoration: none;
|
||||
border-right: 1px solid #d5d5d5;
|
||||
}
|
||||
.bs-sidebar .nav > .active > a,
|
||||
.bs-sidebar .nav > .active:hover > a,
|
||||
.bs-sidebar .nav > .active:focus > a {
|
||||
font-weight: 500;
|
||||
color: #b94a48;
|
||||
background-color: transparent;
|
||||
border-right: 1px solid #b94a48;
|
||||
}
|
||||
|
||||
/* Nav: second level (shown on .active) */
|
||||
.bs-sidebar .nav .nav {
|
||||
display: none;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.bs-sidebar .nav > .active > ul {
|
||||
display: block;
|
||||
}
|
||||
.bs-sidebar .nav .nav > li > a {
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding-left: 30px;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Side notes for calling out things
|
||||
-------------------------------------------------- */
|
||||
|
||||
.bs-callout {
|
||||
margin: 20px 0;
|
||||
padding: 15px 30px 15px 15px;
|
||||
background-color: #fcf2f2;
|
||||
border-left: 5px solid #df7c7b;
|
||||
}
|
||||
.bs-callout h4 {
|
||||
margin-top: 0;
|
||||
}
|
||||
.bs-callout p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.bs-callout code,
|
||||
.bs-callout .highlight {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Special grid styles
|
||||
-------------------------------------------------- */
|
||||
|
||||
@@ -146,96 +258,11 @@ section > ul li {
|
||||
|
||||
|
||||
|
||||
/* Sidenav
|
||||
-------------------------------------------------- */
|
||||
|
||||
.bs-docs-sidebar {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 240px;
|
||||
overflow-y: scroll;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: #f5f5f5;
|
||||
box-shadow: inset -1px 0 0 #e5e5e5;
|
||||
}
|
||||
|
||||
/* Nav: first level */
|
||||
.bs-docs-sidebar > .nav {
|
||||
margin: 0 0 25px 0;
|
||||
}
|
||||
.bs-docs-sidebar .nav > li > a {
|
||||
display: block;
|
||||
color: #666;
|
||||
padding: 4px 25px;
|
||||
}
|
||||
.bs-docs-sidebar .nav > li > a:hover,
|
||||
.bs-docs-sidebar .nav > li > a:focus {
|
||||
text-decoration: none;
|
||||
border-right: 1px solid #d5d5d5;
|
||||
}
|
||||
.bs-docs-sidebar .nav > .active > a,
|
||||
.bs-docs-sidebar .nav > .active:hover > a,
|
||||
.bs-docs-sidebar .nav > .active:focus > a {
|
||||
font-weight: 500;
|
||||
color: #b94a48;
|
||||
background-color: transparent;
|
||||
border-right: 1px solid #b94a48;
|
||||
}
|
||||
|
||||
/* Nav: second level (shown on .active) */
|
||||
.bs-docs-sidebar .nav .nav {
|
||||
display: none;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.bs-docs-sidebar .nav > .active > ul {
|
||||
display: block;
|
||||
}
|
||||
.bs-docs-sidebar .nav .nav > li > a {
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding-left: 40px;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.bs-docs-sidenav-heading {
|
||||
margin: 0 0 25px;
|
||||
}
|
||||
.bs-docs-sidenav-heading a {
|
||||
display: block;
|
||||
padding: 15px 25px;
|
||||
color: #b94a48;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
box-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
.bs-docs-sidenav-heading a:hover {
|
||||
color: #a3403e;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Section headings for groups of links */
|
||||
.bs-docs-sidenav > li > .nav-header {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 5px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
.bs-docs-sidenav > .active > .nav-header,
|
||||
.bs-docs-sidenav > .active > .nav-header:hover {
|
||||
color: #333;
|
||||
border-color: #333;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Bootstrap code examples
|
||||
-------------------------------------------------- */
|
||||
|
||||
/* Base class */
|
||||
.bs-docs-example {
|
||||
.bs-example {
|
||||
position: relative;
|
||||
padding: 39px 14px 14px;
|
||||
margin-bottom: -1px;
|
||||
@@ -244,7 +271,7 @@ section > ul li {
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
/* Echo out a label for the example */
|
||||
.bs-docs-example:after {
|
||||
.bs-example:after {
|
||||
content: "Example";
|
||||
position: absolute;
|
||||
top: -1px;
|
||||
@@ -260,56 +287,70 @@ section > ul li {
|
||||
}
|
||||
|
||||
/* Tweak display of the examples */
|
||||
.bs-docs-example + .prettyprint,
|
||||
.bs-docs-example + .highlight {
|
||||
.bs-example + .prettyprint,
|
||||
.bs-example + .highlight {
|
||||
margin-top: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
|
||||
/* Tweak content of examples for optimum awesome */
|
||||
.bs-docs-example > p:last-child,
|
||||
.bs-docs-example > ul:last-child,
|
||||
.bs-docs-example > ol:last-child,
|
||||
.bs-docs-example > blockquote:last-child,
|
||||
.bs-docs-example > input:last-child,
|
||||
.bs-docs-example > select:last-child,
|
||||
.bs-docs-example > textarea:last-child,
|
||||
.bs-docs-example > .table:last-child,
|
||||
.bs-docs-example > .jumbotron:last-child,
|
||||
.bs-docs-example > .alert:last-child,
|
||||
.bs-docs-example > .panel:last-child,
|
||||
.bs-docs-example > .list-group:last-child,
|
||||
.bs-docs-example > .well:last-child {
|
||||
.bs-example > p:last-child,
|
||||
.bs-example > ul:last-child,
|
||||
.bs-example > ol:last-child,
|
||||
.bs-example > blockquote:last-child,
|
||||
.bs-example > input:last-child,
|
||||
.bs-example > select:last-child,
|
||||
.bs-example > textarea:last-child,
|
||||
.bs-example > .table:last-child,
|
||||
.bs-example > .navbar:last-child
|
||||
.bs-example > .jumbotron:last-child,
|
||||
.bs-example > .alert:last-child,
|
||||
.bs-example > .panel:last-child,
|
||||
.bs-example > .list-group:last-child,
|
||||
.bs-example > .well:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.bs-example > .close {
|
||||
float: none;
|
||||
}
|
||||
|
||||
/* Typography */
|
||||
.bs-docs-example-type .table td {
|
||||
.bs-example-type .table td {
|
||||
color: #999;
|
||||
vertical-align: middle;
|
||||
border-color: ;
|
||||
}
|
||||
.bs-docs-example-type .table td,
|
||||
.bs-docs-example-type .table th {
|
||||
.bs-example-type .table td,
|
||||
.bs-example-type .table th {
|
||||
padding: 15px 0;
|
||||
border-color: #eee;
|
||||
}
|
||||
.bs-docs-example-type .table tr:first-child td,
|
||||
.bs-docs-example-type .table tr:first-child th {
|
||||
.bs-example-type .table tr:first-child td,
|
||||
.bs-example-type .table tr:first-child th {
|
||||
border-top: 0;
|
||||
}
|
||||
.bs-docs-example-type h1,
|
||||
.bs-docs-example-type h2,
|
||||
.bs-docs-example-type h3,
|
||||
.bs-docs-example-type h4,
|
||||
.bs-docs-example-type h5,
|
||||
.bs-docs-example-type h6 {
|
||||
.bs-example-type h1,
|
||||
.bs-example-type h2,
|
||||
.bs-example-type h3,
|
||||
.bs-example-type h4,
|
||||
.bs-example-type h5,
|
||||
.bs-example-type h6 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.bs-example.form-inline select,
|
||||
.bs-example.form-inline input[type="text"],
|
||||
.bs-example.form-inline input[type="password"] {
|
||||
width: 180px;
|
||||
}
|
||||
.bs-example-control-sizing input[type="text"] + input[type="text"] {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* List groups */
|
||||
.bs-docs-example > .list-group {
|
||||
.bs-example > .list-group {
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
@@ -355,10 +396,10 @@ section > ul li {
|
||||
}
|
||||
|
||||
/* Example modals */
|
||||
.bs-docs-example-modal {
|
||||
.bs-example-modal {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
.bs-docs-example-modal .modal {
|
||||
.bs-example-modal .modal {
|
||||
position: relative;
|
||||
top: auto;
|
||||
right: auto;
|
||||
@@ -367,49 +408,49 @@ section > ul li {
|
||||
z-index: 1;
|
||||
display: block;
|
||||
}
|
||||
.bs-docs-example-modal .modal-dialog {
|
||||
.bs-example-modal .modal-dialog {
|
||||
left: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
/* Example dropdowns */
|
||||
.bs-docs-example > .dropdown > .dropdown-menu,
|
||||
.bs-docs-example-submenu > .pull-left > .dropup > .dropdown-menu,
|
||||
.bs-docs-example-submenu > .pull-left > .dropdown > .dropdown-menu {
|
||||
.bs-example > .dropdown > .dropdown-menu,
|
||||
.bs-example-submenu > .pull-left > .dropup > .dropdown-menu,
|
||||
.bs-example-submenu > .pull-left > .dropdown > .dropdown-menu {
|
||||
position: static;
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.bs-docs-example-submenu {
|
||||
.bs-example-submenu {
|
||||
min-height: 230px;
|
||||
}
|
||||
.bs-docs-example-submenu > .pull-left + .pull-left {
|
||||
.bs-example-submenu > .pull-left + .pull-left {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/* Example tabbable tabs */
|
||||
.bs-docs-example-tabs .nav-tabs {
|
||||
.bs-example-tabs .nav-tabs {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/* Tooltips */
|
||||
.bs-docs-tooltip-examples {
|
||||
.bs-example-tooltips {
|
||||
text-align: center;
|
||||
margin: 0 0 10px;
|
||||
list-style: none;
|
||||
}
|
||||
.bs-docs-tooltip-examples li {
|
||||
.bs-example-tooltips li {
|
||||
display: inline;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
/* Popovers */
|
||||
.bs-docs-example-popover {
|
||||
.bs-example-popover {
|
||||
padding-bottom: 24px;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
.bs-docs-example-popover .popover {
|
||||
.bs-example-popover .popover {
|
||||
position: relative;
|
||||
display: block;
|
||||
float: left;
|
||||
@@ -418,13 +459,14 @@ section > ul li {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Example templates
|
||||
-------------------------------------------------- */
|
||||
|
||||
.bs-docs-examples h4 {
|
||||
.bs-examples h4 {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.bs-docs-examples p {
|
||||
.bs-examples p {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
@@ -510,31 +552,25 @@ section > ul li {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 25%;
|
||||
height: 43px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
line-height: 43px;
|
||||
color: #999;
|
||||
text-align: center;
|
||||
border: 1px solid #ddd;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.responsive-utilities-test li + li {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.responsive-utilities-test span {
|
||||
position: absolute;
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
right: -1px;
|
||||
bottom: -1px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
padding: 15px 10px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
line-height: 1.1;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.responsive-utilities-test span {
|
||||
.responsive-utilities-test.visible-on [class*="hidden"],
|
||||
.responsive-utilities-test.hidden-on [class*="visible"] {
|
||||
color: #999;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.responsive-utilities-test.visible-on [class*="visible"],
|
||||
.responsive-utilities-test.hidden-on [class*="hidden"] {
|
||||
color: #468847;
|
||||
background-color: #dff0d8;
|
||||
border: 1px solid #d6e9c6;
|
||||
@@ -545,13 +581,14 @@ section > ul li {
|
||||
/* Footer
|
||||
-------------------------------------------------- */
|
||||
|
||||
.bs-docs-footer {
|
||||
padding-top: 30px;
|
||||
.bs-footer {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 30px;
|
||||
margin-top: 100px;
|
||||
text-align: center;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
.bs-docs-footer p {
|
||||
.bs-footer p {
|
||||
margin-bottom: 0;
|
||||
color: #777;
|
||||
}
|
||||
@@ -567,27 +604,25 @@ section > ul li {
|
||||
}
|
||||
|
||||
/* Social proof buttons from GitHub & Twitter */
|
||||
.bs-docs-social {
|
||||
margin-top: 80px;
|
||||
.bs-social {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
/* Quick links on Home */
|
||||
.bs-docs-social-buttons {
|
||||
.bs-social-buttons {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.bs-docs-social-buttons li {
|
||||
.bs-social-buttons li {
|
||||
display: inline-block;
|
||||
line-height: 1;
|
||||
}
|
||||
.bs-docs-social-buttons li + li {
|
||||
.bs-social-buttons li + li {
|
||||
margin-left: 15px;
|
||||
}
|
||||
.bs-docs-social-buttons .twitter-follow-button {
|
||||
.bs-social-buttons .twitter-follow-button {
|
||||
width: 225px !important;
|
||||
}
|
||||
.bs-docs-social-buttons .twitter-share-button {
|
||||
.bs-social-buttons .twitter-share-button {
|
||||
width: 98px !important;
|
||||
}
|
||||
|
||||
@@ -622,6 +657,7 @@ input.focused {
|
||||
}
|
||||
.highlight pre {
|
||||
padding: 0;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
@@ -640,14 +676,15 @@ input.focused {
|
||||
color: #bebec5;
|
||||
}
|
||||
|
||||
/* Better spacing on download options in getting started */
|
||||
.bs-docs-dl-options h4 {
|
||||
margin-top: 15px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
|
||||
/* Docs gallery
|
||||
-------------------------------------------------- */
|
||||
|
||||
.bs-docs-gallery .thumbnail {
|
||||
max-width: 400px;
|
||||
margin: 0 auto 20px;
|
||||
/* Hide the top link initially */
|
||||
.bs-top {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -656,7 +693,7 @@ input.focused {
|
||||
|
||||
/* Hide code snippets on mobile devices */
|
||||
@media screen and (max-width: 480px) {
|
||||
.bs-docs-example {
|
||||
.bs-example {
|
||||
border-radius: 4px;
|
||||
}
|
||||
.highlight {
|
||||
@@ -667,8 +704,16 @@ input.focused {
|
||||
/* Tablets and up */
|
||||
@media screen and (min-width: 768px) {
|
||||
|
||||
/* Reaffix the fixed sidebar */
|
||||
.bs-sidebar.affix {
|
||||
position: fixed; /* Undo the static from mobile-first approach */
|
||||
top: 50px;
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
/* Back to top link */
|
||||
.bs-docs-top {
|
||||
.bs-top {
|
||||
display: block; /* Unhide */
|
||||
float: left;
|
||||
padding: 7px 15px;
|
||||
font-weight: 500;
|
||||
@@ -676,57 +721,44 @@ input.focused {
|
||||
background-color: #eee;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.bs-docs-top:hover {
|
||||
.bs-top:hover {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
background-color: #999;
|
||||
}
|
||||
.bs-docs-top.affix {
|
||||
.bs-top.affix {
|
||||
position: fixed;
|
||||
right: 15px;
|
||||
bottom: 15px;
|
||||
}
|
||||
|
||||
.bs-docs-section-header h1 {
|
||||
font-size: 80px;
|
||||
font-size: 8rem;
|
||||
.bs-header {
|
||||
font-size: 21px;
|
||||
text-align: left;
|
||||
}
|
||||
.bs-header h1 {
|
||||
font-size: 60px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* Account for fixed navbar (which is static to start) */
|
||||
.bs-docs-docs {
|
||||
padding-left: 260px;
|
||||
}
|
||||
|
||||
/* Undo custom padding */
|
||||
.bs-docs-container {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
/* Show the docs nav */
|
||||
.bs-docs-sidebar {
|
||||
.bs-sidebar {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Tweak display of docs jumbotrons */
|
||||
.masthead {
|
||||
.bs-masthead {
|
||||
padding-top: 100px;
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
.masthead h1 {
|
||||
.bs-masthead h1 {
|
||||
font-size: 100px;
|
||||
}
|
||||
.masthead p {
|
||||
.bs-masthead p {
|
||||
margin-left: 15%;
|
||||
margin-right: 15%;
|
||||
font-size: 30px;
|
||||
}
|
||||
.subhead {
|
||||
padding-top: 60px;
|
||||
padding-bottom: 60px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.bs-navbar-top-example .navbar-fixed-top,
|
||||
.bs-navbar-bottom-example .navbar-fixed-bottom {
|
||||
@@ -738,8 +770,9 @@ input.focused {
|
||||
/* Tablets/desktops and up */
|
||||
@media screen and (min-width: 992px) {
|
||||
|
||||
.bs-docs-docs {
|
||||
padding-left: 280px;
|
||||
/* Widen the fixed sidebar */
|
||||
.bs-sidebar.affix {
|
||||
width: 213px;
|
||||
}
|
||||
|
||||
/* Icons */
|
||||
@@ -751,8 +784,10 @@ input.focused {
|
||||
|
||||
/* Large desktops and up */
|
||||
@media screen and (min-width: 1200px) {
|
||||
.bs-docs-docs {
|
||||
padding-left: 300px;
|
||||
|
||||
/* Widen the fixed sidebar again */
|
||||
.bs-sidebar.affix {
|
||||
width: 270px;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,106 +0,0 @@
|
||||
## 2.0 BOOTSTRAP JS PHILOSOPHY
|
||||
These are the high-level design rules which guide the development of Bootstrap's plugin apis.
|
||||
|
||||
---
|
||||
|
||||
### DATA-ATTRIBUTE API
|
||||
|
||||
We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript.
|
||||
|
||||
We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this:
|
||||
|
||||
$('body').off('.data-api')
|
||||
|
||||
To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this:
|
||||
|
||||
$('body').off('.alert.data-api')
|
||||
|
||||
---
|
||||
|
||||
### PROGRAMMATIC API
|
||||
|
||||
We also believe you should be able to use all plugins provided by Bootstrap purely through the JS API.
|
||||
|
||||
All public APIs should be single, chainable methods, and return the collection acted upon.
|
||||
|
||||
$(".btn.danger").button("toggle").addClass("fat")
|
||||
|
||||
All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior:
|
||||
|
||||
$("#myModal").modal() // initialized with defaults
|
||||
$("#myModal").modal({ keyboard: false }) // initialized with now keyboard
|
||||
$("#myModal").modal('show') // initializes and invokes show immediately afterqwe2
|
||||
|
||||
---
|
||||
|
||||
### OPTIONS
|
||||
|
||||
Options should be sparse and add universal value. We should pick the right defaults.
|
||||
|
||||
All plugins should have a default object which can be modified to effect all instance's default options. The defaults object should be available via `$.fn.plugin.defaults`.
|
||||
|
||||
$.fn.modal.defaults = { … }
|
||||
|
||||
An options definition should take the following form:
|
||||
|
||||
*noun*: *adjective* - describes or modifies a quality of an instance
|
||||
|
||||
examples:
|
||||
|
||||
backdrop: true
|
||||
keyboard: false
|
||||
placement: 'top'
|
||||
|
||||
---
|
||||
|
||||
### EVENTS
|
||||
|
||||
All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action.
|
||||
|
||||
show | shown
|
||||
hide | hidden
|
||||
|
||||
---
|
||||
|
||||
### CONSTRUCTORS
|
||||
|
||||
Each plugin should expose it's raw constructor on a `Constructor` property -- accessed in the following way:
|
||||
|
||||
|
||||
$.fn.popover.Constructor
|
||||
|
||||
---
|
||||
|
||||
### DATA ACCESSOR
|
||||
|
||||
Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this:
|
||||
|
||||
$('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor
|
||||
|
||||
---
|
||||
|
||||
### DATA ATTRIBUTES
|
||||
|
||||
Data attributes should take the following form:
|
||||
|
||||
- data-{{verb}}={{plugin}} - defines main interaction
|
||||
- data-target || href^=# - defined on "control" element (if element controls an element other than self)
|
||||
- data-{{noun}} - defines class instance options
|
||||
|
||||
examples:
|
||||
|
||||
// control other targets
|
||||
data-toggle="modal" data-target="#foo"
|
||||
data-toggle="collapse" data-target="#foo" data-parent="#bar"
|
||||
|
||||
// defined on element they control
|
||||
data-spy="scroll"
|
||||
|
||||
data-dismiss="modal"
|
||||
data-dismiss="alert"
|
||||
|
||||
data-toggle="dropdown"
|
||||
|
||||
data-toggle="button"
|
||||
data-toggle="buttons-checkbox"
|
||||
data-toggle="buttons-radio"
|
@@ -14,28 +14,18 @@
|
||||
})
|
||||
|
||||
// back to top
|
||||
// setTimeout(function () {
|
||||
// $('.bs-docs-sidenav').affix({
|
||||
// offset: {
|
||||
// top: function () { return $window.width() <= 980 ? 290 : 210 }
|
||||
// , bottom: 270
|
||||
// }
|
||||
// })
|
||||
// }, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
$('.bs-docs-top').affix()
|
||||
$('.bs-sidebar').affix({
|
||||
offset: {
|
||||
top: function () { return $window.width() <= 980 ? 290 : 210 }
|
||||
, bottom: 270
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
|
||||
// make code pretty
|
||||
window.prettyPrint && prettyPrint()
|
||||
|
||||
// add-ons
|
||||
$('.add-on :checkbox').on('click', function () {
|
||||
var $this = $(this)
|
||||
, method = $this.attr('checked') ? 'addClass' : 'removeClass'
|
||||
$(this).parents('.add-on')[method]('active')
|
||||
})
|
||||
setTimeout(function () {
|
||||
$('.bs-top').affix()
|
||||
}, 100)
|
||||
|
||||
// add tipsies to grid for scaffolding
|
||||
if ($('#grid-system').length) {
|
||||
@@ -79,22 +69,22 @@
|
||||
$('.bs-docs-carousel-example').carousel()
|
||||
|
||||
// javascript build logic
|
||||
var inputsComponent = $("#components.download input")
|
||||
, inputsPlugin = $("#plugins.download input")
|
||||
, inputsVariables = $("#variables.download input")
|
||||
var inputsComponent = $("#less input")
|
||||
, inputsPlugin = $("#plugins input")
|
||||
, inputsVariables = $("#variables input")
|
||||
|
||||
// toggle all plugin checkboxes
|
||||
$('#components.download .toggle-all').on('click', function (e) {
|
||||
$('#components .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
inputsComponent.attr('checked', !inputsComponent.is(':checked'))
|
||||
inputsComponent.prop('checked', !inputsComponent.is(':checked'))
|
||||
})
|
||||
|
||||
$('#plugins.download .toggle-all').on('click', function (e) {
|
||||
$('#plugins .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
inputsPlugin.attr('checked', !inputsPlugin.is(':checked'))
|
||||
inputsPlugin.prop('checked', !inputsPlugin.is(':checked'))
|
||||
})
|
||||
|
||||
$('#variables.download .toggle-all').on('click', function (e) {
|
||||
$('#variables .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
inputsVariables.val('')
|
||||
})
|
||||
@@ -102,16 +92,16 @@
|
||||
// request built javascript
|
||||
$('.download-btn .btn').on('click', function () {
|
||||
|
||||
var css = $("#components.download input:checked")
|
||||
var css = $("#components input:checked")
|
||||
.map(function () { return this.value })
|
||||
.toArray()
|
||||
, js = $("#plugins.download input:checked")
|
||||
, js = $("#plugins input:checked")
|
||||
.map(function () { return this.value })
|
||||
.toArray()
|
||||
, vars = {}
|
||||
, img = ['glyphicons-halflings.png', 'glyphicons-halflings-white.png']
|
||||
|
||||
$("#variables.download input")
|
||||
$("#variables input")
|
||||
.each(function () {
|
||||
$(this).val() && (vars[ $(this).prev().text() ] = $(this).val())
|
||||
})
|
||||
|
117
docs/assets/js/bootstrap-affix.js
vendored
117
docs/assets/js/bootstrap-affix.js
vendored
@@ -1,117 +0,0 @@
|
||||
/* ==========================================================
|
||||
* bootstrap-affix.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#affix
|
||||
* ==========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* AFFIX CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var Affix = function (element, options) {
|
||||
this.options = $.extend({}, $.fn.affix.defaults, options)
|
||||
this.$window = $(window)
|
||||
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
||||
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
|
||||
this.$element = $(element)
|
||||
this.checkPosition()
|
||||
}
|
||||
|
||||
Affix.prototype.checkPosition = function () {
|
||||
if (!this.$element.is(':visible')) return
|
||||
|
||||
var scrollHeight = $(document).height()
|
||||
, scrollTop = this.$window.scrollTop()
|
||||
, position = this.$element.offset()
|
||||
, offset = this.options.offset
|
||||
, offsetBottom = offset.bottom
|
||||
, offsetTop = offset.top
|
||||
, reset = 'affix affix-top affix-bottom'
|
||||
, affix
|
||||
|
||||
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
||||
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
||||
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
|
||||
|
||||
affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
|
||||
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
|
||||
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
|
||||
'top' : false
|
||||
|
||||
if (this.affixed === affix) return
|
||||
|
||||
this.affixed = affix
|
||||
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
||||
|
||||
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
|
||||
}
|
||||
|
||||
|
||||
/* AFFIX PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.affix
|
||||
|
||||
$.fn.affix = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('affix')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('affix', (data = new Affix(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.affix.Constructor = Affix
|
||||
|
||||
$.fn.affix.defaults = {
|
||||
offset: 0
|
||||
}
|
||||
|
||||
|
||||
/* 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)
|
||||
, data = $spy.data()
|
||||
|
||||
data.offset = data.offset || {}
|
||||
|
||||
data.offsetBottom && (data.offset.bottom = data.offsetBottom)
|
||||
data.offsetTop && (data.offset.top = data.offsetTop)
|
||||
|
||||
$spy.affix(data)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}(window.jQuery);
|
207
docs/assets/js/bootstrap-carousel.js
vendored
207
docs/assets/js/bootstrap-carousel.js
vendored
@@ -1,207 +0,0 @@
|
||||
/* ==========================================================
|
||||
* bootstrap-carousel.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#carousel
|
||||
* ==========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* CAROUSEL CLASS DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var Carousel = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.$indicators = this.$element.find('.carousel-indicators')
|
||||
this.options = options
|
||||
this.options.pause == 'hover' && this.$element
|
||||
.on('mouseenter', $.proxy(this.pause, this))
|
||||
.on('mouseleave', $.proxy(this.cycle, this))
|
||||
}
|
||||
|
||||
Carousel.prototype = {
|
||||
|
||||
cycle: function (e) {
|
||||
if (!e) this.paused = false
|
||||
if (this.interval) clearInterval(this.interval);
|
||||
this.options.interval
|
||||
&& !this.paused
|
||||
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
||||
return this
|
||||
}
|
||||
|
||||
, getActiveIndex: function () {
|
||||
this.$active = this.$element.find('.item.active')
|
||||
this.$items = this.$active.parent().children()
|
||||
return this.$items.index(this.$active)
|
||||
}
|
||||
|
||||
, to: function (pos) {
|
||||
var activeIndex = this.getActiveIndex()
|
||||
, that = this
|
||||
|
||||
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||
|
||||
if (this.sliding) {
|
||||
return this.$element.one('slid', function () {
|
||||
that.to(pos)
|
||||
})
|
||||
}
|
||||
|
||||
if (activeIndex == pos) {
|
||||
return this.pause().cycle()
|
||||
}
|
||||
|
||||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||
}
|
||||
|
||||
, pause: function (e) {
|
||||
if (!e) this.paused = true
|
||||
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
||||
this.$element.trigger($.support.transition.end)
|
||||
this.cycle(true)
|
||||
}
|
||||
clearInterval(this.interval)
|
||||
this.interval = null
|
||||
return this
|
||||
}
|
||||
|
||||
, next: function () {
|
||||
if (this.sliding) return
|
||||
return this.slide('next')
|
||||
}
|
||||
|
||||
, prev: function () {
|
||||
if (this.sliding) return
|
||||
return this.slide('prev')
|
||||
}
|
||||
|
||||
, slide: function (type, next) {
|
||||
var $active = this.$element.find('.item.active')
|
||||
, $next = next || $active[type]()
|
||||
, isCycling = this.interval
|
||||
, direction = type == 'next' ? 'left' : 'right'
|
||||
, fallback = type == 'next' ? 'first' : 'last'
|
||||
, that = this
|
||||
, e
|
||||
|
||||
this.sliding = true
|
||||
|
||||
isCycling && this.pause()
|
||||
|
||||
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
||||
|
||||
e = $.Event('slide', {
|
||||
relatedTarget: $next[0]
|
||||
, direction: direction
|
||||
})
|
||||
|
||||
if ($next.hasClass('active')) return
|
||||
|
||||
if (this.$indicators.length) {
|
||||
this.$indicators.find('.active').removeClass('active')
|
||||
this.$element.one('slid', function () {
|
||||
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
||||
$nextIndicator && $nextIndicator.addClass('active')
|
||||
})
|
||||
}
|
||||
|
||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$next.addClass(type)
|
||||
$next[0].offsetWidth // force reflow
|
||||
$active.addClass(direction)
|
||||
$next.addClass(direction)
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||
$active.removeClass(['active', direction].join(' '))
|
||||
that.sliding = false
|
||||
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
||||
})
|
||||
} else {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$active.removeClass('active')
|
||||
$next.addClass('active')
|
||||
this.sliding = false
|
||||
this.$element.trigger('slid')
|
||||
}
|
||||
|
||||
isCycling && this.cycle()
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* CAROUSEL PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.carousel
|
||||
|
||||
$.fn.carousel = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('carousel')
|
||||
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
||||
, action = typeof option == 'string' ? option : options.slide
|
||||
if (!data) $this.data('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()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.carousel.defaults = {
|
||||
interval: 5000
|
||||
, pause: 'hover'
|
||||
}
|
||||
|
||||
$.fn.carousel.Constructor = Carousel
|
||||
|
||||
|
||||
/* CAROUSEL NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.carousel.noConflict = function () {
|
||||
$.fn.carousel = old
|
||||
return this
|
||||
}
|
||||
|
||||
/* CAROUSEL DATA-API
|
||||
* ================= */
|
||||
|
||||
$(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
||||
var $this = $(this), href
|
||||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
, options = $.extend({}, $target.data(), $this.data())
|
||||
, slideIndex
|
||||
|
||||
$target.carousel(options)
|
||||
|
||||
if (slideIndex = $this.attr('data-slide-to')) {
|
||||
$target.data('carousel').pause().to(slideIndex).cycle()
|
||||
}
|
||||
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
167
docs/assets/js/bootstrap-collapse.js
vendored
167
docs/assets/js/bootstrap-collapse.js
vendored
@@ -1,167 +0,0 @@
|
||||
/* =============================================================
|
||||
* bootstrap-collapse.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
||||
* =============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* COLLAPSE PUBLIC CLASS DEFINITION
|
||||
* ================================ */
|
||||
|
||||
var Collapse = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
||||
|
||||
if (this.options.parent) {
|
||||
this.$parent = $(this.options.parent)
|
||||
}
|
||||
|
||||
this.options.toggle && this.toggle()
|
||||
}
|
||||
|
||||
Collapse.prototype = {
|
||||
|
||||
constructor: Collapse
|
||||
|
||||
, dimension: function () {
|
||||
var hasWidth = this.$element.hasClass('width')
|
||||
return hasWidth ? 'width' : 'height'
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var dimension
|
||||
, scroll
|
||||
, actives
|
||||
, hasData
|
||||
|
||||
if (this.transitioning || this.$element.hasClass('in')) return
|
||||
|
||||
dimension = this.dimension()
|
||||
scroll = $.camelCase(['scroll', dimension].join('-'))
|
||||
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
||||
|
||||
if (actives && actives.length) {
|
||||
hasData = actives.data('collapse')
|
||||
if (hasData && hasData.transitioning) return
|
||||
actives.collapse('hide')
|
||||
hasData || actives.data('collapse', null)
|
||||
}
|
||||
|
||||
this.$element[dimension](0)
|
||||
this.transition('addClass', $.Event('show'), 'shown')
|
||||
$.support.transition && this.$element[dimension](this.$element[0][scroll])
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
var dimension
|
||||
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||
dimension = this.dimension()
|
||||
this.reset(this.$element[dimension]())
|
||||
this.transition('removeClass', $.Event('hide'), 'hidden')
|
||||
this.$element[dimension](0)
|
||||
}
|
||||
|
||||
, reset: function (size) {
|
||||
var dimension = this.dimension()
|
||||
|
||||
this.$element
|
||||
.removeClass('collapse')
|
||||
[dimension](size || 'auto')
|
||||
[0].offsetWidth
|
||||
|
||||
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
, transition: function (method, startEvent, completeEvent) {
|
||||
var that = this
|
||||
, complete = function () {
|
||||
if (startEvent.type == 'show') that.reset()
|
||||
that.transitioning = 0
|
||||
that.$element.trigger(completeEvent)
|
||||
}
|
||||
|
||||
this.$element.trigger(startEvent)
|
||||
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
this.transitioning = 1
|
||||
|
||||
this.$element[method]('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('collapse') ?
|
||||
this.$element.one($.support.transition.end, complete) :
|
||||
complete()
|
||||
}
|
||||
|
||||
, toggle: function () {
|
||||
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* COLLAPSE PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.collapse
|
||||
|
||||
$.fn.collapse = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('collapse')
|
||||
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
|
||||
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.collapse.defaults = {
|
||||
toggle: true
|
||||
}
|
||||
|
||||
$.fn.collapse.Constructor = Collapse
|
||||
|
||||
|
||||
/* COLLAPSE NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.collapse.noConflict = function () {
|
||||
$.fn.collapse = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* COLLAPSE DATA-API
|
||||
* ================= */
|
||||
|
||||
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
||||
var $this = $(this), href
|
||||
, target = $this.attr('data-target')
|
||||
|| e.preventDefault()
|
||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
||||
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||
$(target).collapse(option)
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
165
docs/assets/js/bootstrap-dropdown.js
vendored
165
docs/assets/js/bootstrap-dropdown.js
vendored
@@ -1,165 +0,0 @@
|
||||
/* ============================================================
|
||||
* bootstrap-dropdown.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
||||
* ============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* DROPDOWN CLASS DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var toggle = '[data-toggle=dropdown]'
|
||||
, Dropdown = function (element) {
|
||||
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
||||
$('html').on('click.dropdown.data-api', function () {
|
||||
$el.parent().removeClass('open')
|
||||
})
|
||||
}
|
||||
|
||||
Dropdown.prototype = {
|
||||
|
||||
constructor: Dropdown
|
||||
|
||||
, toggle: function (e) {
|
||||
var $this = $(this)
|
||||
, $parent
|
||||
, isActive
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
$parent = getParent($this)
|
||||
|
||||
isActive = $parent.hasClass('open')
|
||||
|
||||
clearMenus()
|
||||
|
||||
if (!isActive) {
|
||||
$parent.toggleClass('open')
|
||||
}
|
||||
|
||||
$this.focus()
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
, keydown: function (e) {
|
||||
var $this
|
||||
, $items
|
||||
, $active
|
||||
, $parent
|
||||
, isActive
|
||||
, index
|
||||
|
||||
if (!/(38|40|27)/.test(e.keyCode)) return
|
||||
|
||||
$this = $(this)
|
||||
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
$parent = getParent($this)
|
||||
|
||||
isActive = $parent.hasClass('open')
|
||||
|
||||
if (!isActive || (isActive && e.keyCode == 27)) {
|
||||
if (e.which == 27) $parent.find(toggle).focus()
|
||||
return $this.click()
|
||||
}
|
||||
|
||||
$items = $('[role=menu] li:not(.divider):visible a', $parent)
|
||||
|
||||
if (!$items.length) return
|
||||
|
||||
index = $items.index($items.filter(':focus'))
|
||||
|
||||
if (e.keyCode == 38 && index > 0) index-- // up
|
||||
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
||||
if (!~index) index = 0
|
||||
|
||||
$items
|
||||
.eq(index)
|
||||
.focus()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function clearMenus() {
|
||||
$(toggle).each(function () {
|
||||
getParent($(this)).removeClass('open')
|
||||
})
|
||||
}
|
||||
|
||||
function getParent($this) {
|
||||
var selector = $this.attr('data-target')
|
||||
, $parent
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
$parent = selector && $(selector)
|
||||
|
||||
if (!$parent || !$parent.length) $parent = $this.parent()
|
||||
|
||||
return $parent
|
||||
}
|
||||
|
||||
|
||||
/* DROPDOWN PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.dropdown
|
||||
|
||||
$.fn.dropdown = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('dropdown')
|
||||
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.dropdown.Constructor = Dropdown
|
||||
|
||||
|
||||
/* DROPDOWN NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.dropdown.noConflict = function () {
|
||||
$.fn.dropdown = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
||||
* =================================== */
|
||||
|
||||
$(document)
|
||||
.on('click.dropdown.data-api', clearMenus)
|
||||
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||
.on('click.dropdown-menu', function (e) { e.stopPropagation() })
|
||||
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||
|
||||
}(window.jQuery);
|
251
docs/assets/js/bootstrap-modal.js
vendored
251
docs/assets/js/bootstrap-modal.js
vendored
@@ -1,251 +0,0 @@
|
||||
/* =========================================================
|
||||
* bootstrap-modal.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#modals
|
||||
* =========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================= */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* MODAL CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var Modal = function (element, options) {
|
||||
this.options = options
|
||||
this.$element = $(element)
|
||||
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
||||
this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
|
||||
}
|
||||
|
||||
Modal.prototype = {
|
||||
|
||||
constructor: Modal
|
||||
|
||||
, toggle: function () {
|
||||
return this[!this.isShown ? 'show' : 'hide']()
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var that = this
|
||||
, e = $.Event('show')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = true
|
||||
|
||||
this.escape()
|
||||
|
||||
this.backdrop(function () {
|
||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||
|
||||
if (!that.$element.parent().length) {
|
||||
that.$element.appendTo(document.body) //don't move modals dom position
|
||||
}
|
||||
|
||||
that.$element.show()
|
||||
|
||||
if (transition) {
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
}
|
||||
|
||||
that.$element
|
||||
.addClass('in')
|
||||
.attr('aria-hidden', false)
|
||||
|
||||
that.enforceFocus()
|
||||
|
||||
transition ?
|
||||
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
|
||||
that.$element.focus().trigger('shown')
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
, hide: function (e) {
|
||||
e && e.preventDefault()
|
||||
|
||||
var that = this
|
||||
|
||||
e = $.Event('hide')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (!this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = false
|
||||
|
||||
this.escape()
|
||||
|
||||
$(document).off('focusin.modal')
|
||||
|
||||
this.$element
|
||||
.removeClass('in')
|
||||
.attr('aria-hidden', true)
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
this.hideWithTransition() :
|
||||
this.hideModal()
|
||||
}
|
||||
|
||||
, enforceFocus: function () {
|
||||
var that = this
|
||||
$(document).on('focusin.modal', function (e) {
|
||||
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
|
||||
that.$element.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
, escape: function () {
|
||||
var that = this
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
this.$element.on('keyup.dismiss.modal', function ( e ) {
|
||||
e.which == 27 && that.hide()
|
||||
})
|
||||
} else if (!this.isShown) {
|
||||
this.$element.off('keyup.dismiss.modal')
|
||||
}
|
||||
}
|
||||
|
||||
, hideWithTransition: function () {
|
||||
var that = this
|
||||
, timeout = setTimeout(function () {
|
||||
that.$element.off($.support.transition.end)
|
||||
that.hideModal()
|
||||
}, 500)
|
||||
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
that.hideModal()
|
||||
})
|
||||
}
|
||||
|
||||
, hideModal: function () {
|
||||
var that = this
|
||||
this.$element.hide()
|
||||
this.backdrop(function () {
|
||||
that.removeBackdrop()
|
||||
that.$element.trigger('hidden')
|
||||
})
|
||||
}
|
||||
|
||||
, removeBackdrop: function () {
|
||||
this.$backdrop && this.$backdrop.remove()
|
||||
this.$backdrop = null
|
||||
}
|
||||
|
||||
, backdrop: function (callback) {
|
||||
var that = this
|
||||
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||
|
||||
if (this.isShown && this.options.backdrop) {
|
||||
var doAnimate = $.support.transition && animate
|
||||
|
||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||
.appendTo(document.body)
|
||||
|
||||
this.$backdrop.click(
|
||||
this.options.backdrop == 'static' ?
|
||||
$.proxy(this.$element[0].focus, this.$element[0])
|
||||
: $.proxy(this.hide, this)
|
||||
)
|
||||
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
this.$backdrop.addClass('in')
|
||||
|
||||
if (!callback) return
|
||||
|
||||
doAnimate ?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (!this.isShown && this.$backdrop) {
|
||||
this.$backdrop.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade')?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (callback) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* MODAL PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.modal
|
||||
|
||||
$.fn.modal = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('modal')
|
||||
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
||||
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
else if (options.show) data.show()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.modal.defaults = {
|
||||
backdrop: true
|
||||
, keyboard: true
|
||||
, show: true
|
||||
}
|
||||
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
||||
|
||||
/* MODAL NO CONFLICT
|
||||
* ================= */
|
||||
|
||||
$.fn.modal.noConflict = function () {
|
||||
$.fn.modal = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* MODAL DATA-API
|
||||
* ============== */
|
||||
|
||||
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||
var $this = $(this)
|
||||
, href = $this.attr('href')
|
||||
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
||||
, option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
e.preventDefault()
|
||||
|
||||
$target
|
||||
.modal(option)
|
||||
.one('hide', function () {
|
||||
$this.focus()
|
||||
})
|
||||
})
|
||||
|
||||
var $body = $(document.body)
|
||||
.on('shown', '.modal', function () { $body.addClass('modal-open') })
|
||||
.on('hidden', '.modal', function () { $body.removeClass('modal-open') })
|
||||
|
||||
}(window.jQuery);
|
114
docs/assets/js/bootstrap-popover.js
vendored
114
docs/assets/js/bootstrap-popover.js
vendored
@@ -1,114 +0,0 @@
|
||||
/* ===========================================================
|
||||
* bootstrap-popover.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#popovers
|
||||
* ===========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* POPOVER PUBLIC CLASS DEFINITION
|
||||
* =============================== */
|
||||
|
||||
var Popover = function (element, options) {
|
||||
this.init('popover', element, options)
|
||||
}
|
||||
|
||||
|
||||
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
||||
========================================== */
|
||||
|
||||
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
|
||||
|
||||
constructor: Popover
|
||||
|
||||
, setContent: function () {
|
||||
var $tip = this.tip()
|
||||
, title = this.getTitle()
|
||||
, content = this.getContent()
|
||||
|
||||
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
||||
|
||||
$tip.removeClass('fade top bottom left right in')
|
||||
}
|
||||
|
||||
, hasContent: function () {
|
||||
return this.getTitle() || this.getContent()
|
||||
}
|
||||
|
||||
, getContent: function () {
|
||||
var content
|
||||
, $e = this.$element
|
||||
, o = this.options
|
||||
|
||||
content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
||||
|| $e.attr('data-content')
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
, tip: function () {
|
||||
if (!this.$tip) {
|
||||
this.$tip = $(this.options.template)
|
||||
}
|
||||
return this.$tip
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
this.hide().$element.off('.' + this.type).removeData(this.type)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
/* POPOVER PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.popover
|
||||
|
||||
$.fn.popover = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('popover')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('popover', (data = new Popover(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.popover.Constructor = Popover
|
||||
|
||||
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
||||
placement: 'right'
|
||||
, trigger: 'click'
|
||||
, content: ''
|
||||
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
||||
})
|
||||
|
||||
|
||||
/* POPOVER NO CONFLICT
|
||||
* =================== */
|
||||
|
||||
$.fn.popover.noConflict = function () {
|
||||
$.fn.popover = old
|
||||
return this
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
162
docs/assets/js/bootstrap-scrollspy.js
vendored
162
docs/assets/js/bootstrap-scrollspy.js
vendored
@@ -1,162 +0,0 @@
|
||||
/* =============================================================
|
||||
* bootstrap-scrollspy.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
||||
* =============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* SCROLLSPY CLASS DEFINITION
|
||||
* ========================== */
|
||||
|
||||
function ScrollSpy(element, options) {
|
||||
var process = $.proxy(this.process, this)
|
||||
, $element = $(element).is('body') ? $(window) : $(element)
|
||||
, href
|
||||
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
|
||||
this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
|
||||
this.selector = (this.options.target
|
||||
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
|| '') + ' .nav li > a'
|
||||
this.$body = $('body')
|
||||
this.refresh()
|
||||
this.process()
|
||||
}
|
||||
|
||||
ScrollSpy.prototype = {
|
||||
|
||||
constructor: ScrollSpy
|
||||
|
||||
, refresh: function () {
|
||||
var self = this
|
||||
, $targets
|
||||
|
||||
this.offsets = $([])
|
||||
this.targets = $([])
|
||||
|
||||
$targets = this.$body
|
||||
.find(this.selector)
|
||||
.map(function () {
|
||||
var $el = $(this)
|
||||
, href = $el.data('target') || $el.attr('href')
|
||||
, $href = /^#\w/.test(href) && $(href)
|
||||
return ( $href
|
||||
&& $href.length
|
||||
&& [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
|
||||
})
|
||||
.sort(function (a, b) { return a[0] - b[0] })
|
||||
.each(function () {
|
||||
self.offsets.push(this[0])
|
||||
self.targets.push(this[1])
|
||||
})
|
||||
}
|
||||
|
||||
, process: function () {
|
||||
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
||||
, scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
||||
, maxScroll = scrollHeight - this.$scrollElement.height()
|
||||
, offsets = this.offsets
|
||||
, targets = this.targets
|
||||
, activeTarget = this.activeTarget
|
||||
, i
|
||||
|
||||
if (scrollTop >= maxScroll) {
|
||||
return activeTarget != (i = targets.last()[0])
|
||||
&& this.activate ( i )
|
||||
}
|
||||
|
||||
for (i = offsets.length; i--;) {
|
||||
activeTarget != targets[i]
|
||||
&& scrollTop >= offsets[i]
|
||||
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
||||
&& this.activate( targets[i] )
|
||||
}
|
||||
}
|
||||
|
||||
, activate: function (target) {
|
||||
var active
|
||||
, selector
|
||||
|
||||
this.activeTarget = target
|
||||
|
||||
$(this.selector)
|
||||
.parents('.active')
|
||||
.removeClass('active')
|
||||
|
||||
selector = this.selector
|
||||
+ '[data-target="' + target + '"],'
|
||||
+ this.selector + '[href="' + target + '"]'
|
||||
|
||||
active = $(selector)
|
||||
.parents('li')
|
||||
.addClass('active')
|
||||
|
||||
if (active.parent('.dropdown-menu').length) {
|
||||
active = active.closest('li.dropdown').addClass('active')
|
||||
}
|
||||
|
||||
active.trigger('activate')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* SCROLLSPY PLUGIN DEFINITION
|
||||
* =========================== */
|
||||
|
||||
var old = $.fn.scrollspy
|
||||
|
||||
$.fn.scrollspy = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('scrollspy')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.scrollspy.Constructor = ScrollSpy
|
||||
|
||||
$.fn.scrollspy.defaults = {
|
||||
offset: 10
|
||||
}
|
||||
|
||||
|
||||
/* SCROLLSPY NO CONFLICT
|
||||
* ===================== */
|
||||
|
||||
$.fn.scrollspy.noConflict = function () {
|
||||
$.fn.scrollspy = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* SCROLLSPY DATA-API
|
||||
* ================== */
|
||||
|
||||
$(window).on('load', function () {
|
||||
$('[data-spy="scroll"]').each(function () {
|
||||
var $spy = $(this)
|
||||
$spy.scrollspy($spy.data())
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
144
docs/assets/js/bootstrap-tab.js
vendored
144
docs/assets/js/bootstrap-tab.js
vendored
@@ -1,144 +0,0 @@
|
||||
/* ========================================================
|
||||
* bootstrap-tab.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#tabs
|
||||
* ========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TAB CLASS DEFINITION
|
||||
* ==================== */
|
||||
|
||||
var Tab = function (element) {
|
||||
this.element = $(element)
|
||||
}
|
||||
|
||||
Tab.prototype = {
|
||||
|
||||
constructor: Tab
|
||||
|
||||
, show: function () {
|
||||
var $this = this.element
|
||||
, $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||
, selector = $this.attr('data-target')
|
||||
, previous
|
||||
, $target
|
||||
, e
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
if ( $this.parent('li').hasClass('active') ) return
|
||||
|
||||
previous = $ul.find('.active:last a')[0]
|
||||
|
||||
e = $.Event('show', {
|
||||
relatedTarget: previous
|
||||
})
|
||||
|
||||
$this.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$target = $(selector)
|
||||
|
||||
this.activate($this.parent('li'), $ul)
|
||||
this.activate($target, $target.parent(), function () {
|
||||
$this.trigger({
|
||||
type: 'shown'
|
||||
, relatedTarget: previous
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
, activate: function ( element, container, callback) {
|
||||
var $active = container.find('> .active')
|
||||
, transition = callback
|
||||
&& $.support.transition
|
||||
&& $active.hasClass('fade')
|
||||
|
||||
function next() {
|
||||
$active
|
||||
.removeClass('active')
|
||||
.find('> .dropdown-menu > .active')
|
||||
.removeClass('active')
|
||||
|
||||
element.addClass('active')
|
||||
|
||||
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')
|
||||
}
|
||||
|
||||
callback && callback()
|
||||
}
|
||||
|
||||
transition ?
|
||||
$active.one($.support.transition.end, next) :
|
||||
next()
|
||||
|
||||
$active.removeClass('in')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* TAB PLUGIN DEFINITION
|
||||
* ===================== */
|
||||
|
||||
var old = $.fn.tab
|
||||
|
||||
$.fn.tab = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('tab')
|
||||
if (!data) $this.data('tab', (data = new Tab(this)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tab.Constructor = Tab
|
||||
|
||||
|
||||
/* TAB NO CONFLICT
|
||||
* =============== */
|
||||
|
||||
$.fn.tab.noConflict = function () {
|
||||
$.fn.tab = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* TAB DATA-API
|
||||
* ============ */
|
||||
|
||||
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
||||
e.preventDefault()
|
||||
$(this).tab('show')
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
361
docs/assets/js/bootstrap-tooltip.js
vendored
361
docs/assets/js/bootstrap-tooltip.js
vendored
@@ -1,361 +0,0 @@
|
||||
/* ===========================================================
|
||||
* bootstrap-tooltip.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#tooltips
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ===========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TOOLTIP PUBLIC CLASS DEFINITION
|
||||
* =============================== */
|
||||
|
||||
var Tooltip = function (element, options) {
|
||||
this.init('tooltip', element, options)
|
||||
}
|
||||
|
||||
Tooltip.prototype = {
|
||||
|
||||
constructor: Tooltip
|
||||
|
||||
, init: function (type, element, options) {
|
||||
var eventIn
|
||||
, eventOut
|
||||
, triggers
|
||||
, trigger
|
||||
, i
|
||||
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
this.enabled = true
|
||||
|
||||
triggers = this.options.trigger.split(' ')
|
||||
|
||||
for (i = triggers.length; i--;) {
|
||||
trigger = triggers[i]
|
||||
if (trigger == 'click') {
|
||||
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||
} else if (trigger != 'manual') {
|
||||
eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||
eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||
}
|
||||
}
|
||||
|
||||
this.options.selector ?
|
||||
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||
this.fixTitle()
|
||||
}
|
||||
|
||||
, getOptions: function (options) {
|
||||
options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
|
||||
|
||||
if (options.delay && typeof options.delay == 'number') {
|
||||
options.delay = {
|
||||
show: options.delay
|
||||
, hide: options.delay
|
||||
}
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
, enter: function (e) {
|
||||
var defaults = $.fn[this.type].defaults
|
||||
, options = {}
|
||||
, self
|
||||
|
||||
this._options && $.each(this._options, function (key, value) {
|
||||
if (defaults[key] != value) options[key] = value
|
||||
}, this)
|
||||
|
||||
self = $(e.currentTarget)[this.type](options).data(this.type)
|
||||
|
||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||
|
||||
clearTimeout(this.timeout)
|
||||
self.hoverState = 'in'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'in') self.show()
|
||||
}, self.options.delay.show)
|
||||
}
|
||||
|
||||
, leave: function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||
|
||||
if (this.timeout) clearTimeout(this.timeout)
|
||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||
|
||||
self.hoverState = 'out'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'out') self.hide()
|
||||
}, self.options.delay.hide)
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var $tip
|
||||
, pos
|
||||
, actualWidth
|
||||
, actualHeight
|
||||
, placement
|
||||
, tp
|
||||
, e = $.Event('show')
|
||||
|
||||
if (this.hasContent() && this.enabled) {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$tip = this.tip()
|
||||
this.setContent()
|
||||
|
||||
if (this.options.animation) {
|
||||
$tip.addClass('fade')
|
||||
}
|
||||
|
||||
placement = typeof this.options.placement == 'function' ?
|
||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||
this.options.placement
|
||||
|
||||
$tip
|
||||
.detach()
|
||||
.css({ top: 0, left: 0, display: 'block' })
|
||||
|
||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||
|
||||
pos = this.getPosition()
|
||||
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
|
||||
switch (placement) {
|
||||
case 'bottom':
|
||||
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'top':
|
||||
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'left':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
|
||||
break
|
||||
case 'right':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
|
||||
break
|
||||
}
|
||||
|
||||
this.applyPlacement(tp, placement)
|
||||
this.$element.trigger('shown')
|
||||
}
|
||||
}
|
||||
|
||||
, applyPlacement: function(offset, placement){
|
||||
var $tip = this.tip()
|
||||
, width = $tip[0].offsetWidth
|
||||
, height = $tip[0].offsetHeight
|
||||
, actualWidth
|
||||
, actualHeight
|
||||
, delta
|
||||
, replace
|
||||
|
||||
$tip
|
||||
.offset(offset)
|
||||
.addClass(placement)
|
||||
.addClass('in')
|
||||
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
|
||||
if (placement == 'top' && actualHeight != height) {
|
||||
offset.top = offset.top + height - actualHeight
|
||||
replace = true
|
||||
}
|
||||
|
||||
if (placement == 'bottom' || placement == 'top') {
|
||||
delta = 0
|
||||
|
||||
if (offset.left < 0){
|
||||
delta = offset.left * -2
|
||||
offset.left = 0
|
||||
$tip.offset(offset)
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
}
|
||||
|
||||
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||
} else {
|
||||
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||
}
|
||||
|
||||
if (replace) $tip.offset(offset)
|
||||
}
|
||||
|
||||
, replaceArrow: function(delta, dimension, position){
|
||||
this
|
||||
.arrow()
|
||||
.css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
|
||||
}
|
||||
|
||||
, setContent: function () {
|
||||
var $tip = this.tip()
|
||||
, title = this.getTitle()
|
||||
|
||||
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.removeClass('fade in top bottom left right')
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
var that = this
|
||||
, $tip = this.tip()
|
||||
, e = $.Event('hide')
|
||||
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$tip.removeClass('in')
|
||||
|
||||
function removeWithAnimation() {
|
||||
var timeout = setTimeout(function () {
|
||||
$tip.off($.support.transition.end).detach()
|
||||
}, 500)
|
||||
|
||||
$tip.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
$tip.detach()
|
||||
})
|
||||
}
|
||||
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
removeWithAnimation() :
|
||||
$tip.detach()
|
||||
|
||||
this.$element.trigger('hidden')
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
, fixTitle: function () {
|
||||
var $e = this.$element
|
||||
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
||||
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
||||
}
|
||||
}
|
||||
|
||||
, hasContent: function () {
|
||||
return this.getTitle()
|
||||
}
|
||||
|
||||
, getPosition: function () {
|
||||
var el = this.$element[0]
|
||||
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||
width: el.offsetWidth
|
||||
, height: el.offsetHeight
|
||||
}, this.$element.offset())
|
||||
}
|
||||
|
||||
, getTitle: function () {
|
||||
var title
|
||||
, $e = this.$element
|
||||
, o = this.options
|
||||
|
||||
title = $e.attr('data-original-title')
|
||||
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||
|
||||
return title
|
||||
}
|
||||
|
||||
, tip: function () {
|
||||
return this.$tip = this.$tip || $(this.options.template)
|
||||
}
|
||||
|
||||
, arrow: function(){
|
||||
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
|
||||
}
|
||||
|
||||
, validate: function () {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide()
|
||||
this.$element = null
|
||||
this.options = null
|
||||
}
|
||||
}
|
||||
|
||||
, enable: function () {
|
||||
this.enabled = true
|
||||
}
|
||||
|
||||
, disable: function () {
|
||||
this.enabled = false
|
||||
}
|
||||
|
||||
, toggleEnabled: function () {
|
||||
this.enabled = !this.enabled
|
||||
}
|
||||
|
||||
, toggle: function (e) {
|
||||
var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
|
||||
self.tip().hasClass('in') ? self.hide() : self.show()
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
this.hide().$element.off('.' + this.type).removeData(this.type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* TOOLTIP PLUGIN DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var old = $.fn.tooltip
|
||||
|
||||
$.fn.tooltip = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('tooltip')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tooltip.Constructor = Tooltip
|
||||
|
||||
$.fn.tooltip.defaults = {
|
||||
animation: true
|
||||
, placement: 'top'
|
||||
, selector: false
|
||||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||
, trigger: 'hover focus'
|
||||
, title: ''
|
||||
, delay: 0
|
||||
, html: false
|
||||
, container: false
|
||||
}
|
||||
|
||||
|
||||
/* TOOLTIP NO CONFLICT
|
||||
* =================== */
|
||||
|
||||
$.fn.tooltip.noConflict = function () {
|
||||
$.fn.tooltip = old
|
||||
return this
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
60
docs/assets/js/bootstrap-transition.js
vendored
60
docs/assets/js/bootstrap-transition.js
vendored
@@ -1,60 +0,0 @@
|
||||
/* ===================================================
|
||||
* bootstrap-transition.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#transitions
|
||||
* ===================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
|
||||
* ======================================================= */
|
||||
|
||||
$(function () {
|
||||
|
||||
$.support.transition = (function () {
|
||||
|
||||
var transitionEnd = (function () {
|
||||
|
||||
var el = document.createElement('bootstrap')
|
||||
, transEndEventNames = {
|
||||
'WebkitTransition' : 'webkitTransitionEnd'
|
||||
, 'MozTransition' : 'transitionend'
|
||||
, 'OTransition' : 'oTransitionEnd otransitionend'
|
||||
, 'transition' : 'transitionend'
|
||||
}
|
||||
, name
|
||||
|
||||
for (name in transEndEventNames){
|
||||
if (el.style[name] !== undefined) {
|
||||
return transEndEventNames[name]
|
||||
}
|
||||
}
|
||||
|
||||
}())
|
||||
|
||||
return transitionEnd && {
|
||||
end: transitionEnd
|
||||
}
|
||||
|
||||
})()
|
||||
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
335
docs/assets/js/bootstrap-typeahead.js
vendored
335
docs/assets/js/bootstrap-typeahead.js
vendored
@@ -1,335 +0,0 @@
|
||||
/* =============================================================
|
||||
* bootstrap-typeahead.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#typeahead
|
||||
* =============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function($){
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TYPEAHEAD PUBLIC CLASS DEFINITION
|
||||
* ================================= */
|
||||
|
||||
var Typeahead = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
||||
this.matcher = this.options.matcher || this.matcher
|
||||
this.sorter = this.options.sorter || this.sorter
|
||||
this.highlighter = this.options.highlighter || this.highlighter
|
||||
this.updater = this.options.updater || this.updater
|
||||
this.source = this.options.source
|
||||
this.$menu = $(this.options.menu)
|
||||
this.shown = false
|
||||
this.listen()
|
||||
}
|
||||
|
||||
Typeahead.prototype = {
|
||||
|
||||
constructor: Typeahead
|
||||
|
||||
, select: function () {
|
||||
var val = this.$menu.find('.active').attr('data-value')
|
||||
this.$element
|
||||
.val(this.updater(val))
|
||||
.change()
|
||||
return this.hide()
|
||||
}
|
||||
|
||||
, updater: function (item) {
|
||||
return item
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var pos = $.extend({}, this.$element.position(), {
|
||||
height: this.$element[0].offsetHeight
|
||||
})
|
||||
|
||||
this.$menu
|
||||
.insertAfter(this.$element)
|
||||
.css({
|
||||
top: pos.top + pos.height
|
||||
, left: pos.left
|
||||
})
|
||||
.show()
|
||||
|
||||
this.shown = true
|
||||
return this
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
this.$menu.hide()
|
||||
this.shown = false
|
||||
return this
|
||||
}
|
||||
|
||||
, lookup: function (event) {
|
||||
var items
|
||||
|
||||
this.query = this.$element.val()
|
||||
|
||||
if (!this.query || this.query.length < this.options.minLength) {
|
||||
return this.shown ? this.hide() : this
|
||||
}
|
||||
|
||||
items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
|
||||
|
||||
return items ? this.process(items) : this
|
||||
}
|
||||
|
||||
, process: function (items) {
|
||||
var that = this
|
||||
|
||||
items = $.grep(items, function (item) {
|
||||
return that.matcher(item)
|
||||
})
|
||||
|
||||
items = this.sorter(items)
|
||||
|
||||
if (!items.length) {
|
||||
return this.shown ? this.hide() : this
|
||||
}
|
||||
|
||||
return this.render(items.slice(0, this.options.items)).show()
|
||||
}
|
||||
|
||||
, matcher: function (item) {
|
||||
return ~item.toLowerCase().indexOf(this.query.toLowerCase())
|
||||
}
|
||||
|
||||
, sorter: function (items) {
|
||||
var beginswith = []
|
||||
, caseSensitive = []
|
||||
, caseInsensitive = []
|
||||
, item
|
||||
|
||||
while (item = items.shift()) {
|
||||
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
|
||||
else if (~item.indexOf(this.query)) caseSensitive.push(item)
|
||||
else caseInsensitive.push(item)
|
||||
}
|
||||
|
||||
return beginswith.concat(caseSensitive, caseInsensitive)
|
||||
}
|
||||
|
||||
, highlighter: function (item) {
|
||||
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
|
||||
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
||||
return '<strong>' + match + '</strong>'
|
||||
})
|
||||
}
|
||||
|
||||
, render: function (items) {
|
||||
var that = this
|
||||
|
||||
items = $(items).map(function (i, item) {
|
||||
i = $(that.options.item).attr('data-value', item)
|
||||
i.find('a').html(that.highlighter(item))
|
||||
return i[0]
|
||||
})
|
||||
|
||||
items.first().addClass('active')
|
||||
this.$menu.html(items)
|
||||
return this
|
||||
}
|
||||
|
||||
, next: function (event) {
|
||||
var active = this.$menu.find('.active').removeClass('active')
|
||||
, next = active.next()
|
||||
|
||||
if (!next.length) {
|
||||
next = $(this.$menu.find('li')[0])
|
||||
}
|
||||
|
||||
next.addClass('active')
|
||||
}
|
||||
|
||||
, prev: function (event) {
|
||||
var active = this.$menu.find('.active').removeClass('active')
|
||||
, prev = active.prev()
|
||||
|
||||
if (!prev.length) {
|
||||
prev = this.$menu.find('li').last()
|
||||
}
|
||||
|
||||
prev.addClass('active')
|
||||
}
|
||||
|
||||
, listen: function () {
|
||||
this.$element
|
||||
.on('focus', $.proxy(this.focus, this))
|
||||
.on('blur', $.proxy(this.blur, this))
|
||||
.on('keypress', $.proxy(this.keypress, this))
|
||||
.on('keyup', $.proxy(this.keyup, this))
|
||||
|
||||
if (this.eventSupported('keydown')) {
|
||||
this.$element.on('keydown', $.proxy(this.keydown, this))
|
||||
}
|
||||
|
||||
this.$menu
|
||||
.on('click', $.proxy(this.click, this))
|
||||
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
||||
.on('mouseleave', 'li', $.proxy(this.mouseleave, this))
|
||||
}
|
||||
|
||||
, eventSupported: function(eventName) {
|
||||
var isSupported = eventName in this.$element
|
||||
if (!isSupported) {
|
||||
this.$element.setAttribute(eventName, 'return;')
|
||||
isSupported = typeof this.$element[eventName] === 'function'
|
||||
}
|
||||
return isSupported
|
||||
}
|
||||
|
||||
, move: function (e) {
|
||||
if (!this.shown) return
|
||||
|
||||
switch(e.keyCode) {
|
||||
case 9: // tab
|
||||
case 13: // enter
|
||||
case 27: // escape
|
||||
e.preventDefault()
|
||||
break
|
||||
|
||||
case 38: // up arrow
|
||||
e.preventDefault()
|
||||
this.prev()
|
||||
break
|
||||
|
||||
case 40: // down arrow
|
||||
e.preventDefault()
|
||||
this.next()
|
||||
break
|
||||
}
|
||||
|
||||
e.stopPropagation()
|
||||
}
|
||||
|
||||
, keydown: function (e) {
|
||||
this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
|
||||
this.move(e)
|
||||
}
|
||||
|
||||
, keypress: function (e) {
|
||||
if (this.suppressKeyPressRepeat) return
|
||||
this.move(e)
|
||||
}
|
||||
|
||||
, keyup: function (e) {
|
||||
switch(e.keyCode) {
|
||||
case 40: // down arrow
|
||||
case 38: // up arrow
|
||||
case 16: // shift
|
||||
case 17: // ctrl
|
||||
case 18: // alt
|
||||
break
|
||||
|
||||
case 9: // tab
|
||||
case 13: // enter
|
||||
if (!this.shown) return
|
||||
this.select()
|
||||
break
|
||||
|
||||
case 27: // escape
|
||||
if (!this.shown) return
|
||||
this.hide()
|
||||
break
|
||||
|
||||
default:
|
||||
this.lookup()
|
||||
}
|
||||
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
, focus: function (e) {
|
||||
this.focused = true
|
||||
}
|
||||
|
||||
, blur: function (e) {
|
||||
this.focused = false
|
||||
if (!this.mousedover && this.shown) this.hide()
|
||||
}
|
||||
|
||||
, click: function (e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
this.select()
|
||||
this.$element.focus()
|
||||
}
|
||||
|
||||
, mouseenter: function (e) {
|
||||
this.mousedover = true
|
||||
this.$menu.find('.active').removeClass('active')
|
||||
$(e.currentTarget).addClass('active')
|
||||
}
|
||||
|
||||
, mouseleave: function (e) {
|
||||
this.mousedover = false
|
||||
if (!this.focused && this.shown) this.hide()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* TYPEAHEAD PLUGIN DEFINITION
|
||||
* =========================== */
|
||||
|
||||
var old = $.fn.typeahead
|
||||
|
||||
$.fn.typeahead = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('typeahead')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.typeahead.defaults = {
|
||||
source: []
|
||||
, items: 8
|
||||
, menu: '<ul class="typeahead dropdown-menu"></ul>'
|
||||
, item: '<li><a href="#"></a></li>'
|
||||
, minLength: 1
|
||||
}
|
||||
|
||||
$.fn.typeahead.Constructor = Typeahead
|
||||
|
||||
|
||||
/* TYPEAHEAD NO CONFLICT
|
||||
* =================== */
|
||||
|
||||
$.fn.typeahead.noConflict = function () {
|
||||
$.fn.typeahead = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* TYPEAHEAD DATA-API
|
||||
* ================== */
|
||||
|
||||
$(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
|
||||
var $this = $(this)
|
||||
if ($this.data('typeahead')) return
|
||||
$this.typeahead($this.data())
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
2742
docs/assets/js/bootstrap.js
vendored
2742
docs/assets/js/bootstrap.js
vendored
File diff suppressed because it is too large
Load Diff
2
docs/assets/js/bootstrap.min.js
vendored
2
docs/assets/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
2536
docs/components.html
Normal file
2536
docs/components.html
Normal file
File diff suppressed because it is too large
Load Diff
2038
docs/css.html
Normal file
2038
docs/css.html
Normal file
File diff suppressed because it is too large
Load Diff
1468
docs/customize.html
1468
docs/customize.html
File diff suppressed because it is too large
Load Diff
300
docs/docs.html
300
docs/docs.html
@@ -1327,10 +1327,14 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<p>Included with Bootstrap are optional form layouts for common use cases.</p>
|
||||
|
||||
<h3 id="forms-inline">Inline form</h3>
|
||||
<p>Add <code>.form-inline</code> for left-aligned labels and inline-block controls for a compact layout.</p>
|
||||
<p>Add <code>.form-inline</code> for left-aligned and inline-block controls for a compact layout.</p>
|
||||
<div class="bs-docs-sidenote">
|
||||
<h4>Requires custom widths</h4>
|
||||
<p>Inputs, selects, and textareas are 100% wide by default in Bootstrap. To use the inline form, you'll have to set a width on the form controls used within.</p>
|
||||
</div>
|
||||
<form class="bs-docs-example form-inline">
|
||||
<input type="text" class="col col-lg-3" placeholder="Email">
|
||||
<input type="password" class="col col-lg-3" placeholder="Password">
|
||||
<input type="text" placeholder="Email" style="width: 180px;">
|
||||
<input type="password" placeholder="Password" style="width: 180px;">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox"> Remember me
|
||||
@@ -1340,8 +1344,8 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
</form><!-- /example -->
|
||||
{% highlight html %}
|
||||
<form class="form-inline">
|
||||
<input type="text" class="col col-lg-3" placeholder="Email">
|
||||
<input type="password" class="col col-lg-3" placeholder="Password">
|
||||
<input type="text" placeholder="Email" style="width: 180px;">
|
||||
<input type="password" placeholder="Password" style="width: 180px;">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox"> Remember me
|
||||
@@ -1927,74 +1931,30 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
{% endhighlight %}
|
||||
|
||||
<h4>Column sizing</h4>
|
||||
<p>Use <code>.col col-lg-1</code> to <code>.col col-lg-12</code> for setting widths on inputs that match Bootstrap's grid system.</p>
|
||||
<form class="bs-docs-example" style="padding-bottom: 15px;">
|
||||
<div class="controls docs-input-sizes">
|
||||
<input class="col col-lg-1" type="text" placeholder=".col col-lg-1">
|
||||
<input class="col col-lg-2" type="text" placeholder=".col col-lg-2">
|
||||
<input class="col col-lg-3" type="text" placeholder=".col col-lg-3">
|
||||
<select class="col col-lg-1">
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
</select>
|
||||
<select class="col col-lg-2">
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
</select>
|
||||
<select class="col col-lg-3">
|
||||
<option>1</option>
|
||||
<option>2</option>
|
||||
<option>3</option>
|
||||
<option>4</option>
|
||||
<option>5</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
{% highlight html %}
|
||||
<input class="col col-lg-1" type="text" placeholder=".col col-lg-1">
|
||||
<input class="col col-lg-2" type="text" placeholder=".col col-lg-2">
|
||||
<input class="col col-lg-3" type="text" placeholder=".col col-lg-3">
|
||||
<select class="col col-lg-1">
|
||||
...
|
||||
</select>
|
||||
<select class="col col-lg-2">
|
||||
...
|
||||
</select>
|
||||
<select class="col col-lg-3">
|
||||
...
|
||||
</select>
|
||||
{% endhighlight %}
|
||||
|
||||
<p>If you need multiple inputs on the same line, wrap them in the standard grid markup (with <code>.row</code> and <code>.col-span-*</code> classes). Each input should have it's own column and will expand to fill the available width automatically.</p>
|
||||
<p>Wrap inputs in grid columns, or any custom parent element, to easily enforce desired widths.</p>
|
||||
<form class="bs-docs-example" style="padding-bottom: 15px;">
|
||||
<div class="row">
|
||||
<div class="col col-lg-4">
|
||||
<input type="text" placeholder=".col col-lg-4">
|
||||
<div class="col col-lg-2">
|
||||
<input type="text" placeholder="col col-large-2">
|
||||
</div>
|
||||
<div class="col col-lg-3">
|
||||
<input type="text" placeholder="col col-large-3">
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<input type="text" placeholder=".col col-lg-4">
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<input type="text" placeholder=".col col-lg-4">
|
||||
<input type="text" placeholder="col col-large-4">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% highlight html %}
|
||||
<div class="row">
|
||||
<div class="col col-lg-4">
|
||||
<input type="text" placeholder=".col col-lg-4">
|
||||
<div class="col col-lg-2">
|
||||
<input type="text" placeholder="col col-large-2">
|
||||
</div>
|
||||
<div class="col col-lg-3">
|
||||
<input type="text" placeholder="col col-large-3">
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<input type="text" placeholder=".col col-lg-4">
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<input type="text" placeholder=".col col-lg-4">
|
||||
<input type="text" placeholder="col col-large-4">
|
||||
</div>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
@@ -2047,7 +2007,7 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
</div>
|
||||
|
||||
<h2 id="buttons-options">Button options</h2>
|
||||
<p>Button styles can be applied to anything with the <code>.btn</code> class applied. However, typically you'll want to apply these to only <code><a></code> and <code><button></code> elements for the best rendering.</p>
|
||||
<p>Use any of the available button classes to quickly create a styled button.</p>
|
||||
<div class="bs-docs-example">
|
||||
<button type="button" class="btn btn-default">Default</button>
|
||||
<button type="button" class="btn btn-primary">Primary</button>
|
||||
@@ -2080,56 +2040,55 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<button type="button" class="btn btn-link">Link</button>
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
<h2 id="buttons-sizes">Button sizes</h2>
|
||||
<p>Fancy larger or smaller buttons? Add <code>.btn-large</code>, <code>.btn-small</code>, or <code>.btn-mini</code> for additional sizes.</p>
|
||||
<div class="bs-docs-example">
|
||||
<p>
|
||||
<button type="button" class="btn btn-large btn-primary">Large button</button>
|
||||
<button type="button" class="btn btn-large">Large button</button>
|
||||
<button type="button" class="btn btn-primary btn-large">Large button</button>
|
||||
<button type="button" class="btn btn-default btn-large">Large button</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-primary">Default button</button>
|
||||
<button type="button" class="btn">Default button</button>
|
||||
<button type="button" class="btn btn-default">Default button</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-small btn-primary">Small button</button>
|
||||
<button type="button" class="btn btn-small">Small button</button>
|
||||
<button type="button" class="btn btn-primary btn-small">Small button</button>
|
||||
<button type="button" class="btn btn-default btn-small">Small button</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-mini btn-primary">Mini button</button>
|
||||
<button type="button" class="btn btn-mini">Mini button</button>
|
||||
<button type="button" class="btn btn-primary btn-mini">Mini button</button>
|
||||
<button type="button" class="btn btn-default btn-mini">Mini button</button>
|
||||
</p>
|
||||
</div>
|
||||
{% highlight html %}
|
||||
<p>
|
||||
<button type="button" class="btn btn-large btn-primary">Large button</button>
|
||||
<button type="button" class="btn btn-large">Large button</button>
|
||||
<button type="button" class="btn btn-primary btn-large">Large button</button>
|
||||
<button type="button" class="btn btn-default btn-large">Large button</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-primary">Default button</button>
|
||||
<button type="button" class="btn">Default button</button>
|
||||
<button type="button" class="btn btn-default">Default button</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-small btn-primary">Small button</button>
|
||||
<button type="button" class="btn btn-small">Small button</button>
|
||||
<button type="button" class="btn btn-primary btn-small">Small button</button>
|
||||
<button type="button" class="btn btn-default btn-small">Small button</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-mini btn-primary">Mini button</button>
|
||||
<button type="button" class="btn btn-mini">Mini button</button>
|
||||
<button type="button" class="btn btn-primary btn-mini">Mini button</button>
|
||||
<button type="button" class="btn btn-default btn-mini">Mini button</button>
|
||||
</p>
|
||||
{% endhighlight %}
|
||||
|
||||
<p>Create block level buttons—those that span the full width of a parent— by adding <code>.btn-block</code>.</p>
|
||||
<div class="bs-docs-example">
|
||||
<div class="well" style="max-width: 400px; margin: 0 auto 10px;">
|
||||
<button type="button" class="btn btn-large btn-block btn-primary">Block level button</button>
|
||||
<button type="button" class="btn btn-large btn-block">Block level button</button>
|
||||
<button type="button" class="btn btn-primary btn-large btn-block">Block level button</button>
|
||||
<button type="button" class="btn btn-default btn-large btn-block">Block level button</button>
|
||||
</div>
|
||||
</div>
|
||||
{% highlight html %}
|
||||
<button type="button" class="btn btn-large btn-block btn-primary">Block level button</button>
|
||||
<button type="button" class="btn btn-large btn-block">Block level button</button>
|
||||
<button type="button" class="btn btn-primary btn-large btn-block">Block level button</button>
|
||||
<button type="button" class="btn btn-default btn-large btn-block">Block level button</button>
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
@@ -2139,12 +2098,12 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<h3>Button element</h3>
|
||||
<p>Add the <code>disabled</code> attribute to <code><button></code> buttons.</p>
|
||||
<p class="bs-docs-example">
|
||||
<button type="button" class="btn btn-large btn-primary" disabled="disabled">Primary button</button>
|
||||
<button type="button" class="btn btn-large" disabled="disabled">Button</button>
|
||||
<button type="button" class="btn btn-primary btn-large" disabled="disabled">Primary button</button>
|
||||
<button type="button" class="btn btn-default btn-large" disabled="disabled">Button</button>
|
||||
</p>
|
||||
{% highlight html %}
|
||||
<button type="button" class="btn btn-large btn-primary" disabled="disabled">Primary button</button>
|
||||
<button type="button" class="btn btn-large" disabled="disabled">Button</button>
|
||||
<button type="button" class="btn btn-default btn-large" disabled="disabled">Button</button>
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="bs-docs-sidenote">
|
||||
@@ -2155,12 +2114,12 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<h3>Anchor element</h3>
|
||||
<p>Add the <code>.disabled</code> class to <code><a></code> buttons.</p>
|
||||
<p class="bs-docs-example">
|
||||
<a href="#" class="btn btn-large btn-primary disabled">Primary link</a>
|
||||
<a href="#" class="btn btn-large disabled">Link</a>
|
||||
<a href="#" class="btn btn-primary btn-large disabled">Primary link</a>
|
||||
<a href="#" class="btn btn-default btn-large disabled">Link</a>
|
||||
</p>
|
||||
{% highlight html %}
|
||||
<a href="#" class="btn btn-large btn-primary disabled">Primary link</a>
|
||||
<a href="#" class="btn btn-large disabled">Link</a>
|
||||
<a href="#" class="btn btn-primary btn-large disabled">Primary link</a>
|
||||
<a href="#" class="btn btn-default btn-large disabled">Link</a>
|
||||
{% endhighlight %}
|
||||
<p>
|
||||
We use <code>.disabled</code> as a utility class here, similar to the common <code>.active</code> class, so no prefix is required.
|
||||
@@ -2171,19 +2130,19 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
</div>
|
||||
|
||||
|
||||
<h2 id="buttons-tags">One class, multiple tags</h2>
|
||||
<p>Use the <code>.btn</code> class on an <code><a></code>, <code><button></code>, or <code><input></code> element.</p>
|
||||
<h2 id="buttons-tags">Using multiple tags</h2>
|
||||
<p>Use the button classes on an <code><a></code>, <code><button></code>, or <code><input></code> element.</p>
|
||||
<form class="bs-docs-example">
|
||||
<a class="btn" href="">Link</a>
|
||||
<button class="btn" type="submit">Button</button>
|
||||
<input class="btn" type="button" value="Input">
|
||||
<input class="btn" type="submit" value="Submit">
|
||||
<a class="btn btn-default" href="#">Link</a>
|
||||
<button class="btn btn-default" type="submit">Button</button>
|
||||
<input class="btn btn-default" type="button" value="Input">
|
||||
<input class="btn btn-default" type="submit" value="Submit">
|
||||
</form>
|
||||
{% highlight html %}
|
||||
<a class="btn" href="">Link</a>
|
||||
<button class="btn" type="submit">Button</button>
|
||||
<input class="btn" type="button" value="Input">
|
||||
<input class="btn" type="submit" value="Submit">
|
||||
<a class="btn btn-default" href="#">Link</a>
|
||||
<button class="btn btn-default" type="submit">Button</button>
|
||||
<input class="btn btn-default" type="button" value="Input">
|
||||
<input class="btn btn-default" type="submit" value="Submit">
|
||||
{% endhighlight %}
|
||||
|
||||
<div class="bs-docs-sidenote">
|
||||
@@ -2599,20 +2558,20 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group">
|
||||
<a class="btn" href="#"><span class="glyphicon glyphicon-align-left"></span></a>
|
||||
<a class="btn" href="#"><span class="glyphicon glyphicon-align-center"></span></a>
|
||||
<a class="btn" href="#"><span class="glyphicon glyphicon-align-right"></span></a>
|
||||
<a class="btn" href="#"><span class="glyphicon glyphicon-align-justify"></span></a>
|
||||
<a class="btn btn-default" href="#"><span class="glyphicon glyphicon-align-left"></span></a>
|
||||
<a class="btn btn-default" href="#"><span class="glyphicon glyphicon-align-center"></span></a>
|
||||
<a class="btn btn-default" href="#"><span class="glyphicon glyphicon-align-right"></span></a>
|
||||
<a class="btn btn-default" href="#"><span class="glyphicon glyphicon-align-justify"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /bs-docs-example -->
|
||||
{% highlight html %}
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group">
|
||||
<a class="btn" href="#"><span class="glyphicon glyphicon-align-left"></span></a>
|
||||
<a class="btn" href="#"><span class="glyphicon glyphicon-align-center"></span></a>
|
||||
<a class="btn" href="#"><span class="glyphicon glyphicon-align-right"></span></a>
|
||||
<a class="btn" href="#"><span class="glyphicon glyphicon-align-justify"></span></a>
|
||||
<a class="btn btn-default" href="#"><span class="glyphicon glyphicon-align-left"></span></a>
|
||||
<a class="btn btn-default" href="#"><span class="glyphicon glyphicon-align-center"></span></a>
|
||||
<a class="btn btn-default" href="#"><span class="glyphicon glyphicon-align-right"></span></a>
|
||||
<a class="btn btn-default" href="#"><span class="glyphicon glyphicon-align-justify"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
@@ -2638,8 +2597,8 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
</div><!-- /bs-docs-example -->
|
||||
{% highlight html %}
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-primary" href="#"><span class="glyphicon glyphicon-user"></span> User</a>
|
||||
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
|
||||
<a class="btn btn-default btn-primary" href="#"><span class="glyphicon glyphicon-user"></span> User</a>
|
||||
<a class="btn btn-default btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#"><span class="glyphicon glyphicon-pencil"></span> Edit</a></li>
|
||||
<li><a href="#"><span class="glyphicon glyphicon-trash"></span> Delete</a></li>
|
||||
@@ -2652,18 +2611,18 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
|
||||
<h5>Large button</h5>
|
||||
<div class="bs-docs-example">
|
||||
<a class="btn btn-large" href="#"><span class="glyphicon glyphicon-star"></span> Star</a>
|
||||
<a class="btn btn-default btn-large" href="#"><span class="glyphicon glyphicon-star"></span> Star</a>
|
||||
</div><!-- /bs-docs-example -->
|
||||
{% highlight html %}
|
||||
<a class="btn btn-large" href="#"><span class="glyphicon glyphicon-star"></span> Star</a>
|
||||
<a class="btn btn-default btn-large" href="#"><span class="glyphicon glyphicon-star"></span> Star</a>
|
||||
{% endhighlight %}
|
||||
|
||||
<h5>Small button</h5>
|
||||
<div class="bs-docs-example">
|
||||
<a class="btn btn-small" href="#"><span class="glyphicon glyphicon-star"></span></a>
|
||||
<a class="btn btn-default btn-small" href="#"><span class="glyphicon glyphicon-star"></span></a>
|
||||
</div><!-- /bs-docs-example -->
|
||||
{% highlight html %}
|
||||
<a class="btn btn-small" href="#"><span class="glyphicon glyphicon-star"></span></a>
|
||||
<a class="btn btn-default btn-small" href="#"><span class="glyphicon glyphicon-star"></span></a>
|
||||
{% endhighlight %}
|
||||
|
||||
|
||||
@@ -2878,16 +2837,16 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<p>Wrap a series of buttons with <code>.btn</code> in <code>.btn-group</code>.</p>
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-group" style="margin: 9px 0 5px;">
|
||||
<button type="button" class="btn">Left</button>
|
||||
<button type="button" class="btn">Middle</button>
|
||||
<button type="button" class="btn">Right</button>
|
||||
<button type="button" class="btn btn-default">Left</button>
|
||||
<button type="button" class="btn btn-default">Middle</button>
|
||||
<button type="button" class="btn btn-default">Right</button>
|
||||
</div>
|
||||
</div>
|
||||
{% highlight html %}
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn">Left</button>
|
||||
<button type="button" class="btn">Middle</button>
|
||||
<button type="button" class="btn">Right</button>
|
||||
<button type="button" class="btn btn-default">Left</button>
|
||||
<button type="button" class="btn btn-default">Middle</button>
|
||||
<button type="button" class="btn btn-default">Right</button>
|
||||
</div>
|
||||
{% endhighlight %}
|
||||
|
||||
@@ -2896,18 +2855,18 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-toolbar" style="margin: 0;">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn">1</button>
|
||||
<button type="button" class="btn">2</button>
|
||||
<button type="button" class="btn">3</button>
|
||||
<button type="button" class="btn">4</button>
|
||||
<button type="button" class="btn btn-default">1</button>
|
||||
<button type="button" class="btn btn-default">2</button>
|
||||
<button type="button" class="btn btn-default">3</button>
|
||||
<button type="button" class="btn btn-default">4</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn">5</button>
|
||||
<button type="button" class="btn">6</button>
|
||||
<button type="button" class="btn">7</button>
|
||||
<button type="button" class="btn btn-default">5</button>
|
||||
<button type="button" class="btn btn-default">6</button>
|
||||
<button type="button" class="btn btn-default">7</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn">8</button>
|
||||
<button type="button" class="btn btn-default">8</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2923,12 +2882,12 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<p>Place buttons groups within button groups when you want dropdown menus mixed with a series of buttons.</p>
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn">1</button>
|
||||
<button type="button" class="btn">2</button>
|
||||
<button type="button" class="btn">3</button>
|
||||
<button type="button" class="btn btn-default">1</button>
|
||||
<button type="button" class="btn btn-default">2</button>
|
||||
<button type="button" class="btn btn-default">3</button>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
Dropdown
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
@@ -2945,10 +2904,10 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<p>Make a set of buttons appear vertically stacked rather than horizontally.</p>
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-group btn-group-vertical">
|
||||
<button type="button" class="btn"><i class="glyphicon glyphicon-align-left"></i></button>
|
||||
<button type="button" class="btn"><i class="glyphicon glyphicon-align-center"></i></button>
|
||||
<button type="button" class="btn"><i class="glyphicon glyphicon-align-right"></i></button>
|
||||
<button type="button" class="btn"><i class="glyphicon glyphicon-align-justify"></i></button>
|
||||
<button type="button" class="btn btn-default"><i class="glyphicon glyphicon-align-left"></i></button>
|
||||
<button type="button" class="btn btn-default"><i class="glyphicon glyphicon-align-center"></i></button>
|
||||
<button type="button" class="btn btn-default"><i class="glyphicon glyphicon-align-right"></i></button>
|
||||
<button type="button" class="btn btn-default"><i class="glyphicon glyphicon-align-justify"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
{% highlight html %}
|
||||
@@ -2961,9 +2920,9 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<p>Make a group of buttons stretch at the same size to span the entire width of its parent. <strong>This only works with <code><a></code> elements</strong> as the <code><button></code> doesn't pick up these styles.</p>
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-group btn-group-justified">
|
||||
<a href="#" class="btn">Left</a>
|
||||
<a href="#" class="btn">Right</a>
|
||||
<a href="#" class="btn">Middle</a>
|
||||
<a href="#" class="btn btn-default">Left</a>
|
||||
<a href="#" class="btn btn-default">Right</a>
|
||||
<a href="#" class="btn btn-default">Middle</a>
|
||||
</div>
|
||||
</div>
|
||||
{% highlight html %}
|
||||
@@ -2994,7 +2953,7 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-toolbar" style="margin-bottom: 10px;">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
@@ -3048,7 +3007,7 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
{% highlight html %}
|
||||
<!-- Single button -->
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
Action <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -3066,8 +3025,8 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-toolbar" style="margin: 0;">
|
||||
<div class="btn-group">
|
||||
<button class="btn">Action</button>
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
|
||||
<button class="btn btn-default">Action</button>
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
@@ -3125,8 +3084,8 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
{% highlight html %}
|
||||
<!-- Split button -->
|
||||
<div class="btn-group">
|
||||
<button class="btn">Action</button>
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
<button class="btn btn-default">Action</button>
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -3144,7 +3103,7 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-toolbar" style="margin: 0;">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-large dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<button class="btn btn-default btn-large dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
Large button <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -3156,7 +3115,7 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-small dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<button class="btn btn-default btn-small dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
Small button <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -3168,7 +3127,7 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-mini dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<button class="btn btn-default btn-mini dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
Mini button <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -3184,7 +3143,7 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
{% highlight html %}
|
||||
<!-- Large button group -->
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-large dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<button class="btn btn-default btn-large dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
Large button <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -3194,7 +3153,7 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
|
||||
<!-- Small button group -->
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-small dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<button class="btn btn-default btn-small dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
Small button <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -3204,7 +3163,7 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
|
||||
<!-- Mini button group -->
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-mini dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
<button class="btn btn-default btn-mini dropdown-toggle" type="button" data-toggle="dropdown">
|
||||
Mini button <span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -3218,8 +3177,8 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
<div class="bs-docs-example">
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group dropup">
|
||||
<button class="btn">Dropup</button>
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
|
||||
<button class="btn btn-default">Dropup</button>
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
@@ -3229,8 +3188,8 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
<div class="btn-group dropup">
|
||||
<button class="btn primary">Right dropup</button>
|
||||
<button class="btn primary dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
|
||||
<button class="btn btn-primary">Right dropup</button>
|
||||
<button class="btn btn-primary dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
@@ -3243,8 +3202,8 @@ For example, <code><section></code> should be wrapped as inline.
|
||||
</div><!-- /example -->
|
||||
{% highlight html %}
|
||||
<div class="btn-group dropup">
|
||||
<button class="btn">Dropup</button>
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
<button class="btn btn-default">Dropup</button>
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
@@ -5003,10 +4962,10 @@ $('#myModal').on('show', function (e) {
|
||||
================================================== -->
|
||||
<div class="bs-docs-section" id="transitions">
|
||||
<div class="page-header">
|
||||
<h1>Transitions <small>bootstrap-transition.js</small></h1>
|
||||
<h1>Transitions <small>transition.js</small></h1>
|
||||
</div>
|
||||
<h3>About transitions</h3>
|
||||
<p>For simple transition effects, include bootstrap-transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.</p>
|
||||
<p>For simple transition effects, include transition.js once alongside the other JS files. If you're using the compiled (or minified) bootstrap.js, there is no need to include this—it's already there.</p>
|
||||
<h3>Use cases</h3>
|
||||
<p>A few examples of the transition plugin:</p>
|
||||
<ul>
|
||||
@@ -5025,7 +4984,7 @@ $('#myModal').on('show', function (e) {
|
||||
================================================== -->
|
||||
<div class="bs-docs-section" id="modals">
|
||||
<div class="page-header">
|
||||
<h1>Modals <small>bootstrap-modal.js</small></h1>
|
||||
<h1>Modals <small>modal.js</small></h1>
|
||||
</div>
|
||||
|
||||
<h2 id="modals-examples">Examples</h2>
|
||||
@@ -5261,7 +5220,7 @@ $('#myModal').on('hidden', function () {
|
||||
================================================== -->
|
||||
<section id="dropdowns">
|
||||
<div class="page-header">
|
||||
<h1>Dropdowns <small>bootstrap-dropdown.js</small></h1>
|
||||
<h1>Dropdowns <small>dropdown.js</small></h1>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5398,7 +5357,7 @@ $('.dropdown-toggle').dropdown()
|
||||
================================================== -->
|
||||
<section id="scrollspy">
|
||||
<div class="page-header">
|
||||
<h1>ScrollSpy <small>bootstrap-scrollspy.js</small></h1>
|
||||
<h1>ScrollSpy <small>scrollspy.js</small></h1>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5517,7 +5476,7 @@ $('[data-spy="scroll"]').each(function () {
|
||||
================================================== -->
|
||||
<section id="tabs">
|
||||
<div class="page-header">
|
||||
<h1>Togglable tabs <small>bootstrap-tab.js</small></h1>
|
||||
<h1>Togglable tabs <small>tab.js</small></h1>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5644,7 +5603,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
|
||||
================================================== -->
|
||||
<section id="tooltips">
|
||||
<div class="page-header">
|
||||
<h1>Tooltips <small>bootstrap-tooltip.js</small></h1>
|
||||
<h1>Tooltips <small>tooltip.js</small></h1>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -5785,7 +5744,7 @@ $('#example').tooltip(options)
|
||||
================================================== -->
|
||||
<section id="popovers">
|
||||
<div class="page-header">
|
||||
<h1>Popovers <small>bootstrap-popover.js</small></h1>
|
||||
<h1>Popovers <small>popover.js</small></h1>
|
||||
</div>
|
||||
|
||||
<h2>Examples</h2>
|
||||
@@ -5833,7 +5792,6 @@ $('#example').tooltip(options)
|
||||
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<p>No markup shown as popovers are generated from JavaScript and content within a <code>data</code> attribute.</p>
|
||||
|
||||
<h3>Live demo</h3>
|
||||
<div class="bs-docs-example" style="padding-bottom: 24px;">
|
||||
@@ -5967,7 +5925,7 @@ $('#example').tooltip(options)
|
||||
================================================== -->
|
||||
<div class="bs-docs-section" id="js-alerts">
|
||||
<div class="page-header">
|
||||
<h1>Alert messages <small>bootstrap-alert.js</small></h1>
|
||||
<h1>Alert messages <small>alert.js</small></h1>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6046,7 +6004,7 @@ $('#my-alert').bind('closed', function () {
|
||||
================================================== -->
|
||||
<div class="bs-docs-section" id="js-buttons">
|
||||
<div class="page-header">
|
||||
<h1>Buttons <small>bootstrap-button.js</small></h1>
|
||||
<h1>Buttons <small>button.js</small></h1>
|
||||
</div>
|
||||
|
||||
<h2>Example uses</h2>
|
||||
@@ -6191,7 +6149,7 @@ $('.nav-tabs').button()
|
||||
================================================== -->
|
||||
<section id="collapse">
|
||||
<div class="page-header">
|
||||
<h1>Collapse <small>bootstrap-collapse.js</small></h1>
|
||||
<h1>Collapse <small>collapse.js</small></h1>
|
||||
</div>
|
||||
|
||||
<h3>About</h3>
|
||||
@@ -6401,7 +6359,7 @@ $('#myCollapsible').on('hidden', function () {
|
||||
================================================== -->
|
||||
<section id="carousel">
|
||||
<div class="page-header">
|
||||
<h1>Carousel <small>bootstrap-carousel.js</small></h1>
|
||||
<h1>Carousel <small>carousel.js</small></h1>
|
||||
</div>
|
||||
|
||||
<h2>Examples</h2>
|
||||
@@ -6613,7 +6571,7 @@ $('.carousel').carousel({
|
||||
================================================== -->
|
||||
<section id="typeahead">
|
||||
<div class="page-header">
|
||||
<h1>Typeahead <small>bootstrap-typeahead.js</small></h1>
|
||||
<h1>Typeahead <small>typeahead.js</small></h1>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6710,7 +6668,7 @@ $('.typeahead').typeahead()
|
||||
================================================== -->
|
||||
<section id="affix">
|
||||
<div class="page-header">
|
||||
<h1>Affix <small>bootstrap-affix.js</small></h1>
|
||||
<h1>Affix <small>affix.js</small></h1>
|
||||
</div>
|
||||
|
||||
<h2>Example</h2>
|
||||
|
@@ -327,19 +327,19 @@ body {
|
||||
<img class="img-circle" data-src="holder.js/140x140">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.</p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
<p><a class="btn btn-default" href="#">View details »</a></p>
|
||||
</div><!-- /.col-lg-4 -->
|
||||
<div class="col col-lg-4">
|
||||
<img class="img-circle" data-src="holder.js/140x140">
|
||||
<h2>Heading</h2>
|
||||
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.</p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
<p><a class="btn btn-default" href="#">View details »</a></p>
|
||||
</div><!-- /.col-lg-4 -->
|
||||
<div class="col col-lg-4">
|
||||
<img class="img-circle" data-src="holder.js/140x140">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
<p><a class="btn btn-default" href="#">View details »</a></p>
|
||||
</div><!-- /.col-lg-4 -->
|
||||
</div><!-- /.row -->
|
||||
|
||||
|
@@ -11,10 +11,15 @@ title: Grid template
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
h4 {
|
||||
margin-top: 25px;
|
||||
}
|
||||
.row {
|
||||
margin-bottom: 20px;
|
||||
margin-left: -15px;
|
||||
margin-right: -15px;
|
||||
}
|
||||
.row .row {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
[class*="col-lg-"] {
|
||||
padding-top: 15px;
|
||||
@@ -51,6 +56,19 @@ title: Grid template
|
||||
</div>
|
||||
|
||||
<h4>Full width, single column</h4>
|
||||
<p class="text-muted">No grid classes are necessary for full-width elements.</p>
|
||||
<p class="text-warning">No grid classes are necessary for full-width elements.</p>
|
||||
|
||||
<h4>Two columns with two nested columns</h4>
|
||||
<div class="row">
|
||||
<div class="col col-lg-8">
|
||||
.col .col-lg-8
|
||||
<div class="row">
|
||||
<div class="col col-lg-6">.col .col-lg-6</div>
|
||||
<div class="col col-lg-6">.col .col-lg-6</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-lg-4">.col .col-lg-4</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!-- /container -->
|
||||
|
@@ -63,7 +63,7 @@ title: Jumbotron template
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="navbar-form pull-right">
|
||||
<form class="navbar-form form-inline pull-right">
|
||||
<input type="text" placeholder="Email">
|
||||
<input type="password" placeholder="Password">
|
||||
<button type="submit" class="btn">Sign in</button>
|
||||
@@ -88,17 +88,17 @@ title: Jumbotron template
|
||||
<div class="col col-lg-4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
<p><a class="btn btn-default" href="#">View details »</a></p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
<p><a class="btn btn-default" href="#">View details »</a></p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
<p><a class="btn btn-default" href="#">View details »</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@@ -121,17 +121,17 @@ title: Justified nav template
|
||||
<div class="col col-lg-4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
<p><a class="btn btn-default" href="#">View details »</a></p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
<p><a class="btn btn-default" href="#">View details »</a></p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<h2>Heading</h2>
|
||||
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa.</p>
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
<p><a class="btn btn-default" href="#">View details »</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
282
docs/getting-started.html
Normal file
282
docs/getting-started.html
Normal file
@@ -0,0 +1,282 @@
|
||||
---
|
||||
layout: default
|
||||
title: Getting started
|
||||
slug: getting-started
|
||||
lead: "An overview of Bootstrap, how to download and use, basic templates and examples, and more."
|
||||
---
|
||||
|
||||
|
||||
<!-- Getting started
|
||||
================================================== -->
|
||||
<div class="bs-docs-section" id="download">
|
||||
<div class="page-header">
|
||||
<h1>Download Bootstrap</h1>
|
||||
</div>
|
||||
<p class="lead">There are a few easy ways to quickly get started with Bootstrap, each one appealing to a different skill level and use case. Read through to see what suits your particular needs.</p>
|
||||
|
||||
<h3>Download compiled CSS and JS</h3>
|
||||
<p class="lead">The fastest way to get started is to get the compiled and minified versions of our CSS, JavaScript, and fonts. No documentation or original source files are included.</p>
|
||||
<p><a class="btn btn-large btn-primary" href="assets/bootstrap.zip" onclick="_gaq.push(['_trackEvent', 'Getting started', 'Download', 'Download compiled']);">Download Bootstrap</a></p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3 id="download-options">More download options</h3>
|
||||
<div class="bs-docs-dl-options">
|
||||
<h4>
|
||||
<a href="https://github.com/twitter/bootstrap/zipball/master" onclick="_gaq.push(['_trackEvent', 'Getting started', 'Download', 'Download source']);">Download latest source code</a>
|
||||
</h4>
|
||||
<p>Get the original files for all CSS and JavaScript by downloading the latest version directly from GitHub.</p>
|
||||
<h4>
|
||||
<a href="https://github.com/twitter/bootstrap/" onclick="_gaq.push(['_trackEvent', 'Getting started', 'Download', 'GitHub project']);">Clone or fork via GitHub</a>
|
||||
</h4>
|
||||
<p>Clone the entire project or fork your own version of Bootstrap to make it your own by visiting us on GitHub.</p>
|
||||
<h4>
|
||||
Install with <a href="http://twitter.github.com/bower">Bower</a>
|
||||
</h4>
|
||||
<p>Install and manage the original files for all CSS and JavaScript, along with a local copy of the docs, using <a href="http://twitter.github.com/bower">Bower</a>.</p>
|
||||
{% highlight bash %}$ bower install bootstrap{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h3 id="download-cdn">Use the Bootstrap CDN</h3>
|
||||
<p>The folks over at <a href="https://www.netdna.com/">NetDNA</a> have graciously provided CDN support for Bootstrap's CSS and JavaScript. To use, swap your local instances for the <a href="http://www.bootstrapcdn.com/">Bootstrap CDN</a> links listed below.</p>
|
||||
{% highlight html linenos %}
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
|
||||
{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<!-- File structure
|
||||
================================================== -->
|
||||
<div class="bs-docs-section" id="whats-included">
|
||||
<div class="page-header">
|
||||
<h1>What's included</h1>
|
||||
</div>
|
||||
<p class="lead">Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations.</p>
|
||||
<p>Once downloaded, unzip the compressed folder to see the structure of (the compiled) Bootstrap. You'll see something like this:</p>
|
||||
|
||||
{% highlight bash %}
|
||||
bootstrap/
|
||||
├── css/
|
||||
│ ├── bootstrap.css
|
||||
│ ├── bootstrap.min.css
|
||||
├── js/
|
||||
│ ├── bootstrap.js
|
||||
│ ├── bootstrap.min.js
|
||||
└── fonts/
|
||||
├── glyphiconshalflings-regular.eot
|
||||
├── glyphiconshalflings-regular.otf
|
||||
├── glyphiconshalflings-regular.svg
|
||||
├── glyphiconshalflings-regular.ttf
|
||||
└── glyphiconshalflings-regular.woff
|
||||
{% endhighlight %}
|
||||
|
||||
<p>This is the most basic form of Bootstrap: compiled files for quick drop-in usage in nearly any web project. We provide compiled CSS and JS (<code>bootstrap.*</code>), as well as compiled and minified CSS and JS (<code>bootstrap.min.*</code>). The image files are compressed using <a href="http://imageoptim.com/">ImageOptim</a>, a Mac app for compressing PNGs.</p>
|
||||
<div class="bs-callout">
|
||||
<h4>jQuery required</h4>
|
||||
<p>Please note that <strong>all JavaScript plugins require jQuery</strong> to be included, as shown in the <a href="#examples">starter template</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Examples
|
||||
================================================== -->
|
||||
<div class="bs-docs-section" id="examples">
|
||||
<div class="page-header">
|
||||
<h1>Templates and examples</h1>
|
||||
</div>
|
||||
<p class="lead">Make use of a super basic HTML template, or dive into a few examples we've started for you. We encourage folks to iterate on these examples and not simply use them as an end result.</p>
|
||||
|
||||
<h3 id="examples-template">HTML template</h3>
|
||||
<p>Copy and paste the HTML from below to get started with a bare bones Bootstrap document.</p>
|
||||
{% highlight html %}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Bootstrap 101 Template</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- Bootstrap -->
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello, world!</h1>
|
||||
|
||||
<!-- JavaScript plugins (requires jQuery) -->
|
||||
<script src="http://code.jquery.com/jquery.js"></script>
|
||||
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
||||
<script src="js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Optionally enable responsive features in IE8 -->
|
||||
<script src="js/respond.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
{% endhighlight %}
|
||||
|
||||
<h3 id="examples-list">Examples</h3>
|
||||
<div class="row bs-examples">
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/starter-template/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-starter.png" alt="">
|
||||
</a>
|
||||
<h4>Starter template</h4>
|
||||
<p>A barebones HTML page with Bootstrap's CSS and JavaScript included.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/grid/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-grid.png" alt="">
|
||||
</a>
|
||||
<h4>Basic grid layouts</h4>
|
||||
<p>Simple grid layouts to familiarize you with using the Bootstrap grid system.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/jumbotron/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-marketing.png" alt="">
|
||||
</a>
|
||||
<h4>Basic marketing site</h4>
|
||||
<p>Features a jumbotron for primary message and three supporting elements.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/jumbotron-narrow/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-jumbotron-narrow.png" alt="">
|
||||
</a>
|
||||
<h4>Narrow marketing</h4>
|
||||
<p>Slim, lightweight marketing template for small projects or teams.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/justified-nav/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-justified-nav.png" alt="">
|
||||
</a>
|
||||
<h4>Justified nav</h4>
|
||||
<p>Marketing page with equal-width navigation links in a modified navbar.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/signin/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-signin.png" alt="">
|
||||
</a>
|
||||
<h4>Sign in</h4>
|
||||
<p>Barebones sign in form with custom, larger form controls and a flexible layout.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/sticky-footer/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-sticky-footer.png" alt="">
|
||||
</a>
|
||||
<h4>Sticky footer</h4>
|
||||
<p>Pin a fixed-height footer to the bottom of the user's viewport.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/sticky-footer-navbar/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-sticky-footer-navbar.png" alt="">
|
||||
</a>
|
||||
<h4>Sticky footer w/ navbar</h4>
|
||||
<p>Add a fixed navbar to the default sticky footer template.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/carousel/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-carousel.png" alt="">
|
||||
</a>
|
||||
<h4>Carousel jumbotron</h4>
|
||||
<p>An interactive riff on the basic marketing site featuring a prominent carousel.</p>
|
||||
</div>
|
||||
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/navbar/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-navbar.png" alt="">
|
||||
</a>
|
||||
<h4>Navbar</h4>
|
||||
<p>Basic template for showcasing how the navbar works.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/navbar-static-top/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-navbar-static-top.png" alt="">
|
||||
</a>
|
||||
<h4>Static top navbar</h4>
|
||||
<p>Basic template for showcasing the static navbar variation.</p>
|
||||
</div>
|
||||
<div class="col col-lg-4">
|
||||
<a class="thumbnail" href="/examples/navbar-fixed-top/" target="_blank">
|
||||
<img src="/assets/img/examples/bootstrap-example-navbar-fixed-top.png" alt="">
|
||||
</a>
|
||||
<h4>Fixed top navbar</h4>
|
||||
<p>Basic template for showcasing the fixed navbar variation.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="bs-docs-section" id="customizing">
|
||||
<div class="page-header">
|
||||
<h1>Customizing Bootstrap</h1>
|
||||
</div>
|
||||
<p class="lead">Customizing Bootstrap is best accomplished when you treat it as another dependency in your development stack. Doing so ensures future upgrades are as easy as possible while also familiarizing yourself to the intricacies of the framework.</p>
|
||||
|
||||
<p>Once you've downloaded and included Bootstrap's CSS into your templates, you can move on to customizing the included components. To do so, create a new stylesheet (LESS, if you like, or just plain CSS) to house your customizations.</p>
|
||||
|
||||
<div class="bs-callout">
|
||||
<h4>Compiled or minified?</h4>
|
||||
<p>Unless you plan on reading a good chunk of the compiled CSS, go with the minified. It's the same code, just compacted. Less bandwidth is good, especially in production environments.</p>
|
||||
</div>
|
||||
|
||||
<p>From there, include whatever Bootstrap components and HTML content you need to get your template setup. It's best to have a rough idea in mind of modifications to make and content to include, so be sure to spend a brief amount of time on that before moving on.</p>
|
||||
|
||||
<h3>Customizing components</h3>
|
||||
<p>There are varying degrees to customizing components, but most fall into two camps: light customizations and complete visual overhauls. Luckily, there are plenty of examples of both.</p>
|
||||
<p>We define light customizations as mostly surface layer changes, things like a color and font changes to existing Bootstrap components. A great example of this is the the <a href="http://translate.twitter.com">Twitter Translation Center</a> (coded by @mdo). Let's look at how to implement the custom button we wrote for this site, <code>.btn-ttc</code>.</p>
|
||||
<p>Instead of using the provided Bootstrap buttons, which only require just one class to start, <code>.btn</code>, we'll add our own modifier class, <code>.btn-ttc</code>. This will give us a slightly custom look with minimal effort.</p>
|
||||
{% highlight html %}
|
||||
<button type="button" class="btn btn-ttc">Save changes</button>
|
||||
{% endhighlight %}
|
||||
|
||||
<p>In the custom stylesheet, add the following CSS:</p>
|
||||
|
||||
{% highlight css %}
|
||||
/* Custom button
|
||||
-------------------------------------------------- */
|
||||
|
||||
/* Override base .btn styles */
|
||||
/* Apply text and background changes to three key states: default, hover, and active (click). */
|
||||
.btn-ttc,
|
||||
.btn-ttc:hover,
|
||||
.btn-ttc:active {
|
||||
color: white;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
background-color: #007da7;
|
||||
}
|
||||
|
||||
/* Apply the custom-colored gradients */
|
||||
/* Note: you'll need to include all the appropriate gradients for various browsers and standards. */
|
||||
.btn-ttc {
|
||||
background-repeat: repeat-x;
|
||||
background-image: linear-gradient(top, #009ED2 0%, #007DA7 100%);
|
||||
...
|
||||
}
|
||||
|
||||
/* Set the hover state */
|
||||
/* An easy hover state is just to move the gradient up a small amount. Add other embellishments as you see fit. */
|
||||
.btn-ttc:hover {
|
||||
background-position: 0 -15px;
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
<p>Customizing Bootstrap components takes time, but should be straightforward. <strong>Look to the source code often and duplicate the selectors you need for your modifications.</strong> Placing them after the Bootstrap source makes for easy overriding without complication. <strong>To recap, here's the basic workflow:</strong></p>
|
||||
<ul>
|
||||
<li>For each element you want to customize, find its code in the compiled Bootstrap CSS. Copy and paste the selector for a component as-is. For instance, to customize the navbar background, just snag <code>.navbar</code>.</li>
|
||||
<li>Add all your custom CSS in a separate stylesheet using the selectors you just copied from the Bootstrap source. No need for prefacing with additional classes or using <code>!important</code> here.</li>
|
||||
<li>Rinse and repeat until you're happy with your customizations.</li>
|
||||
</ul>
|
||||
<p>Going beyond light customizations and into visual overhauls is just as straightforward as the above custom button. For a site like <a href="http://yourkarma.com">Karma</a>, which uses Bootstrap as a CSS reset with heavy modifications, more extensive work is involved, but well worth it in the end.</p>
|
||||
|
||||
<div class="bs-callout">
|
||||
<h4>Alternate customization methods</h4>
|
||||
<p>While not recommended for folks new to Bootstrap, you may use one of two alternate methods for customization. The first is modifying the source .less files (making upgrades super difficult), and the second is mapping source LESS code to <a href="http://ruby.bvision.com/blog/please-stop-embedding-bootstrap-classes-in-your-html">your own classes via mixins</a>. For the time being, neither options are documented here.</p>
|
||||
</div>
|
||||
|
||||
<h3>Removing potential bloat</h3>
|
||||
<p>Not all sites and applications need to make use of everything Bootstrap has to offer, especially in production environments where bandwidth literally becomes a financial issue. We encourage folks to remove whatever is unused with our <a href="/customize/">Customizer</a>.</p>
|
||||
<p>Using the Customizer, simply uncheck any component, feature, or asset you don't need. Hit download and swap out the default Bootstrap files with these newly customized ones. You'll get vanilla Bootstrap, but without the features *you* deem unnecessary. All custom builds include compiled and minified versions, so use whichever works for you.</p>
|
||||
|
||||
</div>
|
@@ -3,34 +3,18 @@ layout: home
|
||||
title: Bootstrap
|
||||
---
|
||||
|
||||
<div class="bs-docs-jumbotron masthead">
|
||||
<div class="container">
|
||||
<div class="container">
|
||||
<div class="bs-masthead">
|
||||
|
||||
<h1>Bootstrap</h1>
|
||||
<p class="lead">Sleek, intuitive, and powerful mobile-first front-end framework for faster and easier web development.</p>
|
||||
<p>
|
||||
<a href="assets/bootstrap.zip" class="btn btn-large" onclick="_gaq.push(['_trackEvent', 'Jumbotron actions', 'Download', 'Download 3.0.0']);">Download Bootstrap</a>
|
||||
<a href="./docs/" class="btn btn-large" onclick="_gaq.push(['_trackEvent', 'Jumbotron actions', 'Docs', 'View docs']);">View docs</a>
|
||||
</p>
|
||||
|
||||
<div class="bs-docs-social">
|
||||
<ul class="bs-docs-social-buttons">
|
||||
<li>
|
||||
<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=twitter&repo=bootstrap&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
|
||||
</li>
|
||||
<li>
|
||||
<iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=twitter&repo=bootstrap&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="102px" height="20px"></iframe>
|
||||
</li>
|
||||
<li class="follow-btn">
|
||||
<a href="https://twitter.com/twbootstrap" class="twitter-follow-button" data-link-color="#0069D6" data-show-count="true">Follow @twbootstrap</a>
|
||||
</li>
|
||||
<li class="tweet-btn">
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://twitter.github.com/bootstrap/" data-count="horizontal" data-via="twbootstrap" data-related="mdo:Creator of Twitter Bootstrap">Tweet</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% include social-buttons.html %}
|
||||
|
||||
<ul class="masthead-links">
|
||||
<ul class="bs-masthead-links">
|
||||
<li>
|
||||
<a href="./customize/" onclick="_gaq.push(['_trackEvent', 'Jumbotron actions', 'Jumbotron links', 'Customize']);">Customize</a>
|
||||
</li>
|
||||
@@ -38,7 +22,7 @@ title: Bootstrap
|
||||
<a href="http://github.com/twitter/bootstrap" onclick="_gaq.push(['_trackEvent', 'Jumbotron actions', 'Jumbotron links', 'GitHub project']);">GitHub project</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./docs/#examples" onclick="_gaq.push(['_trackEvent', 'Jumbotron actions', 'Jumbotron links', 'Examples']);">Examples</a>
|
||||
<a href="./getting-started/#examples" onclick="_gaq.push(['_trackEvent', 'Jumbotron actions', 'Jumbotron links', 'Examples']);">Examples</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://expo.getbootstrap.com" onclick="_gaq.push(['_trackEvent', 'Jumbotron actions', 'Jumbotron links', 'Expo']);">Bootstrap Expo</a>
|
||||
|
1751
docs/javascript.html
Normal file
1751
docs/javascript.html
Normal file
File diff suppressed because it is too large
Load Diff
22
js/.jshintrc
22
js/.jshintrc
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"validthis": true,
|
||||
"laxcomma" : true,
|
||||
"laxbreak" : true,
|
||||
"browser" : true,
|
||||
"eqnull" : true,
|
||||
"debug" : true,
|
||||
"devel" : true,
|
||||
"boss" : true,
|
||||
"expr" : true,
|
||||
"asi" : true
|
||||
}
|
||||
"validthis": true,
|
||||
"laxcomma" : true,
|
||||
"laxbreak" : true,
|
||||
"browser" : true,
|
||||
"eqnull" : true,
|
||||
"debug" : true,
|
||||
"devel" : true,
|
||||
"boss" : true,
|
||||
"expr" : true,
|
||||
"asi" : true
|
||||
}
|
120
js/affix.js
Normal file
120
js/affix.js
Normal file
@@ -0,0 +1,120 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: affix.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#affix
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// AFFIX CLASS DEFINITION
|
||||
// ======================
|
||||
|
||||
var Affix = function (element, options) {
|
||||
this.options = $.extend({}, Affix.DEFAULTS, options)
|
||||
this.$window = $(window)
|
||||
.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 = null
|
||||
|
||||
this.checkPosition()
|
||||
}
|
||||
|
||||
Affix.DEFAULTS = {
|
||||
offset: 0
|
||||
}
|
||||
|
||||
Affix.prototype.checkPositionWithEventLoop = function () {
|
||||
setTimeout($.proxy(this.checkPosition, this), 1)
|
||||
}
|
||||
|
||||
Affix.prototype.checkPosition = function () {
|
||||
if (!this.$element.is(':visible')) return
|
||||
|
||||
var scrollHeight = $(document).height()
|
||||
var scrollTop = this.$window.scrollTop()
|
||||
var position = this.$element.offset()
|
||||
var offset = this.options.offset
|
||||
var offsetTop = offset.top
|
||||
var offsetBottom = offset.bottom
|
||||
var reset = 'affix affix-top affix-bottom'
|
||||
|
||||
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
||||
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
||||
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
|
||||
|
||||
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
||||
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
||||
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
||||
|
||||
if (this.affixed === affix) return
|
||||
|
||||
this.affixed = affix
|
||||
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
||||
|
||||
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
|
||||
}
|
||||
|
||||
|
||||
// AFFIX PLUGIN DEFINITION
|
||||
// =======================
|
||||
|
||||
var old = $.fn.affix
|
||||
|
||||
$.fn.affix = function (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]()
|
||||
})
|
||||
}
|
||||
|
||||
$.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) data.offset.bottom = data.offsetBottom
|
||||
if (data.offsetTop) data.offset.top = data.offsetTop
|
||||
|
||||
$spy.affix(data)
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
@@ -1,8 +1,8 @@
|
||||
/* ==========================================================
|
||||
* bootstrap-alert.js v3.0.0
|
||||
/* ========================================================================
|
||||
* Bootstrap: alert.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
||||
* ==========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
* ========================================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,48 +15,44 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
+function ($) { "use strict";
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* ALERT CLASS DEFINITION
|
||||
* ====================== */
|
||||
// ALERT CLASS DEFINITION
|
||||
// ======================
|
||||
|
||||
var dismiss = '[data-dismiss="alert"]'
|
||||
, Alert = function (el) {
|
||||
$(el).on('click', dismiss, this.close)
|
||||
}
|
||||
var Alert = function (el) {
|
||||
$(el).on('click', dismiss, this.close)
|
||||
}
|
||||
|
||||
Alert.prototype.close = function (e) {
|
||||
var $this = $(this)
|
||||
, selector = $this.attr('data-target')
|
||||
, $parent
|
||||
var $this = $(this)
|
||||
var selector = $this.attr('data-target')
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||
}
|
||||
|
||||
$parent = $(selector)
|
||||
var $parent = $(selector)
|
||||
|
||||
e && e.preventDefault()
|
||||
if (e) e.preventDefault()
|
||||
|
||||
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
||||
if (!$parent.length) {
|
||||
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
||||
}
|
||||
|
||||
$parent.trigger(e = $.Event('close'))
|
||||
$parent.trigger(e = $.Event('close.bs.alert'))
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent.removeClass('in')
|
||||
|
||||
function removeElement() {
|
||||
$parent
|
||||
.trigger('closed')
|
||||
.remove()
|
||||
$parent.trigger('closed.bs.alert').remove()
|
||||
}
|
||||
|
||||
$.support.transition && $parent.hasClass('fade') ?
|
||||
@@ -65,16 +61,17 @@
|
||||
}
|
||||
|
||||
|
||||
/* ALERT PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
// ALERT PLUGIN DEFINITION
|
||||
// =======================
|
||||
|
||||
var old = $.fn.alert
|
||||
|
||||
$.fn.alert = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('alert')
|
||||
if (!data) $this.data('alert', (data = new Alert(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)
|
||||
})
|
||||
}
|
||||
@@ -82,8 +79,8 @@
|
||||
$.fn.alert.Constructor = Alert
|
||||
|
||||
|
||||
/* ALERT NO CONFLICT
|
||||
* ================= */
|
||||
// ALERT NO CONFLICT
|
||||
// =================
|
||||
|
||||
$.fn.alert.noConflict = function () {
|
||||
$.fn.alert = old
|
||||
@@ -91,9 +88,9 @@
|
||||
}
|
||||
|
||||
|
||||
/* ALERT DATA-API
|
||||
* ============== */
|
||||
// ALERT DATA-API
|
||||
// ==============
|
||||
|
||||
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
|
||||
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
||||
|
||||
}(window.jQuery);
|
117
js/bootstrap-affix.js
vendored
117
js/bootstrap-affix.js
vendored
@@ -1,117 +0,0 @@
|
||||
/* ==========================================================
|
||||
* bootstrap-affix.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#affix
|
||||
* ==========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* AFFIX CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var Affix = function (element, options) {
|
||||
this.options = $.extend({}, $.fn.affix.defaults, options)
|
||||
this.$window = $(window)
|
||||
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
||||
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
|
||||
this.$element = $(element)
|
||||
this.checkPosition()
|
||||
}
|
||||
|
||||
Affix.prototype.checkPosition = function () {
|
||||
if (!this.$element.is(':visible')) return
|
||||
|
||||
var scrollHeight = $(document).height()
|
||||
, scrollTop = this.$window.scrollTop()
|
||||
, position = this.$element.offset()
|
||||
, offset = this.options.offset
|
||||
, offsetBottom = offset.bottom
|
||||
, offsetTop = offset.top
|
||||
, reset = 'affix affix-top affix-bottom'
|
||||
, affix
|
||||
|
||||
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
||||
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
||||
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
|
||||
|
||||
affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
|
||||
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
|
||||
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
|
||||
'top' : false
|
||||
|
||||
if (this.affixed === affix) return
|
||||
|
||||
this.affixed = affix
|
||||
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
||||
|
||||
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
|
||||
}
|
||||
|
||||
|
||||
/* AFFIX PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.affix
|
||||
|
||||
$.fn.affix = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('affix')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('affix', (data = new Affix(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.affix.Constructor = Affix
|
||||
|
||||
$.fn.affix.defaults = {
|
||||
offset: 0
|
||||
}
|
||||
|
||||
|
||||
/* 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)
|
||||
, data = $spy.data()
|
||||
|
||||
data.offset = data.offset || {}
|
||||
|
||||
data.offsetBottom && (data.offset.bottom = data.offsetBottom)
|
||||
data.offsetTop && (data.offset.top = data.offsetTop)
|
||||
|
||||
$spy.affix(data)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}(window.jQuery);
|
99
js/bootstrap-alert.js
vendored
99
js/bootstrap-alert.js
vendored
@@ -1,99 +0,0 @@
|
||||
/* ==========================================================
|
||||
* bootstrap-alert.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
||||
* ==========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* ALERT CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var dismiss = '[data-dismiss="alert"]'
|
||||
, Alert = function (el) {
|
||||
$(el).on('click', dismiss, this.close)
|
||||
}
|
||||
|
||||
Alert.prototype.close = function (e) {
|
||||
var $this = $(this)
|
||||
, selector = $this.attr('data-target')
|
||||
, $parent
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
$parent = $(selector)
|
||||
|
||||
e && e.preventDefault()
|
||||
|
||||
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
||||
|
||||
$parent.trigger(e = $.Event('close'))
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent.removeClass('in')
|
||||
|
||||
function removeElement() {
|
||||
$parent
|
||||
.trigger('closed')
|
||||
.remove()
|
||||
}
|
||||
|
||||
$.support.transition && $parent.hasClass('fade') ?
|
||||
$parent.on($.support.transition.end, removeElement) :
|
||||
removeElement()
|
||||
}
|
||||
|
||||
|
||||
/* ALERT PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.alert
|
||||
|
||||
$.fn.alert = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('alert')
|
||||
if (!data) $this.data('alert', (data = new Alert(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.alert.Constructor = Alert
|
||||
|
||||
|
||||
/* ALERT NO CONFLICT
|
||||
* ================= */
|
||||
|
||||
$.fn.alert.noConflict = function () {
|
||||
$.fn.alert = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* ALERT DATA-API
|
||||
* ============== */
|
||||
|
||||
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
|
||||
|
||||
}(window.jQuery);
|
105
js/bootstrap-button.js
vendored
105
js/bootstrap-button.js
vendored
@@ -1,105 +0,0 @@
|
||||
/* ============================================================
|
||||
* bootstrap-button.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
||||
* ============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* BUTTON PUBLIC CLASS DEFINITION
|
||||
* ============================== */
|
||||
|
||||
var Button = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.button.defaults, options)
|
||||
}
|
||||
|
||||
Button.prototype.setState = function (state) {
|
||||
var d = 'disabled'
|
||||
, $el = this.$element
|
||||
, data = $el.data()
|
||||
, val = $el.is('input') ? 'val' : 'html'
|
||||
|
||||
state = state + 'Text'
|
||||
data.resetText || $el.data('resetText', $el[val]())
|
||||
|
||||
$el[val](data[state] || this.options[state])
|
||||
|
||||
// push to event loop to allow forms to submit
|
||||
setTimeout(function () {
|
||||
state == 'loadingText' ?
|
||||
$el.addClass(d).attr(d, d) :
|
||||
$el.removeClass(d).removeAttr(d)
|
||||
}, 0)
|
||||
}
|
||||
|
||||
Button.prototype.toggle = function () {
|
||||
var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
|
||||
|
||||
$parent && $parent
|
||||
.find('.active')
|
||||
.removeClass('active')
|
||||
|
||||
this.$element.toggleClass('active')
|
||||
}
|
||||
|
||||
|
||||
/* BUTTON PLUGIN DEFINITION
|
||||
* ======================== */
|
||||
|
||||
var old = $.fn.button
|
||||
|
||||
$.fn.button = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('button')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('button', (data = new Button(this, options)))
|
||||
if (option == 'toggle') data.toggle()
|
||||
else if (option) data.setState(option)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.button.defaults = {
|
||||
loadingText: 'loading...'
|
||||
}
|
||||
|
||||
$.fn.button.Constructor = Button
|
||||
|
||||
|
||||
/* BUTTON NO CONFLICT
|
||||
* ================== */
|
||||
|
||||
$.fn.button.noConflict = function () {
|
||||
$.fn.button = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* BUTTON DATA-API
|
||||
* =============== */
|
||||
|
||||
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
|
||||
var $btn = $(e.target)
|
||||
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
||||
$btn.button('toggle')
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
207
js/bootstrap-carousel.js
vendored
207
js/bootstrap-carousel.js
vendored
@@ -1,207 +0,0 @@
|
||||
/* ==========================================================
|
||||
* bootstrap-carousel.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#carousel
|
||||
* ==========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* CAROUSEL CLASS DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var Carousel = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.$indicators = this.$element.find('.carousel-indicators')
|
||||
this.options = options
|
||||
this.options.pause == 'hover' && this.$element
|
||||
.on('mouseenter', $.proxy(this.pause, this))
|
||||
.on('mouseleave', $.proxy(this.cycle, this))
|
||||
}
|
||||
|
||||
Carousel.prototype = {
|
||||
|
||||
cycle: function (e) {
|
||||
if (!e) this.paused = false
|
||||
if (this.interval) clearInterval(this.interval);
|
||||
this.options.interval
|
||||
&& !this.paused
|
||||
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
||||
return this
|
||||
}
|
||||
|
||||
, getActiveIndex: function () {
|
||||
this.$active = this.$element.find('.item.active')
|
||||
this.$items = this.$active.parent().children()
|
||||
return this.$items.index(this.$active)
|
||||
}
|
||||
|
||||
, to: function (pos) {
|
||||
var activeIndex = this.getActiveIndex()
|
||||
, that = this
|
||||
|
||||
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||
|
||||
if (this.sliding) {
|
||||
return this.$element.one('slid', function () {
|
||||
that.to(pos)
|
||||
})
|
||||
}
|
||||
|
||||
if (activeIndex == pos) {
|
||||
return this.pause().cycle()
|
||||
}
|
||||
|
||||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||
}
|
||||
|
||||
, pause: function (e) {
|
||||
if (!e) this.paused = true
|
||||
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
||||
this.$element.trigger($.support.transition.end)
|
||||
this.cycle(true)
|
||||
}
|
||||
clearInterval(this.interval)
|
||||
this.interval = null
|
||||
return this
|
||||
}
|
||||
|
||||
, next: function () {
|
||||
if (this.sliding) return
|
||||
return this.slide('next')
|
||||
}
|
||||
|
||||
, prev: function () {
|
||||
if (this.sliding) return
|
||||
return this.slide('prev')
|
||||
}
|
||||
|
||||
, slide: function (type, next) {
|
||||
var $active = this.$element.find('.item.active')
|
||||
, $next = next || $active[type]()
|
||||
, isCycling = this.interval
|
||||
, direction = type == 'next' ? 'left' : 'right'
|
||||
, fallback = type == 'next' ? 'first' : 'last'
|
||||
, that = this
|
||||
, e
|
||||
|
||||
this.sliding = true
|
||||
|
||||
isCycling && this.pause()
|
||||
|
||||
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
||||
|
||||
e = $.Event('slide', {
|
||||
relatedTarget: $next[0]
|
||||
, direction: direction
|
||||
})
|
||||
|
||||
if ($next.hasClass('active')) return
|
||||
|
||||
if (this.$indicators.length) {
|
||||
this.$indicators.find('.active').removeClass('active')
|
||||
this.$element.one('slid', function () {
|
||||
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
||||
$nextIndicator && $nextIndicator.addClass('active')
|
||||
})
|
||||
}
|
||||
|
||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$next.addClass(type)
|
||||
$next[0].offsetWidth // force reflow
|
||||
$active.addClass(direction)
|
||||
$next.addClass(direction)
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||
$active.removeClass(['active', direction].join(' '))
|
||||
that.sliding = false
|
||||
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
||||
})
|
||||
} else {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$active.removeClass('active')
|
||||
$next.addClass('active')
|
||||
this.sliding = false
|
||||
this.$element.trigger('slid')
|
||||
}
|
||||
|
||||
isCycling && this.cycle()
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* CAROUSEL PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.carousel
|
||||
|
||||
$.fn.carousel = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('carousel')
|
||||
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
||||
, action = typeof option == 'string' ? option : options.slide
|
||||
if (!data) $this.data('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()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.carousel.defaults = {
|
||||
interval: 5000
|
||||
, pause: 'hover'
|
||||
}
|
||||
|
||||
$.fn.carousel.Constructor = Carousel
|
||||
|
||||
|
||||
/* CAROUSEL NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.carousel.noConflict = function () {
|
||||
$.fn.carousel = old
|
||||
return this
|
||||
}
|
||||
|
||||
/* CAROUSEL DATA-API
|
||||
* ================= */
|
||||
|
||||
$(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
||||
var $this = $(this), href
|
||||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
, options = $.extend({}, $target.data(), $this.data())
|
||||
, slideIndex
|
||||
|
||||
$target.carousel(options)
|
||||
|
||||
if (slideIndex = $this.attr('data-slide-to')) {
|
||||
$target.data('carousel').pause().to(slideIndex).cycle()
|
||||
}
|
||||
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
173
js/bootstrap-collapse.js
vendored
173
js/bootstrap-collapse.js
vendored
@@ -1,173 +0,0 @@
|
||||
/* =============================================================
|
||||
* bootstrap-collapse.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
||||
* =============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* COLLAPSE PUBLIC CLASS DEFINITION
|
||||
* ================================ */
|
||||
|
||||
var Collapse = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
||||
|
||||
if (this.options.parent) {
|
||||
this.$parent = $(this.options.parent)
|
||||
}
|
||||
|
||||
this.options.toggle && this.toggle()
|
||||
}
|
||||
|
||||
Collapse.prototype = {
|
||||
|
||||
constructor: Collapse
|
||||
|
||||
, dimension: function () {
|
||||
var hasWidth = this.$element.hasClass('width')
|
||||
return hasWidth ? 'width' : 'height'
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var dimension
|
||||
, scroll
|
||||
, actives
|
||||
, hasData
|
||||
|
||||
if (this.transitioning || this.$element.hasClass('in')) return
|
||||
|
||||
dimension = this.dimension()
|
||||
scroll = $.camelCase(['scroll', dimension].join('-'))
|
||||
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
||||
|
||||
if (actives && actives.length) {
|
||||
hasData = actives.data('collapse')
|
||||
if (hasData && hasData.transitioning) return
|
||||
actives.collapse('hide')
|
||||
hasData || actives.data('collapse', null)
|
||||
}
|
||||
|
||||
this.$element[dimension](0)
|
||||
this.transition('addClass', $.Event('show'), 'shown')
|
||||
$.support.transition && this.$element[dimension](this.$element[0][scroll])
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
var dimension
|
||||
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||
dimension = this.dimension()
|
||||
this.reset(this.$element[dimension]())
|
||||
this.transition('removeClass', $.Event('hide'), 'hidden')
|
||||
this.$element[dimension](0)
|
||||
}
|
||||
|
||||
, reset: function (size) {
|
||||
var dimension = this.dimension()
|
||||
|
||||
this.$element
|
||||
.removeClass('collapse')
|
||||
[dimension](size || 'auto')
|
||||
[0].offsetWidth
|
||||
|
||||
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
, transition: function (method, startEvent, completeEvent) {
|
||||
var that = this
|
||||
, complete = function () {
|
||||
if (startEvent.type == 'show') that.reset()
|
||||
that.transitioning = 0
|
||||
that.$element.trigger(completeEvent)
|
||||
}
|
||||
|
||||
this.$element.trigger(startEvent)
|
||||
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
this.transitioning = 1
|
||||
|
||||
this.$element[method]('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('collapse') ?
|
||||
this.$element.one($.support.transition.end, complete) :
|
||||
complete()
|
||||
}
|
||||
|
||||
, toggle: function () {
|
||||
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* COLLAPSE PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.collapse
|
||||
|
||||
$.fn.collapse = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('collapse')
|
||||
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
|
||||
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.collapse.defaults = {
|
||||
toggle: true
|
||||
}
|
||||
|
||||
$.fn.collapse.Constructor = Collapse
|
||||
|
||||
|
||||
/* COLLAPSE NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.collapse.noConflict = function () {
|
||||
$.fn.collapse = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* COLLAPSE DATA-API
|
||||
* ================= */
|
||||
|
||||
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
||||
var $this = $(this), href
|
||||
, target = $this.attr('data-target')
|
||||
|| e.preventDefault()
|
||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
||||
, parent = $this.attr('data-parent')
|
||||
, $parent = parent && $(parent)
|
||||
|
||||
if ($parent) {
|
||||
$parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed')
|
||||
}
|
||||
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||
$(target).collapse(option)
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
165
js/bootstrap-dropdown.js
vendored
165
js/bootstrap-dropdown.js
vendored
@@ -1,165 +0,0 @@
|
||||
/* ============================================================
|
||||
* bootstrap-dropdown.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
||||
* ============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* DROPDOWN CLASS DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var toggle = '[data-toggle=dropdown]'
|
||||
, Dropdown = function (element) {
|
||||
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
||||
$('html').on('click.dropdown.data-api', function () {
|
||||
$el.parent().removeClass('open')
|
||||
})
|
||||
}
|
||||
|
||||
Dropdown.prototype = {
|
||||
|
||||
constructor: Dropdown
|
||||
|
||||
, toggle: function (e) {
|
||||
var $this = $(this)
|
||||
, $parent
|
||||
, isActive
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
$parent = getParent($this)
|
||||
|
||||
isActive = $parent.hasClass('open')
|
||||
|
||||
clearMenus()
|
||||
|
||||
if (!isActive) {
|
||||
$parent.toggleClass('open')
|
||||
}
|
||||
|
||||
$this.focus()
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
, keydown: function (e) {
|
||||
var $this
|
||||
, $items
|
||||
, $active
|
||||
, $parent
|
||||
, isActive
|
||||
, index
|
||||
|
||||
if (!/(38|40|27)/.test(e.keyCode)) return
|
||||
|
||||
$this = $(this)
|
||||
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
$parent = getParent($this)
|
||||
|
||||
isActive = $parent.hasClass('open')
|
||||
|
||||
if (!isActive || (isActive && e.keyCode == 27)) {
|
||||
if (e.which == 27) $parent.find(toggle).focus()
|
||||
return $this.click()
|
||||
}
|
||||
|
||||
$items = $('[role=menu] li:not(.divider):visible a', $parent)
|
||||
|
||||
if (!$items.length) return
|
||||
|
||||
index = $items.index($items.filter(':focus'))
|
||||
|
||||
if (e.keyCode == 38 && index > 0) index-- // up
|
||||
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
||||
if (!~index) index = 0
|
||||
|
||||
$items
|
||||
.eq(index)
|
||||
.focus()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function clearMenus() {
|
||||
$(toggle).each(function () {
|
||||
getParent($(this)).removeClass('open')
|
||||
})
|
||||
}
|
||||
|
||||
function getParent($this) {
|
||||
var selector = $this.attr('data-target')
|
||||
, $parent
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
$parent = selector && $(selector)
|
||||
|
||||
if (!$parent || !$parent.length) $parent = $this.parent()
|
||||
|
||||
return $parent
|
||||
}
|
||||
|
||||
|
||||
/* DROPDOWN PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.dropdown
|
||||
|
||||
$.fn.dropdown = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('dropdown')
|
||||
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.dropdown.Constructor = Dropdown
|
||||
|
||||
|
||||
/* DROPDOWN NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.dropdown.noConflict = function () {
|
||||
$.fn.dropdown = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
||||
* =================================== */
|
||||
|
||||
$(document)
|
||||
.on('click.dropdown.data-api', clearMenus)
|
||||
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||
.on('click.dropdown-menu', function (e) { e.stopPropagation() })
|
||||
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||
|
||||
}(window.jQuery);
|
251
js/bootstrap-modal.js
vendored
251
js/bootstrap-modal.js
vendored
@@ -1,251 +0,0 @@
|
||||
/* =========================================================
|
||||
* bootstrap-modal.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#modals
|
||||
* =========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================= */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* MODAL CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var Modal = function (element, options) {
|
||||
this.options = options
|
||||
this.$element = $(element)
|
||||
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
||||
this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
|
||||
}
|
||||
|
||||
Modal.prototype = {
|
||||
|
||||
constructor: Modal
|
||||
|
||||
, toggle: function () {
|
||||
return this[!this.isShown ? 'show' : 'hide']()
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var that = this
|
||||
, e = $.Event('show')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = true
|
||||
|
||||
this.escape()
|
||||
|
||||
this.backdrop(function () {
|
||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||
|
||||
if (!that.$element.parent().length) {
|
||||
that.$element.appendTo(document.body) //don't move modals dom position
|
||||
}
|
||||
|
||||
that.$element.show()
|
||||
|
||||
if (transition) {
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
}
|
||||
|
||||
that.$element
|
||||
.addClass('in')
|
||||
.attr('aria-hidden', false)
|
||||
|
||||
that.enforceFocus()
|
||||
|
||||
transition ?
|
||||
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
|
||||
that.$element.focus().trigger('shown')
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
, hide: function (e) {
|
||||
e && e.preventDefault()
|
||||
|
||||
var that = this
|
||||
|
||||
e = $.Event('hide')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (!this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = false
|
||||
|
||||
this.escape()
|
||||
|
||||
$(document).off('focusin.modal')
|
||||
|
||||
this.$element
|
||||
.removeClass('in')
|
||||
.attr('aria-hidden', true)
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
this.hideWithTransition() :
|
||||
this.hideModal()
|
||||
}
|
||||
|
||||
, enforceFocus: function () {
|
||||
var that = this
|
||||
$(document).on('focusin.modal', function (e) {
|
||||
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
|
||||
that.$element.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
, escape: function () {
|
||||
var that = this
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
this.$element.on('keyup.dismiss.modal', function ( e ) {
|
||||
e.which == 27 && that.hide()
|
||||
})
|
||||
} else if (!this.isShown) {
|
||||
this.$element.off('keyup.dismiss.modal')
|
||||
}
|
||||
}
|
||||
|
||||
, hideWithTransition: function () {
|
||||
var that = this
|
||||
, timeout = setTimeout(function () {
|
||||
that.$element.off($.support.transition.end)
|
||||
that.hideModal()
|
||||
}, 500)
|
||||
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
that.hideModal()
|
||||
})
|
||||
}
|
||||
|
||||
, hideModal: function () {
|
||||
var that = this
|
||||
this.$element.hide()
|
||||
this.backdrop(function () {
|
||||
that.removeBackdrop()
|
||||
that.$element.trigger('hidden')
|
||||
})
|
||||
}
|
||||
|
||||
, removeBackdrop: function () {
|
||||
this.$backdrop && this.$backdrop.remove()
|
||||
this.$backdrop = null
|
||||
}
|
||||
|
||||
, backdrop: function (callback) {
|
||||
var that = this
|
||||
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||
|
||||
if (this.isShown && this.options.backdrop) {
|
||||
var doAnimate = $.support.transition && animate
|
||||
|
||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||
.appendTo(document.body)
|
||||
|
||||
this.$backdrop.click(
|
||||
this.options.backdrop == 'static' ?
|
||||
$.proxy(this.$element[0].focus, this.$element[0])
|
||||
: $.proxy(this.hide, this)
|
||||
)
|
||||
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
this.$backdrop.addClass('in')
|
||||
|
||||
if (!callback) return
|
||||
|
||||
doAnimate ?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (!this.isShown && this.$backdrop) {
|
||||
this.$backdrop.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade')?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (callback) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* MODAL PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.modal
|
||||
|
||||
$.fn.modal = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('modal')
|
||||
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
||||
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
else if (options.show) data.show()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.modal.defaults = {
|
||||
backdrop: true
|
||||
, keyboard: true
|
||||
, show: true
|
||||
}
|
||||
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
||||
|
||||
/* MODAL NO CONFLICT
|
||||
* ================= */
|
||||
|
||||
$.fn.modal.noConflict = function () {
|
||||
$.fn.modal = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* MODAL DATA-API
|
||||
* ============== */
|
||||
|
||||
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||
var $this = $(this)
|
||||
, href = $this.attr('href')
|
||||
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
||||
, option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
e.preventDefault()
|
||||
|
||||
$target
|
||||
.modal(option)
|
||||
.one('hide', function () {
|
||||
$this.focus()
|
||||
})
|
||||
})
|
||||
|
||||
var $body = $(document.body)
|
||||
.on('shown', '.modal', function () { $body.addClass('modal-open') })
|
||||
.on('hidden', '.modal', function () { $body.removeClass('modal-open') })
|
||||
|
||||
}(window.jQuery);
|
114
js/bootstrap-popover.js
vendored
114
js/bootstrap-popover.js
vendored
@@ -1,114 +0,0 @@
|
||||
/* ===========================================================
|
||||
* bootstrap-popover.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#popovers
|
||||
* ===========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* =========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* POPOVER PUBLIC CLASS DEFINITION
|
||||
* =============================== */
|
||||
|
||||
var Popover = function (element, options) {
|
||||
this.init('popover', element, options)
|
||||
}
|
||||
|
||||
|
||||
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
||||
========================================== */
|
||||
|
||||
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
|
||||
|
||||
constructor: Popover
|
||||
|
||||
, setContent: function () {
|
||||
var $tip = this.tip()
|
||||
, title = this.getTitle()
|
||||
, content = this.getContent()
|
||||
|
||||
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
||||
|
||||
$tip.removeClass('fade top bottom left right in')
|
||||
}
|
||||
|
||||
, hasContent: function () {
|
||||
return this.getTitle() || this.getContent()
|
||||
}
|
||||
|
||||
, getContent: function () {
|
||||
var content
|
||||
, $e = this.$element
|
||||
, o = this.options
|
||||
|
||||
content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
||||
|| $e.attr('data-content')
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
, tip: function () {
|
||||
if (!this.$tip) {
|
||||
this.$tip = $(this.options.template)
|
||||
}
|
||||
return this.$tip
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
this.hide().$element.off('.' + this.type).removeData(this.type)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
/* POPOVER PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.popover
|
||||
|
||||
$.fn.popover = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('popover')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('popover', (data = new Popover(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.popover.Constructor = Popover
|
||||
|
||||
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
||||
placement: 'right'
|
||||
, trigger: 'click'
|
||||
, content: ''
|
||||
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
||||
})
|
||||
|
||||
|
||||
/* POPOVER NO CONFLICT
|
||||
* =================== */
|
||||
|
||||
$.fn.popover.noConflict = function () {
|
||||
$.fn.popover = old
|
||||
return this
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
162
js/bootstrap-scrollspy.js
vendored
162
js/bootstrap-scrollspy.js
vendored
@@ -1,162 +0,0 @@
|
||||
/* =============================================================
|
||||
* bootstrap-scrollspy.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
||||
* =============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* SCROLLSPY CLASS DEFINITION
|
||||
* ========================== */
|
||||
|
||||
function ScrollSpy(element, options) {
|
||||
var process = $.proxy(this.process, this)
|
||||
, $element = $(element).is('body') ? $(window) : $(element)
|
||||
, href
|
||||
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
|
||||
this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
|
||||
this.selector = (this.options.target
|
||||
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
|| '') + ' .nav li > a'
|
||||
this.$body = $('body')
|
||||
this.refresh()
|
||||
this.process()
|
||||
}
|
||||
|
||||
ScrollSpy.prototype = {
|
||||
|
||||
constructor: ScrollSpy
|
||||
|
||||
, refresh: function () {
|
||||
var self = this
|
||||
, $targets
|
||||
|
||||
this.offsets = $([])
|
||||
this.targets = $([])
|
||||
|
||||
$targets = this.$body
|
||||
.find(this.selector)
|
||||
.map(function () {
|
||||
var $el = $(this)
|
||||
, href = $el.data('target') || $el.attr('href')
|
||||
, $href = /^#\w/.test(href) && $(href)
|
||||
return ( $href
|
||||
&& $href.length
|
||||
&& [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
|
||||
})
|
||||
.sort(function (a, b) { return a[0] - b[0] })
|
||||
.each(function () {
|
||||
self.offsets.push(this[0])
|
||||
self.targets.push(this[1])
|
||||
})
|
||||
}
|
||||
|
||||
, process: function () {
|
||||
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
||||
, scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
||||
, maxScroll = scrollHeight - this.$scrollElement.height()
|
||||
, offsets = this.offsets
|
||||
, targets = this.targets
|
||||
, activeTarget = this.activeTarget
|
||||
, i
|
||||
|
||||
if (scrollTop >= maxScroll) {
|
||||
return activeTarget != (i = targets.last()[0])
|
||||
&& this.activate ( i )
|
||||
}
|
||||
|
||||
for (i = offsets.length; i--;) {
|
||||
activeTarget != targets[i]
|
||||
&& scrollTop >= offsets[i]
|
||||
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
||||
&& this.activate( targets[i] )
|
||||
}
|
||||
}
|
||||
|
||||
, activate: function (target) {
|
||||
var active
|
||||
, selector
|
||||
|
||||
this.activeTarget = target
|
||||
|
||||
$(this.selector)
|
||||
.parents('.active')
|
||||
.removeClass('active')
|
||||
|
||||
selector = this.selector
|
||||
+ '[data-target="' + target + '"],'
|
||||
+ this.selector + '[href="' + target + '"]'
|
||||
|
||||
active = $(selector)
|
||||
.parents('li')
|
||||
.addClass('active')
|
||||
|
||||
if (active.parent('.dropdown-menu').length) {
|
||||
active = active.closest('li.dropdown').addClass('active')
|
||||
}
|
||||
|
||||
active.trigger('activate')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* SCROLLSPY PLUGIN DEFINITION
|
||||
* =========================== */
|
||||
|
||||
var old = $.fn.scrollspy
|
||||
|
||||
$.fn.scrollspy = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('scrollspy')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.scrollspy.Constructor = ScrollSpy
|
||||
|
||||
$.fn.scrollspy.defaults = {
|
||||
offset: 10
|
||||
}
|
||||
|
||||
|
||||
/* SCROLLSPY NO CONFLICT
|
||||
* ===================== */
|
||||
|
||||
$.fn.scrollspy.noConflict = function () {
|
||||
$.fn.scrollspy = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* SCROLLSPY DATA-API
|
||||
* ================== */
|
||||
|
||||
$(window).on('load', function () {
|
||||
$('[data-spy="scroll"]').each(function () {
|
||||
var $spy = $(this)
|
||||
$spy.scrollspy($spy.data())
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
144
js/bootstrap-tab.js
vendored
144
js/bootstrap-tab.js
vendored
@@ -1,144 +0,0 @@
|
||||
/* ========================================================
|
||||
* bootstrap-tab.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#tabs
|
||||
* ========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TAB CLASS DEFINITION
|
||||
* ==================== */
|
||||
|
||||
var Tab = function (element) {
|
||||
this.element = $(element)
|
||||
}
|
||||
|
||||
Tab.prototype = {
|
||||
|
||||
constructor: Tab
|
||||
|
||||
, show: function () {
|
||||
var $this = this.element
|
||||
, $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||
, selector = $this.attr('data-target')
|
||||
, previous
|
||||
, $target
|
||||
, e
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
if ( $this.parent('li').hasClass('active') ) return
|
||||
|
||||
previous = $ul.find('.active:last a')[0]
|
||||
|
||||
e = $.Event('show', {
|
||||
relatedTarget: previous
|
||||
})
|
||||
|
||||
$this.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$target = $(selector)
|
||||
|
||||
this.activate($this.parent('li'), $ul)
|
||||
this.activate($target, $target.parent(), function () {
|
||||
$this.trigger({
|
||||
type: 'shown'
|
||||
, relatedTarget: previous
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
, activate: function ( element, container, callback) {
|
||||
var $active = container.find('> .active')
|
||||
, transition = callback
|
||||
&& $.support.transition
|
||||
&& $active.hasClass('fade')
|
||||
|
||||
function next() {
|
||||
$active
|
||||
.removeClass('active')
|
||||
.find('> .dropdown-menu > .active')
|
||||
.removeClass('active')
|
||||
|
||||
element.addClass('active')
|
||||
|
||||
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')
|
||||
}
|
||||
|
||||
callback && callback()
|
||||
}
|
||||
|
||||
transition ?
|
||||
$active.one($.support.transition.end, next) :
|
||||
next()
|
||||
|
||||
$active.removeClass('in')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* TAB PLUGIN DEFINITION
|
||||
* ===================== */
|
||||
|
||||
var old = $.fn.tab
|
||||
|
||||
$.fn.tab = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('tab')
|
||||
if (!data) $this.data('tab', (data = new Tab(this)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tab.Constructor = Tab
|
||||
|
||||
|
||||
/* TAB NO CONFLICT
|
||||
* =============== */
|
||||
|
||||
$.fn.tab.noConflict = function () {
|
||||
$.fn.tab = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* TAB DATA-API
|
||||
* ============ */
|
||||
|
||||
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
||||
e.preventDefault()
|
||||
$(this).tab('show')
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
361
js/bootstrap-tooltip.js
vendored
361
js/bootstrap-tooltip.js
vendored
@@ -1,361 +0,0 @@
|
||||
/* ===========================================================
|
||||
* bootstrap-tooltip.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#tooltips
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ===========================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TOOLTIP PUBLIC CLASS DEFINITION
|
||||
* =============================== */
|
||||
|
||||
var Tooltip = function (element, options) {
|
||||
this.init('tooltip', element, options)
|
||||
}
|
||||
|
||||
Tooltip.prototype = {
|
||||
|
||||
constructor: Tooltip
|
||||
|
||||
, init: function (type, element, options) {
|
||||
var eventIn
|
||||
, eventOut
|
||||
, triggers
|
||||
, trigger
|
||||
, i
|
||||
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
this.enabled = true
|
||||
|
||||
triggers = this.options.trigger.split(' ')
|
||||
|
||||
for (i = triggers.length; i--;) {
|
||||
trigger = triggers[i]
|
||||
if (trigger == 'click') {
|
||||
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||
} else if (trigger != 'manual') {
|
||||
eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||
eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||
}
|
||||
}
|
||||
|
||||
this.options.selector ?
|
||||
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||
this.fixTitle()
|
||||
}
|
||||
|
||||
, getOptions: function (options) {
|
||||
options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
|
||||
|
||||
if (options.delay && typeof options.delay == 'number') {
|
||||
options.delay = {
|
||||
show: options.delay
|
||||
, hide: options.delay
|
||||
}
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
, enter: function (e) {
|
||||
var defaults = $.fn[this.type].defaults
|
||||
, options = {}
|
||||
, self
|
||||
|
||||
this._options && $.each(this._options, function (key, value) {
|
||||
if (defaults[key] != value) options[key] = value
|
||||
}, this)
|
||||
|
||||
self = $(e.currentTarget)[this.type](options).data(this.type)
|
||||
|
||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||
|
||||
clearTimeout(this.timeout)
|
||||
self.hoverState = 'in'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'in') self.show()
|
||||
}, self.options.delay.show)
|
||||
}
|
||||
|
||||
, leave: function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||
|
||||
if (this.timeout) clearTimeout(this.timeout)
|
||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||
|
||||
self.hoverState = 'out'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'out') self.hide()
|
||||
}, self.options.delay.hide)
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var $tip
|
||||
, pos
|
||||
, actualWidth
|
||||
, actualHeight
|
||||
, placement
|
||||
, tp
|
||||
, e = $.Event('show')
|
||||
|
||||
if (this.hasContent() && this.enabled) {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$tip = this.tip()
|
||||
this.setContent()
|
||||
|
||||
if (this.options.animation) {
|
||||
$tip.addClass('fade')
|
||||
}
|
||||
|
||||
placement = typeof this.options.placement == 'function' ?
|
||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||
this.options.placement
|
||||
|
||||
$tip
|
||||
.detach()
|
||||
.css({ top: 0, left: 0, display: 'block' })
|
||||
|
||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||
|
||||
pos = this.getPosition()
|
||||
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
|
||||
switch (placement) {
|
||||
case 'bottom':
|
||||
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'top':
|
||||
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'left':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
|
||||
break
|
||||
case 'right':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
|
||||
break
|
||||
}
|
||||
|
||||
this.applyPlacement(tp, placement)
|
||||
this.$element.trigger('shown')
|
||||
}
|
||||
}
|
||||
|
||||
, applyPlacement: function(offset, placement){
|
||||
var $tip = this.tip()
|
||||
, width = $tip[0].offsetWidth
|
||||
, height = $tip[0].offsetHeight
|
||||
, actualWidth
|
||||
, actualHeight
|
||||
, delta
|
||||
, replace
|
||||
|
||||
$tip
|
||||
.offset(offset)
|
||||
.addClass(placement)
|
||||
.addClass('in')
|
||||
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
|
||||
if (placement == 'top' && actualHeight != height) {
|
||||
offset.top = offset.top + height - actualHeight
|
||||
replace = true
|
||||
}
|
||||
|
||||
if (placement == 'bottom' || placement == 'top') {
|
||||
delta = 0
|
||||
|
||||
if (offset.left < 0){
|
||||
delta = offset.left * -2
|
||||
offset.left = 0
|
||||
$tip.offset(offset)
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
}
|
||||
|
||||
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||
} else {
|
||||
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||
}
|
||||
|
||||
if (replace) $tip.offset(offset)
|
||||
}
|
||||
|
||||
, replaceArrow: function(delta, dimension, position){
|
||||
this
|
||||
.arrow()
|
||||
.css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
|
||||
}
|
||||
|
||||
, setContent: function () {
|
||||
var $tip = this.tip()
|
||||
, title = this.getTitle()
|
||||
|
||||
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.removeClass('fade in top bottom left right')
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
var that = this
|
||||
, $tip = this.tip()
|
||||
, e = $.Event('hide')
|
||||
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$tip.removeClass('in')
|
||||
|
||||
function removeWithAnimation() {
|
||||
var timeout = setTimeout(function () {
|
||||
$tip.off($.support.transition.end).detach()
|
||||
}, 500)
|
||||
|
||||
$tip.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
$tip.detach()
|
||||
})
|
||||
}
|
||||
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
removeWithAnimation() :
|
||||
$tip.detach()
|
||||
|
||||
this.$element.trigger('hidden')
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
, fixTitle: function () {
|
||||
var $e = this.$element
|
||||
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
||||
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
||||
}
|
||||
}
|
||||
|
||||
, hasContent: function () {
|
||||
return this.getTitle()
|
||||
}
|
||||
|
||||
, getPosition: function () {
|
||||
var el = this.$element[0]
|
||||
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||
width: el.offsetWidth
|
||||
, height: el.offsetHeight
|
||||
}, this.$element.offset())
|
||||
}
|
||||
|
||||
, getTitle: function () {
|
||||
var title
|
||||
, $e = this.$element
|
||||
, o = this.options
|
||||
|
||||
title = $e.attr('data-original-title')
|
||||
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||
|
||||
return title
|
||||
}
|
||||
|
||||
, tip: function () {
|
||||
return this.$tip = this.$tip || $(this.options.template)
|
||||
}
|
||||
|
||||
, arrow: function(){
|
||||
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
|
||||
}
|
||||
|
||||
, validate: function () {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide()
|
||||
this.$element = null
|
||||
this.options = null
|
||||
}
|
||||
}
|
||||
|
||||
, enable: function () {
|
||||
this.enabled = true
|
||||
}
|
||||
|
||||
, disable: function () {
|
||||
this.enabled = false
|
||||
}
|
||||
|
||||
, toggleEnabled: function () {
|
||||
this.enabled = !this.enabled
|
||||
}
|
||||
|
||||
, toggle: function (e) {
|
||||
var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
|
||||
self.tip().hasClass('in') ? self.hide() : self.show()
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
this.hide().$element.off('.' + this.type).removeData(this.type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* TOOLTIP PLUGIN DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var old = $.fn.tooltip
|
||||
|
||||
$.fn.tooltip = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('tooltip')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tooltip.Constructor = Tooltip
|
||||
|
||||
$.fn.tooltip.defaults = {
|
||||
animation: true
|
||||
, placement: 'top'
|
||||
, selector: false
|
||||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||
, trigger: 'hover focus'
|
||||
, title: ''
|
||||
, delay: 0
|
||||
, html: false
|
||||
, container: false
|
||||
}
|
||||
|
||||
|
||||
/* TOOLTIP NO CONFLICT
|
||||
* =================== */
|
||||
|
||||
$.fn.tooltip.noConflict = function () {
|
||||
$.fn.tooltip = old
|
||||
return this
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
60
js/bootstrap-transition.js
vendored
60
js/bootstrap-transition.js
vendored
@@ -1,60 +0,0 @@
|
||||
/* ===================================================
|
||||
* bootstrap-transition.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#transitions
|
||||
* ===================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
|
||||
* ======================================================= */
|
||||
|
||||
$(function () {
|
||||
|
||||
$.support.transition = (function () {
|
||||
|
||||
var transitionEnd = (function () {
|
||||
|
||||
var el = document.createElement('bootstrap')
|
||||
, transEndEventNames = {
|
||||
'WebkitTransition' : 'webkitTransitionEnd'
|
||||
, 'MozTransition' : 'transitionend'
|
||||
, 'OTransition' : 'oTransitionEnd otransitionend'
|
||||
, 'transition' : 'transitionend'
|
||||
}
|
||||
, name
|
||||
|
||||
for (name in transEndEventNames){
|
||||
if (el.style[name] !== undefined) {
|
||||
return transEndEventNames[name]
|
||||
}
|
||||
}
|
||||
|
||||
}())
|
||||
|
||||
return transitionEnd && {
|
||||
end: transitionEnd
|
||||
}
|
||||
|
||||
})()
|
||||
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
335
js/bootstrap-typeahead.js
vendored
335
js/bootstrap-typeahead.js
vendored
@@ -1,335 +0,0 @@
|
||||
/* =============================================================
|
||||
* bootstrap-typeahead.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#typeahead
|
||||
* =============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function($){
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TYPEAHEAD PUBLIC CLASS DEFINITION
|
||||
* ================================= */
|
||||
|
||||
var Typeahead = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
||||
this.matcher = this.options.matcher || this.matcher
|
||||
this.sorter = this.options.sorter || this.sorter
|
||||
this.highlighter = this.options.highlighter || this.highlighter
|
||||
this.updater = this.options.updater || this.updater
|
||||
this.source = this.options.source
|
||||
this.$menu = $(this.options.menu)
|
||||
this.shown = false
|
||||
this.listen()
|
||||
}
|
||||
|
||||
Typeahead.prototype = {
|
||||
|
||||
constructor: Typeahead
|
||||
|
||||
, select: function () {
|
||||
var val = this.$menu.find('.active').attr('data-value')
|
||||
this.$element
|
||||
.val(this.updater(val))
|
||||
.change()
|
||||
return this.hide()
|
||||
}
|
||||
|
||||
, updater: function (item) {
|
||||
return item
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var pos = $.extend({}, this.$element.position(), {
|
||||
height: this.$element[0].offsetHeight
|
||||
})
|
||||
|
||||
this.$menu
|
||||
.insertAfter(this.$element)
|
||||
.css({
|
||||
top: pos.top + pos.height
|
||||
, left: pos.left
|
||||
})
|
||||
.show()
|
||||
|
||||
this.shown = true
|
||||
return this
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
this.$menu.hide()
|
||||
this.shown = false
|
||||
return this
|
||||
}
|
||||
|
||||
, lookup: function (event) {
|
||||
var items
|
||||
|
||||
this.query = this.$element.val()
|
||||
|
||||
if (!this.query || this.query.length < this.options.minLength) {
|
||||
return this.shown ? this.hide() : this
|
||||
}
|
||||
|
||||
items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
|
||||
|
||||
return items ? this.process(items) : this
|
||||
}
|
||||
|
||||
, process: function (items) {
|
||||
var that = this
|
||||
|
||||
items = $.grep(items, function (item) {
|
||||
return that.matcher(item)
|
||||
})
|
||||
|
||||
items = this.sorter(items)
|
||||
|
||||
if (!items.length) {
|
||||
return this.shown ? this.hide() : this
|
||||
}
|
||||
|
||||
return this.render(items.slice(0, this.options.items)).show()
|
||||
}
|
||||
|
||||
, matcher: function (item) {
|
||||
return ~item.toLowerCase().indexOf(this.query.toLowerCase())
|
||||
}
|
||||
|
||||
, sorter: function (items) {
|
||||
var beginswith = []
|
||||
, caseSensitive = []
|
||||
, caseInsensitive = []
|
||||
, item
|
||||
|
||||
while (item = items.shift()) {
|
||||
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
|
||||
else if (~item.indexOf(this.query)) caseSensitive.push(item)
|
||||
else caseInsensitive.push(item)
|
||||
}
|
||||
|
||||
return beginswith.concat(caseSensitive, caseInsensitive)
|
||||
}
|
||||
|
||||
, highlighter: function (item) {
|
||||
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
|
||||
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
||||
return '<strong>' + match + '</strong>'
|
||||
})
|
||||
}
|
||||
|
||||
, render: function (items) {
|
||||
var that = this
|
||||
|
||||
items = $(items).map(function (i, item) {
|
||||
i = $(that.options.item).attr('data-value', item)
|
||||
i.find('a').html(that.highlighter(item))
|
||||
return i[0]
|
||||
})
|
||||
|
||||
items.first().addClass('active')
|
||||
this.$menu.html(items)
|
||||
return this
|
||||
}
|
||||
|
||||
, next: function (event) {
|
||||
var active = this.$menu.find('.active').removeClass('active')
|
||||
, next = active.next()
|
||||
|
||||
if (!next.length) {
|
||||
next = $(this.$menu.find('li')[0])
|
||||
}
|
||||
|
||||
next.addClass('active')
|
||||
}
|
||||
|
||||
, prev: function (event) {
|
||||
var active = this.$menu.find('.active').removeClass('active')
|
||||
, prev = active.prev()
|
||||
|
||||
if (!prev.length) {
|
||||
prev = this.$menu.find('li').last()
|
||||
}
|
||||
|
||||
prev.addClass('active')
|
||||
}
|
||||
|
||||
, listen: function () {
|
||||
this.$element
|
||||
.on('focus', $.proxy(this.focus, this))
|
||||
.on('blur', $.proxy(this.blur, this))
|
||||
.on('keypress', $.proxy(this.keypress, this))
|
||||
.on('keyup', $.proxy(this.keyup, this))
|
||||
|
||||
if (this.eventSupported('keydown')) {
|
||||
this.$element.on('keydown', $.proxy(this.keydown, this))
|
||||
}
|
||||
|
||||
this.$menu
|
||||
.on('click', $.proxy(this.click, this))
|
||||
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
||||
.on('mouseleave', 'li', $.proxy(this.mouseleave, this))
|
||||
}
|
||||
|
||||
, eventSupported: function(eventName) {
|
||||
var isSupported = eventName in this.$element
|
||||
if (!isSupported) {
|
||||
this.$element.setAttribute(eventName, 'return;')
|
||||
isSupported = typeof this.$element[eventName] === 'function'
|
||||
}
|
||||
return isSupported
|
||||
}
|
||||
|
||||
, move: function (e) {
|
||||
if (!this.shown) return
|
||||
|
||||
switch(e.keyCode) {
|
||||
case 9: // tab
|
||||
case 13: // enter
|
||||
case 27: // escape
|
||||
e.preventDefault()
|
||||
break
|
||||
|
||||
case 38: // up arrow
|
||||
e.preventDefault()
|
||||
this.prev()
|
||||
break
|
||||
|
||||
case 40: // down arrow
|
||||
e.preventDefault()
|
||||
this.next()
|
||||
break
|
||||
}
|
||||
|
||||
e.stopPropagation()
|
||||
}
|
||||
|
||||
, keydown: function (e) {
|
||||
this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
|
||||
this.move(e)
|
||||
}
|
||||
|
||||
, keypress: function (e) {
|
||||
if (this.suppressKeyPressRepeat) return
|
||||
this.move(e)
|
||||
}
|
||||
|
||||
, keyup: function (e) {
|
||||
switch(e.keyCode) {
|
||||
case 40: // down arrow
|
||||
case 38: // up arrow
|
||||
case 16: // shift
|
||||
case 17: // ctrl
|
||||
case 18: // alt
|
||||
break
|
||||
|
||||
case 9: // tab
|
||||
case 13: // enter
|
||||
if (!this.shown) return
|
||||
this.select()
|
||||
break
|
||||
|
||||
case 27: // escape
|
||||
if (!this.shown) return
|
||||
this.hide()
|
||||
break
|
||||
|
||||
default:
|
||||
this.lookup()
|
||||
}
|
||||
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
, focus: function (e) {
|
||||
this.focused = true
|
||||
}
|
||||
|
||||
, blur: function (e) {
|
||||
this.focused = false
|
||||
if (!this.mousedover && this.shown) this.hide()
|
||||
}
|
||||
|
||||
, click: function (e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
this.select()
|
||||
this.$element.focus()
|
||||
}
|
||||
|
||||
, mouseenter: function (e) {
|
||||
this.mousedover = true
|
||||
this.$menu.find('.active').removeClass('active')
|
||||
$(e.currentTarget).addClass('active')
|
||||
}
|
||||
|
||||
, mouseleave: function (e) {
|
||||
this.mousedover = false
|
||||
if (!this.focused && this.shown) this.hide()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* TYPEAHEAD PLUGIN DEFINITION
|
||||
* =========================== */
|
||||
|
||||
var old = $.fn.typeahead
|
||||
|
||||
$.fn.typeahead = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('typeahead')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.typeahead.defaults = {
|
||||
source: []
|
||||
, items: 8
|
||||
, menu: '<ul class="typeahead dropdown-menu"></ul>'
|
||||
, item: '<li><a href="#"></a></li>'
|
||||
, minLength: 1
|
||||
}
|
||||
|
||||
$.fn.typeahead.Constructor = Typeahead
|
||||
|
||||
|
||||
/* TYPEAHEAD NO CONFLICT
|
||||
* =================== */
|
||||
|
||||
$.fn.typeahead.noConflict = function () {
|
||||
$.fn.typeahead = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* TYPEAHEAD DATA-API
|
||||
* ================== */
|
||||
|
||||
$(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
|
||||
var $this = $(this)
|
||||
if ($this.data('typeahead')) return
|
||||
$this.typeahead($this.data())
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
@@ -1,8 +1,8 @@
|
||||
/* ============================================================
|
||||
* bootstrap-button.js v3.0.0
|
||||
/* ========================================================================
|
||||
* Bootstrap: button.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
||||
* ============================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
* ========================================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,30 +15,32 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================ */
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
+function ($) { "use strict";
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* BUTTON PUBLIC CLASS DEFINITION
|
||||
* ============================== */
|
||||
// BUTTON PUBLIC CLASS DEFINITION
|
||||
// ==============================
|
||||
|
||||
var Button = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.button.defaults, options)
|
||||
this.options = $.extend({}, Button.DEFAULTS, options)
|
||||
}
|
||||
|
||||
Button.DEFAULTS = {
|
||||
loadingText: 'loading...'
|
||||
}
|
||||
|
||||
Button.prototype.setState = function (state) {
|
||||
var d = 'disabled'
|
||||
, $el = this.$element
|
||||
, data = $el.data()
|
||||
, val = $el.is('input') ? 'val' : 'html'
|
||||
var d = 'disabled'
|
||||
var $el = this.$element
|
||||
var val = $el.is('input') ? 'val' : 'html'
|
||||
var data = $el.data()
|
||||
|
||||
state = state + 'Text'
|
||||
data.resetText || $el.data('resetText', $el[val]())
|
||||
|
||||
if (!data.resetText) $el.data('resetText', $el[val]())
|
||||
|
||||
$el[val](data[state] || this.options[state])
|
||||
|
||||
@@ -46,46 +48,44 @@
|
||||
setTimeout(function () {
|
||||
state == 'loadingText' ?
|
||||
$el.addClass(d).attr(d, d) :
|
||||
$el.removeClass(d).removeAttr(d)
|
||||
$el.removeClass(d).removeAttr(d);
|
||||
}, 0)
|
||||
}
|
||||
|
||||
Button.prototype.toggle = function () {
|
||||
var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
|
||||
|
||||
$parent && $parent
|
||||
.find('.active')
|
||||
.removeClass('active')
|
||||
if ($parent) {
|
||||
$parent.find('.active').removeClass('active')
|
||||
}
|
||||
|
||||
this.$element.toggleClass('active')
|
||||
}
|
||||
|
||||
|
||||
/* BUTTON PLUGIN DEFINITION
|
||||
* ======================== */
|
||||
// BUTTON PLUGIN DEFINITION
|
||||
// ========================
|
||||
|
||||
var old = $.fn.button
|
||||
|
||||
$.fn.button = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('button')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('button', (data = new Button(this, options)))
|
||||
var $this = $(this)
|
||||
var data = $this.data('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)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.button.defaults = {
|
||||
loadingText: 'loading...'
|
||||
}
|
||||
|
||||
$.fn.button.Constructor = Button
|
||||
|
||||
|
||||
/* BUTTON NO CONFLICT
|
||||
* ================== */
|
||||
// BUTTON NO CONFLICT
|
||||
// ==================
|
||||
|
||||
$.fn.button.noConflict = function () {
|
||||
$.fn.button = old
|
||||
@@ -93,10 +93,10 @@
|
||||
}
|
||||
|
||||
|
||||
/* BUTTON DATA-API
|
||||
* =============== */
|
||||
// BUTTON DATA-API
|
||||
// ===============
|
||||
|
||||
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
|
||||
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
|
||||
var $btn = $(e.target)
|
||||
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
||||
$btn.button('toggle')
|
210
js/carousel.js
Normal file
210
js/carousel.js
Normal file
@@ -0,0 +1,210 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: carousel.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#carousel
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "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.pause == 'hover' && this.$element
|
||||
.on('mouseenter', $.proxy(this.pause, this))
|
||||
.on('mouseleave', $.proxy(this.cycle, this))
|
||||
}
|
||||
|
||||
Carousel.DEFAULTS = {
|
||||
interval: 5000
|
||||
, pause: 'hover'
|
||||
}
|
||||
|
||||
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.getActiveIndex = function () {
|
||||
this.$active = this.$element.find('.item.active')
|
||||
this.$items = this.$active.parent().children()
|
||||
|
||||
return this.$items.index(this.$active)
|
||||
}
|
||||
|
||||
Carousel.prototype.to = function (pos) {
|
||||
var that = this
|
||||
var activeIndex = this.getActiveIndex()
|
||||
|
||||
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||
|
||||
if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
|
||||
if (activeIndex == pos) return this.pause().cycle()
|
||||
|
||||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||
}
|
||||
|
||||
Carousel.prototype.pause = function (e) {
|
||||
e || (this.paused = true)
|
||||
|
||||
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
||||
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 || $active[type]()
|
||||
var isCycling = this.interval
|
||||
var direction = type == 'next' ? 'left' : 'right'
|
||||
var fallback = type == 'next' ? 'first' : 'last'
|
||||
var that = this
|
||||
|
||||
this.sliding = true
|
||||
|
||||
isCycling && this.pause()
|
||||
|
||||
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
||||
|
||||
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
||||
|
||||
if ($next.hasClass('active')) return
|
||||
|
||||
if (this.$indicators.length) {
|
||||
this.$indicators.find('.active').removeClass('active')
|
||||
this.$element.one('slid', function () {
|
||||
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
||||
$nextIndicator && $nextIndicator.addClass('active')
|
||||
})
|
||||
}
|
||||
|
||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$next.addClass(type)
|
||||
$next[0].offsetWidth // force reflow
|
||||
$active.addClass(direction)
|
||||
$next.addClass(direction)
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||
$active.removeClass(['active', direction].join(' '))
|
||||
that.sliding = false
|
||||
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
||||
})
|
||||
} else {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$active.removeClass('active')
|
||||
$next.addClass('active')
|
||||
this.sliding = false
|
||||
this.$element.trigger('slid')
|
||||
}
|
||||
|
||||
isCycling && this.cycle()
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// CAROUSEL PLUGIN DEFINITION
|
||||
// ==========================
|
||||
|
||||
var old = $.fn.carousel
|
||||
|
||||
$.fn.carousel = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.carousel')
|
||||
var options = $.extend({}, Carousel.DEFAULTS, 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()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.carousel.Constructor = Carousel
|
||||
|
||||
|
||||
// CAROUSEL NO CONFLICT
|
||||
// ====================
|
||||
|
||||
$.fn.carousel.noConflict = function () {
|
||||
$.fn.carousel = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// CAROUSEL DATA-API
|
||||
// =================
|
||||
|
||||
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
||||
var $this = $(this), href
|
||||
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
var options = $.extend({}, $target.data(), $this.data())
|
||||
var slideIndex
|
||||
|
||||
$target.carousel(options)
|
||||
|
||||
if (slideIndex = $this.attr('data-slide-to')) {
|
||||
$target.data('bs-carousel').pause().to(slideIndex).cycle()
|
||||
}
|
||||
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
$(window).on('load', function () {
|
||||
$('[data-ride="carousel"]').each(function () {
|
||||
var $carousel = $(this)
|
||||
$carousel.carousel($carousel.data())
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
156
js/collapse.js
Normal file
156
js/collapse.js
Normal file
@@ -0,0 +1,156 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: collapse.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// COLLAPSE PUBLIC CLASS DEFINITION
|
||||
// ================================
|
||||
|
||||
var Collapse = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
||||
this.transitioning = null
|
||||
|
||||
if (this.options.parent) this.$parent = $(this.options.parent)
|
||||
if (this.options.toggle) this.toggle()
|
||||
}
|
||||
|
||||
Collapse.DEFAULTS = {
|
||||
toggle: true
|
||||
}
|
||||
|
||||
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 dimension = this.dimension()
|
||||
var scroll = $.camelCase(['scroll', dimension].join('-'))
|
||||
var actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
||||
|
||||
if (actives && actives.length) {
|
||||
var hasData = actives.data('collapse')
|
||||
if (hasData && hasData.transitioning) return
|
||||
actives.collapse('hide')
|
||||
hasData || actives.data('collapse', null)
|
||||
}
|
||||
|
||||
this.$element[dimension](0)
|
||||
this.transition('addClass', $.Event('show.bs.collapse'), 'shown.bs.collapse')
|
||||
|
||||
if ($.support.transition) this.$element[dimension](this.$element[0][scroll])
|
||||
}
|
||||
|
||||
Collapse.prototype.hide = function () {
|
||||
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||
var dimension = this.dimension()
|
||||
this.reset(this.$element[dimension]())
|
||||
this.transition('removeClass', $.Event('hide.bs.collapse'), 'hidden')
|
||||
this.$element[dimension](0)
|
||||
}
|
||||
|
||||
Collapse.prototype.reset = function (size) {
|
||||
var dimension = this.dimension()
|
||||
|
||||
this.$element
|
||||
.removeClass('collapse')
|
||||
[dimension](size || 'auto')
|
||||
[0].offsetWidth
|
||||
|
||||
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
Collapse.prototype.transition = function (method, startEvent, completeEvent) {
|
||||
var that = this
|
||||
var complete = function () {
|
||||
if (startEvent.type == 'show') that.reset()
|
||||
that.transitioning = 0
|
||||
that.$element.trigger(completeEvent)
|
||||
}
|
||||
|
||||
this.$element.trigger(startEvent)
|
||||
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
this.transitioning = 1
|
||||
|
||||
this.$element[method]('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('collapse') ?
|
||||
this.$element.one($.support.transition.end, complete) :
|
||||
complete()
|
||||
}
|
||||
|
||||
Collapse.prototype.toggle = function () {
|
||||
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
|
||||
// COLLAPSE PLUGIN DEFINITION
|
||||
// ==========================
|
||||
|
||||
var old = $.fn.collapse
|
||||
|
||||
$.fn.collapse = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('collapse')
|
||||
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
|
||||
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.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), href
|
||||
var target = $this.attr('data-target')
|
||||
|| e.preventDefault()
|
||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||
var option = $(target).data('collapse') ? 'toggle' : $this.data()
|
||||
var parent = $this.attr('data-parent')
|
||||
var $parent = parent && $(parent)
|
||||
|
||||
if ($parent) $parent.find('[data-toggle=collapse][data-parent=' + parent + ']').not($this).addClass('collapsed')
|
||||
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||
$(target).collapse(option)
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
155
js/dropdown.js
Normal file
155
js/dropdown.js
Normal file
@@ -0,0 +1,155 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: dropdown.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// DROPDOWN CLASS DEFINITION
|
||||
// =========================
|
||||
|
||||
var backdrop = '.dropdown-backdrop'
|
||||
var toggle = '[data-toggle=dropdown]'
|
||||
var Dropdown = function (element) {
|
||||
var $el = $(element).on('click.bs.dropdown', this.toggle)
|
||||
}
|
||||
|
||||
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) {
|
||||
// if mobile we we use a backdrop because click events don't delegate
|
||||
$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
|
||||
}
|
||||
|
||||
$parent.trigger(e = $.Event('show.bs.dropdown'))
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent
|
||||
.toggleClass('open')
|
||||
.trigger('shown.bs.dropdown')
|
||||
}
|
||||
|
||||
$this.focus()
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
Dropdown.prototype.keydown = function (e) {
|
||||
if (!/(38|40|27)/.test(e.keyCode)) 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 || (isActive && e.keyCode == 27)) {
|
||||
if (e.which == 27) $parent.find(toggle).focus()
|
||||
return $this.click()
|
||||
}
|
||||
|
||||
var $items = $('[role=menu] li:not(.divider):visible a', $parent)
|
||||
|
||||
if (!$items.length) return
|
||||
|
||||
var index = $items.index($items.filter(':focus'))
|
||||
|
||||
if (e.keyCode == 38 && index > 0) index-- // up
|
||||
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
||||
if (!~index) index=0
|
||||
|
||||
$items.eq(index).focus()
|
||||
}
|
||||
|
||||
function clearMenus() {
|
||||
$(backdrop).remove()
|
||||
$(toggle).each(function (e) {
|
||||
var $parent = getParent($(this))
|
||||
if (!$parent.hasClass('open')) return
|
||||
$parent.trigger(e = $.Event('hide.bs.dropdown'))
|
||||
if (e.isDefaultPrevented()) return
|
||||
$parent.removeClass('open').trigger('hidden.bs.dropdown')
|
||||
})
|
||||
}
|
||||
|
||||
function getParent($this) {
|
||||
var selector = $this.attr('data-target')
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
var $parent = selector && $(selector)
|
||||
|
||||
return $parent && $parent.length ? $parent : $this.parent()
|
||||
}
|
||||
|
||||
|
||||
// DROPDOWN PLUGIN DEFINITION
|
||||
// ==========================
|
||||
|
||||
var old = $.fn.dropdown
|
||||
|
||||
$.fn.dropdown = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('dropdown')
|
||||
|
||||
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
$.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 + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||
|
||||
}(window.jQuery);
|
243
js/modal.js
Normal file
243
js/modal.js
Normal file
@@ -0,0 +1,243 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: modal.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#modals
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// MODAL CLASS DEFINITION
|
||||
// ======================
|
||||
|
||||
var Modal = function (element, options) {
|
||||
this.options = options
|
||||
this.$element = $(element).delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
||||
this.$backdrop =
|
||||
this.isShown = null
|
||||
|
||||
if (this.options.remote) this.$element.find('.modal-body').load(this.options.remote)
|
||||
}
|
||||
|
||||
Modal.DEFAULTS = {
|
||||
backdrop: true
|
||||
, keyboard: true
|
||||
, show: true
|
||||
}
|
||||
|
||||
Modal.prototype.toggle = function () {
|
||||
return this[!this.isShown ? 'show' : 'hide']()
|
||||
}
|
||||
|
||||
Modal.prototype.show = function () {
|
||||
var that = this
|
||||
var e = $.Event('show.bs.modal')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = true
|
||||
|
||||
this.escape()
|
||||
|
||||
this.backdrop(function () {
|
||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||
|
||||
if (!that.$element.parent().length) {
|
||||
that.$element.appendTo(document.body) // don't move modals dom position
|
||||
}
|
||||
|
||||
that.$element.show()
|
||||
|
||||
if (transition) {
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
}
|
||||
|
||||
that.$element
|
||||
.addClass('in')
|
||||
.attr('aria-hidden', false)
|
||||
|
||||
that.enforceFocus()
|
||||
|
||||
transition ?
|
||||
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown.bs.modal') }) :
|
||||
that.$element.focus().trigger('shown.bs.modal')
|
||||
})
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
$(document).off('focusin.bs.modal')
|
||||
|
||||
this.$element
|
||||
.removeClass('in')
|
||||
.attr('aria-hidden', true)
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
this.hideWithTransition() :
|
||||
this.hideModal()
|
||||
}
|
||||
|
||||
Modal.prototype.enforceFocus = function () {
|
||||
$(document)
|
||||
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||
.on('focusin.bs.modal', function (e) {
|
||||
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
||||
this.$element.focus()
|
||||
}
|
||||
}, this)
|
||||
}
|
||||
|
||||
Modal.prototype.escape = function () {
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
this.$element.on('keyup.dismiss.bs.modal', function ( e ) {
|
||||
e.which == 27 && this.hide()
|
||||
}, this)
|
||||
} else if (!this.isShown) {
|
||||
this.$element.off('keyup.dismiss.bs.modal')
|
||||
}
|
||||
}
|
||||
|
||||
Modal.prototype.hideWithTransition = function () {
|
||||
var that = this
|
||||
var timeout = setTimeout(function () {
|
||||
that.$element.off($.support.transition.end)
|
||||
that.hideModal()
|
||||
}, 500)
|
||||
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
that.hideModal()
|
||||
})
|
||||
}
|
||||
|
||||
Modal.prototype.hideModal = function () {
|
||||
var that = this
|
||||
this.$element.hide()
|
||||
this.backdrop(function () {
|
||||
that.removeBackdrop()
|
||||
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 + '" />')
|
||||
.appendTo(document.body)
|
||||
|
||||
this.$backdrop.click(
|
||||
this.options.backdrop == 'static' ?
|
||||
$.proxy(this.$element[0].focus, this.$element[0])
|
||||
: $.proxy(this.hide, this)
|
||||
)
|
||||
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
this.$backdrop.addClass('in')
|
||||
|
||||
if (!callback) return
|
||||
|
||||
doAnimate ?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (!this.isShown && this.$backdrop) {
|
||||
this.$backdrop.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade')?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (callback) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MODAL PLUGIN DEFINITION
|
||||
// =======================
|
||||
|
||||
var old = $.fn.modal
|
||||
|
||||
$.fn.modal = function (option) {
|
||||
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]()
|
||||
else if (options.show) data.show()
|
||||
})
|
||||
}
|
||||
|
||||
$.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('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
e.preventDefault()
|
||||
|
||||
$target
|
||||
.modal(option)
|
||||
.one('hide', function () {
|
||||
$this.focus()
|
||||
})
|
||||
})
|
||||
|
||||
var $body = $(document.body)
|
||||
.on('bs.modal.shown', '.modal', function () { $body.addClass('modal-open') })
|
||||
.on('bs.modal.hidden', '.modal', function () { $body.removeClass('modal-open') })
|
||||
|
||||
}(window.jQuery);
|
109
js/popover.js
Normal file
109
js/popover.js
Normal file
@@ -0,0 +1,109 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: popover.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#popovers
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// POPOVER PUBLIC CLASS DEFINITION
|
||||
// ===============================
|
||||
|
||||
var Popover = function (element, options) {
|
||||
this.init('popover', element, options)
|
||||
}
|
||||
|
||||
Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
|
||||
placement: 'right'
|
||||
, trigger: 'click'
|
||||
, content: ''
|
||||
, template: '<div class="popover"><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')[this.options.html ? 'html' : 'text'](content)
|
||||
|
||||
$tip.removeClass('fade top bottom left right in')
|
||||
}
|
||||
|
||||
Popover.prototype.hasContent = function () {
|
||||
return this.getTitle() || this.getContent()
|
||||
}
|
||||
|
||||
Popover.prototype.getContent = function () {
|
||||
var content = typeof this.options.content == 'function' ?
|
||||
this.options.content.call(this.$element[0]) :
|
||||
this.options.content
|
||||
|
||||
return content || this.$element.attr('data-content')
|
||||
}
|
||||
|
||||
Popover.prototype.tip = function () {
|
||||
if (!this.$tip) this.$tip = $(this.options.template)
|
||||
return this.$tip
|
||||
}
|
||||
|
||||
Popover.prototype.destroy = function () {
|
||||
this.hide().$element.off('.' + this.type).removeData(this.type)
|
||||
}
|
||||
|
||||
|
||||
// POPOVER PLUGIN DEFINITION
|
||||
// =========================
|
||||
|
||||
var old = $.fn.popover
|
||||
|
||||
$.fn.popover = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.popover')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.popover.Constructor = Popover
|
||||
|
||||
|
||||
// POPOVER NO CONFLICT
|
||||
// ===================
|
||||
|
||||
$.fn.popover.noConflict = function () {
|
||||
$.fn.popover = old
|
||||
return this
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
156
js/scrollspy.js
Normal file
156
js/scrollspy.js
Normal file
@@ -0,0 +1,156 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: scrollspy.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// SCROLLSPY CLASS DEFINITION
|
||||
// ==========================
|
||||
|
||||
function ScrollSpy(element, options) {
|
||||
var href
|
||||
var process = $.proxy(this.process, this)
|
||||
var $element = $(element).is('body') ? $(window) : $(element)
|
||||
|
||||
this.$body = $('body')
|
||||
this.$scrollElement = $element.on('scroll.bs.scroll-spy.data-api', process)
|
||||
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
||||
this.selector = (this.options.target
|
||||
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
|| '') + ' .nav li > a'
|
||||
this.offsets = $([])
|
||||
this.targets = $([])
|
||||
this.activeTarget = null
|
||||
|
||||
this.refresh()
|
||||
this.process()
|
||||
}
|
||||
|
||||
ScrollSpy.DEFAULTS = {
|
||||
offset: 10
|
||||
}
|
||||
|
||||
ScrollSpy.prototype.refresh = function () {
|
||||
this.offsets = $([])
|
||||
this.targets = $([])
|
||||
|
||||
var self = this
|
||||
var $targets = this.$body
|
||||
.find(this.selector)
|
||||
.map(function () {
|
||||
var $el = $(this)
|
||||
var href = $el.data('target') || $el.attr('href')
|
||||
var $href = /^#\w/.test(href) && $(href)
|
||||
|
||||
return ($href
|
||||
&& $href.length
|
||||
&& [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), 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.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
||||
var maxScroll = scrollHeight - this.$scrollElement.height()
|
||||
var offsets = this.offsets
|
||||
var targets = this.targets
|
||||
var activeTarget = this.activeTarget
|
||||
var i
|
||||
|
||||
if (scrollTop >= maxScroll) {
|
||||
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
||||
}
|
||||
|
||||
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.selector)
|
||||
.parents('.active')
|
||||
.removeClass('active')
|
||||
|
||||
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')
|
||||
}
|
||||
|
||||
|
||||
// SCROLLSPY PLUGIN DEFINITION
|
||||
// ===========================
|
||||
|
||||
var old = $.fn.scrollspy
|
||||
|
||||
$.fn.scrollspy = function (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]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.scrollspy.Constructor = ScrollSpy
|
||||
|
||||
|
||||
// SCROLLSPY NO CONFLICT
|
||||
// =====================
|
||||
|
||||
$.fn.scrollspy.noConflict = function () {
|
||||
$.fn.scrollspy = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// SCROLLSPY DATA-API
|
||||
// ==================
|
||||
|
||||
$(window).on('load', function () {
|
||||
$('[data-spy="scroll"]').each(function () {
|
||||
var $spy = $(this)
|
||||
$spy.scrollspy($spy.data())
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
133
js/tab.js
Normal file
133
js/tab.js
Normal file
@@ -0,0 +1,133 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: tab.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#tabs
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// TAB CLASS DEFINITION
|
||||
// ====================
|
||||
|
||||
var Tab = function (element) {
|
||||
this.element = $(element)
|
||||
}
|
||||
|
||||
Tab.prototype.show = function () {
|
||||
var $this = this.element
|
||||
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||
var selector = $this.attr('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')[0]
|
||||
var e = $.Event('show.bs.tab', {
|
||||
relatedTarget: previous
|
||||
})
|
||||
|
||||
$this.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
var $target = $(selector)
|
||||
|
||||
this.activate($this.parent('li'), $ul)
|
||||
this.activate($target, $target.parent(), function () {
|
||||
$this.trigger({
|
||||
type: 'shown.bs.tab'
|
||||
, relatedTarget: previous
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Tab.prototype.activate = function (element, container, callback) {
|
||||
var $active = container.find('> .active')
|
||||
var transition = callback
|
||||
&& $.support.transition
|
||||
&& $active.hasClass('fade')
|
||||
|
||||
function next() {
|
||||
$active
|
||||
.removeClass('active')
|
||||
.find('> .dropdown-menu > .active')
|
||||
.removeClass('active')
|
||||
|
||||
element.addClass('active')
|
||||
|
||||
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')
|
||||
}
|
||||
|
||||
callback && callback()
|
||||
}
|
||||
|
||||
transition ?
|
||||
$active.one($.support.transition.end, next) :
|
||||
next()
|
||||
|
||||
$active.removeClass('in')
|
||||
}
|
||||
|
||||
|
||||
// TAB PLUGIN DEFINITION
|
||||
// =====================
|
||||
|
||||
var old = $.fn.tab
|
||||
|
||||
$.fn.tab = function ( 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]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tab.Constructor = Tab
|
||||
|
||||
|
||||
// TAB NO CONFLICT
|
||||
// ===============
|
||||
|
||||
$.fn.tab.noConflict = function () {
|
||||
$.fn.tab = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// TAB DATA-API
|
||||
// ============
|
||||
|
||||
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
||||
e.preventDefault()
|
||||
$(this).tab('show')
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
@@ -12,37 +12,36 @@
|
||||
<script src="vendor/qunit.js"></script>
|
||||
|
||||
<!-- phantomjs logging script-->
|
||||
<script src="unit/bootstrap-phantom.js"></script>
|
||||
<script src="unit/phantom.js"></script>
|
||||
|
||||
<!-- plugin sources -->
|
||||
<script src="../../js/bootstrap-transition.js"></script>
|
||||
<script src="../../js/bootstrap-alert.js"></script>
|
||||
<script src="../../js/bootstrap-button.js"></script>
|
||||
<script src="../../js/bootstrap-carousel.js"></script>
|
||||
<script src="../../js/bootstrap-collapse.js"></script>
|
||||
<script src="../../js/bootstrap-dropdown.js"></script>
|
||||
<script src="../../js/bootstrap-modal.js"></script>
|
||||
<script src="../../js/bootstrap-scrollspy.js"></script>
|
||||
<script src="../../js/bootstrap-tab.js"></script>
|
||||
<script src="../../js/bootstrap-tooltip.js"></script>
|
||||
<script src="../../js/bootstrap-popover.js"></script>
|
||||
<script src="../../js/bootstrap-typeahead.js"></script>
|
||||
<script src="../../js/bootstrap-affix.js"></script>
|
||||
<script src="../../js/transition.js"></script>
|
||||
<script src="../../js/alert.js"></script>
|
||||
<script src="../../js/button.js"></script>
|
||||
<script src="../../js/carousel.js"></script>
|
||||
<script src="../../js/collapse.js"></script>
|
||||
<script src="../../js/dropdown.js"></script>
|
||||
<script src="../../js/modal.js"></script>
|
||||
<script src="../../js/scrollspy.js"></script>
|
||||
<script src="../../js/tab.js"></script>
|
||||
<script src="../../js/tooltip.js"></script>
|
||||
<script src="../../js/popover.js"></script>
|
||||
<script src="../../js/affix.js"></script>
|
||||
|
||||
<!-- unit tests -->
|
||||
<script src="unit/bootstrap-transition.js"></script>
|
||||
<script src="unit/bootstrap-alert.js"></script>
|
||||
<script src="unit/bootstrap-button.js"></script>
|
||||
<script src="unit/bootstrap-carousel.js"></script>
|
||||
<script src="unit/bootstrap-collapse.js"></script>
|
||||
<script src="unit/bootstrap-dropdown.js"></script>
|
||||
<script src="unit/bootstrap-modal.js"></script>
|
||||
<script src="unit/bootstrap-scrollspy.js"></script>
|
||||
<script src="unit/bootstrap-tab.js"></script>
|
||||
<script src="unit/bootstrap-tooltip.js"></script>
|
||||
<script src="unit/bootstrap-popover.js"></script>
|
||||
<script src="unit/bootstrap-typeahead.js"></script>
|
||||
<script src="unit/bootstrap-affix.js"></script>
|
||||
<script src="unit/transition.js"></script>
|
||||
<script src="unit/alert.js"></script>
|
||||
<script src="unit/button.js"></script>
|
||||
<script src="unit/carousel.js"></script>
|
||||
<script src="unit/collapse.js"></script>
|
||||
<script src="unit/dropdown.js"></script>
|
||||
<script src="unit/modal.js"></script>
|
||||
<script src="unit/scrollspy.js"></script>
|
||||
<script src="unit/tab.js"></script>
|
||||
<script src="unit/tooltip.js"></script>
|
||||
<script src="unit/popover.js"></script>
|
||||
<script src="unit/affix.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-affix")
|
||||
module("affix")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var affix = $.fn.affix.noConflict()
|
||||
@@ -18,7 +18,7 @@ $(function () {
|
||||
|
||||
test("should exit early if element is not visible", function () {
|
||||
var $affix = $('<div style="display: none"></div>').affix()
|
||||
$affix.data('affix').checkPosition()
|
||||
$affix.data('bs.affix').checkPosition()
|
||||
ok(!$affix.hasClass('affix'), 'affix class was not added')
|
||||
})
|
||||
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-alerts")
|
||||
module("alert")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var alert = $.fn.alert.noConflict()
|
||||
@@ -48,12 +48,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
stop();
|
||||
$('<div class="alert"/>')
|
||||
.bind('close', function (e) {
|
||||
.on('close.bs.alert', function (e) {
|
||||
e.preventDefault();
|
||||
ok(true);
|
||||
start();
|
||||
})
|
||||
.bind('closed', function () {
|
||||
.on('closed.bs.alert', function () {
|
||||
ok(false);
|
||||
})
|
||||
.alert('close')
|
236
js/tests/unit/bootstrap-typeahead.js
vendored
236
js/tests/unit/bootstrap-typeahead.js
vendored
@@ -1,236 +0,0 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-typeahead")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var typeahead = $.fn.typeahead.noConflict()
|
||||
ok(!$.fn.typeahead, 'typeahead was set back to undefined (org value)')
|
||||
$.fn.typeahead = typeahead
|
||||
})
|
||||
|
||||
test("should be defined on jquery object", function () {
|
||||
ok($(document.body).typeahead, 'alert method is defined')
|
||||
})
|
||||
|
||||
test("should return element", function () {
|
||||
ok($(document.body).typeahead()[0] == document.body, 'document.body returned')
|
||||
})
|
||||
|
||||
test("should listen to an input", function () {
|
||||
var $input = $('<input />')
|
||||
$input.typeahead()
|
||||
ok($._data($input[0], 'events').blur, 'has a blur event')
|
||||
ok($._data($input[0], 'events').keypress, 'has a keypress event')
|
||||
ok($._data($input[0], 'events').keyup, 'has a keyup event')
|
||||
})
|
||||
|
||||
test("should create a menu", function () {
|
||||
var $input = $('<input />')
|
||||
ok($input.typeahead().data('typeahead').$menu, 'has a menu')
|
||||
})
|
||||
|
||||
test("should listen to the menu", function () {
|
||||
var $input = $('<input />')
|
||||
, $menu = $input.typeahead().data('typeahead').$menu
|
||||
|
||||
ok($._data($menu[0], 'events').mouseover, 'has a mouseover(pseudo: mouseenter)')
|
||||
ok($._data($menu[0], 'events').click, 'has a click')
|
||||
})
|
||||
|
||||
test("should show menu when query entered", function () {
|
||||
var $input = $('<input />')
|
||||
.appendTo('body')
|
||||
.typeahead({
|
||||
source: ['aa', 'ab', 'ac']
|
||||
})
|
||||
, typeahead = $input.data('typeahead')
|
||||
|
||||
$input.val('a')
|
||||
typeahead.lookup()
|
||||
|
||||
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
||||
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
|
||||
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
||||
|
||||
$input.remove()
|
||||
typeahead.$menu.remove()
|
||||
})
|
||||
|
||||
test("should accept data source via synchronous function", function () {
|
||||
var $input = $('<input />').typeahead({
|
||||
source: function () {
|
||||
return ['aa', 'ab', 'ac']
|
||||
}
|
||||
}).appendTo('body')
|
||||
, typeahead = $input.data('typeahead')
|
||||
|
||||
$input.val('a')
|
||||
typeahead.lookup()
|
||||
|
||||
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
||||
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
|
||||
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
||||
|
||||
$input.remove()
|
||||
typeahead.$menu.remove()
|
||||
})
|
||||
|
||||
test("should accept data source via asynchronous function", function () {
|
||||
var $input = $('<input />').typeahead({
|
||||
source: function (query, process) {
|
||||
process(['aa', 'ab', 'ac'])
|
||||
}
|
||||
}).appendTo('body')
|
||||
, typeahead = $input.data('typeahead')
|
||||
|
||||
$input.val('a')
|
||||
typeahead.lookup()
|
||||
|
||||
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
||||
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
|
||||
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
||||
|
||||
$input.remove()
|
||||
typeahead.$menu.remove()
|
||||
})
|
||||
|
||||
test("should not explode when regex chars are entered", function () {
|
||||
var $input = $('<input />').typeahead({
|
||||
source: ['aa', 'ab', 'ac', 'mdo*', 'fat+']
|
||||
}).appendTo('body')
|
||||
, typeahead = $input.data('typeahead')
|
||||
|
||||
$input.val('+')
|
||||
typeahead.lookup()
|
||||
|
||||
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
||||
equals(typeahead.$menu.find('li').length, 1, 'has 1 item in menu')
|
||||
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
||||
|
||||
$input.remove()
|
||||
typeahead.$menu.remove()
|
||||
})
|
||||
|
||||
test("should hide menu when query entered", function () {
|
||||
stop()
|
||||
var $input = $('<input />').typeahead({
|
||||
source: ['aa', 'ab', 'ac']
|
||||
}).appendTo('body')
|
||||
, typeahead = $input.data('typeahead')
|
||||
|
||||
$input.val('a')
|
||||
typeahead.lookup()
|
||||
|
||||
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
||||
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
|
||||
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
||||
|
||||
$input.blur()
|
||||
|
||||
setTimeout(function () {
|
||||
ok(!typeahead.$menu.is(":visible"), "typeahead is no longer visible")
|
||||
start()
|
||||
}, 200)
|
||||
|
||||
$input.remove()
|
||||
typeahead.$menu.remove()
|
||||
})
|
||||
|
||||
test("should set next item when down arrow is pressed", function () {
|
||||
var $input = $('<input />').typeahead({
|
||||
source: ['aa', 'ab', 'ac']
|
||||
}).appendTo('body')
|
||||
, typeahead = $input.data('typeahead')
|
||||
|
||||
$input.val('a')
|
||||
typeahead.lookup()
|
||||
|
||||
ok(typeahead.$menu.is(":visible"), 'typeahead is visible')
|
||||
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
|
||||
equals(typeahead.$menu.find('.active').length, 1, 'one item is active')
|
||||
ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
|
||||
|
||||
// simulate entire key pressing event
|
||||
$input.trigger({
|
||||
type: 'keydown'
|
||||
, keyCode: 40
|
||||
})
|
||||
.trigger({
|
||||
type: 'keypress'
|
||||
, keyCode: 40
|
||||
})
|
||||
.trigger({
|
||||
type: 'keyup'
|
||||
, keyCode: 40
|
||||
})
|
||||
|
||||
ok(typeahead.$menu.find('li').first().next().hasClass('active'), "second item is active")
|
||||
|
||||
$input.trigger({
|
||||
type: 'keydown'
|
||||
, keyCode: 38
|
||||
})
|
||||
.trigger({
|
||||
type: 'keypress'
|
||||
, keyCode: 38
|
||||
})
|
||||
.trigger({
|
||||
type: 'keyup'
|
||||
, keyCode: 38
|
||||
})
|
||||
|
||||
ok(typeahead.$menu.find('li').first().hasClass('active'), "first item is active")
|
||||
|
||||
$input.remove()
|
||||
typeahead.$menu.remove()
|
||||
})
|
||||
|
||||
|
||||
test("should set input value to selected item", function () {
|
||||
var $input = $('<input />').typeahead({
|
||||
source: ['aa', 'ab', 'ac']
|
||||
}).appendTo('body')
|
||||
, typeahead = $input.data('typeahead')
|
||||
, changed = false
|
||||
, focus = false
|
||||
, blur = false
|
||||
|
||||
$input.val('a')
|
||||
typeahead.lookup()
|
||||
|
||||
$input.change(function() { changed = true });
|
||||
$input.focus(function() { focus = true; blur = false });
|
||||
$input.blur(function() { blur = true; focus = false });
|
||||
|
||||
$(typeahead.$menu.find('li')[2]).mouseover().click()
|
||||
|
||||
equals($input.val(), 'ac', 'input value was correctly set')
|
||||
ok(!typeahead.$menu.is(':visible'), 'the menu was hidden')
|
||||
ok(changed, 'a change event was fired')
|
||||
ok(focus && !blur, 'focus is still set')
|
||||
|
||||
$input.remove()
|
||||
typeahead.$menu.remove()
|
||||
})
|
||||
|
||||
test("should start querying when minLength is met", function () {
|
||||
var $input = $('<input />').typeahead({
|
||||
source: ['aaaa', 'aaab', 'aaac'],
|
||||
minLength: 3
|
||||
}).appendTo('body')
|
||||
, typeahead = $input.data('typeahead')
|
||||
|
||||
$input.val('aa')
|
||||
typeahead.lookup()
|
||||
|
||||
equals(typeahead.$menu.find('li').length, 0, 'has 0 items in menu')
|
||||
|
||||
$input.val('aaa')
|
||||
typeahead.lookup()
|
||||
|
||||
equals(typeahead.$menu.find('li').length, 3, 'has 3 items in menu')
|
||||
|
||||
$input.remove()
|
||||
typeahead.$menu.remove()
|
||||
})
|
||||
})
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-buttons")
|
||||
module("button")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var button = $.fn.button.noConflict()
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-carousel")
|
||||
module("carousel")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var carousel = $.fn.carousel.noConflict()
|
||||
@@ -20,12 +20,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
stop()
|
||||
$('<div class="carousel"/>')
|
||||
.bind('slide', function (e) {
|
||||
.on('slide.bs.carousel', function (e) {
|
||||
e.preventDefault();
|
||||
ok(true);
|
||||
start();
|
||||
})
|
||||
.bind('slid', function () {
|
||||
.on('slid.bs.carousel', function () {
|
||||
ok(false);
|
||||
})
|
||||
.carousel('next')
|
||||
@@ -35,7 +35,7 @@ $(function () {
|
||||
var template = '<div id="myCarousel" class="carousel slide"><div class="carousel-inner"><div class="item active"><img alt=""><div class="carousel-caption"><h4>{{_i}}First Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Second Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div><div class="item"><img alt=""><div class="carousel-caption"><h4>{{_i}}Third Thumbnail label{{/i}}</h4><p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p></div></div></div><a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a><a class="right carousel-control" href="#myCarousel" data-slide="next">›</a></div>'
|
||||
$.support.transition = false
|
||||
stop()
|
||||
$(template).on('slide', function (e) {
|
||||
$(template).on('slide.bs.carousel', function (e) {
|
||||
e.preventDefault()
|
||||
ok(e.direction)
|
||||
ok(e.direction === 'right' || e.direction === 'left')
|
||||
@@ -48,7 +48,7 @@ $(function () {
|
||||
$.support.transition = false
|
||||
stop()
|
||||
$(template)
|
||||
.on('slide', function (e) {
|
||||
.on('slide.bs.carousel', function (e) {
|
||||
e.preventDefault();
|
||||
ok(e.relatedTarget);
|
||||
ok($(e.relatedTarget).hasClass('item'));
|
||||
@@ -63,19 +63,19 @@ $(function () {
|
||||
|
||||
template.appendTo("body");
|
||||
$('[data-slide]').first().click();
|
||||
ok($('#myCarousel').data('carousel').options.interval == 1814);
|
||||
ok($('#myCarousel').data('bs.carousel').options.interval == 1814);
|
||||
$('#myCarousel').remove();
|
||||
|
||||
template.appendTo("body").attr("data-modal", "foobar");
|
||||
$('[data-slide]').first().click();
|
||||
ok($('#myCarousel').data('carousel').options.interval == 1814, "even if there is an data-modal attribute set");
|
||||
ok($('#myCarousel').data('bs.carousel').options.interval == 1814, "even if there is an data-modal attribute set");
|
||||
$('#myCarousel').remove();
|
||||
|
||||
template.appendTo("body");
|
||||
$('[data-slide]').first().click();
|
||||
$('#myCarousel').attr('data-interval', 1860);
|
||||
$('[data-slide]').first().click();
|
||||
ok($('#myCarousel').data('carousel').options.interval == 1814, "attributes should be read only on intitialization");
|
||||
ok($('#myCarousel').data('bs.carousel').options.interval == 1814, "attributes should be read only on intitialization");
|
||||
$('#myCarousel').remove();
|
||||
})
|
||||
})
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-collapse")
|
||||
module("collapse")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var collapse = $.fn.collapse.noConflict()
|
||||
@@ -32,12 +32,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
stop()
|
||||
$('<div class="collapse"/>')
|
||||
.bind('show', function (e) {
|
||||
.on('show.bs.collapse', function (e) {
|
||||
e.preventDefault();
|
||||
ok(true);
|
||||
start();
|
||||
})
|
||||
.bind('shown', function () {
|
||||
.on('shown.bs.collapse', function () {
|
||||
ok(false);
|
||||
})
|
||||
.collapse('show')
|
||||
@@ -47,10 +47,10 @@ $(function () {
|
||||
$.support.transition = false
|
||||
stop()
|
||||
$('<div class="collapse" style="height: 0px"/>')
|
||||
.bind('show', function () {
|
||||
.on('show.bs.collapse', function () {
|
||||
ok(this.style.height == '0px')
|
||||
})
|
||||
.bind('shown', function () {
|
||||
.on('shown.bs.collapse', function () {
|
||||
ok(this.style.height == 'auto')
|
||||
start()
|
||||
})
|
||||
@@ -66,7 +66,7 @@ $(function () {
|
||||
|
||||
var collapsible = $('<div id="test1"></div>')
|
||||
.appendTo($('#qunit-fixture'))
|
||||
.on('show', function () {
|
||||
.on('show.bs.collapse', function () {
|
||||
ok(!target.hasClass('collapsed'))
|
||||
start()
|
||||
})
|
||||
@@ -83,7 +83,7 @@ $(function () {
|
||||
|
||||
var collapsible = $('<div id="test1" class="in"></div>')
|
||||
.appendTo($('#qunit-fixture'))
|
||||
.on('hide', function () {
|
||||
.on('hide.bs.collapse', function () {
|
||||
ok(target.hasClass('collapsed'))
|
||||
start()
|
||||
})
|
||||
@@ -115,7 +115,7 @@ $(function () {
|
||||
|
||||
var collapsible3 = $('<div id="body3"></div>')
|
||||
.appendTo(accordion.find('.accordion-group').eq(2))
|
||||
.on('show', function () {
|
||||
.on('show.bs.collapse', function () {
|
||||
ok(target1.hasClass('collapsed'))
|
||||
ok(target2.hasClass('collapsed'))
|
||||
ok(!target3.hasClass('collapsed'))
|
||||
@@ -126,4 +126,4 @@ $(function () {
|
||||
target3.click()
|
||||
})
|
||||
|
||||
})
|
||||
})
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-dropdowns")
|
||||
module("dropdowns")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var dropdown = $.fn.dropdown.noConflict()
|
||||
@@ -103,6 +103,7 @@ $(function () {
|
||||
.find('[data-toggle="dropdown"]')
|
||||
.dropdown()
|
||||
.click()
|
||||
|
||||
ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
|
||||
$('body').click()
|
||||
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class removed')
|
||||
@@ -148,4 +149,71 @@ $(function () {
|
||||
$("#qunit-fixture").html("")
|
||||
})
|
||||
|
||||
test("should fire show and hide event", function () {
|
||||
var dropdownHTML = '<ul class="tabs">'
|
||||
+ '<li class="dropdown">'
|
||||
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
|
||||
+ '<ul class="dropdown-menu">'
|
||||
+ '<li><a href="#">Secondary link</a></li>'
|
||||
+ '<li><a href="#">Something else here</a></li>'
|
||||
+ '<li class="divider"></li>'
|
||||
+ '<li><a href="#">Another link</a></li>'
|
||||
+ '</ul>'
|
||||
+ '</li>'
|
||||
+ '</ul>'
|
||||
, dropdown = $(dropdownHTML)
|
||||
.appendTo('#qunit-fixture')
|
||||
.find('[data-toggle="dropdown"]')
|
||||
.dropdown()
|
||||
|
||||
stop()
|
||||
|
||||
dropdown
|
||||
.parent('.dropdown')
|
||||
.bind('show.bs.dropdown', function () {
|
||||
ok(true, 'show was called')
|
||||
})
|
||||
.bind('hide.bs.dropdown', function () {
|
||||
ok(true, 'hide was called')
|
||||
start()
|
||||
})
|
||||
|
||||
dropdown.click()
|
||||
$(document.body).click()
|
||||
})
|
||||
|
||||
|
||||
test("should fire shown and hiden event", function () {
|
||||
var dropdownHTML = '<ul class="tabs">'
|
||||
+ '<li class="dropdown">'
|
||||
+ '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
|
||||
+ '<ul class="dropdown-menu">'
|
||||
+ '<li><a href="#">Secondary link</a></li>'
|
||||
+ '<li><a href="#">Something else here</a></li>'
|
||||
+ '<li class="divider"></li>'
|
||||
+ '<li><a href="#">Another link</a></li>'
|
||||
+ '</ul>'
|
||||
+ '</li>'
|
||||
+ '</ul>'
|
||||
, dropdown = $(dropdownHTML)
|
||||
.appendTo('#qunit-fixture')
|
||||
.find('[data-toggle="dropdown"]')
|
||||
.dropdown()
|
||||
|
||||
stop()
|
||||
|
||||
dropdown
|
||||
.parent('.dropdown')
|
||||
.bind('shown.bs.dropdown', function () {
|
||||
ok(true, 'show was called')
|
||||
})
|
||||
.bind('hidden.bs.dropdown', function () {
|
||||
ok(true, 'hide was called')
|
||||
start()
|
||||
})
|
||||
|
||||
dropdown.click()
|
||||
$(document.body).click()
|
||||
})
|
||||
|
||||
})
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-modal")
|
||||
module("modal")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var modal = $.fn.modal.noConflict()
|
||||
@@ -20,15 +20,15 @@ $(function () {
|
||||
})
|
||||
|
||||
test("should expose defaults var for settings", function () {
|
||||
ok($.fn.modal.defaults, 'default object exposed')
|
||||
ok($.fn.modal.Constructor.DEFAULTS, 'default object exposed')
|
||||
})
|
||||
|
||||
test("should insert into dom when show method is called", function () {
|
||||
stop()
|
||||
$.support.transition = false
|
||||
$("<div id='modal-test'></div>")
|
||||
.bind("shown", function () {
|
||||
ok($('#modal-test').length, 'modal insterted into dom')
|
||||
.on("shown.bs.modal", function () {
|
||||
ok($('#modal-test').length, 'modal inserted into dom')
|
||||
$(this).remove()
|
||||
start()
|
||||
})
|
||||
@@ -39,10 +39,10 @@ $(function () {
|
||||
stop()
|
||||
$.support.transition = false
|
||||
$("<div id='modal-test'></div>")
|
||||
.bind("show", function () {
|
||||
.on("show.bs.modal", function () {
|
||||
ok(true, "show was called")
|
||||
})
|
||||
.bind("shown", function () {
|
||||
.on("shown.bs.modal", function () {
|
||||
$(this).remove()
|
||||
start()
|
||||
})
|
||||
@@ -53,12 +53,12 @@ $(function () {
|
||||
stop()
|
||||
$.support.transition = false
|
||||
$("<div id='modal-test'></div>")
|
||||
.bind("show", function (e) {
|
||||
.on("show.bs.modal", function (e) {
|
||||
e.preventDefault()
|
||||
ok(true, "show was called")
|
||||
start()
|
||||
})
|
||||
.bind("shown", function () {
|
||||
.on("shown.bs.modal", function () {
|
||||
ok(false, "shown was called")
|
||||
})
|
||||
.modal("show")
|
||||
@@ -69,12 +69,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
|
||||
$("<div id='modal-test'></div>")
|
||||
.bind("shown", function () {
|
||||
.on("shown.bs.modal", function () {
|
||||
ok($('#modal-test').is(":visible"), 'modal visible')
|
||||
ok($('#modal-test').length, 'modal insterted into dom')
|
||||
ok($('#modal-test').length, 'modal inserted into dom')
|
||||
$(this).modal("hide")
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.on("hidden.bs.modal", function() {
|
||||
ok(!$('#modal-test').is(":visible"), 'modal hidden')
|
||||
$('#modal-test').remove()
|
||||
start()
|
||||
@@ -87,12 +87,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
var div = $("<div id='modal-test'></div>")
|
||||
div
|
||||
.bind("shown", function () {
|
||||
.on("shown.bs.modal", function () {
|
||||
ok($('#modal-test').is(":visible"), 'modal visible')
|
||||
ok($('#modal-test').length, 'modal insterted into dom')
|
||||
ok($('#modal-test').length, 'modal inserted into dom')
|
||||
div.modal("toggle")
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.on("hidden.bs.modal", function() {
|
||||
ok(!$('#modal-test').is(":visible"), 'modal hidden')
|
||||
div.remove()
|
||||
start()
|
||||
@@ -105,12 +105,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
var div = $("<div id='modal-test'><span class='close' data-dismiss='modal'></span></div>")
|
||||
div
|
||||
.bind("shown", function () {
|
||||
.on("shown.bs.modal", function () {
|
||||
ok($('#modal-test').is(":visible"), 'modal visible')
|
||||
ok($('#modal-test').length, 'modal insterted into dom')
|
||||
ok($('#modal-test').length, 'modal inserted into dom')
|
||||
div.find('.close').click()
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.on("hidden.bs.modal", function() {
|
||||
ok(!$('#modal-test').is(":visible"), 'modal hidden')
|
||||
div.remove()
|
||||
start()
|
||||
@@ -123,11 +123,11 @@ $(function () {
|
||||
$.support.transition = false
|
||||
var div = $("<div>", { id: 'modal-test', "data-backdrop": false })
|
||||
div
|
||||
.bind("shown", function () {
|
||||
.on("shown.bs.modal", function () {
|
||||
ok($('#modal-test').is(":visible"), 'modal visible')
|
||||
div.modal("hide")
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.on("hidden.bs.modal", function() {
|
||||
ok(!$('#modal-test').is(":visible"), 'modal hidden')
|
||||
div.remove()
|
||||
start()
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-popover")
|
||||
module("popover")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var popover = $.fn.popover.noConflict()
|
||||
@@ -34,7 +34,7 @@ $(function () {
|
||||
var popover = $('<a href="#" title="mdo" data-content="http://twitter.com/mdo">@mdo</a>')
|
||||
.popover()
|
||||
|
||||
ok(!!popover.data('popover'), 'popover instance exists')
|
||||
ok(!!popover.data('bs.popover'), 'popover instance exists')
|
||||
})
|
||||
|
||||
test("should get title and content from options", function () {
|
||||
@@ -99,7 +99,7 @@ $(function () {
|
||||
|
||||
test("should destroy popover", function () {
|
||||
var popover = $('<div/>').popover({trigger: 'hover'}).on('click.foo', function(){})
|
||||
ok(popover.data('popover'), 'popover has data')
|
||||
ok(popover.data('bs.popover'), 'popover has data')
|
||||
ok($._data(popover[0], 'events').mouseover && $._data(popover[0], 'events').mouseout, 'popover has hover event')
|
||||
ok($._data(popover[0], 'events').click[0].namespace == 'foo', 'popover has extra click.foo event')
|
||||
popover.popover('show')
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-scrollspy")
|
||||
module("scrollspy")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var scrollspy = $.fn.scrollspy.noConflict()
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-tabs")
|
||||
module("tabs")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var tab = $.fn.tab.noConflict()
|
||||
@@ -53,12 +53,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
stop();
|
||||
$('<div class="tab"/>')
|
||||
.bind('show', function (e) {
|
||||
.on('show.bs.tab', function (e) {
|
||||
e.preventDefault();
|
||||
ok(true);
|
||||
start();
|
||||
})
|
||||
.bind('shown', function () {
|
||||
.on('shown.bs.tab', function () {
|
||||
ok(false);
|
||||
})
|
||||
.tab('show')
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-tooltip")
|
||||
module("tooltip")
|
||||
|
||||
test("should provide no conflict", function () {
|
||||
var tooltip = $.fn.tooltip.noConflict()
|
||||
@@ -19,7 +19,7 @@ $(function () {
|
||||
})
|
||||
|
||||
test("should expose default settings", function () {
|
||||
ok(!!$.fn.tooltip.defaults, 'defaults is defined')
|
||||
ok(!!$.fn.tooltip.Constructor.DEFAULTS, 'defaults is defined')
|
||||
})
|
||||
|
||||
test("should empty title attribute", function () {
|
||||
@@ -69,7 +69,7 @@ $(function () {
|
||||
test("should fire show event", function () {
|
||||
stop()
|
||||
var tooltip = $('<div title="tooltip title"></div>')
|
||||
.bind("show", function() {
|
||||
.on("show.bs.tooltip", function() {
|
||||
ok(true, "show was called")
|
||||
start()
|
||||
})
|
||||
@@ -79,7 +79,7 @@ $(function () {
|
||||
test("should fire shown event", function () {
|
||||
stop()
|
||||
var tooltip = $('<div title="tooltip title"></div>')
|
||||
.bind("shown", function() {
|
||||
.on("shown.bs.tooltip", function() {
|
||||
ok(true, "shown was called")
|
||||
start()
|
||||
})
|
||||
@@ -89,12 +89,12 @@ $(function () {
|
||||
test("should not fire shown event when default prevented", function () {
|
||||
stop()
|
||||
var tooltip = $('<div title="tooltip title"></div>')
|
||||
.bind("show", function(e) {
|
||||
.on("show.bs.tooltip", function(e) {
|
||||
e.preventDefault()
|
||||
ok(true, "show was called")
|
||||
start()
|
||||
})
|
||||
.bind("shown", function() {
|
||||
.on("shown.bs.tooltip", function() {
|
||||
ok(false, "shown was called")
|
||||
})
|
||||
.tooltip('show')
|
||||
@@ -103,10 +103,10 @@ $(function () {
|
||||
test("should fire hide event", function () {
|
||||
stop()
|
||||
var tooltip = $('<div title="tooltip title"></div>')
|
||||
.bind("shown", function() {
|
||||
.on("shown.bs.tooltip", function() {
|
||||
$(this).tooltip('hide')
|
||||
})
|
||||
.bind("hide", function() {
|
||||
.on("hide.bs.tooltip", function() {
|
||||
ok(true, "hide was called")
|
||||
start()
|
||||
})
|
||||
@@ -116,10 +116,10 @@ $(function () {
|
||||
test("should fire hidden event", function () {
|
||||
stop()
|
||||
var tooltip = $('<div title="tooltip title"></div>')
|
||||
.bind("shown", function() {
|
||||
.on("shown.bs.tooltip", function() {
|
||||
$(this).tooltip('hide')
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.on("hidden.bs.tooltip", function() {
|
||||
ok(true, "hidden was called")
|
||||
start()
|
||||
})
|
||||
@@ -129,15 +129,15 @@ $(function () {
|
||||
test("should not fire hidden event when default prevented", function () {
|
||||
stop()
|
||||
var tooltip = $('<div title="tooltip title"></div>')
|
||||
.bind("shown", function() {
|
||||
.on("shown.bs.tooltip", function() {
|
||||
$(this).tooltip('hide')
|
||||
})
|
||||
.bind("hide", function(e) {
|
||||
.on("hide.bs.tooltip", function(e) {
|
||||
e.preventDefault()
|
||||
ok(true, "hide was called")
|
||||
start()
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.on("hidden.bs.tooltip", function() {
|
||||
ok(false, "hidden was called")
|
||||
})
|
||||
.tooltip('show')
|
||||
@@ -214,13 +214,13 @@ $(function () {
|
||||
|
||||
test("should destroy tooltip", function () {
|
||||
var tooltip = $('<div/>').tooltip().on('click.foo', function(){})
|
||||
ok(tooltip.data('tooltip'), 'tooltip has data')
|
||||
ok(tooltip.data('bs.tooltip'), 'tooltip has data')
|
||||
ok($._data(tooltip[0], 'events').mouseover && $._data(tooltip[0], 'events').mouseout, 'tooltip has hover event')
|
||||
ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip has extra click.foo event')
|
||||
tooltip.tooltip('show')
|
||||
tooltip.tooltip('destroy')
|
||||
ok(!tooltip.hasClass('in'), 'tooltip is hidden')
|
||||
ok(!$._data(tooltip[0], 'tooltip'), 'tooltip does not have data')
|
||||
ok(!$._data(tooltip[0], 'bs.tooltip'), 'tooltip does not have data')
|
||||
ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip still has click.foo')
|
||||
ok(!$._data(tooltip[0], 'events').mouseover && !$._data(tooltip[0], 'events').mouseout, 'tooltip does not have any events')
|
||||
})
|
@@ -1,6 +1,6 @@
|
||||
$(function () {
|
||||
|
||||
module("bootstrap-transition")
|
||||
module("transition")
|
||||
|
||||
test("should be defined on jquery support object", function () {
|
||||
ok($.support.transition !== undefined, 'transition object is defined')
|
353
js/tooltip.js
Normal file
353
js/tooltip.js
Normal file
@@ -0,0 +1,353 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: tooltip.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#affix
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ========================================================================
|
||||
* Copyright 2012 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// TOOLTIP PUBLIC CLASS DEFINITION
|
||||
// ===============================
|
||||
|
||||
var Tooltip = function (element, options) {
|
||||
this.type =
|
||||
this.options =
|
||||
this.enabled =
|
||||
this.timeout =
|
||||
this.hoverState =
|
||||
this.$element = null
|
||||
|
||||
this.init('tooltip', element, options)
|
||||
}
|
||||
|
||||
Tooltip.DEFAULTS = {
|
||||
animation: true
|
||||
, placement: 'top'
|
||||
, selector: false
|
||||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||
, trigger: 'hover focus'
|
||||
, title: ''
|
||||
, delay: 0
|
||||
, html: false
|
||||
, container: false
|
||||
}
|
||||
|
||||
Tooltip.prototype.init = function (type, element, options) {
|
||||
this.enabled = true
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
|
||||
var triggers = this.options.trigger.split(' ')
|
||||
|
||||
for (var i = triggers.length; i--;) {
|
||||
var trigger = triggers[i]
|
||||
|
||||
if (trigger == 'click') {
|
||||
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||
} else if (trigger != 'manual') {
|
||||
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||
var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||
|
||||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||
}
|
||||
}
|
||||
|
||||
this.options.selector ?
|
||||
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||
this.fixTitle()
|
||||
}
|
||||
|
||||
Tooltip.prototype.getDefaults = function () {
|
||||
return Tooltip.DEFAULTS
|
||||
}
|
||||
|
||||
Tooltip.prototype.getOptions = function (options) {
|
||||
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
||||
|
||||
if (options.delay && typeof options.delay == 'number') {
|
||||
options.delay = {
|
||||
show: options.delay
|
||||
, hide: options.delay
|
||||
}
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
Tooltip.prototype.enter = function (e) {
|
||||
var defaults = this.getDefaults()
|
||||
var options = {}
|
||||
|
||||
this._options && $.each(this._options, function (key, value) {
|
||||
if (defaults[key] != value) options[key] = value
|
||||
})
|
||||
|
||||
var self = $(e.currentTarget)[this.type](options).data('bs.' + this.type)
|
||||
|
||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||
|
||||
clearTimeout(this.timeout)
|
||||
|
||||
self.hoverState = 'in'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'in') self.show()
|
||||
}, self.options.delay.show)
|
||||
}
|
||||
|
||||
Tooltip.prototype.leave = function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data('bs.' + this.type)
|
||||
|
||||
if (this.timeout) clearTimeout(this.timeout)
|
||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||
|
||||
self.hoverState = 'out'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'out') self.hide()
|
||||
}, self.options.delay.hide)
|
||||
}
|
||||
|
||||
Tooltip.prototype.show = function () {
|
||||
var e = $.Event('show.bs.'+ this.type)
|
||||
|
||||
if (this.hasContent() && this.enabled) {
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
var $tip = this.tip()
|
||||
|
||||
this.setContent()
|
||||
|
||||
if (this.options.animation) $tip.addClass('fade')
|
||||
|
||||
var placement = typeof this.options.placement == 'function' ?
|
||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||
this.options.placement
|
||||
|
||||
$tip
|
||||
.detach()
|
||||
.css({ top: 0, left: 0, display: 'block' })
|
||||
|
||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||
|
||||
var tp
|
||||
var pos = this.getPosition()
|
||||
var actualWidth = $tip[0].offsetWidth
|
||||
var actualHeight = $tip[0].offsetHeight
|
||||
|
||||
switch (placement) {
|
||||
case 'bottom':
|
||||
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'top':
|
||||
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'left':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
|
||||
break
|
||||
case 'right':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
|
||||
break
|
||||
}
|
||||
|
||||
this.applyPlacement(tp, placement)
|
||||
this.$element.trigger('shown.bs.' + this.type)
|
||||
}
|
||||
}
|
||||
|
||||
Tooltip.prototype.applyPlacement = function(offset, placement) {
|
||||
var replace
|
||||
var $tip = this.tip()
|
||||
var width = $tip[0].offsetWidth
|
||||
var height = $tip[0].offsetHeight
|
||||
|
||||
$tip
|
||||
.offset(offset)
|
||||
.addClass(placement)
|
||||
.addClass('in')
|
||||
|
||||
var actualWidth = $tip[0].offsetWidth
|
||||
var actualHeight = $tip[0].offsetHeight
|
||||
|
||||
if (placement == 'top' && actualHeight != height) {
|
||||
replace = true
|
||||
offset.top = offset.top + height - actualHeight
|
||||
}
|
||||
|
||||
if (placement == 'bottom' || placement == 'top') {
|
||||
var delta = 0
|
||||
|
||||
if (offset.left < 0){
|
||||
delta = offset.left * -2
|
||||
offset.left = 0
|
||||
|
||||
$tip.offset(offset)
|
||||
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
}
|
||||
|
||||
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||
} else {
|
||||
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||
}
|
||||
|
||||
if (replace) $tip.offset(offset)
|
||||
}
|
||||
|
||||
Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
|
||||
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
|
||||
}
|
||||
|
||||
Tooltip.prototype.setContent = function () {
|
||||
var $tip = this.tip()
|
||||
var title = this.getTitle()
|
||||
|
||||
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.removeClass('fade in top bottom left right')
|
||||
}
|
||||
|
||||
Tooltip.prototype.hide = function () {
|
||||
var that = this
|
||||
var $tip = this.tip()
|
||||
var e = $.Event('hide.bs.' + this.type)
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$tip.removeClass('in')
|
||||
|
||||
function removeWithAnimation() {
|
||||
var timeout = setTimeout(function () {
|
||||
$tip.off($.support.transition.end).detach()
|
||||
}, 500)
|
||||
|
||||
$tip.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
$tip.detach()
|
||||
})
|
||||
}
|
||||
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
removeWithAnimation() :
|
||||
$tip.detach()
|
||||
|
||||
this.$element.trigger('hidden.bs.' + this.type)
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
Tooltip.prototype.fixTitle = function () {
|
||||
var $e = this.$element
|
||||
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
||||
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
||||
}
|
||||
}
|
||||
|
||||
Tooltip.prototype.hasContent = function () {
|
||||
return this.getTitle()
|
||||
}
|
||||
|
||||
Tooltip.prototype.getPosition = function () {
|
||||
var el = this.$element[0]
|
||||
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||
width: el.offsetWidth
|
||||
, height: el.offsetHeight
|
||||
}, this.$element.offset())
|
||||
}
|
||||
|
||||
Tooltip.prototype.getTitle = function () {
|
||||
var title
|
||||
var $e = this.$element
|
||||
var o = this.options
|
||||
|
||||
title = $e.attr('data-original-title')
|
||||
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||
|
||||
return title
|
||||
}
|
||||
|
||||
Tooltip.prototype.tip = function () {
|
||||
return this.$tip = this.$tip || $(this.options.template)
|
||||
}
|
||||
|
||||
Tooltip.prototype.arrow =function(){
|
||||
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
|
||||
}
|
||||
|
||||
Tooltip.prototype.validate = function () {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide()
|
||||
this.$element = null
|
||||
this.options = null
|
||||
}
|
||||
}
|
||||
|
||||
Tooltip.prototype.enable = function () {
|
||||
this.enabled = true
|
||||
}
|
||||
|
||||
Tooltip.prototype.disable = function () {
|
||||
this.enabled = false
|
||||
}
|
||||
|
||||
Tooltip.prototype.toggleEnabled = function () {
|
||||
this.enabled = !this.enabled
|
||||
}
|
||||
|
||||
Tooltip.prototype.toggle = function (e) {
|
||||
var self = e ? $(e.currentTarget)[this.type](this._options).data('bs.' + this.type) : this
|
||||
self.tip().hasClass('in') ? self.hide() : self.show()
|
||||
}
|
||||
|
||||
Tooltip.prototype.destroy = function () {
|
||||
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
||||
}
|
||||
|
||||
|
||||
// TOOLTIP PLUGIN DEFINITION
|
||||
// =========================
|
||||
|
||||
var old = $.fn.tooltip
|
||||
|
||||
$.fn.tooltip = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.tooltip')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tooltip.Constructor = Tooltip
|
||||
|
||||
|
||||
// TOOLTIP NO CONFLICT
|
||||
// ===================
|
||||
|
||||
$.fn.tooltip.noConflict = function () {
|
||||
$.fn.tooltip = old
|
||||
return this
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
47
js/transition.js
Normal file
47
js/transition.js
Normal file
@@ -0,0 +1,47 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: transition.js v3.0.0
|
||||
* http://twitter.github.com/bootstrap/javascript.html#transitions
|
||||
* ========================================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) { "use strict";
|
||||
|
||||
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
||||
// ============================================================
|
||||
|
||||
function transitionEnd() {
|
||||
var el = document.createElement('bootstrap')
|
||||
|
||||
var transEndEventNames = {
|
||||
'WebkitTransition' : 'webkitTransitionEnd'
|
||||
, 'MozTransition' : 'transitionend'
|
||||
, 'OTransition' : 'oTransitionEnd otransitionend'
|
||||
, 'transition' : 'transitionend'
|
||||
}
|
||||
|
||||
for (var name in transEndEventNames) {
|
||||
if (el.style[name] !== undefined) {
|
||||
return { end: transEndEventNames[name] }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$.support.transition = transitionEnd()
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
@@ -5,7 +5,7 @@
|
||||
|
||||
// Parent container
|
||||
.accordion {
|
||||
margin-bottom: @line-height-base;
|
||||
margin-bottom: @line-height-computed;
|
||||
}
|
||||
|
||||
// Group == heading + body
|
||||
|
@@ -7,8 +7,8 @@
|
||||
// -------------------------
|
||||
|
||||
.alert {
|
||||
padding: 8px 35px 8px 14px;
|
||||
margin-bottom: @line-height-base;
|
||||
padding: 10px 35px 10px 15px;
|
||||
margin-bottom: @line-height-computed;
|
||||
color: @alert-text;
|
||||
background-color: @alert-bg;
|
||||
border: 1px solid @alert-border;
|
||||
@@ -24,9 +24,8 @@
|
||||
hr {
|
||||
border-top-color: darken(@alert-border, 5%);
|
||||
}
|
||||
// Inherit color for immediate links and bolden them some
|
||||
> a,
|
||||
> p > a {
|
||||
// Provide class for links that match alerts
|
||||
.alert-link {
|
||||
font-weight: 500;
|
||||
color: darken(@alert-text, 10%);
|
||||
}
|
||||
@@ -50,8 +49,7 @@
|
||||
hr {
|
||||
border-top-color: darken(@alert-success-border, 5%);
|
||||
}
|
||||
> a,
|
||||
> p > a {
|
||||
.alert-link {
|
||||
color: darken(@alert-success-text, 10%);
|
||||
}
|
||||
}
|
||||
@@ -62,8 +60,7 @@
|
||||
hr {
|
||||
border-top-color: darken(@alert-danger-border, 5%);
|
||||
}
|
||||
> a,
|
||||
> p > a {
|
||||
.alert-link {
|
||||
color: darken(@alert-danger-text, 10%);
|
||||
}
|
||||
}
|
||||
@@ -74,8 +71,7 @@
|
||||
hr {
|
||||
border-top-color: darken(@alert-info-border, 5%);
|
||||
}
|
||||
> a,
|
||||
> p > a {
|
||||
.alert-link {
|
||||
color: darken(@alert-info-text, 10%);
|
||||
}
|
||||
}
|
||||
@@ -84,8 +80,8 @@
|
||||
// -------------------------
|
||||
|
||||
.alert-block {
|
||||
padding-top: 14px;
|
||||
padding-bottom: 14px;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
.alert-block > p,
|
||||
.alert-block > ul {
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
.breadcrumb {
|
||||
padding: 8px 15px;
|
||||
margin: 0 0 @line-height-base;
|
||||
margin: 0 0 @line-height-computed;
|
||||
list-style: none;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: @border-radius-base;
|
||||
|
@@ -4,24 +4,21 @@
|
||||
|
||||
// Button carets
|
||||
.btn .caret {
|
||||
border-top-color: @btn-color;
|
||||
border-top-color: @btn-default-color;
|
||||
}
|
||||
.dropup .btn .caret {
|
||||
border-bottom-color: @btn-color;
|
||||
border-bottom-color: @btn-default-color;
|
||||
}
|
||||
|
||||
// Make the div behave like a button
|
||||
.btn-group {
|
||||
.btn-group,
|
||||
.btn-group-vertical {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: middle; // match .btn alignment given font-size hack above
|
||||
> .btn {
|
||||
position: relative;
|
||||
float: left;
|
||||
// Prevent double borders when buttons are next to each other
|
||||
+ btn {
|
||||
margin-left: -1px;
|
||||
}
|
||||
// Bring the "active" button to the front
|
||||
&:hover,
|
||||
&:active {
|
||||
@@ -30,6 +27,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent double borders when buttons are next to each other
|
||||
.btn-group .btn + .btn {
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
// Optional: Group multiple button groups together for a toolbar
|
||||
.btn-toolbar {
|
||||
.clearfix();
|
||||
@@ -46,46 +48,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Float them, remove border radius, then re-add to first and last elements
|
||||
.btn-group > .btn {
|
||||
position: relative;
|
||||
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
|
||||
// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
|
||||
.btn-group > .btn:first-child {
|
||||
margin-left: 0;
|
||||
.border-left-radius(@border-radius-base);
|
||||
&:not(:last-child):not(.dropdown-toggle) {
|
||||
.border-right-radius(0);
|
||||
}
|
||||
}
|
||||
// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
|
||||
.btn-group > .btn:last-child,
|
||||
.btn-group > .dropdown-toggle {
|
||||
.border-right-radius(@border-radius-base);
|
||||
}
|
||||
// Reset corners for large buttons
|
||||
.btn-group > .btn.large:first-child {
|
||||
margin-left: 0;
|
||||
.border-left-radius(@border-radius-large);
|
||||
}
|
||||
.btn-group > .btn.large:last-child,
|
||||
.btn-group > .large.dropdown-toggle {
|
||||
.border-right-radius(@border-radius-large);
|
||||
.btn-group > .btn:last-child:not(:first-child),
|
||||
.btn-group > .dropdown-toggle:not(:first-child) {
|
||||
.border-left-radius(0);
|
||||
}
|
||||
|
||||
// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)
|
||||
.btn-group > .btn-group {
|
||||
float: left;
|
||||
}
|
||||
.btn-group > .btn-group > .btn {
|
||||
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
|
||||
border-radius: 0;
|
||||
}
|
||||
.btn-group > .btn-group:last-child > .btn {
|
||||
.border-right-radius(@border-radius-base);
|
||||
.btn-group > .btn-group:first-child > .btn:last-child,
|
||||
.btn-group > .btn-group:first-child > .dropdown-toggle {
|
||||
.border-right-radius(0);
|
||||
}
|
||||
.btn-group > .btn-group:first-child > .btn {
|
||||
margin-left: 0;
|
||||
.border-left-radius(@border-radius-base);
|
||||
.btn-group > .btn-group:last-child > .btn:first-child {
|
||||
.border-left-radius(0);
|
||||
}
|
||||
|
||||
// On active and open, don't show outline
|
||||
@@ -122,7 +114,6 @@
|
||||
|
||||
// Reposition the caret
|
||||
.btn .caret {
|
||||
margin-top: 8px;
|
||||
margin-left: 0;
|
||||
}
|
||||
// Carets in other button sizes
|
||||
@@ -143,20 +134,18 @@
|
||||
float: none;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
+ .btn {
|
||||
margin-top: -1px;
|
||||
}
|
||||
}
|
||||
.btn-group-vertical .btn:not(:first-child):not(:last-child) {
|
||||
border-radius: 0;
|
||||
}
|
||||
.btn-group-vertical .btn:first-child {
|
||||
border-radius: 0; // Needs to be here for specificity since we're not zeroing them out again
|
||||
.border-top-radius(@border-radius-base);
|
||||
.border-bottom-radius(0);
|
||||
}
|
||||
.btn-group-vertical .btn:last-child {
|
||||
border-radius: 0; // Needs to be here for specificity since we're not zeroing them out again
|
||||
.border-bottom-radius(@border-radius-base);
|
||||
}
|
||||
.btn-group-vertical .btn-large:first-child {
|
||||
.border-top-radius(@border-radius-large);
|
||||
}
|
||||
.btn-group-vertical .btn-large:last-child {
|
||||
.border-bottom-radius(@border-radius-large);
|
||||
.border-top-radius(0);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// Core styles
|
||||
.btn {
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
padding: @padding-base-vertical @padding-base-horizontal;
|
||||
margin-bottom: 0; // For input.btn
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
@@ -17,7 +17,7 @@
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
border: 1px solid @btn-border;
|
||||
border: 1px solid transparent;
|
||||
border-radius: @border-radius-base;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -50,91 +50,35 @@
|
||||
}
|
||||
|
||||
|
||||
// Button Sizes
|
||||
// -------------------------
|
||||
|
||||
// Large
|
||||
.btn-large {
|
||||
padding: @padding-large;
|
||||
font-size: @font-size-large;
|
||||
border-radius: @border-radius-large;
|
||||
}
|
||||
|
||||
// Small
|
||||
.btn-small {
|
||||
padding: @padding-small;
|
||||
font-size: @font-size-small;
|
||||
border-radius: @border-radius-small;
|
||||
}
|
||||
|
||||
// Mini
|
||||
.btn-mini {
|
||||
padding: @padding-mini;
|
||||
font-size: @font-size-mini;
|
||||
border-radius: @border-radius-small;
|
||||
}
|
||||
|
||||
|
||||
// Icons in buttons
|
||||
// -------------------------
|
||||
|
||||
// TODO: figure this shit out
|
||||
|
||||
// Block button
|
||||
// -------------------------
|
||||
|
||||
.btn-block {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
// Vertically space out multiple block buttons
|
||||
.btn-block + .btn-block {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
// Specificity overrides
|
||||
input[type="submit"],
|
||||
input[type="reset"],
|
||||
input[type="button"] {
|
||||
&.btn-block {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Alternate buttons
|
||||
// --------------------------------------------------
|
||||
|
||||
.btn {
|
||||
color: @btn-color;
|
||||
.btn-pseudo-states(@btn-bg, @btn-border);
|
||||
.btn-default {
|
||||
.btn-pseudo-states(@btn-default-color, @btn-default-bg, @btn-default-border);
|
||||
}
|
||||
.btn-primary {
|
||||
.btn-pseudo-states(@btn-primary-bg, @btn-primary-border);
|
||||
.btn-pseudo-states(@btn-primary-color, @btn-primary-bg, @btn-primary-border);
|
||||
}
|
||||
// Warning appears as orange
|
||||
.btn-warning {
|
||||
.btn-pseudo-states(@btn-warning-bg, @btn-warning-border);
|
||||
.btn-pseudo-states(@btn-warning-color, @btn-warning-bg, @btn-warning-border);
|
||||
}
|
||||
// Danger and error appear as red
|
||||
.btn-danger {
|
||||
.btn-pseudo-states(@btn-danger-bg, @btn-danger-border);
|
||||
.btn-pseudo-states(@btn-danger-color, @btn-danger-bg, @btn-danger-border);
|
||||
}
|
||||
// Success appears as green
|
||||
.btn-success {
|
||||
.btn-pseudo-states(@btn-success-bg, @btn-success-border);
|
||||
.btn-pseudo-states(@btn-success-color, @btn-success-bg, @btn-success-border);
|
||||
}
|
||||
// Info appears as blue-green
|
||||
.btn-info {
|
||||
.btn-pseudo-states(@btn-info-bg, @btn-info-border);
|
||||
.btn-pseudo-states(@btn-info-color, @btn-info-bg, @btn-info-border);
|
||||
}
|
||||
|
||||
|
||||
// Link buttons
|
||||
// --------------------------------------------------
|
||||
// -------------------------
|
||||
|
||||
// Make a button look and behave like a link
|
||||
.btn-link,
|
||||
@@ -173,3 +117,44 @@ fieldset[disabled] .btn-link {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Button Sizes
|
||||
// --------------------------------------------------
|
||||
|
||||
.btn-large {
|
||||
padding: @padding-large-vertical @padding-large-horizontal;
|
||||
font-size: @font-size-large;
|
||||
border-radius: @border-radius-large;
|
||||
}
|
||||
.btn-small {
|
||||
padding: @padding-small-vertical @padding-small-horizontal;
|
||||
font-size: @font-size-small;
|
||||
line-height: 1.5; // ensure proper height of button next to small input
|
||||
border-radius: @border-radius-small;
|
||||
}
|
||||
|
||||
|
||||
// Block button
|
||||
// --------------------------------------------------
|
||||
|
||||
.btn-block {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
// Vertically space out multiple block buttons
|
||||
.btn-block + .btn-block {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
// Specificity overrides
|
||||
input[type="submit"],
|
||||
input[type="reset"],
|
||||
input[type="button"] {
|
||||
&.btn-block {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
@@ -128,7 +128,7 @@
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
left: 50%;
|
||||
z-index: 5;
|
||||
z-index: 15;
|
||||
width: 100px;
|
||||
margin: 0 0 0 -50px;
|
||||
list-style: none;
|
||||
|
@@ -25,8 +25,8 @@ code {
|
||||
// Blocks of code
|
||||
pre {
|
||||
display: block;
|
||||
padding: ((@line-height-base - 1) / 2);
|
||||
margin: 0 0 (@line-height-base / 2);
|
||||
padding: ((@line-height-computed - 1) / 2);
|
||||
margin: 0 0 (@line-height-computed / 2);
|
||||
font-size: (@font-size-base - 1); // 14px to 13px
|
||||
line-height: @line-height-base;
|
||||
word-break: break-all;
|
||||
@@ -40,7 +40,7 @@ pre {
|
||||
|
||||
// Make prettyprint styles more spaced out for readability
|
||||
&.prettyprint {
|
||||
margin-bottom: @line-height-base;
|
||||
margin-bottom: @line-height-computed;
|
||||
}
|
||||
|
||||
// Account for some code outputs that place code tags in pre tags
|
||||
|
@@ -11,22 +11,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
/*.collapse {
|
||||
position: relative;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
.transition(height .35s ease);
|
||||
&.in {
|
||||
height: auto;
|
||||
}
|
||||
}*/
|
||||
|
||||
.collapse {
|
||||
position: relative;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
.transition(height .35s ease);
|
||||
}
|
||||
.collapse.in {
|
||||
height: auto;
|
||||
|
||||
&.in {
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
@@ -3,35 +3,20 @@
|
||||
// --------------------------------------------------
|
||||
|
||||
|
||||
// Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns
|
||||
.dropup,
|
||||
.dropdown {
|
||||
position: relative;
|
||||
}
|
||||
.dropdown-toggle:active,
|
||||
.open .dropdown-toggle {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
// Dropdown arrow/caret
|
||||
// --------------------
|
||||
.caret {
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
vertical-align: top;
|
||||
margin-left: 2px;
|
||||
vertical-align: middle;
|
||||
border-top: 4px solid #000;
|
||||
border-right: 4px solid transparent;
|
||||
border-left: 4px solid transparent;
|
||||
content: "";
|
||||
}
|
||||
|
||||
// Place the caret
|
||||
.dropdown .caret {
|
||||
margin-top: 8px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
// The dropdown menu (ul)
|
||||
// ----------------------
|
||||
.dropdown-menu {
|
||||
@@ -118,9 +103,27 @@
|
||||
// Open state for the dropdown
|
||||
// ---------------------------
|
||||
.open {
|
||||
& > .dropdown-menu {
|
||||
// Show the menu
|
||||
> .dropdown-menu {
|
||||
display: block;
|
||||
}
|
||||
|
||||
// Remove the outline when :focus is triggered
|
||||
> a {
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Backdrop to catch body clicks on mobile, etc.
|
||||
// ---------------------------
|
||||
.dropdown-backdrop {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
z-index: @zindex-dropdown - 10;
|
||||
}
|
||||
|
||||
// Right aligned dropdowns
|
||||
|
270
less/forms.less
270
less/forms.less
@@ -20,9 +20,9 @@ legend {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin-bottom: @line-height-base;
|
||||
margin-bottom: @line-height-computed;
|
||||
font-size: (@font-size-base * 1.5);
|
||||
line-height: (@line-height-base * 2);
|
||||
line-height: inherit;
|
||||
color: @gray-dark;
|
||||
border: 0;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
@@ -54,10 +54,9 @@ input[type="url"],
|
||||
input[type="search"],
|
||||
input[type="tel"],
|
||||
input[type="color"] {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
min-height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
|
||||
padding: 6px 9px;
|
||||
// margin-bottom: (@line-height-base / 2);
|
||||
padding: @padding-base-vertical @padding-base-horizontal;
|
||||
font-size: @font-size-base;
|
||||
line-height: @line-height-base;
|
||||
color: @gray;
|
||||
@@ -66,7 +65,13 @@ input[type="color"] {
|
||||
border: 1px solid @input-border;
|
||||
border-radius: @input-border-radius;
|
||||
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
|
||||
.transition(~"border-color linear .2s, box-shadow linear .2s");
|
||||
.transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
|
||||
|
||||
&:focus {
|
||||
border-color: rgba(82,168,236,.8);
|
||||
outline: 0;
|
||||
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
|
||||
}
|
||||
}
|
||||
|
||||
// Reset appearance properties for textual inputs and textarea
|
||||
@@ -98,32 +103,6 @@ textarea {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
// Everything else
|
||||
textarea,
|
||||
input[type="text"],
|
||||
input[type="password"],
|
||||
input[type="datetime"],
|
||||
input[type="datetime-local"],
|
||||
input[type="date"],
|
||||
input[type="month"],
|
||||
input[type="time"],
|
||||
input[type="week"],
|
||||
input[type="number"],
|
||||
input[type="email"],
|
||||
input[type="url"],
|
||||
input[type="search"],
|
||||
input[type="tel"],
|
||||
input[type="color"] {
|
||||
// Focus state
|
||||
&:focus {
|
||||
border-color: rgba(82,168,236,.8);
|
||||
outline: 0;
|
||||
outline: thin dotted \9; /* IE6-9 */
|
||||
//.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
|
||||
.box-shadow(0 0 8px rgba(82,168,236,.6));
|
||||
}
|
||||
}
|
||||
|
||||
// Position radios and checkboxes better
|
||||
input[type="radio"],
|
||||
input[type="checkbox"] {
|
||||
@@ -145,8 +124,14 @@ select[size] {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
// Fix optgroup Firefox bug per https://github.com/twitter/bootstrap/issues/7611
|
||||
select optgroup {
|
||||
font-size: inherit;
|
||||
font-style: inherit;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
// Focus for select, file, radio, and checkbox
|
||||
select:focus,
|
||||
input[type="file"]:focus,
|
||||
input[type="radio"]:focus,
|
||||
input[type="checkbox"]:focus {
|
||||
@@ -171,9 +156,11 @@ textarea {
|
||||
.radio,
|
||||
.checkbox {
|
||||
display: block;
|
||||
min-height: @line-height-base; // clear the floating input if there is no label text
|
||||
margin-bottom: (@line-height-base / 2);
|
||||
min-height: @line-height-computed; // clear the floating input if there is no label text
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding-left: 20px;
|
||||
vertical-align: middle;
|
||||
label {
|
||||
display: inline;
|
||||
margin-bottom: 0;
|
||||
@@ -181,7 +168,6 @@ textarea {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.radio input[type="radio"],
|
||||
.radio-inline input[type="radio"],
|
||||
.checkbox input[type="checkbox"],
|
||||
@@ -191,7 +177,7 @@ textarea {
|
||||
}
|
||||
.radio + .radio,
|
||||
.checkbox + .checkbox {
|
||||
margin-top: ((@line-height-base / 4) * -1);
|
||||
margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -241,46 +227,19 @@ input[type="search"],
|
||||
input[type="tel"],
|
||||
input[type="color"] {
|
||||
&.input-large {
|
||||
padding: @padding-large;
|
||||
padding: @padding-large-vertical @padding-large-horizontal;
|
||||
font-size: @font-size-large;
|
||||
border-radius: @border-radius-large;
|
||||
}
|
||||
&.input-small {
|
||||
min-height: @input-height-small;
|
||||
padding: @padding-small;
|
||||
padding: @padding-small-vertical @padding-small-horizontal;
|
||||
font-size: @font-size-small;
|
||||
border-radius: @border-radius-small;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// GRID SIZING FOR INPUTS
|
||||
// ----------------------
|
||||
|
||||
// Grid style input sizes
|
||||
input[class*="span"],
|
||||
select[class*="span"],
|
||||
textarea[class*="span"] {
|
||||
float: none;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
// Ensure input-prepend/append never wraps
|
||||
.input-append input[class*="span"],
|
||||
.input-prepend input[class*="span"] {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
input[class*="span"],
|
||||
select[class*="span"],
|
||||
textarea[class*="span"] {
|
||||
height: @input-height-base;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// DISABLED STATE
|
||||
// --------------
|
||||
|
||||
@@ -316,15 +275,15 @@ input[type="checkbox"] {
|
||||
|
||||
// Warning
|
||||
.has-warning {
|
||||
.formFieldState(@state-warning-text, @state-warning-text, @state-warning-bg);
|
||||
.form-field-validation(@state-warning-text, @state-warning-text, @state-warning-bg);
|
||||
}
|
||||
// Error
|
||||
.has-error {
|
||||
.formFieldState(@state-danger-text, @state-danger-text, @state-danger-bg);
|
||||
.form-field-validation(@state-danger-text, @state-danger-text, @state-danger-bg);
|
||||
}
|
||||
// Success
|
||||
.has-success {
|
||||
.formFieldState(@state-success-text, @state-success-text, @state-success-bg);
|
||||
.form-field-validation(@state-success-text, @state-success-text, @state-success-bg);
|
||||
}
|
||||
|
||||
// HTML5 invalid states
|
||||
@@ -343,37 +302,15 @@ select:focus:invalid {
|
||||
|
||||
|
||||
|
||||
// FORM ACTIONS
|
||||
// ------------
|
||||
|
||||
.form-actions {
|
||||
padding: (@line-height-base - 1) 20px @line-height-base;
|
||||
margin-top: @line-height-base;
|
||||
margin-bottom: @line-height-base;
|
||||
background-color: @form-actions-bg;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
.clearfix(); // Adding clearfix to allow for .pull-right button containers
|
||||
}
|
||||
|
||||
|
||||
|
||||
// HELP TEXT
|
||||
// ---------
|
||||
|
||||
.help-block,
|
||||
.help-inline {
|
||||
color: lighten(@text-color, 25%); // lighten the text some for contrast
|
||||
}
|
||||
|
||||
.help-block {
|
||||
display: block; // account for any element using help-block
|
||||
margin-bottom: (@line-height-base / 2);
|
||||
}
|
||||
|
||||
.help-inline {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
padding-left: 5px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 10px;
|
||||
color: lighten(@text-color, 25%); // lighten the text some for contrast
|
||||
}
|
||||
|
||||
|
||||
@@ -387,14 +324,16 @@ select:focus:invalid {
|
||||
display: table;
|
||||
|
||||
// Undo padding and float of grid classes
|
||||
&[class*="span"] {
|
||||
&.col {
|
||||
float: none;
|
||||
padding: 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
select {
|
||||
width: 100%;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,12 +343,8 @@ select:focus:invalid {
|
||||
.input-group-btn,
|
||||
.input-group input {
|
||||
display: table-cell;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
&.input-small {
|
||||
border-radius: 0;
|
||||
}
|
||||
&.input-large {
|
||||
|
||||
&:not(:first-child):not(:last-child) {
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
@@ -424,7 +359,7 @@ select:focus:invalid {
|
||||
// -------------------------
|
||||
.input-group-addon {
|
||||
.box-sizing(border-box);
|
||||
padding: 6px 8px;
|
||||
padding: @padding-base-vertical @padding-base-horizontal;
|
||||
font-size: @font-size-base;
|
||||
font-weight: normal;
|
||||
line-height: @line-height-base;
|
||||
@@ -432,40 +367,37 @@ select:focus:invalid {
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background-color: @gray-lighter;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: @border-radius-base;
|
||||
|
||||
&.input-small {
|
||||
padding: @padding-small;
|
||||
font-size: @font-size-small;
|
||||
&.input-small {
|
||||
padding: @padding-small-vertical @padding-small-horizontal;
|
||||
font-size: @font-size-small;
|
||||
border-radius: @border-radius-small;
|
||||
}
|
||||
&.input-large {
|
||||
padding: @padding-large-vertical @padding-large-horizontal;
|
||||
font-size: @font-size-large;
|
||||
border-radius: @border-radius-large;
|
||||
}
|
||||
&.input-large {
|
||||
padding: @padding-large;
|
||||
font-size: @font-size-large;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset rounded corners
|
||||
.input-group input:first-child,
|
||||
.input-group-addon:first-child {
|
||||
.border-left-radius(@border-radius-base);
|
||||
&.input-small {
|
||||
.border-left-radius(@border-radius-small);
|
||||
}
|
||||
&.input-large {
|
||||
.border-left-radius(@border-radius-large);
|
||||
}
|
||||
.input-group-addon:first-child,
|
||||
.input-group-btn:first-child > .btn,
|
||||
.input-group-btn:first-child > .dropdown-toggle,
|
||||
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
|
||||
.border-right-radius(0);
|
||||
}
|
||||
.input-group-addon:first-child {
|
||||
border-right: 0;
|
||||
}
|
||||
.input-group input:last-child,
|
||||
.input-group-addon:last-child {
|
||||
.border-right-radius(@border-radius-base);
|
||||
&.input-small {
|
||||
.border-right-radius(@border-radius-small);
|
||||
}
|
||||
&.input-large {
|
||||
.border-right-radius(@border-radius-large);
|
||||
}
|
||||
.input-group-addon:last-child,
|
||||
.input-group-btn:last-child > .btn,
|
||||
.input-group-btn:last-child > .dropdown-toggle,
|
||||
.input-group-btn:first-child > .btn:not(:first-child) {
|
||||
.border-left-radius(0);
|
||||
}
|
||||
.input-group-addon:last-child {
|
||||
border-left: 0;
|
||||
@@ -480,7 +412,6 @@ select:focus:invalid {
|
||||
.input-group-btn > .btn {
|
||||
position: relative;
|
||||
float: left; // Collapse white-space
|
||||
border-radius: 0;
|
||||
+ .btn {
|
||||
margin-left: -1px;
|
||||
}
|
||||
@@ -491,67 +422,42 @@ select:focus:invalid {
|
||||
}
|
||||
}
|
||||
|
||||
// Prepended buttons
|
||||
.input-group-btn:first-child {
|
||||
// Round the left corners only
|
||||
> .btn:first-child,
|
||||
> .dropdown-toggle:first-child {
|
||||
.border-left-radius(@border-radius-base);
|
||||
&.btn-large { .border-left-radius(@border-radius-large); }
|
||||
&.btn-small { .border-left-radius(@border-radius-small); }
|
||||
|
||||
// Inline forms
|
||||
// --------------------------------------------------
|
||||
|
||||
.form-inline {
|
||||
input,
|
||||
select,
|
||||
textarea,
|
||||
.radio,
|
||||
.checkbox {
|
||||
display: inline-block;
|
||||
}
|
||||
.radio,
|
||||
.checkbox {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Appended buttons
|
||||
.input-group-btn:last-child {
|
||||
// Round the right corners only
|
||||
> .btn:last-child,
|
||||
> .dropdown-toggle {
|
||||
.border-right-radius(@border-radius-base);
|
||||
&.btn-large { .border-right-radius(@border-radius-large); }
|
||||
&.btn-small { .border-right-radius(@border-radius-small); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Horizontal forms
|
||||
// --------------------------------------------------
|
||||
// Horizontal forms are built on grid classes.
|
||||
|
||||
@media screen and (min-width: @screen-tablet) {
|
||||
|
||||
.form-horizontal {
|
||||
|
||||
// Increase spacing between groups
|
||||
.control-group {
|
||||
position: relative;
|
||||
margin-bottom: @line-height-base;
|
||||
.clearfix();
|
||||
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Float the labels left
|
||||
.control-group > .control-label {
|
||||
float: left;
|
||||
width: (@component-offset-horizontal - 20);
|
||||
padding-top: 6px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
// Move over all input controls and content over
|
||||
.control-group > .controls {
|
||||
margin-left: @component-offset-horizontal;
|
||||
}
|
||||
|
||||
// Make sure form actions buttons are aligned with controls
|
||||
.form-actions {
|
||||
padding-left: @component-offset-horizontal;
|
||||
}
|
||||
|
||||
.form-horizontal {
|
||||
.row + .row {
|
||||
margin-top: 15px;
|
||||
}
|
||||
.control-label {
|
||||
padding-top: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
// Only right aline form labels here when the columns stop stacking
|
||||
@media (min-width: 768px) {
|
||||
.form-horizontal .control-label {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
// Individual icons
|
||||
|
@@ -41,10 +41,6 @@
|
||||
.container {
|
||||
max-width: 728px;
|
||||
}
|
||||
.row {
|
||||
margin-left: (@grid-gutter-width / -2);
|
||||
margin-right: (@grid-gutter-width / -2);
|
||||
}
|
||||
}
|
||||
|
||||
// Responsive: Desktops and up
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user