summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorBogdan Gheorghe2013-03-07 17:30:02 (EST)
committer Silenio Quarti2013-03-07 17:42:11 (EST)
commitb9fb5fa360ccf64934da75fecb66d0b3d7f7343b (patch)
tree62069b000aeaf8e78f14abd61bb84a98f86b851a
parent437f4bb18fef33387e7d92699e6bb8d11fe0db89 (diff)
downloadorg.eclipse.orion.client-b9fb5fa360ccf64934da75fecb66d0b3d7f7343b.zip
org.eclipse.orion.client-b9fb5fa360ccf64934da75fecb66d0b3d7f7343b.tar.gz
org.eclipse.orion.client-b9fb5fa360ccf64934da75fecb66d0b3d7f7343b.tar.bz2
Bug 401914 - Improve Editor Theming
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/examples/editor/demoSetup.js6
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/edit.js14
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js10
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/adelante.css59
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/ambience.css59
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/blue.css59
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/eclipse.css59
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/nimbus.css59
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/prospecto.css59
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/raspberrypi.css59
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/tierra.css59
11 files changed, 494 insertions, 8 deletions
diff --git a/bundles/org.eclipse.orion.client.editor/web/examples/editor/demoSetup.js b/bundles/org.eclipse.orion.client.editor/web/examples/editor/demoSetup.js
index 2f99418..427bb03 100644
--- a/bundles/org.eclipse.orion.client.editor/web/examples/editor/demoSetup.js
+++ b/bundles/org.eclipse.orion.client.editor/web/examples/editor/demoSetup.js
@@ -49,10 +49,8 @@ define(["require",
exports.getFile = getFile;
function loadTheme(themeClass) {
- if (themeClass) {
- var theme = mTextTheme.TextTheme.getTheme();
- theme.setThemeClass(themeClass, {href: "examples/editor/themes/" + themeClass}); //$NON-NLS-0$
- }
+ var theme = mTextTheme.TextTheme.getTheme();
+ theme.setThemeClass(themeClass, {href: "examples/editor/themes/" + themeClass}); //$NON-NLS-0$
}
function checkView(options) {
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/edit.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/edit.js
index 2dd0f3e..c51be8d 100644
--- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/edit.js
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/edit.js
@@ -16,6 +16,7 @@ define('orion/editor/edit', [ //$NON-NLS-0$
"orion/editor/textView", //$NON-NLS-0$
"orion/editor/textModel", //$NON-NLS-0$
+ "orion/editor/textTheme", //$NON-NLS-0$
"orion/editor/projectionTextModel", //$NON-NLS-0$
"orion/editor/eventTarget", //$NON-NLS-0$
"orion/keyBinding", //$NON-NLS-0$
@@ -38,7 +39,7 @@ define('orion/editor/edit', [ //$NON-NLS-0$
"orion/editor/textMateStyler", //$NON-NLS-0$
"orion/editor/htmlGrammar", //$NON-NLS-0$
"examples/editor/textStyler" //$NON-NLS-0$
-], function(mTextView, mTextModel, mProjModel, mEventTarget, mKeyBinding, mRulers, mAnnotations, mTooltip, mUndoStack, mTextDND, mEditor, mEditorFeatures, mContentAssist, mCSSContentAssist, mHtmlContentAssist, mJSContentAssist, mAsyncStyler, mMirror, mTextMateStyler, mHtmlGrammar, mTextStyler) {
+], function(mTextView, mTextModel, mTextTheme, mProjModel, mEventTarget, mKeyBinding, mRulers, mAnnotations, mTooltip, mUndoStack, mTextDND, mEditor, mEditorFeatures, mContentAssist, mCSSContentAssist, mHtmlContentAssist, mJSContentAssist, mAsyncStyler, mMirror, mTextMateStyler, mHtmlGrammar, mTextStyler) {
/** @private */
function getTextFromElement(element) {
@@ -171,6 +172,16 @@ define('orion/editor/edit', [ //$NON-NLS-0$
if (!parent) { throw "no parent"; } //$NON-NLS-0$
options = mergeOptions(parent, options);
+ if (typeof options.theme === "string") { //$NON-NLS-0$
+ var theme = mTextTheme.TextTheme.getTheme(options.theme);
+ var index = options.theme.lastIndexOf("/"); //$NON-NLS-0$
+ var themeClass = options.theme;
+ if (index !== -1) {
+ themeClass = themeClass.substring(index + 1);
+ }
+ theme.setThemeClass(themeClass, {href: options.theme});
+ options.theme = theme;
+ }
var textViewFactory = function() {
return new mTextView.TextView({
parent: parent,
@@ -181,6 +192,7 @@ define('orion/editor/edit', [ //$NON-NLS-0$
tabMode: options.tabMode,
expandTab: options.expandTab,
themeClass: options.themeClass,
+ theme: options.theme,
wrapMode: options.wrapMode
});
};
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js
index a16ff2f..51c56a4 100644
--- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/textTheme.js
@@ -144,6 +144,10 @@ define("orion/editor/textTheme", //$NON-NLS-0$
return this._themeClass;
},
_load: function (className, styleSheet, callback) {
+ if (!className) {
+ callback();
+ return;
+ }
if (typeof styleSheet === "string") { //$NON-NLS-0$
this._createStyle(className, styleSheet, callback);
return;
@@ -167,12 +171,12 @@ define("orion/editor/textTheme", //$NON-NLS-0$
*/
setThemeClass: function(className, styleSheet) {
var self = this;
+ var oldThemeClass = self._themeClass;
+ self._themeClass = className;
this._load(className, styleSheet, function() {
- var themeClass = self._themeClass;
- self._themeClass = className;
self.onThemeChanged({
type: "ThemeChanged", //$NON-NLS-0$
- oldValue: themeClass,
+ oldValue: oldThemeClass,
newValue: self.getThemeClass()
});
});
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/adelante.css b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/adelante.css
new file mode 100644
index 0000000..eee53a6
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/adelante.css
@@ -0,0 +1,59 @@
+.adelante {
+ font-family: monospace;
+ font-size: 10pt;
+ color: dimgray;
+}
+.adelante.textview {
+ background-color: #F1E7C8;
+}
+.adelante .ruler.annotations {
+ background-color: #E2D2B2;
+}
+.adelante .ruler.lines {
+ background-color: #E2D2B2;
+}
+.adelante .ruler.folding {
+ background-color: #E2D2B2;
+}
+.adelante .ruler.overview {
+ background-color: #E2D2B2;
+}
+.adelante .rulerLines {
+ color: #AF473B;
+}
+.adelante .rulerLines.even {
+ color: #AF473B;
+}
+.adelante .rulerLines.odd {
+ color: #AF473B;
+}
+.adelante .annotationLine.currentLine {
+ background-color: #9e937b;
+}
+.adelante .entity-name-tag {
+ color: #AF473B;
+}
+.adelante .entity-other-attribute-name {
+ color: cadetBlue;
+}
+.adelante .string-quoted {
+ color: #DE5D3B;
+}
+.adelante .token_keyword {
+ color: #AF473B;
+}
+.adelante .token_string {
+ color: #DE5D3B;
+}
+.adelante .token_singleline_comment {
+ color: #5D774E;
+}
+.adelante .token_multiline_comment {
+ color: #5D774E;
+}
+.adelante .token_doc_comment {
+ color: #5D774E;
+}
+.adelante .token_doc_html_markup {
+ color: #5D774E;
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/ambience.css b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/ambience.css
new file mode 100644
index 0000000..229ecb5
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/ambience.css
@@ -0,0 +1,59 @@
+.ambience {
+ font-family: monospace;
+ font-size: 10pt;
+ color: darkseagreen;
+}
+.ambience.textview {
+ background-color: #202020;
+}
+.ambience .ruler.annotations {
+ background-color: #3D3D3D;
+}
+.ambience .ruler.lines {
+ background-color: #3D3D3D;
+}
+.ambience .ruler.folding {
+ background-color: #3D3D3D;
+}
+.ambience .ruler.overview {
+ background-color: white;
+}
+.ambience .rulerLines {
+ color: black;
+}
+.ambience .rulerLines.even {
+ color: black;
+}
+.ambience .rulerLines.odd {
+ color: black;
+}
+.ambience .annotationLine.currentLine {
+ background-color: lightcyan;
+}
+.ambience .entity-name-tag {
+ color: cornFlowerBlue;
+}
+.ambience .entity-other-attribute-name {
+ color: cadetBlue;
+}
+.ambience .string-quoted {
+ color: lightcoral;
+}
+.ambience .token_keyword {
+ color: cornFlowerBlue;
+}
+.ambience .token_string {
+ color: lightcoral;
+}
+.ambience .token_singleline_comment {
+ color: mediumslateblue;
+}
+.ambience .token_multiline_comment {
+ color: mediumslateblue;
+}
+.ambience .token_doc_comment {
+ color: mediumslateblue;
+}
+.ambience .token_doc_html_markup {
+ color: mediumslateblue;
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/blue.css b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/blue.css
new file mode 100644
index 0000000..33d8e9e
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/blue.css
@@ -0,0 +1,59 @@
+.blue {
+ font-family: monospace;
+ font-size: 10pt;
+ color: navy;
+}
+.blue.textview {
+ background-color: aliceBlue;
+}
+.blue .ruler.annotations {
+ background-color: lavender;
+}
+.blue .ruler.lines {
+ background-color: lavender;
+}
+.blue .ruler.folding {
+ background-color: lavender;
+}
+.blue .ruler.overview {
+ background-color: lavender;
+}
+.blue .rulerLines {
+ color: darkSlateGray;
+}
+.blue .rulerLines.even {
+ color: darkSlateGray;
+}
+.blue .rulerLines.odd {
+ color: darkSlateGray;
+}
+.blue .annotationLine.currentLine {
+ background-color: white;
+}
+.blue .entity-name-tag {
+ color: cornFlowerBlue;
+}
+.blue .entity-other-attribute-name {
+ color: cadetBlue;
+}
+.blue .string-quoted {
+ color: cornFlowerBlue;
+}
+.blue .token_keyword {
+ color: cornFlowerBlue;
+}
+.blue .token_string {
+ color: cornFlowerBlue;
+}
+.blue .token_singleline_comment {
+ color: indigo;
+}
+.blue .token_multiline_comment {
+ color: indigo;
+}
+.blue .token_doc_comment {
+ color: indigo;
+}
+.blue .token_doc_html_markup {
+ color: indigo;
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/eclipse.css b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/eclipse.css
new file mode 100644
index 0000000..811ffb9
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/eclipse.css
@@ -0,0 +1,59 @@
+.eclipse {
+ font-family: monospace;
+ font-size: 10pt;
+ color: darkSlateGray;
+}
+.eclipse.textview {
+ background-color: white;
+}
+.eclipse .ruler.annotations {
+ background-color: white;
+}
+.eclipse .ruler.lines {
+ background-color: white;
+}
+.eclipse .ruler.folding {
+ background-color: white;
+}
+.eclipse .ruler.overview {
+ background-color: white;
+}
+.eclipse .rulerLines {
+ color: #444;
+}
+.eclipse .rulerLines.even {
+ color: #444;
+}
+.eclipse .rulerLines.odd {
+ color: #444;
+}
+.eclipse .annotationLine.currentLine {
+ background-color: #EAF2FE;
+}
+.eclipse .entity-name-tag {
+ color: #7f0055;
+}
+.eclipse .entity-other-attribute-name {
+ color: cadetBlue;
+}
+.eclipse .string-quoted {
+ color: blue;
+}
+.eclipse .token_keyword {
+ color: #7f0055;
+}
+.eclipse .token_string {
+ color: blue;
+}
+.eclipse .token_singleline_comment {
+ color: green;
+}
+.eclipse .token_multiline_comment {
+ color: green;
+}
+.eclipse .token_doc_comment {
+ color: green;
+}
+.eclipse .token_doc_html_markup {
+ color: green;
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/nimbus.css b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/nimbus.css
new file mode 100644
index 0000000..0258117
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/nimbus.css
@@ -0,0 +1,59 @@
+.nimbus {
+ font-family: monospace;
+ font-size: 10pt;
+ color: white;
+}
+.nimbus.textview {
+ background-color: dimgray;
+}
+.nimbus .ruler.annotations {
+ background-color: #444;
+}
+.nimbus .ruler.lines {
+ background-color: #444;
+}
+.nimbus .ruler.folding {
+ background-color: #444;
+}
+.nimbus .ruler.overview {
+ background-color: #444;
+}
+.nimbus .rulerLines {
+ color: #aaa;
+}
+.nimbus .rulerLines.even {
+ color: #aaa;
+}
+.nimbus .rulerLines.odd {
+ color: #aaa;
+}
+.nimbus .annotationLine.currentLine {
+ background-color: #aabfbb;
+}
+.nimbus .entity-name-tag {
+ color: darkorange;
+}
+.nimbus .entity-other-attribute-name {
+ color: cadetBlue;
+}
+.nimbus .string-quoted {
+ color: cornflowerblue;
+}
+.nimbus .token_keyword {
+ color: darkorange;
+}
+.nimbus .token_string {
+ color: cornflowerblue;
+}
+.nimbus .token_singleline_comment {
+ color: darkseagreen;
+}
+.nimbus .token_multiline_comment {
+ color: darkseagreen;
+}
+.nimbus .token_doc_comment {
+ color: darkseagreen;
+}
+.nimbus .token_doc_html_markup {
+ color: darkseagreen;
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/prospecto.css b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/prospecto.css
new file mode 100644
index 0000000..88b1079
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/prospecto.css
@@ -0,0 +1,59 @@
+.prospecto {
+ font-family: monospace;
+ font-size: 10pt;
+ color: #333;
+}
+.prospecto.textview {
+ background-color: white;
+}
+.prospecto .ruler.annotations {
+ background-color: white;
+}
+.prospecto .ruler.lines {
+ background-color: white;
+}
+.prospecto .ruler.folding {
+ background-color: white;
+}
+.prospecto .ruler.overview {
+ background-color: white;
+}
+.prospecto .rulerLines {
+ color: silver;
+}
+.prospecto .rulerLines.even {
+ color: silver;
+}
+.prospecto .rulerLines.odd {
+ color: silver;
+}
+.prospecto .annotationLine.currentLine {
+ background-color: #EAF2FE;
+}
+.prospecto .entity-name-tag {
+ color: #CC4C07;
+}
+.prospecto .entity-other-attribute-name {
+ color: cadetBlue;
+}
+.prospecto .string-quoted {
+ color: #446FBD;
+}
+.prospecto .token_keyword {
+ color: #CC4C07;
+}
+.prospecto .token_string {
+ color: #446FBD;
+}
+.prospecto .token_singleline_comment {
+ color: #3C802C;
+}
+.prospecto .token_multiline_comment {
+ color: #3C802C;
+}
+.prospecto .token_doc_comment {
+ color: #3C802C;
+}
+.prospecto .token_doc_html_markup {
+ color: #3C802C;
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/raspberrypi.css b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/raspberrypi.css
new file mode 100644
index 0000000..3b512eb
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/raspberrypi.css
@@ -0,0 +1,59 @@
+.raspberrypi {
+ font-family: monospace;
+ font-size: 10pt;
+ color: dimgray;
+}
+.raspberrypi.textview {
+ background-color: seashell;
+}
+.raspberrypi .ruler.annotations {
+ background-color: seashell;
+}
+.raspberrypi .ruler.lines {
+ background-color: seashell;
+}
+.raspberrypi .ruler.folding {
+ background-color: seashell;
+}
+.raspberrypi .ruler.overview {
+ background-color: seashell;
+}
+.raspberrypi .rulerLines {
+ color: #E73E36;
+}
+.raspberrypi .rulerLines.even {
+ color: #E73E36;
+}
+.raspberrypi .rulerLines.odd {
+ color: #E73E36;
+}
+.raspberrypi .annotationLine.currentLine {
+ background-color: #F5B1AE;
+}
+.raspberrypi .entity-name-tag {
+ color: #E73E36;
+}
+.raspberrypi .entity-other-attribute-name {
+ color: cadetBlue;
+}
+.raspberrypi .string-quoted {
+ color: darkorange;
+}
+.raspberrypi .token_keyword {
+ color: #E73E36;
+}
+.raspberrypi .token_string {
+ color: darkorange;
+}
+.raspberrypi .token_singleline_comment {
+ color: #66B32F;
+}
+.raspberrypi .token_multiline_comment {
+ color: #66B32F;
+}
+.raspberrypi .token_doc_comment {
+ color: #66B32F;
+}
+.raspberrypi .token_doc_html_markup {
+ color: #66B32F;
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/tierra.css b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/tierra.css
new file mode 100644
index 0000000..31033ba
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/themes/tierra.css
@@ -0,0 +1,59 @@
+.tierra {
+ font-family: monospace;
+ font-size: 10pt;
+ color: #555555;
+}
+.tierra.textview {
+ background-color: lemonchiffon;
+}
+.tierra .ruler.annotations {
+ background-color: moccasin;
+}
+.tierra .ruler.lines {
+ background-color: moccasin;
+}
+.tierra .ruler.folding {
+ background-color: moccasin;
+}
+.tierra .ruler.overview {
+ background-color: moccasin;
+}
+.tierra .rulerLines {
+ color: chocolate;
+}
+.tierra .rulerLines.even {
+ color: chocolate;
+}
+.tierra .rulerLines.odd {
+ color: chocolate;
+}
+.tierra .annotationLine.currentLine {
+ background-color: #baa289;
+}
+.tierra .entity-name-tag {
+ color: darkred;
+}
+.tierra .entity-other-attribute-name {
+ color: cadetBlue;
+}
+.tierra .string-quoted {
+ color: orangered;
+}
+.tierra .token_keyword {
+ color: darkred;
+}
+.tierra .token_string {
+ color: orangered;
+}
+.tierra .token_singleline_comment {
+ color: darkseagreen;
+}
+.tierra .token_multiline_comment {
+ color: darkseagreen;
+}
+.tierra .token_doc_comment {
+ color: darkseagreen;
+}
+.tierra .token_doc_html_markup {
+ color: darkseagreen;
+} \ No newline at end of file