From 3d7e606f1a43ed0842650299ac8df779ad82ce68 Mon Sep 17 00:00:00 2001 From: chateau Date: Fri, 1 Feb 2019 21:49:08 +0100 Subject: [PATCH] little more cleanup in ynhpanel.js --- portal/assets/js/ynhpanel.js | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/portal/assets/js/ynhpanel.js b/portal/assets/js/ynhpanel.js index 93fc3da..2fb0ef1 100644 --- a/portal/assets/js/ynhpanel.js +++ b/portal/assets/js/ynhpanel.js @@ -204,16 +204,6 @@ function domReady(cb) { : cb(); } -function loadScript(url, callback) { - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.src = url; - // There are several events for cross browser compatibility. - script.onreadystatechange = callback; - script.onload = callback; - // Fire the loading - document.head.appendChild(script); -} /* ---------------------------------------------------------- Main @@ -264,16 +254,6 @@ domReady(function(){ // Response is JSON response = JSON.parse(r.responseText); - var pfx = ["webkit", "moz", "MS", "o", ""]; - function PrefixedEvent(element, type, callback) { - for (var p = 0; p < pfx.length; p++) { - if (!pfx[p]) type = type.toLowerCase(); - element.addEventListener(pfx[p]+type, callback, false); - } - } - - - // Load all stylesheets after getting config // Add portal stylesheet var portalStyle = document.createElement("link"); @@ -282,7 +262,7 @@ domReady(function(){ portalStyle.setAttribute("href", '/ynhpanel.css'); document.getElementsByTagName("head")[0].insertBefore(portalStyle, null); - // Custom style from theme + // Custom style from theme's id specified in config if (response.theme) { var portalThemeStyle = document.createElement("link"); portalThemeStyle.setAttribute("rel", "stylesheet"); @@ -316,4 +296,5 @@ domReady(function(){ }; r.send(); + });