lint compliance
parent
bbd59c6a2b
commit
dadcc519b7
|
@ -1170,9 +1170,6 @@ define([
|
|||
onLeave: function (m) {
|
||||
channel.bcast("PAD_LEAVE", m);
|
||||
},
|
||||
onAbort: function () {
|
||||
channel.bcast("PAD_DISCONNECT");
|
||||
},
|
||||
onError: function (err) {
|
||||
channel.bcast("PAD_ERROR", err);
|
||||
delete channels[data.channel];
|
||||
|
@ -1181,7 +1178,11 @@ define([
|
|||
channel.bcast("PAD_ERROR", err);
|
||||
delete channels[data.channel];
|
||||
},
|
||||
onConnectionChange: function () {},
|
||||
onConnectionChange: function (info) {
|
||||
if (!info.state) {
|
||||
channel.bcast("PAD_DISCONNECT");
|
||||
}
|
||||
},
|
||||
crypto: {
|
||||
// The encryption and decryption is done in the outer window.
|
||||
// This async-store only deals with already encrypted messages.
|
||||
|
|
|
@ -574,6 +574,49 @@ MessengerUI, Messages) {
|
|||
return $shareBlock;
|
||||
};
|
||||
|
||||
var createRequest = function (toolbar, config) {
|
||||
if (!config.metadataMgr) {
|
||||
throw new Error("You must provide a `metadataMgr` to display the request access button");
|
||||
}
|
||||
|
||||
// We can only requets more access if we're in read-only mode
|
||||
if (config.readOnly !== 1) { return; }
|
||||
|
||||
var $requestBlock = $('<button>', {
|
||||
'class': 'fa fa-lock cp-toolbar-share-button',
|
||||
title: Messages.requestEdit_button
|
||||
}).hide();
|
||||
|
||||
// If we have access to the owner's mailbox, display the button and enable it
|
||||
// false => check if we can contact the owner
|
||||
// true ==> send the request
|
||||
Common.getSframeChannel().query('Q_REQUEST_ACCESS', false, function (err, obj) {
|
||||
if (obj && obj.state) {
|
||||
var locked = false;
|
||||
$requestBlock.show().click(function () {
|
||||
if (locked) { return; }
|
||||
locked = true;
|
||||
Common.getSframeChannel().query('Q_REQUEST_ACCESS', true, function (err, obj) {
|
||||
if (obj && obj.state) {
|
||||
UI.log(Messages.requestEdit_sent);
|
||||
$requestBlock.hide();
|
||||
} else {
|
||||
locked = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
toolbar.$leftside.append($requestBlock);
|
||||
toolbar.request = $requestBlock;
|
||||
|
||||
return $requestBlock;
|
||||
};
|
||||
|
||||
createRequest = createRequest;
|
||||
|
||||
var createTitle = function (toolbar, config) {
|
||||
var $titleContainer = $('<span>', {
|
||||
'class': TITLE_CLS
|
||||
|
|
Loading…
Reference in New Issue