mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Merge branch 'update-icons' into spinner-animation
This commit is contained in:
commit
d9fb592a51
@ -413,8 +413,11 @@
|
||||
.cp-app-drive-icon-expcol {
|
||||
display: inline-flex;
|
||||
&:focus-visible {
|
||||
outline: @variables_focus_style;
|
||||
border-radius: @variables_radius_S;
|
||||
outline: none;
|
||||
svg {
|
||||
outline: @variables_focus_style;
|
||||
border-radius: @variables_radius_S;
|
||||
}
|
||||
}
|
||||
}
|
||||
.cp-app-drive-tree-docs {
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
border-radius: @variables_radius;
|
||||
color: @toolbar-color;
|
||||
.toolbar_button;
|
||||
padding: 3px 9px;
|
||||
padding: 3px 7px;
|
||||
&:hover {
|
||||
background-color: contrast(@cp_toolbar-bg, darken(@cp_toolbar-bg, 5%), lighten(@cp_toolbar-bg, 5%));
|
||||
}
|
||||
|
||||
@ -291,6 +291,7 @@ define([
|
||||
return [name, edPublic, action];
|
||||
});
|
||||
list.updateContent(newRows);
|
||||
Lucide.createIcons();
|
||||
};
|
||||
refreshTable();
|
||||
evRefreshAdmins.reg(() => {
|
||||
@ -388,6 +389,7 @@ define([
|
||||
}).nThen(() => {
|
||||
APP.updateStatus(function () {
|
||||
evRefreshAdmins.fire();
|
||||
Lucide.createIcons();
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -415,6 +417,7 @@ define([
|
||||
// refresh
|
||||
APP.updateStatus(function () {
|
||||
evRefreshAdmins.fire();
|
||||
Lucide.createIcons();
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -508,7 +511,7 @@ define([
|
||||
};
|
||||
|
||||
var copyToClipboard = (content) => {
|
||||
var button = blocks.activeButton('primary','', Messages.copyToClipboard, () => {
|
||||
var button = blocks.activeButton('primary','copy', Messages.copyToClipboard, () => {
|
||||
var toCopy = JSON.stringify(content, null, 2);
|
||||
Clipboard.copy(toCopy, (err) => {
|
||||
if (err) { return UI.warn(Messages.error); }
|
||||
@ -709,7 +712,7 @@ define([
|
||||
h('br'),
|
||||
h('small', Messages.admin_archiveAccountInfo)
|
||||
]);
|
||||
let archiveAccountButton = blocks.activeButton('danger', '',
|
||||
let archiveAccountButton = blocks.activeButton('danger', 'archive',
|
||||
Messages.admin_archiveButton, archiveHandler, true);
|
||||
row(archiveAccountLabel, archiveAccountButton);
|
||||
|
||||
@ -1053,10 +1056,8 @@ define([
|
||||
};
|
||||
redraw();
|
||||
|
||||
var upload = blocks.button('primary', '', Messages.admin_logoButton);
|
||||
upload.prepend(Icons.get('upload'));
|
||||
var remove = blocks.button('danger', '', Messages.admin_logoRemoveButton);
|
||||
remove.prepend(Icons.get('restore'));
|
||||
var upload = blocks.button('primary', 'upload', Messages.admin_logoButton);
|
||||
var remove = blocks.button('danger', 'restore', Messages.admin_logoRemoveButton);
|
||||
|
||||
let spinnerBlock = blocks.inline();
|
||||
let spinner = UI.makeSpinner($(spinnerBlock));
|
||||
@ -1148,8 +1149,7 @@ define([
|
||||
let labelPreview = blocks.labelledInput(Messages.admin_colorPreview, preview);
|
||||
let $preview = $(preview);
|
||||
|
||||
let remove = blocks.button('danger', '', Messages.admin_logoRemoveButton);
|
||||
remove.prepend(Icons.get('restore'));
|
||||
let remove = blocks.button('danger', 'restore', Messages.admin_logoRemoveButton);
|
||||
let $remove = $(remove);
|
||||
|
||||
let setColor = (color, done) => {
|
||||
@ -1290,7 +1290,7 @@ define([
|
||||
|
||||
// Msg.admin_invitationHint, admin_invitationTitle
|
||||
sidebar.addItem('invitation', function(cb){
|
||||
var button = blocks.button('primary', '', Messages.admin_invitationCreate);
|
||||
var button = blocks.button('primary', 'link', Messages.admin_invitationCreate);
|
||||
var $b = $(button);
|
||||
|
||||
var inputAlias = blocks.input({
|
||||
@ -1304,7 +1304,7 @@ define([
|
||||
var blockEmail = blocks.labelledInput(Messages.admin_invitationEmail, inputEmail);
|
||||
|
||||
var refreshInvite = function () {};
|
||||
var refreshButton = blocks.button('secondary', '', Messages.oo_refresh);
|
||||
var refreshButton = blocks.button('secondary', 'refresh', Messages.oo_refresh);
|
||||
Util.onClickEnter($(refreshButton), function () {
|
||||
refreshInvite();
|
||||
});
|
||||
@ -1603,7 +1603,7 @@ define([
|
||||
});
|
||||
var ssoEnabled = ApiConfig.sso && ApiConfig.sso.list && ApiConfig.sso.list.length;
|
||||
|
||||
var button = blocks.button('primary', '', Messages.admin_usersAdd);
|
||||
var button = blocks.button('primary', 'add', Messages.admin_usersAdd);
|
||||
var $b = $(button);
|
||||
|
||||
var userAlias = blocks.input({ type: 'text' });
|
||||
@ -1619,7 +1619,7 @@ define([
|
||||
var blockUser = blocks.labelledInput(Messages.admin_usersBlock, userBlock);
|
||||
|
||||
var refreshUsers = function () {};
|
||||
var refreshButton = blocks.button('secondary', '', Messages.oo_refresh);
|
||||
var refreshButton = blocks.button('secondary', 'refresh', Messages.oo_refresh);
|
||||
Util.onClickEnter($(refreshButton), function () {
|
||||
refreshUsers();
|
||||
});
|
||||
@ -1722,8 +1722,8 @@ define([
|
||||
var emailInput = h('input');
|
||||
$(aliasInput).val(data.alias);
|
||||
$(emailInput).val(data.email);
|
||||
var save = blocks.button('primary', '', Messages.settings_save);
|
||||
var cancel = blocks.button('secondary', '', Messages.cancel);
|
||||
var save = blocks.button('primary', 'save', Messages.settings_save);
|
||||
var cancel = blocks.button('secondary', 'close', Messages.cancel);
|
||||
Util.onClickEnter($(save), function () {
|
||||
var aliasVal = $(aliasInput).val().trim();
|
||||
if (!aliasVal) { return void UI.warn(Messages.error); }
|
||||
@ -1751,6 +1751,7 @@ define([
|
||||
wide: true,
|
||||
});
|
||||
});
|
||||
Lucide.createIcons();
|
||||
});
|
||||
newEntries.push([
|
||||
aliasCell,
|
||||
@ -1874,7 +1875,7 @@ define([
|
||||
var noteBlock = blocks.labelledInput(Messages.admin_limitSetNote, note);
|
||||
var $note = $(note);
|
||||
|
||||
var remove = blocks.button('danger', '', Messages.fc_remove );
|
||||
var remove = blocks.button('danger', 'restricted', Messages.fc_remove );
|
||||
var set = blocks.button('primary', '', Messages.admin_setlimitButton);
|
||||
|
||||
var nav = blocks.nav([set, remove]);
|
||||
@ -2003,6 +2004,7 @@ define([
|
||||
wide: true,
|
||||
});
|
||||
});
|
||||
Lucide.createIcons();
|
||||
});
|
||||
|
||||
var keyEl = h('code.cp-limit-key', key);
|
||||
@ -2038,7 +2040,7 @@ define([
|
||||
});
|
||||
var $input = $(input);
|
||||
|
||||
var btn = blocks.button('primary', '', Messages.ui_generateReport);
|
||||
var btn = blocks.button('primary', 'report', Messages.ui_generateReport);
|
||||
var $btn = $(btn);
|
||||
|
||||
var nav = blocks.nav([btn]);
|
||||
@ -2105,6 +2107,7 @@ define([
|
||||
results.innerHTML = '';
|
||||
results.appendChild(table);
|
||||
});
|
||||
Lucide.createIcons();
|
||||
});
|
||||
|
||||
cb(form);
|
||||
@ -2529,7 +2532,7 @@ define([
|
||||
|
||||
var results = blocks.inline([]);
|
||||
|
||||
var btn = blocks.button('primary', '', Messages.ui_generateReport);
|
||||
var btn = blocks.button('primary', 'report', Messages.ui_generateReport);
|
||||
var $btn = $(btn);
|
||||
|
||||
var nav = blocks.nav([btn]);
|
||||
@ -2634,7 +2637,7 @@ define([
|
||||
row(Messages.admin_totpRecoveryMethod, data.totp.recovery);
|
||||
|
||||
if (data.live) {
|
||||
var archiveButton = blocks.activeButton('danger', '', Messages.ui_archive, function () {
|
||||
var archiveButton = blocks.activeButton('danger', 'archive', Messages.ui_archive, function () {
|
||||
justifyArchivalDialog('', reason => {
|
||||
sframeCommand('ARCHIVE_BLOCK', {
|
||||
key: data.key,
|
||||
@ -2689,7 +2692,7 @@ define([
|
||||
value: ''
|
||||
});
|
||||
var $input = $(input);
|
||||
var btn = blocks.button('primary', '', Messages.ui_generateReport);
|
||||
var btn = blocks.button('primary', 'report', Messages.ui_generateReport);
|
||||
var $btn = $(btn);
|
||||
disable($btn);
|
||||
|
||||
@ -2780,7 +2783,7 @@ define([
|
||||
if (!data.totpCheck || !data.totp.enabled) { return tableObj.table; }
|
||||
|
||||
// TOTP is enabled and the signature is correct: display "disable TOTP" button
|
||||
var disableButton = blocks.button('danger', '', Messages.admin_totpDisableButton);
|
||||
var disableButton = blocks.button('danger', 'restricted', Messages.admin_totpDisableButton);
|
||||
UI.confirmButton(disableButton, { classes: 'btn-danger' }, () => {
|
||||
sframeCommand('DISABLE_MFA', data.key, (err, res) => {
|
||||
if (err) {
|
||||
@ -2816,7 +2819,7 @@ define([
|
||||
'aria-labelledby': 'cp-admin-totp-recovery'
|
||||
});
|
||||
var $input = $(textarea);
|
||||
var btn = blocks.button('primary','', Messages.admin_totpDisable);
|
||||
var btn = blocks.button('primary','restricted', Messages.admin_totpDisable);
|
||||
var $btn = $(btn);
|
||||
var results = blocks.inline([]);
|
||||
|
||||
@ -2886,7 +2889,7 @@ define([
|
||||
var onRefreshStats = Util.mkEvent();
|
||||
|
||||
sidebar.addItem('refresh-stats', function(cb){
|
||||
var btn = blocks.button('primary', '', Messages.oo_refresh);
|
||||
var btn = blocks.button('primary', 'refresh', Messages.oo_refresh);
|
||||
var $btn = $(btn);
|
||||
Util.onClickEnter($btn, function () {
|
||||
onRefreshStats.fire();
|
||||
@ -3060,6 +3063,7 @@ define([
|
||||
}));
|
||||
}).nThen(() => {
|
||||
onRefreshSupportEvt.fire({moderators, supportKey});
|
||||
Lucide.createIcons();
|
||||
});
|
||||
};
|
||||
const getMyData = () => {
|
||||
@ -3142,7 +3146,7 @@ define([
|
||||
});
|
||||
const $button = $(button).appendTo($div);
|
||||
|
||||
const delButton = blocks.activeButton('danger', '',
|
||||
const delButton = blocks.activeButton('danger', 'restricted',
|
||||
Messages.admin_supportDelete, done => {
|
||||
UI.confirm(Messages.admin_supportConfirm, function (yes) {
|
||||
if (!yes) { return void done(false); }
|
||||
@ -3161,7 +3165,7 @@ define([
|
||||
});
|
||||
const $delButton = $(delButton).hide();
|
||||
|
||||
const openButton = blocks.button('primary', '', Messages.admin_supportOpen);
|
||||
const openButton = blocks.button('primary', 'external-link', Messages.admin_supportOpen);
|
||||
const $openButton = $(openButton).hide();
|
||||
Util.onClickEnter($(openButton), () => {
|
||||
common.openURL('/moderation/');
|
||||
@ -3274,7 +3278,7 @@ define([
|
||||
data: friends
|
||||
}, function () {});
|
||||
|
||||
let addBtn = blocks.button('primary', '', Messages.tag_add);
|
||||
let addBtn = blocks.button('primary', 'add', Messages.tag_add);
|
||||
Util.onClickEnter($(addBtn), () => {
|
||||
var $sel = $(contactsGrid.div).find('.cp-usergrid-user.cp-selected');
|
||||
nThen((waitFor) => {
|
||||
@ -3433,7 +3437,7 @@ define([
|
||||
let send = function () {};
|
||||
var refresh = getApi(function (Broadcast) {
|
||||
$active.empty();
|
||||
var removeButton = blocks.button('danger', '', Messages.admin_maintenanceCancel);
|
||||
var removeButton = blocks.button('danger', 'close', Messages.admin_maintenanceCancel);
|
||||
|
||||
if (Broadcast && Broadcast.maintenance) {
|
||||
var m = Broadcast.maintenance;
|
||||
@ -3620,7 +3624,7 @@ define([
|
||||
var refresh = getApi(function(Broadcast) {
|
||||
var button = blocks.button('primary', '', Messages.admin_broadcastButton);
|
||||
var $button = $(button);
|
||||
var removeButton = blocks.button('danger', '', Messages.admin_broadcastCancel);
|
||||
var removeButton = blocks.button('danger', 'close', Messages.admin_broadcastCancel);
|
||||
var activeContent = Messages.admin_broadcastActive;
|
||||
var active = blocks.block(blocks.inline(activeContent), 'cp-broadcast-active');
|
||||
var $active = $(active);
|
||||
@ -3846,7 +3850,7 @@ define([
|
||||
var onRefreshPerformance = Util.mkEvent();
|
||||
|
||||
sidebar.addItem('refresh-performance', function(cb){
|
||||
var btn = blocks.button('primary', '', Messages.oo_refresh);
|
||||
var btn = blocks.button('primary', 'refresh', Messages.oo_refresh);
|
||||
Util.onClickEnter($(btn), function () {
|
||||
onRefreshPerformance.fire();
|
||||
});
|
||||
|
||||
@ -102,7 +102,7 @@ define([
|
||||
"chevron-right": "chevron-right",
|
||||
"chevron-down": "chevron-down",
|
||||
"chevron-up": "chevron-up",
|
||||
"copy": "files",
|
||||
"copy": "copy",
|
||||
"close": "x",
|
||||
"square": "square",
|
||||
"timer": "hourglass",
|
||||
@ -130,6 +130,7 @@ define([
|
||||
"ellipsis-horizontal": 'ellipsis',
|
||||
"toolbar-insert": "image-plus",
|
||||
"features": "info",
|
||||
"report": "clipboard-plus",
|
||||
// Login + Register
|
||||
"login": "log-in",
|
||||
"logout": "log-out",
|
||||
@ -149,6 +150,8 @@ define([
|
||||
"history-timeline-position": "chevron-down",
|
||||
"history-restore": "archive-restore",
|
||||
"remove-history": "eraser",
|
||||
"history-moderation": "archive",
|
||||
"archive": "archive",
|
||||
// Calendar
|
||||
"calendar": "calendar-days",
|
||||
"calendar-inactive": "calendar",
|
||||
@ -200,7 +203,9 @@ define([
|
||||
"notifications" : "notebook-text",
|
||||
"mute": "bell-off",
|
||||
"cursor": "text-cursor",
|
||||
"import": "import",
|
||||
"import": "download",
|
||||
"import-template": "file-down",
|
||||
"export": "upload",
|
||||
// Settings + Admin
|
||||
"settings": "settings",
|
||||
"apps-settings": "wrench",
|
||||
@ -208,7 +213,7 @@ define([
|
||||
"support": "life-buoy",
|
||||
"moderation": "ambulance",
|
||||
"broadcast": "radio",
|
||||
"support-ticket": "ticket",
|
||||
"support-ticket": "mail",
|
||||
"user-directory": "id-card",
|
||||
"database": "database",
|
||||
"stats": "chart-line",
|
||||
|
||||
@ -696,7 +696,7 @@ define([
|
||||
|
||||
switch (type) {
|
||||
case 'export':
|
||||
button = makeButton('download', 'cp-toolbar-icon-export', Messages.exportButtonTitle, Messages.exportButton);
|
||||
button = makeButton('export', 'cp-toolbar-icon-export', Messages.exportButtonTitle, Messages.exportButton);
|
||||
button
|
||||
.click(common.prepareFeedback(type))
|
||||
.click(UI.clearTooltipsDelay);
|
||||
@ -705,7 +705,7 @@ define([
|
||||
}
|
||||
break;
|
||||
case 'import':
|
||||
button = makeButton('upload', 'cp-toolbar-icon-import', Messages.importButtonTitle, Messages.importButton);
|
||||
button = makeButton('import', 'cp-toolbar-icon-import', Messages.importButtonTitle, Messages.importButton);
|
||||
var importer = importContent((data && data.binary) ? 'application/octet-stream' : 'text/plain', callback, {
|
||||
accept: data ? data.accept : undefined,
|
||||
binary: data ? data.binary : undefined
|
||||
@ -769,7 +769,7 @@ define([
|
||||
case 'importtemplate':
|
||||
if (!AppConfig.enableTemplates) { return; }
|
||||
if (!common.isLoggedIn()) { return; }
|
||||
button = makeButton('upload', 'cp-toolbar-icon-import-template', '', Messages.template_import);
|
||||
button = makeButton('import-template', 'cp-toolbar-icon-import-template', '', Messages.template_import);
|
||||
button
|
||||
.click(common.prepareFeedback(type))
|
||||
.click(function () {
|
||||
|
||||
@ -2834,6 +2834,10 @@ define([
|
||||
var showMode = function (mode) {
|
||||
var $gridIcon = $button.find('svg.lucide-layout-grid');
|
||||
var $listIcon = $button.find('svg.lucide-list');
|
||||
if (!$gridIcon.length && !$listIcon.length) {
|
||||
$gridIcon = $button.find('[data-lucide=layout-grid]');
|
||||
$listIcon = $button.find('[data-lucide=list]');
|
||||
}
|
||||
if (mode === 'grid') {
|
||||
$gridIcon.hide();
|
||||
$listIcon.show();
|
||||
@ -2843,7 +2847,7 @@ define([
|
||||
}
|
||||
};
|
||||
setViewMode(viewMode || 'grid');
|
||||
setTimeout(() => showMode(viewMode),0);
|
||||
showMode(viewMode);
|
||||
|
||||
$button.click(function () {
|
||||
var viewMode = getViewMode();
|
||||
|
||||
@ -160,21 +160,21 @@ define([
|
||||
var onRemoteChange = Util.mkEvent();
|
||||
var now = function () { return +new Date(); };
|
||||
var _lastUpdate = 0;
|
||||
var _updateBoards = function (framework, kanban, boards) {
|
||||
var _updateBoards = function (framework, kanban, boards, fixCursor) {
|
||||
_lastUpdate = now();
|
||||
var cursor = getCursor();
|
||||
let cursor;
|
||||
if (fixCursor) { cursor = getCursor(); }
|
||||
kanban.setBoards(Util.clone(boards));
|
||||
kanban.inEditMode = false;
|
||||
addEditItemButton(framework, kanban);
|
||||
addMoveElementButton(framework, kanban);
|
||||
restoreCursor(cursor);
|
||||
onRemoteChange.fire();
|
||||
if (cursor) { restoreCursor(cursor); }
|
||||
Lucide.createIcons();
|
||||
};
|
||||
var _updateBoardsThrottle = Util.throttle(_updateBoards, 1000);
|
||||
var updateBoards = function (framework, kanban, boards) {
|
||||
var updateBoards = function (framework, kanban, boards, fixCursor) {
|
||||
if ((now() - _lastUpdate) > 5000 || framework.isLocked()) {
|
||||
_updateBoards(framework, kanban, boards);
|
||||
_updateBoards(framework, kanban, boards, fixCursor);
|
||||
return;
|
||||
}
|
||||
_updateBoardsThrottle(framework, kanban, boards);
|
||||
@ -325,6 +325,9 @@ define([
|
||||
SFCodeMirror.mkIndentSettings(editor, framework._.cpNfInner.metadataMgr);
|
||||
editor.on('change', function () {
|
||||
var val = editor.getValue();
|
||||
if (!dataObject) {
|
||||
return editor.toTextArea();
|
||||
}
|
||||
if (dataObject.body === val) { return; }
|
||||
dataObject.body = val;
|
||||
commit();
|
||||
@ -1063,7 +1066,7 @@ define([
|
||||
// If the rendering has changed, update the value and redraw
|
||||
kanban.options.tagsAnd = tagsAnd;
|
||||
_tagsAnd = tagsAnd;
|
||||
updateBoards(framework, kanban, kanban.options.boards);
|
||||
updateBoards(framework, kanban, kanban.options.boards, false);
|
||||
});
|
||||
|
||||
if (migrated) { framework.localChange(); }
|
||||
@ -1511,7 +1514,8 @@ define([
|
||||
if (Sortify(currentContent) !== Sortify(remoteContent)) {
|
||||
verbose("Content is different.. Applying content");
|
||||
kanban.options.boards = remoteContent;
|
||||
updateBoards(framework, kanban, remoteContent);
|
||||
updateBoards(framework, kanban, remoteContent, true);
|
||||
onRemoteChange.fire();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -132,6 +132,9 @@
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
|
||||
svg {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -355,7 +355,7 @@ define([
|
||||
]
|
||||
},
|
||||
'closed': { // Msg.support_cat_closed
|
||||
icon: 'history',
|
||||
icon: 'history-moderation',
|
||||
content: [
|
||||
'refresh',
|
||||
'filter',
|
||||
|
||||
@ -994,7 +994,7 @@ define([
|
||||
// If you're an admin or an owner, you can invite your friends to the team
|
||||
// TODO and acquaintances later?
|
||||
if (me && (me.role === 'ADMIN' || me.role === 'OWNER')) {
|
||||
var invite = h('button.cp-online.btn.btn-primary', Messages.team_inviteButton);
|
||||
var invite = h('button.cp-online.btn.btn-primary', [Icons.get('send'), Messages.team_inviteButton]);
|
||||
var inviteFriends = common.getFriends();
|
||||
Object.keys(inviteFriends).forEach(function (curve) {
|
||||
// Keep only friends that are not already in the team and that you can contact
|
||||
@ -1015,7 +1015,7 @@ define([
|
||||
$header.append(invite);
|
||||
}
|
||||
|
||||
var leave = h('button.cp-online.btn.btn-danger', Messages.team_leaveButton);
|
||||
var leave = h('button.cp-online.btn.btn-danger', [Icons.get('logout'),Messages.team_leaveButton]);
|
||||
$(leave).click(function () {
|
||||
if (me && me.role === 'OWNER') {
|
||||
return void UI.alert(Messages.team_leaveOwner);
|
||||
@ -1033,7 +1033,7 @@ define([
|
||||
});
|
||||
$header.append(leave);
|
||||
|
||||
var table = h('button.btn.btn-primary', Messages.teams_table);
|
||||
var table = h('button.btn.btn-primary', [Icons.get('teams'), Messages.teams_table]);
|
||||
$(table).click(function (e) {
|
||||
e.stopPropagation();
|
||||
makePermissions();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user