From: Darren Date: Tue, 10 Sep 2013 19:06:33 +0000 (+0100) Subject: Code formatting; Notifications only when blurred; Channel name in notification; X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ee2f096205eedd7b9c368f42f3cc9da50d5ab0d8;p=KiwiIRC.git Code formatting; Notifications only when blurred; Channel name in notification; --- diff --git a/client/assets/src/applets/settings.js b/client/assets/src/applets/settings.js index 5188edd..f9ee8ad 100644 --- a/client/assets/src/applets/settings.js +++ b/client/assets/src/applets/settings.js @@ -4,7 +4,7 @@ 'change [data-setting]': 'saveSettings', 'click [data-setting="theme"]': 'selectTheme', 'click .register_protocol': 'registerProtocol', - 'click .enable_notifications': 'enableNoticiations' + 'click .enable_notifications': 'enableNoticiations' }, initialize: function (options) { @@ -21,19 +21,19 @@ make_default: _kiwi.global.i18n.translate('client_applets_settings_default_client_enable').fetch(), locale_restart_needed: _kiwi.global.i18n.translate('client_applets_settings_locale_restart_needed').fetch(), default_note: _kiwi.global.i18n.translate('client_applets_settings_default_client_notice').fetch('chrome://settings/handlers'), - html5_notifications: _kiwi.global.i18n.translate('client_applets_settings_locale_html5_notifications').fetch(), - enable_notifications: _kiwi.global.i18n.translate('client_applets_settings_locale_enable_notifications').fetch() + html5_notifications: _kiwi.global.i18n.translate('client_applets_settings_html5_notifications').fetch(), + enable_notifications: _kiwi.global.i18n.translate('client_applets_settings_enable_notifications').fetch() }; this.$el = $(_.template($('#tmpl_applet_settings').html().trim(), text)); if (!navigator.registerProtocolHandler) { this.$el.find('.protocol_handler').remove(); } -/* - if (!window.webkitNotifications) { - this.$el.find('notification_enabler').remove(); - } -*/ + + if (!window.webkitNotifications) { + this.$el.find('notification_enabler').remove(); + } + // Incase any settings change while we have this open, update them _kiwi.global.settings.on('change', this.loadSettings, this); @@ -115,9 +115,9 @@ navigator.registerProtocolHandler('ircs', document.location.origin + _kiwi.app.get('base_path') + '/%s', 'Kiwi IRC'); }, - enableNoticiations: function(event){ - window.webkitNotifications.requestPermission(); - } + enableNoticiations: function(event){ + window.webkitNotifications.requestPermission(); + } }); diff --git a/client/assets/src/index.html.tmpl b/client/assets/src/index.html.tmpl index 84fdb2a..a50c93d 100644 --- a/client/assets/src/index.html.tmpl +++ b/client/assets/src/index.html.tmpl @@ -267,7 +267,7 @@ -
+
<%= html5_notifications %>
diff --git a/client/assets/src/translations/de-de.po b/client/assets/src/translations/de-de.po index 5776256..5c36248 100644 --- a/client/assets/src/translations/de-de.po +++ b/client/assets/src/translations/de-de.po @@ -11,15 +11,15 @@ msgstr "" msgid "client_applets_chanlist_channelname" msgstr "Raumname" -#: +#: msgid "client_applets_chanlist_users" msgstr "Nutzer" -#: +#: msgid "client_applets_chanlist_topic" msgstr "Thema" -#: +#: msgid "client_applets_chanlist_channellist" msgstr "Raumliste" @@ -27,15 +27,15 @@ msgstr "Raumliste" msgid "client_applets_scripteditor_save" msgstr "Speichern" -#: +#: msgid "client_applets_scripteditor_error" msgstr "Programm-Fehler. %s" -#: +#: msgid "client_applets_scripteditor_saved" msgstr "Dein Programm wurde gespeichert und ist nun aktiv." -#: +#: msgid "client_applets_scripteditor_title" msgstr "Programm-Editor" @@ -43,67 +43,67 @@ msgstr "Programm-Editor" msgid "client_applets_settings_channelview_tabs" msgstr "Tabs" -#: +#: msgid "client_applets_settings_channelview_list" msgstr "Liste" -#: +#: msgid "client_applets_settings_channelview_list_notice" msgstr "für eine große Anzahl an Räumen" -#: +#: msgid "client_applets_settings_notification_joinpart" msgstr "Beitreten/Verlassen Benachrichtigungen" -#: +#: msgid "client_applets_settings_timestamp" msgstr "Zeitstempel" -#: +#: msgid "client_applets_settings_notification_sound" msgstr "Audio-Benachrichtigungen stummschalten" -#: +#: msgid "client_applets_settings_history_length" msgstr "Nachrichten im Verlauf" -#: +#: msgid "client_applets_settings_default_client" msgstr "Standard IRC Client" -#: +#: msgid "client_applets_settings_default_client_enable" msgstr "Setze Kiwi als meinen Standard-IRC Client" -#: +#: msgid "client_applets_settings_locale_restart_needed" msgstr "Notiz: Die Änderungen werden erst nach einem Neuladen der Seite wirksam" -#: +#: msgid "client_applets_settings_default_client_notice" msgstr "Notiz: Nutzer von Chrome oder Chromium müssen ihre Einstellungen durch %s testen, sofern nichts passiert" -#: +#: msgid "client_applets_settings_title" msgstr "Einstellungen" #: -msgid "client_applets_settings_locale_html5_notifications" +msgid "client_applets_settings_html5_notifications" msgstr "HTML5 Benachrichtigungen" #: -msgid "client_applets_settings_locale_enable_notifications" +msgid "client_applets_settings_enable_notifications" msgstr "Benachrichtigungen einschalten" #: client/assets/src/models/applet.js msgid "client_models_applet_unknown" msgstr "Unbekannte Anwendung" -#: +#: msgid "client_models_applet_loading" msgstr "Lade.." -#: +#: msgid "client_models_applet_notfound" msgstr "Nicht gefunden" @@ -111,67 +111,67 @@ msgstr "Nicht gefunden" msgid "client_models_application_reconnecting" msgstr "Deine Verbindung wurde getrennt. Es wird versucht die Verbindung wieder aufzubauen" -#: +#: msgid "client_models_application_reconnect_in_x_seconds" msgstr "Deine Verbindung wurde getrennt. Ein erneuter Verbindungsaufbau beginnt in %d Sekunden" -#: +#: msgid "client_models_application_reconnect_successfully" msgstr "Alles OK, du bist wieder verbunden" -#: +#: msgid "client_models_application_settings_saved" msgstr "Einstellungen wurden gespeichert" -#: +#: msgid "client_models_application_ignore_title" msgstr "Ignorierte Nicknamen" -#: +#: msgid "client_models_application_ignore_none" msgstr "Niemand wird ignoriert" -#: +#: msgid "client_models_application_ignore_nick" msgstr "Ignoriere %s" -#: +#: msgid "client_models_application_ignore_stop_notice" msgstr "Gib den Nicknamen ein, den du nicht mehr ignorieren möchtest" -#: +#: msgid "client_models_application_ignore_stopped" msgstr "%s wird nicht mehr ignoriert" -#: +#: msgid "client_models_application_applet_notfound" msgstr "Anwendung \"%s\" existiert nicht" -#: +#: msgid "client_models_application_encoding_changed" msgstr "Kodierung wurde in %s geändert" -#: +#: msgid "client_models_application_encoding_invalid" msgstr "%s ist keine gültige Kodierung" -#: +#: msgid "client_models_application_encoding_notspecified" msgstr "Kodierung nicht angegeben" -#: +#: msgid "client_models_application_encoding_usage" msgstr "Verwendung: /encoding [NEUE-KODIERUNG]" -#: +#: msgid "client_models_application_connection_create" msgstr "Neue Verbindung" -#: +#: msgid "client_models_application_connection_connecting" msgstr "Verbinde zu %s:%s..." -#: +#: msgid "client_models_application_connection_error" msgstr "Fehler beim Verbindungsaufbau nach %s:%s (%s)" @@ -179,19 +179,19 @@ msgstr "Fehler beim Verbindungsaufbau nach %s:%s (%s)" msgid "client_models_channel_join" msgstr "%s hat den Raum betreten" -#: +#: msgid "client_models_channel_quit" msgstr "%s hat %s verlassen" -#: +#: msgid "client_models_channel_kicked" msgstr "%s wurde von %s rausgeschmissen %s" -#: +#: msgid "client_models_channel_selfkick" msgstr "Du wurdest von %s rausgeschmissen %s" -#: +#: msgid "client_models_channel_part" msgstr "%s verließ %s" @@ -199,71 +199,71 @@ msgstr "%s verließ %s" msgid "client_models_network_channel_invalid_name" msgstr "%s ist kein gültiger Raumname" -#: +#: msgid "client_models_network_disconnected" msgstr "Verbindung zum IRC-Netzwerk getrennt" -#: +#: msgid "client_models_network_nickname_changed" msgstr "%s ist nun bekannt als %s" -#: +#: msgid "client_models_network_topic" msgstr "Thema wurde von %s am %s gesetzt" -#: +#: msgid "client_models_network_selfmode" msgstr "%s setzt den Modus %s" -#: +#: msgid "client_models_network_mode" msgstr "%s setzte den Modus %s" -#: +#: msgid "client_models_network_channels" msgstr "Räume: %s" -#: +#: msgid "client_models_network_server" msgstr "Zum Server %s %s verbunden" -#: +#: msgid "client_models_network_idle_and_signon" msgstr "Untätig seit %s, verbunden am %s" -#: +#: msgid "client_models_network_away" msgstr "Abwesend: %s" -#: +#: msgid "client_models_network_idle" msgstr "Untätig seit %s" -#: +#: msgid "client_models_network_nickname_notfound" msgstr "Ungültiger Nickname" -#: +#: msgid "client_models_network_banned" msgstr "Du wurdest aus %s verbannt. %s" -#: +#: msgid "client_models_network_channel_badkey" msgstr "Falsches Passwort für %s" -#: +#: msgid "client_models_network_channel_inviteonly" msgstr "%s kann nur nach Einladung betreten werden." -#: +#: msgid "client_models_network_channel_limitreached" msgstr "%s ist voll." -#: +#: msgid "client_models_network_nickname_alreadyinuse" msgstr "Der Nickname \"%s\" wird bereits verwendet. Bitte wähle einen anderen Nicknamen." -#: +#: msgid "client_models_network_badpassword" msgstr "Falsches Passwort" @@ -275,7 +275,7 @@ msgstr "Dies wird alle KiwiIRC Verbindungen beenden. Bist du sicher, dass du die msgid "client_views_channel_joining" msgstr "Betrete Raum.." -#: +#: msgid "client_views_channel_topic" msgstr "Thema für %s ist: %s" @@ -283,23 +283,23 @@ msgstr "Thema für %s ist: %s" msgid "client_views_mediamessage_close" msgstr "Schließe Medium" -#: +#: msgid "client_views_mediamessage_notfound" msgstr "Nicht gefunden" -#: +#: msgid "client_views_mediamessage_load_tweet" msgstr "Lade Tweet" -#: +#: msgid "client_views_mediamessage_load_image" msgstr "Lade Bild" -#: +#: msgid "client_views_mediamessage_load_reddit" msgstr "Lade Reddit Thread" -#: +#: msgid "client_views_mediamessage_load_gist" msgstr "Lade Gist" @@ -307,11 +307,11 @@ msgstr "Lade Gist" msgid "client_views_nickchangebox_new" msgstr "Neuer Nickname" -#: +#: msgid "client_views_nickchangebox_change" msgstr "Ändern" -#: +#: msgid "client_views_nickchangebox_cancel" msgstr "Abbrechen" @@ -323,87 +323,87 @@ msgstr "Es wird geredet!" msgid "client_views_serverselect_form_title" msgstr "Denk dir einen Nicknamen aus..." -#: +#: msgid "client_views_serverselect_nickname" msgstr "Nickname" -#: +#: msgid "client_views_serverselect_enable_password" msgstr "Ich habe ein Passwort" -#: +#: msgid "client_views_serverselect_password" msgstr "Passwort" -#: +#: msgid "client_views_serverselect_channel" msgstr "Raum" -#: +#: msgid "client_views_serverselect_channelkey" msgstr "Raum-Passwort" -#: +#: msgid "client_views_serverselect_channelkey_required" msgstr "Raum benötigt ein Passwort" -#: +#: msgid "client_views_serverselect_key" msgstr "Passwort" -#: +#: msgid "client_views_serverselect_connection_start" msgstr "Start..." -#: +#: msgid "client_views_serverselect_server_and_network" msgstr "Server und Netzwerk" -#: +#: msgid "client_views_serverselect_server" msgstr "Server" -#: +#: msgid "client_views_serverselect_port" msgstr "Port" -#: +#: msgid "client_views_serverselect_poweredby" msgstr "Präsentiert von Kiwi IRC" -#: +#: msgid "client_views_serverselect_nickname_error_empty" msgstr "Wähle zuerst einen Nicknamen!" -#: +#: msgid "client_views_serverselect_connection_successfully" msgstr "Verbunden" -#: +#: msgid "client_views_serverselect_connection_trying" msgstr "Verbinde.." -#: +#: msgid "client_views_serverselect_nickname_error_alreadyinuse" msgstr "Der Nickname wird bereits verwendet" -#: +#: msgid "client_views_serverselect_nickname_invalid" msgstr "Fehlerhafter Nickname" -#: +#: msgid "client_views_serverselect_password_incorrect" msgstr "Falsches Passwort" -#: +#: msgid "client_views_serverselect_connection_error" msgstr "Fehler beim Verbinden" -#: +#: msgid "client_views_serverselect_server_notfound" msgstr "Server konnte nicht gefunden werden" -#: +#: msgid "client_views_serverselect_connection_refused" msgstr "Verbindung wurde abgelehnt" @@ -411,47 +411,47 @@ msgstr "Verbindung wurde abgelehnt" msgid "client_views_userbox_op" msgstr "Op" -#: +#: msgid "client_views_userbox_deop" msgstr "De-Op" -#: +#: msgid "client_views_userbox_voice" msgstr "Voice" -#: +#: msgid "client_views_userbox_devoice" msgstr "De-Voice" -#: +#: msgid "client_views_userbox_kick" msgstr "Rausschmeissen" -#: +#: msgid "client_views_userbox_ban" msgstr "Verbannen" -#: +#: msgid "client_views_userbox_query" msgstr "Nachricht" -#: +#: msgid "client_views_userbox_whois" msgstr "Info" -#: +#: msgid "client_views_userbox_slap" msgstr "Schlagen!" -#: +#: msgid "client_views_serverselect_ssl" msgstr "SSL" -#: +#: msgid "client_models_application_jumpserver_prepare" msgstr "In 5 Minuten wirst du neu verbunden und alle deine Räume werden neu betreten. Sei bereit!" -#: +#: msgid "client_models_application_jumpserver_reconnect" msgstr "Du wirst neu verbunden.." diff --git a/client/assets/src/translations/en-gb.po b/client/assets/src/translations/en-gb.po index 3603100..db5c47b 100755 --- a/client/assets/src/translations/en-gb.po +++ b/client/assets/src/translations/en-gb.po @@ -11,15 +11,15 @@ msgstr "" msgid "client_applets_chanlist_channelname" msgstr "Channel Name" -#: +#: msgid "client_applets_chanlist_users" msgstr "Users" -#: +#: msgid "client_applets_chanlist_topic" msgstr "Topic" -#: +#: msgid "client_applets_chanlist_channellist" msgstr "Channel List" @@ -27,15 +27,15 @@ msgstr "Channel List" msgid "client_applets_scripteditor_save" msgstr "Save" -#: +#: msgid "client_applets_scripteditor_error" msgstr "Script error. %s" -#: +#: msgid "client_applets_scripteditor_saved" msgstr "Your script has been saved and is now active" -#: +#: msgid "client_applets_scripteditor_title" msgstr "Script Editor" @@ -43,56 +43,56 @@ msgstr "Script Editor" msgid "client_applets_settings_channelview_tabs" msgstr "Tabs" -#: +#: msgid "client_applets_settings_channelview_list" msgstr "List" -#: +#: msgid "client_applets_settings_channelview_list_notice" msgstr "for large amounts of channels" -#: +#: msgid "client_applets_settings_notification_joinpart" msgstr "Join/part channel notifications" -#: +#: msgid "client_applets_settings_timestamp" msgstr "Timestamps" -#: +#: msgid "client_applets_settings_notification_sound" msgstr "Mute sound notifications" -#: +#: msgid "client_applets_settings_history_length" msgstr "messages in scroll history" -#: +#: msgid "client_applets_settings_default_client" msgstr "Default IRC client" -#: +#: msgid "client_applets_settings_default_client_enable" msgstr "Make Kiwi my default IRC client" -#: +#: msgid "client_applets_settings_locale_restart_needed" msgstr "Note: Changes will only take effect after you refresh the page" -#: +#: msgid "client_applets_settings_default_client_notice" msgstr "Note: Chrome or Chromium browser users may need to check their settings via %s if nothing happens" -#: +#: msgid "client_applets_settings_title" msgstr "Settings" #: -msgid "client_apllets_settings_html5_notifications" +msgid "client_applets_settings_html5_notifications" msgstr "HTML5 Notifications" #: -msgid "client_apllets_settings_enable_notifications" +msgid "client_applets_settings_enable_notifications" msgstr "Enable notifications" @@ -100,11 +100,11 @@ msgstr "Enable notifications" msgid "client_models_applet_unknown" msgstr "Unknown Applet" -#: +#: msgid "client_models_applet_loading" msgstr "Loading.." -#: +#: msgid "client_models_applet_notfound" msgstr "Not found" @@ -112,67 +112,67 @@ msgstr "Not found" msgid "client_models_application_reconnecting" msgstr "You have been disconnected. Attempting to reconnect for you" -#: +#: msgid "client_models_application_reconnect_in_x_seconds" msgstr "You have been disconnected. Attempting to reconnect again in %d seconds" -#: +#: msgid "client_models_application_reconnect_successfully" msgstr "It's OK, you're connected again" -#: +#: msgid "client_models_application_settings_saved" msgstr "Settings have been saved" -#: +#: msgid "client_models_application_ignore_title" msgstr "Ignored nicks" -#: +#: msgid "client_models_application_ignore_none" msgstr "Not ignoring anybody" -#: +#: msgid "client_models_application_ignore_nick" msgstr "Ignoring %s" -#: +#: msgid "client_models_application_ignore_stop_notice" msgstr "Specifiy which nick you wish to stop ignoring" -#: +#: msgid "client_models_application_ignore_stopped" msgstr "Stopped ignoring %s" -#: +#: msgid "client_models_application_applet_notfound" msgstr "Applet \"%s\" does not exist" -#: +#: msgid "client_models_application_encoding_changed" msgstr "Encoding modified to %s" -#: +#: msgid "client_models_application_encoding_invalid" msgstr "%s is not a valid encoding" -#: +#: msgid "client_models_application_encoding_notspecified" msgstr "Encoding not specified" -#: +#: msgid "client_models_application_encoding_usage" msgstr "Usage: /encoding [NEW-ENCODING]" -#: +#: msgid "client_models_application_connection_create" msgstr "New Connection" -#: +#: msgid "client_models_application_connection_connecting" msgstr "Connecting to %s:%s..." -#: +#: msgid "client_models_application_connection_error" msgstr "Error connecting to %s:%s (%s)" @@ -180,19 +180,19 @@ msgstr "Error connecting to %s:%s (%s)" msgid "client_models_channel_join" msgstr "%s has joined" -#: +#: msgid "client_models_channel_quit" msgstr "%s has quit %s" -#: +#: msgid "client_models_channel_kicked" msgstr "%s was kicked by %s %s" -#: +#: msgid "client_models_channel_selfkick" msgstr "You have been kicked by %s %s" -#: +#: msgid "client_models_channel_part" msgstr "%s has left %s" @@ -200,71 +200,71 @@ msgstr "%s has left %s" msgid "client_models_network_channel_invalid_name" msgstr "%s is not a valid channel name" -#: +#: msgid "client_models_network_disconnected" msgstr "Disconnected from the IRC network" -#: +#: msgid "client_models_network_nickname_changed" msgstr "%s is now known as %s" -#: +#: msgid "client_models_network_topic" msgstr "Topic set by %s at %s" -#: +#: msgid "client_models_network_selfmode" msgstr "%s sets mode %s" -#: +#: msgid "client_models_network_mode" msgstr "%s set mode %s" -#: +#: msgid "client_models_network_channels" msgstr "Channels: %s" -#: +#: msgid "client_models_network_server" msgstr "Connected to server: %s %s" -#: +#: msgid "client_models_network_idle_and_signon" msgstr "Idle for %s, signed on %s" -#: +#: msgid "client_models_network_away" msgstr "Away: %s" -#: +#: msgid "client_models_network_idle" msgstr "Idle for %s" -#: +#: msgid "client_models_network_nickname_notfound" msgstr "No such nick" -#: +#: msgid "client_models_network_banned" msgstr "You are banned from %s. %s" -#: +#: msgid "client_models_network_channel_badkey" msgstr "Bad channel key for %s" -#: +#: msgid "client_models_network_channel_inviteonly" msgstr "%s is invite only." -#: +#: msgid "client_models_network_channel_limitreached" msgstr "%s is full." -#: +#: msgid "client_models_network_nickname_alreadyinuse" msgstr "The nickname \"%s\" is already in use. Please select a new nickname" -#: +#: msgid "client_models_network_badpassword" msgstr "Incorrect password given" @@ -276,7 +276,7 @@ msgstr "This will close all KiwiIRC conversations. Are you sure you want to clos msgid "client_views_channel_joining" msgstr "Joining channel.." -#: +#: msgid "client_views_channel_topic" msgstr "Topic for %s is: %s" @@ -284,23 +284,23 @@ msgstr "Topic for %s is: %s" msgid "client_views_mediamessage_close" msgstr "Close media" -#: +#: msgid "client_views_mediamessage_notfound" msgstr "Not found" -#: +#: msgid "client_views_mediamessage_load_tweet" msgstr "Loading tweet" -#: +#: msgid "client_views_mediamessage_load_image" msgstr "Loading image" -#: +#: msgid "client_views_mediamessage_load_reddit" msgstr "Loading Reddit thread" -#: +#: msgid "client_views_mediamessage_load_gist" msgstr "Loading gist" @@ -308,11 +308,11 @@ msgstr "Loading gist" msgid "client_views_nickchangebox_new" msgstr "New nick" -#: +#: msgid "client_views_nickchangebox_change" msgstr "Change" -#: +#: msgid "client_views_nickchangebox_cancel" msgstr "Cancel" @@ -324,87 +324,87 @@ msgstr "People are talking!" msgid "client_views_serverselect_form_title" msgstr "Think of a nickname..." -#: +#: msgid "client_views_serverselect_nickname" msgstr "Nickname" -#: +#: msgid "client_views_serverselect_enable_password" msgstr "I have a password" -#: +#: msgid "client_views_serverselect_password" msgstr "Password" -#: +#: msgid "client_views_serverselect_channel" msgstr "Channel" -#: +#: msgid "client_views_serverselect_channelkey" msgstr "Channel Key" -#: +#: msgid "client_views_serverselect_channelkey_required" msgstr "Channel requires a key" -#: +#: msgid "client_views_serverselect_key" msgstr "Key" -#: +#: msgid "client_views_serverselect_connection_start" msgstr "Start..." -#: +#: msgid "client_views_serverselect_server_and_network" msgstr "Server and network" -#: +#: msgid "client_views_serverselect_server" msgstr "Server" -#: +#: msgid "client_views_serverselect_port" msgstr "Port" -#: +#: msgid "client_views_serverselect_poweredby" msgstr "Powered by Kiwi IRC" -#: +#: msgid "client_views_serverselect_nickname_error_empty" msgstr "Select a nickname first!" -#: +#: msgid "client_views_serverselect_connection_successfully" msgstr "Connected" -#: +#: msgid "client_views_serverselect_connection_trying" msgstr "Connecting.." -#: +#: msgid "client_views_serverselect_nickname_error_alreadyinuse" msgstr "Nickname already taken" -#: +#: msgid "client_views_serverselect_nickname_invalid" msgstr "Erroneus nickname" -#: +#: msgid "client_views_serverselect_password_incorrect" msgstr "Incorrect Password" -#: +#: msgid "client_views_serverselect_connection_error" msgstr "Error Connecting" -#: +#: msgid "client_views_serverselect_server_notfound" msgstr "Server not found" -#: +#: msgid "client_views_serverselect_connection_refused" msgstr "Connection refused" @@ -412,47 +412,47 @@ msgstr "Connection refused" msgid "client_views_userbox_op" msgstr "Op" -#: +#: msgid "client_views_userbox_deop" msgstr "De-op" -#: +#: msgid "client_views_userbox_voice" msgstr "Voice" -#: +#: msgid "client_views_userbox_devoice" msgstr "De-voice" -#: +#: msgid "client_views_userbox_kick" msgstr "Kick" -#: +#: msgid "client_views_userbox_ban" msgstr "Ban" -#: +#: msgid "client_views_userbox_query" msgstr "Message" -#: +#: msgid "client_views_userbox_whois" msgstr "Info" -#: +#: msgid "client_views_userbox_slap" msgstr "Slap!" -#: +#: msgid "client_views_serverselect_ssl" msgstr "SSL" -#: +#: msgid "client_models_application_jumpserver_prepare" msgstr "In 5 minutes you will be reconnected and your channels re-joined. Get ready!" -#: +#: msgid "client_models_application_jumpserver_reconnect" msgstr "Safely reconnecting you now.." diff --git a/client/assets/src/views/application.js b/client/assets/src/views/application.js index e6a244c..be2ebbe 100644 --- a/client/assets/src/views/application.js +++ b/client/assets/src/views/application.js @@ -27,6 +27,17 @@ _kiwi.view.Application = Backbone.View.extend({ } }; + // Keep tabs on the browser having focus + this.has_focus = true; + + $(window).on('focus', function () { + that.has_focus = true; + }); + $(window).on('blur', function () { + that.has_focus = false; + }); + + this.favicon = new _kiwi.view.Favicon(); this.initSound(); }, @@ -57,13 +68,13 @@ _kiwi.view.Application = Backbone.View.extend({ if (layout_style === _kiwi.global.settings) { layout_style = arguments[1]; } - + if (layout_style == 'list') { this.$el.addClass('chanlist_treeview'); } else { this.$el.removeClass('chanlist_treeview'); } - + this.doLayout(); }, @@ -283,14 +294,23 @@ _kiwi.view.Application = Backbone.View.extend({ if (_kiwi.global.settings.get('mute_sounds')) return; - + soundManager.play(sound_id); }, - showNotification: function(sender, message) { - console.log(sender, message); - if (window.webkitNotifications && webkitNotifications.checkPermission() === 0){ - window.webkitNotifications.createNotification('/kiwi/assets/img/ico.png', sender, message).show(); - } + + showNotification: function(title, message) { + var icon = this.model.get('base_path') + '/assets/img/ico.png'; + + // Check if we have notification support + if (!window.webkitNotifications) + return; + + if (this.has_focus) + return; + + if (webkitNotifications.checkPermission() === 0){ + window.webkitNotifications.createNotification(icon, title, message).show(); + } } }); diff --git a/client/assets/src/views/channel.js b/client/assets/src/views/channel.js index 4f4012b..3dd89ca 100644 --- a/client/assets/src/views/channel.js +++ b/client/assets/src/views/channel.js @@ -136,7 +136,7 @@ _kiwi.view.Channel = _kiwi.view.Panel.extend({ _kiwi.app.view.alertWindow('* ' + _kiwi.global.i18n.translate('client_views_panel_activity').fetch()); _kiwi.app.view.favicon.newHighlight(); _kiwi.app.view.playSound('highlight'); - _kiwi.app.view.showNotification(msg.nick, msg.msg); + _kiwi.app.view.showNotification(this.model.get('name'), msg.msg); this.alert('highlight'); } else { @@ -149,9 +149,13 @@ _kiwi.view.Channel = _kiwi.view.Panel.extend({ if (this.model.isQuery() && !this.model.isActive()) { _kiwi.app.view.alertWindow('* ' + _kiwi.global.i18n.translate('client_views_panel_activity').fetch()); + + // Highlights have already been dealt with above if (!is_highlight) { _kiwi.app.view.favicon.newHighlight(); } + + _kiwi.app.view.showNotification(this.model.get('name'), msg.msg); _kiwi.app.view.playSound('highlight'); }