From 3d2a2da74efa80258e5cca914c52ae52c0fae57d Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 5 Sep 2017 16:52:22 +0200 Subject: [PATCH 1/4] add listAllTags api --- www/common/cryptpad-common.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 6b07380ed..8b32f12d3 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -560,6 +560,24 @@ define([ }); }; + common.listAllTags = function (cb) { + var all = []; + var proxy = getProxy(); + var files = common.find(proxy, ['drive', 'filesData']); + + if (typeof(files) !== 'object') { return cb('invalid_drive'); } + Object.keys(files).forEach(function (k) { + var file = files[k]; + if (!Array.isArray(file.tags)) { return; } + file.tags.forEach(function (tag) { + if (all.indexOf(tag) === -1) { + all.push(tag); + } + }); + }); + cb(void 0, all); + }; + common.getLSAttribute = function (attr) { return localStorage[attr]; }; From b3d5e04bb4e61da4093e6d301556e33ea6b19c2c Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 5 Sep 2017 17:23:16 +0200 Subject: [PATCH 2/4] lint compliance --- www/common/toolbar3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 4e07d25d6..549b29fde 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -440,7 +440,7 @@ define([ }; var createFileShare = function (toolbar) { - throw new Error('TODO: Update createFileShare to add "embed" and work in secure iframes'); + try { throw new Error('TODO: Update createFileShare to add "embed" and work in secure iframes'); } catch (e) { return; } if (!window.location.hash) { throw new Error("Unable to display the share button: hash required in the URL"); } From 6a735b441fff85d73e3cff643836d64e2c2b3988 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 5 Sep 2017 18:16:06 +0200 Subject: [PATCH 3/4] use paul's print styles --- www/pad/app-pad.less | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/www/pad/app-pad.less b/www/pad/app-pad.less index f187d5683..85b1605b1 100644 --- a/www/pad/app-pad.less +++ b/www/pad/app-pad.less @@ -20,7 +20,7 @@ height: 28px; padding: 2px 0; } - #cke_1_top .cryptpad-toolbar { + #cke_1_top .cp-toolbar { padding: 0; display: block; } @@ -28,3 +28,16 @@ min-width: 60%; } } + +.cke_wysiwyg_frame { + min-width: 60%; +} + +@media print { + #cke_1_top { + display:none !important; + } + &.cp-app-pad .cp-toolbar-userlist-drawer { + display:none; + } +} From 47ec9590327f834768bb73ba8d02c2947f6e8fcc Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 5 Sep 2017 18:35:11 +0200 Subject: [PATCH 4/4] make sure contenteditable is not set in read only mode --- www/pad/inner.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/pad/inner.js b/www/pad/inner.js index 8cd2b9beb..9be24e78a 100644 --- a/www/pad/inner.js +++ b/www/pad/inner.js @@ -369,6 +369,8 @@ define([ if (!readOnly && !initializing) { userDocStateDom.setAttribute("contenteditable", "true"); // lol wtf + } else if (readOnly) { + userDocStateDom.removeAttribute("contenteditable"); } var patch = (DD).diff(inner, userDocStateDom); (DD).apply(inner, patch);