Subversion Repositories SmartDukaan

Rev

Rev 21555 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21555 Rev 21627
Line 1... Line 1...
1
/*!
1
/**
2
 * Bootstrap v3.3.7 (http://getbootstrap.com)
2
* bootstrap.js v3.0.0 by @fat and @mdo
3
 * Copyright 2011-2016 Twitter, Inc.
3
* Copyright 2013 Twitter Inc.
4
 * Licensed under the MIT license
4
* http://www.apache.org/licenses/LICENSE-2.0
5
 */
5
*/
6
 
-
 
7
if (typeof jQuery === 'undefined') {
-
 
8
  throw new Error('Bootstrap\'s JavaScript requires jQuery')
6
if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
9
}
-
 
10
 
-
 
11
+function ($) {
-
 
12
  'use strict';
-
 
13
  var version = $.fn.jquery.split(' ')[0].split('.')
-
 
14
  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {
-
 
15
    throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')
-
 
16
  }
-
 
17
}(jQuery);
-
 
18
 
7
 
19
/* ========================================================================
8
/* ========================================================================
20
 * Bootstrap: transition.js v3.3.7
9
 * Bootstrap: transition.js v3.0.0
21
 * http://getbootstrap.com/javascript/#transitions
10
 * http://twbs.github.com/bootstrap/javascript.html#transitions
22
 * ========================================================================
11
 * ========================================================================
23
 * Copyright 2011-2016 Twitter, Inc.
12
 * Copyright 2013 Twitter, Inc.
-
 
13
 *
24
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
14
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
15
 * you may not use this file except in compliance with the License.
-
 
16
 * You may obtain a copy of the License at
-
 
17
 *
-
 
18
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
19
 *
-
 
20
 * Unless required by applicable law or agreed to in writing, software
-
 
21
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
22
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
23
 * See the License for the specific language governing permissions and
-
 
24
 * limitations under the License.
25
 * ======================================================================== */
25
 * ======================================================================== */
26
 
26
 
27
 
27
 
28
+function ($) {
28
+function ($) { "use strict";
29
  'use strict';
-
 
30
 
29
 
31
  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
30
  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
32
  // ============================================================
31
  // ============================================================
33
 
32
 
34
  function transitionEnd() {
33
  function transitionEnd() {
35
    var el = document.createElement('bootstrap')
34
    var el = document.createElement('bootstrap')
36
 
35
 
37
    var transEndEventNames = {
36
    var transEndEventNames = {
38
      WebkitTransition : 'webkitTransitionEnd',
37
      'WebkitTransition' : 'webkitTransitionEnd'
39
      MozTransition    : 'transitionend',
38
    , 'MozTransition'    : 'transitionend'
40
      OTransition      : 'oTransitionEnd otransitionend',
39
    , 'OTransition'      : 'oTransitionEnd otransitionend'
41
      transition       : 'transitionend'
40
    , 'transition'       : 'transitionend'
42
    }
41
    }
43
 
42
 
44
    for (var name in transEndEventNames) {
43
    for (var name in transEndEventNames) {
45
      if (el.style[name] !== undefined) {
44
      if (el.style[name] !== undefined) {
46
        return { end: transEndEventNames[name] }
45
        return { end: transEndEventNames[name] }
47
      }
46
      }
48
    }
47
    }
49
 
-
 
50
    return false // explicit for ie8 (  ._.)
-
 
51
  }
48
  }
52
 
49
 
53
  // http://blog.alexmaccaw.com/css-transitions
50
  // http://blog.alexmaccaw.com/css-transitions
54
  $.fn.emulateTransitionEnd = function (duration) {
51
  $.fn.emulateTransitionEnd = function (duration) {
55
    var called = false
52
    var called = false, $el = this
56
    var $el = this
-
 
57
    $(this).one('bsTransitionEnd', function () { called = true })
53
    $(this).one($.support.transition.end, function () { called = true })
58
    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
54
    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
59
    setTimeout(callback, duration)
55
    setTimeout(callback, duration)
60
    return this
56
    return this
61
  }
57
  }
62
 
58
 
63
  $(function () {
59
  $(function () {
64
    $.support.transition = transitionEnd()
60
    $.support.transition = transitionEnd()
65
 
-
 
66
    if (!$.support.transition) return
-
 
67
 
-
 
68
    $.event.special.bsTransitionEnd = {
-
 
69
      bindType: $.support.transition.end,
-
 
70
      delegateType: $.support.transition.end,
-
 
71
      handle: function (e) {
-
 
72
        if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
-
 
73
      }
-
 
74
    }
-
 
75
  })
61
  })
76
 
62
 
77
}(jQuery);
63
}(window.jQuery);
78
 
64
 
79
/* ========================================================================
65
/* ========================================================================
80
 * Bootstrap: alert.js v3.3.7
66
 * Bootstrap: alert.js v3.0.0
81
 * http://getbootstrap.com/javascript/#alerts
67
 * http://twbs.github.com/bootstrap/javascript.html#alerts
82
 * ========================================================================
68
 * ========================================================================
83
 * Copyright 2011-2016 Twitter, Inc.
69
 * Copyright 2013 Twitter, Inc.
-
 
70
 *
84
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
71
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
72
 * you may not use this file except in compliance with the License.
-
 
73
 * You may obtain a copy of the License at
-
 
74
 *
-
 
75
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
76
 *
-
 
77
 * Unless required by applicable law or agreed to in writing, software
-
 
78
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
79
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
80
 * See the License for the specific language governing permissions and
-
 
81
 * limitations under the License.
85
 * ======================================================================== */
82
 * ======================================================================== */
86
 
83
 
87
 
84
 
88
+function ($) {
85
+function ($) { "use strict";
89
  'use strict';
-
 
90
 
86
 
91
  // ALERT CLASS DEFINITION
87
  // ALERT CLASS DEFINITION
92
  // ======================
88
  // ======================
93
 
89
 
94
  var dismiss = '[data-dismiss="alert"]'
90
  var dismiss = '[data-dismiss="alert"]'
95
  var Alert   = function (el) {
91
  var Alert   = function (el) {
96
    $(el).on('click', dismiss, this.close)
92
    $(el).on('click', dismiss, this.close)
97
  }
93
  }
98
 
94
 
99
  Alert.VERSION = '3.3.7'
-
 
100
 
-
 
101
  Alert.TRANSITION_DURATION = 150
-
 
102
 
-
 
103
  Alert.prototype.close = function (e) {
95
  Alert.prototype.close = function (e) {
104
    var $this    = $(this)
96
    var $this    = $(this)
105
    var selector = $this.attr('data-target')
97
    var selector = $this.attr('data-target')
106
 
98
 
107
    if (!selector) {
99
    if (!selector) {
108
      selector = $this.attr('href')
100
      selector = $this.attr('href')
109
      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
101
      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
110
    }
102
    }
111
 
103
 
112
    var $parent = $(selector === '#' ? [] : selector)
104
    var $parent = $(selector)
113
 
105
 
114
    if (e) e.preventDefault()
106
    if (e) e.preventDefault()
115
 
107
 
116
    if (!$parent.length) {
108
    if (!$parent.length) {
117
      $parent = $this.closest('.alert')
109
      $parent = $this.hasClass('alert') ? $this : $this.parent()
118
    }
110
    }
119
 
111
 
120
    $parent.trigger(e = $.Event('close.bs.alert'))
112
    $parent.trigger(e = $.Event('close.bs.alert'))
121
 
113
 
122
    if (e.isDefaultPrevented()) return
114
    if (e.isDefaultPrevented()) return
123
 
115
 
124
    $parent.removeClass('in')
116
    $parent.removeClass('in')
125
 
117
 
126
    function removeElement() {
118
    function removeElement() {
127
      // detach from parent, fire event then clean up data
-
 
128
      $parent.detach().trigger('closed.bs.alert').remove()
119
      $parent.trigger('closed.bs.alert').remove()
129
    }
120
    }
130
 
121
 
131
    $.support.transition && $parent.hasClass('fade') ?
122
    $.support.transition && $parent.hasClass('fade') ?
132
      $parent
123
      $parent
133
        .one('bsTransitionEnd', removeElement)
124
        .one($.support.transition.end, removeElement)
134
        .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
125
        .emulateTransitionEnd(150) :
135
      removeElement()
126
      removeElement()
136
  }
127
  }
137
 
128
 
138
 
129
 
139
  // ALERT PLUGIN DEFINITION
130
  // ALERT PLUGIN DEFINITION
140
  // =======================
131
  // =======================
141
 
132
 
-
 
133
  var old = $.fn.alert
-
 
134
 
142
  function Plugin(option) {
135
  $.fn.alert = function (option) {
143
    return this.each(function () {
136
    return this.each(function () {
144
      var $this = $(this)
137
      var $this = $(this)
145
      var data  = $this.data('bs.alert')
138
      var data  = $this.data('bs.alert')
146
 
139
 
147
      if (!data) $this.data('bs.alert', (data = new Alert(this)))
140
      if (!data) $this.data('bs.alert', (data = new Alert(this)))
148
      if (typeof option == 'string') data[option].call($this)
141
      if (typeof option == 'string') data[option].call($this)
149
    })
142
    })
150
  }
143
  }
151
 
144
 
152
  var old = $.fn.alert
-
 
153
 
-
 
154
  $.fn.alert             = Plugin
-
 
155
  $.fn.alert.Constructor = Alert
145
  $.fn.alert.Constructor = Alert
156
 
146
 
157
 
147
 
158
  // ALERT NO CONFLICT
148
  // ALERT NO CONFLICT
159
  // =================
149
  // =================
Line 167... Line 157...
167
  // ALERT DATA-API
157
  // ALERT DATA-API
168
  // ==============
158
  // ==============
169
 
159
 
170
  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
160
  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
171
 
161
 
172
}(jQuery);
162
}(window.jQuery);
173
 
163
 
174
/* ========================================================================
164
/* ========================================================================
175
 * Bootstrap: button.js v3.3.7
165
 * Bootstrap: button.js v3.0.0
176
 * http://getbootstrap.com/javascript/#buttons
166
 * http://twbs.github.com/bootstrap/javascript.html#buttons
177
 * ========================================================================
167
 * ========================================================================
178
 * Copyright 2011-2016 Twitter, Inc.
168
 * Copyright 2013 Twitter, Inc.
-
 
169
 *
179
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
170
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
171
 * you may not use this file except in compliance with the License.
-
 
172
 * You may obtain a copy of the License at
-
 
173
 *
-
 
174
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
175
 *
-
 
176
 * Unless required by applicable law or agreed to in writing, software
-
 
177
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
178
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
179
 * See the License for the specific language governing permissions and
-
 
180
 * limitations under the License.
180
 * ======================================================================== */
181
 * ======================================================================== */
181
 
182
 
182
 
183
 
183
+function ($) {
184
+function ($) { "use strict";
184
  'use strict';
-
 
185
 
185
 
186
  // BUTTON PUBLIC CLASS DEFINITION
186
  // BUTTON PUBLIC CLASS DEFINITION
187
  // ==============================
187
  // ==============================
188
 
188
 
189
  var Button = function (element, options) {
189
  var Button = function (element, options) {
190
    this.$element  = $(element)
190
    this.$element = $(element)
191
    this.options   = $.extend({}, Button.DEFAULTS, options)
191
    this.options  = $.extend({}, Button.DEFAULTS, options)
192
    this.isLoading = false
-
 
193
  }
192
  }
194
 
193
 
195
  Button.VERSION  = '3.3.7'
-
 
196
 
-
 
197
  Button.DEFAULTS = {
194
  Button.DEFAULTS = {
198
    loadingText: 'loading...'
195
    loadingText: 'loading...'
199
  }
196
  }
200
 
197
 
201
  Button.prototype.setState = function (state) {
198
  Button.prototype.setState = function (state) {
202
    var d    = 'disabled'
199
    var d    = 'disabled'
203
    var $el  = this.$element
200
    var $el  = this.$element
204
    var val  = $el.is('input') ? 'val' : 'html'
201
    var val  = $el.is('input') ? 'val' : 'html'
205
    var data = $el.data()
202
    var data = $el.data()
206
 
203
 
207
    state += 'Text'
204
    state = state + 'Text'
208
 
205
 
209
    if (data.resetText == null) $el.data('resetText', $el[val]())
206
    if (!data.resetText) $el.data('resetText', $el[val]())
210
 
207
 
211
    // push to event loop to allow forms to submit
-
 
212
    setTimeout($.proxy(function () {
-
 
213
      $el[val](data[state] == null ? this.options[state] : data[state])
208
    $el[val](data[state] || this.options[state])
214
 
209
 
215
      if (state == 'loadingText') {
210
    // push to event loop to allow forms to submit
216
        this.isLoading = true
211
    setTimeout(function () {
217
        $el.addClass(d).attr(d, d).prop(d, true)
-
 
218
      } else if (this.isLoading) {
212
      state == 'loadingText' ?
219
        this.isLoading = false
213
        $el.addClass(d).attr(d, d) :
220
        $el.removeClass(d).removeAttr(d).prop(d, false)
214
        $el.removeClass(d).removeAttr(d);
221
      }
215
    }, 0)
222
    }, this), 0)
-
 
223
  }
216
  }
224
 
217
 
225
  Button.prototype.toggle = function () {
218
  Button.prototype.toggle = function () {
226
    var changed = true
-
 
227
    var $parent = this.$element.closest('[data-toggle="buttons"]')
219
    var $parent = this.$element.closest('[data-toggle="buttons"]')
228
 
220
 
229
    if ($parent.length) {
221
    if ($parent.length) {
230
      var $input = this.$element.find('input')
222
      var $input = this.$element.find('input')
231
      if ($input.prop('type') == 'radio') {
-
 
232
        if ($input.prop('checked')) changed = false
-
 
233
        $parent.find('.active').removeClass('active')
-
 
234
        this.$element.addClass('active')
-
 
235
      } else if ($input.prop('type') == 'checkbox') {
-
 
236
        if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
-
 
237
        this.$element.toggleClass('active')
-
 
238
      }
-
 
239
      $input.prop('checked', this.$element.hasClass('active'))
223
        .prop('checked', !this.$element.hasClass('active'))
240
      if (changed) $input.trigger('change')
224
        .trigger('change')
241
    } else {
-
 
242
      this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
225
      if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
243
      this.$element.toggleClass('active')
-
 
244
    }
226
    }
-
 
227
 
-
 
228
    this.$element.toggleClass('active')
245
  }
229
  }
246
 
230
 
247
 
231
 
248
  // BUTTON PLUGIN DEFINITION
232
  // BUTTON PLUGIN DEFINITION
249
  // ========================
233
  // ========================
250
 
234
 
-
 
235
  var old = $.fn.button
-
 
236
 
251
  function Plugin(option) {
237
  $.fn.button = function (option) {
252
    return this.each(function () {
238
    return this.each(function () {
253
      var $this   = $(this)
239
      var $this   = $(this)
254
      var data    = $this.data('bs.button')
240
      var data    = $this.data('bs.button')
255
      var options = typeof option == 'object' && option
241
      var options = typeof option == 'object' && option
256
 
242
 
Line 259... Line 245...
259
      if (option == 'toggle') data.toggle()
245
      if (option == 'toggle') data.toggle()
260
      else if (option) data.setState(option)
246
      else if (option) data.setState(option)
261
    })
247
    })
262
  }
248
  }
263
 
249
 
264
  var old = $.fn.button
-
 
265
 
-
 
266
  $.fn.button             = Plugin
-
 
267
  $.fn.button.Constructor = Button
250
  $.fn.button.Constructor = Button
268
 
251
 
269
 
252
 
270
  // BUTTON NO CONFLICT
253
  // BUTTON NO CONFLICT
271
  // ==================
254
  // ==================
Line 277... Line 260...
277
 
260
 
278
 
261
 
279
  // BUTTON DATA-API
262
  // BUTTON DATA-API
280
  // ===============
263
  // ===============
281
 
264
 
282
  $(document)
-
 
283
    .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
265
  $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
284
      var $btn = $(e.target).closest('.btn')
266
    var $btn = $(e.target)
285
      Plugin.call($btn, 'toggle')
267
    if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
286
      if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
268
    $btn.button('toggle')
287
        // Prevent double click on radios, and the double selections (so cancellation) on checkboxes
-
 
288
        e.preventDefault()
269
    e.preventDefault()
289
        // The target component still receive the focus
-
 
290
        if ($btn.is('input,button')) $btn.trigger('focus')
-
 
291
        else $btn.find('input:visible,button:visible').first().trigger('focus')
-
 
292
      }
-
 
293
    })
