New documentation
First commit, halfway through a major restructuring of documentation.
This commit is contained in:
1 parent
f2ff0ce58b
commit
c2fb254a04
456 files changed
+44176
-253
No files matched your search
@@ -0,0 +1,54 @@
|
||||
$('#mysidebar').height($(".nav").height());
|
||||
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
//this script says, if the height of the viewport is greater than 800px, then insert affix class, which makes the nav bar float in a fixed
|
||||
// position as your scroll. if you have a lot of nav items, this height may not work for you.
|
||||
var h = $(window).height();
|
||||
//console.log (h);
|
||||
if (h > 800) {
|
||||
$( "#mysidebar" ).attr("class", "nav affix");
|
||||
}
|
||||
// activate tooltips. although this is a bootstrap js function, it must be activated this way in your theme.
|
||||
$('[data-toggle="tooltip"]').tooltip({
|
||||
placement : 'top'
|
||||
});
|
||||
|
||||
/**
|
||||
* AnchorJS
|
||||
*/
|
||||
anchors.add('h2,h3,h4,h5');
|
||||
|
||||
});
|
||||
|
||||
// needed for nav tabs on pages. See Formatting > Nav tabs for more details.
|
||||
// script from http://stackoverflow.com/questions/10523433/how-do-i-keep-the-current-tab-active-with-twitter-bootstrap-after-a-page-reload
|
||||
$(function() {
|
||||
var json, tabsState;
|
||||
$('a[data-toggle="pill"], a[data-toggle="tab"]').on('shown.bs.tab', function(e) {
|
||||
var href, json, parentId, tabsState;
|
||||
|
||||
tabsState = localStorage.getItem("tabs-state");
|
||||
json = JSON.parse(tabsState || "{}");
|
||||
parentId = $(e.target).parents("ul.nav.nav-pills, ul.nav.nav-tabs").attr("id");
|
||||
href = $(e.target).attr('href');
|
||||
json[parentId] = href;
|
||||
|
||||
return localStorage.setItem("tabs-state", JSON.stringify(json));
|
||||
});
|
||||
|
||||
tabsState = localStorage.getItem("tabs-state");
|
||||
json = JSON.parse(tabsState || "{}");
|
||||
|
||||
$.each(json, function(containerId, href) {
|
||||
return $("#" + containerId + " a[href=" + href + "]").tab('show');
|
||||
});
|
||||
|
||||
$("ul.nav.nav-pills, ul.nav.nav-tabs").each(function() {
|
||||
var $this = $(this);
|
||||
if (!json[$this.attr("id")]) {
|
||||
return $this.find("a[data-toggle=tab]:first, a[data-toggle=pill]:first").tab("show");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module){module.exports=function(){function receivedResponse(xhr){return 200==xhr.status&&4==xhr.readyState}function handleResponse(xhr,callback){xhr.onreadystatechange=function(){if(receivedResponse(xhr))try{callback(null,JSON.parse(xhr.responseText))}catch(err){callback(err,null)}}}var self=this;self.load=function(location,callback){var xhr=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");xhr.open("GET",location,!0),handleResponse(xhr,callback),xhr.send()}}},{}],2:[function(require,module){function FuzzySearchStrategy(){function createFuzzyRegExpFromString(string){return new RegExp(string.split("").join(".*?"),"gi")}var self=this;self.matches=function(string,crit){return"string"!=typeof string?!1:(string=string.trim(),!!string.match(createFuzzyRegExpFromString(crit)))}}module.exports=new FuzzySearchStrategy},{}],3:[function(require,module){function LiteralSearchStrategy(){function doMatch(string,crit){return string.toLowerCase().indexOf(crit.toLowerCase())>=0}var self=this;self.matches=function(string,crit){return"string"!=typeof string?!1:(string=string.trim(),doMatch(string,crit))}}module.exports=new LiteralSearchStrategy},{}],4:[function(require,module){module.exports=function(){function findMatches(store,crit,strategy){for(var data=store.get(),i=0;i<data.length&&matches.length<limit;i++)findMatchesInObject(data[i],crit,strategy);return matches}function findMatchesInObject(obj,crit,strategy){for(var key in obj)if(strategy.matches(obj[key],crit)){matches.push(obj);break}}function getSearchStrategy(){return fuzzy?fuzzySearchStrategy:literalSearchStrategy}var self=this,matches=[],fuzzy=!1,limit=10,fuzzySearchStrategy=require("./SearchStrategies/fuzzy"),literalSearchStrategy=require("./SearchStrategies/literal");self.setFuzzy=function(_fuzzy){fuzzy=!!_fuzzy},self.setLimit=function(_limit){limit=parseInt(_limit,10)||limit},self.search=function(data,crit){return crit?(matches.length=0,findMatches(data,crit,getSearchStrategy())):[]}}},{"./SearchStrategies/fuzzy":2,"./SearchStrategies/literal":3}],5:[function(require,module){module.exports=function(_store){function isObject(obj){return!!obj&&"[object Object]"==Object.prototype.toString.call(obj)}function isArray(obj){return!!obj&&"[object Array]"==Object.prototype.toString.call(obj)}function addObject(data){return store.push(data),data}function addArray(data){for(var added=[],i=0;i<data.length;i++)isObject(data[i])&&added.push(addObject(data[i]));return added}var self=this,store=[];isArray(_store)&&addArray(_store),self.clear=function(){return store.length=0,store},self.get=function(){return store},self.put=function(data){return isObject(data)?addObject(data):isArray(data)?addArray(data):void 0}}},{}],6:[function(require,module){module.exports=function(){var self=this,templatePattern=/\{(.*?)\}/g;self.setTemplatePattern=function(newTemplatePattern){templatePattern=newTemplatePattern},self.render=function(t,data){return t.replace(templatePattern,function(match,prop){return data[prop]||match})}}},{}],7:[function(require){!function(window){"use strict";function SimpleJekyllSearch(){function initWithJSON(){store.put(opt.dataSource),registerInput()}function initWithURL(url){jsonLoader.load(url,function(err,json){err?throwError("failed to get JSON ("+url+")"):(store.put(json),registerInput())})}function throwError(message){throw new Error("SimpleJekyllSearch --- "+message)}function validateOptions(_opt){for(var i=0;i<requiredOptions.length;i++){var req=requiredOptions[i];_opt[req]||throwError("You must specify a "+req)}}function assignOptions(_opt){for(var option in opt)opt[option]=_opt[option]||opt[option]}function isJSON(json){try{return json instanceof Object&&JSON.parse(JSON.stringify(json))}catch(e){return!1}}function emptyResultsContainer(){opt.resultsContainer.innerHTML=""}function appendToResultsContainer(text){opt.resultsContainer.innerHTML+=text}function registerInput(){opt.searchInput.addEventListener("keyup",function(e){return 0==e.target.value.length?void emptyResultsContainer():void render(searcher.search(store,e.target.value))})}function render(results){if(emptyResultsContainer(),0==results.length)return appendToResultsContainer(opt.noResultsText);for(var i=0;i<results.length;i++)appendToResultsContainer(templater.render(opt.searchResultTemplate,results[i]))}var self=this,requiredOptions=["searchInput","resultsContainer","dataSource"],opt={searchInput:null,resultsContainer:null,dataSource:[],searchResultTemplate:'<li><a href="{url}" title="{desc}">{title}</a></li>',noResultsText:"No results found",limit:Line truncated
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* jQuery throttle / debounce - v1.1 - 3/7/2010
|
||||
* http://benalman.com/projects/jquery-throttle-debounce-plugin/
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*/
|
||||
(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date()-d,n=arguments;function l(){d=+new Date();j.apply(o,n)}function k(){h=c}if(i&&!h){l()}h&&clearTimeout(h);if(i===c&&m>e){l()}else{if(f!==true){h=setTimeout(i?k:l,i===c?e-m:e)}}}if($.guid){g.guid=j.guid=j.guid||$.guid++}return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* jQuery Navgoco Menus Plugin v0.2.1 (2014-04-11)
|
||||
* https://github.com/tefra/navgoco
|
||||
*
|
||||
* Copyright (c) 2014 Chris T (@tefra)
|
||||
* BSD - https://github.com/tefra/navgoco/blob/master/LICENSE-BSD
|
||||
*/
|
||||
!function(a){"use strict";var b=function(b,c,d){return this.el=b,this.$el=a(b),this.options=c,this.uuid=this.$el.attr("id")?this.$el.attr("id"):d,this.state={},this.init(),this};b.prototype={init:function(){var b=this;b._load(),b.$el.find("ul").each(function(c){var d=a(this);d.attr("data-index",c),b.options.save&&b.state.hasOwnProperty(c)?(d.parent().addClass(b.options.openClass),d.show()):d.parent().hasClass(b.options.openClass)?(d.show(),b.state[c]=1):d.hide()});var c=a("<span></span>").prepend(b.options.caretHtml),d=b.$el.find("li > a");b._trigger(c,!1),b._trigger(d,!0),b.$el.find("li:has(ul) > a").prepend(c)},_trigger:function(b,c){var d=this;b.on("click",function(b){b.stopPropagation();var e=c?a(this).next():a(this).parent().next(),f=!1;if(c){var g=a(this).attr("href");f=void 0===g||""===g||"#"===g}if(e=e.length>0?e:!1,d.options.onClickBefore.call(this,b,e),!c||e&&f)b.preventDefault(),d._toggle(e,e.is(":hidden")),d._save();else if(d.options.accordion){var h=d.state=d._parents(a(this));d.$el.find("ul").filter(":visible").each(function(){var b=a(this),c=b.attr("data-index");h.hasOwnProperty(c)||d._toggle(b,!1)}),d._save()}d.options.onClickAfter.call(this,b,e)})},_toggle:function(b,c){var d=this,e=b.attr("data-index"),f=b.parent();if(d.options.onToggleBefore.call(this,b,c),c){if(f.addClass(d.options.openClass),b.slideDown(d.options.slide),d.state[e]=1,d.options.accordion){var g=d.state=d._parents(b);g[e]=d.state[e]=1,d.$el.find("ul").filter(":visible").each(function(){var b=a(this),c=b.attr("data-index");g.hasOwnProperty(c)||d._toggle(b,!1)})}}else f.removeClass(d.options.openClass),b.slideUp(d.options.slide),d.state[e]=0;d.options.onToggleAfter.call(this,b,c)},_parents:function(b,c){var d={},e=b.parent(),f=e.parents("ul");return f.each(function(){var b=a(this),e=b.attr("data-index");return e?void(d[e]=c?b:1):!1}),d},_save:function(){if(this.options.save){var b={};for(var d in this.state)1===this.state[d]&&(b[d]=1);c[this.uuid]=this.state=b,a.cookie(this.options.cookie.name,JSON.stringify(c),this.options.cookie)}},_load:function(){if(this.options.save){if(null===c){var b=a.cookie(this.options.cookie.name);c=b?JSON.parse(b):{}}this.state=c.hasOwnProperty(this.uuid)?c[this.uuid]:{}}},toggle:function(b){var c=this,d=arguments.length;if(1>=d)c.$el.find("ul").each(function(){var d=a(this);c._toggle(d,b)});else{var e,f={},g=Array.prototype.slice.call(arguments,1);d--;for(var h=0;d>h;h++){e=g[h];var i=c.$el.find('ul[data-index="'+e+'"]').first();if(i&&(f[e]=i,b)){var j=c._parents(i,!0);for(var k in j)f.hasOwnProperty(k)||(f[k]=j[k])}}for(e in f)c._toggle(f[e],b)}c._save()},destroy:function(){a.removeData(this.$el),this.$el.find("li:has(ul) > a").unbind("click"),this.$el.find("li:has(ul) > a > span").unbind("click")}},a.fn.navgoco=function(c){if("string"==typeof c&&"_"!==c.charAt(0)&&"init"!==c)var d=!0,e=Array.prototype.slice.call(arguments,1);else c=a.extend({},a.fn.navgoco.defaults,c||{}),a.cookie||(c.save=!1);return this.each(function(f){var g=a(this),h=g.data("navgoco");h||(h=new b(this,d?a.fn.navgoco.defaults:c,f),g.data("navgoco",h)),d&&h[c].apply(h,e)})};var c=null;a.fn.navgoco.defaults={caretHtml:"",accordion:!1,openClass:"open",save:!0,cookie:{name:"navgoco",expires:!1,path:"/"},slide:{duration:400,easing:"swing"},onClickBefore:a.noop,onClickAfter:a.noop,onToggleBefore:a.noop,onToggleAfter:a.noop}}(jQuery);
|
||||
Vendored
+1588
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,82 @@
|
||||
// https://github.com/ghiculescu/jekyll-table-of-contents
|
||||
(function($){
|
||||
$.fn.toc = function(options) {
|
||||
var defaults = {
|
||||
noBackToTopLinks: false,
|
||||
title: '',
|
||||
minimumHeaders: 3,
|
||||
headers: 'h1, h2, h3, h4',
|
||||
listType: 'ol', // values: [ol|ul]
|
||||
showEffect: 'show', // values: [show|slideDown|fadeIn|none]
|
||||
showSpeed: 'slow' // set to 0 to deactivate effect
|
||||
},
|
||||
settings = $.extend(defaults, options);
|
||||
|
||||
var headers = $(settings.headers).filter(function() {
|
||||
// get all headers with an ID
|
||||
var previousSiblingName = $(this).prev().attr( "name" );
|
||||
if (!this.id && previousSiblingName) {
|
||||
this.id = $(this).attr( "id", previousSiblingName.replace(/\./g, "-") );
|
||||
}
|
||||
return this.id;
|
||||
}), output = $(this);
|
||||
if (!headers.length || headers.length < settings.minimumHeaders || !output.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (0 === settings.showSpeed) {
|
||||
settings.showEffect = 'none';
|
||||
}
|
||||
|
||||
var render = {
|
||||
show: function() { output.hide().html(html).show(settings.showSpeed); },
|
||||
slideDown: function() { output.hide().html(html).slideDown(settings.showSpeed); },
|
||||
fadeIn: function() { output.hide().html(html).fadeIn(settings.showSpeed); },
|
||||
none: function() { output.html(html); }
|
||||
};
|
||||
|
||||
var get_level = function(ele) { return parseInt(ele.nodeName.replace("H", ""), 10); }
|
||||
var highest_level = headers.map(function(_, ele) { return get_level(ele); }).get().sort()[0];
|
||||
var return_to_top = '<i class="icon-arrow-up back-to-top"> </i>';
|
||||
|
||||
var level = get_level(headers[0]),
|
||||
this_level,
|
||||
html = settings.title + " <"+settings.listType+">";
|
||||
headers.on('click', function() {
|
||||
if (!settings.noBackToTopLinks) {
|
||||
window.location.hash = this.id;
|
||||
}
|
||||
})
|
||||
.addClass('clickable-header')
|
||||
.each(function(_, header) {
|
||||
this_level = get_level(header);
|
||||
if (!settings.noBackToTopLinks && this_level === highest_level) {
|
||||
$(header).addClass('top-level-header').after(return_to_top);
|
||||
}
|
||||
if (this_level === level) // same level as before; same indenting
|
||||
html += "<li><a href='#" + header.id + "'>" + header.innerHTML + "</a>";
|
||||
else if (this_level <= level){ // higher level than before; end parent ol
|
||||
for(i = this_level; i < level; i++) {
|
||||
html += "</li></"+settings.listType+">"
|
||||
}
|
||||
html += "<li><a href='#" + header.id + "'>" + header.innerHTML + "</a>";
|
||||
}
|
||||
else if (this_level > level) { // lower level than before; expand the previous to contain a ol
|
||||
for(i = this_level; i > level; i--) {
|
||||
html += "<"+settings.listType+"><li>"
|
||||
}
|
||||
html += "<a href='#" + header.id + "'>" + header.innerHTML + "</a>";
|
||||
}
|
||||
level = this_level; // update for the next one
|
||||
});
|
||||
html += "</"+settings.listType+">";
|
||||
if (!settings.noBackToTopLinks) {
|
||||
$(document).on('click', '.back-to-top', function() {
|
||||
$(window).scrollTop(0);
|
||||
window.location.hash = '';
|
||||
});
|
||||
}
|
||||
|
||||
render[settings.showEffect]();
|
||||
};
|
||||
})(jQuery);
|
||||
Reference in new issue
Block a user