From 4eb5c10e0f374b083c0ea4c0a039571865509c1c Mon Sep 17 00:00:00 2001 From: D4708 Date: Mon, 10 May 2021 01:32:15 +0300 Subject: [PATCH] integrate original theme nin --- js/interface_common.js | 6 ++++++ js/twister_io.js | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index 1c3d725..a9b1098 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -2747,6 +2747,12 @@ function changeStyle() { // we use .ajax because .getScript requires 'unsafe-inline' CSP rule for now, see https://github.com/jquery/jquery/issues/3969 $.ajax({dataType: 'text', url: 'theme_nin/js/theme_option.js'}) .done(function(res) {eval(res);}); + } else if (theme === 'nin_original') { + theme = 'nin'; // related to native theme in class definitions, so easiest way to integrate original version + style = 'theme_nin_original/css/style.css'; + profile = 'theme_nin_original/css/profile.css'; + $.ajax({dataType: 'text', url: 'theme_nin_original/js/theme_option.js'}) + .done(function(res) {eval(res);}); } else if (theme === 'calm') { style = 'theme_calm/css/style.css'; profile = 'theme_calm/css/profile.css'; diff --git a/js/twister_io.js b/js/twister_io.js index dc4c3f2..ea39f16 100644 --- a/js/twister_io.js +++ b/js/twister_io.js @@ -425,8 +425,20 @@ function getAvatar(peerAlias, img) { return; if (peerAlias === 'nobody') { - img.attr('src', ($.Options.theme.val === 'nin') ? - 'theme_nin/img/tornado_avatar.png' : 'img/tornado_avatar.png'); + + var avatar = 'img/tornado_avatar.png'; + + switch ($.Options.theme.val) { + case 'nin': + avatar = 'theme_nin/img/tornado_avatar.png'; + break; + case 'nin_original': + avatar = 'theme_nin_original/img/tornado_avatar.png'; + break; + } + + img.attr('src', avatar); + return; }