I have merged the changes to remove
the IFRAME that hosts the editor into master.
Unfortunately, some APIs in TextView
had to be removed since they only made sense because of the IFRAME. Hopefully
I have updated all the places that made use of them in Orion. Please let
me know if I missed any. Sorry about other users of the editor. Let
me know if you need help updating.
While
hosted in the IFRAME, the text view was able to detect that its location/size
had changed by hooking the onresize event of the frame. Now, it is
only possible to detected that the browser window has been resized and
the text view needs to be told about changes in the page layout so that
it can relayout its internals accordingly. A page that makes use
of dojo widgets can achieve this as follows:
var dojoWidget = dojo widget that contains
the text view;
var textView = ...'
dojo.connect(dojoWidget, "resize",
function (e){
textView.resize();
});
2) update(styleChanged)
Similar
to the resize() API, but used to notify the text view that style sheets
in the page have changed. This is used by the _javascript_ Settings
page for example.
There is also a change in the selection
behaviour: the text view will not show the selection while it is
not in focus. This behaviour was inconsistent on all the browsers
before (IE/Opera would not show the selection, others would). This
change affects the find/replace feature because it relies on being able
to highlight the search string in the text view while the focus is in the
search input field. Find/Replace actually worked around the problem
on IE by moving focus to the editor after the first match, each made find/replace
inconsistent (not able to hit Enter twice). I changed find/replace
to highlight the search match using the annotation model. I believe
this is a better user experience and opens the door to highlight all matches
and to show the annotations in the rulers for example.
Another change in behaviour is that
the browser built in spellcheck needs to be disabled for the whole page
otherwise the _javascript_ editor would show squiggles all over the place.
In all, I believe the benefits of not
having the IFRAME are greater than these limitations: the editor does not
have to be treated specially in terms of key bindings, mouse events, style
sheets, etc.