Enable notifications in secure pads
parent
642dc17910
commit
51fa6287c1
|
@ -75,6 +75,10 @@ define([
|
|||
});
|
||||
};
|
||||
|
||||
funcs.notify = function () {
|
||||
ctx.sframeChan.event('EV_NOTIFY');
|
||||
};
|
||||
|
||||
funcs.setLoginRedirect = function (cb) {
|
||||
ctx.sframeChan.query('Q_SET_LOGIN_REDIRECT', null, function (err) {
|
||||
if (cb) { cb(err); }
|
||||
|
|
|
@ -78,4 +78,8 @@ define({
|
|||
'Q_SEND_FRIEND_REQUEST': true, // Up query
|
||||
'Q_INCOMING_FRIEND_REQUEST': true, // Down query
|
||||
'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
|
||||
var oldSInner = stringify(JSON.parse(oldShjson)[2]);
|
||||
if (newSInner && newSInner !== oldSInner) {
|
||||
Cryptpad.notify();
|
||||
common.notify();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -151,6 +151,10 @@ define([
|
|||
Cryptpad.logout(cb);
|
||||
});
|
||||
|
||||
sframeChan.on('EV_NOTIFY', function () {
|
||||
Cryptpad.notify();
|
||||
});
|
||||
|
||||
sframeChan.on('Q_SET_LOGIN_REDIRECT', function (data, cb) {
|
||||
sessionStorage.redirectTo = window.location.href;
|
||||
cb();
|
||||
|
|
Loading…
Reference in New Issue