User:Will130/common.js

function addActionButton(text, callback) { var $link = $('' + text + '').click(callback); $('#p-views ul').prepend(   $('').append($(' ').append($link))  ); }

(function{ if (mw.config.get('wgAction') === 'edit') {    addActionButton('Redirect', function (event) { var $box = $('#wpTextbox1'); var s = '#REDIRECT Fi'+'le:' + $box.val + '\n';     s    += '[[Cat'+'egory:PL image redirects';      $box.val(s);    });  } });

var img = document.createElement("img"); img.src = "https://static.wikia.nocookie.net/ucp-internal-test-starter-commons/images/4/49/Flag_gb.svg/revision/latest?cb=20200818142916"; img.width = 30; var src = document.getElementById("editpage-copywarn"); src.appendChild(img);

var img2 = document.createElement("img"); img2.src = "https://static.wikia.nocookie.net/ucp-internal-test-starter-commons/images/1/1e/Flag_us.svg/revision/latest?cb=20200818142636"; img2.width = 30; var src = document.getElementById("editpage-copywarn"); src.appendChild(img2);