Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

pull/1/head
yflory 3 years ago
commit be277c03ba

@ -6,6 +6,7 @@ www/common/onlyoffice/x2t
www/common/onlyoffice/v1 www/common/onlyoffice/v1
www/common/onlyoffice/v2* www/common/onlyoffice/v2*
www/common/onlyoffice/v4 www/common/onlyoffice/v4
www/common/onlyoffice/v5
server.js server.js
www/scratch www/scratch

@ -554,7 +554,7 @@ define([
return; return;
} }
if (testing) { return void proceed(result); } //if (testing) { return void proceed(result); }
if (!(proxy.curvePrivate && proxy.curvePublic && if (!(proxy.curvePrivate && proxy.curvePublic &&
proxy.edPrivate && proxy.edPublic)) { proxy.edPrivate && proxy.edPublic)) {

@ -132,6 +132,24 @@
g.legend text, text.pieTitleText { g.legend text, text.pieTitleText {
fill: @cp_markdown-block-fg; fill: @cp_markdown-block-fg;
} }
g.legend rect {
stroke: @cryptpad_text_col !important;
stroke-width: 1px;
}
.pieCircle {
stroke: @cryptpad_text_col;
}
text.slice {
fill: @cryptpad_text_col;
}
}
&[mermaid-source^="erDiagram"] {
rect.er:not(.relationshipLabelBox) {
fill: #ECECFF;
}
g text.er {
fill: #333;
}
} }
} }
pre.markmap { pre.markmap {

@ -3,7 +3,7 @@ define([
'/bower_components/hyperjson/hyperjson.js', '/bower_components/hyperjson/hyperjson.js',
'json.sortify', 'json.sortify',
'/drive/tests.js', '/drive/tests.js',
'/common/test.js', //'/common/test.js',
'/common/common-hash.js', '/common/common-hash.js',
'/common/common-util.js', '/common/common-util.js',
'/common/common-thumbnail.js', '/common/common-thumbnail.js',
@ -18,7 +18,7 @@ define([
'/bower_components/tweetnacl/nacl-fast.min.js', '/bower_components/tweetnacl/nacl-fast.min.js',
'less!/customize/src/less2/pages/page-assert.less', 'less!/customize/src/less2/pages/page-assert.less',
], function ($, Hyperjson, Sortify, Drive, Test, Hash, Util, Thumb, Wire, Flat, MediaTag, Block, ApiConfig, Assertions, h, Messages) { ], function ($, Hyperjson, Sortify, Drive, /*Test,*/ Hash, Util, Thumb, Wire, Flat, MediaTag, Block, ApiConfig, Assertions, h, Messages) {
window.Hyperjson = Hyperjson; window.Hyperjson = Hyperjson;
window.Sortify = Sortify; window.Sortify = Sortify;
var Nacl = window.nacl; var Nacl = window.nacl;
@ -526,11 +526,12 @@ define([
})), })),
])); ]));
/*
if (failed) { if (failed) {
Test.failed(); Test.failed();
} else { } else {
Test.passed(); Test.passed();
} }*/
}); });
}); });

