Browse Source

fixes and improves

improved post submit keys combination;
removed theme selector;
improved options internal mechanism;
master
Hedgehog 11 years ago
parent
commit
319ed4737e
  1. BIN
      css/orange/OpenSans-Bold.ttf
  2. BIN
      css/orange/OpenSans-Italic.ttf
  3. BIN
      css/orange/OpenSans-Regular.ttf
  4. BIN
      css/orange/OpenSansCondensed300.ttf
  5. 238
      css/orange/profile.css
  6. 1574
      css/orange/style.css
  7. 13
      css/style.css
  8. 45
      following.html
  9. 79
      home.html
  10. BIN
      img/wrapperBg.png
  11. 7
      js/calm.js
  12. 39
      js/interface_common.js
  13. 5
      js/interface_localization.js
  14. 18
      js/mobile_abstract.js
  15. 253
      js/options.js
  16. 11
      js/twister_formatpost.js
  17. 8
      js/twister_newmsgs.js
  18. 30
      login.html
  19. 49
      network.html
  20. 53
      options.html
  21. 10
      profile-edit.html

BIN
css/orange/OpenSans-Bold.ttf

Binary file not shown.

BIN
css/orange/OpenSans-Italic.ttf

Binary file not shown.

BIN
css/orange/OpenSans-Regular.ttf

Binary file not shown.

BIN
css/orange/OpenSansCondensed300.ttf

Binary file not shown.

238
css/orange/profile.css

@ -1,238 +0,0 @@ @@ -1,238 +0,0 @@
/**************************************
********************* PROFILE PHOTO ***
***************************************/
.profile-card
{
padding: 7px;
background: rgba( 255, 255, 255, .5 );
border: solid 1px rgba( 69, 71, 77, .05 );
position: relative;
}
.profile-card-main
{
width: 540px;
text-align: center;
position: relative;
transition: all .2s linear;
}
.profile-card-main:before
{
content: "";
border: solid 0px #fff;
transition: all .2s linear;
position: absolute;
left: 1px;
top: 1px;
right: 1px;
bottom: 1px;
z-index: 0;
}
.profile-card-main *
{
position: relative;
z-index: 1;
}
.profile-card-photo
{
width: 74px;
height: 74px;
border: solid 6px #45474d;
border-radius: 40%;
border-top-right-radius: 0;
border-bottom-left-radius: 0;
box-sizing: content-box;
float:left;
top: 50%;
background-color: #a12a28;
}
.profile-card-main h1
{
font-size: 24px;
font-weight: bold;
color: #fff;
}
.profile-card-main h2
{
color: #fff;
}
.profile-card .direct-messages,
.profile-card .direct-messages-with-user,
.profile-card .follow
{
display: block;
position: absolute;
bottom: 20px;
right: 10px;
padding: 10px;
font-size: 12px;
width: 120px;
text-align: center;
color: rgba( 0, 0, 0, .7 );
background: rgba( 0, 0, 0, .1 );
border: none;
transition: all .2s linear;
}
.profile-card .follow
{
right: 135px;
}
.profile-card .direct-messages:hover,
.profile-card .direct-messages-with-user:hover,
.profile-card .follow:hover
{
background: rgba( 0, 0, 0, .3 );
}
.profile-card.forEdition
{
margin: 0 auto;
width: 540px;
}
.forEdition .profile-card-photo
{
border: solid 2px #fff;
position: relative;
cursor: pointer;
transition: all .2s linear;
}
.forEdition .profile-card-main:hover:after,
.forEdition .profile-card-photo:after
{
content: "";
width: 36px;
height: 36px;
position: absolute;
top: 10px;
right: 10px;
background: url(../img/edit.png) no-repeat right top;
}
.forEdition .profile-card-main:hover:before
{
border: solid 5px #fff;
}
.forEdition .profile-card-main h2
{
margin-bottom: 8px;
}
.forEdition .profile-card-main input
{
display: block;
margin: 0 auto;
background: rgba( 0, 0, 0, .1 );
border: none;
padding: 6px 4px;
color: #fff;
margin-bottom: 4px;
text-align: center;
transition: all .2s linear;
}
.forEdition .profile-card-main input:hover,
.forEdition .profile-card-main input:focus,
.forEdition .profile-card-photo:hover
{
background: rgba( 0, 0, 0, .3 );
}
.input-description
{
width: 90%;
}
.input-name
{
font-size: 20px;
}
.forEdition .profile-card-main .input-website,
.forEdition .profile-card-main .input-city
{
display: inline-block;
}
.profile-edition-buttons
{
padding: 10px;
text-align: right;
}
/*************************************
****************** PROFILE MODAL
**************************************/
.profile-modal .modal-wrapper
{
width: 580px;
border-radius: 5px;
overflow: hidden;
position: absolute;
top:10%;
height: 80%;
margin-left: -300px;
}
.profile-modal .modal-content
{
padding: 3px;
height: 90%;
}
.profile-modal .profile-data
{
display: inline-block;
margin-left: -4px;
border-bottom: 0;
}
.profile-modal .postboard
{
margin-left: 0;
padding: 5px 0 5px 0;
height: 75%;
}
.profile-modal .postboard h2
{
width: auto;
}
.profile-modal .postboard-posts
{
display: block;
height: 90%;
overflow: auto;
}
.profile-modal .profile-card-main
{
background: #45474d;
color: white;
width:100%;
}
.profile-modal .profile-card-main a {
color: #8bb9e0;
}
.profile-modal .postboard-posts .post
{
padding: 0;
}
.profile-modal .post-interactions
{
margin: 2px 10px 3px 60px;
}
.profile-modal .profile-card
{
margin: 0;
padding: 0;
}
/*
.profile-card-main
{
height: 200px;
}
*/
.profile-modal .direct-messages,
.profile-modal .direct-messages-with-user,
.profile-modal .follow
{
bottom: 10px;
}
h1.profile-name {
display: inline;
}
h2.profile-screen-name {
display: inline;
}
.profile-modal .modal-buttons {
display: none;
}

