Index: branches/RL2/extensions/Gadgets/Gadgets.hooks.php |
— | — | @@ -297,7 +297,9 @@ |
298 | 298 | $preferences['gadgets-shared'] = |
299 | 299 | array( |
300 | 300 | 'type' => 'multiselect', |
301 | | - 'options' => array(), // TODO: Maybe fill in stuff anyway? The backend may need that |
| 301 | + //'options' => array(), // TODO: Maybe fill in stuff anyway? The backend may need that |
| 302 | + 'options' => array_combine( explode( '|', $GLOBALS['wgRequest']->getVal( 'ryanscrewedchadover' ) ), |
| 303 | + explode( '|', $GLOBALS['wgRequest']->getVal( 'ryanscrewedchadover2' ) ) ), |
302 | 304 | 'section' => 'gadgets-shared', |
303 | 305 | 'label' => ' ', |
304 | 306 | 'prefix' => 'gadget-', |
Index: branches/RL2/extensions/Gadgets/modules/ext.gadgets.preferences.js |
— | — | @@ -15,12 +15,16 @@ |
16 | 16 | 'id': 'mw-input-wpgadgets-shared-' + id, |
17 | 17 | 'value': id |
18 | 18 | } ); |
| 19 | + if ( mw.user.options.get( 'gadget-' + id ) == "1" ) { |
| 20 | + $input.prop( 'checked', true ); |
| 21 | + } |
19 | 22 | $label = $( '<label>', { for: 'mw-input-wpgadgets-shared-' + id } ) |
20 | 23 | .text( text ); |
21 | 24 | return $div.append( $input ).append( ' ' ).append( $label ); |
22 | 25 | } |
23 | 26 | |
24 | 27 | function buildForm( gadgetsByCategory, categoryNames ) { |
| 28 | + var ryanscrewedchadover = [], ryanscrewedchadover2 = []; |
25 | 29 | var $container = $( '#mw-prefsection-gadgets-shared .mw-input' ), |
26 | 30 | // Detach the container from the DOM, so we can fill it without visible build-up. |
27 | 31 | // This is faster, too. In order to put it back where it was, we need to store its parent. |
— | — | @@ -33,10 +37,14 @@ |
34 | 38 | } |
35 | 39 | for ( var gadget in gadgetsByCategory[category] ) { |
36 | 40 | $container.append( buildPref( gadget, gadgetsByCategory[category][gadget] ) ); |
| 41 | + ryanscrewedchadover.push( 'wpgadgets-shared-id-' + gadget ); |
| 42 | + ryanscrewedchadover2.push( gadgetsByCategory[category][gadget] ); |
37 | 43 | } |
38 | 44 | } |
39 | 45 | // Re-attach the container |
40 | 46 | $containerParent.append( $container ); |
| 47 | + $containerParent.closest( 'form' ).append( $( '<input>' ).attr( { 'type': 'hidden', 'name': 'ryanscrewedchadover' } ).val( ryanscrewedchadover.join( '|' ) ) ); |
| 48 | + $containerParent.closest( 'form' ).append( $( '<input>' ).attr( { 'type': 'hidden', 'name': 'ryanscrewedchadover2' } ).val( ryanscrewedchadover2.join( '|' ) ) ); |
41 | 49 | } |
42 | 50 | |
43 | 51 | // Temporary testing data |