aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Macdonald2013-06-19 18:31:10 (EDT)
committerskaegi2013-06-19 23:43:29 (EDT)
commit7fe432c3cd875f79b8dbd796819d53a47d021f19 (patch)
treeb066c99993f45fd5b8013a78d7b8579a18e46d2b
parent17371fa5b6bfe4a0fbfa90407896f52ae44ae705 (diff)
downloadorg.eclipse.orion.client-7fe432c3cd875f79b8dbd796819d53a47d021f19.zip
org.eclipse.orion.client-7fe432c3cd875f79b8dbd796819d53a47d021f19.tar.gz
org.eclipse.orion.client-7fe432c3cd875f79b8dbd796819d53a47d021f19.tar.bz2
[Bug 411178] webEditingPlugin is not minifiedv20130620-0343
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.html181
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.js173
-rw-r--r--modules/orionode/build/customTargets.xml1
-rw-r--r--releng/org.eclipse.orion.client.releng/builder/orion.mini.xml1
4 files changed, 190 insertions, 166 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.html b/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.html
index 025ee20..d6f403a 100644
--- a/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.html
+++ b/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.html
@@ -1,173 +1,22 @@
<!DOCTYPE html>
<html>
<head>
-<meta name="copyright" content="Copyright (c) IBM Corporation and others 2011, 2012.">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<script src="../orion/plugin.js"></script>
-<script src="../orion/editor/global.js"></script>
-<script src="../orion/editor/keywords.js"></script>
-<script src="../orion/editor/templates.js"></script>
-<script src="../orion/editor/cssContentAssist.js"></script>
-<script src="../orion/editor/jsTemplateContentAssist.js"></script>
-<script src="../orion/editor/htmlGrammar.js"></script>
-<script src="../orion/editor/htmlContentAssist.js"></script>
-<script>
-/*global window eclipse orion */
-window.onload = function() {
-
- var headers = {
- name: "Orion Web Editing Plugin",
- version: "1.0",
- description: "This plugin provides editor link support for the navigator and provides default editing capabilities for HTML, JavaScript, and CSS."
- };
-
- var provider = new orion.PluginProvider(headers);
-
- provider.registerService("orion.core.contenttype", {}, {
- contentTypes:
- // Text types
- [{ id: "text/plain",
- name: "Text",
- extension: ["txt"],
- image: "../images/file_model.gif"
- },
- { id: "text/html",
- "extends": "text/plain",
- name: "HTML",
- extension: ["html", "htm"],
- image: "../images/html.gif"
- },
- { id: "text/css",
- "extends": "text/plain",
- name: "CSS",
- extension: ["css"],
- image: "../images/stylesheet.gif"
- },
- { id: "application/javascript",
- "extends": "text/plain",
- name: "JavaScript",
- extension: ["js"],
- image: "../images/javascript.gif"
- },
- { id: "application/json",
- "extends": "text/plain",
- name: "JSON",
- extension: ["json"],
- image: "../images/wtp/json.gif"
- },
- { id: "application/xml",
- "extends": "text/plain",
- name: "XML",
- extension: ["xml"],
- image: "../images/wtp/xmlfile.gif"
- },
- { id: "text/x-java-source",
- "extends": "text/plain",
- name: "Java",
- extension: ["java"]
- },
- { id: "text/x-markdown",
- "extends": "text/plain",
- name: "Markdown",
- extension: ["md"]
- },
- { id: "text/x-yaml",
- "extends": "text/plain",
- name: "YAML",
- extension: ["yaml", "yml"]
- },
- { id: "text/conf",
- "extends": "text/plain",
- name: "Conf",
- extension: ["conf"]
- },
- { id: "text/sh",
- "extends": "text/plain",
- name: "sh",
- extension: ["sh"]
- },
- // Image types
- { id: "image/gif",
- name: "GIF",
- extension: ["gif"],
- image: "../images/wtp/image.gif"
- },
- { id: "image/jpeg",
- name: "JPG",
- extension: ["jpg", "jpeg", "jpe"],
- image: "../images/wtp/image.gif"
- },
- { id: "image/ico",
- name: "ICO",
- extension: ["ico"],
- image: "../images/wtp/image.gif"
- },
- { id: "image/png",
- name: "PNG",
- extension: ["png"],
- image: "../images/wtp/image.gif"
- },
- { id: "image/tiff",
- name: "TIFF",
- extension: ["tif", "tiff"],
- image: "../images/wtp/image.gif"
- },
- { id: "image/svg",
- name: "SVG",
- extension: ["svg"],
- image: "../images/wtp/image.gif"
- }]
- });
-
- provider.registerService("orion.navigate.command", {}, {
- name: "Raw",
- id: "orion.view.raw",
- tooltip: "Open the raw file or folder in the browser",
- uriTemplate: "{Location}",
- forceSingleItem: true
- });
-
- provider.registerService("orion.edit.editor", {}, {
- id: "orion.editor",
- nameKey: "Orion Editor",
- nls: "orion/nls/messages",
- uriTemplate: "../edit/edit.html#{Location,params*}",
- orionTemplate: "../edit/edit.html#{,Location,params*}"});
-
- provider.registerService("orion.navigate.openWith", {}, {
- editor: "orion.editor",
- contentType: ["text/plain", "text/html", "text/css", "application/javascript", "application/json", "application/xml", "text/x-java-source"]});
-
- provider.registerService("orion.navigate.openWith.default", {}, {
- editor: "orion.editor"});
-
- // Register content assist providers
- provider.registerService("orion.edit.contentAssist",
- new orion.editor.CssContentAssistProvider(),
- { name: "CSS content assist",
- contentType: ["text/css"]
- });
- provider.registerService("orion.edit.contentAssist",
- new orion.editor.JSTemplateContentAssistProvider(),
- { name: "JavaScript content assist",
- contentType: ["application/javascript"]
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Web Editing Plugin</title>
+ <script src="../requirejs/require.js"></script>
+ <script>
+ /*global require*/
+ require({
+ baseUrl: '..',
+ paths: {
+ text: 'requirejs/text',
+ i18n: 'requirejs/i18n',
+ domReady: 'requirejs/domReady'
+ }
});
- provider.registerService("orion.edit.contentAssist",
- new orion.editor.HTMLContentAssistProvider(),
- { name: "HTML content assist",
- contentType: ["text/html"]
- });
-
- // Register syntax highlighting
- provider.registerService("orion.edit.highlighter", {},
- { type: "grammar",
- contentType: ["text/html"],
- grammar: new orion.editor.HtmlGrammar()
- });
-
- provider.connect();
-};
-</script>
+
+ require(['webEditingPlugin.js']);
+ </script>
</head>
<body>
</body>
diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.js b/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.js
new file mode 100644
index 0000000..887be93
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.ui/web/plugins/webEditingPlugin.js
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+/*global define*/
+define([
+ 'orion/plugin',
+ 'orion/editor/cssContentAssist',
+ 'orion/editor/htmlContentAssist',
+ 'orion/editor/htmlGrammar',
+ 'orion/editor/jsTemplateContentAssist',
+ 'orion/editor/keywords',
+ 'orion/editor/templates'
+], function(PluginProvider, cssContentAssist, htmlContentAssist, htmlGrammar, jsTemplateContentAssist, keywords, templates) {
+ var headers = {
+ name: "Orion Web Editing Plugin",
+ version: "1.0",
+ description: "This plugin provides editor link support for the navigator and provides default editing capabilities for HTML, JavaScript, and CSS."
+ };
+
+ var provider = new PluginProvider(headers);
+
+ provider.registerService("orion.core.contenttype", {}, {
+ contentTypes:
+ // Text types
+ [{ id: "text/plain",
+ name: "Text",
+ extension: ["txt"],
+ image: "../images/file_model.gif"
+ },
+ { id: "text/html",
+ "extends": "text/plain",
+ name: "HTML",
+ extension: ["html", "htm"],
+ image: "../images/html.gif"
+ },
+ { id: "text/css",
+ "extends": "text/plain",
+ name: "CSS",
+ extension: ["css"],
+ image: "../images/stylesheet.gif"
+ },
+ { id: "application/javascript",
+ "extends": "text/plain",
+ name: "JavaScript",
+ extension: ["js"],
+ image: "../images/javascript.gif"
+ },
+ { id: "application/json",
+ "extends": "text/plain",
+ name: "JSON",
+ extension: ["json"],
+ image: "../images/wtp/json.gif"
+ },
+ { id: "application/xml",
+ "extends": "text/plain",
+ name: "XML",
+ extension: ["xml"],
+ image: "../images/wtp/xmlfile.gif"
+ },
+ { id: "text/x-java-source",
+ "extends": "text/plain",
+ name: "Java",
+ extension: ["java"]
+ },
+ { id: "text/x-markdown",
+ "extends": "text/plain",
+ name: "Markdown",
+ extension: ["md"]
+ },
+ { id: "text/x-yaml",
+ "extends": "text/plain",
+ name: "YAML",
+ extension: ["yaml", "yml"]
+ },
+ { id: "text/conf",
+ "extends": "text/plain",
+ name: "Conf",
+ extension: ["conf"]
+ },
+ { id: "text/sh",
+ "extends": "text/plain",
+ name: "sh",
+ extension: ["sh"]
+ },
+ // Image types
+ { id: "image/gif",
+ name: "GIF",
+ extension: ["gif"],
+ image: "../images/wtp/image.gif"
+ },
+ { id: "image/jpeg",
+ name: "JPG",
+ extension: ["jpg", "jpeg", "jpe"],
+ image: "../images/wtp/image.gif"
+ },
+ { id: "image/ico",
+ name: "ICO",
+ extension: ["ico"],
+ image: "../images/wtp/image.gif"
+ },
+ { id: "image/png",
+ name: "PNG",
+ extension: ["png"],
+ image: "../images/wtp/image.gif"
+ },
+ { id: "image/tiff",
+ name: "TIFF",
+ extension: ["tif", "tiff"],
+ image: "../images/wtp/image.gif"
+ },
+ { id: "image/svg",
+ name: "SVG",
+ extension: ["svg"],
+ image: "../images/wtp/image.gif"
+ }]
+ });
+
+ provider.registerService("orion.navigate.command", {}, {
+ name: "Raw",
+ id: "orion.view.raw",
+ tooltip: "Open the raw file or folder in the browser",
+ uriTemplate: "{Location}",
+ forceSingleItem: true
+ });
+
+ provider.registerService("orion.edit.editor", {}, {
+ id: "orion.editor",
+ nameKey: "Orion Editor",
+ nls: "orion/nls/messages",
+ uriTemplate: "../edit/edit.html#{Location,params*}",
+ orionTemplate: "../edit/edit.html#{,Location,params*}"});
+
+ provider.registerService("orion.navigate.openWith", {}, {
+ editor: "orion.editor",
+ contentType: ["text/plain", "text/html", "text/css", "application/javascript", "application/json", "application/xml", "text/x-java-source"]});
+
+ provider.registerService("orion.navigate.openWith.default", {}, {
+ editor: "orion.editor"});
+
+ // Register content assist providers
+ provider.registerService("orion.edit.contentAssist",
+ new cssContentAssist.CssContentAssistProvider(),
+ { name: "CSS content assist",
+ contentType: ["text/css"]
+ });
+ provider.registerService("orion.edit.contentAssist",
+ new jsTemplateContentAssist.JSTemplateContentAssistProvider(),
+ { name: "JavaScript content assist",
+ contentType: ["application/javascript"]
+ });
+ provider.registerService("orion.edit.contentAssist",
+ new htmlContentAssist.HTMLContentAssistProvider(),
+ { name: "HTML content assist",
+ contentType: ["text/html"]
+ });
+
+ // Register syntax highlighting
+ provider.registerService("orion.edit.highlighter", {},
+ { type: "grammar",
+ contentType: ["text/html"],
+ grammar: new htmlGrammar.HtmlGrammar()
+ });
+
+ provider.connect();
+}); \ No newline at end of file
diff --git a/modules/orionode/build/customTargets.xml b/modules/orionode/build/customTargets.xml
index 3348b52..1e29e09 100644
--- a/modules/orionode/build/customTargets.xml
+++ b/modules/orionode/build/customTargets.xml
@@ -197,6 +197,7 @@ lastMapTag=${mapsTagTag}
<!-- <optimize pageDir="plugins" name="authenticationPlugin" bundle="org.eclipse.orion.client.ui" /> -->
<optimize pageDir="plugins" name="fileClientPlugin" bundle="org.eclipse.orion.client.ui" />
<optimize pageDir="plugins" name="jslintPlugin" bundle="org.eclipse.orion.client.ui" />
+ <optimize pageDir="plugins" name="webEditingPlugin" bundle="org.eclipse.orion.client.ui" />
<!-- <optimize pageDir="plugins" name="preferencesPlugin" bundle="org.eclipse.orion.client.ui" />
<optimize pageDir="plugins" name="taskPlugin" bundle="org.eclipse.orion.client.ui" />
<optimize pageDir="sites" name="site" bundle="org.eclipse.orion.client.ui" />
diff --git a/releng/org.eclipse.orion.client.releng/builder/orion.mini.xml b/releng/org.eclipse.orion.client.releng/builder/orion.mini.xml
index 30e3ab6..7b46ab7 100644
--- a/releng/org.eclipse.orion.client.releng/builder/orion.mini.xml
+++ b/releng/org.eclipse.orion.client.releng/builder/orion.mini.xml
@@ -178,6 +178,7 @@
<optimize pageDir="plugins" name="jslintPlugin" bundle="org.eclipse.orion.client.ui" />
<optimize pageDir="plugins" name="preferencesPlugin" bundle="org.eclipse.orion.client.ui" />
<optimize pageDir="plugins" name="taskPlugin" bundle="org.eclipse.orion.client.ui" />
+ <optimize pageDir="plugins" name="webEditingPlugin" bundle="org.eclipse.orion.client.ui" />
<optimize pageDir="sites" name="site" bundle="org.eclipse.orion.client.ui" />
<optimize pageDir="sites" name="sites" bundle="org.eclipse.orion.client.ui" />
<optimize pageDir="sites" name="view" bundle="org.eclipse.orion.client.ui" />