Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
36
gaia/apps/network-alerts/js/notification/notification.js
Executable file
36
gaia/apps/network-alerts/js/notification/notification.js
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
(function(exports) {
|
||||
|
||||
function init() {
|
||||
window.navigator.mozSetMessageHandler('notification', onNotification);
|
||||
}
|
||||
|
||||
function closeWindow() {
|
||||
window.close();
|
||||
}
|
||||
|
||||
function onNotification(message) {
|
||||
if (!message.clicked) {
|
||||
closeWindow();
|
||||
return;
|
||||
}
|
||||
|
||||
var title = message.data.title;
|
||||
|
||||
var url = [
|
||||
'attention.html?title=',
|
||||
encodeURIComponent(title),
|
||||
'&body=',
|
||||
encodeURIComponent(message.body),
|
||||
'¬ification=1'
|
||||
].join('');
|
||||
|
||||
window.open(url, '_blank', 'attention');
|
||||
}
|
||||
|
||||
exports.NotificationHandler = {
|
||||
init: init
|
||||
};
|
||||
|
||||
})(window);
|
||||
7
gaia/apps/network-alerts/js/notification/startup.js
Executable file
7
gaia/apps/network-alerts/js/notification/startup.js
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
/* global NotificationHandler */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function() {
|
||||
NotificationHandler.init();
|
||||
})();
|
||||
Loading…
Reference in a new issue