-
 
294
    .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
-
 
295
      $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
-
 
296
    })
270
  })
297
 
271
 
298
}(jQuery);
272
}(window.jQuery);
299
 
273
 
300
/* ========================================================================
274
/* ========================================================================
301
 * Bootstrap: carousel.js v3.3.7
275
 * Bootstrap: carousel.js v3.0.0
302
 * http://getbootstrap.com/javascript/#carousel
276
 * http://twbs.github.com/bootstrap/javascript.html#carousel
303
 * ========================================================================
277
 * ========================================================================
304
 * Copyright 2011-2016 Twitter, Inc.
278
 * Copyright 2012 Twitter, Inc.
-
 
279
 *
305
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
280
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
281
 * you may not use this file except in compliance with the License.
-
 
282
 * You may obtain a copy of the License at
-
 
283
 *
-
 
284
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
285
 *
-
 
286
 * Unless required by applicable law or agreed to in writing, software
-
 
287
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
288
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
289
 * See the License for the specific language governing permissions and
-
 
290
 * limitations under the License.
306
 * ======================================================================== */
291
 * ======================================================================== */
307
 
292
 
308
 
293
 
309
+function ($) {
294
+function ($) { "use strict";
310
  'use strict';
-
 
311
 
295
 
312
  // CAROUSEL CLASS DEFINITION
296
  // CAROUSEL CLASS DEFINITION
313
  // =========================
297
  // =========================
314
 
298
 
315
  var Carousel = function (element, options) {
299
  var Carousel = function (element, options) {
316
    this.$element    = $(element)
300
    this.$element    = $(element)
317
    this.$indicators = this.$element.find('.carousel-indicators')
301
    this.$indicators = this.$element.find('.carousel-indicators')
318
    this.options     = options
302
    this.options     = options
319
    this.paused      = null
303
    this.paused      =
320
    this.sliding     = null
304
    this.sliding     =
321
    this.interval    = null
305
    this.interval    =
322
    this.$active     = null
306
    this.$active     =
323
    this.$items      = null
307
    this.$items      = null
324
 
308
 
325
    this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
-
 
326
 
-
 
327
    this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
309
    this.options.pause == 'hover' && this.$element
328
      .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
310
      .on('mouseenter', $.proxy(this.pause, this))
329
      .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
311
      .on('mouseleave', $.proxy(this.cycle, this))
330
  }
312
  }
331
 
313
 
332
  Carousel.VERSION  = '3.3.7'
-
 
333
 
-
 
334
  Carousel.TRANSITION_DURATION = 600
-
 
335
 
-
 
336
  Carousel.DEFAULTS = {
314
  Carousel.DEFAULTS = {
337
    interval: 5000,
315
    interval: 5000
338
    pause: 'hover',
316
  , pause: 'hover'
339
    wrap: true,
317
  , wrap: true
340
    keyboard: true
-
 
341
  }
318
  }
342
 
319
 
343
  Carousel.prototype.keydown = function (e) {
-
 
344
    if (/input|textarea/i.test(e.target.tagName)) return
-
 
345
    switch (e.which) {
-
 
346
      case 37: this.prev(); break
-
 
347
      case 39: this.next(); break
-
 
348
      default: return
-
 
349
    }
-
 
350
 
-
 
351
    e.preventDefault()
-
 
352
  }
-
 
353
 
-
 
354
  Carousel.prototype.cycle = function (e) {
320
  Carousel.prototype.cycle =  function (e) {
355
    e || (this.paused = false)
321
    e || (this.paused = false)
356
 
322
 
357
    this.interval && clearInterval(this.interval)
323
    this.interval && clearInterval(this.interval)
358
 
324
 
359
    this.options.interval
325
    this.options.interval
Line 361... Line 327...
361
      && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
327
      && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
362
 
328
 
363
    return this
329
    return this
364
  }
330
  }
365
 
331
 
366
  Carousel.prototype.getItemIndex = function (item) {
332
  Carousel.prototype.getActiveIndex = function () {
367
    this.$items = item.parent().children('.item')
333
    this.$active = this.$element.find('.item.active')
368
    return this.$items.index(item || this.$active)
334
    this.$items  = this.$active.parent().children()
369
  }
-
 
370
 
335
 
371
  Carousel.prototype.getItemForDirection = function (direction, active) {
-
 
372
    var activeIndex = this.getItemIndex(active)
-
 
373
    var willWrap = (direction == 'prev' && activeIndex === 0)
-
 
374
                || (direction == 'next' && activeIndex == (this.$items.length - 1))
-
 
375
    if (willWrap && !this.options.wrap) return active
-
 
376
    var delta = direction == 'prev' ? -1 : 1
-
 
377
    var itemIndex = (activeIndex + delta) % this.$items.length
-
 
378
    return this.$items.eq(itemIndex)
336
    return this.$items.index(this.$active)
379
  }
337
  }
380
 
338
 
381
  Carousel.prototype.to = function (pos) {
339
  Carousel.prototype.to = function (pos) {
382
    var that        = this
340
    var that        = this
383
    var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
341
    var activeIndex = this.getActiveIndex()
384
 
342
 
385
    if (pos > (this.$items.length - 1) || pos < 0) return
343
    if (pos > (this.$items.length - 1) || pos < 0) return
386
 
344
 
387
    if (this.sliding)       return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
345
    if (this.sliding)       return this.$element.one('slid', function () { that.to(pos) })
388
    if (activeIndex == pos) return this.pause().cycle()
346
    if (activeIndex == pos) return this.pause().cycle()
389
 
347
 
390
    return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
348
    return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
391
  }
349
  }
392
 
350
 
393
  Carousel.prototype.pause = function (e) {
351
  Carousel.prototype.pause = function (e) {
394
    e || (this.paused = true)
352
    e || (this.paused = true)
395
 
353
 
396
    if (this.$element.find('.next, .prev').length && $.support.transition) {
354
    if (this.$element.find('.next, .prev').length && $.support.transition.end) {
397
      this.$element.trigger($.support.transition.end)
355
      this.$element.trigger($.support.transition.end)
398
      this.cycle(true)
356
      this.cycle(true)
399
    }
357
    }
400
 
358
 
401
    this.interval = clearInterval(this.interval)
359
    this.interval = clearInterval(this.interval)
Line 413... Line 371...
413
    return this.slide('prev')
371
    return this.slide('prev')
414
  }
372
  }
415
 
373
 
416
  Carousel.prototype.slide = function (type, next) {
374
  Carousel.prototype.slide = function (type, next) {
417
    var $active   = this.$element.find('.item.active')
375
    var $active   = this.$element.find('.item.active')
418
    var $next     = next || this.getItemForDirection(type, $active)
376
    var $next     = next || $active[type]()
419
    var isCycling = this.interval
377
    var isCycling = this.interval
420
    var direction = type == 'next' ? 'left' : 'right'
378
    var direction = type == 'next' ? 'left' : 'right'
-
 
379
    var fallback  = type == 'next' ? 'first' : 'last'
421
    var that      = this
380
    var that      = this
422
 
381
 
423
    if ($next.hasClass('active')) return (this.sliding = false)
-
 
424
 
-
 
425
    var relatedTarget = $next[0]
382
    if (!$next.length) {
426
    var slideEvent = $.Event('slide.bs.carousel', {
-
 
427
      relatedTarget: relatedTarget,
383
      if (!this.options.wrap) return
428
      direction: direction
384
      $next = this.$element.find('.item')[fallback]()
429
    })
385
    }
430
    this.$element.trigger(slideEvent)
-
 
431
    if (slideEvent.isDefaultPrevented()) return
-
 
432
 
386
 
433
    this.sliding = true
387
    this.sliding = true
434
 
388
 
435
    isCycling && this.pause()
389
    isCycling && this.pause()
436
 
390
 
-
 
391
    var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
-
 
392
 
-
 
393
    if ($next.hasClass('active')) return
-
 
394
 
437
    if (this.$indicators.length) {
395
    if (this.$indicators.length) {
438
      this.$indicators.find('.active').removeClass('active')
396
      this.$indicators.find('.active').removeClass('active')
-
 
397
      this.$element.one('slid', function () {
439
      var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
398
        var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
440
      $nextIndicator && $nextIndicator.addClass('active')
399
        $nextIndicator && $nextIndicator.addClass('active')
-
 
400
      })
441
    }
401
    }
442
 
402
 
443
    var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
-
 
444
    if ($.support.transition && this.$element.hasClass('slide')) {
403
    if ($.support.transition && this.$element.hasClass('slide')) {
-
 
404
      this.$element.trigger(e)
-
 
405
      if (e.isDefaultPrevented()) return
445
      $next.addClass(type)
406
      $next.addClass(type)
446
      $next[0].offsetWidth // force reflow
407
      $next[0].offsetWidth // force reflow
447
      $active.addClass(direction)
408
      $active.addClass(direction)
448
      $next.addClass(direction)
409
      $next.addClass(direction)
449
      $active
410
      $active
450
        .one('bsTransitionEnd', function () {
411
        .one($.support.transition.end, function () {
451
          $next.removeClass([type, direction].join(' ')).addClass('active')
412
          $next.removeClass([type, direction].join(' ')).addClass('active')
452
          $active.removeClass(['active', direction].join(' '))
413
          $active.removeClass(['active', direction].join(' '))
453
          that.sliding = false
414
          that.sliding = false
454
          setTimeout(function () {
-
 
455
            that.$element.trigger(slidEvent)
415
          setTimeout(function () { that.$element.trigger('slid') }, 0)
456
          }, 0)
-
 
457
        })
416
        })
458
        .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
417
        .emulateTransitionEnd(600)
459
    } else {
418
    } else {
-
 
419
      this.$element.trigger(e)
-
 
420
      if (e.isDefaultPrevented()) return
460
      $active.removeClass('active')
421
      $active.removeClass('active')
461
      $next.addClass('active')
422
      $next.addClass('active')
462
      this.sliding = false
423
      this.sliding = false
463
      this.$element.trigger(slidEvent)
424
      this.$element.trigger('slid')
464
    }
425
    }
465
 
426
 
466
    isCycling && this.cycle()
427
    isCycling && this.cycle()
467
 
428
 
468
    return this
429
    return this
Line 470... Line 431...
470
 
431
 
471
 
432
 
472
  // CAROUSEL PLUGIN DEFINITION
433
  // CAROUSEL PLUGIN DEFINITION
473
  // ==========================
434
  // ==========================
474
 
435
 
-
 
436
  var old = $.fn.carousel
-
 
437
 
475
  function Plugin(option) {
438
  $.fn.carousel = function (option) {
476
    return this.each(function () {
439
    return this.each(function () {
477
      var $this   = $(this)
440
      var $this   = $(this)
478
      var data    = $this.data('bs.carousel')
441
      var data    = $this.data('bs.carousel')
479
      var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
442
      var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
480
      var action  = typeof option == 'string' ? option : options.slide
443
      var action  = typeof option == 'string' ? option : options.slide
Line 484... Line 447...
484
      else if (action) data[action]()
447
      else if (action) data[action]()
485
      else if (options.interval) data.pause().cycle()
448
      else if (options.interval) data.pause().cycle()
486
    })
449
    })
487
  }
450
  }
488
 
451
 
489
  var old = $.fn.carousel
-
 
490
 
-
 
491
  $.fn.carousel             = Plugin
-
 
492
  $.fn.carousel.Constructor = Carousel
452
  $.fn.carousel.Constructor = Carousel
493
 
453
 
494
 
454
 
495
  // CAROUSEL NO CONFLICT
455
  // CAROUSEL NO CONFLICT
496
  // ====================
456
  // ====================
Line 502... Line 462...
502
 
462
 
503
 
463
 
504
  // CAROUSEL DATA-API
464
  // CAROUSEL DATA-API
505
  // =================
465
  // =================
506
 
466
 
507
  var clickHandler = function (e) {
467
  $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
508
    var href
-
 
509
    var $this   = $(this)
468
    var $this   = $(this), href
510
    var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
469
    var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
511
    if (!$target.hasClass('carousel')) return
-
 
512
    var options = $.extend({}, $target.data(), $this.data())
470
    var options = $.extend({}, $target.data(), $this.data())
513
    var slideIndex = $this.attr('data-slide-to')
471
    var slideIndex = $this.attr('data-slide-to')
514
    if (slideIndex) options.interval = false
472
    if (slideIndex) options.interval = false
515
 
473
 
516
    Plugin.call($target, options)
474
    $target.carousel(options)
517
 
475
 
518
    if (slideIndex) {
476
    if (slideIndex = $this.attr('data-slide-to')) {
519
      $target.data('bs.carousel').to(slideIndex)
477
      $target.data('bs.carousel').to(slideIndex)
520
    }
478
    }
521
 
479
 
522
    e.preventDefault()
480
    e.preventDefault()
523
  }
481
  })
524
 
-
 
525
  $(document)
-
 
526
    .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
-
 
527
    .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
-
 
528
 
482
 
529
  $(window).on('load', function () {
483
  $(window).on('load', function () {
530
    $('[data-ride="carousel"]').each(function () {
484
    $('[data-ride="carousel"]').each(function () {
531
      var $carousel = $(this)
485
      var $carousel = $(this)
532
      Plugin.call($carousel, $carousel.data())
486
      $carousel.carousel($carousel.data())
533
    })
487
    })
534
  })
488
  })
535
 
489
 
536
}(jQuery);
490
}(window.jQuery);
537
 
491
 
538
/* ========================================================================
492
/* ========================================================================
539
 * Bootstrap: collapse.js v3.3.7
493
 * Bootstrap: collapse.js v3.0.0
540
 * http://getbootstrap.com/javascript/#collapse
494
 * http://twbs.github.com/bootstrap/javascript.html#collapse
541
 * ========================================================================
495
 * ========================================================================
542
 * Copyright 2011-2016 Twitter, Inc.
496
 * Copyright 2012 Twitter, Inc.
-
 
497
 *
543
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
498
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
499
 * you may not use this file except in compliance with the License.
-
 
500
 * You may obtain a copy of the License at
-
 
501
 *
-
 
502
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
503
 *
-
 
504
 * Unless required by applicable law or agreed to in writing, software
-
 
505
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
506
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
507
 * See the License for the specific language governing permissions and
-
 
508
 * limitations under the License.
544
 * ======================================================================== */
509
 * ======================================================================== */
545
 
510
 
546
/* jshint latedef: false */
-
 
547
 
511
 
