From 315b2f24eebe0bbf5be61db843b5cdeb06ef2480 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 6 Apr 2018 16:01:59 +0100 Subject: [PATCH 1/4] Always include RT styles --- services/web/public/stylesheets/_style_includes.less | 6 +----- services/web/public/stylesheets/app/editor.less | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/services/web/public/stylesheets/_style_includes.less b/services/web/public/stylesheets/_style_includes.less index de6c4ff7fe..7f6070e69c 100644 --- a/services/web/public/stylesheets/_style_includes.less +++ b/services/web/public/stylesheets/_style_includes.less @@ -84,8 +84,4 @@ @import "../js/libs/pdfListView/TextLayer.css"; @import "../js/libs/pdfListView/AnnotationsLayer.css"; @import "../js/libs/pdfListView/HighlightsLayer.css"; - -// CodeMirror -& when (@show-rich-text) { - @import "vendor/codemirror.css"; -} +@import "vendor/codemirror.css"; diff --git a/services/web/public/stylesheets/app/editor.less b/services/web/public/stylesheets/app/editor.less index 9a8bdc5594..50d47e3d61 100644 --- a/services/web/public/stylesheets/app/editor.less +++ b/services/web/public/stylesheets/app/editor.less @@ -12,9 +12,7 @@ @import "./editor/online-users.less"; @import "./editor/hotkeys.less"; @import "./editor/review-panel.less"; -& when (@show-rich-text) { - @import "./editor/rich-text.less"; -} +@import "./editor/rich-text.less"; @ui-layout-toggler-def-height: 50px; @ui-resizer-size: 7px; From d433a881583d62b662947db216587524b1ae483e Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 6 Apr 2018 16:58:12 +0100 Subject: [PATCH 2/4] Pass rich text flag if query string is set --- .../web/app/coffee/Features/Project/ProjectController.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index cd3b3d1905..e95d208900 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -301,6 +301,7 @@ module.exports = ProjectController = themes: THEME_LIST maxDocLength: Settings.max_doc_length useV2History: !!project.overleaf?.history?.display + showRichText: req.query.rt == 'true' timer.done() _buildProjectList: (allProjects, v1Projects = [])-> From c3b2af4345bcba69bb74ea0f7fbf59443eb6ee85 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 6 Apr 2018 16:59:06 +0100 Subject: [PATCH 3/4] Instead of checking RT flag at compile time, adjust at run time --- services/web/app/views/project/editor/editor.pug | 1 + services/web/public/stylesheets/app/editor.less | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/services/web/app/views/project/editor/editor.pug b/services/web/app/views/project/editor/editor.pug index 2b42cda965..b1570fa55d 100644 --- a/services/web/app/views/project/editor/editor.pug +++ b/services/web/app/views/project/editor/editor.pug @@ -39,6 +39,7 @@ div.full-size( ace-editor="editor", ng-if="!editor.richText", ng-show="!!editor.sharejs_doc && !editor.opening", + style=showRichText ? "top: 40px" : "", theme="settings.theme", keybindings="settings.mode", font-size="settings.fontSize", diff --git a/services/web/public/stylesheets/app/editor.less b/services/web/public/stylesheets/app/editor.less index 50d47e3d61..6350a00c24 100644 --- a/services/web/public/stylesheets/app/editor.less +++ b/services/web/public/stylesheets/app/editor.less @@ -80,10 +80,7 @@ .full-size; } -#editor when (@show-rich-text = true) { - top: 40px; // TODO: replace with toolbar height var -} -#editor-rich-text when (@show-rich-text = true) { +#editor-rich-text { top: 40px; // TODO: replace with toolbar height var } From eb05be6eb3da87be7cd7837a2e06c9f6acce57b7 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Fri, 6 Apr 2018 17:00:27 +0100 Subject: [PATCH 4/4] Remove unused feature flag --- services/web/app/coffee/infrastructure/Features.coffee | 2 -- 1 file changed, 2 deletions(-) diff --git a/services/web/app/coffee/infrastructure/Features.coffee b/services/web/app/coffee/infrastructure/Features.coffee index 5dfe73f05f..519cfda6da 100644 --- a/services/web/app/coffee/infrastructure/Features.coffee +++ b/services/web/app/coffee/infrastructure/Features.coffee @@ -14,8 +14,6 @@ module.exports = Features = return Settings.enableGithubSync when 'v1-return-message' return Settings.accountMerge? and Settings.overleaf? - when 'rich-text' - return Settings.showRichText when 'custom-togglers' return Settings.overleaf? else