This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tocJS = (function () { | |
function init() { | |
uiBindings(); | |
} | |
var uiBindings = function () { | |
var parentHeading = document.querySelector('.main-page-content'), // main content | |
parentBlock = document.querySelector('toc list parent div'), | |
tocBlock = document.querySelector('TOC block parent class'), | |
allHeading = parentHeading.querySelectorAll('h2, h3, h4'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var LocalStorage = (function() { | |
var isSupported = false; | |
try { | |
isSupported = window.localStorage ? true : false; | |
} | |
catch (error) {} | |
return { | |
isSupported: isSupported, | |
set: function(key, val) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var customLib = { | |
/** | |
* A native JS extend() function. | |
* https://gist.github.com/cferdinandi/4f8a0e17921c5b46e6c4 | |
* Merge defaults with user options | |
* @private | |
* @param {Object} defaults Default settings | |
* @param {Object} options User options | |
* @returns {Object} Merged values of defaults and options | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
** | |
Ref: https://github.com/sindresorhus/devtools-detect | |
***/ | |
var devtools = { | |
isOpen: false, | |
orientation: undefined, | |
}, | |
threshold = 160; |