-
+
diff --git a/libs/navigation-1.1/FileSaver.min.js b/libs/navigation-1.1/FileSaver.min.js
new file mode 100644
index 0000000..6268ec9
--- /dev/null
+++ b/libs/navigation-1.1/FileSaver.min.js
@@ -0,0 +1,2 @@
+/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
+var saveAs=saveAs||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},o=t.createElementNS("http://www.w3.org/1999/xhtml","a"),r="download"in o,i=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),c=e.webkitRequestFileSystem,f=e.requestFileSystem||c||e.mozRequestFileSystem,u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},d="application/octet-stream",s=0,l=4e4,v=function(e){var t=function(){"string"==typeof e?n().revokeObjectURL(e):e.remove()};setTimeout(t,l)},p=function(e,t,n){t=[].concat(t);for(var o=t.length;o--;){var r=e["on"+t[o]];if("function"==typeof r)try{r.call(e,n||e)}catch(i){u(i)}}},w=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},y=function(t,u,l){l||(t=w(t));var y,m,S,h=this,R=t.type,O=!1,g=function(){p(h,"writestart progress write writeend".split(" "))},b=function(){if(m&&a&&"undefined"!=typeof FileReader){var o=new FileReader;return o.onloadend=function(){var e=o.result;m.location.href="data:attachment/file"+e.slice(e.search(/[,;]/)),h.readyState=h.DONE,g()},o.readAsDataURL(t),void(h.readyState=h.INIT)}if((O||!y)&&(y=n().createObjectURL(t)),m)m.location.href=y;else{var r=e.open(y,"_blank");void 0===r&&a&&(e.location.href=y)}h.readyState=h.DONE,g(),v(y)},E=function(e){return function(){return h.readyState!==h.DONE?e.apply(this,arguments):void 0}},N={create:!0,exclusive:!1};return h.readyState=h.INIT,u||(u="download"),r?(y=n().createObjectURL(t),void setTimeout(function(){o.href=y,o.download=u,i(o),g(),v(y),h.readyState=h.DONE})):(e.chrome&&R&&R!==d&&(S=t.slice||t.webkitSlice,t=S.call(t,0,t.size,d),O=!0),c&&"download"!==u&&(u+=".download"),(R===d||c)&&(m=e),f?(s+=t.size,void f(e.TEMPORARY,s,E(function(e){e.root.getDirectory("saved",N,E(function(e){var n=function(){e.getFile(u,N,E(function(e){e.createWriter(E(function(n){n.onwriteend=function(t){m.location.href=e.toURL(),h.readyState=h.DONE,p(h,"writeend",t),v(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&b()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=h["on"+e]}),n.write(t),h.abort=function(){n.abort(),h.readyState=h.DONE},h.readyState=h.WRITING}),b)}),b)};e.getFile(u,{create:!1},E(function(e){e.remove(),n()}),E(function(e){e.code===e.NOT_FOUND_ERR?n():b()}))}),b)}),b)):void b())},m=y.prototype,S=function(e,t,n){return new y(e,t,n)};return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,n){return n||(e=w(e)),navigator.msSaveOrOpenBlob(e,t||"download")}:(m.abort=function(){var e=this;e.readyState=e.DONE,p(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,S)}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);"undefined"!=typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!=typeof define&&null!==define&&null!==define.amd&&define([],function(){return saveAs});
\ No newline at end of file
diff --git a/libs/navigation-1.1/codefolding.js b/libs/navigation-1.1/codefolding.js
new file mode 100644
index 0000000..4938425
--- /dev/null
+++ b/libs/navigation-1.1/codefolding.js
@@ -0,0 +1,59 @@
+
+window.initializeCodeFolding = function(show) {
+
+ // handlers for show-all and hide all
+ $("#rmd-show-all-code").click(function() {
+ $('div.r-code-collapse').each(function() {
+ $(this).collapse('show');
+ });
+ });
+ $("#rmd-hide-all-code").click(function() {
+ $('div.r-code-collapse').each(function() {
+ $(this).collapse('hide');
+ });
+ });
+
+ // index for unique code element ids
+ var currentIndex = 1;
+
+ // select all R code blocks
+ var rCodeBlocks = $('pre.r');
+ rCodeBlocks.each(function() {
+
+ // create a collapsable div to wrap the code in
+ var div = $('');
+ if (show)
+ div.addClass('in');
+ var id = 'rcode-643E0F36' + currentIndex++;
+ div.attr('id', id);
+ $(this).before(div);
+ $(this).detach().appendTo(div);
+
+ // add a show code button right above
+ var showCodeText = $('' + (show ? 'Hide' : 'Code') + '');
+ var showCodeButton = $('');
+ showCodeButton.append(showCodeText);
+ showCodeButton
+ .attr('data-toggle', 'collapse')
+ .attr('data-target', '#' + id)
+ .attr('aria-expanded', show)
+ .attr('aria-controls', id);
+
+ var buttonRow = $('');
+ var buttonCol = $('');
+
+ buttonCol.append(showCodeButton);
+ buttonRow.append(buttonCol);
+
+ div.before(buttonRow);
+
+ // update state of button on show/hide
+ div.on('hidden.bs.collapse', function () {
+ showCodeText.text('Code');
+ });
+ div.on('show.bs.collapse', function () {
+ showCodeText.text('Hide');
+ });
+ });
+
+}
diff --git a/libs/navigation-1.1/sourceembed.js b/libs/navigation-1.1/sourceembed.js
new file mode 100644
index 0000000..e1b2cf8
--- /dev/null
+++ b/libs/navigation-1.1/sourceembed.js
@@ -0,0 +1,9 @@
+
+
+window.initializeSourceEmbed = function(filename) {
+ $("#rmd-download-source").click(function() {
+ var src = window.atob($("#rmd-source-code").html());
+ var blob = new Blob([src], {type: "text/x-r-markdown"});
+ saveAs(blob, filename);
+ });
+};
diff --git a/libs/navigation-1.1/tabsets.js b/libs/navigation-1.1/tabsets.js
new file mode 100644
index 0000000..27848af
--- /dev/null
+++ b/libs/navigation-1.1/tabsets.js
@@ -0,0 +1,86 @@
+
+
+window.buildTabsets = function(tocID) {
+
+ // build a tabset from a section div with the .tabset class
+ function buildTabset(tabset) {
+
+ // check for fade and pills options
+ var fade = tabset.hasClass("tabset-fade");
+ var pills = tabset.hasClass("tabset-pills");
+ var navClass = pills ? "nav-pills" : "nav-tabs";
+
+ // determine the heading level of the tabset and tabs
+ var match = tabset.attr('class').match(/level(\d) /);
+ if (match === null)
+ return;
+ var tabsetLevel = Number(match[1]);
+ var tabLevel = tabsetLevel + 1;
+
+ // find all subheadings immediately below
+ var tabs = tabset.find("div.section.level" + tabLevel);
+ if (!tabs.length)
+ return;
+
+ // create tablist and tab-content elements
+ var tabList = $('
');
+ $(tabs[0]).before(tabList);
+ var tabContent = $('');
+ $(tabs[0]).before(tabContent);
+
+ // build the tabset
+ tabs.each(function(i) {
+
+ // get the tab div
+ var tab = $(tabs[i]);
+
+ // get the id then sanitize it for use with bootstrap tabs
+ var id = tab.attr('id');
+
+ // remove any table of contents entries associated with
+ // this ID (since we'll be removing the heading element)
+ $("div#" + tocID + " li a[href='#" + id + "']").parent().remove();
+
+ // sanitize the id for use with bootstrap tabs
+ id = id.replace(/[.\/?&!#<>]/g, '').replace(/\s/g, '_');
+ tab.attr('id', id);
+
+ // get the heading element within it, grab it's text, then remove it
+ var heading = tab.find('h' + tabLevel + ':first');
+ var headingText = heading.html();
+ heading.remove();
+
+ // build and append the tab list item
+ var a = $('' + headingText + '');
+ a.attr('href', '#' + id);
+ a.attr('aria-controls', id);
+ var li = $('');
+ li.append(a);
+ if (i === 0)
+ li.attr('class', 'active');
+ tabList.append(li);
+
+ // set it's attributes
+ tab.attr('role', 'tabpanel');
+ tab.addClass('tab-pane');
+ tab.addClass('tabbed-pane');
+ if (fade)
+ tab.addClass('fade');
+ if (i === 0) {
+ tab.addClass('active');
+ if (fade)
+ tab.addClass('in');
+ }
+
+ // move it into the tab content div
+ tab.detach().appendTo(tabContent);
+ });
+ }
+
+ // convert section divs with the .tabset class to tabsets
+ var tabsets = $("div.section.tabset");
+ tabsets.each(function(i) {
+ buildTabset($(tabsets[i]));
+ });
+};
+