options.htm revision ec2744bb1f5dca23072b9586b793382fbbb49bf0
<script type="text/javascript">
var ie7fix = 1;
var userStoreChoice;
var licenseTXT = '';
//convenient alias:
var $ = YAHOO.util.Dom.get;
function launchConsole() {
}
#if ( $upgrade || $upgradeCompleted)
function downloadInstructions() {
/* TODO - enable download - where does this file reside? */
alert( "Not implemented!" );
}
function onUpgradeResponse( response ) {
if ( response.responseText == "true" ) {
//operation was successful, hide the writing dialog, show the confComplete:
//in actuality, this usually happens very fast, so put a delay when removing the testUrlPanel.
//if we don't do this, the window blinks and looks unsightly, so we actually impose an unnecessary
//gui delay for a slightly cleaner 'expected' UI experience:
setTimeout("YAHOO.sun.identity.config.options.upgrading.hide()", 1500);
setTimeout("YAHOO.sun.identity.config.options.upgradeComplete.show()", 1500);
} else {
//TODO - show a specific (nice looking) error message dialog that explains why the upgrade failed.
//for now, just alert:
alert( "Unexpected error: [" + response.responseText + "]. Please contact your System " +
"Administrator. If you are the System Administrator, please direct your questions to the " +
"OpenAM user's mailing list for help.");
}
}
function renderUpgradePanel() {
YAHOO.sun.identity.config.options.upgrade = new YAHOO.widget.Panel("upgrade", { fixedcenter: false, modal: true, close: true, visible:false, constraintoviewport:true });
YAHOO.util.Dom.removeClass('upgrade', 'license-accepted');
document.getElementById("upgrade-accept-check").checked = false;
document.getElementById("upgrade-accept-license-button").disabled = true;
});
$("upgrade-license-message").innerHTML = licenseTXT;
YAHOO.util.Dom.removeClass('upgradeLink', 'disabled');
YAHOO.util.Event.addListener("upgradeLink", "click", showUpgradePanel );
});
}
function showUpgradePanel() {
}
#else
var configOption = 0;
function onDefaultSummarySuccess( response ) {
var formError = (response != null && (response.getResponseHeader["formError"] != null));
if ( !formError ) {
} else {
}
}
function cancelDefaultSummary() {
}
function onDefaultSummaryFailure(response ) {
alert("configuration failed");
}
function submitDefaultSummaryForm() {
if ( window.frames['progressIframe'] ) {
}
AjaxUtils.doPost("defaultSummary", "$context/config/defaultSummary.htm?" + getLocale(), AjaxUtils.serializeForm("defaultForm"), onDefaultSummarySuccess, onDefaultSummaryFailure);
}
function getLocale() {
var queryString = window.top.location.search.substring(1);
var locale = 'locale=';
var localeValue = '';
if (queryString.length > 0) {
var idx = queryString.indexOf(locale);
if (idx != -1) {
idx += locale.length;
var idx1 = queryString.indexOf('&', idx);
if (idx1 == -1) {
idx1 = queryString.length;
}
localeValue = queryString.substring (idx, idx1);
}
}
return locale + localeValue;
}
function renderDefaultSummary() {
YAHOO.sun.identity.config.options.defaultSummary = new YAHOO.widget.Panel("defaultSummary", { width:"450px", fixedcenter: false, modal: true, close: true, visible:false, constraintoviewport:true });
YAHOO.util.Dom.removeClass('defaultSummary', 'license-accepted');
document.getElementById("accept-check").checked = false;
document.getElementById("acceptLicenseButton").disabled = true;
});
$("license-message").innerHTML = licenseTXT;
YAHOO.util.Dom.removeClass('DemoConfiguration', 'disabled');
YAHOO.util.Event.addListener("DemoConfiguration", "click", setOptionOne );
});
}
function setOptionOne() {
setOption(1);
}
function setOptionTwo() {
setOption(2);
}
function showWizard() {
renderWizard();
}
function renderWizard() {
YAHOO.sun.identity.config.options.wizard = new YAHOO.widget.Panel("wizard", { fixedcenter: false, modal: true, close: true, visible:false, constraintoviewport:true });
YAHOO.util.Dom.removeClass('wizard', 'license-accepted');
document.getElementById("wizard-accept-check").checked = false;
document.getElementById("wizard-accept-license-button").disabled = true;
});
$("wizard-license-message").innerHTML = licenseTXT;
YAHOO.util.Dom.removeClass('CreateNewConf', 'disabled');
YAHOO.util.Event.addListener("CreateNewConf", "click", setOptionTwo );
});
}
function setOption(inOption) {
configOption = inOption;
AjaxUtils.call( "$context$path?actionLink=resetSessionAttributes", onSetOption);
}
function onSetOption(response) {
if (configOption == 1) {
} else if (configOption == 2) {
} else {
alert("Not Implemented Yet");
}
}
#end
function writeConfigResponse(response) {
if (response.responseText === "true") {
} else {
document.getElementById("returnToConfig").style.display = "";
document.getElementById("setupMessage").innerHTML = errorImage + " " + response.responseText;
}
}
var isProgressShow = false;
function toggleProgressDiv() {
var obj = document.getElementById("progressControl");
var obj1 = document.getElementById("progressDiv");
if (isProgressShow == true ) {
obj.innerHTML = "Show Progress";
obj1.style.display ="none";
isProgressShow = false;
} else {
obj.innerHTML = "Hide progress log";
obj1.style.display="block";
isProgressShow = true;
}
}
function licenseReady(response) {
YAHOO.util.Dom.addClass('options-container', 'license-loaded');
licenseTXT = response.responseText;
#if ( $upgrade || $upgradeCompleted)
AjaxUtils.load('upgradeContainer', "$context/config/upgrade/upgrade.htm?" + getLocale(), renderUpgradePanel);
#else
AjaxUtils.load('defaultSummaryContainer', "$context/config/defaultSummary.htm?" + getLocale(), renderDefaultSummary);
AjaxUtils.load('wizardContainer', "$context/config/wizard/wizard.htm?" + getLocale(), renderWizard);
#end
}
function init() {
YAHOO.sun.identity.config.options.inProgress = new YAHOO.widget.Panel("inProgress", { width:"700px", fixedcenter: false, modal:true, close: false, visible:false, constraintoviewport:true });
YAHOO.sun.identity.config.options.confComplete = new YAHOO.widget.Panel("confComplete", { fixedcenter: false, modal:true, close: false, visible:false, constraintoviewport:true });
#if ( $upgrade || $upgradeCompleted)
YAHOO.sun.identity.config.options.upgradeComplete = new YAHOO.widget.Panel("upgradeComplete", { fixedcenter: true, modal: true, close: false, visible:false, constraintoviewport:true });
#if ($upgradeCompleted)
#end
YAHOO.sun.identity.config.options.upgrading = new YAHOO.widget.Panel("upgrading", { width:"240px", fixedcenter:true, close:false, draggable:false, zindex:4, modal:true, visible:false });
YAHOO.sun.identity.config.options.upgrading.setHeader("Upgrading configuration. Please wait...");
YAHOO.sun.identity.config.options.upgrading.setBody('<img src="$context/assets/images/rel_interstitial_loading.gif" />');
#end
#if ( $isOpenDS1x )
YAHOO.sun.identity.config.options.cannotContinue = new YAHOO.widget.Panel("cannotContinue", { fixedcenter: true, modal: true, close: false, visible:false, constraintoviewport:true });
#end
}
YAHOO.util.Event.onDOMReady(init);
</script>
<div id="options-container">
<div id="container" align="center">
<div id="options" align="left" style="width:600px">
#if ( $upgrade || $upgradeCompleted)
#else
#end
#if ($upgrade || $upgradeCompleted)
<div style="width: 100%">
#else
<div class="borderRight">
<br>
<p>
<a id="DemoConfiguration" class="blue pointer disabled" >$page.getLocalizedString("configuration.options.option1.link")</a>
</p>
#end
</div>
<!-- enable if adding third option
<div class="borderRight">
-->
#if($upgrade || $upgradeCompleted)
#else
<div>
<br>
<p>
<a id="CreateNewConf" class="blue pointer disabled" >$page.getLocalizedString("configuration.options.option2.link")</a>
</p>
</div>
#end
</div>
</div>
#if ( $upgrade || $upgradeCompleted)
width:280px;
float:left;
padding:5px;
text-align:left;
}
</style>
<div id="upgradeContainer"></div>
<div id="upgradeComplete" style="width:400px;visibility:hidden">
<div class="bd" style="background-color: white; text-align: center">
<a id="launchConsoleLink2" class="blueSmall pointer">$page.getLocalizedString("launch.console.link")</a>
</div>
</div>
#else
<div id="defaultSummaryContainer"></div>
<div id="wizardContainer"></div>
#end
<div id="inProgress" style="visibility:hidden">
<div class="header"> </div>
<div class="bd">
<div class="bodyPopup borderPopUpGray" align="center" style="background:#FFFFFF">
<br/>
#if ($upgrade || $upgradeCompleted)
#else
#end
<img src="$context/assets/images/rel_interstitial_loading.gif" />
<br>
<div id="progressDiv">
<iframe id="progressIframe" name="progressIframe" src="$context/assets/images/rel_interstitial_loading.gif" height=220 width=600 scrolling="no" frameborder="0">This browser cannot dipslay iframes.</iframe>
</div>
<br>
<hr>
<br> <br>
<span id="setupMessage"></span>
<br>
<br>
<div id="returnToConfig">
<a href="#" onClick="YAHOO.sun.identity.config.options.inProgress.hide(); return false;">$page.getLocalizedString("return.config.link")</a>
</div>
<br>
</div>
</div>
</div>
<div id="confComplete" style="visibility:hidden">
#if ($upgrade || $upgradeCompleted)
<div class="bd">
<div class="bodyPopup borderPopUpGray" align="center" style="background:#FFFFFF">
<br>
<br/>
#else
<div class="bd">
<div class="bodyPopup borderPopUpGray" align="center" style="background:#FFFFFF">
<br>
<br/>
<p align="center" class="blueSmall">
<a href="#" onclick="launchConsole(); return false">$page.getLocalizedString("go.to.login.screen")</a>
</p>
#end
</div>
</div>
</div>
#if ( $isOpenDS1x )
width:560px;
float:left;
padding:5px;
text-align:left;
}
</style>
<div id="cannotContinue" align="center" style="width:600px;visibility:hidden">
<div class="bd" style="background-color: white; height: 150px; text-align: left">
<div class="singlecolumn">
</div>
</div>
</div>
#end
</div>