548
+function ($) {
512
+function ($) { "use strict";
549
  'use strict';
-
 
550
 
513
 
551
  // COLLAPSE PUBLIC CLASS DEFINITION
514
  // COLLAPSE PUBLIC CLASS DEFINITION
552
  // ================================
515
  // ================================
553
 
516
 
554
  var Collapse = function (element, options) {
517
  var Collapse = function (element, options) {
555
    this.$element      = $(element)
518
    this.$element      = $(element)
556
    this.options       = $.extend({}, Collapse.DEFAULTS, options)
519
    this.options       = $.extend({}, Collapse.DEFAULTS, options)
557
    this.$trigger      = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
-
 
558
                           '[data-toggle="collapse"][data-target="#' + element.id + '"]')
-
 
559
    this.transitioning = null
520
    this.transitioning = null
560
 
521
 
561
    if (this.options.parent) {
-
 
562
      this.$parent = this.getParent()
522
    if (this.options.parent) this.$parent = $(this.options.parent)
563
    } else {
-
 
564
      this.addAriaAndCollapsedClass(this.$element, this.$trigger)
-
 
565
    }
-
 
566
 
-
 
567
    if (this.options.toggle) this.toggle()
523
    if (this.options.toggle) this.toggle()
568
  }
524
  }
569
 
525
 
570
  Collapse.VERSION  = '3.3.7'
-
 
571
 
-
 
572
  Collapse.TRANSITION_DURATION = 350
-
 
573
 
-
 
574
  Collapse.DEFAULTS = {
526
  Collapse.DEFAULTS = {
575
    toggle: true
527
    toggle: true
576
  }
528
  }
577
 
529
 
578
  Collapse.prototype.dimension = function () {
530
  Collapse.prototype.dimension = function () {
Line 581... Line 533...
581
  }
533
  }
582
 
534
 
583
  Collapse.prototype.show = function () {
535
  Collapse.prototype.show = function () {
584
    if (this.transitioning || this.$element.hasClass('in')) return
536
    if (this.transitioning || this.$element.hasClass('in')) return
585
 
537
 
586
    var activesData
-
 
587
    var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
-
 
588
 
-
 
589
    if (actives && actives.length) {
-
 
590
      activesData = actives.data('bs.collapse')
-
 
591
      if (activesData && activesData.transitioning) return
-
 
592
    }
-
 
593
 
-
 
594
    var startEvent = $.Event('show.bs.collapse')
538
    var startEvent = $.Event('show.bs.collapse')
595
    this.$element.trigger(startEvent)
539
    this.$element.trigger(startEvent)
596
    if (startEvent.isDefaultPrevented()) return
540
    if (startEvent.isDefaultPrevented()) return
597
 
541
 
-
 
542
    var actives = this.$parent && this.$parent.find('> .panel > .in')
-
 
543
 
598
    if (actives && actives.length) {
544
    if (actives && actives.length) {
-
 
545
      var hasData = actives.data('bs.collapse')
-
 
546
      if (hasData && hasData.transitioning) return
599
      Plugin.call(actives, 'hide')
547
      actives.collapse('hide')
600
      activesData || actives.data('bs.collapse', null)
548
      hasData || actives.data('bs.collapse', null)
601
    }
549
    }
602
 
550
 
603
    var dimension = this.dimension()
551
    var dimension = this.dimension()
604
 
552
 
605
    this.$element
553
    this.$element
606
      .removeClass('collapse')
554
      .removeClass('collapse')
607
      .addClass('collapsing')[dimension](0)
555
      .addClass('collapsing')
608
      .attr('aria-expanded', true)
-
 
609
 
-
 
610
    this.$trigger
-
 
611
      .removeClass('collapsed')
556
      [dimension](0)
612
      .attr('aria-expanded', true)
-
 
613
 
557
 
614
    this.transitioning = 1
558
    this.transitioning = 1
615
 
559
 
616
    var complete = function () {
560
    var complete = function () {
617
      this.$element
561
      this.$element
618
        .removeClass('collapsing')
562
        .removeClass('collapsing')
619
        .addClass('collapse in')[dimension]('')
563
        .addClass('in')
-
 
564
        [dimension]('auto')
620
      this.transitioning = 0
565
      this.transitioning = 0
621
      this.$element
-
 
622
        .trigger('shown.bs.collapse')
566
      this.$element.trigger('shown.bs.collapse')
623
    }
567
    }
624
 
568
 
625
    if (!$.support.transition) return complete.call(this)
569
    if (!$.support.transition) return complete.call(this)
626
 
570
 
627
    var scrollSize = $.camelCase(['scroll', dimension].join('-'))
571
    var scrollSize = $.camelCase(['scroll', dimension].join('-'))
628
 
572
 
629
    this.$element
573
    this.$element
630
      .one('bsTransitionEnd', $.proxy(complete, this))
574
      .one($.support.transition.end, $.proxy(complete, this))
-
 
575
      .emulateTransitionEnd(350)
631
      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
576
      [dimension](this.$element[0][scrollSize])
632
  }
577
  }
633
 
578
 
634
  Collapse.prototype.hide = function () {
579
  Collapse.prototype.hide = function () {
635
    if (this.transitioning || !this.$element.hasClass('in')) return
580
    if (this.transitioning || !this.$element.hasClass('in')) return
636
 
581
 
Line 638... Line 583...
638
    this.$element.trigger(startEvent)
583
    this.$element.trigger(startEvent)
639
    if (startEvent.isDefaultPrevented()) return
584
    if (startEvent.isDefaultPrevented()) return
640
 
585
 
641
    var dimension = this.dimension()
586
    var dimension = this.dimension()
642
 
587
 
-
 
588
    this.$element
643
    this.$element[dimension](this.$element[dimension]())[0].offsetHeight
589
      [dimension](this.$element[dimension]())
-
 
590
      [0].offsetHeight
644
 
591
 
645
    this.$element
592
    this.$element
646
      .addClass('collapsing')
593
      .addClass('collapsing')
647
      .removeClass('collapse in')
594
      .removeClass('collapse')
648
      .attr('aria-expanded', false)
-
 
649
 
-
 
650
    this.$trigger
-
 
651
      .addClass('collapsed')
595
      .removeClass('in')
652
      .attr('aria-expanded', false)
-
 
653
 
596
 
654
    this.transitioning = 1
597
    this.transitioning = 1
655
 
598
 
656
    var complete = function () {
599
    var complete = function () {
657
      this.transitioning = 0
600
      this.transitioning = 0
658
      this.$element
601
      this.$element
-
 
602
        .trigger('hidden.bs.collapse')
659
        .removeClass('collapsing')
603
        .removeClass('collapsing')
660
        .addClass('collapse')
604
        .addClass('collapse')
661
        .trigger('hidden.bs.collapse')
-
 
662
    }
605
    }
663
 
606
 
664
    if (!$.support.transition) return complete.call(this)
607
    if (!$.support.transition) return complete.call(this)
665
 
608
 
666
    this.$element
609
    this.$element
667
      [dimension](0)
610
      [dimension](0)
668
      .one('bsTransitionEnd', $.proxy(complete, this))
611
      .one($.support.transition.end, $.proxy(complete, this))
669
      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
612
      .emulateTransitionEnd(350)
670
  }
613
  }
671
 
614
 
672
  Collapse.prototype.toggle = function () {
615
  Collapse.prototype.toggle = function () {
673
    this[this.$element.hasClass('in') ? 'hide' : 'show']()
616
    this[this.$element.hasClass('in') ? 'hide' : 'show']()
674
  }
617
  }
675
 
618
 
676
  Collapse.prototype.getParent = function () {
-
 
677
    return $(this.options.parent)
-
 
678
      .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
-
 
679
      .each($.proxy(function (i, element) {
-
 
680
        var $element = $(element)
-
 
681
        this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
-
 
682
      }, this))
-
 
683
      .end()
-
 
684
  }
-
 
685
 
-
 
686
  Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
-
 
687
    var isOpen = $element.hasClass('in')
-
 
688
 
-
 
689
    $element.attr('aria-expanded', isOpen)
-
 
690
    $trigger
-
 
691
      .toggleClass('collapsed', !isOpen)
-
 
692
      .attr('aria-expanded', isOpen)
-
 
693
  }
-
 
694
 
-
 
695
  function getTargetFromTrigger($trigger) {
-
 
696
    var href
-
 
697
    var target = $trigger.attr('data-target')
-
 
698
      || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
-
 
699
 
-
 
700
    return $(target)
-
 
701
  }
-
 
702
 
-
 
703
 
619
 
704
  // COLLAPSE PLUGIN DEFINITION
620
  // COLLAPSE PLUGIN DEFINITION
705
  // ==========================
621
  // ==========================
706
 
622
 
-
 
623
  var old = $.fn.collapse
-
 
624
 
707
  function Plugin(option) {
625
  $.fn.collapse = function (option) {
708
    return this.each(function () {
626
    return this.each(function () {
709
      var $this   = $(this)
627
      var $this   = $(this)
710
      var data    = $this.data('bs.collapse')
628
      var data    = $this.data('bs.collapse')
711
      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
629
      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
712
 
630
 
713
      if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
-
 
714
      if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
631
      if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
715
      if (typeof option == 'string') data[option]()
632
      if (typeof option == 'string') data[option]()
716
    })
633
    })
717
  }
634
  }
718
 
635
 
719
  var old = $.fn.collapse
-
 
720
 
-
 
721
  $.fn.collapse             = Plugin
-
 
722
  $.fn.collapse.Constructor = Collapse
636
  $.fn.collapse.Constructor = Collapse
723
 
637
 
724
 
638
 
725
  // COLLAPSE NO CONFLICT
639
  // COLLAPSE NO CONFLICT
726
  // ====================
640
  // ====================
Line 732... Line 646...
732
 
646
 
733
 
647
 
734
  // COLLAPSE DATA-API
648
  // COLLAPSE DATA-API
735
  // =================
649
  // =================
736
 
650
 
737
  $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
651
  $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
738
    var $this   = $(this)
652
    var $this   = $(this), href
739
 
-
 
740
    if (!$this.attr('data-target')) e.preventDefault()
653
    var target  = $this.attr('data-target')
741
 
-
 
-
 
654
        || e.preventDefault()
-
 
655
        || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
742
    var $target = getTargetFromTrigger($this)
656
    var $target = $(target)
743
    var data    = $target.data('bs.collapse')
657
    var data    = $target.data('bs.collapse')
744
    var option  = data ? 'toggle' : $this.data()
658
    var option  = data ? 'toggle' : $this.data()
-
 
659
    var parent  = $this.attr('data-parent')
-
 
660
    var $parent = parent && $(parent)
-
 
661
 
-
 
662
    if (!data || !data.transitioning) {
-
 
663
      if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
-
 
664
      $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
-
 
665
    }
745
 
666
 
746
    Plugin.call($target, option)
667
    $target.collapse(option)
747
  })
668
  })
748
 
669
 
749
}(jQuery);
670
}(window.jQuery);
750
 
671
 
751
/* ========================================================================
672
/* ========================================================================
752
 * Bootstrap: dropdown.js v3.3.7
673
 * Bootstrap: dropdown.js v3.0.0
753
 * http://getbootstrap.com/javascript/#dropdowns
674
 * http://twbs.github.com/bootstrap/javascript.html#dropdowns
754
 * ========================================================================
675
 * ========================================================================
755
 * Copyright 2011-2016 Twitter, Inc.
676
 * Copyright 2012 Twitter, Inc.
-
 
677
 *
756
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
678
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
679
 * you may not use this file except in compliance with the License.
-
 
680
 * You may obtain a copy of the License at
-
 
681
 *
-
 
682
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
683
 *
-
 
684
 * Unless required by applicable law or agreed to in writing, software
-
 
685
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
686
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
687
 * See the License for the specific language governing permissions and
-
 
688
 * limitations under the License.
757
 * ======================================================================== */
689
 * ======================================================================== */
758
 
690
 
759
 
691
 
760
+function ($) {
692
+function ($) { "use strict";
761
  'use strict';
-
 
762
 
693
 
763
  // DROPDOWN CLASS DEFINITION
694
  // DROPDOWN CLASS DEFINITION
764
  // =========================
695
  // =========================
765
 
696
 
766
  var backdrop = '.dropdown-backdrop'
697
  var backdrop = '.dropdown-backdrop'
767
  var toggle   = '[data-toggle="dropdown"]'
698
  var toggle   = '[data-toggle=dropdown]'
768
  var Dropdown = function (element) {
699
  var Dropdown = function (element) {
769
    $(element).on('click.bs.dropdown', this.toggle)
700
    var $el = $(element).on('click.bs.dropdown', this.toggle)
770
  }
-
 
771
 
-
 
772
  Dropdown.VERSION = '3.3.7'
-
 
773
 
-
 
774
  function getParent($this) {
-
 
775
    var selector = $this.attr('data-target')
-
 
776
 
-
 
777
    if (!selector) {
-
 
778
      selector = $this.attr('href')
-
 
779
      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
-
 
780
    }
-
 
781
 
-
 
782
    var $parent = selector && $(selector)
-
 
783
 
-
 
784
    return $parent && $parent.length ? $parent : $this.parent()
-
 
785
  }
-
 
786
 
-
 
787
  function clearMenus(e) {
-
 
788
    if (e && e.which === 3) return
-
 
789
    $(backdrop).remove()
-
 
790
    $(toggle).each(function () {
-
 
791
      var $this         = $(this)
-
 
792
      var $parent       = getParent($this)
-
 
793
      var relatedTarget = { relatedTarget: this }
-
 
794
 
-
 
795
      if (!$parent.hasClass('open')) return
-
 
796
 
-
 
797
      if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
-
 
798
 
-
 
799
      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
-
 
800
 
-
 
801
      if (e.isDefaultPrevented()) return
-
 
802
 
-
 
803
      $this.attr('aria-expanded', 'false')
-
 
804
      $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
-
 
805
    })
-
 
806
  }
701
  }
807
 
702
 
808
  Dropdown.prototype.toggle = function (e) {
703
  Dropdown.prototype.toggle = function (e) {
809
    var $this = $(this)
704
    var $this = $(this)
810
 
705
 
Line 815... Line 710...
815
 
710
 
816
    clearMenus()
711
    clearMenus()
817
 
712
 
818
    if (!isActive) {
713
    if (!isActive) {
819
      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
714
      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
820
        // if mobile we use a backdrop because click events don't delegate
715
        // if mobile we we use a backdrop because click events don't delegate
821
        $(document.createElement('div'))
-
 
822
          .addClass('dropdown-backdrop')
716
        $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
823
          .insertAfter($(this))
-
 
824
          .on('click', clearMenus)
-
 
825
      }
717
      }
826
 
718
 
827
      var relatedTarget = { relatedTarget: this }
-
 
828
      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
719
      $parent.trigger(e = $.Event('show.bs.dropdown'))
829
 
720
 
830
      if (e.isDefaultPrevented()) return
721
      if (e.isDefaultPrevented()) return
831
 
722
 
832
      $this
-
 
833
        .trigger('focus')
-
 
834
        .attr('aria-expanded', 'true')
-
 
835
 
-
 
836
      $parent
723
      $parent
837
        .toggleClass('open')
724
        .toggleClass('open')
838
        .trigger($.Event('shown.bs.dropdown', relatedTarget))
725
        .trigger('shown.bs.dropdown')
-
 
726
 
-
 
727
      $this.focus()
839
    }
728
    }
840
 
729
 
841
    return false
730
    return false
842
  }
731
  }
843
 
732
 
844
  Dropdown.prototype.keydown = function (e) {
733
  Dropdown.prototype.keydown = function (e) {
845
    if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
734
    if (!/(38|40|27)/.test(e.keyCode)) return
846
 
735
 
847
    var $this = $(this)
736
    var $this = $(this)
848
 
737
 
849
    e.preventDefault()
738
    e.preventDefault()
850
    e.stopPropagation()
739
    e.stopPropagation()
Line 852... Line 741...
852
    if ($this.is('.disabled, :disabled')) return
741
    if ($this.is('.disabled, :disabled')) return
853
 
742
 
854
    var $parent  = getParent($this)
743
    var $parent  = getParent($this)
855
    var isActive = $parent.hasClass('open')
744
    var isActive = $parent.hasClass('open')
856
 
745
 
857
    if (!isActive && e.which != 27 || isActive && e.which == 27) {
746
    if (!isActive || (isActive && e.keyCode == 27)) {
858
      if (e.which == 27) $parent.find(toggle).trigger('focus')
747
      if (e.which == 27) $parent.find(toggle).focus()
859
      return $this.trigger('click')
748
      return $this.click()
860
    }
749
    }
861
 
750
 
862
    var desc = ' li:not(.disabled):visible a'
751
    var $items = $('[role=menu] li:not(.divider):visible a', $parent)
863
    var $items = $parent.find('.dropdown-menu' + desc)
-
 
864
 
752
 
865
    if (!$items.length) return
753
    if (!$items.length) return
866
 
754
 
867
    var index = $items.index(e.target)
755
    var index = $items.index($items.filter(':focus'))
-
 
756
 
-
 
757
    if (e.keyCode == 38 && index > 0)                 index--                        // up
-
 
758
    if (e.keyCode == 40 && index < $items.length - 1) index++                        // down
-
 
759
    if (!~index)                                      index=0
-
 
760
 
-
 
761
    $items.eq(index).focus()
-
 
762
  }
-
 
763
 
-
 
764
  function clearMenus() {
-
 
765
    $(backdrop).remove()
-
 
766
    $(toggle).each(function (e) {
-
 
767
      var $parent = getParent($(this))
-
 
768
      if (!$parent.hasClass('open')) return
-
 
769
      $parent.trigger(e = $.Event('hide.bs.dropdown'))
-
 
770
      if (e.isDefaultPrevented()) return
-
 
771
      $parent.removeClass('open').trigger('hidden.bs.dropdown')
-
 
772
    })
-
 
773
  }
-
 
774
 
-
 
775
  function getParent($this) {
-
 
776
    var selector = $this.attr('data-target')
-
 
777
 
-
 
778
    if (!selector) {
-
 
779
      selector = $this.attr('href')
-
 
780
      selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
-
 
781
    }
868
 
782
 
869
    if (e.which == 38 && index > 0)                 index--         // up
-
 
870
    if (e.which == 40 && index < $items.length - 1) index++         // down
-
 
871
    if (!~index)                                    index = 0
783
    var $parent = selector && $(selector)
872
 
784
 
873
    $items.eq(index).trigger('focus')
785
    return $parent && $parent.length ? $parent : $this.parent()
874
  }
786
  }
