Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #158 from marcoceppi/unity-web-apps

Reall goof'd this one up
  • Loading branch information...
commit e7a01e220483238a3e9aeed07a2df79a47956daa 2 parents 4b46d78 + 8fba729
David Petersen authored
Showing with 17 additions and 10 deletions.
  1. +15 −9 assets/js/client.js
  2. +2 −1  assets/js/collections.js
24 assets/js/client.js
View
@@ -19,7 +19,7 @@ window.irc = {
};
window.unity = {
- api: external.getUnityObject(1.0),
+ api: null,
connected: false
};
@@ -27,14 +27,20 @@ $(function() {
// window.app = new ChatApplicationRouter;
irc.appView = new ChatApplicationView();
-
- window.unity.init({
- name: "Subay IRC",
- iconUrl: window.location.protocol+"//"+window.location.host+"/assets/images/subway.png",
- onInit: function() {
- window.unity.connected = true;
- }
- });
+ try {
+ window.unity.api = external.getUnityObject(1.0);
+ window.unity.init({
+ name: "Subay IRC",
+ iconUrl: window.location.protocol+"//"+window.location.host+"/assets/images/subway.png",
+ onInit: function() {
+ window.unity.connected = true;
+ console.log('Unity support enabled');
+ }
+ });
+ } catch(e) {
+ window.unity.api = null;
+ console.log('Unity support not available');
+ }
// EVENTS //
3  assets/js/collections.js
View
@@ -67,7 +67,7 @@ var WindowList = Backbone.Collection.extend({
}, 0);
return count;
- }
+ },
unreadByChannel: function() {
var channels = this.byType('channel');
@@ -83,6 +83,7 @@ var WindowList = Backbone.Collection.extend({
});
return windowCounts;
+ }
});
var UserList = Backbone.Collection.extend({
Please sign in to comment.
Something went wrong with that request. Please try again.