diff --git a/bin/mermaid.js b/bin/mermaid.js index d2d7b079f..b2925ea2f 100755 --- a/bin/mermaid.js +++ b/bin/mermaid.js @@ -1,12 +1,12 @@ #!/usr/bin/env node -var fs = require('fs') - , chalk = require('chalk') - , error = chalk.bold.red - , cli = require('../lib/cli.js') - , lib = require('../lib'); +var fs = require('fs'), + chalk = require('chalk'), + error = chalk.bold.red, + cli = require('../lib/cli.js'), + lib = require('../lib') -cli.parse(process.argv.slice(2), function(err, message, options) { +cli.parse(process.argv.slice(2), function (err, message, options) { if (err) { console.error( error('\nYou had errors in your syntax. Use --help for further information.') @@ -16,12 +16,11 @@ cli.parse(process.argv.slice(2), function(err, message, options) { }) return - } - else if (message) { + } else if (message) { console.log(message) return } lib.process(options.files, options, process.exit) -}); +}) diff --git a/dist/www/javascripts/all.js b/dist/www/javascripts/all.js index ba3a4f910..96b2fe9b4 100644 --- a/dist/www/javascripts/all.js +++ b/dist/www/javascripts/all.js @@ -1,4 +1,4 @@ -!function(){if("ontouchstart"in window){var t,e,n,r,i,o,a={};t=function(t,e){return Math.abs(t[0]-e[0])>5||Math.abs(t[1]-e[1])>5},e=function(t){this.startXY=[t.touches[0].clientX,t.touches[0].clientY],this.threshold=!1},n=function(e){return this.threshold?!1:void(this.threshold=t(this.startXY,[e.touches[0].clientX,e.touches[0].clientY]))},r=function(e){if(!this.threshold&&!t(this.startXY,[e.changedTouches[0].clientX,e.changedTouches[0].clientY])){var n=e.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),r.simulated=!0,e.target.dispatchEvent(r)}},i=function(t){var e=Date.now(),n=e-a.time,r=t.clientX,i=t.clientY,s=[Math.abs(a.x-r),Math.abs(a.y-i)],u=o(t.target,"A")||t.target,c=u.nodeName,l="A"===c,h=window.navigator.standalone&&l&&t.target.getAttribute("href");return a.time=e,a.x=r,a.y=i,(!t.simulated&&(500>n||1500>n&&s[0]<50&&s[1]<50)||h)&&(t.preventDefault(),t.stopPropagation(),!h)?!1:(h&&(window.location=u.getAttribute("href")),void(u&&u.classList&&(u.classList.add("energize-focus"),window.setTimeout(function(){u.classList.remove("energize-focus")},150))))},o=function(t,e){for(var n=t;n!==document.body;){if(!n||n.nodeName===e)return n;n=n.parentNode}return null},document.addEventListener("touchstart",e,!1),document.addEventListener("touchmove",n,!1),document.addEventListener("touchend",r,!1),document.addEventListener("click",i,!0)}}(),/* +!(function () { if ('ontouchstart' in window) { var t, e, n, r, i, o, a = {}; t = function (t, e) { return Math.abs(t[0] - e[0]) > 5 || Math.abs(t[1] - e[1]) > 5 }, e = function (t) { this.startXY = [t.touches[0].clientX, t.touches[0].clientY], this.threshold = !1 }, n = function (e) { return this.threshold ? !1 : void (this.threshold = t(this.startXY, [e.touches[0].clientX, e.touches[0].clientY])) }, r = function (e) { if (!this.threshold && !t(this.startXY, [e.changedTouches[0].clientX, e.changedTouches[0].clientY])) { var n = e.changedTouches[0], r = document.createEvent('MouseEvents'); r.initMouseEvent('click', !0, !0, window, 0, n.screenX, n.screenY, n.clientX, n.clientY, !1, !1, !1, !1, 0, null), r.simulated = !0, e.target.dispatchEvent(r) } }, i = function (t) { var e = Date.now(), n = e - a.time, r = t.clientX, i = t.clientY, s = [Math.abs(a.x - r), Math.abs(a.y - i)], u = o(t.target, 'A') || t.target, c = u.nodeName, l = c === 'A', h = window.navigator.standalone && l && t.target.getAttribute('href'); return a.time = e, a.x = r, a.y = i, (!t.simulated && (n < 500 || n < 1500 && s[0] < 50 && s[1] < 50) || h) && (t.preventDefault(), t.stopPropagation(), !h) ? !1 : (h && (window.location = u.getAttribute('href')), void (u && u.classList && (u.classList.add('energize-focus'), window.setTimeout(function () { u.classList.remove('energize-focus') }, 150)))) }, o = function (t, e) { for (var n = t; n !== document.body;) { if (!n || n.nodeName === e) return n; n = n.parentNode } return null }, document.addEventListener('touchstart', e, !1), document.addEventListener('touchmove', n, !1), document.addEventListener('touchend', r, !1), document.addEventListener('click', i, !0) } }()), /* Copyright 2008-2013 Concur Technologies, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -13,63 +13,65 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -function(t){"use strict";function e(e){if(e&&""!==e){$(".lang-selector a").removeClass("active"),$(".lang-selector a[data-language-name='"+e+"']").addClass("active");for(var n=0;n=1){var t=n(location.search).language;if(t)return t;if(-1!=jQuery.inArray(location.search.substr(1),u))return location.search.substr(1)}return!1}function o(t){var e=n(location.search);return e.language?(e.language=t,r(e)):t}function a(t){if(history){var e=window.location.hash;e&&(e=e.replace(/^#+/,"")),history.pushState({},"","?"+o(t)+"#"+e),localStorage.setItem("language",t)}}function s(t){var n=localStorage.getItem("language");u=t;var r=i();r?(e(r),localStorage.setItem("language",r)):e(null!==n&&-1!=jQuery.inArray(n,u)?n:u[0])}var u=[];t.setupLanguages=s,t.activateLanguage=e,$(function(){$(".lang-selector a").on("click",function(){var t=$(this).data("language-name");return a(t),e(t),!1}),window.onpopstate=function(){e(i())}})}(window),/** +(function (t) { 'use strict'; function e (e) { if (e && e !== '') { $('.lang-selector a').removeClass('active'), $(".lang-selector a[data-language-name='" + e + "']").addClass('active'); for (var n = 0; n < u.length; n++)$('.highlight.' + u[n]).hide(); $('.highlight.' + e).show(), t.toc.calculateHeights(), $(window.location.hash).get(0) && $(window.location.hash).get(0).scrollIntoView(!0) } } function n (t) { return typeof t !== 'string' ? {} : (t = t.trim().replace(/^(\?|#|&)/, ''), t ? t.split('&').reduce(function (t, e) { var n = e.replace(/\+/g, ' ').split('='), r = n[0], i = n[1]; return r = decodeURIComponent(r), i = void 0 === i ? null : decodeURIComponent(i), t.hasOwnProperty(r) ? Array.isArray(t[r]) ? t[r].push(i) : t[r] = [t[r], i] : t[r] = i, t }, {}) : {}) } function r (t) { return t ? Object.keys(t).sort().map(function (e) { var n = t[e]; return Array.isArray(n) ? n.sort().map(function (t) { return encodeURIComponent(e) + '=' + encodeURIComponent(t) }).join('&') : encodeURIComponent(e) + '=' + encodeURIComponent(n) }).join('&') : '' } function i () { if (location.search.length >= 1) { var t = n(location.search).language; if (t) return t; if (jQuery.inArray(location.search.substr(1), u) != -1) return location.search.substr(1) } return !1 } function o (t) { var e = n(location.search); return e.language ? (e.language = t, r(e)) : t } function a (t) { if (history) { var e = window.location.hash; e && (e = e.replace(/^#+/, '')), history.pushState({}, '', '?' + o(t) + '#' + e), localStorage.setItem('language', t) } } function s (t) { var n = localStorage.getItem('language'); u = t; var r = i(); r ? (e(r), localStorage.setItem('language', r)) : e(n !== null && jQuery.inArray(n, u) != -1 ? n : u[0]) } var u = []; t.setupLanguages = s, t.activateLanguage = e, $(function () { $('.lang-selector a').on('click', function () { var t = $(this).data('language-name'); return a(t), e(t), !1 }), window.onpopstate = function () { e(i()) } }) }(window)), /** * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.7 * Copyright (C) 2014 Oliver Nightingale * MIT Licensed * @license */ -function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.5.7",/*! +(function () { + var t = function (e) { var n = new t.Index(); return n.pipeline.add(t.trimmer, t.stopWordFilter, t.stemmer), e && e.call(n, n), n }; t.version = '0.5.7', /*! * lunr.utils * Copyright (C) 2014 Oliver Nightingale */ -t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),/*! +t.utils = {}, t.utils.warn = (function (t) { return function (e) { t.console && console.warn && console.warn(e) } }(this)), /*! * lunr.EventEmitter * Copyright (C) 2014 Oliver Nightingale */ -t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},/*! +t.EventEmitter = function () { this.events = {} }, t.EventEmitter.prototype.addListener = function () { var t = Array.prototype.slice.call(arguments), e = t.pop(), n = t; if (typeof e !== 'function') throw new TypeError('last argument must be a function'); n.forEach(function (t) { this.hasHandler(t) || (this.events[t] = []), this.events[t].push(e) }, this) }, t.EventEmitter.prototype.removeListener = function (t, e) { if (this.hasHandler(t)) { var n = this.events[t].indexOf(e); this.events[t].splice(n, 1), this.events[t].length || delete this.events[t] } }, t.EventEmitter.prototype.emit = function (t) { if (this.hasHandler(t)) { var e = Array.prototype.slice.call(arguments, 1); this.events[t].forEach(function (t) { t.apply(void 0, e) }) } }, t.EventEmitter.prototype.hasHandler = function (t) { return t in this.events }, /*! * lunr.tokenizer * Copyright (C) 2014 Oliver Nightingale */ -t.tokenizer=function(t){if(!arguments.length||null==t||void 0==t)return[];if(Array.isArray(t))return t.map(function(t){return t.toLowerCase()});for(var e=t.toString().replace(/^\s+/,""),n=e.length-1;n>=0;n--)if(/\S/.test(e.charAt(n))){e=e.substring(0,n+1);break}return e.split(/(?:\s+|\-)/).filter(function(t){return!!t}).map(function(t){return t.toLowerCase()})},/*! +t.tokenizer = function (t) { if (!arguments.length || t == null || void 0 == t) return []; if (Array.isArray(t)) return t.map(function (t) { return t.toLowerCase() }); for (var e = t.toString().replace(/^\s+/, ''), n = e.length - 1; n >= 0; n--) if (/\S/.test(e.charAt(n))) { e = e.substring(0, n + 1); break } return e.split(/(?:\s+|\-)/).filter(function (t) { return !!t }).map(function (t) { return t.toLowerCase() }) }, /*! * lunr.Pipeline * Copyright (C) 2014 Oliver Nightingale */ -t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var r=t.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load un-registered function: "+e);n.add(r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e)+1;this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,r=this._stack.length,i=0;n>i;i++){for(var o=t[i],a=0;r>a&&(o=this._stack[a](o,i,t),void 0!==o);a++);void 0!==o&&e.push(o)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},/*! +t.Pipeline = function () { this._stack = [] }, t.Pipeline.registeredFunctions = {}, t.Pipeline.registerFunction = function (e, n) { n in this.registeredFunctions && t.utils.warn('Overwriting existing registered function: ' + n), e.label = n, t.Pipeline.registeredFunctions[e.label] = e }, t.Pipeline.warnIfFunctionNotRegistered = function (e) { var n = e.label && e.label in this.registeredFunctions; n || t.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', e) }, t.Pipeline.load = function (e) { var n = new t.Pipeline(); return e.forEach(function (e) { var r = t.Pipeline.registeredFunctions[e]; if (!r) throw new Error('Cannot load un-registered function: ' + e); n.add(r) }), n }, t.Pipeline.prototype.add = function () { var e = Array.prototype.slice.call(arguments); e.forEach(function (e) { t.Pipeline.warnIfFunctionNotRegistered(e), this._stack.push(e) }, this) }, t.Pipeline.prototype.after = function (e, n) { t.Pipeline.warnIfFunctionNotRegistered(n); var r = this._stack.indexOf(e) + 1; this._stack.splice(r, 0, n) }, t.Pipeline.prototype.before = function (e, n) { t.Pipeline.warnIfFunctionNotRegistered(n); var r = this._stack.indexOf(e); this._stack.splice(r, 0, n) }, t.Pipeline.prototype.remove = function (t) { var e = this._stack.indexOf(t); this._stack.splice(e, 1) }, t.Pipeline.prototype.run = function (t) { for (var e = [], n = t.length, r = this._stack.length, i = 0; n > i; i++) { for (var o = t[i], a = 0; r > a && (o = this._stack[a](o, i, t), void 0 !== o); a++);void 0 !== o && e.push(o) } return e }, t.Pipeline.prototype.reset = function () { this._stack = [] }, t.Pipeline.prototype.toJSON = function () { return this._stack.map(function (e) { return t.Pipeline.warnIfFunctionNotRegistered(e), e.label }) }, /*! * lunr.Vector * Copyright (C) 2014 Oliver Nightingale */ -t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){var r=this.list;if(!r)return this.list=new t.Vector.Node(e,n,r),this.length++;for(var i=r,o=r.next;void 0!=o;){if(en.idx?n=n.next:(r+=e.val*n.val,e=e.next,n=n.next);return r},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},/*! +t.Vector = function () { this._magnitude = null, this.list = void 0, this.length = 0 }, t.Vector.Node = function (t, e, n) { this.idx = t, this.val = e, this.next = n }, t.Vector.prototype.insert = function (e, n) { var r = this.list; if (!r) return this.list = new t.Vector.Node(e, n, r), this.length++; for (var i = r, o = r.next; void 0 != o;) { if (e < o.idx) return i.next = new t.Vector.Node(e, n, o), this.length++; i = o, o = o.next } return i.next = new t.Vector.Node(e, n, o), this.length++ }, t.Vector.prototype.magnitude = function () { if (this._magniture) return this._magnitude; for (var t, e = this.list, n = 0; e;)t = e.val, n += t * t, e = e.next; return this._magnitude = Math.sqrt(n) }, t.Vector.prototype.dot = function (t) { for (var e = this.list, n = t.list, r = 0; e && n;)e.idx < n.idx ? e = e.next : e.idx > n.idx ? n = n.next : (r += e.val * n.val, e = e.next, n = n.next); return r }, t.Vector.prototype.similarity = function (t) { return this.dot(t) / (this.magnitude() * t.magnitude()) }, /*! * lunr.SortedSet * Copyright (C) 2014 Oliver Nightingale */ -t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(t){~this.indexOf(t)||this.elements.splice(this.locationFor(t),0,t)},this),this.length=this.elements.length},t.SortedSet.prototype.toArray=function(){return this.elements.slice()},t.SortedSet.prototype.map=function(t,e){return this.elements.map(t,e)},t.SortedSet.prototype.forEach=function(t,e){return this.elements.forEach(t,e)},t.SortedSet.prototype.indexOf=function(t,e,n){var e=e||0,n=n||this.elements.length,r=n-e,i=e+Math.floor(r/2),o=this.elements[i];return 1>=r?o===t?i:-1:t>o?this.indexOf(t,i,n):o>t?this.indexOf(t,e,i):o===t?i:void 0},t.SortedSet.prototype.locationFor=function(t,e,n){var e=e||0,n=n||this.elements.length,r=n-e,i=e+Math.floor(r/2),o=this.elements[i];if(1>=r){if(o>t)return i;if(t>o)return i+1}return t>o?this.locationFor(t,i,n):o>t?this.locationFor(t,e,i):void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,r=0,i=0,o=this.length,a=e.length,s=this.elements,u=e.elements;;){if(r>o-1||i>a-1)break;s[r]!==u[i]?s[r]u[i]&&i++:(n.add(s[r]),r++,i++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,r;return this.length>=t.length?(e=this,n=t):(e=t,n=this),r=e.clone(),r.add.apply(r,n.toArray()),r},t.SortedSet.prototype.toJSON=function(){return this.toArray()},/*! +t.SortedSet = function () { this.length = 0, this.elements = [] }, t.SortedSet.load = function (t) { var e = new this(); return e.elements = t, e.length = t.length, e }, t.SortedSet.prototype.add = function () { Array.prototype.slice.call(arguments).forEach(function (t) { ~this.indexOf(t) || this.elements.splice(this.locationFor(t), 0, t) }, this), this.length = this.elements.length }, t.SortedSet.prototype.toArray = function () { return this.elements.slice() }, t.SortedSet.prototype.map = function (t, e) { return this.elements.map(t, e) }, t.SortedSet.prototype.forEach = function (t, e) { return this.elements.forEach(t, e) }, t.SortedSet.prototype.indexOf = function (t, e, n) { var e = e || 0, n = n || this.elements.length, r = n - e, i = e + Math.floor(r / 2), o = this.elements[i]; return r <= 1 ? o === t ? i : -1 : t > o ? this.indexOf(t, i, n) : o > t ? this.indexOf(t, e, i) : o === t ? i : void 0 }, t.SortedSet.prototype.locationFor = function (t, e, n) { var e = e || 0, n = n || this.elements.length, r = n - e, i = e + Math.floor(r / 2), o = this.elements[i]; if (r <= 1) { if (o > t) return i; if (t > o) return i + 1 } return t > o ? this.locationFor(t, i, n) : o > t ? this.locationFor(t, e, i) : void 0 }, t.SortedSet.prototype.intersect = function (e) { for (var n = new t.SortedSet(), r = 0, i = 0, o = this.length, a = e.length, s = this.elements, u = e.elements; ;) { if (r > o - 1 || i > a - 1) break; s[r] !== u[i] ? s[r] < u[i] ? r++ : s[r] > u[i] && i++ : (n.add(s[r]), r++, i++) } return n }, t.SortedSet.prototype.clone = function () { var e = new t.SortedSet(); return e.elements = this.toArray(), e.length = e.elements.length, e }, t.SortedSet.prototype.union = function (t) { var e, n, r; return this.length >= t.length ? (e = this, n = t) : (e = t, n = this), r = e.clone(), r.add.apply(r, n.toArray()), r }, t.SortedSet.prototype.toJSON = function () { return this.toArray() }, /*! * lunr.Index * Copyright (C) 2014 Oliver Nightingale */ -t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.add=function(e,n){var r={},i=new t.SortedSet,o=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n.name]));r[n.name]=o,t.SortedSet.prototype.add.apply(i,o)},this),this.documentStore.set(o,i),t.SortedSet.prototype.add.apply(this.corpusTokens,i.toArray());for(var a=0;a0&&(r=1+Math.log(this.tokenStore.length/n)),this._idfCache[e]=r},t.Index.prototype.search=function(e){var n=this.pipeline.run(t.tokenizer(e)),r=new t.Vector,i=[],o=this._fields.reduce(function(t,e){return t+e.boost},0),a=n.some(function(t){return this.tokenStore.has(t)},this);if(!a)return[];n.forEach(function(e,n,a){var s=1/a.length*this._fields.length*o,u=this,c=this.tokenStore.expand(e).reduce(function(n,i){var o=u.corpusTokens.indexOf(i),a=u.idf(i),c=1,l=new t.SortedSet;if(i!==e){var h=Math.max(3,i.length-e.length);c=1/Math.log(h)}return o>-1&&r.insert(o,s*a*c),Object.keys(u.tokenStore.get(i)).forEach(function(t){l.add(t)}),n.union(l)},new t.SortedSet);i.push(c)},this);var s=i.reduce(function(t,e){return t.intersect(e)});return s.map(function(t){return{ref:t,score:r.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),r=n.length,i=new t.Vector,o=0;r>o;o++){var a=n.elements[o],s=this.tokenStore.get(a)[e].tf,u=this.idf(a);i.insert(this.corpusTokens.indexOf(a),s*u)}return i},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},/*! +t.Index = function () { this._fields = [], this._ref = 'id', this.pipeline = new t.Pipeline(), this.documentStore = new t.Store(), this.tokenStore = new t.TokenStore(), this.corpusTokens = new t.SortedSet(), this.eventEmitter = new t.EventEmitter(), this._idfCache = {}, this.on('add', 'remove', 'update', function () { this._idfCache = {} }.bind(this)) }, t.Index.prototype.on = function () { var t = Array.prototype.slice.call(arguments); return this.eventEmitter.addListener.apply(this.eventEmitter, t) }, t.Index.prototype.off = function (t, e) { return this.eventEmitter.removeListener(t, e) }, t.Index.load = function (e) { e.version !== t.version && t.utils.warn('version mismatch: current ' + t.version + ' importing ' + e.version); var n = new this(); return n._fields = e.fields, n._ref = e.ref, n.documentStore = t.Store.load(e.documentStore), n.tokenStore = t.TokenStore.load(e.tokenStore), n.corpusTokens = t.SortedSet.load(e.corpusTokens), n.pipeline = t.Pipeline.load(e.pipeline), n }, t.Index.prototype.field = function (t, e) { var e = e || {}, n = {name: t, boost: e.boost || 1}; return this._fields.push(n), this }, t.Index.prototype.ref = function (t) { return this._ref = t, this }, t.Index.prototype.add = function (e, n) { var r = {}, i = new t.SortedSet(), o = e[this._ref], n = void 0 === n ? !0 : n; this._fields.forEach(function (n) { var o = this.pipeline.run(t.tokenizer(e[n.name])); r[n.name] = o, t.SortedSet.prototype.add.apply(i, o) }, this), this.documentStore.set(o, i), t.SortedSet.prototype.add.apply(this.corpusTokens, i.toArray()); for (var a = 0; a < i.length; a++) { var s = i.elements[a], u = this._fields.reduce(function (t, e) { var n = r[e.name].length; if (!n) return t; var i = r[e.name].filter(function (t) { return t === s }).length; return t + i / n * e.boost }, 0); this.tokenStore.add(s, {ref: o, tf: u}) }n && this.eventEmitter.emit('add', e, this) }, t.Index.prototype.remove = function (t, e) { var n = t[this._ref], e = void 0 === e ? !0 : e; if (this.documentStore.has(n)) { var r = this.documentStore.get(n); this.documentStore.remove(n), r.forEach(function (t) { this.tokenStore.remove(t, n) }, this), e && this.eventEmitter.emit('remove', t, this) } }, t.Index.prototype.update = function (t, e) { var e = void 0 === e ? !0 : e; this.remove(t, !1), this.add(t, !1), e && this.eventEmitter.emit('update', t, this) }, t.Index.prototype.idf = function (t) { var e = '@' + t; if (Object.prototype.hasOwnProperty.call(this._idfCache, e)) return this._idfCache[e]; var n = this.tokenStore.count(t), r = 1; return n > 0 && (r = 1 + Math.log(this.tokenStore.length / n)), this._idfCache[e] = r }, t.Index.prototype.search = function (e) { var n = this.pipeline.run(t.tokenizer(e)), r = new t.Vector(), i = [], o = this._fields.reduce(function (t, e) { return t + e.boost }, 0), a = n.some(function (t) { return this.tokenStore.has(t) }, this); if (!a) return []; n.forEach(function (e, n, a) { var s = 1 / a.length * this._fields.length * o, u = this, c = this.tokenStore.expand(e).reduce(function (n, i) { var o = u.corpusTokens.indexOf(i), a = u.idf(i), c = 1, l = new t.SortedSet(); if (i !== e) { var h = Math.max(3, i.length - e.length); c = 1 / Math.log(h) } return o > -1 && r.insert(o, s * a * c), Object.keys(u.tokenStore.get(i)).forEach(function (t) { l.add(t) }), n.union(l) }, new t.SortedSet()); i.push(c) }, this); var s = i.reduce(function (t, e) { return t.intersect(e) }); return s.map(function (t) { return {ref: t, score: r.similarity(this.documentVector(t))} }, this).sort(function (t, e) { return e.score - t.score }) }, t.Index.prototype.documentVector = function (e) { for (var n = this.documentStore.get(e), r = n.length, i = new t.Vector(), o = 0; r > o; o++) { var a = n.elements[o], s = this.tokenStore.get(a)[e].tf, u = this.idf(a); i.insert(this.corpusTokens.indexOf(a), s * u) } return i }, t.Index.prototype.toJSON = function () { return {version: t.version, fields: this._fields, ref: this._ref, documentStore: this.documentStore.toJSON(), tokenStore: this.tokenStore.toJSON(), corpusTokens: this.corpusTokens.toJSON(), pipeline: this.pipeline.toJSON()} }, t.Index.prototype.use = function (t) { var e = Array.prototype.slice.call(arguments, 1); e.unshift(this), t.apply(this, e) }, /*! * lunr.Store * Copyright (C) 2014 Oliver Nightingale */ -t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,r){return n[r]=t.SortedSet.load(e.store[r]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},/*! +t.Store = function () { this.store = {}, this.length = 0 }, t.Store.load = function (e) { var n = new this(); return n.length = e.length, n.store = Object.keys(e.store).reduce(function (n, r) { return n[r] = t.SortedSet.load(e.store[r]), n }, {}), n }, t.Store.prototype.set = function (t, e) { this.has(t) || this.length++, this.store[t] = e }, t.Store.prototype.get = function (t) { return this.store[t] }, t.Store.prototype.has = function (t) { return t in this.store }, t.Store.prototype.remove = function (t) { this.has(t) && (delete this.store[t], this.length--) }, t.Store.prototype.toJSON = function () { return {store: this.store, length: this.length} }, /*! * lunr.stemmer * Copyright (C) 2014 Oliver Nightingale * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt */ -t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",r="[aeiouy]",i=n+"[^aeiouy]*",o=r+"[aeiou]*",a="^("+i+")?"+o+i,s="^("+i+")?"+o+i+"("+o+")?$",u="^("+i+")?"+o+i+o+i,c="^("+i+")?"+r,l=new RegExp(a),h=new RegExp(u),f=new RegExp(s),d=new RegExp(c),p=/^(.+?)(ss|i)es$/,g=/^(.+?)([^s])s$/,m=/^(.+?)eed$/,y=/^(.+?)(ed|ing)$/,v=/.$/,b=/(at|bl|iz)$/,_=new RegExp("([^aeiouylsz])\\1$"),x=new RegExp("^"+i+r+"[^aeiouwxy]$"),w=/^(.+?[^aeiou])y$/,E=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,A=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,k=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,D=/^(.+?)(s|t)(ion)$/,S=/^(.+?)e$/,C=/ll$/,M=new RegExp("^"+i+r+"[^aeiouwxy]$"),T=function(n){var r,i,o,a,s,u,c;if(n.length<3)return n;if(o=n.substr(0,1),"y"==o&&(n=o.toUpperCase()+n.substr(1)),a=p,s=g,a.test(n)?n=n.replace(a,"$1$2"):s.test(n)&&(n=n.replace(s,"$1$2")),a=m,s=y,a.test(n)){var T=a.exec(n);a=l,a.test(T[1])&&(a=v,n=n.replace(a,""))}else if(s.test(n)){var T=s.exec(n);r=T[1],s=d,s.test(r)&&(n=r,s=b,u=_,c=x,s.test(n)?n+="e":u.test(n)?(a=v,n=n.replace(a,"")):c.test(n)&&(n+="e"))}if(a=w,a.test(n)){var T=a.exec(n);r=T[1],n=r+"i"}if(a=E,a.test(n)){var T=a.exec(n);r=T[1],i=T[2],a=l,a.test(r)&&(n=r+t[i])}if(a=A,a.test(n)){var T=a.exec(n);r=T[1],i=T[2],a=l,a.test(r)&&(n=r+e[i])}if(a=k,s=D,a.test(n)){var T=a.exec(n);r=T[1],a=h,a.test(r)&&(n=r)}else if(s.test(n)){var T=s.exec(n);r=T[1]+T[2],s=h,s.test(r)&&(n=r)}if(a=S,a.test(n)){var T=a.exec(n);r=T[1],a=h,s=f,u=M,(a.test(r)||s.test(r)&&!u.test(r))&&(n=r)}return a=C,s=h,a.test(n)&&s.test(n)&&(a=v,n=n.replace(a,"")),"y"==o&&(n=o.toLowerCase()+n.substr(1)),n};return T}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),/*! +t.stemmer = (function () { var t = {ational: 'ate', tional: 'tion', enci: 'ence', anci: 'ance', izer: 'ize', bli: 'ble', alli: 'al', entli: 'ent', eli: 'e', ousli: 'ous', ization: 'ize', ation: 'ate', ator: 'ate', alism: 'al', iveness: 'ive', fulness: 'ful', ousness: 'ous', aliti: 'al', iviti: 'ive', biliti: 'ble', logi: 'log'}, e = {icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: ''}, n = '[^aeiou]', r = '[aeiouy]', i = n + '[^aeiouy]*', o = r + '[aeiou]*', a = '^(' + i + ')?' + o + i, s = '^(' + i + ')?' + o + i + '(' + o + ')?$', u = '^(' + i + ')?' + o + i + o + i, c = '^(' + i + ')?' + r, l = new RegExp(a), h = new RegExp(u), f = new RegExp(s), d = new RegExp(c), p = /^(.+?)(ss|i)es$/, g = /^(.+?)([^s])s$/, m = /^(.+?)eed$/, y = /^(.+?)(ed|ing)$/, v = /.$/, b = /(at|bl|iz)$/, _ = new RegExp('([^aeiouylsz])\\1$'), x = new RegExp('^' + i + r + '[^aeiouwxy]$'), w = /^(.+?[^aeiou])y$/, E = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/, A = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/, k = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/, D = /^(.+?)(s|t)(ion)$/, S = /^(.+?)e$/, C = /ll$/, M = new RegExp('^' + i + r + '[^aeiouwxy]$'), T = function (n) { var r, i, o, a, s, u, c; if (n.length < 3) return n; if (o = n.substr(0, 1), o == 'y' && (n = o.toUpperCase() + n.substr(1)), a = p, s = g, a.test(n) ? n = n.replace(a, '$1$2') : s.test(n) && (n = n.replace(s, '$1$2')), a = m, s = y, a.test(n)) { var T = a.exec(n); a = l, a.test(T[1]) && (a = v, n = n.replace(a, '')) } else if (s.test(n)) { var T = s.exec(n); r = T[1], s = d, s.test(r) && (n = r, s = b, u = _, c = x, s.test(n) ? n += 'e' : u.test(n) ? (a = v, n = n.replace(a, '')) : c.test(n) && (n += 'e')) } if (a = w, a.test(n)) { var T = a.exec(n); r = T[1], n = r + 'i' } if (a = E, a.test(n)) { var T = a.exec(n); r = T[1], i = T[2], a = l, a.test(r) && (n = r + t[i]) } if (a = A, a.test(n)) { var T = a.exec(n); r = T[1], i = T[2], a = l, a.test(r) && (n = r + e[i]) } if (a = k, s = D, a.test(n)) { var T = a.exec(n); r = T[1], a = h, a.test(r) && (n = r) } else if (s.test(n)) { var T = s.exec(n); r = T[1] + T[2], s = h, s.test(r) && (n = r) } if (a = S, a.test(n)) { var T = a.exec(n); r = T[1], a = h, s = f, u = M, (a.test(r) || s.test(r) && !u.test(r)) && (n = r) } return a = C, s = h, a.test(n) && s.test(n) && (a = v, n = n.replace(a, '')), o == 'y' && (n = o.toLowerCase() + n.substr(1)), n }; return T }()), t.Pipeline.registerFunction(t.stemmer, 'stemmer'), /*! * lunr.stopWordFilter * Copyright (C) 2014 Oliver Nightingale */ -t.stopWordFilter=function(e){return-1===t.stopWordFilter.stopWords.indexOf(e)?e:void 0},t.stopWordFilter.stopWords=new t.SortedSet,t.stopWordFilter.stopWords.length=119,t.stopWordFilter.stopWords.elements=["","a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"],t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),/*! +t.stopWordFilter = function (e) { return t.stopWordFilter.stopWords.indexOf(e) === -1 ? e : void 0 }, t.stopWordFilter.stopWords = new t.SortedSet(), t.stopWordFilter.stopWords.length = 119, t.stopWordFilter.stopWords.elements = ['', 'a', 'able', 'about', 'across', 'after', 'all', 'almost', 'also', 'am', 'among', 'an', 'and', 'any', 'are', 'as', 'at', 'be', 'because', 'been', 'but', 'by', 'can', 'cannot', 'could', 'dear', 'did', 'do', 'does', 'either', 'else', 'ever', 'every', 'for', 'from', 'get', 'got', 'had', 'has', 'have', 'he', 'her', 'hers', 'him', 'his', 'how', 'however', 'i', 'if', 'in', 'into', 'is', 'it', 'its', 'just', 'least', 'let', 'like', 'likely', 'may', 'me', 'might', 'most', 'must', 'my', 'neither', 'no', 'nor', 'not', 'of', 'off', 'often', 'on', 'only', 'or', 'other', 'our', 'own', 'rather', 'said', 'say', 'says', 'she', 'should', 'since', 'so', 'some', 'than', 'that', 'the', 'their', 'them', 'then', 'there', 'these', 'they', 'this', 'tis', 'to', 'too', 'twas', 'us', 'wants', 'was', 'we', 'were', 'what', 'when', 'where', 'which', 'while', 'who', 'whom', 'why', 'will', 'with', 'would', 'yet', 'you', 'your'], t.Pipeline.registerFunction(t.stopWordFilter, 'stopWordFilter'), /*! * lunr.trimmer * Copyright (C) 2014 Oliver Nightingale */ -t.trimmer=function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"")},t.Pipeline.registerFunction(t.trimmer,"trimmer"),/*! +t.trimmer = function (t) { return t.replace(/^\W+/, '').replace(/\W+$/, '') }, t.Pipeline.registerFunction(t.trimmer, 'trimmer'), /*! * lunr.stemmer * Copyright (C) 2014 Oliver Nightingale * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt */ -t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,r=t[0],i=t.slice(1);return r in n||(n[r]={docs:{}}),0===i.length?(n[r].docs[e.ref]=e,void(this.length+=1)):this.add(i,e,n[r])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;n1e-4});e.length?(a.empty(),$.each(e,function(t,e){var n=document.getElementById(e.ref);a.append("
  • "+$(n).text()+"
  • ")}),r.call(this)):(a.html("
  • "),$(".search-results li").text('No Results Found for "'+this.value+'"'))}else i(),a.removeClass("visible")}function r(){this.value&&o.highlight(this.value,s)}function i(){o.unhighlight(s)}var o,a,s={element:"span",className:"search-highlight"},u=new lunr.Index;u.ref("id"),u.field("title",{boost:10}),u.field("body"),u.pipeline.add(lunr.trimmer,lunr.stopWordFilter),$(t),$(e)}(),/*! jQuery UI - v1.11.3 - 2015-02-12 +jQuery.extend({highlight: function (t, e, n, r) { if (t.nodeType === 3) { var i = t.data.match(e); if (i) { var o = document.createElement(n || 'span'); o.className = r || 'highlight'; var a = t.splitText(i.index); a.splitText(i[0].length); var s = a.cloneNode(!0); return o.appendChild(s), a.parentNode.replaceChild(o, a), 1 } } else if (t.nodeType === 1 && t.childNodes && !/(script|style)/i.test(t.tagName) && (t.tagName !== n.toUpperCase() || t.className !== r)) for (var u = 0; u < t.childNodes.length; u++)u += jQuery.highlight(t.childNodes[u], e, n, r); return 0 }}), jQuery.fn.unhighlight = function (t) { var e = {className: 'highlight', element: 'span'}; return jQuery.extend(e, t), this.find(e.element + '.' + e.className).each(function () { var t = this.parentNode; t.replaceChild(this.firstChild, this), t.normalize() }).end() }, jQuery.fn.highlight = function (t, e) { var n = {className: 'highlight', element: 'span', caseSensitive: !1, wordsOnly: !1}; if (jQuery.extend(n, e), t.constructor === String && (t = [t]), t = jQuery.grep(t, function (t) { return t != '' }), t = jQuery.map(t, function (t) { return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') }), t.length == 0) return this; var r = n.caseSensitive ? '' : 'i', i = '(' + t.join('|') + ')'; n.wordsOnly && (i = '\\b' + i + '\\b'); var o = new RegExp(i, r); return this.each(function () { jQuery.highlight(this, o, n.element, n.className) }) }, (function () { 'use strict'; function t () { $('h1, h2').each(function () { var t = $(this), e = t.nextUntil('h1, h2'); u.add({id: t.prop('id'), title: t.text(), body: e.text()}) }) } function e () { o = $('.content'), a = $('.search-results'), $('#input-search').on('keyup', n) } function n (t) { if (i(), a.addClass('visible'), t.keyCode === 27 && (this.value = ''), this.value) { var e = u.search(this.value).filter(function (t) { return t.score > 1e-4 }); e.length ? (a.empty(), $.each(e, function (t, e) { var n = document.getElementById(e.ref); a.append("
  • " + $(n).text() + '
  • ') }), r.call(this)) : (a.html('
  • '), $('.search-results li').text('No Results Found for "' + this.value + '"')) } else i(), a.removeClass('visible') } function r () { this.value && o.highlight(this.value, s) } function i () { o.unhighlight(s) } var o, a, s = {element: 'span', className: 'search-highlight'}, u = new lunr.Index(); u.ref('id'), u.field('title', {boost: 10}), u.field('body'), u.pipeline.add(lunr.trimmer, lunr.stopWordFilter), $(t), $(e) }()), /*! jQuery UI - v1.11.3 - 2015-02-12 * http://jqueryui.com * Includes: widget.js * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ -function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){/*! +(function (t) { typeof define === 'function' && define.amd ? define(['jquery'], t) : t(jQuery) }(function (t) { /*! * jQuery UI Widget 1.11.3 * http://jqueryui.com * @@ -127,7 +129,8 @@ function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery) * * http://api.jqueryui.com/jQuery.widget/ */ -var e=0,n=Array.prototype.slice;t.cleanData=function(e){return function(n){var r,i,o;for(o=0;null!=(i=n[o]);o++)try{r=t._data(i,"events"),r&&r.remove&&t(i).triggerHandler("remove")}catch(a){}e(n)}}(t.cleanData),t.widget=function(e,n,r){var i,o,a,s,u={},c=e.split(".")[0];return e=e.split(".")[1],i=c+"-"+e,r||(r=n,n=t.Widget),t.expr[":"][i.toLowerCase()]=function(e){return!!t.data(e,i)},t[c]=t[c]||{},o=t[c][e],a=t[c][e]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new a(t,e)},t.extend(a,o,{version:r.version,_proto:t.extend({},r),_childConstructors:[]}),s=new n,s.options=t.widget.extend({},s.options),t.each(r,function(e,r){return t.isFunction(r)?void(u[e]=function(){var t=function(){return n.prototype[e].apply(this,arguments)},i=function(t){return n.prototype[e].apply(this,t)};return function(){var e,n=this._super,o=this._superApply;return this._super=t,this._superApply=i,e=r.apply(this,arguments),this._super=n,this._superApply=o,e}}()):void(u[e]=r)}),a.prototype=t.widget.extend(s,{widgetEventPrefix:o?s.widgetEventPrefix||e:e},u,{constructor:a,namespace:c,widgetName:e,widgetFullName:i}),o?(t.each(o._childConstructors,function(e,n){var r=n.prototype;t.widget(r.namespace+"."+r.widgetName,a,n._proto)}),delete o._childConstructors):n._childConstructors.push(a),t.widget.bridge(e,a),a},t.widget.extend=function(e){for(var r,i,o=n.call(arguments,1),a=0,s=o.length;s>a;a++)for(r in o[a])i=o[a][r],o[a].hasOwnProperty(r)&&void 0!==i&&(e[r]=t.isPlainObject(i)?t.isPlainObject(e[r])?t.widget.extend({},e[r],i):t.widget.extend({},i):i);return e},t.widget.bridge=function(e,r){var i=r.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,s=n.call(arguments,1),u=this;return a?this.each(function(){var n,r=t.data(this,i);return"instance"===o?(u=r,!1):r?t.isFunction(r[o])&&"_"!==o.charAt(0)?(n=r[o].apply(r,s),n!==r&&void 0!==n?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+o+"'")}):(s.length&&(o=t.widget.extend.apply(null,[o].concat(s))),this.each(function(){var e=t.data(this,i);e?(e.option(o||{}),e._init&&e._init()):t.data(this,i,new r(o,this))})),u}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
    ",options:{disabled:!1,create:null},_createWidget:function(n,r){r=t(r||this.defaultElement||this)[0],this.element=t(r),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),r!==this&&(t.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===r&&this.destroy()}}),this.document=t(r.style?r.ownerDocument:r.document||r),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),n),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var r,i,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},r=e.split("."),e=r.shift(),r.length){for(i=a[e]=t.widget.extend({},this.options[e]),o=0;o a; a++) for (r in o[a])i = o[a][r], o[a].hasOwnProperty(r) && void 0 !== i && (e[r] = t.isPlainObject(i) ? t.isPlainObject(e[r]) ? t.widget.extend({}, e[r], i) : t.widget.extend({}, i) : i); return e }, t.widget.bridge = function (e, r) { var i = r.prototype.widgetFullName || e; t.fn[e] = function (o) { var a = typeof o === 'string', s = n.call(arguments, 1), u = this; return a ? this.each(function () { var n, r = t.data(this, i); return o === 'instance' ? (u = r, !1) : r ? t.isFunction(r[o]) && o.charAt(0) !== '_' ? (n = r[o].apply(r, s), n !== r && void 0 !== n ? (u = n && n.jquery ? u.pushStack(n.get()) : n, !1) : void 0) : t.error("no such method '" + o + "' for " + e + ' widget instance') : t.error('cannot call methods on ' + e + " prior to initialization; attempted to call method '" + o + "'") }) : (s.length && (o = t.widget.extend.apply(null, [o].concat(s))), this.each(function () { var e = t.data(this, i); e ? (e.option(o || {}), e._init && e._init()) : t.data(this, i, new r(o, this)) })), u } }, t.Widget = function () {}, t.Widget._childConstructors = [], t.Widget.prototype = {widgetName: 'widget', widgetEventPrefix: '', defaultElement: '
    ', options: {disabled: !1, create: null}, _createWidget: function (n, r) { r = t(r || this.defaultElement || this)[0], this.element = t(r), this.uuid = e++, this.eventNamespace = '.' + this.widgetName + this.uuid, this.bindings = t(), this.hoverable = t(), this.focusable = t(), r !== this && (t.data(r, this.widgetFullName, this), this._on(!0, this.element, {remove: function (t) { t.target === r && this.destroy() }}), this.document = t(r.style ? r.ownerDocument : r.document || r), this.window = t(this.document[0].defaultView || this.document[0].parentWindow)), this.options = t.widget.extend({}, this.options, this._getCreateOptions(), n), this._create(), this._trigger('create', null, this._getCreateEventData()), this._init() }, _getCreateOptions: t.noop, _getCreateEventData: t.noop, _create: t.noop, _init: t.noop, destroy: function () { this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr('aria-disabled').removeClass(this.widgetFullName + '-disabled ui-state-disabled'), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass('ui-state-hover'), this.focusable.removeClass('ui-state-focus') }, _destroy: t.noop, widget: function () { return this.element }, option: function (e, n) { var r, i, o, a = e; if (arguments.length === 0) return t.widget.extend({}, this.options); if (typeof e === 'string') if (a = {}, r = e.split('.'), e = r.shift(), r.length) { for (i = a[e] = t.widget.extend({}, this.options[e]), o = 0; o < r.length - 1; o++)i[r[o]] = i[r[o]] || {}, i = i[r[o]]; if (e = r.pop(), arguments.length === 1) return void 0 === i[e] ? null : i[e]; i[e] = n } else { if (arguments.length === 1) return void 0 === this.options[e] ? null : this.options[e]; a[e] = n } return this._setOptions(a), this }, _setOptions: function (t) { var e; for (e in t) this._setOption(e, t[e]); return this }, _setOption: function (t, e) { return this.options[t] = e, t === 'disabled' && (this.widget().toggleClass(this.widgetFullName + '-disabled', !!e), e && (this.hoverable.removeClass('ui-state-hover'), this.focusable.removeClass('ui-state-focus'))), this }, enable: function () { return this._setOptions({disabled: !1}) }, disable: function () { return this._setOptions({disabled: !0}) }, _on: function (e, n, r) { var i, o = this; typeof e !== 'boolean' && (r = n, n = e, e = !1), r ? (n = i = t(n), this.bindings = this.bindings.add(n)) : (r = n, n = this.element, i = this.widget()), t.each(r, function (r, a) { function s () { return e || o.options.disabled !== !0 && !t(this).hasClass('ui-state-disabled') ? (typeof a === 'string' ? o[a] : a).apply(o, arguments) : void 0 } typeof a !== 'string' && (s.guid = a.guid = a.guid || s.guid || t.guid++); var u = r.match(/^([\w:-]*)\s*(.*)$/), c = u[1] + o.eventNamespace, l = u[2]; l ? i.delegate(l, c, s) : n.bind(c, s) }) }, _off: function (e, n) { n = (n || '').split(' ').join(this.eventNamespace + ' ') + this.eventNamespace, e.unbind(n).undelegate(n), this.bindings = t(this.bindings.not(e).get()), this.focusable = t(this.focusable.not(e).get()), this.hoverable = t(this.hoverable.not(e).get()) }, _delay: function (t, e) { function n () { return (typeof t === 'string' ? r[t] : t).apply(r, arguments) } var r = this; return setTimeout(n, e || 0) }, _hoverable: function (e) { this.hoverable = this.hoverable.add(e), this._on(e, {mouseenter: function (e) { t(e.currentTarget).addClass('ui-state-hover') }, mouseleave: function (e) { t(e.currentTarget).removeClass('ui-state-hover') }}) }, _focusable: function (e) { this.focusable = this.focusable.add(e), this._on(e, {focusin: function (e) { t(e.currentTarget).addClass('ui-state-focus') }, focusout: function (e) { t(e.currentTarget).removeClass('ui-state-focus') }}) }, _trigger: function (e, n, r) { var i, o, a = this.options[e]; if (r = r || {}, n = t.Event(n), n.type = (e === this.widgetEventPrefix ? e : this.widgetEventPrefix + e).toLowerCase(), n.target = this.element[0], o = n.originalEvent) for (i in o)i in n || (n[i] = o[i]); return this.element.trigger(n, r), !(t.isFunction(a) && a.apply(this.element[0], [n].concat(r)) === !1 || n.isDefaultPrevented()) }}, t.each({show: 'fadeIn', hide: 'fadeOut'}, function (e, n) { t.Widget.prototype['_' + e] = function (r, i, o) { typeof i === 'string' && (i = {effect: i}); var a, s = i ? i === !0 || typeof i === 'number' ? n : i.effect || n : e; i = i || {}, typeof i === 'number' && (i = {duration: i}), a = !t.isEmptyObject(i), i.complete = o, i.delay && r.delay(i.delay), a && t.effects && t.effects.effect[s] ? r[e](i) : s !== e && r[s] ? r[s](i.duration, i.easing, o) : r.queue(function (n) { t(this)[e](), o && o.call(r[0]), n() }) } }); t.widget +})), /* jquery Tocify - v1.8.0 - 2013-09-16 * http://www.gregfranko.com/jquery.tocify.js/ * Copyright (c) 2013 Greg Franko; Licensed MIT * Modified lightly by Robert Lord to fix a bug I found, @@ -135,9 +138,9 @@ var e=0,n=Array.prototype.slice;t.cleanData=function(e){return function(n){var r * also because I want height caching, since the * height lookup for h1s and h2s was causing serious * lag spikes below 30 fps */ -function(t){"use strict";t(window.jQuery,window,document)}(function(t,e,n,r){"use strict";var i="tocify",o="tocify-focus",a="tocify-hover",s="tocify-hide",u="tocify-header",c="."+u,l="tocify-subheader",h="."+l,f="tocify-item",d="."+f,p="tocify-extend-page",g="."+p;t.widget("toc.tocify",{version:"1.8.0",options:{context:"body",ignoreSelector:null,selectors:"h1, h2, h3",showAndHide:!0,showEffect:"slideDown",showEffectSpeed:"medium",hideEffect:"slideUp",hideEffectSpeed:"medium",smoothScroll:!0,smoothScrollSpeed:"medium",scrollTo:0,showAndHideOnScroll:!0,highlightOnScroll:!0,highlightOffset:40,theme:"bootstrap",extendPage:!0,extendPageOffset:100,history:!0,scrollHistory:!1,hashGenerator:"compact",highlightDefault:!0},_create:function(){var n=this;n.tocifyWrapper=t(".tocify-wrapper"),n.extendPageScroll=!0,n.items=[],n._generateToc(),n.cachedHeights=[],n.cachedAnchors=[],n._addCSSClasses(),n.webkit=function(){for(var t in e)if(t&&-1!==t.toLowerCase().indexOf("webkit"))return!0;return!1}(),n._setEventHandlers(),t(e).load(function(){n._setActiveElement(!0),t("html, body").promise().done(function(){setTimeout(function(){n.extendPageScroll=!1},0)})})},_generateToc:function(){var e,n,r=this,o=r.options.ignoreSelector;return e=t(this.options.context).find(-1!==this.options.selectors.indexOf(",")?this.options.selectors.replace(/ /g,"").substr(0,this.options.selectors.indexOf(",")):this.options.selectors.replace(/ /g,"")),e.length?(r.element.addClass(i),void e.each(function(e){t(this).is(o)||(n=t("