summaryrefslogtreecommitdiff
path: root/resources/jquery/jquery.tabIndex.js
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
committerPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
commit9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch)
tree46d1a0dee7febef5c2d57a9f7b972be16a163b3d /resources/jquery/jquery.tabIndex.js
parent78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff)
update to MediaWiki 1.17.0
Diffstat (limited to 'resources/jquery/jquery.tabIndex.js')
-rw-r--r--resources/jquery/jquery.tabIndex.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/resources/jquery/jquery.tabIndex.js b/resources/jquery/jquery.tabIndex.js
new file mode 100644
index 00000000..bb9b2bfa
--- /dev/null
+++ b/resources/jquery/jquery.tabIndex.js
@@ -0,0 +1,35 @@
+/**
+ * jQuery tabIndex
+ */
+( function( $ ) {
+/**
+ * Finds the lowerst tabindex in use within a selection
+ *
+ * @return Integer of lowest tabindex on the page
+ */
+jQuery.fn.firstTabIndex = function() {
+ var minTabIndex = 0;
+ jQuery(this).find( '[tabindex]' ).each( function() {
+ var tabIndex = parseInt( jQuery(this).attr( 'tabindex' ) );
+ if ( tabIndex > minTabIndex ) {
+ minTabIndex = tabIndex;
+ }
+ } );
+ return minTabIndex;
+};
+/**
+ * Finds the highest tabindex in use within a selection
+ *
+ * @return Integer of highest tabindex on the page
+ */
+jQuery.fn.lastTabIndex = function() {
+ var maxTabIndex = 0;
+ jQuery(this).find( '[tabindex]' ).each( function() {
+ var tabIndex = parseInt( jQuery(this).attr( 'tabindex' ) );
+ if ( tabIndex > maxTabIndex ) {
+ maxTabIndex = tabIndex;
+ }
+ } );
+ return maxTabIndex;
+};
+} )( jQuery ); \ No newline at end of file