*UPDATE* SOLVEDScript to Expand all Togglers Flare 9

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
hljanas
Propeller Head
Posts: 29
Joined: Mon Aug 27, 2012 8:38 am

*UPDATE* SOLVEDScript to Expand all Togglers Flare 9

Post by hljanas »

Does anybody have a script that I can add to my topics in Flare 9 for WebHelp output that can open all Togglers by default? Here is another link that shows a script for other Flare versions: http://forums.madcapsoftware.com/viewto ... f=6&t=7900. Does anyone know if that one works?

Thanks a bunch and enjoy the holidays!

Heather
Last edited by hljanas on Fri Jan 24, 2014 8:35 am, edited 1 time in total.
hljanas
Propeller Head
Posts: 29
Joined: Mon Aug 27, 2012 8:38 am

Re: SOLVEDScript to Expand all Togglers Flare 9

Post by hljanas »

I was able to answer my own questions. I found someone to help me write a script that works quite nicely to expand all Togglers on a page. This code works for WebHelp and also changes the toggler image.

**In this case, openTogglers is the .js file I created.

1. Enter this code into notepad or notepad++:

Code: Select all

function openTogglers(e2){
	if(gPopupObj){
	   return;
	}
	var e = document.getElementsByClassName('MCToggler_0');
	
	for(var d = 0;d < e.length;d++){
	    FMCToggler(e[d]);
	}	
}
2. Save it as a .js file.
3. Move it to the content menu of your project.
4.In the text editor replace the opening <body> tag with:

Code: Select all

<body onload="openTogglers(this)">
5. Enter the script using the Script button on the Insert ribbon menu.

I place it at the top of my topics so that I can always find it in the source code if needed.
hljanas
Propeller Head
Posts: 29
Joined: Mon Aug 27, 2012 8:38 am

Re: *UPDATE* SOLVEDScript to Expand all Togglers Flare 9

Post by hljanas »

This code does not work if you are using your own master page. In order for it to work in a .flmsp file the script must actually look like this:

Code: Select all

function openTogglers(e2){
	if(gPopupObj){
	   return;
	}
	var e = document.getElementsByClassName('MCToggler_0');
	
	for(var d = 0;d < e.length;d++){
	    FMCToggler(e[d]);
	}	
}
window.onload = openTogglers;
The addition to this is the window.onload=openTogglers; line.

Enter the script in the topic (you can just enter the link using the Script button in the Insert ribbon).

I actually created a template that with the <body onload=openTogglers> call and the JavaScript so I don't have to worry about putting it in every time.
Post Reply