1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/js/bootstrap.js Fri Jul 04 16:42:41 2014 +0400
1.3 @@ -0,0 +1,2348 @@
1.4 +/* ===================================================
1.5 + * bootstrap-transition.js v2.3.1
1.6 + * http://twitter.github.com/bootstrap/javascript.html#transitions
1.7 + * ===================================================
1.8 + * Copyright 2012 Twitter, Inc.
1.9 + *
1.10 + * Licensed under the Apache License, Version 2.0 (the "License");
1.11 + * you may not use this file except in compliance with the License.
1.12 + * You may obtain a copy of the License at
1.13 + *
1.14 + * http://www.apache.org/licenses/LICENSE-2.0
1.15 + *
1.16 + * Unless required by applicable law or agreed to in writing, software
1.17 + * distributed under the License is distributed on an "AS IS" BASIS,
1.18 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.19 + * See the License for the specific language governing permissions and
1.20 + * limitations under the License.
1.21 + * ========================================================== */
1.22 +
1.23 +
1.24 +!function ($) {
1.25 +
1.26 + "use strict"; // jshint ;_;
1.27 +
1.28 +
1.29 + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
1.30 + * ======================================================= */
1.31 +
1.32 + $(function () {
1.33 +
1.34 + $.support.transition = (function () {
1.35 +
1.36 + var transitionEnd = (function () {
1.37 +
1.38 + var el = document.createElement('bootstrap')
1.39 + , transEndEventNames = {
1.40 + 'WebkitTransition' : 'webkitTransitionEnd'
1.41 + , 'MozTransition' : 'transitionend'
1.42 + , 'OTransition' : 'oTransitionEnd otransitionend'
1.43 + , 'transition' : 'transitionend'
1.44 + }
1.45 + , name
1.46 +
1.47 + for (name in transEndEventNames){
1.48 + if (el.style[name] !== undefined) {
1.49 + return transEndEventNames[name]
1.50 + }
1.51 + }
1.52 +
1.53 + }())
1.54 +
1.55 + return transitionEnd && {
1.56 + end: transitionEnd
1.57 + }
1.58 +
1.59 + })()
1.60 +
1.61 + })
1.62 +
1.63 +}(window.jQuery);/* ==========================================================
1.64 + * bootstrap-alert.js v2.3.1
1.65 + * http://twitter.github.com/bootstrap/javascript.html#alerts
1.66 + * ==========================================================
1.67 + * Copyright 2012 Twitter, Inc.
1.68 + *
1.69 + * Licensed under the Apache License, Version 2.0 (the "License");
1.70 + * you may not use this file except in compliance with the License.
1.71 + * You may obtain a copy of the License at
1.72 + *
1.73 + * http://www.apache.org/licenses/LICENSE-2.0
1.74 + *
1.75 + * Unless required by applicable law or agreed to in writing, software
1.76 + * distributed under the License is distributed on an "AS IS" BASIS,
1.77 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.78 + * See the License for the specific language governing permissions and
1.79 + * limitations under the License.
1.80 + * ========================================================== */
1.81 +
1.82 +
1.83 +!function ($) {
1.84 +
1.85 + "use strict"; // jshint ;_;
1.86 +
1.87 +
1.88 + /* ALERT CLASS DEFINITION
1.89 + * ====================== */
1.90 +
1.91 + var dismiss = '[data-dismiss="alert"]'
1.92 + , Alert = function (el) {
1.93 + $(el).on('click', dismiss, this.close)
1.94 + }
1.95 +
1.96 + Alert.prototype.close = function (e) {
1.97 + var $this = $(this)
1.98 + , selector = $this.attr('data-target')
1.99 + , $parent
1.100 +
1.101 + if (!selector) {
1.102 + selector = $this.attr('href')
1.103 + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1.104 + }
1.105 +
1.106 + $parent = $(selector)
1.107 +
1.108 + e && e.preventDefault()
1.109 +
1.110 + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
1.111 +
1.112 + $parent.trigger(e = $.Event('close'))
1.113 +
1.114 + if (e.isDefaultPrevented()) return
1.115 +
1.116 + $parent.removeClass('in')
1.117 +
1.118 + function removeElement() {
1.119 + $parent
1.120 + .trigger('closed')
1.121 + .remove()
1.122 + }
1.123 +
1.124 + $.support.transition && $parent.hasClass('fade') ?
1.125 + $parent.on($.support.transition.end, removeElement) :
1.126 + removeElement()
1.127 + }
1.128 +
1.129 +
1.130 + /* ALERT PLUGIN DEFINITION
1.131 + * ======================= */
1.132 +
1.133 + var old = $.fn.alert
1.134 +
1.135 + $.fn.alert = function (option) {
1.136 + return this.each(function () {
1.137 + var $this = $(this)
1.138 + , data = $this.data('alert')
1.139 + if (!data) $this.data('alert', (data = new Alert(this)))
1.140 + if (typeof option == 'string') data[option].call($this)
1.141 + })
1.142 + }
1.143 +
1.144 + $.fn.alert.Constructor = Alert
1.145 +
1.146 +
1.147 + /* ALERT NO CONFLICT
1.148 + * ================= */
1.149 +
1.150 + $.fn.alert.noConflict = function () {
1.151 + $.fn.alert = old
1.152 + return this
1.153 + }
1.154 +
1.155 +
1.156 + /* ALERT DATA-API
1.157 + * ============== */
1.158 +
1.159 + $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
1.160 +
1.161 +}(window.jQuery);/* ============================================================
1.162 + * bootstrap-button.js v2.3.1
1.163 + * http://twitter.github.com/bootstrap/javascript.html#buttons
1.164 + * ============================================================
1.165 + * Copyright 2012 Twitter, Inc.
1.166 + *
1.167 + * Licensed under the Apache License, Version 2.0 (the "License");
1.168 + * you may not use this file except in compliance with the License.
1.169 + * You may obtain a copy of the License at
1.170 + *
1.171 + * http://www.apache.org/licenses/LICENSE-2.0
1.172 + *
1.173 + * Unless required by applicable law or agreed to in writing, software
1.174 + * distributed under the License is distributed on an "AS IS" BASIS,
1.175 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.176 + * See the License for the specific language governing permissions and
1.177 + * limitations under the License.
1.178 + * ============================================================ */
1.179 +
1.180 +
1.181 +!function ($) {
1.182 +
1.183 + "use strict"; // jshint ;_;
1.184 +
1.185 +
1.186 + /* BUTTON PUBLIC CLASS DEFINITION
1.187 + * ============================== */
1.188 +
1.189 + var Button = function (element, options) {
1.190 + this.$element = $(element)
1.191 + this.options = $.extend({}, $.fn.button.defaults, options)
1.192 + }
1.193 +
1.194 + Button.prototype.setState = function (state) {
1.195 + var d = 'disabled'
1.196 + , $el = this.$element
1.197 + , data = $el.data()
1.198 + , val = $el.is('input') ? 'val' : 'html'
1.199 +
1.200 + state = state + 'Text'
1.201 + data.resetText || $el.data('resetText', $el[val]())
1.202 +
1.203 + $el[val](data[state] || this.options[state])
1.204 +
1.205 + // push to event loop to allow forms to submit
1.206 + setTimeout(function () {
1.207 + state == 'loadingText' ?
1.208 + $el.addClass(d).attr(d, d) :
1.209 + $el.removeClass(d).removeAttr(d)
1.210 + }, 0)
1.211 + }
1.212 +
1.213 + Button.prototype.toggle = function () {
1.214 + var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
1.215 +
1.216 + $parent && $parent
1.217 + .find('.active')
1.218 + .removeClass('active')
1.219 +
1.220 + this.$element.toggleClass('active')
1.221 + }
1.222 +
1.223 +
1.224 + /* BUTTON PLUGIN DEFINITION
1.225 + * ======================== */
1.226 +
1.227 + var old = $.fn.button
1.228 +
1.229 + $.fn.button = function (option) {
1.230 + return this.each(function () {
1.231 + var $this = $(this)
1.232 + , data = $this.data('button')
1.233 + , options = typeof option == 'object' && option
1.234 + if (!data) $this.data('button', (data = new Button(this, options)))
1.235 + if (option == 'toggle') data.toggle()
1.236 + else if (option) data.setState(option)
1.237 + })
1.238 + }
1.239 +
1.240 + $.fn.button.defaults = {
1.241 + loadingText: 'loading...'
1.242 + }
1.243 +
1.244 + $.fn.button.Constructor = Button
1.245 +
1.246 +
1.247 + /* BUTTON NO CONFLICT
1.248 + * ================== */
1.249 +
1.250 + $.fn.button.noConflict = function () {
1.251 + $.fn.button = old
1.252 + return this
1.253 + }
1.254 +
1.255 +
1.256 + /* BUTTON DATA-API
1.257 + * =============== */
1.258 +
1.259 + $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
1.260 + var $btn = $(e.target)
1.261 + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
1.262 + $btn.button('toggle')
1.263 + })
1.264 +
1.265 +}(window.jQuery);/* ==========================================================
1.266 + * bootstrap-carousel.js v2.3.1
1.267 + * http://twitter.github.com/bootstrap/javascript.html#carousel
1.268 + * ==========================================================
1.269 + * Copyright 2012 Twitter, Inc.
1.270 + *
1.271 + * Licensed under the Apache License, Version 2.0 (the "License");
1.272 + * you may not use this file except in compliance with the License.
1.273 + * You may obtain a copy of the License at
1.274 + *
1.275 + * http://www.apache.org/licenses/LICENSE-2.0
1.276 + *
1.277 + * Unless required by applicable law or agreed to in writing, software
1.278 + * distributed under the License is distributed on an "AS IS" BASIS,
1.279 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.280 + * See the License for the specific language governing permissions and
1.281 + * limitations under the License.
1.282 + * ========================================================== */
1.283 +
1.284 +
1.285 +!function ($) {
1.286 +
1.287 + "use strict"; // jshint ;_;
1.288 +
1.289 +
1.290 + /* CAROUSEL CLASS DEFINITION
1.291 + * ========================= */
1.292 +
1.293 + var Carousel = function (element, options) {
1.294 + this.$element = $(element)
1.295 + this.$indicators = this.$element.find('.carousel-indicators')
1.296 + this.options = options
1.297 + this.options.pause == 'hover' && this.$element
1.298 + .on('mouseenter', $.proxy(this.pause, this))
1.299 + .on('mouseleave', $.proxy(this.cycle, this))
1.300 + }
1.301 +
1.302 + Carousel.prototype = {
1.303 +
1.304 + cycle: function (e) {
1.305 + if (!e) this.paused = false
1.306 + if (this.interval) clearInterval(this.interval);
1.307 + this.options.interval
1.308 + && !this.paused
1.309 + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
1.310 + return this
1.311 + }
1.312 +
1.313 + , getActiveIndex: function () {
1.314 + this.$active = this.$element.find('.item.active')
1.315 + this.$items = this.$active.parent().children()
1.316 + return this.$items.index(this.$active)
1.317 + }
1.318 +
1.319 + , to: function (pos) {
1.320 + var activeIndex = this.getActiveIndex()
1.321 + , that = this
1.322 +
1.323 + if (pos > (this.$items.length - 1) || pos < 0) return
1.324 +
1.325 + if (this.sliding) {
1.326 + return this.$element.one('slid', function () {
1.327 + that.to(pos)
1.328 + })
1.329 + }
1.330 +
1.331 + if (activeIndex == pos) {
1.332 + return this.pause().cycle()
1.333 + }
1.334 +
1.335 + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
1.336 + }
1.337 +
1.338 + , pause: function (e) {
1.339 + if (!e) this.paused = true
1.340 + if (this.$element.find('.next, .prev').length && $.support.transition.end) {
1.341 + this.$element.trigger($.support.transition.end)
1.342 + this.cycle(true)
1.343 + }
1.344 + clearInterval(this.interval)
1.345 + this.interval = null
1.346 + return this
1.347 + }
1.348 +
1.349 + , next: function () {
1.350 + if (this.sliding) return
1.351 + return this.slide('next')
1.352 + }
1.353 +
1.354 + , prev: function () {
1.355 + if (this.sliding) return
1.356 + return this.slide('prev')
1.357 + }
1.358 +
1.359 + , slide: function (type, next) {
1.360 + var $active = this.$element.find('.item.active')
1.361 + , $next = next || $active[type]()
1.362 + , isCycling = this.interval
1.363 + , direction = type == 'next' ? 'left' : 'right'
1.364 + , fallback = type == 'next' ? 'first' : 'last'
1.365 + , that = this
1.366 + , e
1.367 +
1.368 + this.sliding = true
1.369 +
1.370 + isCycling && this.pause()
1.371 +
1.372 + $next = $next.length ? $next : this.$element.find('.item')[fallback]()
1.373 +
1.374 + e = $.Event('slide', {
1.375 + relatedTarget: $next[0]
1.376 + , direction: direction
1.377 + })
1.378 +
1.379 + if ($next.hasClass('active')) return
1.380 +
1.381 + if (this.$indicators.length) {
1.382 + this.$indicators.find('.active').removeClass('active')
1.383 + this.$element.one('slid', function () {
1.384 + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
1.385 + $nextIndicator && $nextIndicator.addClass('active')
1.386 + })
1.387 + }
1.388 +
1.389 + if ($.support.transition && this.$element.hasClass('slide')) {
1.390 + this.$element.trigger(e)
1.391 + if (e.isDefaultPrevented()) return
1.392 + $next.addClass(type)
1.393 + $next[0].offsetWidth // force reflow
1.394 + $active.addClass(direction)
1.395 + $next.addClass(direction)
1.396 + this.$element.one($.support.transition.end, function () {
1.397 + $next.removeClass([type, direction].join(' ')).addClass('active')
1.398 + $active.removeClass(['active', direction].join(' '))
1.399 + that.sliding = false
1.400 + setTimeout(function () { that.$element.trigger('slid') }, 0)
1.401 + })
1.402 + } else {
1.403 + this.$element.trigger(e)
1.404 + if (e.isDefaultPrevented()) return
1.405 + $active.removeClass('active')
1.406 + $next.addClass('active')
1.407 + this.sliding = false
1.408 + this.$element.trigger('slid')
1.409 + }
1.410 +
1.411 + isCycling && this.cycle()
1.412 +
1.413 + return this
1.414 + }
1.415 +
1.416 + }
1.417 +
1.418 +
1.419 + /* CAROUSEL PLUGIN DEFINITION
1.420 + * ========================== */
1.421 +
1.422 + var old = $.fn.carousel
1.423 +
1.424 + $.fn.carousel = function (option) {
1.425 + return this.each(function () {
1.426 + var $this = $(this)
1.427 + , data = $this.data('carousel')
1.428 + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
1.429 + , action = typeof option == 'string' ? option : options.slide
1.430 + if (!data) $this.data('carousel', (data = new Carousel(this, options)))
1.431 + if (typeof option == 'number') data.to(option)
1.432 + else if (action) data[action]()
1.433 + else if (options.interval) data.pause().cycle()
1.434 + })
1.435 + }
1.436 +
1.437 + $.fn.carousel.defaults = {
1.438 + interval: 5000
1.439 + , pause: 'hover'
1.440 + }
1.441 +
1.442 + $.fn.carousel.Constructor = Carousel
1.443 +
1.444 +
1.445 + /* CAROUSEL NO CONFLICT
1.446 + * ==================== */
1.447 +
1.448 + $.fn.carousel.noConflict = function () {
1.449 + $.fn.carousel = old
1.450 + return this
1.451 + }
1.452 +
1.453 + /* CAROUSEL DATA-API
1.454 + * ================= */
1.455 +
1.456 + $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
1.457 + var $this = $(this), href
1.458 + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1.459 + , options = $.extend({}, $target.data(), $this.data())
1.460 + , slideIndex
1.461 +
1.462 + $target.carousel(options)
1.463 +
1.464 + if (slideIndex = $this.attr('data-slide-to')) {
1.465 + $target.data('carousel').pause().to(slideIndex).cycle()
1.466 + }
1.467 +
1.468 + e.preventDefault()
1.469 + })
1.470 +
1.471 +}(window.jQuery);/* =============================================================
1.472 + * bootstrap-collapse.js v2.3.1
1.473 + * http://twitter.github.com/bootstrap/javascript.html#collapse
1.474 + * =============================================================
1.475 + * Copyright 2012 Twitter, Inc.
1.476 + *
1.477 + * Licensed under the Apache License, Version 2.0 (the "License");
1.478 + * you may not use this file except in compliance with the License.
1.479 + * You may obtain a copy of the License at
1.480 + *
1.481 + * http://www.apache.org/licenses/LICENSE-2.0
1.482 + *
1.483 + * Unless required by applicable law or agreed to in writing, software
1.484 + * distributed under the License is distributed on an "AS IS" BASIS,
1.485 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.486 + * See the License for the specific language governing permissions and
1.487 + * limitations under the License.
1.488 + * ============================================================ */
1.489 +
1.490 +
1.491 +!function ($) {
1.492 +
1.493 + "use strict"; // jshint ;_;
1.494 +
1.495 +
1.496 + /* COLLAPSE PUBLIC CLASS DEFINITION
1.497 + * ================================ */
1.498 +
1.499 + var Collapse = function (element, options) {
1.500 + this.$element = $(element)
1.501 + this.options = $.extend({}, $.fn.collapse.defaults, options)
1.502 +
1.503 + if (this.options.parent) {
1.504 + this.$parent = $(this.options.parent)
1.505 + }
1.506 +
1.507 + this.options.toggle && this.toggle()
1.508 + }
1.509 +
1.510 + Collapse.prototype = {
1.511 +
1.512 + constructor: Collapse
1.513 +
1.514 + , dimension: function () {
1.515 + var hasWidth = this.$element.hasClass('width')
1.516 + return hasWidth ? 'width' : 'height'
1.517 + }
1.518 +
1.519 + , show: function () {
1.520 + var dimension
1.521 + , scroll
1.522 + , actives
1.523 + , hasData
1.524 +
1.525 + if (this.transitioning || this.$element.hasClass('in')) return
1.526 +
1.527 + dimension = this.dimension()
1.528 + scroll = $.camelCase(['scroll', dimension].join('-'))
1.529 + actives = this.$parent && this.$parent.find('> .accordion-group > .in')
1.530 +
1.531 + if (actives && actives.length) {
1.532 + hasData = actives.data('collapse')
1.533 + if (hasData && hasData.transitioning) return
1.534 + actives.collapse('hide')
1.535 + hasData || actives.data('collapse', null)
1.536 + }
1.537 +
1.538 + this.$element[dimension](0)
1.539 + this.transition('addClass', $.Event('show'), 'shown')
1.540 + $.support.transition && this.$element[dimension](this.$element[0][scroll])
1.541 + }
1.542 +
1.543 + , hide: function () {
1.544 + var dimension
1.545 + if (this.transitioning || !this.$element.hasClass('in')) return
1.546 + dimension = this.dimension()
1.547 + this.reset(this.$element[dimension]())
1.548 + this.transition('removeClass', $.Event('hide'), 'hidden')
1.549 + this.$element[dimension](0)
1.550 + }
1.551 +
1.552 + , reset: function (size) {
1.553 + var dimension = this.dimension()
1.554 +
1.555 + this.$element
1.556 + .removeClass('collapse')
1.557 + [dimension](size || 'auto')
1.558 + [0].offsetWidth
1.559 +
1.560 + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
1.561 +
1.562 + return this
1.563 + }
1.564 +
1.565 + , transition: function (method, startEvent, completeEvent) {
1.566 + var that = this
1.567 + , complete = function () {
1.568 + if (startEvent.type == 'show') that.reset()
1.569 + that.transitioning = 0
1.570 + that.$element.trigger(completeEvent)
1.571 + }
1.572 +
1.573 + this.$element.trigger(startEvent)
1.574 +
1.575 + if (startEvent.isDefaultPrevented()) return
1.576 +
1.577 + this.transitioning = 1
1.578 +
1.579 + this.$element[method]('in')
1.580 +
1.581 + $.support.transition && this.$element.hasClass('collapse') ?
1.582 + this.$element.one($.support.transition.end, complete) :
1.583 + complete()
1.584 + }
1.585 +
1.586 + , toggle: function () {
1.587 + this[this.$element.hasClass('in') ? 'hide' : 'show']()
1.588 + }
1.589 +
1.590 + }
1.591 +
1.592 +
1.593 + /* COLLAPSE PLUGIN DEFINITION
1.594 + * ========================== */
1.595 +
1.596 + var old = $.fn.collapse
1.597 +
1.598 + $.fn.collapse = function (option) {
1.599 + return this.each(function () {
1.600 + var $this = $(this)
1.601 + , data = $this.data('collapse')
1.602 + , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
1.603 + if (!data) $this.data('collapse', (data = new Collapse(this, options)))
1.604 + if (typeof option == 'string') data[option]()
1.605 + })
1.606 + }
1.607 +
1.608 + $.fn.collapse.defaults = {
1.609 + toggle: true
1.610 + }
1.611 +
1.612 + $.fn.collapse.Constructor = Collapse
1.613 +
1.614 +
1.615 + /* COLLAPSE NO CONFLICT
1.616 + * ==================== */
1.617 +
1.618 + $.fn.collapse.noConflict = function () {
1.619 + $.fn.collapse = old
1.620 + return this
1.621 + }
1.622 +
1.623 +
1.624 + /* COLLAPSE DATA-API
1.625 + * ================= */
1.626 +
1.627 + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
1.628 + var $this = $(this), href
1.629 + , target = $this.attr('data-target')
1.630 + || e.preventDefault()
1.631 + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
1.632 + , option = $(target).data('collapse') ? 'toggle' : $this.data()
1.633 + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
1.634 + $(target).collapse(option)
1.635 + })
1.636 +
1.637 +}(window.jQuery);/* ============================================================
1.638 + * bootstrap-dropdown.js v2.3.1
1.639 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns
1.640 + * ============================================================
1.641 + * Copyright 2012 Twitter, Inc.
1.642 + *
1.643 + * Licensed under the Apache License, Version 2.0 (the "License");
1.644 + * you may not use this file except in compliance with the License.
1.645 + * You may obtain a copy of the License at
1.646 + *
1.647 + * http://www.apache.org/licenses/LICENSE-2.0
1.648 + *
1.649 + * Unless required by applicable law or agreed to in writing, software
1.650 + * distributed under the License is distributed on an "AS IS" BASIS,
1.651 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.652 + * See the License for the specific language governing permissions and
1.653 + * limitations under the License.
1.654 + * ============================================================ */
1.655 +
1.656 +
1.657 +!function ($) {
1.658 +
1.659 + "use strict"; // jshint ;_;
1.660 +
1.661 +
1.662 + /* DROPDOWN CLASS DEFINITION
1.663 + * ========================= */
1.664 +
1.665 + var toggle = '[data-toggle=dropdown]'
1.666 + , Dropdown = function (element) {
1.667 + var $el = $(element).on('click.dropdown.data-api', this.toggle)
1.668 + $('html').on('click.dropdown.data-api', function () {
1.669 + $el.parent().removeClass('open')
1.670 + })
1.671 + }
1.672 +
1.673 + Dropdown.prototype = {
1.674 +
1.675 + constructor: Dropdown
1.676 +
1.677 + , toggle: function (e) {
1.678 + var $this = $(this)
1.679 + , $parent
1.680 + , isActive
1.681 +
1.682 + if ($this.is('.disabled, :disabled')) return
1.683 +
1.684 + $parent = getParent($this)
1.685 +
1.686 + isActive = $parent.hasClass('open')
1.687 +
1.688 + clearMenus()
1.689 +
1.690 + if (!isActive) {
1.691 + $parent.toggleClass('open')
1.692 + }
1.693 +
1.694 + $this.focus()
1.695 +
1.696 + return false
1.697 + }
1.698 +
1.699 + , keydown: function (e) {
1.700 + var $this
1.701 + , $items
1.702 + , $active
1.703 + , $parent
1.704 + , isActive
1.705 + , index
1.706 +
1.707 + if (!/(38|40|27)/.test(e.keyCode)) return
1.708 +
1.709 + $this = $(this)
1.710 +
1.711 + e.preventDefault()
1.712 + e.stopPropagation()
1.713 +
1.714 + if ($this.is('.disabled, :disabled')) return
1.715 +
1.716 + $parent = getParent($this)
1.717 +
1.718 + isActive = $parent.hasClass('open')
1.719 +
1.720 + if (!isActive || (isActive && e.keyCode == 27)) {
1.721 + if (e.which == 27) $parent.find(toggle).focus()
1.722 + return $this.click()
1.723 + }
1.724 +
1.725 + $items = $('[role=menu] li:not(.divider):visible a', $parent)
1.726 +
1.727 + if (!$items.length) return
1.728 +
1.729 + index = $items.index($items.filter(':focus'))
1.730 +
1.731 + if (e.keyCode == 38 && index > 0) index-- // up
1.732 + if (e.keyCode == 40 && index < $items.length - 1) index++ // down
1.733 + if (!~index) index = 0
1.734 +
1.735 + $items
1.736 + .eq(index)
1.737 + .focus()
1.738 + }
1.739 +
1.740 + }
1.741 +
1.742 + function clearMenus() {
1.743 + $(toggle).each(function () {
1.744 + getParent($(this)).removeClass('open')
1.745 + })
1.746 + }
1.747 +
1.748 + function getParent($this) {
1.749 + var selector = $this.attr('data-target')
1.750 + , $parent
1.751 +
1.752 + if (!selector) {
1.753 + selector = $this.attr('href')
1.754 + selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1.755 + }
1.756 +
1.757 + $parent = selector && $(selector)
1.758 +
1.759 + if (!$parent || !$parent.length) $parent = $this.parent()
1.760 +
1.761 + return $parent
1.762 + }
1.763 +
1.764 +
1.765 + /* DROPDOWN PLUGIN DEFINITION
1.766 + * ========================== */
1.767 +
1.768 + var old = $.fn.dropdown
1.769 +
1.770 + $.fn.dropdown = function (option) {
1.771 + return this.each(function () {
1.772 + var $this = $(this)
1.773 + , data = $this.data('dropdown')
1.774 + if (!data) $this.data('dropdown', (data = new Dropdown(this)))
1.775 + if (typeof option == 'string') data[option].call($this)
1.776 + })
1.777 + }
1.778 +
1.779 + $.fn.dropdown.Constructor = Dropdown
1.780 +
1.781 +
1.782 + /* DROPDOWN NO CONFLICT
1.783 + * ==================== */
1.784 +
1.785 + $.fn.dropdown.noConflict = function () {
1.786 + $.fn.dropdown = old
1.787 + return this
1.788 + }
1.789 +
1.790 +
1.791 + /* APPLY TO STANDARD DROPDOWN ELEMENTS
1.792 + * =================================== */
1.793 +
1.794 + $(document)
1.795 + .on('click.dropdown.data-api', clearMenus)
1.796 + .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
1.797 + .on('click.dropdown-menu', function (e) { e.stopPropagation() })
1.798 + .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
1.799 + .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
1.800 +
1.801 +}(window.jQuery);
1.802 +/* =========================================================
1.803 + * bootstrap-modal.js v2.3.1
1.804 + * http://twitter.github.com/bootstrap/javascript.html#modals
1.805 + * =========================================================
1.806 + * Copyright 2012 Twitter, Inc.
1.807 + *
1.808 + * Licensed under the Apache License, Version 2.0 (the "License");
1.809 + * you may not use this file except in compliance with the License.
1.810 + * You may obtain a copy of the License at
1.811 + *
1.812 + * http://www.apache.org/licenses/LICENSE-2.0
1.813 + *
1.814 + * Unless required by applicable law or agreed to in writing, software
1.815 + * distributed under the License is distributed on an "AS IS" BASIS,
1.816 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.817 + * See the License for the specific language governing permissions and
1.818 + * limitations under the License.
1.819 + * ========================================================= */
1.820 +
1.821 +
1.822 +!function ($) {
1.823 +
1.824 + "use strict"; // jshint ;_;
1.825 +
1.826 +
1.827 + /* MODAL CLASS DEFINITION
1.828 + * ====================== */
1.829 +
1.830 + var Modal = function (element, options) {
1.831 + this.options = options
1.832 + this.$element = $(element)
1.833 + .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
1.834 + this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
1.835 + }
1.836 +
1.837 + Modal.prototype = {
1.838 +
1.839 + constructor: Modal
1.840 +
1.841 + , toggle: function () {
1.842 + return this[!this.isShown ? 'show' : 'hide']()
1.843 + }
1.844 +
1.845 + , show: function () {
1.846 + var that = this
1.847 + , e = $.Event('show')
1.848 +
1.849 + this.$element.trigger(e)
1.850 +
1.851 + if (this.isShown || e.isDefaultPrevented()) return
1.852 +
1.853 + this.isShown = true
1.854 +
1.855 + this.escape()
1.856 +
1.857 + this.backdrop(function () {
1.858 + var transition = $.support.transition && that.$element.hasClass('fade')
1.859 +
1.860 + if (!that.$element.parent().length) {
1.861 + that.$element.appendTo(document.body) //don't move modals dom position
1.862 + }
1.863 +
1.864 + that.$element.show()
1.865 +
1.866 + if (transition) {
1.867 + that.$element[0].offsetWidth // force reflow
1.868 + }
1.869 +
1.870 + that.$element
1.871 + .addClass('in')
1.872 + .attr('aria-hidden', false)
1.873 +
1.874 + that.enforceFocus()
1.875 +
1.876 + transition ?
1.877 + that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
1.878 + that.$element.focus().trigger('shown')
1.879 +
1.880 + })
1.881 + }
1.882 +
1.883 + , hide: function (e) {
1.884 + e && e.preventDefault()
1.885 +
1.886 + var that = this
1.887 +
1.888 + e = $.Event('hide')
1.889 +
1.890 + this.$element.trigger(e)
1.891 +
1.892 + if (!this.isShown || e.isDefaultPrevented()) return
1.893 +
1.894 + this.isShown = false
1.895 +
1.896 + this.escape()
1.897 +
1.898 + $(document).off('focusin.modal')
1.899 +
1.900 + this.$element
1.901 + .removeClass('in')
1.902 + .attr('aria-hidden', true)
1.903 +
1.904 + $.support.transition && this.$element.hasClass('fade') ?
1.905 + this.hideWithTransition() :
1.906 + this.hideModal()
1.907 + }
1.908 +
1.909 + , enforceFocus: function () {
1.910 + var that = this
1.911 + $(document).on('focusin.modal', function (e) {
1.912 + if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
1.913 + that.$element.focus()
1.914 + }
1.915 + })
1.916 + }
1.917 +
1.918 + , escape: function () {
1.919 + var that = this
1.920 + if (this.isShown && this.options.keyboard) {
1.921 + this.$element.on('keyup.dismiss.modal', function ( e ) {
1.922 + e.which == 27 && that.hide()
1.923 + })
1.924 + } else if (!this.isShown) {
1.925 + this.$element.off('keyup.dismiss.modal')
1.926 + }
1.927 + }
1.928 +
1.929 + , hideWithTransition: function () {
1.930 + var that = this
1.931 + , timeout = setTimeout(function () {
1.932 + that.$element.off($.support.transition.end)
1.933 + that.hideModal()
1.934 + }, 500)
1.935 +
1.936 + this.$element.one($.support.transition.end, function () {
1.937 + clearTimeout(timeout)
1.938 + that.hideModal()
1.939 + })
1.940 + }
1.941 +
1.942 + , hideModal: function () {
1.943 + var that = this
1.944 + this.$element.hide()
1.945 + this.backdrop(function () {
1.946 + that.removeBackdrop()
1.947 + that.$element.trigger('hidden')
1.948 + })
1.949 + }
1.950 +
1.951 + , removeBackdrop: function () {
1.952 + this.$backdrop && this.$backdrop.remove()
1.953 + this.$backdrop = null
1.954 + }
1.955 +
1.956 + , backdrop: function (callback) {
1.957 + var that = this
1.958 + , animate = this.$element.hasClass('fade') ? 'fade' : ''
1.959 +
1.960 + if (this.isShown && this.options.backdrop) {
1.961 + var doAnimate = $.support.transition && animate
1.962 +
1.963 + this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
1.964 + .appendTo(document.body)
1.965 +
1.966 + this.$backdrop.click(
1.967 + this.options.backdrop == 'static' ?
1.968 + $.proxy(this.$element[0].focus, this.$element[0])
1.969 + : $.proxy(this.hide, this)
1.970 + )
1.971 +
1.972 + if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
1.973 +
1.974 + this.$backdrop.addClass('in')
1.975 +
1.976 + if (!callback) return
1.977 +
1.978 + doAnimate ?
1.979 + this.$backdrop.one($.support.transition.end, callback) :
1.980 + callback()
1.981 +
1.982 + } else if (!this.isShown && this.$backdrop) {
1.983 + this.$backdrop.removeClass('in')
1.984 +
1.985 + $.support.transition && this.$element.hasClass('fade')?
1.986 + this.$backdrop.one($.support.transition.end, callback) :
1.987 + callback()
1.988 +
1.989 + } else if (callback) {
1.990 + callback()
1.991 + }
1.992 + }
1.993 + }
1.994 +
1.995 +
1.996 + /* MODAL PLUGIN DEFINITION
1.997 + * ======================= */
1.998 +
1.999 + var old = $.fn.modal
1.1000 +
1.1001 + $.fn.modal = function (option) {
1.1002 + return this.each(function () {
1.1003 + var $this = $(this)
1.1004 + , data = $this.data('modal')
1.1005 + , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
1.1006 + if (!data) $this.data('modal', (data = new Modal(this, options)))
1.1007 + if (typeof option == 'string') data[option]()
1.1008 + else if (options.show) data.show()
1.1009 + })
1.1010 + }
1.1011 +
1.1012 + $.fn.modal.defaults = {
1.1013 + backdrop: true
1.1014 + , keyboard: true
1.1015 + , show: true
1.1016 + }
1.1017 +
1.1018 + $.fn.modal.Constructor = Modal
1.1019 +
1.1020 +
1.1021 + /* MODAL NO CONFLICT
1.1022 + * ================= */
1.1023 +
1.1024 + $.fn.modal.noConflict = function () {
1.1025 + $.fn.modal = old
1.1026 + return this
1.1027 + }
1.1028 +
1.1029 +
1.1030 + /* MODAL DATA-API
1.1031 + * ============== */
1.1032 +
1.1033 + $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
1.1034 + var $this = $(this)
1.1035 + , href = $this.attr('href')
1.1036 + , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
1.1037 + , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
1.1038 +
1.1039 + e.preventDefault()
1.1040 +
1.1041 + $target
1.1042 + .modal(option)
1.1043 + .one('hide', function () {
1.1044 + $this.focus()
1.1045 + })
1.1046 + })
1.1047 +
1.1048 +}(window.jQuery);
1.1049 +/* ===========================================================
1.1050 + * bootstrap-tooltip.js v2.3.1
1.1051 + * http://twitter.github.com/bootstrap/javascript.html#tooltips
1.1052 + * Inspired by the original jQuery.tipsy by Jason Frame
1.1053 + * ===========================================================
1.1054 + * Copyright 2012 Twitter, Inc.
1.1055 + *
1.1056 + * Licensed under the Apache License, Version 2.0 (the "License");
1.1057 + * you may not use this file except in compliance with the License.
1.1058 + * You may obtain a copy of the License at
1.1059 + *
1.1060 + * http://www.apache.org/licenses/LICENSE-2.0
1.1061 + *
1.1062 + * Unless required by applicable law or agreed to in writing, software
1.1063 + * distributed under the License is distributed on an "AS IS" BASIS,
1.1064 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.1065 + * See the License for the specific language governing permissions and
1.1066 + * limitations under the License.
1.1067 + * ========================================================== */
1.1068 +
1.1069 +
1.1070 +!function ($) {
1.1071 +
1.1072 + "use strict"; // jshint ;_;
1.1073 +
1.1074 +
1.1075 + /* TOOLTIP PUBLIC CLASS DEFINITION
1.1076 + * =============================== */
1.1077 +
1.1078 + var Tooltip = function (element, options) {
1.1079 + this.init('tooltip', element, options)
1.1080 + }
1.1081 +
1.1082 + Tooltip.prototype = {
1.1083 +
1.1084 + constructor: Tooltip
1.1085 +
1.1086 + , init: function (type, element, options) {
1.1087 + var eventIn
1.1088 + , eventOut
1.1089 + , triggers
1.1090 + , trigger
1.1091 + , i
1.1092 +
1.1093 + this.type = type
1.1094 + this.$element = $(element)
1.1095 + this.options = this.getOptions(options)
1.1096 + this.enabled = true
1.1097 +
1.1098 + triggers = this.options.trigger.split(' ')
1.1099 +
1.1100 + for (i = triggers.length; i--;) {
1.1101 + trigger = triggers[i]
1.1102 + if (trigger == 'click') {
1.1103 + this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1.1104 + } else if (trigger != 'manual') {
1.1105 + eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
1.1106 + eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
1.1107 + this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1.1108 + this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1.1109 + }
1.1110 + }
1.1111 +
1.1112 + this.options.selector ?
1.1113 + (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1.1114 + this.fixTitle()
1.1115 + }
1.1116 +
1.1117 + , getOptions: function (options) {
1.1118 + options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
1.1119 +
1.1120 + if (options.delay && typeof options.delay == 'number') {
1.1121 + options.delay = {
1.1122 + show: options.delay
1.1123 + , hide: options.delay
1.1124 + }
1.1125 + }
1.1126 +
1.1127 + return options
1.1128 + }
1.1129 +
1.1130 + , enter: function (e) {
1.1131 + var defaults = $.fn[this.type].defaults
1.1132 + , options = {}
1.1133 + , self
1.1134 +
1.1135 + this._options && $.each(this._options, function (key, value) {
1.1136 + if (defaults[key] != value) options[key] = value
1.1137 + }, this)
1.1138 +
1.1139 + self = $(e.currentTarget)[this.type](options).data(this.type)
1.1140 +
1.1141 + if (!self.options.delay || !self.options.delay.show) return self.show()
1.1142 +
1.1143 + clearTimeout(this.timeout)
1.1144 + self.hoverState = 'in'
1.1145 + this.timeout = setTimeout(function() {
1.1146 + if (self.hoverState == 'in') self.show()
1.1147 + }, self.options.delay.show)
1.1148 + }
1.1149 +
1.1150 + , leave: function (e) {
1.1151 + var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1.1152 +
1.1153 + if (this.timeout) clearTimeout(this.timeout)
1.1154 + if (!self.options.delay || !self.options.delay.hide) return self.hide()
1.1155 +
1.1156 + self.hoverState = 'out'
1.1157 + this.timeout = setTimeout(function() {
1.1158 + if (self.hoverState == 'out') self.hide()
1.1159 + }, self.options.delay.hide)
1.1160 + }
1.1161 +
1.1162 + , show: function () {
1.1163 + var $tip
1.1164 + , pos
1.1165 + , actualWidth
1.1166 + , actualHeight
1.1167 + , placement
1.1168 + , tp
1.1169 + , e = $.Event('show')
1.1170 +
1.1171 + if (this.hasContent() && this.enabled) {
1.1172 + this.$element.trigger(e)
1.1173 + if (e.isDefaultPrevented()) return
1.1174 + $tip = this.tip()
1.1175 + this.setContent()
1.1176 +
1.1177 + if (this.options.animation) {
1.1178 + $tip.addClass('fade')
1.1179 + }
1.1180 +
1.1181 + placement = typeof this.options.placement == 'function' ?
1.1182 + this.options.placement.call(this, $tip[0], this.$element[0]) :
1.1183 + this.options.placement
1.1184 +
1.1185 + $tip
1.1186 + .detach()
1.1187 + .css({ top: 0, left: 0, display: 'block' })
1.1188 +
1.1189 + this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1.1190 +
1.1191 + pos = this.getPosition()
1.1192 +
1.1193 + actualWidth = $tip[0].offsetWidth
1.1194 + actualHeight = $tip[0].offsetHeight
1.1195 +
1.1196 + switch (placement) {
1.1197 + case 'bottom':
1.1198 + tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1.1199 + break
1.1200 + case 'top':
1.1201 + tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1.1202 + break
1.1203 + case 'left':
1.1204 + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1.1205 + break
1.1206 + case 'right':
1.1207 + tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1.1208 + break
1.1209 + }
1.1210 +
1.1211 + this.applyPlacement(tp, placement)
1.1212 + this.$element.trigger('shown')
1.1213 + }
1.1214 + }
1.1215 +
1.1216 + , applyPlacement: function(offset, placement){
1.1217 + var $tip = this.tip()
1.1218 + , width = $tip[0].offsetWidth
1.1219 + , height = $tip[0].offsetHeight
1.1220 + , actualWidth
1.1221 + , actualHeight
1.1222 + , delta
1.1223 + , replace
1.1224 +
1.1225 + $tip
1.1226 + .offset(offset)
1.1227 + .addClass(placement)
1.1228 + .addClass('in')
1.1229 +
1.1230 + actualWidth = $tip[0].offsetWidth
1.1231 + actualHeight = $tip[0].offsetHeight
1.1232 +
1.1233 + if (placement == 'top' && actualHeight != height) {
1.1234 + offset.top = offset.top + height - actualHeight
1.1235 + replace = true
1.1236 + }
1.1237 +
1.1238 + if (placement == 'bottom' || placement == 'top') {
1.1239 + delta = 0
1.1240 +
1.1241 + if (offset.left < 0){
1.1242 + delta = offset.left * -2
1.1243 + offset.left = 0
1.1244 + $tip.offset(offset)
1.1245 + actualWidth = $tip[0].offsetWidth
1.1246 + actualHeight = $tip[0].offsetHeight
1.1247 + }
1.1248 +
1.1249 + this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
1.1250 + } else {
1.1251 + this.replaceArrow(actualHeight - height, actualHeight, 'top')
1.1252 + }
1.1253 +
1.1254 + if (replace) $tip.offset(offset)
1.1255 + }
1.1256 +
1.1257 + , replaceArrow: function(delta, dimension, position){
1.1258 + this
1.1259 + .arrow()
1.1260 + .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
1.1261 + }
1.1262 +
1.1263 + , setContent: function () {
1.1264 + var $tip = this.tip()
1.1265 + , title = this.getTitle()
1.1266 +
1.1267 + $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1.1268 + $tip.removeClass('fade in top bottom left right')
1.1269 + }
1.1270 +
1.1271 + , hide: function () {
1.1272 + var that = this
1.1273 + , $tip = this.tip()
1.1274 + , e = $.Event('hide')
1.1275 +
1.1276 + this.$element.trigger(e)
1.1277 + if (e.isDefaultPrevented()) return
1.1278 +
1.1279 + $tip.removeClass('in')
1.1280 +
1.1281 + function removeWithAnimation() {
1.1282 + var timeout = setTimeout(function () {
1.1283 + $tip.off($.support.transition.end).detach()
1.1284 + }, 500)
1.1285 +
1.1286 + $tip.one($.support.transition.end, function () {
1.1287 + clearTimeout(timeout)
1.1288 + $tip.detach()
1.1289 + })
1.1290 + }
1.1291 +
1.1292 + $.support.transition && this.$tip.hasClass('fade') ?
1.1293 + removeWithAnimation() :
1.1294 + $tip.detach()
1.1295 +
1.1296 + this.$element.trigger('hidden')
1.1297 +
1.1298 + return this
1.1299 + }
1.1300 +
1.1301 + , fixTitle: function () {
1.1302 + var $e = this.$element
1.1303 + if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1.1304 + $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1.1305 + }
1.1306 + }
1.1307 +
1.1308 + , hasContent: function () {
1.1309 + return this.getTitle()
1.1310 + }
1.1311 +
1.1312 + , getPosition: function () {
1.1313 + var el = this.$element[0]
1.1314 + return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
1.1315 + width: el.offsetWidth
1.1316 + , height: el.offsetHeight
1.1317 + }, this.$element.offset())
1.1318 + }
1.1319 +
1.1320 + , getTitle: function () {
1.1321 + var title
1.1322 + , $e = this.$element
1.1323 + , o = this.options
1.1324 +
1.1325 + title = $e.attr('data-original-title')
1.1326 + || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1.1327 +
1.1328 + return title
1.1329 + }
1.1330 +
1.1331 + , tip: function () {
1.1332 + return this.$tip = this.$tip || $(this.options.template)
1.1333 + }
1.1334 +
1.1335 + , arrow: function(){
1.1336 + return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
1.1337 + }
1.1338 +
1.1339 + , validate: function () {
1.1340 + if (!this.$element[0].parentNode) {
1.1341 + this.hide()
1.1342 + this.$element = null
1.1343 + this.options = null
1.1344 + }
1.1345 + }
1.1346 +
1.1347 + , enable: function () {
1.1348 + this.enabled = true
1.1349 + }
1.1350 +
1.1351 + , disable: function () {
1.1352 + this.enabled = false
1.1353 + }
1.1354 +
1.1355 + , toggleEnabled: function () {
1.1356 + this.enabled = !this.enabled
1.1357 + }
1.1358 +
1.1359 + , toggle: function (e) {
1.1360 + var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
1.1361 + self.tip().hasClass('in') ? self.hide() : self.show()
1.1362 + }
1.1363 +
1.1364 + , destroy: function () {
1.1365 + this.hide().$element.off('.' + this.type).removeData(this.type)
1.1366 + }
1.1367 +
1.1368 + }
1.1369 +
1.1370 +
1.1371 + /* TOOLTIP PLUGIN DEFINITION
1.1372 + * ========================= */
1.1373 +
1.1374 + var old = $.fn.tooltip
1.1375 +
1.1376 + $.fn.tooltip = function ( option ) {
1.1377 + return this.each(function () {
1.1378 + var $this = $(this)
1.1379 + , data = $this.data('tooltip')
1.1380 + , options = typeof option == 'object' && option
1.1381 + if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1.1382 + if (typeof option == 'string') data[option]()
1.1383 + })
1.1384 + }
1.1385 +
1.1386 + $.fn.tooltip.Constructor = Tooltip
1.1387 +
1.1388 + $.fn.tooltip.defaults = {
1.1389 + animation: true
1.1390 + , placement: 'top'
1.1391 + , selector: false
1.1392 + , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1.1393 + , trigger: 'hover focus'
1.1394 + , title: ''
1.1395 + , delay: 0
1.1396 + , html: false
1.1397 + , container: false
1.1398 + }
1.1399 +
1.1400 +
1.1401 + /* TOOLTIP NO CONFLICT
1.1402 + * =================== */
1.1403 +
1.1404 + $.fn.tooltip.noConflict = function () {
1.1405 + $.fn.tooltip = old
1.1406 + return this
1.1407 + }
1.1408 +
1.1409 +}(window.jQuery);
1.1410 +/* ===========================================================
1.1411 + * bootstrap-popover.js v2.3.1
1.1412 + * http://twitter.github.com/bootstrap/javascript.html#popovers
1.1413 + * ===========================================================
1.1414 + * Copyright 2012 Twitter, Inc.
1.1415 + *
1.1416 + * Licensed under the Apache License, Version 2.0 (the "License");
1.1417 + * you may not use this file except in compliance with the License.
1.1418 + * You may obtain a copy of the License at
1.1419 + *
1.1420 + * http://www.apache.org/licenses/LICENSE-2.0
1.1421 + *
1.1422 + * Unless required by applicable law or agreed to in writing, software
1.1423 + * distributed under the License is distributed on an "AS IS" BASIS,
1.1424 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.1425 + * See the License for the specific language governing permissions and
1.1426 + * limitations under the License.
1.1427 + * =========================================================== */
1.1428 +
1.1429 +
1.1430 +!function ($) {
1.1431 +
1.1432 + "use strict"; // jshint ;_;
1.1433 +
1.1434 +
1.1435 + /* POPOVER PUBLIC CLASS DEFINITION
1.1436 + * =============================== */
1.1437 +
1.1438 + var Popover = function (element, options) {
1.1439 + this.init('popover', element, options)
1.1440 + }
1.1441 +
1.1442 +
1.1443 + /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1.1444 + ========================================== */
1.1445 +
1.1446 + Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1.1447 +
1.1448 + constructor: Popover
1.1449 +
1.1450 + , setContent: function () {
1.1451 + var $tip = this.tip()
1.1452 + , title = this.getTitle()
1.1453 + , content = this.getContent()
1.1454 +
1.1455 + $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1.1456 + $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
1.1457 +
1.1458 + $tip.removeClass('fade top bottom left right in')
1.1459 + }
1.1460 +
1.1461 + , hasContent: function () {
1.1462 + return this.getTitle() || this.getContent()
1.1463 + }
1.1464 +
1.1465 + , getContent: function () {
1.1466 + var content
1.1467 + , $e = this.$element
1.1468 + , o = this.options
1.1469 +
1.1470 + content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1.1471 + || $e.attr('data-content')
1.1472 +
1.1473 + return content
1.1474 + }
1.1475 +
1.1476 + , tip: function () {
1.1477 + if (!this.$tip) {
1.1478 + this.$tip = $(this.options.template)
1.1479 + }
1.1480 + return this.$tip
1.1481 + }
1.1482 +
1.1483 + , destroy: function () {
1.1484 + this.hide().$element.off('.' + this.type).removeData(this.type)
1.1485 + }
1.1486 +
1.1487 + })
1.1488 +
1.1489 +
1.1490 + /* POPOVER PLUGIN DEFINITION
1.1491 + * ======================= */
1.1492 +
1.1493 + var old = $.fn.popover
1.1494 +
1.1495 + $.fn.popover = function (option) {
1.1496 + return this.each(function () {
1.1497 + var $this = $(this)
1.1498 + , data = $this.data('popover')
1.1499 + , options = typeof option == 'object' && option
1.1500 + if (!data) $this.data('popover', (data = new Popover(this, options)))
1.1501 + if (typeof option == 'string') data[option]()
1.1502 + })
1.1503 + }
1.1504 +
1.1505 + $.fn.popover.Constructor = Popover
1.1506 +
1.1507 + $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1.1508 + placement: 'right'
1.1509 + , trigger: 'click'
1.1510 + , content: ''
1.1511 + , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1.1512 + })
1.1513 +
1.1514 +
1.1515 + /* POPOVER NO CONFLICT
1.1516 + * =================== */
1.1517 +
1.1518 + $.fn.popover.noConflict = function () {
1.1519 + $.fn.popover = old
1.1520 + return this
1.1521 + }
1.1522 +
1.1523 +}(window.jQuery);
1.1524 +/* =============================================================
1.1525 + * bootstrap-scrollspy.js v2.3.1
1.1526 + * http://twitter.github.com/bootstrap/javascript.html#scrollspy
1.1527 + * =============================================================
1.1528 + * Copyright 2012 Twitter, Inc.
1.1529 + *
1.1530 + * Licensed under the Apache License, Version 2.0 (the "License");
1.1531 + * you may not use this file except in compliance with the License.
1.1532 + * You may obtain a copy of the License at
1.1533 + *
1.1534 + * http://www.apache.org/licenses/LICENSE-2.0
1.1535 + *
1.1536 + * Unless required by applicable law or agreed to in writing, software
1.1537 + * distributed under the License is distributed on an "AS IS" BASIS,
1.1538 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.1539 + * See the License for the specific language governing permissions and
1.1540 + * limitations under the License.
1.1541 + * ============================================================== */
1.1542 +
1.1543 +
1.1544 +!function ($) {
1.1545 +
1.1546 + "use strict"; // jshint ;_;
1.1547 +
1.1548 +
1.1549 + /* SCROLLSPY CLASS DEFINITION
1.1550 + * ========================== */
1.1551 +
1.1552 + function ScrollSpy(element, options) {
1.1553 + var process = $.proxy(this.process, this)
1.1554 + , $element = $(element).is('body') ? $(window) : $(element)
1.1555 + , href
1.1556 + this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1.1557 + this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
1.1558 + this.selector = (this.options.target
1.1559 + || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1.1560 + || '') + ' .nav li > a'
1.1561 + this.$body = $('body')
1.1562 + this.refresh()
1.1563 + this.process()
1.1564 + }
1.1565 +
1.1566 + ScrollSpy.prototype = {
1.1567 +
1.1568 + constructor: ScrollSpy
1.1569 +
1.1570 + , refresh: function () {
1.1571 + var self = this
1.1572 + , $targets
1.1573 +
1.1574 + this.offsets = $([])
1.1575 + this.targets = $([])
1.1576 +
1.1577 + $targets = this.$body
1.1578 + .find(this.selector)
1.1579 + .map(function () {
1.1580 + var $el = $(this)
1.1581 + , href = $el.data('target') || $el.attr('href')
1.1582 + , $href = /^#\w/.test(href) && $(href)
1.1583 + return ( $href
1.1584 + && $href.length
1.1585 + && [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
1.1586 + })
1.1587 + .sort(function (a, b) { return a[0] - b[0] })
1.1588 + .each(function () {
1.1589 + self.offsets.push(this[0])
1.1590 + self.targets.push(this[1])
1.1591 + })
1.1592 + }
1.1593 +
1.1594 + , process: function () {
1.1595 + var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1.1596 + , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1.1597 + , maxScroll = scrollHeight - this.$scrollElement.height()
1.1598 + , offsets = this.offsets
1.1599 + , targets = this.targets
1.1600 + , activeTarget = this.activeTarget
1.1601 + , i
1.1602 +
1.1603 + if (scrollTop >= maxScroll) {
1.1604 + return activeTarget != (i = targets.last()[0])
1.1605 + && this.activate ( i )
1.1606 + }
1.1607 +
1.1608 + for (i = offsets.length; i--;) {
1.1609 + activeTarget != targets[i]
1.1610 + && scrollTop >= offsets[i]
1.1611 + && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1.1612 + && this.activate( targets[i] )
1.1613 + }
1.1614 + }
1.1615 +
1.1616 + , activate: function (target) {
1.1617 + var active
1.1618 + , selector
1.1619 +
1.1620 + this.activeTarget = target
1.1621 +
1.1622 + $(this.selector)
1.1623 + .parent('.active')
1.1624 + .removeClass('active')
1.1625 +
1.1626 + selector = this.selector
1.1627 + + '[data-target="' + target + '"],'
1.1628 + + this.selector + '[href="' + target + '"]'
1.1629 +
1.1630 + active = $(selector)
1.1631 + .parent('li')
1.1632 + .addClass('active')
1.1633 +
1.1634 + if (active.parent('.dropdown-menu').length) {
1.1635 + active = active.closest('li.dropdown').addClass('active')
1.1636 + }
1.1637 +
1.1638 + active.trigger('activate')
1.1639 + }
1.1640 +
1.1641 + }
1.1642 +
1.1643 +
1.1644 + /* SCROLLSPY PLUGIN DEFINITION
1.1645 + * =========================== */
1.1646 +
1.1647 + var old = $.fn.scrollspy
1.1648 +
1.1649 + $.fn.scrollspy = function (option) {
1.1650 + return this.each(function () {
1.1651 + var $this = $(this)
1.1652 + , data = $this.data('scrollspy')
1.1653 + , options = typeof option == 'object' && option
1.1654 + if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1.1655 + if (typeof option == 'string') data[option]()
1.1656 + })
1.1657 + }
1.1658 +
1.1659 + $.fn.scrollspy.Constructor = ScrollSpy
1.1660 +
1.1661 + $.fn.scrollspy.defaults = {
1.1662 + offset: 10
1.1663 + }
1.1664 +
1.1665 +
1.1666 + /* SCROLLSPY NO CONFLICT
1.1667 + * ===================== */
1.1668 +
1.1669 + $.fn.scrollspy.noConflict = function () {
1.1670 + $.fn.scrollspy = old
1.1671 + return this
1.1672 + }
1.1673 +
1.1674 +
1.1675 + /* SCROLLSPY DATA-API
1.1676 + * ================== */
1.1677 +
1.1678 + $(window).on('load', function () {
1.1679 + $('[data-spy="scroll"]').each(function () {
1.1680 + var $spy = $(this)
1.1681 + $spy.scrollspy($spy.data())
1.1682 + })
1.1683 + })
1.1684 +
1.1685 +}(window.jQuery);/* ========================================================
1.1686 + * bootstrap-tab.js v2.3.1
1.1687 + * http://twitter.github.com/bootstrap/javascript.html#tabs
1.1688 + * ========================================================
1.1689 + * Copyright 2012 Twitter, Inc.
1.1690 + *
1.1691 + * Licensed under the Apache License, Version 2.0 (the "License");
1.1692 + * you may not use this file except in compliance with the License.
1.1693 + * You may obtain a copy of the License at
1.1694 + *
1.1695 + * http://www.apache.org/licenses/LICENSE-2.0
1.1696 + *
1.1697 + * Unless required by applicable law or agreed to in writing, software
1.1698 + * distributed under the License is distributed on an "AS IS" BASIS,
1.1699 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.1700 + * See the License for the specific language governing permissions and
1.1701 + * limitations under the License.
1.1702 + * ======================================================== */
1.1703 +
1.1704 +
1.1705 +!function ($) {
1.1706 +
1.1707 + "use strict"; // jshint ;_;
1.1708 +
1.1709 +
1.1710 + /* TAB CLASS DEFINITION
1.1711 + * ==================== */
1.1712 +
1.1713 + var Tab = function (element) {
1.1714 + this.element = $(element)
1.1715 + }
1.1716 +
1.1717 + Tab.prototype = {
1.1718 +
1.1719 + constructor: Tab
1.1720 +
1.1721 + , show: function () {
1.1722 + var $this = this.element
1.1723 + , $ul = $this.closest('ul:not(.dropdown-menu)')
1.1724 + , selector = $this.attr('data-target')
1.1725 + , previous
1.1726 + , $target
1.1727 + , e
1.1728 +
1.1729 + if (!selector) {
1.1730 + selector = $this.attr('href')
1.1731 + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1.1732 + }
1.1733 +
1.1734 + if ( $this.parent('li').hasClass('active') ) return
1.1735 +
1.1736 + previous = $ul.find('.active:last a')[0]
1.1737 +
1.1738 + e = $.Event('show', {
1.1739 + relatedTarget: previous
1.1740 + })
1.1741 +
1.1742 + $this.trigger(e)
1.1743 +
1.1744 + if (e.isDefaultPrevented()) return
1.1745 +
1.1746 + $target = $(selector)
1.1747 +
1.1748 + this.activate($this.parent('li'), $ul)
1.1749 + this.activate($target, $target.parent(), function () {
1.1750 + $this.trigger({
1.1751 + type: 'shown'
1.1752 + , relatedTarget: previous
1.1753 + })
1.1754 + })
1.1755 + }
1.1756 +
1.1757 + , activate: function ( element, container, callback) {
1.1758 + var $active = container.find('> .active')
1.1759 + , transition = callback
1.1760 + && $.support.transition
1.1761 + && $active.hasClass('fade')
1.1762 +
1.1763 + function next() {
1.1764 + $active
1.1765 + .removeClass('active')
1.1766 + .find('> .dropdown-menu > .active')
1.1767 + .removeClass('active')
1.1768 +
1.1769 + element.addClass('active')
1.1770 +
1.1771 + if (transition) {
1.1772 + element[0].offsetWidth // reflow for transition
1.1773 + element.addClass('in')
1.1774 + } else {
1.1775 + element.removeClass('fade')
1.1776 + }
1.1777 +
1.1778 + if ( element.parent('.dropdown-menu') ) {
1.1779 + element.closest('li.dropdown').addClass('active')
1.1780 + }
1.1781 +
1.1782 + callback && callback()
1.1783 + }
1.1784 +
1.1785 + transition ?
1.1786 + $active.one($.support.transition.end, next) :
1.1787 + next()
1.1788 +
1.1789 + $active.removeClass('in')
1.1790 + }
1.1791 + }
1.1792 +
1.1793 +
1.1794 + /* TAB PLUGIN DEFINITION
1.1795 + * ===================== */
1.1796 +
1.1797 + var old = $.fn.tab
1.1798 +
1.1799 + $.fn.tab = function ( option ) {
1.1800 + return this.each(function () {
1.1801 + var $this = $(this)
1.1802 + , data = $this.data('tab')
1.1803 + if (!data) $this.data('tab', (data = new Tab(this)))
1.1804 + if (typeof option == 'string') data[option]()
1.1805 + })
1.1806 + }
1.1807 +
1.1808 + $.fn.tab.Constructor = Tab
1.1809 +
1.1810 +
1.1811 + /* TAB NO CONFLICT
1.1812 + * =============== */
1.1813 +
1.1814 + $.fn.tab.noConflict = function () {
1.1815 + $.fn.tab = old
1.1816 + return this
1.1817 + }
1.1818 +
1.1819 +
1.1820 + /* TAB DATA-API
1.1821 + * ============ */
1.1822 +
1.1823 + $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1.1824 + e.preventDefault()
1.1825 + $(this).tab('show')
1.1826 + })
1.1827 +
1.1828 +}(window.jQuery);/* =============================================================
1.1829 + * bootstrap-typeahead.js v2.3.1
1.1830 + * http://twitter.github.com/bootstrap/javascript.html#typeahead
1.1831 + * =============================================================
1.1832 + * Copyright 2012 Twitter, Inc.
1.1833 + *
1.1834 + * Licensed under the Apache License, Version 2.0 (the "License");
1.1835 + * you may not use this file except in compliance with the License.
1.1836 + * You may obtain a copy of the License at
1.1837 + *
1.1838 + * http://www.apache.org/licenses/LICENSE-2.0
1.1839 + *
1.1840 + * Unless required by applicable law or agreed to in writing, software
1.1841 + * distributed under the License is distributed on an "AS IS" BASIS,
1.1842 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.1843 + * See the License for the specific language governing permissions and
1.1844 + * limitations under the License.
1.1845 + * ============================================================ */
1.1846 +
1.1847 +
1.1848 +!function($){
1.1849 +
1.1850 + "use strict"; // jshint ;_;
1.1851 +
1.1852 +
1.1853 + /* TYPEAHEAD PUBLIC CLASS DEFINITION
1.1854 + * ================================= */
1.1855 +
1.1856 + var Typeahead = function (element, options) {
1.1857 + this.$element = $(element)
1.1858 + this.options = $.extend({}, $.fn.typeahead.defaults, options)
1.1859 + this.matcher = this.options.matcher || this.matcher
1.1860 + this.sorter = this.options.sorter || this.sorter
1.1861 + this.highlighter = this.options.highlighter || this.highlighter
1.1862 + this.updater = this.options.updater || this.updater
1.1863 + this.source = this.options.source
1.1864 + this.$menu = $(this.options.menu)
1.1865 + this.shown = false
1.1866 + this.listen()
1.1867 + }
1.1868 +
1.1869 + Typeahead.prototype = {
1.1870 +
1.1871 + constructor: Typeahead
1.1872 +
1.1873 + , select: function () {
1.1874 + var val = this.$menu.find('.active').attr('data-value')
1.1875 + this.$element
1.1876 + .val(this.updater(val))
1.1877 + .change()
1.1878 + return this.hide()
1.1879 + }
1.1880 +
1.1881 + , updater: function (item) {
1.1882 + return item
1.1883 + }
1.1884 +
1.1885 + , show: function () {
1.1886 + var pos = $.extend({}, this.$element.position(), {
1.1887 + height: this.$element[0].offsetHeight
1.1888 + })
1.1889 +
1.1890 + this.$menu
1.1891 + .insertAfter(this.$element)
1.1892 + .css({
1.1893 + top: pos.top + pos.height
1.1894 + , left: pos.left
1.1895 + })
1.1896 + .show()
1.1897 +
1.1898 + this.shown = true
1.1899 + return this
1.1900 + }
1.1901 +
1.1902 + , hide: function () {
1.1903 + this.$menu.hide()
1.1904 + this.shown = false
1.1905 + return this
1.1906 + }
1.1907 +
1.1908 + , lookup: function (event) {
1.1909 + var items
1.1910 +
1.1911 + this.query = this.$element.val()
1.1912 +
1.1913 + if (!this.query || this.query.length < this.options.minLength) {
1.1914 + return this.shown ? this.hide() : this
1.1915 + }
1.1916 +
1.1917 + items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
1.1918 +
1.1919 + return items ? this.process(items) : this
1.1920 + }
1.1921 +
1.1922 + , process: function (items) {
1.1923 + var that = this
1.1924 +
1.1925 + items = $.grep(items, function (item) {
1.1926 + return that.matcher(item)
1.1927 + })
1.1928 +
1.1929 + items = this.sorter(items)
1.1930 +
1.1931 + if (!items.length) {
1.1932 + return this.shown ? this.hide() : this
1.1933 + }
1.1934 +
1.1935 + return this.render(items.slice(0, this.options.items)).show()
1.1936 + }
1.1937 +
1.1938 + , matcher: function (item) {
1.1939 + return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1.1940 + }
1.1941 +
1.1942 + , sorter: function (items) {
1.1943 + var beginswith = []
1.1944 + , caseSensitive = []
1.1945 + , caseInsensitive = []
1.1946 + , item
1.1947 +
1.1948 + while (item = items.shift()) {
1.1949 + if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1.1950 + else if (~item.indexOf(this.query)) caseSensitive.push(item)
1.1951 + else caseInsensitive.push(item)
1.1952 + }
1.1953 +
1.1954 + return beginswith.concat(caseSensitive, caseInsensitive)
1.1955 + }
1.1956 +
1.1957 + , highlighter: function (item) {
1.1958 + var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
1.1959 + return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
1.1960 + return '<strong>' + match + '</strong>'
1.1961 + })
1.1962 + }
1.1963 +
1.1964 + , render: function (items) {
1.1965 + var that = this
1.1966 +
1.1967 + items = $(items).map(function (i, item) {
1.1968 + i = $(that.options.item).attr('data-value', item)
1.1969 + i.find('a').html(that.highlighter(item))
1.1970 + return i[0]
1.1971 + })
1.1972 +
1.1973 + items.first().addClass('active')
1.1974 + this.$menu.html(items)
1.1975 + return this
1.1976 + }
1.1977 +
1.1978 + , next: function (event) {
1.1979 + var active = this.$menu.find('.active').removeClass('active')
1.1980 + , next = active.next()
1.1981 +
1.1982 + if (!next.length) {
1.1983 + next = $(this.$menu.find('li')[0])
1.1984 + }
1.1985 +
1.1986 + next.addClass('active')
1.1987 + }
1.1988 +
1.1989 + , prev: function (event) {
1.1990 + var active = this.$menu.find('.active').removeClass('active')
1.1991 + , prev = active.prev()
1.1992 +
1.1993 + if (!prev.length) {
1.1994 + prev = this.$menu.find('li').last()
1.1995 + }
1.1996 +
1.1997 + prev.addClass('active')
1.1998 + }
1.1999 +
1.2000 + , listen: function () {
1.2001 + this.$element
1.2002 + .on('focus', $.proxy(this.focus, this))
1.2003 + .on('blur', $.proxy(this.blur, this))
1.2004 + .on('keypress', $.proxy(this.keypress, this))
1.2005 + .on('keyup', $.proxy(this.keyup, this))
1.2006 +
1.2007 + if (this.eventSupported('keydown')) {
1.2008 + this.$element.on('keydown', $.proxy(this.keydown, this))
1.2009 + }
1.2010 +
1.2011 + this.$menu
1.2012 + .on('click', $.proxy(this.click, this))
1.2013 + .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1.2014 + .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
1.2015 + }
1.2016 +
1.2017 + , eventSupported: function(eventName) {
1.2018 + var isSupported = eventName in this.$element
1.2019 + if (!isSupported) {
1.2020 + this.$element.setAttribute(eventName, 'return;')
1.2021 + isSupported = typeof this.$element[eventName] === 'function'
1.2022 + }
1.2023 + return isSupported
1.2024 + }
1.2025 +
1.2026 + , move: function (e) {
1.2027 + if (!this.shown) return
1.2028 +
1.2029 + switch(e.keyCode) {
1.2030 + case 9: // tab
1.2031 + case 13: // enter
1.2032 + case 27: // escape
1.2033 + e.preventDefault()
1.2034 + break
1.2035 +
1.2036 + case 38: // up arrow
1.2037 + e.preventDefault()
1.2038 + this.prev()
1.2039 + break
1.2040 +
1.2041 + case 40: // down arrow
1.2042 + e.preventDefault()
1.2043 + this.next()
1.2044 + break
1.2045 + }
1.2046 +
1.2047 + e.stopPropagation()
1.2048 + }
1.2049 +
1.2050 + , keydown: function (e) {
1.2051 + this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
1.2052 + this.move(e)
1.2053 + }
1.2054 +
1.2055 + , keypress: function (e) {
1.2056 + if (this.suppressKeyPressRepeat) return
1.2057 + this.move(e)
1.2058 + }
1.2059 +
1.2060 + , keyup: function (e) {
1.2061 + switch(e.keyCode) {
1.2062 + case 40: // down arrow
1.2063 + case 38: // up arrow
1.2064 + case 16: // shift
1.2065 + case 17: // ctrl
1.2066 + case 18: // alt
1.2067 + break
1.2068 +
1.2069 + case 9: // tab
1.2070 + case 13: // enter
1.2071 + if (!this.shown) return
1.2072 + this.select()
1.2073 + break
1.2074 +
1.2075 + case 27: // escape
1.2076 + if (!this.shown) return
1.2077 + this.hide()
1.2078 + break
1.2079 +
1.2080 + default:
1.2081 + this.lookup()
1.2082 + }
1.2083 +
1.2084 + e.stopPropagation()
1.2085 + e.preventDefault()
1.2086 + }
1.2087 +
1.2088 + , focus: function (e) {
1.2089 + this.focused = true
1.2090 + }
1.2091 +
1.2092 + , blur: function (e) {
1.2093 + this.focused = false
1.2094 + if (!this.mousedover && this.shown) this.hide()
1.2095 + }
1.2096 +
1.2097 + , click: function (e) {
1.2098 + e.stopPropagation()
1.2099 + e.preventDefault()
1.2100 + this.select()
1.2101 + this.$element.focus()
1.2102 + }
1.2103 +
1.2104 + , mouseenter: function (e) {
1.2105 + this.mousedover = true
1.2106 + this.$menu.find('.active').removeClass('active')
1.2107 + $(e.currentTarget).addClass('active')
1.2108 + }
1.2109 +
1.2110 + , mouseleave: function (e) {
1.2111 + this.mousedover = false
1.2112 + if (!this.focused && this.shown) this.hide()
1.2113 + }
1.2114 +
1.2115 + }
1.2116 +
1.2117 +
1.2118 + /* TYPEAHEAD PLUGIN DEFINITION
1.2119 + * =========================== */
1.2120 +
1.2121 + var old = $.fn.typeahead
1.2122 +
1.2123 + $.fn.typeahead = function (option) {
1.2124 + return this.each(function () {
1.2125 + var $this = $(this)
1.2126 + , data = $this.data('typeahead')
1.2127 + , options = typeof option == 'object' && option
1.2128 + if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1.2129 + if (typeof option == 'string') data[option]()
1.2130 + })
1.2131 + }
1.2132 +
1.2133 + $.fn.typeahead.defaults = {
1.2134 + source: []
1.2135 + , items: 8
1.2136 + , menu: '<ul class="typeahead dropdown-menu"></ul>'
1.2137 + , item: '<li><a href="#"></a></li>'
1.2138 + , minLength: 1
1.2139 + }
1.2140 +
1.2141 + $.fn.typeahead.Constructor = Typeahead
1.2142 +
1.2143 +
1.2144 + /* TYPEAHEAD NO CONFLICT
1.2145 + * =================== */
1.2146 +
1.2147 + $.fn.typeahead.noConflict = function () {
1.2148 + $.fn.typeahead = old
1.2149 + return this
1.2150 + }
1.2151 +
1.2152 +
1.2153 + /* TYPEAHEAD DATA-API
1.2154 + * ================== */
1.2155 +
1.2156 + $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1.2157 + var $this = $(this)
1.2158 + if ($this.data('typeahead')) return
1.2159 + $this.typeahead($this.data())
1.2160 + })
1.2161 +
1.2162 +}(window.jQuery);
1.2163 +/* ==========================================================
1.2164 + * bootstrap-affix.js v2.3.1
1.2165 + * http://twitter.github.com/bootstrap/javascript.html#affix
1.2166 + * ==========================================================
1.2167 + * Copyright 2012 Twitter, Inc.
1.2168 + *
1.2169 + * Licensed under the Apache License, Version 2.0 (the "License");
1.2170 + * you may not use this file except in compliance with the License.
1.2171 + * You may obtain a copy of the License at
1.2172 + *
1.2173 + * http://www.apache.org/licenses/LICENSE-2.0
1.2174 + *
1.2175 + * Unless required by applicable law or agreed to in writing, software
1.2176 + * distributed under the License is distributed on an "AS IS" BASIS,
1.2177 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1.2178 + * See the License for the specific language governing permissions and
1.2179 + * limitations under the License.
1.2180 + * ========================================================== */
1.2181 +
1.2182 +
1.2183 +!function ($) {
1.2184 +
1.2185 + "use strict"; // jshint ;_;
1.2186 +
1.2187 +
1.2188 + /* AFFIX CLASS DEFINITION
1.2189 + * ====================== */
1.2190 +
1.2191 + var Affix = function (element, options) {
1.2192 + this.options = $.extend({}, $.fn.affix.defaults, options)
1.2193 + this.$window = $(window)
1.2194 + .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
1.2195 + .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
1.2196 + this.$element = $(element)
1.2197 + this.checkPosition()
1.2198 + }
1.2199 +
1.2200 + Affix.prototype.checkPosition = function () {
1.2201 + if (!this.$element.is(':visible')) return
1.2202 +
1.2203 + var scrollHeight = $(document).height()
1.2204 + , scrollTop = this.$window.scrollTop()
1.2205 + , position = this.$element.offset()
1.2206 + , offset = this.options.offset
1.2207 + , offsetBottom = offset.bottom
1.2208 + , offsetTop = offset.top
1.2209 + , reset = 'affix affix-top affix-bottom'
1.2210 + , affix
1.2211 +
1.2212 + if (typeof offset != 'object') offsetBottom = offsetTop = offset
1.2213 + if (typeof offsetTop == 'function') offsetTop = offset.top()
1.2214 + if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
1.2215 +
1.2216 + affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
1.2217 + false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
1.2218 + 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
1.2219 + 'top' : false
1.2220 +
1.2221 + if (this.affixed === affix) return
1.2222 +
1.2223 + this.affixed = affix
1.2224 + this.unpin = affix == 'bottom' ? position.top - scrollTop : null
1.2225 +
1.2226 + this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
1.2227 + }
1.2228 +
1.2229 +
1.2230 + /* AFFIX PLUGIN DEFINITION
1.2231 + * ======================= */
1.2232 +
1.2233 + var old = $.fn.affix
1.2234 +
1.2235 + $.fn.affix = function (option) {
1.2236 + return this.each(function () {
1.2237 + var $this = $(this)
1.2238 + , data = $this.data('affix')
1.2239 + , options = typeof option == 'object' && option
1.2240 + if (!data) $this.data('affix', (data = new Affix(this, options)))
1.2241 + if (typeof option == 'string') data[option]()
1.2242 + })
1.2243 + }
1.2244 +
1.2245 + $.fn.affix.Constructor = Affix
1.2246 +
1.2247 + $.fn.affix.defaults = {
1.2248 + offset: 0
1.2249 + }
1.2250 +
1.2251 +
1.2252 + /* AFFIX NO CONFLICT
1.2253 + * ================= */
1.2254 +
1.2255 + $.fn.affix.noConflict = function () {
1.2256 + $.fn.affix = old
1.2257 + return this
1.2258 + }
1.2259 +
1.2260 +
1.2261 + /* AFFIX DATA-API
1.2262 + * ============== */
1.2263 +
1.2264 + $(window).on('load', function () {
1.2265 + $('[data-spy="affix"]').each(function () {
1.2266 + var $spy = $(this)
1.2267 + , data = $spy.data()
1.2268 +
1.2269 + data.offset = data.offset || {}
1.2270 +
1.2271 + data.offsetBottom && (data.offset.bottom = data.offsetBottom)
1.2272 + data.offsetTop && (data.offset.top = data.offsetTop)
1.2273 +
1.2274 + $spy.affix(data)
1.2275 + })
1.2276 + })
1.2277 +
1.2278 +
1.2279 +}(window.jQuery);$(function(){
1.2280 + var
1.2281 + character = {
1.2282 + height: 20,
1.2283 + width: 12.4
1.2284 + },
1.2285 + wrap = document.createElement('div'),
1.2286 + bar = wrap.appendChild(document.createElement('div')),
1.2287 +
1.2288 + cursor = document.createElement('div'),
1.2289 + // If the user specified that the visibility is hidden, then we
1.2290 + // start at the first pass ... otherwise we just do the
1.2291 + // cursor fly-by
1.2292 + pass = ($(document.body).css('visibility') == 'visible') ? 1 : 0,
1.2293 + height = $(window).height(),
1.2294 + width = $(window).width(),
1.2295 +
1.2296 + // this makes the loading of the screen proportional to the real-estate of the window.
1.2297 + // it helps keep the cool sequence there while not making it waste too much time.
1.2298 + rounds = (height * width / 165000),
1.2299 + column = width, row = height - character.height;
1.2300 + // TODO: externalize this
1.2301 + //
1.2302 + wrap.setAttribute('style', 'z-index:9999999;background:#000084;position:fixed;bottom:0;right:0;height:100%;width:100%');
1.2303 + bar.setAttribute('style', 'color:#fff;font-weight:bold;float:right;background:#000084;height:20px;margin-top:-20px;width:100%');
1.2304 + cursor.setAttribute('style', 'z-index:9999999;color:#fff;font-weight:bold;position:fixed;bottom:0;right:0');
1.2305 +
1.2306 + cursor.innerHTML = bar.innerHTML = '▄';
1.2307 +
1.2308 + // only inject the wrap if the pass is 0
1.2309 + if(pass === 0) {
1.2310 + document.body.appendChild(wrap);
1.2311 + document.body.style.visibility='visible';
1.2312 + } else {
1.2313 + document.body.appendChild(cursor);
1.2314 + rounds /= 2;
1.2315 + character.height *= 4;
1.2316 + }
1.2317 +
1.2318 + var ival = setInterval(function(){
1.2319 + for(var m = 0; m < rounds; m++) {
1.2320 + column -= character.width;
1.2321 +
1.2322 + if(column <= 0) {
1.2323 + column = width;
1.2324 + row -= character.height;
1.2325 + }
1.2326 + if(row <= 0) {
1.2327 + pass++;
1.2328 + row = height - character.height;
1.2329 +
1.2330 + if(pass == 2) {
1.2331 + document.body.removeChild(cursor);
1.2332 + clearInterval(ival);
1.2333 + } else {
1.2334 + wrap.parentNode.removeChild(wrap);
1.2335 + document.body.appendChild(cursor);
1.2336 + rounds /= 2;
1.2337 + character.height *= 4;
1.2338 + }
1.2339 + }
1.2340 +
1.2341 + if(pass === 0) {
1.2342 + bar.style.width = column + "px";
1.2343 + wrap.style.height = row + "px";
1.2344 + } else {
1.2345 + cursor.style.right = column + "px";
1.2346 + cursor.style.bottom = row + "px";
1.2347 + }
1.2348 + }
1.2349 + }, 1);
1.2350 +});
1.2351 +