875
 
787
 
876
 
788
 
877
  // DROPDOWN PLUGIN DEFINITION
789
  // DROPDOWN PLUGIN DEFINITION
878
  // ==========================
790
  // ==========================
879
 
791
 
-
 
792
  var old = $.fn.dropdown
-
 
793
 
880
  function Plugin(option) {
794
  $.fn.dropdown = function (option) {
881
    return this.each(function () {
795
    return this.each(function () {
882
      var $this = $(this)
796
      var $this = $(this)
883
      var data  = $this.data('bs.dropdown')
797
      var data  = $this.data('dropdown')
884
 
798
 
885
      if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
799
      if (!data) $this.data('dropdown', (data = new Dropdown(this)))
886
      if (typeof option == 'string') data[option].call($this)
800
      if (typeof option == 'string') data[option].call($this)
887
    })
801
    })
888
  }
802
  }
889
 
803
 
890
  var old = $.fn.dropdown
-
 
891
 
-
 
892
  $.fn.dropdown             = Plugin
-
 
893
  $.fn.dropdown.Constructor = Dropdown
804
  $.fn.dropdown.Constructor = Dropdown
894
 
805
 
895
 
806
 
896
  // DROPDOWN NO CONFLICT
807
  // DROPDOWN NO CONFLICT
897
  // ====================
808
  // ====================
Line 906... Line 817...
906
  // ===================================
817
  // ===================================
907
 
818
 
908
  $(document)
819
  $(document)
909
    .on('click.bs.dropdown.data-api', clearMenus)
820
    .on('click.bs.dropdown.data-api', clearMenus)
910
    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
821
    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
911
    .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
822
    .on('click.bs.dropdown.data-api'  , toggle, Dropdown.prototype.toggle)
912
    .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
-
 
913
    .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
823
    .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
914
 
824
 
915
}(jQuery);
825
}(window.jQuery);
916
 
826
 
917
/* ========================================================================
827
/* ========================================================================
918
 * Bootstrap: modal.js v3.3.7
828
 * Bootstrap: modal.js v3.0.0
919
 * http://getbootstrap.com/javascript/#modals
829
 * http://twbs.github.com/bootstrap/javascript.html#modals
920
 * ========================================================================
830
 * ========================================================================
921
 * Copyright 2011-2016 Twitter, Inc.
831
 * Copyright 2012 Twitter, Inc.
-
 
832
 *
922
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
833
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
834
 * you may not use this file except in compliance with the License.
-
 
835
 * You may obtain a copy of the License at
-
 
836
 *
-
 
837
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
838
 *
-
 
839
 * Unless required by applicable law or agreed to in writing, software
-
 
840
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
841
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
842
 * See the License for the specific language governing permissions and
-
 
843
 * limitations under the License.
923
 * ======================================================================== */
844
 * ======================================================================== */
924
 
845
 
925
 
846
 
926
+function ($) {
847
+function ($) { "use strict";
927
  'use strict';
-
 
928
 
848
 
929
  // MODAL CLASS DEFINITION
849
  // MODAL CLASS DEFINITION
930
  // ======================
850
  // ======================
931
 
851
 
932
  var Modal = function (element, options) {
852
  var Modal = function (element, options) {
933
    this.options             = options
853
    this.options   = options
934
    this.$body               = $(document.body)
-
 
935
    this.$element            = $(element)
854
    this.$element  = $(element)
936
    this.$dialog             = this.$element.find('.modal-dialog')
-
 
937
    this.$backdrop           = null
855
    this.$backdrop =
938
    this.isShown             = null
856
    this.isShown   = null
939
    this.originalBodyPad     = null
-
 
940
    this.scrollbarWidth      = 0
-
 
941
    this.ignoreBackdropClick = false
-
 
942
 
857
 
943
    if (this.options.remote) {
-
 
944
      this.$element
-
 
945
        .find('.modal-content')
-
 
946
        .load(this.options.remote, $.proxy(function () {
858
    if (this.options.remote) this.$element.load(this.options.remote)
947
          this.$element.trigger('loaded.bs.modal')
-
 
948
        }, this))
-
 
949
    }
-
 
950
  }
859
  }
951
 
860
 
952
  Modal.VERSION  = '3.3.7'
-
 
953
 
-
 
954
  Modal.TRANSITION_DURATION = 300
-
 
955
  Modal.BACKDROP_TRANSITION_DURATION = 150
-
 
956
 
-
 
957
  Modal.DEFAULTS = {
861
  Modal.DEFAULTS = {
958
    backdrop: true,
862
      backdrop: true
959
    keyboard: true,
863
    , keyboard: true
960
    show: true
864
    , show: true
961
  }
865
  }
962
 
866
 
963
  Modal.prototype.toggle = function (_relatedTarget) {
867
  Modal.prototype.toggle = function (_relatedTarget) {
964
    return this.isShown ? this.hide() : this.show(_relatedTarget)
868
    return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
965
  }
869
  }
966
 
870
 
967
  Modal.prototype.show = function (_relatedTarget) {
871
  Modal.prototype.show = function (_relatedTarget) {
968
    var that = this
872
    var that = this
969
    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
873
    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
Line 972... Line 876...
972
 
876
 
973
    if (this.isShown || e.isDefaultPrevented()) return
877
    if (this.isShown || e.isDefaultPrevented()) return
974
 
878
 
975
    this.isShown = true
879
    this.isShown = true
976
 
880
 
977
    this.checkScrollbar()
-
 
978
    this.setScrollbar()
-
 
979
    this.$body.addClass('modal-open')
-
 
980
 
-
 
981
    this.escape()
881
    this.escape()
982
    this.resize()
-
 
983
 
-
 
984
    this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
-
 
985
 
882
 
986
    this.$dialog.on('mousedown.dismiss.bs.modal', function () {
-
 
987
      that.$element.one('mouseup.dismiss.bs.modal', function (e) {
883
    this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
988
        if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
-
 
989
      })
-
 
990
    })
-
 
991
 
884
 
992
    this.backdrop(function () {
885
    this.backdrop(function () {
993
      var transition = $.support.transition && that.$element.hasClass('fade')
886
      var transition = $.support.transition && that.$element.hasClass('fade')
994
 
887
 
995
      if (!that.$element.parent().length) {
888
      if (!that.$element.parent().length) {
996
        that.$element.appendTo(that.$body) // don't move modals dom position
889
        that.$element.appendTo(document.body) // don't move modals dom position
997
      }
890
      }
998
 
891
 
999
      that.$element
892
      that.$element.show()
1000
        .show()
-
 
1001
        .scrollTop(0)
-
 
1002
 
-
 
1003
      that.adjustDialog()
-
 
1004
 
893
 
1005
      if (transition) {
894
      if (transition) {
1006
        that.$element[0].offsetWidth // force reflow
895
        that.$element[0].offsetWidth // force reflow
1007
      }
896
      }
1008
 
897
 
-
 
898
      that.$element
1009
      that.$element.addClass('in')
899
        .addClass('in')
-
 
900
        .attr('aria-hidden', false)
1010
 
901
 
1011
      that.enforceFocus()
902
      that.enforceFocus()
1012
 
903
 
1013
      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
904
      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
1014
 
905
 
1015
      transition ?
906
      transition ?
1016
        that.$dialog // wait for modal to slide in
907
        that.$element.find('.modal-dialog') // wait for modal to slide in
1017
          .one('bsTransitionEnd', function () {
908
          .one($.support.transition.end, function () {
1018
            that.$element.trigger('focus').trigger(e)
909
            that.$element.focus().trigger(e)
1019
          })
910
          })
1020
          .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
911
          .emulateTransitionEnd(300) :
1021
        that.$element.trigger('focus').trigger(e)
912
        that.$element.focus().trigger(e)
1022
    })
913
    })
1023
  }
914
  }
1024
 
915
 
1025
  Modal.prototype.hide = function (e) {
916
  Modal.prototype.hide = function (e) {
1026
    if (e) e.preventDefault()
917
    if (e) e.preventDefault()
Line 1032... Line 923...
1032
    if (!this.isShown || e.isDefaultPrevented()) return
923
    if (!this.isShown || e.isDefaultPrevented()) return
1033
 
924
 
1034
    this.isShown = false
925
    this.isShown = false
1035
 
926
 
1036
    this.escape()
927
    this.escape()
1037
    this.resize()
-
 
1038
 
928
 
1039
    $(document).off('focusin.bs.modal')
929
    $(document).off('focusin.bs.modal')
1040
 
930
 
1041
    this.$element
931
    this.$element
1042
      .removeClass('in')
932
      .removeClass('in')
1043
      .off('click.dismiss.bs.modal')
933
      .attr('aria-hidden', true)
1044
      .off('mouseup.dismiss.bs.modal')
934
      .off('click.dismiss.modal')
1045
 
-
 
1046
    this.$dialog.off('mousedown.dismiss.bs.modal')
-
 
1047
 
935
 
1048
    $.support.transition && this.$element.hasClass('fade') ?
936
    $.support.transition && this.$element.hasClass('fade') ?
1049
      this.$element
937
      this.$element
1050
        .one('bsTransitionEnd', $.proxy(this.hideModal, this))
938
        .one($.support.transition.end, $.proxy(this.hideModal, this))
1051
        .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
939
        .emulateTransitionEnd(300) :
1052
      this.hideModal()
940
      this.hideModal()
1053
  }
941
  }
1054
 
942
 
1055
  Modal.prototype.enforceFocus = function () {
943
  Modal.prototype.enforceFocus = function () {
1056
    $(document)
944
    $(document)
1057
      .off('focusin.bs.modal') // guard against infinite focus loop
945
      .off('focusin.bs.modal') // guard against infinite focus loop
1058
      .on('focusin.bs.modal', $.proxy(function (e) {
946
      .on('focusin.bs.modal', $.proxy(function (e) {
1059
        if (document !== e.target &&
-
 
1060
            this.$element[0] !== e.target &&
-
 
1061
            !this.$element.has(e.target).length) {
947
        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
1062
          this.$element.trigger('focus')
948
          this.$element.focus()
1063
        }
949
        }
1064
      }, this))
950
      }, this))
1065
  }
951
  }
1066
 
952
 
1067
  Modal.prototype.escape = function () {
953
  Modal.prototype.escape = function () {
1068
    if (this.isShown && this.options.keyboard) {
954
    if (this.isShown && this.options.keyboard) {
1069
      this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
955
      this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
1070
        e.which == 27 && this.hide()
956
        e.which == 27 && this.hide()
1071
      }, this))
957
      }, this))
1072
    } else if (!this.isShown) {
958
    } else if (!this.isShown) {
1073
      this.$element.off('keydown.dismiss.bs.modal')
959
      this.$element.off('keyup.dismiss.bs.modal')
1074
    }
-
 
1075
  }
-
 
1076
 
-
 
1077
  Modal.prototype.resize = function () {
-
 
1078
    if (this.isShown) {
-
 
1079
      $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
-
 
1080
    } else {
-
 
1081
      $(window).off('resize.bs.modal')
-
 
1082
    }
960
    }
1083
  }
961
  }
1084
 
962
 
1085
  Modal.prototype.hideModal = function () {
963
  Modal.prototype.hideModal = function () {
1086
    var that = this
964
    var that = this
1087
    this.$element.hide()
965
    this.$element.hide()
1088
    this.backdrop(function () {
966
    this.backdrop(function () {
1089
      that.$body.removeClass('modal-open')
-
 
1090
      that.resetAdjustments()
-
 
1091
      that.resetScrollbar()
967
      that.removeBackdrop()
1092
      that.$element.trigger('hidden.bs.modal')
968
      that.$element.trigger('hidden.bs.modal')
1093
    })
969
    })
1094
  }
970
  }
1095
 
971
 
1096
  Modal.prototype.removeBackdrop = function () {
972
  Modal.prototype.removeBackdrop = function () {
1097
    this.$backdrop && this.$backdrop.remove()
973
    this.$backdrop && this.$backdrop.remove()
1098
    this.$backdrop = null
974
    this.$backdrop = null
1099
  }
975
  }
1100
 
976
 
1101
  Modal.prototype.backdrop = function (callback) {
977
  Modal.prototype.backdrop = function (callback) {
1102
    var that = this
978
    var that    = this
1103
    var animate = this.$element.hasClass('fade') ? 'fade' : ''
979
    var animate = this.$element.hasClass('fade') ? 'fade' : ''
1104
 
980
 
1105
    if (this.isShown && this.options.backdrop) {
981
    if (this.isShown && this.options.backdrop) {
1106
      var doAnimate = $.support.transition && animate
982
      var doAnimate = $.support.transition && animate
1107
 
983
 
1108
      this.$backdrop = $(document.createElement('div'))
-
 
1109
        .addClass('modal-backdrop ' + animate)
984
      this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
1110
        .appendTo(this.$body)
985
        .appendTo(document.body)
1111
 
986
 
1112
      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
987
      this.$element.on('click.dismiss.modal', $.proxy(function (e) {
1113
        if (this.ignoreBackdropClick) {
-
 
1114
          this.ignoreBackdropClick = false
-
 
1115
          return
-
 
1116
        }
-
 
1117
        if (e.target !== e.currentTarget) return
988
        if (e.target !== e.currentTarget) return
1118
        this.options.backdrop == 'static'
989
        this.options.backdrop == 'static'
1119
          ? this.$element[0].focus()
990
          ? this.$element[0].focus.call(this.$element[0])
1120
          : this.hide()
991
          : this.hide.call(this)
1121
      }, this))
992
      }, this))
1122
 
993
 
1123
      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
994
      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
1124
 
995
 
1125
      this.$backdrop.addClass('in')
996
      this.$backdrop.addClass('in')
1126
 
997
 
1127
      if (!callback) return
998
      if (!callback) return
1128
 
999
 
1129
      doAnimate ?
1000
      doAnimate ?
1130
        this.$backdrop
1001
        this.$backdrop
1131
          .one('bsTransitionEnd', callback)
1002
          .one($.support.transition.end, callback)
1132
          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1003
          .emulateTransitionEnd(150) :
1133
        callback()
1004
        callback()
1134
 
1005
 
1135
    } else if (!this.isShown && this.$backdrop) {
1006
    } else if (!this.isShown && this.$backdrop) {
1136
      this.$backdrop.removeClass('in')
1007
      this.$backdrop.removeClass('in')
1137
 
1008
 
1138
      var callbackRemove = function () {
-
 
1139
        that.removeBackdrop()
-
 
1140
        callback && callback()
-
 
1141
      }
-
 
1142
      $.support.transition && this.$element.hasClass('fade') ?
1009
      $.support.transition && this.$element.hasClass('fade')?
1143
        this.$backdrop
1010
        this.$backdrop
1144
          .one('bsTransitionEnd', callbackRemove)
1011
          .one($.support.transition.end, callback)
1145
          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
1012
          .emulateTransitionEnd(150) :
1146
        callbackRemove()
1013
        callback()
1147
 
1014
 
1148
    } else if (callback) {
1015
    } else if (callback) {
1149
      callback()
1016
      callback()
1150
    }
1017
    }
1151
  }
1018
  }
1152
 
1019
 
1153
  // these following methods are used to handle overflowing modals
-
 
1154
 
-
 
1155
  Modal.prototype.handleUpdate = function () {
-
 
1156
    this.adjustDialog()
-
 
1157
  }
-
 
1158
 
-
 
1159
  Modal.prototype.adjustDialog = function () {
-
 
1160
    var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
-
 
1161
 
-
 
1162
    this.$element.css({
-
 
1163
      paddingLeft:  !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
-
 
1164
      paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
-
 
1165
    })
-
 
1166
  }
-
 
1167
 
-
 
1168
  Modal.prototype.resetAdjustments = function () {
-
 
1169
    this.$element.css({
-
 
1170
      paddingLeft: '',
-
 
1171
      paddingRight: ''
-
 
1172
    })
-
 
1173
  }
-
 
1174
 
-
 
1175
  Modal.prototype.checkScrollbar = function () {
-
 
1176
    var fullWindowWidth = window.innerWidth
-
 
1177
    if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
-
 
1178
      var documentElementRect = document.documentElement.getBoundingClientRect()
-
 
1179
      fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
-
 
1180
    }
-
 
1181
    this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
-
 
