Style from Delphi Seattle-10

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

Moderators: Alexander Halser, Tim Green

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

Re: Style from Delphi Seattle-10

Unread post by Simon Dismore »

Tim Green wrote:In the upcoming 3.2 I'm adding [...]
Hi Tim, is there any chance you could set up these features so that at least some of them can be used without requiring WebHelp 3 skins?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Style from Delphi Seattle-10

Unread post by Tim Green »

Simon Dismore wrote:Hi Tim, is there any chance you could set up these features so that at least some of them can be used without requiring WebHelp 3 skins?
They're going into the WebHelp/EWriter skins first anyway and I've also written a version that can be used in the standard skins included with Help+Manual. You just need to replace the block of code similar to the one below in the layout template with the one below. You then get a userparams object containing any additional parameters that were included in the query portion of the URL using the standard format &paramter=value from the URL query portion. You can query the number of parameters found with userparams.paramscount and read them out with userparams.paramname or userparams["paramname"].

The version for the standard skins assumes that the topic filename is always the first parameter, if it is present (it is tested for basic format). You can pass values to the topic pages by writing a cookie in the Layout template and reading it in the topic page template. The standard templates don't have an integrated cookie function you can use so you need to include your own. The standard set of cookie functions from W3Schools is fine for this.

Code: Select all

var defaulttopic="<%HREF_DEFAULT_PAGE%>";
    var query = window.location.search.substring(1), hash = window.location.hash, xssTest = /'|'|"|"|"|&#61;|&#x3D;|%27|%22|%3d|:|&#58;|&#x3a;|=|%3a|3a;|58;|\/|'|"/i, cntxRX = /contextid=\d*/, topicRX = /^([^=]+?(\.htm[l]?|\.php[\d]?|\.asp[x]?))$/i, cntxMatch = cntxRX.exec(query), cntxSrc = "", userparams = { paramscount: 0};
    if (query !== "") {
      if (typeof(hmGetContextId) != "undefined") {
        if (cntxMatch !== null) {
		  cntxSrc = hmGetContextId(cntxMatch[0]);
        }
	  }
	query = query.split("&");
	if (query.length > 0) {
		for (var x = 0; x < query.length; x++) {
			if (query[x].indexOf("=") > -1 && !cntxRX.test(query[x]) && !xssTest.test(query[x])) {
			userparams[query[x].substr(0,query[x].lastIndexOf("="))] = decodeURIComponent(query[x].substr(query[x].lastIndexOf("=")+1));
			userparams.paramscount++;
			}
		} //parse for userparams
	} // if query.length
	if (topicRX.test(query[0]) && !xssTest.test(query[0])) 
		query = query[0];
	if (cntxSrc !== "") {
	  defaulttopic = cntxSrc;
	} else if (!xssTest.test(query) && !xssTest.test(hash)) {
		  defaulttopic = query + hash;
		 }
    }
    document.write('<iframe name="hmcontent" id="hmcontent" src="'+defaulttopic+'" seamless="seamless" title="Content Page" frameborder="0"></iframe>');
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: Style from Delphi Seattle-10

Unread post by Simon Dismore »

:D

Thanks very much for explaining. All the best.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread post by Martin Wynne »

Hi Tim,

That's great! I can think of several uses for all of that. :)

But the really great thing about EWriter for software help is the interactive ability to transmit info in the reverse direction back to the calling application. For example where your help topic says:

"To reclassify the current grombel, select the Grombels tab on the Integration window, and click the Reclassify button. The Reclassification dialog will open."

You can add in EWriter:

IF EBOOK> "Do you want to do this now?" "Yes - Open Reclassification Dialog" <END

And if clicked it's done for the user, via an executable file link. I'm currently working on a hand-shaking utility to do this sort of thing.

Getting back to Robin's topic, it seems to me that where a new H&M user starts off using only EWriter there is no simple way to know the page URLs for the context calls. They are not visible in the EWriter viewer. If like me you always manually lower-case the topic ids and change spaces to underscores, and untick the option in the export options, you always know what the page URL will be.

But by default H&M doesn't do that nowadays -- it's possible to get a mixture of cases, hyphens and underscores converted from the topic id and invalid characters removed. It would be a good idea to display the actual page URL somewhere in H&M, i.e. make <%HREF_CURRENT_PAGE%> visible in the Topic Options in the same way that the Context number can be.

regards,

Martin.
robinski
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread post by robinski »

Nice Tim...
Martin is right... I'm having difficulty figuring out what the URLs are for the topics. What you're proposing will be a big help.

I was thinking of writing a general purpose Delphi "library" routine to handle form F1 key and right mouse click on entry fields using the help context value to navigate to the appropriate help section.

I take it the invisible snippets you mentioned are like the CHM right mouse click "What's this?" items.

Great product!!

Thanks,
R
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread post by Martin Wynne »

robinski wrote:Martin is right... I'm having difficulty figuring out what the URLs are for the topics.
Hi Robin,

Here is a simple solution. First go to Custom Builds in your project:
hm_custom_builds.png
Click the Add button and add a build called DEBUG (or whatever you want to call it).

Now open your skin file in H&M and go to the Default Page Template:
hm_debug_urls.png
Find the line <%TOPIC_TEXT%> and below it insert a line:

Code: Select all

<IF_DEBUG><%HREF_CURRENT_PAGE%></IF_DEBUG>
(Ignore the ZOOMSTOP line which is part of the Search function. If you called it something else, change DEBUG accordingly.)

And save the skin file.

