X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/9bd0dc7c3396bc90f5cef31a77b67db283fd12b8..497dc01810e6f02731c0e13fa43a63384e9261ef:/skins/ajax_scripts/javascript_events_api.js diff --git a/skins/ajax_scripts/javascript_events_api.js b/skins/ajax_scripts/javascript_events_api.js index bff4300..94960c0 100644 --- a/skins/ajax_scripts/javascript_events_api.js +++ b/skins/ajax_scripts/javascript_events_api.js @@ -1,4 +1,4 @@ -// (c) Benoît PIN 2006-2009 +// (c) Benoît PIN 2006-2014 // http://plinn.org // Licence GPL // @@ -6,7 +6,7 @@ // Meta functions for events management. var addListener; /* (ob, eventName, listenerFunction, group) add event listener eventName without "on" prefix. - * optionally, listeners can be grouped to make removing convenient. + * optionally, listeners can be grouped to make removing convenient. */ var removeListener; // (ob, eventName, listenerFunction, group) remove event listener. var removeGroupListeners; // (group) remove all listeners in group. @@ -26,9 +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(){}; + history.pushState = function(){}; } (function(){ @@ -222,9 +223,19 @@ function _build_clearSelection() { } } - buildMetaFunctions(); +addListener(window, 'load', function(evt) { + // html5 facade + if (!document.body.classList) { + var nop = function(){}; + var fakeDOMTokenList = {'length':0, 'item':nop, 'contains':nop, 'add':nop, 'remove':nop, 'toggle':nop}; + Element.prototype.classList = fakeDOMTokenList; + } +}); + + + var ELEMENT_NODE = 1; var TEXT_NODE = 3; var _setAttribute;