📄 iframe.js
字号:
/* Copyright (C) 1996-2002 MicroStrategy Incorporated, All rights reserved. Confidential. */
var bIsPromptedReport = false;
var bLoaded = false;
var treeProcessing = false;
function notifyParent() {
if (window.parent)
if (window.parent != self)
if (window.parent.showWaitPage)
window.parent.showWaitPage();
return;
}
function showWaitPage() {
//Don't display 'Wait' window when prompts are displayed.
//currentPin will be set to at least 1 when prompts are loaded.
//Therefore, if it's -1, then it means prompts haven't been loaded yet.
if (currentPin == -1) {
bLoaded = true;
var oWait = getObj('divWaitBox');
if (oWait) {
var x = ((getClientWidth() - getObjWidth(oWait)) / 2)
var y = (((getClientHeight() - getObjHeight(oWait)) / 2) + document.body.scrollTop)
moveObjTo(oWait, x, y);
togglePulldowns(oWait, false, x, y);
showObj(oWait);
}
}
return;
}
function hideWaitPage() {
var oWait = getObj('divWaitBox');
if (oWait) {
togglePulldowns('', true, 0, 0);
hideObj(oWait);
togglePulldowns('', true, 0, 0);
//writeToDiv('hello', 'divWait');
//writeToDiv('', 'divWaitForms');
if (treeProcessing) {
removeTreeWaitMessage();
}
}
return;
}
function replaceComponents(parentWindow, iframeWindow) {
//*********************************************************************************************
//Purpose: replaces all elements between the iframe and the parent window.
//Inputs: parentWindow, iframeWindow
//Outputs: None.
//*********************************************************************************************
if(iframeWindow != parentWindow) {
var aIFrameDivs = iframeWindow.getObjectsbyTag("DIV");
var aIFrameForms = iframeWindow.getObjectsbyTag("FORM");
var aIFrameComments = iframeWindow.getObjectsbyTag("COMMENT");
var aScripts = null;
var i, sHTML, parent, current;
for (i = 0; i < aIFrameComments.length; i++) {
if (aIFrameComments[i].getAttribute("IFRAME") == 'true') {
current = aIFrameComments[i]
while((parent = current.parentNode) != null) {
if(parent.tagName == "DIV" && parent.getAttribute("IFRAME") == 'true') {
parent.setAttribute('IFRAME', 'false');
}
current = parent;
}
}
}
for (i = 0; i < aIFrameDivs.length; i++) {
if (aIFrameDivs[i].getAttribute("IFRAME") == 'true') {
current = aIFrameDivs[i]
while((parent = current.parentNode) != null) {
if(parent.tagName == "DIV" && parent.getAttribute("IFRAME") == 'true') {
parent.setAttribute('IFRAME', 'false');
}
current = parent;
}
}
}
for (i = 0; i < aIFrameComments.length; i++) {
if ((aIFrameComments[i].getAttribute("IFRAME") == 'true') && (aIFrameComments[i].getAttribute("ISEMPTY") != 'true')) {
sHTML = aIFrameComments[i].text;
sHTML = sHTML.substring(4, sHTML.length - 3);
sHTML = sHTML.replace(/'/g, "\'");
parentWindow.updateComponent(aIFrameComments[i].getAttribute("ID"), sHTML);
}
}
for (i = 0; i < aIFrameDivs.length; i++) {
if ((aIFrameDivs[i].getAttribute("IFRAME") == 'true') && (aIFrameDivs[i].getAttribute("ISEMPTY") != 'true')) {
sHTML = aIFrameDivs[i].outerHTML;
sHTML = sHTML.replace(/'/g, "\'");
parentWindow.updateComponent(aIFrameDivs[i].getAttribute("ID"), sHTML);
}
}
for (i = 0; i < aIFrameForms.length; i++) {
if ((aIFrameForms[i].getAttribute("IFRAME") == 'true') && (aIFrameForms[i].getAttribute("clearTarget") == 'true')) {
var oParentWindowForm = window.parent.getObj(aIFrameForms[i].name);
if (oParentWindowForm){
if (oParentWindowForm.getAttribute("target") != null){
oParentWindowForm.removeAttribute("target");
}
var aInputs = oParentWindowForm.getElementsByTagName('INPUT');
for(i = 0; i < aInputs.length; i++) {
if(aInputs[i].name == "iframe"){
aInputs[i].value = "false";
}
}
}
}
}
}
}
function updateComponent(sComponentID, sNewHTML) {
//*********************************************************************************************
//Purpose: replaces components in parent window.
//Inputs:
//Outputs: None.
//*********************************************************************************************
var aScripts = null;
var j;
var oParentDiv = getObj(sComponentID);
if (oParentDiv && oParentDiv.tagName == "DIV") {
oParentDiv.outerHTML = sNewHTML;
oParentDiv = getObj(sComponentID);
if(oParentDiv.getElementsByTagName("SCRIPT")) {
aScripts = oParentDiv.getElementsByTagName("SCRIPT");
if ((aScripts) && (aScripts.length > 0)) {
for (j = 0; j < aScripts.length; j++) {
if (aScripts[j].getAttribute("language") != "VBSCRIPT" && aScripts[j].getAttribute("id") == "") {
eval(aScripts[j].innerHTML);
}
}
}
}
}
}
function updateMainWindow(iframeWindow, title) {
//*********************************************************************************************
//Purpose: replaces components in parent window.
//Inputs:
//Outputs: None.
//*********************************************************************************************
if(window.name == "frameManager") {
replaceComponents(window.parent, iframeWindow);
window.parent.hideWaitPage();
window.parent.document.title = title;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -