Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Issue with embedding Orion.Client

Hi Zach,

I believe this is not a problem with the version of require.js. The problem is with the way the files are layed out in the file system (or server).

How are you mounting the files on your server?  I was able to open panel.html by making the changes in the attached patch and creating an orion site with the following mappings:


/Orion-X    ->   /
/Orion-X/orion.client/bundles/org.eclipse.orion.client.editor/web  ->  /
/Orion-X/orion.client/bundles/org.eclipse.orion.client.core/web  -> /

Silenio






From:        John J Barton <johnjbarton@xxxxxxxxxxxxxxx>
To:        Orion developer discussions <orion-dev@xxxxxxxxxxx>,
Date:        06/26/2012 06:15 PM
Subject:        Re: [orion-dev] Issue with embedding Orion.Client
Sent by:        orion-dev-bounces@xxxxxxxxxxx






On Tue, Jun 26, 2012 at 3:11 PM, Zachariah Moreno <xachmoreno@xxxxxxxxx> wrote:
Thank You John,

I hadn't checked my version of Require. I just updated my copy to the latest (v2.0.2) which is still presenting the same error. It was my understanding that orion.client is dependent on require.js, but it is not included in the repo, is this correct?

Try the one in
/orion.client/bundles/org.eclipse.orion.client.core/web/requirejs/require.js

 

The paths you mention are not giving me a Failed to Load Resource, is that what you're getting?

No, I just get undefined arguments, no other errors.

jjb
 


Zach

-- 
Zachariah Moreno
Sent with Sparrow

On Tuesday, June 26, 2012 at 2:41 PM, John J Barton wrote:



On Tue, Jun 26, 2012 at 1:11 PM, Zachariah Moreno <xachmoreno@xxxxxxxxx> wrote:
Hello All,

I have been attempting to embed orion.client into a Chrome DevTools panel, as part of my efforts for Google Summer of Code. The first method I used was outlined by Felipe Heidrich in his blog post Using the Orion Editor with Almond, which was a success in most ways but not others. So I switched my method of embedding to use the the example presented by John Arthorne (thank you btw) in his more recent post Examples of Embedding The Orion Editor, which is more fitting for use in conjunction with the API exposed in DevTools. Last week, John Barton was kind enough to spend some time with me on this project. We determined John Arthorne's Embedded editor example was the most fitting for our desired outcome & the switch was made successfully in this repo. However, the file structure of orion.client was not maintained to get this working in a short period of time. After reviewing this progress, John Barton suggested I go through the process again, while maintaining the orion.client file structure to allow for ease of updates in the future (which I completely agree with). I have created a separate repo for this change & updated all of the paths to reflect this, but I am getting Uncaught TypeError: Cannot read property 'CssContentAssistProvider' of undefined chrome-extension://hnnbddcdmjkbcckijnphgophmegpflhe/embeddededitor.js:47. >From what I can tell, `mCSSContentAssist.CssContentAssistProvider()` is only referenced in embeddededitor.js & the error never came up when I did my first implementation. If anyone has any thoughts or advice please don't hesitate to share.

embeddededitor.js uses require.js with module ids like:

"orion.client/bundles/org.eclipse.orion.client.editor/web/orion/textview/textView"

All of the arguments that match these ids are 'undefined'.

I have no idea how this can happen (require.js is loading the files but not passing the exports to the arguments of define).  I suggest checking the version of require.js against the one used by Orion.

jjb


Thank You Kindly,

-- 
Zachariah Moreno
Sent with Sparrow


_______________________________________________
orion-dev mailing list

orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev


_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev


_______________________________________________
orion-dev mailing list

orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev

_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev

diff --git a/embeddededitor.js b/embeddededitor.js
index 6bed49b..e503abe 100644
--- a/embeddededitor.js
+++ b/embeddededitor.js
@@ -13,17 +13,17 @@
 /*jslint browser:true devel:true*/
 
 define([
-	"org.eclipse.orion.client.core/web/requirejs/require.js",
-	"org.eclipse.orion.client.editor/web/orion/textview/textView",
-	"org.eclipse.orion.client.editor/web/orion/textview/keyBinding",
-	"org.eclipse.orion.client.editor/web/examples/textview/textStyler",
-	"org.eclipse.orion.client.editor/web/orion/editor/textMateStyler",
-	"org.eclipse.orion.client.editor/web/orion/editor/htmlGrammar",
-	"org.eclipse.orion.client.editor/web/orion/editor/editor",
-	"org.eclipse.orion.client.editor/web/orion/editor/editorFeatures",
-	"org.eclipse.orion.client.editor/web/orion/editor/contentAssist",
-	"org.eclipse.orion.client.editor/web/orion/editor/jsContentAssist",
-	"org.eclipse.orion.client.editor/web/orion/editor/cssContentAssist"],
+	"require",
+	"orion/textview/textView",
+	"orion/textview/keyBinding",
+	"examples/textview/textStyler",
+	"orion/editor/textMateStyler",
+	"orion/editor/htmlGrammar",
+	"orion/editor/editor",
+	"orion/editor/editorFeatures",
+	"orion/editor/contentAssist",
+	"orion/editor/jsContentAssist",
+	"orion/editor/cssContentAssist"],
 
 function(require, mTextView, mKeyBinding, mTextStyler, mTextMateStyler, mHtmlGrammar, mEditor, mEditorFeatures, mContentAssist, mJSContentAssist, mCSSContentAssist){
 	
diff --git a/panel.html b/panel.html
index 6b5aa60..e25d2af 100644
--- a/panel.html
+++ b/panel.html
@@ -5,26 +5,26 @@
 		<meta http-equiv="Content-Language" content="en-us">
 		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 		<title>Embedded Orion Editor</title>
-		<link rel="stylesheet" type="text/css" href="orion.client/bundles/org.eclipse.orion.client.editor/web/examples/editor/embeddededitor.css" />
-		<link rel="stylesheet" type="text/css" href="orion.client/bundles/org.eclipse.orion.client.core/web/css/default-theme.css" />
+		<link rel="stylesheet" type="text/css" href="css/default-theme.css" />
+		<link rel="stylesheet" type="text/css" href="examples/editor/embeddededitor.css" />
 
 		<!-- Require JS in orion.client-->
-		<script src="/orion.client/bundles/org.eclipse.orion.client.core/web/requirejs/require.js"></script>
+		<script src="requirejs/require.js"></script>
 
 		<script type="text/javascript">
 			require({
-			  baseUrl: 'orion.client/bundles/',
+			  baseUrl: '.',
 			  paths: {
-				  text: '/orion.client/bundles/org.eclipse.orion.client.core/web/requirejs/text',
-				  i18n: '/orion.client/bundles/org.eclipse.orion.client.core/web/requirejs/i18n',
-			      domReady: '/orion.client/bundles/org.eclipse.orion.client.core/web/requirejs/domReady'
+				  text: 'requirejs/text',
+				  i18n: 'requirejs/i18n',
+			      domReady: 'requirejs/domReady'
 			  }
 			});
 			
 			/* Original copy of embeddededitor.js is in orion.client/bundles/org.eclipse.orion.client.editor/web/examples/editor/embeddededitor.js - embeddededitor.js in root is a copy to fix path issues */
 			require(["embeddededitor.js"]);
 		</script>
-
+	</head>
     <body class="claro" style="width: 100%; height: 100%;">
 	<div id="logo" style="height: 28px; background: #404040; text-align: left;">
 		<img src="img/skinnyheaderlogo.png" alt="Orion">

Back to the top