From 95617a11c8b62a84cfce2df3449073042ebc82b3 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 5 Jan 2017 10:57:13 +0100 Subject: [PATCH 1/7] fix broken paths in old poll --- www/poll/old/main.js | 4 ++-- www/poll/old/wizard.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/www/poll/old/main.js b/www/poll/old/main.js index a702028bd..2703530c7 100644 --- a/www/poll/old/main.js +++ b/www/poll/old/main.js @@ -1,8 +1,8 @@ define([ '/api/config?cb=' + Math.random().toString(16).substring(2), '/customize/messages.js?app=poll', - '/poll/table.js', - '/poll/wizard.js', + 'table.js', + 'wizard.js', '/bower_components/textpatcher/TextPatcher.js', '/bower_components/chainpad-listmap/chainpad-listmap.js', '/bower_components/chainpad-crypto/crypto.js', diff --git a/www/poll/old/wizard.js b/www/poll/old/wizard.js index 9bd23cd1a..b7a1cf04e 100644 --- a/www/poll/old/wizard.js +++ b/www/poll/old/wizard.js @@ -1,5 +1,5 @@ define([ - '/poll/table.js', + 'table.js', '/bower_components/jquery/dist/jquery.min.js', ], function (Table) { var $ = window.jQuery; From 5080751a90b23dfdec145cc0e388720755c5e50b Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 5 Jan 2017 10:58:10 +0100 Subject: [PATCH 2/7] hide unnecessary scrollbar --- www/poll/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/www/poll/index.html b/www/poll/index.html index 17f951997..da7a6ed80 100644 --- a/www/poll/index.html +++ b/www/poll/index.html @@ -80,6 +80,7 @@ width: 50px; } #tableScroll { + overflow-y: hidden; overflow-x: auto; margin-left: calc(30% - 50px + 29px); max-width: 70%; width: auto; display: inline-block; } #description { From e56cc49f79ecaf175fee9bf0ee7ad309ce2ec69d Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 5 Jan 2017 14:14:26 +0100 Subject: [PATCH 3/7] catch errors that popped up because of a cross-origin iframe --- www/common/toolbar.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/www/common/toolbar.js b/www/common/toolbar.js index 511ee3138..260e7d22d 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -506,12 +506,17 @@ define([ }; $(config.ifrw).on('click', removeDropdowns); $(config.ifrw).on('click', cancelEditTitle); + + try { if (config.ifrw.$('iframe').length) { var innerIfrw = config.ifrw.$('iframe').each(function (i, el) { $(el.contentWindow).on('click', removeDropdowns); $(el.contentWindow).on('click', cancelEditTitle); }); } + } catch (e) { + // empty try catch in case this iframe is problematic + } } // Update user list From bd6f2c037ea1d051c53b141277f67f6e18e572fb Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 5 Jan 2017 14:27:40 +0100 Subject: [PATCH 4/7] assign the cors iframe an id --- customize.dist/share/frame.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/customize.dist/share/frame.js b/customize.dist/share/frame.js index 86147ca4b..d3d4fb00d 100644 --- a/customize.dist/share/frame.js +++ b/customize.dist/share/frame.js @@ -18,12 +18,13 @@ onload('[timeoutError] could not load iframe at ' + src); }, timeout); + iframe.setAttribute('id', 'cors-store'); + iframe.onload = function (e) { onload(void 0, iframe, e); window.clearTimeout(to); }; iframe.setAttribute('src', src); - iframe.style.display = 'none'; parent.appendChild(iframe); }; From 5c967ed09e996735165c9664305a1419a9e3ce9e Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 5 Jan 2017 14:45:31 +0100 Subject: [PATCH 5/7] apply live fixes to the codebase --- customize.dist/main.css | 7 +++++-- customize.dist/src/less/cryptpad.less | 8 ++++++-- customize.dist/src/less/toolbar.less | 1 + customize.dist/toolbar.css | 1 + 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/customize.dist/main.css b/customize.dist/main.css index ffda4ba19..10ffd4f7b 100644 --- a/customize.dist/main.css +++ b/customize.dist/main.css @@ -348,7 +348,7 @@ html.cp, font-weight: 400; line-height: 2rem; } -.cp #language-selector { +.cp #language-selector:not(.poll) { position: absolute; top: 0px; right: 0px; @@ -652,7 +652,7 @@ html.cp, } .cp form.realtime table input[type="text"], .cp div.realtime table input[type="text"] { - height: 100%; + height: auto; border: 1px solid #302B28; width: 80%; } @@ -902,3 +902,6 @@ html.cp, .cp div#modal #addtime { border-bottom-left-radius: 5px; } +#cors-store { + display: none; +} diff --git a/customize.dist/src/less/cryptpad.less b/customize.dist/src/less/cryptpad.less index 21c9e1e71..910cd643b 100644 --- a/customize.dist/src/less/cryptpad.less +++ b/customize.dist/src/less/cryptpad.less @@ -22,7 +22,7 @@ body { line-height: 2rem; } -#language-selector { +#language-selector:not(.poll) { position: absolute; top: 0px; right: 0px; @@ -359,7 +359,7 @@ form.realtime, div.realtime { input { &[type="text"] { - height: 100%; + height: auto; border: 1px solid @base; width: 80%; } @@ -625,3 +625,7 @@ div.modal, div#modal { } } +// hack for our cross-origin iframe +#cors-store { + display: none; +} diff --git a/customize.dist/src/less/toolbar.less b/customize.dist/src/less/toolbar.less index 21182b991..454eedbf7 100644 --- a/customize.dist/src/less/toolbar.less +++ b/customize.dist/src/less/toolbar.less @@ -242,6 +242,7 @@ right: 0; span:not(.cryptpad-lag) { vertical-align: top; + display: inline-block; } @media screen and (max-width: @media-narrow-screen) { top: 3em; diff --git a/customize.dist/toolbar.css b/customize.dist/toolbar.css index ed3f95e14..cd9545990 100644 --- a/customize.dist/toolbar.css +++ b/customize.dist/toolbar.css @@ -247,6 +247,7 @@ } .cryptpad-toolbar-top .cryptpad-user span:not(.cryptpad-lag) { vertical-align: top; + display: inline-block; } @media screen and (max-width: 400px) { .cryptpad-toolbar-top .cryptpad-user { From 7868a65da99800e7ba50f32c52f6709be617b79f Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 5 Jan 2017 15:06:08 +0100 Subject: [PATCH 6/7] apply style patches to the correct elements --- customize.dist/main.css | 11 ++++++----- customize.dist/src/less/cryptpad.less | 15 +++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/customize.dist/main.css b/customize.dist/main.css index 10ffd4f7b..4b424e4d8 100644 --- a/customize.dist/main.css +++ b/customize.dist/main.css @@ -337,6 +337,12 @@ html.cp, font-family: Georgia,Cambria,serif; height: 100; } +.cp:not(.poll) #language-selector { + position: absolute; + top: 0px; + right: 0px; + display: inline-block; +} .cp { /* buttons */ /* Tables @@ -348,11 +354,6 @@ html.cp, font-weight: 400; line-height: 2rem; } -.cp #language-selector:not(.poll) { - position: absolute; - top: 0px; - right: 0px; -} .cp a.github-corner > svg { fill: #00ADEE; color: #302B28; diff --git a/customize.dist/src/less/cryptpad.less b/customize.dist/src/less/cryptpad.less index 910cd643b..85923ce11 100644 --- a/customize.dist/src/less/cryptpad.less +++ b/customize.dist/src/less/cryptpad.less @@ -14,6 +14,15 @@ html.cp, .cp body { height: 100; } +.cp:not(.poll) { + #language-selector { + position: absolute; + top: 0px; + right: 0px; + display: inline-block; + } +} + .cp { body { @@ -22,12 +31,6 @@ body { line-height: 2rem; } -#language-selector:not(.poll) { - position: absolute; - top: 0px; - right: 0px; -} - a.github-corner > svg { fill: @cp-blue; color: @base; From b33661d9d58aad89e2e8bc5d092ec70c5db16e76 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 5 Jan 2017 15:21:17 +0100 Subject: [PATCH 7/7] don't toggle maximization state after setting --- www/pad/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/pad/main.js b/www/pad/main.js index bdd8d0a71..09c2be0f4 100644 --- a/www/pad/main.js +++ b/www/pad/main.js @@ -627,7 +627,10 @@ define([ // this should only ever get called once, when the chain syncs var onReady = realtimeOptions.onReady = function (info) { - editor.execCommand('maximize'); + if (!APP.isMaximized) { + editor.execCommand('maximize'); + APP.isMaximized = true; + } module.patchText = TextPatcher.create({ realtime: info.realtime,