Code cleanup con CodeMaid

This commit is contained in:
Samuele E. Locatelli
2020-09-11 12:45:52 +02:00
parent 831ad26bb0
commit 91ccb018af
293 changed files with 52598 additions and 50875 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ function DetailsView_createPropertyString() {
function DetailsView_setStateValue() {
this.stateField.value = this.createPropertyString();
}
function DetailsView_OnCallback (result, context) {
function DetailsView_OnCallback(result, context) {
var value = new String(result);
var valsArray = value.split("|");
var innerHtml = valsArray[2];
@@ -31,4 +31,4 @@ function DetailsView_getHiddenFieldContents(arg) {
function createPropertyStringFromValues_DetailsView(pageIndex, dataKeys) {
var value = new Array(pageIndex, dataKeys);
return value.join("|");
}
}
+20 -20
View File
@@ -35,7 +35,7 @@ function WebForm_AutoFocus(focusId) {
targetControl = document.all[focusId];
}
var focused = targetControl;
if (targetControl && (!WebForm_CanFocus(targetControl)) ) {
if (targetControl && (!WebForm_CanFocus(targetControl))) {
focused = WebForm_FindFirstFocusableChild(targetControl);
}
if (focused) {
@@ -56,33 +56,33 @@ function WebForm_CanFocus(element) {
if (!element || !(element.tagName)) return false;
var tagName = element.tagName.toLowerCase();
return (!(element.disabled) &&
(!(element.type) || element.type.toLowerCase() != "hidden") &&
WebForm_IsFocusableTag(tagName) &&
WebForm_IsInVisibleContainer(element)
);
(!(element.type) || element.type.toLowerCase() != "hidden") &&
WebForm_IsFocusableTag(tagName) &&
WebForm_IsInVisibleContainer(element)
);
}
function WebForm_IsFocusableTag(tagName) {
return (tagName == "input" ||
tagName == "textarea" ||
tagName == "select" ||
tagName == "button" ||
tagName == "a");
tagName == "textarea" ||
tagName == "select" ||
tagName == "button" ||
tagName == "a");
}
function WebForm_IsInVisibleContainer(ctrl) {
var current = ctrl;
while((typeof(current) != "undefined") && (current != null)) {
while ((typeof (current) != "undefined") && (current != null)) {
if (current.disabled ||
( typeof(current.style) != "undefined" &&
( ( typeof(current.style.display) != "undefined" &&
current.style.display == "none") ||
( typeof(current.style.visibility) != "undefined" &&
current.style.visibility == "hidden") ) ) ) {
(typeof (current.style) != "undefined" &&
((typeof (current.style.display) != "undefined" &&
current.style.display == "none") ||
(typeof (current.style.visibility) != "undefined" &&
current.style.visibility == "hidden")))) {
return false;
}
if (typeof(current.parentNode) != "undefined" &&
current.parentNode != null &&
current.parentNode != current &&
current.parentNode.tagName.toLowerCase() != "body") {
if (typeof (current.parentNode) != "undefined" &&
current.parentNode != null &&
current.parentNode != current &&
current.parentNode.tagName.toLowerCase() != "body") {
current = current.parentNode;
}
else {
@@ -90,4 +90,4 @@ function WebForm_IsInVisibleContainer(ctrl) {
}
}
return true;
}
}
+2 -2
View File
@@ -17,7 +17,7 @@ function GridView_createPropertyString() {
function GridView_setStateValue() {
this.stateField.value = this.createPropertyString();
}
function GridView_OnCallback (result, context) {
function GridView_OnCallback(result, context) {
var value = new String(result);
var valsArray = value.split("|");
var innerHtml = valsArray[4];
@@ -33,4 +33,4 @@ function GridView_getHiddenFieldContents(arg) {
function createPropertyStringFromValues_GridView(pageIndex, sortDirection, sortExpression, dataKeys) {
var value = new Array(pageIndex, sortDirection, sortExpression, dataKeys);
return value.join("|");
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3,4 +3,4 @@
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjaxTimer.js
Type._registerScript("Timer.js",["MicrosoftAjaxComponentModel.js"]);Sys.UI._Timer=function(a){Sys.UI._Timer.initializeBase(this,[a]);this._interval=60000;this._enabled=true;this._postbackPending=false;this._raiseTickDelegate=null;this._endRequestHandlerDelegate=null;this._timer=null;this._pageRequestManager=null;this._uniqueID=null};Sys.UI._Timer.prototype={get_enabled:function(){return this._enabled},set_enabled:function(a){this._enabled=a},get_interval:function(){return this._interval},set_interval:function(a){this._interval=a},get_uniqueID:function(){return this._uniqueID},set_uniqueID:function(a){this._uniqueID=a},dispose:function(){this._stopTimer();if(this._pageRequestManager!==null)this._pageRequestManager.remove_endRequest(this._endRequestHandlerDelegate);Sys.UI._Timer.callBaseMethod(this,"dispose")},_doPostback:function(){__doPostBack(this.get_uniqueID(),"")},_handleEndRequest:function(c,b){var a=b.get_dataItems()[this.get_id()];if(a)this._update(a[0],a[1]);if(this._postbackPending===true&&this._pageRequestManager!==null&&this._pageRequestManager.get_isInAsyncPostBack()===false){this._postbackPending=false;this._doPostback()}},initialize:function(){Sys.UI._Timer.callBaseMethod(this,"initialize");this._raiseTickDelegate=Function.createDelegate(this,this._raiseTick);this._endRequestHandlerDelegate=Function.createDelegate(this,this._handleEndRequest);if(Sys.WebForms&&Sys.WebForms.PageRequestManager)this._pageRequestManager=Sys.WebForms.PageRequestManager.getInstance();if(this._pageRequestManager!==null)this._pageRequestManager.add_endRequest(this._endRequestHandlerDelegate);if(this.get_enabled())this._startTimer()},_raiseTick:function(){this._startTimer();if(this._pageRequestManager===null||!this._pageRequestManager.get_isInAsyncPostBack()){this._doPostback();this._postbackPending=false}else this._postbackPending=true},_startTimer:function(){this._timer=window.setTimeout(Function.createDelegate(this,this._raiseTick),this.get_interval())},_stopTimer:function(){if(this._timer!==null){window.clearTimeout(this._timer);this._timer=null}},_update:function(c,b){var a=!this.get_enabled(),d=this.get_interval()!==b;if(!a&&(!c||d)){this._stopTimer();a=true}this.set_enabled(c);this.set_interval(b);if(this.get_enabled()&&a)this._startTimer()}};Sys.UI._Timer.registerClass("Sys.UI._Timer",Sys.UI.Control);
Type._registerScript("Timer.js", ["MicrosoftAjaxComponentModel.js"]); Sys.UI._Timer = function (a) { Sys.UI._Timer.initializeBase(this, [a]); this._interval = 60000; this._enabled = true; this._postbackPending = false; this._raiseTickDelegate = null; this._endRequestHandlerDelegate = null; this._timer = null; this._pageRequestManager = null; this._uniqueID = null }; Sys.UI._Timer.prototype = { get_enabled: function () { return this._enabled }, set_enabled: function (a) { this._enabled = a }, get_interval: function () { return this._interval }, set_interval: function (a) { this._interval = a }, get_uniqueID: function () { return this._uniqueID }, set_uniqueID: function (a) { this._uniqueID = a }, dispose: function () { this._stopTimer(); if (this._pageRequestManager !== null) this._pageRequestManager.remove_endRequest(this._endRequestHandlerDelegate); Sys.UI._Timer.callBaseMethod(this, "dispose") }, _doPostback: function () { __doPostBack(this.get_uniqueID(), "") }, _handleEndRequest: function (c, b) { var a = b.get_dataItems()[this.get_id()]; if (a) this._update(a[0], a[1]); if (this._postbackPending === true && this._pageRequestManager !== null && this._pageRequestManager.get_isInAsyncPostBack() === false) { this._postbackPending = false; this._doPostback() } }, initialize: function () { Sys.UI._Timer.callBaseMethod(this, "initialize"); this._raiseTickDelegate = Function.createDelegate(this, this._raiseTick); this._endRequestHandlerDelegate = Function.createDelegate(this, this._handleEndRequest); if (Sys.WebForms && Sys.WebForms.PageRequestManager) this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); if (this._pageRequestManager !== null) this._pageRequestManager.add_endRequest(this._endRequestHandlerDelegate); if (this.get_enabled()) this._startTimer() }, _raiseTick: function () { this._startTimer(); if (this._pageRequestManager === null || !this._pageRequestManager.get_isInAsyncPostBack()) { this._doPostback(); this._postbackPending = false } else this._postbackPending = true }, _startTimer: function () { this._timer = window.setTimeout(Function.createDelegate(this, this._raiseTick), this.get_interval()) }, _stopTimer: function () { if (this._timer !== null) { window.clearTimeout(this._timer); this._timer = null } }, _update: function (c, b) { var a = !this.get_enabled(), d = this.get_interval() !== b; if (!a && (!c || d)) { this._stopTimer(); a = true } this.set_enabled(c); this.set_interval(b); if (this.get_enabled() && a) this._startTimer() } }; Sys.UI._Timer.registerClass("Sys.UI._Timer", Sys.UI.Control);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+33 -33
View File
@@ -140,7 +140,7 @@ function Menu_FindPrevious(item) {
function Menu_FindSubMenu(item) {
var tr = item.parentNode.parentNode.parentNode.parentNode.parentNode;
if (!tr.id) {
tr=tr.parentNode;
tr = tr.parentNode;
}
return WebForm_GetElementById(tr.id + "Items");
}
@@ -172,7 +172,7 @@ function Menu_GetData(item) {
try {
item.data = eval(menu.id + "_Data");
}
catch(e) {}
catch (e) { }
}
return item.data;
}
@@ -182,14 +182,14 @@ function Menu_HideItems(items) {
document.body.__oldOnClick = null;
}
Menu_ClearInterval();
if (!items || ((typeof(items.tagName) == "undefined") && (items instanceof Event))) {
if (!items || ((typeof (items.tagName) == "undefined") && (items instanceof Event))) {
items = __rootMenuItem;
}
var table = items;
if ((typeof(table) == "undefined") || (table == null) || !table.tagName || (table.tagName.toLowerCase() != "table")) {
if ((typeof (table) == "undefined") || (table == null) || !table.tagName || (table.tagName.toLowerCase() != "table")) {
table = WebForm_GetElementByTagName(table, "TABLE");
}
if ((typeof(table) == "undefined") || (table == null) || !table.tagName || (table.tagName.toLowerCase() != "table")) {
if ((typeof (table) == "undefined") || (table == null) || !table.tagName || (table.tagName.toLowerCase() != "table")) {
return;
}
var rows = table.rows ? table.rows : table.firstChild.rows;
@@ -202,7 +202,7 @@ function Menu_HideItems(items) {
}
var i, child, nextLevel;
if (isVertical) {
for(i = 0; i < rows.length; i++) {
for (i = 0; i < rows.length; i++) {
if (rows[i].id) {
child = WebForm_GetElementById(rows[i].id + "Items");
if (child) {
@@ -218,7 +218,7 @@ function Menu_HideItems(items) {
}
}
else if (rows[0]) {
for(i = 0; i < rows[0].cells.length; i++) {
for (i = 0; i < rows[0].cells.length; i++) {
if (rows[0].cells[i].id) {
child = WebForm_GetElementById(rows[0].cells[i].id + "Items");
if (child) {
@@ -239,7 +239,7 @@ function Menu_HideItems(items) {
}
function Menu_HoverDisabled(item) {
var node = (item.tagName.toLowerCase() == "td") ?
item:
item :
item.cells[0];
var data = Menu_GetData(item);
if (!data) return;
@@ -247,11 +247,11 @@ function Menu_HoverDisabled(item) {
if (data.disappearAfter >= 200) {
__disappearAfter = data.disappearAfter;
}
Menu_Expand(node, data.horizontalOffset, data.verticalOffset);
Menu_Expand(node, data.horizontalOffset, data.verticalOffset);
}
function Menu_HoverDynamic(item) {
var node = (item.tagName.toLowerCase() == "td") ?
item:
item :
item.cells[0];
var data = Menu_GetData(item);
if (!data) return;
@@ -268,11 +268,11 @@ function Menu_HoverDynamic(item) {
if (data.disappearAfter >= 200) {
__disappearAfter = data.disappearAfter;
}
Menu_Expand(node, data.horizontalOffset, data.verticalOffset);
Menu_Expand(node, data.horizontalOffset, data.verticalOffset);
}
function Menu_HoverRoot(item) {
var node = (item.tagName.toLowerCase() == "td") ?
item:
item :
item.cells[0];
var data = Menu_GetData(item);
if (!data) {
@@ -295,7 +295,7 @@ function Menu_HoverStatic(item) {
var data = Menu_GetData(item);
if (!data) return;
__disappearAfter = data.disappearAfter;
Menu_Expand(node, data.horizontalOffset, data.verticalOffset);
Menu_Expand(node, data.horizontalOffset, data.verticalOffset);
}
function Menu_IsHorizontal(item) {
if (item) {
@@ -320,7 +320,7 @@ function Menu_Key(item) {
item = event.currentTarget;
}
else {
event = window.event;
event = window.event;
}
var key = (event ? event.keyCode : -1);
var data = Menu_GetData(item);
@@ -344,7 +344,7 @@ function Menu_Key(item) {
if ((!horizontal && key == 40) || (horizontal && key == 39)) {
if (horizontal) {
var subMenu = Menu_FindSubMenu(a);
if (subMenu && subMenu.style && subMenu.style.visibility &&
if (subMenu && subMenu.style && subMenu.style.visibility &&
subMenu.style.visibility.toLowerCase() == "hidden") {
Menu_Expand(a, data.horizontalOffset, data.verticalOffset, true);
event.cancelBubble = true;
@@ -449,7 +449,7 @@ function Menu_ResetSiblings(item) {
}
var i, child, childNode;
if (isVertical) {
for(i = 0; i < table.rows.length; i++) {
for (i = 0; i < table.rows.length; i++) {
childNode = table.rows[i];
if (childNode != item) {
child = WebForm_GetElementById(childNode.id + "Items");
@@ -460,7 +460,7 @@ function Menu_ResetSiblings(item) {
}
}
else {
for(i = 0; i < table.rows[0].cells.length; i++) {
for (i = 0; i < table.rows[0].cells.length; i++) {
childNode = table.rows[0].cells[i];
if (childNode != item) {
child = WebForm_GetElementById(childNode.id + "Items");
@@ -483,7 +483,7 @@ function Menu_ResetTopMenus(table, doNotReset, level, up) {
else {
if (level == 0 && table != doNotReset) {
if (table.rows[0].id) {
for(i = 0; i < table.rows.length; i++) {
for (i = 0; i < table.rows.length; i++) {
childNode = table.rows[i];
child = WebForm_GetElementById(childNode.id + "Items");
if (child) {
@@ -492,7 +492,7 @@ function Menu_ResetTopMenus(table, doNotReset, level, up) {
}
}
else {
for(i = 0; i < table.rows[0].cells.length; i++) {
for (i = 0; i < table.rows[0].cells.length; i++) {
childNode = table.rows[0].cells[i];
child = WebForm_GetElementById(childNode.id + "Items");
if (child) {
@@ -530,7 +530,7 @@ function Menu_SetRoot(item) {
}
function Menu_Unhover(item) {
var node = (item.tagName.toLowerCase() == "td") ?
item:
item :
item.cells[0];
var nodeTable = WebForm_GetElementByTagName(node, "table");
if (nodeTable.hoverClass) {
@@ -612,7 +612,7 @@ function PopOut_Position(panel, hideScrollers) {
var relTable = WebForm_GetElementByTagName(rel, "TABLE");
var relCoordinates = WebForm_GetElementPosition(relTable ? relTable : rel);
var panelCoordinates = WebForm_GetElementPosition(panel);
var panelHeight = ((typeof(panel.physicalHeight) != "undefined") && (panel.physicalHeight != null)) ?
var panelHeight = ((typeof (panel.physicalHeight) != "undefined") && (panel.physicalHeight != null)) ?
panel.physicalHeight :
panelCoordinates.height;
panel.physicalHeight = panelHeight;
@@ -628,7 +628,7 @@ function PopOut_Position(panel, hideScrollers) {
var overflowElement = WebForm_GetElementById("__overFlowElement");
if (!overflowElement) {
overflowElement = document.createElement("img");
overflowElement.id="__overFlowElement";
overflowElement.id = "__overFlowElement";
WebForm_SetElementWidth(overflowElement, 1);
document.body.appendChild(overflowElement);
}
@@ -651,15 +651,15 @@ function PopOut_Position(panel, hideScrollers) {
}
var scrollTop = 0;
var scrollLeft = 0;
if (typeof(window.pageYOffset) != "undefined") {
if (typeof (window.pageYOffset) != "undefined") {
scrollTop = window.pageYOffset;
scrollLeft = window.pageXOffset;
}
else if (document.documentElement && (typeof(document.documentElement.scrollTop) != "undefined")) {
else if (document.documentElement && (typeof (document.documentElement.scrollTop) != "undefined")) {
scrollTop = document.documentElement.scrollTop;
scrollLeft = document.documentElement.scrollLeft;
}
else if (document.body && (typeof(document.body.scrollTop) != "undefined")) {
else if (document.body && (typeof (document.body.scrollTop) != "undefined")) {
scrollTop = document.body.scrollTop;
scrollLeft = document.body.scrollLeft;
}
@@ -668,7 +668,7 @@ function PopOut_Position(panel, hideScrollers) {
var bottomWindowBorder = clientHeight + scrollTop;
var rightWindowBorder = clientWidth + scrollLeft;
var position = panel.pos;
if ((typeof(position) == "undefined") || (position == null) || (position == "")) {
if ((typeof (position) == "undefined") || (position == null) || (position == "")) {
position = (WebForm_GetElementDir(rel) == "rtl" ? "middleleft" : "middleright");
}
position = position.toLowerCase();
@@ -682,10 +682,10 @@ function PopOut_Position(panel, hideScrollers) {
var overflow;
if (position.indexOf("top") != -1) {
y -= panelHeight;
WebForm_SetElementY(panel, y);
WebForm_SetElementY(panel, y);
if (y < -panelParentCoordinates.y) {
y = -panelParentCoordinates.y;
WebForm_SetElementY(panel, y);
WebForm_SetElementY(panel, y);
if (panelHeight > clientHeight - 2) {
clip = true;
PopOut_SetPanelHeight(panel, clientHeight - 2);
@@ -695,15 +695,15 @@ function PopOut_Position(panel, hideScrollers) {
else {
if (position.indexOf("bottom") != -1) {
y += relCoordinates.height;
WebForm_SetElementY(panel, y);
WebForm_SetElementY(panel, y);
}
overflow = y + panelParentCoordinates.y + panelHeight - bottomWindowBorder;
if (overflow > 0) {
y -= overflow;
WebForm_SetElementY(panel, y);
WebForm_SetElementY(panel, y);
if (y < -panelParentCoordinates.y) {
y = 2 - panelParentCoordinates.y + scrollTop;
WebForm_SetElementY(panel, y);
WebForm_SetElementY(panel, y);
clip = true;
PopOut_SetPanelHeight(panel, clientHeight - 2);
}
@@ -716,7 +716,7 @@ function PopOut_Position(panel, hideScrollers) {
if (panel.offsetParent) {
panelParentOffsetY = WebForm_GetElementPosition(panel.offsetParent).y;
}
var panelY = ((typeof(panel.originY) != "undefined") && (panel.originY != null)) ?
var panelY = ((typeof (panel.originY) != "undefined") && (panel.originY != null)) ?
panel.originY :
y - panelParentOffsetY;
panel.originY = panelY;
@@ -895,4 +895,4 @@ function PopOut_Up(scroller) {
PopOut_Stop();
__scrollPanel.interval = window.setInterval("PopOut_Up()", 8);
}
}
}
+99 -99
View File
@@ -1,7 +1,7 @@
//CdnPath=http://ajax.aspnetcdn.com/ajax/4.5.1/1/MenuStandards.js
if (!window.Sys) { window.Sys = {}; }
if (!Sys.WebForms) { Sys.WebForms = {}; }
Sys.WebForms.Menu = function(options) {
Sys.WebForms.Menu = function (options) {
this.items = [];
this.depth = options.depth || 1;
this.parentMenuItem = options.parentMenuItem;
@@ -68,7 +68,7 @@ Sys.WebForms.Menu = function(options) {
var count = children.length;
for (var i = 0; i < count; i++) {
var node = children[i];
if (node.nodeType !== 1) {
if (node.nodeType !== 1) {
continue;
}
var topLevelMenuItem = null;
@@ -85,9 +85,9 @@ Sys.WebForms.Menu = function(options) {
}
};
Sys.WebForms.Menu.prototype = {
blur: function() { if (this.container) this.container.blur(); },
collapse: function() {
this.each(function(menuItem) {
blur: function () { if (this.container) this.container.blur(); },
collapse: function () {
this.each(function (menuItem) {
menuItem.hover(false);
menuItem.blur();
var childMenu = menuItem.childMenu;
@@ -97,23 +97,23 @@ Sys.WebForms.Menu.prototype = {
});
this.hide();
},
doDispose: function() { this.each(function(item) { item.doDispose(); }); },
each: function(fn) {
doDispose: function () { this.each(function (item) { item.doDispose(); }); },
each: function (fn) {
var count = this.items.length;
for (var i = 0; i < count; i++) {
fn(this.items[i]);
}
},
firstChild: function() { return this.items[0]; },
focus: function() { if (this.container) this.container.focus(); },
get_displayed: function() { return this.element.style.display !== 'none'; },
get_focused: function() {
firstChild: function () { return this.items[0]; },
focus: function () { if (this.container) this.container.focus(); },
get_displayed: function () { return this.element.style.display !== 'none'; },
get_focused: function () {
if (this.container) {
return this.container.focused;
}
return false;
},
handleKeyPress: function(keyCode) {
handleKeyPress: function (keyCode) {
if (this.keyMap.contains(keyCode)) {
if (this.container.focusedMenuItem) {
this.container.focusedMenuItem.navigate(keyCode);
@@ -125,11 +125,11 @@ Sys.WebForms.Menu.prototype = {
}
}
},
hide: function() {
hide: function () {
if (!this.get_displayed()) {
return;
}
this.each(function(item) {
this.each(function (item) {
if (item.childMenu) {
item.childMenu.hide();
}
@@ -141,15 +141,15 @@ Sys.WebForms.Menu.prototype = {
this.element.style.display = 'none';
}
},
isRoot: function() { return this.rootMenu === this; },
isStatic: function() { return this.displayMode === 'static'; },
lastChild: function() { return this.items[this.items.length - 1]; },
show: function() { this.element.style.display = 'block'; }
isRoot: function () { return this.rootMenu === this; },
isStatic: function () { return this.displayMode === 'static'; },
lastChild: function () { return this.items[this.items.length - 1]; },
show: function () { this.element.style.display = 'block'; }
};
if (Sys.WebForms.Menu.registerClass) {
Sys.WebForms.Menu.registerClass('Sys.WebForms.Menu');
}
Sys.WebForms.MenuItem = function(parentMenu, listElement, topLevelMenuItem) {
Sys.WebForms.MenuItem = function (parentMenu, listElement, topLevelMenuItem) {
this.keyMap = parentMenu.keyMap;
this.parentMenu = parentMenu;
this.container = parentMenu.container;
@@ -189,8 +189,8 @@ Sys.WebForms.MenuItem = function(parentMenu, listElement, topLevelMenuItem) {
}
};
Sys.WebForms.MenuItem.prototype = {
applyUp: function(fn, condition) {
condition = condition || function(menuItem) { return menuItem; };
applyUp: function (fn, condition) {
condition = condition || function (menuItem) { return menuItem; };
var menuItem = this;
var lastMenuItem = null;
while (condition(menuItem)) {
@@ -200,15 +200,15 @@ Sys.WebForms.MenuItem.prototype = {
}
return lastMenuItem;
},
blur: function() { this.setTabIndex(-1); },
doDispose: function() {
blur: function () { this.setTabIndex(-1); },
doDispose: function () {
Sys.WebForms.Menu._domHelper.removeEvent(this.element, 'mouseover', Sys.WebForms.MenuItem._onmouseover);
Sys.WebForms.Menu._domHelper.removeEvent(this.element, 'mouseout', Sys.WebForms.MenuItem._onmouseout);
if (this.childMenu) {
this.childMenu.doDispose();
}
},
focus: function() {
focus: function () {
if (!this.parentMenu.get_displayed()) {
this.parentMenu.show();
}
@@ -216,17 +216,17 @@ Sys.WebForms.MenuItem.prototype = {
this.container.focused = true;
this._anchor.focus();
},
get_highlighted: function() { return /(^|\s)highlighted(\s|$)/.test(this._anchor.className); },
getTabIndex: function() { return this._anchor.tabIndex; },
highlight: function(highlighting) {
get_highlighted: function () { return /(^|\s)highlighted(\s|$)/.test(this._anchor.className); },
getTabIndex: function () { return this._anchor.tabIndex; },
highlight: function (highlighting) {
if (highlighting) {
this.applyUp(function(menuItem) {
this.applyUp(function (menuItem) {
menuItem.parentMenu.parentMenuItem.highlight(true);
},
function(menuItem) {
return !menuItem.parentMenu.isStatic() && menuItem.parentMenu.parentMenuItem;
}
);
function (menuItem) {
return !menuItem.parentMenu.isStatic() && menuItem.parentMenu.parentMenuItem;
}
);
Sys.WebForms.Menu._domHelper.appendCssClass(this._anchor, 'highlighted');
}
else {
@@ -234,7 +234,7 @@ Sys.WebForms.MenuItem.prototype = {
this.setTabIndex(-1);
}
},
hover: function(hovering) {
hover: function (hovering) {
if (hovering) {
var currentHoveredItem = this.container.hoveredMenuItem;
if (currentHoveredItem) {
@@ -244,7 +244,7 @@ Sys.WebForms.MenuItem.prototype = {
if (currentFocusedItem && currentFocusedItem !== this) {
currentFocusedItem.hover(false);
}
this.applyUp(function(menuItem) {
this.applyUp(function (menuItem) {
if (menuItem.childMenu && !menuItem.childMenu.get_displayed()) {
menuItem.childMenu.show();
}
@@ -265,8 +265,8 @@ Sys.WebForms.MenuItem.prototype = {
}
}
},
isSiblingOf: function(menuItem) { return menuItem.parentMenu === this.parentMenu; },
mouseout: function() {
isSiblingOf: function (menuItem) { return menuItem.parentMenu === this.parentMenu; },
mouseout: function () {
var menuItem = this,
id = this.container.pendingMouseoutId,
disappearAfter = this.container.disappearAfter;
@@ -275,10 +275,10 @@ Sys.WebForms.MenuItem.prototype = {
}
if (disappearAfter > -1) {
this.container.pendingMouseoutId =
window.setTimeout(function() { menuItem.hover(false); }, disappearAfter);
window.setTimeout(function () { menuItem.hover(false); }, disappearAfter);
}
},
mouseover: function() {
mouseover: function () {
var id = this.container.pendingMouseoutId;
if (id) {
window.clearTimeout(id);
@@ -289,7 +289,7 @@ Sys.WebForms.MenuItem.prototype = {
this.container.navigateTo(this);
}
},
navigate: function(keyCode) {
navigate: function (keyCode) {
switch (this.keyMap[keyCode]) {
case this.keyMap.next:
this.navigateNext();
@@ -308,7 +308,7 @@ Sys.WebForms.MenuItem.prototype = {
break;
}
},
navigateChild: function() {
navigateChild: function () {
var subMenu = this.childMenu;
if (subMenu) {
var firstChild = subMenu.firstChild();
@@ -330,7 +330,7 @@ Sys.WebForms.MenuItem.prototype = {
}
}
},
navigateNext: function() {
navigateNext: function () {
if (this.childMenu) {
this.childMenu.hide();
}
@@ -348,10 +348,10 @@ Sys.WebForms.MenuItem.prototype = {
this.container.navigateTo(nextMenuItem);
}
},
navigateOut: function() {
navigateOut: function () {
this.parentMenu.blur();
},
navigateParent: function() {
navigateParent: function () {
var parentMenu = this.parentMenu,
horizontal = this.container.orientation === 'horizontal';
if (!parentMenu) return;
@@ -376,7 +376,7 @@ Sys.WebForms.MenuItem.prototype = {
}
}
},
navigatePrevious: function() {
navigatePrevious: function () {
if (this.childMenu) {
this.childMenu.hide();
}
@@ -397,9 +397,9 @@ Sys.WebForms.MenuItem.prototype = {
this.container.navigateTo(previousMenuItem);
}
},
setTabIndex: function(index) { if (this._anchor) this._anchor.tabIndex = index; }
setTabIndex: function (index) { if (this._anchor) this._anchor.tabIndex = index; }
};
Sys.WebForms.MenuItem._onmouseout = function(e) {
Sys.WebForms.MenuItem._onmouseout = function (e) {
var menuItem = Sys.WebForms.Menu._elementObjectMapper.getMappedObject(this);
if (!menuItem) {
return;
@@ -407,7 +407,7 @@ Sys.WebForms.MenuItem._onmouseout = function(e) {
menuItem.mouseout();
Sys.WebForms.Menu._domHelper.cancelEvent(e);
};
Sys.WebForms.MenuItem._onmouseover = function(e) {
Sys.WebForms.MenuItem._onmouseover = function (e) {
var menuItem = Sys.WebForms.Menu._elementObjectMapper.getMappedObject(this);
if (!menuItem) {
return;
@@ -416,7 +416,7 @@ Sys.WebForms.MenuItem._onmouseover = function(e) {
Sys.WebForms.Menu._domHelper.cancelEvent(e);
};
Sys.WebForms.Menu._domHelper = {
addEvent: function(element, eventName, fn, useCapture) {
addEvent: function (element, eventName, fn, useCapture) {
if (element.addEventListener) {
element.addEventListener(eventName, fn, !!useCapture);
}
@@ -424,13 +424,13 @@ Sys.WebForms.Menu._domHelper = {
element['on' + eventName] = fn;
}
},
appendAttributeValue: function(element, name, value) {
appendAttributeValue: function (element, name, value) {
this.updateAttributeValue('append', element, name, value);
},
appendCssClass: function(element, value) {
appendCssClass: function (element, value) {
this.updateClassName('append', element, name, value);
},
appendString: function(getString, setString, value) {
appendString: function (getString, setString, value) {
var currentValue = getString();
if (!currentValue) {
setString(value);
@@ -442,7 +442,7 @@ Sys.WebForms.Menu._domHelper = {
}
setString(currentValue + ' ' + value);
},
cancelEvent: function(e) {
cancelEvent: function (e) {
var event = e || window.event;
if (event) {
event.cancelBubble = true;
@@ -451,19 +451,19 @@ Sys.WebForms.Menu._domHelper = {
}
}
},
contains: function(ancestor, descendant) {
contains: function (ancestor, descendant) {
for (; descendant && (descendant !== ancestor); descendant = descendant.parentNode) { }
return !!descendant;
},
firstChild: function(element) {
firstChild: function (element) {
var child = element.firstChild;
if (child && child.nodeType !== 1) {
if (child && child.nodeType !== 1) {
child = this.nextSibling(child);
}
return child;
},
getElement: function(elementOrId) { return typeof elementOrId === 'string' ? document.getElementById(elementOrId) : elementOrId; },
getElementDirection: function(element) {
getElement: function (elementOrId) { return typeof elementOrId === 'string' ? document.getElementById(elementOrId) : elementOrId; },
getElementDirection: function (element) {
if (element) {
if (element.dir) {
return element.dir;
@@ -472,8 +472,8 @@ Sys.WebForms.Menu._domHelper = {
}
return "ltr";
},
getKeyCode: function(event) { return event.keyCode || event.charCode || 0; },
insertAfter: function(element, elementToInsert) {
getKeyCode: function (event) { return event.keyCode || event.charCode || 0; },
insertAfter: function (element, elementToInsert) {
var next = element.nextSibling;
if (next) {
element.parentNode.insertBefore(elementToInsert, next);
@@ -482,22 +482,22 @@ Sys.WebForms.Menu._domHelper = {
element.parentNode.appendChild(elementToInsert);
}
},
nextSibling: function(element) {
nextSibling: function (element) {
var sibling = element.nextSibling;
while (sibling) {
if (sibling.nodeType === 1) {
if (sibling.nodeType === 1) {
return sibling;
}
sibling = sibling.nextSibling;
}
},
removeAttributeValue: function(element, name, value) {
removeAttributeValue: function (element, name, value) {
this.updateAttributeValue('remove', element, name, value);
},
removeCssClass: function(element, value) {
removeCssClass: function (element, value) {
this.updateClassName('remove', element, name, value);
},
removeEvent: function(element, eventName, fn, useCapture) {
removeEvent: function (element, eventName, fn, useCapture) {
if (element.removeEventListener) {
element.removeEventListener(eventName, fn, !!useCapture);
}
@@ -506,41 +506,41 @@ Sys.WebForms.Menu._domHelper = {
}
element['on' + eventName] = null;
},
removeString: function(getString, setString, valueToRemove) {
removeString: function (getString, setString, valueToRemove) {
var currentValue = getString();
if (currentValue) {
var regex = this._regexes.getRegex('(\\s|\\b)' + valueToRemove + '$|\\b' + valueToRemove + '\\s+');
setString(currentValue.replace(regex, ''));
}
},
setFloat: function(element, direction) {
setFloat: function (element, direction) {
element.style.styleFloat = direction;
element.style.cssFloat = direction;
},
updateAttributeValue: function(operation, element, name, value) {
updateAttributeValue: function (operation, element, name, value) {
this[operation + 'String'](
function() {
return element.getAttribute(name);
},
function(newValue) {
element.setAttribute(name, newValue);
},
value
);
function () {
return element.getAttribute(name);
},
function (newValue) {
element.setAttribute(name, newValue);
},
value
);
},
updateClassName: function(operation, element, name, value) {
updateClassName: function (operation, element, name, value) {
this[operation + 'String'](
function() {
return element.className;
},
function(newValue) {
element.className = newValue;
},
value
);
function () {
return element.className;
},
function (newValue) {
element.className = newValue;
},
value
);
},
_regexes: {
getRegex: function(pattern) {
getRegex: function (pattern) {
var regex = this[pattern];
if (!regex) {
this[pattern] = regex = new RegExp(pattern);
@@ -553,24 +553,24 @@ Sys.WebForms.Menu._elementObjectMapper = {
_computedId: 0,
_mappings: {},
_mappingIdName: 'Sys.WebForms.Menu.Mapping',
getMappedObject: function(element) {
getMappedObject: function (element) {
var id = element[this._mappingIdName];
if (id) {
return this._mappings[this._mappingIdName + ':' + id];
}
},
map: function(element, theObject) {
map: function (element, theObject) {
var mappedObject = element[this._mappingIdName];
if (mappedObject === theObject) {
return;
}
var objectId = element[this._mappingIdName] || element.id || '%' + (++this._computedId);
var objectId = element[this._mappingIdName] || element.id || '%' + (++this._computedId);
element[this._mappingIdName] = objectId;
this._mappings[this._mappingIdName + ':' + objectId] = theObject;
theObject.mappingId = objectId;
}
};
Sys.WebForms.Menu._keyboardMapping = new (function() {
Sys.WebForms.Menu._keyboardMapping = new (function () {
var LEFT_ARROW = 37;
var UP_ARROW = 38;
var RIGHT_ARROW = 39;
@@ -601,11 +601,11 @@ Sys.WebForms.Menu._keyboardMapping = new (function() {
this.horizontalRtl[DOWN_ARROW] = this.horizontalRtl.child;
this.horizontalRtl[UP_ARROW] = this.horizontalRtl.parent;
this.horizontalRtl[TAB] = this.horizontalRtl[ESCAPE] = this.horizontalRtl.tab;
this.horizontal.contains = this.horizontalRtl.contains = this.vertical.contains = this.verticalRtl.contains = function(keycode) {
this.horizontal.contains = this.horizontalRtl.contains = this.vertical.contains = this.verticalRtl.contains = function (keycode) {
return this[keycode] != null;
};
})();
Sys.WebForms._MenuContainer = function(options) {
Sys.WebForms._MenuContainer = function (options) {
this.focused = false;
this.disabled = options.disabled;
this.staticDisplayLevels = options.staticDisplayLevels || 1;
@@ -646,7 +646,7 @@ Sys.WebForms._MenuContainer = function(options) {
Sys.WebForms.Menu._domHelper.addEvent(this.menu.element, 'focus', this._onfocus, true);
Sys.WebForms.Menu._domHelper.addEvent(this.menu.element, 'keydown', this._onkeydown);
var menuContainer = this;
this.element.dispose = function() {
this.element.dispose = function () {
if (menuContainer.element.dispose) {
menuContainer.element.dispose = null;
Sys.WebForms.Menu._domHelper.removeEvent(menuContainer.menu.element, 'focus', menuContainer._onfocus, true);
@@ -654,7 +654,7 @@ Sys.WebForms._MenuContainer = function(options) {
menuContainer.menu.doDispose();
}
};
Sys.WebForms.Menu._domHelper.addEvent(window, 'unload', function() {
Sys.WebForms.Menu._domHelper.addEvent(window, 'unload', function () {
if (menuContainer.element.dispose) {
menuContainer.element.dispose();
}
@@ -662,14 +662,14 @@ Sys.WebForms._MenuContainer = function(options) {
}
};
Sys.WebForms._MenuContainer.prototype = {
blur: function() {
blur: function () {
this.focused = false;
this.isBlurring = false;
this.menu.collapse();
this.focusedMenuItem = null;
},
focus: function(e) { this.focused = true; },
navigateTo: function(menuItem) {
focus: function (e) { this.focused = true; },
navigateTo: function (menuItem) {
if (this.focusedMenuItem && this.focusedMenuItem !== this) {
this.focusedMenuItem.highlight(false);
}
@@ -677,7 +677,7 @@ Sys.WebForms._MenuContainer.prototype = {
menuItem.focus();
this.focusedMenuItem = menuItem;
},
_onfocus: function(e) {
_onfocus: function (e) {
var event = e || window.event;
if (event.srcElement && this) {
if (Sys.WebForms.Menu._domHelper.contains(this.element, event.srcElement)) {
@@ -687,11 +687,11 @@ Sys.WebForms._MenuContainer.prototype = {
}
}
},
_onkeydown: function(e) {
_onkeydown: function (e) {
var thisMenu = Sys.WebForms.Menu._elementObjectMapper.getMappedObject(this);
var keyCode = Sys.WebForms.Menu._domHelper.getKeyCode(e || window.event);
if (thisMenu) {
thisMenu.handleKeyPress(keyCode);
}
}
};
};
+101 -133
View File
@@ -1,59 +1,50 @@
//CdnPath=http://ajax.aspnetcdn.com/ajax/4.5.1/1/SmartNav.js
var snSrc;
if ((typeof(window.__smartNav) == "undefined") || (window.__smartNav == null))
{
if ((typeof (window.__smartNav) == "undefined") || (window.__smartNav == null)) {
window.__smartNav = new Object();
window.__smartNav.update = function()
{
window.__smartNav.update = function () {
var sn = window.__smartNav;
var fd;
document.detachEvent("onstop", sn.stopHif);
sn.inPost = false;
try { fd = frames["__hifSmartNav"].document; } catch (e) {return;}
try { fd = frames["__hifSmartNav"].document; } catch (e) { return; }
var fdr = fd.getElementsByTagName("asp_smartnav_rdir");
if (fdr.length > 0)
{
if ((typeof(sn.sHif) == "undefined") || (sn.sHif == null))
{
if (fdr.length > 0) {
if ((typeof (sn.sHif) == "undefined") || (sn.sHif == null)) {
sn.sHif = document.createElement("IFRAME");
sn.sHif.name = "__hifSmartNav";
sn.sHif.style.display = "none";
sn.sHif.src = snSrc;
}
try {window.location = fdr[0].url;} catch (e) {};
try { window.location = fdr[0].url; } catch (e) { };
return;
}
var fdurl = fd.location.href;
var index = fdurl.indexOf(snSrc);
if ((index != -1 && index == fdurl.length-snSrc.length)
if ((index != -1 && index == fdurl.length - snSrc.length)
|| fdurl == "about:blank")
return;
var fdurlb = fdurl.split("?")[0];
if (document.location.href.indexOf(fdurlb) < 0)
{
document.location.href=fdurl;
return;
}
sn._savedOnLoad = window.onload;
window.onload = null;
window.__smartNav.updateHelper();
}
window.__smartNav.updateHelper = function()
{
if (document.readyState != "complete")
{
window.setTimeout(window.__smartNav.updateHelper, 25);
return;
}
window.__smartNav.loadNewContent();
}
window.__smartNav.loadNewContent = function()
{
var sn = window.__smartNav;
var fd;
try { fd = frames["__hifSmartNav"].document; } catch (e) {return;}
if ((typeof(sn.sHif) != "undefined") && (sn.sHif != null))
{
var fdurlb = fdurl.split("?")[0];
if (document.location.href.indexOf(fdurlb) < 0) {
document.location.href = fdurl;
return;
}
sn._savedOnLoad = window.onload;
window.onload = null;
window.__smartNav.updateHelper();
}
window.__smartNav.updateHelper = function () {
if (document.readyState != "complete") {
window.setTimeout(window.__smartNav.updateHelper, 25);
return;
}
window.__smartNav.loadNewContent();
}
window.__smartNav.loadNewContent = function () {
var sn = window.__smartNav;
var fd;
try { fd = frames["__hifSmartNav"].document; } catch (e) { return; }
if ((typeof (sn.sHif) != "undefined") && (sn.sHif != null)) {
sn.sHif.removeNode(true);
sn.sHif = null;
}
@@ -61,10 +52,8 @@ if ((typeof(window.__smartNav) == "undefined") || (window.__smartNav == null))
var hk = hdm.childNodes;
var tt = null;
var i;
for (i = hk.length - 1; i>= 0; i--)
{
if (hk[i].tagName == "TITLE")
{
for (i = hk.length - 1; i >= 0; i--) {
if (hk[i].tagName == "TITLE") {
tt = hk[i].outerHTML;
continue;
}
@@ -72,124 +61,110 @@ if ((typeof(window.__smartNav) == "undefined") || (window.__smartNav == null))
hdm.removeChild(hdm.childNodes[i]);
}
var kids = fd.getElementsByTagName("head")[0].childNodes;
for (i = 0; i < kids.length; i++)
{
for (i = 0; i < kids.length; i++) {
var tn = kids[i].tagName;
var k = document.createElement(tn);
k.id = kids[i].id;
k.mergeAttributes(kids[i]);
switch(tn)
{
case "TITLE":
if (tt == kids[i].outerHTML)
switch (tn) {
case "TITLE":
if (tt == kids[i].outerHTML)
continue;
k.innerText = kids[i].text;
hdm.insertAdjacentElement("afterbegin", k);
continue;
k.innerText = kids[i].text;
hdm.insertAdjacentElement("afterbegin", k);
continue;
case "BASEFONT" :
if (kids[i].innerHTML.length > 0)
continue;
break;
default:
var o = document.createElement("BODY");
o.innerHTML = "<BODY>" + kids[i].outerHTML + "</BODY>";
k = o.firstChild;
break;
case "BASEFONT":
if (kids[i].innerHTML.length > 0)
continue;
break;
default:
var o = document.createElement("BODY");
o.innerHTML = "<BODY>" + kids[i].outerHTML + "</BODY>";
k = o.firstChild;
break;
}
if((typeof(k) != "undefined") && (k != null))
if ((typeof (k) != "undefined") && (k != null))
hdm.appendChild(k);
}
document.body.clearAttributes();
document.body.id = fd.body.id;
document.body.mergeAttributes(fd.body);
var newBodyLoad = fd.body.onload;
if ((typeof(newBodyLoad) != "undefined") && (newBodyLoad != null))
if ((typeof (newBodyLoad) != "undefined") && (newBodyLoad != null))
document.body.onload = newBodyLoad;
else
document.body.onload = sn._savedOnLoad;
var s = "<BODY>" + fd.body.innerHTML + "</BODY>";
if ((typeof(sn.hif) != "undefined") && (sn.hif != null))
{
if ((typeof (sn.hif) != "undefined") && (sn.hif != null)) {
var hifP = sn.hif.parentElement;
if ((typeof(hifP) != "undefined") && (hifP != null))
sn.sHif=hifP.removeChild(sn.hif);
if ((typeof (hifP) != "undefined") && (hifP != null))
sn.sHif = hifP.removeChild(sn.hif);
}
document.body.innerHTML = s;
var sc = document.scripts;
for (i = 0; i < sc.length; i++)
{
for (i = 0; i < sc.length; i++) {
sc[i].text = sc[i].text;
}
sn.hif = document.all("__hifSmartNav");
if ((typeof(sn.hif) != "undefined") && (sn.hif != null))
{
if ((typeof (sn.hif) != "undefined") && (sn.hif != null)) {
var hif = sn.hif;
sn.hifName = "__hifSmartNav" + (new Date()).getTime();
frames["__hifSmartNav"].name = sn.hifName;
sn.hifDoc = hif.contentWindow.document;
if (sn.ie5)
hif.parentElement.removeChild(hif);
window.setTimeout(sn.restoreFocus,0);
window.setTimeout(sn.restoreFocus, 0);
}
if (typeof(window.onload) == "string")
{
try { eval(window.onload) } catch (e) {};
if (typeof (window.onload) == "string") {
try { eval(window.onload) } catch (e) { };
}
else if ((typeof(window.onload) != "undefined") && (window.onload != null))
{
try { window.onload() } catch (e) {};
else if ((typeof (window.onload) != "undefined") && (window.onload != null)) {
try { window.onload() } catch (e) { };
}
sn._savedOnLoad = null;
sn.attachForm();
};
window.__smartNav.restoreFocus = function()
{
window.__smartNav.restoreFocus = function () {
if (window.__smartNav.inPost == true) return;
var curAe = document.activeElement;
var sAeId = window.__smartNav.ae;
if (((typeof(sAeId) == "undefined") || (sAeId == null)) ||
(typeof(curAe) != "undefined") && (curAe != null) && (curAe.id == sAeId || curAe.name == sAeId))
if (((typeof (sAeId) == "undefined") || (sAeId == null)) ||
(typeof (curAe) != "undefined") && (curAe != null) && (curAe.id == sAeId || curAe.name == sAeId))
return;
var ae = document.all(sAeId);
if ((typeof(ae) == "undefined") || (ae == null)) return;
try { ae.focus(); } catch(e){};
if ((typeof (ae) == "undefined") || (ae == null)) return;
try { ae.focus(); } catch (e) { };
}
window.__smartNav.saveHistory = function()
{
if ((typeof(window.__smartNav.hif) != "undefined") && (window.__smartNav.hif != null))
window.__smartNav.saveHistory = function () {
if ((typeof (window.__smartNav.hif) != "undefined") && (window.__smartNav.hif != null))
window.__smartNav.hif.removeNode();
if ((typeof(window.__smartNav.sHif) != "undefined") && (window.__smartNav.sHif != null)
&& (typeof(document.all[window.__smartNav.siHif]) != "undefined")
if ((typeof (window.__smartNav.sHif) != "undefined") && (window.__smartNav.sHif != null)
&& (typeof (document.all[window.__smartNav.siHif]) != "undefined")
&& (document.all[window.__smartNav.siHif] != null)) {
document.all[window.__smartNav.siHif].insertAdjacentElement(
"BeforeBegin", window.__smartNav.sHif);
"BeforeBegin", window.__smartNav.sHif);
}
}
window.__smartNav.stopHif = function()
{
window.__smartNav.stopHif = function () {
document.detachEvent("onstop", window.__smartNav.stopHif);
var sn = window.__smartNav;
if (((typeof(sn.hifDoc) == "undefined") || (sn.hifDoc == null)) &&
(typeof(sn.hif) != "undefined") && (sn.hif != null))
{
try {sn.hifDoc = sn.hif.contentWindow.document;}
catch(e){sn.hifDoc=null}
if (((typeof (sn.hifDoc) == "undefined") || (sn.hifDoc == null)) &&
(typeof (sn.hif) != "undefined") && (sn.hif != null)) {
try { sn.hifDoc = sn.hif.contentWindow.document; }
catch (e) { sn.hifDoc = null }
}
if (sn.hifDoc != null)
{
try {sn.hifDoc.execCommand("stop");} catch (e){}
if (sn.hifDoc != null) {
try { sn.hifDoc.execCommand("stop"); } catch (e) { }
}
}
window.__smartNav.init = function()
{
window.__smartNav.init = function () {
var sn = window.__smartNav;
window.__smartNav.form.__smartNavPostBack.value = 'true';
document.detachEvent("onstop", sn.stopHif);
document.attachEvent("onstop", sn.stopHif);
try { if (window.event.returnValue == false) return; } catch(e) {}
try { if (window.event.returnValue == false) return; } catch (e) { }
sn.inPost = true;
if ((typeof(document.activeElement) != "undefined") && (document.activeElement != null))
{
if ((typeof (document.activeElement) != "undefined") && (document.activeElement != null)) {
var ae = document.activeElement.id;
if (ae.length == 0)
ae = document.activeElement.name;
@@ -197,48 +172,43 @@ if ((typeof(window.__smartNav) == "undefined") || (window.__smartNav == null))
}
else
sn.ae = null;
try {document.selection.empty();} catch (e) {}
if ((typeof(sn.hif) == "undefined") || (sn.hif == null))
{
try { document.selection.empty(); } catch (e) { }
if ((typeof (sn.hif) == "undefined") || (sn.hif == null)) {
sn.hif = document.all("__hifSmartNav");
sn.hifDoc = sn.hif.contentWindow.document;
}
if ((typeof(sn.hifDoc) != "undefined") && (sn.hifDoc != null))
try {sn.hifDoc.designMode = "On";} catch(e){};
if ((typeof(sn.hif.parentElement) == "undefined") || (sn.hif.parentElement == null))
if ((typeof (sn.hifDoc) != "undefined") && (sn.hifDoc != null))
try { sn.hifDoc.designMode = "On"; } catch (e) { };
if ((typeof (sn.hif.parentElement) == "undefined") || (sn.hif.parentElement == null))
document.body.appendChild(sn.hif);
var hif = sn.hif;
hif.detachEvent("onload", sn.update);
hif.attachEvent("onload", sn.update);
window.__smartNav.fInit = true;
};
window.__smartNav.submit = function()
{
window.__smartNav.submit = function () {
window.__smartNav.fInit = false;
try { window.__smartNav.init(); } catch(e) {}
try { window.__smartNav.init(); } catch (e) { }
if (window.__smartNav.fInit) {
window.__smartNav.form._submit();
}
};
window.__smartNav.attachForm = function()
{
window.__smartNav.attachForm = function () {
var cf = document.forms;
for (var i=0; i<cf.length; i++)
{
if ((typeof(cf[i].__smartNavEnabled) != "undefined") && (cf[i].__smartNavEnabled != null))
{
for (var i = 0; i < cf.length; i++) {
if ((typeof (cf[i].__smartNavEnabled) != "undefined") && (cf[i].__smartNavEnabled != null)) {
window.__smartNav.form = cf[i];
window.__smartNav.form.insertAdjacentHTML("beforeEnd", "<input type='hidden' name='__smartNavPostBack' value='false' />");
break;
}
}
var snfm = window.__smartNav.form;
if ((typeof(snfm) == "undefined") || (snfm == null)) return false;
if ((typeof (snfm) == "undefined") || (snfm == null)) return false;
var sft = snfm.target;
if (sft.length != 0 && sft.indexOf("__hifSmartNav") != 0) return false;
var sfc = snfm.action.split("?")[0];
var url = window.location.href.split("?")[0];
if (url.charAt(url.length-1) != '/' && url.lastIndexOf(sfc) + sfc.length != url.length) return false;
if (url.charAt(url.length - 1) != '/' && url.lastIndexOf(sfc) + sfc.length != url.length) return false;
if (snfm.__formAttached == true) return true;
snfm.__formAttached = true;
snfm.attachEvent("onsubmit", window.__smartNav.init);
@@ -251,24 +221,22 @@ if ((typeof(window.__smartNav) == "undefined") || (window.__smartNav == null))
window.__smartNav.ie5 = navigator.appVersion.indexOf("MSIE 5") > 0;
var rc = window.__smartNav.attachForm();
var hif = document.all("__hifSmartNav");
if ((typeof(snSrc) == "undefined") || (snSrc == null)) {
if (typeof(window.dialogHeight) != "undefined") {
snSrc = "IEsmartnav1";
hif.src = snSrc;
} else {
snSrc = hif.src;
}
if ((typeof (snSrc) == "undefined") || (snSrc == null)) {
if (typeof (window.dialogHeight) != "undefined") {
snSrc = "IEsmartnav1";
hif.src = snSrc;
} else {
snSrc = hif.src;
}
}
if (rc)
{
if (rc) {
var fsn = frames["__hifSmartNav"];
fsn.name = window.__smartNav.hifName;
window.__smartNav.siHif = hif.sourceIndex;
try {
if (fsn.document.location != snSrc)
{
if (fsn.document.location != snSrc) {
fsn.document.designMode = "On";
hif.attachEvent("onload",window.__smartNav.update);
hif.attachEvent("onload", window.__smartNav.update);
window.__smartNav.hif = hif;
}
}
@@ -277,4 +245,4 @@ if ((typeof(window.__smartNav) == "undefined") || (window.__smartNav == null))
}
else
window.__smartNav = null;
}
}
+15 -15
View File
@@ -61,7 +61,7 @@ function TreeView_PopulateNode(data, index, node, selectNode, selectImageNode, l
function TreeView_ProcessNodeData(result, context) {
var treeNode = context.node;
if (result.length > 0) {
var ci = result.indexOf("|", 0);
var ci = result.indexOf("|", 0);
context.data.lastIndex = result.substring(0, ci);
ci = result.indexOf("|", ci + 1);
var newExpandState = result.substring(context.data.lastIndex.length + 1, ci);
@@ -73,7 +73,7 @@ function TreeView_ProcessNodeData(result, context) {
newDiv.innerHTML = chunk;
table = WebForm_GetParentByTagName(treeNode, "TABLE");
newChildren = null;
if ((typeof(table.nextSibling) == "undefined") || (table.nextSibling == null)) {
if ((typeof (table.nextSibling) == "undefined") || (table.nextSibling == null)) {
table.parentNode.insertBefore(newDiv.firstChild, table.nextSibling);
newChildren = table.previousSibling;
}
@@ -89,16 +89,16 @@ function TreeView_ProcessNodeData(result, context) {
table.insertAdjacentHTML("afterEnd", chunk);
newChildren = document.all[treeNode.id + "Nodes"];
}
if ((typeof(newChildren) != "undefined") && (newChildren != null)) {
if ((typeof (newChildren) != "undefined") && (newChildren != null)) {
TreeView_ToggleNode(context.data, context.index, treeNode, context.lineType, newChildren);
treeNode.href = document.getElementById ?
"javascript:TreeView_ToggleNode(" + context.data.name + "," + context.index + ",document.getElementById('" + treeNode.id + "'),'" + context.lineType + "',document.getElementById('" + newChildren.id + "'))" :
"javascript:TreeView_ToggleNode(" + context.data.name + "," + context.index + "," + treeNode.id + ",'" + context.lineType + "'," + newChildren.id + ")";
if ((typeof(context.selectNode) != "undefined") && (context.selectNode != null) && context.selectNode.href &&
if ((typeof (context.selectNode) != "undefined") && (context.selectNode != null) && context.selectNode.href &&
(context.selectNode.href.indexOf("javascript:TreeView_PopulateNode", 0) == 0)) {
context.selectNode.href = treeNode.href;
}
if ((typeof(context.selectImageNode) != "undefined") && (context.selectImageNode != null) && context.selectNode.href &&
if ((typeof (context.selectImageNode) != "undefined") && (context.selectImageNode != null) && context.selectNode.href &&
(context.selectImageNode.href.indexOf("javascript:TreeView_PopulateNode", 0) == 0)) {
context.selectImageNode.href = treeNode.href;
}
@@ -107,7 +107,7 @@ function TreeView_ProcessNodeData(result, context) {
}
else {
var img = treeNode.childNodes ? treeNode.childNodes[0] : treeNode.children[0];
if ((typeof(img) != "undefined") && (img != null)) {
if ((typeof (img) != "undefined") && (img != null)) {
var lineType = context.lineType;
if (lineType == "l") {
img.src = context.data.images[13];
@@ -129,8 +129,8 @@ function TreeView_ProcessNodeData(result, context) {
}
else {
pe = treeNode.parentElement;
treeNode.style.visibility="hidden";
treeNode.style.display="none";
treeNode.style.visibility = "hidden";
treeNode.style.display = "none";
pe.insertAdjacentElement("afterBegin", img);
}
}
@@ -140,11 +140,11 @@ function TreeView_SelectNode(data, node, nodeId) {
if (!data) {
return;
}
if ((typeof(data.selectedClass) != "undefined") && (data.selectedClass != null)) {
if ((typeof (data.selectedClass) != "undefined") && (data.selectedClass != null)) {
var id = data.selectedNodeID.value;
if (id.length > 0) {
var selectedNode = document.getElementById(id);
if ((typeof(selectedNode) != "undefined") && (selectedNode != null)) {
if ((typeof (selectedNode) != "undefined") && (selectedNode != null)) {
WebForm_RemoveClassName(selectedNode, data.selectedHyperLinkClass);
selectedNode = WebForm_GetParentByTagName(selectedNode, "TD");
WebForm_RemoveClassName(selectedNode, data.selectedClass);
@@ -166,7 +166,7 @@ function TreeView_ToggleNode(data, index, node, lineType, children) {
if (children.style.display == "none") {
children.style.display = "block";
newExpandState = "e";
if ((typeof(img) != "undefined") && (img != null)) {
if ((typeof (img) != "undefined") && (img != null)) {
if (lineType == "l") {
img.src = data.images[15];
}
@@ -185,7 +185,7 @@ function TreeView_ToggleNode(data, index, node, lineType, children) {
else {
children.style.display = "none";
newExpandState = "c";
if ((typeof(img) != "undefined") && (img != null)) {
if ((typeof (img) != "undefined") && (img != null)) {
if (lineType == "l") {
img.src = data.images[14];
}
@@ -202,8 +202,8 @@ function TreeView_ToggleNode(data, index, node, lineType, children) {
}
}
}
catch(e) {}
data.expandState.value = data.expandState.value.substring(0, index) + newExpandState + data.expandState.value.slice(index + 1);
catch (e) { }
data.expandState.value = data.expandState.value.substring(0, index) + newExpandState + data.expandState.value.slice(index + 1);
}
function TreeView_UnhoverNode(node) {
if (!node.hoverClass) {
@@ -217,4 +217,4 @@ function TreeView_UnhoverNode(node) {
node = node.children[node.children.length - 1];
}
WebForm_RemoveClassName(node, node.hoverHyperLinkClass);
}
}
+33 -33
View File
@@ -11,27 +11,27 @@ function WebForm_PostBackOptions(eventTarget, eventArgument, validation, validat
function WebForm_DoPostBackWithOptions(options) {
var validationResult = true;
if (options.validation) {
if (typeof(Page_ClientValidate) == 'function') {
if (typeof (Page_ClientValidate) == 'function') {
validationResult = Page_ClientValidate(options.validationGroup);
}
}
if (validationResult) {
if ((typeof(options.actionUrl) != "undefined") && (options.actionUrl != null) && (options.actionUrl.length > 0)) {
if ((typeof (options.actionUrl) != "undefined") && (options.actionUrl != null) && (options.actionUrl.length > 0)) {
theForm.action = options.actionUrl;
}
if (options.trackFocus) {
var lastFocus = theForm.elements["__LASTFOCUS"];
if ((typeof(lastFocus) != "undefined") && (lastFocus != null)) {
if (typeof(document.activeElement) == "undefined") {
if ((typeof (lastFocus) != "undefined") && (lastFocus != null)) {
if (typeof (document.activeElement) == "undefined") {
lastFocus.value = options.eventTarget;
}
else {
var active = document.activeElement;
if ((typeof(active) != "undefined") && (active != null)) {
if ((typeof(active.id) != "undefined") && (active.id != null) && (active.id.length > 0)) {
if ((typeof (active) != "undefined") && (active != null)) {
if ((typeof (active.id) != "undefined") && (active.id != null) && (active.id.length > 0)) {
lastFocus.value = active.id;
}
else if (typeof(active.name) != "undefined") {
else if (typeof (active.name) != "undefined") {
lastFocus.value = active.name;
}
}
@@ -47,27 +47,27 @@ var __pendingCallbacks = new Array();
var __synchronousCallBackIndex = -1;
function WebForm_DoCallback(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync) {
var postData = __theFormPostData +
"__CALLBACKID=" + WebForm_EncodeCallback(eventTarget) +
"&__CALLBACKPARAM=" + WebForm_EncodeCallback(eventArgument);
"__CALLBACKID=" + WebForm_EncodeCallback(eventTarget) +
"&__CALLBACKPARAM=" + WebForm_EncodeCallback(eventArgument);
if (theForm["__EVENTVALIDATION"]) {
postData += "&__EVENTVALIDATION=" + WebForm_EncodeCallback(theForm["__EVENTVALIDATION"].value);
}
var xmlRequest,e;
var xmlRequest, e;
try {
xmlRequest = new XMLHttpRequest();
}
catch(e) {
catch (e) {
try {
xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e) {
catch (e) {
}
}
var setRequestHeaderMethodExists = true;
try {
setRequestHeaderMethodExists = (xmlRequest && xmlRequest.setRequestHeader);
}
catch(e) {}
catch (e) { }
var callback = new Object();
callback.eventCallback = eventCallback;
callback.context = context;
@@ -123,10 +123,10 @@ function WebForm_DoCallback(eventTarget, eventArgument, eventCallback, context,
xmlRequestFrame.src = callBackFrameUrl;
}
}
catch(e) {}
catch (e) { }
document.body.appendChild(xmlRequestFrame);
}
var interval = window.setInterval(function() {
var interval = window.setInterval(function () {
xmlRequestFrame = document.frames[callbackFrameID];
if (xmlRequestFrame && xmlRequestFrame.document) {
window.clearInterval(interval);
@@ -193,12 +193,12 @@ function WebForm_CallbackComplete() {
function WebForm_ExecuteCallback(callbackObject) {
var response = callbackObject.xmlRequest.responseText;
if (response.charAt(0) == "s") {
if ((typeof(callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) {
if ((typeof (callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) {
callbackObject.eventCallback(response.substring(1), callbackObject.context);
}
}
else if (response.charAt(0) == "e") {
if ((typeof(callbackObject.errorCallback) != "undefined") && (callbackObject.errorCallback != null)) {
if ((typeof (callbackObject.errorCallback) != "undefined") && (callbackObject.errorCallback != null)) {
callbackObject.errorCallback(response.substring(1), callbackObject.context);
}
}
@@ -218,7 +218,7 @@ function WebForm_ExecuteCallback(callbackObject) {
}
validationFieldElement.value = validationField;
}
if ((typeof(callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) {
if ((typeof (callbackObject.eventCallback) != "undefined") && (callbackObject.eventCallback != null)) {
callbackObject.eventCallback(response.substring(separatorIndex + validationFieldLength + 1), callbackObject.context);
}
}
@@ -282,7 +282,7 @@ function WebForm_EncodeCallback(parameter) {
}
var __disabledControlArray = new Array();
function WebForm_ReEnableControls() {
if (typeof(__enabledControlArray) == 'undefined') {
if (typeof (__enabledControlArray) == 'undefined') {
return false;
}
var disabledIndex = 0;
@@ -294,7 +294,7 @@ function WebForm_ReEnableControls() {
else {
c = document.all[__enabledControlArray[i]];
}
if ((typeof(c) != "undefined") && (c != null) && (c.disabled == true)) {
if ((typeof (c) != "undefined") && (c != null) && (c.disabled == true)) {
c.disabled = false;
__disabledControlArray[disabledIndex++] = c;
}
@@ -312,7 +312,7 @@ function WebForm_SimulateClick(element, event) {
if (element) {
if (element.click) {
element.click();
} else {
} else {
clickEvent = document.createEvent("MouseEvents");
clickEvent.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
if (!element.dispatchEvent(clickEvent)) {
@@ -332,9 +332,9 @@ function WebForm_FireDefaultButton(event, target) {
var src = event.srcElement || event.target;
if (src &&
((src.tagName.toLowerCase() == "input") &&
(src.type.toLowerCase() == "submit" || src.type.toLowerCase() == "button")) ||
(src.type.toLowerCase() == "submit" || src.type.toLowerCase() == "button")) ||
((src.tagName.toLowerCase() == "a") &&
(src.href != null) && (src.href != "")) ||
(src.href != null) && (src.href != "")) ||
(src.tagName.toLowerCase() == "textarea")) {
return true;
}
@@ -347,7 +347,7 @@ function WebForm_FireDefaultButton(event, target) {
}
if (defaultButton) {
return WebForm_SimulateClick(defaultButton, event);
}
}
}
return true;
}
@@ -388,7 +388,7 @@ function WebForm_SaveScrollPositionSubmit() {
theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX();
theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY();
}
if ((typeof(this.oldSubmit) != "undefined") && (this.oldSubmit != null)) {
if ((typeof (this.oldSubmit) != "undefined") && (this.oldSubmit != null)) {
return this.oldSubmit();
}
return true;
@@ -396,7 +396,7 @@ function WebForm_SaveScrollPositionSubmit() {
function WebForm_SaveScrollPositionOnSubmit() {
theForm.__SCROLLPOSITIONX.value = WebForm_GetScrollX();
theForm.__SCROLLPOSITIONY.value = WebForm_GetScrollY();
if ((typeof(this.oldOnSubmit) != "undefined") && (this.oldOnSubmit != null)) {
if ((typeof (this.oldOnSubmit) != "undefined") && (this.oldOnSubmit != null)) {
return this.oldOnSubmit();
}
return true;
@@ -408,7 +408,7 @@ function WebForm_RestoreScrollPosition() {
else {
window.scrollTo(theForm.__SCROLLPOSITIONX.value, theForm.__SCROLLPOSITIONY.value);
}
if ((typeof(theForm.oldOnLoad) != "undefined") && (theForm.oldOnLoad != null)) {
if ((typeof (theForm.oldOnLoad) != "undefined") && (theForm.oldOnLoad != null)) {
return theForm.oldOnLoad();
}
return true;
@@ -422,8 +422,8 @@ function WebForm_TextBoxKeyHandler(event) {
else {
target = event.srcElement;
}
if ((typeof(target) != "undefined") && (target != null)) {
if (typeof(target.onchange) != "undefined") {
if ((typeof (target) != "undefined") && (target != null)) {
if (typeof (target.onchange) != "undefined") {
target.onchange();
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
@@ -504,10 +504,10 @@ function WebForm_GetElementPosition(element) {
result.y += parent.offsetTop;
var parentTagName = parent.tagName.toLowerCase();
if (parentTagName != "table" &&
parentTagName != "body" &&
parentTagName != "html" &&
parentTagName != "div" &&
parent.clientTop &&
parentTagName != "body" &&
parentTagName != "html" &&
parentTagName != "div" &&
parent.clientTop &&
parent.clientLeft) {
result.x += parent.clientLeft;
result.y += parent.clientTop;
+48 -48
View File
@@ -5,7 +5,7 @@ function Point(x, y) {
this.y = y;
}
function __wpTranslateOffset(x, y, offsetElement, relativeToElement, includeScroll) {
while ((typeof(offsetElement) != "undefined") && (offsetElement != null) && (offsetElement != relativeToElement)) {
while ((typeof (offsetElement) != "undefined") && (offsetElement != null) && (offsetElement != relativeToElement)) {
x += offsetElement.offsetLeft;
y += offsetElement.offsetTop;
var tagName = offsetElement.tagName;
@@ -22,7 +22,7 @@ function __wpTranslateOffset(x, y, offsetElement, relativeToElement, includeScro
return new Point(x, y);
}
function __wpGetPageEventLocation(event, includeScroll) {
if ((typeof(event) == "undefined") || (event == null)) {
if ((typeof (event) == "undefined") || (event == null)) {
event = window.event;
}
return __wpTranslateOffset(event.offsetX, event.offsetY, event.srcElement, null, includeScroll);
@@ -35,10 +35,10 @@ function WebPart(webPartElement, webPartTitleElement, zone, zoneIndex, allowZone
this.allowZoneChange = allowZoneChange;
this.zone = zone;
this.zoneIndex = zoneIndex;
this.title = ((typeof(webPartTitleElement) != "undefined") && (webPartTitleElement != null)) ?
this.title = ((typeof (webPartTitleElement) != "undefined") && (webPartTitleElement != null)) ?
webPartTitleElement.innerText : "";
webPartElement.__webPart = this;
if ((typeof(webPartTitleElement) != "undefined") && (webPartTitleElement != null)) {
if ((typeof (webPartTitleElement) != "undefined") && (webPartTitleElement != null)) {
webPartTitleElement.style.cursor = "move";
webPartTitleElement.attachEvent("onmousedown", WebPart_OnMouseDown);
webPartElement.attachEvent("ondragstart", WebPart_OnDragStart);
@@ -49,12 +49,12 @@ function WebPart(webPartElement, webPartTitleElement, zone, zoneIndex, allowZone
this.Dispose = WebPart_Dispose;
}
function WebPart_Dispose() {
this.webPartElement.__webPart = null
this.webPartElement.__webPart = null
}
function WebPart_OnMouseDown() {
var currentEvent = window.event;
var draggedWebPart = WebPart_GetParentWebPartElement(currentEvent.srcElement);
if ((typeof(draggedWebPart) == "undefined") || (draggedWebPart == null)) {
if ((typeof (draggedWebPart) == "undefined") || (draggedWebPart == null)) {
return;
}
document.selection.empty();
@@ -72,7 +72,7 @@ function WebPart_OnMouseDown() {
function WebPart_OnDragStart() {
var currentEvent = window.event;
var webPartElement = currentEvent.srcElement;
if ((typeof(webPartElement.__webPart) == "undefined") || (webPartElement.__webPart == null)) {
if ((typeof (webPartElement.__webPart) == "undefined") || (webPartElement.__webPart == null)) {
currentEvent.returnValue = false;
currentEvent.cancelBubble = true;
return;
@@ -88,9 +88,9 @@ function WebPart_OnDragEnd() {
}
function WebPart_GetParentWebPartElement(containedElement) {
var elem = containedElement;
while ((typeof(elem.__webPart) == "undefined") || (elem.__webPart == null)) {
while ((typeof (elem.__webPart) == "undefined") || (elem.__webPart == null)) {
elem = elem.parentElement;
if ((typeof(elem) == "undefined") || (elem == null)) {
if ((typeof (elem) == "undefined") || (elem == null)) {
break;
}
}
@@ -181,9 +181,9 @@ function Zone_OnDrop() {
}
function Zone_GetParentZoneElement(containedElement) {
var elem = containedElement;
while ((typeof(elem.__zone) == "undefined") || (elem.__zone == null)) {
while ((typeof (elem.__zone) == "undefined") || (elem.__zone == null)) {
elem = elem.parentElement;
if ((typeof(elem) == "undefined") || (elem == null)) {
if ((typeof (elem) == "undefined") || (elem == null)) {
break;
}
}
@@ -279,7 +279,7 @@ function WebPartMenu(menuLabelElement, menuDropDownElement, menuElement) {
this.menuLabelElement.attachEvent('onkeypress', WebPartMenu_OnKeyPress);
this.menuLabelElement.attachEvent('onmouseenter', WebPartMenu_OnMouseEnter);
this.menuLabelElement.attachEvent('onmouseleave', WebPartMenu_OnMouseLeave);
if ((typeof(this.menuDropDownElement) != "undefined") && (this.menuDropDownElement != null)) {
if ((typeof (this.menuDropDownElement) != "undefined") && (this.menuDropDownElement != null)) {
this.menuDropDownElement.__menu = this;
}
this.menuItemStyle = "";
@@ -296,7 +296,7 @@ function WebPartMenu(menuLabelElement, menuDropDownElement, menuElement) {
this.Unhover = WebPartMenu_Unhover;
this.Dispose = WebPartMenu_Dispose;
var menu = this;
this.disposeDelegate = function() { menu.Dispose(); };
this.disposeDelegate = function () { menu.Dispose(); };
window.attachEvent('onunload', this.disposeDelegate);
}
function WebPartMenu_Dispose() {
@@ -305,7 +305,7 @@ function WebPartMenu_Dispose() {
window.detachEvent('onunload', this.disposeDelegate);
}
function WebPartMenu_Show() {
if ((typeof(__wpm.menu) != "undefined") && (__wpm.menu != null)) {
if ((typeof (__wpm.menu) != "undefined") && (__wpm.menu != null)) {
__wpm.menu.Hide();
}
var menuHTML =
@@ -341,7 +341,7 @@ function WebPartMenu_Show() {
function WebPartMenu_Hide() {
if (__wpm.menu == this) {
__wpm.menu = null;
if ((typeof(this.popup) != "undefined") && (this.popup != null)) {
if ((typeof (this.popup) != "undefined") && (this.popup != null)) {
this.popup.hide();
this.popup = null;
}
@@ -366,7 +366,7 @@ function WebPartMenu_Unhover() {
}
function WebPartMenu_OnClick() {
var menu = window.event.srcElement.__menu;
if ((typeof(menu) != "undefined") && (menu != null)) {
if ((typeof (menu) != "undefined") && (menu != null)) {
window.event.returnValue = false;
window.event.cancelBubble = true;
menu.Show();
@@ -375,7 +375,7 @@ function WebPartMenu_OnClick() {
function WebPartMenu_OnKeyPress() {
if (window.event.keyCode == 13) {
var menu = window.event.srcElement.__menu;
if ((typeof(menu) != "undefined") && (menu != null)) {
if ((typeof (menu) != "undefined") && (menu != null)) {
window.event.returnValue = false;
window.event.cancelBubble = true;
menu.Show();
@@ -384,13 +384,13 @@ function WebPartMenu_OnKeyPress() {
}
function WebPartMenu_OnMouseEnter() {
var menu = window.event.srcElement.__menu;
if ((typeof(menu) != "undefined") && (menu != null)) {
if ((typeof (menu) != "undefined") && (menu != null)) {
menu.Hover();
}
}
function WebPartMenu_OnMouseLeave() {
var menu = window.event.srcElement.__menu;
if ((typeof(menu) != "undefined") && (menu != null)) {
if ((typeof (menu) != "undefined") && (menu != null)) {
menu.Unhover();
}
}
@@ -429,10 +429,10 @@ function WebPartManager_AddZone(zoneElement, uniqueID, isVertical, allowLayoutCh
return zone;
}
function WebPartManager_IsDragDropEnabled() {
return ((typeof(this.overlayContainerElement) != "undefined") && (this.overlayContainerElement != null));
return ((typeof (this.overlayContainerElement) != "undefined") && (this.overlayContainerElement != null));
}
function WebPartManager_DragDrop() {
if ((typeof(this.draggedWebPart) != "undefined") && (this.draggedWebPart != null)) {
if ((typeof (this.draggedWebPart) != "undefined") && (this.draggedWebPart != null)) {
var tempWebPart = this.draggedWebPart;
this.draggedWebPart = null;
tempWebPart.dragDrop();
@@ -468,7 +468,7 @@ function WebPartManager_InitiateWebPartDragDrop(webPartElement) {
function WebPartManager_CompleteWebPartDragDrop() {
var dragState = this.dragState;
this.dragState = null;
if ((typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
if ((typeof (dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
dragState.dropZoneElement.__zone.ToggleDropCues(false, dragState.dropIndex, false);
}
document.body.detachEvent("ondragover", Zone_OnDragOver);
@@ -477,12 +477,12 @@ function WebPartManager_CompleteWebPartDragDrop() {
}
this.overlayContainerElement.removeChild(this.overlayContainerElement.firstChild);
this.overlayContainerElement.style.display = "none";
if ((typeof(dragState) != "undefined") && (dragState != null) && (dragState.dropped == true)) {
if ((typeof (dragState) != "undefined") && (dragState != null) && (dragState.dropped == true)) {
var currentZone = dragState.webPartElement.__webPart.zone;
var currentZoneIndex = dragState.webPartElement.__webPart.zoneIndex;
if ((currentZone != dragState.dropZoneElement.__zone) ||
((currentZoneIndex != dragState.dropIndex) &&
(currentZoneIndex != (dragState.dropIndex - 1)))) {
(currentZoneIndex != (dragState.dropIndex - 1)))) {
var eventTarget = dragState.dropZoneElement.__zone.uniqueID;
var eventArgument = "Drag:" + dragState.webPartElement.id + ":" + dragState.dropIndex;
this.SubmitPage(eventTarget, eventArgument);
@@ -491,7 +491,7 @@ function WebPartManager_CompleteWebPartDragDrop() {
}
function WebPartManager_ContinueWebPartDragDrop() {
var dragState = this.dragState;
if ((typeof(dragState) != "undefined") && (dragState != null)) {
if ((typeof (dragState) != "undefined") && (dragState != null)) {
var style = this.overlayContainerElement.style;
var location = __wpGetPageEventLocation(window.event, true);
style.left = location.x - dragState.webPartElement.offsetWidth / 2;
@@ -507,27 +507,27 @@ function WebPartManager_Execute(script) {
}
function WebPartManager_ProcessWebPartDragEnter() {
var dragState = __wpm.dragState;
if ((typeof(dragState) != "undefined") && (dragState != null)) {
if ((typeof (dragState) != "undefined") && (dragState != null)) {
var currentEvent = window.event;
var newDropZoneElement = Zone_GetParentZoneElement(currentEvent.srcElement);
if ((typeof(newDropZoneElement.__zone) == "undefined") || (newDropZoneElement.__zone == null) ||
if ((typeof (newDropZoneElement.__zone) == "undefined") || (newDropZoneElement.__zone == null) ||
(newDropZoneElement.__zone.allowDrop == false)) {
newDropZoneElement = null;
}
var newDropIndex = -1;
if ((typeof(newDropZoneElement) != "undefined") && (newDropZoneElement != null)) {
if ((typeof (newDropZoneElement) != "undefined") && (newDropZoneElement != null)) {
newDropIndex = newDropZoneElement.__zone.GetWebPartIndex(__wpGetPageEventLocation(currentEvent, false));
if (newDropIndex == -1) {
newDropZoneElement = null;
}
}
if (dragState.dropZoneElement != newDropZoneElement) {
if ((typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
if ((typeof (dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
dragState.dropZoneElement.__zone.ToggleDropCues(false, dragState.dropIndex, false);
}
dragState.dropZoneElement = newDropZoneElement;
dragState.dropIndex = newDropIndex;
if ((typeof(newDropZoneElement) != "undefined") && (newDropZoneElement != null)) {
if ((typeof (newDropZoneElement) != "undefined") && (newDropZoneElement != null)) {
newDropZoneElement.__zone.ToggleDropCues(true, newDropIndex, false);
}
}
@@ -536,11 +536,11 @@ function WebPartManager_ProcessWebPartDragEnter() {
dragState.dropZoneElement.__zone.ToggleDropCues(false, dragState.dropIndex, false);
}
dragState.dropIndex = newDropIndex;
if ((typeof(newDropZoneElement) != "undefined") && (newDropZoneElement != null)) {
if ((typeof (newDropZoneElement) != "undefined") && (newDropZoneElement != null)) {
newDropZoneElement.__zone.ToggleDropCues(true, newDropIndex, false);
}
}
if ((typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
if ((typeof (dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
currentEvent.dataTransfer.effectAllowed = dragState.effect;
}
return true;
@@ -551,26 +551,26 @@ function WebPartManager_ProcessWebPartDragOver() {
var dragState = __wpm.dragState;
var currentEvent = window.event;
var handled = false;
if ((typeof(dragState) != "undefined") && (dragState != null) &&
(typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
if ((typeof (dragState) != "undefined") && (dragState != null) &&
(typeof (dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
var dropZoneElement = Zone_GetParentZoneElement(currentEvent.srcElement);
if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null) && (dropZoneElement.__zone.allowDrop == false)) {
if ((typeof (dropZoneElement) != "undefined") && (dropZoneElement != null) && (dropZoneElement.__zone.allowDrop == false)) {
dropZoneElement = null;
}
if (((typeof(dropZoneElement) == "undefined") || (dropZoneElement == null)) &&
(typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
if (((typeof (dropZoneElement) == "undefined") || (dropZoneElement == null)) &&
(typeof (dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) {
dragState.dropZoneElement.__zone.ToggleDropCues(false, __wpm.dragState.dropIndex, false);
dragState.dropZoneElement = null;
dragState.dropIndex = -1;
}
else if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null)) {
else if ((typeof (dropZoneElement) != "undefined") && (dropZoneElement != null)) {
var location = __wpGetPageEventLocation(currentEvent, false);
var newDropIndex = dropZoneElement.__zone.GetWebPartIndex(location);
if (newDropIndex == -1) {
dropZoneElement = null;
}
if (dragState.dropZoneElement != dropZoneElement) {
if ((dragState.dropIndex != -1) || (typeof(dropZoneElement) == "undefined") || (dropZoneElement == null)) {
if ((dragState.dropIndex != -1) || (typeof (dropZoneElement) == "undefined") || (dropZoneElement == null)) {
dragState.dropZoneElement.__zone.ToggleDropCues(false, __wpm.dragState.dropIndex, false);
}
dragState.dropZoneElement = dropZoneElement;
@@ -579,27 +579,27 @@ function WebPartManager_ProcessWebPartDragOver() {
dragState.dropZoneElement.__zone.ToggleDropCues(false, dragState.dropIndex, true);
}
dragState.dropIndex = newDropIndex;
if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null)) {
if ((typeof (dropZoneElement) != "undefined") && (dropZoneElement != null)) {
dropZoneElement.__zone.ToggleDropCues(true, newDropIndex, false);
}
}
handled = true;
}
if ((typeof(dragState) == "undefined") || (dragState == null) ||
(typeof(dragState.dropZoneElement) == "undefined") || (dragState.dropZoneElement == null)) {
if ((typeof (dragState) == "undefined") || (dragState == null) ||
(typeof (dragState.dropZoneElement) == "undefined") || (dragState.dropZoneElement == null)) {
currentEvent.dataTransfer.effectAllowed = "none";
}
return handled;
}
function WebPartManager_ProcessWebPartDrop() {
var dragState = this.dragState;
if ((typeof(dragState) != "undefined") && (dragState != null)) {
if ((typeof (dragState) != "undefined") && (dragState != null)) {
var currentEvent = window.event;
var dropZoneElement = Zone_GetParentZoneElement(currentEvent.srcElement);
if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null) && (dropZoneElement.__zone.allowDrop == false)) {
if ((typeof (dropZoneElement) != "undefined") && (dropZoneElement != null) && (dropZoneElement.__zone.allowDrop == false)) {
dropZoneElement = null;
}
if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null) && (dragState.dropZoneElement == dropZoneElement)) {
if ((typeof (dropZoneElement) != "undefined") && (dropZoneElement != null) && (dragState.dropZoneElement == dropZoneElement)) {
dragState.dropped = true;
}
return true;
@@ -607,7 +607,7 @@ function WebPartManager_ProcessWebPartDrop() {
return false;
}
function WebPartManager_ShowHelp(helpUrl, helpMode) {
if ((typeof(this.menu) != "undefined") && (this.menu != null)) {
if ((typeof (this.menu) != "undefined") && (this.menu != null)) {
this.menu.Hide();
}
if (helpMode == 0 || helpMode == 1) {
@@ -640,8 +640,8 @@ function WebPartManager_UpdatePositions() {
}
}
function WebPartManager_SubmitPage(eventTarget, eventArgument) {
if ((typeof(this.menu) != "undefined") && (this.menu != null)) {
if ((typeof (this.menu) != "undefined") && (this.menu != null)) {
this.menu.Hide();
}
__doPostBack(eventTarget, eventArgument);
}
}
+79 -80
View File
@@ -5,7 +5,7 @@ var Page_BlockSubmit = false;
var Page_InvalidControlToBeFocused = null;
var Page_TextTypes = /^(text|password|file|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i;
function ValidatorUpdateDisplay(val) {
if (typeof(val.display) == "string") {
if (typeof (val.display) == "string") {
if (val.display == "None") {
return;
}
@@ -24,7 +24,7 @@ function ValidatorUpdateIsValid() {
Page_IsValid = AllValidatorsValid(Page_Validators);
}
function AllValidatorsValid(validators) {
if ((typeof(validators) != "undefined") && (validators != null)) {
if ((typeof (validators) != "undefined") && (validators != null)) {
var i;
for (i = 0; i < validators.length; i++) {
if (!validators[i].isvalid) {
@@ -35,11 +35,11 @@ function AllValidatorsValid(validators) {
return true;
}
function ValidatorHookupControlID(controlID, val) {
if (typeof(controlID) != "string") {
if (typeof (controlID) != "string") {
return;
}
var ctrl = document.getElementById(controlID);
if ((typeof(ctrl) != "undefined") && (ctrl != null)) {
if ((typeof (ctrl) != "undefined") && (ctrl != null)) {
ValidatorHookupControl(ctrl, val);
}
else {
@@ -48,8 +48,8 @@ function ValidatorHookupControlID(controlID, val) {
}
}
function ValidatorHookupControl(control, val) {
if (typeof(control.tagName) != "string") {
return;
if (typeof (control.tagName) != "string") {
return;
}
if (control.tagName != "INPUT" && control.tagName != "TEXTAREA" && control.tagName != "SELECT") {
var i;
@@ -59,20 +59,20 @@ function ValidatorHookupControl(control, val) {
return;
}
else {
if (typeof(control.Validators) == "undefined") {
if (typeof (control.Validators) == "undefined") {
control.Validators = new Array;
var eventType;
if (control.type == "radio") {
eventType = "onclick";
} else {
eventType = "onchange";
if (typeof(val.focusOnError) == "string" && val.focusOnError == "t") {
if (typeof (val.focusOnError) == "string" && val.focusOnError == "t") {
ValidatorHookupEvent(control, "onblur", "ValidatedControlOnBlur(event); ");
}
}
ValidatorHookupEvent(control, eventType, "ValidatorOnChange(event); ");
if (Page_TextTypes.test(control.type)) {
ValidatorHookupEvent(control, "onkeypress",
ValidatorHookupEvent(control, "onkeypress",
"event = event || window.event; if (!ValidatedTextBoxOnKeyPress(event)) { event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); return false; } ");
}
}
@@ -81,7 +81,7 @@ function ValidatorHookupControl(control, val) {
}
function ValidatorHookupEvent(control, eventType, functionPrefix) {
var ev = control[eventType];
if (typeof(ev) == "function") {
if (typeof (ev) == "function") {
ev = ev.toString();
ev = ev.substring(ev.indexOf("{") + 1, ev.lastIndexOf("}"));
}
@@ -93,18 +93,17 @@ function ValidatorHookupEvent(control, eventType, functionPrefix) {
function ValidatorGetValue(id) {
var control;
control = document.getElementById(id);
if (typeof(control.value) == "string") {
if (typeof (control.value) == "string") {
return control.value;
}
return ValidatorGetValueRecursive(control);
}
function ValidatorGetValueRecursive(control)
{
if (typeof(control.value) == "string" && (control.type != "radio" || control.checked == true)) {
function ValidatorGetValueRecursive(control) {
if (typeof (control.value) == "string" && (control.type != "radio" || control.checked == true)) {
return control.value;
}
var i, val;
for (i = 0; i<control.childNodes.length; i++) {
for (i = 0; i < control.childNodes.length; i++) {
val = ValidatorGetValueRecursive(control.childNodes[i]);
if (val != "") return val;
}
@@ -112,7 +111,7 @@ function ValidatorGetValueRecursive(control)
}
function Page_ClientValidate(validationGroup) {
Page_InvalidControlToBeFocused = null;
if (typeof(Page_Validators) == "undefined") {
if (typeof (Page_Validators) == "undefined") {
return true;
}
var i;
@@ -127,7 +126,7 @@ function Page_ClientValidate(validationGroup) {
function ValidatorCommonOnSubmit() {
Page_InvalidControlToBeFocused = null;
var result = !Page_BlockSubmit;
if ((typeof(window.event) != "undefined") && (window.event != null)) {
if ((typeof (window.event) != "undefined") && (window.event != null)) {
window.event.returnValue = result;
}
Page_BlockSubmit = false;
@@ -142,14 +141,14 @@ function ValidatorOnChange(event) {
event = event || window.event;
Page_InvalidControlToBeFocused = null;
var targetedControl;
if ((typeof(event.srcElement) != "undefined") && (event.srcElement != null)) {
if ((typeof (event.srcElement) != "undefined") && (event.srcElement != null)) {
targetedControl = event.srcElement;
}
else {
targetedControl = event.target;
}
var vals;
if (typeof(targetedControl.Validators) != "undefined") {
if (typeof (targetedControl.Validators) != "undefined") {
vals = targetedControl.Validators;
}
else {
@@ -170,7 +169,7 @@ function ValidatedTextBoxOnKeyPress(event) {
if (event.keyCode == 13) {
ValidatorOnChange(event);
var vals;
if ((typeof(event.srcElement) != "undefined") && (event.srcElement != null)) {
if ((typeof (event.srcElement) != "undefined") && (event.srcElement != null)) {
vals = event.srcElement.Validators;
}
else {
@@ -183,24 +182,24 @@ function ValidatedTextBoxOnKeyPress(event) {
function ValidatedControlOnBlur(event) {
event = event || window.event;
var control;
if ((typeof(event.srcElement) != "undefined") && (event.srcElement != null)) {
if ((typeof (event.srcElement) != "undefined") && (event.srcElement != null)) {
control = event.srcElement;
}
else {
control = event.target;
}
if ((typeof(control) != "undefined") && (control != null) && (Page_InvalidControlToBeFocused == control)) {
if ((typeof (control) != "undefined") && (control != null) && (Page_InvalidControlToBeFocused == control)) {
control.focus();
Page_InvalidControlToBeFocused = null;
}
}
function ValidatorValidate(val, validationGroup, event) {
val.isvalid = true;
if ((typeof(val.enabled) == "undefined" || val.enabled != false) && IsValidationGroupMatch(val, validationGroup)) {
if (typeof(val.evaluationfunction) == "function") {
if ((typeof (val.enabled) == "undefined" || val.enabled != false) && IsValidationGroupMatch(val, validationGroup)) {
if (typeof (val.evaluationfunction) == "function") {
val.isvalid = val.evaluationfunction(val);
if (!val.isvalid && Page_InvalidControlToBeFocused == null &&
typeof(val.focusOnError) == "string" && val.focusOnError == "t") {
typeof (val.focusOnError) == "string" && val.focusOnError == "t") {
ValidatorSetFocus(val, event);
}
}
@@ -209,80 +208,80 @@ function ValidatorValidate(val, validationGroup, event) {
}
function ValidatorSetFocus(val, event) {
var ctrl;
if (typeof(val.controlhookup) == "string") {
if (typeof (val.controlhookup) == "string") {
var eventCtrl;
if ((typeof(event) != "undefined") && (event != null)) {
if ((typeof(event.srcElement) != "undefined") && (event.srcElement != null)) {
if ((typeof (event) != "undefined") && (event != null)) {
if ((typeof (event.srcElement) != "undefined") && (event.srcElement != null)) {
eventCtrl = event.srcElement;
}
else {
eventCtrl = event.target;
}
}
if ((typeof(eventCtrl) != "undefined") && (eventCtrl != null) &&
(typeof(eventCtrl.id) == "string") &&
if ((typeof (eventCtrl) != "undefined") && (eventCtrl != null) &&
(typeof (eventCtrl.id) == "string") &&
(eventCtrl.id == val.controlhookup)) {
ctrl = eventCtrl;
}
}
if ((typeof(ctrl) == "undefined") || (ctrl == null)) {
if ((typeof (ctrl) == "undefined") || (ctrl == null)) {
ctrl = document.getElementById(val.controltovalidate);
}
if ((typeof(ctrl) != "undefined") && (ctrl != null) &&
(ctrl.tagName.toLowerCase() != "table" || (typeof(event) == "undefined") || (event == null)) &&
if ((typeof (ctrl) != "undefined") && (ctrl != null) &&
(ctrl.tagName.toLowerCase() != "table" || (typeof (event) == "undefined") || (event == null)) &&
((ctrl.tagName.toLowerCase() != "input") || (ctrl.type.toLowerCase() != "hidden")) &&
(typeof(ctrl.disabled) == "undefined" || ctrl.disabled == null || ctrl.disabled == false) &&
(typeof(ctrl.visible) == "undefined" || ctrl.visible == null || ctrl.visible != false) &&
(typeof (ctrl.disabled) == "undefined" || ctrl.disabled == null || ctrl.disabled == false) &&
(typeof (ctrl.visible) == "undefined" || ctrl.visible == null || ctrl.visible != false) &&
(IsInVisibleContainer(ctrl))) {
if ((ctrl.tagName.toLowerCase() == "table" && (typeof(__nonMSDOMBrowser) == "undefined" || __nonMSDOMBrowser)) ||
if ((ctrl.tagName.toLowerCase() == "table" && (typeof (__nonMSDOMBrowser) == "undefined" || __nonMSDOMBrowser)) ||
(ctrl.tagName.toLowerCase() == "span")) {
var inputElements = ctrl.getElementsByTagName("input");
var lastInputElement = inputElements[inputElements.length -1];
var lastInputElement = inputElements[inputElements.length - 1];
if (lastInputElement != null) {
ctrl = lastInputElement;
}
}
if (typeof(ctrl.focus) != "undefined" && ctrl.focus != null) {
if (typeof (ctrl.focus) != "undefined" && ctrl.focus != null) {
ctrl.focus();
Page_InvalidControlToBeFocused = ctrl;
}
}
}
function IsInVisibleContainer(ctrl) {
if (typeof(ctrl.style) != "undefined" &&
( ( typeof(ctrl.style.display) != "undefined" &&
if (typeof (ctrl.style) != "undefined" &&
((typeof (ctrl.style.display) != "undefined" &&
ctrl.style.display == "none") ||
( typeof(ctrl.style.visibility) != "undefined" &&
ctrl.style.visibility == "hidden") ) ) {
(typeof (ctrl.style.visibility) != "undefined" &&
ctrl.style.visibility == "hidden"))) {
return false;
}
else if (typeof(ctrl.parentNode) != "undefined" &&
ctrl.parentNode != null &&
ctrl.parentNode != ctrl) {
else if (typeof (ctrl.parentNode) != "undefined" &&
ctrl.parentNode != null &&
ctrl.parentNode != ctrl) {
return IsInVisibleContainer(ctrl.parentNode);
}
return true;
}
function IsValidationGroupMatch(control, validationGroup) {
if ((typeof(validationGroup) == "undefined") || (validationGroup == null)) {
if ((typeof (validationGroup) == "undefined") || (validationGroup == null)) {
return true;
}
var controlGroup = "";
if (typeof(control.validationGroup) == "string") {
if (typeof (control.validationGroup) == "string") {
controlGroup = control.validationGroup;
}
return (controlGroup == validationGroup);
}
function ValidatorOnLoad() {
if (typeof(Page_Validators) == "undefined")
if (typeof (Page_Validators) == "undefined")
return;
var i, val;
for (i = 0; i < Page_Validators.length; i++) {
val = Page_Validators[i];
if (typeof(val.evaluationfunction) == "string") {
if (typeof (val.evaluationfunction) == "string") {
eval("val.evaluationfunction = " + val.evaluationfunction + ";");
}
if (typeof(val.isvalid) == "string") {
if (typeof (val.isvalid) == "string") {
if (val.isvalid == "False") {
val.isvalid = false;
Page_IsValid = false;
@@ -293,13 +292,13 @@ function ValidatorOnLoad() {
} else {
val.isvalid = true;
}
if (typeof(val.enabled) == "string") {
if (typeof (val.enabled) == "string") {
val.enabled = (val.enabled != "False");
}
if (typeof(val.controltovalidate) == "string") {
if (typeof (val.controltovalidate) == "string") {
ValidatorHookupControlID(val.controltovalidate, val);
}
if (typeof(val.controlhookup) == "string") {
if (typeof (val.controlhookup) == "string") {
ValidatorHookupControlID(val.controlhookup, val);
}
}
@@ -319,14 +318,14 @@ function ValidatorConvert(op, dataType, val) {
num = parseInt(op, 10);
return (isNaN(num) ? null : num);
}
else if(dataType == "Double") {
else if (dataType == "Double") {
exp = new RegExp("^\\s*([-\\+])?(\\d*)\\" + val.decimalchar + "?(\\d*)\\s*$");
m = op.match(exp);
if (m == null)
return null;
if (m[2].length == 0 && m[3].length == 0)
return null;
cleanInput = (m[1] != null ? m[1] : "") + (m[2].length>0 ? m[2] : "0") + (m[3].length>0 ? "." + m[3] : "");
cleanInput = (m[1] != null ? m[1] : "") + (m[2].length > 0 ? m[2] : "0") + (m[3].length > 0 ? "." + m[3] : "");
num = parseFloat(cleanInput);
return (isNaN(num) ? null : num);
}
@@ -342,8 +341,8 @@ function ValidatorConvert(op, dataType, val) {
beginGroupSize = subsequentGroupSize = "+";
}
exp = new RegExp("^\\s*([-\\+])?((\\d" + beginGroupSize + "(\\" + val.groupchar + "\\d" + subsequentGroupSize + ")+)|\\d*)"
+ (hasDigits ? "\\" + val.decimalchar + "?(\\d{0," + val.digits + "})" : "")
+ "\\s*$");
+ (hasDigits ? "\\" + val.decimalchar + "?(\\d{0," + val.digits + "})" : "")
+ "\\s*$");
m = op.match(exp);
if (m == null)
return null;
@@ -357,13 +356,13 @@ function ValidatorConvert(op, dataType, val) {
var yearFirstExp = new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\. ?)(\\d{1,2})\\4(\\d{1,2})\\.?\\s*$");
m = op.match(yearFirstExp);
var day, month, year;
if (m != null && (((typeof(m[2]) != "undefined") && (m[2].length == 4)) || val.dateorder == "ymd")) {
if (m != null && (((typeof (m[2]) != "undefined") && (m[2].length == 4)) || val.dateorder == "ymd")) {
day = m[6];
month = m[5];
year = (m[2].length == 4) ? m[2] : GetFullYear(parseInt(m[3], 10));
}
else {
if (val.dateorder == "ymd"){
if (val.dateorder == "ymd") {
return null;
}
var yearLastExp = new RegExp("^\\s*(\\d{1,2})([-/]|\\. ?)(\\d{1,2})(?:\\s|\\2)((\\d{4})|(\\d{2}))(?:\\s\u0433\\.|\\.)?\\s*$");
@@ -379,14 +378,14 @@ function ValidatorConvert(op, dataType, val) {
day = m[1];
month = m[3];
}
year = ((typeof(m[5]) != "undefined") && (m[5].length == 4)) ? m[5] : GetFullYear(parseInt(m[6], 10));
year = ((typeof (m[5]) != "undefined") && (m[5].length == 4)) ? m[5] : GetFullYear(parseInt(m[6], 10));
}
month -= 1;
var date = new Date(year, month, day);
if (year < 100) {
date.setFullYear(year);
}
return (typeof(date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate()) ? date.valueOf() : null;
return (typeof (date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate()) ? date.valueOf() : null;
}
else {
return op.toString();
@@ -421,10 +420,10 @@ function CompareValidatorEvaluateIsValid(val) {
if (ValidatorTrim(value).length == 0)
return true;
var compareTo = "";
if ((typeof(val.controltocompare) != "string") ||
(typeof(document.getElementById(val.controltocompare)) == "undefined") ||
if ((typeof (val.controltocompare) != "string") ||
(typeof (document.getElementById(val.controltocompare)) == "undefined") ||
(null == document.getElementById(val.controltocompare))) {
if (typeof(val.valuetocompare) == "string") {
if (typeof (val.valuetocompare) == "string") {
compareTo = val.valuetocompare;
}
}
@@ -432,22 +431,22 @@ function CompareValidatorEvaluateIsValid(val) {
compareTo = ValidatorGetValue(val.controltocompare);
}
var operator = "Equal";
if (typeof(val.operator) == "string") {
if (typeof (val.operator) == "string") {
operator = val.operator;
}
return ValidatorCompare(value, compareTo, operator, val);
}
function CustomValidatorEvaluateIsValid(val) {
var value = "";
if (typeof(val.controltovalidate) == "string") {
if (typeof (val.controltovalidate) == "string") {
value = ValidatorGetValue(val.controltovalidate);
if ((ValidatorTrim(value).length == 0) &&
((typeof(val.validateemptytext) != "string") || (val.validateemptytext != "true"))) {
((typeof (val.validateemptytext) != "string") || (val.validateemptytext != "true"))) {
return true;
}
}
var args = { Value:value, IsValid:true };
if (typeof(val.clientvalidationfunction) == "string") {
var args = { Value: value, IsValid: true };
if (typeof (val.clientvalidationfunction) == "string") {
eval(val.clientvalidationfunction + "(val, args) ;");
}
return args.IsValid;
@@ -472,10 +471,10 @@ function RangeValidatorEvaluateIsValid(val) {
if (ValidatorTrim(value).length == 0)
return true;
return (ValidatorCompare(value, val.minimumvalue, "GreaterThanEqual", val) &&
ValidatorCompare(value, val.maximumvalue, "LessThanEqual", val));
ValidatorCompare(value, val.maximumvalue, "LessThanEqual", val));
}
function ValidationSummaryOnSubmit(validationGroup) {
if (typeof(Page_ValidationSummaries) == "undefined")
if (typeof (Page_ValidationSummaries) == "undefined")
return;
var summary, sums, s;
var headerSep, first, pre, post, end;
@@ -487,7 +486,7 @@ function ValidationSummaryOnSubmit(validationGroup) {
var i;
if (summary.showsummary != "False") {
summary.style.display = "";
if (typeof(summary.displaymode) != "string") {
if (typeof (summary.displaymode) != "string") {
summary.displaymode = "BulletList";
}
switch (summary.displaymode) {
@@ -515,27 +514,27 @@ function ValidationSummaryOnSubmit(validationGroup) {
break;
}
s = "";
if (typeof(summary.headertext) == "string") {
if (typeof (summary.headertext) == "string") {
s += summary.headertext + headerSep;
}
s += first;
for (i=0; i<Page_Validators.length; i++) {
if (!Page_Validators[i].isvalid && typeof(Page_Validators[i].errormessage) == "string") {
for (i = 0; i < Page_Validators.length; i++) {
if (!Page_Validators[i].isvalid && typeof (Page_Validators[i].errormessage) == "string") {
s += pre + Page_Validators[i].errormessage + post;
}
}
s += end;
summary.innerHTML = s;
window.scrollTo(0,0);
window.scrollTo(0, 0);
}
if (summary.showmessagebox == "True") {
s = "";
if (typeof(summary.headertext) == "string") {
if (typeof (summary.headertext) == "string") {
s += summary.headertext + "\r\n";
}
var lastValIndex = Page_Validators.length - 1;
for (i=0; i<=lastValIndex; i++) {
if (!Page_Validators[i].isvalid && typeof(Page_Validators[i].errormessage) == "string") {
for (i = 0; i <= lastValIndex; i++) {
if (!Page_Validators[i].isvalid && typeof (Page_Validators[i].errormessage) == "string") {
switch (summary.displaymode) {
case "List":
s += Page_Validators[i].errormessage;
@@ -680,5 +679,5 @@ if (window.jQuery) {
}
registerUpdatePanel();
});
} (jQuery));
}(jQuery));
}