htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0 - Add-Ons:
The Long Awaited Context Menus


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


Luis
Veteran

Jul 28, 2003, 1:51 AM

Post #1 of 22 (14280 views)
Shortcut
The Long Awaited Context Menus Can't Post

Hi Everybody:

I've got good news to all of you. I remade Context Menus from scratch. They work beautifully!

There are six different scenarios:
  1. When the editor is empty
  2. When an Image is selected
  3. When the editor has contents, but nothing is selected
  4. When Text is selected
  5. When right clicking inside a Table Cell.
  6. When selecting a Table.


I plan to add another one for Form Elements once I make a real Forms Manager (Insert and Edit). Currently, form elements can be accesed with Insert Form, because they are in a multi-page container.

Implementation can be very difficult. I had to modify a lot of things. The most important (and I don't know the reason) was to lowercase all custom CMDId's, and Capitalize all default command identifiers. ( I think it's due to some setting in the toolbar configuration that are not easy to catch). (The most conflictive part is all Table Operations).

In the other hand, I think the code is very simple and very flexible. I used the Popups method, which by the way invites me to redo the toolbar in order to simplify it and arrange the buttons in a most comprehensible way.

Right now, the mod has not configuration options. That means that if you have different textareas in the same page, with different options, or said it in another words, if you are using editor_generate('yourFieldNameHere2',config); you cannot show up different context menus in an easy way. To make them configurable has been put in my pendings list, but it's not a priority for me, so in the meantime, you should find out the way to do it yourselves. Any help to make it happen sooner will be very appreciated.

How to implement them:

I had planned to document all the changes you need to do, but it's indeed a hard work. Many picky details in editor.js are involved, so in order to save yourselves a lot of headaches, I recommend you to work backwards this time. It is, download my editor and take out of it all what you need to take out and add all what you need to add.

I know it is a hard work, but trust me, it's going to be 10 times easier than doing it in the other way. I guarantee that!.

Yes, it's a hard work, but in a effort-benefit balance, it's worth. Put your part of effort.

I know many of you are going to try to do it editing your existing files. It's up to you! I won't provide support for bugs generated by doing it this way, and there will be tons.

By the way, with the changes I made, all bugs have gone, at least in my end.

The other two files involved are: fullscreen.html and your textarea page (index2.html or example.html or whatever you named it)

In your textarea page, change:

<script language='javascript1.2'>
editor_generate('yourtextarenamehere');
</script>

for:

<script language='javascript1.2'>
editor_generate('yourtextarenamehere');
WriteMenuItems('yourtextarenamehere');
</script>

In fullscreen.html, add
<SCRIPT>WriteMenuItems('editor');</SCRIPT> in the Body section of the page.

For those who downloaded my last zip, (save to local disc), the dialogs.js is not used anymore. I integrated the save function to editor.js

What is next?

My next milestone is to completely redo the toolbar, making it more user friendly, grouping the functions logically (File, Edit, Insert, View, etc), using dorpdowns and subs.

Once it's done, the dropdowns will allow me to redo the Forms Manager, throwing away the multipage container to use single dialogs instead. I'll try to add editing options too.

Any ideas, suggestions or help are welcome.

To download the files including Context Menus, go to the URL below and download the updated zip file there (last updated: July 27, 2003)

Greetings and enjoy it!!


Don't give up!!
http://webstationone.com/test/htmlarea


(This post was edited by Luis on Jul 28, 2003, 1:55 AM)


prenaud
User

Jul 28, 2003, 9:05 AM

Post #2 of 22 (14242 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

Amazing work, Luis. Congratulations!

Before I start implementing the changes, I'm wondering what the best way would be to that. I want to make sure that I put back my functions. I thought about using something like ExamDiff - http://www.prestosoft.com/ps.asp?page=edp_examdiff so I can compare the 2 files. Does it seem like a good idea? Is there a better way to do that?

Pierre

ezHTMLarea - http://fslactivities.sd61.bc.ca/ezHTMLarea/



Murray
Novice

Jul 28, 2003, 5:00 PM

Post #3 of 22 (14211 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

Hi Luis,

This new mod looks great.

You asked for ideas for a reconfigured toolbar. I was toying with the idea of providing a basic toolbar by default with the option of advanced features. I tend to think that most users might not need all the table features (most of the time) for example so the interface might load quicker (and appear simpler) if they were not displayed unless requested. Maybe this could be achieved with drop-down options or maybe there could be a button which reveals all the advanced features. What are your ideas on the best way to achieve this?

Thanks again,

Murray


Luis
Veteran

Jul 28, 2003, 9:41 PM

Post #4 of 22 (14198 views)
Shortcut
Re: [prenaud] The Long Awaited Context Menus [In reply to] Can't Post

Hi Pierre:

I really don't know. I've never used a program to examine differences, but you can give it a try and see what happens. I only suggest you to back up your files first.

Greetings.


Don't give up!!
http://webstationone.com/test/htmlarea


(This post was edited by Luis on Jul 28, 2003, 10:11 PM)


chet
User

Jul 29, 2003, 6:13 AM

Post #5 of 22 (14174 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

 hai Luis,

Great work Shocked

I think it's nice because you can delete the table icons from the toolbar fot better performance and they are still availeble under the right mouse button.

What would really be nice if the context menu's are coming up on the place where you right click instead of the left position.
Could this be done ?


Luis
Veteran

Jul 30, 2003, 2:18 AM

Post #6 of 22 (14136 views)
Shortcut
Re: [chet] The Long Awaited Context Menus [In reply to] Can't Post

Hi chet:

Yes, it can be done, but it requires a little bit of work to automatize size and position.

As config. options need to be done too, I rather to leave them as they are and automatize them when everything is ready.

Greetings.


Don't give up!!
http://webstationone.com/test/htmlarea


chet
User

Aug 1, 2003, 3:16 PM

Post #7 of 22 (14069 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

Hai luis,

I don't know what's wrong with this version but it ruins my html files. With your normal editor everything went fine but with this new version it ruins my javascript in my html documents when I edit them.

I try to compare the normal version with this new one but I don't get it what went wrong ?


chet
User

Aug 1, 2003, 3:47 PM

Post #8 of 22 (14063 views)
Shortcut
Re: [chet] The Long Awaited Context Menus [In reply to] Can't Post

I've found the problem :)

I'ts the word cleaner. If I disable the word cleaner everything went okay.

I think this cleaner will destroy some relevant javascript functions in a html page


Luis
Veteran

Aug 1, 2003, 4:22 PM

Post #9 of 22 (14062 views)
Shortcut
Re: [chet] The Long Awaited Context Menus [In reply to] Can't Post

Yes. It's indeed the function cleanHTML(unclean). You can leave the other part.

I'm working in some modifications to allow scripts remain in pasted pages. Actually, what I'm doing is detecting when pasted text come from Word in order to enable/disable some cleaning routines.


Don't give up!!
http://webstationone.com/test/htmlarea


chet
User

Aug 1, 2003, 4:48 PM

Post #10 of 22 (14058 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

Everything is almost working fine now. Exept it puts the body back when I save. In the older version this was working alright. Where can I find the function that put the body tag back ?

It's repeating now by saving


chet
User

Aug 1, 2003, 7:16 PM

Post #11 of 22 (14041 views)
Shortcut
Re: [chet] The Long Awaited Context Menus [In reply to] Can't Post

Everything works fine now. I just had to delete all the unclean = unclean.replace functions.



Thanks


ADSaunders
Novice

Aug 19, 2003, 3:15 AM

Post #12 of 22 (13827 views)
Shortcut
Re: [prenaud] The Long Awaited Context Menus [In reply to] Can't Post

Hi Pierre,
The tool I've used for a long time for comparing and merging text based (source) files is WinMerge, which not only highlights differences between files, but allows automatic copying of added, or deleting of removed blocks in either file, as well as in-place editing. Take a look, I find it extremely useful at times .. much better than the various diff and windiff clones out there (I do use WinDiff extensively however).

Regards .. Alan


AtK
User

Aug 19, 2003, 3:52 AM

Post #13 of 22 (13825 views)
Shortcut
Re: The Long Awaited Context Menus [In reply to] Can't Post

I had a funny error:

I have 2 Monitor´s and a dual-head card... if i use your demo on the second monitor, and click the right mousebutton, the context-menu is shown on the first monitor on the position where it should be on the second..

greetz
AtK


prenaud
User

Aug 19, 2003, 6:13 AM

Post #14 of 22 (13814 views)
Shortcut
Re: [ADSaunders] The Long Awaited Context Menus [In reply to] Can't Post

Thank you Alan. It looks like what I was looking for.

Pierre

ezHTMLarea - http://fslactivities.sd61.bc.ca/ezHTMLarea/



stervina
User

Aug 20, 2003, 6:50 AM

Post #15 of 22 (13773 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

Hi Luis

I have implemented your context menus into my site. I fact I used most of your editor, adding to it some bits I have written. I tried to add a few functions your menus, and they work fine, but one thing has changed. The table-icon menu is disabled by default. The only way to modify a table is then to use the context menu. Once the context menu has been used, the table ico-menu is enabled again. Is there a reason to that ?
I have just opened a test-zone. You can have a look here :

http://www.college4vents.net/testhtmlarea/example.php?action=ajouter
Greetings
STERVINA


Luis
Veteran

Aug 20, 2003, 1:17 PM

Post #16 of 22 (13749 views)
Shortcut
Re: [stervina] The Long Awaited Context Menus [In reply to] Can't Post

Hi Stervina:

Nope. It should work the other way. I'm pretty sure you have a code error in your editor. You can reproduce it by going to Full Screen Mode. You cannot go back to Normal mode or switch to HTMLMode.

These are the kind of errors I faced most often when made the context menus. Can you send me your editor to try to find the error?

Don't take me wrong but your name doesn't give me a clue (Nothing Similar in Spanish); are you man or woman? The other day I recommended somebody to contact you and I felt ashamed wondering if I should call you she or he.


Don't give up!!
http://webstationone.com/test/htmlarea


(This post was edited by Luis on Aug 20, 2003, 1:18 PM)


stervina
User

Aug 20, 2003, 3:36 PM

Post #17 of 22 (13742 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

Hi Luis,

Thanks once more for your quick reply.

Before all, let me tell you I am a "he", not a "she". I am an English teacher in Britanny France.

Yes, I did get a mail from someone I had never heard of, and I didn't reply. You can tell the sender to recontact me and I will reply.

As for the context menu, I was most careful adding new functionalities. When I noticed the table icon-menu was disabled, I started from scrap again, but I got to the same result.

I attach my editor.js, so that you can see

Thanks for helping

Greeting

PS: I have erased all comments from the editor to make it lighter.

Stervina
Lannion
Brittany France


(This post was edited by stervina on Aug 27, 2003, 2:11 AM)
Attachments: editor.js (92.1 KB)


stervina
User

Aug 27, 2003, 2:22 AM

Post #18 of 22 (13649 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

Hi Luis, and thaks for your great work,

Following my previous post, have you been able to sort out out why the table properties are disabled when more functions are added to the context menus. I wanted to have the "center" and "justify right" functions at hand.

I added my edidor.js to my previous post.

Greetings

Stervina


Luis
Veteran

Aug 27, 2003, 3:42 AM

Post #19 of 22 (13645 views)
Shortcut
Re: [stervina] The Long Awaited Context Menus [In reply to] Can't Post

Hi Stervina:

I'm sorry. I had forgotten your editor was in my pendings.

Here it is. The problem relied on those strange conversions to lowercase without any logic reason. Another error i found is that you have insertform in the context menus, but the functions doesn't exist in your editor.

Greetings.


Don't give up!!
http://webstationone.com/test/htmlarea
Attachments: editor_stervina.js (92.2 KB)


stervina
User

Aug 27, 2003, 8:07 AM

Post #20 of 22 (13616 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

Hi luis

Great, everything works fine now. Thanks indeed.

I have also added 2 new PHP popup add_ons. A smiley insertion tool, and a graphic insertion tool. Both work fully automatically. You only need to upload the graphics in the required directories. Their purpose is to enable fast graphic insersion. The code is very light, and once the images are cached, they are immediately at hand.

See here

http://daddy/College/admin/eleves.php?action=ajouter

Greetings

STERVINA

Lannion France


stervina
User

Aug 27, 2003, 5:27 PM

Post #21 of 22 (13593 views)
Shortcut
Re: [Luis] The Long Awaited Context Menus [In reply to] Can't Post

HI again Luis

I said "great !!! " this morning when I received your post. The table Icons were enabled when I clicked in a cell. But I didn't notice then that the forecolor and the back color popups no longer worked. As you had told me it had to do with 'lowercase and uppercase', I tried several solutions, dealing with lower and uppercase. Sometimes I was getting the color popups, but then the table functions were disabled again. Sometimes I was getting the table functions, but no color popup. I tried over and over again until it finally worked.

In thisbtnlist I wrote

"couleurc":
['ForeColor', 'Couleur de caractères', 'editor_action(this.id)', 'ed_color_fg.gif'],
"couleurf":
['BackColor', 'Surlignage', 'editor_action(this.id)', 'ed_color_bg.gif'],

And in the programme

else
if (cmdID.toLowerCase() == 'forecolor' || cmdID.toLowerCase() == 'backcolor') {
var oldcolor = _dec_to_rgb(editdoc.queryCommandValue(cmdID));
var newcolor = showModalDialog(_editor_url + "popups/select_color.html", oldcolor, "resizable: no; help: no; status: no; scroll: no;");
if (newcolor != null) { editdoc.execCommand(cmdID, false, "#"+newcolor); }
}


It didn't work like this



else if (cmdID.toLowerCase() == 'ForeColor' || cmdID.toLowerCase() == 'BackColor') {
var oldcolor = _dec_to_rgb(editdoc.queryCommandValue(cmdID));
var newcolor = showModalDialog(_editor_url + "popups/select_color.html", oldcolor, "resizable: no; help: no; status: no; scroll: no;");
if (newcolor != null) { editdoc.execCommand(cmdID, false, "#"+newcolor); }
}


As you can see I wrote the parameters down to lowercase

AND THEN IT WORKED

Why so ?

I doesn't act that way with the other popups or whenever cmdID is called

Funny behaviour

Greetings

STERVINA



Luis
Veteran

Aug 27, 2003, 8:19 PM

Post #22 of 22 (13586 views)
Shortcut
Re: [stervina] The Long Awaited Context Menus [In reply to] Can't Post

Yeah!. My dumb mistake. How can some word written in uppercase equals a word I'm forcing to be lowercase?

else if (cmdID.toLowerCase() == 'ForeColor'

Good everything works correctly now.

Greetings.


Don't give up!!
http://webstationone.com/test/htmlarea

 
 
 


Search for (options)