From 88be5444f0d6457238c6f06e972dc74d26a34d3b Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Tue, 8 Aug 2017 10:37:37 +0200 Subject: [PATCH 1/7] change alertify warn color --- customize.dist/src/less2/include/alertify.less | 6 +++--- customize.dist/src/less2/include/colortheme.less | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/customize.dist/src/less2/include/alertify.less b/customize.dist/src/less2/include/alertify.less index 1a791bc04..3e9bec46a 100644 --- a/customize.dist/src/less2/include/alertify.less +++ b/customize.dist/src/less2/include/alertify.less @@ -39,14 +39,14 @@ box-shadow: @alertify_box-shadow; &, &.default { // FIXME - background: rgba(0, 0, 0, .8); + background: @colortheme_notification-log; } &.error { font-weight: bold; - background: @colortheme_cp-red; + background: @colortheme_notification-warn; } &.success { - background: rgba(0, 0, 0, .8); + background: @colortheme_notification-log; } } } diff --git a/customize.dist/src/less2/include/colortheme.less b/customize.dist/src/less2/include/colortheme.less index a1e02d9d4..51b9af335 100644 --- a/customize.dist/src/less2/include/colortheme.less +++ b/customize.dist/src/less2/include/colortheme.less @@ -24,6 +24,9 @@ @colortheme_alertify-red: #E55236; @colortheme_alertify-green: #77C825; +@colortheme_notification-log: rgba(0, 0, 0, 0.8); +@colortheme_notification-warn: rgba(205, 37, 50, 0.8); + // Apps @colortheme_pad-bg: #1c4fa0; From f585ddccdf5db49691950aa0c17ca9c99d7f7252 Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Tue, 8 Aug 2017 11:44:01 +0200 Subject: [PATCH 2/7] fix image sizes in /slide/ --- www/common/diffMarked.js | 4 ++++ www/slide/slide.less | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/www/common/diffMarked.js b/www/common/diffMarked.js index 42da27b97..f72d5277e 100644 --- a/www/common/diffMarked.js +++ b/www/common/diffMarked.js @@ -60,6 +60,10 @@ define([ return out; }; + renderer.paragraph = function (p) { + return //i.test(p)? p + '\n': '

' + p + '

\n'; + }; + var MutationObserver = window.MutationObserver; var forbiddenTags = [ 'SCRIPT', diff --git a/www/slide/slide.less b/www/slide/slide.less index ef50796b9..0e8c414db 100644 --- a/www/slide/slide.less +++ b/www/slide/slide.less @@ -336,6 +336,15 @@ div#modal #content, #print { padding-left: 0.3em; } + // fixes image overflowing + media-tag { + height: 100%; + + & + * { + margin-top: 1rem; + } + } + img { position: relative; min-width: 1%; From c427f375ddb2421ba14196a3649fedef6985f0be Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Tue, 8 Aug 2017 11:48:17 +0200 Subject: [PATCH 3/7] add bootstrap css to /code for image uploader --- www/code/inner.js | 1 + 1 file changed, 1 insertion(+) diff --git a/www/code/inner.js b/www/code/inner.js index fa3a41f6f..d36a7acd2 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -4,6 +4,7 @@ define([ 'cm/lib/codemirror', 'css!/bower_components/components-font-awesome/css/font-awesome.min.css', + 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/code/code.less', 'less!/customize/src/less/toolbar.less', 'less!/customize/src/less/cryptpad.less', From d15280c6ce6c6094c996736afe11f855da48c130 Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Tue, 8 Aug 2017 11:52:16 +0200 Subject: [PATCH 4/7] prevent pdfs from being huge --- www/code/code.less | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/www/code/code.less b/www/code/code.less index 6c620fff8..79ec0af11 100644 --- a/www/code/code.less +++ b/www/code/code.less @@ -59,8 +59,13 @@ body { box-sizing: border-box; font-family: Calibri,Ubuntu,sans-serif; word-wrap: break-word; - media-tag * { - max-width:100%; + media-tag { + * { + max-width:100%; + } + iframe[type="application/pdf"] { + max-height:50vh; + } } } From 90075cd48e17ff1905887bc82f3eff29b45539f3 Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Tue, 8 Aug 2017 12:01:39 +0200 Subject: [PATCH 5/7] media-tag to less file --- customize.dist/src/less2/include/mediatag.less | 18 ++++++++++++++++++ www/slide/slide.less | 17 ++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 customize.dist/src/less2/include/mediatag.less diff --git a/customize.dist/src/less2/include/mediatag.less b/customize.dist/src/less2/include/mediatag.less new file mode 100644 index 000000000..704fd71bd --- /dev/null +++ b/customize.dist/src/less2/include/mediatag.less @@ -0,0 +1,18 @@ +.mediatag_base() { + media-tag { + min-height: 0; + flex: 1; + display: flex; + flex-flow: column; + text-align: center; + } + + media-tag img { + flex: 1; + max-height: 100% !important; + } + + media-tag iframe { + min-height: 100%; + } +} diff --git a/www/slide/slide.less b/www/slide/slide.less index 0e8c414db..9e020f98f 100644 --- a/www/slide/slide.less +++ b/www/slide/slide.less @@ -392,19 +392,6 @@ p { //flex: 1; } -media-tag { - min-height: 0; - flex: 1; - display: flex; - flex-flow: column; - text-align: center; -} +@import "../customize/src/less2/include/mediatag.less"; -media-tag img { - flex: 1; - max-height: 100% !important; -} - -media-tag iframe { - min-height: 100%; -} +.mediatag_base(); From 355b7f1839b82fe26beb9e4e9a8711bf04b17cdc Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Tue, 8 Aug 2017 12:05:22 +0200 Subject: [PATCH 6/7] change recent to local pads --- customize.dist/pages.js | 2 +- customize.dist/translations/messages.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 1d07bef96..d416c4d65 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -263,7 +263,7 @@ define([ [ 'slide', '/slide/', Msg.main_slidePad, 'fa-file-powerpoint-o' ], [ 'poll.cp-more.cp-hidden', '/poll/', Msg.main_pollPad, 'fa-calendar' ], [ 'whiteboard.cp-more.cp-hidden', '/whiteboard/', Msg.main_whiteboardPad, 'fa-paint-brush' ], - [ 'recent.cp-more.cp-hidden', '/drive/', Msg.main_recentPads, 'fa-hdd-o' ] + [ 'recent.cp-more.cp-hidden', '/drive/', Msg.main_localPads, 'fa-hdd-o' ] ].map(function (x) { return h('a', [ { href: x[1] }, diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 5fb3a6ae1..fa0cf7791 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -525,7 +525,7 @@ define(function () { out.main_slidePad = 'Markdown Presentation'; out.main_pollPad = 'Poll or Schedule'; out.main_whiteboardPad = 'Whiteboard'; - out.main_recentPads = 'Recent Pads'; + out.main_localPads = 'Local Pads'; out.footer_applications = "Applications"; out.footer_contact = "Contact"; From 85e383d5c59e7335025ae8e07bba91575fb14d86 Mon Sep 17 00:00:00 2001 From: Pierre Bondoerffer Date: Tue, 8 Aug 2017 14:36:04 +0200 Subject: [PATCH 7/7] add invisible splitter --- www/code/code.less | 12 ++++++++++++ www/code/main.js | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/www/code/code.less b/www/code/code.less index 79ec0af11..50026d340 100644 --- a/www/code/code.less +++ b/www/code/code.less @@ -59,6 +59,7 @@ body { box-sizing: border-box; font-family: Calibri,Ubuntu,sans-serif; word-wrap: break-word; + position: relative; media-tag { * { max-width:100%; @@ -77,6 +78,17 @@ body { .markdown_gfm-table(black); } +.cp-splitter { + position: absolute; + height: 100%; + width: 8px; + top: 0; + left: 0; + z-index: 9999; + + cursor: col-resize; +} + @media (max-width: @media-medium-screen) { .CodeMirror { flex: 1; diff --git a/www/code/main.js b/www/code/main.js index db358018d..7591f12a2 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -387,6 +387,26 @@ define([ } }); + // add the splitter + var splitter = $('
', { + 'class': 'cp-splitter' + }).appendTo($iframe.find('#previewContainer')); + + var $target = $iframe.find('.CodeMirror'); + splitter.on('mousedown', function (e) { + e.preventDefault(); + var x = e.pageX; + var w = $target.width(); + + $iframe.on('mouseup mousemove', function handler(evt) { + if (evt.type === 'mouseup') { + $iframe.off('mouseup mousemove', handler); + return; + } + $target.css('width', (w - x + evt.pageX) + 'px'); + }); + }); + Cryptpad.removeLoadingScreen(); setEditable(true); initializing = false;