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
/*jshint maxlen: 79 */ | |
var MYSITE = MYSITE || {}; | |
/** | |
* Make YouTube links with .yt-embed replace themselves with YouTube iframes | |
* when clicked. The first child element is assumed to be the img element | |
* holding the poster frame. The YouTube URL must contain the "v" parameter, | |
* but no further parameters. The data-yt-options attribute may hold iframe | |
* URL parameters. |
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
// jshint esversion: 6, maxlen: 80, strict: global | |
'use strict'; | |
// In mailto: links, replace '(at)' with '@' and '(dot)' with '.' | |
{ | |
const at = /\(at\)/gi; | |
const dot = /\(dot\)/gi; | |
const links = document.querySelectorAll('a[href^="mailto:"]'); |