Browse Source

Fixes #184

pull/291/merge
Ramiro Saenz 9 years ago
parent
commit
64cbcea2b0
  1. 2
      app/store/ServicesList.js
  2. 4
      app/ux/WebView.js

2
app/store/ServicesList.js

@ -36,7 +36,7 @@ Ext.define('Rambox.store.ServicesList', {
,description: 'Slack brings all your communication together in one place. It’s real-time messaging, archiving and search for modern teams.' ,description: 'Slack brings all your communication together in one place. It’s real-time messaging, archiving and search for modern teams.'
,url: 'https://___.slack.com/' ,url: 'https://___.slack.com/'
,type: 'messaging' ,type: 'messaging'
,js_unread: 'function checkUnread(){var a=0,b=0;$(".unread_msgs").each(function(){a+=parseInt($(this).html())}),$(".unread_highlights").each(function(){b+=parseInt($(this).html())}),updateBadge(a,b)}function updateBadge(a,b){var c=b>0?"("+b+") ":a>0?"(•) ":"";document.title=c.originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);' ,js_unread: 'function checkUnread(){var a=0,b=0;$(".unread_msgs").each(function(){a+=parseInt($(this).html())}),$(".unread_highlights").each(function(){b+=parseInt($(this).html())}),updateBadge(a,b)}function updateBadge(a,b){var c=b>0?"("+b+") ":a>0?"(•) ":"";document.title=c+originalTitle}var originalTitle=document.title;setInterval(checkUnread,3000);'
}, },
{ {
id: 'noysi' id: 'noysi'

4
app/ux/WebView.js

@ -179,8 +179,8 @@ Ext.define('Rambox.ux.WebView',{
webview.addEventListener("page-title-updated", function(e) { webview.addEventListener("page-title-updated", function(e) {
var count = e.title.match(/\(([^)]+)\)/); // Get text between (...) var count = e.title.match(/\(([^)]+)\)/); // Get text between (...)
count = count ? count[1] : '0'; count = count ? count[1] : '0';
count = Ext.isArray(count.match(/\d+/g)) ? count.match(/\d+/g).join("") : count.match(/\d+/g); // Some services have special characters. Example: (•) count = count === '•' ? count : Ext.isArray(count.match(/\d+/g)) ? count.match(/\d+/g).join("") : count.match(/\d+/g); // Some services have special characters. Example: (•)
count = count ? parseInt(count) : 0; count = count === null ? '0' : count;
var formattedCount = Rambox.util.Format.formatNumber(count); var formattedCount = Rambox.util.Format.formatNumber(count);

Loading…
Cancel
Save