From a10ad0a99ba6e44a35253c3bcaff80c90e99348e Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Sun, 3 Oct 2021 00:10:58 -0500 Subject: Revert ALL jekyll-text-theme configuration files I am changing the theme of the site, and need to revert these changes to make everything work. Revert "Add jekyll-text-theme YAML files" This reverts commit 61b34a5f260db45575d448d766ea29c0fb273ed3. Revert "Bring all of jekyll-text-theme _includes into site" This reverts commit c6bf5f7c895287d2028f6024265913b59784a154. Revert "Bring all of jekyll-text-theme assets to site" This reverts commit 7b69c2e5975f98da09d932ba6c70bdd71b1601a7. Remove jekyll text theme from Gemfile --- _includes/scripts/lib/toc.js | 107 ------------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 _includes/scripts/lib/toc.js (limited to '_includes/scripts/lib/toc.js') diff --git a/_includes/scripts/lib/toc.js b/_includes/scripts/lib/toc.js deleted file mode 100644 index fb43857..0000000 --- a/_includes/scripts/lib/toc.js +++ /dev/null @@ -1,107 +0,0 @@ -(function() { - var SOURCES = window.TEXT_VARIABLES.sources; - window.Lazyload.js(SOURCES.jquery, function() { - function toc(options) { - var $root = this, $window = $(window), $scrollTarget, $scroller, $tocUl = $(''), $tocLi, $headings, $activeLast, $activeCur, - selectors = 'h1,h2,h3', container = 'body', scrollTarget = window, scroller = 'html, body', disabled = false, - headingsPos, scrolling = false, hasRendered = false, hasInit = false; - - function setOptions(options) { - var _options = options || {}; - _options.selectors && (selectors = _options.selectors); - _options.container && (container = _options.container); - _options.scrollTarget && (scrollTarget = _options.scrollTarget); - _options.scroller && (scroller = _options.scroller); - _options.disabled !== undefined && (disabled = _options.disabled); - $headings = $(container).find(selectors).filter('[id]'); - $scrollTarget = $(scrollTarget); - $scroller = $(scroller); - } - function calc() { - headingsPos = []; - $headings.each(function() { - headingsPos.push(Math.floor($(this).position().top)); - }); - } - function setState(element, disabled) { - var scrollTop = $scrollTarget.scrollTop(), i; - if (disabled || !headingsPos || headingsPos.length < 1) { return; } - if (element) { - $activeCur = element; - } else { - for (i = 0; i < headingsPos.length; i++) { - if (scrollTop >= headingsPos[i]) { - $activeCur = $tocLi.eq(i); - } else { - $activeCur || ($activeCur = $tocLi.eq(i)); - break; - } - } - } - $activeLast && $activeLast.removeClass('active'); - ($activeLast = $activeCur).addClass('active'); - } - function render() { - if(!hasRendered) { - $root.append($tocUl); - $headings.each(function() { - var $this = $(this); - $tocUl.append($('
  • ').addClass('toc-' + $this.prop('tagName').toLowerCase()) - .append($('').text($this.text()).attr('href', '#' + $this.prop('id')))); - }); - $tocLi = $tocUl.children('li'); - $tocUl.on('click', 'a', function(e) { - e.preventDefault(); - var $this = $(this); - scrolling = true; - setState($this.parent()); - $scroller.scrollToAnchor($this.attr('href'), 400, function() { - scrolling = false; - }); - }); - } - hasRendered = true; - } - function init() { - var interval, timeout; - if(!hasInit) { - render(); calc(); setState(null, scrolling); - // run calc every 100 millisecond - interval = setInterval(function() { - calc(); - }, 100); - timeout = setTimeout(function() { - clearInterval(interval); - }, 45000); - window.pageLoad.then(function() { - setTimeout(function() { - clearInterval(interval); - clearTimeout(timeout); - }, 3000); - }); - $scrollTarget.on('scroll', function() { - disabled || setState(null, scrolling); - }); - $window.on('resize', window.throttle(function() { - if (!disabled) { - render(); calc(); setState(null, scrolling); - } - }, 100)); - } - hasInit = true; - } - - setOptions(options); - if (!disabled) { - init(); - } - $window.on('resize', window.throttle(function() { - init(); - }, 200)); - return { - setOptions: setOptions - }; - } - $.fn.toc = toc; - }); -})(); -- cgit v1.2.3