Javascript in a Flare project?
Javascript in a Flare project?
Talking with one of the engineer's on project I'm working on, we came up with the great idea (OK, it was 4:30 AM, so maybe that has something to do with it). However, I wanted to toss this out and see if anybody had every done anything like this, or could think of why something like this wouldn't work...
We have a huge, hmmm... maybe ginormous is a better word for it ... Register Programming Guide that contains 20,000+ registers. I have a written a custom script that extracts the registers from the output generated by the hardware design software. I have turned each register into it's own DITA topic, and then I build a DITAMAP that get's placed into Flare and we build a webhelp project. Now, for the interesting part we cooked up this morning. We're thinking of adding a custom button either to the webhelp interface, or on each page, which would run a javascript and generate a 'c' header file for the register displayed on the screen. We provide these in the software kit, but there are plenty of times when customers either destroy or need to have a clean/new version of the header file.
Has anybody added any custom scripts to their documentation projects? If so, did you have any issues implementing them?
Wayne
We have a huge, hmmm... maybe ginormous is a better word for it ... Register Programming Guide that contains 20,000+ registers. I have a written a custom script that extracts the registers from the output generated by the hardware design software. I have turned each register into it's own DITA topic, and then I build a DITAMAP that get's placed into Flare and we build a webhelp project. Now, for the interesting part we cooked up this morning. We're thinking of adding a custom button either to the webhelp interface, or on each page, which would run a javascript and generate a 'c' header file for the register displayed on the screen. We provide these in the software kit, but there are plenty of times when customers either destroy or need to have a clean/new version of the header file.
Has anybody added any custom scripts to their documentation projects? If so, did you have any issues implementing them?
Wayne
Re: Javascript in a Flare project?
I've added JavaScript to my Flare WebHelp projects with little difficulty. If all you are doing is interacting with existing elements on the page, you're usually fine. When you get into trouble is when you try to do things that are likely to run up against browser security policies.
Flare v6.1 | Capture 4.0.0
Re: Javascript in a Flare project?
And in fact that is very likely since it would need to write files out to the hard drive, which can be a big 'no-no' depending on the security policy. I hadn't even thought about that... Thanks!Andrew wrote: When you get into trouble is when you try to do things that are likely to run up against browser security policies.
Re: Javascript in a Flare project?
Yeah, that is going to cause problems. If it's something you can do with cookies instead, that might be one option, but otherwise, you'll have to get your customers to change their security policy (and even then, they may still get prompts).
Flare v6.1 | Capture 4.0.0
-
Craig.Prichard
- Propeller Head
- Posts: 62
- Joined: Sat Dec 10, 2005 8:06 pm
- Location: Calgary, AB Canada
Re: Javascript in a Flare project?
Does anyone have some sample javascript code for reading a cookie when a WebHelp page loads?
Craig Prichard
craig.prichard@gmail.com
craig.prichard@gmail.com
-
RamonS
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Javascript in a Flare project?
Since it is WebHelp, use a PHP script. PHP has excellent cookie handling and even covers the cases where browsers reject cookies. The parameters then get passed through the URL calls.
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U

Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
-
Craig.Prichard
- Propeller Head
- Posts: 62
- Joined: Sat Dec 10, 2005 8:06 pm
- Location: Calgary, AB Canada
Re: Javascript in a Flare project?
Unfortunately, PHP is not an option, only javascript (or vbscript).
Craig Prichard
craig.prichard@gmail.com
craig.prichard@gmail.com
-
RamonS
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Javascript in a Flare project?
Any reason why PHP is not an option? PHP binaries are available for almost any web server out there. Besides that, PHP is server side scripting, JavaScript is not. If the client selectively decides to not run your special script (which is quite easy to do) you have nothing left. JavaScript is OK as long as you don't have to count on it. The only choice then is to cut the client off right at the start with a "You cannot view this page without JavaScript enabled" message. Of course, you can use ASP or JSP or something else that is server side.
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U

Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
-
Craig.Prichard
- Propeller Head
- Posts: 62
- Joined: Sat Dec 10, 2005 8:06 pm
- Location: Calgary, AB Canada
Re: Javascript in a Flare project?
PHP is not an option because my WebHelp is being deployed within the City of Calgary intranet, tightly-controlled by IT. I had to jump through hoops to get authorization for the javascript already present in Flare's WebHelp.
Craig Prichard
craig.prichard@gmail.com
craig.prichard@gmail.com
-
RamonS
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Javascript in a Flare project?
Ah, red tape, not a technical reason. Well, then good luck!
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U

Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: Javascript in a Flare project?
One source I like to use for JavaScripts is http://javascript.internet.com/ and they have a whole section on cookies, although I've never used any of the scripts in that section so I can't speak to their use.Craig.Prichard wrote:Does anyone have some sample javascript code for reading a cookie when a WebHelp page loads?
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.