diff --git a/abort.html b/abort.html index 67526c8..2823869 100644 --- a/abort.html +++ b/abort.html @@ -3,18 +3,9 @@ Aborting... - + + + @@ -28,7 +19,7 @@ if (theme=='calm') { - + diff --git a/css/style.css b/css/style.css index 0ac4d77..13bbf39 100644 --- a/css/style.css +++ b/css/style.css @@ -1429,7 +1429,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder { background: #fff; transition: background-color 100ms linear; } -.login .module select.local-usernames, .sndOpt, #keysOpt select, #choseLanguage select{ +.login .module select.local-usernames, .sndOpt, #keysOpt select, #selectLanguage select, #selectTheme select { height: 30px; font: 13px/24px "Open sans"; text-align: center; @@ -1909,7 +1909,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder { margin-right: -163px; font: 12px "Open Sans", sans-serif; } -#notifyForm p, #choseLanguage p, #keysOpt p { +#notifyForm p, #selectLanguage p, #keysOpt p { margin-top: 15px; } /* Following page */ diff --git a/following.html b/following.html index ce35159..a1b39b3 100644 --- a/following.html +++ b/following.html @@ -3,18 +3,9 @@ Following - + + + @@ -35,10 +26,8 @@ if (theme=='calm') { diff --git a/home.html b/home.html index edfe9c2..3af26de 100644 --- a/home.html +++ b/home.html @@ -3,6 +3,9 @@ twister + + + @@ -28,20 +31,9 @@ - @@ -528,14 +520,5 @@ $(".userMenu-dhtindicator").hide(); - diff --git a/js/calm.js b/js/calm.js index 23f030a..60b0bbe 100644 --- a/js/calm.js +++ b/js/calm.js @@ -42,89 +42,6 @@ function modalDMIntr() { $(".modal-content").removeAttr("style"); }); }; -//sound notifications - -function soundNotifOptions() { - if(!localStorage['sndDM']) localStorage['sndDM'] = false; - if(!localStorage['sndMention']) localStorage['sndMention'] = false; - $('#notifyForm select').each(function(){ - this.value = localStorage[this.id]; - }); - - var player = $('#player'); - player[0].pause(); - $('#player').empty(); - - - $('form#notifyForm').on('change','select',function(){ - localStorage.setItem(this.id, this.value); - - if(this.value == false) {player[0].pause(); return;} - if (player[0].canPlayType('audio/mpeg;')) { - player.attr('type', 'audio/mpeg'); - player.attr('src', 'sound/'+this.value+'.mp3'); - } else { - player.attr('type', 'audio/ogg'); - player.attr('src', 'sound/'+this.value+'.ogg'); - } - - player[0].play(); - }); -} - -function volumeControl () { - var playerVol = $('#playerVol'); - playerVol[0].value = localStorage[playerVol[0].id] ? localStorage[playerVol[0].id] : 100; - $('.volValue').text((localStorage[playerVol[0].id] * 100).toFixed()); - - playerVol.on('change',function(){ - localStorage.setItem(this.id, this.value); - $('#player')[0].volume = (this.value); - $('.volValue').text((this.value * 100).toFixed()); - }); -} - -function DMsNotif() { - if(localStorage['sndDM'] == "false") return; - var player = $('#player'); - $('#player').empty(); - - if (player[0].canPlayType('audio/mpeg;')) { - player.attr('type', 'audio/mpeg'); - player.attr('src', 'sound/'+localStorage['sndDM']+'.mp3'); - } else { - player.attr('type', 'audio/ogg'); - player.attr('src', 'sound/'+localStorage['sndDM']+'.ogg'); - } - player[0].volume = localStorage['playerVol']; - player[0].play(); -} - -function mensNotif() { - if(localStorage['sndMention'] == "false") return; - var player = $('#player'); - $('#playerSec').empty(); - - if (player[0].canPlayType('audio/mpeg;')) { - player.attr('type', 'audio/mpeg'); - player.attr('src', 'sound/'+localStorage['sndMention']+'.mp3'); - } else { - player.attr('type', 'audio/ogg'); - player.attr('src', 'sound/'+localStorage['sndMention']+'.ogg'); - } - player[0].volume = localStorage['playerVol']; - player[0].play(); -}; - -function keysSend() { - if(!localStorage['keysSend']) localStorage['keysSend'] = 1; - $('#keysOpt select')[0].value = localStorage['keysSend']; - - $('#keysOpt select').on('change', function(){ - localStorage[this.id] = this.value; - - }) -} function mensAutocomplete() { var suggests = []; @@ -151,20 +68,25 @@ function mensAutocomplete() { ]) } -function setLang() { - - $('#language').val(localStorage['locLang'] || 'auto') - $('#language').on('change', function(){ - localStorage['locLang'] = $(this).val(); - }) +function changeStyle() { + var style, profile, menu; + if(localStorage['theme'] == 'calm') + { + style = 'css/style.css'; + profile = 'css/profile.css'; + menu = '.calm_menu'; + }else if(localStorage['theme'] == 'original') + { + style = 'css/orange/style.css'; + profile = 'css/orange/profile.css'; + menu = '.original_menu'; + $(".userMenu-dhtindicator").hide(); + } + $('#stylecss').attr('href', style); + $('#profilecss').attr('href', profile); + setTimeout(function(){$(menu).removeAttr('style')}, 0); } -function InitOptions () { - soundNotifOptions(); - volumeControl(); - keysSend(); - setLang(); -} function homeIntInit () { modalDMIntr (); setTimeout(mensAutocomplete, 800); diff --git a/js/options.js b/js/options.js index d9286d5..aab97c7 100644 --- a/js/options.js +++ b/js/options.js @@ -1,3 +1,110 @@ $(function() { }); + +function soundNotifOptions() { + if(!localStorage['sndDM']) localStorage['sndDM'] = false; + if(!localStorage['sndMention']) localStorage['sndMention'] = false; + $('#notifyForm select').each(function(){ + this.value = localStorage[this.id]; + }); + + var player = $('#player'); + player[0].pause(); + $('#player').empty(); + + + $('form#notifyForm').on('change','select',function(){ + localStorage.setItem(this.id, this.value); + + if(this.value == false) {player[0].pause(); return;} + if (player[0].canPlayType('audio/mpeg;')) { + player.attr('type', 'audio/mpeg'); + player.attr('src', 'sound/'+this.value+'.mp3'); + } else { + player.attr('type', 'audio/ogg'); + player.attr('src', 'sound/'+this.value+'.ogg'); + } + + player[0].play(); + }); +} + +function volumeControl () { + var playerVol = $('#playerVol'); + playerVol[0].value = localStorage[playerVol[0].id] ? localStorage[playerVol[0].id] : 100; + $('.volValue').text((localStorage[playerVol[0].id] * 100).toFixed()); + + playerVol.on('change',function(){ + localStorage.setItem(this.id, this.value); + $('#player')[0].volume = (this.value); + $('.volValue').text((this.value * 100).toFixed()); + }); +} + +function DMsNotif() { + if(localStorage['sndDM'] == "false") return; + var player = $('#player'); + $('#player').empty(); + + if (player[0].canPlayType('audio/mpeg;')) { + player.attr('type', 'audio/mpeg'); + player.attr('src', 'sound/'+localStorage['sndDM']+'.mp3'); + } else { + player.attr('type', 'audio/ogg'); + player.attr('src', 'sound/'+localStorage['sndDM']+'.ogg'); + } + player[0].volume = localStorage['playerVol']; + player[0].play(); +} + +function mensNotif() { + if(localStorage['sndMention'] == "false") return; + var player = $('#player'); + $('#playerSec').empty(); + + if (player[0].canPlayType('audio/mpeg;')) { + player.attr('type', 'audio/mpeg'); + player.attr('src', 'sound/'+localStorage['sndMention']+'.mp3'); + } else { + player.attr('type', 'audio/ogg'); + player.attr('src', 'sound/'+localStorage['sndMention']+'.ogg'); + } + player[0].volume = localStorage['playerVol']; + player[0].play(); +}; + +function keysSend() { + if(!localStorage['keysSend']) localStorage['keysSend'] = 1; + $('#keysOpt select')[0].value = localStorage['keysSend']; + + $('#keysOpt select').on('change', function(){ + localStorage[this.id] = this.value; + + }) +} + +function setLang() { + + $('#language').val(localStorage['locLang'] || 'auto') + $('#language').on('change', function(){ + localStorage['locLang'] = $(this).val(); + }) +} + +function setTheme() { + if(!localStorage['theme']) localStorage['theme'] = 'calm'; + $('#theme').val(localStorage['theme']).on('change', function(){ + localStorage['theme'] = $(this).val(); + location.reload(); + }); + +} + +function InitOptions () { + soundNotifOptions(); + volumeControl(); + keysSend(); + setLang(); + setTheme(); +} \ No newline at end of file diff --git a/login.html b/login.html index 9c4d538..187426e 100644 --- a/login.html +++ b/login.html @@ -3,18 +3,9 @@ twister login - + + + @@ -31,10 +22,8 @@ if (theme=='calm') { diff --git a/network.html b/network.html index 9652ddd..6a1af31 100644 --- a/network.html +++ b/network.html @@ -3,18 +3,9 @@ Network status - + + + @@ -33,10 +24,8 @@ if (theme=='calm') { diff --git a/options.html b/options.html index d5c1299..3d09917 100644 --- a/options.html +++ b/options.html @@ -2,19 +2,10 @@ - twister login - + Options + + + @@ -30,16 +21,9 @@ if (theme=='calm') { - @@ -71,7 +55,7 @@ if (theme=='calm') {

Use language

-
+ + + + +
+
+
+
@@ -131,23 +129,7 @@ if (theme=='calm') {
- -
-
-

Theme

-
- - -
-
- diff --git a/profile-edit.html b/profile-edit.html index 6174e38..bda938b 100644 --- a/profile-edit.html +++ b/profile-edit.html @@ -2,18 +2,9 @@ Edit profile - + + + @@ -33,10 +24,8 @@ if (theme=='calm') {