Now when you publish to EWriter, you will have a tickbox for DEBUG showing in the Include Options on the Publish page. If you tick that box when publishing, the page URL will be shown at the bottom of each page in EWriter. Obviously you untick the box to remove the URLs when making your final publish.

You can then also use IF DEBUG wherever you like in your topics and templates to insert temporary info. See the Help on Conditional Text.

regards,

Martin.
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Style from Delphi Seattle-10

Unread post by Tim Green »

I agree that a preview of the topic filename for the URL would be very useful. However, this also depends on your setting for replacing blanks, underscores (and invalid characters) in topic filenames and the topic file extension in the Configuration > Publishing Options > WebHelp > HTML Export Options page. And both of these settings can be changed by a skin if you add them to the skin with PP Toolbox.

If you take your underscore/hyphens setting into account and avoid any special characters in your IDs your topic filename is basically simple: It's the ID in all lower case + your topic file extension. In the release version of Help+Manual 7 the topic file extension can only be .htm in EWriter. In the upcoming 7.2 update or the current beta if you want to use that you can use either .htm or .html, but not any other extensions. If your project sets a different extension it will default to .htm in EWriter.
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: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Style from Delphi Seattle-10

Unread post by Tim Green »

Now when you publish to EWriter, you will have a tickbox for DEBUG showing in the Include Options on the Publish page. If you tick that box when publishing, the page URL will be shown at the bottom of each page in EWriter. Obviously you untick the box to remove the URLs when making your final publish.
Good idea! To make it easier, make your URL line an active hyperlink. Then you can copy it by right-clicking:

Code: Select all

<IF_DEBUG> <a class="topiclink" href="<%HREF_CURRENT_PAGE%>"><%HREF_CURRENT_PAGE%></a></IF_DEBUG>
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
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread post by Martin Wynne »

Tim Green wrote:Good idea! To make it easier, make your URL line an active hyperlink. Then you can copy it by right-clicking:
Hi Tim,

Not in EWriter you can't. :(

To right-click copy something you must first drag over it to select it, and that's a lot easier if it is plain text, and NOT a link.

Martin.
robinski
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread post by robinski »

Hi all.

I'm glad I've got all your creative juices flowing. Mine have just gone into high gear. In 24 hours:
  • * head scratch on Delphi Seattle-10 styles propagating into H&M
    * suggestion to change from CHM to EWriter
    * concept of separating eBook from viewer
    * custom viewer with my app icon
    * altered skin logo and url link to my web site
    * Delphi wire frame routine written to launch viewer with parameters
Now .... get the authoring done!
image0005.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Style from Delphi Seattle-10

Unread post by Tim Green »

Martin Wynne wrote:Not in EWriter you can't. :(
No, but then you could just generate your working reference version as WebHelp... :gottit:
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
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread post by Martin Wynne »

Martin Wynne wrote:You can add in EWriter: IF EBOOK> Do you want to do this now? Yes - open the Banana Sizing Dialog <END

And if clicked it's done for the user, via an executable file link. I'm currently working on a hand-shaking utility to do this sort of thing.
I'm happy to say I've now got this working quite well, which illustrates the brilliance of EWriter. The ability to launch executable files changes everything.

In practice you often need two options:

Do you want to do this now?

Yes - open the Banana Sizing Dialog
Yes - open the Banana Sizing Dialog and return here


In the former case the application comes back to the front for the user to continue working, and EWriter must be retrieved from the task bar when needed.

In the latter case EWriter is closed, and re-opened at the original topic in front of the application after a short delay (currently 4 seconds).

I realise this Meccano approach to Help functions doesn't appeal to everyone, or comply with any known standards, but it's meat and drink to me. :typing:

Martin.
robinski
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread post by robinski »

Good morning Martin.

I just wanted to let you know I implemented your "DEBUG" suggestion. This is great, because I publish a web (HTML) version of my help system as well. In support email responses to users, I'll include links to the appropriate sections answering their questions.

Loading up the H&M documentation project is a fantastic tutorial! ... I'm on a 2500km road trip for the next few weeks, and will have something only I will find useful as summer reading material. :)

Cheers,
R
robinski
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread post by robinski »

Hi all.

I've hacked the bejeezus out of Delphi's Vcl.HTMLHelpViewer.pas and have got the F1 key on any form to bring up the context sensitive help in my eBook. Now I'm writing a custom "right click" for the field level to display the popup help for the fields. I've managed (I think) to create new "popup topics" in the Project > Topic Files > Topics (*.xml) location.

I see in the H&M help I might have to use some Javascript to get this to function for the EWriter eBook. Thanks for the sample code... I'm a complete newbie to this, so I'm not sure how to call (ShellExecute()?) and parameter string formatting to pass to my separate EXE viewer. Or... is there something similar to accessing the popup info like in the CHM format?

Thanks in advance for any assistance.
Cheers,
R
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Style from Delphi Seattle-10

Unread post by Tim Green »

Hi Rob,

If you're using popup topics in your project in EWriter those would be JavaScript constructs included in the skin code, just as in any other WebHelp page. This is the case because EWriter is really "WebHelp in a box": The viewer is a wrapper program around a local web server and an instance of an IE WebView. All the available skins that support EWriter already have popup functionality. Once you write popup topics in Help+Manual and configure JavaScript popups you don't need to do anything special to get a popup: A link to a popup topic automatically opens as a popup.

What you can't do is trigger a popup with a call to an EWriter book from your program, because in WebHelp a popup topic isn't really a real topic that you can access from an URL. Is that what you're trying to do? Normally, that would not be such a good idea, because you would be opening the help, displaying some normal topic page and then putting a popup on top of it, all automatically.. :?
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