Remove firefox app installation

Lorenz Hübschle-Schneider 11 years ago
parent e50d0ebd2a
commit 10d2f81c75
  1. 19
      index.html
  2. 41
      js/glowingbear.js

@ -171,25 +171,6 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</div> </div>
</div> </div>
</div> </div>
<div class="panel" data-state="collapsed" ng-hide="isinstalled">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" ng-click="toggleAccordion($event)">
Install app
</a>
</h4>
</div>
<div id="collapseFour" class="panel-collapse collapse in">
<div class="panel-body">
<p>You don't need to install anything to use this app, it should work with any modern browser. Start using it <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">right now</a>! However, there are a few ways to improve integration with your operating system.</p>
<h3>Firefox</h3>
<p>If you have a recent version of Firefox you can install glowing bear as an app. Click the button to install.</p>
<button class="btn btn-lg btn-primary" ng-click="install()">Install Firefox app <i class="glyphicon glyphicon-chevron-right"></i></button>
<h3>Chrome</h3>
<p>To install glowing bear as an app in Chrome, select <kbd>Menu - Add to home screen</kbd> (Android) or <kbd>Menu - Tools - Create Application Shortcuts</kbd> (desktop version).</p>
</div>
</div>
</div>
<div class="panel" data-state="collapsed"> <div class="panel" data-state="collapsed">
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">

@ -25,23 +25,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$log.debug(watchers); $log.debug(watchers);
}; };
$scope.isinstalled = (function() {
// Check for firefox & app installed
if (navigator.mozApps !== undefined) {
navigator.mozApps.getSelf().onsuccess = function _onAppReady(evt) {
var app = evt.target.result;
if (app) {
return true;
} else {
return false;
}
};
} else {
return false;
}
}());
// Detect page visibility attributes // Detect page visibility attributes
(function() { (function() {
// Sadly, the page visibility API still has a lot of vendor prefixes // Sadly, the page visibility API still has a lot of vendor prefixes
@ -482,30 +465,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
connection.disconnect(); connection.disconnect();
}; };
//XXX this is a bit out of place here, either move up to the rest of the firefox install code or remove
$scope.install = function() {
if (navigator.mozApps !== undefined) {
// Find absolute url with trailing '/' or '/index.html' removed
var base_url = location.protocol + '//' + location.host +
location.pathname.replace(/\/(index\.html)?$/, '');
var request = navigator.mozApps.install(base_url + '/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+');
}
};
$scope.showModal = function(elementId) { $scope.showModal = function(elementId) {
document.getElementById(elementId).setAttribute('data-state', 'visible'); document.getElementById(elementId).setAttribute('data-state', 'visible');
}; };

Loading…
Cancel
Save