diff options
-rw-r--r-- | scudcloud-1.0/resources/scudcloud.js | 2 | ||||
-rw-r--r-- | scudcloud-1.0/scudcloud-src.js | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/scudcloud-1.0/resources/scudcloud.js b/scudcloud-1.0/resources/scudcloud.js index 34bbec3..82a7621 100644 --- a/scudcloud-1.0/resources/scudcloud.js +++ b/scudcloud-1.0/resources/scudcloud.js @@ -1 +1 @@ -ScudCloud={unloaded:!0,hasPreference:function(n){return!1},getPreference:function(n){return!1},setPreference:function(n,e){return!1},canShowHtmlNotifications:function(){return!1},call:function(n,e){switch(ScudCloud.log(n),n){case"reload":return ScudCloud.reload();case"didStartLoading":return ScudCloud.didStartLoading();case"didFinishLoading":return ScudCloud.didFinishLoading();case"setConnectionStatus":return ScudCloud.setConnectionStatus(e);case"notify":return ScudCloud.notify(e);case"setBadgeCount":return ScudCloud.setBadgeCount(e);case"displayTeam":return ScudCloud.displayTeam(e)}return!1},reload:function(){window.location.reload()},didStartLoading:function(){},didFinishLoading:function(){ScudCloud.unloaded&&(TS.ui.banner.close(),ScudCloud.populate(),ScudCloud.unloaded=!1)},setConnectionStatus:function(n){switch(n){case"online":desktop.enableMenus(!0);break;default:desktop.enableMenus(!1)}},notify:function(n){desktop.sendMessage(n.title,n.content)},setBadgeCount:function(n){desktop.count(n.all_unread_highlights_cnt,n.all_unread_cnt)},displayTeam:function(n){},log:function(n){console.log("ScudCloud."+n)},populate:function(){desktop.populate(JSON.stringify({channels:ScudCloud.listChannels(),teams:ScudCloud.listTeams(),icon:TS.model.team.icon.image_44}))},createSnippet:function(){return TS.ui.snippet_dialog.start()},listChannels:function(){return TS.channels.getUnarchivedChannelsForUser()},listTeams:function(){var n=TS.getAllTeams();return n[0].team_icon={image_44:TS.model.team.icon.image_44},n},quicklist:function(){desktop.quicklist(ScudCloud.listChannels())},join:function(n){return TS.channels.join(n)},setClipboard:function(n){TS.client.ui.file_pasted_sig.dispatch(n,TS.model.shift_key_pressed)},preferences:function(){return TS.ui.prefs_dialog.start()},addTeam:function(){document.location=TS.boot_data.signin_url},getCurrentTeam:function(){var n=TS.getAllTeams();if(null!=n)for(var e=0;n.length;e++)if(n[e].team_url==TS.boot_data.team_url)return n[e].id;return""},logout:function(){document.location=TS.boot_data.logout_url},help:function(){return TS.help_dialog.start()}},document.onpaste=function(n){desktop.pasted(!1)},window.winssb=TSSSB=ScudCloud,ScudCloud.didFinishLoading(); +ScudCloud={unloaded:!0,hasPreference:function(n){return!1},getPreference:function(n){return!1},setPreference:function(n,e){return!1},canShowHtmlNotifications:function(){return!1},call:function(n,e){switch(ScudCloud.log(n),n){case"reload":return ScudCloud.reload();case"didStartLoading":return ScudCloud.didStartLoading();case"didFinishLoading":return ScudCloud.didFinishLoading();case"setConnectionStatus":return ScudCloud.setConnectionStatus(e);case"notify":return ScudCloud.notify(e);case"setBadgeCount":return ScudCloud.setBadgeCount(e);case"displayTeam":return ScudCloud.displayTeam(e)}return!1},reload:function(){window.location.reload()},didStartLoading:function(){},didFinishLoading:function(){TS.ui.banner.close(),ScudCloud.populate(),ScudCloud.unloaded=!1},setConnectionStatus:function(n){switch(n){case"online":desktop.enableMenus(!0);break;default:desktop.enableMenus(!1)}},notify:function(n){desktop.sendMessage(n.title,n.content)},setBadgeCount:function(n){desktop.count(n.all_unread_highlights_cnt,n.all_unread_cnt)},displayTeam:function(n){},log:function(n){console.log("ScudCloud."+n)},populate:function(){desktop.populate(JSON.stringify({channels:ScudCloud.listChannels(),teams:ScudCloud.listTeams(),icon:TS.model.team.icon.image_44}))},createSnippet:function(){return TS.ui.snippet_dialog.start()},listChannels:function(){return TS.channels.getUnarchivedChannelsForUser()},listTeams:function(){var n=TS.getAllTeams();return n[0].team_icon={image_44:TS.model.team.icon.image_44},n},quicklist:function(){desktop.quicklist(ScudCloud.listChannels())},join:function(n){return TS.channels.join(n)},setClipboard:function(n){TS.client.ui.file_pasted_sig.dispatch(n,TS.model.shift_key_pressed)},preferences:function(){return TS.ui.prefs_dialog.start()},addTeam:function(){document.location=TS.boot_data.signin_url},getCurrentTeam:function(){var n=TS.getAllTeams();if(null!=n)for(var e=0;n.length;e++)if(n[e].team_url==TS.boot_data.team_url)return n[e].id;return""},logout:function(){document.location=TS.boot_data.logout_url},help:function(){return TS.help_dialog.start()}},document.onpaste=function(n){desktop.pasted(!1)},window.winssb=TSSSB=ScudCloud,ScudCloud.unloaded&&ScudCloud.didFinishLoading(); diff --git a/scudcloud-1.0/scudcloud-src.js b/scudcloud-1.0/scudcloud-src.js index 36ce89e..3bb9beb 100644 --- a/scudcloud-1.0/scudcloud-src.js +++ b/scudcloud-1.0/scudcloud-src.js @@ -1,3 +1,4 @@ + ScudCloud = { unloaded: true, // App functions @@ -42,11 +43,9 @@ ScudCloud = { didStartLoading: function(){ }, didFinishLoading: function(){ - if(ScudCloud.unloaded){ - TS.ui.banner.close(); - ScudCloud.populate(); - ScudCloud.unloaded = false; - } + TS.ui.banner.close(); + ScudCloud.populate(); + ScudCloud.unloaded = false; }, setConnectionStatus: function(status){ // "online", "connecting", "offline" @@ -116,4 +115,6 @@ ScudCloud = { document.onpaste = function(e){desktop.pasted(false);}; window.winssb = TSSSB = ScudCloud; // Sometimes didFinishLoading is not loaded -ScudCloud.didFinishLoading(); +if(ScudCloud.unloaded){ + ScudCloud.didFinishLoading(); +} |