Ticket #900 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

retain editing position position between modes

Reported by: ray Owned by: gogo
Priority: normal Milestone: Version 1.0
Component: Xinha Core Version: trunk
Severity: normal Keywords:
Cc:

Description

This is IMHO a very valuable function which I would like to add to the trunk

I attach it as a plugin for testing purposes. Please give me some feedback

Attachments

RetainPosition.zip (1.5 kB) - added by ray 6 years ago.
the plugin

Change History

Changed 6 years ago by ray

the plugin

Changed 6 years ago by mharrisonline

Wow! This works great!

The only thing I can think of to improve it would be if the cursor was focused in the same place when you switch modes, or if you had highlighted something, it would be highlighted in code view, and vice versa. Even so, what an improvement!

Changed 6 years ago by mharrisonline

It only seems to work one way in FireFox?, from HTML mode to WYSIWYG mode. In IE it works both ways.

Changed 6 years ago by ray

  • owner changed from akaEdge to gogo
  • component changed from Documentation to Xinha Core

Though it's not perfect, committed this in rev [703]

mharrisonline, your ideas are good but I honestly don't know how it would best be done :(

Changed 6 years ago by guest

Also found it doesn't work on Firefox for the Mac

Changed 6 years ago by jedi58

oops, forgot to say it was version 1.5.0.9 I tested it in

Changed 6 years ago by ray

but works on FF 2.0.0.1 Mac

Changed 6 years ago by ray

rev [706]: fixed an error that occured in IE if an image ("Control") was selected when switching from WYSIWYG to text

Changed 6 years ago by ray

rev [707]: now using different control characters in IE and GEcko, because the one I used in the first place (String.fromCharCode(173)) was expanded to ­ in IE when using the (former) GetHtml plugin. The one that is now used in IE on the other hand doesn't work in Gecko...

Changed 6 years ago by ray

rev [712]: In case the cursor is inside a link automatically created from a url by IE the cc also appears in the url and we have to strip it out additionally

Changed 6 years ago by ray

rev [754]: There seems to be something going on beyond my understanding in fullpage mode in gecko. Catched the error

Changed 6 years ago by ray

  • status changed from new to closed
  • resolution set to fixed

Changed 6 years ago by wymsy

  • status changed from closed to reopened
  • resolution deleted

In FF (2.0.0.3 Mac) this works only one way, from WYSIWYG to html. I'm pretty sure the problem is that focus is not being set correctly, for the following reasons:

- If I put an alert() anywhere in the "else" branch of findCC() in Gecko.js, it works. I think this does not suggest a timing problem, but rather clicking OK in the alert sets the focus.

- Without the alert(), after switching back to WYSIWYG, if I press 'tab' one or sometimes more times (depends on the page content) it starts working. I think this is the tab stepping through the form elements until it gets to the xinha iframe.

However, I have not managed to figure out how to fix it. It should be just a 'focus()' method applied to something, and I'm probably missing something simple, but nothing I have tried so far works. Any ideas?

Changed 6 years ago by wymsy

  • status changed from reopened to closed
  • resolution set to fixed

Found it. Just add

this._iframe.contentWindow.focus();

and all is well. Commited in changeset:808.

Note: See TracTickets for help on using tickets.