Revision 12135256 of "Järjestelmäviesti:Sysop.js" on fiwiki/** Ylläpitäjien JavaScript-työkalut ***************************************/
/** Poistosyiden sensurointi ***********************************************
*
* Kuvaus: Sensuroi poistosyyn automaattisesti ja antaa mahdollisuuden
* palauttaa alkuperäisen syyn.
* Toimivuus testattu Internet Explorer 7:lla ja Mozilla Firefox 3.0:lla.
* Ylläpitäjä: [[Käyttäjä:Str4nd|str4nd]]
*/
if (wgAction == 'delete' && !location.href.match(/submitdelete=true/)) { // vain poistosivulla
// _GET code from NoGray JS Library http://www.nogray.com/new_site/
var _GET = new Array();
var _uri = location.href;
// Poistetaan Wikitrustin värikoodaukset urlista.
var _uri = _uri.replace(/%3C(?:.|\n)*?%3E/gm, "");
var _temp_get_arr = _uri.substring(_uri.indexOf('?')+1, _uri.length).split("&");
var _temp_get_arr_1 = new Array();
for(_get_arr_i=0; _get_arr_i<_temp_get_arr.length; _get_arr_i++){
_temp_get_arr_1 = _temp_get_arr[_get_arr_i].split("=");
_GET[decodeURI(_temp_get_arr_1[0])] = decodeURI(_temp_get_arr_1[1]);
}
delete _uri; delete _temp_get_arr; delete _temp_get_arr_1;
if (!location.href.match(/wpDeleteReasonID=/)) {
document.getElementById('wpDeleteReasonList').options[1].selected = false; // Valitaan ensimmäinen valmissyylistasta
} else { // jos ollaan määritetty wpDeleteReasonID, valitaan valmissyylistasta syy ID:n mukaan
document.getElementById('wpDeleteReasonList').options[_GET['wpDeleteReasonID']].selected = true;
}
}
// Poistokriteerin automaattinen täyttäminen Roskaa-mallineen perusteella.
// Mukailtu englanninkielisestä Wikipediasta, jossa koodin kirjoitti käyttäjä Happy-Melon
addOnloadHook(function() {
if ( document.getElementById('ca-delete') && document.getElementById('delete-criterion') ) {
var link = document.getElementById('ca-delete').getElementsByTagName('A')[0];
var reason = document.getElementById('delete-reason').innerHTML;
var criterionIndex = document.getElementById('delete-criterion').innerHTML;
if(criterionIndex == null || criterionIndex == '') {
criterionIndex = 0;
}
link.setAttribute( 'href' , link.getAttribute('href') + '&wpDeleteReasonID=' + criterionIndex + '&wpReason=' + reason );
}
});All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://fi.wikipedia.org/w/index.php?oldid=12135256.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|