1182
    this.scrollbarWidth = this.measureScrollbar()
-
 
1183
  }
-
 
1184
 
-
 
1185
  Modal.prototype.setScrollbar = function () {
-
 
1186
    var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
-
 
1187
    this.originalBodyPad = document.body.style.paddingRight || ''
-
 
1188
    if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
-
 
1189
  }
-
 
1190
 
-
 
1191
  Modal.prototype.resetScrollbar = function () {
-
 
1192
    this.$body.css('padding-right', this.originalBodyPad)
-
 
1193
  }
-
 
1194
 
-
 
1195
  Modal.prototype.measureScrollbar = function () { // thx walsh
-
 
1196
    var scrollDiv = document.createElement('div')
-
 
1197
    scrollDiv.className = 'modal-scrollbar-measure'
-
 
1198
    this.$body.append(scrollDiv)
-
 
1199
    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
-
 
1200
    this.$body[0].removeChild(scrollDiv)
-
 
1201
    return scrollbarWidth
-
 
1202
  }
-
 
1203
 
-
 
1204
 
1020
 
1205
  // MODAL PLUGIN DEFINITION
1021
  // MODAL PLUGIN DEFINITION
1206
  // =======================
1022
  // =======================
1207
 
1023
 
-
 
1024
  var old = $.fn.modal
-
 
1025
 
1208
  function Plugin(option, _relatedTarget) {
1026
  $.fn.modal = function (option, _relatedTarget) {
1209
    return this.each(function () {
1027
    return this.each(function () {
1210
      var $this   = $(this)
1028
      var $this   = $(this)
1211
      var data    = $this.data('bs.modal')
1029
      var data    = $this.data('bs.modal')
1212
      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
1030
      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
1213
 
1031
 
Line 1215... Line 1033...
1215
      if (typeof option == 'string') data[option](_relatedTarget)
1033
      if (typeof option == 'string') data[option](_relatedTarget)
1216
      else if (options.show) data.show(_relatedTarget)
1034
      else if (options.show) data.show(_relatedTarget)
1217
    })
1035
    })
1218
  }
1036
  }
1219
 
1037
 
1220
  var old = $.fn.modal
-
 
1221
 
-
 
1222
  $.fn.modal             = Plugin
-
 
1223
  $.fn.modal.Constructor = Modal
1038
  $.fn.modal.Constructor = Modal
1224
 
1039
 
1225
 
1040
 
1226
  // MODAL NO CONFLICT
1041
  // MODAL NO CONFLICT
1227
  // =================
1042
  // =================
Line 1236... Line 1051...
1236
  // ==============
1051
  // ==============
1237
 
1052
 
1238
  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
1053
  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
1239
    var $this   = $(this)
1054
    var $this   = $(this)
1240
    var href    = $this.attr('href')
1055
    var href    = $this.attr('href')
1241
    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
1056
    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
1242
    var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1057
    var option  = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
1243
 
1058
 
1244
    if ($this.is('a')) e.preventDefault()
1059
    e.preventDefault()
1245
 
1060
 
-
 
1061
    $target
1246
    $target.one('show.bs.modal', function (showEvent) {
1062
      .modal(option, this)
1247
      if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
-
 
1248
      $target.one('hidden.bs.modal', function () {
1063
      .one('hide', function () {
1249
        $this.is(':visible') && $this.trigger('focus')
1064
        $this.is(':visible') && $this.focus()
1250
      })
1065
      })
1251
    })
-
 
1252
    Plugin.call($target, option, this)
-
 
1253
  })
1066
  })
1254
 
1067
 
-
 
1068
  $(document)
-
 
1069
    .on('show.bs.modal',  '.modal', function () { $(document.body).addClass('modal-open') })
-
 
1070
    .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
-
 
1071
 
1255
}(jQuery);
1072
}(window.jQuery);
1256
 
1073
 
1257
/* ========================================================================
1074
/* ========================================================================
1258
 * Bootstrap: tooltip.js v3.3.7
1075
 * Bootstrap: tooltip.js v3.0.0
1259
 * http://getbootstrap.com/javascript/#tooltip
1076
 * http://twbs.github.com/bootstrap/javascript.html#tooltip
1260
 * Inspired by the original jQuery.tipsy by Jason Frame
1077
 * Inspired by the original jQuery.tipsy by Jason Frame
1261
 * ========================================================================
1078
 * ========================================================================
1262
 * Copyright 2011-2016 Twitter, Inc.
1079
 * Copyright 2012 Twitter, Inc.
-
 
1080
 *
1263
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1081
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
1082
 * you may not use this file except in compliance with the License.
-
 
1083
 * You may obtain a copy of the License at
-
 
1084
 *
-
 
1085
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
1086
 *
-
 
1087
 * Unless required by applicable law or agreed to in writing, software
-
 
1088
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
1089
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
1090
 * See the License for the specific language governing permissions and
-
 
1091
 * limitations under the License.
1264
 * ======================================================================== */
1092
 * ======================================================================== */
1265
 
1093
 
1266
 
1094
 
1267
+function ($) {
1095
+function ($) { "use strict";
1268
  'use strict';
-
 
1269
 
1096
 
1270
  // TOOLTIP PUBLIC CLASS DEFINITION
1097
  // TOOLTIP PUBLIC CLASS DEFINITION
1271
  // ===============================
1098
  // ===============================
1272
 
1099
 
1273
  var Tooltip = function (element, options) {
1100
  var Tooltip = function (element, options) {
1274
    this.type       = null
1101
    this.type       =
1275
    this.options    = null
1102
    this.options    =
1276
    this.enabled    = null
1103
    this.enabled    =
1277
    this.timeout    = null
1104
    this.timeout    =
1278
    this.hoverState = null
1105
    this.hoverState =
1279
    this.$element   = null
1106
    this.$element   = null
1280
    this.inState    = null
-
 
1281
 
1107
 
1282
    this.init('tooltip', element, options)
1108
    this.init('tooltip', element, options)
1283
  }
1109
  }
1284
 
1110
 
1285
  Tooltip.VERSION  = '3.3.7'
-
 
1286
 
-
 
1287
  Tooltip.TRANSITION_DURATION = 150
-
 
1288
 
-
 
1289
  Tooltip.DEFAULTS = {
1111
  Tooltip.DEFAULTS = {
1290
    animation: true,
1112
    animation: true
1291
    placement: 'top',
1113
  , placement: 'top'
1292
    selector: false,
1114
  , selector: false
1293
    template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
1115
  , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1294
    trigger: 'hover focus',
1116
  , trigger: 'hover focus'
1295
    title: '',
1117
  , title: ''
1296
    delay: 0,
1118
  , delay: 0
1297
    html: false,
1119
  , html: false
1298
    container: false,
1120
  , container: false
1299
    viewport: {
-
 
1300
      selector: 'body',
-
 
1301
      padding: 0
-
 
1302
    }
-
 
1303
  }
1121
  }
1304
 
1122
 
1305
  Tooltip.prototype.init = function (type, element, options) {
1123
  Tooltip.prototype.init = function (type, element, options) {
1306
    this.enabled   = true
1124
    this.enabled  = true
1307
    this.type      = type
1125
    this.type     = type
1308
    this.$element  = $(element)
1126
    this.$element = $(element)
1309
    this.options   = this.getOptions(options)
1127
    this.options  = this.getOptions(options)
1310
    this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
-
 
1311
    this.inState   = { click: false, hover: false, focus: false }
-
 
1312
 
-
 
1313
    if (this.$element[0] instanceof document.constructor && !this.options.selector) {
-
 
1314
      throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
-
 
1315
    }
-
 
1316
 
1128
 
1317
    var triggers = this.options.trigger.split(' ')
1129
    var triggers = this.options.trigger.split(' ')
1318
 
1130
 
1319
    for (var i = triggers.length; i--;) {
1131
    for (var i = triggers.length; i--;) {
1320
      var trigger = triggers[i]
1132
      var trigger = triggers[i]
1321
 
1133
 
1322
      if (trigger == 'click') {
1134
      if (trigger == 'click') {
1323
        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1135
        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1324
      } else if (trigger != 'manual') {
1136
      } else if (trigger != 'manual') {
1325
        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
1137
        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focus'
1326
        var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
1138
        var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
1327
 
1139
 
1328
        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1140
        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1329
        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1141
        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1330
      }
1142
      }
1331
    }
1143
    }
Line 1342... Line 1154...
1342
  Tooltip.prototype.getOptions = function (options) {
1154
  Tooltip.prototype.getOptions = function (options) {
1343
    options = $.extend({}, this.getDefaults(), this.$element.data(), options)
1155
    options = $.extend({}, this.getDefaults(), this.$element.data(), options)
1344
 
1156
 
1345
    if (options.delay && typeof options.delay == 'number') {
1157
    if (options.delay && typeof options.delay == 'number') {
1346
      options.delay = {
1158
      options.delay = {
1347
        show: options.delay,
1159
        show: options.delay
1348
        hide: options.delay
1160
      , hide: options.delay
1349
      }
1161
      }
1350
    }
1162
    }
1351
 
1163
 
1352
    return options
1164
    return options
1353
  }
1165
  }
Line 1363... Line 1175...
1363
    return options
1175
    return options
1364
  }
1176
  }
1365
 
1177
 
1366
  Tooltip.prototype.enter = function (obj) {
1178
  Tooltip.prototype.enter = function (obj) {
1367
    var self = obj instanceof this.constructor ?
1179
    var self = obj instanceof this.constructor ?
1368
      obj : $(obj.currentTarget).data('bs.' + this.type)
1180
      obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
1369
 
-
 
1370
    if (!self) {
-
 
1371
      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
-
 
1372
      $(obj.currentTarget).data('bs.' + this.type, self)
-
 
1373
    }
-
 
1374
 
-
 
1375
    if (obj instanceof $.Event) {
-
 
1376
      self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
-
 
1377
    }
-
 
1378
 
-
 
1379
    if (self.tip().hasClass('in') || self.hoverState == 'in') {
-
 
1380
      self.hoverState = 'in'
-
 
1381
      return
-
 
1382
    }
-
 
1383
 
1181
 
1384
    clearTimeout(self.timeout)
1182
    clearTimeout(self.timeout)
1385
 
1183
 
1386
    self.hoverState = 'in'
1184
    self.hoverState = 'in'
1387
 
1185
 
Line 1390... Line 1188...
1390
    self.timeout = setTimeout(function () {
1188
    self.timeout = setTimeout(function () {
1391
      if (self.hoverState == 'in') self.show()
1189
      if (self.hoverState == 'in') self.show()
1392
    }, self.options.delay.show)
1190
    }, self.options.delay.show)
1393
  }
1191
  }
1394
 
1192
 
1395
  Tooltip.prototype.isInStateTrue = function () {
-
 
1396
    for (var key in this.inState) {
-
 
1397
      if (this.inState[key]) return true
-
 
1398
    }
-
 
1399
 
-
 
1400
    return false
-
 
1401
  }
-
 
1402
 
-
 
1403
  Tooltip.prototype.leave = function (obj) {
1193
  Tooltip.prototype.leave = function (obj) {
1404
    var self = obj instanceof this.constructor ?
1194
    var self = obj instanceof this.constructor ?
1405
      obj : $(obj.currentTarget).data('bs.' + this.type)
1195
      obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
1406
 
-
 
1407
    if (!self) {
-
 
1408
      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
-
 
1409
      $(obj.currentTarget).data('bs.' + this.type, self)
-
 
1410
    }
-
 
1411
 
-
 
1412
    if (obj instanceof $.Event) {
-
 
1413
      self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
-
 
1414
    }
-
 
1415
 
-
 
1416
    if (self.isInStateTrue()) return
-
 
1417
 
1196
 
1418
    clearTimeout(self.timeout)
1197
    clearTimeout(self.timeout)
1419
 
1198
 
1420
    self.hoverState = 'out'
1199
    self.hoverState = 'out'
1421
 
1200
 
Line 1425... Line 1204...
1425
      if (self.hoverState == 'out') self.hide()
1204
      if (self.hoverState == 'out') self.hide()
1426
    }, self.options.delay.hide)
1205
    }, self.options.delay.hide)
1427
  }
1206
  }
1428
 
1207
 
1429
  Tooltip.prototype.show = function () {
1208
  Tooltip.prototype.show = function () {
1430
    var e = $.Event('show.bs.' + this.type)
1209
    var e = $.Event('show.bs.'+ this.type)
1431
 
1210
 
1432
    if (this.hasContent() && this.enabled) {
1211
    if (this.hasContent() && this.enabled) {
1433
      this.$element.trigger(e)
1212
      this.$element.trigger(e)
1434
 
1213
 
1435
      var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
-
 
1436
      if (e.isDefaultPrevented() || !inDom) return
1214
      if (e.isDefaultPrevented()) return
1437
      var that = this
-
 
1438
 
1215
 
1439
      var $tip = this.tip()
1216
      var $tip = this.tip()
1440
 
1217
 
1441
      var tipId = this.getUID(this.type)
-
 
1442
 
-
 
1443
      this.setContent()
1218
      this.setContent()
1444
      $tip.attr('id', tipId)
-
 
1445
      this.$element.attr('aria-describedby', tipId)
-
 
1446
 
1219
 
1447
      if (this.options.animation) $tip.addClass('fade')
1220
      if (this.options.animation) $tip.addClass('fade')
1448
 
1221
 
1449
      var placement = typeof this.options.placement == 'function' ?
1222
      var placement = typeof this.options.placement == 'function' ?
1450
        this.options.placement.call(this, $tip[0], this.$element[0]) :
1223
        this.options.placement.call(this, $tip[0], this.$element[0]) :
Line 1456... Line 1229...
1456
 
1229
 
1457
      $tip
1230
      $tip
1458
        .detach()
1231
        .detach()
1459
        .css({ top: 0, left: 0, display: 'block' })
1232
        .css({ top: 0, left: 0, display: 'block' })
1460
        .addClass(placement)
1233
        .addClass(placement)
1461
        .data('bs.' + this.type, this)
-
 
1462
 
1234
 
1463
      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1235
      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
1464
      this.$element.trigger('inserted.bs.' + this.type)
-
 
1465
 
1236
 
1466
      var pos          = this.getPosition()
1237
      var pos          = this.getPosition()
1467
      var actualWidth  = $tip[0].offsetWidth
1238
      var actualWidth  = $tip[0].offsetWidth
1468
      var actualHeight = $tip[0].offsetHeight
1239
      var actualHeight = $tip[0].offsetHeight
1469
 
1240
 
1470
      if (autoPlace) {
1241
      if (autoPlace) {
1471
        var orgPlacement = placement
-
 
1472
        var viewportDim = this.getPosition(this.$viewport)
1242
        var $parent = this.$element.parent()
1473
 
1243
 
-
 
1244
        var orgPlacement = placement
-
 
1245
        var docScroll    = document.documentElement.scrollTop || document.body.scrollTop
-
 
1246
        var parentWidth  = this.options.container == 'body' ? window.innerWidth  : $parent.outerWidth()
-
 
1247
        var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
-
 
1248
        var parentLeft   = this.options.container == 'body' ? 0 : $parent.offset().left
-
 
1249
 
1474
        placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top'    :
1250
        placement = placement == 'bottom' && pos.top   + pos.height  + actualHeight - docScroll > parentHeight  ? 'top'    :
1475
                    placement == 'top'    && pos.top    - actualHeight < viewportDim.top    ? 'bottom' :
1251
                    placement == 'top'    && pos.top   - docScroll   - actualHeight < 0                         ? 'bottom' :
1476
                    placement == 'right'  && pos.right  + actualWidth  > viewportDim.width  ? 'left'   :
1252
                    placement == 'right'  && pos.right + actualWidth > parentWidth                              ? 'left'   :
1477
                    placement == 'left'   && pos.left   - actualWidth  < viewportDim.left   ? 'right'  :
1253
                    placement == 'left'   && pos.left  - actualWidth < parentLeft                               ? 'right'  :
1478
                    placement
1254
                    placement
1479
 
1255
 
1480
        $tip
1256
        $tip
1481
          .removeClass(orgPlacement)
1257
          .removeClass(orgPlacement)
1482
          .addClass(placement)
1258
          .addClass(placement)
1483
      }
1259
      }
1484
 
1260
 
1485
      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1261
      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
1486
 
1262
 
1487
      this.applyPlacement(calculatedOffset, placement)
1263
      this.applyPlacement(calculatedOffset, placement)
1488
 
-
 
1489
      var complete = function () {
-
 
1490
        var prevHoverState = that.hoverState
-
 
1491
        that.$element.trigger('shown.bs.' + that.type)
1264
      this.$element.trigger('shown.bs.' + this.type)
1492
        that.hoverState = null
-
 
1493
 
-
 
1494
        if (prevHoverState == 'out') that.leave(that)
-
 
1495
      }
-
 
1496
 
-
 
1497
      $.support.transition && this.$tip.hasClass('fade') ?
-
 
1498
        $tip
-
 
1499
          .one('bsTransitionEnd', complete)
-
 
1500
          .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
-
 
1501
        complete()
-
 
1502
    }
1265
    }
1503
  }
1266
  }
