?? toolbar.htc
字號(hào):
if (isButton || isCheckButton)
{
item._defaultStyle = globalDefault;
if (hasGroup && (item._group.szDefaultStyle != null))
item._defaultStyle += item._group.szDefaultStyle + ";";
item._defaultStyle += localDefault + ";";
item._hoverStyle = item._defaultStyle + globalHover;
if (hasGroup && (item._group.szHoverStyle != null))
item._hoverStyle += item._group.szHoverStyle + ";";
item._hoverStyle += item.getAttribute("hoverStyle") + ";";
item._selectedStyle = item._defaultStyle + globalSelected;
if (hasGroup && (item._group.szSelectedStyle != null))
item._selectedStyle += item._group.szSelectedStyle + ";";
item._selectedStyle += item.getAttribute("selectedStyle") + ";";
f_ApplyNeutralStyle(item);
}
else if (item._type != "emptygroup")
{
item.style.cssText = globalDefault + localDefault;
if ((item._type == "dropdownlist") || (item._type == "textbox"))
f_InheritCellFont(item);
}
}
}
function f_ApplyNeutralStyle(oCell)
{
switch (oCell._type)
{
case "checkbutton":
oCell.style.cssText = (f_IsSelected(oCell)) ? oCell._selectedStyle : oCell._defaultStyle;
break;
case "button":
oCell.style.cssText = oCell._defaultStyle;
break;
}
}
function f_ApplyPressedStyle(oCell)
{
switch (oCell._type)
{
case "checkbutton":
oCell.style.cssText = oCell._selectedStyle;
break;
case "button":
oCell.style.cssText = oCell._selectedStyle;
break;
}
}
function f_ApplyHoverStyle(oCell)
{
switch (oCell._type)
{
case "checkbutton":
oCell.style.cssText = (f_IsSelected(oCell)) ? oCell._selectedStyle : oCell._hoverStyle;
break;
case "button":
oCell.style.cssText = oCell._hoverStyle;
break;
}
}
function f_OnMouseOver()
{
if (_IsSubmitting || !_Ready)
return;
if (_bDragging)
return;
var oCell = f_FindSurroundingCell(event.srcElement);
if ((oCell != null) && !oCell.contains(event.fromElement))
{
if (!f_Interactable(oCell) || oCell.isDisabled)
return;
if (_oInteractNode != null)
{
if (_oInteractNode == oCell)
f_ApplyPressedStyle(oCell);
}
else
{
f_ApplyHoverStyle(oCell);
}
}
}
function f_OnMouseOut()
{
if (_IsSubmitting || !_Ready)
return;
if (_bDragging)
return;
var oCell = f_FindSurroundingCell(event.srcElement);
if ((oCell != null) && !oCell.contains(event.toElement))
{
if (!f_Interactable(oCell) || oCell.isDisabled)
return;
if (_oInteractNode != null)
{
if (_oInteractNode == oCell)
f_ApplyHoverStyle(oCell);
}
else
{
f_ApplyNeutralStyle(oCell);
}
}
}
function f_OnMouseDown()
{
if (_IsSubmitting || !_Ready)
return;
if (event.button != 1)
return;
var oCell = f_FindSurroundingCell(event.srcElement);
if ((oCell != null) && (f_Interactable(oCell)))
{
f_SetCapture();
if (oCell.isDisabled)
return;
f_ApplyPressedStyle(oCell);
_oInteractNode = oCell;
}
else if (f_IsMoveable())
{
if ((oCell == null) ||
(oCell._type == "gripper"))
{
f_SetCapture();
f_StartDrag();
}
}
}
function f_OnMouseUp()
{
if (_IsSubmitting || !_Ready)
return;
if (event.button != 1)
return;
f_ReleaseCapture();
if (_oInteractNode != null)
{
f_ApplyNeutralStyle(_oInteractNode);
_oInteractNode = null;
}
f_StopDrag();
f_OnMouseOver();
}
function f_OnKeyUp()
{
if (_IsSubmitting || !_Ready)
return;
if ((event.srcElement.accessKey != null) && event.altKey &&
(event.srcElement.accessKey.toUpperCase().charCodeAt() == event.keyCode))
{
event.srcElement.click();
}
else
{
switch (event.keyCode)
{
case 13:
case 32:
var oCell = f_FindSurroundingCell(event.srcElement);
if (oCell != null)
{
_KeyboardClick = true;
oCell.click();
}
break;
}
}
}
function f_StartDrag()
{
_nLastScreenX = event.screenX;
_nLastScreenY = event.screenY;
_nLastClientX = event.clientX;
_nLastClientY = event.clientY;
_bDragging = true;
}
function f_StopDrag()
{
_bDragging = false;
}
function f_Least (a, b, c, d)
{
return ((a < b) && (a < c) && (a < d));
}
function f_Drag()
{
if (!_bDragging || (event.button != 1))
{
return;
}
var nNewLeft = offsetLeft + event.screenX - _nLastScreenX;
var nNewTop = offsetTop + event.screenY - _nLastScreenY;
_nLastScreenX = event.screenX;
_nLastScreenY = event.screenY;
var oBody = f_FindSurroundingBody();
if (oBody == null)
return;
var nDeltaLeft = (offsetLeft + event.clientX) - oBody.scrollLeft;
var nDeltaTop = (offsetTop + event.clientY) - oBody.scrollTop;
var nDeltaRight = (oBody.scrollLeft + oBody.clientWidth) - (offsetLeft + event.clientX);
var nDeltaBottom = (oBody.scrollTop + oBody.clientHeight) - (offsetTop + event.clientY);
var nMaxDelta = 10;
if (f_IsDockable() &&
((nDeltaLeft <= nMaxDelta) || (nDeltaTop <= nMaxDelta) || (nDeltaBottom <= nMaxDelta) || (nDeltaRight <= nMaxDelta)))
{
if ((!_bDocked && (nDeltaTop <= nMaxDelta)) ||
(_bDocked && (_szDockedLocation != "top") && f_Least(nDeltaTop, nDeltaBottom, nDeltaLeft, nDeltaRight)))
{
if (!_bDocked)
_PreDockOrientation = orientation;
f_ReleaseCapture();
_oTable.releaseCapture();
orientation = "horizontal";
f_SetCapture();
style.removeExpression("height");
style.height = "";
style.setExpression("left", "scrollLeft-scrollLeft+document.body.scrollLeft", "JavaScript");
style.setExpression("top", "scrollTop-scrollTop+document.body.scrollTop", "JavaScript");
style.setExpression("width", "document.body.clientWidth");
_bDocked = true;
_szDockedLocation = "top";
}
else if ((!_bDocked && (nDeltaLeft <= nMaxDelta)) ||
(_bDocked && (_szDockedLocation != "left") && f_Least(nDeltaLeft, nDeltaTop, nDeltaBottom, nDeltaRight)))
{
if (!_bDocked)
_PreDockOrientation = orientation;
f_ReleaseCapture();
orientation = "vertical";
f_SetCapture();
style.removeExpression("width");
style.width = "";
style.height = oBody.clientHeight;
style.setExpression("left", "scrollLeft-scrollLeft+document.body.scrollLeft", "JavaScript");
style.setExpression("top", "scrollTop-scrollTop+document.body.scrollTop", "JavaScript");
style.setExpression("height", "document.body.clientHeight");
_bDocked = true;
_szDockedLocation = "left";
}
else if ((!_bDocked && (nDeltaBottom <= nMaxDelta)) ||
(_bDocked && (_szDockedLocation != "bottom") && f_Least(nDeltaBottom, nDeltaTop, nDeltaLeft, nDeltaRight)))
{
if (!_bDocked)
_PreDockOrientation = orientation;
f_ReleaseCapture();
orientation = "horizontal";
f_SetCapture();
style.removeExpression("height");
style.height = "";
style.setExpression("left", "scrollLeft-scrollLeft+document.body.scrollLeft", "JavaScript");
style.setExpression("top", "scrollTop-scrollTop+document.body.scrollTop+document.body.clientHeight-offsetHeight", "JavaScript");
style.setExpression("width", "document.body.clientWidth");
_bDocked = true;
_szDockedLocation = "bottom";
}
else if ((!_bDocked && (nDeltaRight <= nMaxDelta)) ||
(_bDocked && (_szDockedLocation != "right") && f_Least(nDeltaRight, nDeltaTop, nDeltaBottom, nDeltaLeft)))
{
if (!_bDocked)
_PreDockOrientation = orientation;
f_ReleaseCapture();
orientation = "vertical";
f_SetCapture();
style.removeExpression("width");
style.width = "";
style.height = oBody.clientHeight;
style.setExpression("left", "scrollLeft-scrollLeft+document.body.scrollLeft+document.body.clientWidth-offsetWidth", "JavaScript");
style.setExpression("top", "scrollTop-scrollTop+document.body.scrollTop", "JavaScript");
style.setExpression("height", "document.body.clientHeight");
_bDocked = true;
_szDockedLocation = "right";
}
}
else if (_bDocked)
{
f_ReleaseCapture();
orientation = _PreDockOrientation;
_PreDockOrientation = "";
f_SetCapture();
style.removeExpression("left");
style.removeExpression("top");
style.removeExpression("width");
style.removeExpression("height");
style.width = "";
style.height = "";
style.left = offsetLeft + (event.clientX - _nLastClientX);
style.top = offsetTop + (event.clientY - _nLastClientY);
_bDocked = false;
}
else if (!_bDocked)
{
style.left = nNewLeft;
style.top = nNewTop;
}
}
function f_SelectItem(oCell)
{
if (!f_Interactable(oCell))
return;
if (oCell._type == "checkbutton")
{
if (!f_IsSelected(oCell))
{
f_CheckButton(oCell);
}
else if ((oCell._group == null) || (!oCell._group.bForceSel))
{
f_SetSelected(oCell, false);
if (oCell._group != null)
{
oCell._group.oSelected = null;
}
f_FireCheckChange(oCell);
}
if (_KeyboardClick)
f_ApplyNeutralStyle(oCell);
else
f_ApplyHoverStyle(oCell);
}
f_FireButtonClick(oCell);
}
function f_OnClick()
{
if (_IsSubmitting || !_Ready)
return;
var oCell = f_FindSurroundingCell(event.srcElement);
if ((oCell != null) && (!oCell.isDisabled))
f_SelectItem(oCell);
_KeyboardClick = false;
}
function f_FindSurroundingCell(oNode)
{
while (oNode != null)
{
if (oNode._type != null)
return oNode;
oNode = oNode.offsetParent;
}
return null;
}
function f_FindSurroundingBody()
{
var oParent = element.offsetParent;
while (oParent.tagName != "BODY")
{
oParent = oParent.offsetParent;
if (oParent == null)
return;
}
return oParent;
}
function f_CancelInteractEvents()
{
var oCell = f_FindSurroundingCell(event.srcElement);
if (oCell == null)
{
event.returnValue = false;
}
else
{
switch (oCell._type)
{
case "button":
case "checkbutton":
case "separator":
case "gripper":
case "label":
event.returnValue = false;
break;
}
}
}
function f_FireCheckChange(oCell)
{
evCheckChange.fire(f_CreateEventObject(oCell));
}
function f_FireButtonClick(oCell)
{
evButtonClick.fire(f_CreateEventObject(oCell));
}
function f_CreateEventObject(oCell)
{
var oEvent= createEventObject();
if (oCell != null)
{
oEvent.srcNode = f_PublicMakeContract(oCell);
var nIndex = f_GetIndexFromCell(oCell);
if (nIndex >= 0)
oEvent.flatIndex = nIndex;
}
return oEvent;
}
function f_GetIndexFromCell(oCell)
{
var parent = f_GetParent();
var item;
var index;
var flatIndex = -1;
var vertical = (orientation == "vertical");
for (index = 0; index < parent.children.length; index++)
{
item = parent.children[index];
if (vertical)
item = item.children[0];
if (item._type != "emptygroup")
flatIndex++;
if (oCell.uniqueID == item.uniqueID)
return flatIndex;
}
return -1;
}
function f_SetCapture()
{
f_ReleaseCapture();
_oTable.setCapture();
}
function f_ReleaseCapture()
{
_oTable.releaseCapture();
}
function f_OnStop()
{
if (!_IsSubmitting || (_OnStopCount > 0))
{
_IsSubmitting = false;
element.removeAttribute("_submitting");
}
_OnStopCount++;
}
function f_CleanupEvents()
{
var eventArray = window.__toolbarAttachedEvents;
if ((eventArray != null) && (eventArray[0]))
{
var newArray = new Array(false);
for (var i = 1; i < eventArray.length; i++)
{
if (element.document.all[eventArray[i][0]] == null)
{
element.document.detachEvent("onstop", eventArray[i][1]);
}
else
{
newArray = newArray.concat(new Array(eventArray[i]));
}
}
window.__toolbarAttachedEvents = newArray;
}
}
function f_AddStopEvent()
{
var eventArray = window.__toolbarAttachedEvents;
if (eventArray == null)
{
eventArray = new Array(false);
}
element.document.attachEvent("onstop", f_OnStop);
eventArray[0] = true;
entry = new Array(element.uniqueID, f_OnStop);
window.__toolbarAttachedEvents = eventArray.concat(new Array(entry));
}
function f_OnDocReady()
{
f_CleanupEvents();
evWCReady.fire(createEventObject());
}
</script>
</public:component>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -