mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Merge branch 'sidebar' into support2
This commit is contained in:
commit
b4d9a0d4c1
@ -127,22 +127,22 @@
|
||||
margin-bottom: 0;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
th{
|
||||
th {
|
||||
max-width: 60vw;
|
||||
border: 1px solid #777;
|
||||
padding: 7px;
|
||||
}
|
||||
td{
|
||||
td {
|
||||
padding: 2px;
|
||||
}
|
||||
.cp-checkmark{
|
||||
.cp-checkmark {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
.cp-broadcast-container{
|
||||
.cp-broadcast-container {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
}
|
||||
.cp-broadcast-lang{
|
||||
.cp-broadcast-lang {
|
||||
order: 4;
|
||||
margin: 30px;
|
||||
margin-bottom: 0;
|
||||
@ -150,10 +150,6 @@
|
||||
flex-flow: column;
|
||||
align-items: baseline;
|
||||
}
|
||||
.button.btn.primary.cp-report{
|
||||
margin-left: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.cp-sidebar-list {
|
||||
pre {
|
||||
margin: 0;
|
||||
|
||||
@ -227,9 +227,8 @@ define([
|
||||
|
||||
sidebar.addItem = (key, get, options) => {
|
||||
const safeKey = keyToCamlCase(key);
|
||||
get((content, config) => {
|
||||
get((content) => {
|
||||
if (content === false) { return; }
|
||||
config = config || {};
|
||||
options = options || {};
|
||||
const title = options.noTitle ? undefined : h('label.cp-item-label', {
|
||||
id: `cp-${app}-${key}`
|
||||
|
||||
@ -48,8 +48,6 @@ define([
|
||||
|
||||
var Nacl = window.nacl;
|
||||
var common;
|
||||
var metadataMgr;
|
||||
var privateData;
|
||||
var sFrameChan;
|
||||
|
||||
var andThen = function (common, $container) {
|
||||
@ -468,7 +466,7 @@ define([
|
||||
row(archiveAccountLabel, archiveAccountButton);
|
||||
|
||||
// archive owned documents
|
||||
/* // TODO not implemented
|
||||
/* // TODO not implemented
|
||||
var archiveDocuments = () => {
|
||||
justifyRestorationDialog(Messages.admin_archiveDocumentsConfirm, reason => {
|
||||
sframeCommand('ARCHIVE_OWNED_DOCUMENTS', {
|
||||
@ -3395,8 +3393,6 @@ define([
|
||||
if (!common.isAdmin()) { return; }
|
||||
updateStatus(waitFor());
|
||||
}).nThen(function( /*waitFor*/ ) {
|
||||
metadataMgr = common.getMetadataMgr();
|
||||
privateData = metadataMgr.getPrivateData();
|
||||
common.setTabTitle(Messages.adminPage || 'Administration');
|
||||
|
||||
if (!common.isAdmin()) {
|
||||
|
||||
@ -35,7 +35,7 @@ define([
|
||||
category = window.location.hash.slice(1);
|
||||
window.location.hash = '';
|
||||
}
|
||||
var addData = function (obj, Cryptpad, user, Utils) {
|
||||
var addData = function (obj) {
|
||||
if (category) { obj.category = category; }
|
||||
};
|
||||
SFCommonO.start({
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
@import (reference) '../../customize/src/less2/include/sidebar-layout.less';
|
||||
@import (reference) "../../customize/src/less2/include/limit-bar.less";
|
||||
@import (reference) "../../customize/src/less2/include/creation.less";
|
||||
@import (reference) '../../customize/src/less2/include/framework.less';
|
||||
@import (reference) '../../customize/src/less2/include/export.less';
|
||||
|
||||
&.cp-app-sidebar {
|
||||
.framework_min_main();
|
||||
.sidebar-layout_main();
|
||||
.limit-bar_main();
|
||||
.creation_main();
|
||||
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
font: @colortheme_app-font;
|
||||
}
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CryptPad</title>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<script src="/customize/pre-loading.js?ver=1.1"></script>
|
||||
<link href="/customize/src/pre-loading.css?ver=1.0" rel="stylesheet" type="text/css">
|
||||
<script async data-bootload="main.js" data-main="/common/boot.js?ver=1.0" src="/components/requirejs/require.js?ver=2.3.5"></script>
|
||||
<link href="/customize/src/outer.css?ver=1.3.2" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<noscript></noscript>
|
||||
<iframe-placeholder>
|
||||
@ -1,22 +0,0 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html class="cp-app-noscroll">
|
||||
<head>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
||||
<script src="/customize/pre-loading.js?ver=1.1"></script>
|
||||
<link href="/customize/src/pre-loading.css?ver=1.0" rel="stylesheet" type="text/css">
|
||||
<script async data-bootload="/sidebar/inner.js" data-main="/common/sframe-boot.js?ver=1.11" src="/components/requirejs/require.js?ver=2.3.5"></script>
|
||||
<style>
|
||||
.loading-hidden { display: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body class="cp-app-sidebar">
|
||||
<div id="cp-toolbar" class="cp-toolbar-container"></div>
|
||||
<div id="cp-sidebarlayout-container"></div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,111 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
define([
|
||||
'jquery',
|
||||
'/common/toolbar.js',
|
||||
'/components/nthen/index.js',
|
||||
'/common/sframe-common.js',
|
||||
'/common/common-interface.js',
|
||||
'/common/common-ui-elements.js',
|
||||
'/common/common-util.js',
|
||||
'/common/common-hash.js',
|
||||
'/common/inner/sidebar-layout.js',
|
||||
'/customize/messages.js',
|
||||
'/common/hyperscript.js',
|
||||
'/customize/application_config.js',
|
||||
'/api/config',
|
||||
|
||||
'css!/components/bootstrap/dist/css/bootstrap.min.css',
|
||||
'css!/components/components-font-awesome/css/font-awesome.min.css',
|
||||
'less!/sidebar/app-sidebar.less',
|
||||
], function(
|
||||
$,
|
||||
Toolbar,
|
||||
nThen,
|
||||
SFCommon,
|
||||
UI,
|
||||
UIElements,
|
||||
Util,
|
||||
Hash,
|
||||
Sidebar,
|
||||
Messages,
|
||||
h,
|
||||
AppConfig,
|
||||
ApiConfig,
|
||||
) {
|
||||
var APP = window.APP = {};
|
||||
|
||||
var common;
|
||||
var metadataMgr;
|
||||
var privateData;
|
||||
var sframeChan;
|
||||
|
||||
var andThen = function (common, $container) {
|
||||
const sidebar = Sidebar.create(common, 'sidebar', $container);
|
||||
var categories = {
|
||||
'users': {
|
||||
icon: 'fa fa-users',
|
||||
content: [
|
||||
'invitations',
|
||||
'directory'
|
||||
]
|
||||
},
|
||||
'test': {
|
||||
icon: 'fa fa-bell',
|
||||
content: [
|
||||
]
|
||||
},
|
||||
'click': {
|
||||
icon: 'fa fa-file',
|
||||
onClick: () => {
|
||||
common.openUnsafeURL('https://cryptpad.fr');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const blocks = sidebar.blocks;
|
||||
sidebar.addItem('invitations', function (cb) {
|
||||
var input = h('input', {type:'number'});
|
||||
var label = blocks.labelledInput('Test Input label', input);
|
||||
var button = blocks.button('secondary', 'fa-question', "My Button text");
|
||||
var content = blocks.form(label, blocks.nav(button));
|
||||
cb(content);
|
||||
});
|
||||
|
||||
sidebar.makeLeftside(categories);
|
||||
};
|
||||
|
||||
|
||||
nThen(function(waitFor) {
|
||||
$(waitFor(UI.addLoadingScreen));
|
||||
SFCommon.create(waitFor(function(c) { APP.common = common = c; }));
|
||||
}).nThen(function(waitFor) {
|
||||
APP.$container = $('#cp-sidebarlayout-container');
|
||||
APP.$toolbar = $('#cp-toolbar');
|
||||
sframeChan = common.getSframeChannel();
|
||||
sframeChan.onReady(waitFor());
|
||||
}).nThen(function( /*waitFor*/ ) {
|
||||
metadataMgr = common.getMetadataMgr();
|
||||
privateData = metadataMgr.getPrivateData();
|
||||
|
||||
// Toolbar
|
||||
var displayed = ['useradmin', 'newpad', 'limit', 'pageTitle', 'notifications'];
|
||||
var configTb = {
|
||||
displayed: displayed,
|
||||
sfCommon: common,
|
||||
$container: APP.$toolbar,
|
||||
pageTitle: 'TEST SIDEBAR',
|
||||
metadataMgr: common.getMetadataMgr(),
|
||||
};
|
||||
APP.toolbar = Toolbar.create(configTb);
|
||||
APP.toolbar.$rightside.hide();
|
||||
|
||||
// Content
|
||||
andThen(common, APP.$container);
|
||||
|
||||
common.setTabTitle(Messages.settings_title);
|
||||
UI.removeLoadingScreen();
|
||||
});
|
||||
});
|
||||
@ -1,32 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
// Load #1, load as little as possible because we are in a race to get the loading screen up.
|
||||
define([
|
||||
'/components/nthen/index.js',
|
||||
'/api/config',
|
||||
'/common/dom-ready.js',
|
||||
'/common/sframe-common-outer.js'
|
||||
], function (nThen, ApiConfig, DomReady, SFCommonO) {
|
||||
|
||||
// Loaded in load #2
|
||||
nThen(function (waitFor) {
|
||||
DomReady.onReady(waitFor());
|
||||
}).nThen(function (waitFor) {
|
||||
SFCommonO.initIframe(waitFor);
|
||||
}).nThen(function (/*waitFor*/) {
|
||||
var category;
|
||||
if (window.location.hash) {
|
||||
category = window.location.hash.slice(1);
|
||||
window.location.hash = '';
|
||||
}
|
||||
var addData = function (obj, Cryptpad, user, Utils) {
|
||||
if (category) { obj.category = category; }
|
||||
};
|
||||
SFCommonO.start({
|
||||
noRealtime: true,
|
||||
addData: addData
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user