cross-browser DOM issues - trouble with Macs, mostly

L

lkrubner

Go to this page:

http://www.publicpen.com/designer/mcControlPanel.php?arrangement=createweblogsForm.php

You'll need to login, use these:

username: designer
password: designer123

This is a demo site where we are debugging our software, please feel
free to play around, that is what the site is for.

My question is with the formatting buttons on this page (I mean the
bold, italic, 'make a link' buttons, etc). This works in FireFox,
Netscape, and IE on a PC. It does not work in IE or Safari on a Mac.

Two questions: do these buttons work in FireFox on a Mac, and why don't
they work in IE?

Also: this is an open source project and we would very much like to
have someone volunteer who knows something about Javascript. I'm tied
up with all the PHP code, and my graphic-design friends Misty and Peter
have only been able to put in a few hours each month working on the
interface. If we could find a someone who wanted to volunteer some time
to cleaning up the Javascript (or the HTML) associated with this
project, it would be a great help to us. So please think about it.
 
F

Fred Oz

My question is with the formatting buttons on this page (I mean the
bold, italic, 'make a link' buttons, etc). This works in FireFox,
Netscape, and IE on a PC. It does not work in IE or Safari on a Mac.

Two questions: do these buttons work in FireFox on a Mac, and why don't
they work in IE?

Yes, they work in Firefox on Mac, but only at the most basic "append
some tags to the field value" level - none of the selection stuff works
at all on Mac Firefox, IE, Safari.

They buttons do not work at all in Safari or IE because of:

function insertAtCursor(myField, tag) {
...

} else if ('number' == typeof myField.selectionStart) {
...

selectionStart is not supported by either browser, so they barf. Try
modifying it to:

} else if (document.selectionStart
&& 'number' == typeof myField.selectionStart) {

or some similar test of selectionStart before you try to use it.
Firefox doesn't support it either, but it tolerates the error.

All you can do - as per the last condition in insertAtCursor() - is to
append some tags to the text area value.

Incidentally, the "save" alert is very annoying.

Whilst I applaud your attempts at an open-source project, I don't think
there is much place for a browser-based HTML editor. The issues
involved are just too great to bother with, particularly when the only
real way to code HTML is to do it with raw code - I don't know of any
serious HTML programmers that use anything more than a text editor with
syntax/language highlighting.

Even the most new of newbies can pick up basic HTML in a few minutes -
heck, the original word processors used markup and they were used by
ordinary typists and clerical staff when computers were very "gee
whiz".

Perhaps just some help explaining some basic tags would be simpler and
better?
 
L

lkrubner

"<i> Even the most new of newbies can pick up basic HTML in a few
minutes -<i>"

Thanks much for your feedback, it's super valueable to me. Your remarks
about text editors might be true in a general sense, but they are not
true for weblogs. If you look at what Google is trying to do (with
Blogger), they are developing a full text editor online. If you need to
see what I mean, set up a weblog at Blogger, it is free and only takes
a few minutes.

Moveabletype and Typepad have gone down the same road, so I think one
can generally say that all the weblog software packages are offering
online text editors.

So if we want our software to be in that category, we should offer some
basic text editing abilities.

In general, when I talk to people and tell them they should learn some
HTML tags, they explain to me that they can not do it. Never. No way.
Even software like Microsoft Word or FrontPage or Dreamweaver leaves
them overwhelmed and confused, but the idea of leaving the GUI behind
and editing raw HTML is not a possibility.
 
F

Fred Oz

So if we want our software to be in that category, we should offer some
basic text editing abilities.

Fair enough, it just ain't my bag!
In general, when I talk to people and tell them they should learn some
HTML tags, they explain to me that they can not do it. Never. No way.
Even software like Microsoft Word or FrontPage or Dreamweaver leaves
them overwhelmed and confused, but the idea of leaving the GUI behind
and editing raw HTML is not a possibility.

The FCK editor link provided by BMR worked with Firefox/Mac, but not
Safari - but I don't have the latest version. Apple are working pretty
hard to get Safari up to speed, I expect the version to come out with
Tiger will be pretty much up with the best.

Unfortunately, Apple only provide Safari feature upgrades with OS
upgrades.

<URL:http://www.fckeditor.net/default.html>

Good luck!
 
L

lkrubner

I've seen it and it looks great. I'll try to study up on what they've
done. I'd love it if I could simply import their code, however, I fear
the time and effort it would take to integrate it into the rest of our
code. I think this is one of those places where it would be great to
have more volunteers to come into our project. If someone else wanted
to integrate fckeditor into our code, that would be awesome. As it is,
I feel that I don't have the time, and that for a few simple
select/replace commands, its quicker for me to write the code myself.
After all, the basic text editing features that we now have I'll
probably be done debugging by Friday, whereas if I tried to import
fckeditor, I'd probably be lucky if I could get done reading the
documentation by Friday.

I have tried importing other open source packages before, and it has
rarely worked out for me. Every package makes assumptions about how the
data should be formatted in the end, what names should be given to form
inputs, how variables should be input to the server and is the backend
language PHP or ASP or JSP? Every package takes time to think through
and integrate. The only code that I've managed to import so far is code
that stands alone or has very simple and clear input expectations:

Matt Bean's function for pinging www.weblogs.com (PHP)

Paul Schrieber's email class (PHP)

Costin Breveneaua's class for MySql (PHP)

Zurab Davitiani's XML class (PHP)

All of these are pretty much single purpose, stand-alone packages.
Importing fckeditor is automatically more complicated than that, since
I'd have to control the form inputs to make sure they have the names
the PHP code expects before inputting the results to the database. And
I'd have questions like, am I responsible for validating the form
input, or does fckeditor do that?

So I'd say it is not easy to import a big package like that. However, I
only say this because I am so stretched for time. Again, if another
volunteer joined up who wanted to integrate it into our software, I'd
say that was awesome.

In the meantime, I need to figure out how to make my text editing
functions work on a Mac. So I'll take a look to see what they did to
make it work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top