Browse Source

integrate original theme nin

pull/15/head
D4708 4 years ago
parent
commit
4eb5c10e0f
  1. 6
      js/interface_common.js
  2. 16
      js/twister_io.js

6
js/interface_common.js

@ -2747,6 +2747,12 @@ function changeStyle() { @@ -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';

16
js/twister_io.js

@ -425,8 +425,20 @@ function getAvatar(peerAlias, img) { @@ -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;
}

Loading…
Cancel
Save