Difference between revisions of "User:Pdehaye/common.js"

From Wikibase Personal data
Jump to navigation Jump to search
(Created page with " // Button: mw.loader.using( 'oojs-ui-core' ).done( function () { $( function () { var input = new OO.ui.TextInputWidget( { placeholder: 'This is an entry box' } );...")
 
(Replaced content with "// wrong page")
Tag: Replaced
 
Line 1: Line 1:
 
+
// wrong page
 
 
// 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);
 
 
 
} );
 
 
 
} );
 

Latest revision as of 00:29, 18 May 2019

// wrong page