s around - // "paragraphs" that are wrapped in non-block-level tags, such as anchors, - // phrase emphasis, and spans. The list of tags we're looking for is - // hard-coded: - var block_tags_a = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del" - var block_tags_b = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math" - - // First, look for nested blocks, e.g.: - //
tags around block-level tags.
- text = _HashHTMLBlocks(text);
- text = _FormParagraphs(text, doNotUnhash);
-
- return text;
- }
-
- function _RunSpanGamut(text) {
- //
- // These are all the transformations that occur *within* block-level
- // tags like paragraphs, headers, and list items.
- //
-
- text = pluginHooks.preSpanGamut(text);
-
- text = _DoCodeSpans(text);
- text = _EscapeSpecialCharsWithinTagAttributes(text);
- text = _EncodeBackslashEscapes(text);
-
- // Process anchor and image tags. Images must come first,
- // because ![foo][f] looks like an anchor.
- text = _DoImages(text);
- text = _DoAnchors(text);
-
- // Make links out of things like `
\n");
-
- text = pluginHooks.postSpanGamut(text);
-
- return text;
- }
-
- function _EscapeSpecialCharsWithinTagAttributes(text) {
- //
- // Within tags -- meaning between < and > -- encode [\ ` * _] so they
- // don't conflict with their use in Markdown for code, italics and strong.
- //
-
- // Build a regex to find HTML tags and comments. See Friedl's
- // "Mastering Regular Expressions", 2nd Ed., pp. 200-201.
-
- // SE: changed the comment part of the regex
-
- var regex = /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;
-
- text = text.replace(regex, function (wholeMatch) {
- var tag = wholeMatch.replace(/(.)<\/?code>(?=.)/g, "$1`");
- tag = escapeCharacters(tag, wholeMatch.charAt(1) == "!" ? "\\`*_/" : "\\`*_"); // also escape slashes in comments to prevent autolinking there -- http://meta.stackoverflow.com/questions/95987
- return tag;
- });
-
- return text;
- }
-
- function _DoAnchors(text) {
- //
- // Turn Markdown link shortcuts into XHTML tags.
- //
- //
- // First, handle reference-style links: [link text] [id]
- //
-
- /*
- text = text.replace(/
- ( // wrap whole match in $1
- \[
- (
- (?:
- \[[^\]]*\] // allow brackets nested one level
- |
- [^\[] // or anything else
- )*
- )
- \]
-
- [ ]? // one optional space
- (?:\n[ ]*)? // one optional newline followed by spaces
-
- \[
- (.*?) // id = $3
- \]
- )
- ()()()() // pad remaining backreferences
- /g, writeAnchorTag);
- */
- text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, writeAnchorTag);
-
- //
- // Next, inline-style links: [link text](url "optional title")
- //
-
- /*
- text = text.replace(/
- ( // wrap whole match in $1
- \[
- (
- (?:
- \[[^\]]*\] // allow brackets nested one level
- |
- [^\[\]] // or anything else
- )*
- )
- \]
- \( // literal paren
- [ \t]*
- () // no id, so leave $3 empty
- ( // href = $4
- (?:
- \([^)]*\) // allow one level of (correctly nested) parens (think MSDN)
- |
- [^()\s]
- )*?
- )>?
- [ \t]*
- ( // $5
- (['"]) // quote char = $6
- (.*?) // Title = $7
- \6 // matching quote
- [ \t]* // ignore any spaces/tabs between closing quote and )
- )? // title is optional
- \)
- )
- /g, writeAnchorTag);
- */
-
- text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()((?:\([^)]*\)|[^()\s])*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, writeAnchorTag);
-
- //
- // Last, handle reference-style shortcuts: [link text]
- // These must come last in case you've also got [link test][1]
- // or [link test](/foo)
- //
-
- /*
- text = text.replace(/
- ( // wrap whole match in $1
- \[
- ([^\[\]]+) // link text = $2; can't contain '[' or ']'
- \]
- )
- ()()()()() // pad rest of backreferences
- /g, writeAnchorTag);
- */
- text = text.replace(/(\[([^\[\]]+)\])()()()()()/g, writeAnchorTag);
-
- return text;
- }
-
- function writeAnchorTag(wholeMatch, m1, m2, m3, m4, m5, m6, m7) {
- if (m7 == undefined) m7 = "";
- var whole_match = m1;
- var link_text = m2.replace(/:\/\//g, "~P"); // to prevent auto-linking withing the link. will be converted back after the auto-linker runs
- var link_id = m3.toLowerCase();
- var url = m4;
- var title = m7;
-
- if (url == "") {
- if (link_id == "") {
- // lower-case and turn embedded newlines into spaces
- link_id = link_text.toLowerCase().replace(/ ?\n/g, " ");
- }
- url = "#" + link_id;
-
- if (g_urls.get(link_id) != undefined) {
- url = g_urls.get(link_id);
- if (g_titles.get(link_id) != undefined) {
- title = g_titles.get(link_id);
- }
- }
- else {
- if (whole_match.search(/\(\s*\)$/m) > -1) {
- // Special case for explicit empty url
- url = "";
- } else {
- return whole_match;
- }
- }
- }
- url = encodeProblemUrlChars(url);
- url = escapeCharacters(url, "*_");
- var result = "" + link_text + "";
-
- return result;
- }
-
- function _DoImages(text) {
- //
- // Turn Markdown image shortcuts into tags.
- //
-
- //
- // First, handle reference-style labeled images: ![alt text][id]
- //
-
- /*
- text = text.replace(/
- ( // wrap whole match in $1
- !\[
- (.*?) // alt text = $2
- \]
-
- [ ]? // one optional space
- (?:\n[ ]*)? // one optional newline followed by spaces
-
- \[
- (.*?) // id = $3
- \]
- )
- ()()()() // pad rest of backreferences
- /g, writeImageTag);
- */
- text = text.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, writeImageTag);
-
- //
- // Next, handle inline images: 
- // Don't forget: encode * and _
-
- /*
- text = text.replace(/
- ( // wrap whole match in $1
- !\[
- (.*?) // alt text = $2
- \]
- \s? // One optional whitespace character
- \( // literal paren
- [ \t]*
- () // no id, so leave $3 empty
- (\S+?)>? // src url = $4
- [ \t]*
- ( // $5
- (['"]) // quote char = $6
- (.*?) // title = $7
- \6 // matching quote
- [ \t]*
- )? // title is optional
- \)
- )
- /g, writeImageTag);
- */
- text = text.replace(/(!\[(.*?)\]\s?\([ \t]*()(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, writeImageTag);
-
- return text;
- }
-
- function attributeEncode(text) {
- // unconditionally replace angle brackets here -- what ends up in an attribute (e.g. alt or title)
- // never makes sense to have verbatim HTML in it (and the sanitizer would totally break it)
- return text.replace(/>/g, ">").replace(/
` blocks.
- //
-
- /*
- text = text.replace(/
- (?:\n\n|^)
- ( // $1 = the code block -- one or more lines, starting with a space/tab
- (?:
- (?:[ ]{4}|\t) // Lines must start with a tab or a tab-width of spaces - attacklab: g_tab_width
- .*\n+
- )+
- )
- (\n*[ ]{0,3}[^ \t\n]|(?=~0)) // attacklab: g_tab_width
- /g ,function(){...});
- */
-
- // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
- text += "~0";
-
- text = text.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,
- function (wholeMatch, m1, m2) {
- var codeblock = m1;
- var nextChar = m2;
-
- codeblock = _EncodeCode(_Outdent(codeblock));
- codeblock = _Detab(codeblock);
- codeblock = codeblock.replace(/^\n+/g, ""); // trim leading newlines
- codeblock = codeblock.replace(/\n+$/g, ""); // trim trailing whitespace
-
- codeblock = "" + codeblock + "\n
";
-
- return "\n\n" + codeblock + "\n\n" + nextChar;
- }
- );
-
- // attacklab: strip sentinel
- text = text.replace(/~0/, "");
-
- return text;
- }
-
- function hashBlock(text) {
- text = text.replace(/(^\n+|\n+$)/g, "");
- return "\n\n~K" + (g_html_blocks.push(text) - 1) + "K\n\n";
- }
-
- function _DoCodeSpans(text) {
- //
- // * Backtick quotes are used for spans.
- //
- // * You can use multiple backticks as the delimiters if you want to
- // include literal backticks in the code span. So, this input:
- //
- // Just type ``foo `bar` baz`` at the prompt.
- //
- // Will translate to:
- //
- // Just type foo `bar` baz at the prompt.
- //
- // There's no arbitrary limit to the number of backticks you
- // can use as delimters. If you need three consecutive backticks
- // in your code, use four for delimiters, etc.
- //
- // * You can use spaces to get literal backticks at the edges:
- //
- // ... type `` `bar` `` ...
- //
- // Turns to:
- //
- // ... type `bar` ...
- //
-
- /*
- text = text.replace(/
- (^|[^\\]) // Character before opening ` can't be a backslash
- (`+) // $2 = Opening run of `
- ( // $3 = The code block
- [^\r]*?
- [^`] // attacklab: work around lack of lookbehind
- )
- \2 // Matching closer
- (?!`)
- /gm, function(){...});
- */
-
- text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
- function (wholeMatch, m1, m2, m3, m4) {
- var c = m3;
- c = c.replace(/^([ \t]*)/g, ""); // leading whitespace
- c = c.replace(/[ \t]*$/g, ""); // trailing whitespace
- c = _EncodeCode(c);
- c = c.replace(/:\/\//g, "~P"); // to prevent auto-linking. Not necessary in code *blocks*, but in code spans. Will be converted back after the auto-linker runs.
- return m1 + "" + c + "";
- }
- );
-
- return text;
- }
-
- function _EncodeCode(text) {
- //
- // Encode/escape certain characters inside Markdown code runs.
- // The point is that in code, these characters are literals,
- // and lose their special Markdown meanings.
- //
- // Encode all ampersands; HTML entities are not
- // entities within a Markdown code span.
- text = text.replace(/&/g, "&");
-
- // Do the angle bracket song and dance:
- text = text.replace(/ content, so we need to fix that:
- bq = bq.replace(
- /(\s*[^\r]+?<\/pre>)/gm,
- function (wholeMatch, m1) {
- var pre = m1;
- // attacklab: hack around Konqueror 3.5.4 bug:
- pre = pre.replace(/^ /mg, "~0");
- pre = pre.replace(/~0/g, "");
- return pre;
- });
-
- return hashBlock("\n" + bq + "\n
");
- }
- );
- return text;
- }
-
- function _FormParagraphs(text, doNotUnhash) {
- //
- // Params:
- // $text - string to process with html tags
- //
-
- // Strip leading and trailing lines:
- text = text.replace(/^\n+/g, "");
- text = text.replace(/\n+$/g, "");
-
- var grafs = text.split(/\n{2,}/g);
- var grafsOut = [];
-
- var markerRe = /~K(\d+)K/;
-
- //
- // Wrap
tags.
- //
- var end = grafs.length;
- for (var i = 0; i < end; i++) {
- var str = grafs[i];
-
- // if this is an HTML marker, copy it
- if (markerRe.test(str)) {
- grafsOut.push(str);
- }
- else if (/\S/.test(str)) {
- str = _RunSpanGamut(str);
- str = str.replace(/^([ \t]*)/g, "
");
- str += "
"
- grafsOut.push(str);
- }
-
- }
- //
- // Unhashify HTML blocks
- //
- if (!doNotUnhash) {
- end = grafsOut.length;
- for (var i = 0; i < end; i++) {
- var foundAny = true;
- while (foundAny) { // we may need several runs, since the data may be nested
- foundAny = false;
- grafsOut[i] = grafsOut[i].replace(/~K(\d+)K/g, function (wholeMatch, id) {
- foundAny = true;
- return g_html_blocks[id];
- });
- }
- }
- }
- return grafsOut.join("\n\n");
- }
-
- function _EncodeAmpsAndAngles(text) {
- // Smart processing for ampersands and angle brackets that need to be encoded.
-
- // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
- // http://bumppo.net/projects/amputator/
- text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&");
-
- // Encode naked <'s
- text = text.replace(/<(?![a-z\/?!]|~D)/gi, "<");
-
- return text;
- }
-
- function _EncodeBackslashEscapes(text) {
- //
- // Parameter: String.
- // Returns: The string, with after processing the following backslash
- // escape sequences.
- //
-
- // attacklab: The polite way to do this is with the new
- // escapeCharacters() function:
- //
- // text = escapeCharacters(text,"\\",true);
- // text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
- //
- // ...but we're sidestepping its use of the (slow) RegExp constructor
- // as an optimization for Firefox. This function gets called a LOT.
-
- text = text.replace(/\\(\\)/g, escapeCharacters_callback);
- text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g, escapeCharacters_callback);
- return text;
- }
-
- function handleTrailingParens(wholeMatch, lookbehind, protocol, link) {
- if (lookbehind)
- return wholeMatch;
- if (link.charAt(link.length - 1) !== ")")
- return "<" + protocol + link + ">";
- var parens = link.match(/[()]/g);
- var level = 0;
- for (var i = 0; i < parens.length; i++) {
- if (parens[i] === "(") {
- if (level <= 0)
- level = 1;
- else
- level++;
- }
- else {
- level--;
- }
- }
- var tail = "";
- if (level < 0) {
- var re = new RegExp("\\){1," + (-level) + "}$");
- link = link.replace(re, function (trailingParens) {
- tail = trailingParens;
- return "";
- });
- }
-
- return "<" + protocol + link + ">" + tail;
- }
-
- function _DoAutoLinks(text) {
-
- // note that at this point, all other URL in the text are already hyperlinked as
- // *except* for the case
-
- // automatically add < and > around unadorned raw hyperlinks
- // must be preceded by a non-word character (and not by =" or <) and followed by non-word/EOF character
- // simulating the lookbehind in a consuming way is okay here, since a URL can neither and with a " nor
- // with a <, so there is no risk of overlapping matches.
- text = text.replace(/(="|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi, handleTrailingParens);
-
- // autolink anything like
-
- var replacer = function (wholematch, m1) { return "" + pluginHooks.plainLinkText(m1) + ""; }
- text = text.replace(/<((https?|ftp):[^'">\s]+)>/gi, replacer);
-
- // Email addresses:
- /*
- text = text.replace(/
- <
- (?:mailto:)?
- (
- [-.\w]+
- \@
- [-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+
- )
- >
- /gi, _DoAutoLinks_callback());
- */
-
- /* disabling email autolinking, since we don't do that on the server, either
- text = text.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
- function(wholeMatch,m1) {
- return _EncodeEmailAddress( _UnescapeSpecialChars(m1) );
- }
- );
- */
- return text;
- }
-
- function _UnescapeSpecialChars(text) {
- //
- // Swap back in all the special characters we've hidden.
- //
- text = text.replace(/~E(\d+)E/g,
- function (wholeMatch, m1) {
- var charCodeToReplace = parseInt(m1);
- return String.fromCharCode(charCodeToReplace);
- }
- );
- return text;
- }
-
- function _Outdent(text) {
- //
- // Remove one level of line-leading tabs or spaces
- //
-
- // attacklab: hack around Konqueror 3.5.4 bug:
- // "----------bug".replace(/^-/g,"") == "bug"
-
- text = text.replace(/^(\t|[ ]{1,4})/gm, "~0"); // attacklab: g_tab_width
-
- // attacklab: clean up hack
- text = text.replace(/~0/g, "")
-
- return text;
- }
-
- function _Detab(text) {
- if (!/\t/.test(text))
- return text;
-
- var spaces = [" ", " ", " ", " "],
- skew = 0,
- v;
-
- return text.replace(/[\n\t]/g, function (match, offset) {
- if (match === "\n") {
- skew = offset + 1;
- return match;
- }
- v = (offset - skew) % 4;
- skew = offset + 1;
- return spaces[v];
- });
- }
-
- //
- // attacklab: Utility functions
- //
-
- var _problemUrlChars = /(?:["'*()[\]:]|~D)/g;
-
- // hex-encodes some unusual "problem" chars in URLs to avoid URL detection problems
- function encodeProblemUrlChars(url) {
- if (!url)
- return "";
-
- var len = url.length;
-
- return url.replace(_problemUrlChars, function (match, offset) {
- if (match == "~D") // escape for dollar
- return "%24";
- if (match == ":") {
- if (offset == len - 1 || /[0-9\/]/.test(url.charAt(offset + 1)))
- return ":"
- }
- return "%" + match.charCodeAt(0).toString(16);
- });
- }
-
-
- function escapeCharacters(text, charsToEscape, afterBackslash) {
- // First we have to escape the escape characters so that
- // we can build a character class out of them
- var regexString = "([" + charsToEscape.replace(/([\[\]\\])/g, "\\$1") + "])";
-
- if (afterBackslash) {
- regexString = "\\\\" + regexString;
- }
-
- var regex = new RegExp(regexString, "g");
- text = text.replace(regex, escapeCharacters_callback);
-
- return text;
- }
-
-
- function escapeCharacters_callback(wholeMatch, m1) {
- var charCodeToEscape = m1.charCodeAt(0);
- return "~E" + charCodeToEscape + "E";
- }
-
- }; // end of the Markdown.Converter constructor
-
-})();
diff --git a/docs/js/Markdown.Extra.js b/docs/js/Markdown.Extra.js
deleted file mode 100644
index 6ab5e42b73..0000000000
--- a/docs/js/Markdown.Extra.js
+++ /dev/null
@@ -1,787 +0,0 @@
-(function () {
- // A quick way to make sure we're only keeping span-level tags when we need to.
- // This isn't supposed to be foolproof. It's just a quick way to make sure we
- // keep all span-level tags returned by a pagedown converter. It should allow
- // all span-level tags through, with or without attributes.
- var inlineTags = new RegExp(['^(<\\/?(a|abbr|acronym|applet|area|b|basefont|',
- 'bdo|big|button|cite|code|del|dfn|em|figcaption|',
- 'font|i|iframe|img|input|ins|kbd|label|map|',
- 'mark|meter|object|param|progress|q|ruby|rp|rt|s|',
- 'samp|script|select|small|span|strike|strong|',
- 'sub|sup|textarea|time|tt|u|var|wbr)[^>]*>|',
- '<(br)\\s?\\/?>)$'].join(''), 'i');
-
- /******************************************************************
- * Utility Functions *
- *****************************************************************/
-
- // patch for ie7
- if (!Array.indexOf) {
- Array.prototype.indexOf = function(obj) {
- for (var i = 0; i < this.length; i++) {
- if (this[i] == obj) {
- return i;
- }
- }
- return -1;
- };
- }
-
- function trim(str) {
- return str.replace(/^\s+|\s+$/g, '');
- }
-
- function rtrim(str) {
- return str.replace(/\s+$/g, '');
- }
-
- // Remove one level of indentation from text. Indent is 4 spaces.
- function outdent(text) {
- return text.replace(new RegExp('^(\\t|[ ]{1,4})', 'gm'), '');
- }
-
- function contains(str, substr) {
- return str.indexOf(substr) != -1;
- }
-
- // Sanitize html, removing tags that aren't in the whitelist
- function sanitizeHtml(html, whitelist) {
- return html.replace(/<[^>]*>?/gi, function(tag) {
- return tag.match(whitelist) ? tag : '';
- });
- }
-
- // Merge two arrays, keeping only unique elements.
- function union(x, y) {
- var obj = {};
- for (var i = 0; i < x.length; i++)
- obj[x[i]] = x[i];
- for (i = 0; i < y.length; i++)
- obj[y[i]] = y[i];
- var res = [];
- for (var k in obj) {
- if (obj.hasOwnProperty(k))
- res.push(obj[k]);
- }
- return res;
- }
-
- // JS regexes don't support \A or \Z, so we add sentinels, as Pagedown
- // does. In this case, we add the ascii codes for start of text (STX) and
- // end of text (ETX), an idea borrowed from:
- // https://github.com/tanakahisateru/js-markdown-extra
- function addAnchors(text) {
- if(text.charAt(0) != '\x02')
- text = '\x02' + text;
- if(text.charAt(text.length - 1) != '\x03')
- text = text + '\x03';
- return text;
- }
-
- // Remove STX and ETX sentinels.
- function removeAnchors(text) {
- if(text.charAt(0) == '\x02')
- text = text.substr(1);
- if(text.charAt(text.length - 1) == '\x03')
- text = text.substr(0, text.length - 1);
- return text;
- }
-
- // Convert markdown within an element, retaining only span-level tags
- function convertSpans(text, extra) {
- return sanitizeHtml(convertAll(text, extra), inlineTags);
- }
-
- // Convert internal markdown using the stock pagedown converter
- function convertAll(text, extra) {
- var result = extra.blockGamutHookCallback(text);
- // We need to perform these operations since we skip the steps in the converter
- result = unescapeSpecialChars(result);
- result = result.replace(/~D/g, "$$").replace(/~T/g, "~");
- result = extra.previousPostConversion(result);
- return result;
- }
-
- // Convert escaped special characters to HTML decimal entity codes.
- function processEscapes(text) {
- // Markdown extra adds two escapable characters, `:` and `|`
- // If escaped, we convert them to html entities so our
- // regexes don't recognize them. Markdown doesn't support escaping
- // the escape character, e.g. `\\`, which make this even simpler.
- return text.replace(/\\\|/g, '|').replace(/\\:/g, ':');
- }
-
- // Duplicated from PageDown converter
- function unescapeSpecialChars(text) {
- // Swap back in all the special characters we've hidden.
- text = text.replace(/~E(\d+)E/g, function(wholeMatch, m1) {
- var charCodeToReplace = parseInt(m1);
- return String.fromCharCode(charCodeToReplace);
- });
- return text;
- }
-
- function slugify(text) {
- return text.toLowerCase()
- .replace(/\s+/g, '-') // Replace spaces with -
- .replace(/[^\w\-]+/g, '') // Remove all non-word chars
- .replace(/\-\-+/g, '-') // Replace multiple - with single -
- .replace(/^-+/, '') // Trim - from start of text
- .replace(/-+$/, ''); // Trim - from end of text
- }
-
- /*****************************************************************************
- * Markdown.Extra *
- ****************************************************************************/
-
- Markdown.Extra = function() {
- // For converting internal markdown (in tables for instance).
- // This is necessary since these methods are meant to be called as
- // preConversion hooks, and the Markdown converter passed to init()
- // won't convert any markdown contained in the html tags we return.
- this.converter = null;
-
- // Stores html blocks we generate in hooks so that
- // they're not destroyed if the user is using a sanitizing converter
- this.hashBlocks = [];
-
- // Stores footnotes
- this.footnotes = {};
- this.usedFootnotes = [];
-
- // Special attribute blocks for fenced code blocks and headers enabled.
- this.attributeBlocks = false;
-
- // Fenced code block options
- this.googleCodePrettify = false;
- this.highlightJs = false;
-
- // Table options
- this.tableClass = '';
-
- this.tabWidth = 4;
- };
-
- Markdown.Extra.init = function(converter, options) {
- // Each call to init creates a new instance of Markdown.Extra so it's
- // safe to have multiple converters, with different options, on a single page
- var extra = new Markdown.Extra();
- var postNormalizationTransformations = [];
- var preBlockGamutTransformations = [];
- var postConversionTransformations = ["unHashExtraBlocks"];
-
- options = options || {};
- options.extensions = options.extensions || ["all"];
- if (contains(options.extensions, "all")) {
- options.extensions = ["tables", "fenced_code_gfm", "def_list", "attr_list", "footnotes", "smartypants"];
- }
- preBlockGamutTransformations.push("wrapHeaders");
- if (contains(options.extensions, "attr_list")) {
- postNormalizationTransformations.push("hashFcbAttributeBlocks");
- preBlockGamutTransformations.push("hashHeaderAttributeBlocks");
- postConversionTransformations.push("applyAttributeBlocks");
- extra.attributeBlocks = true;
- }
- if (contains(options.extensions, "fenced_code_gfm")) {
- postNormalizationTransformations.push("fencedCodeBlocks");
- }
- if (contains(options.extensions, "tables")) {
- preBlockGamutTransformations.push("tables");
- }
- if (contains(options.extensions, "def_list")) {
- preBlockGamutTransformations.push("definitionLists");
- }
- if (contains(options.extensions, "footnotes")) {
- postNormalizationTransformations.push("stripFootnoteDefinitions");
- preBlockGamutTransformations.push("doFootnotes");
- postConversionTransformations.push("printFootnotes");
- }
- if (contains(options.extensions, "smartypants")) {
- postConversionTransformations.push("runSmartyPants");
- }
-
- converter.hooks.chain("postNormalization", function(text) {
- return extra.doTransform(postNormalizationTransformations, text) + '\n';
- });
-
- converter.hooks.chain("preBlockGamut", function(text, blockGamutHookCallback) {
- // Keep a reference to the block gamut callback to run recursively
- extra.blockGamutHookCallback = blockGamutHookCallback;
- text = processEscapes(text);
- return extra.doTransform(preBlockGamutTransformations, text) + '\n';
- });
-
- // Keep a reference to the hook chain running before doPostConversion to apply on hashed extra blocks
- extra.previousPostConversion = converter.hooks.postConversion;
- converter.hooks.chain("postConversion", function(text) {
- text = extra.doTransform(postConversionTransformations, text);
- // Clear state vars that may use unnecessary memory
- extra.hashBlocks = [];
- extra.footnotes = {};
- extra.usedFootnotes = [];
- return text;
- });
-
- if ("highlighter" in options) {
- extra.googleCodePrettify = options.highlighter === 'prettify';
- extra.highlightJs = options.highlighter === 'highlight';
- }
-
- if ("table_class" in options) {
- extra.tableClass = options.table_class;
- }
-
- extra.converter = converter;
-
- // Caller usually won't need this, but it's handy for testing.
- return extra;
- };
-
- // Do transformations
- Markdown.Extra.prototype.doTransform = function(transformations, text) {
- for(var i = 0; i < transformations.length; i++)
- text = this[transformations[i]](text);
- return text;
- };
-
- // Return a placeholder containing a key, which is the block's index in the
- // hashBlocks array. We wrap our output in a tag here so Pagedown won't.
- Markdown.Extra.prototype.hashExtraBlock = function(block) {
- return '\n
~X' + (this.hashBlocks.push(block) - 1) + 'X
\n';
- };
- Markdown.Extra.prototype.hashExtraInline = function(block) {
- return '~X' + (this.hashBlocks.push(block) - 1) + 'X';
- };
-
- // Replace placeholder blocks in `text` with their corresponding
- // html blocks in the hashBlocks array.
- Markdown.Extra.prototype.unHashExtraBlocks = function(text) {
- var self = this;
- function recursiveUnHash() {
- var hasHash = false;
- text = text.replace(/(?:)?~X(\d+)X(?:<\/p>)?/g, function(wholeMatch, m1) {
- hasHash = true;
- var key = parseInt(m1, 10);
- return self.hashBlocks[key];
- });
- if(hasHash === true) {
- recursiveUnHash();
- }
- }
- recursiveUnHash();
- return text;
- };
-
- // Wrap headers to make sure they won't be in def lists
- Markdown.Extra.prototype.wrapHeaders = function(text) {
- function wrap(text) {
- return '\n' + text + '\n';
- }
- text = text.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm, wrap);
- text = text.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm, wrap);
- text = text.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm, wrap);
- return text;
- };
-
-
- /******************************************************************
- * Attribute Blocks *
- *****************************************************************/
-
- // Extract headers attribute blocks, move them above the element they will be
- // applied to, and hash them for later.
- Markdown.Extra.prototype.hashHeaderAttributeBlocks = function(text) {
- // TODO: use sentinels. Should we just add/remove them in doConversion?
- // TODO: better matches for id / class attributes
- var attrBlock = "\\{\\s*[.|#][^}]+\\}";
- var hdrAttributesA = new RegExp("^(#{1,6}.*#{0,6})\\s+(" + attrBlock + ")[ \\t]*(\\n|0x03)", "gm");
- var hdrAttributesB = new RegExp("^(.*)\\s+(" + attrBlock + ")[ \\t]*\\n" +
- "(?=[\\-|=]+\\s*(\\n|0x03))", "gm"); // underline lookahead
-
- var self = this;
- function attributeCallback(wholeMatch, pre, attr) {
- return '
~XX' + (self.hashBlocks.push(attr) - 1) + 'XX
\n' + pre + "\n";
- }
-
- text = text.replace(hdrAttributesA, attributeCallback); // ## headers
- text = text.replace(hdrAttributesB, attributeCallback); // underline headers
- return text;
- };
-
- // Extract FCB attribute blocks, move them above the element they will be
- // applied to, and hash them for later.
- Markdown.Extra.prototype.hashFcbAttributeBlocks = function(text) {
- // TODO: use sentinels. Should we just add/remove them in doConversion?
- // TODO: better matches for id / class attributes
- var attrBlock = "\\{\\s*[.|#][^}]+\\}";
- var fcbAttributes = new RegExp("^(```[^{\\n]*)\\s+(" + attrBlock + ")[ \\t]*\\n" +
- "(?=([\\s\\S]*?)\\n```\\s*(\\n|0x03))", "gm");
-
- var self = this;
- function attributeCallback(wholeMatch, pre, attr) {
- return '~XX' + (self.hashBlocks.push(attr) - 1) + 'XX
\n' + pre + "\n";
- }
-
- return text.replace(fcbAttributes, attributeCallback);
- };
-
- Markdown.Extra.prototype.applyAttributeBlocks = function(text) {
- var self = this;
- var blockRe = new RegExp('~XX(\\d+)XX
[\\s]*' +
- '(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?\\2>))', "gm");
- text = text.replace(blockRe, function(wholeMatch, k, tag, cls, rest) {
- if (!tag) // no following header or fenced code block.
- return '';
-
- // get attributes list from hash
- var key = parseInt(k, 10);
- var attributes = self.hashBlocks[key];
-
- // get id
- var id = attributes.match(/#[^\s{}]+/g) || [];
- var idStr = id[0] ? ' id="' + id[0].substr(1, id[0].length - 1) + '"' : '';
-
- // get classes and merge with existing classes
- var classes = attributes.match(/\.[^\s{}]+/g) || [];
- for (var i = 0; i < classes.length; i++) // Remove leading dot
- classes[i] = classes[i].substr(1, classes[i].length - 1);
-
- var classStr = '';
- if (cls)
- classes = union(classes, [cls]);
-
- if (classes.length > 0)
- classStr = ' class="' + classes.join(' ') + '"';
-
- return "<" + tag + idStr + classStr + rest;
- });
-
- return text;
- };
-
- /******************************************************************
- * Tables *
- *****************************************************************/
-
- // Find and convert Markdown Extra tables into html.
- Markdown.Extra.prototype.tables = function(text) {
- var self = this;
-
- var leadingPipe = new RegExp(
- ['^' ,
- '[ ]{0,3}' , // Allowed whitespace
- '[|]' , // Initial pipe
- '(.+)\\n' , // $1: Header Row
-
- '[ ]{0,3}' , // Allowed whitespace
- '[|]([ ]*[-:]+[-| :]*)\\n' , // $2: Separator
-
- '(' , // $3: Table Body
- '(?:[ ]*[|].*\\n?)*' , // Table rows
- ')',
- '(?:\\n|$)' // Stop at final newline
- ].join(''),
- 'gm'
- );
-
- var noLeadingPipe = new RegExp(
- ['^' ,
- '[ ]{0,3}' , // Allowed whitespace
- '(\\S.*[|].*)\\n' , // $1: Header Row
-
- '[ ]{0,3}' , // Allowed whitespace
- '([-:]+[ ]*[|][-| :]*)\\n' , // $2: Separator
-
- '(' , // $3: Table Body
- '(?:.*[|].*\\n?)*' , // Table rows
- ')' ,
- '(?:\\n|$)' // Stop at final newline
- ].join(''),
- 'gm'
- );
-
- text = text.replace(leadingPipe, doTable);
- text = text.replace(noLeadingPipe, doTable);
-
- // $1 = header, $2 = separator, $3 = body
- function doTable(match, header, separator, body, offset, string) {
- // remove any leading pipes and whitespace
- header = header.replace(/^ *[|]/m, '');
- separator = separator.replace(/^ *[|]/m, '');
- body = body.replace(/^ *[|]/gm, '');
-
- // remove trailing pipes and whitespace
- header = header.replace(/[|] *$/m, '');
- separator = separator.replace(/[|] *$/m, '');
- body = body.replace(/[|] *$/gm, '');
-
- // determine column alignments
- alignspecs = separator.split(/ *[|] */);
- align = [];
- for (var i = 0; i < alignspecs.length; i++) {
- var spec = alignspecs[i];
- if (spec.match(/^ *-+: *$/m))
- align[i] = ' style="text-align:right;"';
- else if (spec.match(/^ *:-+: *$/m))
- align[i] = ' style="text-align:center;"';
- else if (spec.match(/^ *:-+ *$/m))
- align[i] = ' style="text-align:left;"';
- else align[i] = '';
- }
-
- // TODO: parse spans in header and rows before splitting, so that pipes
- // inside of tags are not interpreted as separators
- var headers = header.split(/ *[|] */);
- var colCount = headers.length;
-
- // build html
- var cls = self.tableClass ? ' class="' + self.tableClass + '"' : '';
- var html = ['\n', '\n', '\n'].join('');
-
- // build column headers.
- for (i = 0; i < colCount; i++) {
- var headerHtml = convertSpans(trim(headers[i]), self);
- html += [" ", headerHtml, " \n"].join('');
- }
- html += " \n\n";
-
- // build rows
- var rows = body.split('\n');
- for (i = 0; i < rows.length; i++) {
- if (rows[i].match(/^\s*$/)) // can apply to final row
- continue;
-
- // ensure number of rowCells matches colCount
- var rowCells = rows[i].split(/ *[|] */);
- var lenDiff = colCount - rowCells.length;
- for (var j = 0; j < lenDiff; j++)
- rowCells.push('');
-
- html += "\n";
- for (j = 0; j < colCount; j++) {
- var colHtml = convertSpans(trim(rowCells[j]), self);
- html += [" ", colHtml, " \n"].join('');
- }
- html += " \n";
- }
-
- html += "
\n";
-
- // replace html with placeholder until postConversion step
- return self.hashExtraBlock(html);
- }
-
- return text;
- };
-
-
- /******************************************************************
- * Footnotes *
- *****************************************************************/
-
- // Strip footnote, store in hashes.
- Markdown.Extra.prototype.stripFootnoteDefinitions = function(text) {
- var self = this;
-
- text = text.replace(
- /\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g,
- function(wholeMatch, m1, m2) {
- m1 = slugify(m1);
- m2 += "\n";
- m2 = m2.replace(/^[ ]{0,3}/g, "");
- self.footnotes[m1] = m2;
- return "\n";
- });
-
- return text;
- };
-
-
- // Find and convert footnotes references.
- Markdown.Extra.prototype.doFootnotes = function(text) {
- var self = this;
- if(self.isConvertingFootnote === true) {
- return text;
- }
-
- var footnoteCounter = 0;
- text = text.replace(/\[\^(.+?)\]/g, function(wholeMatch, m1) {
- var id = slugify(m1);
- var footnote = self.footnotes[id];
- if (footnote === undefined) {
- return wholeMatch;
- }
- footnoteCounter++;
- self.usedFootnotes.push(id);
- var html = '' + footnoteCounter
- + '';
- return self.hashExtraInline(html);
- });
-
- return text;
- };
-
- // Print footnotes at the end of the document
- Markdown.Extra.prototype.printFootnotes = function(text) {
- var self = this;
-
- if (self.usedFootnotes.length === 0) {
- return text;
- }
-
- text += '\n\n\n
\n\n\n';
- for(var i=0; i'
- + formattedfootnote
- + ' ↩\n\n';
- }
- text += '
\n';
- return text;
- };
-
-
- /******************************************************************
- * Fenced Code Blocks (gfm) *
- ******************************************************************/
-
- // Find and convert gfm-inspired fenced code blocks into html.
- Markdown.Extra.prototype.fencedCodeBlocks = function(text) {
- function encodeCode(code) {
- code = code.replace(/&/g, "&");
- code = code.replace(//g, ">");
- // These were escaped by PageDown before postNormalization
- code = code.replace(/~D/g, "$$");
- code = code.replace(/~T/g, "~");
- return code;
- }
-
- var self = this;
- text = text.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g, function(match, m1, m2) {
- var language = m1, codeblock = m2;
-
- // adhere to specified options
- var preclass = self.googleCodePrettify ? ' class="prettyprint"' : '';
- var codeclass = '';
- if (language) {
- if (self.googleCodePrettify || self.highlightJs) {
- // use html5 language- class names. supported by both prettify and highlight.js
- codeclass = ' class="language-' + language + '"';
- } else {
- codeclass = ' class="' + language + '"';
- }
- }
-
- var html = ['',
- encodeCode(codeblock), '
'].join('');
-
- // replace codeblock with placeholder until postConversion step
- return self.hashExtraBlock(html);
- });
-
- return text;
- };
-
-
- /******************************************************************
- * SmartyPants *
- ******************************************************************/
-
- var educatePants = function(wholeMatch,m1,m2,m3,m4,m5,m6) {
- var blockText = m5;
- var blockOffset = 0;
- var newBlockText = '';
- blockText.replace(/(<)([a-zA-Z1-6]*)([^\n>]?)(>)(.*?)(<\/\2>)/mg, function(wholeMatch,m1,m2,m3,m4,m5,m6,offset) {
- newBlockText += applyPants(blockText.substring(blockOffset, offset)) + educatePants(wholeMatch,m1,m2,m3,m4,m5,m6);
- blockOffset = offset + wholeMatch.length;
- });
- newBlockText += applyPants(blockText.substring(blockOffset));
- return m1 + m2 + m3 + m4 + newBlockText + m6;
- };
-
- function revertPants(wholeMatch, m1) {
- var blockText = m1;
- blockText = blockText.replace(/&\#8220;/g, "\"");
- blockText = blockText.replace(/&\#8221;/g, "\"");
- blockText = blockText.replace(/&\#8216;/g, "'");
- blockText = blockText.replace(/&\#8217;/g, "'");
- blockText = blockText.replace(/&\#8212;/g, "---");
- blockText = blockText.replace(/&\#8211;/g, "--");
- blockText = blockText.replace(/&\#8230;/g, "...");
- return blockText;
- }
-
- function applyPants(text) {
- text = text.replace(/``/g, "“").replace (/''/g, "”");
- text = text.replace(/---/g, "—").replace(/--/g, "–");
- text = text.replace(/\.\.\./g, "…").replace(/\.\s\.\s\./g, "…");
-
- text = text.replace (/^'(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/g, "‘");
- text = text.replace (/^"(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/g, "“");
- text = text.replace(/^"(?=\w)/g, "“");
- text = text.replace(/^'(?=\w)/g, "‘");
-
- text = text.replace(/"'(?=\w)/g, "“‘");
- text = text.replace(/'"(?=\w)/g, "‘“");
-
- // Special case for decade abbreviations (the '80s):
- text = text.replace(/'(?=\d{2}s)/g, "’");
- text = text.replace(/(>|\t|\n|\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)'(?=\w)/g, "$1‘");
- text = text.replace(/([^<>\\ \t\r\n\[\{\(\-])'(?=\s | s\b)/g, "$1’");
-
- // Any remaining single quotes should be opening ones:
- text = text.replace(/`/g, "‘").replace(/'/g, "’");
- text = text.replace(/(>|\t|\n|\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)"(?=\w)/g, "$1“");
- text = text.replace(/([^<>\\ \t\r\n\[\{\(\-])"(?=\s | s\b)/g, "$1”");
-
- text = text.replace(/"/ig, "”");
- return text;
- }
-
- // Find and convert markdown extra definition lists into html.
- Markdown.Extra.prototype.runSmartyPants = function(text) {
- text = text.replace(/(<)([a-zA-Z1-6]+)([^\n>]*?)(>)(.*?)(<\/\2>)/gm, educatePants);
- //clean everything inside html tags
- text = text.replace(/(<([a-zA-Z1-6]+)\b([^\n>]*?)(\/)?>)/g, revertPants);
- //clean out replacements inside special tags
- text = text.replace(/((<)(code|kbd|pre|script|noscript|iframe|math|ins|del|pre)(.?)(>)(.*?)(<\/)(code|kbd|pre|script|noscript|iframe|math|ins|del|pre)(>))/gm, revertPants);
- return text;
- };
-
- /******************************************************************
- * Definition Lists *
- ******************************************************************/
-
- // Find and convert markdown extra definition lists into html.
- Markdown.Extra.prototype.definitionLists = function(text) {
- var wholeList = new RegExp(
- ['(\\x02\\n?|\\n\\n)' ,
- '(?:' ,
- '(' , // $1 = whole list
- '(' , // $2
- '[ ]{0,3}' ,
- '((?:[ \\t]*\\S.*\\n)+)', // $3 = defined term
- '\\n?' ,
- '[ ]{0,3}:[ ]+' , // colon starting definition
- ')' ,
- '([\\s\\S]+?)' ,
- '(' , // $4
- '(?=\\0x03)' , // \z
- '|' ,
- '(?=' ,
- '\\n{2,}' ,
- '(?=\\S)' ,
- '(?!' , // Negative lookahead for another term
- '[ ]{0,3}' ,
- '(?:\\S.*\\n)+?' , // defined term
- '\\n?' ,
- '[ ]{0,3}:[ ]+' , // colon starting definition
- ')' ,
- '(?!' , // Negative lookahead for another definition
- '[ ]{0,3}:[ ]+' , // colon starting definition
- ')' ,
- ')' ,
- ')' ,
- ')' ,
- ')'
- ].join(''),
- 'gm'
- );
-
- var self = this;
- text = addAnchors(text);
-
- text = text.replace(wholeList, function(match, pre, list) {
- var result = trim(self.processDefListItems(list));
- result = "\n" + result + "\n
";
- return pre + self.hashExtraBlock(result) + "\n\n";
- });
-
- return removeAnchors(text);
- };
-
- // Process the contents of a single definition list, splitting it
- // into individual term and definition list items.
- Markdown.Extra.prototype.processDefListItems = function(listStr) {
- var self = this;
-
- var dt = new RegExp(
- ['(\\x02\\n?|\\n\\n+)' , // leading line
- '(' , // definition terms = $1
- '[ ]{0,3}' , // leading whitespace
- '(?![:][ ]|[ ])' , // negative lookahead for a definition
- // mark (colon) or more whitespace
- '(?:\\S.*\\n)+?' , // actual term (not whitespace)
- ')' ,
- '(?=\\n?[ ]{0,3}:[ ])' // lookahead for following line feed
- ].join(''), // with a definition mark
- 'gm'
- );
-
- var dd = new RegExp(
- ['\\n(\\n+)?' , // leading line = $1
- '(' , // marker space = $2
- '[ ]{0,3}' , // whitespace before colon
- '[:][ ]+' , // definition mark (colon)
- ')' ,
- '([\\s\\S]+?)' , // definition text = $3
- '(?=\\n*' , // stop at next definition mark,
- '(?:' , // next term or end of text
- '\\n[ ]{0,3}[:][ ]|' ,
- '|\\x03' , // \z
- ')' ,
- ')'
- ].join(''),
- 'gm'
- );
-
- listStr = addAnchors(listStr);
- // trim trailing blank lines:
- listStr = listStr.replace(/\n{2,}(?=\\x03)/, "\n");
-
- // Process definition terms.
- listStr = listStr.replace(dt, function(match, pre, termsStr) {
- var terms = trim(termsStr).split("\n");
- var text = '';
- for (var i = 0; i < terms.length; i++) {
- var term = terms[i];
- // process spans inside dt
- term = convertSpans(trim(term), self);
- text += "\n" + term + " ";
- }
- return text + "\n";
- });
-
- // Process actual definitions.
- listStr = listStr.replace(dd, function(match, leadingLine, markerSpace, def) {
- if (leadingLine || def.match(/\n{2,}/)) {
- // replace marker with the appropriate whitespace indentation
- def = Array(markerSpace.length + 1).join(' ') + def;
- // process markdown inside definition
- // TODO?: currently doesn't apply extensions
- def = outdent(def) + "\n\n";
- def = "\n" + convertAll(def, self) + "\n";
- } else {
- // convert span-level markdown inside definition
- def = rtrim(def);
- def = convertSpans(outdent(def), self);
- }
-
- return "\n " + def + " \n";
- });
-
- return removeAnchors(listStr);
- };
-
-})();
-
diff --git a/docs/js/bootstrap.min.js b/docs/js/bootstrap.min.js
deleted file mode 100644
index e9efd24c10..0000000000
--- a/docs/js/bootstrap.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
-* Bootstrap.js by @fat & @mdo
-* plugins: bootstrap-transition.js, bootstrap-modal.js, bootstrap-dropdown.js, bootstrap-scrollspy.js, bootstrap-tab.js, bootstrap-tooltip.js, bootstrap-popover.js, bootstrap-affix.js, bootstrap-alert.js, bootstrap-button.js, bootstrap-collapse.js, bootstrap-carousel.js, bootstrap-typeahead.js
-* Copyright 2012 Twitter, Inc.
-* http://www.apache.org/licenses/LICENSE-2.0.txt
-*/
-!function(a){a(function(){a.support.transition=function(){var a=function(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},c;for(c in b)if(a.style[c]!==undefined)return b[c]}();return a&&{end:a}}()})}(window.jQuery),!function(a){var b=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this,c=a.Event("show");this.$element.trigger(c);if(this.isShown||c.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var c=a.support.transition&&b.$element.hasClass("fade");b.$element.parent().length||b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in").attr("aria-hidden",!1),b.enforceFocus(),c?b.$element.one(a.support.transition.end,function(){b.$element.focus().trigger("shown")}):b.$element.focus().trigger("shown")})},hide:function(b){b&&b.preventDefault();var c=this;b=a.Event("hide"),this.$element.trigger(b);if(!this.isShown||b.isDefaultPrevented())return;this.isShown=!1,this.escape(),a(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),a.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var b=this;a(document).on("focusin.modal",function(a){b.$element[0]!==a.target&&!b.$element.has(a.target).length&&b.$element.focus()})},escape:function(){var a=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(b){b.which==27&&a.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),b.hideModal()},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),b.hideModal()})},hideModal:function(a){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?a.proxy(this.$element[0].focus,this.$element[0]):a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,a.proxy(this.removeBackdrop,this)):this.removeBackdrop()):b&&b()}},a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=a.extend({},a.fn.modal.defaults,d.data(),typeof c=="object"&&c);e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():f.show&&e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=b,a(document).on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f).one("hide",function(){c.focus()})})}(window.jQuery),!function(a){function d(){a(b).each(function(){e(a(this)).removeClass("open")})}function e(b){var c=b.attr("data-target"),d;return c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,"")),d=a(c),d.length||(d=b.parent()),d}var b="[data-toggle=dropdown]",c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),f,g;if(c.is(".disabled, :disabled"))return;return f=e(c),g=f.hasClass("open"),d(),g||(f.toggleClass("open"),c.focus()),!1},keydown:function(b){var c,d,f,g,h,i;if(!/(38|40|27)/.test(b.keyCode))return;c=a(this),b.preventDefault(),b.stopPropagation();if(c.is(".disabled, :disabled"))return;g=e(c),h=g.hasClass("open");if(!h||h&&b.keyCode==27)return c.click();d=a("[role=menu] li:not(.divider) a",g);if(!d.length)return;i=d.index(d.filter(":focus")),b.keyCode==38&&i>0&&i--,b.keyCode==40&&i a",this.$body=a("body"),this.refresh(),this.process()}b.prototype={constructor:b,refresh:function(){var b=this,c;this.offsets=a([]),this.targets=a([]),c=this.$body.find(this.selector).map(function(){var b=a(this),c=b.data("target")||b.attr("href"),d=/^#\w/.test(c)&&a(c);return d&&d.length&&[[d.position().top,c]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,c=b-this.$scrollElement.height(),d=this.offsets,e=this.targets,f=this.activeTarget,g;if(a>=c)return f!=(g=e.last()[0])&&this.activate(g);for(g=d.length;g--;)f!=e[g]&&a>=d[g]&&(!d[g+1]||a<=d[g+1])&&this.activate(e[g])},activate:function(b){var c,d;this.activeTarget=b,a(this.selector).parent(".active").removeClass("active"),d=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',c=a(d).parent("li").addClass("active"),c.parent(".dropdown-menu").length&&(c=c.closest("li.dropdown").addClass("active")),c.trigger("activate")}},a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f,g;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active:last a")[0],g=a.Event("show",{relatedTarget:e}),b.trigger(g);if(g.isDefaultPrevented())return;f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}},a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),!function(a){var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,this.options.trigger=="click"?this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this)):this.options.trigger!="manual"&&(e=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(e+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f+"."+this.type,this.options.selector,a.proxy(this.leave,this))),this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,b,this.$element.data()),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);if(!c.options.delay||!c.options.delay.show)return c.show();clearTimeout(this.timeout),c.hoverState="in",this.timeout=setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show)},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!c.options.delay||!c.options.delay.hide)return c.hide();c.hoverState="out",this.timeout=setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide)},show:function(){var a,b,c,d,e,f,g;if(this.hasContent()&&this.enabled){a=this.tip(),this.setContent(),this.options.animation&&a.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,b=/in/.test(f),a.detach().css({top:0,left:0,display:"block"}).insertAfter(this.$element),c=this.getPosition(b),d=a[0].offsetWidth,e=a[0].offsetHeight;switch(b?f.split(" ")[1]:f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}a.offset(g).addClass(f).addClass("in")}},setContent:function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},hide:function(){function d(){var b=setTimeout(function(){c.off(a.support.transition.end).detach()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.detach()})}var b=this,c=this.tip();return c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d():c.detach(),this},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(b){return a.extend({},b?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);c[c.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}},a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover",title:"",delay:0,html:!1}}(window.jQuery),!function(a){var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content > *")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-content")||(typeof c.content=="function"?c.content.call(b[0]):c.content),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}}),a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:''})}(window.jQuery),!function(a){var b=function(b,c){this.options=a.extend({},a.fn.affix.defaults,c),this.$window=a(window).on("scroll.affix.data-api",a.proxy(this.checkPosition,this)).on("click.affix.data-api",a.proxy(function(){setTimeout(a.proxy(this.checkPosition,this),1)},this)),this.$element=a(b),this.checkPosition()};b.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var b=a(document).height(),c=this.$window.scrollTop(),d=this.$element.offset(),e=this.options.offset,f=e.bottom,g=e.top,h="affix affix-top affix-bottom",i;typeof e!="object"&&(f=g=e),typeof g=="function"&&(g=e.top()),typeof f=="function"&&(f=e.bottom()),i=this.unpin!=null&&c+this.unpin<=d.top?!1:f!=null&&d.top+this.$element.height()>=b-f?"bottom":g!=null&&c<=g?"top":!1;if(this.affixed===i)return;this.affixed=i,this.unpin=i=="bottom"?d.top-c:null,this.$element.removeClass(h).addClass("affix"+(i?"-"+i:""))},a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("affix"),f=typeof c=="object"&&c;e||d.data("affix",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.defaults={offset:0},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery),!function(a){var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function f(){e.trigger("closed").remove()}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger(b=a.Event("close"));if(b.isDefaultPrevented())return;e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(document).on("click.alert.data-api",b,c.prototype.close)}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(document).on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b,c,d,e;if(this.transitioning)return;b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find("> .accordion-group > .in");if(d&&d.length){e=d.data("collapse");if(e&&e.transitioning)return;d.collapse("hide"),e||d.data("collapse",null)}this.$element[b](0),this.transition("addClass",a.Event("show"),"shown"),a.support.transition&&this.$element[b](this.$element[0][c])},hide:function(){var b;if(this.transitioning)return;b=this.dimension(),this.reset(this.$element[b]()),this.transition("removeClass",a.Event("hide"),"hidden"),this.$element[b](0)},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[a!==null?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){c.type=="show"&&e.reset(),e.transitioning=0,e.$element.trigger(d)};this.$element.trigger(c);if(c.isDefaultPrevented())return;this.transitioning=1,this.$element[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(document).on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();c[a(e).hasClass("in")?"addClass":"removeClass"]("collapsed"),a(e).collapse(f)})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=c,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(b){return b||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},to:function(b){var c=this.$element.find(".item.active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this,j;this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h](),j=a.Event("slide",{relatedTarget:e[0]});if(e.hasClass("active"))return;if(a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(j);if(j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})}else{this.$element.trigger(j);if(j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=a.extend({},a.fn.carousel.defaults,typeof c=="object"&&c),g=typeof c=="string"?c:f.slide;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):g?e[g]():f.interval&&e.cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=b,a(document).on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=a(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(a)).change(),this.hide()},updater:function(a){return a},show:function(){var b=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:b.top+b.height,left:b.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c;return this.query=this.$element.val(),!this.query||this.query.length"+b+" "})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",a.proxy(this.keydown,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},eventSupported:function(a){var b=a in this.$element;return b||(this.$element.setAttribute(a,"return;"),b=typeof this.$element[a]=="function"),b},move:function(a){if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}a.stopPropagation()},keydown:function(b){this.suppressKeyPressRepeat=!~a.inArray(b.keyCode,[40,38,9,13,27]),this.move(b)},keypress:function(a){if(this.suppressKeyPressRepeat)return;this.move(a)},keyup:function(a){switch(a.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}a.stopPropagation(),a.preventDefault()},blur:function(a){var b=this;setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()},mouseenter:function(b){this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")}},a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'',item:'| t |