1504
 
1267
 
1505
  Tooltip.prototype.applyPlacement = function (offset, placement) {
1268
  Tooltip.prototype.applyPlacement = function(offset, placement) {
-
 
1269
    var replace
1506
    var $tip   = this.tip()
1270
    var $tip   = this.tip()
1507
    var width  = $tip[0].offsetWidth
1271
    var width  = $tip[0].offsetWidth
1508
    var height = $tip[0].offsetHeight
1272
    var height = $tip[0].offsetHeight
1509
 
1273
 
1510
    // manually read margins because getBoundingClientRect includes difference
1274
    // manually read margins because getBoundingClientRect includes difference
Line 1513... Line 1277...
1513
 
1277
 
1514
    // we must check for NaN for ie 8/9
1278
    // we must check for NaN for ie 8/9
1515
    if (isNaN(marginTop))  marginTop  = 0
1279
    if (isNaN(marginTop))  marginTop  = 0
1516
    if (isNaN(marginLeft)) marginLeft = 0
1280
    if (isNaN(marginLeft)) marginLeft = 0
1517
 
1281
 
1518
    offset.top  += marginTop
1282
    offset.top  = offset.top  + marginTop
1519
    offset.left += marginLeft
1283
    offset.left = offset.left + marginLeft
1520
 
1284
 
1521
    // $.fn.offset doesn't round pixel values
-
 
1522
    // so we use setOffset directly with our own function B-0
-
 
1523
    $.offset.setOffset($tip[0], $.extend({
-
 
1524
      using: function (props) {
-
 
1525
        $tip.css({
-
 
1526
          top: Math.round(props.top),
-
 
1527
          left: Math.round(props.left)
-
 
1528
        })
-
 
1529
      }
1285
    $tip
1530
    }, offset), 0)
1286
      .offset(offset)
1531
 
-
 
1532
    $tip.addClass('in')
1287
      .addClass('in')
1533
 
1288
 
1534
    // check to see if placing tip in new offset caused the tip to resize itself
1289
    // check to see if placing tip in new offset caused the tip to resize itself
1535
    var actualWidth  = $tip[0].offsetWidth
1290
    var actualWidth  = $tip[0].offsetWidth
1536
    var actualHeight = $tip[0].offsetHeight
1291
    var actualHeight = $tip[0].offsetHeight
1537
 
1292
 
1538
    if (placement == 'top' && actualHeight != height) {
1293
    if (placement == 'top' && actualHeight != height) {
-
 
1294
      replace = true
1539
      offset.top = offset.top + height - actualHeight
1295
      offset.top = offset.top + height - actualHeight
1540
    }
1296
    }
1541
 
1297
 
1542
    var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
1298
    if (/bottom|top/.test(placement)) {
-
 
1299
      var delta = 0
1543
 
1300
 
-
 
1301
      if (offset.left < 0) {
1544
    if (delta.left) offset.left += delta.left
1302
        delta       = offset.left * -2
1545
    else offset.top += delta.top
1303
        offset.left = 0
1546
 
1304
 
1547
    var isVertical          = /top|bottom/.test(placement)
1305
        $tip.offset(offset)
1548
    var arrowDelta          = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
-
 
1549
    var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
-
 
1550
 
1306
 
-
 
1307
        actualWidth  = $tip[0].offsetWidth
1551
    $tip.offset(offset)
1308
        actualHeight = $tip[0].offsetHeight
-
 
1309
      }
-
 
1310
 
1552
    this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
1311
      this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
-
 
1312
    } else {
-
 
1313
      this.replaceArrow(actualHeight - height, actualHeight, 'top')
-
 
1314
    }
-
 
1315
 
-
 
1316
    if (replace) $tip.offset(offset)
1553
  }
1317
  }
1554
 
1318
 
1555
  Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
1319
  Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
1556
    this.arrow()
-
 
1557
      .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
1320
    this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
1558
      .css(isVertical ? 'top' : 'left', '')
-
 
1559
  }
1321
  }
1560
 
1322
 
1561
  Tooltip.prototype.setContent = function () {
1323
  Tooltip.prototype.setContent = function () {
1562
    var $tip  = this.tip()
1324
    var $tip  = this.tip()
1563
    var title = this.getTitle()
1325
    var title = this.getTitle()
1564
 
1326
 
1565
    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1327
    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1566
    $tip.removeClass('fade in top bottom left right')
1328
    $tip.removeClass('fade in top bottom left right')
1567
  }
1329
  }
1568
 
1330
 
1569
  Tooltip.prototype.hide = function (callback) {
1331
  Tooltip.prototype.hide = function () {
1570
    var that = this
1332
    var that = this
1571
    var $tip = $(this.$tip)
1333
    var $tip = this.tip()
1572
    var e    = $.Event('hide.bs.' + this.type)
1334
    var e    = $.Event('hide.bs.' + this.type)
1573
 
1335
 
1574
    function complete() {
1336
    function complete() {
1575
      if (that.hoverState != 'in') $tip.detach()
1337
      if (that.hoverState != 'in') $tip.detach()
1576
      if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
-
 
1577
        that.$element
-
 
1578
          .removeAttr('aria-describedby')
-
 
1579
          .trigger('hidden.bs.' + that.type)
-
 
1580
      }
-
 
1581
      callback && callback()
-
 
1582
    }
1338
    }
1583
 
1339
 
1584
    this.$element.trigger(e)
1340
    this.$element.trigger(e)
1585
 
1341
 
1586
    if (e.isDefaultPrevented()) return
1342
    if (e.isDefaultPrevented()) return
1587
 
1343
 
1588
    $tip.removeClass('in')
1344
    $tip.removeClass('in')
1589
 
1345
 
1590
    $.support.transition && $tip.hasClass('fade') ?
1346
    $.support.transition && this.$tip.hasClass('fade') ?
1591
      $tip
1347
      $tip
1592
        .one('bsTransitionEnd', complete)
1348
        .one($.support.transition.end, complete)
1593
        .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
1349
        .emulateTransitionEnd(150) :
1594
      complete()
1350
      complete()
1595
 
1351
 
1596
    this.hoverState = null
1352
    this.$element.trigger('hidden.bs.' + this.type)
1597
 
1353
 
1598
    return this
1354
    return this
1599
  }
1355
  }
1600
 
1356
 
1601
  Tooltip.prototype.fixTitle = function () {
1357
  Tooltip.prototype.fixTitle = function () {
1602
    var $e = this.$element
1358
    var $e = this.$element
1603
    if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
1359
    if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1604
      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1360
      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
1605
    }
1361
    }
1606
  }
1362
  }
1607
 
1363
 
1608
  Tooltip.prototype.hasContent = function () {
1364
  Tooltip.prototype.hasContent = function () {
1609
    return this.getTitle()
1365
    return this.getTitle()
1610
  }
1366
  }
1611
 
1367
 
1612
  Tooltip.prototype.getPosition = function ($element) {
1368
  Tooltip.prototype.getPosition = function () {
1613
    $element   = $element || this.$element
-
 
1614
 
-
 
1615
    var el     = $element[0]
1369
    var el = this.$element[0]
1616
    var isBody = el.tagName == 'BODY'
-
 
1617
 
-
 
1618
    var elRect    = el.getBoundingClientRect()
1370
    return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
1619
    if (elRect.width == null) {
1371
      width: el.offsetWidth
1620
      // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
-
 
1621
      elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
-
 
1622
    }
-
 
1623
    var isSvg = window.SVGElement && el instanceof window.SVGElement
-
 
1624
    // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
-
 
1625
    // See https://github.com/twbs/bootstrap/issues/20280
1372
    , height: el.offsetHeight
1626
    var elOffset  = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
-
 
1627
    var scroll    = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
-
 
1628
    var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
-
 
1629
 
-
 
1630
    return $.extend({}, elRect, scroll, outerDims, elOffset)
1373
    }, this.$element.offset())
1631
  }
1374
  }
1632
 
1375
 
1633
  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1376
  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
1634
    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2 } :
1377
    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2  } :
1635
           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
1378
           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2  } :
1636
           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
1379
           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
1637
        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
1380
        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width   }
1638
 
-
 
1639
  }
-
 
1640
 
-
 
1641
  Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
-
 
1642
    var delta = { top: 0, left: 0 }
-
 
1643
    if (!this.$viewport) return delta
-
 
1644
 
-
 
1645
    var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
-
 
1646
    var viewportDimensions = this.getPosition(this.$viewport)
-
 
1647
 
-
 
1648
    if (/right|left/.test(placement)) {
-
 
1649
      var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
-
 
1650
      var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
-
 
1651
      if (topEdgeOffset < viewportDimensions.top) { // top overflow
-
 
1652
        delta.top = viewportDimensions.top - topEdgeOffset
-
 
1653
      } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
-
 
1654
        delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
-
 
1655
      }
-
 
1656
    } else {
-
 
1657
      var leftEdgeOffset  = pos.left - viewportPadding
-
 
1658
      var rightEdgeOffset = pos.left + viewportPadding + actualWidth
-
 
1659
      if (leftEdgeOffset < viewportDimensions.left) { // left overflow
-
 
1660
        delta.left = viewportDimensions.left - leftEdgeOffset
-
 
1661
      } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
-
 
1662
        delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
-
 
1663
      }
-
 
1664
    }
-
 
1665
 
-
 
1666
    return delta
-
 
1667
  }
1381
  }
1668
 
1382
 
1669
  Tooltip.prototype.getTitle = function () {
1383
  Tooltip.prototype.getTitle = function () {
1670
    var title
1384
    var title
1671
    var $e = this.$element
1385
    var $e = this.$element
Line 1675... Line 1389...
1675
      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
1389
      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
1676
 
1390
 
1677
    return title
1391
    return title
1678
  }
1392
  }
1679
 
1393
 
1680
  Tooltip.prototype.getUID = function (prefix) {
-
 
1681
    do prefix += ~~(Math.random() * 1000000)
-
 
1682
    while (document.getElementById(prefix))
-
 
1683
    return prefix
-
 
1684
  }
-
 
1685
 
-
 
1686
  Tooltip.prototype.tip = function () {
1394
  Tooltip.prototype.tip = function () {
1687
    if (!this.$tip) {
-
 
1688
      this.$tip = $(this.options.template)
1395
    return this.$tip = this.$tip || $(this.options.template)
1689
      if (this.$tip.length != 1) {
-
 
1690
        throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
-
 
1691
      }
-
 
1692
    }
-
 
1693
    return this.$tip
-
 
1694
  }
1396
  }
1695
 
1397
 
1696
  Tooltip.prototype.arrow = function () {
1398
  Tooltip.prototype.arrow = function () {
1697
    return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
1399
    return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
-
 
1400
  }
-
 
1401
 
-
 
1402
  Tooltip.prototype.validate = function () {
-
 
1403
    if (!this.$element[0].parentNode) {
-
 
1404
      this.hide()
-
 
1405
      this.$element = null
-
 
1406
      this.options  = null
-
 
1407
    }
1698
  }
1408
  }
1699
 
1409
 
1700
  Tooltip.prototype.enable = function () {
1410
  Tooltip.prototype.enable = function () {
1701
    this.enabled = true
1411
    this.enabled = true
1702
  }
1412
  }
Line 1708... Line 1418...
1708
  Tooltip.prototype.toggleEnabled = function () {
1418
  Tooltip.prototype.toggleEnabled = function () {
1709
    this.enabled = !this.enabled
1419
    this.enabled = !this.enabled
1710
  }
1420
  }
1711
 
1421
 
1712
  Tooltip.prototype.toggle = function (e) {
1422
  Tooltip.prototype.toggle = function (e) {
1713
    var self = this
-
 
1714
    if (e) {
-
 
1715
      self = $(e.currentTarget).data('bs.' + this.type)
1423
    var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
1716
      if (!self) {
-
 
1717
        self = new this.constructor(e.currentTarget, this.getDelegateOptions())
-
 
1718
        $(e.currentTarget).data('bs.' + this.type, self)
-
 
1719
      }
-
 
1720
    }
-
 
1721
 
-
 
1722
    if (e) {
-
 
1723
      self.inState.click = !self.inState.click
-
 
1724
      if (self.isInStateTrue()) self.enter(self)
-
 
1725
      else self.leave(self)
-
 
1726
    } else {
-
 
1727
      self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
1424
    self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
1728
    }
-
 
1729
  }
1425
  }
1730
 
1426
 
1731
  Tooltip.prototype.destroy = function () {
1427
  Tooltip.prototype.destroy = function () {
1732
    var that = this
-
 
1733
    clearTimeout(this.timeout)
-
 
1734
    this.hide(function () {
-
 
1735
      that.$element.off('.' + that.type).removeData('bs.' + that.type)
1428
    this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
1736
      if (that.$tip) {
-
 
1737
        that.$tip.detach()
-
 
1738
      }
-
 
1739
      that.$tip = null
-
 
1740
      that.$arrow = null
-
 
1741
      that.$viewport = null
-
 
1742
      that.$element = null
-
 
1743
    })
-
 
1744
  }
1429
  }
1745
 
1430
 
1746
 
1431
 
1747
  // TOOLTIP PLUGIN DEFINITION
1432
  // TOOLTIP PLUGIN DEFINITION
1748
  // =========================
1433
  // =========================
1749
 
1434
 
-
 
1435
  var old = $.fn.tooltip
-
 
1436
 
1750
  function Plugin(option) {
1437
  $.fn.tooltip = function (option) {
1751
    return this.each(function () {
1438
    return this.each(function () {
1752
      var $this   = $(this)
1439
      var $this   = $(this)
1753
      var data    = $this.data('bs.tooltip')
1440
      var data    = $this.data('bs.tooltip')
1754
      var options = typeof option == 'object' && option
1441
      var options = typeof option == 'object' && option
1755
 
1442
 
1756
      if (!data && /destroy|hide/.test(option)) return
-
 
1757
      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1443
      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
1758
      if (typeof option == 'string') data[option]()
1444
      if (typeof option == 'string') data[option]()
1759
    })
1445
    })
1760
  }
1446
  }
1761
 
1447
 
1762
  var old = $.fn.tooltip
-
 
1763
 
-
 
1764
  $.fn.tooltip             = Plugin
-
 
1765
  $.fn.tooltip.Constructor = Tooltip
1448
  $.fn.tooltip.Constructor = Tooltip
1766
 
1449
 
1767
 
1450
 
1768
  // TOOLTIP NO CONFLICT
1451
  // TOOLTIP NO CONFLICT
1769
  // ===================
1452
  // ===================
Line 1771... Line 1454...
1771
  $.fn.tooltip.noConflict = function () {
1454
  $.fn.tooltip.noConflict = function () {
1772
    $.fn.tooltip = old
1455
    $.fn.tooltip = old
1773
    return this
1456
    return this
1774
  }
1457
  }
1775
 
1458
 
1776
}(jQuery);
1459
}(window.jQuery);
1777
 
1460
 
1778
/* ========================================================================
1461
/* ========================================================================
1779
 * Bootstrap: popover.js v3.3.7
1462
 * Bootstrap: popover.js v3.0.0
1780
 * http://getbootstrap.com/javascript/#popovers
1463
 * http://twbs.github.com/bootstrap/javascript.html#popovers
1781
 * ========================================================================
1464
 * ========================================================================
1782
 * Copyright 2011-2016 Twitter, Inc.
1465
 * Copyright 2012 Twitter, Inc.
-
 
1466
 *
1783
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1467
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
1468
 * you may not use this file except in compliance with the License.
-
 
1469
 * You may obtain a copy of the License at
-
 
1470
 *
-
 
1471
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
1472
 *
-
 
1473
 * Unless required by applicable law or agreed to in writing, software
-
 
1474
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
1475
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
1476
 * See the License for the specific language governing permissions and
-
 
1477
 * limitations under the License.
1784
 * ======================================================================== */
