diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..e66579d --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,7 @@ +{ + "ExpandedNodes": [ + "" + ], + "SelectedNode": "\\C:\\Users\\Sylveon\\Source\\Repos\\embedbuilder", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/embedbuilder/v17/.suo b/.vs/embedbuilder/v17/.suo new file mode 100644 index 0000000..2c4b5a4 Binary files /dev/null and b/.vs/embedbuilder/v17/.suo differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..8f3e541 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/assets/js/script.js b/assets/js/script.js index e08d214..4d66532 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -163,11 +163,7 @@ addEventListener('load', () => { editor.focus(); const notif = document.querySelector('.notification'), url = (url) => /^(https?:)?\/\//g.exec(url) ? url : '//' + url, - makeShort = (txt, length, mediaWidth) => { - if (mediaWidth && window.matchMedia(`(max-width:${mediaWidth}px)`).matches) - return txt.length > (length - 3) ? txt.substring(0, length - 3) + '...' : txt; - return txt; - }, error = (msg, time) => { + error = (msg, time) => { if (msg === false) // Hide error element return notif.animate({ opacity: '0', bottom: '-50px', offset: 1 }, { easing: 'ease', duration: 500 }).onfinish = () => notif.style.removeProperty('display'); @@ -177,25 +173,8 @@ addEventListener('load', () => { .onfinish = () => notif.style.removeProperty('display'), time); return false; }, allGood = e => { - let invalid, err, str = JSON.stringify(e, null, 4), re = /("(?:icon_)?url": *")((?!\w+?:\/\/).+)"/g.exec(str); - if (e.timestamp && new Date(e.timestamp).toString() === "Invalid Date") + if (e.timestamp && new Date(e.timestamp).toString() === "Invalid Date") { invalid = true, err = 'Timestamp is invalid'; - else if (re) { // If a URL is found without a protocol - if (!/\w+:|\/\/|^\//g.exec(re[2]) && re[2].includes('.')) { - let activeInput = document.querySelector('input[class$="link" i]:focus') - if (activeInput) { - lastPos = activeInput.selectionStart + 7; - activeInput.value = `http://${re[2]}`; - update(JSON.parse(str.replace(re[0], `${re[1]}http://${re[2]}"`))); - activeInput.setSelectionRange(lastPos, lastPos) - return true; - } - } - invalid = true, err = (`URL should have a protocol. Did you mean http://${makeShort(re[2], 30, 600).replace(' ', '')}?`); - } - if (invalid) { - validationError = true; - return error(err); } return true; }, innerHTML = (element, html) => {