mirror of https://github.com/twbs/bootstrap.git
Merge branch 'master' into fix-13386
Conflicts: js/carousel.js
This commit is contained in:
commit
0aa01f63e3
|
|
@ -2,7 +2,7 @@ language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "0.10"
|
- "0.10"
|
||||||
before_install:
|
before_install:
|
||||||
- time sudo pip install --use-mirrors -r test-infra/requirements.txt
|
- time travis_retry sudo pip install -r test-infra/requirements.txt
|
||||||
- rvm use 1.9.3 --fuzzy
|
- rvm use 1.9.3 --fuzzy
|
||||||
- export GEMDIR=$(rvm gemdir)
|
- export GEMDIR=$(rvm gemdir)
|
||||||
- if [ "$TWBS_TEST" = validate-html ]; then echo "ruby=$(basename $GEMDIR) jekyll=$JEKYLL_VERSION" > pseudo_Gemfile.lock; fi
|
- if [ "$TWBS_TEST" = validate-html ]; then echo "ruby=$(basename $GEMDIR) jekyll=$JEKYLL_VERSION" > pseudo_Gemfile.lock; fi
|
||||||
|
|
|
||||||
47
Gruntfile.js
47
Gruntfile.js
|
|
@ -17,10 +17,10 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
var npmShrinkwrap = require('npm-shrinkwrap');
|
||||||
var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js');
|
var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js');
|
||||||
var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js');
|
var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js');
|
||||||
var generateRawFiles = require('./grunt/bs-raw-files-generator.js');
|
var generateRawFiles = require('./grunt/bs-raw-files-generator.js');
|
||||||
var updateShrinkwrap = require('./grunt/shrinkwrap.js');
|
|
||||||
|
|
||||||
// Project configuration.
|
// Project configuration.
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
|
|
@ -32,6 +32,7 @@ module.exports = function (grunt) {
|
||||||
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
|
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
|
||||||
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
|
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
|
||||||
' */\n',
|
' */\n',
|
||||||
|
// NOTE: This jqueryCheck code is duplicated in customizer.js; if making changes here, be sure to update the other copy too.
|
||||||
jqueryCheck: 'if (typeof jQuery === \'undefined\') { throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\') }\n\n',
|
jqueryCheck: 'if (typeof jQuery === \'undefined\') { throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\') }\n\n',
|
||||||
|
|
||||||
// Task configuration.
|
// Task configuration.
|
||||||
|
|
@ -109,17 +110,14 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
|
|
||||||
uglify: {
|
uglify: {
|
||||||
|
options: {
|
||||||
|
preserveComments: 'some'
|
||||||
|
},
|
||||||
bootstrap: {
|
bootstrap: {
|
||||||
options: {
|
|
||||||
banner: '<%= banner %>'
|
|
||||||
},
|
|
||||||
src: '<%= concat.bootstrap.dest %>',
|
src: '<%= concat.bootstrap.dest %>',
|
||||||
dest: 'dist/js/<%= pkg.name %>.min.js'
|
dest: 'dist/js/<%= pkg.name %>.min.js'
|
||||||
},
|
},
|
||||||
customize: {
|
customize: {
|
||||||
options: {
|
|
||||||
preserveComments: 'some'
|
|
||||||
},
|
|
||||||
src: [
|
src: [
|
||||||
'docs/assets/js/_vendor/less.min.js',
|
'docs/assets/js/_vendor/less.min.js',
|
||||||
'docs/assets/js/_vendor/jszip.min.js',
|
'docs/assets/js/_vendor/jszip.min.js',
|
||||||
|
|
@ -132,9 +130,6 @@ module.exports = function (grunt) {
|
||||||
dest: 'docs/assets/js/customize.min.js'
|
dest: 'docs/assets/js/customize.min.js'
|
||||||
},
|
},
|
||||||
docsJs: {
|
docsJs: {
|
||||||
options: {
|
|
||||||
preserveComments: 'some'
|
|
||||||
},
|
|
||||||
src: [
|
src: [
|
||||||
'docs/assets/js/_vendor/holder.js',
|
'docs/assets/js/_vendor/holder.js',
|
||||||
'docs/assets/js/_vendor/ZeroClipboard.min.js',
|
'docs/assets/js/_vendor/ZeroClipboard.min.js',
|
||||||
|
|
@ -180,7 +175,16 @@ module.exports = function (grunt) {
|
||||||
|
|
||||||
autoprefixer: {
|
autoprefixer: {
|
||||||
options: {
|
options: {
|
||||||
browsers: ['last 2 versions', 'ie 8', 'ie 9', 'android 2.3', 'android 4', 'opera 12']
|
browsers: [
|
||||||
|
'Android 2.3',
|
||||||
|
'Android >= 4',
|
||||||
|
'Chrome >= 20',
|
||||||
|
'Firefox >= 24', // Firefox 24 is the latest ESR
|
||||||
|
'Explorer >= 8',
|
||||||
|
'iOS >= 6',
|
||||||
|
'Opera >= 12',
|
||||||
|
'Safari >= 6'
|
||||||
|
]
|
||||||
},
|
},
|
||||||
core: {
|
core: {
|
||||||
options: {
|
options: {
|
||||||
|
|
@ -383,9 +387,6 @@ module.exports = function (grunt) {
|
||||||
exec: {
|
exec: {
|
||||||
npmUpdate: {
|
npmUpdate: {
|
||||||
command: 'npm update'
|
command: 'npm update'
|
||||||
},
|
|
||||||
npmShrinkWrap: {
|
|
||||||
command: 'npm shrinkwrap --dev'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -459,7 +460,19 @@ module.exports = function (grunt) {
|
||||||
generateRawFiles(grunt, banner);
|
generateRawFiles(grunt, banner);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Task for updating the npm packages used by the Travis build.
|
// Task for updating the cached npm packages used by the Travis build (which are controlled by test-infra/npm-shrinkwrap.json).
|
||||||
grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', 'exec:npmShrinkWrap', '_update-shrinkwrap']);
|
// This task should be run and the updated file should be committed whenever Bootstrap's dependencies change.
|
||||||
grunt.registerTask('_update-shrinkwrap', function () { updateShrinkwrap.call(this, grunt); });
|
grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', '_update-shrinkwrap']);
|
||||||
|
grunt.registerTask('_update-shrinkwrap', function () {
|
||||||
|
var done = this.async();
|
||||||
|
npmShrinkwrap({ dev: true, dirname: __dirname }, function (err) {
|
||||||
|
if (err) {
|
||||||
|
grunt.fail.warn(err)
|
||||||
|
}
|
||||||
|
var dest = 'test-infra/npm-shrinkwrap.json';
|
||||||
|
fs.renameSync('npm-shrinkwrap.json', dest);
|
||||||
|
grunt.log.writeln('File ' + dest.cyan + ' updated.');
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
# [Bootstrap](http://getbootstrap.com)
|
# [Bootstrap](http://getbootstrap.com)
|
||||||
[](http://badge.fury.io/bo/bootstrap) [](http://badge.fury.io/js/bootstrap) [](http://travis-ci.org/twbs/bootstrap) [](https://david-dm.org/twbs/bootstrap#info=devDependencies)
|
[](http://badge.fury.io/bo/bootstrap)
|
||||||
|
[](http://badge.fury.io/js/bootstrap)
|
||||||
|
[](http://travis-ci.org/twbs/bootstrap)
|
||||||
|
[](https://david-dm.org/twbs/bootstrap#info=devDependencies)
|
||||||
[](https://saucelabs.com/u/bootstrap)
|
[](https://saucelabs.com/u/bootstrap)
|
||||||
|
|
||||||
Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](http://twitter.com/mdo) and [Jacob Thornton](http://twitter.com/fat), and maintained by the [core team](https://github.com/twbs?tab=members) with the massive support and involvement of the community.
|
Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by [Mark Otto](http://twitter.com/mdo) and [Jacob Thornton](http://twitter.com/fat), and maintained by the [core team](https://github.com/twbs?tab=members) with the massive support and involvement of the community.
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,11 @@
|
||||||
background-color: #e0e0e0;
|
background-color: #e0e0e0;
|
||||||
border-color: #dbdbdb;
|
border-color: #dbdbdb;
|
||||||
}
|
}
|
||||||
|
.btn-default:disabled,
|
||||||
|
.btn-default[disabled] {
|
||||||
|
background-color: #e0e0e0;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
|
background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
|
||||||
background-image: -o-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
|
background-image: -o-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
|
||||||
|
|
@ -75,6 +80,11 @@
|
||||||
background-color: #2d6ca2;
|
background-color: #2d6ca2;
|
||||||
border-color: #2b669a;
|
border-color: #2b669a;
|
||||||
}
|
}
|
||||||
|
.btn-primary:disabled,
|
||||||
|
.btn-primary[disabled] {
|
||||||
|
background-color: #2d6ca2;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
.btn-success {
|
.btn-success {
|
||||||
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
|
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
|
||||||
background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
|
background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
|
||||||
|
|
@ -95,6 +105,11 @@
|
||||||
background-color: #419641;
|
background-color: #419641;
|
||||||
border-color: #3e8f3e;
|
border-color: #3e8f3e;
|
||||||
}
|
}
|
||||||
|
.btn-success:disabled,
|
||||||
|
.btn-success[disabled] {
|
||||||
|
background-color: #419641;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
.btn-info {
|
.btn-info {
|
||||||
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
|
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
|
||||||
background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
|
background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
|
||||||
|
|
@ -115,6 +130,11 @@
|
||||||
background-color: #2aabd2;
|
background-color: #2aabd2;
|
||||||
border-color: #28a4c9;
|
border-color: #28a4c9;
|
||||||
}
|
}
|
||||||
|
.btn-info:disabled,
|
||||||
|
.btn-info[disabled] {
|
||||||
|
background-color: #2aabd2;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
.btn-warning {
|
.btn-warning {
|
||||||
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
|
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
|
||||||
background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
|
background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
|
||||||
|
|
@ -135,6 +155,11 @@
|
||||||
background-color: #eb9316;
|
background-color: #eb9316;
|
||||||
border-color: #e38d13;
|
border-color: #e38d13;
|
||||||
}
|
}
|
||||||
|
.btn-warning:disabled,
|
||||||
|
.btn-warning[disabled] {
|
||||||
|
background-color: #eb9316;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
.btn-danger {
|
.btn-danger {
|
||||||
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
|
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
|
||||||
background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
|
background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
|
||||||
|
|
@ -155,6 +180,11 @@
|
||||||
background-color: #c12e2a;
|
background-color: #c12e2a;
|
||||||
border-color: #b92c28;
|
border-color: #b92c28;
|
||||||
}
|
}
|
||||||
|
.btn-danger:disabled,
|
||||||
|
.btn-danger[disabled] {
|
||||||
|
background-color: #c12e2a;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
.thumbnail,
|
.thumbnail,
|
||||||
.img-thumbnail {
|
.img-thumbnail {
|
||||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
|
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
|
||||||
|
|
@ -324,6 +354,11 @@
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
|
||||||
background-repeat: repeat-x;
|
background-repeat: repeat-x;
|
||||||
}
|
}
|
||||||
|
.progress-bar-striped {
|
||||||
|
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
|
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
|
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
|
}
|
||||||
.list-group {
|
.list-group {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
|
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -935,6 +935,7 @@ img {
|
||||||
.carousel-inner > .item > img,
|
.carousel-inner > .item > img,
|
||||||
.carousel-inner > .item > a > img {
|
.carousel-inner > .item > a > img {
|
||||||
display: block;
|
display: block;
|
||||||
|
width: 100% \9;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
@ -943,6 +944,7 @@ img {
|
||||||
}
|
}
|
||||||
.img-thumbnail {
|
.img-thumbnail {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
width: 100% \9;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
|
@ -1025,7 +1027,7 @@ h6 .small,
|
||||||
.h6 .small {
|
.h6 .small {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
h1,
|
h1,
|
||||||
.h1,
|
.h1,
|
||||||
|
|
@ -1148,7 +1150,7 @@ mark,
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
.text-muted {
|
.text-muted {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.text-primary {
|
.text-primary {
|
||||||
color: #428bca;
|
color: #428bca;
|
||||||
|
|
@ -1272,7 +1274,7 @@ dd {
|
||||||
abbr[title],
|
abbr[title],
|
||||||
abbr[data-original-title] {
|
abbr[data-original-title] {
|
||||||
cursor: help;
|
cursor: help;
|
||||||
border-bottom: 1px dotted #999;
|
border-bottom: 1px dotted #777;
|
||||||
}
|
}
|
||||||
.initialism {
|
.initialism {
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
|
|
@ -1295,7 +1297,7 @@ blockquote .small {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
line-height: 1.42857143;
|
line-height: 1.42857143;
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
blockquote footer:before,
|
blockquote footer:before,
|
||||||
blockquote small:before,
|
blockquote small:before,
|
||||||
|
|
@ -2373,14 +2375,14 @@ output {
|
||||||
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
|
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
|
||||||
}
|
}
|
||||||
.form-control::-moz-placeholder {
|
.form-control::-moz-placeholder {
|
||||||
color: #999;
|
color: #777;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
.form-control:-ms-input-placeholder {
|
.form-control:-ms-input-placeholder {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.form-control::-webkit-input-placeholder {
|
.form-control::-webkit-input-placeholder {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.form-control[disabled],
|
.form-control[disabled],
|
||||||
.form-control[readonly],
|
.form-control[readonly],
|
||||||
|
|
@ -2478,7 +2480,18 @@ fieldset[disabled] .radio label,
|
||||||
fieldset[disabled] .checkbox label {
|
fieldset[disabled] .checkbox label {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
.input-sm {
|
.form-control-static {
|
||||||
|
padding-top: 7px;
|
||||||
|
padding-bottom: 7px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
.form-control-static.input-lg,
|
||||||
|
.form-control-static.input-sm {
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
.input-sm,
|
||||||
|
.form-horizontal .form-group-sm .form-control {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|
@ -2493,7 +2506,8 @@ textarea.input-sm,
|
||||||
select[multiple].input-sm {
|
select[multiple].input-sm {
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
.input-lg {
|
.input-lg,
|
||||||
|
.form-horizontal .form-group-lg .form-control {
|
||||||
height: 46px;
|
height: 46px;
|
||||||
padding: 10px 16px;
|
padding: 10px 16px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
@ -2616,9 +2630,6 @@ select[multiple].input-lg {
|
||||||
.has-feedback label.sr-only ~ .form-control-feedback {
|
.has-feedback label.sr-only ~ .form-control-feedback {
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
.form-control-static {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
.help-block {
|
.help-block {
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
|
@ -2688,10 +2699,6 @@ select[multiple].input-lg {
|
||||||
margin-right: -15px;
|
margin-right: -15px;
|
||||||
margin-left: -15px;
|
margin-left: -15px;
|
||||||
}
|
}
|
||||||
.form-horizontal .form-control-static {
|
|
||||||
padding-top: 7px;
|
|
||||||
padding-bottom: 7px;
|
|
||||||
}
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.form-horizontal .control-label {
|
.form-horizontal .control-label {
|
||||||
padding-top: 7px;
|
padding-top: 7px;
|
||||||
|
|
@ -2703,6 +2710,16 @@ select[multiple].input-lg {
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 15px;
|
right: 15px;
|
||||||
}
|
}
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.form-horizontal .form-group-lg .control-label {
|
||||||
|
padding-top: 14.3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.form-horizontal .form-group-sm .control-label {
|
||||||
|
padding-top: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.btn {
|
.btn {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
|
|
@ -3027,7 +3044,7 @@ fieldset[disabled] .btn-link {
|
||||||
fieldset[disabled] .btn-link:hover,
|
fieldset[disabled] .btn-link:hover,
|
||||||
.btn-link[disabled]:focus,
|
.btn-link[disabled]:focus,
|
||||||
fieldset[disabled] .btn-link:focus {
|
fieldset[disabled] .btn-link:focus {
|
||||||
color: #999;
|
color: #777;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.btn-lg,
|
.btn-lg,
|
||||||
|
|
@ -3054,8 +3071,6 @@ fieldset[disabled] .btn-link:focus {
|
||||||
.btn-block {
|
.btn-block {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-right: 0;
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
}
|
||||||
.btn-block + .btn-block {
|
.btn-block + .btn-block {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
|
@ -3168,7 +3183,7 @@ tbody.collapse.in {
|
||||||
.dropdown-menu > .disabled > a,
|
.dropdown-menu > .disabled > a,
|
||||||
.dropdown-menu > .disabled > a:hover,
|
.dropdown-menu > .disabled > a:hover,
|
||||||
.dropdown-menu > .disabled > a:focus {
|
.dropdown-menu > .disabled > a:focus {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.dropdown-menu > .disabled > a:hover,
|
.dropdown-menu > .disabled > a:hover,
|
||||||
.dropdown-menu > .disabled > a:focus {
|
.dropdown-menu > .disabled > a:focus {
|
||||||
|
|
@ -3197,7 +3212,8 @@ tbody.collapse.in {
|
||||||
padding: 3px 20px;
|
padding: 3px 20px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.42857143;
|
line-height: 1.42857143;
|
||||||
color: #999;
|
color: #777;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.dropdown-backdrop {
|
.dropdown-backdrop {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
@ -3578,11 +3594,11 @@ select[multiple].input-group-sm > .input-group-btn > .btn {
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
.nav > li.disabled > a {
|
.nav > li.disabled > a {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.nav > li.disabled > a:hover,
|
.nav > li.disabled > a:hover,
|
||||||
.nav > li.disabled > a:focus {
|
.nav > li.disabled > a:focus {
|
||||||
color: #999;
|
color: #777;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
|
@ -4176,7 +4192,7 @@ fieldset[disabled] .navbar-default .btn-link:focus {
|
||||||
border-color: #080808;
|
border-color: #080808;
|
||||||
}
|
}
|
||||||
.navbar-inverse .navbar-brand {
|
.navbar-inverse .navbar-brand {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.navbar-inverse .navbar-brand:hover,
|
.navbar-inverse .navbar-brand:hover,
|
||||||
.navbar-inverse .navbar-brand:focus {
|
.navbar-inverse .navbar-brand:focus {
|
||||||
|
|
@ -4184,10 +4200,10 @@ fieldset[disabled] .navbar-default .btn-link:focus {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
.navbar-inverse .navbar-text {
|
.navbar-inverse .navbar-text {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.navbar-inverse .navbar-nav > li > a {
|
.navbar-inverse .navbar-nav > li > a {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.navbar-inverse .navbar-nav > li > a:hover,
|
.navbar-inverse .navbar-nav > li > a:hover,
|
||||||
.navbar-inverse .navbar-nav > li > a:focus {
|
.navbar-inverse .navbar-nav > li > a:focus {
|
||||||
|
|
@ -4234,7 +4250,7 @@ fieldset[disabled] .navbar-default .btn-link:focus {
|
||||||
background-color: #080808;
|
background-color: #080808;
|
||||||
}
|
}
|
||||||
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
|
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
|
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
|
||||||
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
|
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
|
||||||
|
|
@ -4255,13 +4271,13 @@ fieldset[disabled] .navbar-default .btn-link:focus {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navbar-inverse .navbar-link {
|
.navbar-inverse .navbar-link {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.navbar-inverse .navbar-link:hover {
|
.navbar-inverse .navbar-link:hover {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.navbar-inverse .btn-link {
|
.navbar-inverse .btn-link {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.navbar-inverse .btn-link:hover,
|
.navbar-inverse .btn-link:hover,
|
||||||
.navbar-inverse .btn-link:focus {
|
.navbar-inverse .btn-link:focus {
|
||||||
|
|
@ -4289,7 +4305,7 @@ fieldset[disabled] .navbar-inverse .btn-link:focus {
|
||||||
content: "/\00a0";
|
content: "/\00a0";
|
||||||
}
|
}
|
||||||
.breadcrumb > .active {
|
.breadcrumb > .active {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.pagination {
|
.pagination {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
@ -4349,7 +4365,7 @@ fieldset[disabled] .navbar-inverse .btn-link:focus {
|
||||||
.pagination > .disabled > a,
|
.pagination > .disabled > a,
|
||||||
.pagination > .disabled > a:hover,
|
.pagination > .disabled > a:hover,
|
||||||
.pagination > .disabled > a:focus {
|
.pagination > .disabled > a:focus {
|
||||||
color: #999;
|
color: #777;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-color: #ddd;
|
border-color: #ddd;
|
||||||
|
|
@ -4418,7 +4434,7 @@ fieldset[disabled] .navbar-inverse .btn-link:focus {
|
||||||
.pager .disabled > a:hover,
|
.pager .disabled > a:hover,
|
||||||
.pager .disabled > a:focus,
|
.pager .disabled > a:focus,
|
||||||
.pager .disabled > span {
|
.pager .disabled > span {
|
||||||
color: #999;
|
color: #777;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
@ -4448,11 +4464,11 @@ a.label:focus {
|
||||||
top: -1px;
|
top: -1px;
|
||||||
}
|
}
|
||||||
.label-default {
|
.label-default {
|
||||||
background-color: #999;
|
background-color: #777;
|
||||||
}
|
}
|
||||||
.label-default[href]:hover,
|
.label-default[href]:hover,
|
||||||
.label-default[href]:focus {
|
.label-default[href]:focus {
|
||||||
background-color: #808080;
|
background-color: #5e5e5e;
|
||||||
}
|
}
|
||||||
.label-primary {
|
.label-primary {
|
||||||
background-color: #428bca;
|
background-color: #428bca;
|
||||||
|
|
@ -4500,7 +4516,7 @@ a.label:focus {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
vertical-align: baseline;
|
vertical-align: baseline;
|
||||||
background-color: #999;
|
background-color: #777;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
.badge:empty {
|
.badge:empty {
|
||||||
|
|
@ -4612,10 +4628,12 @@ a.thumbnail.active {
|
||||||
.alert > p + p {
|
.alert > p + p {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
.alert-dismissable {
|
.alert-dismissable,
|
||||||
|
.alert-dismissible {
|
||||||
padding-right: 35px;
|
padding-right: 35px;
|
||||||
}
|
}
|
||||||
.alert-dismissable .close {
|
.alert-dismissable .close,
|
||||||
|
.alert-dismissible .close {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -2px;
|
top: -2px;
|
||||||
right: -21px;
|
right: -21px;
|
||||||
|
|
@ -4713,14 +4731,16 @@ a.thumbnail.active {
|
||||||
-o-transition: width .6s ease;
|
-o-transition: width .6s ease;
|
||||||
transition: width .6s ease;
|
transition: width .6s ease;
|
||||||
}
|
}
|
||||||
.progress-striped .progress-bar {
|
.progress-striped .progress-bar,
|
||||||
|
.progress-bar-striped {
|
||||||
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
|
||||||
-webkit-background-size: 40px 40px;
|
-webkit-background-size: 40px 40px;
|
||||||
background-size: 40px 40px;
|
background-size: 40px 40px;
|
||||||
}
|
}
|
||||||
.progress.active .progress-bar {
|
.progress.active .progress-bar,
|
||||||
|
.progress-bar.active {
|
||||||
-webkit-animation: progress-bar-stripes 2s linear infinite;
|
-webkit-animation: progress-bar-stripes 2s linear infinite;
|
||||||
-o-animation: progress-bar-stripes 2s linear infinite;
|
-o-animation: progress-bar-stripes 2s linear infinite;
|
||||||
animation: progress-bar-stripes 2s linear infinite;
|
animation: progress-bar-stripes 2s linear infinite;
|
||||||
|
|
@ -4731,7 +4751,7 @@ a.thumbnail.active {
|
||||||
}
|
}
|
||||||
.progress-bar[aria-valuenow="0"] {
|
.progress-bar[aria-valuenow="0"] {
|
||||||
min-width: 30px;
|
min-width: 30px;
|
||||||
color: #999;
|
color: #777;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
background-image: none;
|
background-image: none;
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
|
|
@ -4839,7 +4859,7 @@ a.list-group-item:focus {
|
||||||
.list-group-item.disabled,
|
.list-group-item.disabled,
|
||||||
.list-group-item.disabled:hover,
|
.list-group-item.disabled:hover,
|
||||||
.list-group-item.disabled:focus {
|
.list-group-item.disabled:focus {
|
||||||
color: #999;
|
color: #777;
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
.list-group-item.disabled .list-group-item-heading,
|
.list-group-item.disabled .list-group-item-heading,
|
||||||
|
|
@ -4850,7 +4870,7 @@ a.list-group-item:focus {
|
||||||
.list-group-item.disabled .list-group-item-text,
|
.list-group-item.disabled .list-group-item-text,
|
||||||
.list-group-item.disabled:hover .list-group-item-text,
|
.list-group-item.disabled:hover .list-group-item-text,
|
||||||
.list-group-item.disabled:focus .list-group-item-text {
|
.list-group-item.disabled:focus .list-group-item-text {
|
||||||
color: #999;
|
color: #777;
|
||||||
}
|
}
|
||||||
.list-group-item.active,
|
.list-group-item.active,
|
||||||
.list-group-item.active:hover,
|
.list-group-item.active:hover,
|
||||||
|
|
@ -4862,7 +4882,13 @@ a.list-group-item:focus {
|
||||||
}
|
}
|
||||||
.list-group-item.active .list-group-item-heading,
|
.list-group-item.active .list-group-item-heading,
|
||||||
.list-group-item.active:hover .list-group-item-heading,
|
.list-group-item.active:hover .list-group-item-heading,
|
||||||
.list-group-item.active:focus .list-group-item-heading {
|
.list-group-item.active:focus .list-group-item-heading,
|
||||||
|
.list-group-item.active .list-group-item-heading > small,
|
||||||
|
.list-group-item.active:hover .list-group-item-heading > small,
|
||||||
|
.list-group-item.active:focus .list-group-item-heading > small,
|
||||||
|
.list-group-item.active .list-group-item-heading > .small,
|
||||||
|
.list-group-item.active:hover .list-group-item-heading > .small,
|
||||||
|
.list-group-item.active:focus .list-group-item-heading > .small {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
.list-group-item.active .list-group-item-text,
|
.list-group-item.active .list-group-item-text,
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
|
@ -1,19 +1,19 @@
|
||||||
- name: Little
|
- name: Red Antler
|
||||||
url: http://littleco.com
|
url: http://www.redantler.com/
|
||||||
expo_url: http://expo.getbootstrap.com/2014/02/12/little/
|
expo_url: http://expo.getbootstrap.com/2014/02/24/redantler/
|
||||||
img: http://expo.getbootstrap.com/screenshots/little.jpg
|
img: redantler
|
||||||
|
|
||||||
- name: Engine Yard
|
- name: Riot Design
|
||||||
url: http://engineyard.com
|
url: http://riotdesign.eu/en/
|
||||||
expo_url: http://expo.getbootstrap.com/2014/02/10/engine-yard/
|
expo_url: http://expo.getbootstrap.com/2014/03/13/riot-design/
|
||||||
img: http://expo.getbootstrap.com/screenshots/engine-yard.jpg
|
img: riot
|
||||||
|
|
||||||
- name: Webflow
|
- name: Newsweek
|
||||||
url: http://webflow.com
|
url: http://www.newsweek.com/
|
||||||
expo_url: http://expo.getbootstrap.com/2014/02/04/webflow/
|
expo_url: http://expo.getbootstrap.com/2014/02/12/newsweek/
|
||||||
img: http://expo.getbootstrap.com/screenshots/webflow.jpg
|
img: newsweek
|
||||||
|
|
||||||
- name: Sentry
|
- name: Robinhood
|
||||||
url: https://getsentry.com
|
url: https://www.robinhood.com
|
||||||
expo_url: http://expo.getbootstrap.com/2013/05/09/sentry/
|
expo_url: http://expo.getbootstrap.com/2014/02/26/robinhood/
|
||||||
img: http://expo.getbootstrap.com/screenshots/sentry.jpg
|
img: robinhood
|
||||||
|
|
|
||||||
|
|
@ -32,16 +32,16 @@
|
||||||
<div class="alert alert-danger" role="alert">...</div>
|
<div class="alert alert-danger" role="alert">...</div>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
<h2 id="alerts-dismissable">Dismissable alerts</h2>
|
<h2 id="alerts-dismissible">Dismissible alerts</h2>
|
||||||
<p>Build on any alert by adding an optional <code>.alert-dismissable</code> and close button.</p>
|
<p>Build on any alert by adding an optional <code>.alert-dismissible</code> and close button.</p>
|
||||||
<div class="bs-example">
|
<div class="bs-example">
|
||||||
<div class="alert alert-warning alert-dismissable" role="alert">
|
<div class="alert alert-warning alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||||
<strong>Warning!</strong> Better check yourself, you're not looking too good.
|
<strong>Warning!</strong> Better check yourself, you're not looking too good.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<div class="alert alert-warning alert-dismissable" role="alert">
|
<div class="alert alert-warning alert-dismissible" role="alert">
|
||||||
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
|
||||||
<strong>Warning!</strong> Better check yourself, you're not looking too good.
|
<strong>Warning!</strong> Better check yourself, you're not looking too good.
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
<h3 id="panels-heading">Panel with heading</h3>
|
<h3 id="panels-heading">Panel with heading</h3>
|
||||||
<p>Easily add a heading container to your panel with <code>.panel-heading</code>. You may also include any <code><h1></code>-<code><h6></code> with a <code>.panel-title</code> class to add a pre-styled heading.</p>
|
<p>Easily add a heading container to your panel with <code>.panel-heading</code>. You may also include any <code><h1></code>-<code><h6></code> with a <code>.panel-title</code> class to add a pre-styled heading.</p>
|
||||||
|
<p>For proper link coloring, be sure to place links in headings within <code>.panel-title</code>.</p>
|
||||||
<div class="bs-example">
|
<div class="bs-example">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">Panel heading without title</div>
|
<div class="panel-heading">Panel heading without title</div>
|
||||||
|
|
|
||||||
|
|
@ -120,60 +120,60 @@
|
||||||
<h3 id="progress-striped">Striped</h3>
|
<h3 id="progress-striped">Striped</h3>
|
||||||
<p>Uses a gradient to create a striped effect. Not available in IE8.</p>
|
<p>Uses a gradient to create a striped effect. Not available in IE8.</p>
|
||||||
<div class="bs-example">
|
<div class="bs-example">
|
||||||
<div class="progress progress-striped" >
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
|
<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
|
||||||
<span class="sr-only">40% Complete (success)</span>
|
<span class="sr-only">40% Complete (success)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress progress-striped">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
|
<div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
|
||||||
<span class="sr-only">20% Complete</span>
|
<span class="sr-only">20% Complete</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress progress-striped">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
|
<div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
|
||||||
<span class="sr-only">60% Complete (warning)</span>
|
<span class="sr-only">60% Complete (warning)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress progress-striped">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
|
<div class="progress-bar progress-bar-danger progress-bar-striped" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
|
||||||
<span class="sr-only">80% Complete (danger)</span>
|
<span class="sr-only">80% Complete (danger)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<div class="progress progress-striped">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
|
<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
|
||||||
<span class="sr-only">40% Complete (success)</span>
|
<span class="sr-only">40% Complete (success)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress progress-striped">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
|
<div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
|
||||||
<span class="sr-only">20% Complete</span>
|
<span class="sr-only">20% Complete</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress progress-striped">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
|
<div class="progress-bar progress-bar-warning progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
|
||||||
<span class="sr-only">60% Complete (warning)</span>
|
<span class="sr-only">60% Complete (warning)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress progress-striped">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
|
<div class="progress-bar progress-bar-danger progress-bar-striped" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
|
||||||
<span class="sr-only">80% Complete (danger)</span>
|
<span class="sr-only">80% Complete (danger)</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
<h3 id="progress-animated">Animated</h3>
|
<h3 id="progress-animated">Animated</h3>
|
||||||
<p>Add <code>.active</code> to <code>.progress-striped</code> to animate the stripes right to left. Not available in IE9 and below.</p>
|
<p>Add <code>.active</code> to <code>.progress-bar-striped</code> to animate the stripes right to left. Not available in IE9 and below.</p>
|
||||||
<div class="bs-example">
|
<div class="bs-example">
|
||||||
<div class="progress progress-striped active">
|
<div class="progress">
|
||||||
<div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%"><span class="sr-only">45% Complete</span></div>
|
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%"><span class="sr-only">45% Complete</span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<div class="progress progress-striped active">
|
<div class="progress">
|
||||||
<div class="progress-bar" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%">
|
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 45%">
|
||||||
<span class="sr-only">45% Complete</span>
|
<span class="sr-only">45% Complete</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -186,7 +186,7 @@
|
||||||
<div class="progress-bar progress-bar-success" style="width: 35%">
|
<div class="progress-bar progress-bar-success" style="width: 35%">
|
||||||
<span class="sr-only">35% Complete (success)</span>
|
<span class="sr-only">35% Complete (success)</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress-bar progress-bar-warning" style="width: 20%">
|
<div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 20%">
|
||||||
<span class="sr-only">20% Complete (warning)</span>
|
<span class="sr-only">20% Complete (warning)</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress-bar progress-bar-danger" style="width: 10%">
|
<div class="progress-bar progress-bar-danger" style="width: 10%">
|
||||||
|
|
@ -199,7 +199,7 @@
|
||||||
<div class="progress-bar progress-bar-success" style="width: 35%">
|
<div class="progress-bar progress-bar-success" style="width: 35%">
|
||||||
<span class="sr-only">35% Complete (success)</span>
|
<span class="sr-only">35% Complete (success)</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress-bar progress-bar-warning" style="width: 20%">
|
<div class="progress-bar progress-bar-warning progress-bar-striped" style="width: 20%">
|
||||||
<span class="sr-only">20% Complete (warning)</span>
|
<span class="sr-only">20% Complete (warning)</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="progress-bar progress-bar-danger" style="width: 10%">
|
<div class="progress-bar progress-bar-danger" style="width: 10%">
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
|
|
||||||
|
|
||||||
<h2 id="buttons-active">Active state</h2>
|
<h2 id="buttons-active">Active state</h2>
|
||||||
<p>Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. For <code><button></code> elements, this is done via <code>:active</code>. For <code><a></code> elements, it's done with <code>.active</code>. However, you may use <code>.active</code> on <code><button></code>s should you need to replicate the active state progammatically.</p>
|
<p>Buttons will appear pressed (with a darker background, darker border, and inset shadow) when active. For <code><button></code> elements, this is done via <code>:active</code>. For <code><a></code> elements, it's done with <code>.active</code>. However, you may use <code>.active</code> on <code><button></code>s should you need to replicate the active state programmatically.</p>
|
||||||
|
|
||||||
<h3>Button element</h3>
|
<h3>Button element</h3>
|
||||||
<p>No need to add <code>:active</code> as it's a pseudo-class, but if you need to force the same appearance, go ahead and add <code>.active</code>.</p>
|
<p>No need to add <code>:active</code> as it's a pseudo-class, but if you need to force the same appearance, go ahead and add <code>.active</code>.</p>
|
||||||
|
|
|
||||||
|
|
@ -670,6 +670,42 @@
|
||||||
<select class="form-control input-sm">...</select>
|
<select class="form-control input-sm">...</select>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
<h3>Horizontal form group sizes</h3>
|
||||||
|
<p>Quickly size labels and form controls within <code>.form-horizontal</code> by adding <code>.form-group-lg</code> or <code>.form-group-sm</code>.</p>
|
||||||
|
<div class="bs-example">
|
||||||
|
<form class="form-horizontal" role="form">
|
||||||
|
<div class="form-group form-group-lg">
|
||||||
|
<label class="col-sm-2 control-label" for="formGroupInputLarge">Large label</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input class="form-control" type="text" id="formGroupInputLarge" placeholder="Large input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group form-group-sm">
|
||||||
|
<label class="col-sm-2 control-label" for="formGroupInputSmall">Small label</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input class="form-control" type="text" id="formGroupInputSmall" placeholder="Small input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div><!-- /.bs-example -->
|
||||||
|
{% highlight html %}
|
||||||
|
<form class="form-horizontal" role="form">
|
||||||
|
<div class="form-group form-group-lg">
|
||||||
|
<label class="col-sm-2 control-label" for="formGroupInputLarge">Large label</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input class="form-control" type="text" id="formGroupInputLarge" placeholder="Large input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group form-group-sm">
|
||||||
|
<label class="col-sm-2 control-label" for="formGroupInputSmall">Small label</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input class="form-control" type="text" id="formGroupInputSmall" placeholder="Small input">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
|
||||||
<h3>Column sizing</h3>
|
<h3>Column sizing</h3>
|
||||||
<p>Wrap inputs in grid columns, or any custom parent element, to easily enforce desired widths.</p>
|
<p>Wrap inputs in grid columns, or any custom parent element, to easily enforce desired widths.</p>
|
||||||
<div class="bs-example">
|
<div class="bs-example">
|
||||||
|
|
|
||||||
|
|
@ -347,16 +347,16 @@
|
||||||
|
|
||||||
|
|
||||||
<h3 id="grid-nesting">Nesting columns</h3>
|
<h3 id="grid-nesting">Nesting columns</h3>
|
||||||
<p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.col-md-*</code> columns within an existing <code>.col-md-*</code> column. Nested rows should include a set of columns that add up to 12 or less (it is not required that you use all 12 available columns).</p>
|
<p>To nest your content with the default grid, add a new <code>.row</code> and set of <code>.col-sm-*</code> columns within an existing <code>.col-sm-*</code> column. Nested rows should include a set of columns that add up to 12 or less (it is not required that you use all 12 available columns).</p>
|
||||||
<div class="row show-grid">
|
<div class="row show-grid">
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
Level 1: .col-md-9
|
Level 1: .col-sm-9
|
||||||
<div class="row show-grid">
|
<div class="row show-grid">
|
||||||
<div class="col-xs-8 col-sm-6">
|
<div class="col-xs-8 col-sm-6">
|
||||||
Level 2: .col-xs-8 .col-md-6
|
Level 2: .col-xs-8 .col-sm-6
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4 col-sm-6">
|
<div class="col-xs-4 col-sm-6">
|
||||||
Level 2: .col-xs-4 .col-md-6
|
Level 2: .col-xs-4 .col-sm-6
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -364,13 +364,13 @@
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
Level 1: .col-md-9
|
Level 1: .col-sm-9
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-8 col-sm-6">
|
<div class="col-xs-8 col-sm-6">
|
||||||
Level 2: .col-xs-8 .col-md-6
|
Level 2: .col-xs-8 .col-sm-6
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4 col-sm-6">
|
<div class="col-xs-4 col-sm-6">
|
||||||
Level 2: .col-xs-4 .col-md-6
|
Level 2: .col-xs-4 .col-sm-6
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
@gray-darker: lighten(#000, 13.5%); // #222
|
@gray-darker: lighten(#000, 13.5%); // #222
|
||||||
@gray-dark: lighten(#000, 20%); // #333
|
@gray-dark: lighten(#000, 20%); // #333
|
||||||
@gray: lighten(#000, 33.5%); // #555
|
@gray: lighten(#000, 33.5%); // #555
|
||||||
@gray-light: lighten(#000, 60%); // #999
|
@gray-light: lighten(#000, 46.7%); // #777
|
||||||
@gray-lighter: lighten(#000, 93.5%); // #eee
|
@gray-lighter: lighten(#000, 93.5%); // #eee
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="bs-customizer-input">
|
<div class="bs-customizer-input">
|
||||||
<label for="input-@gray-light">@gray-light</label>
|
<label for="input-@gray-light">@gray-light</label>
|
||||||
<input id="input-@gray-light" type="text" value="lighten(#000, 60%)" data-var="@gray-light" class="form-control"/>
|
<input id="input-@gray-light" type="text" value="lighten(#000, 46.7%)" data-var="@gray-light" class="form-control"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="bs-customizer-input">
|
<div class="bs-customizer-input">
|
||||||
<label for="input-@gray-lighter">@gray-lighter</label>
|
<label for="input-@gray-lighter">@gray-lighter</label>
|
||||||
|
|
@ -1735,6 +1735,11 @@
|
||||||
<input id="input-@page-header-border-color" type="text" value="@gray-lighter" data-var="@page-header-border-color" class="form-control"/>
|
<input id="input-@page-header-border-color" type="text" value="@gray-lighter" data-var="@page-header-border-color" class="form-control"/>
|
||||||
<p class="help-block">Page header border color</p>
|
<p class="help-block">Page header border color</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="bs-customizer-input">
|
||||||
|
<label for="input-@dl-horizontal-offset">@dl-horizontal-offset</label>
|
||||||
|
<input id="input-@dl-horizontal-offset" type="text" value="@component-offset-horizontal" data-var="@dl-horizontal-offset" class="form-control"/>
|
||||||
|
<p class="help-block">Width of horizontal description list titles</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h2 id="miscellaneous">Miscellaneous</h2>
|
<h2 id="miscellaneous">Miscellaneous</h2>
|
||||||
<p></p>
|
<p></p>
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,9 @@
|
||||||
<h3 id="support-ie8-box-sizing">Internet Explorer 8 and box-sizing</h3>
|
<h3 id="support-ie8-box-sizing">Internet Explorer 8 and box-sizing</h3>
|
||||||
<p>IE8 does not fully support <code>box-sizing: border-box;</code> when combined with <code>min-width</code>, <code>max-width</code>, <code>min-height</code>, or <code>max-height</code>. For that reason, as of v3.0.1, we no longer use <code>max-width</code> on <code>.container</code>s.</p>
|
<p>IE8 does not fully support <code>box-sizing: border-box;</code> when combined with <code>min-width</code>, <code>max-width</code>, <code>min-height</code>, or <code>max-height</code>. For that reason, as of v3.0.1, we no longer use <code>max-width</code> on <code>.container</code>s.</p>
|
||||||
|
|
||||||
|
<h3 id="support-ie8-font-face">Internet Explorer 8 and @font-face</h3>
|
||||||
|
<p>IE8 has some issues with <code>@font-face</code> when combined with <code>:before</code>. Bootstrap uses that combination with its Glyphicons. If a page is cached, and loaded without the mouse over the window (i.e. hit the refresh button or load something in an iframe) then the page gets rendered before the font loads. Hovering over the page (body) will show some of the icons and hovering over the remaining icons will show those as well. <a href="https://github.com/twbs/bootstrap/issues/13863">See issue #13863</a> for details.</p>
|
||||||
|
|
||||||
<h3 id="support-ie-compatibility-modes">IE Compatibility modes</h3>
|
<h3 id="support-ie-compatibility-modes">IE Compatibility modes</h3>
|
||||||
<p>Bootstrap is not supported in the old Internet Explorer compatibility modes. To be sure you're using the latest rendering mode for IE, consider including the appropriate <code><meta></code> tag in your pages:</p>
|
<p>Bootstrap is not supported in the old Internet Explorer compatibility modes. To be sure you're using the latest rendering mode for IE, consider including the appropriate <code><meta></code> tag in your pages:</p>
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="bs-docs-section">
|
<div class="bs-docs-section">
|
||||||
<h1 id="examples" class="page-header">Examples</h1>
|
<h1 id="examples" class="page-header">Examples</h1>
|
||||||
|
|
||||||
<p class="lead">Build on the basic template above with Bootstrap's many components. See also <a href="#customizing">Customizing Bootstrap</a> for tips on maintaining your own Bootstrap variants.</p>
|
<p class="lead">Build on the basic template above with Bootstrap's many components. We encourage you to customize and adapt Bootstrap to suit your individual project's needs.</p>
|
||||||
|
|
||||||
<h3 id="examples-framework">Using the framework</h3>
|
<h3 id="examples-framework">Using the framework</h3>
|
||||||
<div class="row bs-examples">
|
<div class="row bs-examples">
|
||||||
|
|
@ -119,7 +119,7 @@
|
||||||
<img src="../examples/screenshots/justified-nav.jpg" alt="">
|
<img src="../examples/screenshots/justified-nav.jpg" alt="">
|
||||||
</a>
|
</a>
|
||||||
<h4>Justified nav</h4>
|
<h4>Justified nav</h4>
|
||||||
<p>Create a custom navbar with justified links. Heads up! <a href="../components/#nav-justified">Not too WebKit friendly.</a></p>
|
<p>Create a custom navbar with justified links. Heads up! <a href="../components/#nav-justified">Not too Safari friendly.</a></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix visible-xs"></div>
|
<div class="clearfix visible-xs"></div>
|
||||||
|
|
||||||
|
|
@ -155,12 +155,5 @@
|
||||||
<h4>Offcanvas</h4>
|
<h4>Offcanvas</h4>
|
||||||
<p>Build a toggleable off-canvas navigation menu for use with Bootstrap.</p>
|
<p>Build a toggleable off-canvas navigation menu for use with Bootstrap.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-md-4">
|
|
||||||
<a class="thumbnail" href="../examples/equal-height-columns/">
|
|
||||||
<img src="../examples/screenshots/equal-height-columns.jpg" alt="">
|
|
||||||
</a>
|
|
||||||
<h4>Equal-height grid columns</h4>
|
|
||||||
<p>Adds automatic equal-height grid columns to Bootstrap's grid system.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ $('.btn').button()
|
||||||
|
|
||||||
<div class="bs-callout bs-callout-danger">
|
<div class="bs-callout bs-callout-danger">
|
||||||
<h4>Cross-browser compatibility</h4>
|
<h4>Cross-browser compatibility</h4>
|
||||||
<p><a href="https://github.com/twbs/bootstrap/issues/793">Firefox persists the disabled state across page loads</a>. A workaround for this is to use <code>autocomplete="off"</code>.</p>
|
<p><a href="https://github.com/twbs/bootstrap/issues/793">Firefox persists form control states across page loads</a>. A workaround for this is to use <code>autocomplete="off"</code>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h4>$().button('reset')</h4>
|
<h4>$().button('reset')</h4>
|
||||||
|
|
|
||||||
|
|
@ -111,10 +111,10 @@ sagittis lacus vel augue laoreet rutrum faucibus.">
|
||||||
<h4>Dismiss on next click</h4>
|
<h4>Dismiss on next click</h4>
|
||||||
<p>Use the <code>focus</code> trigger to dismiss popovers on their next click.</p>
|
<p>Use the <code>focus</code> trigger to dismiss popovers on their next click.</p>
|
||||||
<div class="bs-example" style="padding-bottom: 24px;">
|
<div class="bs-example" style="padding-bottom: 24px;">
|
||||||
<button type="button" class="btn btn-lg btn-danger bs-docs-popover-dismiss" data-toggle="popover" title="Dimissmisable popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissable popover</button>
|
<button type="button" class="btn btn-lg btn-danger bs-docs-popover-dismiss" data-toggle="popover" title="Dismissible popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</button>
|
||||||
</div>
|
</div>
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<button type="button" class="btn btn-lg btn-danger popover-dismiss" data-toggle="popover" title="Dimissmisable popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissable popover</button>
|
<button type="button" class="btn btn-lg btn-danger popover-dismiss" data-toggle="popover" title="Dismissible popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissible popover</button>
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
{% highlight js %}
|
{% highlight js %}
|
||||||
$('.popover-dismiss').popover({
|
$('.popover-dismiss').popover({
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@
|
||||||
<a href="#alerts">Alerts</a>
|
<a href="#alerts">Alerts</a>
|
||||||
<ul class="nav">
|
<ul class="nav">
|
||||||
<li><a href="#alerts-examples">Examples</a></li>
|
<li><a href="#alerts-examples">Examples</a></li>
|
||||||
<li><a href="#alerts-dismissable">Dismissable alerts</a></li>
|
<li><a href="#alerts-dismissible">Dismissible alerts</a></li>
|
||||||
<li><a href="#alerts-links">Links in alerts</a></li>
|
<li><a href="#alerts-links">Links in alerts</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@
|
||||||
<li><a href="#support-ie8-ie9">Internet Explorer 8-9</a></li>
|
<li><a href="#support-ie8-ie9">Internet Explorer 8-9</a></li>
|
||||||
<li><a href="#support-ie8-respondjs">IE8 and Respond.js</a></li>
|
<li><a href="#support-ie8-respondjs">IE8 and Respond.js</a></li>
|
||||||
<li><a href="#support-ie8-box-sizing">IE8 and box-sizing</a></li>
|
<li><a href="#support-ie8-box-sizing">IE8 and box-sizing</a></li>
|
||||||
|
<li><a href="#support-ie8-font-face">IE8 and @font-face</a></li>
|
||||||
<li><a href="#support-ie-compatibility-modes">IE Compatibility modes</a></li>
|
<li><a href="#support-ie-compatibility-modes">IE Compatibility modes</a></li>
|
||||||
<li><a href="#support-ie10-width">IE10 and Windows (Phone) 8</a></li>
|
<li><a href="#support-ie10-width">IE10 and Windows (Phone) 8</a></li>
|
||||||
<li><a href="#support-safari-percentages">Safari percent rounding</a></li>
|
<li><a href="#support-safari-percentages">Safari percent rounding</a></li>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
{{ content }}
|
{{ content }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="bs-docs-sidebar hidden-print" role="complementary">
|
<div class="bs-docs-sidebar hidden-print hidden-xs hidden-sm" role="complementary">
|
||||||
<ul class="nav bs-docs-sidenav">
|
<ul class="nav bs-docs-sidenav">
|
||||||
{% if page.slug == "getting-started" %}
|
{% if page.slug == "getting-started" %}
|
||||||
{% include nav/getting-started.html %}
|
{% include nav/getting-started.html %}
|
||||||
|
|
|
||||||
|
|
@ -857,7 +857,7 @@ h1[id] {
|
||||||
left: 15px;
|
left: 15px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #bbb;
|
color: #959595;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
content: "Example";
|
content: "Example";
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -233,7 +233,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||||
if (('variables.less' === filename) && vars) lessSource += generateCustomLess(vars)
|
if (('variables.less' === filename) && vars) lessSource += generateCustomLess(vars)
|
||||||
})
|
})
|
||||||
|
|
||||||
lessSource = lessSource.replace(/@import[^\n]*/gi, '') //strip any imports
|
lessSource = lessSource.replace(/@import[^\n]*/gi, '') // strip any imports
|
||||||
return lessSource
|
return lessSource
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,80 +0,0 @@
|
||||||
/*
|
|
||||||
* Row with equal height columns
|
|
||||||
* --------------------------------------------------
|
|
||||||
*/
|
|
||||||
.row-eq-height {
|
|
||||||
display: -webkit-box;
|
|
||||||
display: -webkit-flex;
|
|
||||||
display: -ms-flexbox;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Styles copied from the Grid example to make grid rows & columns visible.
|
|
||||||
*/
|
|
||||||
.container {
|
|
||||||
padding-right: 15px;
|
|
||||||
padding-left: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
margin-top: 25px;
|
|
||||||
}
|
|
||||||
.row {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.row .row {
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
[class*="col-"] {
|
|
||||||
padding-top: 15px;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
background-color: #eee;
|
|
||||||
background-color: rgba(86,61,124,.15);
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
border: 1px solid rgba(86,61,124,.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Callout styles copied from Bootstrap's main docs.
|
|
||||||
*/
|
|
||||||
/* Common styles for all types */
|
|
||||||
.bs-callout {
|
|
||||||
padding: 20px;
|
|
||||||
margin: 20px 0;
|
|
||||||
border-left: 3px solid #eee;
|
|
||||||
}
|
|
||||||
.bs-callout h4 {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
.bs-callout p:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
.bs-callout code {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
/* Variations */
|
|
||||||
.bs-callout-danger {
|
|
||||||
background-color: #fdf7f7;
|
|
||||||
border-color: #d9534f;
|
|
||||||
}
|
|
||||||
.bs-callout-danger h4 {
|
|
||||||
color: #d9534f;
|
|
||||||
}
|
|
||||||
.bs-callout-warning {
|
|
||||||
background-color: #fcf8f2;
|
|
||||||
border-color: #f0ad4e;
|
|
||||||
}
|
|
||||||
.bs-callout-warning h4 {
|
|
||||||
color: #f0ad4e;
|
|
||||||
}
|
|
||||||
.bs-callout-info {
|
|
||||||
background-color: #f4f8fa;
|
|
||||||
border-color: #5bc0de;
|
|
||||||
}
|
|
||||||
.bs-callout-info h4 {
|
|
||||||
color: #5bc0de;
|
|
||||||
}
|
|
||||||
|
|
@ -1,85 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<meta name="description" content="">
|
|
||||||
<meta name="author" content="">
|
|
||||||
<link rel="shortcut icon" href="../../assets/ico/favicon.ico">
|
|
||||||
|
|
||||||
<title>Equal Height Columns Example for Bootstrap</title>
|
|
||||||
|
|
||||||
<!-- Bootstrap core CSS -->
|
|
||||||
<link href="../../dist/css/bootstrap.min.css" rel="stylesheet">
|
|
||||||
|
|
||||||
<!-- Custom styles for this template -->
|
|
||||||
<link href="equal-height-columns.css" rel="stylesheet">
|
|
||||||
|
|
||||||
<!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
|
|
||||||
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
|
|
||||||
<script src="../../assets/js/ie-emulation-modes-warning.js"></script>
|
|
||||||
|
|
||||||
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
|
|
||||||
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
|
|
||||||
|
|
||||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
|
||||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="container">
|
|
||||||
|
|
||||||
<div class="page-header">
|
|
||||||
<h1>Bootstrap equal-height columns experiment</h1>
|
|
||||||
<p class="lead">A simple experiment that adds flexbox-based equal-height columns to Bootstrap's grid system.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>Normal row (with unequal-height columns)</h3>
|
|
||||||
<p>For comparison, here's a normal row, <strong>without</strong> <code>.row-eq-height</code>.</p>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-4">.row > .col-xs-4</div>
|
|
||||||
<div class="col-xs-4">.row > .col-xs-4<br>this is<br>a much<br>taller<br>column<br>than the others</div>
|
|
||||||
<div class="col-xs-4">.row > .col-xs-4</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<h3>Row with equal-height columns</h3>
|
|
||||||
<p>This row uses the custom <code>.row-eq-height</code> class defined in <a href="equal-height-columns.css">this example's CSS</a> to make all of its columns automatically be of equal height.</p>
|
|
||||||
<p>All of the columns will stretch vertically to occupy the same height as the tallest column.</p>
|
|
||||||
|
|
||||||
<div class="row row-eq-height">
|
|
||||||
<div class="col-xs-4">.row.row-eq-height > .col-xs-4</div>
|
|
||||||
<div class="col-xs-4">.row.row-eq-height > .col-xs-4<br>this is<br>a much<br>taller<br>column<br>than the others</div>
|
|
||||||
<div class="col-xs-4">.row.row-eq-height > .col-xs-4</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="bs-callout bs-callout-danger">
|
|
||||||
<h4>Warning: Browser compatibility</h4>
|
|
||||||
<p>The <code>.row-eq-height</code> class uses <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes">CSS3's flexbox layout mode</a>, which is not supported in Internet Explorer 9 and below.</p>
|
|
||||||
<p>In any unsupported browser, the <code>.row-eq-height</code> class will have no effect.</p>
|
|
||||||
<p>For more info on browser support for flexbox, please consult <a href="http://caniuse.com/flexbox">"Can I use..."</a>.</p>
|
|
||||||
</div>
|
|
||||||
<div class="bs-callout bs-callout-warning">
|
|
||||||
<h4>Warning: Changes column wrapping behavior</h4>
|
|
||||||
<p>If you have put more than 12 columns in one <code>.row-eq-height</code>, the columns will be forced to shrink into a single row, instead of wrapping onto a new line as they normally would.</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>Equal-height row with more than 12 columns</h3>
|
|
||||||
<div class="row row-eq-height">
|
|
||||||
<div class="col-xs-4">.row.row-eq-height > .col-xs-4</div>
|
|
||||||
<div class="col-xs-4">.row.row-eq-height > .col-xs-4</div>
|
|
||||||
<div class="col-xs-4">.row.row-eq-height > .col-xs-4</div>
|
|
||||||
<div class="col-xs-4">.row.row-eq-height > .col-xs-4<br>This and subsequent columns would normally have wrapped onto a new line,<br>if not for <code>.row-eq-height</code>.</div>
|
|
||||||
<div class="col-xs-4">.row.row-eq-height > .col-xs-4<br></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div> <!-- /container -->
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -485,6 +485,9 @@
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"><span class="sr-only">80% Complete (danger)</span></div>
|
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"><span class="sr-only">80% Complete (danger)</span></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="progress">
|
||||||
|
<div class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"><span class="sr-only">100% Complete</span></div>
|
||||||
|
</div>
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div class="progress-bar progress-bar-success" style="width: 35%"><span class="sr-only">35% Complete (success)</span></div>
|
<div class="progress-bar progress-bar-success" style="width: 35%"><span class="sr-only">35% Complete (success)</span></div>
|
||||||
<div class="progress-bar progress-bar-warning" style="width: 20%"><span class="sr-only">20% Complete (warning)</span></div>
|
<div class="progress-bar progress-bar-warning" style="width: 20%"><span class="sr-only">20% Complete (warning)</span></div>
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ title: Bootstrap
|
||||||
{% for showcase in site.data.showcase %}
|
{% for showcase in site.data.showcase %}
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<a href="{{ showcase.expo_url }}" target="_blank" title="{{ showcase.name }}">
|
<a href="{{ showcase.expo_url }}" target="_blank" title="{{ showcase.name }}">
|
||||||
<img src="{{ showcase.img }}" alt="{{ showcase.name }}" class="img-responsive">
|
<img src="http://expo.getbootstrap.com/screenshots/{{ showcase.img }}.jpg" alt="{{ showcase.name }}" class="img-responsive">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
/*!
|
|
||||||
* Bootstrap Grunt task for generating npm-shrinkwrap.canonical.json
|
|
||||||
* http://getbootstrap.com
|
|
||||||
* Copyright 2014 Twitter, Inc.
|
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
This Grunt task updates the npm-shrinkwrap.canonical.json file that's used as the key for Bootstrap's npm packages cache.
|
|
||||||
This task should be run and the updated file should be committed whenever Bootstrap's dependencies change.
|
|
||||||
*/
|
|
||||||
'use strict';
|
|
||||||
var canonicallyJsonStringify = require('canonical-json');
|
|
||||||
var NON_CANONICAL_FILE = 'npm-shrinkwrap.json';
|
|
||||||
var DEST_FILE = 'test-infra/npm-shrinkwrap.canonical.json';
|
|
||||||
|
|
||||||
|
|
||||||
function cleanup(shrinkwrap) {
|
|
||||||
// Remove `resolved` property to avoid irrelevant changes
|
|
||||||
// See https://github.com/npm/npm/issues/3581
|
|
||||||
if (typeof shrinkwrap === 'string') {
|
|
||||||
return shrinkwrap;
|
|
||||||
}
|
|
||||||
delete shrinkwrap.resolved;
|
|
||||||
for (var key in shrinkwrap) {
|
|
||||||
shrinkwrap[key] = cleanup(shrinkwrap[key]);
|
|
||||||
}
|
|
||||||
return shrinkwrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateShrinkwrap(grunt) {
|
|
||||||
// Assumption: Non-canonical shrinkwrap already generated by prerequisite Grunt task
|
|
||||||
var shrinkwrapData = grunt.file.readJSON(NON_CANONICAL_FILE);
|
|
||||||
grunt.log.writeln('Deleting ' + NON_CANONICAL_FILE.cyan + '...');
|
|
||||||
grunt.file.delete(NON_CANONICAL_FILE);
|
|
||||||
// Output as Canonical JSON in correct location
|
|
||||||
grunt.file.write(DEST_FILE, canonicallyJsonStringify(cleanup(shrinkwrapData)));
|
|
||||||
grunt.log.writeln('File ' + DEST_FILE.cyan + ' updated.');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = updateShrinkwrap;
|
|
||||||
11
js/.jscsrc
11
js/.jscsrc
|
|
@ -1,29 +1,30 @@
|
||||||
{
|
{
|
||||||
"disallowEmptyBlocks": true,
|
"disallowEmptyBlocks": true,
|
||||||
"disallowKeywords": ["with"],
|
"disallowKeywords": ["with"],
|
||||||
"disallowLeftStickedOperators": ["?", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
|
|
||||||
"disallowMixedSpacesAndTabs": true,
|
"disallowMixedSpacesAndTabs": true,
|
||||||
"disallowMultipleLineStrings": true,
|
"disallowMultipleLineStrings": true,
|
||||||
"disallowMultipleVarDecl": true,
|
"disallowMultipleVarDecl": true,
|
||||||
"disallowQuotedKeysInObjects": "allButReserved",
|
"disallowQuotedKeysInObjects": "allButReserved",
|
||||||
"disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
|
"disallowSpaceAfterPrefixUnaryOperators": ["!"],
|
||||||
|
"disallowSpaceBeforeBinaryOperators": [","],
|
||||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
||||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
||||||
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
|
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
|
||||||
"disallowSpacesInsideArrayBrackets": true,
|
"disallowSpacesInsideArrayBrackets": true,
|
||||||
"disallowTrailingComma": true,
|
|
||||||
"disallowSpacesInsideParentheses": true,
|
"disallowSpacesInsideParentheses": true,
|
||||||
|
"disallowTrailingComma": true,
|
||||||
"disallowTrailingWhitespace": true,
|
"disallowTrailingWhitespace": true,
|
||||||
|
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
||||||
"requireCapitalizedConstructors": true,
|
"requireCapitalizedConstructors": true,
|
||||||
"requireCommaBeforeLineBreak": true,
|
"requireCommaBeforeLineBreak": true,
|
||||||
"requireDotNotation": true,
|
"requireDotNotation": true,
|
||||||
"requireLeftStickedOperators": [","],
|
|
||||||
"requireLineFeedAtFileEnd": true,
|
"requireLineFeedAtFileEnd": true,
|
||||||
"requireRightStickedOperators": ["!"],
|
|
||||||
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
|
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
|
||||||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
|
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
|
||||||
|
"requireSpaceAfterLineComment": true,
|
||||||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
|
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
|
||||||
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true },
|
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true },
|
||||||
|
"requireSpacesInConditionalExpression": true,
|
||||||
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
|
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
|
||||||
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
|
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
|
||||||
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
|
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,5 @@
|
||||||
"nonbsp" : true,
|
"nonbsp" : true,
|
||||||
"strict" : true,
|
"strict" : true,
|
||||||
"undef" : true,
|
"undef" : true,
|
||||||
"unused" : true,
|
"unused" : true
|
||||||
"predef" : [ "define", "require" ]
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
210
js/affix.js
210
js/affix.js
|
|
@ -7,142 +7,136 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// AFFIX CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ======================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// AFFIX CLASS DEFINITION
|
var Affix = function (element, options) {
|
||||||
// ======================
|
this.options = $.extend({}, Affix.DEFAULTS, options)
|
||||||
|
|
||||||
var Affix = function (element, options) {
|
this.$target = $(this.options.target)
|
||||||
this.options = $.extend({}, Affix.DEFAULTS, options)
|
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
||||||
|
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
||||||
|
|
||||||
this.$target = $(this.options.target)
|
this.$element = $(element)
|
||||||
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
this.affixed =
|
||||||
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
this.unpin =
|
||||||
|
this.pinnedOffset = null
|
||||||
|
|
||||||
this.$element = $(element)
|
this.checkPosition()
|
||||||
this.affixed =
|
}
|
||||||
this.unpin =
|
|
||||||
this.pinnedOffset = null
|
|
||||||
|
|
||||||
this.checkPosition()
|
Affix.VERSION = '3.1.1'
|
||||||
}
|
|
||||||
|
|
||||||
Affix.VERSION = '3.1.1'
|
Affix.RESET = 'affix affix-top affix-bottom'
|
||||||
|
|
||||||
Affix.RESET = 'affix affix-top affix-bottom'
|
Affix.DEFAULTS = {
|
||||||
|
offset: 0,
|
||||||
|
target: window
|
||||||
|
}
|
||||||
|
|
||||||
Affix.DEFAULTS = {
|
Affix.prototype.getPinnedOffset = function () {
|
||||||
offset: 0,
|
if (this.pinnedOffset) return this.pinnedOffset
|
||||||
target: window
|
this.$element.removeClass(Affix.RESET).addClass('affix')
|
||||||
}
|
var scrollTop = this.$target.scrollTop()
|
||||||
|
var position = this.$element.offset()
|
||||||
|
return (this.pinnedOffset = position.top - scrollTop)
|
||||||
|
}
|
||||||
|
|
||||||
Affix.prototype.getPinnedOffset = function () {
|
Affix.prototype.checkPositionWithEventLoop = function () {
|
||||||
if (this.pinnedOffset) return this.pinnedOffset
|
setTimeout($.proxy(this.checkPosition, this), 1)
|
||||||
this.$element.removeClass(Affix.RESET).addClass('affix')
|
}
|
||||||
var scrollTop = this.$target.scrollTop()
|
|
||||||
var position = this.$element.offset()
|
|
||||||
return (this.pinnedOffset = position.top - scrollTop)
|
|
||||||
}
|
|
||||||
|
|
||||||
Affix.prototype.checkPositionWithEventLoop = function () {
|
Affix.prototype.checkPosition = function () {
|
||||||
setTimeout($.proxy(this.checkPosition, this), 1)
|
if (!this.$element.is(':visible')) return
|
||||||
}
|
|
||||||
|
|
||||||
Affix.prototype.checkPosition = function () {
|
var scrollHeight = $(document).height()
|
||||||
if (!this.$element.is(':visible')) return
|
var scrollTop = this.$target.scrollTop()
|
||||||
|
var position = this.$element.offset()
|
||||||
|
var offset = this.options.offset
|
||||||
|
var offsetTop = offset.top
|
||||||
|
var offsetBottom = offset.bottom
|
||||||
|
|
||||||
var scrollHeight = $(document).height()
|
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
||||||
var scrollTop = this.$target.scrollTop()
|
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
||||||
var position = this.$element.offset()
|
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
||||||
var offset = this.options.offset
|
|
||||||
var offsetTop = offset.top
|
|
||||||
var offsetBottom = offset.bottom
|
|
||||||
|
|
||||||
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
||||||
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
||||||
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
||||||
|
|
||||||
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
if (this.affixed === affix) return
|
||||||
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
if (this.unpin != null) this.$element.css('top', '')
|
||||||
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
|
||||||
|
|
||||||
if (this.affixed === affix) return
|
var affixType = 'affix' + (affix ? '-' + affix : '')
|
||||||
if (this.unpin != null) this.$element.css('top', '')
|
var e = $.Event(affixType + '.bs.affix')
|
||||||
|
|
||||||
var affixType = 'affix' + (affix ? '-' + affix : '')
|
this.$element.trigger(e)
|
||||||
var e = $.Event(affixType + '.bs.affix')
|
|
||||||
|
|
||||||
this.$element.trigger(e)
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
if (e.isDefaultPrevented()) return
|
this.affixed = affix
|
||||||
|
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
|
||||||
|
|
||||||
this.affixed = affix
|
this.$element
|
||||||
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
|
.removeClass(Affix.RESET)
|
||||||
|
.addClass(affixType)
|
||||||
|
.trigger($.Event(affixType.replace('affix', 'affixed')))
|
||||||
|
|
||||||
this.$element
|
if (affix == 'bottom') {
|
||||||
.removeClass(Affix.RESET)
|
this.$element.offset({
|
||||||
.addClass(affixType)
|
top: scrollHeight - this.$element.height() - offsetBottom
|
||||||
.trigger($.Event(affixType.replace('affix', 'affixed')))
|
|
||||||
|
|
||||||
if (affix == 'bottom') {
|
|
||||||
this.$element.offset({
|
|
||||||
top: scrollHeight - this.$element.height() - offsetBottom
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// AFFIX PLUGIN DEFINITION
|
|
||||||
// =======================
|
|
||||||
|
|
||||||
function Plugin(option) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.affix')
|
|
||||||
var options = typeof option == 'object' && option
|
|
||||||
|
|
||||||
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
|
||||||
if (typeof option == 'string') data[option]()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
var old = $.fn.affix
|
|
||||||
|
|
||||||
$.fn.affix = Plugin
|
|
||||||
$.fn.affix.Constructor = Affix
|
|
||||||
|
|
||||||
|
|
||||||
// AFFIX NO CONFLICT
|
// AFFIX PLUGIN DEFINITION
|
||||||
// =================
|
// =======================
|
||||||
|
|
||||||
$.fn.affix.noConflict = function () {
|
function Plugin(option) {
|
||||||
$.fn.affix = old
|
return this.each(function () {
|
||||||
return this
|
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)))
|
||||||
// AFFIX DATA-API
|
if (typeof option == 'string') data[option]()
|
||||||
// ==============
|
|
||||||
|
|
||||||
$(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
|
|
||||||
|
|
||||||
Plugin.call($spy, data)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = $.fn.affix
|
||||||
|
|
||||||
|
$.fn.affix = Plugin
|
||||||
|
$.fn.affix.Constructor = Affix
|
||||||
|
|
||||||
|
|
||||||
|
// AFFIX NO CONFLICT
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$.fn.affix.noConflict = function () {
|
||||||
|
$.fn.affix = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// AFFIX DATA-API
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
$(window).on('load', function () {
|
||||||
|
$('[data-spy="affix"]').each(function () {
|
||||||
|
var $spy = $(this)
|
||||||
|
var data = $spy.data()
|
||||||
|
|
||||||
|
data.offset = data.offset || {}
|
||||||
|
|
||||||
|
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
|
||||||
|
if (data.offsetTop) data.offset.top = data.offsetTop
|
||||||
|
|
||||||
|
Plugin.call($spy, data)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}();
|
}(jQuery);
|
||||||
|
|
|
||||||
128
js/alert.js
128
js/alert.js
|
|
@ -7,92 +7,86 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// ALERT CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ======================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// ALERT CLASS DEFINITION
|
var dismiss = '[data-dismiss="alert"]'
|
||||||
// ======================
|
var Alert = function (el) {
|
||||||
|
$(el).on('click', dismiss, this.close)
|
||||||
|
}
|
||||||
|
|
||||||
var dismiss = '[data-dismiss="alert"]'
|
Alert.VERSION = '3.1.1'
|
||||||
var Alert = function (el) {
|
|
||||||
$(el).on('click', dismiss, this.close)
|
Alert.prototype.close = function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
var selector = $this.attr('data-target')
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||||
}
|
}
|
||||||
|
|
||||||
Alert.VERSION = '3.1.1'
|
var $parent = $(selector)
|
||||||
|
|
||||||
Alert.prototype.close = function (e) {
|
if (e) e.preventDefault()
|
||||||
var $this = $(this)
|
|
||||||
var selector = $this.attr('data-target')
|
|
||||||
|
|
||||||
if (!selector) {
|
if (!$parent.length) {
|
||||||
selector = $this.attr('href')
|
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
||||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
|
||||||
}
|
|
||||||
|
|
||||||
var $parent = $(selector)
|
|
||||||
|
|
||||||
if (e) e.preventDefault()
|
|
||||||
|
|
||||||
if (!$parent.length) {
|
|
||||||
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
|
||||||
}
|
|
||||||
|
|
||||||
$parent.trigger(e = $.Event('close.bs.alert'))
|
|
||||||
|
|
||||||
if (e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
$parent.removeClass('in')
|
|
||||||
|
|
||||||
function removeElement() {
|
|
||||||
// detach from parent, fire event then clean up data
|
|
||||||
$parent.detach().trigger('closed.bs.alert').remove()
|
|
||||||
}
|
|
||||||
|
|
||||||
$.support.transition && $parent.hasClass('fade') ?
|
|
||||||
$parent
|
|
||||||
.one('bsTransitionEnd', removeElement)
|
|
||||||
.emulateTransitionEnd(150) :
|
|
||||||
removeElement()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$parent.trigger(e = $.Event('close.bs.alert'))
|
||||||
|
|
||||||
// ALERT PLUGIN DEFINITION
|
if (e.isDefaultPrevented()) return
|
||||||
// =======================
|
|
||||||
|
|
||||||
function Plugin(option) {
|
$parent.removeClass('in')
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.alert')
|
|
||||||
|
|
||||||
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
function removeElement() {
|
||||||
if (typeof option == 'string') data[option].call($this)
|
// detach from parent, fire event then clean up data
|
||||||
})
|
$parent.detach().trigger('closed.bs.alert').remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
var old = $.fn.alert
|
$.support.transition && $parent.hasClass('fade') ?
|
||||||
|
$parent
|
||||||
$.fn.alert = Plugin
|
.one('bsTransitionEnd', removeElement)
|
||||||
$.fn.alert.Constructor = Alert
|
.emulateTransitionEnd(150) :
|
||||||
|
removeElement()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ALERT NO CONFLICT
|
// ALERT PLUGIN DEFINITION
|
||||||
// =================
|
// =======================
|
||||||
|
|
||||||
$.fn.alert.noConflict = function () {
|
function Plugin(option) {
|
||||||
$.fn.alert = old
|
return this.each(function () {
|
||||||
return this
|
var $this = $(this)
|
||||||
}
|
var data = $this.data('bs.alert')
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
||||||
|
if (typeof option == 'string') data[option].call($this)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = $.fn.alert
|
||||||
|
|
||||||
|
$.fn.alert = Plugin
|
||||||
|
$.fn.alert.Constructor = Alert
|
||||||
|
|
||||||
|
|
||||||
// ALERT DATA-API
|
// ALERT NO CONFLICT
|
||||||
// ==============
|
// =================
|
||||||
|
|
||||||
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
$.fn.alert.noConflict = function () {
|
||||||
|
$.fn.alert = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}();
|
// ALERT DATA-API
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
||||||
|
|
||||||
|
}(jQuery);
|
||||||
|
|
|
||||||
164
js/button.js
164
js/button.js
|
|
@ -7,110 +7,104 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// BUTTON PUBLIC CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ==============================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// BUTTON PUBLIC CLASS DEFINITION
|
var Button = function (element, options) {
|
||||||
// ==============================
|
this.$element = $(element)
|
||||||
|
this.options = $.extend({}, Button.DEFAULTS, options)
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
|
||||||
var Button = function (element, options) {
|
Button.VERSION = '3.1.1'
|
||||||
this.$element = $(element)
|
|
||||||
this.options = $.extend({}, Button.DEFAULTS, options)
|
|
||||||
this.isLoading = false
|
|
||||||
}
|
|
||||||
|
|
||||||
Button.VERSION = '3.1.1'
|
Button.DEFAULTS = {
|
||||||
|
loadingText: 'loading...'
|
||||||
|
}
|
||||||
|
|
||||||
Button.DEFAULTS = {
|
Button.prototype.setState = function (state) {
|
||||||
loadingText: 'loading...'
|
var d = 'disabled'
|
||||||
}
|
var $el = this.$element
|
||||||
|
var val = $el.is('input') ? 'val' : 'html'
|
||||||
|
var data = $el.data()
|
||||||
|
|
||||||
Button.prototype.setState = function (state) {
|
state = state + 'Text'
|
||||||
var d = 'disabled'
|
|
||||||
var $el = this.$element
|
|
||||||
var val = $el.is('input') ? 'val' : 'html'
|
|
||||||
var data = $el.data()
|
|
||||||
|
|
||||||
state = state + 'Text'
|
if (data.resetText == null) $el.data('resetText', $el[val]())
|
||||||
|
|
||||||
if (data.resetText == null) $el.data('resetText', $el[val]())
|
$el[val](data[state] == null ? this.options[state] : data[state])
|
||||||
|
|
||||||
$el[val](data[state] == null ? this.options[state] : data[state])
|
// push to event loop to allow forms to submit
|
||||||
|
setTimeout($.proxy(function () {
|
||||||
// push to event loop to allow forms to submit
|
if (state == 'loadingText') {
|
||||||
setTimeout($.proxy(function () {
|
this.isLoading = true
|
||||||
if (state == 'loadingText') {
|
$el.addClass(d).attr(d, d)
|
||||||
this.isLoading = true
|
} else if (this.isLoading) {
|
||||||
$el.addClass(d).attr(d, d)
|
this.isLoading = false
|
||||||
} else if (this.isLoading) {
|
$el.removeClass(d).removeAttr(d)
|
||||||
this.isLoading = false
|
|
||||||
$el.removeClass(d).removeAttr(d)
|
|
||||||
}
|
|
||||||
}, this), 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
Button.prototype.toggle = function () {
|
|
||||||
var changed = true
|
|
||||||
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
|
||||||
|
|
||||||
if ($parent.length) {
|
|
||||||
var $input = this.$element.find('input')
|
|
||||||
if ($input.prop('type') == 'radio') {
|
|
||||||
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
|
|
||||||
else $parent.find('.active').removeClass('active')
|
|
||||||
}
|
|
||||||
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
|
||||||
}
|
}
|
||||||
|
}, this), 0)
|
||||||
|
}
|
||||||
|
|
||||||
if (changed) this.$element.toggleClass('active')
|
Button.prototype.toggle = function () {
|
||||||
|
var changed = true
|
||||||
|
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
||||||
|
|
||||||
|
if ($parent.length) {
|
||||||
|
var $input = this.$element.find('input')
|
||||||
|
if ($input.prop('type') == 'radio') {
|
||||||
|
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
|
||||||
|
else $parent.find('.active').removeClass('active')
|
||||||
|
}
|
||||||
|
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changed) this.$element.toggleClass('active')
|
||||||
// BUTTON PLUGIN DEFINITION
|
}
|
||||||
// ========================
|
|
||||||
|
|
||||||
function Plugin(option) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.button')
|
|
||||||
var options = typeof option == 'object' && option
|
|
||||||
|
|
||||||
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
|
||||||
|
|
||||||
if (option == 'toggle') data.toggle()
|
|
||||||
else if (option) data.setState(option)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var old = $.fn.button
|
|
||||||
|
|
||||||
$.fn.button = Plugin
|
|
||||||
$.fn.button.Constructor = Button
|
|
||||||
|
|
||||||
|
|
||||||
// BUTTON NO CONFLICT
|
// BUTTON PLUGIN DEFINITION
|
||||||
// ==================
|
// ========================
|
||||||
|
|
||||||
$.fn.button.noConflict = function () {
|
function Plugin(option) {
|
||||||
$.fn.button = old
|
return this.each(function () {
|
||||||
return this
|
var $this = $(this)
|
||||||
}
|
var data = $this.data('bs.button')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
||||||
|
|
||||||
// BUTTON DATA-API
|
if (option == 'toggle') data.toggle()
|
||||||
// ===============
|
else if (option) data.setState(option)
|
||||||
|
|
||||||
$(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
|
||||||
var $btn = $(e.target)
|
|
||||||
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
|
||||||
Plugin.call($btn, 'toggle')
|
|
||||||
e.preventDefault()
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = $.fn.button
|
||||||
|
|
||||||
|
$.fn.button = Plugin
|
||||||
|
$.fn.button.Constructor = Button
|
||||||
|
|
||||||
|
|
||||||
|
// BUTTON NO CONFLICT
|
||||||
|
// ==================
|
||||||
|
|
||||||
|
$.fn.button.noConflict = function () {
|
||||||
|
$.fn.button = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// BUTTON DATA-API
|
||||||
|
// ===============
|
||||||
|
|
||||||
|
$(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
||||||
|
var $btn = $(e.target)
|
||||||
|
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
||||||
|
Plugin.call($btn, 'toggle')
|
||||||
|
e.preventDefault()
|
||||||
})
|
})
|
||||||
|
|
||||||
}();
|
}(jQuery);
|
||||||
|
|
|
||||||
374
js/carousel.js
374
js/carousel.js
|
|
@ -7,223 +7,217 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// CAROUSEL CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// =========================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// CAROUSEL CLASS DEFINITION
|
var Carousel = function (element, options) {
|
||||||
// =========================
|
this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
|
||||||
|
this.$indicators = this.$element.find('.carousel-indicators')
|
||||||
|
this.options = options
|
||||||
|
this.paused =
|
||||||
|
this.sliding =
|
||||||
|
this.interval =
|
||||||
|
this.$active =
|
||||||
|
this.$items = null
|
||||||
|
|
||||||
var Carousel = function (element, options) {
|
this.options.pause == 'hover' && this.$element
|
||||||
this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
|
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
|
||||||
this.$indicators = this.$element.find('.carousel-indicators')
|
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
|
||||||
this.options = options
|
}
|
||||||
this.paused =
|
|
||||||
this.sliding =
|
|
||||||
this.interval =
|
|
||||||
this.$active =
|
|
||||||
this.$items = null
|
|
||||||
|
|
||||||
this.options.pause == 'hover' && this.$element
|
Carousel.VERSION = '3.1.1'
|
||||||
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
|
|
||||||
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
|
Carousel.DEFAULTS = {
|
||||||
|
interval: 5000,
|
||||||
|
pause: 'hover',
|
||||||
|
wrap: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.keydown = function (e) {
|
||||||
|
switch (e.which) {
|
||||||
|
case 37: this.prev(); break
|
||||||
|
case 39: this.next(); break
|
||||||
|
default: return
|
||||||
}
|
}
|
||||||
|
|
||||||
Carousel.VERSION = '3.1.1'
|
e.preventDefault()
|
||||||
|
}
|
||||||
|
|
||||||
Carousel.DEFAULTS = {
|
Carousel.prototype.cycle = function (e) {
|
||||||
interval: 5000,
|
e || (this.paused = false)
|
||||||
pause: 'hover',
|
|
||||||
wrap: true
|
this.interval && clearInterval(this.interval)
|
||||||
|
|
||||||
|
this.options.interval
|
||||||
|
&& !this.paused
|
||||||
|
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.getItemIndex = function (item) {
|
||||||
|
this.$items = item.parent().children('.item')
|
||||||
|
return this.$items.index(item || this.$active)
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.to = function (pos) {
|
||||||
|
var that = this
|
||||||
|
var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
|
||||||
|
|
||||||
|
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||||
|
|
||||||
|
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
|
||||||
|
if (activeIndex == pos) return this.pause().cycle()
|
||||||
|
|
||||||
|
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.pause = function (e) {
|
||||||
|
e || (this.paused = true)
|
||||||
|
|
||||||
|
if (this.$element.find('.next, .prev').length && $.support.transition) {
|
||||||
|
this.$element.trigger($.support.transition.end)
|
||||||
|
this.cycle(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
Carousel.prototype.keydown = function (e) {
|
this.interval = clearInterval(this.interval)
|
||||||
switch (e.which) {
|
|
||||||
case 37: this.prev(); break
|
|
||||||
case 39: this.next(); break
|
|
||||||
default: return
|
|
||||||
}
|
|
||||||
|
|
||||||
e.preventDefault()
|
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
|
||||||
|
|
||||||
|
if (!$next.length) {
|
||||||
|
if (!this.options.wrap) return
|
||||||
|
$next = this.$element.find('.item')[fallback]()
|
||||||
}
|
}
|
||||||
|
|
||||||
Carousel.prototype.cycle = function (e) {
|
if ($next.hasClass('active')) return (this.sliding = false)
|
||||||
e || (this.paused = false)
|
|
||||||
|
|
||||||
this.interval && clearInterval(this.interval)
|
var relatedTarget = $next[0]
|
||||||
|
var slideEvent = $.Event('slide.bs.carousel', {
|
||||||
|
relatedTarget: relatedTarget,
|
||||||
|
direction: direction
|
||||||
|
})
|
||||||
|
this.$element.trigger(slideEvent)
|
||||||
|
if (slideEvent.isDefaultPrevented()) return
|
||||||
|
|
||||||
this.options.interval
|
this.sliding = true
|
||||||
&& !this.paused
|
|
||||||
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
|
||||||
|
|
||||||
return this
|
isCycling && this.pause()
|
||||||
|
|
||||||
|
if (this.$indicators.length) {
|
||||||
|
this.$indicators.find('.active').removeClass('active')
|
||||||
|
var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
|
||||||
|
$nextIndicator && $nextIndicator.addClass('active')
|
||||||
}
|
}
|
||||||
|
|
||||||
Carousel.prototype.getItemIndex = function (item) {
|
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
|
||||||
this.$items = item.parent().children('.item')
|
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||||
return this.$items.index(item || this.$active)
|
$next.addClass(type)
|
||||||
|
$next[0].offsetWidth // force reflow
|
||||||
|
$active.addClass(direction)
|
||||||
|
$next.addClass(direction)
|
||||||
|
$active
|
||||||
|
.one('bsTransitionEnd', function () {
|
||||||
|
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||||
|
$active.removeClass(['active', direction].join(' '))
|
||||||
|
that.sliding = false
|
||||||
|
setTimeout(function () {
|
||||||
|
that.$element.trigger(slidEvent)
|
||||||
|
}, 0)
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
|
||||||
|
} else {
|
||||||
|
$active.removeClass('active')
|
||||||
|
$next.addClass('active')
|
||||||
|
this.sliding = false
|
||||||
|
this.$element.trigger(slidEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
Carousel.prototype.to = function (pos) {
|
isCycling && this.cycle()
|
||||||
var that = this
|
|
||||||
var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
|
|
||||||
|
|
||||||
if (pos > (this.$items.length - 1) || pos < 0) return
|
return this
|
||||||
|
}
|
||||||
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
|
|
||||||
if (activeIndex == pos) return this.pause().cycle()
|
|
||||||
|
|
||||||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
|
||||||
}
|
|
||||||
|
|
||||||
Carousel.prototype.pause = function (e) {
|
|
||||||
e || (this.paused = true)
|
|
||||||
|
|
||||||
if (this.$element.find('.next, .prev').length && $.support.transition) {
|
|
||||||
this.$element.trigger($.support.transition.end)
|
|
||||||
this.cycle(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
this.interval = clearInterval(this.interval)
|
|
||||||
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
Carousel.prototype.next = function () {
|
|
||||||
if (this.sliding) return
|
|
||||||
return this.slide('next')
|
|
||||||
}
|
|
||||||
|
|
||||||
Carousel.prototype.prev = function () {
|
|
||||||
if (this.sliding) return
|
|
||||||
return this.slide('prev')
|
|
||||||
}
|
|
||||||
|
|
||||||
Carousel.prototype.slide = function (type, next) {
|
|
||||||
var $active = this.$element.find('.item.active')
|
|
||||||
var $next = next || $active[type]()
|
|
||||||
var isCycling = this.interval
|
|
||||||
var direction = type == 'next' ? 'left' : 'right'
|
|
||||||
var fallback = type == 'next' ? 'first' : 'last'
|
|
||||||
var that = this
|
|
||||||
|
|
||||||
if (!$next.length) {
|
|
||||||
if (!this.options.wrap) return
|
|
||||||
$next = this.$element.find('.item')[fallback]()
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($next.hasClass('active')) return (this.sliding = false)
|
|
||||||
|
|
||||||
var relatedTarget = $next[0]
|
|
||||||
var slideEvent = $.Event('slide.bs.carousel', {
|
|
||||||
relatedTarget: relatedTarget,
|
|
||||||
direction: direction
|
|
||||||
})
|
|
||||||
this.$element.trigger(slideEvent)
|
|
||||||
if (slideEvent.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
this.sliding = true
|
|
||||||
|
|
||||||
isCycling && this.pause()
|
|
||||||
|
|
||||||
if (this.$indicators.length) {
|
|
||||||
this.$indicators.find('.active').removeClass('active')
|
|
||||||
var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
|
|
||||||
$nextIndicator && $nextIndicator.addClass('active')
|
|
||||||
}
|
|
||||||
|
|
||||||
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
|
|
||||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
|
||||||
$next.addClass(type)
|
|
||||||
$next[0].offsetWidth // force reflow
|
|
||||||
$active.addClass(direction)
|
|
||||||
$next.addClass(direction)
|
|
||||||
$active
|
|
||||||
.one('bsTransitionEnd', function () {
|
|
||||||
$next.removeClass([type, direction].join(' ')).addClass('active')
|
|
||||||
$active.removeClass(['active', direction].join(' '))
|
|
||||||
that.sliding = false
|
|
||||||
setTimeout(function () {
|
|
||||||
that.$element.trigger(slidEvent)
|
|
||||||
}, 0)
|
|
||||||
})
|
|
||||||
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
|
|
||||||
} else {
|
|
||||||
$active.removeClass('active')
|
|
||||||
$next.addClass('active')
|
|
||||||
this.sliding = false
|
|
||||||
this.$element.trigger(slidEvent)
|
|
||||||
}
|
|
||||||
|
|
||||||
isCycling && this.cycle()
|
|
||||||
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CAROUSEL PLUGIN DEFINITION
|
// CAROUSEL PLUGIN DEFINITION
|
||||||
// ==========================
|
// ==========================
|
||||||
|
|
||||||
function Plugin(option) {
|
function Plugin(option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.carousel')
|
|
||||||
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
|
||||||
var action = typeof option == 'string' ? option : options.slide
|
|
||||||
|
|
||||||
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
|
||||||
if (typeof option == 'number') data.to(option)
|
|
||||||
else if (action) data[action]()
|
|
||||||
else if (options.interval) data.pause().cycle()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var old = $.fn.carousel
|
|
||||||
|
|
||||||
$.fn.carousel = Plugin
|
|
||||||
$.fn.carousel.Constructor = Carousel
|
|
||||||
|
|
||||||
|
|
||||||
// CAROUSEL NO CONFLICT
|
|
||||||
// ====================
|
|
||||||
|
|
||||||
$.fn.carousel.noConflict = function () {
|
|
||||||
$.fn.carousel = old
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CAROUSEL DATA-API
|
|
||||||
// =================
|
|
||||||
|
|
||||||
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
|
||||||
var href
|
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
var data = $this.data('bs.carousel')
|
||||||
if (!$target.hasClass('carousel')) return
|
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||||
var options = $.extend({}, $target.data(), $this.data())
|
var action = typeof option == 'string' ? option : options.slide
|
||||||
var slideIndex = $this.attr('data-slide-to')
|
|
||||||
if (slideIndex) options.interval = false
|
|
||||||
|
|
||||||
Plugin.call($target, options)
|
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
||||||
|
if (typeof option == 'number') data.to(option)
|
||||||
if (slideIndex) {
|
else if (action) data[action]()
|
||||||
$target.data('bs.carousel').to(slideIndex)
|
else if (options.interval) data.pause().cycle()
|
||||||
}
|
|
||||||
|
|
||||||
e.preventDefault()
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
$(window).on('load', function () {
|
var old = $.fn.carousel
|
||||||
$('[data-ride="carousel"]').each(function () {
|
|
||||||
var $carousel = $(this)
|
|
||||||
Plugin.call($carousel, $carousel.data())
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
|
$.fn.carousel = Plugin
|
||||||
|
$.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 href
|
||||||
|
var $this = $(this)
|
||||||
|
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
|
||||||
|
if (!$target.hasClass('carousel')) return
|
||||||
|
var options = $.extend({}, $target.data(), $this.data())
|
||||||
|
var slideIndex = $this.attr('data-slide-to')
|
||||||
|
if (slideIndex) options.interval = false
|
||||||
|
|
||||||
|
Plugin.call($target, options)
|
||||||
|
|
||||||
|
if (slideIndex) {
|
||||||
|
$target.data('bs.carousel').to(slideIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
e.preventDefault()
|
||||||
})
|
})
|
||||||
|
|
||||||
}();
|
$(window).on('load', function () {
|
||||||
|
$('[data-ride="carousel"]').each(function () {
|
||||||
|
var $carousel = $(this)
|
||||||
|
Plugin.call($carousel, $carousel.data())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
||||||
|
|
|
||||||
270
js/collapse.js
270
js/collapse.js
|
|
@ -7,170 +7,164 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// COLLAPSE PUBLIC CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ================================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// COLLAPSE PUBLIC CLASS DEFINITION
|
var Collapse = function (element, options) {
|
||||||
// ================================
|
this.$element = $(element)
|
||||||
|
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
||||||
|
this.transitioning = null
|
||||||
|
|
||||||
var Collapse = function (element, options) {
|
if (this.options.parent) this.$parent = $(this.options.parent)
|
||||||
this.$element = $(element)
|
if (this.options.toggle) this.toggle()
|
||||||
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
}
|
||||||
this.transitioning = null
|
|
||||||
|
|
||||||
if (this.options.parent) this.$parent = $(this.options.parent)
|
Collapse.VERSION = '3.1.1'
|
||||||
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 startEvent = $.Event('show.bs.collapse')
|
||||||
|
this.$element.trigger(startEvent)
|
||||||
|
if (startEvent.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
||||||
|
|
||||||
|
if (actives && actives.length) {
|
||||||
|
var hasData = actives.data('bs.collapse')
|
||||||
|
if (hasData && hasData.transitioning) return
|
||||||
|
Plugin.call(actives, 'hide')
|
||||||
|
hasData || actives.data('bs.collapse', null)
|
||||||
}
|
}
|
||||||
|
|
||||||
Collapse.VERSION = '3.1.1'
|
var dimension = this.dimension()
|
||||||
|
|
||||||
Collapse.DEFAULTS = {
|
this.$element
|
||||||
toggle: true
|
.removeClass('collapse')
|
||||||
}
|
.addClass('collapsing')[dimension](0)
|
||||||
|
|
||||||
Collapse.prototype.dimension = function () {
|
this.transitioning = 1
|
||||||
var hasWidth = this.$element.hasClass('width')
|
|
||||||
return hasWidth ? 'width' : 'height'
|
|
||||||
}
|
|
||||||
|
|
||||||
Collapse.prototype.show = function () {
|
|
||||||
if (this.transitioning || this.$element.hasClass('in')) return
|
|
||||||
|
|
||||||
var startEvent = $.Event('show.bs.collapse')
|
|
||||||
this.$element.trigger(startEvent)
|
|
||||||
if (startEvent.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
|
||||||
|
|
||||||
if (actives && actives.length) {
|
|
||||||
var hasData = actives.data('bs.collapse')
|
|
||||||
if (hasData && hasData.transitioning) return
|
|
||||||
Plugin.call(actives, 'hide')
|
|
||||||
hasData || actives.data('bs.collapse', null)
|
|
||||||
}
|
|
||||||
|
|
||||||
var dimension = this.dimension()
|
|
||||||
|
|
||||||
|
var complete = function () {
|
||||||
this.$element
|
this.$element
|
||||||
.removeClass('collapse')
|
.removeClass('collapsing')
|
||||||
.addClass('collapsing')[dimension](0)
|
.addClass('collapse in')[dimension]('')
|
||||||
|
this.transitioning = 0
|
||||||
this.transitioning = 1
|
|
||||||
|
|
||||||
var complete = function () {
|
|
||||||
this.$element
|
|
||||||
.removeClass('collapsing')
|
|
||||||
.addClass('collapse in')[dimension]('')
|
|
||||||
this.transitioning = 0
|
|
||||||
this.$element
|
|
||||||
.trigger('shown.bs.collapse')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$.support.transition) return complete.call(this)
|
|
||||||
|
|
||||||
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
|
||||||
|
|
||||||
this.$element
|
this.$element
|
||||||
.one('bsTransitionEnd', $.proxy(complete, this))
|
.trigger('shown.bs.collapse')
|
||||||
.emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Collapse.prototype.hide = function () {
|
if (!$.support.transition) return complete.call(this)
|
||||||
if (this.transitioning || !this.$element.hasClass('in')) return
|
|
||||||
|
|
||||||
var startEvent = $.Event('hide.bs.collapse')
|
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
||||||
this.$element.trigger(startEvent)
|
|
||||||
if (startEvent.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
var dimension = this.dimension()
|
this.$element
|
||||||
|
.one('bsTransitionEnd', $.proxy(complete, this))
|
||||||
|
.emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
|
||||||
|
}
|
||||||
|
|
||||||
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
|
Collapse.prototype.hide = function () {
|
||||||
|
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||||
|
|
||||||
|
var startEvent = $.Event('hide.bs.collapse')
|
||||||
|
this.$element.trigger(startEvent)
|
||||||
|
if (startEvent.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var dimension = this.dimension()
|
||||||
|
|
||||||
|
this.$element[dimension](this.$element[dimension]())[0].offsetHeight
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.addClass('collapsing')
|
||||||
|
.removeClass('collapse')
|
||||||
|
.removeClass('in')
|
||||||
|
|
||||||
|
this.transitioning = 1
|
||||||
|
|
||||||
|
var complete = function () {
|
||||||
|
this.transitioning = 0
|
||||||
this.$element
|
this.$element
|
||||||
.addClass('collapsing')
|
.trigger('hidden.bs.collapse')
|
||||||
.removeClass('collapse')
|
.removeClass('collapsing')
|
||||||
.removeClass('in')
|
.addClass('collapse')
|
||||||
|
|
||||||
this.transitioning = 1
|
|
||||||
|
|
||||||
var complete = function () {
|
|
||||||
this.transitioning = 0
|
|
||||||
this.$element
|
|
||||||
.trigger('hidden.bs.collapse')
|
|
||||||
.removeClass('collapsing')
|
|
||||||
.addClass('collapse')
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$.support.transition) return complete.call(this)
|
|
||||||
|
|
||||||
this.$element
|
|
||||||
[dimension](0)
|
|
||||||
.one('bsTransitionEnd', $.proxy(complete, this))
|
|
||||||
.emulateTransitionEnd(350)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Collapse.prototype.toggle = function () {
|
if (!$.support.transition) return complete.call(this)
|
||||||
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
|
||||||
}
|
this.$element
|
||||||
|
[dimension](0)
|
||||||
|
.one('bsTransitionEnd', $.proxy(complete, this))
|
||||||
|
.emulateTransitionEnd(350)
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.prototype.toggle = function () {
|
||||||
|
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// COLLAPSE PLUGIN DEFINITION
|
// COLLAPSE PLUGIN DEFINITION
|
||||||
// ==========================
|
// ==========================
|
||||||
|
|
||||||
function Plugin(option) {
|
function Plugin(option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.collapse')
|
|
||||||
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
|
||||||
|
|
||||||
if (!data && options.toggle && option == 'show') option = !option
|
|
||||||
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
|
||||||
if (typeof option == 'string') data[option]()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var old = $.fn.collapse
|
|
||||||
|
|
||||||
$.fn.collapse = Plugin
|
|
||||||
$.fn.collapse.Constructor = Collapse
|
|
||||||
|
|
||||||
|
|
||||||
// COLLAPSE NO CONFLICT
|
|
||||||
// ====================
|
|
||||||
|
|
||||||
$.fn.collapse.noConflict = function () {
|
|
||||||
$.fn.collapse = old
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// COLLAPSE DATA-API
|
|
||||||
// =================
|
|
||||||
|
|
||||||
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
|
|
||||||
var href
|
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
var target = $this.attr('data-target')
|
var data = $this.data('bs.collapse')
|
||||||
|| e.preventDefault()
|
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
|
||||||
var $target = $(target)
|
|
||||||
var data = $target.data('bs.collapse')
|
|
||||||
var option = data ? 'toggle' : $this.data()
|
|
||||||
var parent = $this.attr('data-parent')
|
|
||||||
var $parent = parent && $(parent)
|
|
||||||
|
|
||||||
if (!data || !data.transitioning) {
|
if (!data && options.toggle && option == 'show') option = !option
|
||||||
if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
||||||
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
if (typeof option == 'string') data[option]()
|
||||||
}
|
|
||||||
|
|
||||||
Plugin.call($target, option)
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = $.fn.collapse
|
||||||
|
|
||||||
|
$.fn.collapse = Plugin
|
||||||
|
$.fn.collapse.Constructor = Collapse
|
||||||
|
|
||||||
|
|
||||||
|
// COLLAPSE NO CONFLICT
|
||||||
|
// ====================
|
||||||
|
|
||||||
|
$.fn.collapse.noConflict = function () {
|
||||||
|
$.fn.collapse = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// COLLAPSE DATA-API
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
|
||||||
|
var href
|
||||||
|
var $this = $(this)
|
||||||
|
var target = $this.attr('data-target')
|
||||||
|
|| e.preventDefault()
|
||||||
|
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
||||||
|
var $target = $(target)
|
||||||
|
var data = $target.data('bs.collapse')
|
||||||
|
var option = data ? 'toggle' : $this.data()
|
||||||
|
var parent = $this.attr('data-parent')
|
||||||
|
var $parent = parent && $(parent)
|
||||||
|
|
||||||
|
if (!data || !data.transitioning) {
|
||||||
|
if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
||||||
|
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugin.call($target, option)
|
||||||
})
|
})
|
||||||
|
|
||||||
}();
|
}(jQuery);
|
||||||
|
|
|
||||||
256
js/dropdown.js
256
js/dropdown.js
|
|
@ -7,151 +7,145 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// DROPDOWN CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// =========================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// DROPDOWN CLASS DEFINITION
|
var backdrop = '.dropdown-backdrop'
|
||||||
// =========================
|
var toggle = '[data-toggle="dropdown"]'
|
||||||
|
var Dropdown = function (element) {
|
||||||
|
$(element).on('click.bs.dropdown', this.toggle)
|
||||||
|
}
|
||||||
|
|
||||||
var backdrop = '.dropdown-backdrop'
|
Dropdown.VERSION = '3.1.1'
|
||||||
var toggle = '[data-toggle="dropdown"]'
|
|
||||||
var Dropdown = function (element) {
|
Dropdown.prototype.toggle = function (e) {
|
||||||
$(element).on('click.bs.dropdown', this.toggle)
|
var $this = $(this)
|
||||||
|
|
||||||
|
if ($this.is('.disabled, :disabled')) return
|
||||||
|
|
||||||
|
var $parent = getParent($this)
|
||||||
|
var isActive = $parent.hasClass('open')
|
||||||
|
|
||||||
|
clearMenus()
|
||||||
|
|
||||||
|
if (!isActive) {
|
||||||
|
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
||||||
|
// if mobile we use a backdrop because click events don't delegate
|
||||||
|
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
||||||
|
}
|
||||||
|
|
||||||
|
var relatedTarget = { relatedTarget: this }
|
||||||
|
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$this.trigger('focus')
|
||||||
|
|
||||||
|
$parent
|
||||||
|
.toggleClass('open')
|
||||||
|
.trigger('shown.bs.dropdown', relatedTarget)
|
||||||
}
|
}
|
||||||
|
|
||||||
Dropdown.VERSION = '3.1.1'
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
Dropdown.prototype.toggle = function (e) {
|
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).trigger('focus')
|
||||||
|
return $this.trigger('click')
|
||||||
|
}
|
||||||
|
|
||||||
|
var desc = ' li:not(.divider):visible a'
|
||||||
|
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
|
||||||
|
|
||||||
|
if (!$items.length) return
|
||||||
|
|
||||||
|
var index = $items.index($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).trigger('focus')
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearMenus(e) {
|
||||||
|
if (e && e.which === 3) return
|
||||||
|
$(backdrop).remove()
|
||||||
|
$(toggle).each(function () {
|
||||||
|
var $parent = getParent($(this))
|
||||||
|
var relatedTarget = { relatedTarget: this }
|
||||||
|
if (!$parent.hasClass('open')) return
|
||||||
|
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function getParent($this) {
|
||||||
|
var selector = $this.attr('data-target')
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
|
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||||
|
}
|
||||||
|
|
||||||
|
var $parent = selector && $(selector)
|
||||||
|
|
||||||
|
return $parent && $parent.length ? $parent : $this.parent()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DROPDOWN PLUGIN DEFINITION
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
function Plugin(option) {
|
||||||
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.dropdown')
|
||||||
|
|
||||||
if ($this.is('.disabled, :disabled')) return
|
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
||||||
|
if (typeof option == 'string') data[option].call($this)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
var $parent = getParent($this)
|
var old = $.fn.dropdown
|
||||||
var isActive = $parent.hasClass('open')
|
|
||||||
|
|
||||||
clearMenus()
|
$.fn.dropdown = Plugin
|
||||||
|
$.fn.dropdown.Constructor = Dropdown
|
||||||
if (!isActive) {
|
|
||||||
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
|
||||||
// if mobile we use a backdrop because click events don't delegate
|
|
||||||
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
|
||||||
}
|
|
||||||
|
|
||||||
var relatedTarget = { relatedTarget: this }
|
|
||||||
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
|
||||||
|
|
||||||
if (e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
$this.trigger('focus')
|
|
||||||
|
|
||||||
$parent
|
|
||||||
.toggleClass('open')
|
|
||||||
.trigger('shown.bs.dropdown', relatedTarget)
|
|
||||||
}
|
|
||||||
|
|
||||||
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).trigger('focus')
|
|
||||||
return $this.trigger('click')
|
|
||||||
}
|
|
||||||
|
|
||||||
var desc = ' li:not(.divider):visible a'
|
|
||||||
var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
|
|
||||||
|
|
||||||
if (!$items.length) return
|
|
||||||
|
|
||||||
var index = $items.index($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).trigger('focus')
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearMenus(e) {
|
|
||||||
if (e && e.which === 3) return
|
|
||||||
$(backdrop).remove()
|
|
||||||
$(toggle).each(function () {
|
|
||||||
var $parent = getParent($(this))
|
|
||||||
var relatedTarget = { relatedTarget: this }
|
|
||||||
if (!$parent.hasClass('open')) return
|
|
||||||
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
|
||||||
if (e.isDefaultPrevented()) return
|
|
||||||
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function getParent($this) {
|
|
||||||
var selector = $this.attr('data-target')
|
|
||||||
|
|
||||||
if (!selector) {
|
|
||||||
selector = $this.attr('href')
|
|
||||||
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
|
||||||
}
|
|
||||||
|
|
||||||
var $parent = selector && $(selector)
|
|
||||||
|
|
||||||
return $parent && $parent.length ? $parent : $this.parent()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// DROPDOWN PLUGIN DEFINITION
|
// DROPDOWN NO CONFLICT
|
||||||
// ==========================
|
// ====================
|
||||||
|
|
||||||
function Plugin(option) {
|
$.fn.dropdown.noConflict = function () {
|
||||||
return this.each(function () {
|
$.fn.dropdown = old
|
||||||
var $this = $(this)
|
return this
|
||||||
var data = $this.data('bs.dropdown')
|
}
|
||||||
|
|
||||||
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
|
||||||
if (typeof option == 'string') data[option].call($this)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var old = $.fn.dropdown
|
|
||||||
|
|
||||||
$.fn.dropdown = Plugin
|
|
||||||
$.fn.dropdown.Constructor = Dropdown
|
|
||||||
|
|
||||||
|
|
||||||
// DROPDOWN NO CONFLICT
|
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
||||||
// ====================
|
// ===================================
|
||||||
|
|
||||||
$.fn.dropdown.noConflict = function () {
|
$(document)
|
||||||
$.fn.dropdown = old
|
.on('click.bs.dropdown.data-api', clearMenus)
|
||||||
return this
|
.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"], [role="listbox"]', Dropdown.prototype.keydown)
|
||||||
|
|
||||||
|
}(jQuery);
|
||||||
// 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"], [role="listbox"]', Dropdown.prototype.keydown)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}();
|
|
||||||
|
|
|
||||||
528
js/modal.js
528
js/modal.js
|
|
@ -7,280 +7,274 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// MODAL CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ======================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// MODAL CLASS DEFINITION
|
var Modal = function (element, options) {
|
||||||
// ======================
|
this.options = options
|
||||||
|
this.$body = $(document.body)
|
||||||
var Modal = function (element, options) {
|
this.$element = $(element)
|
||||||
this.options = options
|
this.$backdrop =
|
||||||
this.$body = $(document.body)
|
this.isShown = null
|
||||||
this.$element = $(element)
|
this.scrollbarWidth = 0
|
||||||
this.$backdrop =
|
|
||||||
this.isShown = null
|
|
||||||
this.scrollbarWidth = 0
|
|
||||||
|
|
||||||
if (this.options.remote) {
|
|
||||||
this.$element
|
|
||||||
.find('.modal-content')
|
|
||||||
.load(this.options.remote, $.proxy(function () {
|
|
||||||
this.$element.trigger('loaded.bs.modal')
|
|
||||||
}, this))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.VERSION = '3.1.1'
|
|
||||||
|
|
||||||
Modal.DEFAULTS = {
|
|
||||||
backdrop: true,
|
|
||||||
keyboard: true,
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.toggle = function (_relatedTarget) {
|
|
||||||
return this.isShown ? this.hide() : this.show(_relatedTarget)
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.show = function (_relatedTarget) {
|
|
||||||
var that = this
|
|
||||||
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
|
||||||
|
|
||||||
this.$element.trigger(e)
|
|
||||||
|
|
||||||
if (this.isShown || e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
this.isShown = true
|
|
||||||
|
|
||||||
this.checkScrollbar()
|
|
||||||
this.$body.addClass('modal-open')
|
|
||||||
|
|
||||||
this.setScrollbar()
|
|
||||||
this.escape()
|
|
||||||
|
|
||||||
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
|
||||||
|
|
||||||
this.backdrop(function () {
|
|
||||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
|
||||||
|
|
||||||
if (!that.$element.parent().length) {
|
|
||||||
that.$element.appendTo(that.$body) // don't move modals dom position
|
|
||||||
}
|
|
||||||
|
|
||||||
that.$element
|
|
||||||
.show()
|
|
||||||
.scrollTop(0)
|
|
||||||
|
|
||||||
if (transition) {
|
|
||||||
that.$element[0].offsetWidth // force reflow
|
|
||||||
}
|
|
||||||
|
|
||||||
that.$element
|
|
||||||
.addClass('in')
|
|
||||||
.attr('aria-hidden', false)
|
|
||||||
|
|
||||||
that.enforceFocus()
|
|
||||||
|
|
||||||
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
|
||||||
|
|
||||||
transition ?
|
|
||||||
that.$element.find('.modal-dialog') // wait for modal to slide in
|
|
||||||
.one('bsTransitionEnd', function () {
|
|
||||||
that.$element.trigger('focus').trigger(e)
|
|
||||||
})
|
|
||||||
.emulateTransitionEnd(300) :
|
|
||||||
that.$element.trigger('focus').trigger(e)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.hide = function (e) {
|
|
||||||
if (e) e.preventDefault()
|
|
||||||
|
|
||||||
e = $.Event('hide.bs.modal')
|
|
||||||
|
|
||||||
this.$element.trigger(e)
|
|
||||||
|
|
||||||
if (!this.isShown || e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
this.isShown = false
|
|
||||||
|
|
||||||
this.$body.removeClass('modal-open')
|
|
||||||
|
|
||||||
this.resetScrollbar()
|
|
||||||
this.escape()
|
|
||||||
|
|
||||||
$(document).off('focusin.bs.modal')
|
|
||||||
|
|
||||||
|
if (this.options.remote) {
|
||||||
this.$element
|
this.$element
|
||||||
.removeClass('in')
|
.find('.modal-content')
|
||||||
.attr('aria-hidden', true)
|
.load(this.options.remote, $.proxy(function () {
|
||||||
.off('click.dismiss.bs.modal')
|
this.$element.trigger('loaded.bs.modal')
|
||||||
|
}, this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.support.transition && this.$element.hasClass('fade') ?
|
Modal.VERSION = '3.1.1'
|
||||||
this.$element
|
|
||||||
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
|
Modal.DEFAULTS = {
|
||||||
|
backdrop: true,
|
||||||
|
keyboard: true,
|
||||||
|
show: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.toggle = function (_relatedTarget) {
|
||||||
|
return this.isShown ? this.hide() : this.show(_relatedTarget)
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.show = function (_relatedTarget) {
|
||||||
|
var that = this
|
||||||
|
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (this.isShown || e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
this.isShown = true
|
||||||
|
|
||||||
|
this.checkScrollbar()
|
||||||
|
this.$body.addClass('modal-open')
|
||||||
|
|
||||||
|
this.setScrollbar()
|
||||||
|
this.escape()
|
||||||
|
|
||||||
|
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
||||||
|
|
||||||
|
this.backdrop(function () {
|
||||||
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||||
|
|
||||||
|
if (!that.$element.parent().length) {
|
||||||
|
that.$element.appendTo(that.$body) // don't move modals dom position
|
||||||
|
}
|
||||||
|
|
||||||
|
that.$element
|
||||||
|
.show()
|
||||||
|
.scrollTop(0)
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
that.$element[0].offsetWidth // force reflow
|
||||||
|
}
|
||||||
|
|
||||||
|
that.$element
|
||||||
|
.addClass('in')
|
||||||
|
.attr('aria-hidden', false)
|
||||||
|
|
||||||
|
that.enforceFocus()
|
||||||
|
|
||||||
|
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
||||||
|
|
||||||
|
transition ?
|
||||||
|
that.$element.find('.modal-dialog') // wait for modal to slide in
|
||||||
|
.one('bsTransitionEnd', function () {
|
||||||
|
that.$element.trigger('focus').trigger(e)
|
||||||
|
})
|
||||||
.emulateTransitionEnd(300) :
|
.emulateTransitionEnd(300) :
|
||||||
this.hideModal()
|
that.$element.trigger('focus').trigger(e)
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.enforceFocus = function () {
|
|
||||||
$(document)
|
|
||||||
.off('focusin.bs.modal') // guard against infinite focus loop
|
|
||||||
.on('focusin.bs.modal', $.proxy(function (e) {
|
|
||||||
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
|
||||||
this.$element.trigger('focus')
|
|
||||||
}
|
|
||||||
}, this))
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.escape = function () {
|
|
||||||
if (this.isShown && this.options.keyboard) {
|
|
||||||
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
|
||||||
e.which == 27 && this.hide()
|
|
||||||
}, this))
|
|
||||||
} else if (!this.isShown) {
|
|
||||||
this.$element.off('keyup.dismiss.bs.modal')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.hideModal = function () {
|
|
||||||
var that = this
|
|
||||||
this.$element.hide()
|
|
||||||
this.backdrop(function () {
|
|
||||||
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(this.$body)
|
|
||||||
|
|
||||||
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
|
||||||
if (e.target !== e.currentTarget) return
|
|
||||||
this.options.backdrop == 'static'
|
|
||||||
? this.$element[0].focus.call(this.$element[0])
|
|
||||||
: this.hide.call(this)
|
|
||||||
}, this))
|
|
||||||
|
|
||||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
|
||||||
|
|
||||||
this.$backdrop.addClass('in')
|
|
||||||
|
|
||||||
if (!callback) return
|
|
||||||
|
|
||||||
doAnimate ?
|
|
||||||
this.$backdrop
|
|
||||||
.one('bsTransitionEnd', callback)
|
|
||||||
.emulateTransitionEnd(150) :
|
|
||||||
callback()
|
|
||||||
|
|
||||||
} else if (!this.isShown && this.$backdrop) {
|
|
||||||
this.$backdrop.removeClass('in')
|
|
||||||
|
|
||||||
var callbackRemove = function () {
|
|
||||||
that.removeBackdrop()
|
|
||||||
callback && callback()
|
|
||||||
}
|
|
||||||
$.support.transition && this.$element.hasClass('fade') ?
|
|
||||||
this.$backdrop
|
|
||||||
.one('bsTransitionEnd', callbackRemove)
|
|
||||||
.emulateTransitionEnd(150) :
|
|
||||||
callbackRemove()
|
|
||||||
|
|
||||||
} else if (callback) {
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.checkScrollbar = function () {
|
|
||||||
if (document.body.clientWidth >= window.innerWidth) return
|
|
||||||
this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.setScrollbar = function () {
|
|
||||||
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
|
||||||
if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.resetScrollbar = function () {
|
|
||||||
this.$body.css('padding-right', '')
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.prototype.measureScrollbar = function () { // thx walsh
|
|
||||||
var scrollDiv = document.createElement('div')
|
|
||||||
scrollDiv.className = 'modal-scrollbar-measure'
|
|
||||||
this.$body.append(scrollDiv)
|
|
||||||
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
|
|
||||||
this.$body[0].removeChild(scrollDiv)
|
|
||||||
return scrollbarWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// MODAL PLUGIN DEFINITION
|
|
||||||
// =======================
|
|
||||||
|
|
||||||
function Plugin(option, _relatedTarget) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.modal')
|
|
||||||
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
|
||||||
|
|
||||||
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
|
||||||
if (typeof option == 'string') data[option](_relatedTarget)
|
|
||||||
else if (options.show) data.show(_relatedTarget)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var old = $.fn.modal
|
|
||||||
|
|
||||||
$.fn.modal = Plugin
|
|
||||||
$.fn.modal.Constructor = Modal
|
|
||||||
|
|
||||||
|
|
||||||
// MODAL NO CONFLICT
|
|
||||||
// =================
|
|
||||||
|
|
||||||
$.fn.modal.noConflict = function () {
|
|
||||||
$.fn.modal = old
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// MODAL DATA-API
|
|
||||||
// ==============
|
|
||||||
|
|
||||||
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
|
||||||
var $this = $(this)
|
|
||||||
var href = $this.attr('href')
|
|
||||||
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
|
||||||
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
|
||||||
|
|
||||||
if ($this.is('a')) e.preventDefault()
|
|
||||||
|
|
||||||
$target.one('show.bs.modal', function (showEvent) {
|
|
||||||
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
|
|
||||||
$target.one('hidden.bs.modal', function () {
|
|
||||||
$this.is(':visible') && $this.trigger('focus')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
Plugin.call($target, option, this)
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
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.$body.removeClass('modal-open')
|
||||||
|
|
||||||
|
this.resetScrollbar()
|
||||||
|
this.escape()
|
||||||
|
|
||||||
|
$(document).off('focusin.bs.modal')
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.removeClass('in')
|
||||||
|
.attr('aria-hidden', true)
|
||||||
|
.off('click.dismiss.bs.modal')
|
||||||
|
|
||||||
|
$.support.transition && this.$element.hasClass('fade') ?
|
||||||
|
this.$element
|
||||||
|
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
|
||||||
|
.emulateTransitionEnd(300) :
|
||||||
|
this.hideModal()
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.enforceFocus = function () {
|
||||||
|
$(document)
|
||||||
|
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||||
|
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||||
|
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
||||||
|
this.$element.trigger('focus')
|
||||||
|
}
|
||||||
|
}, this))
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.escape = function () {
|
||||||
|
if (this.isShown && this.options.keyboard) {
|
||||||
|
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
||||||
|
e.which == 27 && this.hide()
|
||||||
|
}, this))
|
||||||
|
} else if (!this.isShown) {
|
||||||
|
this.$element.off('keyup.dismiss.bs.modal')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.hideModal = function () {
|
||||||
|
var that = this
|
||||||
|
this.$element.hide()
|
||||||
|
this.backdrop(function () {
|
||||||
|
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(this.$body)
|
||||||
|
|
||||||
|
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
||||||
|
if (e.target !== e.currentTarget) return
|
||||||
|
this.options.backdrop == 'static'
|
||||||
|
? this.$element[0].focus.call(this.$element[0])
|
||||||
|
: this.hide.call(this)
|
||||||
|
}, this))
|
||||||
|
|
||||||
|
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||||
|
|
||||||
|
this.$backdrop.addClass('in')
|
||||||
|
|
||||||
|
if (!callback) return
|
||||||
|
|
||||||
|
doAnimate ?
|
||||||
|
this.$backdrop
|
||||||
|
.one('bsTransitionEnd', callback)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
callback()
|
||||||
|
|
||||||
|
} else if (!this.isShown && this.$backdrop) {
|
||||||
|
this.$backdrop.removeClass('in')
|
||||||
|
|
||||||
|
var callbackRemove = function () {
|
||||||
|
that.removeBackdrop()
|
||||||
|
callback && callback()
|
||||||
|
}
|
||||||
|
$.support.transition && this.$element.hasClass('fade') ?
|
||||||
|
this.$backdrop
|
||||||
|
.one('bsTransitionEnd', callbackRemove)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
callbackRemove()
|
||||||
|
|
||||||
|
} else if (callback) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.checkScrollbar = function () {
|
||||||
|
if (document.body.clientWidth >= window.innerWidth) return
|
||||||
|
this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.setScrollbar = function () {
|
||||||
|
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
||||||
|
if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.resetScrollbar = function () {
|
||||||
|
this.$body.css('padding-right', '')
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.measureScrollbar = function () { // thx walsh
|
||||||
|
var scrollDiv = document.createElement('div')
|
||||||
|
scrollDiv.className = 'modal-scrollbar-measure'
|
||||||
|
this.$body.append(scrollDiv)
|
||||||
|
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
|
||||||
|
this.$body[0].removeChild(scrollDiv)
|
||||||
|
return scrollbarWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// MODAL PLUGIN DEFINITION
|
||||||
|
// =======================
|
||||||
|
|
||||||
|
function Plugin(option, _relatedTarget) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.modal')
|
||||||
|
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
||||||
|
if (typeof option == 'string') data[option](_relatedTarget)
|
||||||
|
else if (options.show) data.show(_relatedTarget)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = $.fn.modal
|
||||||
|
|
||||||
|
$.fn.modal = Plugin
|
||||||
|
$.fn.modal.Constructor = Modal
|
||||||
|
|
||||||
|
|
||||||
|
// MODAL NO CONFLICT
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$.fn.modal.noConflict = function () {
|
||||||
|
$.fn.modal = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// MODAL DATA-API
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
var href = $this.attr('href')
|
||||||
|
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
|
||||||
|
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||||
|
|
||||||
|
if ($this.is('a')) e.preventDefault()
|
||||||
|
|
||||||
|
$target.one('show.bs.modal', function (showEvent) {
|
||||||
|
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
|
||||||
|
$target.one('hidden.bs.modal', function () {
|
||||||
|
$this.is(':visible') && $this.trigger('focus')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
Plugin.call($target, option, this)
|
||||||
})
|
})
|
||||||
|
|
||||||
}();
|
}(jQuery);
|
||||||
|
|
|
||||||
200
js/popover.js
200
js/popover.js
|
|
@ -7,113 +7,107 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// POPOVER PUBLIC CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ===============================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// POPOVER PUBLIC CLASS DEFINITION
|
var Popover = function (element, options) {
|
||||||
// ===============================
|
this.init('popover', element, options)
|
||||||
|
}
|
||||||
|
|
||||||
var Popover = function (element, options) {
|
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
||||||
this.init('popover', element, options)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
Popover.VERSION = '3.1.1'
|
||||||
|
|
||||||
Popover.VERSION = '3.1.1'
|
|
||||||
|
|
||||||
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
|
||||||
placement: 'right',
|
|
||||||
trigger: 'click',
|
|
||||||
content: '',
|
|
||||||
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
// NOTE: POPOVER EXTENDS tooltip.js
|
|
||||||
// ================================
|
|
||||||
|
|
||||||
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
|
||||||
|
|
||||||
Popover.prototype.constructor = Popover
|
|
||||||
|
|
||||||
Popover.prototype.getDefaults = function () {
|
|
||||||
return Popover.DEFAULTS
|
|
||||||
}
|
|
||||||
|
|
||||||
Popover.prototype.setContent = function () {
|
|
||||||
var $tip = this.tip()
|
|
||||||
var title = this.getTitle()
|
|
||||||
var content = this.getContent()
|
|
||||||
|
|
||||||
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
|
||||||
$tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events
|
|
||||||
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
|
||||||
](content)
|
|
||||||
|
|
||||||
$tip.removeClass('fade top bottom left right in')
|
|
||||||
|
|
||||||
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
|
||||||
// this manually by checking the contents.
|
|
||||||
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
Popover.prototype.hasContent = function () {
|
|
||||||
return this.getTitle() || this.getContent()
|
|
||||||
}
|
|
||||||
|
|
||||||
Popover.prototype.getContent = function () {
|
|
||||||
var $e = this.$element
|
|
||||||
var o = this.options
|
|
||||||
|
|
||||||
return $e.attr('data-content')
|
|
||||||
|| (typeof o.content == 'function' ?
|
|
||||||
o.content.call($e[0]) :
|
|
||||||
o.content)
|
|
||||||
}
|
|
||||||
|
|
||||||
Popover.prototype.arrow = function () {
|
|
||||||
return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
|
|
||||||
}
|
|
||||||
|
|
||||||
Popover.prototype.tip = function () {
|
|
||||||
if (!this.$tip) this.$tip = $(this.options.template)
|
|
||||||
return this.$tip
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// POPOVER PLUGIN DEFINITION
|
|
||||||
// =========================
|
|
||||||
|
|
||||||
function Plugin(option) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.popover')
|
|
||||||
var options = typeof option == 'object' && option
|
|
||||||
|
|
||||||
if (!data && option == 'destroy') return
|
|
||||||
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
|
||||||
if (typeof option == 'string') data[option]()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var old = $.fn.popover
|
|
||||||
|
|
||||||
$.fn.popover = Plugin
|
|
||||||
$.fn.popover.Constructor = Popover
|
|
||||||
|
|
||||||
|
|
||||||
// POPOVER NO CONFLICT
|
|
||||||
// ===================
|
|
||||||
|
|
||||||
$.fn.popover.noConflict = function () {
|
|
||||||
$.fn.popover = old
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
||||||
|
placement: 'right',
|
||||||
|
trigger: 'click',
|
||||||
|
content: '',
|
||||||
|
template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
||||||
})
|
})
|
||||||
|
|
||||||
}();
|
|
||||||
|
// NOTE: POPOVER EXTENDS tooltip.js
|
||||||
|
// ================================
|
||||||
|
|
||||||
|
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
||||||
|
|
||||||
|
Popover.prototype.constructor = Popover
|
||||||
|
|
||||||
|
Popover.prototype.getDefaults = function () {
|
||||||
|
return Popover.DEFAULTS
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.setContent = function () {
|
||||||
|
var $tip = this.tip()
|
||||||
|
var title = this.getTitle()
|
||||||
|
var content = this.getContent()
|
||||||
|
|
||||||
|
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
||||||
|
$tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events
|
||||||
|
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
||||||
|
](content)
|
||||||
|
|
||||||
|
$tip.removeClass('fade top bottom left right in')
|
||||||
|
|
||||||
|
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
||||||
|
// this manually by checking the contents.
|
||||||
|
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.hasContent = function () {
|
||||||
|
return this.getTitle() || this.getContent()
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.getContent = function () {
|
||||||
|
var $e = this.$element
|
||||||
|
var o = this.options
|
||||||
|
|
||||||
|
return $e.attr('data-content')
|
||||||
|
|| (typeof o.content == 'function' ?
|
||||||
|
o.content.call($e[0]) :
|
||||||
|
o.content)
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.arrow = function () {
|
||||||
|
return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.tip = function () {
|
||||||
|
if (!this.$tip) this.$tip = $(this.options.template)
|
||||||
|
return this.$tip
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// POPOVER PLUGIN DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
function Plugin(option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.popover')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data && option == 'destroy') return
|
||||||
|
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = $.fn.popover
|
||||||
|
|
||||||
|
$.fn.popover = Plugin
|
||||||
|
$.fn.popover.Constructor = Popover
|
||||||
|
|
||||||
|
|
||||||
|
// POPOVER NO CONFLICT
|
||||||
|
// ===================
|
||||||
|
|
||||||
|
$.fn.popover.noConflict = function () {
|
||||||
|
$.fn.popover = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
}(jQuery);
|
||||||
|
|
|
||||||
270
js/scrollspy.js
270
js/scrollspy.js
|
|
@ -7,170 +7,164 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// SCROLLSPY CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ==========================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// SCROLLSPY CLASS DEFINITION
|
function ScrollSpy(element, options) {
|
||||||
// ==========================
|
var process = $.proxy(this.process, this)
|
||||||
|
|
||||||
function ScrollSpy(element, options) {
|
this.$body = $('body')
|
||||||
var process = $.proxy(this.process, this)
|
this.$scrollElement = $(element).is('body') ? $(window) : $(element)
|
||||||
|
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
||||||
|
this.selector = (this.options.target || '') + ' .nav li > a'
|
||||||
|
this.offsets = []
|
||||||
|
this.targets = []
|
||||||
|
this.activeTarget = null
|
||||||
|
this.scrollHeight = 0
|
||||||
|
|
||||||
this.$body = $('body')
|
this.$scrollElement.on('scroll.bs.scrollspy', process)
|
||||||
this.$scrollElement = $(element).is('body') ? $(window) : $(element)
|
this.refresh()
|
||||||
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
this.process()
|
||||||
this.selector = (this.options.target || '') + ' .nav li > a'
|
}
|
||||||
this.offsets = []
|
|
||||||
this.targets = []
|
|
||||||
this.activeTarget = null
|
|
||||||
this.scrollHeight = 0
|
|
||||||
|
|
||||||
this.$scrollElement.on('scroll.bs.scrollspy', process)
|
ScrollSpy.VERSION = '3.1.1'
|
||||||
|
|
||||||
|
ScrollSpy.DEFAULTS = {
|
||||||
|
offset: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.prototype.getScrollHeight = function () {
|
||||||
|
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.prototype.refresh = function () {
|
||||||
|
var offsetMethod = 'offset'
|
||||||
|
var offsetBase = 0
|
||||||
|
|
||||||
|
if (!$.isWindow(this.$scrollElement[0])) {
|
||||||
|
offsetMethod = 'position'
|
||||||
|
offsetBase = this.$scrollElement.scrollTop()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.offsets = []
|
||||||
|
this.targets = []
|
||||||
|
this.scrollHeight = this.getScrollHeight()
|
||||||
|
|
||||||
|
var self = this
|
||||||
|
|
||||||
|
this.$body
|
||||||
|
.find(this.selector)
|
||||||
|
.map(function () {
|
||||||
|
var $el = $(this)
|
||||||
|
var href = $el.data('target') || $el.attr('href')
|
||||||
|
var $href = /^#./.test(href) && $(href)
|
||||||
|
|
||||||
|
return ($href
|
||||||
|
&& $href.length
|
||||||
|
&& $href.is(':visible')
|
||||||
|
&& [[$href[offsetMethod]().top + offsetBase, href]]) || null
|
||||||
|
})
|
||||||
|
.sort(function (a, b) { return a[0] - b[0] })
|
||||||
|
.each(function () {
|
||||||
|
self.offsets.push(this[0])
|
||||||
|
self.targets.push(this[1])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.prototype.process = function () {
|
||||||
|
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
||||||
|
var scrollHeight = this.getScrollHeight()
|
||||||
|
var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
|
||||||
|
var offsets = this.offsets
|
||||||
|
var targets = this.targets
|
||||||
|
var activeTarget = this.activeTarget
|
||||||
|
var i
|
||||||
|
|
||||||
|
if (this.scrollHeight != scrollHeight) {
|
||||||
this.refresh()
|
this.refresh()
|
||||||
this.process()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollSpy.VERSION = '3.1.1'
|
if (scrollTop >= maxScroll) {
|
||||||
|
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
|
||||||
ScrollSpy.DEFAULTS = {
|
|
||||||
offset: 10
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollSpy.prototype.getScrollHeight = function () {
|
if (activeTarget && scrollTop <= offsets[0]) {
|
||||||
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
|
return activeTarget != (i = targets[0]) && this.activate(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollSpy.prototype.refresh = function () {
|
for (i = offsets.length; i--;) {
|
||||||
var offsetMethod = 'offset'
|
activeTarget != targets[i]
|
||||||
var offsetBase = 0
|
&& scrollTop >= offsets[i]
|
||||||
|
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
||||||
if (!$.isWindow(this.$scrollElement[0])) {
|
&& this.activate(targets[i])
|
||||||
offsetMethod = 'position'
|
|
||||||
offsetBase = this.$scrollElement.scrollTop()
|
|
||||||
}
|
|
||||||
|
|
||||||
this.offsets = []
|
|
||||||
this.targets = []
|
|
||||||
this.scrollHeight = this.getScrollHeight()
|
|
||||||
|
|
||||||
var self = this
|
|
||||||
|
|
||||||
this.$body
|
|
||||||
.find(this.selector)
|
|
||||||
.map(function () {
|
|
||||||
var $el = $(this)
|
|
||||||
var href = $el.data('target') || $el.attr('href')
|
|
||||||
var $href = /^#./.test(href) && $(href)
|
|
||||||
|
|
||||||
return ($href
|
|
||||||
&& $href.length
|
|
||||||
&& $href.is(':visible')
|
|
||||||
&& [[$href[offsetMethod]().top + offsetBase, href]]) || null
|
|
||||||
})
|
|
||||||
.sort(function (a, b) { return a[0] - b[0] })
|
|
||||||
.each(function () {
|
|
||||||
self.offsets.push(this[0])
|
|
||||||
self.targets.push(this[1])
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ScrollSpy.prototype.process = function () {
|
ScrollSpy.prototype.activate = function (target) {
|
||||||
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
this.activeTarget = target
|
||||||
var scrollHeight = this.getScrollHeight()
|
|
||||||
var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
|
|
||||||
var offsets = this.offsets
|
|
||||||
var targets = this.targets
|
|
||||||
var activeTarget = this.activeTarget
|
|
||||||
var i
|
|
||||||
|
|
||||||
if (this.scrollHeight != scrollHeight) {
|
$(this.selector)
|
||||||
this.refresh()
|
.parentsUntil(this.options.target, '.active')
|
||||||
}
|
.removeClass('active')
|
||||||
|
|
||||||
if (scrollTop >= maxScroll) {
|
var selector = this.selector +
|
||||||
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
|
'[data-target="' + target + '"],' +
|
||||||
}
|
this.selector + '[href="' + target + '"]'
|
||||||
|
|
||||||
if (activeTarget && scrollTop <= offsets[0]) {
|
var active = $(selector)
|
||||||
return activeTarget != (i = targets[0]) && this.activate(i)
|
.parents('li')
|
||||||
}
|
.addClass('active')
|
||||||
|
|
||||||
for (i = offsets.length; i--;) {
|
if (active.parent('.dropdown-menu').length) {
|
||||||
activeTarget != targets[i]
|
active = active
|
||||||
&& scrollTop >= offsets[i]
|
.closest('li.dropdown')
|
||||||
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
|
||||||
&& this.activate(targets[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollSpy.prototype.activate = function (target) {
|
|
||||||
this.activeTarget = target
|
|
||||||
|
|
||||||
$(this.selector)
|
|
||||||
.parentsUntil(this.options.target, '.active')
|
|
||||||
.removeClass('active')
|
|
||||||
|
|
||||||
var selector = this.selector +
|
|
||||||
'[data-target="' + target + '"],' +
|
|
||||||
this.selector + '[href="' + target + '"]'
|
|
||||||
|
|
||||||
var active = $(selector)
|
|
||||||
.parents('li')
|
|
||||||
.addClass('active')
|
.addClass('active')
|
||||||
|
|
||||||
if (active.parent('.dropdown-menu').length) {
|
|
||||||
active = active
|
|
||||||
.closest('li.dropdown')
|
|
||||||
.addClass('active')
|
|
||||||
}
|
|
||||||
|
|
||||||
active.trigger('activate.bs.scrollspy')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
active.trigger('activate.bs.scrollspy')
|
||||||
// SCROLLSPY PLUGIN DEFINITION
|
}
|
||||||
// ===========================
|
|
||||||
|
|
||||||
function Plugin(option) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.scrollspy')
|
|
||||||
var options = typeof option == 'object' && option
|
|
||||||
|
|
||||||
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
|
||||||
if (typeof option == 'string') data[option]()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var old = $.fn.scrollspy
|
|
||||||
|
|
||||||
$.fn.scrollspy = Plugin
|
|
||||||
$.fn.scrollspy.Constructor = ScrollSpy
|
|
||||||
|
|
||||||
|
|
||||||
// SCROLLSPY NO CONFLICT
|
// SCROLLSPY PLUGIN DEFINITION
|
||||||
// =====================
|
// ===========================
|
||||||
|
|
||||||
$.fn.scrollspy.noConflict = function () {
|
function Plugin(option) {
|
||||||
$.fn.scrollspy = old
|
return this.each(function () {
|
||||||
return this
|
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)))
|
||||||
// SCROLLSPY DATA-API
|
if (typeof option == 'string') data[option]()
|
||||||
// ==================
|
|
||||||
|
|
||||||
$(window).on('load.bs.scrollspy.data-api', function () {
|
|
||||||
$('[data-spy="scroll"]').each(function () {
|
|
||||||
var $spy = $(this)
|
|
||||||
Plugin.call($spy, $spy.data())
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = $.fn.scrollspy
|
||||||
|
|
||||||
|
$.fn.scrollspy = Plugin
|
||||||
|
$.fn.scrollspy.Constructor = ScrollSpy
|
||||||
|
|
||||||
|
|
||||||
|
// SCROLLSPY NO CONFLICT
|
||||||
|
// =====================
|
||||||
|
|
||||||
|
$.fn.scrollspy.noConflict = function () {
|
||||||
|
$.fn.scrollspy = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// SCROLLSPY DATA-API
|
||||||
|
// ==================
|
||||||
|
|
||||||
|
$(window).on('load.bs.scrollspy.data-api', function () {
|
||||||
|
$('[data-spy="scroll"]').each(function () {
|
||||||
|
var $spy = $(this)
|
||||||
|
Plugin.call($spy, $spy.data())
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}();
|
}(jQuery);
|
||||||
|
|
|
||||||
224
js/tab.js
224
js/tab.js
|
|
@ -7,128 +7,122 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// TAB CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ====================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// TAB CLASS DEFINITION
|
var Tab = function (element) {
|
||||||
// ====================
|
this.element = $(element)
|
||||||
|
}
|
||||||
|
|
||||||
var Tab = function (element) {
|
Tab.VERSION = '3.1.1'
|
||||||
this.element = $(element)
|
|
||||||
|
Tab.prototype.show = function () {
|
||||||
|
var $this = this.element
|
||||||
|
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||||
|
var selector = $this.data('target')
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||||
}
|
}
|
||||||
|
|
||||||
Tab.VERSION = '3.1.1'
|
if ($this.parent('li').hasClass('active')) return
|
||||||
|
|
||||||
Tab.prototype.show = function () {
|
var previous = $ul.find('.active:last a')[0]
|
||||||
var $this = this.element
|
var e = $.Event('show.bs.tab', {
|
||||||
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
relatedTarget: previous
|
||||||
var selector = $this.data('target')
|
|
||||||
|
|
||||||
if (!selector) {
|
|
||||||
selector = $this.attr('href')
|
|
||||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this.parent('li').hasClass('active')) return
|
|
||||||
|
|
||||||
var previous = $ul.find('.active:last a')[0]
|
|
||||||
var e = $.Event('show.bs.tab', {
|
|
||||||
relatedTarget: previous
|
|
||||||
})
|
|
||||||
|
|
||||||
$this.trigger(e)
|
|
||||||
|
|
||||||
if (e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
var $target = $(selector)
|
|
||||||
|
|
||||||
this.activate($this.closest('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('bsTransitionEnd', next)
|
|
||||||
.emulateTransitionEnd(150) :
|
|
||||||
next()
|
|
||||||
|
|
||||||
$active.removeClass('in')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// TAB PLUGIN DEFINITION
|
|
||||||
// =====================
|
|
||||||
|
|
||||||
function Plugin(option) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this)
|
|
||||||
var data = $this.data('bs.tab')
|
|
||||||
|
|
||||||
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
|
||||||
if (typeof option == 'string') data[option]()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var old = $.fn.tab
|
|
||||||
|
|
||||||
$.fn.tab = Plugin
|
|
||||||
$.fn.tab.Constructor = Tab
|
|
||||||
|
|
||||||
|
|
||||||
// TAB NO CONFLICT
|
|
||||||
// ===============
|
|
||||||
|
|
||||||
$.fn.tab.noConflict = function () {
|
|
||||||
$.fn.tab = old
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// TAB DATA-API
|
|
||||||
// ============
|
|
||||||
|
|
||||||
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
|
||||||
e.preventDefault()
|
|
||||||
Plugin.call($(this), 'show')
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$this.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var $target = $(selector)
|
||||||
|
|
||||||
|
this.activate($this.closest('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('bsTransitionEnd', next)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
next()
|
||||||
|
|
||||||
|
$active.removeClass('in')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TAB PLUGIN DEFINITION
|
||||||
|
// =====================
|
||||||
|
|
||||||
|
function Plugin(option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.tab')
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var old = $.fn.tab
|
||||||
|
|
||||||
|
$.fn.tab = Plugin
|
||||||
|
$.fn.tab.Constructor = Tab
|
||||||
|
|
||||||
|
|
||||||
|
// TAB NO CONFLICT
|
||||||
|
// ===============
|
||||||
|
|
||||||
|
$.fn.tab.noConflict = function () {
|
||||||
|
$.fn.tab = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TAB DATA-API
|
||||||
|
// ============
|
||||||
|
|
||||||
|
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
||||||
|
e.preventDefault()
|
||||||
|
Plugin.call($(this), 'show')
|
||||||
})
|
})
|
||||||
|
|
||||||
}();
|
}(jQuery);
|
||||||
|
|
|
||||||
776
js/tooltip.js
776
js/tooltip.js
|
|
@ -8,456 +8,450 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// TOOLTIP PUBLIC CLASS DEFINITION
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ===============================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// TOOLTIP PUBLIC CLASS DEFINITION
|
var Tooltip = function (element, options) {
|
||||||
// ===============================
|
this.type =
|
||||||
|
this.options =
|
||||||
|
this.enabled =
|
||||||
|
this.timeout =
|
||||||
|
this.hoverState =
|
||||||
|
this.$element = null
|
||||||
|
|
||||||
var Tooltip = function (element, options) {
|
this.init('tooltip', element, options)
|
||||||
this.type =
|
}
|
||||||
this.options =
|
|
||||||
this.enabled =
|
|
||||||
this.timeout =
|
|
||||||
this.hoverState =
|
|
||||||
this.$element = null
|
|
||||||
|
|
||||||
this.init('tooltip', element, options)
|
Tooltip.VERSION = '3.1.1'
|
||||||
|
|
||||||
|
Tooltip.DEFAULTS = {
|
||||||
|
animation: true,
|
||||||
|
placement: 'top',
|
||||||
|
selector: false,
|
||||||
|
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
||||||
|
trigger: 'hover focus',
|
||||||
|
title: '',
|
||||||
|
delay: 0,
|
||||||
|
html: false,
|
||||||
|
container: false,
|
||||||
|
viewport: {
|
||||||
|
selector: 'body',
|
||||||
|
padding: 0
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Tooltip.VERSION = '3.1.1'
|
Tooltip.prototype.init = function (type, element, options) {
|
||||||
|
this.enabled = true
|
||||||
|
this.type = type
|
||||||
|
this.$element = $(element)
|
||||||
|
this.options = this.getOptions(options)
|
||||||
|
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
|
||||||
|
|
||||||
Tooltip.DEFAULTS = {
|
var triggers = this.options.trigger.split(' ')
|
||||||
animation: true,
|
|
||||||
placement: 'top',
|
for (var i = triggers.length; i--;) {
|
||||||
selector: false,
|
var trigger = triggers[i]
|
||||||
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
|
||||||
trigger: 'hover focus',
|
if (trigger == 'click') {
|
||||||
title: '',
|
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||||
delay: 0,
|
} else if (trigger != 'manual') {
|
||||||
html: false,
|
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
||||||
container: false,
|
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
||||||
viewport: {
|
|
||||||
selector: 'body',
|
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||||
padding: 0
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.prototype.init = function (type, element, options) {
|
this.options.selector ?
|
||||||
this.enabled = true
|
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||||
this.type = type
|
this.fixTitle()
|
||||||
this.$element = $(element)
|
}
|
||||||
this.options = this.getOptions(options)
|
|
||||||
this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
|
|
||||||
|
|
||||||
var triggers = this.options.trigger.split(' ')
|
Tooltip.prototype.getDefaults = function () {
|
||||||
|
return Tooltip.DEFAULTS
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = triggers.length; i--;) {
|
Tooltip.prototype.getOptions = function (options) {
|
||||||
var trigger = triggers[i]
|
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
||||||
|
|
||||||
if (trigger == 'click') {
|
if (options.delay && typeof options.delay == 'number') {
|
||||||
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
options.delay = {
|
||||||
} else if (trigger != 'manual') {
|
show: options.delay,
|
||||||
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
hide: options.delay
|
||||||
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
|
||||||
|
|
||||||
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.getDelegateOptions = function () {
|
|
||||||
var options = {}
|
|
||||||
var defaults = this.getDefaults()
|
|
||||||
|
|
||||||
this._options && $.each(this._options, function (key, value) {
|
|
||||||
if (defaults[key] != value) options[key] = value
|
|
||||||
})
|
|
||||||
|
|
||||||
return options
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.enter = function (obj) {
|
|
||||||
var self = obj instanceof this.constructor ?
|
|
||||||
obj : $(obj.currentTarget).data('bs.' + this.type)
|
|
||||||
|
|
||||||
if (!self) {
|
|
||||||
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
|
||||||
$(obj.currentTarget).data('bs.' + this.type, self)
|
|
||||||
}
|
|
||||||
|
|
||||||
clearTimeout(self.timeout)
|
|
||||||
|
|
||||||
self.hoverState = 'in'
|
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
|
||||||
|
|
||||||
self.timeout = setTimeout(function () {
|
|
||||||
if (self.hoverState == 'in') self.show()
|
|
||||||
}, self.options.delay.show)
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.leave = function (obj) {
|
|
||||||
var self = obj instanceof this.constructor ?
|
|
||||||
obj : $(obj.currentTarget).data('bs.' + this.type)
|
|
||||||
|
|
||||||
if (!self) {
|
|
||||||
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
|
||||||
$(obj.currentTarget).data('bs.' + this.type, self)
|
|
||||||
}
|
|
||||||
|
|
||||||
clearTimeout(self.timeout)
|
|
||||||
|
|
||||||
self.hoverState = 'out'
|
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
|
||||||
|
|
||||||
self.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)
|
|
||||||
|
|
||||||
var inDom = $.contains(document.documentElement, this.$element[0])
|
|
||||||
if (e.isDefaultPrevented() || !inDom) return
|
|
||||||
var that = this
|
|
||||||
|
|
||||||
var $tip = this.tip()
|
|
||||||
|
|
||||||
var tipId = this.getUID(this.type)
|
|
||||||
|
|
||||||
this.setContent()
|
|
||||||
$tip.attr('id', tipId)
|
|
||||||
this.$element.attr('aria-describedby', tipId)
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
var autoToken = /\s?auto?\s?/i
|
|
||||||
var autoPlace = autoToken.test(placement)
|
|
||||||
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
|
||||||
|
|
||||||
$tip
|
|
||||||
.detach()
|
|
||||||
.css({ top: 0, left: 0, display: 'block' })
|
|
||||||
.addClass(placement)
|
|
||||||
.data('bs.' + this.type, this)
|
|
||||||
|
|
||||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
|
||||||
|
|
||||||
var pos = this.getPosition()
|
|
||||||
var actualWidth = $tip[0].offsetWidth
|
|
||||||
var actualHeight = $tip[0].offsetHeight
|
|
||||||
|
|
||||||
if (autoPlace) {
|
|
||||||
var orgPlacement = placement
|
|
||||||
var $parent = this.$element.parent()
|
|
||||||
var parentDim = this.getPosition($parent)
|
|
||||||
|
|
||||||
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - parentDim.scroll > parentDim.height ? 'top' :
|
|
||||||
placement == 'top' && pos.top - parentDim.scroll - actualHeight < 0 ? 'bottom' :
|
|
||||||
placement == 'right' && pos.right + actualWidth > parentDim.width ? 'left' :
|
|
||||||
placement == 'left' && pos.left - actualWidth < parentDim.left ? 'right' :
|
|
||||||
placement
|
|
||||||
|
|
||||||
$tip
|
|
||||||
.removeClass(orgPlacement)
|
|
||||||
.addClass(placement)
|
|
||||||
}
|
|
||||||
|
|
||||||
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
|
||||||
|
|
||||||
this.applyPlacement(calculatedOffset, placement)
|
|
||||||
this.hoverState = null
|
|
||||||
|
|
||||||
var complete = function () {
|
|
||||||
that.$element.trigger('shown.bs.' + that.type)
|
|
||||||
}
|
|
||||||
|
|
||||||
$.support.transition && this.$tip.hasClass('fade') ?
|
|
||||||
$tip
|
|
||||||
.one('bsTransitionEnd', complete)
|
|
||||||
.emulateTransitionEnd(150) :
|
|
||||||
complete()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
return options
|
||||||
var $tip = this.tip()
|
}
|
||||||
var width = $tip[0].offsetWidth
|
|
||||||
var height = $tip[0].offsetHeight
|
|
||||||
|
|
||||||
// manually read margins because getBoundingClientRect includes difference
|
Tooltip.prototype.getDelegateOptions = function () {
|
||||||
var marginTop = parseInt($tip.css('margin-top'), 10)
|
var options = {}
|
||||||
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
var defaults = this.getDefaults()
|
||||||
|
|
||||||
// we must check for NaN for ie 8/9
|
this._options && $.each(this._options, function (key, value) {
|
||||||
if (isNaN(marginTop)) marginTop = 0
|
if (defaults[key] != value) options[key] = value
|
||||||
if (isNaN(marginLeft)) marginLeft = 0
|
})
|
||||||
|
|
||||||
offset.top = offset.top + marginTop
|
return options
|
||||||
offset.left = offset.left + marginLeft
|
}
|
||||||
|
|
||||||
// $.fn.offset doesn't round pixel values
|
Tooltip.prototype.enter = function (obj) {
|
||||||
// so we use setOffset directly with our own function B-0
|
var self = obj instanceof this.constructor ?
|
||||||
$.offset.setOffset($tip[0], $.extend({
|
obj : $(obj.currentTarget).data('bs.' + this.type)
|
||||||
using: function (props) {
|
|
||||||
$tip.css({
|
|
||||||
top: Math.round(props.top),
|
|
||||||
left: Math.round(props.left)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, offset), 0)
|
|
||||||
|
|
||||||
$tip.addClass('in')
|
if (!self) {
|
||||||
|
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
||||||
|
$(obj.currentTarget).data('bs.' + this.type, self)
|
||||||
|
}
|
||||||
|
|
||||||
// check to see if placing tip in new offset caused the tip to resize itself
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
|
self.hoverState = 'in'
|
||||||
|
|
||||||
|
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||||
|
|
||||||
|
self.timeout = setTimeout(function () {
|
||||||
|
if (self.hoverState == 'in') self.show()
|
||||||
|
}, self.options.delay.show)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.leave = function (obj) {
|
||||||
|
var self = obj instanceof this.constructor ?
|
||||||
|
obj : $(obj.currentTarget).data('bs.' + this.type)
|
||||||
|
|
||||||
|
if (!self) {
|
||||||
|
self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
|
||||||
|
$(obj.currentTarget).data('bs.' + this.type, self)
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
|
self.hoverState = 'out'
|
||||||
|
|
||||||
|
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||||
|
|
||||||
|
self.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)
|
||||||
|
|
||||||
|
var inDom = $.contains(document.documentElement, this.$element[0])
|
||||||
|
if (e.isDefaultPrevented() || !inDom) return
|
||||||
|
var that = this
|
||||||
|
|
||||||
|
var $tip = this.tip()
|
||||||
|
|
||||||
|
var tipId = this.getUID(this.type)
|
||||||
|
|
||||||
|
this.setContent()
|
||||||
|
$tip.attr('id', tipId)
|
||||||
|
this.$element.attr('aria-describedby', tipId)
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
var autoToken = /\s?auto?\s?/i
|
||||||
|
var autoPlace = autoToken.test(placement)
|
||||||
|
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.detach()
|
||||||
|
.css({ top: 0, left: 0, display: 'block' })
|
||||||
|
.addClass(placement)
|
||||||
|
.data('bs.' + this.type, this)
|
||||||
|
|
||||||
|
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||||
|
|
||||||
|
var pos = this.getPosition()
|
||||||
var actualWidth = $tip[0].offsetWidth
|
var actualWidth = $tip[0].offsetWidth
|
||||||
var actualHeight = $tip[0].offsetHeight
|
var actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
if (placement == 'top' && actualHeight != height) {
|
if (autoPlace) {
|
||||||
offset.top = offset.top + height - actualHeight
|
var orgPlacement = placement
|
||||||
|
var $parent = this.$element.parent()
|
||||||
|
var parentDim = this.getPosition($parent)
|
||||||
|
|
||||||
|
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - parentDim.scroll > parentDim.height ? 'top' :
|
||||||
|
placement == 'top' && pos.top - parentDim.scroll - actualHeight < 0 ? 'bottom' :
|
||||||
|
placement == 'right' && pos.right + actualWidth > parentDim.width ? 'left' :
|
||||||
|
placement == 'left' && pos.left - actualWidth < parentDim.left ? 'right' :
|
||||||
|
placement
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.removeClass(orgPlacement)
|
||||||
|
.addClass(placement)
|
||||||
}
|
}
|
||||||
|
|
||||||
var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
|
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
||||||
|
|
||||||
if (delta.left) offset.left += delta.left
|
this.applyPlacement(calculatedOffset, placement)
|
||||||
else offset.top += delta.top
|
|
||||||
|
|
||||||
var arrowDelta = delta.left ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
|
var complete = function () {
|
||||||
var arrowPosition = delta.left ? 'left' : 'top'
|
that.$element.trigger('shown.bs.' + that.type)
|
||||||
var arrowOffsetPosition = delta.left ? 'offsetWidth' : 'offsetHeight'
|
that.hoverState = null
|
||||||
|
|
||||||
$tip.offset(offset)
|
|
||||||
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition)
|
|
||||||
}
|
|
||||||
|
|
||||||
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.removeAttr('aria-describedby')
|
|
||||||
|
|
||||||
function complete() {
|
|
||||||
if (that.hoverState != 'in') $tip.detach()
|
|
||||||
that.$element.trigger('hidden.bs.' + that.type)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$element.trigger(e)
|
|
||||||
|
|
||||||
if (e.isDefaultPrevented()) return
|
|
||||||
|
|
||||||
$tip.removeClass('in')
|
|
||||||
|
|
||||||
$.support.transition && this.$tip.hasClass('fade') ?
|
$.support.transition && this.$tip.hasClass('fade') ?
|
||||||
$tip
|
$tip
|
||||||
.one('bsTransitionEnd', complete)
|
.one('bsTransitionEnd', complete)
|
||||||
.emulateTransitionEnd(150) :
|
.emulateTransitionEnd(150) :
|
||||||
complete()
|
complete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.hoverState = null
|
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
||||||
|
var $tip = this.tip()
|
||||||
|
var width = $tip[0].offsetWidth
|
||||||
|
var height = $tip[0].offsetHeight
|
||||||
|
|
||||||
return this
|
// manually read margins because getBoundingClientRect includes difference
|
||||||
|
var marginTop = parseInt($tip.css('margin-top'), 10)
|
||||||
|
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
||||||
|
|
||||||
|
// we must check for NaN for ie 8/9
|
||||||
|
if (isNaN(marginTop)) marginTop = 0
|
||||||
|
if (isNaN(marginLeft)) marginLeft = 0
|
||||||
|
|
||||||
|
offset.top = offset.top + marginTop
|
||||||
|
offset.left = offset.left + marginLeft
|
||||||
|
|
||||||
|
// $.fn.offset doesn't round pixel values
|
||||||
|
// so we use setOffset directly with our own function B-0
|
||||||
|
$.offset.setOffset($tip[0], $.extend({
|
||||||
|
using: function (props) {
|
||||||
|
$tip.css({
|
||||||
|
top: Math.round(props.top),
|
||||||
|
left: Math.round(props.left)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, offset), 0)
|
||||||
|
|
||||||
|
$tip.addClass('in')
|
||||||
|
|
||||||
|
// check to see if placing tip in new offset caused the tip to resize itself
|
||||||
|
var actualWidth = $tip[0].offsetWidth
|
||||||
|
var actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (placement == 'top' && actualHeight != height) {
|
||||||
|
offset.top = offset.top + height - actualHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.prototype.fixTitle = function () {
|
var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
|
||||||
var $e = this.$element
|
|
||||||
if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
|
if (delta.left) offset.left += delta.left
|
||||||
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
else offset.top += delta.top
|
||||||
|
|
||||||
|
var arrowDelta = delta.left ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
|
||||||
|
var arrowPosition = delta.left ? 'left' : 'top'
|
||||||
|
var arrowOffsetPosition = delta.left ? 'offsetWidth' : 'offsetHeight'
|
||||||
|
|
||||||
|
$tip.offset(offset)
|
||||||
|
this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition)
|
||||||
|
}
|
||||||
|
|
||||||
|
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.removeAttr('aria-describedby')
|
||||||
|
|
||||||
|
function complete() {
|
||||||
|
if (that.hoverState != 'in') $tip.detach()
|
||||||
|
that.$element.trigger('hidden.bs.' + that.type)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$tip.removeClass('in')
|
||||||
|
|
||||||
|
$.support.transition && this.$tip.hasClass('fade') ?
|
||||||
|
$tip
|
||||||
|
.one('bsTransitionEnd', complete)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
complete()
|
||||||
|
|
||||||
|
this.hoverState = null
|
||||||
|
|
||||||
|
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 ($element) {
|
||||||
|
$element = $element || this.$element
|
||||||
|
var el = $element[0]
|
||||||
|
var isBody = el.tagName == 'BODY'
|
||||||
|
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
|
||||||
|
scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
|
||||||
|
width: isBody ? $(window).width() : $element.outerWidth(),
|
||||||
|
height: isBody ? $(window).height() : $element.outerHeight()
|
||||||
|
}, isBody ? { top: 0, left: 0 } : $element.offset())
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
||||||
|
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||||
|
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||||
|
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
||||||
|
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
|
||||||
|
var delta = { top: 0, left: 0 }
|
||||||
|
if (!this.$viewport) return delta
|
||||||
|
|
||||||
|
var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
|
||||||
|
var viewportDimensions = this.getPosition(this.$viewport)
|
||||||
|
|
||||||
|
if (/right|left/.test(placement)) {
|
||||||
|
var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
|
||||||
|
var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
|
||||||
|
if (topEdgeOffset < viewportDimensions.top) { // top overflow
|
||||||
|
delta.top = viewportDimensions.top - topEdgeOffset
|
||||||
|
} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
|
||||||
|
delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
var leftEdgeOffset = pos.left - viewportPadding
|
||||||
|
var rightEdgeOffset = pos.left + viewportPadding + actualWidth
|
||||||
|
if (leftEdgeOffset < viewportDimensions.left) { // left overflow
|
||||||
|
delta.left = viewportDimensions.left - leftEdgeOffset
|
||||||
|
} else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
|
||||||
|
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tooltip.prototype.hasContent = function () {
|
return delta
|
||||||
return this.getTitle()
|
}
|
||||||
|
|
||||||
|
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.getUID = function (prefix) {
|
||||||
|
do prefix += ~~(Math.random() * 1000000)
|
||||||
|
while (document.getElementById(prefix))
|
||||||
|
return prefix
|
||||||
|
}
|
||||||
|
|
||||||
|
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.getPosition = function ($element) {
|
Tooltip.prototype.enable = function () {
|
||||||
$element = $element || this.$element
|
this.enabled = true
|
||||||
var el = $element[0]
|
}
|
||||||
var isBody = el.tagName == 'BODY'
|
|
||||||
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
|
|
||||||
scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
|
|
||||||
width: isBody ? $(window).width() : $element.outerWidth(),
|
|
||||||
height: isBody ? $(window).height() : $element.outerHeight()
|
|
||||||
}, isBody ? { top: 0, left: 0 } : $element.offset())
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
Tooltip.prototype.disable = function () {
|
||||||
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
this.enabled = false
|
||||||
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
}
|
||||||
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
|
||||||
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
|
||||||
|
|
||||||
}
|
Tooltip.prototype.toggleEnabled = function () {
|
||||||
|
this.enabled = !this.enabled
|
||||||
|
}
|
||||||
|
|
||||||
Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
|
Tooltip.prototype.toggle = function (e) {
|
||||||
var delta = { top: 0, left: 0 }
|
var self = this
|
||||||
if (!this.$viewport) return delta
|
if (e) {
|
||||||
|
self = $(e.currentTarget).data('bs.' + this.type)
|
||||||
var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
|
if (!self) {
|
||||||
var viewportDimensions = this.getPosition(this.$viewport)
|
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
|
||||||
|
$(e.currentTarget).data('bs.' + this.type, self)
|
||||||
if (/right|left/.test(placement)) {
|
|
||||||
var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
|
|
||||||
var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
|
|
||||||
if (topEdgeOffset < viewportDimensions.top) { // top overflow
|
|
||||||
delta.top = viewportDimensions.top - topEdgeOffset
|
|
||||||
} else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
|
|
||||||
delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var leftEdgeOffset = pos.left - viewportPadding
|
|
||||||
var rightEdgeOffset = pos.left + viewportPadding + actualWidth
|
|
||||||
if (leftEdgeOffset < viewportDimensions.left) { // left overflow
|
|
||||||
delta.left = viewportDimensions.left - leftEdgeOffset
|
|
||||||
} else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
|
|
||||||
delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return delta
|
|
||||||
}
|
|
||||||
|
|
||||||
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.getUID = function (prefix) {
|
|
||||||
do prefix += ~~(Math.random() * 1000000)
|
|
||||||
while (document.getElementById(prefix))
|
|
||||||
return prefix
|
|
||||||
}
|
|
||||||
|
|
||||||
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 () {
|
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
||||||
this.enabled = true
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.disable = function () {
|
Tooltip.prototype.destroy = function () {
|
||||||
this.enabled = false
|
clearTimeout(this.timeout)
|
||||||
}
|
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
||||||
|
}
|
||||||
Tooltip.prototype.toggleEnabled = function () {
|
|
||||||
this.enabled = !this.enabled
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.toggle = function (e) {
|
|
||||||
var self = this
|
|
||||||
if (e) {
|
|
||||||
self = $(e.currentTarget).data('bs.' + this.type)
|
|
||||||
if (!self) {
|
|
||||||
self = new this.constructor(e.currentTarget, this.getDelegateOptions())
|
|
||||||
$(e.currentTarget).data('bs.' + this.type, self)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
Tooltip.prototype.destroy = function () {
|
|
||||||
clearTimeout(this.timeout)
|
|
||||||
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// TOOLTIP PLUGIN DEFINITION
|
// TOOLTIP PLUGIN DEFINITION
|
||||||
// =========================
|
// =========================
|
||||||
|
|
||||||
function Plugin(option) {
|
function Plugin(option) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this)
|
var $this = $(this)
|
||||||
var data = $this.data('bs.tooltip')
|
var data = $this.data('bs.tooltip')
|
||||||
var options = typeof option == 'object' && option
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
if (!data && option == 'destroy') return
|
if (!data && option == 'destroy') return
|
||||||
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||||
if (typeof option == 'string') data[option]()
|
if (typeof option == 'string') data[option]()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var old = $.fn.tooltip
|
var old = $.fn.tooltip
|
||||||
|
|
||||||
$.fn.tooltip = Plugin
|
$.fn.tooltip = Plugin
|
||||||
$.fn.tooltip.Constructor = Tooltip
|
$.fn.tooltip.Constructor = Tooltip
|
||||||
|
|
||||||
|
|
||||||
// TOOLTIP NO CONFLICT
|
// TOOLTIP NO CONFLICT
|
||||||
// ===================
|
// ===================
|
||||||
|
|
||||||
$.fn.tooltip.noConflict = function () {
|
$.fn.tooltip.noConflict = function () {
|
||||||
$.fn.tooltip = old
|
$.fn.tooltip = old
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
}(jQuery);
|
||||||
|
|
||||||
}();
|
|
||||||
|
|
|
||||||
|
|
@ -7,59 +7,53 @@
|
||||||
* ======================================================================== */
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
+function () { 'use strict';
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
(function (o_o) {
|
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
||||||
typeof define == 'function' && define.amd ? define(['jquery'], o_o) :
|
// ============================================================
|
||||||
typeof exports == 'object' ? o_o(require('jquery')) : o_o(jQuery)
|
|
||||||
})(function ($) {
|
|
||||||
|
|
||||||
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
function transitionEnd() {
|
||||||
// ============================================================
|
var el = document.createElement('bootstrap')
|
||||||
|
|
||||||
function transitionEnd() {
|
var transEndEventNames = {
|
||||||
var el = document.createElement('bootstrap')
|
WebkitTransition : 'webkitTransitionEnd',
|
||||||
|
MozTransition : 'transitionend',
|
||||||
var transEndEventNames = {
|
OTransition : 'oTransitionEnd otransitionend',
|
||||||
WebkitTransition : 'webkitTransitionEnd',
|
transition : 'transitionend'
|
||||||
MozTransition : 'transitionend',
|
|
||||||
OTransition : 'oTransitionEnd otransitionend',
|
|
||||||
transition : 'transitionend'
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var name in transEndEventNames) {
|
|
||||||
if (el.style[name] !== undefined) {
|
|
||||||
return { end: transEndEventNames[name] }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false // explicit for ie8 ( ._.)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://blog.alexmaccaw.com/css-transitions
|
for (var name in transEndEventNames) {
|
||||||
$.fn.emulateTransitionEnd = function (duration) {
|
if (el.style[name] !== undefined) {
|
||||||
var called = false
|
return { end: transEndEventNames[name] }
|
||||||
var $el = this
|
}
|
||||||
$(this).one('bsTransitionEnd', function () { called = true })
|
|
||||||
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
|
||||||
setTimeout(callback, duration)
|
|
||||||
return this
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function () {
|
return false // explicit for ie8 ( ._.)
|
||||||
$.support.transition = transitionEnd()
|
}
|
||||||
|
|
||||||
if (!$.support.transition) return
|
// http://blog.alexmaccaw.com/css-transitions
|
||||||
|
$.fn.emulateTransitionEnd = function (duration) {
|
||||||
|
var called = false
|
||||||
|
var $el = this
|
||||||
|
$(this).one('bsTransitionEnd', function () { called = true })
|
||||||
|
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
||||||
|
setTimeout(callback, duration)
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
$.event.special.bsTransitionEnd = {
|
$(function () {
|
||||||
bindType: $.support.transition.end,
|
$.support.transition = transitionEnd()
|
||||||
delegateType: $.support.transition.end,
|
|
||||||
handle: function (e) {
|
if (!$.support.transition) return
|
||||||
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
|
|
||||||
}
|
$.event.special.bsTransitionEnd = {
|
||||||
|
bindType: $.support.transition.end,
|
||||||
|
delegateType: $.support.transition.end,
|
||||||
|
handle: function (e) {
|
||||||
|
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}();
|
}(jQuery);
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dismissable alerts
|
// Dismissible alerts
|
||||||
//
|
//
|
||||||
// Expand the right padding and account for the close button's positioning.
|
// Expand the right padding and account for the close button's positioning.
|
||||||
|
|
||||||
.alert-dismissable {
|
.alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0.
|
||||||
|
.alert-dismissible {
|
||||||
padding-right: (@alert-padding + 20);
|
padding-right: (@alert-padding + 20);
|
||||||
|
|
||||||
// Adjust close link position
|
// Adjust close link position
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,6 @@
|
||||||
.btn-block {
|
.btn-block {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-left: 0;
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vertically space out multiple block buttons
|
// Vertically space out multiple block buttons
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,7 @@
|
||||||
font-size: @font-size-small;
|
font-size: @font-size-small;
|
||||||
line-height: @line-height-base;
|
line-height: @line-height-base;
|
||||||
color: @dropdown-header-color;
|
color: @dropdown-header-color;
|
||||||
|
white-space: nowrap; // as with > li > a
|
||||||
}
|
}
|
||||||
|
|
||||||
// Backdrop to catch body clicks on mobile, etc.
|
// Backdrop to catch body clicks on mobile, etc.
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,26 @@ input[type="checkbox"] {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Static form control text
|
||||||
|
//
|
||||||
|
// Apply class to a `p` element to make any string of text align with labels in
|
||||||
|
// a horizontal form layout.
|
||||||
|
|
||||||
|
.form-control-static {
|
||||||
|
// Size it appropriately next to real form controls
|
||||||
|
padding-top: (@padding-base-vertical + 1);
|
||||||
|
padding-bottom: (@padding-base-vertical + 1);
|
||||||
|
// Remove default margin from `p`
|
||||||
|
margin-bottom: 0;
|
||||||
|
|
||||||
|
&.input-lg,
|
||||||
|
&.input-sm {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Form control sizing
|
// Form control sizing
|
||||||
//
|
//
|
||||||
// Build on `.form-control` with modifier classes to decrease or increase the
|
// Build on `.form-control` with modifier classes to decrease or increase the
|
||||||
|
|
@ -349,16 +369,6 @@ input[type="checkbox"] {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Static form control text
|
|
||||||
//
|
|
||||||
// Apply class to a `p` element to make any string of text align with labels in
|
|
||||||
// a horizontal form layout.
|
|
||||||
|
|
||||||
.form-control-static {
|
|
||||||
margin-bottom: 0; // Remove default margin from `p`
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Help text
|
// Help text
|
||||||
//
|
//
|
||||||
// Apply to any element you wish to create light text for placement immediately
|
// Apply to any element you wish to create light text for placement immediately
|
||||||
|
|
@ -484,11 +494,6 @@ input[type="checkbox"] {
|
||||||
.make-row();
|
.make-row();
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-control-static {
|
|
||||||
padding-top: (@padding-base-vertical + 1);
|
|
||||||
padding-bottom: (@padding-base-vertical + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset spacing and right align labels, but scope to media queries so that
|
// Reset spacing and right align labels, but scope to media queries so that
|
||||||
// labels on narrow viewports stack the same as a default form example.
|
// labels on narrow viewports stack the same as a default form example.
|
||||||
@media (min-width: @screen-sm-min) {
|
@media (min-width: @screen-sm-min) {
|
||||||
|
|
@ -507,4 +512,29 @@ input[type="checkbox"] {
|
||||||
top: 0;
|
top: 0;
|
||||||
right: (@grid-gutter-width / 2);
|
right: (@grid-gutter-width / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Form group sizes
|
||||||
|
//
|
||||||
|
// Quick utility class for applying `.input-lg` and `.input-sm` styles to the
|
||||||
|
// inputs and labels within a `.form-group`.
|
||||||
|
.form-group-lg {
|
||||||
|
@media (min-width: @screen-sm-min) {
|
||||||
|
.control-label {
|
||||||
|
padding-top: ((@padding-large-vertical * @line-height-large) + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.form-control {
|
||||||
|
&:extend(.input-lg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.form-group-sm {
|
||||||
|
@media (min-width: @screen-sm-min) {
|
||||||
|
.control-label {
|
||||||
|
padding-top: (@padding-small-vertical + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.form-control {
|
||||||
|
&:extend(.input-sm);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,9 @@ a.list-group-item {
|
||||||
border-color: @list-group-active-border;
|
border-color: @list-group-active-border;
|
||||||
|
|
||||||
// Force color to inherit for custom content
|
// Force color to inherit for custom content
|
||||||
.list-group-item-heading {
|
.list-group-item-heading,
|
||||||
|
.list-group-item-heading > small,
|
||||||
|
.list-group-item-heading > .small {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
.list-group-item-text {
|
.list-group-item-text {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
// Keep images from scaling beyond the width of their parents.
|
// Keep images from scaling beyond the width of their parents.
|
||||||
.img-responsive(@display: block) {
|
.img-responsive(@display: block) {
|
||||||
display: @display;
|
display: @display;
|
||||||
|
width: 100% \9; // Force IE10 and below to size SVG images correctly
|
||||||
max-width: 100%; // Part 1: Set a maximum relative to the parent
|
max-width: 100%; // Part 1: Set a maximum relative to the parent
|
||||||
height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
|
height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
.progress-bar-variant(@color) {
|
.progress-bar-variant(@color) {
|
||||||
background-color: @color;
|
background-color: @color;
|
||||||
|
|
||||||
|
// Deprecated parent class requirement as of v3.2.0
|
||||||
.progress-striped & {
|
.progress-striped & {
|
||||||
#gradient > .striped();
|
#gradient > .striped();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Vendor Prefixes
|
// Vendor Prefixes
|
||||||
//
|
//
|
||||||
// All vendor mixins are deprecated as of v3.2 due to the introduction of
|
// All vendor mixins are deprecated as of v3.2.0 due to the introduction of
|
||||||
// Autoprefixer in our Gruntfile. They will be removed in v4.
|
// Autoprefixer in our Gruntfile. They will be removed in v4.
|
||||||
|
|
||||||
// - Animations
|
// - Animations
|
||||||
|
|
@ -131,10 +131,10 @@
|
||||||
transform: scaleY(@ratio);
|
transform: scaleY(@ratio);
|
||||||
}
|
}
|
||||||
.skew(@x; @y) {
|
.skew(@x; @y) {
|
||||||
-webkit-transform: skew(@x, @y);
|
-webkit-transform: skewX(@x) skewY(@y);
|
||||||
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
|
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
|
||||||
-o-transform: skew(@x, @y);
|
-o-transform: skewX(@x) skewY(@y);
|
||||||
transform: skew(@x, @y);
|
transform: skewX(@x) skewY(@y);
|
||||||
}
|
}
|
||||||
.translate(@x; @y) {
|
.translate(@x; @y) {
|
||||||
-webkit-transform: translate(@x, @y);
|
-webkit-transform: translate(@x, @y);
|
||||||
|
|
|
||||||
|
|
@ -41,13 +41,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Striped bars
|
// Striped bars
|
||||||
.progress-striped .progress-bar {
|
//
|
||||||
|
// `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the
|
||||||
|
// `.progress-bar-striped` class, which you just add to an existing
|
||||||
|
// `.progress-bar`.
|
||||||
|
.progress-striped .progress-bar,
|
||||||
|
.progress-bar-striped {
|
||||||
#gradient > .striped();
|
#gradient > .striped();
|
||||||
background-size: 40px 40px;
|
background-size: 40px 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call animation for the active one
|
// Call animation for the active one
|
||||||
.progress.active .progress-bar {
|
//
|
||||||
|
// `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the
|
||||||
|
// `.progress-bar.active` approach.
|
||||||
|
.progress.active .progress-bar,
|
||||||
|
.progress-bar.active {
|
||||||
.animation(progress-bar-stripes 2s linear infinite);
|
.animation(progress-bar-stripes 2s linear infinite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,12 @@
|
||||||
background-color: darken(@btn-color, 12%);
|
background-color: darken(@btn-color, 12%);
|
||||||
border-color: darken(@btn-color, 14%);
|
border-color: darken(@btn-color, 14%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:disabled,
|
||||||
|
&[disabled] {
|
||||||
|
background-color: darken(@btn-color, 12%);
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Common styles
|
// Common styles
|
||||||
|
|
@ -191,6 +197,11 @@
|
||||||
.progress-bar-warning { .progress-bar-styles(@progress-bar-warning-bg); }
|
.progress-bar-warning { .progress-bar-styles(@progress-bar-warning-bg); }
|
||||||
.progress-bar-danger { .progress-bar-styles(@progress-bar-danger-bg); }
|
.progress-bar-danger { .progress-bar-styles(@progress-bar-danger-bg); }
|
||||||
|
|
||||||
|
// Reset the striped class because our mixins don't do multiple gradients and
|
||||||
|
// the above custom styles override the new `.progress-bar-striped` in v3.2.0.
|
||||||
|
.progress-bar-striped {
|
||||||
|
#gradient > .striped();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -74,10 +74,10 @@ p {
|
||||||
// Emphasis & misc
|
// Emphasis & misc
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
// Ex: 14px base font * 85% = about 12px
|
// Ex: (12px small font / 14px base font) * 100% = about 85%
|
||||||
small,
|
small,
|
||||||
.small {
|
.small {
|
||||||
font-size: 85%;
|
font-size: floor((100% * @font-size-small / @font-size-base));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Undo browser default styling
|
// Undo browser default styling
|
||||||
|
|
@ -219,13 +219,13 @@ dd {
|
||||||
@media (min-width: @grid-float-breakpoint) {
|
@media (min-width: @grid-float-breakpoint) {
|
||||||
dt {
|
dt {
|
||||||
float: left;
|
float: left;
|
||||||
width: (@component-offset-horizontal - 20);
|
width: (@dl-horizontal-offset - 20);
|
||||||
clear: left;
|
clear: left;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
.text-overflow();
|
.text-overflow();
|
||||||
}
|
}
|
||||||
dd {
|
dd {
|
||||||
margin-left: @component-offset-horizontal;
|
margin-left: @dl-horizontal-offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
@gray-darker: lighten(#000, 13.5%); // #222
|
@gray-darker: lighten(#000, 13.5%); // #222
|
||||||
@gray-dark: lighten(#000, 20%); // #333
|
@gray-dark: lighten(#000, 20%); // #333
|
||||||
@gray: lighten(#000, 33.5%); // #555
|
@gray: lighten(#000, 33.5%); // #555
|
||||||
@gray-light: lighten(#000, 60%); // #999
|
@gray-light: lighten(#000, 46.7%); // #777
|
||||||
@gray-lighter: lighten(#000, 93.5%); // #eee
|
@gray-lighter: lighten(#000, 93.5%); // #eee
|
||||||
|
|
||||||
@brand-primary: #428bca;
|
@brand-primary: #428bca;
|
||||||
|
|
@ -836,6 +836,8 @@
|
||||||
@blockquote-border-color: @gray-lighter;
|
@blockquote-border-color: @gray-lighter;
|
||||||
//** Page header border color
|
//** Page header border color
|
||||||
@page-header-border-color: @gray-lighter;
|
@page-header-border-color: @gray-lighter;
|
||||||
|
//** Width of horizontal description list titles
|
||||||
|
@dl-horizontal-offset: @component-offset-horizontal;
|
||||||
|
|
||||||
|
|
||||||
//== Miscellaneous
|
//== Miscellaneous
|
||||||
|
|
|
||||||
28
package.json
28
package.json
|
|
@ -30,34 +30,34 @@
|
||||||
"url": "https://github.com/twbs/bootstrap/blob/master/LICENSE"
|
"url": "https://github.com/twbs/bootstrap/blob/master/LICENSE"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"btoa": "~1.1.1",
|
"btoa": "~1.1.2",
|
||||||
"canonical-json": "~0.0.4",
|
"glob": "~4.0.2",
|
||||||
"glob": "^4.0.0",
|
"grunt": "~0.4.5",
|
||||||
"grunt": "~0.4.4",
|
"grunt-autoprefixer": "~0.7.6",
|
||||||
"grunt-autoprefixer": "~0.7.2",
|
"grunt-banner": "~0.2.3",
|
||||||
"grunt-banner": "~0.2.2",
|
|
||||||
"grunt-contrib-clean": "~0.5.0",
|
"grunt-contrib-clean": "~0.5.0",
|
||||||
"grunt-contrib-concat": "~0.4.0",
|
"grunt-contrib-concat": "~0.4.0",
|
||||||
"grunt-contrib-connect": "~0.8.0",
|
"grunt-contrib-connect": "~0.8.0",
|
||||||
"grunt-contrib-copy": "~0.5.0",
|
"grunt-contrib-copy": "~0.5.0",
|
||||||
"grunt-contrib-csslint": "~0.2.0",
|
"grunt-contrib-csslint": "~0.2.0",
|
||||||
"grunt-contrib-cssmin": "~0.9.0",
|
"grunt-contrib-cssmin": "~0.10.0",
|
||||||
"grunt-contrib-jade": "~0.12.0",
|
"grunt-contrib-jade": "~0.12.0",
|
||||||
"grunt-contrib-jshint": "~0.10.0",
|
"grunt-contrib-jshint": "~0.10.0",
|
||||||
"grunt-contrib-less": "~0.11.0",
|
"grunt-contrib-less": "~0.11.3",
|
||||||
"grunt-contrib-qunit": "~0.5.1",
|
"grunt-contrib-qunit": "~0.5.1",
|
||||||
"grunt-contrib-uglify": "~0.4.0",
|
"grunt-contrib-uglify": "~0.5.0",
|
||||||
"grunt-contrib-watch": "~0.6.1",
|
"grunt-contrib-watch": "~0.6.1",
|
||||||
"grunt-csscomb": "~2.0.1",
|
"grunt-csscomb": "~2.0.1",
|
||||||
"grunt-exec": "~0.4.5",
|
"grunt-exec": "~0.4.5",
|
||||||
"grunt-html-validation": "~0.1.15",
|
"grunt-html-validation": "~0.1.18",
|
||||||
"grunt-jekyll": "~0.4.1",
|
"grunt-jekyll": "~0.4.2",
|
||||||
"grunt-jscs-checker": "~0.4.3",
|
"grunt-jscs-checker": "~0.5.1",
|
||||||
"grunt-saucelabs": "~8.0.2",
|
"grunt-saucelabs": "~8.0.2",
|
||||||
"grunt-sed": "~0.1.1",
|
"grunt-sed": "~0.1.1",
|
||||||
"load-grunt-tasks": "~0.5.0",
|
"load-grunt-tasks": "~0.6.0",
|
||||||
"markdown": "~0.5.0",
|
"markdown": "~0.5.0",
|
||||||
"time-grunt": "~0.3.1"
|
"npm-shrinkwrap": "~3.1.6",
|
||||||
|
"time-grunt": "~0.3.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "~0.10.1"
|
"node": "~0.10.1"
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ Similar to git, `s3_cache.py` makes the assumption that [SHA-256 will effectivel
|
||||||
### For Bootstrap specifically
|
### For Bootstrap specifically
|
||||||
`s3_cache.py` is used to cache the npm packages that our Grunt tasks depend on and the RubyGems that Jekyll depends on. (Jekyll is needed to compile our docs to HTML so that we can run them thru an HTML5 validator.)
|
`s3_cache.py` is used to cache the npm packages that our Grunt tasks depend on and the RubyGems that Jekyll depends on. (Jekyll is needed to compile our docs to HTML so that we can run them thru an HTML5 validator.)
|
||||||
|
|
||||||
For npm, the `node_modules` directory is cached based on our `npm-shrinkwrap.canonical.json` file.
|
For npm, the `node_modules` directory is cached based on our `npm-shrinkwrap.json` file.
|
||||||
|
|
||||||
For RubyGems, the `gemdir` of the current RVM-selected Ruby is cached based on the `pseudo_Gemfile.lock` file generated by our Travis build script.
|
For RubyGems, the `gemdir` of the current RVM-selected Ruby is cached based on the `pseudo_Gemfile.lock` file generated by our Travis build script.
|
||||||
`pseudo_Gemfile.lock` contains the versions of Ruby and Jekyll that we're using (read our `.travis.yml` for details).
|
`pseudo_Gemfile.lock` contains the versions of Ruby and Jekyll that we're using (read our `.travis.yml` for details).
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"npm-modules": {
|
"npm-modules": {
|
||||||
"key": "./npm-shrinkwrap.canonical.json",
|
"key": "./npm-shrinkwrap.json",
|
||||||
"cache": "../node_modules",
|
"cache": "../node_modules",
|
||||||
"generate": "./uncached-npm-install.sh"
|
"generate": "./uncached-npm-install.sh"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
cd .. # /bootstrap/
|
cd .. # /bootstrap/
|
||||||
cp test-infra/npm-shrinkwrap.canonical.json npm-shrinkwrap.json
|
cp test-infra/npm-shrinkwrap.json npm-shrinkwrap.json
|
||||||
npm install
|
npm install
|
||||||
rm npm-shrinkwrap.json
|
rm npm-shrinkwrap.json
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue