diff options
author | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
commit | 8fabf77b2a7720a357c63817c07035a9908818a0 (patch) | |
tree | d689fcac1403e2473010fe80bc337599a78c21a4 /Neutron-trunk/resources/private/global.js._/index.php | |
parent | 7b4af63a90a726b98a59b83e53f040a7a566a11d (diff) | |
download | electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.gz electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.bz2 electrode-8fabf77b2a7720a357c63817c07035a9908818a0.zip |
Update
Diffstat (limited to 'Neutron-trunk/resources/private/global.js._/index.php')
-rw-r--r-- | Neutron-trunk/resources/private/global.js._/index.php | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/Neutron-trunk/resources/private/global.js._/index.php b/Neutron-trunk/resources/private/global.js._/index.php deleted file mode 100644 index fb9dcc3..0000000 --- a/Neutron-trunk/resources/private/global.js._/index.php +++ /dev/null @@ -1,95 +0,0 @@ -window.onerror = function(msg, url, line, col, error) { - if (msg == "ResizeObserver loop completed with undelivered notifications.") { - return; - } - if (typeof line != "undefined") { - if (typeof col != "undefined") { - linecol = "at line " + line + " and column " + col - } else { - linecol = "at line " + line - } - } - alert_full("Sorry, a runtime error occurred on this page:\n" + msg + "\n\nThe error is from " + url + "\n" + linecol + "\n\nWe suggest that you submit a bug report on Neutron's website and include above information."); -}; - -// New Ajax Lazy Loader -location.reloadLegacy = location.reload; -reloadPage = () => { location.reload() }; -ajaxPageReload = () => { - try { - document.title = "..."; - $('body').fadeOut(200); - $.ajax({ - type: "GET", - dataType: 'html', - url: location.href, - success: function (data) { - document.getElementsByTagName('html')[0].innerHTML = data + "<style>body{display:none;}</style>"; - setTimeout(() => { - $('body').fadeIn(200); - }, 500) - }, - error: function (error) { - location.reloadLegacy(); - }, - cache: false, - contentType: false, - processData: false - }); - } catch (err) { - location.reloadLegacy(); - } -} -switchToPage = (url) => { - try { - let stateObj = { - foo: ".", - }; - document.title = "..."; - history.pushState(stateObj, "page 2", "#/loading"); - $('body').fadeOut(200); - $.ajax({ - type: "GET", - dataType: 'html', - url: url, - success: function (data) { - document.getElementsByTagName('html')[0].innerHTML = data + "<style>body{display:none;}</style>"; - Array.from(document.getElementsByTagName('script')).forEach((el) => { - if (el.src.trim() == "") { - eval(el.innerHTML); - } - }); - if (location.pathname.startsWith("<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin")) { - $.ajax({ - type: "GET", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/admin.js", - success: function (data) { - eval(data); - }, - error: function (error) { - console.error("Unable to load script at " + "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/admin.js"); - }, - cache: false, - contentType: false, - processData: false - }); - } - setTimeout(() => { - $('body').fadeIn(200); - history.pushState(stateObj, "page 2", url); - }, 500) - }, - error: function (error) { - console.log(error); - location.href = url; - }, - cache: false, - contentType: false, - processData: false - }); - } catch (err) { - console.log(err); - location.href = url; - } -}
\ No newline at end of file |