change files order, new DHT indicator in top menu, ‘back’ button in DM conversations, sound notifications (alpha) and new page ‘Options’, few fixesmaster
@ -1,10 +0,0 @@ |
|||||||
$(function(){ |
|
||||||
$('.post-text').on('click', 'a', function(e){ |
|
||||||
e.stopPropagation(); |
|
||||||
}); |
|
||||||
|
|
||||||
$(".cancel").on('click', function(e){ |
|
||||||
if($(".modal-content").attr("style") != undefined){$(".modal-content").removeAttr("style")}; |
|
||||||
|
|
||||||
}) |
|
||||||
}) |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 475 B After Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 309 B After Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 134 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 511 B After Width: | Height: | Size: 511 B |
@ -0,0 +1,122 @@ |
|||||||
|
$(function(){ |
||||||
|
$('.post-text').on('click', 'a', function(e){ |
||||||
|
e.stopPropagation(); |
||||||
|
}); |
||||||
|
|
||||||
|
$('#showqr').on('click', function(){ |
||||||
|
if($('#qrcode img')[0]) return; |
||||||
|
var skey = document.getElementById('skey').innerText; |
||||||
|
new QRCode(document.getElementById("qrcode"), skey); |
||||||
|
}); |
||||||
|
|
||||||
|
function dhtIndicatorBg(){ |
||||||
|
var bgcolor = ''; |
||||||
|
if(twisterDhtNodes <= 10){bgcolor = '#770900' |
||||||
|
}else if(twisterDhtNodes <= 20){bgcolor = '#773400' |
||||||
|
}else if(twisterDhtNodes <= 30){bgcolor = '#774c00' |
||||||
|
}else if(twisterDhtNodes <= 40){bgcolor = '#776400' |
||||||
|
}else if(twisterDhtNodes <= 50){bgcolor = '#707500' |
||||||
|
}else if(twisterDhtNodes <= 60){bgcolor = '#3f6900' |
||||||
|
}else if(twisterDhtNodes <= 70){bgcolor = '#005f15' |
||||||
|
}else if(twisterDhtNodes >= 71){bgcolor = '#009922' |
||||||
|
} |
||||||
|
$('.userMenu-dhtindicator').animate({'background-color': bgcolor }); |
||||||
|
}; |
||||||
|
setTimeout(dhtIndicatorBg, 300); |
||||||
|
setTimeout(function() {setInterval(dhtIndicatorBg, 2000)}, 400); |
||||||
|
}) |
||||||
|
|
||||||
|
function modalDMIntr () { |
||||||
|
$(".cancel").on('click', function(event){ |
||||||
|
if(!$(event.target).hasClass("cancel")) return; |
||||||
|
if($(".modal-content").attr("style") != undefined){$(".modal-content").removeAttr("style")}; |
||||||
|
$('.modal-back').css('display', 'none'); |
||||||
|
}); |
||||||
|
$('.modal-back').on('click', function(){ |
||||||
|
if($('.modal-content .direct-messages-list')[0]) return; |
||||||
|
directMessagesPopup(); |
||||||
|
$(".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(); |
||||||
|
// setTimeout('player[0].pause', 1000);
|
||||||
|
} |
||||||
|
|
||||||
|
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(); |
||||||
|
// setTimeout('player[0].pause', 1000);
|
||||||
|
}; |
||||||
|
function InitOptions () { |
||||||
|
soundNotifOptions(); |
||||||
|
volumeControl(); |
||||||
|
} |
||||||
|
function homeIntInit () { |
||||||
|
modalDMIntr (); |
||||||
|
} |
@ -0,0 +1,84 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"/> |
||||||
|
<title>twister login</title> |
||||||
|
<link rel="stylesheet" href="css/style.css" type="text/css"/> |
||||||
|
<script src="js/jquery.min.js"></script> |
||||||
|
<script src="js/jQueryPlugins.js"></script> |
||||||
|
<script src="js/jquery.json-2.4.js"></script> |
||||||
|
<script src="js/jquery.jsonrpcclient.js"></script> |
||||||
|
<script src="js/jquery.storageapi.js"></script> |
||||||
|
<script src="js/mobile_abstract.js"></script> |
||||||
|
<script src="js/twister_io.js"></script> |
||||||
|
<script src="js/twister_network.js"></script> |
||||||
|
<script src="js/twister_user.js"></script> |
||||||
|
<script src="js/interface_common.js"></script> |
||||||
|
<script src="js/interface_login.js"></script> |
||||||
|
<script src="js/polyglot.min.js"></script> |
||||||
|
<script src="js/interface_localization.js"></script> |
||||||
|
<script src="js/calm.js"></script> |
||||||
|
<script src="js/options.js"></script> |
||||||
|
<script>$(function(){ |
||||||
|
initInterfaceCommon(); |
||||||
|
InitOptions();}) |
||||||
|
</script> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body> |
||||||
|
|
||||||
|
<!-- MENU SUPERIOR INIT --> |
||||||
|
<nav class="userMenu"> |
||||||
|
<ul> |
||||||
|
<li class="userMenu-home"><a href="home.html"></a></li> |
||||||
|
<li class="userMenu-options current"><a href="options.html">Options</a></li> |
||||||
|
<li class="userMenu-config"> |
||||||
|
<a class="userMenu-config-dropdown" href="#"> |
||||||
|
<div class="config-menu dialog-modal"> |
||||||
|
<a class="dropdown-menu-item" href="options.html">Options</a> |
||||||
|
<a class="dropdown-menu-item" href="network.html">Network config</a> |
||||||
|
<a class="dropdown-menu-item" href="profile-edit.html">Setup account</a> |
||||||
|
<a class="dropdown-menu-item" href="following.html">Following users</a> |
||||||
|
<a class="dropdown-menu-item" href="login.html">Change user</a> |
||||||
|
</div> |
||||||
|
</a> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
</nav> |
||||||
|
|
||||||
|
<div class="wrapper"> |
||||||
|
|
||||||
|
<div class="sounds"> |
||||||
|
|
||||||
|
<div class="module"> |
||||||
|
<p> Sound notifications </p> |
||||||
|
<div> |
||||||
|
<form action="" id="notifyForm"> |
||||||
|
<p>Mentions</p> |
||||||
|
<select name="" id="sndMention" class="sndOpt"> |
||||||
|
<option value="false">none</option> |
||||||
|
<option value="1">beat</option> |
||||||
|
<option value="2">pip</option> |
||||||
|
<option value="3">vibro</option> |
||||||
|
<option value="4">flip</option> |
||||||
|
<option value="5">click</option> |
||||||
|
</select><br> |
||||||
|
<p>Direct messages</p> |
||||||
|
<select name="" id="sndDM" class="sndOpt"> |
||||||
|
<option value="false">none</option> |
||||||
|
<option value="1">beat</option> |
||||||
|
<option value="2">pip</option> |
||||||
|
<option value="3">vibro</option> |
||||||
|
<option value="4">flip</option> |
||||||
|
<option value="5">click</option> |
||||||
|
</select> |
||||||
|
<input type="range" name="playerVol" id="playerVol" min="0" max="1" step="0.01"><span class="volValue">0</span> |
||||||
|
</form> |
||||||
|
<audio id="player"></audio> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |