By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,384 Members | 845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,384 IT Pros & Developers. It's quick & easy.

Who wants to participate in writing an open source web-based programmer's editor?

P: n/a
Hi...
We want to write an open source web based TEXT editor and would be
happy about any help ;-)

Please notice: We do NOT want to write a web based WEB editor, where
you can edit a web page without knowing HTML - we want to write a real
programmer's editor located on a web page in your browser with
features like...

- Syntax Highlighting
- Tab, Indent/Deindent
- Tags & Commands List with Integrated Help
- Set and Jump To Marks
- CSS Tool
- Folding
- etc.

Right now we have just a bit more than the basic framework, but some
things already work: You can edit text ,-) Syntax Highlighting is
impemented (with bugs), indent/deindent works more or less and we have
a little menu popup. And: The program has a nice OO design ;-)

So, if you are a javascript guru and longing for a new adventure, come
join us and take a look at...

http://baseportal.com/htmledit

We set up a little CVS - if you like you could check out the source
and start programming right away...
Any help is welcome! ;-)
Best regards,

Christoph...
PS: It looks like it will be the first web-based programmer's editor -
we searched a lot but didn't find any other project like this - please
correct me someone if I'm wrong...
Jul 20 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
la*******@hotmail.com (Christoph Bergmann) writes:
We want to write an open source web based TEXT editor and would be
happy about any help ;-)


Let's play the devils advocate (I love doing that :P ). That means that
the questions I ask are not necessarily criticism. It's just something
you should be able to answer before going much further.
What is the purpose of writing it at all? There are plenty of free,
not-web-based editors out there. Why will anybody want to use your
editor instead of one of these?

Why doesn't the HTML validate?

Which browsers is it supposed to work in?
You write:
this.doc.designMode="on"; // let the user edit the element (cross-browser)
That is *not* cross browser. It might be IE and Mozilla, but that is about
it. It doesn't work in my browser (Opera 7).

You write:
document.write("<b class=menueitem id="+menue_id+
" href='javascript:changes("+(i+1)+")' onMouseover=changes("+(i+1)+")>")

It is not recommended to use javascript:-URI's. Use the onclick attribute
instead. <URL:http://jibbering.com/faq/#FAQ4_24>

You write:
function sc(r,g,b)
{
ri=isNaN(r)? ....
You should make "ri" an local variable. This just pollutes the global
namespace.

You write:
dsub_obj.innerHTML = ""; // to be sure ;-)
right after using document.getElementById. Why not use DOM methods
to empty the object, and only fall back on proprietary methods like
innerHTML if the standards compliant methods aren't available.

Your code can fail in a standards compliant browser without innerHTML.
(No, I don't know of one, but it might exist now, or maybe later).

Why all the document.write's? You can build your interface in HTML
instead of writing it, or you can use DOM methods to insert it.
Is there a reason behind using document write?

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
Lasse Reichstein Nielsen <lr*@hotpop.com> wrote in message news:<3c**********@hotpop.com>...
la*******@hotmail.com (Christoph Bergmann) writes:
We want to write an open source web based TEXT editor and would be
happy about any help ;-)
Let's play the devils advocate (I love doing that :P ). That means that
the questions I ask are not necessarily criticism. It's just something
you should be able to answer before going much further.


No problem ;-) Thats what discussions are for...

What is the purpose of writing it at all? There are plenty of free,
not-web-based editors out there. Why will anybody want to use your
editor instead of one of these?
There are also plenty of not-web-based WYSIWYG web editors out there
(Dreamweaver etc.), but in the last years you've seen dozens of
web-based scripts (like "htmlarea") doing the same in the browser
(mostly with limited possibilites). I think the main reason is: "Speed
of use", I mean you don't need to install anything - you call a web
page and there you go... ;-)

To be more precise: I organize my work in a browser-centric way - I
can edit all my web pages via the browser (which is extremely useful
to me when I'm not at my own computer), but right now I do this with a
simple textarea... A web-based text editor would be wonderful to me...
;-) Thats why we started wroting one, since we didn't find any other
out there...

Which browsers is it supposed to work in?
You write:
this.doc.designMode="on"; // let the user edit the element (cross-browser)
That is *not* cross browser. It might be IE and Mozilla, but that is about
it. It doesn't work in my browser (Opera 7).
Surely it can only work in browsers that support editing of web pages
or elements of it. "cross-browser" in this case means: We want to
support all browsers that are able to. We can't work miracles, if the
browser doesn't support it or there is no javascript its not possible
;-)

Right now I think only IE and Mozilla can do it (please correct me if
I'm wrong), but perhaps Opera will support this in the future since
its a really useful feature.

You write:
document.write("<b class=menueitem id="+menue_id+
" href='javascript:changes("+(i+1)+")' onMouseover=changes("+(i+1)+")>")

It is not recommended to use javascript:-URI's. Use the onclick attribute
instead. <URL:http://jibbering.com/faq/#FAQ4_24>

You write:
function sc(r,g,b)
{
ri=isNaN(r)? ....
You should make "ri" an local variable. This just pollutes the global
namespace.

You write:
dsub_obj.innerHTML = ""; // to be sure ;-)
right after using document.getElementById. Why not use DOM methods
to empty the object, and only fall back on proprietary methods like
innerHTML if the standards compliant methods aren't available.

Your code can fail in a standards compliant browser without innerHTML.
(No, I don't know of one, but it might exist now, or maybe later).
You judge too hard ;-) - we just started to build this program, its
version 0.0.2 and of course its not perfect and needs a lot of work
and testing... And everybody has different techniques and goals - me,
personally, I'm more pragmatic and want to get the thing run fast -
cleanup comes afterwards... Some of the code (the one with the global
"ri") was copied from another project (and this was a quick hack ;-) )
and needs adaption. But one step after another...

If you want to improve our code - you are cordially invited ;-)

Its open source and a little CVS is available, just check out a copy
and do whatever you think is necessary ;-)

http://baseportal.com/htmledit/minicvs/work

Why all the document.write's? You can build your interface in HTML
instead of writing it, or you can use DOM methods to insert it.
Is there a reason behind using document write?
I think I didn't wrote the part you mean (right now we are 3
programmers) so I can't tell you the exact intends of the one who did
it. But I guess its not directly in HTML because with document.write
you can control the output. Whats wrong with document.write anyway?


/L


Best regards,

Christoph...
Jul 20 '05 #3

P: n/a
On 23 Oct 2003 13:41:20 -0700
la*******@hotmail.com (Christoph Bergmann) wrote:
<snip>
Right now I think only IE and Mozilla can do it (please correct me if
I'm wrong), but perhaps Opera will support this in the future since
its a really useful feature.

<snip>

Sorry. But you hit a hot button here. Opera is probably more standards
compliant than the other two. Certainly more compliant than IE. Why do
you just assume that Opera is not capable? How can you argue for
"cross-browser compatibility" when you know so little about Opera? I am
assuming that you intend to follow W3C standards and not MS "standards."

--
Life is an offensive, directed against the repetitious mechanism of the
Universe.
--Alfred North Whitehead (1861-1947)
Jul 20 '05 #4

P: n/a
Albert Wagner wrote:
la*******@hotmail.com (Christoph Bergmann) wrote:
<snip>
Right now I think only IE and Mozilla can do it (please correct me if
I'm wrong), but perhaps Opera will support this in the future since
its a really useful feature. <snip>

Sorry. But you hit a hot button here. Opera is probably more standards
compliant than the other two.


Probably not. You may want to check out what part of the
standards/recommendations Opera does not obey and then
compare with Mozilla/5.0, for example.

http://www.opera.com/docs/specs/opera6/
http://www.opera.com/docs/specs/

When it comes to standards compliance, the order is like
Mozilla/5.0, IE 6.0 SP-1, Opera (from best to worst). In
contrast, when it comes to speed it is still (alas!)
vice-versa.
Certainly more compliant than IE.


Opera even still (v7.11) supports IE-proprietary document.all
when User-Agent is set to IE and its CSS support is still far
from obeying the CSS1 specification as well as W3C-DOM is still
far from being usable, so please don't try to tell us that Opera
is standards-compliant or even more standards-compliant than
Mozilla/5.0 or IE. Thanks.
PointedEars

Jul 20 '05 #5

P: n/a
Thomas 'PointedEars' Lahn <Po*********@web.de> writes:
When it comes to standards compliance, the order is like
Mozilla/5.0, IE 6.0 SP-1, Opera (from best to worst).
Which standards are we talking about here?

When it comes to CSS, IE is by far the worst. It fails *basic* CSS 2
features like attribute-selectors, adjacent and child selectors, and
position:fixed. IE 6 is better that any previous IE, but still very
far from CSS 2 compliance. IE completely disregards the W3C DOM 2
Events specification.

I admit that Mozilla supports most standards at least as well as
Opera. Opera is still the second best browser I know, standards
compliance-wise.
Certainly more compliant than IE.


Opera even still (v7.11) supports IE-proprietary document.all
when User-Agent is set to IE


It supports it no matter what the User-Agent string is set to.
However, what does support for proprietary features have to do with
standards compliance? You can be fully standard compliant and have
extra features. What breaks standards compliance is the absence,
or incorrect behavior, of standard features.
and its CSS support is still far from obeying the CSS1 specification
They claim to support all of CSS 1. Since Håkon Lie, one of the authors
of the CSS 1 specification, works for Opera Software, I bet they know
what they are talking about.

Can you tell me which parts of the CSS specification they are missing
(there must be more than one, if they are "far from" obeying it)?
as well as W3C-DOM is still far from being usable,
What are you missing? I haven't needed any W3C-DOM 2 feature in Opera
that existed in IE (not saying they aren't there, I just haven't
needed them).

At least they tell su which parts are not supported.
so please don't try to tell us that Opera is standards-compliant
I will say that Opera is *far* more standards compliant than IE.
I can't think of one standard that both IE and Opera claims to
support where Opera has worse support than IE.

or even more standards-compliant than Mozilla/5.0 or IE. Thanks.


IE might have support for *more* standards, but they are generally
badly supported. Ok, I mighe be biased by working a lot with CSS, and
IE *really* sucks there!

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #6

P: n/a
On Fri, 24 Oct 2003 16:57:13 +0200, Thomas 'PointedEars' Lahn
<Po*********@web.de> wrote:
Opera even still (v7.11) supports IE-proprietary document.all


Which is no way wrong by any standard. It's bad IMO that more
browsers don't provide it.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #7

P: n/a
Albert Wagner <al******@tcac.net> wrote in message news:<20031023180411.64078c89.al******@tcac.net>.. .
On 23 Oct 2003 13:41:20 -0700
la*******@hotmail.com (Christoph Bergmann) wrote:
<snip>
Right now I think only IE and Mozilla can do it (please correct me if
I'm wrong), but perhaps Opera will support this in the future since
its a really useful feature.

<snip>

Sorry. But you hit a hot button here. Opera is probably more standards
compliant than the other two. Certainly more compliant than IE. Why do
you just assume that Opera is not capable? How can you argue for
"cross-browser compatibility" when you know so little about Opera? I am
assuming that you intend to follow W3C standards and not MS "standards."


I didn't write that IE or Mozilla is more standards compliant than
Opera.

I wrote "I THINK only IE and Mozilla can do it (please correct me if
I'm wrong)". You wrote "Why do you just assume that Opera is not
capable?" - is my assumpation wrong? Is there a way to let the user
edit elements in Opera? If yes, why don't you write how or give a link
where its explained?
To come back to the point:

We WANT to write an open source web-based programmer's editor running
on a web page. We WANT it to work in as many browser as possible, not
only in IE (thats why i used the term "cross-browser"). The program is
NOT READY. There are lots of bugs and lots of stuff missing...

Thats why I did the original post. Everybody is invited to join us:

http://baseportal.com/htmledit

If you know better ways (more standards compliant) to do parts of the
code, then check out a copy and do it ;-)

Best regards,

Christoph Bergmann
Jul 20 '05 #8

P: n/a
On 26 Oct 2003 10:27:33 -0800
la*******@hotmail.com (Christoph Bergmann) wrote:

<snip>
I wrote "I THINK only IE and Mozilla can do it (please correct me if
I'm wrong)".
The "only" means that you think none of the other browsers can.
You wrote "Why do you just assume that Opera is not
capable?" - is my assumpation wrong?
Which assumption? That Opera is not capable? Or that you intend it's use
to be "cross browser". One or the other is wrong.
Is there a way to let the user
edit elements in Opera? If yes, why don't you write how or give a link
where its explained?


Not sure what you mean by "user" here. Are you meaning the programmers
of your editor or the end user? Same with "elements." I assume you are
referring to DOM elements. The real problem with your post, for me, was
similar to problems with programmers of browser sniffers that make the
assumption that a browsers name tells you all you need to know about a
browser's capabilities. This method of sniffing has been thoroughly
debunked on this group. Why don't you just specify what browser
specific capabilities should be available to run the editor? Then it
would be fairly straight forward to compare with any browser's features.
If your design specs haven't proceeded far enough to do this, then it
is premature to claim that it will be "cross browser."

I don't mean to start a flame. I've said all I intend to say and I wish
you well with your project.

<snip>

--
Life is an offensive, directed against the repetitious mechanism of the
Universe.
--Alfred North Whitehead (1861-1947)
Jul 20 '05 #9

P: n/a
Albert Wagner <al******@tcac.net> writes:
On 26 Oct 2003 10:27:33 -0800
la*******@hotmail.com (Christoph Bergmann) wrote:

<snip>
I wrote "I THINK only IE and Mozilla can do it (please correct me if
I'm wrong)".


The "only" means that you think none of the other browsers can.


Yes, exactly. I think the same. Are we wrong?
Why does that hit a hot button on you?
You wrote "Why do you just assume that Opera is not
capable?" - is my assumpation wrong?


Which assumption? That Opera is not capable?


Yes: That Opera is not capable of understanding "designMode" (or
"contentEditable"). And it isn't.

Nobody *blames* Opera for not implementing this proprietary feature
(a feature that I think is completely ludicrous to begin with).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #10

P: n/a
Albert Wagner <al******@tcac.net> wrote in message news:<20031026204713.43a44fb8.al******@tcac.net>.. .
On 26 Oct 2003 10:27:33 -0800
la*******@hotmail.com (Christoph Bergmann) wrote:
You wrote "Why do you just assume that Opera is not
capable?" - is my assumpation wrong?
Which assumption? That Opera is not capable? Or that you intend it's use
to be "cross browser". One or the other is wrong.


Well, since you wrote the question "Why do you just assume that Opera
is not capable?", thus, of course I meant the assumption that Opera is
not capable... In a complete sentence: Is my assumption, that Opera is
not capable, wrong?

By the way, "cross browser" in its pure meaning says: "in more than
one browser", nothing more... (It does NOT mean "in all browser ever
written, starting from Nexus via Mosaic to Lynx")

Is there a way to let the user
edit elements in Opera? If yes, why don't you write how or give a link
where its explained?


Not sure what you mean by "user" here. Are you meaning the programmers
of your editor or the end user? Same with "elements." I assume you are


Of course the end user. A programmer does the thing, the user uses
it...

referring to DOM elements. The real problem with your post, for me, was
Yes, DOM elements...

debunked on this group. Why don't you just specify what browser
specific capabilities should be available to run the editor? Then it
would be fairly straight forward to compare with any browser's features.
If your design specs haven't proceeded far enough to do this, then it
is premature to claim that it will be "cross browser."
I didn't really claim anything about "cross browser"... Lasse
Reichstein Nielsen copied it from the source and this source is far
from being ready or nice or whatever. Its a quick start to see how it
will look and to have something to work with. The "cross browser" was
a comment to indicate that the editing now works in IE and Mozilla
(since an earlier version worked in IE only)...

I can't believe we're really discussing about this.....


I don't mean to start a flame. I've said all I intend to say and I wish
you well with your project.


Thanks ;-)
Best regards,

Christoph Bergmann
Jul 20 '05 #11

P: n/a
"Christoph Bergmann" <la*******@hotmail.com> wrote in message
news:c0**************************@posting.google.c om...
<snip>
Which assumption? That Opera is not capable? Or that you intend
it's use to be "cross browser". One or the other is wrong.
Well, since you wrote the question "Why do you just assume that
Opera is not capable?", thus, of course I meant the assumption
that Opera is not capable... In a complete sentence: Is my
assumption, that Opera is not capable, wrong?


Because Opera 7 has a dynamically manipulatable DOM it is in principal
possible to script it into a text editor. The script would be
horrendous, you would have to be a complete masochist to attempt it, and
it would still fall short if IE's built in capabilities (not much chance
of reading from the OS clipboard for example and working out the
insertion point with a non-fixed width font would be a pain). Though, if
written, the result should also stand some chance of working on
Konqueror, Safari and ICEbrowser as well.
By the way, "cross browser" in its pure meaning says: "in more
than one browser", nothing more... (It does NOT mean "in all
browser ever written, starting from Nexus via Mosaic to Lynx")

<snip>

I would categorise a script that was designed to work in more than one
browser as "multi-browser". Trying to use that definition for "cross
browser" should not be acceptable, two is more than one, so should a
script that was designed to work only with Firebird and Mozilla, or
Konqueror and Safari be allowed to describe itself as cross browser?
That would be an incredibly low standard.

I would take "cross browser" as meaning "across browsers" and as a
result unrestricted to any sub-set of browsers (though I would allow
"across HTML browsers" [1]). Of course no script will successfully
execute in all browsers (in the same way as no script will successfully
execute in the latest release of IE 6 if active scripting has been
disabled). And that means that "cross browser" scripting involves
anticipating and planning for the failure of the script as well as its
successful execution.

You browser based text editor will never be cross browser (it will be a
very long time before any non-desktop PC browsers have access to the
resources to even consider implementing editable content outside of
textarea and input type="text" fields). It might be best to just state
which browsers the editor does work with (and maybe stress how common
they are) and avoid giving anyone expectations that must be
disappointed.

Richard.

[1] I don't have any problem with saying that a cross browser HTML DOM
manipulating script should not even be expected to work in a browser
designed exclusively for some other mark-up language, in principal it
should not even be attempted to be loaded in such an environment.
Jul 20 '05 #12

P: n/a
On 27 Oct 2003 09:56:43 +0100
Lasse Reichstein Nielsen <lr*@hotpop.com> wrote:
<snip>
Yes: That Opera is not capable of understanding "designMode" (or
"contentEditable"). And it isn't.

<snip>

Thanks, Lasse. This clears up everything for me: they are using
proprietary features and therefore a very limited definition of
"cross-browser."

--
Life is an offensive, directed against the repetitious mechanism of the
Universe.
--Alfred North Whitehead (1861-1947)
Jul 20 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.