From 581d6c0a8dfe156cb1c712b40fded7fd1f031c20 Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Sat, 7 Feb 2015 23:21:19 +0600 Subject: [PATCH] removed notification when sending own post or DM, fixed hashtag searching and message about sending --- js/interface_common.js | 3 +-- js/interface_localization.js | 29 ++++++++++++++++++++++++++--- js/twister_following.js | 2 +- js/twister_newmsgs.js | 27 +++++++++++++++------------ js/twister_timeline.js | 8 ++++---- 5 files changed, 47 insertions(+), 22 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index d176d7d..3dde411 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -1316,8 +1316,7 @@ var postSubmit = function(e, oldLastPostId) var tweetForm = $this.parents("form"); var remainingCount = tweetForm.find(".post-area-remaining"); remainingCount.text(140); - $replyText.attr("placeholder", "Your message was sent!"); - + if ($this.parents('.modal-wrapper').length) { closeModal($this); } else if ($this.parents('.prompt-wrapper').length) { diff --git a/js/interface_localization.js b/js/interface_localization.js index d68b39d..feef35c 100644 --- a/js/interface_localization.js +++ b/js/interface_localization.js @@ -49,7 +49,6 @@ if(preferredLanguage == "en"){ "Connections:": "Connections: ", // to network "Connection lost.": "Connection lost.", "days": "%{smart_count} day |||| %{smart_count} days", - "Desktop notifications": "Desktop notifications", "Detailed information": "Detailed information", "DHT network down.": "DHT network down.", "Direct Messages": "Direct Messages", @@ -192,6 +191,7 @@ if(preferredLanguage == "en"){ "Theme": "Theme", "Keys": "Keys", "Notifications": "Notifications", + "Desktop notifications": "Desktop notifications", "Sound notifications": "Sound notifications", "Send key": "Send key", "Posts display": "Posts display", @@ -428,6 +428,8 @@ if(preferredLanguage == "es"){ "Ignore": "Ignorar", "Theme": "Tema", "Keys": "Teclas", + "Notifications": "Notificaciones", + "Desktop notifications": "Notificaciones de Escritorio", "Sound notifications": "Notificaciones de Sonido", "Send key": "Send key", "Posts display": "Posts display", @@ -661,6 +663,8 @@ if(preferredLanguage == "uk"){ "Ignore": "Ignore", "Theme": "Theme", "Keys": "Keys", + "Notifications": "Notifications", + "Desktop notifications": "Desktop notifications", "Sound notifications": "Sound notifications", "Send key": "Send key", "Posts display": "Posts display", @@ -893,6 +897,8 @@ if(preferredLanguage == "zh"){ "Ignore": "Ignore", "Theme": "Theme", "Keys": "Keys", + "Notifications": "Notifications", + "Desktop notifications": "Desktop notifications", "Sound notifications": "Sound notifications", "Send key": "Send key", "Posts display": "Posts display", @@ -1126,6 +1132,8 @@ if(preferredLanguage == "nl"){ "Ignore": "Ignore", "Theme": "Theme", "Keys": "Keys", + "Notifications": "Notifications", + "Desktop notifications": "Desktop notifications", "Sound notifications": "Sound notifications", "Send key": "Send key", "Posts display": "Posts display", @@ -1356,6 +1364,8 @@ if(preferredLanguage == "it"){ "Ignore": "Ignore", "Theme": "Theme", "Keys": "Keys", + "Notifications": "Notifications", + "Desktop notifications": "Desktop notifications", "Sound notifications": "Sound notifications", "Send key": "Send key", "Posts display": "Posts display", @@ -1590,6 +1600,8 @@ if(preferredLanguage == "fr"){ "Ignore": "Ignore", "Theme": "Theme", "Keys": "Keys", + "Notifications": "Notifications", + "Desktop notifications": "Desktop notifications", "Sound notifications": "Sound notifications", "Send key": "Send key", "Posts display": "Posts display", @@ -1686,7 +1698,6 @@ if(preferredLanguage == "ru"){ "Connections:": "Соединений: ", "Connection lost.": "Соединение с сетью было потеряно.", "days": "%{smart_count} день |||| %{smart_count} дней", - "Desktop notifications": "Уведомления рабочего стола", "Detailed information": "Подробная информация", "DHT network down.": "Недоступна DHT сеть.", "Direct Messages": "Личные сообщения", @@ -1828,6 +1839,8 @@ if(preferredLanguage == "ru"){ "Ignore": "Игнорировать", "Theme": "Тема", "Keys": "Клавиши", + "Notifications": "Уведомления", + "Desktop notifications": "Уведомления рабочего стола", "Sound notifications": "Звуковые уведомления", "Send key": "Отправка сообщения", "Posts display": "Отображение сообщений", @@ -2067,7 +2080,9 @@ if(preferredLanguage == "de"){ "Ignore": "Ignorieren", "Theme": "Theme", "Keys": "Keys", - "Sound notifications": "Audioeinstellungen", + "Notifications": "Benachrichtigungen", + "Desktop notifications": "Desktophinweisen", + "Sound notifications": "Audioeinstellungen", "Send key": "Send key", "Posts display": "Posts display", "Post editor": "Nachrichten-Editor", @@ -2297,6 +2312,8 @@ if(preferredLanguage == "ja"){ "Ignore": "Ignore", "Theme": "Theme", "Keys": "Keys", + "Notifications": "Notifications", + "Desktop notifications": "Desktop notifications", "Sound notifications": "Sound notifications", "Send key": "Send key", "Posts display": "Posts display", @@ -2533,6 +2550,8 @@ if(preferredLanguage == "pt-BR"){ "Ignore": "Ignore", "Theme": "Theme", "Keys": "Keys", + "Notifications": "Notifications", + "Desktop notifications": "Desktop notifications", "Sound notifications": "Sound notifications", "Send key": "Send key", "Posts display": "Posts display", @@ -2756,6 +2775,8 @@ if(preferredLanguage == "tr"){ "Ignore": "Görmezden gel", "Theme": "Tema", "Keys": "Tuşlar", + "Notifications": "Uyarılar", + "Desktop notifications": "Masaüstü uyarılar", "Sound notifications": "Sesli uyarılar", "Send key": "Gönderme tuşu", "Posts display": "Gönderiler", @@ -2996,6 +3017,8 @@ if(preferredLanguage == "cs"){ "Ignore": "Ignorovat", "Theme": "Styl grafiky", "Keys": "Klávesy", + "Notifications": "Upozornění", + "Desktop notifications": "Upozornění na ploše", "Sound notifications": "Zvuková upozornění", "Send key": "Klávesa pro odeslání", "Posts display": "Zobrazení příspěvků", diff --git a/js/twister_following.js b/js/twister_following.js index 43ec374..5d42604 100644 --- a/js/twister_following.js +++ b/js/twister_following.js @@ -586,7 +586,7 @@ function userSearchKeypress(event) { searchResults.slideUp( "fast" ); if ( event.which == 13 ) - openHashtagModalFromSearch(partialName.substr(1)); + window.location.hash = '#hashtag?hashtag=' + encodeURIComponent(partialName.substr(1)); return; } diff --git a/js/twister_newmsgs.js b/js/twister_newmsgs.js index 58f9520..3284a11 100644 --- a/js/twister_newmsgs.js +++ b/js/twister_newmsgs.js @@ -115,18 +115,21 @@ function requestMentionsCount() { if( _newDMsUpdated ) { _newDMsUpdated = false; - $.MAL.soundNotifyDM(); - - var desktopNotification = new Notify(polyglot.t('notify_desktop_title'), { - body: 'You got '+polyglot.t('new_direct_messages', getNewDMsCount())+'.', - icon: '../img/twister_mini.png', - tag: 'twister_notification_new_DMs', - timeout: _desktopNotificationTimeout, - notifyClick: function() { - window.location.hash = '#directmessages'; - } - }); - desktopNotification.show(); + var newDMs = getNewDMsCount(); + if ( newDMs ) { + $.MAL.soundNotifyDM(); + + var desktopNotification = new Notify(polyglot.t('notify_desktop_title'), { + body: 'You got '+polyglot.t('new_direct_messages', newDMs)+'.', + icon: '../img/twister_mini.png', + tag: 'twister_notification_new_DMs', + timeout: _desktopNotificationTimeout, + notifyClick: function() { + window.location.hash = '#directmessages'; + } + }); + desktopNotification.show(); + } } } diff --git a/js/twister_timeline.js b/js/twister_timeline.js index b105634..3ebbf02 100644 --- a/js/twister_timeline.js +++ b/js/twister_timeline.js @@ -279,13 +279,13 @@ function processLastHave(userHaves) function processNewPostsConfirmation(expected, posts) { //we don't want to produce alert for the posts that won't be displayed - var p2h = 0; + var pnp = 0; for( var i = posts.length-1; i >= 0; i-- ) { - if (willBeHidden(posts[i])) { - p2h++; + if (willBeHidden(posts[i]) || posts[i]['userpost']['n'] === defaultScreenName) { + pnp++; } } - _newPostsPending += posts.length - p2h; + _newPostsPending += posts.length - pnp; if( _newPostsPending ) { $.MAL.reportNewPosts(_newPostsPending); }