Use dark logo on loader

This commit is contained in:
Julia Radzhabova 2021-10-04 23:58:27 +03:00
parent bb2abd98f2
commit 87a608d0af
8 changed files with 26 additions and 23 deletions

View file

@ -189,7 +189,8 @@
var params = getUrlParams(), var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0], lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null; logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];
@ -201,12 +202,12 @@
document.body.removeChild(document.getElementById('loading-mask')); document.body.removeChild(document.getElementById('loading-mask'));
} else { } else {
var elem = document.querySelector('.loading-logo'); var elem = document.querySelector('.loading-logo');
if (elem && logo) { if (elem && (logo || logoDark)) {
elem.style.backgroundImage= 'none'; elem.style.backgroundImage= 'none';
elem.style.width = 'auto'; elem.style.width = 'auto';
elem.style.height = 'auto'; elem.style.height = 'auto';
var img = document.querySelector('.loading-logo img'); var img = document.querySelector('.loading-logo img');
img && img.setAttribute('src', logo); img && img.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
img.style.opacity = 1; img.style.opacity = 1;
} }
} }

View file

@ -170,17 +170,18 @@
var params = getUrlParams(), var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0], lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null; logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];
var elem = document.querySelector('.loading-logo'); var elem = document.querySelector('.loading-logo');
if (elem && logo) { if (elem && (logo || logoDark)) {
elem.style.backgroundImage= 'none'; elem.style.backgroundImage= 'none';
elem.style.width = 'auto'; elem.style.width = 'auto';
elem.style.height = 'auto'; elem.style.height = 'auto';
var img = document.querySelector('.loading-logo img'); var img = document.querySelector('.loading-logo img');
img && img.setAttribute('src', logo); img && img.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
img.style.opacity = 1; img.style.opacity = 1;
} }
</script> </script>

View file

@ -233,7 +233,8 @@
var params = getUrlParams(), var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0], lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null; logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];
@ -292,7 +293,7 @@
} else { } else {
var elem = document.querySelector('.loading-logo img'); var elem = document.querySelector('.loading-logo img');
if (elem) { if (elem) {
logo && (elem.setAttribute('src', logo)); (logo || logoDark) && elem.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
elem.style.opacity = 1; elem.style.opacity = 1;
} }
} }

View file

@ -205,7 +205,8 @@
var params = getUrlParams(), var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0], lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null; logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];
@ -264,7 +265,7 @@
} else { } else {
var elem = document.querySelector('.loading-logo img'); var elem = document.querySelector('.loading-logo img');
if (elem) { if (elem) {
logo && (elem.setAttribute('src', logo)); (logo || logoDark) && elem.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
elem.style.opacity = 1; elem.style.opacity = 1;
} }
} }

View file

@ -255,16 +255,12 @@
var params = getUrlParams(), var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0], lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null; logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];
var ui_theme_name = params.uitheme || localStorage.getItem("ui-theme");
if ( !!ui_theme_name ) {
document.documentElement.classList.add(ui_theme_name);
}
if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) if(/MSIE \d|Trident.*rv:/.test(navigator.userAgent))
document.write('<script src="../../common/main/lib/util/fix-ie-compat.js"><\/script>'); document.write('<script src="../../common/main/lib/util/fix-ie-compat.js"><\/script>');
</script> </script>
@ -318,7 +314,7 @@
} else { } else {
var elem = document.querySelector('.loading-logo img'); var elem = document.querySelector('.loading-logo img');
if (elem) { if (elem) {
logo && (elem.setAttribute('src', logo)); (logo || logoDark) && elem.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
elem.style.opacity = 1; elem.style.opacity = 1;
} }
} }

View file

@ -247,7 +247,8 @@
var params = getUrlParams(), var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0], lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null; logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];
@ -315,7 +316,7 @@
} else { } else {
var elem = document.querySelector('.loading-logo img'); var elem = document.querySelector('.loading-logo img');
if (elem) { if (elem) {
logo && (elem.setAttribute('src', logo)); (logo || logoDark) && elem.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
elem.style.opacity = 1; elem.style.opacity = 1;
} }
} }

View file

@ -262,7 +262,8 @@
var params = getUrlParams(), var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0], lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null; logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];
@ -334,7 +335,7 @@
} else { } else {
var elem = document.querySelector('.loading-logo img'); var elem = document.querySelector('.loading-logo img');
if (elem) { if (elem) {
logo && (elem.setAttribute('src', logo)); (logo || logoDark) && elem.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
elem.style.opacity = 1; elem.style.opacity = 1;
} }
} }

View file

@ -247,7 +247,8 @@
var params = getUrlParams(), var params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0], lang = (params["lang"] || 'en').split(/[\-\_]/)[0],
logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null; logo = params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : null,
logoDark = params["headerlogodark"] ? encodeUrlParam(params["headerlogodark"]) : null;
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];
@ -328,7 +329,7 @@
} else { } else {
var elem = document.querySelector('.loading-logo img'); var elem = document.querySelector('.loading-logo img');
if (elem) { if (elem) {
logo && (elem.setAttribute('src', logo)); (logo || logoDark) && elem.setAttribute('src', /theme-dark/.test(document.body.className) ? logoDark || logo : logo || logoDark);
elem.style.opacity = 1; elem.style.opacity = 1;
} }
} }