Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 428681

Summary: Readonly file widget: Need to support *.ejs file syntax highlighting.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: grant_gayed, ken_walker
Version: 5.0Flags: grant_gayed: review+
ken_walker: review+
Target Milestone: 5.0 RC3   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description libing wang CLA 2014-02-20 14:22:20 EST
We need to support the *.ejs file syntax highlighting in the readonly widget.
Comment 1 libing wang CLA 2014-02-20 14:24:48 EST
proposed fix patch:

diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/staticDataSource.js b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/staticDataSource.js
index ae19925..02ebca7 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/staticDataSource.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/widgets/browse/staticDataSource.js
@@ -23,8 +23,9 @@
 	"orion/editor/stylers/application_json/syntax",
 	"orion/editor/stylers/text_x-php/syntax",
 	"orion/editor/stylers/text_x-python/syntax",
-	"orion/editor/stylers/text_x-ruby/syntax"
-], function(Deferred, mStyler, mJS, mCss, mHtml, mJava, mJson, mPhp, mPython, mRuby) {
+	"orion/editor/stylers/text_x-ruby/syntax",
+	'orion/editor/stylers/application_x-ejs/syntax'
+], function(Deferred, mStyler, mJS, mCss, mHtml, mJava, mJson, mPhp, mPython, mRuby, mEJS) {
 	var ContentTypes = [{	id: "text/plain",
 			name: "Text",
 			extension: ["txt"],
@@ -59,6 +60,12 @@
 			name: "XML",
 			extension: ["xml"],
 			imageClass: "file-sprite-xml"
+		},
+		{	id: "application/x-ejs",
+			"extends": "text/plain",
+			name: "Embedded Javascript",
+			extension: ["ejs"],
+			imageClass: "file-sprite-javascript modelDecorationSprite"
 		},
 		{	id: "text/x-java-source",
 			"extends": "text/plain",
@@ -156,6 +163,9 @@
 					case "application/javascript": //$NON-NLS-0$
 						this.styler = new mStyler.TextStyler(textView, annotationModel, mJS.grammars, "orion.js"); //$NON-NLS-0$
 						break;
+					case "application/x-ejs": //$NON-NLS-0$
+						this.styler = new mStyler.TextStyler(textView, annotationModel, mEJS.grammars, "orion.ejs"); //$NON-NLS-0$
+						break;
 					case "text/css": //$NON-NLS-0$
 						this.styler = new mStyler.TextStyler(textView, annotationModel, mCss.grammars, "orion.css"); //$NON-NLS-0$
 						break;
Comment 2 libing wang CLA 2014-02-20 16:00:43 EST
pushed the fix to both master and rc2 branch.