Load notifications script from background page

pull/749/head
lilia 10 years ago
parent f90f6328dd
commit ddbaf87741

@ -15,18 +15,19 @@
*/
;(function() {
'use strict';
extension.windows.getBackground(function(bg) {
$('.notifications .on button').click(function() {
Whisper.Notifications.disable();
bg.Whisper.Notifications.disable();
initOptions();
});
$('.notifications .off button').click(function() {
Whisper.Notifications.enable(initOptions);
bg.Whisper.Notifications.enable(initOptions);
initOptions();
});
function initOptions() {
if (Whisper.Notifications.isEnabled()) {
if (bg.Whisper.Notifications.isEnabled()) {
$('.notifications .on').show();
$('.notifications .off').hide();
} else {
@ -69,7 +70,6 @@
});
$(function() {
extension.windows.getBackground(function(bg) {
if (bg.textsecure.registration.isDone()) {
$('#complete-number').text(bg.textsecure.storage.user.getNumber());
$('#setup-complete').show().addClass('in');

@ -117,7 +117,6 @@
<script type="text/javascript" src="js/components.js"></script>
<script type="text/javascript" src="js/database.js"></script>
<script type="text/javascript" src="js/notifications.js"></script>
<script type="text/javascript" src="js/libphonenumber-util.js"></script>
<script type="text/javascript" src="js/models/messages.js"></script>
<script type="text/javascript" src="js/models/conversations.js"></script>

Loading…
Cancel
Save