User:Takiten/monobook.js and Alex Plante: Difference between pages

(Difference between pages)
Content deleted Content added
Takiten (talk | contribs)
No edit summary
 
No edit summary
 
Line 1:
{{Infobox Ice Hockey Player
/*<pre>*/
| image =
//On diff pages this script replaces ''(Difference between revisions)''with
| image_size =
//different tools for reverting the edit and warning the user that made the edit.
| position = [[Defenseman (ice hockey)|Defenseman]]
//For instructions see talk page.
| shoots = Left
// Revert tools by Lorian
| height_ft = 6
function getElementsByClass(searchClass,node,tag) {
| height_in = 4
// Function from http://www.dustindiaz.com/getelementsbyclass/
| weight_lb = 225
var classElements = new Array();
| nickname =
if ( node == null )
| nationality = CAN
node = document;
| birth_date = {{birth date and age|1989|5|9}}
if ( tag == null )
| birth_place = [[Brandon, Manitoba]]
tag = '*';
| career_start = TBA
var els = node.getElementsByTagName(tag);
| career_end =
var elsLen = els.length;
| team = [[Edmonton Oilers]]
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
| league = [[National Hockey League|NHL]]
for (i = 0, j = 0; i < elsLen; i++) {
| prospect_league = [[Western Hockey League|WHL]]
if ( pattern.test(els[i].className) ) {
| prospect_team = [[Calgary Hitmen]]
classElements[j] = els[i];
| halloffame =
j++;
}}
}
'''Alex Plante''' (born [[May 9]], [[1989]] in [[Brandon, Manitoba]]) is an ice hockey defenceman. He plays for the [[Calgary Hitmen]] of the [[Western Hockey League]], and was drafted by the [[Edmonton Oilers]] 15th overall in the [[2007 NHL Entry Draft]].
}
return classElements;
}
 
// _GET code from NoGray JS Library http://www.nogray.com/new_site/
var _GET = new Array();
var _uri = ___location.href;
 
==External links==
var _temp_get_arr = _uri.substring(_uri.indexOf('?')+1, _uri.length).split("&");
[http://whl.ca/en/stats/player.php?id=24221 WHL Page]
 
{{Canada-icehockey-player-stub}}
var _temp_get_arr_1 = new Array();
{{DEFAULTSORT:Plante, Alex}}
 
[[Category:1989 births]]
for(_get_arr_i=0; _get_arr_i<_temp_get_arr.length; _get_arr_i++){
[[Category:Canadian ice hockey players]]
_temp_get_arr_1 = _temp_get_arr[_get_arr_i].split("=");
[[Category:Edmonton Oilers draft picks]]
_GET[decodeURI(_temp_get_arr_1[0])] = decodeURI(_temp_get_arr_1[1]);
[[Category:Hockey prospects]]
}
[[Category:Manitoba sportspeople]]
 
[[Category:National Hockey League first round draft picks]]
delete _uri; delete _temp_get_arr; delete _temp_get_arr_1;
 
function getMessage (where, user1, user2) {
var message = prompt ('What message would you like to leave?', '');
window.___location = 'http://en.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&'+where+'=2&user1='+user1+'&user2='+user2+'&message='+message;
}
 
addOnloadHook(function (){
if (___location.href.match(/diff=/)) {
// Get username of submitter
var user1 = getElementsByClass('diff-otitle',null,'td'); user1 = user1[0].getElementsByTagName('a')[2].innerHTML;
var user2 = getElementsByClass('diff-ntitle',null,'td'); user2 = user2[0].getElementsByTagName('a')[3].innerHTML;
document.getElementById('contentSub').innerHTML = '(<a href="http://en.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&revert=1&user1='+user1+'&user2='+user2+'">Revert</a> / <a href="javascript:var message = getMessage(\'revert\', \''+user1+'\', \''+user2+'\');">Message</a>) (<a href="http://en.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&vandalism=1&user1='+user1+'&user2='+user2+'">Vandalism</a> / <a href="javascript:var message = getMessage(\'vandalism\', \''+user1+'\', \''+user2+'\');">Message</a>) (Warn: <a href="http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=1">Test</a> / <a href="http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=2">Blatant</a> / <a href="http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=3">Nonsense</a> / <a href="http://en.wikipedia.org/w/index.php?title=User_talk:'+user2+'&action=edit&section=new&warn=4">Blanking</a>)';
} else if (___location.href.match(/revert=1/)) {
document.getElementById('wpSummary').value = 'Reverted edits by Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+' to last version by Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+'';
document.getElementById('editform').submit();
} else if (___location.href.match(/revert=2/)) {
document.getElementById('wpSummary').value = 'Reverted edits by Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+' to last version by Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+' ('+_GET['message']+')';
document.getElementById('editform').submit();
} else if (___location.href.match(/vandalism=1/)) {
document.getElementById('wpSummary').value = 'Reverted vandalism by Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+' to last version by Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+'';
document.getElementById('editform').submit();
} else if (___location.href.match(/vandalism=2/)) {
document.getElementById('wpSummary').value = 'Reverted vandalism by Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+' to last version by Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+' ('+_GET['message']+')';
document.getElementById('editform').submit();
} else if (___location.href.match(/warn=1/)) {
document.getElementById('wpSummary').value = 'Vandalism warning';
document.getElementById('wpTextbox1').value = '{{sub'+'st:test}} ~~'+'~~';
document.getElementById('editform').submit();
} else if (___location.href.match(/warn=2/)) {
document.getElementById('wpSummary').value = 'Vandalism warning';
document.getElementById('wpTextbox1').value = '{{sub'+'st:blatantvandal}} ~~'+'~~';
document.getElementById('editform').submit();
} else if (___location.href.match(/warn=3/)) {
document.getElementById('wpSummary').value = 'Vandalism warning';
document.getElementById('wpTextbox1').value = '{{sub'+'st:test2}} ~~'+'~~';
document.getElementById('editform').submit();
} else if (___location.href.match(/warn=4/)) {
document.getElementById('wpSummary').value = 'Vandalism warning';
document.getElementById('wpTextbox1').value = '{{sub'+'st:test2a}} ~~'+'~~';
document.getElementById('editform').submit();
}
});
/*</pre>*/