summaryrefslogtreecommitdiffstats
path: root/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js
diff options
context:
space:
mode:
Diffstat (limited to 'docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js')
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/clipboardjs.js30
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/docsearch.js8
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/filesaver.js0
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/lazysizes.js3
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/main.js22
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/menutoggle.js31
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/nojs.js1
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/scrolldir.js1
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/smoothscroll.js80
-rw-r--r--docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/tabs.js43
10 files changed, 0 insertions, 219 deletions
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/clipboardjs.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/clipboardjs.js
deleted file mode 100644
index ffae31c7f..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/clipboardjs.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var Clipboard = require('clipboard/dist/clipboard.js');
-new Clipboard('.copy', {
- target: function(trigger) {
- if(trigger.classList.contains('copy-toggle')){
- return trigger.previousElementSibling;
- }
- return trigger.nextElementSibling;
- }
- }).on('success', function(e) {
- successMessage(e.trigger, 'Copied!');
- e.clearSelection();
- }).on('error', function(e) {
- successMessage(e.trigger, fallbackMessage(e.action));
-});
-
-function successMessage(elem, msg) {
- elem.setAttribute('class', 'copied bg-primary-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2');
- elem.setAttribute('aria-label', msg);
-}
-
-function fallbackMessage(elem, action) {
- var actionMsg = '';
- var actionKey = (action === 'cut' ? 'X' : 'C');
- if (isMac) {
- actionMsg = 'Press ⌘-' + actionKey;
- } else {
- actionMsg = 'Press Ctrl-' + actionKey;
- }
- return actionMsg;
-}
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/docsearch.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/docsearch.js
deleted file mode 100644
index e14fb2994..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/docsearch.js
+++ /dev/null
@@ -1,8 +0,0 @@
-var docsearch = require('docsearch.js/dist/cdn/docsearch.js');
-docsearch({
- appId: 'D1BPLZHGYQ',
- apiKey: '6df94e1e5d55d258c56f60d974d10314',
- indexName: 'hugodocs',
- inputSelector: '#search-input',
- debug: true, // Set debug to true if you want to inspect the dropdown
-});
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/filesaver.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/filesaver.js
deleted file mode 100644
index e69de29bb..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/filesaver.js
+++ /dev/null
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/lazysizes.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/lazysizes.js
deleted file mode 100644
index 4eb3950af..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/lazysizes.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var lazysizes = require('lazysizes');
-// var lsnoscript = require('lazysizes/plugins/noscript/ls.noscript.js');
-var unveilhooks = require('lazysizes/plugins/unveilhooks/ls.unveilhooks.js');
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/main.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/main.js
deleted file mode 100644
index f6d3eac9f..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/main.js
+++ /dev/null
@@ -1,22 +0,0 @@
-import styles from './../css/main.css';
-import './clipboardjs.js'
-import './codeblocks.js'
-import './docsearch.js'
-import './lazysizes.js'
-import './menutoggle.js'
-import './scrolldir.js'
-import './smoothscroll.js'
-import './tabs.js'
-import './nojs.js'
-
-// TO use jQuery, just call the modules you want
-// var $ = require('jquery/src/core');
-// require('jquery/src/core/init');
-// require('jquery/src/manipulation');
-
-// OR, use all of them
-// var $ = require('jquery/src/jquery');
-
-// And write your code
-// $('body').append('<p>Jquery is working</p>');
-//
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/menutoggle.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/menutoggle.js
deleted file mode 100644
index 40bda0ce9..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/menutoggle.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// Grab any element that has the 'js-toggle' class and add an event listener for the toggleClass function
-var toggleBtns = document.getElementsByClassName('js-toggle')
- for (var i = 0; i < toggleBtns.length; i++) {
- toggleBtns[i].addEventListener('click', toggleClass, false)
- }
-
-function toggleClass() {
- // Define the data target via the dataset "target" (e.g. data-target=".docsmenu")
- var content = this.dataset.target.split(' ')
- // Find any menu items that are open
- var mobileCurrentlyOpen = document.querySelector('.mobilemenu:not(.dn)')
- var desktopCurrentlyOpen = document.querySelector('.desktopmenu:not(.dn)')
- var desktopActive = document.querySelector('.desktopmenu:not(.dn)')
-
- // Loop through the targets' divs
- for (var i = 0; i < content.length; i++) {
- var matches = document.querySelectorAll(content[i]);
- //for each, if the div has the 'dn' class (which is "display:none;"), remove it, otherwise, add that class
- [].forEach.call(matches, function(dom) {
- dom.classList.contains('dn') ?
- dom.classList.remove('dn') :
- dom.classList.add('dn');
- return false;
- });
- // close the currently open menu items
- if (mobileCurrentlyOpen) mobileCurrentlyOpen.classList.add('dn')
- if (desktopCurrentlyOpen) desktopCurrentlyOpen.classList.add('dn')
- if (desktopActive) desktopActive.classList.remove('db')
-
- }
- }
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/nojs.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/nojs.js
deleted file mode 100644
index 50b5126a9..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/nojs.js
+++ /dev/null
@@ -1 +0,0 @@
-document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/, 'js');
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/scrolldir.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/scrolldir.js
deleted file mode 100644
index 0b69978cd..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/scrolldir.js
+++ /dev/null
@@ -1 +0,0 @@
-var scrollDir = require('scrolldir/dist/scrolldir.auto.min.js');
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/smoothscroll.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/smoothscroll.js
deleted file mode 100644
index 4bb2d99b8..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/smoothscroll.js
+++ /dev/null
@@ -1,80 +0,0 @@
-// query selector targets Hugo TOC
-(function() {
-
- 'use strict';
-
- // Feature Test
- if ('querySelector' in document && 'addEventListener' in window && Array.prototype.forEach) {
-
- // Function to animate the scroll
- var smoothScroll = function(anchor, duration) {
-
- // Calculate how far and how fast to scroll
- var startLocation = window.pageYOffset;
- var endLocation = anchor.offsetTop;
- var distance = endLocation - startLocation;
- var increments = distance / (duration / 16);
- var stopAnimation;
-
- // Scroll the page by an increment, and check if it's time to stop
- var animateScroll = function() {
- window.scrollBy(0, increments);
- stopAnimation();
- };
-
- // If scrolling down
- if (increments >= 0) {
- // Stop animation when you reach the anchor OR the bottom of the page
- stopAnimation = function() {
- var travelled = window.pageYOffset;
- if ((travelled >= (endLocation - increments)) || ((window.innerHeight + travelled) >= document.body.offsetHeight)) {
- clearInterval(runAnimation);
- }
- };
- }
- // If scrolling up
- else {
- // Stop animation when you reach the anchor OR the top of the page
- stopAnimation = function() {
- var travelled = window.pageYOffset;
- if (travelled <= (endLocation || 0)) {
- clearInterval(runAnimation);
- }
- };
- }
-
- // Loop the animation function
- var runAnimation = setInterval(animateScroll, 16);
-
- };
-
- // Define smooth scroll links
- var scrollToggle = document.querySelectorAll('#TableOfContents ul li a');
-
- // For each smooth scroll link
- [].forEach.call(scrollToggle, function(toggle) {
-
- // When the smooth scroll link is clicked
- toggle.addEventListener('click', function(e) {
-
- // Prevent the default link behavior
- e.preventDefault();
-
- // Get anchor link and calculate distance from the top
- var dataID = toggle.getAttribute('href');
- var dataTarget = document.querySelector(dataID);
- var dataSpeed = toggle.getAttribute('data-speed');
-
- // If the anchor exists
- if (dataTarget) {
- // Scroll to the anchor
- smoothScroll(dataTarget, dataSpeed || 500);
- }
-
- }, false);
-
- });
-
- }
-
-})();
diff --git a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/tabs.js b/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/tabs.js
deleted file mode 100644
index a689d474e..000000000
--- a/docs/_vendor/github.com/gohugoio/gohugoioTheme/assets/js/tabs.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Scripts which manages Code Toggle tabs.
- */
-var i;
-// store tabs variable
-var allTabs = document.querySelectorAll("[data-toggle-tab]");
-var allPanes = document.querySelectorAll("[data-pane]");
-
-function toggleTabs(event) {
-
- if(event.target){
- event.preventDefault();
- var clickedTab = event.currentTarget;
- var targetKey = clickedTab.getAttribute("data-toggle-tab")
- }else {
- var targetKey = event
- }
- // We store the config language selected in users' localStorage
- if(window.localStorage){
- window.localStorage.setItem("configLangPref", targetKey)
- }
- var selectedTabs = document.querySelectorAll("[data-toggle-tab='" + targetKey + "']");
- var selectedPanes = document.querySelectorAll("[data-pane='" + targetKey + "']");
-
- for (var i = 0; i < allTabs.length; i++) {
- allTabs[i].classList.remove("active");
- allPanes[i].classList.remove("active");
- }
-
- for (var i = 0; i < selectedTabs.length; i++) {
- selectedTabs[i].classList.add("active");
- selectedPanes[i].classList.add("active");
- }
-
-}
-
-for (i = 0; i < allTabs.length; i++) {
- allTabs[i].addEventListener("click", toggleTabs)
-}
-// Upon page load, if user has a preferred language in its localStorage, tabs are set to it.
-if(window.localStorage.getItem('configLangPref')) {
- toggleTabs(window.localStorage.getItem('configLangPref'))
-}