home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.tcs3.com
/
ftp.tcs3.com.tar
/
ftp.tcs3.com
/
DRIVERS
/
Audio
/
Office2010
/
ProPlus.WW
/
ProPsWW.cab
/
FORMSHOMEPAGESCRIPT.JS3
< prev
next >
Wrap
Text File
|
2007-02-04
|
8KB
|
200 lines
/*********************************************************************
Notice
You may not modify, use, copy or distribute this file or its contents.
Internal interfaces referenced in this file are nonpublic, unsupported
and subject to change without notice. These interfaces may not be
utilized in other software applications or components.
*********************************************************************/
// Capture keydown and contextmenu events for the document.
document.oncontextmenu = contextMenuEvent;
function contextMenuEvent()
{
// Right-click context menu will only appear if 'Ctrl' key is held down.
if (!event.ctrlKey)
event.returnValue = false;
}
function initMainPage()
{
var GrooveFormsToolDesignObjectType_Form = 0x0001;
var GrooveFormsToolDesignObjectType_View = 0x0002;
var bNavigated = false;
// If the design is initialized and there are at least one form and view, go to the view frame.
if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").IsDesignInitialized(false))
{
if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DesignObjectCount(GrooveFormsToolDesignObjectType_Form, false) > 0 &&
getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DesignObjectCount(GrooveFormsToolDesignObjectType_View, false) > 0)
{
if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").NeedToAutoCreateRecord())
{
var dFormID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").AutoCreateForm;
if (dFormID == -1)
dFormID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DefaultFormID;
// Navigate to the form designated for auto-creating.
if (dFormID != -1)
{
var sFormID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").ConvertDesignObjectIDToString(dFormID);
window.location.replace("FormsFormTemplate.html?FormID=" + sFormID);
bNavigated = true;
}
}
else if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DocumentMode)
{
var Transaction = getScriptHostQI("IGrooveFormsToolUIDelegate").OpenTransaction();
try
{
if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DesignObjectCount(GrooveFormsToolDesignObjectType_Form) > 0)
{
var dFormID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DefaultFormID;
var sFormID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").ConvertDesignObjectIDToString(dFormID);
// Get the currently selected record ID.
var dRecordID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").GetSelectedRecordID();
if (dRecordID == -1 || !getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").IsValidRecord(dRecordID))
dRecordID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").GetFirstValidRecordID();
if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").IsValidRecord(dRecordID))
{
var sRecordID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").ConvertDesignObjectIDToString(dRecordID);
// If the record has a form specified use it instead of the first form in the enum.
var Record = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").OpenRecord(dRecordID);
if (Record.HasField("Forms_Tool_grooveFormID"))
{
dFormID = Record.OpenField("Forms_Tool_grooveFormID");
sFormID = getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").ConvertDesignObjectIDToString(dFormID);
}
if (dFormID != -1)
{
window.location.replace("FormsFormTemplate.html?FormID=" + sFormID + "&RecordID=" + sRecordID);
bNavigated = true;
// Call to set the initial state of the StatusBarViewNameButton
getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").SetCurrentDocumentModeRecordID(dRecordID);
}
}
else
getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").SetCurrentDocumentModeRecordID(-1);
}
Transaction.Commit();
}
catch(error)
{
//alert("Tranaction aborted in initMainPage [" + error.description + "]");
Transaction.Abort();
}
}
else
{
window.location.replace("FormsViewFrame.html");
bNavigated = true;
}
}
}
if (!bNavigated)
{
// If the design is not complete, display the welcome page.
setVisibility("tblMain", "visible");
// Disable the command bar buttons that can't be used yet.
getScriptHostQI("IGrooveFormsToolUIDelegateHomePagePrivate").DisableUICommands();
if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").CanUseDesigner)
{
try
{
if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").IsDesignInitialized(true) ||
(getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DesignObjectCount(GrooveFormsToolDesignObjectType_Form, false) <= 0 &&
getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DesignObjectCount(GrooveFormsToolDesignObjectType_View, false) > 0) ||
(getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DesignObjectCount(GrooveFormsToolDesignObjectType_Form, false) > 0 &&
getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DesignObjectCount(GrooveFormsToolDesignObjectType_View, false) <= 0))
{
setDisplay("divSandbox", "block");
setDisplay("divSandboxButton", "block");
}
else
{
setDisplay("divDesigner", "block");
if (getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DesignObjectCount(GrooveFormsToolDesignObjectType_Form, false) <= 0 &&
getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").DesignObjectCount(GrooveFormsToolDesignObjectType_View, false) <= 0)
{
setVisibility("pDesigner", "visible");
setDisplay("divButton", "block");
}
}
}
catch (error)
{
// Hide designer related divs on error.
setDisplay("divDesigner", "none");
setDisplay("divButton", "none");
// Show generic non-designer div on error.
setDisplay("divNonDesigner", "block");
}
}
else
setDisplay("divNonDesigner", "block");
}
}
function setVisibility(i_ID, i_Visibility)
{
var objVisibility = document.getElementById(i_ID);
if (objVisibility != null)
objVisibility.style.visibility = i_Visibility;
}
function setDisplay(i_ID, i_Display)
{
var objDisplay = document.getElementById(i_ID);
if (objDisplay != null)
objDisplay.style.display = i_Display;
}
function doButtonOver()
{
tdButtonLeft.style.background = "url(button_left_over.gif)";
tdButtonMid.style.background = "url(button_mid_over.gif)";
tdButtonRight.style.background = "url(button_right_over.gif)";
}
function doButtonOut()
{
tdButtonLeft.style.background = "url(button_left.gif)";
tdButtonMid.style.background = "url(button_mid.gif)";
tdButtonRight.style.background = "url(button_right.gif)";
}
function doSandboxButtonOver()
{
tdSandboxButtonLeft.style.background = "url(button_left_over.gif)";
tdSandboxButtonMid.style.background = "url(button_mid_over.gif)";
tdSandboxButtonRight.style.background = "url(button_right_over.gif)";
}
function doSandboxButtonOut()
{
tdSandboxButtonLeft.style.background = "url(button_left.gif)";
tdSandboxButtonMid.style.background = "url(button_mid.gif)";
tdSandboxButtonRight.style.background = "url(button_right.gif)";
}
function goCreate()
{
getScriptHostQI("IGrooveFormsToolUIDelegateHomePagePrivate").CreateNewForm();
}
function goContinue()
{
getScriptHostQI("IGrooveFormsToolUIDelegatePrivate").SwitchWebState(FormsUIState_SettingsAndOptions, -1);
}