]> source.dussan.org Git - jquery-ui.git/commitdiff
Build: Filter filters for linting to exclude some to-be-rewritten ones. Fix lint...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 4 Apr 2012 08:52:41 +0000 (10:52 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 4 Apr 2012 09:02:08 +0000 (11:02 +0200)
grunt.js
ui/jquery.ui.autocomplete.js
ui/jquery.ui.menu.js
ui/jquery.ui.position.js
ui/jquery.ui.tabs.js

index 74713be5df1b1c27c4ae8da85039402eade020e2..3d861be850941b0837577bf79f949f857cca002e 100644 (file)
--- a/grunt.js
+++ b/grunt.js
@@ -261,11 +261,14 @@ grunt.initConfig({
                files: grunt.file.expandFiles( "tests/unit/**/*.html" ).filter(function( file ) {
                        // disabling everything that doesn't (quite) work with PhantomJS for now
                        // except for all|index|test, try to include more as we go
-                       return !( /(all|index|test|draggable|droppable|selectable|resizable|sortable|dialog|slider|datepicker|tabs|tabs_deprecated)\.html/ ).test( file );
+                       return !( /(all|all-active|index|test|draggable|droppable|selectable|resizable|sortable|dialog|slider|datepicker|tabs|tabs_deprecated)\.html/ ).test( file );
                })
        },
        lint: {
-               ui: "ui/*",
+               ui: grunt.file.expandFiles( "ui/*.js" ).filter(function( file ) {
+                       // remove items from this list once rewritten
+                       return !( /(effects.core|mouse|datepicker|draggable|droppable|resizable|selectable|sortable)\.js$/ ).test( file );
+               }),
                grunt: "grunt.js",
                tests: "tests/unit/**/*.js"
        },
index 226d406053eeced3928e78113696afaa14a70903..ab4d175847e55fb51e1e627194de1b67f909625a 100644 (file)
@@ -107,13 +107,13 @@ $.widget( "ui.autocomplete", {
                                                // which causes forms to submit
                                                suppressKeyPress = true;
                                                event.preventDefault();
+                                               self.menu.select( event );
                                        }
-                                       //passthrough - ENTER and TAB both select the current element
+                                       break;
                                case keyCode.TAB:
-                                       if ( !self.menu.active ) {
-                                               return;
+                                       if ( self.menu.active ) {
+                                               self.menu.select( event );
                                        }
-                                       self.menu.select( event );
                                        break;
                                case keyCode.ESCAPE:
                                        if ( self.menu.element.is(":visible") ) {
@@ -524,7 +524,7 @@ $.widget( "ui.autocomplete", {
 
 $.extend( $.ui.autocomplete, {
        escapeRegex: function( value ) {
-               return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
+               return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
        },
        filter: function(array, term) {
                var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
index af22c19b02d4ea845bc7e2dd867b776bd0354d29..526789e9e9b60233f75bb4dc5782606eb6c26d0c 100644 (file)
@@ -189,7 +189,7 @@ $.widget( "ui.menu", {
                                                character = prev + character;
                                        }
                                        function escape( value ) {
-                                               return value.replace( /[-[\]{}()*+?.,\\^$|#\s]/g , "\\$&" );
+                                               return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
                                        }
                                        match = this.activeMenu.children( ".ui-menu-item" ).filter( function() {
                                                return new RegExp("^" + escape(character), "i")
index 7fe31626d5fadcd1175cd7239717542357d2a56a..d751e9374cff1fd301dcf0509b4dc7fdaa511327 100644 (file)
@@ -13,7 +13,7 @@ $.ui = $.ui || {};
 
 var rhorizontal = /left|center|right/,
        rvertical = /top|center|bottom/,
-       roffset = /[+-]\d+%?/,
+       roffset = /[\+\-]\d+%?/,
        rposition = /^\w+/,
        rpercent = /%$/,
        center = "center",
index 95113fc57b16c36bc3adc4de67bb995d0328c0aa..fb384e5639880b328b4a92bc21dd0800c35e4b06 100644 (file)
@@ -162,7 +162,7 @@ $.widget( "ui.tabs", {
        },
 
        _sanitizeSelector: function( hash ) {
-               return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@[\]^`{|}~]/g, "\\$&" ) : "";
+               return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
        },
 
        refresh: function() {
@@ -841,7 +841,7 @@ if ( $.uiBackCompat !== false ) {
 
                _tabId: function( a ) {
                        return $( a ).attr( "aria-controls" ) ||
-                               a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) ||
+                               a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF\-]/g, "" ) ||
                                this.options.idPrefix + getNextTabId();
                }
        });