#439 closed New Feature (fixed)
IE: CTRL+Click to open links in a new window
Reported by: | Duncan | Owned by: | Martin Kou |
---|---|---|---|
Priority: | Normal | Milestone: | FCKeditor 2.6.3 |
Component: | General | Version: | 3.3.2 |
Keywords: | Confirmed IE Review- | Cc: |
Description
It does not seem possible to follow a link using IE7. For example, the "You are using FCKeditor" link in the Demo pages. NOTE: IE6 and Firefox work fine, ctrl-click and shift-click open the window.
I've had a search of the existing tickets and can't find anything relevant. However, this seems such a fundamental problem I can't believe it hasn't already been reported. Fingers crossed you've already investigated this and know of a workaround.
If there is no workaround, might I suggest adding an "Open Link" menu item to the link context menu and an "Open Link" button to the Link Editor dialog.
I had a look at the problem and I suspect the event model is incorrect for contenteditable elements. I think this event is bypassing the normal event handlers and cannot be caught.
Attachments (4)
Change History (23)
comment:1 Changed 18 years ago by
Keywords: | IE7 Link URL removed |
---|
comment:2 Changed 18 years ago by
You are right, it does work in IE6! Gotta admit I kind of assumed it wouldn't because I have had my fingers burnt on something very similar to this a while back. See http://www.quirksmode.org/bugreports/archives/2007/02/Ctrl_Click_event_lost_on_IE7_hyperlinks.html
Bizarrely, ctrl and shift clicking the link works fine in Firefox.
Do you know any way my users can open the link target in IE6 and IE7. That would be most helpful. Thanks - Duncan
comment:3 Changed 18 years ago by
It should be possible to write a plugin that provides that option in the context menu of a link. The only problem that I can foresee are relative links, I'm not sure if they will work fine or they will open based on the location of the editor files.
comment:4 Changed 18 years ago by
Summary: | Cannot follow a link in IE7 → IE: CTRL+Click to open links in a new window |
---|---|
Type: | Bug → New Feature |
For now, in the way you want it, this is a Firefox only feature.
IE instead has also a unique feature for the CTRL+Click: select the entire paragraph. So, others may say that this is also a nice feature.
Probably the plugin solution is much more indicated, putting a "Open link" option in the context menu.
comment:5 Changed 18 years ago by
comment:6 Changed 17 years ago by
Keywords: | Confirmed IE added |
---|
comment:7 Changed 17 years ago by
Milestone: | → FCKeditor 2.6.1 |
---|
I confirm that current we have this feature natively on Firefox. No luck for us with IE, Safari and Opera.
I've just investigated this feature a bit and find out several issues.
I'm supposing the only way to do that is:
- Take the link href.
- Call window.open to open it.
Sounds simple, but then the troubles.
- Popup blockers just hate window.open.
- Everything is ok with full URLs.
- Absolute URLs (like "/path/page.html") will be always relative to the site running the editor. No lucky to open www pages from a backoffice in a different URL.
- Relative URLs (like "path.page.html" or "../path/page.html") are a big trouble. They will be always relative to the "fckeditor/editor" folder. I've tried opening it from several different windows, but it will always be relative to "fckeditor/editor".
So, things are not that simple. The correct approach would be:
- If BaseHref is set, combine absolute and relative URLs with it. The base href value should be taken from the page because of FullPage=true.
- If BaseHref is empty, combine absolute and relative URLs with the main page URL (the page containing the editor).
Other then that, I've also tested the CTRL+Click and SHIFT+Click. In IE, clicks with control (at least on editing mode) are not passed to the "click" or "mousedown" events. So there is no way to catch them. I was able to make it work with SHIFT with "good enough" results. But, it seems that CTRL is more accepted for that (Word uses it for instance). So, much probably the context menu option is the right approach for it.
To conclude, this is doable with some effort, but the popup blockers issue will always be a problem for us.
comment:8 Changed 17 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
Changed 17 years ago by
comment:9 Changed 17 years ago by
Keywords: | Review? added |
---|
A new icon for the new context menu item may be needed.
Changed 17 years ago by
Attachment: | 439.2.patch added |
---|
comment:10 Changed 17 years ago by
Keywords: | Review- added; Review? removed |
---|
- The patch assumes that _fcksavedurl will be always available, which is not true (paste). The correct way to retrieve the URL should be:
var url = el.getAttribute( '_fcksavedurl' ) || el.getAttribute( 'href' , 2 ) ;
- I understand all the RFC stuff, but
/:\/\//
should be also enough to check for a full URL, as well as/^.*:\/\/+[^\/]+/
to retrieve the "until host" part of the base href.
- There is no need to pass
'FCKVisitLink'
towindow.open
. It would just limit the links to open in the same window, which is not needed here.
Changed 17 years ago by
Attachment: | 439_3.patch added |
---|
comment:11 Changed 17 years ago by
Keywords: | Review? added; Review- removed |
---|
comment:12 Changed 17 years ago by
Keywords: | Review- added; Review? removed |
---|
The code looks good. There are still two small details:
- As there are additions to the language files, update_lang.bat must be run to include the new entries into all files.
- It is not a good idea to use the same icon as for the link command. If no icon is available it is better to have no icon there, which would be ok in this case.
- The first and the last positions in the context menu are to be used by the entries more often used. I know it sounds strange, but the last entries are in the lower boundary which is visually easier and quicker to find. So, the correct order would be "Open Link, -, Edit Link, Remove Link".
A Review+ will definitely come after those changes.
comment:13 Changed 17 years ago by
Keywords: | Review? added; Review- removed |
---|
comment:14 Changed 17 years ago by
Keywords: | Review? removed |
---|
Oops, the new patch was polluted with changes in other tickets, retracting the review request.
Changed 17 years ago by
Attachment: | 439_4.patch added |
---|
comment:15 Changed 17 years ago by
Keywords: | Review? added |
---|
comment:16 Changed 17 years ago by
Keywords: | Review- added; Review? removed |
---|
We are almost there... just the change at line 303 of fck_othercommands.js is not needed. Everything is ok for the rest.
comment:17 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I've removed that line and committed to SVN in [2143].
comment:18 Changed 14 years ago by
Version: | → 3.3.2 |
---|
Will this context menu item be also added to CKEditor? I'm using version 3.3.2 and it's not available
comment:19 Changed 13 years ago by
@qgo - I've raised a new ticket to request this functionality gets added back in. #8251 - Open Link functionality needed for IE9
I don't see any difference between IE6 and IE7.
I think that there's already a request about an option to open the link in a new window, maybe it's still in sourceforge.