eWriter context menu questions

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

eWriter context menu questions

Unread post by Simon Dismore »

I'm experimenting with the EWriter format. It might be that for commercial reasons an author would like to have control over which pages, or parts of pages, can be copied or printed using a custom right-click (context) menu.

Can you help me with a few questions...
  • I find I can configure a 'Web link' menu entry to invoke script using an 'Internet URL' like "javascript:alert('Hiya')". Can I rely on this capability or might you block it in future builds?
  • Can the custom menu be configured dynamically by javascript on the page, e.g. to enable or disable individual items just before it is displayed in response to a right-click?
  • What context information can I retrieve (if any) about the element on the page the mouse was over when the menu is clicked?
  • Is there any way I can publish to EWriter with F12 developer tools enabled?
  • How do 'Page link' menu entries work? I don't see any HTML pages listed in the drop-down listbox.
Thanks for any advice.
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: eWriter context menu questions

Unread post by Tim Green »

Hi Simon,
I find I can configure a 'Web link' menu entry to invoke script using an 'Internet URL' like "javascript:alert('Hiya')". Can I rely on this capability or might you block it in future builds?
That's fine.
Can the custom menu be configured dynamically by javascript on the page, e.g. to enable or disable individual items just before it is displayed in response to a right-click
No, that part of the interface isn't HTML, it's part of the independent viewer program.
What context information can I retrieve (if any) about the element on the page the mouse was over when the menu is clicked?
What exactly are you looking for here?
Is there any way I can publish to EWriter with F12 developer tools enabled?
No, this is an embedded IE WebView component. To test with F12, use the same skin and output as WebHelp and test in IE. EWriter is WebHelp in a box and the viewer is IE, so pretty much everything should be testable out of the box in IE as well. Not everything will behave exactly the same, because embedded IE does have some quirks.
How do 'Page link' menu entries work? I don't see any HTML pages listed in the drop-down listbox.
Hmm... There seems to be a new problem there. That is supposed to show a list of Topic IDs from the current project. I'll pass this on to Alexander.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Re: eWriter context menu questions

Unread post by Simon Dismore »

Thanks for such a prompt response.
Tim Green wrote:
What context information can I retrieve (if any) about the element on the page the mouse was over when the menu is clicked?
What exactly are you looking for here?
Imagine a menu item "Save As..." that allows the reader to export a table or illustration. I'd need to know where they right-clicked, so I can identify the desired element and render it to an appropriate format before prompting for the file destination.

I might be better off creating a context menu entirely in javascript (something like jQuery contextMenu), which would allow me to have the same solution in both WebHelp and EWriter output.

Have a good weekend :-)
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: eWriter context menu questions

Unread post by Tim Green »

Hi Simon,

I haven't played with this all that much yet (too busy working on field-level popups for normal web pages for PP3...). However I just did a quick check and you can access the HTML with a web link entry and javascript: in the URL box (just like entering script in the HREF attribute of a link, which is what it does). The context is the main index.html layout page, so if you need to access the topic page you need to reach into its iFrame. The easiest way is probably to put your script functions on the main layout page of the skin so that you just call them from the menu entry, then have them reach into the topic page. With jQuery the easiest way to get the topic page from the top is:

Code: Select all

$("iframe#hmcontent").contents().find()
Then you put the selector for whatever you want to access in the find() braces. You could then extract content from the page, trigger local functions there etc. See the reference here:

Reference: https://api.jquery.com/contents/
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: eWriter context menu questions

Unread post by Tim Green »

Hi Simon,

The topic link problem for the menus is fixed in this build:

http://download.ec-software.com/help-an ... p-v706.exe

8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Re: eWriter context menu questions

Unread post by Simon Dismore »

Hi Tim, thanks for both of those replies. Have a good weekend!
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Re: eWriter context menu questions

Unread post by Simon Dismore »

7.0.6.3701 fixes the problem of the 'HTML page' drop-down list not being populated.

The list includes popup topics. At runtime, when you select a menu item that links to a popup topic, EWriter displays it in the main window. Is this the intended behaviour?
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: eWriter context menu questions

Unread post by Tim Green »

Simon Dismore wrote:The list includes popup topics. At runtime, when you select a menu item that links to a popup topic, EWriter displays it in the main window. Is this the intended behaviour?
Just don't link to popups from a menu entry. That wouldn't make sense anyway. :roll:
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Re: eWriter context menu questions

Unread post by Simon Dismore »

Tim Green wrote:That wouldn't make sense anyway. :roll:
It does makes sense when you want to present the popup as a dialog box, which is my use case. But never mind: I'll create the context menu from scratch rather than using the delivered functionality.
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: eWriter context menu questions

Unread post by Tim Green »

It does makes sense when you want to present the popup as a dialog box
Popups are native to the topic pages and in the main menu you are not on the topic page but in the main interface.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply