Index: trunk/extensions/HeaderTabs/HeaderTabs_body.jq.php |
— | — | @@ -36,9 +36,12 @@ |
37 | 37 | for ( $i = 0; $i < ( count( $parts ) / 2 ); $i++ ) { |
38 | 38 | preg_match( '/id="(.*?)"/', $parts[$i * 2], $matches ); |
39 | 39 | // Forward slashes in tab IDs cause a problem |
40 | | - // in the jQuery UI tabs() function - just |
41 | | - // replace them with an underline. |
42 | | - $tabid = str_replace('/', '_', $matches[1]); |
| 40 | + // in the jQuery UI tabs() function - |
| 41 | + // replace them with two underlines (two, to |
| 42 | + // avoid conflicting with another tab that |
| 43 | + // might have the same name, but with a space |
| 44 | + // instead of a slash). |
| 45 | + $tabid = str_replace('.2F', '__', $matches[1]); |
43 | 46 | |
44 | 47 | preg_match( '/<span.*?class="mw-headline".*?>\s*(.*?)\s*<\/h1>/', $parts[$i * 2], $matches ); |
45 | 48 | $tabtitle = $matches[1]; |
— | — | @@ -91,6 +94,8 @@ |
92 | 95 | $(".tabLink").click( function() { |
93 | 96 | var href = $(this).attr('href'); |
94 | 97 | var tabName = href.replace( "#tab=", "" ); |
| 98 | + // Fix for tabs with slashes in their name. |
| 99 | + tabName = tabName.replace( "/", "__" ); |
95 | 100 | $("#headertabs").tabs('select', tabName); |
96 | 101 | return false; //$htUseHistory; |
97 | 102 | } ); |