[cla][patch] Safari and dijit.Editor

Hi there!

I posted some Patches back in 2006 to get Editor2 working with Safari – and now I’m at it again for dijit.Editor ­čÖé

So far, I’ve managed to get Font-Formatting and Alignment working, mainly by preventing Safari from losing the selection on click.

I’ve also implemented a Html-Source editing plugin, which I’m happy to share if you’re interested. For that I needed to fix RichText#replaceValue?() – is there any particular reason why there is no catch-all that just hands the call off to setValue?

Finally I had an issue where Safari would only display the text-value, with all html-formatting stripped.

I’m attaching a patch with these three changes.

thanks for any feedback you can give me

cheers, Hannes

Safari: dijit.Editor dies while creating an unlabelled Button

Hi all! I’m working towards getting dijit.Editor usable in Safari.

In dijit.form.Button:postCreate, the following call to dojo.trim fails:

dojo.trim(this.containerNode.innerText || this.containerNode.textContent);

The reason for this is that in Safari this.containerNode.innerText returns an empty string. Safari then proceeds with this.containerNode.textContent and passes the result of this second call (undefined) to dojo.trim, where no typechecking is done and the call to undefined.replace fails. Unfortunately this transcends my javascript-foo. What’s the canonical way to work around that kind of problem? (it seems that Safari treats an empty String as a false-value – is this a bug in Safari?) However, if I explicitly cast the argument, I get a step further:

dojo.trim(String(” || undefined))

Possible patch is attached.

Thanks in advance for your feedback, Hannes

dojo 0.3, being updated to 0.9

By Hannes Wyss:

I’m looking for a way to pass an array of strings into a widget. Some of these contain commas, which messes with the parser… A working example (dojo 0.3, being updated to 0.9) are the captions in the custom slideshow widget here: http://www.davaz.com/en/personal/family/pretty

Thanks for your Feedback.

The Patch.

dojo 0.9 Patch: cross browser issues

Post by Hannes Wyss:

In order for a div to properly wipe in and out on various platforms I needed to set its display style to “block” in strategic locations. I’m aware (or rather I presume) that this prevents display:inline elements from being displayed properly, but afaik there is no way of reliably setting the height of an inline element anyway.

Patch (Works for me TM) attached.

Thanks in advance!

I forgot:
Tested on Linux (Firefox 2.0.0.6, Opera 9.23, Konqueror 3.5.7), Mac OS X (Safari 2.0), Windows XP (IE6, IE7)