From: Jörn Zaefferer Date: Wed, 4 Apr 2012 08:52:41 +0000 (+0200) Subject: Build: Filter filters for linting to exclude some to-be-rewritten ones. Fix lint... X-Git-Tag: 1.9.0m8~153 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=79f1eea6dc874accae3447891783566337e97736;p=jquery-ui.git Build: Filter filters for linting to exclude some to-be-rewritten ones. Fix lint in those remaining --- diff --git a/grunt.js b/grunt.js index 74713be5d..3d861be85 100644 --- 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" }, diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 226d40605..ab4d17584 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -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" ); diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index af22c19b0..526789e9e 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -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") diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 7fe31626d..d751e9374 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -13,7 +13,7 @@ $.ui = $.ui || {}; var rhorizontal = /left|center|right/, rvertical = /top|center|bottom/, - roffset = /[+-]\d+%?/, + roffset = /[\+\-]\d+%?/, rposition = /^\w+/, rpercent = /%$/, center = "center", diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 95113fc57..fb384e563 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -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(); } });