diff --git a/.gitignore b/.gitignore index 1a2c94d..1c02836 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,4 @@ -*.rbc -capybara-*.html -.rspec -/log -/tmp -/db/*.sqlite3 -/public/system -/coverage/ -/spec/tmp -**.orig -rerun.txt -pickle-email-*.html -config/initializers/secret_token.rb -config/secrets.yml - -## Environment normalisation: -/.bundle -/vendor/bundle - -# these should all be checked in to normalise the environment: -# Gemfile.lock, .ruby-version, .ruby-gemset - -# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: -.rvmrc +node_modules +bower_components +.DS_Store +npm-debug.log diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..d30e9ab --- /dev/null +++ b/bower.json @@ -0,0 +1,10 @@ +{ + "name": "passport", + "version": "0.0.1", + "license": "MIT", + "private": true, + "dependencies": { + "bootstrap": "~3.1.1", + "jquery": "~2.1.1" + } +} diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..44a1e2c --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,82 @@ +'use strict' +var gulp = require('gulp') + , source = require('vinyl-source-stream') + , streamify = require('gulp-streamify') + , browserify = require('browserify') + , less = require('gulp-less') + , jade = require('gulp-jade') + , uglify = require('gulp-uglify') + , livereload = require('gulp-livereload') + , gutil = require('gulp-util') + , concat = require('gulp-concat') + +var PORT = 3333 + , SRC = './src' + , DEST = './public' + , LESS_PATHS = [ './src/css' + , './bower_components/bootstrap/less' + ] + , LEGACY_JS = [ './bower_components/jquery/dist/jquery.js' + , './bower_components/bootstrap/dist/js/bootstrap.js' + ] + +// wrap a stream in an error catcher +function catchErrors(stream) { + stream.on('error', function(err) { + gutil.log(gutil.colors.red('Error'), err.message) + stream.end() + }) + return stream +} + +// compile jade file +gulp.task('jade', function() { + gulp.src(SRC + '/pages/**/*.jade') + .pipe(catchErrors(jade())) + .pipe(gulp.dest(DEST)) +}) + +// compile js as a browserify bundle +gulp.task('js', function() { + catchErrors(browserify(SRC + '/js/index.js').bundle()) + .pipe(source('bundle.js')) + // .pipe(streamify(uglify())) + .pipe(gulp.dest(DEST + '/js')) +}) + +// concatenate legacy vendor js libraries +gulp.task('vendor-js', function() { + gulp.src (LEGACY_JS) + .pipe(concat('vendor.js')) + .pipe(gulp.dest(DEST + '/js')) +}) + +// compile less +gulp.task('less', function() { + gulp.src(SRC + '/css/main.less') + .pipe(catchErrors(less({paths: LESS_PATHS}))) + .pipe(gulp.dest(DEST + '/css')) +}) + +// build all assets +gulp.task('build', ['jade', 'less', 'js', 'vendor-js']) + +// start a simple static asset server +gulp.task('server', function(next) { + var connect = require('connect') + , server = connect() + server.use(connect.static(DEST)).listen(PORT, next) +}) + +// rebuild on changes + livereload +gulp.task('watch', ['build', 'server'], function() { + var server = livereload() + + gulp.watch(SRC + '/css/**', ['less']) + gulp.watch(SRC + '/js/**', ['js']) + gulp.watch(SRC + '/**/*.jade', ['jade']) + + gulp.watch(DEST + '/**').on('change', function(file) { + server.changed(file.path) + }) +}) diff --git a/package.json b/package.json new file mode 100644 index 0000000..ba881c7 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "passport", + "version": "0.0.1", + "private": true, + "scripts": { + "start": "./node_modules/gulp/bin/gulp.js watch", + "build": "./node_modules/gulp/bin/gulp.js build", + "postinstall": "./node_modules/bower/bin/bower install" + }, + "devDependencies": { + "bower": "^1.3.8", + "browserify": "^4.1.2", + "connect": "^2.15.0", + "gulp": "^3.6.2", + "gulp-concat": "^2.2.0", + "gulp-jade": "^0.5.0", + "gulp-less": "^1.2.3", + "gulp-livereload": "^1.5.0", + "gulp-streamify": "0.0.5", + "gulp-uglify": "^0.3.0", + "gulp-util": "^2.2.14", + "knockout": "^3.1.0", + "moment": "^2.7.0", + "superagent": "^0.18.2", + "vinyl-source-stream": "^0.1.1" + }, + "license": "MIT" +} diff --git a/public/css/main.css b/public/css/main.css new file mode 100644 index 0000000..3e7920a --- /dev/null +++ b/public/css/main.css @@ -0,0 +1,5821 @@ +/*! normalize.css v3.0.0 | MIT License | git.io/normalize */ +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + font-size: 2em; + margin: 0.67em 0; +} +mark { + background: #ff0; + color: #000; +} +small { + font-size: 80%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +td, +th { + padding: 0; +} +@media print { + * { + text-shadow: none !important; + color: #000 !important; + background: transparent !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="javascript:"]:after, + a[href^="#"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + select { + background: #fff !important; + } + .navbar { + display: none; + } + .table td, + .table th { + background-color: #fff !important; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 62.5%; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.42857143; + color: #333333; + background-color: #ffffff; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #428bca; + text-decoration: none; +} +a:hover, +a:focus { + color: #2a6496; + text-decoration: underline; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + padding: 4px; + line-height: 1.42857143; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 4px; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + display: inline-block; + max-width: 100%; + height: auto; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eeeeee; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #999999; +} +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 20px; + margin-bottom: 10px; +} +h1 small, +.h1 small, +h2 small, +.h2 small, +h3 small, +.h3 small, +h1 .small, +.h1 .small, +h2 .small, +.h2 .small, +h3 .small, +.h3 .small { + font-size: 65%; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 10px; + margin-bottom: 10px; +} +h4 small, +.h4 small, +h5 small, +.h5 small, +h6 small, +.h6 small, +h4 .small, +.h4 .small, +h5 .small, +.h5 .small, +h6 .small, +.h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 36px; +} +h2, +.h2 { + font-size: 30px; +} +h3, +.h3 { + font-size: 24px; +} +h4, +.h4 { + font-size: 18px; +} +h5, +.h5 { + font-size: 14px; +} +h6, +.h6 { + font-size: 12px; +} +p { + margin: 0 0 10px; +} +.lead { + margin-bottom: 20px; + font-size: 16px; + font-weight: 200; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 21px; + } +} +small, +.small { + font-size: 85%; +} +cite { + font-style: normal; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-muted { + color: #999999; +} +.text-primary { + color: #428bca; +} +a.text-primary:hover { + color: #3071a9; +} +.text-success { + color: #3c763d; +} +a.text-success:hover { + color: #2b542c; +} +.text-info { + color: #31708f; +} +a.text-info:hover { + color: #245269; +} +.text-warning { + color: #8a6d3b; +} +a.text-warning:hover { + color: #66512c; +} +.text-danger { + color: #a94442; +} +a.text-danger:hover { + color: #843534; +} +.bg-primary { + color: #fff; + background-color: #428bca; +} +a.bg-primary:hover { + background-color: #3071a9; +} +.bg-success { + background-color: #dff0d8; +} +a.bg-success:hover { + background-color: #c1e2b3; +} +.bg-info { + background-color: #d9edf7; +} +a.bg-info:hover { + background-color: #afd9ee; +} +.bg-warning { + background-color: #fcf8e3; +} +a.bg-warning:hover { + background-color: #f7ecb5; +} +.bg-danger { + background-color: #f2dede; +} +a.bg-danger:hover { + background-color: #e4b9b9; +} +.page-header { + padding-bottom: 9px; + margin: 40px 0 20px; + border-bottom: 1px solid #eeeeee; +} +ul, +ol { + margin-top: 0; + margin-bottom: 10px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + list-style: none; + margin-left: -5px; +} +.list-inline > li { + display: inline-block; + padding-left: 5px; + padding-right: 5px; +} +dl { + margin-top: 0; + margin-bottom: 20px; +} +dt, +dd { + line-height: 1.42857143; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + clear: left; + text-align: right; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #999999; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 10px 20px; + margin: 0 0 20px; + font-size: 17.5px; + border-left: 5px solid #eeeeee; +} +blockquote p:last-child, +blockquote ul:last-child, +blockquote ol:last-child { + margin-bottom: 0; +} +blockquote footer, +blockquote small, +blockquote .small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #999999; +} +blockquote footer:before, +blockquote small:before, +blockquote .small:before { + content: '\2014 \00A0'; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #eeeeee; + border-left: 0; + text-align: right; +} +.blockquote-reverse footer:before, +blockquote.pull-right footer:before, +.blockquote-reverse small:before, +blockquote.pull-right small:before, +.blockquote-reverse .small:before, +blockquote.pull-right .small:before { + content: ''; +} +.blockquote-reverse footer:after, +blockquote.pull-right footer:after, +.blockquote-reverse small:after, +blockquote.pull-right small:after, +.blockquote-reverse .small:after, +blockquote.pull-right .small:after { + content: '\00A0 \2014'; +} +blockquote:before, +blockquote:after { + content: ""; +} +address { + margin-bottom: 20px; + font-style: normal; + line-height: 1.42857143; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + white-space: nowrap; + border-radius: 4px; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #ffffff; + background-color: #333333; + border-radius: 3px; + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +pre { + display: block; + padding: 9.5px; + margin: 0 0 10px; + font-size: 13px; + line-height: 1.42857143; + word-break: break-all; + word-wrap: break-word; + color: #333333; + background-color: #f5f5f5; + border: 1px solid #cccccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +.row { + margin-left: -15px; + margin-right: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: 0%; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: 0%; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0%; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: 0%; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: 0%; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: 0%; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: 0%; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: 0%; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: 0%; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0%; + } +} +table { + max-width: 100%; + background-color: transparent; +} +th { + text-align: left; +} +.table { + width: 100%; + margin-bottom: 20px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; + border-top: 1px solid #dddddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #dddddd; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #dddddd; +} +.table .table { + background-color: #ffffff; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-child(odd) > td, +.table-striped > tbody > tr:nth-child(odd) > th { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover > td, +.table-hover > tbody > tr:hover > th { + background-color: #f5f5f5; +} +table col[class*="col-"] { + position: static; + float: none; + display: table-column; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + float: none; + display: table-cell; +} +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #f5f5f5; +} +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr.active:hover > th { + background-color: #e8e8e8; +} +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #dff0d8; +} +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr.success:hover > th { + background-color: #d0e9c6; +} +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #d9edf7; +} +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; +} +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; +} +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; +} +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #f2dede; +} +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr.danger:hover > th { + background-color: #ebcccc; +} +@media (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 15px; + overflow-y: hidden; + overflow-x: scroll; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #dddddd; + -webkit-overflow-scrolling: touch; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + padding: 0; + margin: 0; + border: 0; + min-width: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 20px; + font-size: 21px; + line-height: inherit; + color: #333333; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + /* IE8-9 */ + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 7px; + font-size: 14px; + line-height: 1.42857143; + color: #555555; +} +.form-control { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + color: #555555; + background-color: #ffffff; + background-image: none; + border: 1px solid #cccccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.form-control::-moz-placeholder { + color: #999999; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #999999; +} +.form-control::-webkit-input-placeholder { + color: #999999; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + cursor: not-allowed; + background-color: #eeeeee; + opacity: 1; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +input[type="date"] { + line-height: 34px; +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + display: block; + min-height: 20px; + margin-top: 10px; + margin-bottom: 10px; + padding-left: 20px; +} +.radio label, +.checkbox label { + display: inline; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + float: left; + margin-left: -20px; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + vertical-align: middle; + font-weight: normal; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +.radio[disabled], +.radio-inline[disabled], +.checkbox[disabled], +.checkbox-inline[disabled], +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"], +fieldset[disabled] .radio, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.input-sm { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 30px; + line-height: 30px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.input-lg { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-lg { + height: 46px; + line-height: 46px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 42.5px; +} +.has-feedback .form-control-feedback { + position: absolute; + top: 25px; + right: 0; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline { + color: #3c763d; +} +.has-success .form-control { + border-color: #3c763d; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-success .form-control:focus { + border-color: #2b542c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; +} +.has-success .input-group-addon { + color: #3c763d; + border-color: #3c763d; + background-color: #dff0d8; +} +.has-success .form-control-feedback { + color: #3c763d; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline { + color: #8a6d3b; +} +.has-warning .form-control { + border-color: #8a6d3b; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-warning .form-control:focus { + border-color: #66512c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; +} +.has-warning .input-group-addon { + color: #8a6d3b; + border-color: #8a6d3b; + background-color: #fcf8e3; +} +.has-warning .form-control-feedback { + color: #8a6d3b; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline { + color: #a94442; +} +.has-error .form-control { + border-color: #a94442; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .form-control:focus { + border-color: #843534; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; +} +.has-error .input-group-addon { + color: #a94442; + border-color: #a94442; + background-color: #f2dede; +} +.has-error .form-control-feedback { + color: #a94442; +} +.form-control-static { + margin-bottom: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #737373; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + vertical-align: middle; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + float: none; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .control-label, +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + margin-top: 0; + margin-bottom: 0; + padding-top: 7px; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; +} +.form-horizontal .form-group { + margin-left: -15px; + margin-right: -15px; +} +.form-horizontal .form-control-static { + padding-top: 7px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + text-align: right; + } +} +.form-horizontal .has-feedback .form-control-feedback { + top: 0; + right: 15px; +} +.btn { + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 6px 12px; + font-size: 14px; + line-height: 1.42857143; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus { + color: #333333; + text-decoration: none; +} +.btn:active, +.btn.active { + outline: 0; + background-image: none; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + pointer-events: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-default { + color: #333333; + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default:hover, +.btn-default:focus, +.btn-default:active, +.btn-default.active, +.open .dropdown-toggle.btn-default { + color: #333333; + background-color: #ebebeb; + border-color: #adadad; +} +.btn-default:active, +.btn-default.active, +.open .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #ffffff; + border-color: #cccccc; +} +.btn-default .badge { + color: #ffffff; + background-color: #333333; +} +.btn-primary { + color: #ffffff; + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary:active, +.btn-primary.active, +.open .dropdown-toggle.btn-primary { + color: #ffffff; + background-color: #3276b1; + border-color: #285e8e; +} +.btn-primary:active, +.btn-primary.active, +.open .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #428bca; + border-color: #357ebd; +} +.btn-primary .badge { + color: #428bca; + background-color: #ffffff; +} +.btn-success { + color: #ffffff; + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success:hover, +.btn-success:focus, +.btn-success:active, +.btn-success.active, +.open .dropdown-toggle.btn-success { + color: #ffffff; + background-color: #47a447; + border-color: #398439; +} +.btn-success:active, +.btn-success.active, +.open .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #5cb85c; + border-color: #4cae4c; +} +.btn-success .badge { + color: #5cb85c; + background-color: #ffffff; +} +.btn-info { + color: #ffffff; + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info:hover, +.btn-info:focus, +.btn-info:active, +.btn-info.active, +.open .dropdown-toggle.btn-info { + color: #ffffff; + background-color: #39b3d7; + border-color: #269abc; +} +.btn-info:active, +.btn-info.active, +.open .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #5bc0de; + border-color: #46b8da; +} +.btn-info .badge { + color: #5bc0de; + background-color: #ffffff; +} +.btn-warning { + color: #ffffff; + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning:hover, +.btn-warning:focus, +.btn-warning:active, +.btn-warning.active, +.open .dropdown-toggle.btn-warning { + color: #ffffff; + background-color: #ed9c28; + border-color: #d58512; +} +.btn-warning:active, +.btn-warning.active, +.open .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #f0ad4e; + border-color: #eea236; +} +.btn-warning .badge { + color: #f0ad4e; + background-color: #ffffff; +} +.btn-danger { + color: #ffffff; + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger:hover, +.btn-danger:focus, +.btn-danger:active, +.btn-danger.active, +.open .dropdown-toggle.btn-danger { + color: #ffffff; + background-color: #d2322d; + border-color: #ac2925; +} +.btn-danger:active, +.btn-danger.active, +.open .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d9534f; + border-color: #d43f3a; +} +.btn-danger .badge { + color: #d9534f; + background-color: #ffffff; +} +.btn-link { + color: #428bca; + font-weight: normal; + cursor: pointer; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #2a6496; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #999999; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; + padding-left: 0; + padding-right: 0; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + transition: height 0.35s ease; +} +@font-face { + font-family: 'Glyphicons Halflings'; + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\2a"; +} +.glyphicon-plus:before { + content: "\2b"; +} +.glyphicon-euro:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px solid; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + font-size: 14px; + background-color: #ffffff; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + background-clip: padding-box; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #333333; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + text-decoration: none; + color: #262626; + background-color: #f5f5f5; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #428bca; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #999999; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + cursor: not-allowed; +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + left: auto; + right: 0; +} +.dropdown-menu-left { + left: 0; + right: auto; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #999999; +} +.dropdown-backdrop { + position: fixed; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px solid; + content: ""; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 1px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + left: auto; + right: 0; + } + .navbar-right .dropdown-menu-left { + left: 0; + right: auto; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus { + outline: none; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child > .btn:last-child, +.btn-group > .btn-group:first-child > .dropdown-toggle { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn-group:last-child > .btn:first-child { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-left: 12px; + padding-right: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-bottom-left-radius: 4px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + float: none; + display: table-cell; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +[data-toggle="buttons"] > .btn > input[type="radio"], +[data-toggle="buttons"] > .btn > input[type="checkbox"] { + display: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 46px; + padding: 10px 16px; + font-size: 18px; + line-height: 1.33; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 46px; + line-height: 46px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 6px 12px; + font-size: 14px; + font-weight: normal; + line-height: 1; + color: #555555; + text-align: center; + background-color: #eeeeee; + border: 1px solid #cccccc; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 10px 16px; + font-size: 18px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + margin-left: -1px; +} +.nav { + margin-bottom: 0; + padding-left: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.nav > li.disabled > a { + color: #999999; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #999999; + text-decoration: none; + background-color: transparent; + cursor: not-allowed; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #eeeeee; + border-color: #428bca; +} +.nav .nav-divider { + height: 1px; + margin: 9px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #dddddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #555555; + background-color: #ffffff; + border: 1px solid #dddddd; + border-bottom-color: transparent; + cursor: default; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #ffffff; + background-color: #428bca; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #ffffff; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar { + position: relative; + min-height: 50px; + margin-bottom: 20px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + max-height: 340px; + overflow-x: visible; + padding-right: 15px; + padding-left: 15px; + border-top: 1px solid transparent; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-overflow-scrolling: touch; +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-left: 0; + padding-right: 0; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + padding: 15px 15px; + font-size: 18px; + line-height: 20px; + height: 50px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + margin-right: 15px; + padding: 9px 10px; + margin-top: 8px; + margin-bottom: 8px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: none; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 7.5px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 20px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 20px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + } + .navbar-nav.navbar-right:last-child { + margin-right: -15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + } +} +.navbar-form { + margin-left: -15px; + margin-right: -15px; + padding: 10px 15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + margin-top: 8px; + margin-bottom: 8px; +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + padding-left: 0; + vertical-align: middle; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + float: none; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + border: 0; + margin-left: 0; + margin-right: 0; + padding-top: 0; + padding-bottom: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-form.navbar-right:last-child { + margin-right: -15px; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 8px; + margin-bottom: 8px; +} +.navbar-btn.btn-sm { + margin-top: 10px; + margin-bottom: 10px; +} +.navbar-btn.btn-xs { + margin-top: 14px; + margin-bottom: 14px; +} +.navbar-text { + margin-top: 15px; + margin-bottom: 15px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-left: 15px; + margin-right: 15px; + } + .navbar-text.navbar-right:last-child { + margin-right: 0; + } +} +.navbar-default { + background-color: #f8f8f8; + border-color: #e7e7e7; +} +.navbar-default .navbar-brand { + color: #777777; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #5e5e5e; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777777; +} +.navbar-default .navbar-nav > li > a { + color: #777777; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #333333; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #555555; + background-color: #e7e7e7; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #cccccc; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #dddddd; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #dddddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #888888; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #e7e7e7; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + background-color: #e7e7e7; + color: #555555; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #333333; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #555555; + background-color: #e7e7e7; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #cccccc; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777777; +} +.navbar-default .navbar-link:hover { + color: #333333; +} +.navbar-inverse { + background-color: #222222; + border-color: #080808; +} +.navbar-inverse .navbar-brand { + color: #999999; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #999999; +} +.navbar-inverse .navbar-nav > li > a { + color: #999999; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: #080808; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #444444; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #333333; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #333333; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #ffffff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #101010; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + background-color: #080808; + color: #ffffff; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #999999; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #ffffff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #ffffff; + background-color: #080808; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444444; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #999999; +} +.navbar-inverse .navbar-link:hover { + color: #ffffff; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 20px; + list-style: none; + background-color: #f5f5f5; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + content: "/\00a0"; + padding: 0 5px; + color: #cccccc; +} +.breadcrumb > .active { + color: #999999; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 20px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 6px 12px; + line-height: 1.42857143; + text-decoration: none; + color: #428bca; + background-color: #ffffff; + border: 1px solid #dddddd; + margin-left: -1px; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + color: #2a6496; + background-color: #eeeeee; + border-color: #dddddd; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 2; + color: #ffffff; + background-color: #428bca; + border-color: #428bca; + cursor: default; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #999999; + background-color: #ffffff; + border-color: #dddddd; + cursor: not-allowed; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 10px 16px; + font-size: 18px; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 20px 0; + list-style: none; + text-align: center; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #eeeeee; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #999999; + background-color: #ffffff; + cursor: not-allowed; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #ffffff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +.label[href]:hover, +.label[href]:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #999999; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #808080; +} +.label-primary { + background-color: #428bca; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #3071a9; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #c9302c; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + color: #ffffff; + line-height: 1; + vertical-align: baseline; + white-space: nowrap; + text-align: center; + background-color: #999999; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +a.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #428bca; + background-color: #ffffff; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding: 30px; + margin-bottom: 30px; + color: inherit; + background-color: #eeeeee; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 21px; + font-weight: 200; +} +.container .jumbotron { + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding-top: 48px; + padding-bottom: 48px; + } + .container .jumbotron { + padding-left: 60px; + padding-right: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 63px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 20px; + line-height: 1.42857143; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 4px; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-left: auto; + margin-right: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #428bca; +} +.thumbnail .caption { + padding: 9px; + color: #333333; +} +.alert { + padding: 15px; + margin-bottom: 20px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable { + padding-right: 35px; +} +.alert-dismissable .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + background-color: #dff0d8; + border-color: #d6e9c6; + color: #3c763d; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #2b542c; +} +.alert-info { + background-color: #d9edf7; + border-color: #bce8f1; + color: #31708f; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #245269; +} +.alert-warning { + background-color: #fcf8e3; + border-color: #faebcc; + color: #8a6d3b; +} +.alert-warning hr { + border-top-color: #f7e1b5; +} +.alert-warning .alert-link { + color: #66512c; +} +.alert-danger { + background-color: #f2dede; + border-color: #ebccd1; + color: #a94442; +} +.alert-danger hr { + border-top-color: #e4b9c0; +} +.alert-danger .alert-link { + color: #843534; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + overflow: hidden; + height: 20px; + margin-bottom: 20px; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} +.progress-bar { + float: left; + width: 0%; + height: 100%; + font-size: 12px; + line-height: 20px; + color: #ffffff; + text-align: center; + background-color: #428bca; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress-striped .progress-bar { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-size: 40px 40px; +} +.progress.active .progress-bar { + -webkit-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #5cb85c; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #5bc0de; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #f0ad4e; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #d9534f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.media, +.media-body { + overflow: hidden; + zoom: 1; +} +.media, +.media .media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media-object { + display: block; +} +.media-heading { + margin: 0 0 5px; +} +.media > .pull-left { + margin-right: 10px; +} +.media > .pull-right { + margin-left: 10px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + margin-bottom: 20px; + padding-left: 0; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #ffffff; + border: 1px solid #dddddd; +} +.list-group-item:first-child { + border-top-right-radius: 4px; + border-top-left-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +a.list-group-item { + color: #555555; +} +a.list-group-item .list-group-item-heading { + color: #333333; +} +a.list-group-item:hover, +a.list-group-item:focus { + text-decoration: none; + background-color: #f5f5f5; +} +a.list-group-item.active, +a.list-group-item.active:hover, +a.list-group-item.active:focus { + z-index: 2; + color: #ffffff; + background-color: #428bca; + border-color: #428bca; +} +a.list-group-item.active .list-group-item-heading, +a.list-group-item.active:hover .list-group-item-heading, +a.list-group-item.active:focus .list-group-item-heading { + color: inherit; +} +a.list-group-item.active .list-group-item-text, +a.list-group-item.active:hover .list-group-item-text, +a.list-group-item.active:focus .list-group-item-text { + color: #e1edf7; +} +.list-group-item-success { + color: #3c763d; + background-color: #dff0d8; +} +a.list-group-item-success { + color: #3c763d; +} +a.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +a.list-group-item-success:focus { + color: #3c763d; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +a.list-group-item-success.active:hover, +a.list-group-item-success.active:focus { + color: #fff; + background-color: #3c763d; + border-color: #3c763d; +} +.list-group-item-info { + color: #31708f; + background-color: #d9edf7; +} +a.list-group-item-info { + color: #31708f; +} +a.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +a.list-group-item-info:focus { + color: #31708f; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +a.list-group-item-info.active:hover, +a.list-group-item-info.active:focus { + color: #fff; + background-color: #31708f; + border-color: #31708f; +} +.list-group-item-warning { + color: #8a6d3b; + background-color: #fcf8e3; +} +a.list-group-item-warning { + color: #8a6d3b; +} +a.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +a.list-group-item-warning:focus { + color: #8a6d3b; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus { + color: #fff; + background-color: #8a6d3b; + border-color: #8a6d3b; +} +.list-group-item-danger { + color: #a94442; + background-color: #f2dede; +} +a.list-group-item-danger { + color: #a94442; +} +a.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +a.list-group-item-danger:focus { + color: #a94442; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus { + color: #fff; + background-color: #a94442; + border-color: #a94442; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 20px; + background-color: #ffffff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 16px; + color: inherit; +} +.panel-title > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #f5f5f5; + border-top: 1px solid #dddddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table { + margin-bottom: 0; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive { + border-top: 1px solid #dddddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + border: 0; + margin-bottom: 0; +} +.panel-group { + margin-bottom: 20px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; + overflow: hidden; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse .panel-body { + border-top: 1px solid #dddddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #dddddd; +} +.panel-default { + border-color: #dddddd; +} +.panel-default > .panel-heading { + color: #333333; + background-color: #f5f5f5; + border-color: #dddddd; +} +.panel-default > .panel-heading + .panel-collapse .panel-body { + border-top-color: #dddddd; +} +.panel-default > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #dddddd; +} +.panel-primary { + border-color: #428bca; +} +.panel-primary > .panel-heading { + color: #ffffff; + background-color: #428bca; + border-color: #428bca; +} +.panel-primary > .panel-heading + .panel-collapse .panel-body { + border-top-color: #428bca; +} +.panel-primary > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #428bca; +} +.panel-success { + border-color: #d6e9c6; +} +.panel-success > .panel-heading { + color: #3c763d; + background-color: #dff0d8; + border-color: #d6e9c6; +} +.panel-success > .panel-heading + .panel-collapse .panel-body { + border-top-color: #d6e9c6; +} +.panel-success > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #d6e9c6; +} +.panel-info { + border-color: #bce8f1; +} +.panel-info > .panel-heading { + color: #31708f; + background-color: #d9edf7; + border-color: #bce8f1; +} +.panel-info > .panel-heading + .panel-collapse .panel-body { + border-top-color: #bce8f1; +} +.panel-info > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #bce8f1; +} +.panel-warning { + border-color: #faebcc; +} +.panel-warning > .panel-heading { + color: #8a6d3b; + background-color: #fcf8e3; + border-color: #faebcc; +} +.panel-warning > .panel-heading + .panel-collapse .panel-body { + border-top-color: #faebcc; +} +.panel-warning > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #faebcc; +} +.panel-danger { + border-color: #ebccd1; +} +.panel-danger > .panel-heading { + color: #a94442; + background-color: #f2dede; + border-color: #ebccd1; +} +.panel-danger > .panel-heading + .panel-collapse .panel-body { + border-top-color: #ebccd1; +} +.panel-danger > .panel-footer + .panel-collapse .panel-body { + border-bottom-color: #ebccd1; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f5f5f5; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} +.modal-open { + overflow: hidden; +} +.modal { + display: none; + overflow: auto; + overflow-y: scroll; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + transform: translate(0, -25%); + -webkit-transition: -webkit-transform 0.3s ease-out; + -moz-transition: -moz-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + background-clip: padding-box; + outline: none; +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; + filter: alpha(opacity=0); +} +.modal-backdrop.in { + opacity: 0.5; + filter: alpha(opacity=50); +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; + min-height: 16.42857143px; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 20px; +} +.modal-footer { + margin-top: 15px; + padding: 19px 20px 20px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-left: 5px; + margin-bottom: 0; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1030; + display: block; + visibility: visible; + font-size: 12px; + line-height: 1.4; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.9; + filter: alpha(opacity=90); +} +.tooltip.top { + margin-top: -3px; + padding: 5px 0; +} +.tooltip.right { + margin-left: 3px; + padding: 0 5px; +} +.tooltip.bottom { + margin-top: 3px; + padding: 5px 0; +} +.tooltip.left { + margin-left: -3px; + padding: 0 5px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + left: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + right: 5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + left: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + right: 5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1010; + display: none; + max-width: 276px; + padding: 1px; + text-align: left; + background-color: #ffffff; + background-clip: padding-box; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + white-space: normal; +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + margin: 0; + padding: 8px 14px; + font-size: 14px; + font-weight: normal; + line-height: 18px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + border-width: 10px; + content: ""; +} +.popover.top > .arrow { + left: 50%; + margin-left: -11px; + border-bottom-width: 0; + border-top-color: #999999; + border-top-color: rgba(0, 0, 0, 0.25); + bottom: -11px; +} +.popover.top > .arrow:after { + content: " "; + bottom: 1px; + margin-left: -10px; + border-bottom-width: 0; + border-top-color: #ffffff; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-left-width: 0; + border-right-color: #999999; + border-right-color: rgba(0, 0, 0, 0.25); +} +.popover.right > .arrow:after { + content: " "; + left: 1px; + bottom: -10px; + border-left-width: 0; + border-right-color: #ffffff; +} +.popover.bottom > .arrow { + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999999; + border-bottom-color: rgba(0, 0, 0, 0.25); + top: -11px; +} +.popover.bottom > .arrow:after { + content: " "; + top: 1px; + margin-left: -10px; + border-top-width: 0; + border-bottom-color: #ffffff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999999; + border-left-color: rgba(0, 0, 0, 0.25); +} +.popover.left > .arrow:after { + content: " "; + right: 1px; + border-right-width: 0; + border-left-color: #ffffff; + bottom: -10px; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + overflow: hidden; + width: 100%; +} +.carousel-inner > .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + line-height: 1; +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 15%; + opacity: 0.5; + filter: alpha(opacity=50); + font-size: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0%), color-stop(rgba(0, 0, 0, 0.0001) 100%)); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); +} +.carousel-control.right { + left: auto; + right: 0; + background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0%), color-stop(rgba(0, 0, 0, 0.5) 100%)); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); +} +.carousel-control:hover, +.carousel-control:focus { + outline: none; + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + margin-top: -10px; + margin-left: -10px; + font-family: serif; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203a'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + margin-left: -30%; + padding-left: 0; + list-style: none; + text-align: center; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + border: 1px solid #ffffff; + border-radius: 10px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); +} +.carousel-indicators .active { + margin: 0; + width: 12px; + height: 12px; + background-color: #ffffff; +} +.carousel-caption { + position: absolute; + left: 15%; + right: 15%; + bottom: 20px; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + margin-left: -15px; + font-size: 30px; + } + .carousel-caption { + left: 20%; + right: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.clearfix:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-left: auto; + margin-right: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; + visibility: hidden !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} +.day-header strong { + padding-left: 1em; +} +.day-header .btn-group:first-child { + margin-right: 1em; +} +.day-wrapper { + width: 450px; +} +.day-wrapper .day-gutter { + display: inline-block; + width: 50px; + vertical-align: top; + border: 1px solid gray; + border-right: none; +} +.day-wrapper .day { + display: inline-block; + width: 400px; + border: 1px solid gray; + position: relative; +} +.day-wrapper .day .timeslot { + position: absolute; + padding: 5px; +} +.day-wrapper .day .timeslot .badge.availability { + background-color: green; +} +.day-wrapper .day .timeslot .badge.bookings { + background-color: blue; +} +.day-wrapper .day .timeslot .badge.boat { + background-color: black; +} +.day-wrapper .day .timeslot .badge.full { + background-color: red; +} +.day-wrapper .hour { + height: 55px; + border-bottom: 1px solid #f0f0f0; + color: #aaa; + padding-left: 2px; +} +.day-wrapper .hour:last-child { + border-bottom: none; +} diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..4f32cb0 --- /dev/null +++ b/public/index.html @@ -0,0 +1 @@ +Resource Management Code Challenge

Piranha View Tours Schedule


Boats

\ No newline at end of file diff --git a/public/js/bundle.js b/public/js/bundle.js new file mode 100755 index 0000000..bf8dc3b --- /dev/null +++ b/public/js/bundle.js @@ -0,0 +1,8694 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o tag) - put directly in global namespace + factory(window['ko'] = {}); + } +}(function(koExports){ +// Internally, all KO objects are attached to koExports (even the non-exported ones whose names will be minified by the closure compiler). +// In the future, the following "ko" variable may be made distinct from "koExports" so that private objects are not externally reachable. +var ko = typeof koExports !== 'undefined' ? koExports : {}; +// Google Closure Compiler helpers (used only to make the minified file smaller) +ko.exportSymbol = function(koPath, object) { + var tokens = koPath.split("."); + + // In the future, "ko" may become distinct from "koExports" (so that non-exported objects are not reachable) + // At that point, "target" would be set to: (typeof koExports !== "undefined" ? koExports : ko) + var target = ko; + + for (var i = 0; i < tokens.length - 1; i++) + target = target[tokens[i]]; + target[tokens[tokens.length - 1]] = object; +}; +ko.exportProperty = function(owner, publicName, object) { + owner[publicName] = object; +}; +ko.version = "3.1.0"; + +ko.exportSymbol('version', ko.version); +ko.utils = (function () { + function objectForEach(obj, action) { + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { + action(prop, obj[prop]); + } + } + } + + function extend(target, source) { + if (source) { + for(var prop in source) { + if(source.hasOwnProperty(prop)) { + target[prop] = source[prop]; + } + } + } + return target; + } + + function setPrototypeOf(obj, proto) { + obj.__proto__ = proto; + return obj; + } + + var canSetPrototype = ({ __proto__: [] } instanceof Array); + + // Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup) + var knownEvents = {}, knownEventTypesByEventName = {}; + var keyEventTypeName = (navigator && /Firefox\/2/i.test(navigator.userAgent)) ? 'KeyboardEvent' : 'UIEvents'; + knownEvents[keyEventTypeName] = ['keyup', 'keydown', 'keypress']; + knownEvents['MouseEvents'] = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave']; + objectForEach(knownEvents, function(eventType, knownEventsForType) { + if (knownEventsForType.length) { + for (var i = 0, j = knownEventsForType.length; i < j; i++) + knownEventTypesByEventName[knownEventsForType[i]] = eventType; + } + }); + var eventsThatMustBeRegisteredUsingAttachEvent = { 'propertychange': true }; // Workaround for an IE9 issue - https://github.com/SteveSanderson/knockout/issues/406 + + // Detect IE versions for bug workarounds (uses IE conditionals, not UA string, for robustness) + // Note that, since IE 10 does not support conditional comments, the following logic only detects IE < 10. + // Currently this is by design, since IE 10+ behaves correctly when treated as a standard browser. + // If there is a future need to detect specific versions of IE10+, we will amend this. + var ieVersion = document && (function() { + var version = 3, div = document.createElement('div'), iElems = div.getElementsByTagName('i'); + + // Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment + while ( + div.innerHTML = '', + iElems[0] + ) {} + return version > 4 ? version : undefined; + }()); + var isIe6 = ieVersion === 6, + isIe7 = ieVersion === 7; + + function isClickOnCheckableElement(element, eventType) { + if ((ko.utils.tagNameLower(element) !== "input") || !element.type) return false; + if (eventType.toLowerCase() != "click") return false; + var inputType = element.type; + return (inputType == "checkbox") || (inputType == "radio"); + } + + return { + fieldsIncludedWithJsonPost: ['authenticity_token', /^__RequestVerificationToken(_.*)?$/], + + arrayForEach: function (array, action) { + for (var i = 0, j = array.length; i < j; i++) + action(array[i], i); + }, + + arrayIndexOf: function (array, item) { + if (typeof Array.prototype.indexOf == "function") + return Array.prototype.indexOf.call(array, item); + for (var i = 0, j = array.length; i < j; i++) + if (array[i] === item) + return i; + return -1; + }, + + arrayFirst: function (array, predicate, predicateOwner) { + for (var i = 0, j = array.length; i < j; i++) + if (predicate.call(predicateOwner, array[i], i)) + return array[i]; + return null; + }, + + arrayRemoveItem: function (array, itemToRemove) { + var index = ko.utils.arrayIndexOf(array, itemToRemove); + if (index > 0) { + array.splice(index, 1); + } + else if (index === 0) { + array.shift(); + } + }, + + arrayGetDistinctValues: function (array) { + array = array || []; + var result = []; + for (var i = 0, j = array.length; i < j; i++) { + if (ko.utils.arrayIndexOf(result, array[i]) < 0) + result.push(array[i]); + } + return result; + }, + + arrayMap: function (array, mapping) { + array = array || []; + var result = []; + for (var i = 0, j = array.length; i < j; i++) + result.push(mapping(array[i], i)); + return result; + }, + + arrayFilter: function (array, predicate) { + array = array || []; + var result = []; + for (var i = 0, j = array.length; i < j; i++) + if (predicate(array[i], i)) + result.push(array[i]); + return result; + }, + + arrayPushAll: function (array, valuesToPush) { + if (valuesToPush instanceof Array) + array.push.apply(array, valuesToPush); + else + for (var i = 0, j = valuesToPush.length; i < j; i++) + array.push(valuesToPush[i]); + return array; + }, + + addOrRemoveItem: function(array, value, included) { + var existingEntryIndex = ko.utils.arrayIndexOf(ko.utils.peekObservable(array), value); + if (existingEntryIndex < 0) { + if (included) + array.push(value); + } else { + if (!included) + array.splice(existingEntryIndex, 1); + } + }, + + canSetPrototype: canSetPrototype, + + extend: extend, + + setPrototypeOf: setPrototypeOf, + + setPrototypeOfOrExtend: canSetPrototype ? setPrototypeOf : extend, + + objectForEach: objectForEach, + + objectMap: function(source, mapping) { + if (!source) + return source; + var target = {}; + for (var prop in source) { + if (source.hasOwnProperty(prop)) { + target[prop] = mapping(source[prop], prop, source); + } + } + return target; + }, + + emptyDomNode: function (domNode) { + while (domNode.firstChild) { + ko.removeNode(domNode.firstChild); + } + }, + + moveCleanedNodesToContainerElement: function(nodes) { + // Ensure it's a real array, as we're about to reparent the nodes and + // we don't want the underlying collection to change while we're doing that. + var nodesArray = ko.utils.makeArray(nodes); + + var container = document.createElement('div'); + for (var i = 0, j = nodesArray.length; i < j; i++) { + container.appendChild(ko.cleanNode(nodesArray[i])); + } + return container; + }, + + cloneNodes: function (nodesArray, shouldCleanNodes) { + for (var i = 0, j = nodesArray.length, newNodesArray = []; i < j; i++) { + var clonedNode = nodesArray[i].cloneNode(true); + newNodesArray.push(shouldCleanNodes ? ko.cleanNode(clonedNode) : clonedNode); + } + return newNodesArray; + }, + + setDomNodeChildren: function (domNode, childNodes) { + ko.utils.emptyDomNode(domNode); + if (childNodes) { + for (var i = 0, j = childNodes.length; i < j; i++) + domNode.appendChild(childNodes[i]); + } + }, + + replaceDomNodes: function (nodeToReplaceOrNodeArray, newNodesArray) { + var nodesToReplaceArray = nodeToReplaceOrNodeArray.nodeType ? [nodeToReplaceOrNodeArray] : nodeToReplaceOrNodeArray; + if (nodesToReplaceArray.length > 0) { + var insertionPoint = nodesToReplaceArray[0]; + var parent = insertionPoint.parentNode; + for (var i = 0, j = newNodesArray.length; i < j; i++) + parent.insertBefore(newNodesArray[i], insertionPoint); + for (var i = 0, j = nodesToReplaceArray.length; i < j; i++) { + ko.removeNode(nodesToReplaceArray[i]); + } + } + }, + + fixUpContinuousNodeArray: function(continuousNodeArray, parentNode) { + // Before acting on a set of nodes that were previously outputted by a template function, we have to reconcile + // them against what is in the DOM right now. It may be that some of the nodes have already been removed, or that + // new nodes might have been inserted in the middle, for example by a binding. Also, there may previously have been + // leading comment nodes (created by rewritten string-based templates) that have since been removed during binding. + // So, this function translates the old "map" output array into its best guess of the set of current DOM nodes. + // + // Rules: + // [A] Any leading nodes that have been removed should be ignored + // These most likely correspond to memoization nodes that were already removed during binding + // See https://github.com/SteveSanderson/knockout/pull/440 + // [B] We want to output a continuous series of nodes. So, ignore any nodes that have already been removed, + // and include any nodes that have been inserted among the previous collection + + if (continuousNodeArray.length) { + // The parent node can be a virtual element; so get the real parent node + parentNode = (parentNode.nodeType === 8 && parentNode.parentNode) || parentNode; + + // Rule [A] + while (continuousNodeArray.length && continuousNodeArray[0].parentNode !== parentNode) + continuousNodeArray.shift(); + + // Rule [B] + if (continuousNodeArray.length > 1) { + var current = continuousNodeArray[0], last = continuousNodeArray[continuousNodeArray.length - 1]; + // Replace with the actual new continuous node set + continuousNodeArray.length = 0; + while (current !== last) { + continuousNodeArray.push(current); + current = current.nextSibling; + if (!current) // Won't happen, except if the developer has manually removed some DOM elements (then we're in an undefined scenario) + return; + } + continuousNodeArray.push(last); + } + } + return continuousNodeArray; + }, + + setOptionNodeSelectionState: function (optionNode, isSelected) { + // IE6 sometimes throws "unknown error" if you try to write to .selected directly, whereas Firefox struggles with setAttribute. Pick one based on browser. + if (ieVersion < 7) + optionNode.setAttribute("selected", isSelected); + else + optionNode.selected = isSelected; + }, + + stringTrim: function (string) { + return string === null || string === undefined ? '' : + string.trim ? + string.trim() : + string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, ''); + }, + + stringTokenize: function (string, delimiter) { + var result = []; + var tokens = (string || "").split(delimiter); + for (var i = 0, j = tokens.length; i < j; i++) { + var trimmed = ko.utils.stringTrim(tokens[i]); + if (trimmed !== "") + result.push(trimmed); + } + return result; + }, + + stringStartsWith: function (string, startsWith) { + string = string || ""; + if (startsWith.length > string.length) + return false; + return string.substring(0, startsWith.length) === startsWith; + }, + + domNodeIsContainedBy: function (node, containedByNode) { + if (node === containedByNode) + return true; + if (node.nodeType === 11) + return false; // Fixes issue #1162 - can't use node.contains for document fragments on IE8 + if (containedByNode.contains) + return containedByNode.contains(node.nodeType === 3 ? node.parentNode : node); + if (containedByNode.compareDocumentPosition) + return (containedByNode.compareDocumentPosition(node) & 16) == 16; + while (node && node != containedByNode) { + node = node.parentNode; + } + return !!node; + }, + + domNodeIsAttachedToDocument: function (node) { + return ko.utils.domNodeIsContainedBy(node, node.ownerDocument.documentElement); + }, + + anyDomNodeIsAttachedToDocument: function(nodes) { + return !!ko.utils.arrayFirst(nodes, ko.utils.domNodeIsAttachedToDocument); + }, + + tagNameLower: function(element) { + // For HTML elements, tagName will always be upper case; for XHTML elements, it'll be lower case. + // Possible future optimization: If we know it's an element from an XHTML document (not HTML), + // we don't need to do the .toLowerCase() as it will always be lower case anyway. + return element && element.tagName && element.tagName.toLowerCase(); + }, + + registerEventHandler: function (element, eventType, handler) { + var mustUseAttachEvent = ieVersion && eventsThatMustBeRegisteredUsingAttachEvent[eventType]; + if (!mustUseAttachEvent && jQuery) { + jQuery(element)['bind'](eventType, handler); + } else if (!mustUseAttachEvent && typeof element.addEventListener == "function") + element.addEventListener(eventType, handler, false); + else if (typeof element.attachEvent != "undefined") { + var attachEventHandler = function (event) { handler.call(element, event); }, + attachEventName = "on" + eventType; + element.attachEvent(attachEventName, attachEventHandler); + + // IE does not dispose attachEvent handlers automatically (unlike with addEventListener) + // so to avoid leaks, we have to remove them manually. See bug #856 + ko.utils.domNodeDisposal.addDisposeCallback(element, function() { + element.detachEvent(attachEventName, attachEventHandler); + }); + } else + throw new Error("Browser doesn't support addEventListener or attachEvent"); + }, + + triggerEvent: function (element, eventType) { + if (!(element && element.nodeType)) + throw new Error("element must be a DOM node when calling triggerEvent"); + + // For click events on checkboxes and radio buttons, jQuery toggles the element checked state *after* the + // event handler runs instead of *before*. (This was fixed in 1.9 for checkboxes but not for radio buttons.) + // IE doesn't change the checked state when you trigger the click event using "fireEvent". + // In both cases, we'll use the click method instead. + var useClickWorkaround = isClickOnCheckableElement(element, eventType); + + if (jQuery && !useClickWorkaround) { + jQuery(element)['trigger'](eventType); + } else if (typeof document.createEvent == "function") { + if (typeof element.dispatchEvent == "function") { + var eventCategory = knownEventTypesByEventName[eventType] || "HTMLEvents"; + var event = document.createEvent(eventCategory); + event.initEvent(eventType, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, element); + element.dispatchEvent(event); + } + else + throw new Error("The supplied element doesn't support dispatchEvent"); + } else if (useClickWorkaround && element.click) { + element.click(); + } else if (typeof element.fireEvent != "undefined") { + element.fireEvent("on" + eventType); + } else { + throw new Error("Browser doesn't support triggering events"); + } + }, + + unwrapObservable: function (value) { + return ko.isObservable(value) ? value() : value; + }, + + peekObservable: function (value) { + return ko.isObservable(value) ? value.peek() : value; + }, + + toggleDomNodeCssClass: function (node, classNames, shouldHaveClass) { + if (classNames) { + var cssClassNameRegex = /\S+/g, + currentClassNames = node.className.match(cssClassNameRegex) || []; + ko.utils.arrayForEach(classNames.match(cssClassNameRegex), function(className) { + ko.utils.addOrRemoveItem(currentClassNames, className, shouldHaveClass); + }); + node.className = currentClassNames.join(" "); + } + }, + + setTextContent: function(element, textContent) { + var value = ko.utils.unwrapObservable(textContent); + if ((value === null) || (value === undefined)) + value = ""; + + // We need there to be exactly one child: a text node. + // If there are no children, more than one, or if it's not a text node, + // we'll clear everything and create a single text node. + var innerTextNode = ko.virtualElements.firstChild(element); + if (!innerTextNode || innerTextNode.nodeType != 3 || ko.virtualElements.nextSibling(innerTextNode)) { + ko.virtualElements.setDomNodeChildren(element, [element.ownerDocument.createTextNode(value)]); + } else { + innerTextNode.data = value; + } + + ko.utils.forceRefresh(element); + }, + + setElementName: function(element, name) { + element.name = name; + + // Workaround IE 6/7 issue + // - https://github.com/SteveSanderson/knockout/issues/197 + // - http://www.matts411.com/post/setting_the_name_attribute_in_ie_dom/ + if (ieVersion <= 7) { + try { + element.mergeAttributes(document.createElement(""), false); + } + catch(e) {} // For IE9 with doc mode "IE9 Standards" and browser mode "IE9 Compatibility View" + } + }, + + forceRefresh: function(node) { + // Workaround for an IE9 rendering bug - https://github.com/SteveSanderson/knockout/issues/209 + if (ieVersion >= 9) { + // For text nodes and comment nodes (most likely virtual elements), we will have to refresh the container + var elem = node.nodeType == 1 ? node : node.parentNode; + if (elem.style) + elem.style.zoom = elem.style.zoom; + } + }, + + ensureSelectElementIsRenderedCorrectly: function(selectElement) { + // Workaround for IE9 rendering bug - it doesn't reliably display all the text in dynamically-added select boxes unless you force it to re-render by updating the width. + // (See https://github.com/SteveSanderson/knockout/issues/312, http://stackoverflow.com/questions/5908494/select-only-shows-first-char-of-selected-option) + // Also fixes IE7 and IE8 bug that causes selects to be zero width if enclosed by 'if' or 'with'. (See issue #839) + if (ieVersion) { + var originalWidth = selectElement.style.width; + selectElement.style.width = 0; + selectElement.style.width = originalWidth; + } + }, + + range: function (min, max) { + min = ko.utils.unwrapObservable(min); + max = ko.utils.unwrapObservable(max); + var result = []; + for (var i = min; i <= max; i++) + result.push(i); + return result; + }, + + makeArray: function(arrayLikeObject) { + var result = []; + for (var i = 0, j = arrayLikeObject.length; i < j; i++) { + result.push(arrayLikeObject[i]); + }; + return result; + }, + + isIe6 : isIe6, + isIe7 : isIe7, + ieVersion : ieVersion, + + getFormFields: function(form, fieldName) { + var fields = ko.utils.makeArray(form.getElementsByTagName("input")).concat(ko.utils.makeArray(form.getElementsByTagName("textarea"))); + var isMatchingField = (typeof fieldName == 'string') + ? function(field) { return field.name === fieldName } + : function(field) { return fieldName.test(field.name) }; // Treat fieldName as regex or object containing predicate + var matches = []; + for (var i = fields.length - 1; i >= 0; i--) { + if (isMatchingField(fields[i])) + matches.push(fields[i]); + }; + return matches; + }, + + parseJson: function (jsonString) { + if (typeof jsonString == "string") { + jsonString = ko.utils.stringTrim(jsonString); + if (jsonString) { + if (JSON && JSON.parse) // Use native parsing where available + return JSON.parse(jsonString); + return (new Function("return " + jsonString))(); // Fallback on less safe parsing for older browsers + } + } + return null; + }, + + stringifyJson: function (data, replacer, space) { // replacer and space are optional + if (!JSON || !JSON.stringify) + throw new Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"); + return JSON.stringify(ko.utils.unwrapObservable(data), replacer, space); + }, + + postJson: function (urlOrForm, data, options) { + options = options || {}; + var params = options['params'] || {}; + var includeFields = options['includeFields'] || this.fieldsIncludedWithJsonPost; + var url = urlOrForm; + + // If we were given a form, use its 'action' URL and pick out any requested field values + if((typeof urlOrForm == 'object') && (ko.utils.tagNameLower(urlOrForm) === "form")) { + var originalForm = urlOrForm; + url = originalForm.action; + for (var i = includeFields.length - 1; i >= 0; i--) { + var fields = ko.utils.getFormFields(originalForm, includeFields[i]); + for (var j = fields.length - 1; j >= 0; j--) + params[fields[j].name] = fields[j].value; + } + } + + data = ko.utils.unwrapObservable(data); + var form = document.createElement("form"); + form.style.display = "none"; + form.action = url; + form.method = "post"; + for (var key in data) { + // Since 'data' this is a model object, we include all properties including those inherited from its prototype + var input = document.createElement("input"); + input.name = key; + input.value = ko.utils.stringifyJson(ko.utils.unwrapObservable(data[key])); + form.appendChild(input); + } + objectForEach(params, function(key, value) { + var input = document.createElement("input"); + input.name = key; + input.value = value; + form.appendChild(input); + }); + document.body.appendChild(form); + options['submitter'] ? options['submitter'](form) : form.submit(); + setTimeout(function () { form.parentNode.removeChild(form); }, 0); + } + } +}()); + +ko.exportSymbol('utils', ko.utils); +ko.exportSymbol('utils.arrayForEach', ko.utils.arrayForEach); +ko.exportSymbol('utils.arrayFirst', ko.utils.arrayFirst); +ko.exportSymbol('utils.arrayFilter', ko.utils.arrayFilter); +ko.exportSymbol('utils.arrayGetDistinctValues', ko.utils.arrayGetDistinctValues); +ko.exportSymbol('utils.arrayIndexOf', ko.utils.arrayIndexOf); +ko.exportSymbol('utils.arrayMap', ko.utils.arrayMap); +ko.exportSymbol('utils.arrayPushAll', ko.utils.arrayPushAll); +ko.exportSymbol('utils.arrayRemoveItem', ko.utils.arrayRemoveItem); +ko.exportSymbol('utils.extend', ko.utils.extend); +ko.exportSymbol('utils.fieldsIncludedWithJsonPost', ko.utils.fieldsIncludedWithJsonPost); +ko.exportSymbol('utils.getFormFields', ko.utils.getFormFields); +ko.exportSymbol('utils.peekObservable', ko.utils.peekObservable); +ko.exportSymbol('utils.postJson', ko.utils.postJson); +ko.exportSymbol('utils.parseJson', ko.utils.parseJson); +ko.exportSymbol('utils.registerEventHandler', ko.utils.registerEventHandler); +ko.exportSymbol('utils.stringifyJson', ko.utils.stringifyJson); +ko.exportSymbol('utils.range', ko.utils.range); +ko.exportSymbol('utils.toggleDomNodeCssClass', ko.utils.toggleDomNodeCssClass); +ko.exportSymbol('utils.triggerEvent', ko.utils.triggerEvent); +ko.exportSymbol('utils.unwrapObservable', ko.utils.unwrapObservable); +ko.exportSymbol('utils.objectForEach', ko.utils.objectForEach); +ko.exportSymbol('utils.addOrRemoveItem', ko.utils.addOrRemoveItem); +ko.exportSymbol('unwrap', ko.utils.unwrapObservable); // Convenient shorthand, because this is used so commonly + +if (!Function.prototype['bind']) { + // Function.prototype.bind is a standard part of ECMAScript 5th Edition (December 2009, http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf) + // In case the browser doesn't implement it natively, provide a JavaScript implementation. This implementation is based on the one in prototype.js + Function.prototype['bind'] = function (object) { + var originalFunction = this, args = Array.prototype.slice.call(arguments), object = args.shift(); + return function () { + return originalFunction.apply(object, args.concat(Array.prototype.slice.call(arguments))); + }; + }; +} + +ko.utils.domData = new (function () { + var uniqueId = 0; + var dataStoreKeyExpandoPropertyName = "__ko__" + (new Date).getTime(); + var dataStore = {}; + + function getAll(node, createIfNotFound) { + var dataStoreKey = node[dataStoreKeyExpandoPropertyName]; + var hasExistingDataStore = dataStoreKey && (dataStoreKey !== "null") && dataStore[dataStoreKey]; + if (!hasExistingDataStore) { + if (!createIfNotFound) + return undefined; + dataStoreKey = node[dataStoreKeyExpandoPropertyName] = "ko" + uniqueId++; + dataStore[dataStoreKey] = {}; + } + return dataStore[dataStoreKey]; + } + + return { + get: function (node, key) { + var allDataForNode = getAll(node, false); + return allDataForNode === undefined ? undefined : allDataForNode[key]; + }, + set: function (node, key, value) { + if (value === undefined) { + // Make sure we don't actually create a new domData key if we are actually deleting a value + if (getAll(node, false) === undefined) + return; + } + var allDataForNode = getAll(node, true); + allDataForNode[key] = value; + }, + clear: function (node) { + var dataStoreKey = node[dataStoreKeyExpandoPropertyName]; + if (dataStoreKey) { + delete dataStore[dataStoreKey]; + node[dataStoreKeyExpandoPropertyName] = null; + return true; // Exposing "did clean" flag purely so specs can infer whether things have been cleaned up as intended + } + return false; + }, + + nextKey: function () { + return (uniqueId++) + dataStoreKeyExpandoPropertyName; + } + }; +})(); + +ko.exportSymbol('utils.domData', ko.utils.domData); +ko.exportSymbol('utils.domData.clear', ko.utils.domData.clear); // Exporting only so specs can clear up after themselves fully + +ko.utils.domNodeDisposal = new (function () { + var domDataKey = ko.utils.domData.nextKey(); + var cleanableNodeTypes = { 1: true, 8: true, 9: true }; // Element, Comment, Document + var cleanableNodeTypesWithDescendants = { 1: true, 9: true }; // Element, Document + + function getDisposeCallbacksCollection(node, createIfNotFound) { + var allDisposeCallbacks = ko.utils.domData.get(node, domDataKey); + if ((allDisposeCallbacks === undefined) && createIfNotFound) { + allDisposeCallbacks = []; + ko.utils.domData.set(node, domDataKey, allDisposeCallbacks); + } + return allDisposeCallbacks; + } + function destroyCallbacksCollection(node) { + ko.utils.domData.set(node, domDataKey, undefined); + } + + function cleanSingleNode(node) { + // Run all the dispose callbacks + var callbacks = getDisposeCallbacksCollection(node, false); + if (callbacks) { + callbacks = callbacks.slice(0); // Clone, as the array may be modified during iteration (typically, callbacks will remove themselves) + for (var i = 0; i < callbacks.length; i++) + callbacks[i](node); + } + + // Erase the DOM data + ko.utils.domData.clear(node); + + // Perform cleanup needed by external libraries (currently only jQuery, but can be extended) + ko.utils.domNodeDisposal["cleanExternalData"](node); + + // Clear any immediate-child comment nodes, as these wouldn't have been found by + // node.getElementsByTagName("*") in cleanNode() (comment nodes aren't elements) + if (cleanableNodeTypesWithDescendants[node.nodeType]) + cleanImmediateCommentTypeChildren(node); + } + + function cleanImmediateCommentTypeChildren(nodeWithChildren) { + var child, nextChild = nodeWithChildren.firstChild; + while (child = nextChild) { + nextChild = child.nextSibling; + if (child.nodeType === 8) + cleanSingleNode(child); + } + } + + return { + addDisposeCallback : function(node, callback) { + if (typeof callback != "function") + throw new Error("Callback must be a function"); + getDisposeCallbacksCollection(node, true).push(callback); + }, + + removeDisposeCallback : function(node, callback) { + var callbacksCollection = getDisposeCallbacksCollection(node, false); + if (callbacksCollection) { + ko.utils.arrayRemoveItem(callbacksCollection, callback); + if (callbacksCollection.length == 0) + destroyCallbacksCollection(node); + } + }, + + cleanNode : function(node) { + // First clean this node, where applicable + if (cleanableNodeTypes[node.nodeType]) { + cleanSingleNode(node); + + // ... then its descendants, where applicable + if (cleanableNodeTypesWithDescendants[node.nodeType]) { + // Clone the descendants list in case it changes during iteration + var descendants = []; + ko.utils.arrayPushAll(descendants, node.getElementsByTagName("*")); + for (var i = 0, j = descendants.length; i < j; i++) + cleanSingleNode(descendants[i]); + } + } + return node; + }, + + removeNode : function(node) { + ko.cleanNode(node); + if (node.parentNode) + node.parentNode.removeChild(node); + }, + + "cleanExternalData" : function (node) { + // Special support for jQuery here because it's so commonly used. + // Many jQuery plugins (including jquery.tmpl) store data using jQuery's equivalent of domData + // so notify it to tear down any resources associated with the node & descendants here. + if (jQuery && (typeof jQuery['cleanData'] == "function")) + jQuery['cleanData']([node]); + } + } +})(); +ko.cleanNode = ko.utils.domNodeDisposal.cleanNode; // Shorthand name for convenience +ko.removeNode = ko.utils.domNodeDisposal.removeNode; // Shorthand name for convenience +ko.exportSymbol('cleanNode', ko.cleanNode); +ko.exportSymbol('removeNode', ko.removeNode); +ko.exportSymbol('utils.domNodeDisposal', ko.utils.domNodeDisposal); +ko.exportSymbol('utils.domNodeDisposal.addDisposeCallback', ko.utils.domNodeDisposal.addDisposeCallback); +ko.exportSymbol('utils.domNodeDisposal.removeDisposeCallback', ko.utils.domNodeDisposal.removeDisposeCallback); +(function () { + var leadingCommentRegex = /^(\s*)/; + + function simpleHtmlParse(html) { + // Based on jQuery's "clean" function, but only accounting for table-related elements. + // If you have referenced jQuery, this won't be used anyway - KO will use jQuery's "clean" function directly + + // Note that there's still an issue in IE < 9 whereby it will discard comment nodes that are the first child of + // a descendant node. For example: "
abc
" will get parsed as "
abc
" + // This won't affect anyone who has referenced jQuery, and there's always the workaround of inserting a dummy node + // (possibly a text node) in front of the comment. So, KO does not attempt to workaround this IE issue automatically at present. + + // Trim whitespace, otherwise indexOf won't work as expected + var tags = ko.utils.stringTrim(html).toLowerCase(), div = document.createElement("div"); + + // Finds the first match from the left column, and returns the corresponding "wrap" data from the right column + var wrap = tags.match(/^<(thead|tbody|tfoot)/) && [1, "", "
"] || + !tags.indexOf("", ""] || + (!tags.indexOf("", ""] || + /* anything else */ [0, "", ""]; + + // Go to html and back, then peel off extra wrappers + // Note that we always prefix with some dummy text, because otherwise, IE<9 will strip out leading comment nodes in descendants. Total madness. + var markup = "ignored
" + wrap[1] + html + wrap[2] + "
"; + if (typeof window['innerShiv'] == "function") { + div.appendChild(window['innerShiv'](markup)); + } else { + div.innerHTML = markup; + } + + // Move to the right depth + while (wrap[0]--) + div = div.lastChild; + + return ko.utils.makeArray(div.lastChild.childNodes); + } + + function jQueryHtmlParse(html) { + // jQuery's "parseHTML" function was introduced in jQuery 1.8.0 and is a documented public API. + if (jQuery['parseHTML']) { + return jQuery['parseHTML'](html) || []; // Ensure we always return an array and never null + } else { + // For jQuery < 1.8.0, we fall back on the undocumented internal "clean" function. + var elems = jQuery['clean']([html]); + + // As of jQuery 1.7.1, jQuery parses the HTML by appending it to some dummy parent nodes held in an in-memory document fragment. + // Unfortunately, it never clears the dummy parent nodes from the document fragment, so it leaks memory over time. + // Fix this by finding the top-most dummy parent element, and detaching it from its owner fragment. + if (elems && elems[0]) { + // Find the top-most parent element that's a direct child of a document fragment + var elem = elems[0]; + while (elem.parentNode && elem.parentNode.nodeType !== 11 /* i.e., DocumentFragment */) + elem = elem.parentNode; + // ... then detach it + if (elem.parentNode) + elem.parentNode.removeChild(elem); + } + + return elems; + } + } + + ko.utils.parseHtmlFragment = function(html) { + return jQuery ? jQueryHtmlParse(html) // As below, benefit from jQuery's optimisations where possible + : simpleHtmlParse(html); // ... otherwise, this simple logic will do in most common cases. + }; + + ko.utils.setHtml = function(node, html) { + ko.utils.emptyDomNode(node); + + // There's no legitimate reason to display a stringified observable without unwrapping it, so we'll unwrap it + html = ko.utils.unwrapObservable(html); + + if ((html !== null) && (html !== undefined)) { + if (typeof html != 'string') + html = html.toString(); + + // jQuery contains a lot of sophisticated code to parse arbitrary HTML fragments, + // for example elements which are not normally allowed to exist on their own. + // If you've referenced jQuery we'll use that rather than duplicating its code. + if (jQuery) { + jQuery(node)['html'](html); + } else { + // ... otherwise, use KO's own parsing logic. + var parsedNodes = ko.utils.parseHtmlFragment(html); + for (var i = 0; i < parsedNodes.length; i++) + node.appendChild(parsedNodes[i]); + } + } + }; +})(); + +ko.exportSymbol('utils.parseHtmlFragment', ko.utils.parseHtmlFragment); +ko.exportSymbol('utils.setHtml', ko.utils.setHtml); + +ko.memoization = (function () { + var memos = {}; + + function randomMax8HexChars() { + return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1); + } + function generateRandomId() { + return randomMax8HexChars() + randomMax8HexChars(); + } + function findMemoNodes(rootNode, appendToArray) { + if (!rootNode) + return; + if (rootNode.nodeType == 8) { + var memoId = ko.memoization.parseMemoText(rootNode.nodeValue); + if (memoId != null) + appendToArray.push({ domNode: rootNode, memoId: memoId }); + } else if (rootNode.nodeType == 1) { + for (var i = 0, childNodes = rootNode.childNodes, j = childNodes.length; i < j; i++) + findMemoNodes(childNodes[i], appendToArray); + } + } + + return { + memoize: function (callback) { + if (typeof callback != "function") + throw new Error("You can only pass a function to ko.memoization.memoize()"); + var memoId = generateRandomId(); + memos[memoId] = callback; + return ""; + }, + + unmemoize: function (memoId, callbackParams) { + var callback = memos[memoId]; + if (callback === undefined) + throw new Error("Couldn't find any memo with ID " + memoId + ". Perhaps it's already been unmemoized."); + try { + callback.apply(null, callbackParams || []); + return true; + } + finally { delete memos[memoId]; } + }, + + unmemoizeDomNodeAndDescendants: function (domNode, extraCallbackParamsArray) { + var memos = []; + findMemoNodes(domNode, memos); + for (var i = 0, j = memos.length; i < j; i++) { + var node = memos[i].domNode; + var combinedParams = [node]; + if (extraCallbackParamsArray) + ko.utils.arrayPushAll(combinedParams, extraCallbackParamsArray); + ko.memoization.unmemoize(memos[i].memoId, combinedParams); + node.nodeValue = ""; // Neuter this node so we don't try to unmemoize it again + if (node.parentNode) + node.parentNode.removeChild(node); // If possible, erase it totally (not always possible - someone else might just hold a reference to it then call unmemoizeDomNodeAndDescendants again) + } + }, + + parseMemoText: function (memoText) { + var match = memoText.match(/^\[ko_memo\:(.*?)\]$/); + return match ? match[1] : null; + } + }; +})(); + +ko.exportSymbol('memoization', ko.memoization); +ko.exportSymbol('memoization.memoize', ko.memoization.memoize); +ko.exportSymbol('memoization.unmemoize', ko.memoization.unmemoize); +ko.exportSymbol('memoization.parseMemoText', ko.memoization.parseMemoText); +ko.exportSymbol('memoization.unmemoizeDomNodeAndDescendants', ko.memoization.unmemoizeDomNodeAndDescendants); +ko.extenders = { + 'throttle': function(target, timeout) { + // Throttling means two things: + + // (1) For dependent observables, we throttle *evaluations* so that, no matter how fast its dependencies + // notify updates, the target doesn't re-evaluate (and hence doesn't notify) faster than a certain rate + target['throttleEvaluation'] = timeout; + + // (2) For writable targets (observables, or writable dependent observables), we throttle *writes* + // so the target cannot change value synchronously or faster than a certain rate + var writeTimeoutInstance = null; + return ko.dependentObservable({ + 'read': target, + 'write': function(value) { + clearTimeout(writeTimeoutInstance); + writeTimeoutInstance = setTimeout(function() { + target(value); + }, timeout); + } + }); + }, + + 'rateLimit': function(target, options) { + var timeout, method, limitFunction; + + if (typeof options == 'number') { + timeout = options; + } else { + timeout = options['timeout']; + method = options['method']; + } + + limitFunction = method == 'notifyWhenChangesStop' ? debounce : throttle; + target.limit(function(callback) { + return limitFunction(callback, timeout); + }); + }, + + 'notify': function(target, notifyWhen) { + target["equalityComparer"] = notifyWhen == "always" ? + null : // null equalityComparer means to always notify + valuesArePrimitiveAndEqual; + } +}; + +var primitiveTypes = { 'undefined':1, 'boolean':1, 'number':1, 'string':1 }; +function valuesArePrimitiveAndEqual(a, b) { + var oldValueIsPrimitive = (a === null) || (typeof(a) in primitiveTypes); + return oldValueIsPrimitive ? (a === b) : false; +} + +function throttle(callback, timeout) { + var timeoutInstance; + return function () { + if (!timeoutInstance) { + timeoutInstance = setTimeout(function() { + timeoutInstance = undefined; + callback(); + }, timeout); + } + }; +} + +function debounce(callback, timeout) { + var timeoutInstance; + return function () { + clearTimeout(timeoutInstance); + timeoutInstance = setTimeout(callback, timeout); + }; +} + +function applyExtenders(requestedExtenders) { + var target = this; + if (requestedExtenders) { + ko.utils.objectForEach(requestedExtenders, function(key, value) { + var extenderHandler = ko.extenders[key]; + if (typeof extenderHandler == 'function') { + target = extenderHandler(target, value) || target; + } + }); + } + return target; +} + +ko.exportSymbol('extenders', ko.extenders); + +ko.subscription = function (target, callback, disposeCallback) { + this.target = target; + this.callback = callback; + this.disposeCallback = disposeCallback; + this.isDisposed = false; + ko.exportProperty(this, 'dispose', this.dispose); +}; +ko.subscription.prototype.dispose = function () { + this.isDisposed = true; + this.disposeCallback(); +}; + +ko.subscribable = function () { + ko.utils.setPrototypeOfOrExtend(this, ko.subscribable['fn']); + this._subscriptions = {}; +} + +var defaultEvent = "change"; + +var ko_subscribable_fn = { + subscribe: function (callback, callbackTarget, event) { + var self = this; + + event = event || defaultEvent; + var boundCallback = callbackTarget ? callback.bind(callbackTarget) : callback; + + var subscription = new ko.subscription(self, boundCallback, function () { + ko.utils.arrayRemoveItem(self._subscriptions[event], subscription); + }); + + // This will force a computed with deferEvaluation to evaluate before any subscriptions + // are registered. + if (self.peek) { + self.peek(); + } + + if (!self._subscriptions[event]) + self._subscriptions[event] = []; + self._subscriptions[event].push(subscription); + return subscription; + }, + + "notifySubscribers": function (valueToNotify, event) { + event = event || defaultEvent; + if (this.hasSubscriptionsForEvent(event)) { + try { + ko.dependencyDetection.begin(); // Begin suppressing dependency detection (by setting the top frame to undefined) + for (var a = this._subscriptions[event].slice(0), i = 0, subscription; subscription = a[i]; ++i) { + // In case a subscription was disposed during the arrayForEach cycle, check + // for isDisposed on each subscription before invoking its callback + if (!subscription.isDisposed) + subscription.callback(valueToNotify); + } + } finally { + ko.dependencyDetection.end(); // End suppressing dependency detection + } + } + }, + + limit: function(limitFunction) { + var self = this, selfIsObservable = ko.isObservable(self), + isPending, previousValue, pendingValue, beforeChange = 'beforeChange'; + + if (!self._origNotifySubscribers) { + self._origNotifySubscribers = self["notifySubscribers"]; + self["notifySubscribers"] = function(value, event) { + if (!event || event === defaultEvent) { + self._rateLimitedChange(value); + } else if (event === beforeChange) { + self._rateLimitedBeforeChange(value); + } else { + self._origNotifySubscribers(value, event); + } + }; + } + + var finish = limitFunction(function() { + // If an observable provided a reference to itself, access it to get the latest value. + // This allows computed observables to delay calculating their value until needed. + if (selfIsObservable && pendingValue === self) { + pendingValue = self(); + } + isPending = false; + if (self.isDifferent(previousValue, pendingValue)) { + self._origNotifySubscribers(previousValue = pendingValue); + } + }); + + self._rateLimitedChange = function(value) { + isPending = true; + pendingValue = value; + finish(); + }; + self._rateLimitedBeforeChange = function(value) { + if (!isPending) { + previousValue = value; + self._origNotifySubscribers(value, beforeChange); + } + }; + }, + + hasSubscriptionsForEvent: function(event) { + return this._subscriptions[event] && this._subscriptions[event].length; + }, + + getSubscriptionsCount: function () { + var total = 0; + ko.utils.objectForEach(this._subscriptions, function(eventName, subscriptions) { + total += subscriptions.length; + }); + return total; + }, + + isDifferent: function(oldValue, newValue) { + return !this['equalityComparer'] || !this['equalityComparer'](oldValue, newValue); + }, + + extend: applyExtenders +}; + +ko.exportProperty(ko_subscribable_fn, 'subscribe', ko_subscribable_fn.subscribe); +ko.exportProperty(ko_subscribable_fn, 'extend', ko_subscribable_fn.extend); +ko.exportProperty(ko_subscribable_fn, 'getSubscriptionsCount', ko_subscribable_fn.getSubscriptionsCount); + +// For browsers that support proto assignment, we overwrite the prototype of each +// observable instance. Since observables are functions, we need Function.prototype +// to still be in the prototype chain. +if (ko.utils.canSetPrototype) { + ko.utils.setPrototypeOf(ko_subscribable_fn, Function.prototype); +} + +ko.subscribable['fn'] = ko_subscribable_fn; + + +ko.isSubscribable = function (instance) { + return instance != null && typeof instance.subscribe == "function" && typeof instance["notifySubscribers"] == "function"; +}; + +ko.exportSymbol('subscribable', ko.subscribable); +ko.exportSymbol('isSubscribable', ko.isSubscribable); + +ko.computedContext = ko.dependencyDetection = (function () { + var outerFrames = [], + currentFrame, + lastId = 0; + + // Return a unique ID that can be assigned to an observable for dependency tracking. + // Theoretically, you could eventually overflow the number storage size, resulting + // in duplicate IDs. But in JavaScript, the largest exact integral value is 2^53 + // or 9,007,199,254,740,992. If you created 1,000,000 IDs per second, it would + // take over 285 years to reach that number. + // Reference http://blog.vjeux.com/2010/javascript/javascript-max_int-number-limits.html + function getId() { + return ++lastId; + } + + function begin(options) { + outerFrames.push(currentFrame); + currentFrame = options; + } + + function end() { + currentFrame = outerFrames.pop(); + } + + return { + begin: begin, + + end: end, + + registerDependency: function (subscribable) { + if (currentFrame) { + if (!ko.isSubscribable(subscribable)) + throw new Error("Only subscribable things can act as dependencies"); + currentFrame.callback(subscribable, subscribable._id || (subscribable._id = getId())); + } + }, + + ignore: function (callback, callbackTarget, callbackArgs) { + try { + begin(); + return callback.apply(callbackTarget, callbackArgs || []); + } finally { + end(); + } + }, + + getDependenciesCount: function () { + if (currentFrame) + return currentFrame.computed.getDependenciesCount(); + }, + + isInitial: function() { + if (currentFrame) + return currentFrame.isInitial; + } + }; +})(); + +ko.exportSymbol('computedContext', ko.computedContext); +ko.exportSymbol('computedContext.getDependenciesCount', ko.computedContext.getDependenciesCount); +ko.exportSymbol('computedContext.isInitial', ko.computedContext.isInitial); +ko.observable = function (initialValue) { + var _latestValue = initialValue; + + function observable() { + if (arguments.length > 0) { + // Write + + // Ignore writes if the value hasn't changed + if (observable.isDifferent(_latestValue, arguments[0])) { + observable.valueWillMutate(); + _latestValue = arguments[0]; + if (DEBUG) observable._latestValue = _latestValue; + observable.valueHasMutated(); + } + return this; // Permits chained assignments + } + else { + // Read + ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation + return _latestValue; + } + } + ko.subscribable.call(observable); + ko.utils.setPrototypeOfOrExtend(observable, ko.observable['fn']); + + if (DEBUG) observable._latestValue = _latestValue; + observable.peek = function() { return _latestValue }; + observable.valueHasMutated = function () { observable["notifySubscribers"](_latestValue); } + observable.valueWillMutate = function () { observable["notifySubscribers"](_latestValue, "beforeChange"); } + + ko.exportProperty(observable, 'peek', observable.peek); + ko.exportProperty(observable, "valueHasMutated", observable.valueHasMutated); + ko.exportProperty(observable, "valueWillMutate", observable.valueWillMutate); + + return observable; +} + +ko.observable['fn'] = { + "equalityComparer": valuesArePrimitiveAndEqual +}; + +var protoProperty = ko.observable.protoProperty = "__ko_proto__"; +ko.observable['fn'][protoProperty] = ko.observable; + +// Note that for browsers that don't support proto assignment, the +// inheritance chain is created manually in the ko.observable constructor +if (ko.utils.canSetPrototype) { + ko.utils.setPrototypeOf(ko.observable['fn'], ko.subscribable['fn']); +} + +ko.hasPrototype = function(instance, prototype) { + if ((instance === null) || (instance === undefined) || (instance[protoProperty] === undefined)) return false; + if (instance[protoProperty] === prototype) return true; + return ko.hasPrototype(instance[protoProperty], prototype); // Walk the prototype chain +}; + +ko.isObservable = function (instance) { + return ko.hasPrototype(instance, ko.observable); +} +ko.isWriteableObservable = function (instance) { + // Observable + if ((typeof instance == "function") && instance[protoProperty] === ko.observable) + return true; + // Writeable dependent observable + if ((typeof instance == "function") && (instance[protoProperty] === ko.dependentObservable) && (instance.hasWriteFunction)) + return true; + // Anything else + return false; +} + + +ko.exportSymbol('observable', ko.observable); +ko.exportSymbol('isObservable', ko.isObservable); +ko.exportSymbol('isWriteableObservable', ko.isWriteableObservable); +ko.observableArray = function (initialValues) { + initialValues = initialValues || []; + + if (typeof initialValues != 'object' || !('length' in initialValues)) + throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined."); + + var result = ko.observable(initialValues); + ko.utils.setPrototypeOfOrExtend(result, ko.observableArray['fn']); + return result.extend({'trackArrayChanges':true}); +}; + +ko.observableArray['fn'] = { + 'remove': function (valueOrPredicate) { + var underlyingArray = this.peek(); + var removedValues = []; + var predicate = typeof valueOrPredicate == "function" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; }; + for (var i = 0; i < underlyingArray.length; i++) { + var value = underlyingArray[i]; + if (predicate(value)) { + if (removedValues.length === 0) { + this.valueWillMutate(); + } + removedValues.push(value); + underlyingArray.splice(i, 1); + i--; + } + } + if (removedValues.length) { + this.valueHasMutated(); + } + return removedValues; + }, + + 'removeAll': function (arrayOfValues) { + // If you passed zero args, we remove everything + if (arrayOfValues === undefined) { + var underlyingArray = this.peek(); + var allValues = underlyingArray.slice(0); + this.valueWillMutate(); + underlyingArray.splice(0, underlyingArray.length); + this.valueHasMutated(); + return allValues; + } + // If you passed an arg, we interpret it as an array of entries to remove + if (!arrayOfValues) + return []; + return this['remove'](function (value) { + return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0; + }); + }, + + 'destroy': function (valueOrPredicate) { + var underlyingArray = this.peek(); + var predicate = typeof valueOrPredicate == "function" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; }; + this.valueWillMutate(); + for (var i = underlyingArray.length - 1; i >= 0; i--) { + var value = underlyingArray[i]; + if (predicate(value)) + underlyingArray[i]["_destroy"] = true; + } + this.valueHasMutated(); + }, + + 'destroyAll': function (arrayOfValues) { + // If you passed zero args, we destroy everything + if (arrayOfValues === undefined) + return this['destroy'](function() { return true }); + + // If you passed an arg, we interpret it as an array of entries to destroy + if (!arrayOfValues) + return []; + return this['destroy'](function (value) { + return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0; + }); + }, + + 'indexOf': function (item) { + var underlyingArray = this(); + return ko.utils.arrayIndexOf(underlyingArray, item); + }, + + 'replace': function(oldItem, newItem) { + var index = this['indexOf'](oldItem); + if (index >= 0) { + this.valueWillMutate(); + this.peek()[index] = newItem; + this.valueHasMutated(); + } + } +}; + +// Populate ko.observableArray.fn with read/write functions from native arrays +// Important: Do not add any additional functions here that may reasonably be used to *read* data from the array +// because we'll eval them without causing subscriptions, so ko.computed output could end up getting stale +ko.utils.arrayForEach(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (methodName) { + ko.observableArray['fn'][methodName] = function () { + // Use "peek" to avoid creating a subscription in any computed that we're executing in the context of + // (for consistency with mutating regular observables) + var underlyingArray = this.peek(); + this.valueWillMutate(); + this.cacheDiffForKnownOperation(underlyingArray, methodName, arguments); + var methodCallResult = underlyingArray[methodName].apply(underlyingArray, arguments); + this.valueHasMutated(); + return methodCallResult; + }; +}); + +// Populate ko.observableArray.fn with read-only functions from native arrays +ko.utils.arrayForEach(["slice"], function (methodName) { + ko.observableArray['fn'][methodName] = function () { + var underlyingArray = this(); + return underlyingArray[methodName].apply(underlyingArray, arguments); + }; +}); + +// Note that for browsers that don't support proto assignment, the +// inheritance chain is created manually in the ko.observableArray constructor +if (ko.utils.canSetPrototype) { + ko.utils.setPrototypeOf(ko.observableArray['fn'], ko.observable['fn']); +} + +ko.exportSymbol('observableArray', ko.observableArray); +var arrayChangeEventName = 'arrayChange'; +ko.extenders['trackArrayChanges'] = function(target) { + // Only modify the target observable once + if (target.cacheDiffForKnownOperation) { + return; + } + var trackingChanges = false, + cachedDiff = null, + pendingNotifications = 0, + underlyingSubscribeFunction = target.subscribe; + + // Intercept "subscribe" calls, and for array change events, ensure change tracking is enabled + target.subscribe = target['subscribe'] = function(callback, callbackTarget, event) { + if (event === arrayChangeEventName) { + trackChanges(); + } + return underlyingSubscribeFunction.apply(this, arguments); + }; + + function trackChanges() { + // Calling 'trackChanges' multiple times is the same as calling it once + if (trackingChanges) { + return; + } + + trackingChanges = true; + + // Intercept "notifySubscribers" to track how many times it was called. + var underlyingNotifySubscribersFunction = target['notifySubscribers']; + target['notifySubscribers'] = function(valueToNotify, event) { + if (!event || event === defaultEvent) { + ++pendingNotifications; + } + return underlyingNotifySubscribersFunction.apply(this, arguments); + }; + + // Each time the array changes value, capture a clone so that on the next + // change it's possible to produce a diff + var previousContents = [].concat(target.peek() || []); + cachedDiff = null; + target.subscribe(function(currentContents) { + // Make a copy of the current contents and ensure it's an array + currentContents = [].concat(currentContents || []); + + // Compute the diff and issue notifications, but only if someone is listening + if (target.hasSubscriptionsForEvent(arrayChangeEventName)) { + var changes = getChanges(previousContents, currentContents); + if (changes.length) { + target['notifySubscribers'](changes, arrayChangeEventName); + } + } + + // Eliminate references to the old, removed items, so they can be GCed + previousContents = currentContents; + cachedDiff = null; + pendingNotifications = 0; + }); + } + + function getChanges(previousContents, currentContents) { + // We try to re-use cached diffs. + // The scenarios where pendingNotifications > 1 are when using rate-limiting or the Deferred Updates + // plugin, which without this check would not be compatible with arrayChange notifications. Normally, + // notifications are issued immediately so we wouldn't be queueing up more than one. + if (!cachedDiff || pendingNotifications > 1) { + cachedDiff = ko.utils.compareArrays(previousContents, currentContents, { 'sparse': true }); + } + + return cachedDiff; + } + + target.cacheDiffForKnownOperation = function(rawArray, operationName, args) { + // Only run if we're currently tracking changes for this observable array + // and there aren't any pending deferred notifications. + if (!trackingChanges || pendingNotifications) { + return; + } + var diff = [], + arrayLength = rawArray.length, + argsLength = args.length, + offset = 0; + + function pushDiff(status, value, index) { + return diff[diff.length] = { 'status': status, 'value': value, 'index': index }; + } + switch (operationName) { + case 'push': + offset = arrayLength; + case 'unshift': + for (var index = 0; index < argsLength; index++) { + pushDiff('added', args[index], offset + index); + } + break; + + case 'pop': + offset = arrayLength - 1; + case 'shift': + if (arrayLength) { + pushDiff('deleted', rawArray[offset], offset); + } + break; + + case 'splice': + // Negative start index means 'from end of array'. After that we clamp to [0...arrayLength]. + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice + var startIndex = Math.min(Math.max(0, args[0] < 0 ? arrayLength + args[0] : args[0]), arrayLength), + endDeleteIndex = argsLength === 1 ? arrayLength : Math.min(startIndex + (args[1] || 0), arrayLength), + endAddIndex = startIndex + argsLength - 2, + endIndex = Math.max(endDeleteIndex, endAddIndex), + additions = [], deletions = []; + for (var index = startIndex, argsIndex = 2; index < endIndex; ++index, ++argsIndex) { + if (index < endDeleteIndex) + deletions.push(pushDiff('deleted', rawArray[index], index)); + if (index < endAddIndex) + additions.push(pushDiff('added', args[argsIndex], index)); + } + ko.utils.findMovesInArrayComparison(deletions, additions); + break; + + default: + return; + } + cachedDiff = diff; + }; +}; +ko.computed = ko.dependentObservable = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, options) { + var _latestValue, + _needsEvaluation = true, + _isBeingEvaluated = false, + _suppressDisposalUntilDisposeWhenReturnsFalse = false, + _isDisposed = false, + readFunction = evaluatorFunctionOrOptions; + + if (readFunction && typeof readFunction == "object") { + // Single-parameter syntax - everything is on this "options" param + options = readFunction; + readFunction = options["read"]; + } else { + // Multi-parameter syntax - construct the options according to the params passed + options = options || {}; + if (!readFunction) + readFunction = options["read"]; + } + if (typeof readFunction != "function") + throw new Error("Pass a function that returns the value of the ko.computed"); + + function addSubscriptionToDependency(subscribable, id) { + if (!_subscriptionsToDependencies[id]) { + _subscriptionsToDependencies[id] = subscribable.subscribe(evaluatePossiblyAsync); + ++_dependenciesCount; + } + } + + function disposeAllSubscriptionsToDependencies() { + _isDisposed = true; + ko.utils.objectForEach(_subscriptionsToDependencies, function (id, subscription) { + subscription.dispose(); + }); + _subscriptionsToDependencies = {}; + _dependenciesCount = 0; + _needsEvaluation = false; + } + + function evaluatePossiblyAsync() { + var throttleEvaluationTimeout = dependentObservable['throttleEvaluation']; + if (throttleEvaluationTimeout && throttleEvaluationTimeout >= 0) { + clearTimeout(evaluationTimeoutInstance); + evaluationTimeoutInstance = setTimeout(evaluateImmediate, throttleEvaluationTimeout); + } else if (dependentObservable._evalRateLimited) { + dependentObservable._evalRateLimited(); + } else { + evaluateImmediate(); + } + } + + function evaluateImmediate() { + if (_isBeingEvaluated) { + // If the evaluation of a ko.computed causes side effects, it's possible that it will trigger its own re-evaluation. + // This is not desirable (it's hard for a developer to realise a chain of dependencies might cause this, and they almost + // certainly didn't intend infinite re-evaluations). So, for predictability, we simply prevent ko.computeds from causing + // their own re-evaluation. Further discussion at https://github.com/SteveSanderson/knockout/pull/387 + return; + } + + // Do not evaluate (and possibly capture new dependencies) if disposed + if (_isDisposed) { + return; + } + + if (disposeWhen && disposeWhen()) { + // See comment below about _suppressDisposalUntilDisposeWhenReturnsFalse + if (!_suppressDisposalUntilDisposeWhenReturnsFalse) { + dispose(); + return; + } + } else { + // It just did return false, so we can stop suppressing now + _suppressDisposalUntilDisposeWhenReturnsFalse = false; + } + + _isBeingEvaluated = true; + try { + // Initially, we assume that none of the subscriptions are still being used (i.e., all are candidates for disposal). + // Then, during evaluation, we cross off any that are in fact still being used. + var disposalCandidates = _subscriptionsToDependencies, disposalCount = _dependenciesCount; + ko.dependencyDetection.begin({ + callback: function(subscribable, id) { + if (!_isDisposed) { + if (disposalCount && disposalCandidates[id]) { + // Don't want to dispose this subscription, as it's still being used + _subscriptionsToDependencies[id] = disposalCandidates[id]; + ++_dependenciesCount; + delete disposalCandidates[id]; + --disposalCount; + } else { + // Brand new subscription - add it + addSubscriptionToDependency(subscribable, id); + } + } + }, + computed: dependentObservable, + isInitial: !_dependenciesCount // If we're evaluating when there are no previous dependencies, it must be the first time + }); + + _subscriptionsToDependencies = {}; + _dependenciesCount = 0; + + try { + var newValue = evaluatorFunctionTarget ? readFunction.call(evaluatorFunctionTarget) : readFunction(); + + } finally { + ko.dependencyDetection.end(); + + // For each subscription no longer being used, remove it from the active subscriptions list and dispose it + if (disposalCount) { + ko.utils.objectForEach(disposalCandidates, function(id, toDispose) { + toDispose.dispose(); + }); + } + + _needsEvaluation = false; + } + + if (dependentObservable.isDifferent(_latestValue, newValue)) { + dependentObservable["notifySubscribers"](_latestValue, "beforeChange"); + + _latestValue = newValue; + if (DEBUG) dependentObservable._latestValue = _latestValue; + + // If rate-limited, the notification will happen within the limit function. Otherwise, + // notify as soon as the value changes. Check specifically for the throttle setting since + // it overrides rateLimit. + if (!dependentObservable._evalRateLimited || dependentObservable['throttleEvaluation']) { + dependentObservable["notifySubscribers"](_latestValue); + } + } + } finally { + _isBeingEvaluated = false; + } + + if (!_dependenciesCount) + dispose(); + } + + function dependentObservable() { + if (arguments.length > 0) { + if (typeof writeFunction === "function") { + // Writing a value + writeFunction.apply(evaluatorFunctionTarget, arguments); + } else { + throw new Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters."); + } + return this; // Permits chained assignments + } else { + // Reading the value + if (_needsEvaluation) + evaluateImmediate(); + ko.dependencyDetection.registerDependency(dependentObservable); + return _latestValue; + } + } + + function peek() { + // Peek won't re-evaluate, except to get the initial value when "deferEvaluation" is set. + // That's the only time that both of these conditions will be satisfied. + if (_needsEvaluation && !_dependenciesCount) + evaluateImmediate(); + return _latestValue; + } + + function isActive() { + return _needsEvaluation || _dependenciesCount > 0; + } + + // By here, "options" is always non-null + var writeFunction = options["write"], + disposeWhenNodeIsRemoved = options["disposeWhenNodeIsRemoved"] || options.disposeWhenNodeIsRemoved || null, + disposeWhenOption = options["disposeWhen"] || options.disposeWhen, + disposeWhen = disposeWhenOption, + dispose = disposeAllSubscriptionsToDependencies, + _subscriptionsToDependencies = {}, + _dependenciesCount = 0, + evaluationTimeoutInstance = null; + + if (!evaluatorFunctionTarget) + evaluatorFunctionTarget = options["owner"]; + + ko.subscribable.call(dependentObservable); + ko.utils.setPrototypeOfOrExtend(dependentObservable, ko.dependentObservable['fn']); + + dependentObservable.peek = peek; + dependentObservable.getDependenciesCount = function () { return _dependenciesCount; }; + dependentObservable.hasWriteFunction = typeof options["write"] === "function"; + dependentObservable.dispose = function () { dispose(); }; + dependentObservable.isActive = isActive; + + // Replace the limit function with one that delays evaluation as well. + var originalLimit = dependentObservable.limit; + dependentObservable.limit = function(limitFunction) { + originalLimit.call(dependentObservable, limitFunction); + dependentObservable._evalRateLimited = function() { + dependentObservable._rateLimitedBeforeChange(_latestValue); + + _needsEvaluation = true; // Mark as dirty + + // Pass the observable to the rate-limit code, which will access it when + // it's time to do the notification. + dependentObservable._rateLimitedChange(dependentObservable); + } + }; + + ko.exportProperty(dependentObservable, 'peek', dependentObservable.peek); + ko.exportProperty(dependentObservable, 'dispose', dependentObservable.dispose); + ko.exportProperty(dependentObservable, 'isActive', dependentObservable.isActive); + ko.exportProperty(dependentObservable, 'getDependenciesCount', dependentObservable.getDependenciesCount); + + // Add a "disposeWhen" callback that, on each evaluation, disposes if the node was removed without using ko.removeNode. + if (disposeWhenNodeIsRemoved) { + // Since this computed is associated with a DOM node, and we don't want to dispose the computed + // until the DOM node is *removed* from the document (as opposed to never having been in the document), + // we'll prevent disposal until "disposeWhen" first returns false. + _suppressDisposalUntilDisposeWhenReturnsFalse = true; + + // Only watch for the node's disposal if the value really is a node. It might not be, + // e.g., { disposeWhenNodeIsRemoved: true } can be used to opt into the "only dispose + // after first false result" behaviour even if there's no specific node to watch. This + // technique is intended for KO's internal use only and shouldn't be documented or used + // by application code, as it's likely to change in a future version of KO. + if (disposeWhenNodeIsRemoved.nodeType) { + disposeWhen = function () { + return !ko.utils.domNodeIsAttachedToDocument(disposeWhenNodeIsRemoved) || (disposeWhenOption && disposeWhenOption()); + }; + } + } + + // Evaluate, unless deferEvaluation is true + if (options['deferEvaluation'] !== true) + evaluateImmediate(); + + // Attach a DOM node disposal callback so that the computed will be proactively disposed as soon as the node is + // removed using ko.removeNode. But skip if isActive is false (there will never be any dependencies to dispose). + if (disposeWhenNodeIsRemoved && isActive() && disposeWhenNodeIsRemoved.nodeType) { + dispose = function() { + ko.utils.domNodeDisposal.removeDisposeCallback(disposeWhenNodeIsRemoved, dispose); + disposeAllSubscriptionsToDependencies(); + }; + ko.utils.domNodeDisposal.addDisposeCallback(disposeWhenNodeIsRemoved, dispose); + } + + return dependentObservable; +}; + +ko.isComputed = function(instance) { + return ko.hasPrototype(instance, ko.dependentObservable); +}; + +var protoProp = ko.observable.protoProperty; // == "__ko_proto__" +ko.dependentObservable[protoProp] = ko.observable; + +ko.dependentObservable['fn'] = { + "equalityComparer": valuesArePrimitiveAndEqual +}; +ko.dependentObservable['fn'][protoProp] = ko.dependentObservable; + +// Note that for browsers that don't support proto assignment, the +// inheritance chain is created manually in the ko.dependentObservable constructor +if (ko.utils.canSetPrototype) { + ko.utils.setPrototypeOf(ko.dependentObservable['fn'], ko.subscribable['fn']); +} + +ko.exportSymbol('dependentObservable', ko.dependentObservable); +ko.exportSymbol('computed', ko.dependentObservable); // Make "ko.computed" an alias for "ko.dependentObservable" +ko.exportSymbol('isComputed', ko.isComputed); + +(function() { + var maxNestedObservableDepth = 10; // Escape the (unlikely) pathalogical case where an observable's current value is itself (or similar reference cycle) + + ko.toJS = function(rootObject) { + if (arguments.length == 0) + throw new Error("When calling ko.toJS, pass the object you want to convert."); + + // We just unwrap everything at every level in the object graph + return mapJsObjectGraph(rootObject, function(valueToMap) { + // Loop because an observable's value might in turn be another observable wrapper + for (var i = 0; ko.isObservable(valueToMap) && (i < maxNestedObservableDepth); i++) + valueToMap = valueToMap(); + return valueToMap; + }); + }; + + ko.toJSON = function(rootObject, replacer, space) { // replacer and space are optional + var plainJavaScriptObject = ko.toJS(rootObject); + return ko.utils.stringifyJson(plainJavaScriptObject, replacer, space); + }; + + function mapJsObjectGraph(rootObject, mapInputCallback, visitedObjects) { + visitedObjects = visitedObjects || new objectLookup(); + + rootObject = mapInputCallback(rootObject); + var canHaveProperties = (typeof rootObject == "object") && (rootObject !== null) && (rootObject !== undefined) && (!(rootObject instanceof Date)) && (!(rootObject instanceof String)) && (!(rootObject instanceof Number)) && (!(rootObject instanceof Boolean)); + if (!canHaveProperties) + return rootObject; + + var outputProperties = rootObject instanceof Array ? [] : {}; + visitedObjects.save(rootObject, outputProperties); + + visitPropertiesOrArrayEntries(rootObject, function(indexer) { + var propertyValue = mapInputCallback(rootObject[indexer]); + + switch (typeof propertyValue) { + case "boolean": + case "number": + case "string": + case "function": + outputProperties[indexer] = propertyValue; + break; + case "object": + case "undefined": + var previouslyMappedValue = visitedObjects.get(propertyValue); + outputProperties[indexer] = (previouslyMappedValue !== undefined) + ? previouslyMappedValue + : mapJsObjectGraph(propertyValue, mapInputCallback, visitedObjects); + break; + } + }); + + return outputProperties; + } + + function visitPropertiesOrArrayEntries(rootObject, visitorCallback) { + if (rootObject instanceof Array) { + for (var i = 0; i < rootObject.length; i++) + visitorCallback(i); + + // For arrays, also respect toJSON property for custom mappings (fixes #278) + if (typeof rootObject['toJSON'] == 'function') + visitorCallback('toJSON'); + } else { + for (var propertyName in rootObject) { + visitorCallback(propertyName); + } + } + }; + + function objectLookup() { + this.keys = []; + this.values = []; + }; + + objectLookup.prototype = { + constructor: objectLookup, + save: function(key, value) { + var existingIndex = ko.utils.arrayIndexOf(this.keys, key); + if (existingIndex >= 0) + this.values[existingIndex] = value; + else { + this.keys.push(key); + this.values.push(value); + } + }, + get: function(key) { + var existingIndex = ko.utils.arrayIndexOf(this.keys, key); + return (existingIndex >= 0) ? this.values[existingIndex] : undefined; + } + }; +})(); + +ko.exportSymbol('toJS', ko.toJS); +ko.exportSymbol('toJSON', ko.toJSON); +(function () { + var hasDomDataExpandoProperty = '__ko__hasDomDataOptionValue__'; + + // Normally, SELECT elements and their OPTIONs can only take value of type 'string' (because the values + // are stored on DOM attributes). ko.selectExtensions provides a way for SELECTs/OPTIONs to have values + // that are arbitrary objects. This is very convenient when implementing things like cascading dropdowns. + ko.selectExtensions = { + readValue : function(element) { + switch (ko.utils.tagNameLower(element)) { + case 'option': + if (element[hasDomDataExpandoProperty] === true) + return ko.utils.domData.get(element, ko.bindingHandlers.options.optionValueDomDataKey); + return ko.utils.ieVersion <= 7 + ? (element.getAttributeNode('value') && element.getAttributeNode('value').specified ? element.value : element.text) + : element.value; + case 'select': + return element.selectedIndex >= 0 ? ko.selectExtensions.readValue(element.options[element.selectedIndex]) : undefined; + default: + return element.value; + } + }, + + writeValue: function(element, value, allowUnset) { + switch (ko.utils.tagNameLower(element)) { + case 'option': + switch(typeof value) { + case "string": + ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, undefined); + if (hasDomDataExpandoProperty in element) { // IE <= 8 throws errors if you delete non-existent properties from a DOM node + delete element[hasDomDataExpandoProperty]; + } + element.value = value; + break; + default: + // Store arbitrary object using DomData + ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, value); + element[hasDomDataExpandoProperty] = true; + + // Special treatment of numbers is just for backward compatibility. KO 1.2.1 wrote numerical values to element.value. + element.value = typeof value === "number" ? value : ""; + break; + } + break; + case 'select': + if (value === "" || value === null) // A blank string or null value will select the caption + value = undefined; + var selection = -1; + for (var i = 0, n = element.options.length, optionValue; i < n; ++i) { + optionValue = ko.selectExtensions.readValue(element.options[i]); + // Include special check to handle selecting a caption with a blank string value + if (optionValue == value || (optionValue == "" && value === undefined)) { + selection = i; + break; + } + } + if (allowUnset || selection >= 0 || (value === undefined && element.size > 1)) { + element.selectedIndex = selection; + } + break; + default: + if ((value === null) || (value === undefined)) + value = ""; + element.value = value; + break; + } + } + }; +})(); + +ko.exportSymbol('selectExtensions', ko.selectExtensions); +ko.exportSymbol('selectExtensions.readValue', ko.selectExtensions.readValue); +ko.exportSymbol('selectExtensions.writeValue', ko.selectExtensions.writeValue); +ko.expressionRewriting = (function () { + var javaScriptReservedWords = ["true", "false", "null", "undefined"]; + + // Matches something that can be assigned to--either an isolated identifier or something ending with a property accessor + // This is designed to be simple and avoid false negatives, but could produce false positives (e.g., a+b.c). + // This also will not properly handle nested brackets (e.g., obj1[obj2['prop']]; see #911). + var javaScriptAssignmentTarget = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i; + + function getWriteableValue(expression) { + if (ko.utils.arrayIndexOf(javaScriptReservedWords, expression) >= 0) + return false; + var match = expression.match(javaScriptAssignmentTarget); + return match === null ? false : match[1] ? ('Object(' + match[1] + ')' + match[2]) : expression; + } + + // The following regular expressions will be used to split an object-literal string into tokens + + // These two match strings, either with double quotes or single quotes + var stringDouble = '"(?:[^"\\\\]|\\\\.)*"', + stringSingle = "'(?:[^'\\\\]|\\\\.)*'", + // Matches a regular expression (text enclosed by slashes), but will also match sets of divisions + // as a regular expression (this is handled by the parsing loop below). + stringRegexp = '/(?:[^/\\\\]|\\\\.)*/\w*', + // These characters have special meaning to the parser and must not appear in the middle of a + // token, except as part of a string. + specials = ',"\'{}()/:[\\]', + // Match text (at least two characters) that does not contain any of the above special characters, + // although some of the special characters are allowed to start it (all but the colon and comma). + // The text can contain spaces, but leading or trailing spaces are skipped. + everyThingElse = '[^\\s:,/][^' + specials + ']*[^\\s' + specials + ']', + // Match any non-space character not matched already. This will match colons and commas, since they're + // not matched by "everyThingElse", but will also match any other single character that wasn't already + // matched (for example: in "a: 1, b: 2", each of the non-space characters will be matched by oneNotSpace). + oneNotSpace = '[^\\s]', + + // Create the actual regular expression by or-ing the above strings. The order is important. + bindingToken = RegExp(stringDouble + '|' + stringSingle + '|' + stringRegexp + '|' + everyThingElse + '|' + oneNotSpace, 'g'), + + // Match end of previous token to determine whether a slash is a division or regex. + divisionLookBehind = /[\])"'A-Za-z0-9_$]+$/, + keywordRegexLookBehind = {'in':1,'return':1,'typeof':1}; + + function parseObjectLiteral(objectLiteralString) { + // Trim leading and trailing spaces from the string + var str = ko.utils.stringTrim(objectLiteralString); + + // Trim braces '{' surrounding the whole object literal + if (str.charCodeAt(0) === 123) str = str.slice(1, -1); + + // Split into tokens + var result = [], toks = str.match(bindingToken), key, values, depth = 0; + + if (toks) { + // Append a comma so that we don't need a separate code block to deal with the last item + toks.push(','); + + for (var i = 0, tok; tok = toks[i]; ++i) { + var c = tok.charCodeAt(0); + // A comma signals the end of a key/value pair if depth is zero + if (c === 44) { // "," + if (depth <= 0) { + if (key) + result.push(values ? {key: key, value: values.join('')} : {'unknown': key}); + key = values = depth = 0; + continue; + } + // Simply skip the colon that separates the name and value + } else if (c === 58) { // ":" + if (!values) + continue; + // A set of slashes is initially matched as a regular expression, but could be division + } else if (c === 47 && i && tok.length > 1) { // "/" + // Look at the end of the previous token to determine if the slash is actually division + var match = toks[i-1].match(divisionLookBehind); + if (match && !keywordRegexLookBehind[match[0]]) { + // The slash is actually a division punctuator; re-parse the remainder of the string (not including the slash) + str = str.substr(str.indexOf(tok) + 1); + toks = str.match(bindingToken); + toks.push(','); + i = -1; + // Continue with just the slash + tok = '/'; + } + // Increment depth for parentheses, braces, and brackets so that interior commas are ignored + } else if (c === 40 || c === 123 || c === 91) { // '(', '{', '[' + ++depth; + } else if (c === 41 || c === 125 || c === 93) { // ')', '}', ']' + --depth; + // The key must be a single token; if it's a string, trim the quotes + } else if (!key && !values) { + key = (c === 34 || c === 39) /* '"', "'" */ ? tok.slice(1, -1) : tok; + continue; + } + if (values) + values.push(tok); + else + values = [tok]; + } + } + return result; + } + + // Two-way bindings include a write function that allow the handler to update the value even if it's not an observable. + var twoWayBindings = {}; + + function preProcessBindings(bindingsStringOrKeyValueArray, bindingOptions) { + bindingOptions = bindingOptions || {}; + + function processKeyValue(key, val) { + var writableVal; + function callPreprocessHook(obj) { + return (obj && obj['preprocess']) ? (val = obj['preprocess'](val, key, processKeyValue)) : true; + } + if (!callPreprocessHook(ko['getBindingHandler'](key))) + return; + + if (twoWayBindings[key] && (writableVal = getWriteableValue(val))) { + // For two-way bindings, provide a write method in case the value + // isn't a writable observable. + propertyAccessorResultStrings.push("'" + key + "':function(_z){" + writableVal + "=_z}"); + } + + // Values are wrapped in a function so that each value can be accessed independently + if (makeValueAccessors) { + val = 'function(){return ' + val + ' }'; + } + resultStrings.push("'" + key + "':" + val); + } + + var resultStrings = [], + propertyAccessorResultStrings = [], + makeValueAccessors = bindingOptions['valueAccessors'], + keyValueArray = typeof bindingsStringOrKeyValueArray === "string" ? + parseObjectLiteral(bindingsStringOrKeyValueArray) : bindingsStringOrKeyValueArray; + + ko.utils.arrayForEach(keyValueArray, function(keyValue) { + processKeyValue(keyValue.key || keyValue['unknown'], keyValue.value); + }); + + if (propertyAccessorResultStrings.length) + processKeyValue('_ko_property_writers', "{" + propertyAccessorResultStrings.join(",") + " }"); + + return resultStrings.join(","); + } + + return { + bindingRewriteValidators: [], + + twoWayBindings: twoWayBindings, + + parseObjectLiteral: parseObjectLiteral, + + preProcessBindings: preProcessBindings, + + keyValueArrayContainsKey: function(keyValueArray, key) { + for (var i = 0; i < keyValueArray.length; i++) + if (keyValueArray[i]['key'] == key) + return true; + return false; + }, + + // Internal, private KO utility for updating model properties from within bindings + // property: If the property being updated is (or might be) an observable, pass it here + // If it turns out to be a writable observable, it will be written to directly + // allBindings: An object with a get method to retrieve bindings in the current execution context. + // This will be searched for a '_ko_property_writers' property in case you're writing to a non-observable + // key: The key identifying the property to be written. Example: for { hasFocus: myValue }, write to 'myValue' by specifying the key 'hasFocus' + // value: The value to be written + // checkIfDifferent: If true, and if the property being written is a writable observable, the value will only be written if + // it is !== existing value on that writable observable + writeValueToProperty: function(property, allBindings, key, value, checkIfDifferent) { + if (!property || !ko.isObservable(property)) { + var propWriters = allBindings.get('_ko_property_writers'); + if (propWriters && propWriters[key]) + propWriters[key](value); + } else if (ko.isWriteableObservable(property) && (!checkIfDifferent || property.peek() !== value)) { + property(value); + } + } + }; +})(); + +ko.exportSymbol('expressionRewriting', ko.expressionRewriting); +ko.exportSymbol('expressionRewriting.bindingRewriteValidators', ko.expressionRewriting.bindingRewriteValidators); +ko.exportSymbol('expressionRewriting.parseObjectLiteral', ko.expressionRewriting.parseObjectLiteral); +ko.exportSymbol('expressionRewriting.preProcessBindings', ko.expressionRewriting.preProcessBindings); + +// Making bindings explicitly declare themselves as "two way" isn't ideal in the long term (it would be better if +// all bindings could use an official 'property writer' API without needing to declare that they might). However, +// since this is not, and has never been, a public API (_ko_property_writers was never documented), it's acceptable +// as an internal implementation detail in the short term. +// For those developers who rely on _ko_property_writers in their custom bindings, we expose _twoWayBindings as an +// undocumented feature that makes it relatively easy to upgrade to KO 3.0. However, this is still not an official +// public API, and we reserve the right to remove it at any time if we create a real public property writers API. +ko.exportSymbol('expressionRewriting._twoWayBindings', ko.expressionRewriting.twoWayBindings); + +// For backward compatibility, define the following aliases. (Previously, these function names were misleading because +// they referred to JSON specifically, even though they actually work with arbitrary JavaScript object literal expressions.) +ko.exportSymbol('jsonExpressionRewriting', ko.expressionRewriting); +ko.exportSymbol('jsonExpressionRewriting.insertPropertyAccessorsIntoJson', ko.expressionRewriting.preProcessBindings); +(function() { + // "Virtual elements" is an abstraction on top of the usual DOM API which understands the notion that comment nodes + // may be used to represent hierarchy (in addition to the DOM's natural hierarchy). + // If you call the DOM-manipulating functions on ko.virtualElements, you will be able to read and write the state + // of that virtual hierarchy + // + // The point of all this is to support containerless templates (e.g., blah) + // without having to scatter special cases all over the binding and templating code. + + // IE 9 cannot reliably read the "nodeValue" property of a comment node (see https://github.com/SteveSanderson/knockout/issues/186) + // but it does give them a nonstandard alternative property called "text" that it can read reliably. Other browsers don't have that property. + // So, use node.text where available, and node.nodeValue elsewhere + var commentNodesHaveTextProperty = document && document.createComment("test").text === ""; + + var startCommentRegex = commentNodesHaveTextProperty ? /^$/ : /^\s*ko(?:\s+([\s\S]+))?\s*$/; + var endCommentRegex = commentNodesHaveTextProperty ? /^$/ : /^\s*\/ko\s*$/; + var htmlTagsWithOptionallyClosingChildren = { 'ul': true, 'ol': true }; + + function isStartComment(node) { + return (node.nodeType == 8) && startCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue); + } + + function isEndComment(node) { + return (node.nodeType == 8) && endCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue); + } + + function getVirtualChildren(startComment, allowUnbalanced) { + var currentNode = startComment; + var depth = 1; + var children = []; + while (currentNode = currentNode.nextSibling) { + if (isEndComment(currentNode)) { + depth--; + if (depth === 0) + return children; + } + + children.push(currentNode); + + if (isStartComment(currentNode)) + depth++; + } + if (!allowUnbalanced) + throw new Error("Cannot find closing comment tag to match: " + startComment.nodeValue); + return null; + } + + function getMatchingEndComment(startComment, allowUnbalanced) { + var allVirtualChildren = getVirtualChildren(startComment, allowUnbalanced); + if (allVirtualChildren) { + if (allVirtualChildren.length > 0) + return allVirtualChildren[allVirtualChildren.length - 1].nextSibling; + return startComment.nextSibling; + } else + return null; // Must have no matching end comment, and allowUnbalanced is true + } + + function getUnbalancedChildTags(node) { + // e.g., from
OK
Another, returns: Another + // from
OK
, returns: + var childNode = node.firstChild, captureRemaining = null; + if (childNode) { + do { + if (captureRemaining) // We already hit an unbalanced node and are now just scooping up all subsequent nodes + captureRemaining.push(childNode); + else if (isStartComment(childNode)) { + var matchingEndComment = getMatchingEndComment(childNode, /* allowUnbalanced: */ true); + if (matchingEndComment) // It's a balanced tag, so skip immediately to the end of this virtual set + childNode = matchingEndComment; + else + captureRemaining = [childNode]; // It's unbalanced, so start capturing from this point + } else if (isEndComment(childNode)) { + captureRemaining = [childNode]; // It's unbalanced (if it wasn't, we'd have skipped over it already), so start capturing + } + } while (childNode = childNode.nextSibling); + } + return captureRemaining; + } + + ko.virtualElements = { + allowedBindings: {}, + + childNodes: function(node) { + return isStartComment(node) ? getVirtualChildren(node) : node.childNodes; + }, + + emptyNode: function(node) { + if (!isStartComment(node)) + ko.utils.emptyDomNode(node); + else { + var virtualChildren = ko.virtualElements.childNodes(node); + for (var i = 0, j = virtualChildren.length; i < j; i++) + ko.removeNode(virtualChildren[i]); + } + }, + + setDomNodeChildren: function(node, childNodes) { + if (!isStartComment(node)) + ko.utils.setDomNodeChildren(node, childNodes); + else { + ko.virtualElements.emptyNode(node); + var endCommentNode = node.nextSibling; // Must be the next sibling, as we just emptied the children + for (var i = 0, j = childNodes.length; i < j; i++) + endCommentNode.parentNode.insertBefore(childNodes[i], endCommentNode); + } + }, + + prepend: function(containerNode, nodeToPrepend) { + if (!isStartComment(containerNode)) { + if (containerNode.firstChild) + containerNode.insertBefore(nodeToPrepend, containerNode.firstChild); + else + containerNode.appendChild(nodeToPrepend); + } else { + // Start comments must always have a parent and at least one following sibling (the end comment) + containerNode.parentNode.insertBefore(nodeToPrepend, containerNode.nextSibling); + } + }, + + insertAfter: function(containerNode, nodeToInsert, insertAfterNode) { + if (!insertAfterNode) { + ko.virtualElements.prepend(containerNode, nodeToInsert); + } else if (!isStartComment(containerNode)) { + // Insert after insertion point + if (insertAfterNode.nextSibling) + containerNode.insertBefore(nodeToInsert, insertAfterNode.nextSibling); + else + containerNode.appendChild(nodeToInsert); + } else { + // Children of start comments must always have a parent and at least one following sibling (the end comment) + containerNode.parentNode.insertBefore(nodeToInsert, insertAfterNode.nextSibling); + } + }, + + firstChild: function(node) { + if (!isStartComment(node)) + return node.firstChild; + if (!node.nextSibling || isEndComment(node.nextSibling)) + return null; + return node.nextSibling; + }, + + nextSibling: function(node) { + if (isStartComment(node)) + node = getMatchingEndComment(node); + if (node.nextSibling && isEndComment(node.nextSibling)) + return null; + return node.nextSibling; + }, + + hasBindingValue: isStartComment, + + virtualNodeBindingValue: function(node) { + var regexMatch = (commentNodesHaveTextProperty ? node.text : node.nodeValue).match(startCommentRegex); + return regexMatch ? regexMatch[1] : null; + }, + + normaliseVirtualElementDomStructure: function(elementVerified) { + // Workaround for https://github.com/SteveSanderson/knockout/issues/155 + // (IE <= 8 or IE 9 quirks mode parses your HTML weirdly, treating closing tags as if they don't exist, thereby moving comment nodes + // that are direct descendants of
    into the preceding
  • ) + if (!htmlTagsWithOptionallyClosingChildren[ko.utils.tagNameLower(elementVerified)]) + return; + + // Scan immediate children to see if they contain unbalanced comment tags. If they do, those comment tags + // must be intended to appear *after* that child, so move them there. + var childNode = elementVerified.firstChild; + if (childNode) { + do { + if (childNode.nodeType === 1) { + var unbalancedTags = getUnbalancedChildTags(childNode); + if (unbalancedTags) { + // Fix up the DOM by moving the unbalanced tags to where they most likely were intended to be placed - *after* the child + var nodeToInsertBefore = childNode.nextSibling; + for (var i = 0; i < unbalancedTags.length; i++) { + if (nodeToInsertBefore) + elementVerified.insertBefore(unbalancedTags[i], nodeToInsertBefore); + else + elementVerified.appendChild(unbalancedTags[i]); + } + } + } + } while (childNode = childNode.nextSibling); + } + } + }; +})(); +ko.exportSymbol('virtualElements', ko.virtualElements); +ko.exportSymbol('virtualElements.allowedBindings', ko.virtualElements.allowedBindings); +ko.exportSymbol('virtualElements.emptyNode', ko.virtualElements.emptyNode); +//ko.exportSymbol('virtualElements.firstChild', ko.virtualElements.firstChild); // firstChild is not minified +ko.exportSymbol('virtualElements.insertAfter', ko.virtualElements.insertAfter); +//ko.exportSymbol('virtualElements.nextSibling', ko.virtualElements.nextSibling); // nextSibling is not minified +ko.exportSymbol('virtualElements.prepend', ko.virtualElements.prepend); +ko.exportSymbol('virtualElements.setDomNodeChildren', ko.virtualElements.setDomNodeChildren); +(function() { + var defaultBindingAttributeName = "data-bind"; + + ko.bindingProvider = function() { + this.bindingCache = {}; + }; + + ko.utils.extend(ko.bindingProvider.prototype, { + 'nodeHasBindings': function(node) { + switch (node.nodeType) { + case 1: return node.getAttribute(defaultBindingAttributeName) != null; // Element + case 8: return ko.virtualElements.hasBindingValue(node); // Comment node + default: return false; + } + }, + + 'getBindings': function(node, bindingContext) { + var bindingsString = this['getBindingsString'](node, bindingContext); + return bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node) : null; + }, + + 'getBindingAccessors': function(node, bindingContext) { + var bindingsString = this['getBindingsString'](node, bindingContext); + return bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node, {'valueAccessors':true}) : null; + }, + + // The following function is only used internally by this default provider. + // It's not part of the interface definition for a general binding provider. + 'getBindingsString': function(node, bindingContext) { + switch (node.nodeType) { + case 1: return node.getAttribute(defaultBindingAttributeName); // Element + case 8: return ko.virtualElements.virtualNodeBindingValue(node); // Comment node + default: return null; + } + }, + + // The following function is only used internally by this default provider. + // It's not part of the interface definition for a general binding provider. + 'parseBindingsString': function(bindingsString, bindingContext, node, options) { + try { + var bindingFunction = createBindingsStringEvaluatorViaCache(bindingsString, this.bindingCache, options); + return bindingFunction(bindingContext, node); + } catch (ex) { + ex.message = "Unable to parse bindings.\nBindings value: " + bindingsString + "\nMessage: " + ex.message; + throw ex; + } + } + }); + + ko.bindingProvider['instance'] = new ko.bindingProvider(); + + function createBindingsStringEvaluatorViaCache(bindingsString, cache, options) { + var cacheKey = bindingsString + (options && options['valueAccessors'] || ''); + return cache[cacheKey] + || (cache[cacheKey] = createBindingsStringEvaluator(bindingsString, options)); + } + + function createBindingsStringEvaluator(bindingsString, options) { + // Build the source for a function that evaluates "expression" + // For each scope variable, add an extra level of "with" nesting + // Example result: with(sc1) { with(sc0) { return (expression) } } + var rewrittenBindings = ko.expressionRewriting.preProcessBindings(bindingsString, options), + functionBody = "with($context){with($data||{}){return{" + rewrittenBindings + "}}}"; + return new Function("$context", "$element", functionBody); + } +})(); + +ko.exportSymbol('bindingProvider', ko.bindingProvider); +(function () { + ko.bindingHandlers = {}; + + // The following element types will not be recursed into during binding. In the future, we + // may consider adding