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

Bug 382253

Summary: Text view example not working standalone
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: EditorAssignee: John Arthorne <john.arthorne>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Silenio_Quarti, simon_kaegi
Version: unspecifiedFlags: simon_kaegi: review+
Target Milestone: 0.5 RC2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description John Arthorne CLA 2012-06-11 10:50:51 EDT
I was trying to run the text view example stand-alone on my desktop this morning. The example in its current state in the repository would not work for me. It looks like there is an absolute path in the require.js configuration. When I changed this to a relative path the example worked. It seems to work on orion.eclipse.org though so I don't fully understand why it didn't work locally.
Comment 1 John Arthorne CLA 2012-06-11 10:51:21 EDT
This patch fixed it for me:

diff --git a/bundles/org.eclipse.orion.client.editor/web/examples/textview/demo.html b/bundles/org.eclipse.orion.client.editor/web/examples/textview/demo.html
index 71d448e..335fee7 100644
--- a/bundles/org.eclipse.orion.client.editor/web/examples/textview/demo.html
+++ b/bundles/org.eclipse.orion.client.editor/web/examples/textview/demo.html
@@ -14,7 +14,7 @@
 	  paths: {
 		  text: 'requirejs/text',
 		  i18n: 'requirejs/i18n',
-		  tests: '/js-tests',
+		  tests: 'js-tests',
 		  domReady: 'requirejs/domReady'
 	  }
 	});
Comment 2 Silenio Quarti CLA 2012-06-11 13:05:54 EDT
The change is good to me. We should not have absolute paths. While at this, we should remove the same path mapping from the following files since they are unnecessary.

minimaleditor.html
embeddededitor.html

John, how do I run the example standalone? Just double-click the HTML in the file explorer?
Comment 3 John Arthorne CLA 2012-06-11 22:15:48 EDT
(In reply to comment #2)
> The change is good to me. We should not have absolute paths. While at this, we
> should remove the same path mapping from the following files since they are
> unnecessary.
> 
> minimaleditor.html
> embeddededitor.html
> 
> John, how do I run the example standalone? Just double-click the HTML in the
> file explorer?

1) Clone client repository to local machine
2) Copy requirejs folder from org.eclipse.orion.client.core to client.editor.
3) Double-click the example HTML file to open it.

I'm sure you can also run it in an Orion site, I just happened to be working completely offline today so that's how I was doing it.