Rename drawio to digram

https://github.com/cryptpad/cryptpad/issues/1062
This commit is contained in:
Wolfgang Ginolas 2023-06-22 14:59:13 +02:00
parent 3f8422d99b
commit f7d56eea16
10 changed files with 24 additions and 24 deletions

View File

@ -12,7 +12,7 @@
poll: #2c9e98;
form: #2c9e98;
whiteboard: #a72ba7;
drawio: #f447fa; // XXX placeholder
diagram: #f447fa; // XXX placeholder
kanban: #8C4;
sheet: #40865c;
doc: #5170B5;

View File

@ -12,7 +12,7 @@
poll: #2c9e98;
form: #2c9e98;
whiteboard: #a72ba7;
drawio: #f447fa; // XXX placeholder
diagram: #f447fa; // XXX placeholder
kanban: #8C4;
sheet: #40865c;
doc: #5170B5;

View File

@ -47,7 +47,7 @@ Default.padContentSecurity = function (Env) {
return (Default.commonCSP(Env).join('; ') + "script-src 'self' 'unsafe-eval' 'unsafe-inline' resource: " + Env.httpUnsafeOrigin).replace(/\s+/g, ' ');
};
Default.drawioContentSecurity = function (Env) {
Default.diagramContentSecurity = function (Env) {
return (Default.commonCSP(Env).join('; ') + "script-src 'self' 'sha256-vrEVJkYyBW9H4tt1lYZtK5fDowIeRwUgYZfFTT36YpE=' 'sha256-6g514VrT/cZFZltSaKxIVNFF46+MFaTSDTPB8WfYK+c=' resource: " + Env.httpUnsafeOrigin).replace(/\s+/g, ' ');
};

View File

@ -64,8 +64,8 @@ var getHeaders = function (Env, type) {
var csp;
if (type === 'office') {
csp = Default.padContentSecurity(Env);
} else if (type === 'drawio') {
csp = Default.drawioContentSecurity(Env);
} else if (type === 'diagram') {
csp = Default.diagramContentSecurity(Env);
} else {
csp = Default.contentSecurity(Env);
}
@ -97,7 +97,7 @@ var setHeaders = function (req, res) {
} else if (/^\/api\/(broadcast|config)/.test(req.url)) {
type = 'api';
} else if (/^\/bower_components\/drawio\/src\/main\/webapp\/index.html.*$/.test(req.url)) {
type = 'drawio';
type = 'diagram';
} else {
type = 'standard';
}

View File

@ -12,7 +12,7 @@ define(function() {
* You should never remove the drive from this list.
*/
AppConfig.availablePadTypes = ['drive', 'teams', 'sheet', 'doc', 'presentation', 'pad', 'kanban', 'code', 'form', 'poll', 'whiteboard',
'file', 'contacts', 'slide', 'convert', 'drawio'];
'file', 'contacts', 'slide', 'convert', 'diagram'];
/* The registered only types are apps restricted to registered users.
* You should never remove apps from this list unless you know what you're doing. The apps
* listed here by default can't work without a user account.
@ -192,7 +192,7 @@ define(function() {
poll: 'cptools-poll',
form: 'cptools-poll',
whiteboard: 'cptools-whiteboard',
drawio: 'cptools-diagram',
diagram: 'cptools-diagram',
todo: 'cptools-todo',
contacts: 'fa-address-book',
calendar: 'fa-calendar',

View File

@ -1,20 +1,20 @@
body.cp-app-generic {
body.cp-app-diagram {
@import (once) "../../customize.dist/src/less2/include/browser.less";
@import (once) "../../customize.dist/src/less2/include/framework.less";
.framework_main(
@bg-color: @colortheme_apps[drawio],
@bg-color: @colortheme_apps[diagram],
);
// body
&.cp-app-generic {
&.cp-app-diagram {
display: flex;
flex-flow: column;
max-height: 100%;
min-height: auto;
.cp-app-generic-container {
.cp-app-diagram-container {
display: inline-flex;
flex-flow: column;
height: 100%;
@ -23,7 +23,7 @@ body.cp-app-generic {
resize: horizontal;
overflow: hidden;
}
.cp-app-generic-editor {
.cp-app-diagram-editor {
flex: 1;
display: flex;
flex-flow: row;
@ -32,7 +32,7 @@ body.cp-app-generic {
}
@media (max-width: @browser_media-medium-screen) {
.cp-app-drawio-container {
.cp-app-diagram-container {
flex: 1;
max-width: 100%;
resize: none;

View File

@ -3,7 +3,7 @@
<head>
<meta content="text/html; charset=utf-8" http-equiv=
"content-type">
<script async data-bootload="/drawio/inner.js"
<script async data-bootload="/diagram/inner.js"
data-main="/common/sframe-boot.js?ver=1.6"
src="/bower_components/requirejs/require.js?ver=2.3.5"></script>
<style>
@ -30,19 +30,19 @@
</style>
<title></title>
</head>
<body class="cp-app-generic cp-app-drawio">
<body class="cp-app-diagram">
<div id="cme_toolbox" class="cp-toolbar-container"></div>
<div id="cp-app-drawio-editor" class="cp-app-generic-editor">
<div id="cp-app-drawio-container" class="cp-app-generic-container">
<div id="cp-app-diagram-editor" class="cp-app-diagram-editor">
<div id="cp-app-diagram-container" class="cp-app-diagram-container">
<div class="diagram-editor loading">
<div id="overlay"></div>
<iframe id="cp-app-drawio-content"
<iframe id="cp-app-diagram-content"
src=""
border="0"
frameborder="0"
width="100%"
height="100%"
name="cp-app-drawio-content"></iframe>
name="cp-app-diagram-content"></iframe>
</div>
</div>
</div>

View File

@ -5,8 +5,8 @@ define([
'/bower_components/pako/dist/pako.min.js',
'/bower_components/js-base64/base64.js',
'/bower_components/x2js/xml2json.min.js',
'less!/drawio/app.less',
'css!/drawio/drawio.css',
'less!/diagram/app-diagram.less',
'css!/diagram/drawio.css',
], function (
Framework,
Messages,
@ -56,7 +56,7 @@ define([
// This is the main initialization loop
var onFrameworkReady = function (framework) {
var EMPTY_DRAWIO = "<mxfile type=\"embed\"><diagram id=\"bWoO5ACGZIaXrIiKNTKd\" name=\"Page-1\"><mxGraphModel dx=\"1259\" dy=\"718\" grid=\"1\" gridSize=\"10\" guides=\"1\" tooltips=\"1\" connect=\"1\" arrows=\"1\" fold=\"1\" page=\"1\" pageScale=\"1\" pageWidth=\"827\" pageHeight=\"1169\" math=\"0\" shadow=\"0\"><root><mxCell id=\"0\"/><mxCell id=\"1\" parent=\"0\"/></root></mxGraphModel></diagram></mxfile>";
var drawioFrame = document.querySelector('#cp-app-drawio-content');
var drawioFrame = document.querySelector('#cp-app-diagram-content');
var x2js = new X2JS();
var lastContent = x2js.xml_str2json(EMPTY_DRAWIO);
var drawIoInitalized = false;
@ -192,7 +192,7 @@ define([
// Framework initialization
Framework.create({
toolbarContainer: '#cme_toolbox',
contentContainer: '#cp-app-drawio-editor',
contentContainer: '#cp-app-diagram-editor',
// validateContent: validateXml,
}, function (framework) {
onFrameworkReady(framework);