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:
Luis htmlarea and Context menu placement


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.

 


iboza
Novice

Apr 7, 2004, 8:52 PM

Post #1 of 8 (5116 views)
Shortcut
Luis htmlarea and Context menu placement Can't Post

Hi all

O.K. It must be me..but I am unable to get the right click context menu to appear in the text box I click in for pasting.

In the example.html it works fine...and I noticed that it follows my cursor around the screen keeping the same distance if I click in the text box.

Is there a place to set its distace from the cursor in the .js file or is there a tag that anchors it that I have missed.

Thanks
Andrew


waving
New User

Apr 8, 2004, 1:17 AM

Post #2 of 8 (5103 views)
Shortcut
Re: [iboza] Luis htmlarea and Context menu placement [In reply to] Can't Post

I am having the exact same problem. In another thread I found the following solution, but that didn't work either:


1.- Add the following to variables at top of the function

var mouseX = editEvent.clientX + parentWin.document.all['_'+objname+'_editor'].offsetLeft;


var mouseY = editEvent.clientY + parentWin.document.all['_'+objname+'_editor'].offsetTop;

2.- modify all instances of

oPopup.show(mouseX+5, mouseY+100, 150, 134,objname.body);


I even played arround with the mouseX+5 AND mouseY+100 parameters but no success. Any suggestions?
Attachments: editor.js (118 KB)


iboza
Novice

Apr 8, 2004, 8:34 AM

Post #3 of 8 (5089 views)
Shortcut
Re: [iboza] Luis htmlarea and Context menu placement [In reply to] Can't Post

Hey, I thought it was working in the example.html file, but if you put say 8-10 returns between the first and second text field, the right context menu ends up out of place.

Anyone else get the same thing.



Andrew


Luis
Veteran

Apr 9, 2004, 2:25 AM

Post #4 of 8 (5063 views)
Shortcut
Re: [iboza] Luis htmlarea and Context menu placement [In reply to] Can't Post

Hi Iboza:

Try adding the code in red to the position variables in function displayMenu(). (Make sure the var mouse line is a single line, no wrapping):

if(objname == "editor"){var Hadjust = 5; var Vadjust = +25;}
else{var Hadjust = -10; var Vadjust = -12;}


var mouseX
= editEvent.clientX + parentWin.document.all['_'+objname+'_editor'].offsetLeft - document.body.scrollLeft + window.screen.availWidth-document.body.clientWidth+Hadjust;

var mouseY
= editEvent.clientY + parentWin.document.all['_'+objname+'_editor'].offsetTop - document.body.scrollTop + window.screen.availHeight-document.body.clientHeight+Vadjust;


Then. change all instances of mouseX+5 for mouseX and mouseY+100 for mouseY. (taking out +5 and +100), only in function displayMenu(). leave all other as they are.

What +100 was supossed to do is to take in count the Browser's toolbars height; however as it was hard-coded; it was misbehaving due to user's specific settings and monitor's resolution. The new Vadjust and Hadjust variables are used mainly to compensate the status bar height and the vertical scroll bar width, when in fullscreen

Please let me know if it worked for you.
greetings


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


(This post was edited by Luis on Apr 9, 2004, 4:39 AM)


iboza
Novice

Apr 20, 2004, 4:40 PM

Post #5 of 8 (4972 views)
Shortcut
Re: [Luis] Luis htmlarea and Context menu placement [In reply to] Can't Post

Hi Luis, thanks for the reply.

I added the code as per your instruction, but the context menu still opens about -500 pixels from the textbox that my curser is in and I am right clicking on.

I have attached a gif image to demonstrate my issue.

Thanks again

Andrew
Attachments: right_click_context.gif (14.3 KB)


Luis
Veteran

Apr 20, 2004, 5:27 PM

Post #6 of 8 (4967 views)
Shortcut
Re: [iboza] Luis htmlarea and Context menu placement [In reply to] Can't Post

Hi Iboza:

You must be doing something wrong. It should work as it does in my sample pages.

Attach your editor.js and your textarea page and I'll take a look. (Save the code as afetr being executed. I cannot run asp's).

Greetings


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


iboza
Novice

Apr 20, 2004, 8:43 PM

Post #7 of 8 (4962 views)
Shortcut
Re: [Luis] Luis htmlarea and Context menu placement [In reply to] Can't Post

Hi Luis, I checked again and think I did it right, but fresh eyes are always a help.

I have saved the htm page as a txt file and the .js is attached.

Thanks again

Andrew
Attachments: editor.js (123 KB)
  textfield_page.txt (6.94 KB)


iboza
Novice

May 1, 2004, 8:11 AM

Post #8 of 8 (4889 views)
Shortcut
Re: [Luis] Luis htmlarea and Context menu placement [In reply to] Can't Post

Hi Luis, so does the html and the js file look correct and if so, can you offer another suggestion as to why the right context menu does not place itself over the text field that the editor is editing.

p.s. I really love the additions you have made to the HTML Editor. The Word cleaner is great!

Best Regards

Andrew

 
 
 


Search for (options)