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

pull/1/head
ansuz 4 years ago
commit 8b524b9d4b

@ -1444,10 +1444,6 @@ define([
editor.addCommand(tag, new CKEDITOR.styleCommand(new CKEDITOR.style({ element: tag }))); editor.addCommand(tag, new CKEDITOR.styleCommand(new CKEDITOR.style({ element: tag })));
editor.setKeystroke( CKEDITOR.CTRL + CKEDITOR.ALT + styleKeys[tag], tag); editor.setKeystroke( CKEDITOR.CTRL + CKEDITOR.ALT + styleKeys[tag], tag);
}); });
var privateData = framework._.cpNfInner.metadataMgr.getPrivateData(); // XXX race condition. framework isn't defined when this is called
var openLinkSetting = Util.find(privateData, ['settings', 'pad', 'openLink']);
Links.init(Ckeditor, editor, openLinkSetting);
}).nThen(function() { }).nThen(function() {
// Move ckeditor parts to have a structure like the other apps // Move ckeditor parts to have a structure like the other apps
var $contentContainer = $('#cke_1_contents'); var $contentContainer = $('#cke_1_contents');
@ -1491,6 +1487,9 @@ define([
}).nThen(waitFor()); }).nThen(waitFor());
}).nThen(function(waitFor) { }).nThen(function(waitFor) {
var privateData = framework._.cpNfInner.metadataMgr.getPrivateData();
var openLinkSetting = Util.find(privateData, ['settings', 'pad', 'openLink']);
Links.init(Ckeditor, editor, openLinkSetting);
require(['/pad/csp.js'], waitFor()); require(['/pad/csp.js'], waitFor());
}).nThen(function( /*waitFor*/ ) { }).nThen(function( /*waitFor*/ ) {

@ -373,8 +373,9 @@ define([
APP.FM.handleFile(blob); APP.FM.handleFile(blob);
}); });
}; };
var MAX_IMAGE_SIZE = 1 * 1024 * 1024; // 1 MB var ONE_MB = 1 * 1024 * 1024; // 1 MB
var maxSizeStr = Util.bytesToMegabytes(MAX_IMAGE_SIZE); var MAX_IMAGE_SIZE = Math.ceil(ONE_MB / 3) * 4 + 23; // 23 is the length of "data:image/jpeg;base64,"
var maxSizeStr = Util.bytesToMegabytes(ONE_MB);
var addImageToCanvas = function (img) { var addImageToCanvas = function (img) {
if (img.src && img.src.length > MAX_IMAGE_SIZE) { if (img.src && img.src.length > MAX_IMAGE_SIZE) {
UI.warn(Messages._getKey('upload_tooLargeBrief', [maxSizeStr])); UI.warn(Messages._getKey('upload_tooLargeBrief', [maxSizeStr]));

Loading…
Cancel
Save