1574
css/orange/style.css

File diff suppressed because it is too large Load Diff

13
css/style.css

@ -378,6 +378,19 @@ input.userMenu-search-field:focus::-ms-input-placeholder { @@ -378,6 +378,19 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
z-index: 1;
min-height: 100%;
}
.optionsPage:after, .profileEditPage:after, .loginPage:after
{
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: .05;
z-index: -1;
background: url('../img/wrapperBg.png') repeat;
}
.dashboard
{
width: 320px;

45
following.html

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
<script src="js/jquery.storageapi.js"></script>
<script src="js/jquery.a-tools-1.4.1.js"></script>
<script src="js/jquery.asuggest.js"></script>
<script src="js/options.js"></script>
<script src="js/mobile_abstract.js"></script>
<script src="js/twister_io.js"></script>
<script src="js/polyglot.min.js"></script>
@ -39,8 +40,7 @@ @@ -39,8 +40,7 @@
<body>
<!-- MENU SUPERIOR INIT Calm-->
<div style="display:none" class="calm_menu">
<!-- MENU SUPERIOR INIT-->
<nav class="userMenu">
<ul>
<li class="userMenu-home"><a href="home.html"></a></li>
@ -59,44 +59,9 @@ @@ -59,44 +59,9 @@
<!-- BUSCA -->
</ul>
</nav>
</div>
<!-- MENU SUPERIOR END Calm -->
<!-- MENU SUPERIOR INIT Original-->
<div style="display:none" class="original_menu">
<nav class="userMenu">
<ul>
<li class="userMenu-home"><a href="home.html">Home</a></li>
<li class="userMenu-network"><a href="network.html">Network</a></li>
<li class="userMenu-profile"><a href="profile-edit.html">Profile</a></li>
<li class="userMenu-config current">
<a class="userMenu-config-dropdown" href="#">
<div class="config-menu dialog-modal">
<div class="mini-profile-info">
<div class="mini-profile-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
<a href="#" class="mini-profile-name">Fulano da Silva</a>
<span class="mini-profile-view">View</span>
</div>
<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="network.html">Network config</a>
<a class="dropdown-menu-item" href="login.html">Change user</a>
<a class="direct-messages" href="#">Direct Messages</a>
</div>
</a>
</li>
<li class="userMenu-connections">
<a href="#">
<span class="messages-qtd" style="display:none;">12</span>
</a>
</li>
<li class="userMenu-messages">
<a href="#">
<span class="messages-qtd" style="display:none;">12</span>
</a>
</li>
</div>
<!-- MENU SUPERIOR END Original -->
<div class="wrapper">
<!-- MENU SUPERIOR END-->
<div class="wrapper followingPage">
<!-- LADO ESQUERDO DE MÓDULOS INIT -->
<div class="following">

79
home.html

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
<script src="js/jquery.storageapi.js"></script>
<script src="js/jquery.a-tools-1.4.1.js"></script>
<script src="js/jquery.asuggest.js"></script>
<script src="js/options.js"></script>
<script src="js/mobile_abstract.js"></script>
<script src="js/twister_io.js"></script>
<script src="js/polyglot.min.js"></script>
@ -29,14 +30,11 @@ @@ -29,14 +30,11 @@
<script src="js/interface_home.js"></script>
<script src="js/jquery.animate-colors-min.js"></script>
<script src="js/calm.js"></script>
<script src="js/options.js"></script>
<script src="jquery-emotions/jquery.emotions.js"></script>
<script src="js/sjcl.js"></script>
<script src="js/img.bi.js"></script>
<script>
$(function(){setInterval("networkUpdate()", 2000); homeIntInit();})
changeStyle();
InitOptionsforHome();
</script>
<link rel="icon" type="image/png" href="img/twister_mini.png" />
@ -44,8 +42,7 @@ @@ -44,8 +42,7 @@
<body>
<!-- MENU SUPERIOR INIT CALM-->
<div style="display:none" class="calm_menu">
<!-- MENU SUPERIOR INIT-->
<nav class="userMenu">
<ul>
<li class="userMenu-home"><a href="#"></a></li>
@ -95,82 +92,10 @@ @@ -95,82 +92,10 @@
</li>
</ul>
</div>
</li>
</ul>
</nav>
</div>
<!-- MENU SUPERIOR END -->
<!-- MENU SUPERIOR INIT ORIGINAL-->
<div style="display:none" class="original_menu">
<nav class="userMenu">
<ul>
<li class="userMenu-home current"><a href="#">Home</a></li>
<li class="userMenu-network"><a href="network.html">Network</a></li>
<li class="userMenu-profile"><a href="profile-edit.html">Profile</a></li>
<li class="userMenu-config">
<a class="userMenu-config-dropdown" href="#">
<div class="config-menu dialog-modal">
<div class="mini-profile-info">
<div class="mini-profile-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
<a href="#" class="mini-profile-name">Fulano da Silva</a>
<span class="mini-profile-view">View</span>
</div>
<a class="dropdown-menu-item" href="options.html">Options</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="network.html">Network config</a>
<a class="dropdown-menu-item" href="login.html">Change user</a>
<a class="dropdown-menu-item promoted-posts-only" href="#">Switch to Promoted posts</a>
<a class="direct-messages dropdown-menu-item" href="#">Direct Messages</a>
</div>
</a>
</li>
<li class="userMenu-connections">
<a href="#">
<span class="messages-qtd" style="display:none;">12</span>
</a>
</li>
<li class="userMenu-messages">
<a href="#">
<span class="messages-qtd" style="display:none;">12</span>
</a>
</li>
<!-- BUSCA -->
<li class="userMenu-search">
<input type="text" class="userMenu-search-field" placeholder="search"/>
<div class="search-results dialog-modal">
<ul class="userMenu-search-sugestions" style="display: none;">
<li><a href="#">Fulano</a></li>
<li><a href="#">Outro Fulano</a></li>
<li><a href="#">Mais outro</a></li>
</ul>
<ul class="userMenu-search-profiles">
<li id="search-profile-template" style="display: none;">
<div class="mini-profile-info" data-screen-name="">
<a href="#" class="open-profile-modal">
<img class="mini-profile-photo" src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/>
<span class="mini-screen-name">@<b></b></span>
<span class="mini-profile-name"></span>
</a>
<button class="follow">Follow</button>
</div>
</li>
</ul>
</div>
</li>
</ul>
</nav></div>
<!-- MENU SUPERIOR END ORIGINAL-->
<div class="wrapper">

BIN
img/wrapperBg.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

7
js/calm.js

@ -1,10 +1,15 @@ @@ -1,10 +1,15 @@
$(function(){
$('.post-text, #descWrap').on('click', 'a', function(e){e.stopPropagation();});
$('#showqr').on('click', function(){
if($('#qrcode img')[0]) return;
if($('#qrcode img')[0]) {
$('#qrcode').empty();
return;
};
var skey = document.getElementById('skey').innerText;
new QRCode(document.getElementById("qrcode"), skey);
});
$('.tox-ctc').on('click', function(){
window.prompt('Press Ctrl/Cmd+C to copy then Enter to close', $(this).attr('data'))
})

39
js/interface_common.js

@ -400,7 +400,7 @@ var unfocusThis = function() @@ -400,7 +400,7 @@ var unfocusThis = function()
}
function replyTextKeypress(e) {
e = e || event;
var e = e || event;
var $this = $( this );
var tweetForm = $this.parents("form");
if( tweetForm != undefined ) {
@ -418,21 +418,29 @@ function replyTextKeypress(e) { @@ -418,21 +418,29 @@ function replyTextKeypress(e) {
} else {
$.MAL.disableButton(tweetAction);
}
}
}
if(localStorage['keysSend'] == 1 && $('.dropdown-menu').css('display') == 'none'){
if (e.keyCode === 13 && (!e.metaKey && !e.ctrlKey)) {
$this.val($this.val().trim());
if( !tweetAction.hasClass("disabled")) {
tweetAction.click();
}
var replyTextSendKeys = function(e) {
var $this = $(this);
var tweetAction = $this.parents("form").find('.post-submit');
if($.Options.getOption('keysSend', 2) === 1){
if (!(e.metaKey || e.ctrlKey) && e.keyCode === 13) {
$this.val($this.val().trim());
if( !tweetAction.hasClass("disabled")) {
tweetAction.click();
}
}else if((e.metaKey || e.ctrlKey) && e.keyCode === 13){
e.preventDefault();
var val = $this.val();
$this.val(val += '\r')
}
}else if(localStorage['keysSend'] == 2){
if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) {
$this.val($this.val().trim());
if( !tweetAction.hasClass("disabled") ) {
tweetAction.click();
}
}else if($.Options.getOption('keysSend', 2) === 2){
if ((e.metaKey || e.ctrlKey) && e.keyCode === 13) {
$this.val($this.val().trim());
if( !tweetAction.hasClass("disabled") ) {
tweetAction.click();
}
}
}
@ -499,7 +507,8 @@ function initInterfaceCommon() { @@ -499,7 +507,8 @@ function initInterfaceCommon() {
$( ".modal-propagate").click( retweetSubmit );
var $replyText = $( ".post-area-new textarea" );
$replyText.on("keyup", replyTextKeypress );
$replyText.on('keyup', replyTextKeypress );
$replyText.on('keydown', replyTextSendKeys);
$( ".open-profile-modal").bind( "click", openProfileModal );
$( ".open-hashtag-modal").bind( "click", openHashtagModal );

5
js/interface_localization.js

@ -6,8 +6,7 @@ @@ -6,8 +6,7 @@
// translators: add your language code here such as "es" for Spanish, "ru" for Russian
var knownLanguages = ["en","es","nl","it","fr","ru","de","zh","ja","pt-BR","tr","uk"], preferredLanguage;
if(!localStorage['locLang'] || localStorage['locLang'] == 'auto'){
if(!localStorage['locLang']) localStorage['locLang'] = 'auto';
if($.Options.getOption('locLang', 'auto') === 'auto'){
// detect language with JavaScript
preferredLanguage = window.navigator.userLanguage || window.navigator.language || "en";
if(knownLanguages.indexOf(preferredLanguage) > -1){
@ -23,7 +22,7 @@ if(!localStorage['locLang'] || localStorage['locLang'] == 'auto'){ @@ -23,7 +22,7 @@ if(!localStorage['locLang'] || localStorage['locLang'] == 'auto'){
preferredLanguage = "en";
}
}else{
preferredLanguage = localStorage['locLang'];
preferredLanguage = $.Options.getOption('locLang', 'en');
}
// set up Polyglot
polyglot = new Polyglot();

18
js/mobile_abstract.js

@ -94,7 +94,7 @@ var MAL = function() @@ -94,7 +94,7 @@ var MAL = function()
newTweetsBar.text("Refresh");
}
} else {
var newTweetsBar = $(".postboard-news");
var newTweetsBar = $(".wrapper").find(".postboard-news");
if( newPosts ) {
document.title = "(" + String(newPosts) + ") twister";
newTweetsBar.text(String(newPosts) + " new posts");
@ -338,7 +338,7 @@ var MAL = function() @@ -338,7 +338,7 @@ var MAL = function()
$button.addClass("disabled");
$button.attr("disabled","true");
}
}
}
this.changedUser = function() {
if( $.hasOwnProperty("mobile") ) {
@ -351,6 +351,20 @@ var MAL = function() @@ -351,6 +351,20 @@ var MAL = function()
window.location.href = "home.html";
}
}
this.soundNotifyMentions = function() {
if( $.hasOwnProperty("mobile") ) {
} else {
$.Options.mensNotif();
}
}
this.soundNotifyDM = function() {
if( $.hasOwnProperty("mobile") ) {
} else {
$.Options.DMsNotif();
}
}
}
jQuery.MAL = new MAL;

253
js/options.js

@ -1,147 +1,146 @@ @@ -1,147 +1,146 @@
$(function() {
});
var TwisterOptions = function()
{
this.getOption = function(optionName, defaultValue) {
var keyName = 'options:' + optionName;
if ($.localStorage.isSet(keyName)) {
return $.localStorage.get(keyName);
}else{
return defaultValue;
}
};
function soundNotifOptions() {
if(!localStorage['sndDM']) localStorage['sndDM'] = false;
if(!localStorage['sndMention']) localStorage['sndMention'] = false;
$('.sndOpt').each(function(){
this.value = localStorage[this.id];
});
this.setOption = function(optionName, value) {
var keyName = 'options:' + optionName;
$.localStorage.set(keyName, value);
};
var player = $('#player');
player[0].pause();
$('#player').empty();
this.soundNotifOptions = function() {
$('.sndOpt').each(function(){
this.value = $.Options.getOption(this.id, 'false');
});
$('.sndOpt').on('change',function(){
localStorage.setItem(this.id, this.value);
var player = $('#player');
player[0].pause();
$('#player').empty();
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');
if(!localStorage[playerVol[0].id]) localStorage[playerVol[0].id] = 1;
playerVol[0].value = localStorage[playerVol[0].id];
$('.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());
});
}
$('.sndOpt').on('change',function(){
$.Options.setOption(this.id, this.value);
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();
}
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 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();
};
this.volumeControl = function() {
var playerVol = $('#playerVol');
function keysSend() {
if(!localStorage['keysSend']) localStorage['keysSend'] = 1;
$('#keysSend')[0].value = localStorage['keysSend'];
$('#keysSend').on('change', function(){
localStorage[this.id] = this.value;
})
}
playerVol[0].value = $.Options.getOption(playerVol[0].id, 1)
$('.volValue').text((playerVol[0].value * 100).toFixed());
playerVol.on('change',function(){
$.Options.setOption(this.id, this.value)
$('#player')[0].volume = (this.value);
$('.volValue').text((this.value * 100).toFixed());
});
}
function setLang() {
this.DMsNotif = function() {
if($.Options.getOption('sndDM', 'false') === "false") return;
var player = $('#player');
$('#player').empty();
$('#language').val(localStorage['locLang'] || 'auto')
$('#language').on('change', function(){
localStorage['locLang'] = $(this).val();
location.reload();
})
}
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 = $.Options.getOption('playerVol', 1);
player[0].play();
}
function setTheme() {
if(!localStorage['theme']) localStorage['theme'] = 'calm';
$('#theme').val(localStorage['theme']).on('change', function(){
localStorage['theme'] = $(this).val();
location.reload();
});
this.mensNotif = function() {
if($.Options.getOption('sndMention', 'false' === 'false')) return;
}
var player = $('#player');
$('#playerSec').empty();
function setShowPreviewOpt(){
if(!localStorage['imagesPreview']) localStorage['imagesPreview'] = 'enable';
if(!localStorage['imagesPreviewGif']) localStorage['imagesPreviewGif'] = 'true';
if(!localStorage['youtubePreview']) localStorage['youtubePreview'] = 'enable';
if(!localStorage['vimeoPreview']) localStorage['vimeoPreview'] = 'enable';
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 = $.Options.getOption('playerVol', 1);
player[0].play();
};
$('.previewOpt').each(function() {
this.value = localStorage[this.id];
})
$('.gifCheckBox').prop('checked', localStorage['imagesPreviewGif'] === 'true')
this.keysSend = function() {
$('#keysSend')[0].value = $.Options.getOption('keysSend', 2)
$('#keysSend').on('change', function(){
$.Options.setOption(this.id, this.value);
if(localStorage['imagesPreview'] == 'disable'){
$('input[type="checkbox"]').prop('disabled', localStorage['imagesPreviewGif'])
})
}
$('.previewOpt').on('change', function(){
localStorage[this.id] = $(this).val();
if (this.id === 'imagesPreview'){
switch($(this).val()){
case 'enable': $('.gifCheckBox').prop('disabled', false); break;
case 'disable': $('.gifCheckBox').prop('disabled', true); break;
}
this.locLang = function() {
$('#locLang').val($.Options.getOption('locLang', 'auto'))
$('#locLang').on('change', function(){
$.Options.setOption(this.id, this.value);
location.reload();
})
}
this.showPreviewOpt = function() {
$('.previewOpt').each(function() {
this.value = $.Options.getOption(this.id, 'enable');
})
$('.gifCheckBox').prop('checked', $.Options.getOption('imagesPreviewGif', 'true'))
if($.Options.getOption('imagesPreview', 'enable') === 'disable'){
$('input[type="checkbox"]').prop('disabled', 'true')
}
})
$('input[type="checkbox"]').on('click', function(){
localStorage[$(this).attr('name')] = $(this).prop('checked')
})
}
$('.previewOpt').on('change', function(){
$.Options.setOption(this.id, this.value)
if (this.id === 'imagesPreview'){
switch(this.value){
case 'enable': $('.gifCheckBox').prop('disabled', false); break;
case 'disable': $('.gifCheckBox').prop('disabled', true); break;
}
}
})
$('input[type="checkbox"]').on('click', function(){
$.Options.setOption(this.name, this.checked)
})
}
this.initOptions = function() {
this.soundNotifOptions();
this.volumeControl();
this.keysSend();
this.locLang();
this.showPreviewOpt();
}
function InitOptions() {
soundNotifOptions();
volumeControl();
keysSend();
setLang();
setTheme();
setShowPreviewOpt();
}
function InitOptionsforHome() {
setShowPreviewOpt();
}
jQuery.Options = new TwisterOptions;

11
js/twister_formatpost.js

@ -107,15 +107,15 @@ function postToElem( post, kind ) { @@ -107,15 +107,15 @@ function postToElem( post, kind ) {
var ytRegExp = /(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?/i;
var vimeoRegExp = /http[s]?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/i;
if (postLink && localStorage['imagesPreview'] == 'enable' && (/(\.jpg)|(\.gif)|(\.png)|(\.jpeg)|(\.jpe)/i.test(postLink) || /https:\/\/img.bi/i.test(postLink))){
if (postLink && $.Options.getOption('imagesPreview', 'enable') === 'enable' && (/(\.jpg)|(\.gif)|(\.png)|(\.jpeg)|(\.jpe)/i.test(postLink) || /https:\/\/img.bi/i.test(postLink))){
previewContainer.show();
previewContainer.append(imagePreview(postLink));
}else if(postLink && ytRegExp.test(postLink) && localStorage['youtubePreview'] === 'enable'){
}else if(postLink && ytRegExp.test(postLink) && $.Options.getOption('youtubePreview', 'enable') === 'enable'){
var ytid = postLink.match(ytRegExp) ? RegExp.$1 : false;
previewContainer.show();
previewContainer.attr('data-youtube-id', ytid);
previewContainer.append(getYoutubePreview(postLink, ytid));
}else if(postLink && vimeoRegExp.test(postLink) && localStorage['vimeoPreview'] === 'enable'){
}else if(postLink && vimeoRegExp.test(postLink) && $.Options.getOptions('vimeoPreview', 'enable') === 'enable'){
var vimid = postLink.match(vimeoRegExp) ? RegExp.$2 : false;
previewContainer.show();
previewContainer.attr('data-vimeo-id', vimid);
@ -314,8 +314,9 @@ function imagePreview(link) { @@ -314,8 +314,9 @@ function imagePreview(link) {
return '<img data-imgbi="'+link+'" class="image-preview" />';
//imgBiJS();
}else{
var cleanLink = link.replace(/^http[s]?:\/\//i, '');
if(/\.gif\b/i.test(cleanLink) && localStorage['imagesPreviewGif'] == 'false') return;
var cleanLink;
if(/\.gif\b/i.test(cleanLink) && $.Options.getOption('imagesPreviewGif', 'true') === 'false') return;
cleanLink = link.replace(/^http[s]?:\/\//i, '');
return '<img src="'+linkAnon+cleanLink+'" class="image-preview" />';
}
}

8
js/twister_newmsgs.js

@ -18,17 +18,21 @@ function processMention(user, mentionTime, data) { @@ -18,17 +18,21 @@ function processMention(user, mentionTime, data) {
if( mentionTime > curTime + 3600 ) {
console.log("mention from the future will be ignored");
} else {
var newMentionsUpdated = false;
if( !(key in _knownMentions) ) {
mensNotif(); // sound notification
// mention must be somewhat recent compared to last known one to be considered new
if( mentionTime + 3600 > _lastMentionTime ) {
_newMentions++;
newMentionsUpdated = true;
_lastMentionTime = mentionTime;
}
_knownMentions[key] = {mentionTime:mentionTime, data:data};
purgeOldMentions();
saveMentionsToStorage();
}
if(newMentionsUpdated){
$.MAL.soundNotifyMentions();
}
}
}
@ -158,7 +162,7 @@ function getNewDMsCount() { @@ -158,7 +162,7 @@ function getNewDMsCount() {
}
}
for (key in _newDMsPerUser){if(_newDMsPerUser[key] * 1)reslt = true};
if(newDMs > 0 && reslt) DMsNotif(); //sound notification
if(newDMs > 0 && reslt) $.MAL.soundNotifyDM();
return newDMs;
}

30
login.html

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
<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/options.js"></script>
<script src="js/mobile_abstract.js"></script>
<script src="js/twister_io.js"></script>
<script src="js/twister_network.js"></script>
@ -19,7 +20,6 @@ @@ -19,7 +20,6 @@
<script src="js/interface_login.js"></script>
<script src="js/polyglot.min.js"></script>
<script src="js/interface_localization.js"></script>
<script src="js/options.js"></script>
<script src="js/calm.js"></script>
<script>
@ -32,8 +32,7 @@ @@ -32,8 +32,7 @@
<body>
<!-- MENU SUPERIOR INIT CALM -->
<div style="display:none" class="calm_menu">
<!-- MENU SUPERIOR INIT-->
<nav class="userMenu">
<ul>
<li class="userMenu-home"><a href="home.html"></a></li>
@ -49,32 +48,11 @@ @@ -49,32 +48,11 @@
</div>
</a>
</li>
</ul>
</nav>
</div>
<!-- MENU SUPERIOR END CALM-->
<!-- MENU SUPERIOR INIT Original-->
<div style="display:none" class="original_menu">
<nav class="userMenu">
<ul>
<li class="userMenu-home"><a href="home.html">Home</a></li>
<li class="userMenu-network"><a href="network.html">Network</a></li>
<li class="userMenu-profile current"><a href="login.html">Login</a></li>
<li class="userMenu-config">
</li>
</ul>
</nav>
</div>
<!-- MENU SUPERIOR END Original-->
<!-- MENU SUPERIOR END-->
<div class="wrapper">
<div class="wrapper loginPage">
<!-- LADO ESQUERDO DE MÓDULOS INIT -->
<div class="login">

49
network.html

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
<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/options.js"></script>
<script src="js/mobile_abstract.js"></script>
<script src="js/twister_io.js"></script>
<script src="js/twister_user.js"></script>
@ -33,8 +34,7 @@ @@ -33,8 +34,7 @@
<body>
<!-- MENU SUPERIOR INIT Calm -->
<div style="display:none" class="calm_menu">
<!-- MENU SUPERIOR INIT-->
<nav class="userMenu">
<ul>
<li class="userMenu-home"><a href="home.html"></a></li>
@ -52,50 +52,7 @@ @@ -52,50 +52,7 @@
</li>
</ul>
</nav>
</div>
<!-- MENU SUPERIOR END CALM-->
<!-- MENU SUPERIOR INIT -->
<div style="display:none" class="original_menu">
<nav class="userMenu">
<ul>
<li class="userMenu-home"><a href="home.html">Home</a></li>
<li class="userMenu-network current"><a href="network.html">Network</a></li>
<li class="userMenu-profile"><a href="profile-edit.html">Profile</a></li>
<li class="userMenu-config">
<a class="userMenu-config-dropdown" href="#">
<div class="config-menu dialog-modal">
<div class="mini-profile-info">
<div class="mini-profile-photo"><img src="img/grayed_avatar_placeholder_24.png" alt="user-photo"/></div>
<a href="#" class="mini-profile-name">Fulano da Silva</a>
<span class="mini-profile-view">View</span>
</div>
<a class="dropdown-menu-item" href="options.html">Options</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="network.html">Network config</a>
<a class="dropdown-menu-item" href="login.html">Change user</a>
<a class="direct-messages" href="#">Direct Messages</a>
</div>
</a>
</li>
<li class="userMenu-connections">
<a href="#">
<span class="messages-qtd" style="display:none;">12</span>
</a>
</li>
<li class="userMenu-messages">
<a href="#">
<span class="messages-qtd" style="display:none;">12</span>
</a>
</li>
<li class="userMenu-search">
<input type="text" class="userMenu-search-field" placeholder="search"/>
</li>
</ul>
</nav>
</div>
<!-- MENU SUPERIOR END -->
<!-- MENU SUPERIOR END-->
<div class="wrapper">

53
options.html

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
<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/options.js"></script>
<script src="js/mobile_abstract.js"></script>
<script src="js/twister_io.js"></script>
<script src="js/twister_network.js"></script>
@ -20,17 +21,17 @@ @@ -20,17 +21,17 @@
<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()});
changeStyle();
$(function(){
initInterfaceCommon();
$.Options.initOptions()
});
</script>
</head>
<body>
<!-- MENU SUPERIOR INIT Calm-->
<div style="display:none" class="calm_menu">
<!-- MENU SUPERIOR INIT-->
<nav class="userMenu">
<ul>
<li class="userMenu-home"><a href="home.html"></a></li>
@ -48,36 +49,14 @@ @@ -48,36 +49,14 @@
</li>
</ul>
</nav>
</div>
<!-- MENU SUPERIOR END Calm-->
<!-- MENU SUPERIOR INIT Original-->
<div style="display:none" class="original_menu">
<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>
<!-- MENU SUPERIOR END Original-->
<!-- MENU SUPERIOR END-->
<div class="wrapper optionsPage">
<div class="module">
<h1>Use language</h1>
<div>
<select name="" id="language">
<select name="" id="locLang">
<option value="auto">Auto</option>
<option value="pt-BR">Braz. Portuguese</option>
<option value="zh">Chinese</option>
@ -94,16 +73,6 @@ @@ -94,16 +73,6 @@
</div>
</div>
<div class="module">
<h1>Theme</h1>
<div>
<select name="" id="theme">
<option value="calm">Calm</option>
<option value="original">Original</option>
</select>
</div>
</div>
<div class="module">
<h1>Sound notifications</h1>
<h2>Mentions</h2>
@ -141,19 +110,19 @@ @@ -141,19 +110,19 @@
<h1>Media links preview</h1>
<h2>Images preview</h2>
<select name="" id="imagesPreview" class="previewOpt">
<option value="disable">Disable</option>
<option value="enable">Enable</option>
<option value="disable">Disable</option>
</select>
<label><span>Display GIF images</span><input class="gifCheckBox" type="checkbox" name="imagesPreviewGif"></label>
<h2>Youtube links preview</h2>
<select name="" id="youtubePreview" class="previewOpt">
<option value="disable">Disable</option>
<option value="enable">Enable</option>
<option value="disable">Disable</option>
</select>
<h2>Vimeo links preview</h2>
<select name="" id="vimeoPreview" class="previewOpt">
<option value="disable">Disable</option>
<option value="enable">Enable</option>
<option value="disable">Disable</option>
</select>
</div>

10
profile-edit.html

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
<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/options.js"></script>
<script src="js/mobile_abstract.js"></script>
<script src="js/twister_io.js"></script>
<script src="js/polyglot.min.js"></script>
@ -54,7 +55,7 @@ @@ -54,7 +55,7 @@
<!-- MENU SUPERIOR END -->
<div class="wrapper">
<div class="wrapper profileEditPage">
<!-- ÁREA DE PROFILE PHOTO INIT -->
<div class="profile-card forEdition">
@ -76,11 +77,12 @@ @@ -76,11 +77,12 @@
</div>
<div style="font-size:80%;text-align: center;" class="secret-key-container">
<span class="label">Secret key:</span> <div id="skey"><span class="secret-key"></span></div>
<button href="#" id="showqr">Show QR code</button>
<span class="label">Secret key:</span> <div id="skey"><span class="secret-key"></span></div>
<button href="#" id="showqr">Show QR code</button>
<div align="center" id="qrcode"></div>
</div>
<div align="center" id="qrcode"></div>
</div>

Loading…
Cancel
Save