diff --git a/lib/javascript-static.js b/lib/javascript-static.js index bfd294a8c2d..b3e1726bbdb 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -978,49 +978,6 @@ function findParentNode(el, elName, elClass, elId) { } return el; } -/* - findChildNode (start, elementName, elementClass, elementID) - - Travels down the DOM hierarchy to find all child elements with the - specified tag name, class, and id. All conditions must be met, - but any can be ommitted. - Doesn't examine children of matches. - - @deprecated since Moodle 2.7 - please do not use this function any more. - @todo MDL-43242 This will be deleted in Moodle 2.9. - @see Y.all -*/ -function findChildNodes(start, tagName, elementClass, elementID, elementName) { - Y.log("findChildNodes() is deprecated. Please use Y.all instead.", - "warn", "javascript-static.js"); - var children = new Array(); - for (var i = 0; i < start.childNodes.length; i++) { - var classfound = false; - var child = start.childNodes[i]; - if((child.nodeType == 1) &&//element node type - (elementClass && (typeof(child.className)=='string'))) { - var childClasses = child.className.split(/\s+/); - for (var childClassIndex in childClasses) { - if (childClasses[childClassIndex]==elementClass) { - classfound = true; - break; - } - } - } - if(child.nodeType == 1) { //element node type - if ( (!tagName || child.nodeName == tagName) && - (!elementClass || classfound)&& - (!elementID || child.id == elementID) && - (!elementName || child.name == elementName)) - { - children = children.concat(child); - } else { - children = children.concat(findChildNodes(child, tagName, elementClass, elementID, elementName)); - } - } - } - return children; -} function unmaskPassword(id) { var pw = document.getElementById(id); @@ -1137,83 +1094,6 @@ function insertAtCursor(myField, myValue) { } } - -/* - Call instead of setting window.onload directly or setting body onload=. - Adds your function to a chain of functions rather than overwriting anything - that exists. - @deprecated Since Moodle 2.7. This will be removed in Moodle 2.9. -*/ -function addonload(fn) { - Y.log('addonload has been deprecated since Moodle 2.7 and will be removed in Moodle 2.9', - 'warn', 'javascript-static.js'); - var oldhandler=window.onload; - window.onload=function() { - if(oldhandler) oldhandler(); - fn(); - } -} -/** - * Replacement for getElementsByClassName in browsers that aren't cool enough - * - * Relying on the built-in getElementsByClassName is far, far faster than - * using YUI. - * - * Note: the third argument used to be an object with odd behaviour. It now - * acts like the 'name' in the HTML5 spec, though the old behaviour is still - * mimicked if you pass an object. - * - * @param {Node} oElm The top-level node for searching. To search a whole - * document, use `document`. - * @param {String} strTagName filter by tag names - * @param {String} name same as HTML5 spec - * @deprecated Since Moodle 2.7. This will be removed in Moodle 2.9. - */ -function getElementsByClassName(oElm, strTagName, name) { - Y.log('getElementsByClassName has been deprecated since Moodle 2.7 and will be removed in Moodle 2.9', - 'warn', 'javascript-static.js'); - // for backwards compatibility - if(typeof name == "object") { - var names = new Array(); - for(var i=0; i