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

Bug 421004

Summary: Browser issues with embedding Orion v3.0 Editor in HTML source
Product: [ECD] Orion Reporter: Jack Pizzolato <jppmail01>
Component: EditorAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: Silenio_Quarti
Version: 3.0   
Target Milestone: 5.0 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jack Pizzolato CLA 2013-11-04 12:51:13 EST
We embedded the Orion editor v3.0 in our HTML code, following the instructions at:

http://planetorion.org/news/2013/02/embed-the-latest-orion-editor-in-your-code-in-2-steps/

After some testing, we noticed the following issues:

1) On page load with Firefox v24/v25 (as well as IE9 and IE10), there appears to be a bug that causes the browser to scroll down to the 
last code example that is invoking the Orion editor.  Problem with scrollIntoView method?
2) On page load with IE8, the browser displays a script error (Object expected) and the editor does not display.  

We see the same problems when viewing the embedded editor on the Orion News page at:  
http://planetorion.org/news/2013/02/embed-the-latest-orion-editor-in-your-code-in-2-steps/

We've tried turning off different attributes (including all default attributes) and setting the display to readonly, but have not been able to fix the problem.  We also tried embedding v2.0 of the editor without success.

Based on our testing, the current versions of the following browsers do not seem to have a problem with the embedded editor:  
Chrome, Maxthon Cloud, Safari for Windows, Opera
Comment 1 Jack Pizzolato CLA 2013-11-04 12:54:30 EST
Testing on XP and Windows 7
Comment 2 Silenio Quarti CLA 2013-11-12 10:10:02 EST
For problem 2), support for IE8 has been added to the stand alone editor in Orion 4.0.  There still one remaining issue the affects the creation of multiple editors wrapping elements of a given className (which is used in blogs specially).  The problem happens because document.getElementsByClassName() is not available in IE8. I have fixed this with:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=8a92f18247a7d7cf69a5537093ed7dfb0da130e8

Please try the latest build from:

http://download.eclipse.org/orion/drops/I201311112230/index.html

The blog posts in planetorion are using this build and working on IE8.
Comment 3 Silenio Quarti CLA 2013-11-12 10:31:07 EST
For problem 1),  the page scrolls to show the last editor when the editor DIV receives focus.  There is no reasonable way to prevent this from happening on FF and IE.  I have added a option (see commit [1]) to the editor (noFocus) that when set to true avoids setting the focus to the editor on creation.   The flag is true by default when creating multiple editors. This should take care of blogs with multiple snippets of code.  If your blogs have only one editor and you do not want the page to scroll to show that editor, set this option to true.

[1] http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=74810f96430dac5fae22b8b45b62a924346f5f56

Please try the next build.