From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- resources/jquery/jquery.getAttrs.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 resources/jquery/jquery.getAttrs.js (limited to 'resources/jquery/jquery.getAttrs.js') diff --git a/resources/jquery/jquery.getAttrs.js b/resources/jquery/jquery.getAttrs.js new file mode 100644 index 00000000..c05012d9 --- /dev/null +++ b/resources/jquery/jquery.getAttrs.js @@ -0,0 +1,24 @@ +/** + * Utility to get all attributes of an element directy as an object. + * + * @author Timo Tijhof, 2011 + */ +jQuery.fn.getAttrs = function( all ) { + var map = this[0].attributes, + attrs = {}, + len = map.length, + i, v; + + for ( i = 0; i < len; i++ ) { + // IE6 includes *all* allowed attributes for thew element (including those + // not set). Those have values like undefined, null, 0, false, "" or "inherit". + // However there may be genuine attributes set to that. If you need them, + // set all to true. They are excluded by default. + v = map[i].nodeValue; + if ( all || ( v && v !== 'inherit' ) ) { + attrs[ map[i].nodeName ] = v; + } + } + + return attrs; +}; -- cgit v1.2.3-54-g00ecf