]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Allow non-latin characters for ids. Fixes #4581 - title attribute for remote...
authorScott González <scott.gonzalez@gmail.com>
Fri, 3 Sep 2010 15:35:10 +0000 (11:35 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 3 Sep 2010 15:35:10 +0000 (11:35 -0400)
tests/unit/tabs/tabs.html
tests/unit/tabs/tabs_tickets.js
ui/jquery.ui.tabs.js

index a3e73173f85675f401315496916c3bdf519e8fa7..aa79ddabb69e6d819881f03876b10578140ed0b2 100644 (file)
@@ -61,6 +61,7 @@
                                <li><a href="#colon:test"><span>1</span></a></li>
                                <li><a href="#inline-style"><span>2</span></a></li>
                                <li><a href="data/test.html#test"><span>3</span></a></li>
+                               <li><a href="data/test.html" title="∫ßáö Սե"<span>4</span></a></li>
                        </ul>
                        <div id="colon:test"></div>
                        <div style="height: 300px;" id="inline-style"></div>
index 475579c89130bed8e900914195099aa8088d1853..fdc2295e9cb7e8a6a8f1bdad3deaea40ce11c0af 100644 (file)
@@ -70,7 +70,6 @@ test('#5069 - ui.tabs.add creates two tab panels when using a full URL', functio
        
 });
 
-
 test('#5893 - Sublist in the tab list are considered as tab', function() {
        // http://dev.jqueryui.com/ticket/5893
        expect(1);
@@ -80,5 +79,16 @@ test('#5893 - Sublist in the tab list are considered as tab', function() {
 
 });
 
+asyncTest( "#4581 - title attribute for remote tabs does not support foreign languages", function() {
+       expect( 1 );
+       
+       $( "#tabs2" ).tabs({
+               selected: 3,
+               load: function( event, ui ) {
+                       equal( ui.panel.id, "∫ßáö_Սե", "proper title" );
+                       start();
+               }
+       });
+});
 
 })(jQuery);
index 98b90c289ca8740a3062e003e7bcf500f158ddf0..8b63992a5caafbfc2643d3a4f195f54caa9cb15e 100644 (file)
@@ -63,7 +63,7 @@ $.widget( "ui.tabs", {
        },
 
        _tabId: function( a ) {
-               return a.title && a.title.replace( /\s/g, "_" ).replace( /[^A-Za-z0-9\-_:\.]/g, "" ) ||
+               return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) ||
                        this.options.idPrefix + getNextTabId();
        },