You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
/**
* Adds an AI Artwork button to the image uploader page
*/
$(document).ready(function() {
if (mw.config.get('wgCanonicalSpecialPageName') === 'Upload') {
// checkbox element
var checkboxHtml = `
<td class="mw-label"><label for="aiCheckbox">AI Artwork?:</label></td>
<td class="mw-input"><input type="checkbox" id="aiCheckbox"></td>
`;
// Insert the checkbox element after the Licensing row
$('td.mw-label label[for="wpLicense"]').closest('tr').after('<tr>' + checkboxHtml + '</tr>');
// Update the destination filename when the checkbox value changes
$('#aiCheckbox').change(function() {
var destFileInput = $('#wpDestFile');
var currentFilename = destFileInput.val();
if ($(this).prop('checked')) {
// Prepend "-ai-" if checkbox is checked
if (!currentFilename.startsWith("-ai-")) {
destFileInput.val("-ai-" + currentFilename);
000
1:0
Return to MediaWiki:Common.js.