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
(function() { | |
window.addEventListener( 'load', function() { | |
var links = Array.prototype.slice.call( document.querySelectorAll( 'link[title]') ); | |
var uniqueTitles = links.reduce( function( titles, link ) { | |
if ( titles.indexOf( link.title ) === -1 ) { | |
titles.push( link.title ); | |
} | |
return titles; | |
}, []); | |
var title = window.sessionStorage && window.sessionStorage.getItem( 'title' ) || ''; |
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
(function() { | |
const links = Array.from( document.querySelectorAll( 'link[title]' ) ); | |
const styles = Array.from( new Set( links.map( link => link.title ) ) ); | |
let title = localStorage.getItem( 'title' ); | |
function selectStyle( title ) { | |
links.forEach( link => { | |
link.disabled = true; | |
link.disabled = link.title !== title; | |
}); |
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
const camelCase = str => str.split( /[_,-]+/ ).map( ( item, index ) => index === 0 ? item : item.charAt(0).toUpperCase() + item.slice(1).toLowerCase() | |
).join(''); |
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
--- | |
linters: | |
BangFormat: | |
space_before_bang: true | |
space_after_bang: false | |
BemDepth: | |
enabled: false | |
BorderZero: | |
enabled: true | |
convention: none |
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
function isInteractiveElement( element ) { | |
if ( [ 'A', 'BUTTON', 'DETAILS', 'EMBED', 'IFRAME', 'KEYGEN', 'LABEL', 'SELECT', 'TEXTAREA' ].indexOf( element.nodeName ) !== -1 ) { | |
return true; | |
} | |
if ( element.nodeName === 'INPUT' && element.type !== 'hidden' ) { | |
return true; | |
} | |
if ( ['AUDIO', 'VIDEO'].indexOf( element.nodeName ) > -1 && element.hasAttribute('controls') ) { | |
return true; | |
} |
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
function $_( selectors, baseElement ) { | |
var elements = (baseElement || document).querySelectorAll( selectors ); | |
return Array.prototype.slice.call( elements ); | |
} |
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
function insertScript(url, onload, onerror) { | |
var ref = document.getElementsByTagName('script')[0]; | |
var script = document.createElement('script'); | |
script.src = url; | |
if (typeof onload === 'function') { | |
script.onload = onload; | |
} | |
if (typeof onerror === 'function') { | |
script.onerror = onerror; | |
} |
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
# For more information about the properties used in | |
# this file, please see the EditorConfig documentation: | |
# http://editorconfig.org/ | |
root = true | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 |
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
(function() { | |
'use strict'; | |
document.addEventListener('keydown', function(event) { | |
var S = 83, | |
activeElement = document.activeElement, | |
saveButtonId, | |
saveButton; | |
if ((event.key === S || event.keyCode === S) && (event.metaKey || event.ctrlKey) && activeElement.nodeName === 'TEXTAREA') { |
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 scrollbarSize = (function() { | |
var inner = document.createElement( "div" ), | |
outer = document.createElement( "div" ); | |
inner.style.width = "100%"; | |
inner.style.height = "60px"; | |
outer.style.position = "absolute"; | |
outer.style.top = "0"; | |
outer.style.left = "0"; | |
outer.style.visibility = "hidden"; | |
outer.style.width = "50px"; |