Changes

Jump to navigation Jump to search
no edit summary
Line 5: Line 5:  
  * https://phabricator.wikimedia.org/T107693
 
  * https://phabricator.wikimedia.org/T107693
 
  *
 
  *
  * @author [[User:Efly]]
+
  * @author [https://meta.wikimedia.org/wiki/User:Efly]
 
  */
 
  */
  −
mw.notify( $('<span>Gadget <a href="https://wiki.personaldata.io/wiki/User:Podehaye/Gadget-CreateNewItem.js">CreateNewItem</a> loaded this time! Yay!</span>') );
      
( function ( $, mw ) {
 
( function ( $, mw ) {
 
'use strict';
 
'use strict';
        mw.notify( $('<span>code is run</span>') );
  −
  −
   
// To translators:
 
// To translators:
 
// $1 is the original error message (e.g. "No match was found.")
 
// $1 is the original error message (e.g. "No match was found.")
Line 20: Line 15:  
switch ( mw.config.get( 'wgUserLanguage' ) ) {
 
switch ( mw.config.get( 'wgUserLanguage' ) ) {
 
default:
 
default:
 +
mw.messages.set( {
 +
'not-found-message': '$1. Create new item...'
 +
} );
 +
break;
 
case 'en':
 
case 'en':
 
mw.messages.set( {
 
mw.messages.set( {
Line 50: Line 49:     
function openNewItemPopup( currentField ) {
 
function openNewItemPopup( currentField ) {
                mw.notify( $('<span>openNewItemPopup</span>') );
   
// .submit( requestDeletion )
 
// .submit( requestDeletion )
 
var currentLabel = currentField.val();
 
var currentLabel = currentField.val();
Line 88: Line 86:     
function init() {
 
function init() {
 +
//                mw.notify( $('<span>init Gadget-CreateNewItem</span>') );
 
var currentField = $( 'input' );
 
var currentField = $( 'input' );
 
var willEntitySelectorListUpdate = false;
 
var willEntitySelectorListUpdate = false;
Line 108: Line 107:  
return false;
 
return false;
 
} );
 
} );
$innerA.text( mw.message( 'not-found-message', $innerA.text(), $( '#n-special-newitem' ).text() ) );
+
$innerA.text( mw.message( 'not-found-message', $innerA.text(),  
 +
// $( '#n-special-newitem' ).text()  
 +
"Create New Item"
 +
) );
 
}
 
}
 
}
 
}

Navigation menu