1478
 * ======================================================================== */
1785
 
1479
 
1786
 
1480
 
1787
+function ($) {
1481
+function ($) { "use strict";
1788
  'use strict';
-
 
1789
 
1482
 
1790
  // POPOVER PUBLIC CLASS DEFINITION
1483
  // POPOVER PUBLIC CLASS DEFINITION
1791
  // ===============================
1484
  // ===============================
1792
 
1485
 
1793
  var Popover = function (element, options) {
1486
  var Popover = function (element, options) {
1794
    this.init('popover', element, options)
1487
    this.init('popover', element, options)
1795
  }
1488
  }
1796
 
1489
 
1797
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1490
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
1798
 
1491
 
1799
  Popover.VERSION  = '3.3.7'
-
 
1800
 
-
 
1801
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
1492
  Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
1802
    placement: 'right',
1493
    placement: 'right'
1803
    trigger: 'click',
1494
  , trigger: 'click'
1804
    content: '',
1495
  , content: ''
1805
    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1496
  , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
1806
  })
1497
  })
1807
 
1498
 
1808
 
1499
 
1809
  // NOTE: POPOVER EXTENDS tooltip.js
1500
  // NOTE: POPOVER EXTENDS tooltip.js
1810
  // ================================
1501
  // ================================
Line 1821... Line 1512...
1821
    var $tip    = this.tip()
1512
    var $tip    = this.tip()
1822
    var title   = this.getTitle()
1513
    var title   = this.getTitle()
1823
    var content = this.getContent()
1514
    var content = this.getContent()
1824
 
1515
 
1825
    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1516
    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1826
    $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
-
 
1827
      this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
1517
    $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
1828
    ](content)
-
 
1829
 
1518
 
1830
    $tip.removeClass('fade top bottom left right in')
1519
    $tip.removeClass('fade top bottom left right in')
1831
 
1520
 
1832
    // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
1521
    // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
1833
    // this manually by checking the contents.
1522
    // this manually by checking the contents.
Line 1847... Line 1536...
1847
            o.content.call($e[0]) :
1536
            o.content.call($e[0]) :
1848
            o.content)
1537
            o.content)
1849
  }
1538
  }
1850
 
1539
 
1851
  Popover.prototype.arrow = function () {
1540
  Popover.prototype.arrow = function () {
1852
    return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
1541
    return this.$arrow = this.$arrow || this.tip().find('.arrow')
-
 
1542
  }
-
 
1543
 
-
 
1544
  Popover.prototype.tip = function () {
-
 
1545
    if (!this.$tip) this.$tip = $(this.options.template)
-
 
1546
    return this.$tip
1853
  }
1547
  }
1854
 
1548
 
1855
 
1549
 
1856
  // POPOVER PLUGIN DEFINITION
1550
  // POPOVER PLUGIN DEFINITION
1857
  // =========================
1551
  // =========================
1858
 
1552
 
-
 
1553
  var old = $.fn.popover
-
 
1554
 
1859
  function Plugin(option) {
1555
  $.fn.popover = function (option) {
1860
    return this.each(function () {
1556
    return this.each(function () {
1861
      var $this   = $(this)
1557
      var $this   = $(this)
1862
      var data    = $this.data('bs.popover')
1558
      var data    = $this.data('bs.popover')
1863
      var options = typeof option == 'object' && option
1559
      var options = typeof option == 'object' && option
1864
 
1560
 
1865
      if (!data && /destroy|hide/.test(option)) return
-
 
1866
      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1561
      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
1867
      if (typeof option == 'string') data[option]()
1562
      if (typeof option == 'string') data[option]()
1868
    })
1563
    })
1869
  }
1564
  }
1870
 
1565
 
1871
  var old = $.fn.popover
-
 
1872
 
-
 
1873
  $.fn.popover             = Plugin
-
 
1874
  $.fn.popover.Constructor = Popover
1566
  $.fn.popover.Constructor = Popover
1875
 
1567
 
1876
 
1568
 
1877
  // POPOVER NO CONFLICT
1569
  // POPOVER NO CONFLICT
1878
  // ===================
1570
  // ===================
Line 1880... Line 1572...
1880
  $.fn.popover.noConflict = function () {
1572
  $.fn.popover.noConflict = function () {
1881
    $.fn.popover = old
1573
    $.fn.popover = old
1882
    return this
1574
    return this
1883
  }
1575
  }
1884
 
1576
 
1885
}(jQuery);
1577
}(window.jQuery);
1886
 
1578
 
1887
/* ========================================================================
1579
/* ========================================================================
1888
 * Bootstrap: scrollspy.js v3.3.7
1580
 * Bootstrap: scrollspy.js v3.0.0
1889
 * http://getbootstrap.com/javascript/#scrollspy
1581
 * http://twbs.github.com/bootstrap/javascript.html#scrollspy
1890
 * ========================================================================
1582
 * ========================================================================
1891
 * Copyright 2011-2016 Twitter, Inc.
1583
 * Copyright 2012 Twitter, Inc.
-
 
1584
 *
1892
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1585
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
1586
 * you may not use this file except in compliance with the License.
-
 
1587
 * You may obtain a copy of the License at
-
 
1588
 *
-
 
1589
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
1590
 *
-
 
1591
 * Unless required by applicable law or agreed to in writing, software
-
 
1592
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
1593
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
1594
 * See the License for the specific language governing permissions and
-
 
1595
 * limitations under the License.
1893
 * ======================================================================== */
1596
 * ======================================================================== */
1894
 
1597
 
1895
 
1598
 
1896
+function ($) {
1599
+function ($) { "use strict";
1897
  'use strict';
-
 
1898
 
1600
 
1899
  // SCROLLSPY CLASS DEFINITION
1601
  // SCROLLSPY CLASS DEFINITION
1900
  // ==========================
1602
  // ==========================
1901
 
1603
 
1902
  function ScrollSpy(element, options) {
1604
  function ScrollSpy(element, options) {
-
 
1605
    var href
-
 
1606
    var process  = $.proxy(this.process, this)
-
 
1607
 
-
 
1608
    this.$element       = $(element).is('body') ? $(window) : $(element)
1903
    this.$body          = $(document.body)
1609
    this.$body          = $('body')
1904
    this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
1610
    this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
1905
    this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
1611
    this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
1906
    this.selector       = (this.options.target || '') + ' .nav li > a'
1612
    this.selector       = (this.options.target
-
 
1613
      || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
-
 
1614
      || '') + ' .nav li > a'
1907
    this.offsets        = []
1615
    this.offsets        = $([])
1908
    this.targets        = []
1616
    this.targets        = $([])
1909
    this.activeTarget   = null
1617
    this.activeTarget   = null
1910
    this.scrollHeight   = 0
-
 
1911
 
1618
 
1912
    this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
-
 
1913
    this.refresh()
1619
    this.refresh()
1914
    this.process()
1620
    this.process()
1915
  }
1621
  }
1916
 
1622
 
1917
  ScrollSpy.VERSION  = '3.3.7'
-
 
1918
 
-
 
1919
  ScrollSpy.DEFAULTS = {
1623
  ScrollSpy.DEFAULTS = {
1920
    offset: 10
1624
    offset: 10
1921
  }
1625
  }
1922
 
1626
 
1923
  ScrollSpy.prototype.getScrollHeight = function () {
-
 
1924
    return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
-
 
1925
  }
-
 
1926
 
-
 
1927
  ScrollSpy.prototype.refresh = function () {
1627
  ScrollSpy.prototype.refresh = function () {
1928
    var that          = this
-
 
1929
    var offsetMethod  = 'offset'
1628
    var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
1930
    var offsetBase    = 0
-
 
1931
 
-
 
1932
    this.offsets      = []
-
 
1933
    this.targets      = []
-
 
1934
    this.scrollHeight = this.getScrollHeight()
-
 
1935
 
1629
 
1936
    if (!$.isWindow(this.$scrollElement[0])) {
-
 
1937
      offsetMethod = 'position'
1630
    this.offsets = $([])
1938
      offsetBase   = this.$scrollElement.scrollTop()
1631
    this.targets = $([])
1939
    }
-
 
1940
 
1632
 
-
 
1633
    var self     = this
1941
    this.$body
1634
    var $targets = this.$body
1942
      .find(this.selector)
1635
      .find(this.selector)
1943
      .map(function () {
1636
      .map(function () {
1944
        var $el   = $(this)
1637
        var $el   = $(this)
1945
        var href  = $el.data('target') || $el.attr('href')
1638
        var href  = $el.data('target') || $el.attr('href')
1946
        var $href = /^#./.test(href) && $(href)
1639
        var $href = /^#\w/.test(href) && $(href)
1947
 
1640
 
1948
        return ($href
1641
        return ($href
1949
          && $href.length
1642
          && $href.length
1950
          && $href.is(':visible')
-
 
1951
          && [[$href[offsetMethod]().top + offsetBase, href]]) || null
1643
          && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
1952
      })
1644
      })
1953
      .sort(function (a, b) { return a[0] - b[0] })
1645
      .sort(function (a, b) { return a[0] - b[0] })
1954
      .each(function () {
1646
      .each(function () {
1955
        that.offsets.push(this[0])
1647
        self.offsets.push(this[0])
1956
        that.targets.push(this[1])
1648
        self.targets.push(this[1])
1957
      })
1649
      })
1958
  }
1650
  }
1959
 
1651
 
1960
  ScrollSpy.prototype.process = function () {
1652
  ScrollSpy.prototype.process = function () {
1961
    var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset
1653
    var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset
1962
    var scrollHeight = this.getScrollHeight()
1654
    var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1963
    var maxScroll    = this.options.offset + scrollHeight - this.$scrollElement.height()
1655
    var maxScroll    = scrollHeight - this.$scrollElement.height()
1964
    var offsets      = this.offsets
1656
    var offsets      = this.offsets
1965
    var targets      = this.targets
1657
    var targets      = this.targets
1966
    var activeTarget = this.activeTarget
1658
    var activeTarget = this.activeTarget
1967
    var i
1659
    var i
1968
 
1660
 
1969
    if (this.scrollHeight != scrollHeight) {
-
 
1970
      this.refresh()
-
 
1971
    }
-
 
1972
 
-
 
1973
    if (scrollTop >= maxScroll) {
1661
    if (scrollTop >= maxScroll) {
1974
      return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
1662
      return activeTarget != (i = targets.last()[0]) && this.activate(i)
1975
    }
-
 
1976
 
-
 
1977
    if (activeTarget && scrollTop < offsets[0]) {
-
 
1978
      this.activeTarget = null
-
 
1979
      return this.clear()
-
 
1980
    }
1663
    }
1981
 
1664
 
1982
    for (i = offsets.length; i--;) {
1665
    for (i = offsets.length; i--;) {
1983
      activeTarget != targets[i]
1666
      activeTarget != targets[i]
1984
        && scrollTop >= offsets[i]
1667
        && scrollTop >= offsets[i]
1985
        && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
1668
        && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1986
        && this.activate(targets[i])
1669
        && this.activate( targets[i] )
1987
    }
1670
    }
1988
  }
1671
  }
1989
 
1672
 
1990
  ScrollSpy.prototype.activate = function (target) {
1673
  ScrollSpy.prototype.activate = function (target) {
1991
    this.activeTarget = target
1674
    this.activeTarget = target
1992
 
1675
 
1993
    this.clear()
1676
    $(this.selector)
-
 
1677
      .parents('.active')
-
 
1678
      .removeClass('active')
1994
 
1679
 
1995
    var selector = this.selector +
1680
    var selector = this.selector
1996
      '[data-target="' + target + '"],' +
1681
      + '[data-target="' + target + '"],'
1997
      this.selector + '[href="' + target + '"]'
1682
      + this.selector + '[href="' + target + '"]'
1998
 
1683
 
1999
    var active = $(selector)
1684
    var active = $(selector)
2000
      .parents('li')
1685
      .parents('li')
2001
      .addClass('active')
1686
      .addClass('active')
2002
 
1687
 
2003
    if (active.parent('.dropdown-menu').length) {
1688
    if (active.parent('.dropdown-menu').length)  {
2004
      active = active
1689
      active = active
2005
        .closest('li.dropdown')
1690
        .closest('li.dropdown')
2006
        .addClass('active')
1691
        .addClass('active')
2007
    }
1692
    }
2008
 
1693
 
2009
    active.trigger('activate.bs.scrollspy')
1694
    active.trigger('activate')
2010
  }
-
 
2011
 
-
 
2012
  ScrollSpy.prototype.clear = function () {
-
 
2013
    $(this.selector)
-
 
2014
      .parentsUntil(this.options.target, '.active')
-
 
2015
      .removeClass('active')
-
 
2016
  }
1695
  }
2017
 
1696
 
2018
 
1697
 
2019
  // SCROLLSPY PLUGIN DEFINITION
1698
  // SCROLLSPY PLUGIN DEFINITION
2020
  // ===========================
1699
  // ===========================
2021
 
1700
 
-
 
1701
  var old = $.fn.scrollspy
-
 
1702
 
2022
  function Plugin(option) {
1703
  $.fn.scrollspy = function (option) {
2023
    return this.each(function () {
1704
    return this.each(function () {
2024
      var $this   = $(this)
1705
      var $this   = $(this)
2025
      var data    = $this.data('bs.scrollspy')
1706
      var data    = $this.data('bs.scrollspy')
2026
      var options = typeof option == 'object' && option
1707
      var options = typeof option == 'object' && option
2027
 
1708
 
2028
      if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
1709
      if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
2029
      if (typeof option == 'string') data[option]()
1710
      if (typeof option == 'string') data[option]()
2030
    })
1711
    })
2031
  }
1712
  }
2032
 
1713
 
2033
  var old = $.fn.scrollspy
-
 
2034
 
-
 
2035
  $.fn.scrollspy             = Plugin
-
 
2036
  $.fn.scrollspy.Constructor = ScrollSpy
1714
  $.fn.scrollspy.Constructor = ScrollSpy
2037
 
1715
 
2038
 
1716
 
2039
  // SCROLLSPY NO CONFLICT
1717
  // SCROLLSPY NO CONFLICT
2040
  // =====================
1718
  // =====================
Line 2046... Line 1724...
2046
 
1724
 
2047
 
1725
 
2048
  // SCROLLSPY DATA-API
1726
  // SCROLLSPY DATA-API
2049
  // ==================
1727
  // ==================
2050
 
1728
 
2051
  $(window).on('load.bs.scrollspy.data-api', function () {
1729
  $(window).on('load', function () {
2052
    $('[data-spy="scroll"]').each(function () {
1730
    $('[data-spy="scroll"]').each(function () {
2053
      var $spy = $(this)
1731
      var $spy = $(this)
2054
      Plugin.call($spy, $spy.data())
1732
      $spy.scrollspy($spy.data())
2055
    })
1733
    })
2056
  })
1734
  })
2057
 
1735
 
2058
}(jQuery);
1736
}(window.jQuery);
2059
 
1737
 
2060
/* ========================================================================
1738
/* ========================================================================
2061
 * Bootstrap: tab.js v3.3.7
1739
 * Bootstrap: tab.js v3.0.0
2062
 * http://getbootstrap.com/javascript/#tabs
1740
 * http://twbs.github.com/bootstrap/javascript.html#tabs
2063
 * ========================================================================
1741
 * ========================================================================
2064
 * Copyright 2011-2016 Twitter, Inc.
1742
 * Copyright 2012 Twitter, Inc.
-
 
1743
 *
2065
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1744
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
1745
 * you may not use this file except in compliance with the License.
-
 
1746
 * You may obtain a copy of the License at
-
 
1747
 *
-
 
1748
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
1749
 *
-
 
1750
 * Unless required by applicable law or agreed to in writing, software
-
 
1751
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
1752
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
1753
 * See the License for the specific language governing permissions and
-
 
1754
 * limitations under the License.
2066
 * ======================================================================== */
1755
 * ======================================================================== */
2067
 
1756
 
2068
 
1757
 
2069
+function ($) {
1758
+function ($) { "use strict";
2070
  'use strict';
-
 
2071
 
1759
 
2072
  // TAB CLASS DEFINITION
1760
  // TAB CLASS DEFINITION
2073
  // ====================
1761
  // ====================
2074
 
1762
 
2075
  var Tab = function (element) {
1763
  var Tab = function (element) {
2076
    // jscs:disable requireDollarBeforejQueryAssignment
-
 
2077
    this.element = $(element)
1764
    this.element = $(element)
2078
    // jscs:enable requireDollarBeforejQueryAssignment
-
 
2079
  }
1765
  }
2080
 
1766
 
2081
  Tab.VERSION = '3.3.7'
-
 
2082
 
-
 
2083
  Tab.TRANSITION_DURATION = 150
-
 
2084
 
-
 
2085
  Tab.prototype.show = function () {
1767
  Tab.prototype.show = function () {
2086
    var $this    = this.element
1768
    var $this    = this.element
2087
    var $ul      = $this.closest('ul:not(.dropdown-menu)')
1769
    var $ul      = $this.closest('ul:not(.dropdown-menu)')
2088
    var selector = $this.data('target')
1770
    var selector = $this.attr('data-target')
2089
 
1771
 
2090
    if (!selector) {
1772
    if (!selector) {
2091
      selector = $this.attr('href')
1773
      selector = $this.attr('href')
2092
      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
1774
      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
2093
    }
1775
    }
2094
 
1776
 
2095
    if ($this.parent('li').hasClass('active')) return
1777
    if ($this.parent('li').hasClass('active')) return
2096
 
1778
 
2097
    var $previous = $ul.find('.active:last a')
1779
    var previous = $ul.find('.active:last a')[0]
2098
    var hideEvent = $.Event('hide.bs.tab', {
-
 
2099
      relatedTarget: $this[0]
-
 
2100
    })
-
 
2101
    var showEvent = $.Event('show.bs.tab', {
1780
    var e        = $.Event('show.bs.tab', {
2102
      relatedTarget: $previous[0]
1781
      relatedTarget: previous
2103
    })
1782
    })
2104
 
1783
 
2105
    $previous.trigger(hideEvent)
-
 
2106
    $this.trigger(showEvent)
1784
    $this.trigger(e)
2107
 
1785
 
2108
    if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
1786
    if (e.isDefaultPrevented()) return
2109
 
1787
 
2110
    var $target = $(selector)
1788
    var $target = $(selector)
2111
 
1789
 
2112
    this.activate($this.closest('li'), $ul)
1790
    this.activate($this.parent('li'), $ul)
2113
    this.activate($target, $target.parent(), function () {
1791
    this.activate($target, $target.parent(), function () {
2114
      $previous.trigger({
-
 
2115
        type: 'hidden.bs.tab',
-
 
2116
        relatedTarget: $this[0]
-
 
2117
      })
-
 
2118
      $this.trigger({
1792
      $this.trigger({
2119
        type: 'shown.bs.tab',
1793
        type: 'shown.bs.tab'
2120
        relatedTarget: $previous[0]
1794
      , relatedTarget: previous
2121
      })
1795
      })
2122
    })
1796
    })
2123
  }
1797
  }
2124
 
1798
 
2125
  Tab.prototype.activate = function (element, container, callback) {
1799
  Tab.prototype.activate = function (element, container, callback) {
2126
    var $active    = container.find('> .active')
1800
    var $active    = container.find('> .active')
2127
    var transition = callback
1801
    var transition = callback
2128
      && $.support.transition
1802
      && $.support.transition
2129
      && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
1803
      && $active.hasClass('fade')
2130
 
1804
 
2131
    function next() {
1805
    function next() {
2132
      $active
1806
      $active
2133
        .removeClass('active')
1807
        .removeClass('active')
2134
        .find('> .dropdown-menu > .active')
1808
        .find('> .dropdown-menu > .active')
2135
          .removeClass('active')
1809
        .removeClass('active')
2136
        .end()
-
 
2137
        .find('[data-toggle="tab"]')
-
 
2138
          .attr('aria-expanded', false)
-
 
2139
 
1810
 
2140
      element
-
 
2141
        .addClass('active')
1811
      element.addClass('active')
2142
        .find('[data-toggle="tab"]')
-
 
2143
          .attr('aria-expanded', true)
-
 
2144
 
1812
 
2145
      if (transition) {
1813
      if (transition) {
2146
        element[0].offsetWidth // reflow for transition
1814
        element[0].offsetWidth // reflow for transition
2147
        element.addClass('in')
1815
        element.addClass('in')
2148
      } else {
1816
      } else {
2149
        element.removeClass('fade')
1817
        element.removeClass('fade')
2150
      }
1818
      }
2151
 
1819
 
2152
      if (element.parent('.dropdown-menu').length) {
1820
      if (element.parent('.dropdown-menu')) {
2153
        element
-
 
2154
          .closest('li.dropdown')
1821
        element.closest('li.dropdown').addClass('active')
2155
            .addClass('active')
-
 
2156
          .end()
-
 
2157
          .find('[data-toggle="tab"]')
-
 
2158
            .attr('aria-expanded', true)
-
 
2159
      }
1822
      }
2160
 
1823
 
2161
      callback && callback()
1824
      callback && callback()
2162
    }
1825
    }
2163
 
1826
 
2164
    $active.length && transition ?
1827
    transition ?
2165
      $active
1828
      $active
2166
        .one('bsTransitionEnd', next)
1829
        .one($.support.transition.end, next)
2167
        .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
1830
        .emulateTransitionEnd(150) :
2168
      next()
1831
      next()
2169
 
1832
 
2170
    $active.removeClass('in')
1833
    $active.removeClass('in')
2171
  }
1834
  }
2172
 
1835
 
2173
 
1836
 
2174
  // TAB PLUGIN DEFINITION
1837
  // TAB PLUGIN DEFINITION
2175
  // =====================
1838
  // =====================
2176
 
1839
 
-
 
1840
  var old = $.fn.tab
-
 
1841
 
2177
  function Plugin(option) {
1842
  $.fn.tab = function ( option ) {
2178
    return this.each(function () {
1843
    return this.each(function () {
2179
      var $this = $(this)
1844
      var $this = $(this)
2180
      var data  = $this.data('bs.tab')
1845
      var data  = $this.data('bs.tab')
2181
 
1846
 
2182
      if (!data) $this.data('bs.tab', (data = new Tab(this)))
1847
      if (!data) $this.data('bs.tab', (data = new Tab(this)))
2183
      if (typeof option == 'string') data[option]()
1848
      if (typeof option == 'string') data[option]()
2184
    })
1849
    })
2185
  }
1850
  }
2186
 
1851
 
2187
  var old = $.fn.tab
-
 
2188
 
-
 
2189
  $.fn.tab             = Plugin
-
 
2190
  $.fn.tab.Constructor = Tab
1852
  $.fn.tab.Constructor = Tab
2191
 
1853
 
2192
 
1854
 
2193
  // TAB NO CONFLICT
1855
  // TAB NO CONFLICT
2194
  // ===============
1856
  // ===============
Line 2200... Line 1862...
2200
 
1862
 
2201
 
1863
 
2202
  // TAB DATA-API
1864
  // TAB DATA-API
2203
  // ============
1865
  // ============
2204
 
1866
 
2205
  var clickHandler = function (e) {
1867
  $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
2206
    e.preventDefault()
1868
    e.preventDefault()
2207
    Plugin.call($(this), 'show')
1869
    $(this).tab('show')
2208
  }
1870
  })
2209
 
-
 
2210
  $(document)
-
 
2211
    .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
-
 
2212
    .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
-
 
2213
 
1871
 
2214
}(jQuery);
1872
}(window.jQuery);
2215
 
