| Line 8: |
Line 8: |
| | mw.loader.using( 'oojs-ui-core' ).done( function () { | | mw.loader.using( 'oojs-ui-core' ).done( function () { |
| | $( function () { | | $( function () { |
| − | mw.storage.set( 'key', 'value' );
| + | var key = new OO.ui.TextInputWidget( { |
| − | var input = new OO.ui.TextInputWidget( { | + | placeholder: 'key' |
| − | placeholder: 'This is an entry box' | |
| | } ), | | } ), |
| | + | value = new OO.ui.TextInputWidget( { |
| | + | placeholder: 'value' |
| | + | } ), |
| | + | button = new OO.ui.ButtonWidget( |
| | + | label: 'save' |
| | + | } ), |
| | info = new OO.ui.LabelWidget( { | | info = new OO.ui.LabelWidget( { |
| − | label: 'Information', | + | label: 'label' |
| − | classes: [ 'todo-info' ]
| |
| | } ); | | } ); |
| − | info.setLabel( mw.cookie.get("UseDC"));
| |
| | | | |
| | | | |
| − | input.on( 'enter', function () { | + | button.on( 'enter', function () { |
| − | mw.cookie.get('my_wikiUserName' ); | + | mw.storage.set( key.getValue(), value.getValue() ); |
| − | | |
| | }); | | }); |
| | | | |
| Line 27: |
Line 29: |
| | // Append the app widgets | | // Append the app widgets |
| | $( '#mw-content-text' ).prepend( | | $( '#mw-content-text' ).prepend( |
| − | "hello",
| + | key.$element, |
| − | mw.cookie.get('my_wikiUserName' ),
| + | value.$element, |
| − | input.$element,
| + | button.$element, |
| − | info.$element | + | info.$element |
| | ); | | ); |
| | | | |