diff --git a/lib/scripts/compatibility.js b/lib/scripts/compatibility.js index bd5403f0dc49b26073da57dcc730ee240700605d..58efc03b96b204383125fa0e431f0a565d583954 100644 --- a/lib/scripts/compatibility.js +++ b/lib/scripts/compatibility.js @@ -23,3 +23,8 @@ function findPosY(object){ return jQuery(object).position().top; } +function getElementsByClass(searchClass,node,tag){ + DEPRECATED('Use jQuery() instead'); + if(node == null) node = document; + return jQuery(node).find(tag+'.'+searchClass).toArray(); +} diff --git a/lib/scripts/script.js b/lib/scripts/script.js index 68687c14e601935de645594809b79f941e122a57..fc8cb609610780adc7b6b74ae8b0a7d4b7e9d932 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -100,29 +100,6 @@ function isset(varname){ } /** - * Select elements by their class name - * - * @author Dustin Diaz <dustin [at] dustindiaz [dot] com> - * @link http://www.dustindiaz.com/getelementsbyclass/ - */ -function getElementsByClass(searchClass,node,tag) { - var classElements = new Array(); - if ( node == null ) - node = document; - if ( tag == null ) - tag = '*'; - var els = node.getElementsByTagName(tag); - var elsLen = els.length; - var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); - for (var i = 0, j = 0; i < elsLen; i++) { - if ( pattern.test(els[i].className) ) { - classElements[j] = els[i]; - j++; - } - } - return classElements; -} - * Get the computed style of a node. * * @link https://acidmartin.wordpress.com/2008/08/26/style-get-any-css-property-value-of-an-object/