Advanced HTML: Reset States Button

Discuss techniques and workflows for ProtoShare.
Josh Kristof
Posts: 525
Joined: Tue Mar 31, 2009 3:40 pm

Advanced HTML: Reset States Button

Postby Josh Kristof » Mon Jan 09, 2012 7:52 am

Often while reviewing a project you will want to reset all states to their default. This is commonly the case if your project contains any type of user privilege simulation. The code below will allow you to create an advanced HTML component that resets all states.

Code: Select all

<!DOCTYPE html>
<script type="text/javascript">
function go() {
if ( isEditing() ) {
parent.site9.StateMgr.set( 'ps' );
} else {
window.parent.site9.StateMgr.set( 'ps' );

function isEditing() {
try {
if ( window.parent.frameElement.s9_workspace ) {
return true;
catch ( e ) {

return false;
<body style="background:transparent">
<input type="button" onclick="go();return false;" value="Reset States"/>
Josh Kristof
Site9, Inc. / Customer Support |

Posts: 1
Joined: Sat Oct 21, 2017 2:11 am

Re: Advanced HTML: Reset States Button

Postby Mullett » Mon Oct 30, 2017 6:25 am

That's pretty useful. Thanks a lot for sharing Josh.
The testogen is good to try.

Return to “Tips & Tricks”

Who is online

Users browsing this forum: No registered users and 0 guests