Add access button in all the apps

pull/1/head
yflory 5 years ago
parent 620995506e
commit 521db379a0

@ -1802,6 +1802,26 @@ define([
}); });
updateIcon(data.element.is(':visible')); updateIcon(data.element.is(':visible'));
break; break;
case 'access':
button = $('<button>', {
'class': 'fa fa-unlock-alt cp-toolbar-icon-access',
title: "ACCESS", // XXX
}).append($('<span>', {'class': 'cp-toolbar-drawer-element'})
.text("ACCESS")) // XXX
.click(common.prepareFeedback(type))
.click(function () {
common.isPadStored(function (err, data) {
if (!data) {
return void UI.alert(Messages.autostore_notAvailable);
}
require(['/common/inner/access.js'], function (Access) {
Access.getAccessModal(common, {}, function (e) {
if (e) { console.error(e); }
});
});
});
});
break;
case 'properties': case 'properties':
button = $('<button>', { button = $('<button>', {
'class': 'fa fa-info-circle cp-toolbar-icon-properties', 'class': 'fa fa-info-circle cp-toolbar-icon-properties',

@ -940,7 +940,7 @@ define([
var canMute = data.mailbox && owned === true && ( var canMute = data.mailbox && owned === true && (
(typeof (data.mailbox) === "string" && data.owners[0] === edPublic) || (typeof (data.mailbox) === "string" && data.owners[0] === edPublic) ||
data.mailbox[edPublic]); data.mailbox[edPublic]);
if (owned === true) { if (owned === true) { // XXX not for files
var cbox = UI.createCheckbox('cp-access-mute', Messages.access_muteRequests, !canMute); var cbox = UI.createCheckbox('cp-access-mute', Messages.access_muteRequests, !canMute);
var $cbox = $(cbox); var $cbox = $(cbox);
var spinner = UI.makeSpinner($cbox); var spinner = UI.makeSpinner($cbox);
@ -1067,6 +1067,7 @@ define([
})); }));
if (!owned) { return; } if (!owned) { return; }
// XXX if "file" ==> don't show "allow" and "owners"
getAllowTab(common, data, opts, waitFor(function (e, c) { getAllowTab(common, data, opts, waitFor(function (e, c) {
if (e) { if (e) {

@ -1479,6 +1479,8 @@ define([
var $properties = common.createButton('properties', true); var $properties = common.createButton('properties', true);
toolbar.$drawer.append($properties); toolbar.$drawer.append($properties);
var $access = common.createButton('access', true);
toolbar.$drawer.append($access);
}; };
config.onReady = function (info) { config.onReady = function (info) {

@ -699,6 +699,8 @@ define([
var $properties = common.createButton('properties', true); var $properties = common.createButton('properties', true);
toolbar.$drawer.append($properties); toolbar.$drawer.append($properties);
var $access = common.createButton('access', true);
toolbar.$drawer.append($access);
createFilePicker(); createFilePicker();

@ -132,6 +132,7 @@ define([
title: Title.getTitleConfig(), title: Title.getTitleConfig(),
}); });
toolbar.$rightside.append(common.createButton('forget', true)); toolbar.$rightside.append(common.createButton('forget', true));
toolbar.$rightside.append(common.createButton('access', true));
toolbar.$rightside.append(common.createButton('properties', true)); toolbar.$rightside.append(common.createButton('properties', true));
if (common.isLoggedIn()) { if (common.isLoggedIn()) {
toolbar.$rightside.append(common.createButton('hashtag', true)); toolbar.$rightside.append(common.createButton('hashtag', true));

@ -1171,6 +1171,8 @@ define([
var $forgetPad = common.createButton('forget', true, {}, forgetCb); var $forgetPad = common.createButton('forget', true, {}, forgetCb);
$rightside.append($forgetPad); $rightside.append($forgetPad);
var $access = common.createButton('access', true);
$drawer.append($access);
var $properties = common.createButton('properties', true); var $properties = common.createButton('properties', true);
$drawer.append($properties); $drawer.append($properties);

Loading…
Cancel
Save