From 641faa4df31d3d135e14c1dbb75205ab81847127 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 21 Oct 2013 15:51:05 +0200 Subject: [PATCH 1/8] App support for firefox --- index.html | 16 +++++++++++++++- js/websockets.js | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 08e7ff8..97841c7 100644 --- a/index.html +++ b/index.html @@ -120,7 +120,21 @@ /relay sslcertkey /relay add ssl.weechat 8000 - + + + +
+ +
+
+

If you have a very new Firefox you can install the frontend as an app. Click the button to install.

+
diff --git a/js/websockets.js b/js/websockets.js index 187fbfd..a84cda9 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -336,6 +336,20 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', window.webkitNotifications.requestPermission(); } } + // Check for firefox & app installed + if(navigator.mozApps != undefined) { + navigator.mozApps.getSelf().onsuccess = function _onAppReady(evt) { + var app = evt.target.result; + if(app) { + $scope.isinstalled = true; + }else { + $scope.isinstalled = false; + } + console.log($scope.isinstalled); + } + }else { + $scope.isinstalled = false; + } $rootScope.$on('activeBufferChanged', function() { $rootScope.scrollToBottom(); @@ -432,6 +446,26 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.disconnect = function() { connection.disconnect(); } + $scope.install = function() { + if(navigator.mozApps != undefined) { + var request = navigator.mozApps.install('http://torhve.github.io/glowing-bear/manifest.webapp'); + request.onsuccess = function () { + $scope.isinstalled = true; + // Save the App object that is returned + var appRecord = this.result; + // Start the app. + appRecord.launch(); + alert('Installation successful!'); + }; + request.onerror = function () { + // Display the error information from the DOMError object + alert('Install failed, error: ' + this.error.name); + }; + }else{ + alert('Sorry. Only supported in Firefox v26+'); + } + } + /* Function gets called from bufferLineAdded code if user should be notified */ $rootScope.createHighlight = function(buffer, message) { From 9e88f7775e9375155b0d17a918ccc365e9ef6eb1 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 21 Oct 2013 15:51:55 +0200 Subject: [PATCH 2/8] Add firefox app manifest --- manifest.webapp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 manifest.webapp diff --git a/manifest.webapp b/manifest.webapp new file mode 100644 index 0000000..3e6db2b --- /dev/null +++ b/manifest.webapp @@ -0,0 +1,16 @@ +{ + "name": "WeeChat", + "description": "WeeChat Web frontend", + "icons": { + "128": "/glowing-bear/img/favicon.png" + }, + "installs_allowed_from": [ + "*" + ], + "developer": { + "name": "Tor Hveem", + "url": "http://github.com/torhve/" + }, + "default_locale": "en" +} + From 5cd2fa19faf4ce7116e73fe50f603b927e308f5e Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 21 Oct 2013 16:12:58 +0200 Subject: [PATCH 3/8] Add chrome app manifest. To test, check: http://developer.chrome.com/apps/first_app.html --- manifest.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 manifest.json diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..5a8e96b --- /dev/null +++ b/manifest.json @@ -0,0 +1,25 @@ +{ + "name": "Weechat", + "description": "WeeChat Web frontend", + "version": "0.0.0.1", + "manifest_version": 2, + "icons": { + "32": "img/favicon.png", + "128": "img/weechat_logo_128x128.png" + }, + "app": { + "urls": [ + "http://torhve.github.io/glowing-bear/" + ], + "launch": { + "web_url": "http://torhve.github.io/glowing-bear/" + } + }, + "permissions": [ + "notifications" + ], + "web_accessible_resources": [ + "img/favicon.png" + ], +} +} From f07981cdefd3cc27f32e4bbc3925effc6ce29b9b Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 21 Oct 2013 16:15:46 +0200 Subject: [PATCH 4/8] Add 128x128 icon --- img/weechat_logo_128x128.png | Bin 0 -> 9970 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 img/weechat_logo_128x128.png diff --git a/img/weechat_logo_128x128.png b/img/weechat_logo_128x128.png new file mode 100644 index 0000000000000000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ufV#2aqL7dzs%_9cCln~ewC%pv73!HXRdRYQ} z3fE4NFM3VBDG5(*gp1zC0UP_KnBBr7c(;RhC8u!XiMK=3bB9nEH@*t)l)m(6J;>(mU`aT9kY&NqsZlsd3crqIZhVdH|5~WzODpsWr;lJ% zap7QNuhF2>rO!_xT}HBx6Ov1M`Cg_V3Lb69e?twC=l_fl-SK-xiCZC&$ zwa(33zgnG?3sk_W-Nvr}2>gq!St{dFE9FvL5^PYS)SUimxl(G^L1vhd!}#UsHP%8W zJoxVm^ViTTW4oW`PiB{DU9~(C{eC7X?^OFJrnG8tLcI=0( zFoKO7>a$~cw&PnPqE+TxCs+CN~d)U%LDK?AT+}95=(hP9AI}<(;1Xa+N;IP}5I Date: Mon, 21 Oct 2013 16:18:16 +0200 Subject: [PATCH 5/8] Fix version, path and icon --- manifest.webapp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manifest.webapp b/manifest.webapp index 3e6db2b..8ef9ff5 100644 --- a/manifest.webapp +++ b/manifest.webapp @@ -2,8 +2,9 @@ "name": "WeeChat", "description": "WeeChat Web frontend", "icons": { - "128": "/glowing-bear/img/favicon.png" + "128": "/glowing-bear/img/weechat_logo_128x128.png" }, + "launch_path": "/glowing-bear/", "installs_allowed_from": [ "*" ], @@ -11,6 +12,7 @@ "name": "Tor Hveem", "url": "http://github.com/torhve/" }, - "default_locale": "en" + "default_locale": "en", + "version": "2" } From 29e767e989af3a06fa2acf63d0ed326312570c53 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Mon, 21 Oct 2013 16:23:42 +0200 Subject: [PATCH 6/8] Add icon size --- manifest.webapp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifest.webapp b/manifest.webapp index 8ef9ff5..e9c20fa 100644 --- a/manifest.webapp +++ b/manifest.webapp @@ -2,7 +2,8 @@ "name": "WeeChat", "description": "WeeChat Web frontend", "icons": { - "128": "/glowing-bear/img/weechat_logo_128x128.png" + "128": "img/weechat_logo_128x128.png", + "32": "img/favicon.png" }, "launch_path": "/glowing-bear/", "installs_allowed_from": [ From e974dde95c960a5d81acd129febbd3906bb967a0 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Tue, 22 Oct 2013 13:26:35 +0200 Subject: [PATCH 7/8] Fix markup error --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 97841c7..e7f5e38 100644 --- a/index.html +++ b/index.html @@ -33,7 +33,7 @@ Oh no! We cannot connect! From abed2b753fcf82f7979ddceeef5560230a52966b Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Tue, 22 Oct 2013 13:35:55 +0200 Subject: [PATCH 8/8] Make the white border on the panels pretty --- css/glowingbear.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/css/glowingbear.css b/css/glowingbear.css index f468ccd..09c3d97 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -36,6 +36,12 @@ body { box-shadow: rgba(255, 255, 255, 0.07) -1px 0 0; border-left: 1px solid #121212; } +.panel-group .panel-heading + .panel-collapse .panel-body { +-webkit-box-shadow: rgba(255, 255, 255, 0.07) 0 -1px 0; + -moz-box-shadow: rgba(255, 255, 255, 0.07) 0 -1px 0; + box-shadow: rgba(255, 255, 255, 0.07) 0 -1px 0; + border-top: 1px solid #121212; +} input#sendMessage { border: 0;