diff --git a/css/style.css b/css/style.css index ab7eecb..ef26224 100644 --- a/css/style.css +++ b/css/style.css @@ -1412,7 +1412,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder { background: #fff; transition: background-color 100ms linear; } -.login .module select.local-usernames, .sndOpt { +.login .module select.local-usernames, .sndOpt, #keysOpt select{ height: 30px; font: 13px/24px "Open sans"; text-align: center; diff --git a/js/calm.js b/js/calm.js index 8aefbff..fef9eb4 100644 --- a/js/calm.js +++ b/js/calm.js @@ -26,7 +26,7 @@ $(function(){ setTimeout(function() {setInterval(dhtIndicatorBg, 2000)}, 400); }) -function modalDMIntr () { +function modalDMIntr() { $(".cancel").on('click', function(event){ if(!$(event.target).hasClass("cancel")) return; if($(".modal-content").attr("style") != undefined){$(".modal-content").removeAttr("style")}; @@ -40,7 +40,7 @@ function modalDMIntr () { }; //sound notifications -function soundNotifOptions () { +function soundNotifOptions() { if(!localStorage['sndDM']) localStorage['sndDM'] = false; if(!localStorage['sndMention']) localStorage['sndMention'] = false; $('#notifyForm select').each(function(){ @@ -110,11 +110,21 @@ function mensNotif() { } player[0].volume = localStorage['playerVol']; player[0].play(); - // setTimeout('player[0].pause', 1000); }; + +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 InitOptions () { soundNotifOptions(); volumeControl(); + keysSend(); } function homeIntInit () { modalDMIntr (); diff --git a/js/interface_common.js b/js/interface_common.js index c129303..fba6c6d 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -386,14 +386,28 @@ function replyTextKeypress(e) { $.MAL.disableButton(tweetAction); } - if (e.keyCode === 13) { - if (!e.ctrlKey) { + if(localStorage['keysSend'] == 1){ + if (e.keyCode === 13 && (!e.metaKey && !e.ctrlKey)) { $this.val($this.val().trim()); if( !tweetAction.hasClass("disabled") ) { tweetAction.click(); + if($this.parent().parent().is('.post-area,.post-reply-content')){ + $this.parent().removeClass('open'); + $this.blur(); + } + } + } + }else if(localStorage['keysSend'] == 2){ + if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) { + + $this.val($this.val().trim()); + if( !tweetAction.hasClass("disabled") ) { + tweetAction.click(); + if($this.parent().parent().is('.post-area,.post-reply-content')){ + $this.parent().removeClass('open'); + $this.blur(); + } } - } else { - $this.val($this.val() + "\r"); } } } @@ -456,7 +470,7 @@ function initInterfaceCommon() { $( ".modal-propagate").click( retweetSubmit ); var $replyText = $( ".post-area-new textarea" ); - $replyText.keyup( replyTextKeypress ); + $replyText.on("keydown", replyTextKeypress ); $( ".open-profile-modal").bind( "click", openProfileModal ); $( ".open-hashtag-modal").bind( "click", openHashtagModal ); diff --git a/js/interface_localization.js b/js/interface_localization.js index f420b33..139fb45 100644 --- a/js/interface_localization.js +++ b/js/interface_localization.js @@ -78,6 +78,7 @@ if(preferredLanguage == "en"){ "Internal error: lastPostId unknown (following yourself may fix!)": "Internal error: lastPostId unknown (following yourself may fix!)", "Known peers:": "Known peers: ", "Last block is ahead of your computer time, check your clock.": "Last block is ahead of your computer time, check your clock.", + "Mentions": "Mentions", "mentions_at": "Mentions @%{user}", "minutes": "%{smart_count} minute |||| %{smart_count} minutes", "Must be 16 characters or less.": "Must be 16 characters or less.", // username @@ -117,6 +118,7 @@ if(preferredLanguage == "en"){ "Sent Direct Message": "Sent Direct Message", "Sent Post to @": "Sent Post to @", "Setup account": "Setup account", + "Sound notifications": "Sound notifications", "switch_to_network": "Local daemon is not connected to the network or\n" + "block chain is outdated. If you stay in this page\n" + "your actions may not work.\n" + diff --git a/options.html b/options.html index 0135af5..e362ee6 100644 --- a/options.html +++ b/options.html @@ -77,7 +77,20 @@ + +
+
+

Keys

+
+
+

Send key

+ +
+