Kaynağa Gözat

Load rich text code from module view include instead of hard coding

Alasdair Smith 8 yıl önce
ebeveyn
işleme
1a0154c9ea

+ 1 - 5
services/web/app/views/project/editor.pug

@@ -159,11 +159,7 @@ block requirejs
 		window.pdfCMapsPath = "#{pdfCMapsPath}"
 		window.uiConfig = JSON.parse('!{JSON.stringify(uiConfig).replace(/\//g, "\\/")}');
 
-	if hasFeature('rich-text')
-		script(
-			src=buildWebpackPath('es/rich-text.js', {hashedPath:settings.useMinifiedJs})
-			type="text/javascript"
-		)
+	!= moduleIncludes("editor:script", locals)
 
 	script(
 		data-main=buildJsPath("ide.js", {hashedPath:false}),

+ 2 - 10
services/web/app/views/project/editor/editor.pug

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