| Index: branches/RL2/extensions/Gadgets/Gadgets.i18n.php |
| — | — | @@ -28,7 +28,7 @@ |
| 29 | 29 | Administrators manage the [[Special:Gadgets|gadget definitions, titles and descriptions]] of available gadgets.', |
| 30 | 30 | 'gadgets-preference-description' => '$1: $2', |
| 31 | 31 | 'gadgets-sharedprefstext' => 'Below is a list of gadgets from other wikis. TODO: This needs more text', |
| 32 | | - 'gadgets-sharedprefs-ajaxerror' => 'An error occurred while attempting to fetch category and description information for shared gadgets. The gadgets below are shown uncategorized and without descriptions or proper titles.', |
| | 32 | + 'gadgets-sharedprefs-ajaxerror' => 'An error occurred while attempting to fetch category and description information for shared gadgets. The gadgets and categories below do not have their proper titles.', |
| 33 | 33 | |
| 34 | 34 | # For Special:Gadgets |
| 35 | 35 | // General |
| Index: branches/RL2/extensions/Gadgets/Gadgets.hooks.php |
| — | — | @@ -259,7 +259,7 @@ |
| 260 | 260 | foreach ( $byCategory as $category => $gadgets ) { |
| 261 | 261 | foreach ( $gadgets as $gadget ) { |
| 262 | 262 | $id = $gadget->getId(); |
| 263 | | - $sectionCat = $category === '' ? '' : "/gadgetcategory-$category"; |
| | 263 | + $sectionCat = $category === '' ? '' : "/gadgetcategory-$repoSource-$category"; |
| 264 | 264 | if ( $repo->isLocal() ) { |
| 265 | 265 | // For local gadgets we have all the information |
| 266 | 266 | $title = htmlspecialchars( $gadget->getTitleMessage() ); |
| — | — | @@ -280,7 +280,7 @@ |
| 281 | 281 | $preferences["gadget-$id"] = array( |
| 282 | 282 | 'type' => 'toggle', |
| 283 | 283 | 'label' => htmlspecialchars( $id ), // will be changed by JS |
| 284 | | - // TODO the below means source and category IDs can't contain slashes, enforce this |
| | 284 | + // TODO the below means source and category IDs can't contain slashes or dashes, enforce this |
| 285 | 285 | 'section' => "gadgetsshared/gadgetrepo-$repoSource$sectionCat", |
| 286 | 286 | 'cssclass' => 'mw-gadgets-shared-pref', |
| 287 | 287 | //'default' => $gadget->isEnabledForUser( $user ), // TODO: should we honor 'default' for remote gadgets? |
| — | — | @@ -295,7 +295,7 @@ |
| 296 | 296 | |
| 297 | 297 | public static function preferencesGetLegend( $form, $key, &$legend ) { |
| 298 | 298 | $matches = null; |
| 299 | | - if ( preg_match( '/^(gadgetcategory|gadgetrepo)-(.*)$/', $key, $matches ) ) { |
| | 299 | + if ( preg_match( '/^(gadgetrepo|gadgetcategory-.*?)-(.*)$/', $key, $matches ) ) { |
| 300 | 300 | // Just display the ID itself (with ucfirst applied) |
| 301 | 301 | // This will be changed to a properly i18ned string by JS |
| 302 | 302 | $legend = $form->getLang()->ucfirst( $matches[2] ); |
| Index: branches/RL2/extensions/Gadgets/modules/ext.gadgets.preferences.css |
| — | — | @@ -1,9 +1 @@ |
| 2 | | -/* Hide checkboxes when JS is enabled and descriptions have not yet been loaded */ |
| 3 | | -.client-js .mw-gadgetsshared-item-unloaded .mw-input { |
| 4 | | - display: none; |
| 5 | | -} |
| 6 | | - |
| 7 | | -/* When the wrapping <tr> contains a spinner, increase its height so the spinner isn't cut off */ |
| 8 | | -.client-js .mw-gadgetsshared-item-unloaded.mw-ajax-loader { |
| 9 | | - height: 32px; |
| 10 | | -} |
| | 2 | +/* TODO: spinner CSS */ |
| Index: branches/RL2/extensions/Gadgets/modules/ext.gadgets.preferences.js |
| — | — | @@ -11,7 +11,7 @@ |
| 12 | 12 | for ( category in gadgetsByCategory[repo] ) { |
| 13 | 13 | // FIXME HTMLForm isn't namespacing these things, we have to make it do that |
| 14 | 14 | // to prevent category naming collisions between repos |
| 15 | | - $( document.getElementById( 'mw-htmlform-gadgetcategory-' + category ) ) |
| | 15 | + $( document.getElementById( 'mw-htmlform-gadgetcategory-' + repo + '-' + category ) ) |
| 16 | 16 | .siblings( 'legend' ) |
| 17 | 17 | .text( categoryNames[repo][category] ); |
| 18 | 18 | |
| — | — | @@ -33,12 +33,11 @@ |
| 34 | 34 | * @param msgKey {String} Message key of the error message |
| 35 | 35 | */ |
| 36 | 36 | function showPreferenceFormError( msgKey ) { |
| 37 | | - var $oldContainer = $( '#mw-prefsection-gadgetsshared' ).find( '.mw-input' ), |
| 38 | | - $oldContainerTR = $oldContainer.closest( '.mw-gadgetsshared-item-unloaded' ), |
| | 37 | + var $table = $( '#mw-htmlform-gadgetsshared' ), |
| 39 | 38 | $errorMsg = $( '<p>' ).addClass( 'error' ).text( mw.msg( msgKey ) ); |
| 40 | 39 | |
| 41 | | - $oldContainerTR |
| 42 | | - .before( $( '<tr>' ).append( $( '<td>' ).attr( 'colspan', 2 ).append( $errorMsg ) ) ) |
| | 40 | + $table |
| | 41 | + .append( $( '<tr>' ).append( $( '<td>' ).attr( 'colspan', 2 ).append( $errorMsg ) ) ) |
| 43 | 42 | // Unhide the container and remove the spinner |
| 44 | 43 | .removeClass( 'mw-gadgetsshared-item-unloaded mw-ajax-loader' ); |
| 45 | 44 | } |
| — | — | @@ -86,8 +85,7 @@ |
| 87 | 86 | $( function() { |
| 88 | 87 | var gadgetsByCategory = null, categoryNames = null, failed = false; |
| 89 | 88 | |
| 90 | | - // Add spinner |
| 91 | | - $( '#mw-prefsection-gadgetsshared' ).find( '.mw-gadgetsshared-item-unloaded' ).addClass( 'mw-ajax-loader' ); |
| | 89 | + // TODO spinner |
| 92 | 90 | |
| 93 | 91 | // Do AJAX requests and call fixPreferenceForm() when done |
| 94 | 92 | mw.gadgets.api.getForeignGadgetsData( |