Changes

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

Navigation menu