X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/99afe0ce8700bf835ff7bbedf77bb46e58f996d8..9bd0dc7c3396bc90f5cef31a77b67db283fd12b8:/skins/ajax_scripts/javascript_events_api.js?ds=inline diff --git a/skins/ajax_scripts/javascript_events_api.js b/skins/ajax_scripts/javascript_events_api.js index 7e9e8dd..bff4300 100644 --- a/skins/ajax_scripts/javascript_events_api.js +++ b/skins/ajax_scripts/javascript_events_api.js @@ -26,6 +26,10 @@ var getCopyOfNode; /* (node) returns a clone of the given node. * the node came from a foreign document (eg. XmlHttpRequest xml reponse) * to inject HMTL code inside tags where innerHtml is read only (IE) */ +var copyPrototype; // (descendant, parent) lightwheight javascript inheritance +if (!history.pushState) { + history.pushState = function(){}; +} (function(){ @@ -43,17 +47,17 @@ function buildMetaFunctions() { clearSelection = _build_clearSelection(); } -__groupListeners = {}; +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 :-( }; @@ -61,126 +65,126 @@ function _build_addListener() { var common = function(ob, eventName, listenerFunction, group) { _browserSpecific(ob, eventName, listenerFunction); if (group) { - if(!__groupListeners[group]) - __groupListeners[group] = new Array(); + if(!__groupListeners[group]) { + __groupListeners[group] = [];} __groupListeners[group].push([ob, eventName, listenerFunction]); } - } + }; return common; } 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 :-( - } + }; return _dom2_removeListener; } } removeGroupListeners = function(group) { var listeners = __groupListeners[group]; - var l; - for (var i=0 ; i