?? search.js
字號:
}
function addFieldToFreeFormFormula( fieldName )
{
if( fieldName )
{
var freeFormTextBox = document.getElementById( "FormulaText" );
if( freeFormTextBox )
{
freeFormTextBox.value += fieldName;
}
}
}
function removeFieldFromSelected( strFieldToBeRemoved, addFieldMenuLabel, removeFieldMenuLabel )
{
//Remove the menu from the selected fields list
var strCurrentSelList = document.all.SelectedList.innerHTML;
var fieldsArray = strCurrentSelList.split( "<BR>" );
var strNewSelList = "";
//We're always going to have an empty node at the end
for( var i = 0; i < (fieldsArray.length-1); i++ )
{
if( fieldsArray[i] != strFieldToBeRemoved )
{
strNewSelList += fieldsArray[i] + "<BR>";
}
}
document.all.SelectedList.innerHTML = strNewSelList;
//Add the field to the menu that lets you add an item to the selected fields list
addMenuItemToExistingMenu( addFieldMenuLabel, strFieldToBeRemoved,
"addFieldToSelected( \"" + strFieldToBeRemoved + "\", \"" + addFieldMenuLabel + "\", \""
+ removeFieldMenuLabel + "\" ); " );
//Remove the field from the menu that lets your remove an item from the selected fields list
removeMenuItemFromExistingMenu( removeFieldMenuLabel, strFieldToBeRemoved );
//Rewrite the menus
updateWrittenMenus();
}
//Assumes: hiddenTreeInfo is a div containing the full tree information in the expected form
// groupTree is the div into which the group tree is expected to be placed
// treeScrollCurrent is an element whose innerText contains the current position in the tree
// treeScrollMaxVisible is an element whose innerText contains the maximum visible nodes for the tree
//Params: updateType - a flag denoted whether this is a refresh or a move back or forward
function updateGroupTree( updateType )
{
//Check that we actually have a tree
if( !(document.all.hiddenTreeInfo) )
{
//If not, just disable the buttons and go
if( document.all.scrollup )
{
document.all.scrollup.style.display = "none";
}
if( document.all.scrolldown )
{
document.all.scrolldown.style.display = "none";
}
return;
}
//Get all of the node info
var strFullTreeInfo = document.all.hiddenTreeInfo.innerText;
var aryAllTreeNodes = strFullTreeInfo.split( "!!@@" );
//Get position info
var treeScrollCurrent = new Number( document.all.treeScrollCurrent.innerText );
var treeScrollMaxVisible = new Number( document.all.treeScrollMaxVisible.innerText );
//Set up the start point correctly
if( updateType == "refresh" )
{
//This is probably the first time we're calling this, so make sure that the start point is
//valid (ie. between 0 and # of nodes) and then make sure that it's at the start of a group
//(ie. if treeScrollMaxVisible = 10, then start point should be 0 or 10 or 20 or ...)
//Make start point valid
if( treeScrollCurrent < 0 )
{
treeScrollCurrent = 0;
}
else if( treeScrollCurrent > (aryAllTreeNodes.length-1 ) )
{
//This will likely be in the middle of a page, but the next section will deal with that
//so we're not even going to try
treeScrollCurrent = aryAllTreeNodes.length-1;
}
//Put start point at the top of a page
var remainder = treeScrollCurrent % treeScrollMaxVisible;
if( remainder > 0 )
{
var newCurrentNode = treeScrollCurrent - remainder;
document.all.treeScrollCurrent.innerText = newCurrentNode;
treeScrollCurrent = newCurrentNode;
}
}
else if( updateType == "previous" )
{
//Move the current node back by the number of visible nodes
var newCurrentNode = treeScrollCurrent - treeScrollMaxVisible;
if( newCurrentNode < 0 )
{
newCurrentNode = 0;
}
document.all.treeScrollCurrent.innerText = newCurrentNode;
treeScrollCurrent = newCurrentNode;
}
else if( updateType == "next" )
{
//Move the current node forward by the number of visible nodes
var newCurrentNode = treeScrollCurrent + treeScrollMaxVisible;
if( newCurrentNode > (aryAllTreeNodes.length-1) )
{
//Nowhere to go
newCurrentNode = treeScrollCurrent;
}
document.all.treeScrollCurrent.innerText = newCurrentNode;
treeScrollCurrent = newCurrentNode;
}
//Set end point correctly - reminder, last node in the array will actually be blank, just because
//of the way we print out the full tree info
var endPoint = treeScrollCurrent+treeScrollMaxVisible;
var numberToMax = 0;
if( endPoint > (aryAllTreeNodes.length-1) )
{
//We want to be able to pad the report so that each time you scroll, the amount of space the tree takes up
//is the same - however, if we have less than treeScrollMaxVisible nodes there is only one page (no scrolling)
//so we don't want to pad at all
if( treeScrollMaxVisible < (aryAllTreeNodes.length-1) )
{
numberToMax = endPoint - (aryAllTreeNodes.length-1);
}
endPoint = (aryAllTreeNodes.length-1);
}
var downImage = "";
var upImage = "";
if( document.all.treeImageDown )
{
downImage = document.all.treeImageDown.innerText;
}
if( document.all.treeImageUp )
{
upImage = document.all.treeImageUp.innerText;
}
//Write out each node
var strGroupTreeText = "";
for( var i=treeScrollCurrent; i < endPoint; i++ )
{
//Get the node info
var aryThisNodeInfo = aryAllTreeNodes[i].split( ":::" );
if( aryThisNodeInfo == null )
{
continue;
}
var nodeLevel = aryThisNodeInfo[0];
var imageFlag = aryThisNodeInfo[1];
var growProcedure = aryThisNodeInfo[2];
var name = aryThisNodeInfo[3];
var nodePath = aryThisNodeInfo[4];
var navigateProcedure = "";
if( aryThisNodeInfo.length >= 6 )
{
//The last var may or may not be here
navigateProcedure = aryThisNodeInfo[5];
}
for( var j=0; j < nodeLevel; j++ )
{
strGroupTreeText += "   ";
}
//If this is the first node on the page (treeScrollCurrent) then we need to put
//this information in the input for retrieval
if( i == treeScrollCurrent )
{
var pathOfTopNode = document.getElementById('topNodeOfTree');
if( pathOfTopNode != null )
{
pathOfTopNode.value = nodePath;
}
}
//Start writing out tag - first the marker, then the name
strGroupTreeText += "<a class=\"crtreenode\" href=\"";
strGroupTreeText += growProcedure;
strGroupTreeText += "\"><img src=\"";
if( imageFlag == "crtreenodeDown" )
{
strGroupTreeText += downImage;
}
else
{
strGroupTreeText += upImage;
}
strGroupTreeText += " \"><a>";
strGroupTreeText += "  ";
if( navigateProcedure )
{
strGroupTreeText += "<a class=\"crtreenode\" href=\"";
strGroupTreeText += navigateProcedure;
strGroupTreeText += "\">";
strGroupTreeText += name;
strGroupTreeText += "</a>";
}
else
{
strGroupTreeText += name;
}
strGroupTreeText += "<br>";
}
//If the number of entries on the page does not equal our max number of entries, we want to fill in blank
//spaces to keep the spacing the same
for( var j = 0; j<numberToMax; j++ )
{
strGroupTreeText += "  ";
strGroupTreeText += "<br>";
}
document.all.groupTree.innerHTML = strGroupTreeText;
//Reset the scroll buttons - if they exist - if this is the first time through, the scroll down
//button won't exist yet
if( document.all.scrollup )
{
if( treeScrollCurrent <= 0 )
{
//scroll up is disabled
document.all.scrollup.style.visibility = "hidden";
}
else
{
document.all.scrollup.style.visibility = "visible";
}
}
if( document.all.scrolldown )
{
if( endPoint >= (aryAllTreeNodes.length-1) )
{
//scroll down is disabled
document.all.scrolldown.style.visibility = "hidden";
}
else
{
document.all.scrolldown.style.visibility = "visible";
}
}
}
//Function: SlideSideBar
// Shows and hides the side bar depending on user behaviour
//Assumes: sidebar is in a table cell named SideBar
// triggering area is a table cell named TriggerBar
function SlideSideBar( action )
{
if( document.all.SideBar.filters[0] )
{
document.all.SideBar.filters[0].apply();
}
if( action == "hide" )
{
//If the side bar is showing, then we should hide it
document.all.SideBar.style.display = "none";
}
else
{
//If the side bar is hidden, then we should show it
document.all.SideBar.style.display = "inline";
}
if( document.all.SideBar.filters[0] )
{
document.all.SideBar.filters[0].play();
}
}
//This function should only be called from the COM viewer. Use encodeURIComponent from the
//Java viewer to get the appropriate encoding.
function COMUrlEncode( strToBeEncoded )
{
var encodedString = new String("");
for( var i = 0; i < strToBeEncoded.length; i++ )
{
var nextChar = strToBeEncoded.charAt(i);
switch( nextChar )
{
//Unsafe characters
case '%':
{
encodedString += "%25";
break;
}
case '+':
{
encodedString += "%2B";
break;
}
case ' ':
{
encodedString += "%20";
break;
}
case '<':
{
encodedString += "%3C";
break;
}
case '>':
{
encodedString += "%3E";
break;
}
case '"':
{
encodedString += "%22";
break;
}
case '\'':
{
encodedString += "%27";
break;
}
case '#':
{
encodedString += "%23";
break;
}
case '{':
{
encodedString += "%7B";
break;
}
case '}':
{
encodedString += "%7D";
break;
}
case '|':
{
encodedString += "%7C";
break;
}
case '\\':
{
encodedString += "%5C";
break;
}
case '^':
{
encodedString += "%5E";
break;
}
case '~':
{
encodedString += "%7E";
break;
}
case '`':
{
encodedString += "%60";
break;
}
case '[':
{
encodedString += "%5B";
break;
}
case ']':
{
encodedString += "%5D";
break;
}
//Reserved characters
case ';':
{
encodedString += "%3B";
break;
}
case '/':
{
encodedString += "%2F";
break;
}
case '?':
{
encodedString += "%3F";
break;
}
case ':':
{
encodedString += "%3A";
break;
}
case '@':
{
encodedString += "%40";
break;
}
case '=':
{
encodedString += "%3D";
break;
}
case '&':
{
encodedString += "%26";
break;
}
default:
{
encodedString += nextChar;
break;
}
}
}
return encodedString;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -