Changes

Jump to navigation Jump to search
no edit summary
Line 2: Line 2:     
mw.loader.load( '//wiki.personaldata.io/w/index.php?title=User:Podehaye/button.js&action=raw&ctype=text/javascript' ); // front button for testing
 
mw.loader.load( '//wiki.personaldata.io/w/index.php?title=User:Podehaye/button.js&action=raw&ctype=text/javascript' ); // front button for testing
 +
 +
 +
 +
// Button:
 +
mw.loader.using( 'oojs-ui-core' ).done( function () {
 +
$( function () {
 +
var input = new OO.ui.TextInputWidget( {
 +
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;
 +
}
 +
 +
} );
 +
 +
// Append the app widgets
 +
  $( '#mw-content-text' ).prepend(
 +
input.$element);
 +
 +
} );
 +
 +
} );

Navigation menu