diff options
author | Karl Hallsby <karl@hallsby.com> | 2021-10-03 00:10:58 -0500 |
---|---|---|
committer | Karl Hallsby <karl@hallsby.com> | 2021-10-03 02:16:53 -0500 |
commit | a10ad0a99ba6e44a35253c3bcaff80c90e99348e (patch) | |
tree | 005e05a70fb1fe24a5a7c44dc1d2d14c9e1d88ed /_includes/scripts/archieve.js | |
parent | b9b34a65fbe55ce78d353ce2b7eb51f6884bd272 (diff) |
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
Diffstat (limited to '_includes/scripts/archieve.js')
-rw-r--r-- | _includes/scripts/archieve.js | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/_includes/scripts/archieve.js b/_includes/scripts/archieve.js deleted file mode 100644 index 96549b5..0000000 --- a/_includes/scripts/archieve.js +++ /dev/null @@ -1,135 +0,0 @@ -(function() { - var SOURCES = window.TEXT_VARIABLES.sources; - function queryString() { - // This function is anonymous, is executed immediately and - // the return value is assigned to QueryString! - var i = 0, queryObj = {}, pair; - var queryStr = window.location.search.substring(1); - var queryArr = queryStr.split('&'); - for (i = 0; i < queryArr.length; i++) { - pair = queryArr[i].split('='); - // If first entry with this name - if (typeof queryObj[pair[0]] === 'undefined') { - queryObj[pair[0]] = pair[1]; - // If second entry with this name - } else if (typeof queryObj[pair[0]] === 'string') { - queryObj[pair[0]] = [queryObj[pair[0]], pair[1]]; - // If third or later entry with this name - } else { - queryObj[pair[0]].push(pair[1]); - } - } - return queryObj; - } - - var setUrlQuery = (function() { - var baseUrl = window.location.href.split('?')[0]; - return function(query) { - if (typeof query === 'string') { - window.history.replaceState(null, '', baseUrl + query); - } else { - window.history.replaceState(null, '', baseUrl); - } - }; - })(); - - window.Lazyload.js(SOURCES.jquery, function() { - var $tags = $('.js-tags'); - var $articleTags = $tags.find('button'); - var $tagShowAll = $tags.find('.tag-button--all'); - var $result = $('.js-result'); - var $sections = $result.find('section'); - var sectionArticles = []; - var $lastFocusButton = null; - var sectionTopArticleIndex = []; - var hasInit = false; - - $sections.each(function() { - sectionArticles.push($(this).find('.item')); - }); - - function init() { - var i, index = 0; - for (i = 0; i < $sections.length; i++) { - sectionTopArticleIndex.push(index); - index += $sections.eq(i).find('.item').length; - } - sectionTopArticleIndex.push(index); - } - - function searchButtonsByTag(_tag/*raw tag*/) { - if (!_tag) { - return $tagShowAll; - } - var _buttons = $articleTags.filter('[data-encode="' + _tag + '"]'); - if (_buttons.length === 0) { - return $tagShowAll; - } - return _buttons; - } - function buttonFocus(target) { - if (target) { - target.addClass('focus'); - $lastFocusButton && !$lastFocusButton.is(target) && $lastFocusButton.removeClass('focus'); - $lastFocusButton = target; - } - } - - function tagSelect (tag/*raw tag*/, target) { - var result = {}, $articles; - var i, j, k, _tag; - - for (i = 0; i < sectionArticles.length; i++) { - $articles = sectionArticles[i]; - for (j = 0; j < $articles.length; j++) { - if (tag === '' || tag === undefined) { - result[i] || (result[i] = {}); - result[i][j] = true; - } else { - var tags = $articles.eq(j).data('tags').split(','); - for (k = 0; k < tags.length; k++) { - if (tags[k] === tag) { - result[i] || (result[i] = {}); - result[i][j] = true; break; - } - } - } - } - } - - for (i = 0; i < sectionArticles.length; i++) { - result[i] && $sections.eq(i).removeClass('d-none'); - result[i] || $sections.eq(i).addClass('d-none'); - for (j = 0; j < sectionArticles[i].length; j++) { - if (result[i] && result[i][j]) { - sectionArticles[i].eq(j).removeClass('d-none'); - } else { - sectionArticles[i].eq(j).addClass('d-none'); - } - } - } - - hasInit || ($result.removeClass('d-none'), hasInit = true); - - - if (target) { - buttonFocus(target); - _tag = target.attr('data-encode'); - if (_tag === '' || typeof _tag !== 'string') { - setUrlQuery(); - } else { - setUrlQuery('?tag=' + _tag); - } - } else { - buttonFocus(searchButtonsByTag(tag)); - } - } - - var query = queryString(), _tag = query.tag; - init(); tagSelect(_tag); - $tags.on('click', 'button', function() { - tagSelect($(this).data('encode'), $(this)); - }); - - }); -})(); |