From 5081d805b05f5874a6439dc49311e038cca1595c Mon Sep 17 00:00:00 2001 From: DESKTOP-AJSJJMA\Admin Date: Mon, 25 Jul 2022 23:33:20 +0530 Subject: MAS 1.6 --- _site/site_libs/navigation-1.1/codefolding-lua.css | 9 ++ _site/site_libs/navigation-1.1/codefolding.js | 76 +++++++++++ _site/site_libs/navigation-1.1/sourceembed.js | 12 ++ _site/site_libs/navigation-1.1/tabsets.js | 141 +++++++++++++++++++++ 4 files changed, 238 insertions(+) create mode 100644 _site/site_libs/navigation-1.1/codefolding-lua.css create mode 100644 _site/site_libs/navigation-1.1/codefolding.js create mode 100644 _site/site_libs/navigation-1.1/sourceembed.js create mode 100644 _site/site_libs/navigation-1.1/tabsets.js (limited to '_site/site_libs/navigation-1.1') diff --git a/_site/site_libs/navigation-1.1/codefolding-lua.css b/_site/site_libs/navigation-1.1/codefolding-lua.css new file mode 100644 index 0000000..183b19e --- /dev/null +++ b/_site/site_libs/navigation-1.1/codefolding-lua.css @@ -0,0 +1,9 @@ +detaiks.chunk-details > summary.chunk-summary { + text-align: right; +} +details.chunk-details[open] > summary.chunk-summary::after { + content: "Hide"; +} +details.chunk-details[open] > summary.chunk-summary > span.chunk-summary-text { + display: none; +} diff --git a/_site/site_libs/navigation-1.1/codefolding.js b/_site/site_libs/navigation-1.1/codefolding.js new file mode 100644 index 0000000..97fffb2 --- /dev/null +++ b/_site/site_libs/navigation-1.1/codefolding.js @@ -0,0 +1,76 @@ + +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, pre.python, pre.bash, pre.sql, pre.cpp, pre.stan, pre.julia, pre.foldable'); + rCodeBlocks.each(function() { + // skip if the block has fold-none class + if ($(this).hasClass('fold-none')) return; + + // create a collapsable div to wrap the code in + var div = $('
'); + var showThis = (show || $(this).hasClass('fold-show')) && !$(this).hasClass('fold-hide'); + 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 = $('' + (showThis ? 'Hide' : 'Code') + ''); + var showCodeButton = $(''); + showCodeButton.append(showCodeText); + showCodeButton + .attr('data-toggle', 'collapse') + .attr('data-bs-toggle', 'collapse') // BS5 + .attr('data-target', '#' + id) + .attr('data-bs-target', '#' + id) // BS5 + .attr('aria-expanded', showThis) + .attr('aria-controls', id); + + var buttonRow = $(''); + var buttonCol = $(''); + + buttonCol.append(showCodeButton); + buttonRow.append(buttonCol); + + div.before(buttonRow); + + // show the div if necessary + if (showThis) div.collapse('show'); + + // update state of button on show/hide + // * Change text + // * add a class for intermediate states styling + div.on('hide.bs.collapse', function () { + showCodeText.text('Code'); + showCodeButton.addClass('btn-collapsing'); + }); + div.on('hidden.bs.collapse', function () { + showCodeButton.removeClass('btn-collapsing'); + }); + div.on('show.bs.collapse', function () { + showCodeText.text('Hide'); + showCodeButton.addClass('btn-expanding'); + }); + div.on('shown.bs.collapse', function () { + showCodeButton.removeClass('btn-expanding'); + }); + + }); + +} diff --git a/_site/site_libs/navigation-1.1/sourceembed.js b/_site/site_libs/navigation-1.1/sourceembed.js new file mode 100644 index 0000000..8464b0c --- /dev/null +++ b/_site/site_libs/navigation-1.1/sourceembed.js @@ -0,0 +1,12 @@ + +window.initializeSourceEmbed = function(filename) { + $("#rmd-download-source").click(function() { + var src = $("#rmd-source-code").html(); + var a = document.createElement('a'); + a.href = "data:text/x-r-markdown;base64," + src; + a.download = filename; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + }); +}; diff --git a/_site/site_libs/navigation-1.1/tabsets.js b/_site/site_libs/navigation-1.1/tabsets.js new file mode 100644 index 0000000..d7284e6 --- /dev/null +++ b/_site/site_libs/navigation-1.1/tabsets.js @@ -0,0 +1,141 @@ + + +/** + * jQuery Plugin: Sticky Tabs + * + * @author Aidan Lister