From 03557759b5338002b09080b222e63cb6f4fe45d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Thu, 22 May 2014 10:54:38 +0200 Subject: [PATCH 1/1] =?utf8?q?Affectation=20des=20fonctions=20de=20manipul?= =?utf8?q?ation=20des=20=C3=A9v=C3=A9nements=20sur=20d=C3=A9tection=20du?= =?utf8?q?=20support=20DOM2=20event=20(au=20lieu=20du=20nom=20du=20navigat?= =?utf8?q?eur).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- skins/ajax_scripts/javascript_events_api.js | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/skins/ajax_scripts/javascript_events_api.js b/skins/ajax_scripts/javascript_events_api.js index 521fa91..4e721e2 100644 --- a/skins/ajax_scripts/javascript_events_api.js +++ b/skins/ajax_scripts/javascript_events_api.js @@ -48,13 +48,13 @@ var __groupListeners = {}; function _build_addListener() { var _browserSpecific; - if (browser.isIE55 || browser.isIE6up) { + if (!browser.isDOM2Event) { _browserSpecific = function(ob, eventName, listenerFunction) { eventName = "on" + eventName; ob.attachEvent(eventName, listenerFunction); }; } - else if (browser.isDOM2Event) { + else { _browserSpecific = function(ob, eventName, listenerFunction) { ob.addEventListener(eventName, listenerFunction, false); // only bubbling events :-( }; @@ -71,14 +71,14 @@ function _build_addListener() { } function _build_removeListener() { - if (browser.isIE55 || browser.isIE6up) { + if (!browser.isDOM2Event) { var _ie_removeListener = function(ob, eventName, listenerFunction) { eventName = "on" + eventName; ob.detachEvent(eventName, listenerFunction); }; return _ie_removeListener; } - else if (browser.isDOM2Event) { + else { var _dom2_removeListener = function(ob, eventName, listenerFunction) { ob.removeEventListener(eventName, listenerFunction, false); // only bubbling events :-( }; @@ -98,13 +98,13 @@ removeGroupListeners = function(group) { }; function _build_raiseMouseEvent() { - if (browser.isIE55 || browser.isIE6up) { + if (!browser.isDOM2Event) { var _ie_raiseMouseEvent = function(ob, eventName) { ob.fireEvent("on" + eventName); }; return _ie_raiseMouseEvent; } - else if (browser.isDOM2Event) { + else { var _dom2_raiseMouseEvent = function(ob, eventName) { var event = document.createEvent("MouseEvents"); event.initEvent(eventName, true, true); @@ -115,13 +115,13 @@ function _build_raiseMouseEvent() { } function _build_getTargetedObject(){ - if (browser.isIE55 || browser.isIE6up) { + if (!browser.isDOM2Event) { var _ie_getTargetedObject = function() { return window.event.srcElement; }; return _ie_getTargetedObject; } - else if (browser.isDOM2Event) { + else { var _appleWebKit_getTargetedeObject = function(evt) { var target = evt.target; // is it really safe ?... @@ -135,13 +135,13 @@ function _build_getTargetedObject(){ } function _build_getEventObject(){ - if (browser.isIE) { + if (!browser.isDOM2Event) { var _ie_getEventObject = function() { return window.event; }; return _ie_getEventObject; } - else if (browser.isDOM2Event) { + else { var _dom2_getEventObject = function(evt) { return evt; }; @@ -151,13 +151,13 @@ function _build_getEventObject(){ function _build_disableDefault(){ - if (browser.isIE55 || browser.isIE6up) { + if (!browser.isDOM2Event) { var _ie_disableDefault = function() { window.event.returnValue = false; }; return _ie_disableDefault; } - else if (browser.isDOM2Event) { + else { var _dom2_disableDefault = function(evt) { evt.preventDefault(); }; @@ -166,13 +166,13 @@ function _build_disableDefault(){ } function _build_disablePropagation() { - if (browser.isIE55 || browser.isIE6up) { + if (!browser.isDOM2Event) { var _ie_disablePropagation = function() { window.event.cancelBubble = true; }; return _ie_disablePropagation; } - else if (browser.isDOM2Event) { + else { var _dom2_disablePropagation = function(evt) { evt.stopPropagation(); }; -- 2.20.1