Hide rich text behind feature flag

This commit is contained in:
Alasdair Smith 2018-02-05 15:35:00 +00:00
parent 4c23a3c8f0
commit bfda9c595b
4 changed files with 16 additions and 12 deletions

View file

@ -14,5 +14,7 @@ module.exports = Features =
return Settings.enableGithubSync
when 'v1-return-message'
return Settings.accountMerge? and Settings.overleaf?
when 'rich-text'
return Settings.showRichText
else
throw new Error("unknown feature: #{feature}")

View file

@ -159,10 +159,11 @@ block requirejs
window.uiConfig = JSON.parse('!{JSON.stringify(uiConfig).replace(/\//g, "\\/")}');
// TODO: inject based on environment
script(
src="http://localhost:3809/public/js/es/richText.js"
type="text/javascript"
)
if hasFeature('rich-text')
script(
src="http://localhost:3809/public/js/es/richText.js"
type="text/javascript"
)
script(
data-main=buildJsPath("ide.js", {hashedPath:false}),

View file

@ -30,8 +30,9 @@ div.full-size(
i.fa.fa-arrow-left
|   #{translate("open_a_file_on_the_left")}
.toolbar.toolbar-editor(ng-controller="EditorToolbarController")
button(ng-click="toggleRichText()") Rich Text
if hasFeature('rich-text')
.toolbar.toolbar-editor(ng-controller="EditorToolbarController")
button(ng-click="toggleRichText()") Rich Text
#editor(
ace-editor="editor",
@ -66,11 +67,12 @@ div.full-size(
renderer-data="reviewPanel.rendererData"
)
#editor-rich-text(
cm-editor
ng-if="!editor.opening && editor.richText"
sharejs-doc="editor.sharejs_doc"
)
if hasFeature('rich-text')
#editor-rich-text(
cm-editor
ng-if="!editor.opening && editor.richText"
sharejs-doc="editor.sharejs_doc"
)
include ./review-panel

View file

@ -192,4 +192,3 @@ define [
toggleRichText: () ->
@$scope.editor.richText = !@$scope.editor.richText