Community
Participate
Working Groups
Support links in the editor Adding links to the editor is not as easy as adding a link to a html page. The editor uses contentEditable=true what causes the <a> element the behaviour very differently than what a user would expected of a link. The two main ideas to solve this problem are: a) The editor provides a link -the links would only shows on a specific case (mouse move holding control key down, like eclipse) -the links would have the native tooltip/status message -the links would have the native colour and state (visisted, etc) -hard to define API -hard to customize the behaviour and apperance -Implementation is challenging b) The editor provides all features needed for the app to implement a link -add mouse events support to the editor (and/or the ranges) --Note: mouse events can be needed for another features in the future --Problem: Normalize events ? How to stop events ? -no native tooltip/status message -no visited state -native colors can be emulated
I released support for embedded links in text view by implementing idea a) mentioned above. Links are provide as styling information (onLineStyle() event). The Style object has been extended allowing stylers to identify the type of DOM element to create for a range. Supported types at the moment are: "A" (for links) and "SPAN" (the default). Another addition is the "attributes" property which let stylers set generic DOM attributes for the range element. Link elements should specify the "href attribute as it is done in usual HTML. Style {String} styleClass A CSS class name. {Object} style An object with CSS properties. {String} tagName A DOM tag name. (NEW) {Object} attributes An object with DOM attributes. (NEW) Links are displayed when the mouse moves with the Ctrl modifier pressed (Cmd on Mac) and without any buttons pressed. Links are followed using usual user agent behaviour (Ctrl down -> opens new tab not selected) and (Ctrl+Shift down -> opens new tab and selects it). If Ctrl is not down when the link is clicked, nothing happens. The example styler (examples/textview/styler.js) has been modified to identify two types of links in comments: URLs and bugzilla numbers (bug#XXXXX). Fixed http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f959913b7721cf70e0e9042566754cd4546ec889
I understand this bug doesn't cover the links for the resources used in HTML files. But I feel it would be nice to be able to open the javascript, CSS and even other HTML files that are referenced from an HTML file, i.e. the ones that are referenced using relative path. I don't see a bug for this. Or is there already one?
(In reply to comment #2) > I understand this bug doesn't cover the links for the resources used in HTML > files. But I feel it would be nice to be able to open the javascript, CSS and > even other HTML files that are referenced from an HTML file, i.e. the ones that > are referenced using relative path. > I don't see a bug for this. Or is there already one? This is something that the html styler would need to handle. Please open a new bug, this would be a nice feature to have.