Browse Source

update

added ability to send post by ctrl/cmd+enter, look options page. Some
fixes.
master
Hedgehog 10 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 { @@ -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;

16
js/calm.js

@ -26,7 +26,7 @@ $(function(){ @@ -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 () { @@ -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() { @@ -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 ();

24
js/interface_common.js

@ -386,14 +386,28 @@ function replyTextKeypress(e) { @@ -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() { @@ -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 );

2
js/interface_localization.js

@ -78,6 +78,7 @@ if(preferredLanguage == "en"){ @@ -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"){ @@ -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" +

13
options.html

@ -77,7 +77,20 @@ @@ -77,7 +77,20 @@
<audio id="player"></audio>
</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>

Loading…
Cancel
Save