helpers.js (590B)
1 window.TITLE = 'Mercury' 2 window.TITLE_TEMPLATE = _.template('<%= title %> → <%= section %>') 3 4 window.$title = (string) => title( string ? _.upperCase(string) : "", { special: [ "Völkrom" ] } ) 5 window.$slugify = (string) => _.snakeCase(_.deburr(string)) 6 window.$escape = (string) => he.encode(string, {useNamedReferences: true}) 7 8 window.$is_dat = async (callback) => { 9 if (window.DatArchive != undefined) { 10 await callback() 11 } 12 } 13 14 window.$retitle = (string) => { 15 if (!string) { 16 document.title = TITLE 17 } else { 18 document.title = TITLE_TEMPLATE({title: TITLE, section: string}) 19 } 20 }