Browse Source

update

added ability to send post by ctrl/cmd+enter, look options page. Some
fixes.
master
Hedgehog 11 years ago
parent
commit
92557257dc
  1. 2
      css/style.css
  2. 16
      js/calm.js
  3. 24
      js/interface_common.js
  4. 2
      js/interface_localization.js
  5. 13
      options.html

2
css/style.css

@ -1412,7 +1412,7 @@ input.userMenu-search-field:focus::-ms-input-placeholder {
background: #fff; background: #fff;
transition: background-color 100ms linear; transition: background-color 100ms linear;
} }
.login .module select.local-usernames, .sndOpt { .login .module select.local-usernames, .sndOpt, #keysOpt select{
height: 30px; height: 30px;
font: 13px/24px "Open sans"; font: 13px/24px "Open sans";
text-align: center; text-align: center;

16
js/calm.js

@ -26,7 +26,7 @@ $(function(){
setTimeout(function() {setInterval(dhtIndicatorBg, 2000)}, 400); setTimeout(function() {setInterval(dhtIndicatorBg, 2000)}, 400);
}) })
function modalDMIntr () { function modalDMIntr() {
$(".cancel").on('click', function(event){ $(".cancel").on('click', function(event){
if(!$(event.target).hasClass("cancel")) return; if(!$(event.target).hasClass("cancel")) return;
if($(".modal-content").attr("style") != undefined){$(".modal-content").removeAttr("style")}; if($(".modal-content").attr("style") != undefined){$(".modal-content").removeAttr("style")};
@ -40,7 +40,7 @@ function modalDMIntr () {
}; };
//sound notifications //sound notifications
function soundNotifOptions () { function soundNotifOptions() {
if(!localStorage['sndDM']) localStorage['sndDM'] = false; if(!localStorage['sndDM']) localStorage['sndDM'] = false;
if(!localStorage['sndMention']) localStorage['sndMention'] = false; if(!localStorage['sndMention']) localStorage['sndMention'] = false;
$('#notifyForm select').each(function(){ $('#notifyForm select').each(function(){
@ -110,11 +110,21 @@ function mensNotif() {
} }
player[0].volume = localStorage['playerVol']; player[0].volume = localStorage['playerVol'];
player[0].play(); 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 () { function InitOptions () {
soundNotifOptions(); soundNotifOptions();
volumeControl(); volumeControl();
keysSend();
} }
function homeIntInit () { function homeIntInit () {
modalDMIntr (); modalDMIntr ();

24
js/interface_common.js

@ -386,14 +386,28 @@ function replyTextKeypress(e) {
$.MAL.disableButton(tweetAction); $.MAL.disableButton(tweetAction);
} }
if (e.keyCode === 13) { if(localStorage['keysSend'] == 1){
if (!e.ctrlKey) { if (e.keyCode === 13 && (!e.metaKey && !e.ctrlKey)) {
$this.val($this.val().trim()); $this.val($this.val().trim());
if( !tweetAction.hasClass("disabled") ) { if( !tweetAction.hasClass("disabled") ) {
tweetAction.click(); 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 ); $( ".modal-propagate").click( retweetSubmit );
var $replyText = $( ".post-area-new textarea" ); var $replyText = $( ".post-area-new textarea" );
$replyText.keyup( replyTextKeypress ); $replyText.on("keydown", replyTextKeypress );
$( ".open-profile-modal").bind( "click", openProfileModal ); $( ".open-profile-modal").bind( "click", openProfileModal );
$( ".open-hashtag-modal").bind( "click", openHashtagModal ); $( ".open-hashtag-modal").bind( "click", openHashtagModal );

2
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!)", "Internal error: lastPostId unknown (following yourself may fix!)": "Internal error: lastPostId unknown (following yourself may fix!)",
"Known peers:": "Known peers: ", "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.", "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}", "mentions_at": "Mentions @%{user}",
"minutes": "%{smart_count} minute |||| %{smart_count} minutes", "minutes": "%{smart_count} minute |||| %{smart_count} minutes",
"Must be 16 characters or less.": "Must be 16 characters or less.", // username "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 Direct Message": "Sent Direct Message",
"Sent Post to @": "Sent Post to @", "Sent Post to @": "Sent Post to @",
"Setup account": "Setup account", "Setup account": "Setup account",
"Sound notifications": "Sound notifications",
"switch_to_network": "Local daemon is not connected to the network or\n" + "switch_to_network": "Local daemon is not connected to the network or\n" +
"block chain is outdated. If you stay in this page\n" + "block chain is outdated. If you stay in this page\n" +
"your actions may not work.\n" + "your actions may not work.\n" +

13
options.html

@ -78,6 +78,19 @@
</div> </div>
</div> </div>
<div class="keys">
<div class="module">
<p> Keys </p>
<div>
<form action="" id="keysOpt">
<p>Send key</p>
<select name="" id="keysSend">
<option value="1">Enter</option>
<option value="2">Ctrl/Cmd+Enter</option>
</select>
</form>
</div>
</body> </body>

Loading…
Cancel
Save