bootstrap.js 68 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295
  1. /* ===================================================
  2. * bootstrap-transition.js v2.3.2
  3. * http://getbootstrap.com/2.3.2/javascript.html#transitions
  4. * ===================================================
  5. * Copyright 2013 Twitter, Inc.
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. * ========================================================== */
  19. !function ($) {
  20. "use strict"; // jshint ;_;
  21. /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
  22. * ======================================================= */
  23. $(function () {
  24. $.support.transition = (function () {
  25. var transitionEnd = (function () {
  26. var el = document.createElement('bootstrap')
  27. , transEndEventNames = {
  28. 'WebkitTransition': 'webkitTransitionEnd'
  29. , 'MozTransition': 'transitionend'
  30. , 'OTransition': 'oTransitionEnd otransitionend'
  31. , 'transition': 'transitionend'
  32. }
  33. , name
  34. for (name in transEndEventNames) {
  35. if (el.style[name] !== undefined) {
  36. return transEndEventNames[name]
  37. }
  38. }
  39. }())
  40. return transitionEnd && {
  41. end: transitionEnd
  42. }
  43. })()
  44. })
  45. }(window.jQuery);/* ==========================================================
  46. * bootstrap-alert.js v2.3.2
  47. * http://getbootstrap.com/2.3.2/javascript.html#alerts
  48. * ==========================================================
  49. * Copyright 2013 Twitter, Inc.
  50. *
  51. * Licensed under the Apache License, Version 2.0 (the "License");
  52. * you may not use this file except in compliance with the License.
  53. * You may obtain a copy of the License at
  54. *
  55. * http://www.apache.org/licenses/LICENSE-2.0
  56. *
  57. * Unless required by applicable law or agreed to in writing, software
  58. * distributed under the License is distributed on an "AS IS" BASIS,
  59. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  60. * See the License for the specific language governing permissions and
  61. * limitations under the License.
  62. * ========================================================== */
  63. !function ($) {
  64. "use strict"; // jshint ;_;
  65. /* ALERT CLASS DEFINITION
  66. * ====================== */
  67. var dismiss = '[data-dismiss="alert"]'
  68. , Alert = function (el) {
  69. $(el).on('click', dismiss, this.close)
  70. }
  71. Alert.prototype.close = function (e) {
  72. var $this = $(this)
  73. , selector = $this.attr('data-target')
  74. , $parent
  75. if (!selector) {
  76. selector = $this.attr('href')
  77. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  78. }
  79. $parent = $(selector)
  80. e && e.preventDefault()
  81. $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
  82. $parent.trigger(e = $.Event('close'))
  83. if (e.isDefaultPrevented()) return
  84. $parent.removeClass('in')
  85. function removeElement() {
  86. $parent
  87. .trigger('closed')
  88. .remove()
  89. }
  90. $.support.transition && $parent.hasClass('fade') ?
  91. $parent.on($.support.transition.end, removeElement) :
  92. removeElement()
  93. }
  94. /* ALERT PLUGIN DEFINITION
  95. * ======================= */
  96. var old = $.fn.alert
  97. $.fn.alert = function (option) {
  98. return this.each(function () {
  99. var $this = $(this)
  100. , data = $this.data('alert')
  101. if (!data) $this.data('alert', (data = new Alert(this)))
  102. if (typeof option == 'string') data[option].call($this)
  103. })
  104. }
  105. $.fn.alert.Constructor = Alert
  106. /* ALERT NO CONFLICT
  107. * ================= */
  108. $.fn.alert.noConflict = function () {
  109. $.fn.alert = old
  110. return this
  111. }
  112. /* ALERT DATA-API
  113. * ============== */
  114. $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
  115. }(window.jQuery);/* ============================================================
  116. * bootstrap-button.js v2.3.2
  117. * http://getbootstrap.com/2.3.2/javascript.html#buttons
  118. * ============================================================
  119. * Copyright 2013 Twitter, Inc.
  120. *
  121. * Licensed under the Apache License, Version 2.0 (the "License");
  122. * you may not use this file except in compliance with the License.
  123. * You may obtain a copy of the License at
  124. *
  125. * http://www.apache.org/licenses/LICENSE-2.0
  126. *
  127. * Unless required by applicable law or agreed to in writing, software
  128. * distributed under the License is distributed on an "AS IS" BASIS,
  129. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  130. * See the License for the specific language governing permissions and
  131. * limitations under the License.
  132. * ============================================================ */
  133. !function ($) {
  134. "use strict"; // jshint ;_;
  135. /* BUTTON PUBLIC CLASS DEFINITION
  136. * ============================== */
  137. var Button = function (element, options) {
  138. this.$element = $(element)
  139. this.options = $.extend({}, $.fn.button.defaults, options)
  140. }
  141. Button.prototype.setState = function (state) {
  142. var d = 'disabled'
  143. , $el = this.$element
  144. , data = $el.data()
  145. , val = $el.is('input') ? 'val' : 'html'
  146. state = state + 'Text'
  147. data.resetText || $el.data('resetText', $el[val]())
  148. $el[val](data[state] || this.options[state])
  149. // push to event loop to allow forms to submit
  150. setTimeout(function () {
  151. state == 'loadingText' ?
  152. $el.addClass(d).attr(d, d) :
  153. $el.removeClass(d).removeAttr(d)
  154. }, 0)
  155. }
  156. Button.prototype.toggle = function () {
  157. var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
  158. $parent && $parent
  159. .find('.active')
  160. .removeClass('active')
  161. this.$element.toggleClass('active')
  162. }
  163. /* BUTTON PLUGIN DEFINITION
  164. * ======================== */
  165. var old = $.fn.button
  166. $.fn.button = function (option) {
  167. return this.each(function () {
  168. var $this = $(this)
  169. , data = $this.data('button')
  170. , options = typeof option == 'object' && option
  171. if (!data) $this.data('button', (data = new Button(this, options)))
  172. if (option == 'toggle') data.toggle()
  173. else if (option) data.setState(option)
  174. })
  175. }
  176. $.fn.button.defaults = {
  177. loadingText: 'loading...'
  178. }
  179. $.fn.button.Constructor = Button
  180. /* BUTTON NO CONFLICT
  181. * ================== */
  182. $.fn.button.noConflict = function () {
  183. $.fn.button = old
  184. return this
  185. }
  186. /* BUTTON DATA-API
  187. * =============== */
  188. $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
  189. var $btn = $(e.target)
  190. if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
  191. $btn.button('toggle')
  192. })
  193. }(window.jQuery);/* ==========================================================
  194. * bootstrap-carousel.js v2.3.2
  195. * http://getbootstrap.com/2.3.2/javascript.html#carousel
  196. * ==========================================================
  197. * Copyright 2013 Twitter, Inc.
  198. *
  199. * Licensed under the Apache License, Version 2.0 (the "License");
  200. * you may not use this file except in compliance with the License.
  201. * You may obtain a copy of the License at
  202. *
  203. * http://www.apache.org/licenses/LICENSE-2.0
  204. *
  205. * Unless required by applicable law or agreed to in writing, software
  206. * distributed under the License is distributed on an "AS IS" BASIS,
  207. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  208. * See the License for the specific language governing permissions and
  209. * limitations under the License.
  210. * ========================================================== */
  211. !function ($) {
  212. "use strict"; // jshint ;_;
  213. /* CAROUSEL CLASS DEFINITION
  214. * ========================= */
  215. var Carousel = function (element, options) {
  216. this.$element = $(element)
  217. this.$indicators = this.$element.find('.carousel-indicators')
  218. this.options = options
  219. this.options.pause == 'hover' && this.$element
  220. .on('mouseenter', $.proxy(this.pause, this))
  221. .on('mouseleave', $.proxy(this.cycle, this))
  222. }
  223. Carousel.prototype = {
  224. cycle: function (e) {
  225. if (!e) this.paused = false
  226. if (this.interval) clearInterval(this.interval);
  227. this.options.interval
  228. && !this.paused
  229. && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
  230. return this
  231. }
  232. , getActiveIndex: function () {
  233. this.$active = this.$element.find('.item.active')
  234. this.$items = this.$active.parent().children()
  235. return this.$items.index(this.$active)
  236. }
  237. , to: function (pos) {
  238. var activeIndex = this.getActiveIndex()
  239. , that = this
  240. if (pos > (this.$items.length - 1) || pos < 0) return
  241. if (this.sliding) {
  242. return this.$element.one('slid', function () {
  243. that.to(pos)
  244. })
  245. }
  246. if (activeIndex == pos) {
  247. return this.pause().cycle()
  248. }
  249. return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
  250. }
  251. , pause: function (e) {
  252. if (!e) this.paused = true
  253. if (this.$element.find('.next, .prev').length && $.support.transition.end) {
  254. this.$element.trigger($.support.transition.end)
  255. this.cycle(true)
  256. }
  257. clearInterval(this.interval)
  258. this.interval = null
  259. return this
  260. }
  261. , next: function () {
  262. if (this.sliding) return
  263. return this.slide('next')
  264. }
  265. , prev: function () {
  266. if (this.sliding) return
  267. return this.slide('prev')
  268. }
  269. , slide: function (type, next) {
  270. var $active = this.$element.find('.item.active')
  271. , $next = next || $active[type]()
  272. , isCycling = this.interval
  273. , direction = type == 'next' ? 'left' : 'right'
  274. , fallback = type == 'next' ? 'first' : 'last'
  275. , that = this
  276. , e
  277. this.sliding = true
  278. isCycling && this.pause()
  279. $next = $next.length ? $next : this.$element.find('.item')[fallback]()
  280. e = $.Event('slide', {
  281. relatedTarget: $next[0]
  282. , direction: direction
  283. })
  284. if ($next.hasClass('active')) return
  285. if (this.$indicators.length) {
  286. this.$indicators.find('.active').removeClass('active')
  287. this.$element.one('slid', function () {
  288. var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
  289. $nextIndicator && $nextIndicator.addClass('active')
  290. })
  291. }
  292. if ($.support.transition && this.$element.hasClass('slide')) {
  293. this.$element.trigger(e)
  294. if (e.isDefaultPrevented()) return
  295. $next.addClass(type)
  296. $next[0].offsetWidth // force reflow
  297. $active.addClass(direction)
  298. $next.addClass(direction)
  299. this.$element.one($.support.transition.end, function () {
  300. $next.removeClass([type, direction].join(' ')).addClass('active')
  301. $active.removeClass(['active', direction].join(' '))
  302. that.sliding = false
  303. setTimeout(function () {
  304. that.$element.trigger('slid')
  305. }, 0)
  306. })
  307. } else {
  308. this.$element.trigger(e)
  309. if (e.isDefaultPrevented()) return
  310. $active.removeClass('active')
  311. $next.addClass('active')
  312. this.sliding = false
  313. this.$element.trigger('slid')
  314. }
  315. isCycling && this.cycle()
  316. return this
  317. }
  318. }
  319. /* CAROUSEL PLUGIN DEFINITION
  320. * ========================== */
  321. var old = $.fn.carousel
  322. $.fn.carousel = function (option) {
  323. return this.each(function () {
  324. var $this = $(this)
  325. , data = $this.data('carousel')
  326. , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
  327. , action = typeof option == 'string' ? option : options.slide
  328. if (!data) $this.data('carousel', (data = new Carousel(this, options)))
  329. if (typeof option == 'number') data.to(option)
  330. else if (action) data[action]()
  331. else if (options.interval) data.pause().cycle()
  332. })
  333. }
  334. $.fn.carousel.defaults = {
  335. interval: 5000
  336. , pause: 'hover'
  337. }
  338. $.fn.carousel.Constructor = Carousel
  339. /* CAROUSEL NO CONFLICT
  340. * ==================== */
  341. $.fn.carousel.noConflict = function () {
  342. $.fn.carousel = old
  343. return this
  344. }
  345. /* CAROUSEL DATA-API
  346. * ================= */
  347. $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
  348. var $this = $(this), href
  349. ,
  350. $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  351. , options = $.extend({}, $target.data(), $this.data())
  352. , slideIndex
  353. $target.carousel(options)
  354. if (slideIndex = $this.attr('data-slide-to')) {
  355. $target.data('carousel').pause().to(slideIndex).cycle()
  356. }
  357. e.preventDefault()
  358. })
  359. }(window.jQuery);/* =============================================================
  360. * bootstrap-collapse.js v2.3.2
  361. * http://getbootstrap.com/2.3.2/javascript.html#collapse
  362. * =============================================================
  363. * Copyright 2013 Twitter, Inc.
  364. *
  365. * Licensed under the Apache License, Version 2.0 (the "License");
  366. * you may not use this file except in compliance with the License.
  367. * You may obtain a copy of the License at
  368. *
  369. * http://www.apache.org/licenses/LICENSE-2.0
  370. *
  371. * Unless required by applicable law or agreed to in writing, software
  372. * distributed under the License is distributed on an "AS IS" BASIS,
  373. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  374. * See the License for the specific language governing permissions and
  375. * limitations under the License.
  376. * ============================================================ */
  377. !function ($) {
  378. "use strict"; // jshint ;_;
  379. /* COLLAPSE PUBLIC CLASS DEFINITION
  380. * ================================ */
  381. var Collapse = function (element, options) {
  382. this.$element = $(element)
  383. this.options = $.extend({}, $.fn.collapse.defaults, options)
  384. if (this.options.parent) {
  385. this.$parent = $(this.options.parent)
  386. }
  387. this.options.toggle && this.toggle()
  388. }
  389. Collapse.prototype = {
  390. constructor: Collapse
  391. , dimension: function () {
  392. var hasWidth = this.$element.hasClass('width')
  393. return hasWidth ? 'width' : 'height'
  394. }
  395. , show: function () {
  396. var dimension
  397. , scroll
  398. , actives
  399. , hasData
  400. if (this.transitioning || this.$element.hasClass('in')) return
  401. dimension = this.dimension()
  402. scroll = $.camelCase(['scroll', dimension].join('-'))
  403. actives = this.$parent && this.$parent.find('> .accordion-group > .in')
  404. if (actives && actives.length) {
  405. hasData = actives.data('collapse')
  406. if (hasData && hasData.transitioning) return
  407. actives.collapse('hide')
  408. hasData || actives.data('collapse', null)
  409. }
  410. this.$element[dimension](0)
  411. this.transition('addClass', $.Event('show'), 'shown')
  412. $.support.transition && this.$element[dimension](this.$element[0][scroll])
  413. }
  414. , hide: function () {
  415. var dimension
  416. if (this.transitioning || !this.$element.hasClass('in')) return
  417. dimension = this.dimension()
  418. this.reset(this.$element[dimension]())
  419. this.transition('removeClass', $.Event('hide'), 'hidden')
  420. this.$element[dimension](0)
  421. }
  422. , reset: function (size) {
  423. var dimension = this.dimension()
  424. this.$element
  425. .removeClass('collapse')
  426. [dimension](size || 'auto')
  427. [0].offsetWidth
  428. this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
  429. return this
  430. }
  431. , transition: function (method, startEvent, completeEvent) {
  432. var that = this
  433. , complete = function () {
  434. if (startEvent.type == 'show') that.reset()
  435. that.transitioning = 0
  436. that.$element.trigger(completeEvent)
  437. }
  438. this.$element.trigger(startEvent)
  439. if (startEvent.isDefaultPrevented()) return
  440. this.transitioning = 1
  441. this.$element[method]('in')
  442. $.support.transition && this.$element.hasClass('collapse') ?
  443. this.$element.one($.support.transition.end, complete) :
  444. complete()
  445. }
  446. , toggle: function () {
  447. this[this.$element.hasClass('in') ? 'hide' : 'show']()
  448. }
  449. }
  450. /* COLLAPSE PLUGIN DEFINITION
  451. * ========================== */
  452. var old = $.fn.collapse
  453. $.fn.collapse = function (option) {
  454. return this.each(function () {
  455. var $this = $(this)
  456. , data = $this.data('collapse')
  457. , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
  458. if (!data) $this.data('collapse', (data = new Collapse(this, options)))
  459. if (typeof option == 'string') data[option]()
  460. })
  461. }
  462. $.fn.collapse.defaults = {
  463. toggle: true
  464. }
  465. $.fn.collapse.Constructor = Collapse
  466. /* COLLAPSE NO CONFLICT
  467. * ==================== */
  468. $.fn.collapse.noConflict = function () {
  469. $.fn.collapse = old
  470. return this
  471. }
  472. /* COLLAPSE DATA-API
  473. * ================= */
  474. $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
  475. var $this = $(this), href
  476. , target = $this.attr('data-target')
  477. || e.preventDefault()
  478. || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
  479. , option = $(target).data('collapse') ? 'toggle' : $this.data()
  480. $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
  481. $(target).collapse(option)
  482. })
  483. }(window.jQuery);/* ============================================================
  484. * bootstrap-dropdown.js v2.3.2
  485. * http://getbootstrap.com/2.3.2/javascript.html#dropdowns
  486. * ============================================================
  487. * Copyright 2013 Twitter, Inc.
  488. *
  489. * Licensed under the Apache License, Version 2.0 (the "License");
  490. * you may not use this file except in compliance with the License.
  491. * You may obtain a copy of the License at
  492. *
  493. * http://www.apache.org/licenses/LICENSE-2.0
  494. *
  495. * Unless required by applicable law or agreed to in writing, software
  496. * distributed under the License is distributed on an "AS IS" BASIS,
  497. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  498. * See the License for the specific language governing permissions and
  499. * limitations under the License.
  500. * ============================================================ */
  501. !function ($) {
  502. "use strict"; // jshint ;_;
  503. /* DROPDOWN CLASS DEFINITION
  504. * ========================= */
  505. var toggle = '[data-toggle=dropdown]'
  506. , Dropdown = function (element) {
  507. var $el = $(element).on('click.dropdown.data-api', this.toggle)
  508. $('html').on('click.dropdown.data-api', function () {
  509. $el.parent().removeClass('open')
  510. })
  511. }
  512. Dropdown.prototype = {
  513. constructor: Dropdown
  514. , toggle: function (e) {
  515. var $this = $(this)
  516. , $parent
  517. , isActive
  518. if ($this.is('.disabled, :disabled')) return
  519. $parent = getParent($this)
  520. isActive = $parent.hasClass('open')
  521. clearMenus()
  522. if (!isActive) {
  523. if ('ontouchstart' in document.documentElement) {
  524. // if mobile we we use a backdrop because click events don't delegate
  525. $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
  526. }
  527. $parent.toggleClass('open')
  528. }
  529. $this.focus()
  530. return false
  531. }
  532. , keydown: function (e) {
  533. var $this
  534. , $items
  535. , $active
  536. , $parent
  537. , isActive
  538. , index
  539. if (!/(38|40|27)/.test(e.keyCode)) return
  540. $this = $(this)
  541. e.preventDefault()
  542. e.stopPropagation()
  543. if ($this.is('.disabled, :disabled')) return
  544. $parent = getParent($this)
  545. isActive = $parent.hasClass('open')
  546. if (!isActive || (isActive && e.keyCode == 27)) {
  547. if (e.which == 27) $parent.find(toggle).focus()
  548. return $this.click()
  549. }
  550. $items = $('[role=menu] li:not(.divider):visible a', $parent)
  551. if (!$items.length) return
  552. index = $items.index($items.filter(':focus'))
  553. if (e.keyCode == 38 && index > 0) index-- // up
  554. if (e.keyCode == 40 && index < $items.length - 1) index++ // down
  555. if (!~index) index = 0
  556. $items
  557. .eq(index)
  558. .focus()
  559. }
  560. }
  561. function clearMenus() {
  562. $('.dropdown-backdrop').remove()
  563. $(toggle).each(function () {
  564. getParent($(this)).removeClass('open')
  565. })
  566. }
  567. function getParent($this) {
  568. var selector = $this.attr('data-target')
  569. , $parent
  570. if (!selector) {
  571. selector = $this.attr('href')
  572. selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  573. }
  574. $parent = selector && $(selector)
  575. if (!$parent || !$parent.length) $parent = $this.parent()
  576. return $parent
  577. }
  578. /* DROPDOWN PLUGIN DEFINITION
  579. * ========================== */
  580. var old = $.fn.dropdown
  581. $.fn.dropdown = function (option) {
  582. return this.each(function () {
  583. var $this = $(this)
  584. , data = $this.data('dropdown')
  585. if (!data) $this.data('dropdown', (data = new Dropdown(this)))
  586. if (typeof option == 'string') data[option].call($this)
  587. })
  588. }
  589. $.fn.dropdown.Constructor = Dropdown
  590. /* DROPDOWN NO CONFLICT
  591. * ==================== */
  592. $.fn.dropdown.noConflict = function () {
  593. $.fn.dropdown = old
  594. return this
  595. }
  596. /* APPLY TO STANDARD DROPDOWN ELEMENTS
  597. * =================================== */
  598. $(document)
  599. .on('click.dropdown.data-api', clearMenus)
  600. .on('click.dropdown.data-api', '.dropdown form', function (e) {
  601. e.stopPropagation()
  602. })
  603. .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
  604. .on('keydown.dropdown.data-api', toggle + ', [role=menu]', Dropdown.prototype.keydown)
  605. }(window.jQuery);
  606. /* =========================================================
  607. * bootstrap-modal.js v2.3.2
  608. * http://getbootstrap.com/2.3.2/javascript.html#modals
  609. * =========================================================
  610. * Copyright 2013 Twitter, Inc.
  611. *
  612. * Licensed under the Apache License, Version 2.0 (the "License");
  613. * you may not use this file except in compliance with the License.
  614. * You may obtain a copy of the License at
  615. *
  616. * http://www.apache.org/licenses/LICENSE-2.0
  617. *
  618. * Unless required by applicable law or agreed to in writing, software
  619. * distributed under the License is distributed on an "AS IS" BASIS,
  620. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  621. * See the License for the specific language governing permissions and
  622. * limitations under the License.
  623. * ========================================================= */
  624. !function ($) {
  625. "use strict"; // jshint ;_;
  626. /* MODAL CLASS DEFINITION
  627. * ====================== */
  628. var Modal = function (element, options) {
  629. this.options = options
  630. this.$element = $(element)
  631. .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
  632. this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
  633. }
  634. Modal.prototype = {
  635. constructor: Modal
  636. , toggle: function () {
  637. return this[!this.isShown ? 'show' : 'hide']()
  638. }
  639. , show: function () {
  640. var that = this
  641. , e = $.Event('show')
  642. this.$element.trigger(e)
  643. if (this.isShown || e.isDefaultPrevented()) return
  644. this.isShown = true
  645. this.escape()
  646. this.backdrop(function () {
  647. var transition = $.support.transition && that.$element.hasClass('fade')
  648. if (!that.$element.parent().length) {
  649. that.$element.appendTo(document.body) //don't move modals dom position
  650. }
  651. that.$element.show()
  652. if (transition) {
  653. that.$element[0].offsetWidth // force reflow
  654. }
  655. that.$element
  656. .addClass('in')
  657. .attr('aria-hidden', false)
  658. that.enforceFocus()
  659. transition ?
  660. that.$element.one($.support.transition.end, function () {
  661. that.$element.focus().trigger('shown')
  662. }) :
  663. that.$element.focus().trigger('shown')
  664. })
  665. }
  666. , hide: function (e) {
  667. e && e.preventDefault()
  668. var that = this
  669. e = $.Event('hide')
  670. this.$element.trigger(e)
  671. if (!this.isShown || e.isDefaultPrevented()) return
  672. this.isShown = false
  673. this.escape()
  674. $(document).off('focusin.modal')
  675. this.$element
  676. .removeClass('in')
  677. .attr('aria-hidden', true)
  678. $.support.transition && this.$element.hasClass('fade') ?
  679. this.hideWithTransition() :
  680. this.hideModal()
  681. }
  682. , enforceFocus: function () {
  683. var that = this
  684. $(document).on('focusin.modal', function (e) {
  685. if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
  686. that.$element.focus()
  687. }
  688. })
  689. }
  690. , escape: function () {
  691. var that = this
  692. if (this.isShown && this.options.keyboard) {
  693. this.$element.on('keyup.dismiss.modal', function (e) {
  694. e.which == 27 && that.hide()
  695. })
  696. } else if (!this.isShown) {
  697. this.$element.off('keyup.dismiss.modal')
  698. }
  699. }
  700. , hideWithTransition: function () {
  701. var that = this
  702. , timeout = setTimeout(function () {
  703. that.$element.off($.support.transition.end)
  704. that.hideModal()
  705. }, 500)
  706. this.$element.one($.support.transition.end, function () {
  707. clearTimeout(timeout)
  708. that.hideModal()
  709. })
  710. }
  711. , hideModal: function () {
  712. var that = this
  713. this.$element.hide()
  714. this.backdrop(function () {
  715. that.removeBackdrop()
  716. that.$element.trigger('hidden')
  717. })
  718. }
  719. , removeBackdrop: function () {
  720. this.$backdrop && this.$backdrop.remove()
  721. this.$backdrop = null
  722. }
  723. , backdrop: function (callback) {
  724. var that = this
  725. , animate = this.$element.hasClass('fade') ? 'fade' : ''
  726. if (this.isShown && this.options.backdrop) {
  727. var doAnimate = $.support.transition && animate
  728. this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
  729. .appendTo(document.body)
  730. this.$backdrop.click(
  731. this.options.backdrop == 'static' ?
  732. $.proxy(this.$element[0].focus, this.$element[0])
  733. : $.proxy(this.hide, this)
  734. )
  735. if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
  736. this.$backdrop.addClass('in')
  737. if (!callback) return
  738. doAnimate ?
  739. this.$backdrop.one($.support.transition.end, callback) :
  740. callback()
  741. } else if (!this.isShown && this.$backdrop) {
  742. this.$backdrop.removeClass('in')
  743. $.support.transition && this.$element.hasClass('fade') ?
  744. this.$backdrop.one($.support.transition.end, callback) :
  745. callback()
  746. } else if (callback) {
  747. callback()
  748. }
  749. }
  750. }
  751. /* MODAL PLUGIN DEFINITION
  752. * ======================= */
  753. var old = $.fn.modal
  754. $.fn.modal = function (option) {
  755. return this.each(function () {
  756. var $this = $(this)
  757. , data = $this.data('modal')
  758. , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
  759. if (!data) $this.data('modal', (data = new Modal(this, options)))
  760. if (typeof option == 'string') data[option]()
  761. else if (options.show) data.show()
  762. })
  763. }
  764. $.fn.modal.defaults = {
  765. backdrop: true
  766. , keyboard: true
  767. , show: true
  768. }
  769. $.fn.modal.Constructor = Modal
  770. /* MODAL NO CONFLICT
  771. * ================= */
  772. $.fn.modal.noConflict = function () {
  773. $.fn.modal = old
  774. return this
  775. }
  776. /* MODAL DATA-API
  777. * ============== */
  778. $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
  779. var $this = $(this)
  780. , href = $this.attr('href')
  781. , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
  782. ,
  783. option = $target.data('modal') ? 'toggle' : $.extend({remote: !/#/.test(href) && href}, $target.data(), $this.data())
  784. e.preventDefault()
  785. $target
  786. .modal(option)
  787. .one('hide', function () {
  788. $this.focus()
  789. })
  790. })
  791. }(window.jQuery);
  792. /* ===========================================================
  793. * bootstrap-tooltip.js v2.3.2
  794. * http://getbootstrap.com/2.3.2/javascript.html#tooltips
  795. * Inspired by the original jQuery.tipsy by Jason Frame
  796. * ===========================================================
  797. * Copyright 2013 Twitter, Inc.
  798. *
  799. * Licensed under the Apache License, Version 2.0 (the "License");
  800. * you may not use this file except in compliance with the License.
  801. * You may obtain a copy of the License at
  802. *
  803. * http://www.apache.org/licenses/LICENSE-2.0
  804. *
  805. * Unless required by applicable law or agreed to in writing, software
  806. * distributed under the License is distributed on an "AS IS" BASIS,
  807. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  808. * See the License for the specific language governing permissions and
  809. * limitations under the License.
  810. * ========================================================== */
  811. !function ($) {
  812. "use strict"; // jshint ;_;
  813. /* TOOLTIP PUBLIC CLASS DEFINITION
  814. * =============================== */
  815. var Tooltip = function (element, options) {
  816. this.init('tooltip', element, options)
  817. }
  818. Tooltip.prototype = {
  819. constructor: Tooltip
  820. , init: function (type, element, options) {
  821. var eventIn
  822. , eventOut
  823. , triggers
  824. , trigger
  825. , i
  826. this.type = type
  827. this.$element = $(element)
  828. this.options = this.getOptions(options)
  829. this.enabled = true
  830. triggers = this.options.trigger.split(' ')
  831. for (i = triggers.length; i--;) {
  832. trigger = triggers[i]
  833. if (trigger == 'click') {
  834. this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
  835. } else if (trigger != 'manual') {
  836. eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
  837. eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
  838. this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
  839. this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
  840. }
  841. }
  842. this.options.selector ?
  843. (this._options = $.extend({}, this.options, {trigger: 'manual', selector: ''})) :
  844. this.fixTitle()
  845. }
  846. , getOptions: function (options) {
  847. options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
  848. if (options.delay && typeof options.delay == 'number') {
  849. options.delay = {
  850. show: options.delay
  851. , hide: options.delay
  852. }
  853. }
  854. return options
  855. }
  856. , enter: function (e) {
  857. var defaults = $.fn[this.type].defaults
  858. , options = {}
  859. , self
  860. this._options && $.each(this._options, function (key, value) {
  861. if (defaults[key] != value) options[key] = value
  862. }, this)
  863. self = $(e.currentTarget)[this.type](options).data(this.type)
  864. if (!self.options.delay || !self.options.delay.show) return self.show()
  865. clearTimeout(this.timeout)
  866. self.hoverState = 'in'
  867. this.timeout = setTimeout(function () {
  868. if (self.hoverState == 'in') self.show()
  869. }, self.options.delay.show)
  870. }
  871. , leave: function (e) {
  872. var self = $(e.currentTarget)[this.type](this._options).data(this.type)
  873. if (this.timeout) clearTimeout(this.timeout)
  874. if (!self.options.delay || !self.options.delay.hide) return self.hide()
  875. self.hoverState = 'out'
  876. this.timeout = setTimeout(function () {
  877. if (self.hoverState == 'out') self.hide()
  878. }, self.options.delay.hide)
  879. }
  880. , show: function () {
  881. var $tip
  882. , pos
  883. , actualWidth
  884. , actualHeight
  885. , placement
  886. , tp
  887. , e = $.Event('show')
  888. if (this.hasContent() && this.enabled) {
  889. this.$element.trigger(e)
  890. if (e.isDefaultPrevented()) return
  891. $tip = this.tip()
  892. this.setContent()
  893. if (this.options.animation) {
  894. $tip.addClass('fade')
  895. }
  896. placement = typeof this.options.placement == 'function' ?
  897. this.options.placement.call(this, $tip[0], this.$element[0]) :
  898. this.options.placement
  899. $tip
  900. .detach()
  901. .css({top: 0, left: 0, display: 'block'})
  902. this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
  903. pos = this.getPosition()
  904. actualWidth = $tip[0].offsetWidth
  905. actualHeight = $tip[0].offsetHeight
  906. switch (placement) {
  907. case 'bottom':
  908. tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
  909. break
  910. case 'top':
  911. tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
  912. break
  913. case 'left':
  914. tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
  915. break
  916. case 'right':
  917. tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
  918. break
  919. }
  920. this.applyPlacement(tp, placement)
  921. this.$element.trigger('shown')
  922. }
  923. }
  924. , applyPlacement: function (offset, placement) {
  925. var $tip = this.tip()
  926. , width = $tip[0].offsetWidth
  927. , height = $tip[0].offsetHeight
  928. , actualWidth
  929. , actualHeight
  930. , delta
  931. , replace
  932. $tip
  933. .offset(offset)
  934. .addClass(placement)
  935. .addClass('in')
  936. actualWidth = $tip[0].offsetWidth
  937. actualHeight = $tip[0].offsetHeight
  938. if (placement == 'top' && actualHeight != height) {
  939. offset.top = offset.top + height - actualHeight
  940. replace = true
  941. }
  942. if (placement == 'bottom' || placement == 'top') {
  943. delta = 0
  944. if (offset.left < 0) {
  945. delta = offset.left * -2
  946. offset.left = 0
  947. $tip.offset(offset)
  948. actualWidth = $tip[0].offsetWidth
  949. actualHeight = $tip[0].offsetHeight
  950. }
  951. this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
  952. } else {
  953. this.replaceArrow(actualHeight - height, actualHeight, 'top')
  954. }
  955. if (replace) $tip.offset(offset)
  956. }
  957. , replaceArrow: function (delta, dimension, position) {
  958. this
  959. .arrow()
  960. .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
  961. }
  962. , setContent: function () {
  963. var $tip = this.tip()
  964. , title = this.getTitle()
  965. $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
  966. $tip.removeClass('fade in top bottom left right')
  967. }
  968. , hide: function () {
  969. var that = this
  970. , $tip = this.tip()
  971. , e = $.Event('hide')
  972. this.$element.trigger(e)
  973. if (e.isDefaultPrevented()) return
  974. $tip.removeClass('in')
  975. function removeWithAnimation() {
  976. var timeout = setTimeout(function () {
  977. $tip.off($.support.transition.end).detach()
  978. }, 500)
  979. $tip.one($.support.transition.end, function () {
  980. clearTimeout(timeout)
  981. $tip.detach()
  982. })
  983. }
  984. $.support.transition && this.$tip.hasClass('fade') ?
  985. removeWithAnimation() :
  986. $tip.detach()
  987. this.$element.trigger('hidden')
  988. return this
  989. }
  990. , fixTitle: function () {
  991. var $e = this.$element
  992. if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
  993. $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
  994. }
  995. }
  996. , hasContent: function () {
  997. return this.getTitle()
  998. }
  999. , getPosition: function () {
  1000. var el = this.$element[0]
  1001. return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
  1002. width: el.offsetWidth
  1003. , height: el.offsetHeight
  1004. }, this.$element.offset())
  1005. }
  1006. , getTitle: function () {
  1007. var title
  1008. , $e = this.$element
  1009. , o = this.options
  1010. title = $e.attr('data-original-title')
  1011. || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
  1012. return title
  1013. }
  1014. , tip: function () {
  1015. return this.$tip = this.$tip || $(this.options.template)
  1016. }
  1017. , arrow: function () {
  1018. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  1019. }
  1020. , validate: function () {
  1021. if (!this.$element[0].parentNode) {
  1022. this.hide()
  1023. this.$element = null
  1024. this.options = null
  1025. }
  1026. }
  1027. , enable: function () {
  1028. this.enabled = true
  1029. }
  1030. , disable: function () {
  1031. this.enabled = false
  1032. }
  1033. , toggleEnabled: function () {
  1034. this.enabled = !this.enabled
  1035. }
  1036. , toggle: function (e) {
  1037. var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
  1038. self.tip().hasClass('in') ? self.hide() : self.show()
  1039. }
  1040. , destroy: function () {
  1041. this.hide().$element.off('.' + this.type).removeData(this.type)
  1042. }
  1043. }
  1044. /* TOOLTIP PLUGIN DEFINITION
  1045. * ========================= */
  1046. var old = $.fn.tooltip
  1047. $.fn.tooltip = function (option) {
  1048. return this.each(function () {
  1049. var $this = $(this)
  1050. , data = $this.data('tooltip')
  1051. , options = typeof option == 'object' && option
  1052. if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
  1053. if (typeof option == 'string') data[option]()
  1054. })
  1055. }
  1056. $.fn.tooltip.Constructor = Tooltip
  1057. $.fn.tooltip.defaults = {
  1058. animation: true
  1059. , placement: 'top'
  1060. , selector: false
  1061. , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
  1062. , trigger: 'hover focus'
  1063. , title: ''
  1064. , delay: 0
  1065. , html: false
  1066. , container: false
  1067. }
  1068. /* TOOLTIP NO CONFLICT
  1069. * =================== */
  1070. $.fn.tooltip.noConflict = function () {
  1071. $.fn.tooltip = old
  1072. return this
  1073. }
  1074. }(window.jQuery);
  1075. /* ===========================================================
  1076. * bootstrap-popover.js v2.3.2
  1077. * http://getbootstrap.com/2.3.2/javascript.html#popovers
  1078. * ===========================================================
  1079. * Copyright 2013 Twitter, Inc.
  1080. *
  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.
  1092. * =========================================================== */
  1093. !function ($) {
  1094. "use strict"; // jshint ;_;
  1095. /* POPOVER PUBLIC CLASS DEFINITION
  1096. * =============================== */
  1097. var Popover = function (element, options) {
  1098. this.init('popover', element, options)
  1099. }
  1100. /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
  1101. ========================================== */
  1102. Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
  1103. constructor: Popover
  1104. , setContent: function () {
  1105. var $tip = this.tip()
  1106. , title = this.getTitle()
  1107. , content = this.getContent()
  1108. $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
  1109. $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
  1110. $tip.removeClass('fade top bottom left right in')
  1111. }
  1112. , hasContent: function () {
  1113. return this.getTitle() || this.getContent()
  1114. }
  1115. , getContent: function () {
  1116. var content
  1117. , $e = this.$element
  1118. , o = this.options
  1119. content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
  1120. || $e.attr('data-content')
  1121. return content
  1122. }
  1123. , tip: function () {
  1124. if (!this.$tip) {
  1125. this.$tip = $(this.options.template)
  1126. }
  1127. return this.$tip
  1128. }
  1129. , destroy: function () {
  1130. this.hide().$element.off('.' + this.type).removeData(this.type)
  1131. }
  1132. })
  1133. /* POPOVER PLUGIN DEFINITION
  1134. * ======================= */
  1135. var old = $.fn.popover
  1136. $.fn.popover = function (option) {
  1137. return this.each(function () {
  1138. var $this = $(this)
  1139. , data = $this.data('popover')
  1140. , options = typeof option == 'object' && option
  1141. if (!data) $this.data('popover', (data = new Popover(this, options)))
  1142. if (typeof option == 'string') data[option]()
  1143. })
  1144. }
  1145. $.fn.popover.Constructor = Popover
  1146. $.fn.popover.defaults = $.extend({}, $.fn.tooltip.defaults, {
  1147. placement: 'right'
  1148. ,
  1149. trigger: 'click'
  1150. ,
  1151. content: ''
  1152. ,
  1153. template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
  1154. })
  1155. /* POPOVER NO CONFLICT
  1156. * =================== */
  1157. $.fn.popover.noConflict = function () {
  1158. $.fn.popover = old
  1159. return this
  1160. }
  1161. }(window.jQuery);
  1162. /* =============================================================
  1163. * bootstrap-scrollspy.js v2.3.2
  1164. * http://getbootstrap.com/2.3.2/javascript.html#scrollspy
  1165. * =============================================================
  1166. * Copyright 2013 Twitter, Inc.
  1167. *
  1168. * Licensed under the Apache License, Version 2.0 (the "License");
  1169. * you may not use this file except in compliance with the License.
  1170. * You may obtain a copy of the License at
  1171. *
  1172. * http://www.apache.org/licenses/LICENSE-2.0
  1173. *
  1174. * Unless required by applicable law or agreed to in writing, software
  1175. * distributed under the License is distributed on an "AS IS" BASIS,
  1176. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1177. * See the License for the specific language governing permissions and
  1178. * limitations under the License.
  1179. * ============================================================== */
  1180. !function ($) {
  1181. "use strict"; // jshint ;_;
  1182. /* SCROLLSPY CLASS DEFINITION
  1183. * ========================== */
  1184. function ScrollSpy(element, options) {
  1185. var process = $.proxy(this.process, this)
  1186. , $element = $(element).is('body') ? $(window) : $(element)
  1187. , href
  1188. this.options = $.extend({}, $.fn.scrollspy.defaults, options)
  1189. this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
  1190. this.selector = (this.options.target
  1191. || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
  1192. || '') + ' .nav li > a'
  1193. this.$body = $('body')
  1194. this.refresh()
  1195. this.process()
  1196. }
  1197. ScrollSpy.prototype = {
  1198. constructor: ScrollSpy
  1199. , refresh: function () {
  1200. var self = this
  1201. , $targets
  1202. this.offsets = $([])
  1203. this.targets = $([])
  1204. $targets = this.$body
  1205. .find(this.selector)
  1206. .map(function () {
  1207. var $el = $(this)
  1208. , href = $el.data('target') || $el.attr('href')
  1209. , $href = /^#\w/.test(href) && $(href)
  1210. return ($href
  1211. && $href.length
  1212. && [[$href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href]]) || null
  1213. })
  1214. .sort(function (a, b) {
  1215. return a[0] - b[0]
  1216. })
  1217. .each(function () {
  1218. self.offsets.push(this[0])
  1219. self.targets.push(this[1])
  1220. })
  1221. }
  1222. , process: function () {
  1223. var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
  1224. , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
  1225. , maxScroll = scrollHeight - this.$scrollElement.height()
  1226. , offsets = this.offsets
  1227. , targets = this.targets
  1228. , activeTarget = this.activeTarget
  1229. , i
  1230. if (scrollTop >= maxScroll) {
  1231. return activeTarget != (i = targets.last()[0])
  1232. && this.activate(i)
  1233. }
  1234. for (i = offsets.length; i--;) {
  1235. activeTarget != targets[i]
  1236. && scrollTop >= offsets[i]
  1237. && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
  1238. && this.activate(targets[i])
  1239. }
  1240. }
  1241. , activate: function (target) {
  1242. var active
  1243. , selector
  1244. this.activeTarget = target
  1245. $(this.selector)
  1246. .parent('.active')
  1247. .removeClass('active')
  1248. selector = this.selector
  1249. + '[data-target="' + target + '"],'
  1250. + this.selector + '[href="' + target + '"]'
  1251. active = $(selector)
  1252. .parent('li')
  1253. .addClass('active')
  1254. if (active.parent('.dropdown-menu').length) {
  1255. active = active.closest('li.dropdown').addClass('active')
  1256. }
  1257. active.trigger('activate')
  1258. }
  1259. }
  1260. /* SCROLLSPY PLUGIN DEFINITION
  1261. * =========================== */
  1262. var old = $.fn.scrollspy
  1263. $.fn.scrollspy = function (option) {
  1264. return this.each(function () {
  1265. var $this = $(this)
  1266. , data = $this.data('scrollspy')
  1267. , options = typeof option == 'object' && option
  1268. if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
  1269. if (typeof option == 'string') data[option]()
  1270. })
  1271. }
  1272. $.fn.scrollspy.Constructor = ScrollSpy
  1273. $.fn.scrollspy.defaults = {
  1274. offset: 10
  1275. }
  1276. /* SCROLLSPY NO CONFLICT
  1277. * ===================== */
  1278. $.fn.scrollspy.noConflict = function () {
  1279. $.fn.scrollspy = old
  1280. return this
  1281. }
  1282. /* SCROLLSPY DATA-API
  1283. * ================== */
  1284. $(window).on('load', function () {
  1285. $('[data-spy="scroll"]').each(function () {
  1286. var $spy = $(this)
  1287. $spy.scrollspy($spy.data())
  1288. })
  1289. })
  1290. }(window.jQuery);/* ========================================================
  1291. * bootstrap-tab.js v2.3.2
  1292. * http://getbootstrap.com/2.3.2/javascript.html#tabs
  1293. * ========================================================
  1294. * Copyright 2013 Twitter, Inc.
  1295. *
  1296. * Licensed under the Apache License, Version 2.0 (the "License");
  1297. * you may not use this file except in compliance with the License.
  1298. * You may obtain a copy of the License at
  1299. *
  1300. * http://www.apache.org/licenses/LICENSE-2.0
  1301. *
  1302. * Unless required by applicable law or agreed to in writing, software
  1303. * distributed under the License is distributed on an "AS IS" BASIS,
  1304. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1305. * See the License for the specific language governing permissions and
  1306. * limitations under the License.
  1307. * ======================================================== */
  1308. !function ($) {
  1309. "use strict"; // jshint ;_;
  1310. /* TAB CLASS DEFINITION
  1311. * ==================== */
  1312. var Tab = function (element) {
  1313. this.element = $(element)
  1314. }
  1315. Tab.prototype = {
  1316. constructor: Tab
  1317. , show: function () {
  1318. var $this = this.element
  1319. , $ul = $this.closest('ul:not(.dropdown-menu)')
  1320. , selector = $this.attr('data-target')
  1321. , previous
  1322. , $target
  1323. , e
  1324. if (!selector) {
  1325. selector = $this.attr('href')
  1326. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  1327. }
  1328. if ($this.parent('li').hasClass('active')) return
  1329. previous = $ul.find('.active:last a')[0]
  1330. e = $.Event('show', {
  1331. relatedTarget: previous
  1332. })
  1333. $this.trigger(e)
  1334. if (e.isDefaultPrevented()) return
  1335. $target = $(selector)
  1336. this.activate($this.parent('li'), $ul)
  1337. this.activate($target, $target.parent(), function () {
  1338. $this.trigger({
  1339. type: 'shown'
  1340. , relatedTarget: previous
  1341. })
  1342. })
  1343. }
  1344. , activate: function (element, container, callback) {
  1345. var $active = container.find('> .active')
  1346. , transition = callback
  1347. && $.support.transition
  1348. && $active.hasClass('fade')
  1349. function next() {
  1350. $active
  1351. .removeClass('active')
  1352. .find('> .dropdown-menu > .active')
  1353. .removeClass('active')
  1354. element.addClass('active')
  1355. if (transition) {
  1356. element[0].offsetWidth // reflow for transition
  1357. element.addClass('in')
  1358. } else {
  1359. element.removeClass('fade')
  1360. }
  1361. if (element.parent('.dropdown-menu')) {
  1362. element.closest('li.dropdown').addClass('active')
  1363. }
  1364. callback && callback()
  1365. }
  1366. transition ?
  1367. $active.one($.support.transition.end, next) :
  1368. next()
  1369. $active.removeClass('in')
  1370. }
  1371. }
  1372. /* TAB PLUGIN DEFINITION
  1373. * ===================== */
  1374. var old = $.fn.tab
  1375. $.fn.tab = function (option) {
  1376. return this.each(function () {
  1377. var $this = $(this)
  1378. , data = $this.data('tab')
  1379. if (!data) $this.data('tab', (data = new Tab(this)))
  1380. if (typeof option == 'string') data[option]()
  1381. })
  1382. }
  1383. $.fn.tab.Constructor = Tab
  1384. /* TAB NO CONFLICT
  1385. * =============== */
  1386. $.fn.tab.noConflict = function () {
  1387. $.fn.tab = old
  1388. return this
  1389. }
  1390. /* TAB DATA-API
  1391. * ============ */
  1392. $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
  1393. e.preventDefault()
  1394. $(this).tab('show')
  1395. })
  1396. }(window.jQuery);/* =============================================================
  1397. * bootstrap-typeahead.js v2.3.2
  1398. * http://getbootstrap.com/2.3.2/javascript.html#typeahead
  1399. * =============================================================
  1400. * Copyright 2013 Twitter, Inc.
  1401. *
  1402. * Licensed under the Apache License, Version 2.0 (the "License");
  1403. * you may not use this file except in compliance with the License.
  1404. * You may obtain a copy of the License at
  1405. *
  1406. * http://www.apache.org/licenses/LICENSE-2.0
  1407. *
  1408. * Unless required by applicable law or agreed to in writing, software
  1409. * distributed under the License is distributed on an "AS IS" BASIS,
  1410. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1411. * See the License for the specific language governing permissions and
  1412. * limitations under the License.
  1413. * ============================================================ */
  1414. !function ($) {
  1415. "use strict"; // jshint ;_;
  1416. /* TYPEAHEAD PUBLIC CLASS DEFINITION
  1417. * ================================= */
  1418. var Typeahead = function (element, options) {
  1419. this.$element = $(element)
  1420. this.options = $.extend({}, $.fn.typeahead.defaults, options)
  1421. this.matcher = this.options.matcher || this.matcher
  1422. this.sorter = this.options.sorter || this.sorter
  1423. this.highlighter = this.options.highlighter || this.highlighter
  1424. this.updater = this.options.updater || this.updater
  1425. this.source = this.options.source
  1426. this.$menu = $(this.options.menu)
  1427. this.shown = false
  1428. this.listen()
  1429. }
  1430. Typeahead.prototype = {
  1431. constructor: Typeahead
  1432. , select: function () {
  1433. var val = this.$menu.find('.active').attr('data-value')
  1434. this.$element
  1435. .val(this.updater(val))
  1436. .change()
  1437. return this.hide()
  1438. }
  1439. , updater: function (item) {
  1440. return item
  1441. }
  1442. , show: function () {
  1443. var pos = $.extend({}, this.$element.position(), {
  1444. height: this.$element[0].offsetHeight
  1445. })
  1446. this.$menu
  1447. .insertAfter(this.$element)
  1448. .css({
  1449. top: pos.top + pos.height
  1450. , left: pos.left
  1451. })
  1452. .show()
  1453. this.shown = true
  1454. return this
  1455. }
  1456. , hide: function () {
  1457. this.$menu.hide()
  1458. this.shown = false
  1459. return this
  1460. }
  1461. , lookup: function (event) {
  1462. var items
  1463. this.query = this.$element.val()
  1464. if (!this.query || this.query.length < this.options.minLength) {
  1465. return this.shown ? this.hide() : this
  1466. }
  1467. items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
  1468. return items ? this.process(items) : this
  1469. }
  1470. , process: function (items) {
  1471. var that = this
  1472. items = $.grep(items, function (item) {
  1473. return that.matcher(item)
  1474. })
  1475. items = this.sorter(items)
  1476. if (!items.length) {
  1477. return this.shown ? this.hide() : this
  1478. }
  1479. return this.render(items.slice(0, this.options.items)).show()
  1480. }
  1481. , matcher: function (item) {
  1482. return ~item.toLowerCase().indexOf(this.query.toLowerCase())
  1483. }
  1484. , sorter: function (items) {
  1485. var beginswith = []
  1486. , caseSensitive = []
  1487. , caseInsensitive = []
  1488. , item
  1489. while (item = items.shift()) {
  1490. if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
  1491. else if (~item.indexOf(this.query)) caseSensitive.push(item)
  1492. else caseInsensitive.push(item)
  1493. }
  1494. return beginswith.concat(caseSensitive, caseInsensitive)
  1495. }
  1496. , highlighter: function (item) {
  1497. var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
  1498. return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
  1499. return '<strong>' + match + '</strong>'
  1500. })
  1501. }
  1502. , render: function (items) {
  1503. var that = this
  1504. items = $(items).map(function (i, item) {
  1505. i = $(that.options.item).attr('data-value', item)
  1506. i.find('a').html(that.highlighter(item))
  1507. return i[0]
  1508. })
  1509. items.first().addClass('active')
  1510. this.$menu.html(items)
  1511. return this
  1512. }
  1513. , next: function (event) {
  1514. var active = this.$menu.find('.active').removeClass('active')
  1515. , next = active.next()
  1516. if (!next.length) {
  1517. next = $(this.$menu.find('li')[0])
  1518. }
  1519. next.addClass('active')
  1520. }
  1521. , prev: function (event) {
  1522. var active = this.$menu.find('.active').removeClass('active')
  1523. , prev = active.prev()
  1524. if (!prev.length) {
  1525. prev = this.$menu.find('li').last()
  1526. }
  1527. prev.addClass('active')
  1528. }
  1529. , listen: function () {
  1530. this.$element
  1531. .on('focus', $.proxy(this.focus, this))
  1532. .on('blur', $.proxy(this.blur, this))
  1533. .on('keypress', $.proxy(this.keypress, this))
  1534. .on('keyup', $.proxy(this.keyup, this))
  1535. if (this.eventSupported('keydown')) {
  1536. this.$element.on('keydown', $.proxy(this.keydown, this))
  1537. }
  1538. this.$menu
  1539. .on('click', $.proxy(this.click, this))
  1540. .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
  1541. .on('mouseleave', 'li', $.proxy(this.mouseleave, this))
  1542. }
  1543. , eventSupported: function (eventName) {
  1544. var isSupported = eventName in this.$element
  1545. if (!isSupported) {
  1546. this.$element.setAttribute(eventName, 'return;')
  1547. isSupported = typeof this.$element[eventName] === 'function'
  1548. }
  1549. return isSupported
  1550. }
  1551. , move: function (e) {
  1552. if (!this.shown) return
  1553. switch (e.keyCode) {
  1554. case 9: // tab
  1555. case 13: // enter
  1556. case 27: // escape
  1557. e.preventDefault()
  1558. break
  1559. case 38: // up arrow
  1560. e.preventDefault()
  1561. this.prev()
  1562. break
  1563. case 40: // down arrow
  1564. e.preventDefault()
  1565. this.next()
  1566. break
  1567. }
  1568. e.stopPropagation()
  1569. }
  1570. , keydown: function (e) {
  1571. this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40, 38, 9, 13, 27])
  1572. this.move(e)
  1573. }
  1574. , keypress: function (e) {
  1575. if (this.suppressKeyPressRepeat) return
  1576. this.move(e)
  1577. }
  1578. , keyup: function (e) {
  1579. switch (e.keyCode) {
  1580. case 40: // down arrow
  1581. case 38: // up arrow
  1582. case 16: // shift
  1583. case 17: // ctrl
  1584. case 18: // alt
  1585. break
  1586. case 9: // tab
  1587. case 13: // enter
  1588. if (!this.shown) return
  1589. this.select()
  1590. break
  1591. case 27: // escape
  1592. if (!this.shown) return
  1593. this.hide()
  1594. break
  1595. default:
  1596. this.lookup()
  1597. }
  1598. e.stopPropagation()
  1599. e.preventDefault()
  1600. }
  1601. , focus: function (e) {
  1602. this.focused = true
  1603. }
  1604. , blur: function (e) {
  1605. this.focused = false
  1606. if (!this.mousedover && this.shown) this.hide()
  1607. }
  1608. , click: function (e) {
  1609. e.stopPropagation()
  1610. e.preventDefault()
  1611. this.select()
  1612. this.$element.focus()
  1613. }
  1614. , mouseenter: function (e) {
  1615. this.mousedover = true
  1616. this.$menu.find('.active').removeClass('active')
  1617. $(e.currentTarget).addClass('active')
  1618. }
  1619. , mouseleave: function (e) {
  1620. this.mousedover = false
  1621. if (!this.focused && this.shown) this.hide()
  1622. }
  1623. }
  1624. /* TYPEAHEAD PLUGIN DEFINITION
  1625. * =========================== */
  1626. var old = $.fn.typeahead
  1627. $.fn.typeahead = function (option) {
  1628. return this.each(function () {
  1629. var $this = $(this)
  1630. , data = $this.data('typeahead')
  1631. , options = typeof option == 'object' && option
  1632. if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
  1633. if (typeof option == 'string') data[option]()
  1634. })
  1635. }
  1636. $.fn.typeahead.defaults = {
  1637. source: []
  1638. , items: 8
  1639. , menu: '<ul class="typeahead dropdown-menu"></ul>'
  1640. , item: '<li><a href="#"></a></li>'
  1641. , minLength: 1
  1642. }
  1643. $.fn.typeahead.Constructor = Typeahead
  1644. /* TYPEAHEAD NO CONFLICT
  1645. * =================== */
  1646. $.fn.typeahead.noConflict = function () {
  1647. $.fn.typeahead = old
  1648. return this
  1649. }
  1650. /* TYPEAHEAD DATA-API
  1651. * ================== */
  1652. $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
  1653. var $this = $(this)
  1654. if ($this.data('typeahead')) return
  1655. $this.typeahead($this.data())
  1656. })
  1657. }(window.jQuery);
  1658. /* ==========================================================
  1659. * bootstrap-affix.js v2.3.2
  1660. * http://getbootstrap.com/2.3.2/javascript.html#affix
  1661. * ==========================================================
  1662. * Copyright 2013 Twitter, Inc.
  1663. *
  1664. * Licensed under the Apache License, Version 2.0 (the "License");
  1665. * you may not use this file except in compliance with the License.
  1666. * You may obtain a copy of the License at
  1667. *
  1668. * http://www.apache.org/licenses/LICENSE-2.0
  1669. *
  1670. * Unless required by applicable law or agreed to in writing, software
  1671. * distributed under the License is distributed on an "AS IS" BASIS,
  1672. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1673. * See the License for the specific language governing permissions and
  1674. * limitations under the License.
  1675. * ========================================================== */
  1676. !function ($) {
  1677. "use strict"; // jshint ;_;
  1678. /* AFFIX CLASS DEFINITION
  1679. * ====================== */
  1680. var Affix = function (element, options) {
  1681. this.options = $.extend({}, $.fn.affix.defaults, options)
  1682. this.$window = $(window)
  1683. .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
  1684. .on('click.affix.data-api', $.proxy(function () {
  1685. setTimeout($.proxy(this.checkPosition, this), 1)
  1686. }, this))
  1687. this.$element = $(element)
  1688. this.checkPosition()
  1689. }
  1690. Affix.prototype.checkPosition = function () {
  1691. if (!this.$element.is(':visible')) return
  1692. var scrollHeight = $(document).height()
  1693. , scrollTop = this.$window.scrollTop()
  1694. , position = this.$element.offset()
  1695. , offset = this.options.offset
  1696. , offsetBottom = offset.bottom
  1697. , offsetTop = offset.top
  1698. , reset = 'affix affix-top affix-bottom'
  1699. , affix
  1700. if (typeof offset != 'object') offsetBottom = offsetTop = offset
  1701. if (typeof offsetTop == 'function') offsetTop = offset.top()
  1702. if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
  1703. affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
  1704. false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
  1705. 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
  1706. 'top' : false
  1707. if (this.affixed === affix) return
  1708. this.affixed = affix
  1709. this.unpin = affix == 'bottom' ? position.top - scrollTop : null
  1710. this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
  1711. }
  1712. /* AFFIX PLUGIN DEFINITION
  1713. * ======================= */
  1714. var old = $.fn.affix
  1715. $.fn.affix = function (option) {
  1716. return this.each(function () {
  1717. var $this = $(this)
  1718. , data = $this.data('affix')
  1719. , options = typeof option == 'object' && option
  1720. if (!data) $this.data('affix', (data = new Affix(this, options)))
  1721. if (typeof option == 'string') data[option]()
  1722. })
  1723. }
  1724. $.fn.affix.Constructor = Affix
  1725. $.fn.affix.defaults = {
  1726. offset: 0
  1727. }
  1728. /* AFFIX NO CONFLICT
  1729. * ================= */
  1730. $.fn.affix.noConflict = function () {
  1731. $.fn.affix = old
  1732. return this
  1733. }
  1734. /* AFFIX DATA-API
  1735. * ============== */
  1736. $(window).on('load', function () {
  1737. $('[data-spy="affix"]').each(function () {
  1738. var $spy = $(this)
  1739. , data = $spy.data()
  1740. data.offset = data.offset || {}
  1741. data.offsetBottom && (data.offset.bottom = data.offsetBottom)
  1742. data.offsetTop && (data.offset.top = data.offsetTop)
  1743. $spy.affix(data)
  1744. })
  1745. })
  1746. }(window.jQuery);