MediaWiki talk:Gadget-checkConstraints.js
Latest comment: 6 years ago by Jonas Kress (WMDE)
Please load the gadget JS code from the introduced resource loader module of the constraint extension via mw.loader.using( 'wikibase.quality.constraints.gadget' ). Thanks!--Jonas Kress (WMDE) (talk) 10:59, 29 June 2017 (UTC)
- No, I think it would be better to completely clear this file (except perhaps for a comment) and load the module in the gadget definition directly:
- * checkConstraints[ResourceLoader|dependencies=wikibase.quality.constraints.gadget]|checkConstraints.js
- See also the WBQC documentation. --Lucas Werkmeister (WMDE) (talk) 11:51, 29 June 2017 (UTC)
- For backwards compatibility with loading from personal scripts, I would do either. I think RL prevents loading the same module twice. Matěj Suchánek (talk) 12:11, 29 June 2017 (UTC)
- Good point, that makes sense. Thanks! --Lucas Werkmeister (WMDE) (talk) 12:54, 29 June 2017 (UTC)
- Per search no user script points to MediaWiki:Gadget-checkConstraints.js. There are some user script that points to User:Jonas Kress (WMDE)/check constraints.js. There should the backwards compatibility script be installed. Not in MediaWiki:Gadget-checkConstraints.js. --Fomafix (talk) 13:05, 29 June 2017 (UTC)
- That page “redirects” to MediaWiki:Gadget-checkConstraints.js, so the fallback should still work, no? --Lucas Werkmeister (WMDE) (talk) 13:57, 29 June 2017 (UTC)
- The fallback works anyway as far as I see. But it is difficult to remove a backward compatibility some time. I suggest not to introduce a backward compatibility where it is not needed. --Fomafix (talk) 12:47, 30 June 2017 (UTC)
- When will the backward compatibility get removed? --Fomafix (talk) 11:10, 26 July 2017 (UTC)
- Per search, it looks like 75 users still link to Jonas’ subpage. Can we send them a MassMessage or something like that?
- In the meantime, we could also add the module inclusion to Jonas’ subpage, and then already clear out this page, since no one seems to link to it directly. --Lucas Werkmeister (WMDE) (talk) 13:37, 26 July 2017 (UTC)
- That is exactly what I wrote above. A warning can also generated by JavaScript for the users that include the JavaScript file. --Fomafix (talk) 15:39, 26 July 2017 (UTC)
- That page “redirects” to MediaWiki:Gadget-checkConstraints.js, so the fallback should still work, no? --Lucas Werkmeister (WMDE) (talk) 13:57, 29 June 2017 (UTC)
- For backwards compatibility with loading from personal scripts, I would do either. I think RL prevents loading the same module twice. Matěj Suchánek (talk) 12:11, 29 June 2017 (UTC)
Alright. @Jonas Kress (WMDE): Can you set User:Jonas Kress (WMDE)/check constraints.js to the following content?
( function( mw ) {
mw.loader.using( 'wikibase.quality.constraints.gadget' );
mw.loader.using( 'mediawiki.notification' ).then( function() {
mw.notification.notify(
$( '<span>' )
.append( 'The ' )
.append(
$( '<tt>' )
.text( 'check_constraints.js' ) )
.append( ' user script will be removed soon. ' )
.append( 'Please remove it from ' )
.append(
$( '<a>' )
.attr( 'href', '/wiki/Special:MyPage/common.js' )
.text( 'your common.js' ) )
.append( ' and instead enable the ' )
.append(
$( '<i>' )
.text( 'checkConstraints' ) )
.append( ' gadget in your ' )
.append(
$( '<a>' )
.attr( 'href', '/wiki/Special:Preferences#mw-prefsection-gadgets' )
.text( 'preferences' ) )
.append( '.' ),
{
autoHideSeconds: 'long',
type: 'warn'
}
);
} );
} )( mediaWiki );
Once that’s done, the fallback can be removed from this page. --Lucas Werkmeister (WMDE) (talk) 12:15, 27 July 2017 (UTC)
- Done! --Jonas Kress (WMDE) (talk) 15:41, 27 July 2017 (UTC)