Difference between revisions of "Team:Aix-Marseille/java"
(Created page with "→! * Bootstrap v3.1.1 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE): if (type...") |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | /*! | + | <!DOCTYPE html> |
+ | <html lang="en" dir="ltr" class="client-nojs"> | ||
+ | <head> | ||
+ | <meta charset="UTF-8" /> | ||
+ | <title>Team:Aix-Marseille/bootstrap.js - 2015.igem.org</title> | ||
+ | <meta name="generator" content="MediaWiki 1.24.1" /> | ||
+ | <link rel="alternate" type="application/x-wiki" title="Edit" href="/wiki/index.php?title=Team:Aix-Marseille/bootstrap.js&action=edit" /> | ||
+ | <link rel="edit" title="Edit" href="/wiki/index.php?title=Team:Aix-Marseille/bootstrap.js&action=edit" /> | ||
+ | <link rel="shortcut icon" href="/favicon.ico" /> | ||
+ | <link rel="search" type="application/opensearchdescription+xml" href="/wiki/opensearch_desc.php" title="2015.igem.org (en)" /> | ||
+ | <link rel="EditURI" type="application/rsd+xml" href="https://2015.igem.org/wiki/api.php?action=rsd" /> | ||
+ | <link rel="alternate" hreflang="x-default" href="/Team:Aix-Marseille/bootstrap.js" /> | ||
+ | <link rel="copyright" href="http://creativecommons.org/licenses/by/3.0/" /> | ||
+ | <link rel="alternate" type="application/atom+xml" title="2015.igem.org Atom feed" href="/wiki/index.php?title=Special:RecentChanges&feed=atom" /> | ||
+ | <link rel="stylesheet" href="https://2015.igem.org/wiki/load.php?debug=false&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.content.externallinks%7Cmediawiki.skinning.interface%7Cmediawiki.ui.button%7Cskins.igem.styles&only=styles&skin=igem&*" /> | ||
+ | <!--[if IE 6]><link rel="stylesheet" href="/wiki/skins/Igem/IE60Fixes.css?303" media="screen" /><![endif]--> | ||
+ | <!--[if IE 7]><link rel="stylesheet" href="/wiki/skins/Igem/IE70Fixes.css?303" media="screen" /><![endif]--><meta name="ResourceLoaderDynamicStyles" content="" /> | ||
+ | <style>a:lang(ar),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none} | ||
+ | /* cache key: 2015_igem_org:resourceloader:filter:minify-css:7:875d2068ffef0b9ce1dbab8400ce2379 */</style> | ||
+ | <script src="https://2015.igem.org/wiki/load.php?debug=false&lang=en&modules=startup&only=scripts&skin=igem&*"></script> | ||
+ | <script>if(window.mw){ | ||
+ | mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Team:Aix-Marseille/bootstrap.js","wgTitle":"Team:Aix-Marseille/bootstrap.js","wgCurRevisionId":86482,"wgRevisionId":86482,"wgArticleId":12189,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":"Marion.Aruanno","wgUserGroups":["*","user","autoconfirmed"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"Team:Aix-Marseille/bootstrap.js","wgUserId":2801,"wgUserEditCount":75,"wgUserRegistration":1436956066000,"wgUserNewMsgRevisionId":null,"wgIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgWikiEditorEnabledModules":{"toolbar":false,"dialogs":false,"hidesig":true,"preview":false,"previewDialog":false,"publish":false}}); | ||
+ | }</script><script>if(window.mw){ | ||
+ | mw.loader.implement("user.options",function($,jQuery){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"editfont":"default","editondblclick":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":1,"extendwatchlist":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nickname":"","norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"rcdays":7,"rclimit":50,"rows":25,"showhiddencats":0,"shownumberswatching":1,"showtoolbar":1,"skin":"igem","stubthreshold":0,"thumbsize":5,"underline":2,"uselivepreview":0,"usenewrc":1,"watchcreations":1,"watchdefault":1,"watchdeletion":0,"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"watchrollback":0, | ||
+ | "wllimit":250,"useeditwarning":1,"prefershttps":1,"language":"en","variant-gan":"gan","variant-iu":"iu","variant-kk":"kk","variant-ku":"ku","variant-shi":"shi","variant-sr":"sr","variant-tg":"tg","variant-uz":"uz","variant-zh":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false});},{},{});mw.loader.implement("user.tokens",function($,jQuery){mw.user.tokens.set({"editToken":"35d9ded3bdc0e9fc748ef7c1d00f97eb+\\","patrolToken":"fac309d8172f5f93ead753521ba7763e+\\","watchToken":"1a07bdea33a069427f07e5197df6bd75+\\"});},{},{}); | ||
+ | /* cache key: 2015_igem_org:resourceloader:filter:minify-js:7:9164be07b080bbc59bb57d225ab1edcb */ | ||
+ | }</script> | ||
+ | <script>if(window.mw){ | ||
+ | mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]); | ||
+ | }</script> | ||
+ | </head> | ||
+ | <body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-Team_Aix-Marseille_bootstrap_js skin-igem action-view"> | ||
− | * Bootstrap v3.1.1 (http://getbootstrap.com) | + | <script type='text/javascript' src ='/common/tablesorter/jquery.tablesorter.min.js'></script> |
+ | <link rel='stylesheet' type='text/css' href='/common/tablesorter/themes/groupparts/style.css' /> | ||
+ | <link rel='stylesheet' type='text/css' href='/common/table_styles.css' /> | ||
+ | |||
+ | <div id='globalWrapper'> | ||
+ | <div id='top_menu_under' class='noprint'></div> | ||
+ | <div id='top_menu_14' class='noprint'>Loading menubar.....</div> <!-- Will be replaced with the jQuery.load --> | ||
+ | <script>jQuery('#top_menu_14').load('https://2015.igem.org/cgi/top_menu_14/menubar_reply.cgi', | ||
+ | { t:"Team%3AAix-Marseille%2Fbootstrap.js", | ||
+ | a:"View+%2FTeam%3AAix-Marseille%2Fbootstrap.js++Edit+%2Fwiki%2Findex.php%3Ftitle%3DTeam%3AAix-Marseille%2Fbootstrap.js%26action%3Dedit++History+%2Fwiki%2Findex.php%3Ftitle%3DTeam%3AAix-Marseille%2Fbootstrap.js%26action%3Dhistory++Move+%2FSpecial%3AMovePage%2FTeam%3AAix-Marseille%2Fbootstrap.js++Watch+%2Fwiki%2Findex.php%3Ftitle%3DTeam%3AAix-Marseille%2Fbootstrap.js%26action%3Dwatch%26token%3D99378be6b5e17d2f038c18e2638b9692%252B%255C++Page+%2FTeam%3AAix-Marseille%2Fbootstrap.js++Discussion+%2Fwiki%2Findex.php%3Ftitle%3DTalk%3ATeam%3AAix-Marseille%2Fbootstrap.js%26action%3Dedit%26redlink%3D1++" }); | ||
+ | |||
+ | </script> | ||
+ | <div id="content" class="mw-body" role="main"> | ||
+ | <a id="top"></a> | ||
+ | <h1 id="firstHeading" class="firstHeading"> | ||
+ | <span dir="auto">Team:Aix-Marseille/bootstrap.js</span> | ||
+ | </h1> | ||
+ | <div id="bodyContent"> | ||
+ | <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><p>/*! | ||
+ | </p> | ||
+ | <pre>* Bootstrap v3.1.1 (<a rel="nofollow" class="external free" href="http://getbootstrap.com">http://getbootstrap.com</a>) | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
*/ | */ | ||
− | + | </pre> | |
− | if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } | + | <p>if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: transition.js v3.1.1 | |
− | * Bootstrap: transition.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#transitions">http://getbootstrap.com/javascript/#transitions</a> |
− | * http://getbootstrap.com/javascript/#transitions | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // CSS TRANSITION SUPPORT (Shoutout: <a rel="nofollow" class="external free" href="http://www.modernizr.com/">http://www.modernizr.com/</a>) | |
// ============================================================ | // ============================================================ | ||
− | + | </pre> | |
− | + | <pre> function transitionEnd() { | |
var el = document.createElement('bootstrap') | var el = document.createElement('bootstrap') | ||
− | + | </pre> | |
− | + | <pre> var transEndEventNames = { | |
− | 'WebkitTransition' : 'webkitTransitionEnd', | + | 'WebkitTransition' : 'webkitTransitionEnd', |
− | 'MozTransition' | + | 'MozTransition'  : 'transitionend', |
− | 'OTransition' | + | 'OTransition'  : 'oTransitionEnd otransitionend', |
− | 'transition' | + | 'transition'  : 'transitionend' |
} | } | ||
− | + | </pre> | |
− | + | <pre> for (var name in transEndEventNames) { | |
− | if (el.style[name] !== undefined) { | + | if (el.style[name] !== undefined) { |
return { end: transEndEventNames[name] } | return { end: transEndEventNames[name] } | ||
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> return false // explicit for ie8 ( ._.) | |
} | } | ||
− | + | </pre> | |
− | + | <pre> // <a rel="nofollow" class="external free" href="http://blog.alexmaccaw.com/css-transitions">http://blog.alexmaccaw.com/css-transitions</a> | |
$.fn.emulateTransitionEnd = function (duration) { | $.fn.emulateTransitionEnd = function (duration) { | ||
var called = false, $el = this | var called = false, $el = this | ||
Line 52: | Line 102: | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $(function () { | |
$.support.transition = transitionEnd() | $.support.transition = transitionEnd() | ||
}) | }) | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: alert.js v3.1.1 | |
− | * Bootstrap: alert.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#alerts">http://getbootstrap.com/javascript/#alerts</a> |
− | * http://getbootstrap.com/javascript/#alerts | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // ALERT CLASS DEFINITION | |
// ====================== | // ====================== | ||
− | + | </pre> | |
− | + | <pre> var dismiss = '[data-dismiss="alert"]' | |
var Alert = function (el) { | var Alert = function (el) { | ||
$(el).on('click', dismiss, this.close) | $(el).on('click', dismiss, this.close) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Alert.prototype.close = function (e) { | |
var $this = $(this) | var $this = $(this) | ||
var selector = $this.attr('data-target') | var selector = $this.attr('data-target') | ||
− | + | </pre> | |
− | + | <pre> if (!selector) { | |
selector = $this.attr('href') | selector = $this.attr('href') | ||
− | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ) // strip for ie7 | + | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, <i>) // strip for ie7</i> |
} | } | ||
− | + | </pre> | |
− | + | <pre> var $parent = $(selector) | |
− | + | </pre> | |
− | + | <pre> if (e) e.preventDefault() | |
− | + | </pre> | |
− | + | <pre> if (!$parent.length) { | |
− | $parent = $this.hasClass('alert') ? $this : $this.parent() | + | $parent = $this.hasClass('alert') ? $this : $this.parent() |
} | } | ||
− | + | </pre> | |
− | + | <pre> $parent.trigger(e = $.Event('close.bs.alert')) | |
− | + | </pre> | |
− | + | <pre> if (e.isDefaultPrevented()) return | |
− | + | </pre> | |
− | + | <pre> $parent.removeClass('in') | |
− | + | </pre> | |
− | + | <pre> function removeElement() { | |
$parent.trigger('closed.bs.alert').remove() | $parent.trigger('closed.bs.alert').remove() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.support.transition && $parent.hasClass('fade') ? | |
$parent | $parent | ||
.one($.support.transition.end, removeElement) | .one($.support.transition.end, removeElement) | ||
− | .emulateTransitionEnd(150) : | + | .emulateTransitionEnd(150) : |
removeElement() | removeElement() | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // ALERT PLUGIN DEFINITION | ||
// ======================= | // ======================= | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.alert | |
− | + | </pre> | |
− | + | <pre> $.fn.alert = function (option) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.alert') | var data = $this.data('bs.alert') | ||
− | + | </pre> | |
− | + | <pre> if (!data) $this.data('bs.alert', (data = new Alert(this))) | |
if (typeof option == 'string') data[option].call($this) | if (typeof option == 'string') data[option].call($this) | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.alert.Constructor = Alert | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // ALERT NO CONFLICT | ||
// ================= | // ================= | ||
− | + | </pre> | |
− | + | <pre> $.fn.alert.noConflict = function () { | |
$.fn.alert = old | $.fn.alert = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // ALERT DATA-API | ||
// ============== | // ============== | ||
− | + | </pre> | |
− | + | <pre> $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) | |
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: button.js v3.1.1 | |
− | * Bootstrap: button.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#buttons">http://getbootstrap.com/javascript/#buttons</a> |
− | * http://getbootstrap.com/javascript/#buttons | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // BUTTON PUBLIC CLASS DEFINITION | |
// ============================== | // ============================== | ||
− | + | </pre> | |
− | + | <pre> var Button = function (element, options) { | |
this.$element = $(element) | this.$element = $(element) | ||
this.options = $.extend({}, Button.DEFAULTS, options) | this.options = $.extend({}, Button.DEFAULTS, options) | ||
this.isLoading = false | this.isLoading = false | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Button.DEFAULTS = { | |
loadingText: 'loading...' | loadingText: 'loading...' | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Button.prototype.setState = function (state) { | |
var d = 'disabled' | var d = 'disabled' | ||
var $el = this.$element | var $el = this.$element | ||
− | var val = $el.is('input') ? 'val' : 'html' | + | var val = $el.is('input') ? 'val' : 'html' |
var data = $el.data() | var data = $el.data() | ||
− | + | </pre> | |
− | + | <pre> state = state + 'Text' | |
− | + | </pre> | |
− | + | <pre> if (!data.resetText) $el.data('resetText', $el[val]()) | |
− | + | </pre> | |
− | + | <pre> $el[val](data[state] || this.options[state]) | |
− | + | </pre> | |
− | + | <pre> // push to event loop to allow forms to submit | |
setTimeout($.proxy(function () { | setTimeout($.proxy(function () { | ||
if (state == 'loadingText') { | if (state == 'loadingText') { | ||
Line 200: | Line 251: | ||
}, this), 0) | }, this), 0) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Button.prototype.toggle = function () { | |
var changed = true | var changed = true | ||
var $parent = this.$element.closest('[data-toggle="buttons"]') | var $parent = this.$element.closest('[data-toggle="buttons"]') | ||
− | + | </pre> | |
− | + | <pre> if ($parent.length) { | |
var $input = this.$element.find('input') | var $input = this.$element.find('input') | ||
if ($input.prop('type') == 'radio') { | if ($input.prop('type') == 'radio') { | ||
− | if ($input.prop('checked') && this.$element.hasClass('active')) changed = false | + | if ($input.prop('checked') && this.$element.hasClass('active')) changed = false |
else $parent.find('.active').removeClass('active') | else $parent.find('.active').removeClass('active') | ||
} | } | ||
− | if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') | + | if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') |
} | } | ||
− | + | </pre> | |
− | + | <pre> if (changed) this.$element.toggleClass('active') | |
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // BUTTON PLUGIN DEFINITION | ||
// ======================== | // ======================== | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.button | |
− | + | </pre> | |
− | + | <pre> $.fn.button = function (option) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.button') | var data = $this.data('bs.button') | ||
− | var options = typeof option == 'object' && option | + | var options = typeof option == 'object' && option |
− | + | </pre> | |
− | + | <pre> if (!data) $this.data('bs.button', (data = new Button(this, options))) | |
− | + | </pre> | |
− | + | <pre> if (option == 'toggle') data.toggle() | |
else if (option) data.setState(option) | else if (option) data.setState(option) | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.button.Constructor = Button | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // BUTTON NO CONFLICT | ||
// ================== | // ================== | ||
− | + | </pre> | |
− | + | <pre> $.fn.button.noConflict = function () { | |
$.fn.button = old | $.fn.button = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // BUTTON DATA-API | ||
// =============== | // =============== | ||
− | + | </pre> | |
− | + | <pre> $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { | |
var $btn = $(e.target) | var $btn = $(e.target) | ||
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') | ||
Line 257: | Line 311: | ||
e.preventDefault() | e.preventDefault() | ||
}) | }) | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: carousel.js v3.1.1 | |
− | * Bootstrap: carousel.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#carousel">http://getbootstrap.com/javascript/#carousel</a> |
− | * http://getbootstrap.com/javascript/#carousel | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // CAROUSEL CLASS DEFINITION | |
// ========================= | // ========================= | ||
− | + | </pre> | |
− | + | <pre> var Carousel = function (element, options) { | |
this.$element = $(element) | this.$element = $(element) | ||
this.$indicators = this.$element.find('.carousel-indicators') | this.$indicators = this.$element.find('.carousel-indicators') | ||
Line 286: | Line 339: | ||
this.$active = | this.$active = | ||
this.$items = null | this.$items = null | ||
− | + | </pre> | |
− | + | <pre> this.options.pause == 'hover' && this.$element | |
.on('mouseenter', $.proxy(this.pause, this)) | .on('mouseenter', $.proxy(this.pause, this)) | ||
.on('mouseleave', $.proxy(this.cycle, this)) | .on('mouseleave', $.proxy(this.cycle, this)) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Carousel.DEFAULTS = { | |
interval: 5000, | interval: 5000, | ||
pause: 'hover', | pause: 'hover', | ||
wrap: true | wrap: true | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Carousel.prototype.cycle = function (e) { | |
e || (this.paused = false) | e || (this.paused = false) | ||
− | + | </pre> | |
− | + | <pre> this.interval && clearInterval(this.interval) | |
− | + | </pre> | |
− | + | <pre> this.options.interval | |
− | && !this.paused | + | && !this.paused |
− | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) | + | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) |
− | + | </pre> | |
− | + | <pre> return this | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Carousel.prototype.getActiveIndex = function () { | |
this.$active = this.$element.find('.item.active') | this.$active = this.$element.find('.item.active') | ||
this.$items = this.$active.parent().children() | this.$items = this.$active.parent().children() | ||
− | + | </pre> | |
− | + | <pre> return this.$items.index(this.$active) | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Carousel.prototype.to = function (pos) { | |
var that = this | var that = this | ||
var activeIndex = this.getActiveIndex() | var activeIndex = this.getActiveIndex() | ||
− | + | </pre> | |
− | + | <pre> if (pos > (this.$items.length - 1) || pos < 0) return | |
− | + | </pre> | |
− | + | <pre> if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) | |
if (activeIndex == pos) return this.pause().cycle() | if (activeIndex == pos) return this.pause().cycle() | ||
− | + | </pre> | |
− | + | <pre> return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Carousel.prototype.pause = function (e) { | |
e || (this.paused = true) | e || (this.paused = true) | ||
− | + | </pre> | |
− | + | <pre> if (this.$element.find('.next, .prev').length && $.support.transition) { | |
this.$element.trigger($.support.transition.end) | this.$element.trigger($.support.transition.end) | ||
this.cycle(true) | this.cycle(true) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> this.interval = clearInterval(this.interval) | |
− | + | </pre> | |
− | + | <pre> return this | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Carousel.prototype.next = function () { | |
if (this.sliding) return | if (this.sliding) return | ||
return this.slide('next') | return this.slide('next') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Carousel.prototype.prev = function () { | |
if (this.sliding) return | if (this.sliding) return | ||
return this.slide('prev') | return this.slide('prev') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Carousel.prototype.slide = function (type, next) { | |
var $active = this.$element.find('.item.active') | var $active = this.$element.find('.item.active') | ||
var $next = next || $active[type]() | var $next = next || $active[type]() | ||
var isCycling = this.interval | var isCycling = this.interval | ||
− | var direction = type == 'next' ? 'left' : 'right' | + | var direction = type == 'next' ? 'left' : 'right' |
− | var fallback = type == 'next' ? 'first' : 'last' | + | var fallback = type == 'next' ? 'first' : 'last' |
var that = this | var that = this | ||
− | + | </pre> | |
− | + | <pre> if (!$next.length) { | |
if (!this.options.wrap) return | if (!this.options.wrap) return | ||
$next = this.$element.find('.item')[fallback]() | $next = this.$element.find('.item')[fallback]() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> if ($next.hasClass('active')) return this.sliding = false | |
− | + | </pre> | |
− | + | <pre> var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) | |
this.$element.trigger(e) | this.$element.trigger(e) | ||
if (e.isDefaultPrevented()) return | if (e.isDefaultPrevented()) return | ||
− | + | </pre> | |
− | + | <pre> this.sliding = true | |
− | + | </pre> | |
− | + | <pre> isCycling && this.pause() | |
− | + | </pre> | |
− | + | <pre> if (this.$indicators.length) { | |
this.$indicators.find('.active').removeClass('active') | this.$indicators.find('.active').removeClass('active') | ||
this.$element.one('slid.bs.carousel', function () { | this.$element.one('slid.bs.carousel', function () { | ||
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) | var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) | ||
− | $nextIndicator && $nextIndicator.addClass('active') | + | $nextIndicator && $nextIndicator.addClass('active') |
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> if ($.support.transition && this.$element.hasClass('slide')) { | |
$next.addClass(type) | $next.addClass(type) | ||
$next[0].offsetWidth // force reflow | $next[0].offsetWidth // force reflow | ||
Line 402: | Line 455: | ||
this.$element.trigger('slid.bs.carousel') | this.$element.trigger('slid.bs.carousel') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> isCycling && this.cycle() | |
− | + | </pre> | |
− | + | <pre> return this | |
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // CAROUSEL PLUGIN DEFINITION | ||
// ========================== | // ========================== | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.carousel | |
− | + | </pre> | |
− | + | <pre> $.fn.carousel = function (option) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.carousel') | var data = $this.data('bs.carousel') | ||
− | var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) | + | var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) |
− | var action = typeof option == 'string' ? option : options.slide | + | var action = typeof option == 'string' ? option : options.slide |
− | + | </pre> | |
− | + | <pre> if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) | |
if (typeof option == 'number') data.to(option) | if (typeof option == 'number') data.to(option) | ||
else if (action) data[action]() | else if (action) data[action]() | ||
Line 427: | Line 481: | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.carousel.Constructor = Carousel | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // CAROUSEL NO CONFLICT | ||
// ==================== | // ==================== | ||
− | + | </pre> | |
− | + | <pre> $.fn.carousel.noConflict = function () { | |
$.fn.carousel = old | $.fn.carousel = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // CAROUSEL DATA-API | ||
// ================= | // ================= | ||
− | + | </pre> | |
− | + | <pre> $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { | |
var $this = $(this), href | var $this = $(this), href | ||
− | var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, )) //strip for ie7 | + | var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, <i>)) //strip for ie7</i> |
var options = $.extend({}, $target.data(), $this.data()) | var options = $.extend({}, $target.data(), $this.data()) | ||
var slideIndex = $this.attr('data-slide-to') | var slideIndex = $this.attr('data-slide-to') | ||
if (slideIndex) options.interval = false | if (slideIndex) options.interval = false | ||
− | + | </pre> | |
− | + | <pre> $target.carousel(options) | |
− | + | </pre> | |
− | + | <pre> if (slideIndex = $this.attr('data-slide-to')) { | |
$target.data('bs.carousel').to(slideIndex) | $target.data('bs.carousel').to(slideIndex) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> e.preventDefault() | |
}) | }) | ||
− | + | </pre> | |
− | + | <pre> $(window).on('load', function () { | |
$('[data-ride="carousel"]').each(function () { | $('[data-ride="carousel"]').each(function () { | ||
var $carousel = $(this) | var $carousel = $(this) | ||
Line 465: | Line 521: | ||
}) | }) | ||
}) | }) | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: collapse.js v3.1.1 | |
− | * Bootstrap: collapse.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#collapse">http://getbootstrap.com/javascript/#collapse</a> |
− | * http://getbootstrap.com/javascript/#collapse | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // COLLAPSE PUBLIC CLASS DEFINITION | |
// ================================ | // ================================ | ||
− | + | </pre> | |
− | + | <pre> var Collapse = function (element, options) { | |
this.$element = $(element) | this.$element = $(element) | ||
this.options = $.extend({}, Collapse.DEFAULTS, options) | this.options = $.extend({}, Collapse.DEFAULTS, options) | ||
this.transitioning = null | this.transitioning = null | ||
− | + | </pre> | |
− | + | <pre> if (this.options.parent) this.$parent = $(this.options.parent) | |
if (this.options.toggle) this.toggle() | if (this.options.toggle) this.toggle() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Collapse.DEFAULTS = { | |
toggle: true | toggle: true | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Collapse.prototype.dimension = function () { | |
var hasWidth = this.$element.hasClass('width') | var hasWidth = this.$element.hasClass('width') | ||
− | return hasWidth ? 'width' : 'height' | + | return hasWidth ? 'width' : 'height' |
} | } | ||
− | + | </pre> | |
− | + | <pre> Collapse.prototype.show = function () { | |
if (this.transitioning || this.$element.hasClass('in')) return | if (this.transitioning || this.$element.hasClass('in')) return | ||
− | + | </pre> | |
− | + | <pre> var startEvent = $.Event('show.bs.collapse') | |
this.$element.trigger(startEvent) | this.$element.trigger(startEvent) | ||
if (startEvent.isDefaultPrevented()) return | if (startEvent.isDefaultPrevented()) return | ||
− | + | </pre> | |
− | + | <pre> var actives = this.$parent && this.$parent.find('> .panel > .in') | |
− | + | </pre> | |
− | + | <pre> if (actives && actives.length) { | |
var hasData = actives.data('bs.collapse') | var hasData = actives.data('bs.collapse') | ||
− | if (hasData && hasData.transitioning) return | + | if (hasData && hasData.transitioning) return |
actives.collapse('hide') | actives.collapse('hide') | ||
hasData || actives.data('bs.collapse', null) | hasData || actives.data('bs.collapse', null) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> var dimension = this.dimension() | |
− | + | </pre> | |
− | + | <pre> this.$element | |
.removeClass('collapse') | .removeClass('collapse') | ||
.addClass('collapsing') | .addClass('collapsing') | ||
[dimension](0) | [dimension](0) | ||
− | + | </pre> | |
− | + | <pre> this.transitioning = 1 | |
− | + | </pre> | |
− | + | <pre> var complete = function () { | |
this.$element | this.$element | ||
.removeClass('collapsing') | .removeClass('collapsing') | ||
Line 536: | Line 591: | ||
this.$element.trigger('shown.bs.collapse') | this.$element.trigger('shown.bs.collapse') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> if (!$.support.transition) return complete.call(this) | |
− | + | </pre> | |
− | + | <pre> var scrollSize = $.camelCase(['scroll', dimension].join('-')) | |
− | + | </pre> | |
− | + | <pre> this.$element | |
.one($.support.transition.end, $.proxy(complete, this)) | .one($.support.transition.end, $.proxy(complete, this)) | ||
.emulateTransitionEnd(350) | .emulateTransitionEnd(350) | ||
[dimension](this.$element[0][scrollSize]) | [dimension](this.$element[0][scrollSize]) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Collapse.prototype.hide = function () { | |
− | if (this.transitioning || !this.$element.hasClass('in')) return | + | if (this.transitioning || !this.$element.hasClass('in')) return |
− | + | </pre> | |
− | + | <pre> var startEvent = $.Event('hide.bs.collapse') | |
this.$element.trigger(startEvent) | this.$element.trigger(startEvent) | ||
if (startEvent.isDefaultPrevented()) return | if (startEvent.isDefaultPrevented()) return | ||
− | + | </pre> | |
− | + | <pre> var dimension = this.dimension() | |
− | + | </pre> | |
− | + | <pre> this.$element | |
[dimension](this.$element[dimension]()) | [dimension](this.$element[dimension]()) | ||
[0].offsetHeight | [0].offsetHeight | ||
− | + | </pre> | |
− | + | <pre> this.$element | |
.addClass('collapsing') | .addClass('collapsing') | ||
.removeClass('collapse') | .removeClass('collapse') | ||
.removeClass('in') | .removeClass('in') | ||
− | + | </pre> | |
− | + | <pre> this.transitioning = 1 | |
− | + | </pre> | |
− | + | <pre> var complete = function () { | |
this.transitioning = 0 | this.transitioning = 0 | ||
this.$element | this.$element | ||
Line 574: | Line 629: | ||
.addClass('collapse') | .addClass('collapse') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> if (!$.support.transition) return complete.call(this) | |
− | + | </pre> | |
− | + | <pre> this.$element | |
[dimension](0) | [dimension](0) | ||
.one($.support.transition.end, $.proxy(complete, this)) | .one($.support.transition.end, $.proxy(complete, this)) | ||
.emulateTransitionEnd(350) | .emulateTransitionEnd(350) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Collapse.prototype.toggle = function () { | |
− | this[this.$element.hasClass('in') ? 'hide' : 'show']() | + | this[this.$element.hasClass('in') ? 'hide' : 'show']() |
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // COLLAPSE PLUGIN DEFINITION | ||
// ========================== | // ========================== | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.collapse | |
− | + | </pre> | |
− | + | <pre> $.fn.collapse = function (option) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.collapse') | var data = $this.data('bs.collapse') | ||
− | var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) | + | var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) |
− | + | </pre> | |
− | + | <pre> if (!data && options.toggle && option == 'show') option = !option | |
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) | if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) | ||
if (typeof option == 'string') data[option]() | if (typeof option == 'string') data[option]() | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.collapse.Constructor = Collapse | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // COLLAPSE NO CONFLICT | ||
// ==================== | // ==================== | ||
− | + | </pre> | |
− | + | <pre> $.fn.collapse.noConflict = function () { | |
$.fn.collapse = old | $.fn.collapse = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // COLLAPSE DATA-API | ||
// ================= | // ================= | ||
− | + | </pre> | |
− | + | <pre> $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { | |
var $this = $(this), href | var $this = $(this), href | ||
var target = $this.attr('data-target') | var target = $this.attr('data-target') | ||
|| e.preventDefault() | || e.preventDefault() | ||
− | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, ) //strip for ie7 | + | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, <i>) //strip for ie7</i> |
var $target = $(target) | var $target = $(target) | ||
var data = $target.data('bs.collapse') | var data = $target.data('bs.collapse') | ||
− | var option = data ? 'toggle' : $this.data() | + | var option = data ? 'toggle' : $this.data() |
var parent = $this.attr('data-parent') | var parent = $this.attr('data-parent') | ||
− | var $parent = parent && $(parent) | + | var $parent = parent && $(parent) |
− | + | </pre> | |
− | + | <pre> if (!data || !data.transitioning) { | |
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') | if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') | ||
− | $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') | + | $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') |
} | } | ||
− | + | </pre> | |
− | + | <pre> $target.collapse(option) | |
}) | }) | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: dropdown.js v3.1.1 | |
− | * Bootstrap: dropdown.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#dropdowns">http://getbootstrap.com/javascript/#dropdowns</a> |
− | * http://getbootstrap.com/javascript/#dropdowns | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // DROPDOWN CLASS DEFINITION | |
// ========================= | // ========================= | ||
− | + | </pre> | |
− | + | <pre> var backdrop = '.dropdown-backdrop' | |
var toggle = '[data-toggle=dropdown]' | var toggle = '[data-toggle=dropdown]' | ||
var Dropdown = function (element) { | var Dropdown = function (element) { | ||
$(element).on('click.bs.dropdown', this.toggle) | $(element).on('click.bs.dropdown', this.toggle) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Dropdown.prototype.toggle = function (e) { | |
var $this = $(this) | var $this = $(this) | ||
− | + | </pre> | |
− | + | <pre> if ($this.is('.disabled, :disabled')) return | |
− | + | </pre> | |
− | + | <pre> var $parent = getParent($this) | |
var isActive = $parent.hasClass('open') | var isActive = $parent.hasClass('open') | ||
− | + | </pre> | |
− | + | <pre> clearMenus() | |
− | + | </pre> | |
− | + | <pre> if (!isActive) { | |
− | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { | + | if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { |
// if mobile we use a backdrop because click events don't delegate | // if mobile we use a backdrop because click events don't delegate | ||
− | $(' | + | $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) |
} | } | ||
− | + | </pre> | |
− | + | <pre> var relatedTarget = { relatedTarget: this } | |
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) | $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) | ||
− | + | </pre> | |
− | + | <pre> if (e.isDefaultPrevented()) return | |
− | + | </pre> | |
− | + | <pre> $parent | |
.toggleClass('open') | .toggleClass('open') | ||
.trigger('shown.bs.dropdown', relatedTarget) | .trigger('shown.bs.dropdown', relatedTarget) | ||
− | + | </pre> | |
− | + | <pre> $this.focus() | |
} | } | ||
− | + | </pre> | |
− | + | <pre> return false | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Dropdown.prototype.keydown = function (e) { | |
if (!/(38|40|27)/.test(e.keyCode)) return | if (!/(38|40|27)/.test(e.keyCode)) return | ||
− | + | </pre> | |
− | + | <pre> var $this = $(this) | |
− | + | </pre> | |
− | + | <pre> e.preventDefault() | |
e.stopPropagation() | e.stopPropagation() | ||
− | + | </pre> | |
− | + | <pre> if ($this.is('.disabled, :disabled')) return | |
− | + | </pre> | |
− | + | <pre> var $parent = getParent($this) | |
var isActive = $parent.hasClass('open') | var isActive = $parent.hasClass('open') | ||
− | + | </pre> | |
− | + | <pre> if (!isActive || (isActive && e.keyCode == 27)) { | |
if (e.which == 27) $parent.find(toggle).focus() | if (e.which == 27) $parent.find(toggle).focus() | ||
return $this.click() | return $this.click() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> var desc = ' li:not(.divider):visible a' | |
var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc) | var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc) | ||
− | + | </pre> | |
− | + | <pre> if (!$items.length) return | |
− | + | </pre> | |
− | + | <pre> var index = $items.index($items.filter(':focus')) | |
− | + | </pre> | |
− | + | <pre> if (e.keyCode == 38 && index > 0) index-- // up | |
− | if (e.keyCode == 40 && index | + | if (e.keyCode == 40 && index < $items.length - 1) index++ // down |
if (!~index) index = 0 | if (!~index) index = 0 | ||
− | + | </pre> | |
− | + | <pre> $items.eq(index).focus() | |
} | } | ||
− | + | </pre> | |
− | + | <pre> function clearMenus(e) { | |
$(backdrop).remove() | $(backdrop).remove() | ||
$(toggle).each(function () { | $(toggle).each(function () { | ||
Line 738: | Line 795: | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> function getParent($this) { | |
var selector = $this.attr('data-target') | var selector = $this.attr('data-target') | ||
− | + | </pre> | |
− | + | <pre> if (!selector) { | |
selector = $this.attr('href') | selector = $this.attr('href') | ||
− | selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, ) //strip for ie7 | + | selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, <i>) //strip for ie7</i> |
} | } | ||
− | + | </pre> | |
− | + | <pre> var $parent = selector && $(selector) | |
− | + | </pre> | |
− | + | <pre> return $parent && $parent.length ? $parent : $this.parent() | |
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // DROPDOWN PLUGIN DEFINITION | ||
// ========================== | // ========================== | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.dropdown | |
− | + | </pre> | |
− | + | <pre> $.fn.dropdown = function (option) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.dropdown') | var data = $this.data('bs.dropdown') | ||
− | + | </pre> | |
− | + | <pre> if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) | |
if (typeof option == 'string') data[option].call($this) | if (typeof option == 'string') data[option].call($this) | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.dropdown.Constructor = Dropdown | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // DROPDOWN NO CONFLICT | ||
// ==================== | // ==================== | ||
− | + | </pre> | |
− | + | <pre> $.fn.dropdown.noConflict = function () { | |
$.fn.dropdown = old | $.fn.dropdown = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // APPLY TO STANDARD DROPDOWN ELEMENTS | ||
// =================================== | // =================================== | ||
− | + | </pre> | |
− | + | <pre> $(document) | |
.on('click.bs.dropdown.data-api', clearMenus) | .on('click.bs.dropdown.data-api', clearMenus) | ||
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) | .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) | ||
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) | .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) | ||
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown) | .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown) | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: modal.js v3.1.1 | |
− | * Bootstrap: modal.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#modals">http://getbootstrap.com/javascript/#modals</a> |
− | * http://getbootstrap.com/javascript/#modals | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // MODAL CLASS DEFINITION | |
// ====================== | // ====================== | ||
− | + | </pre> | |
− | + | <pre> var Modal = function (element, options) { | |
this.options = options | this.options = options | ||
this.$element = $(element) | this.$element = $(element) | ||
this.$backdrop = | this.$backdrop = | ||
this.isShown = null | this.isShown = null | ||
− | + | </pre> | |
− | + | <pre> if (this.options.remote) { | |
this.$element | this.$element | ||
.find('.modal-content') | .find('.modal-content') | ||
Line 822: | Line 881: | ||
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Modal.DEFAULTS = { | |
backdrop: true, | backdrop: true, | ||
keyboard: true, | keyboard: true, | ||
show: true | show: true | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Modal.prototype.toggle = function (_relatedTarget) { | |
− | return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) | + | return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) |
} | } | ||
− | + | </pre> | |
− | + | <pre> Modal.prototype.show = function (_relatedTarget) { | |
var that = this | var that = this | ||
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) | var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) | ||
− | + | </pre> | |
− | + | <pre> this.$element.trigger(e) | |
− | + | </pre> | |
− | + | <pre> if (this.isShown || e.isDefaultPrevented()) return | |
− | + | </pre> | |
− | + | <pre> this.isShown = true | |
− | + | </pre> | |
− | + | <pre> this.escape() | |
− | + | </pre> | |
− | + | <pre> this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) | |
− | + | </pre> | |
− | + | <pre> this.backdrop(function () { | |
− | var transition = $.support.transition && that.$element.hasClass('fade') | + | var transition = $.support.transition && that.$element.hasClass('fade') |
− | + | </pre> | |
− | + | <pre> if (!that.$element.parent().length) { | |
that.$element.appendTo(document.body) // don't move modals dom position | that.$element.appendTo(document.body) // don't move modals dom position | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> that.$element | |
.show() | .show() | ||
.scrollTop(0) | .scrollTop(0) | ||
− | + | </pre> | |
− | + | <pre> if (transition) { | |
that.$element[0].offsetWidth // force reflow | that.$element[0].offsetWidth // force reflow | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> that.$element | |
.addClass('in') | .addClass('in') | ||
.attr('aria-hidden', false) | .attr('aria-hidden', false) | ||
− | + | </pre> | |
− | + | <pre> that.enforceFocus() | |
− | + | </pre> | |
− | + | <pre> var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) | |
− | + | </pre> | |
− | + | <pre> transition ? | |
that.$element.find('.modal-dialog') // wait for modal to slide in | that.$element.find('.modal-dialog') // wait for modal to slide in | ||
.one($.support.transition.end, function () { | .one($.support.transition.end, function () { | ||
that.$element.focus().trigger(e) | that.$element.focus().trigger(e) | ||
}) | }) | ||
− | .emulateTransitionEnd(300) : | + | .emulateTransitionEnd(300) : |
that.$element.focus().trigger(e) | that.$element.focus().trigger(e) | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Modal.prototype.hide = function (e) { | |
if (e) e.preventDefault() | if (e) e.preventDefault() | ||
− | + | </pre> | |
− | + | <pre> e = $.Event('hide.bs.modal') | |
− | + | </pre> | |
− | + | <pre> this.$element.trigger(e) | |
− | + | </pre> | |
− | + | <pre> if (!this.isShown || e.isDefaultPrevented()) return | |
− | + | </pre> | |
− | + | <pre> this.isShown = false | |
− | + | </pre> | |
− | + | <pre> this.escape() | |
− | + | </pre> | |
− | + | <pre> $(document).off('focusin.bs.modal') | |
− | + | </pre> | |
− | + | <pre> this.$element | |
.removeClass('in') | .removeClass('in') | ||
.attr('aria-hidden', true) | .attr('aria-hidden', true) | ||
.off('click.dismiss.bs.modal') | .off('click.dismiss.bs.modal') | ||
− | + | </pre> | |
− | + | <pre> $.support.transition && this.$element.hasClass('fade') ? | |
this.$element | this.$element | ||
.one($.support.transition.end, $.proxy(this.hideModal, this)) | .one($.support.transition.end, $.proxy(this.hideModal, this)) | ||
− | .emulateTransitionEnd(300) : | + | .emulateTransitionEnd(300) : |
this.hideModal() | this.hideModal() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Modal.prototype.enforceFocus = function () { | |
$(document) | $(document) | ||
.off('focusin.bs.modal') // guard against infinite focus loop | .off('focusin.bs.modal') // guard against infinite focus loop | ||
.on('focusin.bs.modal', $.proxy(function (e) { | .on('focusin.bs.modal', $.proxy(function (e) { | ||
− | if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { | + | if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { |
this.$element.focus() | this.$element.focus() | ||
} | } | ||
}, this)) | }, this)) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Modal.prototype.escape = function () { | |
− | if (this.isShown && this.options.keyboard) { | + | if (this.isShown && this.options.keyboard) { |
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { | this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { | ||
− | e.which == 27 && this.hide() | + | e.which == 27 && this.hide() |
}, this)) | }, this)) | ||
} else if (!this.isShown) { | } else if (!this.isShown) { | ||
Line 926: | Line 985: | ||
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Modal.prototype.hideModal = function () { | |
var that = this | var that = this | ||
this.$element.hide() | this.$element.hide() | ||
Line 935: | Line 994: | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Modal.prototype.removeBackdrop = function () { | |
− | this.$backdrop && this.$backdrop.remove() | + | this.$backdrop && this.$backdrop.remove() |
this.$backdrop = null | this.$backdrop = null | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Modal.prototype.backdrop = function (callback) { | |
− | var animate = this.$element.hasClass('fade') ? 'fade' : | + | var animate = this.$element.hasClass('fade') ? 'fade' : |
− | + | </pre> | |
− | + | <pre> if (this.isShown && this.options.backdrop) { | |
− | var doAnimate = $.support.transition && animate | + | var doAnimate = $.support.transition && animate |
− | + | </pre> | |
− | + | <pre> this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') | |
.appendTo(document.body) | .appendTo(document.body) | ||
− | + | </pre> | |
− | + | <pre> this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { | |
− | if (e.target !== e.currentTarget) return | + | if (e.target !== e.currentTarget) return |
this.options.backdrop == 'static' | this.options.backdrop == 'static' | ||
− | + |  ? this.$element[0].focus.call(this.$element[0]) | |
− | + |  : this.hide.call(this) | |
}, this)) | }, this)) | ||
− | + | </pre> | |
− | + | <pre> if (doAnimate) this.$backdrop[0].offsetWidth // force reflow | |
− | + | </pre> | |
− | + | <pre> this.$backdrop.addClass('in') | |
− | + | </pre> | |
− | + | <pre> if (!callback) return | |
− | + | </pre> | |
− | + | <pre> doAnimate ? | |
this.$backdrop | this.$backdrop | ||
.one($.support.transition.end, callback) | .one($.support.transition.end, callback) | ||
− | .emulateTransitionEnd(150) : | + | .emulateTransitionEnd(150) : |
callback() | callback() | ||
− | + | </pre> | |
− | + | <pre> } else if (!this.isShown && this.$backdrop) { | |
this.$backdrop.removeClass('in') | this.$backdrop.removeClass('in') | ||
− | + | </pre> | |
− | + | <pre> $.support.transition && this.$element.hasClass('fade') ? | |
this.$backdrop | this.$backdrop | ||
.one($.support.transition.end, callback) | .one($.support.transition.end, callback) | ||
− | .emulateTransitionEnd(150) : | + | .emulateTransitionEnd(150) : |
callback() | callback() | ||
− | + | </pre> | |
− | + | <pre> } else if (callback) { | |
callback() | callback() | ||
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // MODAL PLUGIN DEFINITION | ||
// ======================= | // ======================= | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.modal | |
− | + | </pre> | |
− | + | <pre> $.fn.modal = function (option, _relatedTarget) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.modal') | var data = $this.data('bs.modal') | ||
− | var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) | + | var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) |
− | + | </pre> | |
− | + | <pre> if (!data) $this.data('bs.modal', (data = new Modal(this, options))) | |
if (typeof option == 'string') data[option](_relatedTarget) | if (typeof option == 'string') data[option](_relatedTarget) | ||
else if (options.show) data.show(_relatedTarget) | else if (options.show) data.show(_relatedTarget) | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.modal.Constructor = Modal | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // MODAL NO CONFLICT | ||
// ================= | // ================= | ||
− | + | </pre> | |
− | + | <pre> $.fn.modal.noConflict = function () { | |
$.fn.modal = old | $.fn.modal = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // MODAL DATA-API | ||
// ============== | // ============== | ||
− | + | </pre> | |
− | + | <pre> $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { | |
var $this = $(this) | var $this = $(this) | ||
var href = $this.attr('href') | var href = $this.attr('href') | ||
− | var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ))) //strip for ie7 | + | var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, <i>))) //strip for ie7</i> |
− | var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) | + | var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) |
− | + | </pre> | |
− | + | <pre> if ($this.is('a')) e.preventDefault() | |
− | + | </pre> | |
− | + | <pre> $target | |
.modal(option, this) | .modal(option, this) | ||
.one('hide', function () { | .one('hide', function () { | ||
− | $this.is(':visible') && $this.focus() | + | $this.is(':visible') && $this.focus() |
}) | }) | ||
}) | }) | ||
− | + | </pre> | |
− | + | <pre> $(document) | |
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) | .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) | ||
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') }) | .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') }) | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: tooltip.js v3.1.1 | |
− | * Bootstrap: tooltip.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#tooltip">http://getbootstrap.com/javascript/#tooltip</a> |
− | * http://getbootstrap.com/javascript/#tooltip | + | |
* Inspired by the original jQuery.tipsy by Jason Frame | * Inspired by the original jQuery.tipsy by Jason Frame | ||
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // TOOLTIP PUBLIC CLASS DEFINITION | |
// =============================== | // =============================== | ||
− | + | </pre> | |
− | + | <pre> var Tooltip = function (element, options) { | |
this.type = | this.type = | ||
this.options = | this.options = | ||
Line 1,062: | Line 1,123: | ||
this.hoverState = | this.hoverState = | ||
this.$element = null | this.$element = null | ||
− | + | </pre> | |
− | + | <pre> this.init('tooltip', element, options) | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.DEFAULTS = { | |
animation: true, | animation: true, | ||
placement: 'top', | placement: 'top', | ||
selector: false, | selector: false, | ||
− | + | </pre> | |
− | template: ' | + | template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', |
− | ', | + | <pre> trigger: 'hover focus', |
− | + | title: <i>,</i> | |
− | + | ||
− | title: , | + | |
delay: 0, | delay: 0, | ||
html: false, | html: false, | ||
container: false | container: false | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.init = function (type, element, options) { | |
this.enabled = true | this.enabled = true | ||
this.type = type | this.type = type | ||
this.$element = $(element) | this.$element = $(element) | ||
this.options = this.getOptions(options) | this.options = this.getOptions(options) | ||
− | + | </pre> | |
− | + | <pre> var triggers = this.options.trigger.split(' ') | |
− | + | </pre> | |
− | + | <pre> for (var i = triggers.length; i--;) { | |
var trigger = triggers[i] | var trigger = triggers[i] | ||
− | + | </pre> | |
− | + | <pre> if (trigger == 'click') { | |
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) | this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) | ||
− | } else if (trigger != 'manual') { | + | } else if (trigger != 'manual') { |
− | var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' | + | var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' |
− | var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' | + | var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' |
− | + | </pre> | |
− | + | <pre> this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) | |
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) | this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) | ||
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> this.options.selector ? | |
− | (this._options = $.extend({}, this.options, { trigger: 'manual', selector: | + | (this._options = $.extend({}, this.options, { trigger: 'manual', selector: <i> })) :</i> |
this.fixTitle() | this.fixTitle() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.getDefaults = function () { | |
return Tooltip.DEFAULTS | return Tooltip.DEFAULTS | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.getOptions = function (options) { | |
options = $.extend({}, this.getDefaults(), this.$element.data(), options) | options = $.extend({}, this.getDefaults(), this.$element.data(), options) | ||
− | + | </pre> | |
− | + | <pre> if (options.delay && typeof options.delay == 'number') { | |
options.delay = { | options.delay = { | ||
show: options.delay, | show: options.delay, | ||
Line 1,121: | Line 1,180: | ||
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> return options | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.getDelegateOptions = function () { | |
var options = {} | var options = {} | ||
var defaults = this.getDefaults() | var defaults = this.getDefaults() | ||
− | + | </pre> | |
− | + | <pre> this._options && $.each(this._options, function (key, value) { | |
− | if (defaults[key] != value) options[key] = value | + | if (defaults[key] != value) options[key] = value |
}) | }) | ||
− | + | </pre> | |
− | + | <pre> return options | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.enter = function (obj) { | |
− | var self = obj instanceof this.constructor ? | + | var self = obj instanceof this.constructor ? |
− | obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) | + | obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) |
− | + | </pre> | |
− | + | <pre> clearTimeout(self.timeout) | |
− | + | </pre> | |
− | + | <pre> self.hoverState = 'in' | |
− | + | </pre> | |
− | + | <pre> if (!self.options.delay || !self.options.delay.show) return self.show() | |
− | + | </pre> | |
− | + | <pre> self.timeout = setTimeout(function () { | |
if (self.hoverState == 'in') self.show() | if (self.hoverState == 'in') self.show() | ||
}, self.options.delay.show) | }, self.options.delay.show) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.leave = function (obj) { | |
− | var self = obj instanceof this.constructor ? | + | var self = obj instanceof this.constructor ? |
− | obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) | + | obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) |
− | + | </pre> | |
− | + | <pre> clearTimeout(self.timeout) | |
− | + | </pre> | |
− | + | <pre> self.hoverState = 'out' | |
− | + | </pre> | |
− | + | <pre> if (!self.options.delay || !self.options.delay.hide) return self.hide() | |
− | + | </pre> | |
− | + | <pre> self.timeout = setTimeout(function () { | |
if (self.hoverState == 'out') self.hide() | if (self.hoverState == 'out') self.hide() | ||
}, self.options.delay.hide) | }, self.options.delay.hide) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.show = function () { | |
var e = $.Event('show.bs.' + this.type) | var e = $.Event('show.bs.' + this.type) | ||
− | + | </pre> | |
− | + | <pre> if (this.hasContent() && this.enabled) { | |
this.$element.trigger(e) | this.$element.trigger(e) | ||
− | + | </pre> | |
− | + | <pre> if (e.isDefaultPrevented()) return | |
var that = this; | var that = this; | ||
− | + | </pre> | |
− | + | <pre> var $tip = this.tip() | |
− | + | </pre> | |
− | + | <pre> this.setContent() | |
− | + | </pre> | |
− | + | <pre> if (this.options.animation) $tip.addClass('fade') | |
− | + | </pre> | |
− | + | <pre> var placement = typeof this.options.placement == 'function' ? | |
− | this.options.placement.call(this, $tip[0], this.$element[0]) : | + | this.options.placement.call(this, $tip[0], this.$element[0]) : |
this.options.placement | this.options.placement | ||
− | + | </pre> | |
− | + | <pre> var autoToken = /\s?auto?\s?/i | |
var autoPlace = autoToken.test(placement) | var autoPlace = autoToken.test(placement) | ||
− | if (autoPlace) placement = placement.replace(autoToken, ) || 'top' | + | if (autoPlace) placement = placement.replace(autoToken, <i>) || 'top'</i> |
− | + | </pre> | |
− | + | <pre> $tip | |
.detach() | .detach() | ||
.css({ top: 0, left: 0, display: 'block' }) | .css({ top: 0, left: 0, display: 'block' }) | ||
.addClass(placement) | .addClass(placement) | ||
− | + | </pre> | |
− | + | <pre> this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) | |
− | + | </pre> | |
− | + | <pre> var pos = this.getPosition() | |
var actualWidth = $tip[0].offsetWidth | var actualWidth = $tip[0].offsetWidth | ||
var actualHeight = $tip[0].offsetHeight | var actualHeight = $tip[0].offsetHeight | ||
− | + | </pre> | |
− | + | <pre> if (autoPlace) { | |
var $parent = this.$element.parent() | var $parent = this.$element.parent() | ||
− | + | </pre> | |
− | + | <pre> var orgPlacement = placement | |
var docScroll = document.documentElement.scrollTop || document.body.scrollTop | var docScroll = document.documentElement.scrollTop || document.body.scrollTop | ||
− | var parentWidth = this.options.container == 'body' ? window.innerWidth | + | var parentWidth = this.options.container == 'body' ? window.innerWidth  : $parent.outerWidth() |
− | var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() | + | var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() |
− | var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left | + | var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left |
− | + | </pre> | |
− | + | <pre> placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight  ? 'top'  : | |
− | placement == 'top' && pos.top - docScroll - actualHeight | + | placement == 'top' && pos.top - docScroll - actualHeight < 0  ? 'bottom' : |
− | placement == 'right' && pos.right + actualWidth | + | placement == 'right' && pos.right + actualWidth > parentWidth  ? 'left'  : |
− | placement == 'left' && pos.left - actualWidth | + | placement == 'left' && pos.left - actualWidth < parentLeft  ? 'right'  : |
placement | placement | ||
− | + | </pre> | |
− | + | <pre> $tip | |
.removeClass(orgPlacement) | .removeClass(orgPlacement) | ||
.addClass(placement) | .addClass(placement) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) | |
− | + | </pre> | |
− | + | <pre> this.applyPlacement(calculatedOffset, placement) | |
this.hoverState = null | this.hoverState = null | ||
− | + | </pre> | |
− | + | <pre> var complete = function() { | |
that.$element.trigger('shown.bs.' + that.type) | that.$element.trigger('shown.bs.' + that.type) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.support.transition && this.$tip.hasClass('fade') ? | |
$tip | $tip | ||
.one($.support.transition.end, complete) | .one($.support.transition.end, complete) | ||
− | .emulateTransitionEnd(150) : | + | .emulateTransitionEnd(150) : |
complete() | complete() | ||
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.applyPlacement = function (offset, placement) { | |
var replace | var replace | ||
var $tip = this.tip() | var $tip = this.tip() | ||
var width = $tip[0].offsetWidth | var width = $tip[0].offsetWidth | ||
var height = $tip[0].offsetHeight | var height = $tip[0].offsetHeight | ||
− | + | </pre> | |
− | + | <pre> // manually read margins because getBoundingClientRect includes difference | |
var marginTop = parseInt($tip.css('margin-top'), 10) | var marginTop = parseInt($tip.css('margin-top'), 10) | ||
var marginLeft = parseInt($tip.css('margin-left'), 10) | var marginLeft = parseInt($tip.css('margin-left'), 10) | ||
− | + | </pre> | |
− | + | <pre> // we must check for NaN for ie 8/9 | |
if (isNaN(marginTop)) marginTop = 0 | if (isNaN(marginTop)) marginTop = 0 | ||
if (isNaN(marginLeft)) marginLeft = 0 | if (isNaN(marginLeft)) marginLeft = 0 | ||
− | + | </pre> | |
− | + | <pre> offset.top = offset.top + marginTop | |
offset.left = offset.left + marginLeft | offset.left = offset.left + marginLeft | ||
− | + | </pre> | |
− | + | <pre> // $.fn.offset doesn't round pixel values | |
// so we use setOffset directly with our own function B-0 | // so we use setOffset directly with our own function B-0 | ||
$.offset.setOffset($tip[0], $.extend({ | $.offset.setOffset($tip[0], $.extend({ | ||
Line 1,264: | Line 1,323: | ||
} | } | ||
}, offset), 0) | }, offset), 0) | ||
− | + | </pre> | |
− | + | <pre> $tip.addClass('in') | |
− | + | </pre> | |
− | + | <pre> // check to see if placing tip in new offset caused the tip to resize itself | |
var actualWidth = $tip[0].offsetWidth | var actualWidth = $tip[0].offsetWidth | ||
var actualHeight = $tip[0].offsetHeight | var actualHeight = $tip[0].offsetHeight | ||
− | + | </pre> | |
− | + | <pre> if (placement == 'top' && actualHeight != height) { | |
replace = true | replace = true | ||
offset.top = offset.top + height - actualHeight | offset.top = offset.top + height - actualHeight | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> if (/bottom|top/.test(placement)) { | |
var delta = 0 | var delta = 0 | ||
− | + | </pre> | |
− | + | <pre> if (offset.left < 0) { | |
delta = offset.left * -2 | delta = offset.left * -2 | ||
offset.left = 0 | offset.left = 0 | ||
− | + | </pre> | |
− | + | <pre> $tip.offset(offset) | |
− | + | </pre> | |
− | + | <pre> actualWidth = $tip[0].offsetWidth | |
actualHeight = $tip[0].offsetHeight | actualHeight = $tip[0].offsetHeight | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') | |
} else { | } else { | ||
this.replaceArrow(actualHeight - height, actualHeight, 'top') | this.replaceArrow(actualHeight - height, actualHeight, 'top') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> if (replace) $tip.offset(offset) | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.replaceArrow = function (delta, dimension, position) { | |
− | this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : ) | + | this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : <i>)</i> |
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.setContent = function () { | |
var $tip = this.tip() | var $tip = this.tip() | ||
var title = this.getTitle() | var title = this.getTitle() | ||
− | + | </pre> | |
− | + | <pre> $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) | |
$tip.removeClass('fade in top bottom left right') | $tip.removeClass('fade in top bottom left right') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.hide = function () { | |
var that = this | var that = this | ||
var $tip = this.tip() | var $tip = this.tip() | ||
var e = $.Event('hide.bs.' + this.type) | var e = $.Event('hide.bs.' + this.type) | ||
− | + | </pre> | |
− | + | <pre> function complete() { | |
− | if (that.hoverState != 'in') $tip.detach() | + | if (that.hoverState != 'in') $tip.detach() |
that.$element.trigger('hidden.bs.' + that.type) | that.$element.trigger('hidden.bs.' + that.type) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> this.$element.trigger(e) | |
− | + | </pre> | |
− | + | <pre> if (e.isDefaultPrevented()) return | |
− | + | </pre> | |
− | + | <pre> $tip.removeClass('in') | |
− | + | </pre> | |
− | + | <pre> $.support.transition && this.$tip.hasClass('fade') ? | |
$tip | $tip | ||
.one($.support.transition.end, complete) | .one($.support.transition.end, complete) | ||
− | .emulateTransitionEnd(150) : | + | .emulateTransitionEnd(150) : |
complete() | complete() | ||
− | + | </pre> | |
− | + | <pre> this.hoverState = null | |
− | + | </pre> | |
− | + | <pre> return this | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.fixTitle = function () { | |
var $e = this.$element | var $e = this.$element | ||
− | if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { | + | if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { |
− | $e.attr('data-original-title', $e.attr('title') || ).attr('title', ) | + | $e.attr('data-original-title', $e.attr('title') || <i>).attr('title', </i>) |
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.hasContent = function () { | |
return this.getTitle() | return this.getTitle() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.getPosition = function () { | |
var el = this.$element[0] | var el = this.$element[0] | ||
− | return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { | + | return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { |
width: el.offsetWidth, | width: el.offsetWidth, | ||
height: el.offsetHeight | height: el.offsetHeight | ||
}, this.$element.offset()) | }, this.$element.offset()) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { | |
− | return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : | + | return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : |
− | placement == 'top' | + | placement == 'top'  ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : |
− | placement == 'left' | + | placement == 'left'  ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : |
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } | /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.getTitle = function () { | |
var title | var title | ||
var $e = this.$element | var $e = this.$element | ||
var o = this.options | var o = this.options | ||
− | + | </pre> | |
− | + | <pre> title = $e.attr('data-original-title') | |
− | || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) | + | || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) |
− | + | </pre> | |
− | + | <pre> return title | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.tip = function () { | |
return this.$tip = this.$tip || $(this.options.template) | return this.$tip = this.$tip || $(this.options.template) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.arrow = function () { | |
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') | return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.validate = function () { | |
if (!this.$element[0].parentNode) { | if (!this.$element[0].parentNode) { | ||
this.hide() | this.hide() | ||
Line 1,388: | Line 1,447: | ||
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.enable = function () { | |
this.enabled = true | this.enabled = true | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.disable = function () { | |
this.enabled = false | this.enabled = false | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.toggleEnabled = function () { | |
− | this.enabled = !this.enabled | + | this.enabled = !this.enabled |
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.toggle = function (e) { | |
− | var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this | + | var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this |
− | self.tip().hasClass('in') ? self.leave(self) : self.enter(self) | + | self.tip().hasClass('in') ? self.leave(self) : self.enter(self) |
} | } | ||
− | + | </pre> | |
− | + | <pre> Tooltip.prototype.destroy = function () { | |
clearTimeout(this.timeout) | clearTimeout(this.timeout) | ||
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) | this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // TOOLTIP PLUGIN DEFINITION | ||
// ========================= | // ========================= | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.tooltip | |
− | + | </pre> | |
− | + | <pre> $.fn.tooltip = function (option) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.tooltip') | var data = $this.data('bs.tooltip') | ||
− | var options = typeof option == 'object' && option | + | var options = typeof option == 'object' && option |
− | + | </pre> | |
− | + | <pre> if (!data && option == 'destroy') return | |
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) | if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) | ||
if (typeof option == 'string') data[option]() | if (typeof option == 'string') data[option]() | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.tooltip.Constructor = Tooltip | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // TOOLTIP NO CONFLICT | ||
// =================== | // =================== | ||
− | + | </pre> | |
− | + | <pre> $.fn.tooltip.noConflict = function () { | |
$.fn.tooltip = old | $.fn.tooltip = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: popover.js v3.1.1 | |
− | * Bootstrap: popover.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#popovers">http://getbootstrap.com/javascript/#popovers</a> |
− | * http://getbootstrap.com/javascript/#popovers | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // POPOVER PUBLIC CLASS DEFINITION | |
// =============================== | // =============================== | ||
− | + | </pre> | |
− | + | <pre> var Popover = function (element, options) { | |
this.init('popover', element, options) | this.init('popover', element, options) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') | |
− | + | </pre> | |
− | + | <pre> Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { | |
placement: 'right', | placement: 'right', | ||
trigger: 'click', | trigger: 'click', | ||
− | content: , | + | content: <i>,</i> |
− | + | </pre> | |
− | template: ' | + | template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"><span class="mw-headline" id=""></span></h3><div class="popover-content"></div></div>' |
− | ' | + | <pre> }) |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
− | + | <pre> // NOTE: POPOVER EXTENDS tooltip.js | |
− | + | ||
// ================================ | // ================================ | ||
− | + | </pre> | |
− | + | <pre> Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) | |
− | + | </pre> | |
− | + | <pre> Popover.prototype.constructor = Popover | |
− | + | </pre> | |
− | + | <pre> Popover.prototype.getDefaults = function () { | |
return Popover.DEFAULTS | return Popover.DEFAULTS | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Popover.prototype.setContent = function () { | |
var $tip = this.tip() | var $tip = this.tip() | ||
var title = this.getTitle() | var title = this.getTitle() | ||
var content = this.getContent() | var content = this.getContent() | ||
− | + | </pre> | |
− | + | <pre> $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) | |
$tip.find('.popover-content')[ // we use append for html objects to maintain js events | $tip.find('.popover-content')[ // we use append for html objects to maintain js events | ||
− | this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' | + | this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' |
](content) | ](content) | ||
− | + | </pre> | |
− | + | <pre> $tip.removeClass('fade top bottom left right in') | |
− | + | </pre> | |
− | + | <pre> // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do | |
// this manually by checking the contents. | // this manually by checking the contents. | ||
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() | if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Popover.prototype.hasContent = function () { | |
return this.getTitle() || this.getContent() | return this.getTitle() || this.getContent() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Popover.prototype.getContent = function () { | |
var $e = this.$element | var $e = this.$element | ||
var o = this.options | var o = this.options | ||
− | + | </pre> | |
− | + | <pre> return $e.attr('data-content') | |
− | || (typeof o.content == 'function' ? | + | || (typeof o.content == 'function' ? |
− | o.content.call($e[0]) : | + | o.content.call($e[0]) : |
o.content) | o.content) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Popover.prototype.arrow = function () { | |
return this.$arrow = this.$arrow || this.tip().find('.arrow') | return this.$arrow = this.$arrow || this.tip().find('.arrow') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Popover.prototype.tip = function () { | |
if (!this.$tip) this.$tip = $(this.options.template) | if (!this.$tip) this.$tip = $(this.options.template) | ||
return this.$tip | return this.$tip | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // POPOVER PLUGIN DEFINITION | ||
// ========================= | // ========================= | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.popover | |
− | + | </pre> | |
− | + | <pre> $.fn.popover = function (option) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.popover') | var data = $this.data('bs.popover') | ||
− | var options = typeof option == 'object' && option | + | var options = typeof option == 'object' && option |
− | + | </pre> | |
− | + | <pre> if (!data && option == 'destroy') return | |
if (!data) $this.data('bs.popover', (data = new Popover(this, options))) | if (!data) $this.data('bs.popover', (data = new Popover(this, options))) | ||
if (typeof option == 'string') data[option]() | if (typeof option == 'string') data[option]() | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.popover.Constructor = Popover | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // POPOVER NO CONFLICT | ||
// =================== | // =================== | ||
− | + | </pre> | |
− | + | <pre> $.fn.popover.noConflict = function () { | |
$.fn.popover = old | $.fn.popover = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: scrollspy.js v3.1.1 | |
− | * Bootstrap: scrollspy.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#scrollspy">http://getbootstrap.com/javascript/#scrollspy</a> |
− | * http://getbootstrap.com/javascript/#scrollspy | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // SCROLLSPY CLASS DEFINITION | |
// ========================== | // ========================== | ||
− | + | </pre> | |
− | + | <pre> function ScrollSpy(element, options) { | |
var href | var href | ||
var process = $.proxy(this.process, this) | var process = $.proxy(this.process, this) | ||
− | + | </pre> | |
− | + | <pre> this.$element = $(element).is('body') ? $(window) : $(element) | |
this.$body = $('body') | this.$body = $('body') | ||
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) | this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) | ||
this.options = $.extend({}, ScrollSpy.DEFAULTS, options) | this.options = $.extend({}, ScrollSpy.DEFAULTS, options) | ||
this.selector = (this.options.target | this.selector = (this.options.target | ||
− | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, )) //strip for ie7 | + | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, <i>)) //strip for ie7</i> |
− | || ) + ' .nav li | + | || <i>) + ' .nav li > a'</i> |
this.offsets = $([]) | this.offsets = $([]) | ||
this.targets = $([]) | this.targets = $([]) | ||
this.activeTarget = null | this.activeTarget = null | ||
− | + | </pre> | |
− | + | <pre> this.refresh() | |
this.process() | this.process() | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> ScrollSpy.DEFAULTS = { | |
offset: 10 | offset: 10 | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> ScrollSpy.prototype.refresh = function () { | |
− | var offsetMethod = this.$element[0] == window ? 'offset' : 'position' | + | var offsetMethod = this.$element[0] == window ? 'offset' : 'position' |
− | + | </pre> | |
− | + | <pre> this.offsets = $([]) | |
this.targets = $([]) | this.targets = $([]) | ||
− | + | </pre> | |
− | + | <pre> var self = this | |
var $targets = this.$body | var $targets = this.$body | ||
.find(this.selector) | .find(this.selector) | ||
Line 1,610: | Line 1,670: | ||
var $el = $(this) | var $el = $(this) | ||
var href = $el.data('target') || $el.attr('href') | var href = $el.data('target') || $el.attr('href') | ||
− | var $href = /^#./.test(href) && $(href) | + | var $href = /^#./.test(href) && $(href) |
− | + | </pre> | |
− | + | <pre> return ($href | |
− | && $href.length | + | && $href.length |
− | && $href.is(':visible') | + | && $href.is(':visible') |
− | && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null | + | && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null |
}) | }) | ||
.sort(function (a, b) { return a[0] - b[0] }) | .sort(function (a, b) { return a[0] - b[0] }) | ||
Line 1,623: | Line 1,683: | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> ScrollSpy.prototype.process = function () { | |
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset | ||
var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight | var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight | ||
Line 1,632: | Line 1,692: | ||
var activeTarget = this.activeTarget | var activeTarget = this.activeTarget | ||
var i | var i | ||
− | + | </pre> | |
− | + | <pre> if (scrollTop >= maxScroll) { | |
− | return activeTarget != (i = targets.last()[0]) && this.activate(i) | + | return activeTarget != (i = targets.last()[0]) && this.activate(i) |
} | } | ||
− | + | </pre> | |
− | + | <pre> if (activeTarget && scrollTop <= offsets[0]) { | |
− | return activeTarget != (i = targets[0]) && this.activate(i) | + | return activeTarget != (i = targets[0]) && this.activate(i) |
} | } | ||
− | + | </pre> | |
− | + | <pre> for (i = offsets.length; i--;) { | |
− | activeTarget != targets[i] | + | activeTarget != targets[i] |
− | && scrollTop | + | && scrollTop >= offsets[i] |
− | && (!offsets[i + 1] || scrollTop | + | && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) |
− | && this.activate( targets[i] ) | + | && this.activate( targets[i] ) |
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> ScrollSpy.prototype.activate = function (target) { | |
this.activeTarget = target | this.activeTarget = target | ||
− | + | </pre> | |
− | + | <pre> $(this.selector) | |
.parentsUntil(this.options.target, '.active') | .parentsUntil(this.options.target, '.active') | ||
.removeClass('active') | .removeClass('active') | ||
− | + | </pre> | |
− | + | <pre> var selector = this.selector + | |
'[data-target="' + target + '"],' + | '[data-target="' + target + '"],' + | ||
this.selector + '[href="' + target + '"]' | this.selector + '[href="' + target + '"]' | ||
− | + | </pre> | |
− | + | <pre> var active = $(selector) | |
.parents('li') | .parents('li') | ||
.addClass('active') | .addClass('active') | ||
− | + | </pre> | |
− | + | <pre> if (active.parent('.dropdown-menu').length) { | |
active = active | active = active | ||
.closest('li.dropdown') | .closest('li.dropdown') | ||
.addClass('active') | .addClass('active') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> active.trigger('activate.bs.scrollspy') | |
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // SCROLLSPY PLUGIN DEFINITION | ||
// =========================== | // =========================== | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.scrollspy | |
− | + | </pre> | |
− | + | <pre> $.fn.scrollspy = function (option) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.scrollspy') | var data = $this.data('bs.scrollspy') | ||
− | var options = typeof option == 'object' && option | + | var options = typeof option == 'object' && option |
− | + | </pre> | |
− | + | <pre> if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) | |
if (typeof option == 'string') data[option]() | if (typeof option == 'string') data[option]() | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.scrollspy.Constructor = ScrollSpy | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // SCROLLSPY NO CONFLICT | ||
// ===================== | // ===================== | ||
− | + | </pre> | |
− | + | <pre> $.fn.scrollspy.noConflict = function () { | |
$.fn.scrollspy = old | $.fn.scrollspy = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // SCROLLSPY DATA-API | ||
// ================== | // ================== | ||
− | + | </pre> | |
− | + | <pre> $(window).on('load', function () { | |
$('[data-spy="scroll"]').each(function () { | $('[data-spy="scroll"]').each(function () { | ||
var $spy = $(this) | var $spy = $(this) | ||
Line 1,711: | Line 1,774: | ||
}) | }) | ||
}) | }) | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: tab.js v3.1.1 | |
− | * Bootstrap: tab.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#tabs">http://getbootstrap.com/javascript/#tabs</a> |
− | * http://getbootstrap.com/javascript/#tabs | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // TAB CLASS DEFINITION | |
// ==================== | // ==================== | ||
− | + | </pre> | |
− | + | <pre> var Tab = function (element) { | |
this.element = $(element) | this.element = $(element) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tab.prototype.show = function () { | |
var $this = this.element | var $this = this.element | ||
var $ul = $this.closest('ul:not(.dropdown-menu)') | var $ul = $this.closest('ul:not(.dropdown-menu)') | ||
var selector = $this.data('target') | var selector = $this.data('target') | ||
− | + | </pre> | |
− | + | <pre> if (!selector) { | |
selector = $this.attr('href') | selector = $this.attr('href') | ||
− | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ) //strip for ie7 | + | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, <i>) //strip for ie7</i> |
} | } | ||
− | + | </pre> | |
− | + | <pre> if ($this.parent('li').hasClass('active')) return | |
− | + | </pre> | |
− | + | <pre> var previous = $ul.find('.active:last a')[0] | |
var e = $.Event('show.bs.tab', { | var e = $.Event('show.bs.tab', { | ||
relatedTarget: previous | relatedTarget: previous | ||
}) | }) | ||
− | + | </pre> | |
− | + | <pre> $this.trigger(e) | |
− | + | </pre> | |
− | + | <pre> if (e.isDefaultPrevented()) return | |
− | + | </pre> | |
− | + | <pre> var $target = $(selector) | |
− | + | </pre> | |
− | + | <pre> this.activate($this.parent('li'), $ul) | |
this.activate($target, $target.parent(), function () { | this.activate($target, $target.parent(), function () { | ||
$this.trigger({ | $this.trigger({ | ||
Line 1,766: | Line 1,828: | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Tab.prototype.activate = function (element, container, callback) { | |
− | var $active = container.find(' | + | var $active = container.find('> .active') |
var transition = callback | var transition = callback | ||
− | && $.support.transition | + | && $.support.transition |
− | && $active.hasClass('fade') | + | && $active.hasClass('fade') |
− | + | </pre> | |
− | + | <pre> function next() { | |
$active | $active | ||
.removeClass('active') | .removeClass('active') | ||
− | .find(' | + | .find('> .dropdown-menu > .active') |
.removeClass('active') | .removeClass('active') | ||
− | + | </pre> | |
− | + | <pre> element.addClass('active') | |
− | + | </pre> | |
− | + | <pre> if (transition) { | |
element[0].offsetWidth // reflow for transition | element[0].offsetWidth // reflow for transition | ||
element.addClass('in') | element.addClass('in') | ||
Line 1,787: | Line 1,849: | ||
element.removeClass('fade') | element.removeClass('fade') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> if (element.parent('.dropdown-menu')) { | |
element.closest('li.dropdown').addClass('active') | element.closest('li.dropdown').addClass('active') | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> callback && callback() | |
} | } | ||
− | + | </pre> | |
− | + | <pre> transition ? | |
$active | $active | ||
.one($.support.transition.end, next) | .one($.support.transition.end, next) | ||
− | .emulateTransitionEnd(150) : | + | .emulateTransitionEnd(150) : |
next() | next() | ||
− | + | </pre> | |
− | + | <pre> $active.removeClass('in') | |
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // TAB PLUGIN DEFINITION | ||
// ===================== | // ===================== | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.tab | |
− | + | </pre> | |
− | + | <pre> $.fn.tab = function ( option ) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.tab') | var data = $this.data('bs.tab') | ||
− | + | </pre> | |
− | + | <pre> if (!data) $this.data('bs.tab', (data = new Tab(this))) | |
if (typeof option == 'string') data[option]() | if (typeof option == 'string') data[option]() | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.tab.Constructor = Tab | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // TAB NO CONFLICT | ||
// =============== | // =============== | ||
− | + | </pre> | |
− | + | <pre> $.fn.tab.noConflict = function () { | |
$.fn.tab = old | $.fn.tab = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // TAB DATA-API | ||
// ============ | // ============ | ||
− | + | </pre> | |
− | + | <pre> $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { | |
e.preventDefault() | e.preventDefault() | ||
$(this).tab('show') | $(this).tab('show') | ||
}) | }) | ||
− | + | </pre> | |
− | }(jQuery); | + | <p>}(jQuery); |
− | + | </p><p>/* ======================================================================== | |
− | /* ======================================================================== | + | </p> |
− | + | <pre>* Bootstrap: affix.js v3.1.1 | |
− | * Bootstrap: affix.js v3.1.1 | + | * <a rel="nofollow" class="external free" href="http://getbootstrap.com/javascript/#affix">http://getbootstrap.com/javascript/#affix</a> |
− | * http://getbootstrap.com/javascript/#affix | + | |
* ======================================================================== | * ======================================================================== | ||
* Copyright 2011-2014 Twitter, Inc. | * Copyright 2011-2014 Twitter, Inc. | ||
− | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | + | * Licensed under MIT (<a rel="nofollow" class="external free" href="https://github.com/twbs/bootstrap/blob/master/LICENSE">https://github.com/twbs/bootstrap/blob/master/LICENSE</a>) |
* ======================================================================== */ | * ======================================================================== */ | ||
− | + | </pre> | |
− | + | <p><br /> | |
+function ($) { | +function ($) { | ||
− | + | </p> | |
− | + | <pre> 'use strict'; | |
− | + | </pre> | |
− | + | <pre> // AFFIX CLASS DEFINITION | |
// ====================== | // ====================== | ||
− | + | </pre> | |
− | + | <pre> var Affix = function (element, options) { | |
this.options = $.extend({}, Affix.DEFAULTS, options) | this.options = $.extend({}, Affix.DEFAULTS, options) | ||
this.$window = $(window) | this.$window = $(window) | ||
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) | .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) | ||
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) | .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) | ||
− | + | </pre> | |
− | + | <pre> this.$element = $(element) | |
this.affixed = | this.affixed = | ||
this.unpin = | this.unpin = | ||
this.pinnedOffset = null | this.pinnedOffset = null | ||
− | + | </pre> | |
− | + | <pre> this.checkPosition() | |
} | } | ||
− | + | </pre> | |
− | + | <pre> Affix.RESET = 'affix affix-top affix-bottom' | |
− | + | </pre> | |
− | + | <pre> Affix.DEFAULTS = { | |
offset: 0 | offset: 0 | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Affix.prototype.getPinnedOffset = function () { | |
if (this.pinnedOffset) return this.pinnedOffset | if (this.pinnedOffset) return this.pinnedOffset | ||
this.$element.removeClass(Affix.RESET).addClass('affix') | this.$element.removeClass(Affix.RESET).addClass('affix') | ||
Line 1,886: | Line 1,950: | ||
return (this.pinnedOffset = position.top - scrollTop) | return (this.pinnedOffset = position.top - scrollTop) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Affix.prototype.checkPositionWithEventLoop = function () { | |
setTimeout($.proxy(this.checkPosition, this), 1) | setTimeout($.proxy(this.checkPosition, this), 1) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> Affix.prototype.checkPosition = function () { | |
if (!this.$element.is(':visible')) return | if (!this.$element.is(':visible')) return | ||
− | + | </pre> | |
− | + | <pre> var scrollHeight = $(document).height() | |
var scrollTop = this.$window.scrollTop() | var scrollTop = this.$window.scrollTop() | ||
var position = this.$element.offset() | var position = this.$element.offset() | ||
Line 1,900: | Line 1,964: | ||
var offsetTop = offset.top | var offsetTop = offset.top | ||
var offsetBottom = offset.bottom | var offsetBottom = offset.bottom | ||
− | + | </pre> | |
− | + | <pre> if (this.affixed == 'top') position.top += scrollTop | |
− | + | </pre> | |
− | + | <pre> if (typeof offset != 'object') offsetBottom = offsetTop = offset | |
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) | if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) | ||
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) | if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) | ||
− | + | </pre> | |
− | + | <pre> var affix = this.unpin  != null && (scrollTop + this.unpin <= position.top) ? false : | |
− | offsetBottom != null && (position.top + this.$element.height() | + | offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : |
− | offsetTop | + | offsetTop  != null && (scrollTop <= offsetTop) ? 'top' : false |
− | + | </pre> | |
− | + | <pre> if (this.affixed === affix) return | |
− | if (this.unpin) this.$element.css('top', ) | + | if (this.unpin) this.$element.css('top', <i>)</i> |
− | + | </pre> | |
− | + | <pre> var affixType = 'affix' + (affix ? '-' + affix : <i>)</i> | |
var e = $.Event(affixType + '.bs.affix') | var e = $.Event(affixType + '.bs.affix') | ||
− | + | </pre> | |
− | + | <pre> this.$element.trigger(e) | |
− | + | </pre> | |
− | + | <pre> if (e.isDefaultPrevented()) return | |
− | + | </pre> | |
− | + | <pre> this.affixed = affix | |
− | this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null | + | this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null |
− | + | </pre> | |
− | + | <pre> this.$element | |
.removeClass(Affix.RESET) | .removeClass(Affix.RESET) | ||
.addClass(affixType) | .addClass(affixType) | ||
.trigger($.Event(affixType.replace('affix', 'affixed'))) | .trigger($.Event(affixType.replace('affix', 'affixed'))) | ||
− | + | </pre> | |
− | + | <pre> if (affix == 'bottom') { | |
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) | this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) | ||
} | } | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // AFFIX PLUGIN DEFINITION | ||
// ======================= | // ======================= | ||
− | + | </pre> | |
− | + | <pre> var old = $.fn.affix | |
− | + | </pre> | |
− | + | <pre> $.fn.affix = function (option) { | |
return this.each(function () { | return this.each(function () { | ||
var $this = $(this) | var $this = $(this) | ||
var data = $this.data('bs.affix') | var data = $this.data('bs.affix') | ||
− | var options = typeof option == 'object' && option | + | var options = typeof option == 'object' && option |
− | + | </pre> | |
− | + | <pre> if (!data) $this.data('bs.affix', (data = new Affix(this, options))) | |
if (typeof option == 'string') data[option]() | if (typeof option == 'string') data[option]() | ||
}) | }) | ||
} | } | ||
− | + | </pre> | |
− | + | <pre> $.fn.affix.Constructor = Affix | |
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // AFFIX NO CONFLICT | ||
// ================= | // ================= | ||
− | + | </pre> | |
− | + | <pre> $.fn.affix.noConflict = function () { | |
$.fn.affix = old | $.fn.affix = old | ||
return this | return this | ||
} | } | ||
− | + | </pre> | |
− | + | <p><br /> | |
− | + | </p> | |
+ | <pre> // AFFIX DATA-API | ||
// ============== | // ============== | ||
− | + | </pre> | |
− | + | <pre> $(window).on('load', function () { | |
$('[data-spy="affix"]').each(function () { | $('[data-spy="affix"]').each(function () { | ||
var $spy = $(this) | var $spy = $(this) | ||
var data = $spy.data() | var data = $spy.data() | ||
− | + | </pre> | |
− | + | <pre> data.offset = data.offset || {} | |
− | + | </pre> | |
− | + | <pre> if (data.offsetBottom) data.offset.bottom = data.offsetBottom | |
if (data.offsetTop) data.offset.top = data.offsetTop | if (data.offsetTop) data.offset.top = data.offsetTop | ||
− | + | </pre> | |
− | + | <pre> $spy.affix(data) | |
}) | }) | ||
}) | }) | ||
+ | </pre> | ||
+ | <p>}(jQuery); | ||
+ | </p> | ||
+ | <!-- | ||
+ | NewPP limit report | ||
+ | CPU time usage: 0.086 seconds | ||
+ | Real time usage: 0.086 seconds | ||
+ | Preprocessor visited node count: 10/1000000 | ||
+ | Preprocessor generated node count: 22/1000000 | ||
+ | Post‐expand include size: 0/2097152 bytes | ||
+ | Template argument size: 0/2097152 bytes | ||
+ | Highest expansion depth: 1/40 | ||
+ | Expensive parser function count: 0/100 | ||
+ | --> | ||
− | + | <!-- Saved in parser cache with key 2015_igem_org:pcache:idhash:12189-0!*!*!*!*!*!* and timestamp 20150915130606 and revision id 86482 | |
+ | --> | ||
+ | </div> <div class="visualClear"></div> | ||
+ | </div> | ||
+ | </div> | ||
+ | </div> | ||
+ | </body> | ||
+ | </html> |
Latest revision as of 16:03, 15 September 2015
<!DOCTYPE html>
Team:Aix-Marseille/bootstrap.js
/*!
* Bootstrap v3.1.1 (http://getbootstrap.com) * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */
if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
/* ========================================================================
* Bootstrap: transition.js v3.1.1 * http://getbootstrap.com/javascript/#transitions * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) // ============================================================
function transitionEnd() { var el = document.createElement('bootstrap')
var transEndEventNames = { 'WebkitTransition' : 'webkitTransitionEnd', 'MozTransition' : 'transitionend', 'OTransition' : 'oTransitionEnd otransitionend', 'transition' : 'transitionend' }
for (var name in transEndEventNames) { if (el.style[name] !== undefined) { return { end: transEndEventNames[name] } } }
return false // explicit for ie8 ( ._.) }
// http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function (duration) { var called = false, $el = this $(this).one($.support.transition.end, function () { called = true }) var callback = function () { if (!called) $($el).trigger($.support.transition.end) } setTimeout(callback, duration) return this }
$(function () { $.support.transition = transitionEnd() })
}(jQuery);
/* ========================================================================
* Bootstrap: alert.js v3.1.1 * http://getbootstrap.com/javascript/#alerts * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// ALERT CLASS DEFINITION // ======================
var dismiss = '[data-dismiss="alert"]' var Alert = function (el) { $(el).on('click', dismiss, this.close) }
Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target')
if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ) // strip for ie7 }
var $parent = $(selector)
if (e) e.preventDefault()
if (!$parent.length) { $parent = $this.hasClass('alert') ? $this : $this.parent() }
$parent.trigger(e = $.Event('close.bs.alert'))
if (e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement() { $parent.trigger('closed.bs.alert').remove() }
$.support.transition && $parent.hasClass('fade') ? $parent .one($.support.transition.end, removeElement) .emulateTransitionEnd(150) : removeElement() }
// ALERT PLUGIN DEFINITION // =======================
var old = $.fn.alert
$.fn.alert = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.alert')
if (!data) $this.data('bs.alert', (data = new Alert(this))) if (typeof option == 'string') data[option].call($this) }) }
$.fn.alert.Constructor = Alert
// ALERT NO CONFLICT // =================
$.fn.alert.noConflict = function () { $.fn.alert = old return this }
// ALERT DATA-API // ==============
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
}(jQuery);
/* ========================================================================
* Bootstrap: button.js v3.1.1 * http://getbootstrap.com/javascript/#buttons * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// BUTTON PUBLIC CLASS DEFINITION // ==============================
var Button = function (element, options) { this.$element = $(element) this.options = $.extend({}, Button.DEFAULTS, options) this.isLoading = false }
Button.DEFAULTS = { loadingText: 'loading...' }
Button.prototype.setState = function (state) { var d = 'disabled' var $el = this.$element var val = $el.is('input') ? 'val' : 'html' var data = $el.data()
state = state + 'Text'
if (!data.resetText) $el.data('resetText', $el[val]())
$el[val](data[state] || this.options[state])
// push to event loop to allow forms to submit setTimeout($.proxy(function () { if (state == 'loadingText') { this.isLoading = true $el.addClass(d).attr(d, d) } else if (this.isLoading) { this.isLoading = false $el.removeClass(d).removeAttr(d) } }, this), 0) }
Button.prototype.toggle = function () { var changed = true var $parent = this.$element.closest('[data-toggle="buttons"]')
if ($parent.length) { var $input = this.$element.find('input') if ($input.prop('type') == 'radio') { if ($input.prop('checked') && this.$element.hasClass('active')) changed = false else $parent.find('.active').removeClass('active') } if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') }
if (changed) this.$element.toggleClass('active') }
// BUTTON PLUGIN DEFINITION // ========================
var old = $.fn.button
$.fn.button = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new Button(this, options)))
if (option == 'toggle') data.toggle() else if (option) data.setState(option) }) }
$.fn.button.Constructor = Button
// BUTTON NO CONFLICT // ==================
$.fn.button.noConflict = function () { $.fn.button = old return this }
// BUTTON DATA-API // ===============
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { var $btn = $(e.target) if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') $btn.button('toggle') e.preventDefault() })
}(jQuery);
/* ========================================================================
* Bootstrap: carousel.js v3.1.1 * http://getbootstrap.com/javascript/#carousel * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// CAROUSEL CLASS DEFINITION // =========================
var Carousel = function (element, options) { this.$element = $(element) this.$indicators = this.$element.find('.carousel-indicators') this.options = options this.paused = this.sliding = this.interval = this.$active = this.$items = null
this.options.pause == 'hover' && this.$element .on('mouseenter', $.proxy(this.pause, this)) .on('mouseleave', $.proxy(this.cycle, this)) }
Carousel.DEFAULTS = { interval: 5000, pause: 'hover', wrap: true }
Carousel.prototype.cycle = function (e) { e || (this.paused = false)
this.interval && clearInterval(this.interval)
this.options.interval && !this.paused && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this }
Carousel.prototype.getActiveIndex = function () { this.$active = this.$element.find('.item.active') this.$items = this.$active.parent().children()
return this.$items.index(this.$active) }
Carousel.prototype.to = function (pos) { var that = this var activeIndex = this.getActiveIndex()
if (pos > (this.$items.length - 1) || pos < 0) return
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) if (activeIndex == pos) return this.pause().cycle()
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) }
Carousel.prototype.pause = function (e) { e || (this.paused = true)
if (this.$element.find('.next, .prev').length && $.support.transition) { this.$element.trigger($.support.transition.end) this.cycle(true) }
this.interval = clearInterval(this.interval)
return this }
Carousel.prototype.next = function () { if (this.sliding) return return this.slide('next') }
Carousel.prototype.prev = function () { if (this.sliding) return return this.slide('prev') }
Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') var $next = next || $active[type]() var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' var fallback = type == 'next' ? 'first' : 'last' var that = this
if (!$next.length) { if (!this.options.wrap) return $next = this.$element.find('.item')[fallback]() }
if ($next.hasClass('active')) return this.sliding = false
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) this.$element.trigger(e) if (e.isDefaultPrevented()) return
this.sliding = true
isCycling && this.pause()
if (this.$indicators.length) { this.$indicators.find('.active').removeClass('active') this.$element.one('slid.bs.carousel', function () { var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) $nextIndicator && $nextIndicator.addClass('active') }) }
if ($.support.transition && this.$element.hasClass('slide')) { $next.addClass(type) $next[0].offsetWidth // force reflow $active.addClass(direction) $next.addClass(direction) $active .one($.support.transition.end, function () { $next.removeClass([type, direction].join(' ')).addClass('active') $active.removeClass(['active', direction].join(' ')) that.sliding = false setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) }) .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) } else { $active.removeClass('active') $next.addClass('active') this.sliding = false this.$element.trigger('slid.bs.carousel') }
isCycling && this.cycle()
return this }
// CAROUSEL PLUGIN DEFINITION // ==========================
var old = $.fn.carousel
$.fn.carousel = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.carousel') var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) var action = typeof option == 'string' ? option : options.slide
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) else if (action) data[action]() else if (options.interval) data.pause().cycle() }) }
$.fn.carousel.Constructor = Carousel
// CAROUSEL NO CONFLICT // ====================
$.fn.carousel.noConflict = function () { $.fn.carousel = old return this }
// CAROUSEL DATA-API // =================
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { var $this = $(this), href var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, )) //strip for ie7 var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false
$target.carousel(options)
if (slideIndex = $this.attr('data-slide-to')) { $target.data('bs.carousel').to(slideIndex) }
e.preventDefault() })
$(window).on('load', function () { $('[data-ride="carousel"]').each(function () { var $carousel = $(this) $carousel.carousel($carousel.data()) }) })
}(jQuery);
/* ========================================================================
* Bootstrap: collapse.js v3.1.1 * http://getbootstrap.com/javascript/#collapse * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// COLLAPSE PUBLIC CLASS DEFINITION // ================================
var Collapse = function (element, options) { this.$element = $(element) this.options = $.extend({}, Collapse.DEFAULTS, options) this.transitioning = null
if (this.options.parent) this.$parent = $(this.options.parent) if (this.options.toggle) this.toggle() }
Collapse.DEFAULTS = { toggle: true }
Collapse.prototype.dimension = function () { var hasWidth = this.$element.hasClass('width') return hasWidth ? 'width' : 'height' }
Collapse.prototype.show = function () { if (this.transitioning || this.$element.hasClass('in')) return
var startEvent = $.Event('show.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return
var actives = this.$parent && this.$parent.find('> .panel > .in')
if (actives && actives.length) { var hasData = actives.data('bs.collapse') if (hasData && hasData.transitioning) return actives.collapse('hide') hasData || actives.data('bs.collapse', null) }
var dimension = this.dimension()
this.$element .removeClass('collapse') .addClass('collapsing') [dimension](0)
this.transitioning = 1
var complete = function () { this.$element .removeClass('collapsing') .addClass('collapse in') [dimension]('auto') this.transitioning = 0 this.$element.trigger('shown.bs.collapse') }
if (!$.support.transition) return complete.call(this)
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
this.$element .one($.support.transition.end, $.proxy(complete, this)) .emulateTransitionEnd(350) [dimension](this.$element[0][scrollSize]) }
Collapse.prototype.hide = function () { if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse') this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return
var dimension = this.dimension()
this.$element [dimension](this.$element[dimension]()) [0].offsetHeight
this.$element .addClass('collapsing') .removeClass('collapse') .removeClass('in')
this.transitioning = 1
var complete = function () { this.transitioning = 0 this.$element .trigger('hidden.bs.collapse') .removeClass('collapsing') .addClass('collapse') }
if (!$.support.transition) return complete.call(this)
this.$element [dimension](0) .one($.support.transition.end, $.proxy(complete, this)) .emulateTransitionEnd(350) }
Collapse.prototype.toggle = function () { this[this.$element.hasClass('in') ? 'hide' : 'show']() }
// COLLAPSE PLUGIN DEFINITION // ==========================
var old = $.fn.collapse
$.fn.collapse = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data && options.toggle && option == 'show') option = !option if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) }
$.fn.collapse.Constructor = Collapse
// COLLAPSE NO CONFLICT // ====================
$.fn.collapse.noConflict = function () { $.fn.collapse = old return this }
// COLLAPSE DATA-API // =================
$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { var $this = $(this), href var target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, ) //strip for ie7 var $target = $(target) var data = $target.data('bs.collapse') var option = data ? 'toggle' : $this.data() var parent = $this.attr('data-parent') var $parent = parent && $(parent)
if (!data || !data.transitioning) { if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') }
$target.collapse(option) })
}(jQuery);
/* ========================================================================
* Bootstrap: dropdown.js v3.1.1 * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// DROPDOWN CLASS DEFINITION // =========================
var backdrop = '.dropdown-backdrop' var toggle = '[data-toggle=dropdown]' var Dropdown = function (element) { $(element).on('click.bs.dropdown', this.toggle) }
Dropdown.prototype.toggle = function (e) { var $this = $(this)
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this) var isActive = $parent.hasClass('open')
clearMenus()
if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { // if mobile we use a backdrop because click events don't delegate $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) }
var relatedTarget = { relatedTarget: this } $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
if (e.isDefaultPrevented()) return
$parent .toggleClass('open') .trigger('shown.bs.dropdown', relatedTarget)
$this.focus() }
return false }
Dropdown.prototype.keydown = function (e) { if (!/(38|40|27)/.test(e.keyCode)) return
var $this = $(this)
e.preventDefault() e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this) var isActive = $parent.hasClass('open')
if (!isActive || (isActive && e.keyCode == 27)) { if (e.which == 27) $parent.find(toggle).focus() return $this.click() }
var desc = ' li:not(.divider):visible a' var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
if (!$items.length) return
var index = $items.index($items.filter(':focus'))
if (e.keyCode == 38 && index > 0) index-- // up if (e.keyCode == 40 && index < $items.length - 1) index++ // down if (!~index) index = 0
$items.eq(index).focus() }
function clearMenus(e) { $(backdrop).remove() $(toggle).each(function () { var $parent = getParent($(this)) var relatedTarget = { relatedTarget: this } if (!$parent.hasClass('open')) return $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) if (e.isDefaultPrevented()) return $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) }) }
function getParent($this) { var selector = $this.attr('data-target')
if (!selector) { selector = $this.attr('href') selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, ) //strip for ie7 }
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent() }
// DROPDOWN PLUGIN DEFINITION // ==========================
var old = $.fn.dropdown
$.fn.dropdown = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.dropdown')
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) if (typeof option == 'string') data[option].call($this) }) }
$.fn.dropdown.Constructor = Dropdown
// DROPDOWN NO CONFLICT // ====================
$.fn.dropdown.noConflict = function () { $.fn.dropdown = old return this }
// APPLY TO STANDARD DROPDOWN ELEMENTS // ===================================
$(document) .on('click.bs.dropdown.data-api', clearMenus) .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
}(jQuery);
/* ========================================================================
* Bootstrap: modal.js v3.1.1 * http://getbootstrap.com/javascript/#modals * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// MODAL CLASS DEFINITION // ======================
var Modal = function (element, options) { this.options = options this.$element = $(element) this.$backdrop = this.isShown = null
if (this.options.remote) { this.$element .find('.modal-content') .load(this.options.remote, $.proxy(function () { this.$element.trigger('loaded.bs.modal') }, this)) } }
Modal.DEFAULTS = { backdrop: true, keyboard: true, show: true }
Modal.prototype.toggle = function (_relatedTarget) { return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) }
Modal.prototype.show = function (_relatedTarget) { var that = this var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
if (this.isShown || e.isDefaultPrevented()) return
this.isShown = true
this.escape()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.backdrop(function () { var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) { that.$element.appendTo(document.body) // don't move modals dom position }
that.$element .show() .scrollTop(0)
if (transition) { that.$element[0].offsetWidth // force reflow }
that.$element .addClass('in') .attr('aria-hidden', false)
that.enforceFocus()
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
transition ? that.$element.find('.modal-dialog') // wait for modal to slide in .one($.support.transition.end, function () { that.$element.focus().trigger(e) }) .emulateTransitionEnd(300) : that.$element.focus().trigger(e) }) }
Modal.prototype.hide = function (e) { if (e) e.preventDefault()
e = $.Event('hide.bs.modal')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
this.escape()
$(document).off('focusin.bs.modal')
this.$element .removeClass('in') .attr('aria-hidden', true) .off('click.dismiss.bs.modal')
$.support.transition && this.$element.hasClass('fade') ? this.$element .one($.support.transition.end, $.proxy(this.hideModal, this)) .emulateTransitionEnd(300) : this.hideModal() }
Modal.prototype.enforceFocus = function () { $(document) .off('focusin.bs.modal') // guard against infinite focus loop .on('focusin.bs.modal', $.proxy(function (e) { if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { this.$element.focus() } }, this)) }
Modal.prototype.escape = function () { if (this.isShown && this.options.keyboard) { this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { e.which == 27 && this.hide() }, this)) } else if (!this.isShown) { this.$element.off('keyup.dismiss.bs.modal') } }
Modal.prototype.hideModal = function () { var that = this this.$element.hide() this.backdrop(function () { that.removeBackdrop() that.$element.trigger('hidden.bs.modal') }) }
Modal.prototype.removeBackdrop = function () { this.$backdrop && this.$backdrop.remove() this.$backdrop = null }
Modal.prototype.backdrop = function (callback) { var animate = this.$element.hasClass('fade') ? 'fade' :
if (this.isShown && this.options.backdrop) { var doAnimate = $.support.transition && animate
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') .appendTo(document.body)
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { if (e.target !== e.currentTarget) return this.options.backdrop == 'static' ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this) }, this))
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
if (!callback) return
doAnimate ? this.$backdrop .one($.support.transition.end, callback) .emulateTransitionEnd(150) : callback()
} else if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade') ? this.$backdrop .one($.support.transition.end, callback) .emulateTransitionEnd(150) : callback()
} else if (callback) { callback() } }
// MODAL PLUGIN DEFINITION // =======================
var old = $.fn.modal
$.fn.modal = function (option, _relatedTarget) { return this.each(function () { var $this = $(this) var data = $this.data('bs.modal') var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new Modal(this, options))) if (typeof option == 'string') data[option](_relatedTarget) else if (options.show) data.show(_relatedTarget) }) }
$.fn.modal.Constructor = Modal
// MODAL NO CONFLICT // =================
$.fn.modal.noConflict = function () { $.fn.modal = old return this }
// MODAL DATA-API // ==============
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { var $this = $(this) var href = $this.attr('href') var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ))) //strip for ie7 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
if ($this.is('a')) e.preventDefault()
$target .modal(option, this) .one('hide', function () { $this.is(':visible') && $this.focus() }) })
$(document) .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
}(jQuery);
/* ========================================================================
* Bootstrap: tooltip.js v3.1.1 * http://getbootstrap.com/javascript/#tooltip * Inspired by the original jQuery.tipsy by Jason Frame * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// TOOLTIP PUBLIC CLASS DEFINITION // ===============================
var Tooltip = function (element, options) { this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null
this.init('tooltip', element, options) }
Tooltip.DEFAULTS = { animation: true, placement: 'top', selector: false,template: '
trigger: 'hover focus', title: , delay: 0, html: false, container: false }
Tooltip.prototype.init = function (type, element, options) { this.enabled = true this.type = type this.$element = $(element) this.options = this.getOptions(options)
var triggers = this.options.trigger.split(' ')
for (var i = triggers.length; i--;) { var trigger = triggers[i]
if (trigger == 'click') { this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) } else if (trigger != 'manual') { var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) } }
this.options.selector ? (this._options = $.extend({}, this.options, { trigger: 'manual', selector: })) : this.fixTitle() }
Tooltip.prototype.getDefaults = function () { return Tooltip.DEFAULTS }
Tooltip.prototype.getOptions = function (options) { options = $.extend({}, this.getDefaults(), this.$element.data(), options)
if (options.delay && typeof options.delay == 'number') { options.delay = { show: options.delay, hide: options.delay } }
return options }
Tooltip.prototype.getDelegateOptions = function () { var options = {} var defaults = this.getDefaults()
this._options && $.each(this._options, function (key, value) { if (defaults[key] != value) options[key] = value })
return options }
Tooltip.prototype.enter = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
self.hoverState = 'in'
if (!self.options.delay || !self.options.delay.show) return self.show()
self.timeout = setTimeout(function () { if (self.hoverState == 'in') self.show() }, self.options.delay.show) }
Tooltip.prototype.leave = function (obj) { var self = obj instanceof this.constructor ? obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
self.hoverState = 'out'
if (!self.options.delay || !self.options.delay.hide) return self.hide()
self.timeout = setTimeout(function () { if (self.hoverState == 'out') self.hide() }, self.options.delay.hide) }
Tooltip.prototype.show = function () { var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) { this.$element.trigger(e)
if (e.isDefaultPrevented()) return var that = this;
var $tip = this.tip()
this.setContent()
if (this.options.animation) $tip.addClass('fade')
var placement = typeof this.options.placement == 'function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement
var autoToken = /\s?auto?\s?/i var autoPlace = autoToken.test(placement) if (autoPlace) placement = placement.replace(autoToken, ) || 'top'
$tip .detach() .css({ top: 0, left: 0, display: 'block' }) .addClass(placement)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
var pos = this.getPosition() var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight
if (autoPlace) { var $parent = this.$element.parent()
var orgPlacement = placement var docScroll = document.documentElement.scrollTop || document.body.scrollTop var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' : placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' : placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' : placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' : placement
$tip .removeClass(orgPlacement) .addClass(placement) }
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
this.applyPlacement(calculatedOffset, placement) this.hoverState = null
var complete = function() { that.$element.trigger('shown.bs.' + that.type) }
$.support.transition && this.$tip.hasClass('fade') ? $tip .one($.support.transition.end, complete) .emulateTransitionEnd(150) : complete() } }
Tooltip.prototype.applyPlacement = function (offset, placement) { var replace var $tip = this.tip() var width = $tip[0].offsetWidth var height = $tip[0].offsetHeight
// manually read margins because getBoundingClientRect includes difference var marginTop = parseInt($tip.css('margin-top'), 10) var marginLeft = parseInt($tip.css('margin-left'), 10)
// we must check for NaN for ie 8/9 if (isNaN(marginTop)) marginTop = 0 if (isNaN(marginLeft)) marginLeft = 0
offset.top = offset.top + marginTop offset.left = offset.left + marginLeft
// $.fn.offset doesn't round pixel values // so we use setOffset directly with our own function B-0 $.offset.setOffset($tip[0], $.extend({ using: function (props) { $tip.css({ top: Math.round(props.top), left: Math.round(props.left) }) } }, offset), 0)
$tip.addClass('in')
// check to see if placing tip in new offset caused the tip to resize itself var actualWidth = $tip[0].offsetWidth var actualHeight = $tip[0].offsetHeight
if (placement == 'top' && actualHeight != height) { replace = true offset.top = offset.top + height - actualHeight }
if (/bottom|top/.test(placement)) { var delta = 0
if (offset.left < 0) { delta = offset.left * -2 offset.left = 0
$tip.offset(offset)
actualWidth = $tip[0].offsetWidth actualHeight = $tip[0].offsetHeight }
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') } else { this.replaceArrow(actualHeight - height, actualHeight, 'top') }
if (replace) $tip.offset(offset) }
Tooltip.prototype.replaceArrow = function (delta, dimension, position) { this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : ) }
Tooltip.prototype.setContent = function () { var $tip = this.tip() var title = this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) $tip.removeClass('fade in top bottom left right') }
Tooltip.prototype.hide = function () { var that = this var $tip = this.tip() var e = $.Event('hide.bs.' + this.type)
function complete() { if (that.hoverState != 'in') $tip.detach() that.$element.trigger('hidden.bs.' + that.type) }
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip.removeClass('in')
$.support.transition && this.$tip.hasClass('fade') ? $tip .one($.support.transition.end, complete) .emulateTransitionEnd(150) : complete()
this.hoverState = null
return this }
Tooltip.prototype.fixTitle = function () { var $e = this.$element if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { $e.attr('data-original-title', $e.attr('title') || ).attr('title', ) } }
Tooltip.prototype.hasContent = function () { return this.getTitle() }
Tooltip.prototype.getPosition = function () { var el = this.$element[0] return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { width: el.offsetWidth, height: el.offsetHeight }, this.$element.offset()) }
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } }
Tooltip.prototype.getTitle = function () { var title var $e = this.$element var o = this.options
title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
return title }
Tooltip.prototype.tip = function () { return this.$tip = this.$tip || $(this.options.template) }
Tooltip.prototype.arrow = function () { return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') }
Tooltip.prototype.validate = function () { if (!this.$element[0].parentNode) { this.hide() this.$element = null this.options = null } }
Tooltip.prototype.enable = function () { this.enabled = true }
Tooltip.prototype.disable = function () { this.enabled = false }
Tooltip.prototype.toggleEnabled = function () { this.enabled = !this.enabled }
Tooltip.prototype.toggle = function (e) { var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this self.tip().hasClass('in') ? self.leave(self) : self.enter(self) }
Tooltip.prototype.destroy = function () { clearTimeout(this.timeout) this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) }
// TOOLTIP PLUGIN DEFINITION // =========================
var old = $.fn.tooltip
$.fn.tooltip = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tooltip') var options = typeof option == 'object' && option
if (!data && option == 'destroy') return if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) if (typeof option == 'string') data[option]() }) }
$.fn.tooltip.Constructor = Tooltip
// TOOLTIP NO CONFLICT // ===================
$.fn.tooltip.noConflict = function () { $.fn.tooltip = old return this }
}(jQuery);
/* ========================================================================
* Bootstrap: popover.js v3.1.1 * http://getbootstrap.com/javascript/#popovers * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// POPOVER PUBLIC CLASS DEFINITION // ===============================
var Popover = function (element, options) { this.init('popover', element, options) }
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { placement: 'right', trigger: 'click', content: ,template: '
})
// NOTE: POPOVER EXTENDS tooltip.js // ================================
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
Popover.prototype.constructor = Popover
Popover.prototype.getDefaults = function () { return Popover.DEFAULTS }
Popover.prototype.setContent = function () { var $tip = this.tip() var title = this.getTitle() var content = this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) $tip.find('.popover-content')[ // we use append for html objects to maintain js events this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' ](content)
$tip.removeClass('fade top bottom left right in')
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do // this manually by checking the contents. if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() }
Popover.prototype.hasContent = function () { return this.getTitle() || this.getContent() }
Popover.prototype.getContent = function () { var $e = this.$element var o = this.options
return $e.attr('data-content') || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) }
Popover.prototype.arrow = function () { return this.$arrow = this.$arrow || this.tip().find('.arrow') }
Popover.prototype.tip = function () { if (!this.$tip) this.$tip = $(this.options.template) return this.$tip }
// POPOVER PLUGIN DEFINITION // =========================
var old = $.fn.popover
$.fn.popover = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.popover') var options = typeof option == 'object' && option
if (!data && option == 'destroy') return if (!data) $this.data('bs.popover', (data = new Popover(this, options))) if (typeof option == 'string') data[option]() }) }
$.fn.popover.Constructor = Popover
// POPOVER NO CONFLICT // ===================
$.fn.popover.noConflict = function () { $.fn.popover = old return this }
}(jQuery);
/* ========================================================================
* Bootstrap: scrollspy.js v3.1.1 * http://getbootstrap.com/javascript/#scrollspy * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// SCROLLSPY CLASS DEFINITION // ==========================
function ScrollSpy(element, options) { var href var process = $.proxy(this.process, this)
this.$element = $(element).is('body') ? $(window) : $(element) this.$body = $('body') this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.selector = (this.options.target || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, )) //strip for ie7 || ) + ' .nav li > a' this.offsets = $([]) this.targets = $([]) this.activeTarget = null
this.refresh() this.process() }
ScrollSpy.DEFAULTS = { offset: 10 }
ScrollSpy.prototype.refresh = function () { var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
this.offsets = $([]) this.targets = $([])
var self = this var $targets = this.$body .find(this.selector) .map(function () { var $el = $(this) var href = $el.data('target') || $el.attr('href') var $href = /^#./.test(href) && $(href)
return ($href && $href.length && $href.is(':visible') && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null }) .sort(function (a, b) { return a[0] - b[0] }) .each(function () { self.offsets.push(this[0]) self.targets.push(this[1]) }) }
ScrollSpy.prototype.process = function () { var scrollTop = this.$scrollElement.scrollTop() + this.options.offset var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight var maxScroll = scrollHeight - this.$scrollElement.height() var offsets = this.offsets var targets = this.targets var activeTarget = this.activeTarget var i
if (scrollTop >= maxScroll) { return activeTarget != (i = targets.last()[0]) && this.activate(i) }
if (activeTarget && scrollTop <= offsets[0]) { return activeTarget != (i = targets[0]) && this.activate(i) }
for (i = offsets.length; i--;) { activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) && this.activate( targets[i] ) } }
ScrollSpy.prototype.activate = function (target) { this.activeTarget = target
$(this.selector) .parentsUntil(this.options.target, '.active') .removeClass('active')
var selector = this.selector + '[data-target="' + target + '"],' + this.selector + '[href="' + target + '"]'
var active = $(selector) .parents('li') .addClass('active')
if (active.parent('.dropdown-menu').length) { active = active .closest('li.dropdown') .addClass('active') }
active.trigger('activate.bs.scrollspy') }
// SCROLLSPY PLUGIN DEFINITION // ===========================
var old = $.fn.scrollspy
$.fn.scrollspy = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.scrollspy') var options = typeof option == 'object' && option
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) if (typeof option == 'string') data[option]() }) }
$.fn.scrollspy.Constructor = ScrollSpy
// SCROLLSPY NO CONFLICT // =====================
$.fn.scrollspy.noConflict = function () { $.fn.scrollspy = old return this }
// SCROLLSPY DATA-API // ==================
$(window).on('load', function () { $('[data-spy="scroll"]').each(function () { var $spy = $(this) $spy.scrollspy($spy.data()) }) })
}(jQuery);
/* ========================================================================
* Bootstrap: tab.js v3.1.1 * http://getbootstrap.com/javascript/#tabs * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// TAB CLASS DEFINITION // ====================
var Tab = function (element) { this.element = $(element) }
Tab.prototype.show = function () { var $this = this.element var $ul = $this.closest('ul:not(.dropdown-menu)') var selector = $this.data('target')
if (!selector) { selector = $this.attr('href') selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ) //strip for ie7 }
if ($this.parent('li').hasClass('active')) return
var previous = $ul.find('.active:last a')[0] var e = $.Event('show.bs.tab', { relatedTarget: previous })
$this.trigger(e)
if (e.isDefaultPrevented()) return
var $target = $(selector)
this.activate($this.parent('li'), $ul) this.activate($target, $target.parent(), function () { $this.trigger({ type: 'shown.bs.tab', relatedTarget: previous }) }) }
Tab.prototype.activate = function (element, container, callback) { var $active = container.find('> .active') var transition = callback && $.support.transition && $active.hasClass('fade')
function next() { $active .removeClass('active') .find('> .dropdown-menu > .active') .removeClass('active')
element.addClass('active')
if (transition) { element[0].offsetWidth // reflow for transition element.addClass('in') } else { element.removeClass('fade') }
if (element.parent('.dropdown-menu')) { element.closest('li.dropdown').addClass('active') }
callback && callback() }
transition ? $active .one($.support.transition.end, next) .emulateTransitionEnd(150) : next()
$active.removeClass('in') }
// TAB PLUGIN DEFINITION // =====================
var old = $.fn.tab
$.fn.tab = function ( option ) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tab')
if (!data) $this.data('bs.tab', (data = new Tab(this))) if (typeof option == 'string') data[option]() }) }
$.fn.tab.Constructor = Tab
// TAB NO CONFLICT // ===============
$.fn.tab.noConflict = function () { $.fn.tab = old return this }
// TAB DATA-API // ============
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { e.preventDefault() $(this).tab('show') })
}(jQuery);
/* ========================================================================
* Bootstrap: affix.js v3.1.1 * http://getbootstrap.com/javascript/#affix * ======================================================================== * Copyright 2011-2014 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */
+function ($) {
'use strict';
// AFFIX CLASS DEFINITION // ======================
var Affix = function (element, options) { this.options = $.extend({}, Affix.DEFAULTS, options) this.$window = $(window) .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
this.$element = $(element) this.affixed = this.unpin = this.pinnedOffset = null
this.checkPosition() }
Affix.RESET = 'affix affix-top affix-bottom'
Affix.DEFAULTS = { offset: 0 }
Affix.prototype.getPinnedOffset = function () { if (this.pinnedOffset) return this.pinnedOffset this.$element.removeClass(Affix.RESET).addClass('affix') var scrollTop = this.$window.scrollTop() var position = this.$element.offset() return (this.pinnedOffset = position.top - scrollTop) }
Affix.prototype.checkPositionWithEventLoop = function () { setTimeout($.proxy(this.checkPosition, this), 1) }
Affix.prototype.checkPosition = function () { if (!this.$element.is(':visible')) return
var scrollHeight = $(document).height() var scrollTop = this.$window.scrollTop() var position = this.$element.offset() var offset = this.options.offset var offsetTop = offset.top var offsetBottom = offset.bottom
if (this.affixed == 'top') position.top += scrollTop
if (typeof offset != 'object') offsetBottom = offsetTop = offset if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
if (this.affixed === affix) return if (this.unpin) this.$element.css('top', )
var affixType = 'affix' + (affix ? '-' + affix : ) var e = $.Event(affixType + '.bs.affix')
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
this.affixed = affix this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
this.$element .removeClass(Affix.RESET) .addClass(affixType) .trigger($.Event(affixType.replace('affix', 'affixed')))
if (affix == 'bottom') { this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) } }
// AFFIX PLUGIN DEFINITION // =======================
var old = $.fn.affix
$.fn.affix = function (option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.affix') var options = typeof option == 'object' && option
if (!data) $this.data('bs.affix', (data = new Affix(this, options))) if (typeof option == 'string') data[option]() }) }
$.fn.affix.Constructor = Affix
// AFFIX NO CONFLICT // =================
$.fn.affix.noConflict = function () { $.fn.affix = old return this }
// AFFIX DATA-API // ==============
$(window).on('load', function () { $('[data-spy="affix"]').each(function () { var $spy = $(this) var data = $spy.data()
data.offset = data.offset || {}
if (data.offsetBottom) data.offset.bottom = data.offsetBottom if (data.offsetTop) data.offset.top = data.offsetTop
$spy.affix(data) }) })
}(jQuery);