Changes

Jump to navigation Jump to search
no edit summary
Line 8: Line 8:  
mw.loader.using( 'oojs-ui-core' ).done( function () {
 
mw.loader.using( 'oojs-ui-core' ).done( function () {
 
$( function () {
 
$( function () {
var input = new OO.ui.TextInputWidget( {
+
var name = new OO.ui.TextInputWidget( {
placeholder: 'This is an entry box'
+
placeholder: 'cookie name'
 
} );
 
} );
 
 
 
input.on( 'enter', function () {
 
input.on( 'enter', function () {
// Check for duplicates and prevent empty input
+
            mw.cookie.set( name.getValue(), 'unknown' );
if ( list.findItemFromData( input.getValue() ) ||
+
 
input.getValue() === '' ) {
+
        }
input.$element.addClass( 'todo-error' );
  −
return;
  −
}
   
 
 
} );
 
} );

Navigation menu