Enable notifications in secure pads
This commit is contained in:
@@ -75,6 +75,10 @@ define([
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
funcs.notify = function () {
|
||||||
|
ctx.sframeChan.event('EV_NOTIFY');
|
||||||
|
};
|
||||||
|
|
||||||
funcs.setLoginRedirect = function (cb) {
|
funcs.setLoginRedirect = function (cb) {
|
||||||
ctx.sframeChan.query('Q_SET_LOGIN_REDIRECT', null, function (err) {
|
ctx.sframeChan.query('Q_SET_LOGIN_REDIRECT', null, function (err) {
|
||||||
if (cb) { cb(err); }
|
if (cb) { cb(err); }
|
||||||
|
|||||||
@@ -78,4 +78,8 @@ define({
|
|||||||
'Q_SEND_FRIEND_REQUEST': true, // Up query
|
'Q_SEND_FRIEND_REQUEST': true, // Up query
|
||||||
'Q_INCOMING_FRIEND_REQUEST': true, // Down query
|
'Q_INCOMING_FRIEND_REQUEST': true, // Down query
|
||||||
'EV_FRIEND_REQUEST': true, // Down event when the request is complete
|
'EV_FRIEND_REQUEST': true, // Down event when the request is complete
|
||||||
|
|
||||||
|
// Set the tab notification when the content of the pad changes
|
||||||
|
'EV_NOTIFY': true,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ define([
|
|||||||
// Notify only when the content has changed, not when someone has joined/left
|
// Notify only when the content has changed, not when someone has joined/left
|
||||||
var oldSInner = stringify(JSON.parse(oldShjson)[2]);
|
var oldSInner = stringify(JSON.parse(oldShjson)[2]);
|
||||||
if (newSInner && newSInner !== oldSInner) {
|
if (newSInner && newSInner !== oldSInner) {
|
||||||
Cryptpad.notify();
|
common.notify();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,10 @@ define([
|
|||||||
Cryptpad.logout(cb);
|
Cryptpad.logout(cb);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sframeChan.on('EV_NOTIFY', function () {
|
||||||
|
Cryptpad.notify();
|
||||||
|
});
|
||||||
|
|
||||||
sframeChan.on('Q_SET_LOGIN_REDIRECT', function (data, cb) {
|
sframeChan.on('Q_SET_LOGIN_REDIRECT', function (data, cb) {
|
||||||
sessionStorage.redirectTo = window.location.href;
|
sessionStorage.redirectTo = window.location.href;
|
||||||
cb();
|
cb();
|
||||||
|
|||||||
Reference in New Issue
Block a user