aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRael <rael.gc@gmail.com>2015-10-14 22:07:19 -0300
committerRael <rael.gc@gmail.com>2015-10-14 22:07:19 -0300
commit9f11b54084983a2d7a6dc2dc90ec1eedbb534356 (patch)
treec375bd681b01b2c3575413f1cef3c91db4ffaffa
parent2dd8236094cd0b223b5280953b6456d290c02252 (diff)
downloadscudcloud-9f11b54084983a2d7a6dc2dc90ec1eedbb534356.zip
scudcloud-9f11b54084983a2d7a6dc2dc90ec1eedbb534356.tar.gz
scudcloud-9f11b54084983a2d7a6dc2dc90ec1eedbb534356.tar.bz2
Better JS
-rw-r--r--scudcloud-1.0/scudcloud-src.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/scudcloud-1.0/scudcloud-src.js b/scudcloud-1.0/scudcloud-src.js
index e394b58..faef081 100644
--- a/scudcloud-1.0/scudcloud-src.js
+++ b/scudcloud-1.0/scudcloud-src.js
@@ -1,4 +1,5 @@
var ScudCloud = {
+ started: false,
overrideNotifications: function(){
TS.ui.growls.no_notifications = false;
TS.ui.growls.checkPermission = function() { return true; };
@@ -10,6 +11,10 @@ var ScudCloud = {
TS.ms.connected_sig.add(function(){ScudCloud.connect(true);});
TS.ms.disconnected_sig.add(function(){ScudCloud.connect(false);});
},
+ overrideBanner: function(){
+ ScudCloud.showBanner = TS.ui.banner.show;
+ TS.ui.banner.show = function(){ ScudCloud.showBanner(); ScudCloud.overrideNotifications(); };
+ },
connect: function(b){
desktop.enableMenus(b);
if(b) desktop.populate(JSON.stringify({'channels': ScudCloud.listChannels(), 'teams': ScudCloud.listTeams(), 'icon': TS.model.team.icon.image_88}));
@@ -67,8 +72,9 @@ var ScudCloud = {
return "undefined" != typeof TS && "undefined" != typeof TS.model && TS.model.ms_connected;
}
};
-if("undefined" != typeof TS){
+if("undefined" != typeof TS && false == ScudCloud.started){
document.onpaste = function(e){desktop.pasted(false);};
- ScudCloud.overrideNotifications();
ScudCloud.overrideConnect();
+ ScudCloud.overrideBanner();
+ ScudCloud.started = true;
}