User talk:Equazcion/SkipFileWizard.js
Latest comment: 8 years ago by Mr. Stradivarius in topic Edit request: update and clean up code
Edit request: update and clean up code edit
This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
This userscript relies on outdated and deprecated methods, so I would suggest the following update, which I have written myself basically from scratch. The functionality is the same, but the code is (I hope) cleaner and easier to understand and maintain. Please replace the entire script with the one below.
if (typeof SkipFileWizardOption == 'undefined') {
SkipFileWizardOption = 'FileSpace';
}
$( 'a.new[href*="wpDestFile"]' ).attr( 'href', function (index, value) {
if ( SkipFileWizardOption == 'FileSpace' ) {
var fileTitle = mw.util.getParamValue( 'wpDestFile', value );
var fileName = mw.config.get( 'wgFormattedNamespaces' )[6] + ':' + fileTitle;
var params = {
action: 'edit',
redlink: 1
};
return mw.util.getUrl( fileName, params );
} else {
return mw.util.getUrl( 'Special:Upload' );
}
} );
— Preceding unsigned comment added by HueSatLum (talk • contribs) 16:11, 24 July 2015