1873
 
2216
/* ========================================================================
1874
/* ========================================================================
2217
 * Bootstrap: affix.js v3.3.7
1875
 * Bootstrap: affix.js v3.0.0
2218
 * http://getbootstrap.com/javascript/#affix
1876
 * http://twbs.github.com/bootstrap/javascript.html#affix
2219
 * ========================================================================
1877
 * ========================================================================
2220
 * Copyright 2011-2016 Twitter, Inc.
1878
 * Copyright 2012 Twitter, Inc.
-
 
1879
 *
2221
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1880
 * Licensed under the Apache License, Version 2.0 (the "License");
-
 
1881
 * you may not use this file except in compliance with the License.
-
 
1882
 * You may obtain a copy of the License at
-
 
1883
 *
-
 
1884
 * http://www.apache.org/licenses/LICENSE-2.0
-
 
1885
 *
-
 
1886
 * Unless required by applicable law or agreed to in writing, software
-
 
1887
 * distributed under the License is distributed on an "AS IS" BASIS,
-
 
1888
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
 
1889
 * See the License for the specific language governing permissions and
-
 
1890
 * limitations under the License.
2222
 * ======================================================================== */
1891
 * ======================================================================== */
2223
 
1892
 
2224
 
1893
 
2225
+function ($) {
1894
+function ($) { "use strict";
2226
  'use strict';
-
 
2227
 
1895
 
2228
  // AFFIX CLASS DEFINITION
1896
  // AFFIX CLASS DEFINITION
2229
  // ======================
1897
  // ======================
2230
 
1898
 
2231
  var Affix = function (element, options) {
1899
  var Affix = function (element, options) {
2232
    this.options = $.extend({}, Affix.DEFAULTS, options)
1900
    this.options = $.extend({}, Affix.DEFAULTS, options)
2233
 
-
 
2234
    this.$target = $(this.options.target)
1901
    this.$window = $(window)
2235
      .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
1902
      .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
2236
      .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))
1903
      .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))
2237
 
1904
 
2238
    this.$element     = $(element)
1905
    this.$element = $(element)
2239
    this.affixed      = null
1906
    this.affixed  =
2240
    this.unpin        = null
1907
    this.unpin    = null
2241
    this.pinnedOffset = null
-
 
2242
 
1908
 
2243
    this.checkPosition()
1909
    this.checkPosition()
2244
  }
1910
  }
2245
 
1911
 
2246
  Affix.VERSION  = '3.3.7'
-
 
2247
 
-
 
2248
  Affix.RESET    = 'affix affix-top affix-bottom'
1912
  Affix.RESET = 'affix affix-top affix-bottom'
2249
 
1913
 
2250
  Affix.DEFAULTS = {
1914
  Affix.DEFAULTS = {
2251
    offset: 0,
1915
    offset: 0
2252
    target: window
-
 
2253
  }
-
 
2254
 
-
 
2255
  Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
-
 
2256
    var scrollTop    = this.$target.scrollTop()
-
 
2257
    var position     = this.$element.offset()
-
 
2258
    var targetHeight = this.$target.height()
-
 
2259
 
-
 
2260
    if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
-
 
2261
 
-
 
2262
    if (this.affixed == 'bottom') {
-
 
2263
      if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
-
 
2264
      return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
-
 
2265
    }
-
 
2266
 
-
 
2267
    var initializing   = this.affixed == null
-
 
2268
    var colliderTop    = initializing ? scrollTop : position.top
-
 
2269
    var colliderHeight = initializing ? targetHeight : height
-
 
2270
 
-
 
2271
    if (offsetTop != null && scrollTop <= offsetTop) return 'top'
-
 
2272
    if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
-
 
2273
 
-
 
2274
    return false
-
 
2275
  }
-
 
2276
 
-
 
2277
  Affix.prototype.getPinnedOffset = function () {
-
 
2278
    if (this.pinnedOffset) return this.pinnedOffset
-
 
2279
    this.$element.removeClass(Affix.RESET).addClass('affix')
-
 
2280
    var scrollTop = this.$target.scrollTop()
-
 
2281
    var position  = this.$element.offset()
-
 
2282
    return (this.pinnedOffset = position.top - scrollTop)
-
 
2283
  }
1916
  }
2284
 
1917
 
2285
  Affix.prototype.checkPositionWithEventLoop = function () {
1918
  Affix.prototype.checkPositionWithEventLoop = function () {
2286
    setTimeout($.proxy(this.checkPosition, this), 1)
1919
    setTimeout($.proxy(this.checkPosition, this), 1)
2287
  }
1920
  }
2288
 
1921
 
2289
  Affix.prototype.checkPosition = function () {
1922
  Affix.prototype.checkPosition = function () {
2290
    if (!this.$element.is(':visible')) return
1923
    if (!this.$element.is(':visible')) return
2291
 
1924
 
-
 
1925
    var scrollHeight = $(document).height()
-
 
1926
    var scrollTop    = this.$window.scrollTop()
2292
    var height       = this.$element.height()
1927
    var position     = this.$element.offset()
2293
    var offset       = this.options.offset
1928
    var offset       = this.options.offset
2294
    var offsetTop    = offset.top
1929
    var offsetTop    = offset.top
2295
    var offsetBottom = offset.bottom
1930
    var offsetBottom = offset.bottom
2296
    var scrollHeight = Math.max($(document).height(), $(document.body).height())
-
 
2297
 
1931
 
2298
    if (typeof offset != 'object')         offsetBottom = offsetTop = offset
1932
    if (typeof offset != 'object')         offsetBottom = offsetTop = offset
2299
    if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
1933
    if (typeof offsetTop == 'function')    offsetTop    = offset.top()
2300
    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
1934
    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
2301
 
1935
 
2302
    var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
1936
    var affix = this.unpin   != null && (scrollTop + this.unpin <= position.top) ? false :
-
 
1937
                offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
-
 
1938
                offsetTop    != null && (scrollTop <= offsetTop) ? 'top' : false
2303
 
1939
 
2304
    if (this.affixed != affix) {
1940
    if (this.affixed === affix) return
2305
      if (this.unpin != null) this.$element.css('top', '')
1941
    if (this.unpin) this.$element.css('top', '')
2306
 
1942
 
2307
      var affixType = 'affix' + (affix ? '-' + affix : '')
1943
    this.affixed = affix
2308
      var e         = $.Event(affixType + '.bs.affix')
1944
    this.unpin   = affix == 'bottom' ? position.top - scrollTop : null
2309
 
1945
 
2310
      this.$element.trigger(e)
-
 
2311
 
-
 
2312
      if (e.isDefaultPrevented()) return
-
 
2313
 
-
 
2314
      this.affixed = affix
-
 
2315
      this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
-
 
2316
 
-
 
2317
      this.$element
-
 
2318
        .removeClass(Affix.RESET)
-
 
2319
        .addClass(affixType)
-
 
2320
        .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
1946
    this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
2321
    }
-
 
2322
 
1947
 
2323
    if (affix == 'bottom') {
1948
    if (affix == 'bottom') {
2324
      this.$element.offset({
-
 
2325
        top: scrollHeight - height - offsetBottom
1949
      this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
2326
      })
-
 
2327
    }
1950
    }
2328
  }
1951
  }
2329
 
1952
 
2330
 
1953
 
2331
  // AFFIX PLUGIN DEFINITION
1954
  // AFFIX PLUGIN DEFINITION
2332
  // =======================
1955
  // =======================
2333
 
1956
 
-
 
1957
  var old = $.fn.affix
-
 
1958
 
2334
  function Plugin(option) {
1959
  $.fn.affix = function (option) {
2335
    return this.each(function () {
1960
    return this.each(function () {
2336
      var $this   = $(this)
1961
      var $this   = $(this)
2337
      var data    = $this.data('bs.affix')
1962
      var data    = $this.data('bs.affix')
2338
      var options = typeof option == 'object' && option
1963
      var options = typeof option == 'object' && option
2339
 
1964
 
2340
      if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
1965
      if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
2341
      if (typeof option == 'string') data[option]()
1966
      if (typeof option == 'string') data[option]()
2342
    })
1967
    })
2343
  }
1968
  }
2344
 
1969
 
2345
  var old = $.fn.affix
-
 
2346
 
-
 
2347
  $.fn.affix             = Plugin
-
 
2348
  $.fn.affix.Constructor = Affix
1970
  $.fn.affix.Constructor = Affix
2349
 
1971
 
2350
 
1972
 
2351
  // AFFIX NO CONFLICT
1973
  // AFFIX NO CONFLICT
2352
  // =================
1974
  // =================
Line 2365... Line 1987...
2365
      var $spy = $(this)
1987
      var $spy = $(this)
2366
      var data = $spy.data()
1988
      var data = $spy.data()
2367
 
1989
 
2368
      data.offset = data.offset || {}
1990
      data.offset = data.offset || {}
2369
 
1991
 
2370
      if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
1992
      if (data.offsetBottom) data.offset.bottom = data.offsetBottom
2371
      if (data.offsetTop    != null) data.offset.top    = data.offsetTop
1993
      if (data.offsetTop)    data.offset.top    = data.offsetTop
2372
 
1994
 
2373
      Plugin.call($spy, data)
1995
      $spy.affix(data)
2374
    })
1996
    })
2375
  })
1997
  })
2376
 
1998
 
2377
}(jQuery);
1999
}(window.jQuery);