User:Legoktm/i8.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
//Quick way to add <nowiki>{{db-i8}}</nowiki> onto an image page //Please do not use without reading [[WP:CSD#I8]] and [[WP:MITTC]] if(wgNamespaceNumber == 6) { if(wgAction == 'edit' || wgAction == 'submit') { addOnloadHook(function () { addPortletLink('p-cactions','javascript:doi8()','i8','ca-i8'); }); } else { var url = wgServer + wgScript + '?title=' + encodeURIComponent(wgPageName) + '&action=edit&autoi8=true'; addOnloadHook(function () { addPortletLink('p-cactions',url,'i8','ca-i8'); }); } } if(queryString('autoi8')) addOnloadHook(function() { doi8(); }) function doi8() { var txt = document.getElementById('wpTextbox1'); if(!txt) return; txt.value = '{' + '{' + 'db-i8}}\n\n' + txt.value; document.getElementById('wpSummary').value += 'tagging for [[WP:SD|speedy deletion]] per [[WP:CSD#I8|CSD I8]]'; document.getElementById('wpSave').click(); } function queryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } } return null; }