@ -363,7 +363,7 @@ define([
}); });
}); });
var sheetURL = '/common/onlyoffice/v4/web-apps/apps/spreadsheeteditor/main/index.html'; var sheetURL = '/common/onlyoffice/v5/web-apps/apps/spreadsheeteditor/main/index.html';
assert(function (cb, msg) { assert(function (cb, msg) {
msg.innerText = "Missing HTTP headers required for .xlsx export from sheets. "; msg.innerText = "Missing HTTP headers required for .xlsx export from sheets. ";
@ -671,7 +671,7 @@ define([
}); });
assert(function (cb, msg) { assert(function (cb, msg) {
var url = '/common/onlyoffice/v4/web-apps/apps/spreadsheeteditor/main/index.html'; var url = '/common/onlyoffice/v5/web-apps/apps/spreadsheeteditor/main/index.html';
msg.appendChild(CSP_WARNING(url)); msg.appendChild(CSP_WARNING(url));
deferredPostMessage({ deferredPostMessage({
command: 'GET_HEADER', command: 'GET_HEADER',

File diff suppressed because one or more lines are too long

@ -18,14 +18,14 @@ define([
'/lib/tippy/tippy.min.js', '/lib/tippy/tippy.min.js',
'/common/hyperscript.js', '/common/hyperscript.js',
'/customize/loading.js', '/customize/loading.js',
'/common/test.js', //'/common/test.js',
'/lib/jquery-ui/jquery-ui.min.js', // autocomplete widget '/lib/jquery-ui/jquery-ui.min.js', // autocomplete widget
'/bower_components/bootstrap-tokenfield/dist/bootstrap-tokenfield.js', '/bower_components/bootstrap-tokenfield/dist/bootstrap-tokenfield.js',
'css!/lib/tippy/tippy.css', 'css!/lib/tippy/tippy.css',
'css!/lib/jquery-ui/jquery-ui.min.css' 'css!/lib/jquery-ui/jquery-ui.min.css'
], function ($, Messages, Util, Hash, Notifier, AppConfig, ], function ($, Messages, Util, Hash, Notifier, AppConfig,
Alertify, Tippy, h, Loading, Test) { Alertify, Tippy, h, Loading/*, Test */) {
var UI = {}; var UI = {};
/* /*
@ -994,7 +994,7 @@ define([
// Release the test blocker, hopefully every test has been registered. // Release the test blocker, hopefully every test has been registered.
// This test is created in sframe-boot2.js // This test is created in sframe-boot2.js
cb = cb || function () {}; cb = cb || function () {};
if (Test.__ASYNC_BLOCKER__) { Test.__ASYNC_BLOCKER__.pass(); } //if (Test.__ASYNC_BLOCKER__) { Test.__ASYNC_BLOCKER__.pass(); }
var $loading = $('#' + LOADING); var $loading = $('#' + LOADING);
$loading.addClass("cp-loading-hidden"); // Hide the loading screen $loading.addClass("cp-loading-hidden"); // Hide the loading screen

@ -36,7 +36,7 @@ define([
init: function () { init: function () {
require([ require([
'mermaid', 'mermaid',
'css!/code/mermaid-new.css' //'css!/code/mermaid-new.css' // XXX
], function (_Mermaid) { ], function (_Mermaid) {
console.debug("loaded mermaid"); console.debug("loaded mermaid");
if (Mermaid.__stubbed) { if (Mermaid.__stubbed) {
@ -202,7 +202,7 @@ define([
renderer.code = function (code, language) { renderer.code = function (code, language) {
if (!code || typeof(code) !== 'string' || !code.trim()) { return defaultCode.apply(renderer, arguments); } if (!code || typeof(code) !== 'string' || !code.trim()) { return defaultCode.apply(renderer, arguments); }
if (language === 'mermaid' && code.match(/^(graph|pie|gantt|sequenceDiagram|classDiagram|gitGraph)/)) { if (language === 'mermaid' && code.match(/^(flowchart|graph|pie|gantt|sequenceDiagram|classDiagram|gitGraph|stateDiagram|erDiagram|journey|requirementDiagram)/)) {
return '<pre class="mermaid" data-plugin="mermaid">'+Util.fixHTML(code)+'</pre>'; return '<pre class="mermaid" data-plugin="mermaid">'+Util.fixHTML(code)+'</pre>';
} else if (language === 'markmap') { } else if (language === 'markmap') {
return '<pre class="markmap" data-plugin="markmap">'+Util.fixHTML(code)+'</pre>'; return '<pre class="markmap" data-plugin="markmap">'+Util.fixHTML(code)+'</pre>';

@ -3907,7 +3907,18 @@ define([
setEditable(true, false, true); setEditable(true, false, true);
} }
if (APP.readOnly) { if (APP.readOnly && !APP.loggedIn) {
// XXX this incorrectly prompts guests to login/register even when they lack editing rights.
(function () {
var $banner = $(Pages.setHTML(h('div.cp-app-drive-content-info-box'), Messages.fm_info_sharedFolder));
$banner.find('[href="/login/"], [href="/register/"]').click(function (ev) {
ev.preventDefault();
var page = this.getAttribute('href').replace(/\//g, '');
common.setLoginRedirect(page);
});
$content.prepend($banner);
}());
} else if (APP.readOnly) {
// Read-only drive (team?) // Read-only drive (team?)
$content.prepend($readOnly.clone()); $content.prepend($readOnly.clone());
} else if (sfId && folders[sfId] && folders[sfId].readOnly) { } else if (sfId && folders[sfId] && folders[sfId].readOnly) {

@ -61,7 +61,7 @@ define([
var CHECKPOINT_INTERVAL = 100; var CHECKPOINT_INTERVAL = 100;
var FORCE_CHECKPOINT_INTERVAL = 10000; var FORCE_CHECKPOINT_INTERVAL = 10000;
var DISPLAY_RESTORE_BUTTON = false; var DISPLAY_RESTORE_BUTTON = false;
var NEW_VERSION = 4; // version of the .bin, patches and ChainPad formats var NEW_VERSION = 5; // version of the .bin, patches and ChainPad formats
var PENDING_TIMEOUT = 30000; var PENDING_TIMEOUT = 30000;
var CURRENT_VERSION = X2T.CURRENT_VERSION; var CURRENT_VERSION = X2T.CURRENT_VERSION;
@ -215,7 +215,7 @@ define([
var tabId = metadataMgr.getNetfluxId() + '-' + obj.id; var tabId = metadataMgr.getNetfluxId() + '-' + obj.id;
if (content.ids[tabId]) { if (content.ids[tabId]) {
delete content.ids[tabId]; delete content.ids[tabId];
delete content.locks[tabId]; if (content.locks) { delete content.locks[tabId]; }
APP.onLocal(); APP.onLocal();
} }
}; };
@ -2912,8 +2912,8 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
} }
readOnly = true; readOnly = true;
} }
} else if (content && content.version <= 3) { // V2 or V3 } else if (content && content.version <= 4) { // V2 or V3
version = 'v2b/'; version = content.version <= 3 ? 'v2b/' : 'v4/';
APP.migrate = true; APP.migrate = true;
// Registedred ~~users~~ editors can start the migration // Registedred ~~users~~ editors can start the migration
if (common.isLoggedIn() && !readOnly) { if (common.isLoggedIn() && !readOnly) {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save