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 favicon = { | |
change: function(iconURL) { | |
if (arguments.length == 2) { | |
document.title = optionalDocTitle | |
} | |
this.addLink(iconURL, "icon") | |
this.addLink(iconURL, "shortcut icon") | |
// Google Chrome HACK - whenever an IFrame changes location | |
// (even to about:blank), it updates the favicon for some reason |
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 MIN_LENGTH = 5; | |
const MAX_LENGTH = 63; | |
const ALPHA_NUMERIC_REGEX = /^[a-z][a-z\-]*[a-z0-9]*$/; | |
const START_END_HYPHEN_REGEX = /\A[^-].*[^-]\z/i; | |
const reservedNames = ['www', 'ftp', 'mail', 'pop', 'smtp', 'admin', 'ssl', 'sftp']; | |
const validateSubdomain = subdomain => { | |
//if is reserved... | |
if (reservedNames.includes(subdomain)) | |
throw new Error('cannot be a reserved name'); |