📄 n2corelibs-events-15996.js
字号:
var sLinkID = sInstanceName.substr(prefixLength, sInstanceName.length-prefixLength);return goN2U.getLinkNameInfo(sLinkID);}window.N2HInstance.prototype.mouseOverTrack = function(oLNI) {if (this.oFeature.isDisabled()) {return;};//goN2Debug.info("hotspot mouseOverTrack; hotspot id " + oLNI.getLinkID() + ", name " + oLNI.getLinkName());var oFInstance = this.oFeature.getFeatureInstance(oLNI);if (oFInstance) {oFInstance.mouseOverHotspotTrack(oLNI);}}window.N2HInstance.prototype.mouseOverOpen = function(oLNI, nFeatureFlags) {if (this.oFeature.isDisabled()) {return;};//goN2Debug.info("hotspot mouseOverOpen; hotspot id " + oLNI.getLinkID() + ", name " + oLNI.getLinkName());var oFInstance = this.oFeature.getFeatureInstance(oLNI);if (!oFInstance) {oFInstance = this.oFeature.createFeatureInstance(oLNI);}if (oFInstance) {oFInstance.mouseOverHotspotOpen(oLNI, nFeatureFlags);} else {;}}window.N2HInstance.prototype.mouseClickOpen = function(oLNI, nFeatureFlags) {;//goN2Debug.info("hotspot mouseClickOpen; hotspot id " + oLNI.getLinkID() + ", name " + oLNI.getLinkName());if (this.oFeature.isDisabled()) {return;}var oFInstance = this.oFeature.getFeatureInstance(oLNI);if (!oFInstance) {oFInstance = this.oFeature.createFeatureInstance(oLNI);}if (oFInstance) {oFInstance.clickHotspotOpen(oLNI, nFeatureFlags);} else {;}}window.N2HInstance.prototype.mouseOutClose = function(oLNI) {;//goN2Debug.info("hotspot mouseOutClose; hotspot id " + oLNI.getLinkID() + ", name " + oLNI.getLinkName());if (this.oFeature.isDisabled()) {return;}var oFInstance = this.oFeature.getFeatureInstance(oLNI);if (oFInstance) {oFInstance.mouseOutHotspotClose(oLNI);}}window.N2RegFeature = function(oFeature, sFeatureID, mouseOverFn, mouseOutFn, clickFn) {this.className = 'N2RegFeature';this.version = '1.1.0';if (!oFeature) {return;}if (!mouseOverFn) {mouseOverFn = n2MouseOverHotspotNop;}if (!mouseOutFn) {mouseOutFn = n2MouseOutHotspotNop;}this._sFeatureID = sFeatureID;this._oFeature = oFeature;this._timerDelays = new Object();this._timerDelays.showAfter = 400;this._timerDelays.reachWithin = 600;this._timerDelays.closeAfter = 400;this._eventsRegistry = new Object();this._registeredFunctions = new Object();this._preProcessEventFunction('onmouseover', mouseOverFn);this._preProcessEventFunction('onmouseout', mouseOutFn);this._preProcessEventFunction('onclick', clickFn);}new N2RegFeature();window.N2RegFeature.prototype.getFeatureID = function() { return this._sFeatureID; }window.N2RegFeature.prototype.getFeature = function() { return this._oFeature; }window.N2RegFeature.prototype.getEventHelperFunction = function(event) {return this._registeredFunctions[event];}window.N2RegFeature.prototype._preProcessEventFunction = function(event, fname){try {;var code = eval(fname)this._eventsRegistry[event] = fname;this._registeredFunctions[event] = code;;}catch (e) {;}}window.N2RegFeature.prototype.attachEventsToLink = function(elem) {for (var event in this._eventsRegistry) {if (this._eventsRegistry[event]) {;elem[event] = this._registeredFunctions[event];}}}window.N2RegFeature.prototype.setDelays = function(nShowAfter, nReachWithin, nCloseAfter) {var a, b, c;a = this._timerDelays.showAfter = goN2U.isUndefOrNull(nShowAfter) ? this._timerDelays.showAfter : nShowAfter;b = this._timerDelays.reachWithin = goN2U.isUndefOrNull(nReachWithin) ? this._timerDelays.reachWithin : nReachWithin;c = this._timerDelays.closeAfter = goN2U.isUndefOrNull(nCloseAfter) ? this._timerDelays.closeAfter : nCloseAfter;;}window.N2RegFeature.prototype.getDelayShowAfter = function() {return this._timerDelays.showAfter;}window.N2RegFeature.prototype.getDelayReachWithin = function() {return this._timerDelays.reachWithin;}window.N2RegFeature.prototype.getDelayCloseAfter = function() {return this._timerDelays.closeAfter;}window.N2Feature = function() {this.className = 'N2Feature';this.version = '1.1.0';this._timeDisabledUntil = null;this._nDefaultDisableMs = 5000;this._oHInstance = new N2HInstance(this);}new N2Feature();window.N2Feature.prefixHInstanceNames = "HS_";window.N2Feature.prefixFInstanceNames = "FI_";window.N2Feature.prototype.closeAllInstances = function(bImmediate) {;}window.N2Feature.prototype.notifyMouseOwner = function(oRegFeatureMouseOwner, sInstanceNameMouseOwner) {;}window.N2Feature.prototype.disableFeature = function(nMSDelay) {if (!nMSDelay) {nMSDelay = this._nDefaultDisableMs;}this.clossAll(false);var date = new Date();var now = date.getTime();this._timeDisabledUntil = now + nMSDelay;}window.N2Feature.prototype.isDisabled = function() {var bDisabled = false;if (this._timeDisabledUntil) {var date = new Date();var now = date.getTime();if (now < this._timeDisabledUntil) {bDisabled = true;} else {this._timeDisabledUntil = null;}}return bDisabled;}window.N2Feature.prototype.getFeatureInstance = function(oLNI_or_featureID, sInstanceName) {;return null;}window.N2Feature.prototype.createFeatureInstance = function(oLNI) {;return null;}window.N2Feature.prototype.getFeatureInstanceName = function(oLNI) {return N2FInstance.getInstanceNameFromLinkInfo(oLNI);}window.N2Feature.prototype.getHotspotInstance = function(oLNI_or_featureID, sInstanceName) {return this._oHInstance;}window.N2Feature.prototype.getHotspotInstanceName = function(oLNI) {return N2HInstance.getInstanceNameFromLinkInfo(oLNI);}window.N2Feature.prototype.getLinkInfoFromHotspotInstanceName = function(sInstanceName) {return N2HInstance.getLinkInfoFromInstanceName(sInstanceName);}window.N2Feature.prototype.isHotspotInstanceName = function(sInstanceName) {;if (sInstanceName) {return (sInstanceName.substr(0,N2Feature.prefixHInstanceNames.length) == N2Feature.prefixHInstanceNames);}return false;}window.N2Feature.prototype.getInstance = function(featureID, sInstanceName) {;if (sInstanceName.substr(0,N2Feature.prefixHInstanceNames.length) == N2Feature.prefixHInstanceNames) {return this.getHotspotInstance(featureID, sInstanceName);} else if (sInstanceName.substr(0,N2Feature.prefixFInstanceNames.length) == N2Feature.prefixFInstanceNames) {return this.getFeatureInstance(featureID, sInstanceName);};return null;}window.N2FeatureWrapper = function(sFeatureID, oWrappedFeature, wrappedFeatureObjectName) {N2FeatureWrapper.parentClass.call(this); // THIS line MUST come first -- executes parent constructorthis.className = 'N2FeatureWrapper';this.version = '1.1.0';this._oWrappedFeature = oWrappedFeature; // JSF 1.0 Feature objectthis._wrappedFeatureObjectName = wrappedFeatureObjectName;this._oActiveFInstance = null; // the active feature instance, if any.this._featureInstances = new Object();}window.N2FeatureWrapper.prototype = new N2Feature();window.N2FeatureWrapper.parentClass = N2Feature;window.N2FeatureWrapper.prototype.getWrappedFeatureObjectName = function() { return this._wrappedFeatureObjectName; }window.N2FeatureWrapper.prototype.getWrappedFeatureObj = function() { return this._oWrappedFeature; }window.N2FeatureWrapper.prototype.getActiveWrappedFInstance = function() { return this._oActiveFInstance; }window.N2FeatureWrapper.prototype.setActiveWrappedFInstance = function(oWrappingInstance) {;this._oActiveFInstance = oWrappingInstance;}window.N2FeatureWrapper.prototype.getWrappedFeatureActiveElement = function() {return (this._oWrappedFeature.isActive() ? this._oWrappedFeature.getObject() : null);}window.N2FeatureWrapper.prototype.getWrappedMouseOutCallback = function() {return this._oWrappedFeature.myMouseOutCallback;}window.N2FeatureWrapper.prototype.getFeatureInstance = function(oLNI_or_featureID, sInstanceName) {var featureID;if (typeof oLNI_or_featureID == "string") {featureID = oLNI_or_featureID;} else {var oLNI = oLNI_or_featureID;featureID = oLNI.getFeature();sInstanceName = N2FInstance.getInstanceNameFromLinkInfo(oLNI);}for (var id in this._featureInstances) {if (id == featureID + "|" + sInstanceName) {return this._featureInstances[id];}}return null;}window.N2FeatureWrapper.prototype.notifyMouseOwner = function(oRegFeatureMouseOwner, sInstanceNameMouseOwner) {var oFeatureMouseOwner = (oRegFeatureMouseOwner ? oRegFeatureMouseOwner.getFeature() : null);var featureIDMouseOwner = (oRegFeatureMouseOwner ? oRegFeatureMouseOwner.getFeatureID() : "");for (var id in this._featureInstances) {var idArray = id.split("|");var featureID = idArray[0];var oFInstance = this._featureInstances[id];oFInstance.notifyFInstanceHasMouse(this == oFeatureMouseOwner && // needed because featureIDs might be nulloFInstance.getFeatureID() == featureIDMouseOwner &&oFInstance.getInstanceName() == sInstanceNameMouseOwner );}if (oFeatureMouseOwner==this && this.isHotspotInstanceName(sInstanceNameMouseOwner)) {var oLNI = this.getLinkInfoFromHotspotInstanceName(sInstanceNameMouseOwner);if (oLNI) {var hotspotElem = goN2U.getRawObject(oLNI.getLinkID());var helperFunction = oRegFeatureMouseOwner.getEventHelperFunction("onmouseover");if (hotspotElem && helperFunction) {helperFunction.call(hotspotElem);}}}}window.N2FeatureWrapper.prototype.closeAllInstances = function(bImmediate) {; // gets the wrapped feature, not the instance! But uncalled, so it's OK.var oFInstance = this.getWrappedFeatureActiveElement();if (oFInstance) {oFInstance.closeNow(bImmediate);}}window.N2FeatureWrapper.prototype.createFeatureInstance = function(oLNI) {var oWrappingInstance = new N2FInstanceWrapper(this);oWrappingInstance.assignInstance(oLNI);var id = oLNI.getFeature() + "|" + oWrappingInstance.getInstanceNameFromLinkInfo(oLNI);;this._featureInstances[id] = oWrappingInstance;return oWrappingInstance;}window.N2Events = function() {this.className = 'N2Events';this.version = '1.1.0';this._nextAvailId = 0;this._oFeatureMouseOwner = null; // the instance's featurethis._sInstanceNameMouseOwner = ""; // the instance namethis._nParentSeeks=3;this._bAnalyzeHREFs=false;this._sAutoFeatureID='autoexp';this._featureChangedTimer = null;this._featureRegistry = new Object();this.fSEMISTATIC = N2Events.fSEMISTATIC;this.fSTATICWITHCLOSE = N2Events.fSTATICWITHCLOSE;this.initialize = function(){if (!this._initialized) {; // safety net failedthis._initialized = true;N2ChainEventHandler('onmousemove',function(evt) {evt = (evt) ? evt : window.event;if (typeof goN2Events == "object") {goN2Events._mouseMoved(evt);}},'N2EventsMouse');;} else {;}}this.registerFeature = function(sFeatureID, featureObjectOrObjectName, mouseOverFn, mouseOutFn, clickFn) {;;var oFeature;if (typeof featureObjectOrObjectName == "object") {oFeature = featureObjectOrObjectName;} else {var oWrappedFeature = this._evalWrappedFeatureObjectName(featureObjectOrObjectName);if (oWrappedFeature == null) {;return;}oFeature = this._getFeatureFromWrappedFeature(oWrappedFeature);if (!oFeature) {oFeature = new N2FeatureWrapper(sFeatureID, oWrappedFeature, featureObjectOrObjectName);}}var oRegFeature = new N2RegFeature(oFeature, sFeatureID, mouseOverFn, mouseOutFn, clickFn);this._featureRegistry[sFeatureID] = oRegFeature;}this._evalWrappedFeatureObjectName = function(wrappedFeatureObjectName) {var oWrappedFeature = null;try {oWrappedFeature = eval(wrappedFeatureObjectName);}catch (e) {}return oWrappedFeature;}this.lookupRegFeature = function(sFeatureID) {return this._featureRegistry[sFeatureID];}this.lookupFeature = function(sFeatureID) {var oRegFeature = this._featureRegistry[sFeatureID];return (oRegFeature ? oRegFeature.getFeature() : null);}this._getFeatureFromWrappedFeature = function(oWrappedFeature) {for (var sFeatureID in this._featureRegistry) {var oRegFeature = this._featureRegistry[sFeatureID];var oFeature = oRegFeature.getFeature();if (oFeature.getWrappedFeatureObj &&oFeature.getWrappedFeatureObj() === oWrappedFeature) {return oFeature;}}}this._searchForActiveFeature = function(elementMouse) {var oFeatureActive = null;for (var sFeatureID in this._featureRegistry) {var oFeature = this._featureRegistry[sFeatureID].getFeature();var oWrappedFeature = oFeature.getWrappedFeatureObj();if (oWrappedFeature.isStatic() || !oWrappedFeature.isActive()) {continue;}var bMouseIn = false;if (goN2U.isDefined(oWrappedFeature.isElementContained)) {bMouseIn = oWrappedFeature.isElementContained(elementMouse);} else {var elementFeature = oFeature.getWrappedFeatureActiveElement();bMouseIn = goN2U.elementIsContainedBy(elementMouse, elementFeature);}if (bMouseIn) {if (oFeatureActive && oFeatureActive!==oFeature) {;}oFeatureActive = oFeature;}}return oFeatureActive;}this.setFeatureDelays = function(sFeatureID, nShowAfter, nReachWithin, nCloseAfter) {var oRegFeature = this._featureRegistry[sFeatureID];if (!oRegFeature) {;return;}oRegFeature.setDelays(nShowAfter, nReachWithin, nCloseAfter);}this.analyzeHREFS = function(b) { this._bAnalyzeHREFs = b; }this.setAutoFeatureID = function(s) { this._sAutoFeatureID=s; }this.broadcastMouseOwner = function(oRegFeatureMouseOwner, sInstanceNameMouseOwner) {var oFeatureMouseOwner = (oRegFeatureMouseOwner ? oRegFeatureMouseOwner.getFeature() : null);if (oFeatureMouseOwner!==this._oFeatureMouseOwner || sInstanceNameMouseOwner!=this._sInstanceNameMouseOwner ) {this._oFeatureMouseOwner = oFeatureMouseOwner;this._sInstanceNameMouseOwner = sInstanceNameMouseOwner;for (var sFeatureID in this._featureRegistry) {var oFeature = this._featureRegistry[sFeatureID].getFeature();oFeature.notifyMouseOwner(oRegFeatureMouseOwner, sInstanceNameMouseOwner);}}}this.validateState = function() {var oRegFeatureMouseOwner = null;if (this._oFeatureMouseOwner != null){var oWrappedPopoverFeature = this._oFeatureMouseOwner.getWrappedFeatureObj();oRegFeatureMouseOwner = this.lookupRegFeature(oWrappedPopoverFeature.getRegFeatureID());}for (var sFeatureID in this._featureRegistry) {var oFeature = this._featureRegistry[sFeatureID].getFeature();oFeature.notifyMouseOwner(oRegFeatureMouseOwner, this._sInstanceNameMouseOwner);}}this.instanceIsNotMouseOwner = function(oRegFeature, sInstanceName) {var oFeature = oRegFeature.getFeature();if (oFeature===this._oFeatureMouseOwner && sInstanceName==this._sInstanceNameMouseOwner ) {this._oFeatureMouseOwner = null;this._sInstanceNameMouseOwner = "";}}this._attachEventsToLink = function(elem, name) {var modified = false;var nameArray = name.split("|");if (nameArray.length < N2Events.nMINHOTSPOTNAMECOMPONENTS) {return false;}var sFeatureID = nameArray[0];var oRegFeature = this.lookupRegFeature(sFeatureID);if (sFeatureID && oRegFeature) {;if (!elem.id) {elem.setAttribute("id","lnx"+this._nextAvailId);;this._nextAvailId++;}oRegFeature.attachEventsToLink(elem);modified = true;}return modified;}this._mouseMoved = function(evt){;var name;var elem;if (goN2U.bIsIE)elem = evt.srcElement;elseelem = evt.target;var elemBase = elem; // save the element on which the event was generatedif (elem) {if (!elem.name && this._bAnalyzeHREFs) {var sHref = elem.href;if (elem.tagName == 'IMG') {var i = 2; //this._nParentSeeks;var parentElem = goN2U.getParentElement(elem);while ( parentElem && i ) {if (parentElem.href) {sHref = parentElem.href;break;}parentElem = goN2U.getParentElement(parentElem);i--;}}if (sHref) {var aRE = new Array();aRE[0] = /\/exec\/obidos\/ASIN\/([^\/]*)\//;aRE[1] = /\/exec\/obidos\/am\/[^=]+=ASIN\/([^\/]+)/;aRE[2] = /\/exec\/obidos\/tg\/detail\/-\/([^\/]*)\//;aRE[3] = /\/exec\/obidos\/am\/[^\/]+\/detail\/-\/([^\/]*)\//;sHref = unescape(sHref);for (var i=0;i<aRE.length;i++) {var aResults = sHref.match(aRE[i]);if (aResults) {var sASIN = aResults[1];var sNameVal = this._sAutoFeatureID + '|a|' + sASIN;;elem.name = sNameVal;break;}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -