function getPname() {
z=document.getElementById("content").childNodes;
for (var n=0;n<z.length;n++) {
if (z.className=="firstHeading") {
var text = z.textContent ? z.textContent : z.innerText;
return text;
}
}
}
function import_module(page){
if( document.createElement && document.childNodes ) {
var url =
'http://en.wikipedia.org/w/index.php?title=' +
page +
'&action=raw&ctype=text/javascript';
var scriptElem = document.createElement('script');
scriptElem.setAttribute('src',url);
scriptElem.setAttribute('type','text/javascript');
document.getElementsByTagName('head').appendChild(scriptElem);
}
}
function replace() {
var s = prompt("Search regexp?");
if(s) {
var r = prompt("Replace regexp?");
if(!r && r != '') return;
var txt = document.editform.wpTextbox1;
txt.value = txt.value.replace(new RegExp(s, "g"), r);
}
}
// User:Gimmetrow/replace.js
addOnloadHook(function () {
if(document.forms.editform) {
addLink('p-cactions', 'javascript:replace()', 'replace', 'ca-replace', 'Regexp replace for the edit window', '', 'ca-history');
}
});
var ta=
function addLink(where, url, name, id, title, key, after){
//* where is the id of the toolbar where the button should be added;
// i.e. one of "p-cactions", "p-personal", "p-navigation", or "p-tb".
//
//* url is the URL which will be called when the button is clicked.
// javascript: urls can be used to do more complex things.
//
//* name is what will appear as the name of the button.
//
//* id is the id of the button; it's best to define one.
// Use a prefix to make sure its unique. Optional.
//
//* title is the tooltip title that gives a longer description
// of the button; if you define a accesskey, mention it here. Optional.
//
//* key is the char you want for the accesskey. Optional.
//
//* after is the id of the button you want to follow this one. Optional.
//
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
if(id) li.id = id;
li.appendChild(na);
var tabs = document.getElementById(where)
tabs=tabs.getElementsByTagName('ul');
if(after) {
tabs.insertBefore(li,document.getElementById(after));
} else {
tabs.appendChild(li);
}
if(id) {
if(key && title) { ta = ; }
else if(key) { ta = ; }
else if(title) { ta = ;}
}
// re-render the title and accesskeys from existing code in wikibits.js
akeytt();
return li;
}
function getElementsByClassName(oElm, strTagName, strClassName){
var arrElements=(strTagName=="*"&&oElm.all)?oElm.all:
oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
strClassName = strClassName.replace(/\-/g, "\\-");
var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
var oElement;
for(var i=0; i<arrElements.length; i++){
oElement = arrElements;
if(oRegExp.test(oElement.className)){
arrReturnElements.push(oElement);
}
}
return (arrReturnElements)
}
function getelbyclass(cls){
var e=getElementsByClassName(document,"*",cls)
return e?e:null
}
function getspclpagelist(cls){
var e=document.getElementById("bodyContent")
e=e.getElementsByTagName("ul")
return e?e:null
}
function sortfunc(a,b){
return a-b
}
function sortlist(){
var a=
var listel=getelbyclass('special')
var list=listel.childNodes
for(var i=0;i<list.length;i++){
var itxt=list.innerText
itm=itxt.match(/\+)\s+bytes/i)
if(itm&&itm){
itm=parseInt(itm.replace(//g,""))
a=,itm]
} else {
a=,0]
}
}
a=a.sort(sortfunc)
for(var i=0;i<a.length;i++){
listel.appendChild(a)
}
}
function removeimagereverts(){
var a=
var listel=getspclpagelist()
var list=listel.childNodes
for(var i=0;i<list.length;i++){
var itxt=list.innerText
if(/reverted\s+to\s+earlier/i.exec(itxt)){
a=list
}
}
for(var i=0;i<a.length;i++){
listel.removeChild(a)
}
}
var oldonload=onload
onload=function(){
addLink("p-navigation",'javascript:sortlist()',"Sort items","poccil-sort")
addLink("p-navigation",'javascript:removeimagereverts()',
"Remove image reverts","poccil-noimgrev")
if(oldonload)oldonload()
}
function importPage(site){
var s=site.replace(/ /g,"_")
s = s.replace(/^\\]$/, '');
s=escape(s)
s=s.replace(/(])/g,
function(a,b){
return "%"+b.charCodeAt(0).toString(16).toUpperCase()
})
var x='<scr'+'ipt type="text/javascript" src="http://en.wikipedia.org/w/index.php?title='
+ s + '&action=raw&ctype=text/javascript&dontcountme=s"></sc'+'ript>'
// alert(x)
document.write(x);
}
//Import two prerequisites for some scripts.
importPage('Wikipedia:WikiProject User scripts/Scripts/addLink');
importPage('Wikipedia:WikiProject User scripts/Scripts/addTab');
if(0){
//add in cacyle's editor
// include comfortable javascript editor by cacycle
// levels of undo (each level holds the whole text)
undoBufferMax = 20;
// style for preview box
stylePreviewBox = 'background-color: #f9f9f9;';
// style for custom edit buttons
styleButtons = 'font-size: smaller; padding-left: 0.1em; padding-right: 0.1em';
// presets for input field dropdown options
findHistoryLength = 10;
// preset for combo box select options
presetOptions = ;
presetOptions = [
'Copyedit',
'Linkfix',
'Reverting vandalism',
'Formatting source text'
];
// expiration time span for history cookies in seconds
cookieExpireSec = (365 * 24 * 60 * 60);
// enable cursor horizontal position memory
cursorMemory = true;
// show at least this number of lines ahead of cursor movement
scrollMargin = 1;
// show at least this number of lines ahead of cursor movement for
findMargin = 2;
// find ahead checkbox selected by default
findAheadSelected = true;
// css for change indicators
styleDelete = 'font-weight: normal; text-decoration: none; color: #ffffff; background-color: #990033;';
styleInsert = 'font-weight: normal; text-decoration: none; color: #ffffff; background-color: #009933;';
styleMoved = 'font-weight: bold; vertical-align: text-bottom; font-size: xx-small; padding: 0; border: solid 1px;';
styleBlock = [
'background-color: #ffff44;',
'background-color: #b0ff90;',
'background-color: #ffcc99;',
'background-color: #99ffff;',
'background-color: #99ccff;',
'background-color: #cc99ff;',
'background-color: #ff99cc;',
'background-color: #ffd040;',
'background-color: #d0d0d0;'
];
// html for change indicators, {number} is replaced by the block number, {block} is replaced by the block style
htmlMovedRight = '<input type="button" value=">" style="' + styleMoved + ' {block}">';
htmlMovedLeft = '<input type="button" value="<" style="' + styleMoved + ' {block}">';
htmlBlockStart = '<span style="{block}">';
htmlBlockEnd = '</span>';
htmlDeleteStart = '<del style="' + styleDelete + '">';
htmlDeleteEnd = '</del>';
htmlInsertStart = '<ins style="' + styleInsert + '">';
htmlInsertEnd = '</ins>';
// minimal number of real words for a moved block (0 for always displaying block move indicators)
blockMinLength = 3;
// exclude identical sequence starts and endings from change marking
wordDiff = true;
// enable recursive diff to resolve problematic sequences
recursiveDiff = true;
// enable block move display
showBlockMoves = true;
}
importPage(']')
function getAnchors() {
var s=, anchs=document.getElementsByTagName('A');
for (var i=0; i<anchs.length; ++i) if (anchs.name && anchs.name!='top')
s.push(anchs.name);
return s;
}
window.handleKeys=function(evt){
if (window.handleKeys.disabled) {
return true;
}
var k = window.event ? window.event.keyCode : ( evt.keyCode ? evt.keyCode : evt.which);
if (!k) return;
var letter=String.fromCharCode(k);
switch (letter) {
case 'j': changeAnchor(1); return false;
case 'J': changeAnchor('last'); return false;
case 'k': changeAnchor(-1); return false;
case 'K': changeAnchor('first'); return false;
default: return true;
}
}
window.handleKeys.disabled=false;
window.handleKeys.disableFlags=;
function setupFocusHandlers(elType, startAt) {
var inputs=document.getElementsByTagName(elType);
var j=startAt || 0;
for (var i=0; i<inputs.length; ++i) {
if (elType=='input' && inputs.type.toLowerCase()!='text') { continue; }
window.handleKeys.disableFlags=false;
inputs.onfocus=function(){ window.handleKeys.disableFlags=true; updateDisabledFlag(); }
inputs.onblur=function(){ window.handleKeys.disableFlags=false; updateDisabledFlag(); }
++j;
}
//alert(j + ' handlers installed');
return j;
}
function updateDisabledFlag() {
for (var i=0; i<window.handleKeys.disableFlags.length; ++i) {
if (window.handleKeys.disableFlags===true) {
window.handleKeys.disabled=true;
return true;
}
}
window.handleKeys.disabled=false;
return false;
}
var anchs, pos;
window.changeAnchor=function(step, loop) {
if(!anchs && !(anchs=getAnchors()) ) return;
var loc=document.location.toString().split('#');
switch (step) {
case 'first': pos=0; break;
case 'last': pos=anchs.length-1; break;
default:
if (loc.length > 0) {
var target=loc.slice(1).join('#');
for (var i=0; i<anchs.length; ++i) { if (anchs==target) { pos=i; break; } }
}
if(typeof pos==='number') {
pos += step;
if (loop) { while(pos < 0) pos += anchs.length; pos %= anchs.length; }
else { if (pos<0) pos=0; if(pos>=anchs.length) pos=anchs.length-1; }
}
else pos = 0;
} /* switch */
var newloc=loc + '#' + anchs;
if(document.location!=newloc) document.location=newloc;
}
var sectionKeysPage=( ! /^(Editing|Search -|Confirm|Move page|Logs|E-mail user|All pages|Block user)/.test(document.title)
&&
! /(=|wiki\/)pecial:/.test(document.location) );
if (sectionKeysPage) {
addOnloadHook(function(){
var j=setupFocusHandlers('input');
setupFocusHandlers('textarea', j);
document.onkeypress=window.handleKeys;
});
}
if(0){
// CHECK THAT I'VE REMEMBERED TO SIGN TALK PAGES AND IF SURE DO IT AUTOMATIC:
// *** aut. signing / (automatische Unterschrift) *** 23. Apr. 2006 by ]
// updated by ] v1.43
//<pre><nowiki>
// helper-function
String.prototype.trim = function(){return this.replace(/^\s*|\s*$/g,"")};
addOnloadHook(function () {
if(!document.editform) return;
title = document.title; // Object to String
// regarded pages
regpages=new Array('talk:', 'Talk:', ':Village pump', ':Articles for deletion', ':Requests for adminship', ':Current surveys');
for (p in regpages)
if(title.indexOf(regpages)!=-1){
regpages=false;
break
}
if(regpages) return;
var txtObj=document.editform.wpTextbox1;
var txtOld=txtObj.value.trim();
txtOld_l=txtOld.length
var txtOldEnd=txtOld.slice(-24);
function doSign(){
if(document.editform.onsubmit==''){ // only once!
removeEvent(document.editform.wpSave,"click",doSign);
removeEvent(document.editform.wpPreview,"click",doSign);
}
if(document.editform.wpMinoredit.checked) return true;
signing = ' --\ ~\~\~ ~\~\~\~\~\n';
if(!txtObj.value.match(/~{3}/)){
txt=txtObj.value.trim();
txtEnd=txt.slice(-24);
if(txtOldEnd!=txtEnd) return txtObj.value = txt + signing; // aut. underwrite
else { // post between
pos = getCaretPos(txtObj);
pos = txt.indexOf('\n', pos); // go to the post-end
txtEnds = txt.substr(pos,24).replace(/^\s*/,""); // after
txtpEnds = txt.slice(pos-18,pos); // before
olldp = txtOld.indexOf(txtEnds);
if(olldp!=-1 && olldp < pos - 3 && txtOld.search(txtpEnds+txtEnds)==-1) // if some added
return txtObj.value = txt.slice(0,pos).trim() + signing + txt.slice(pos+1);
}
// FIXME: the edit-end is not found
}
else if(txtOld.search(/~{3}/)==-1 || !txtOld.match(/<nowiki>.*?~{3}.*?<\/nowiki>/i)) return 1;
else if(txtOld.match(/~{3}/g).length < txtObj.value.match(/~{3}/g).length) return 1;
return document.editform.onsubmit=new Function("document.editform.onsubmit='';return confirm('No signing was found. Save anyway?')");
};
addEvent(document.editform.wpSave,"click", doSign)
addEvent(document.editform.wpPreview,"click", doSign)
});
}
function getCaretPos(txtObj) {
if(txtObj.setSelectionRange) return txtObj.selectionStart; // NS like
else if(!document.selection) return 0; // not IE like
txtObj.focus();
var c="\001", pos=0;
var range=document.selection.createRange();
var txt=range.text, dul=range.duplicate();
dul.moveToElementText(txtObj);
range.text=txt+c;
pos=(dul.text.indexOf(c));
range.moveStart('character',-1);
range.text="";
return pos;
};
function addEvent(obj,type,fn){if(obj.addEventListener){obj.addEventListener(type,fn,false)}else if(obj.attachEvent){var eProp=type+fn;obj=fn;obj=function(){obj(window.event)};obj.attachEvent("on"+type,obj)}else{obj=fn}};
function removeEvent(obj,type,fn){if(obj.removeEventListener){obj.removeEventListener(type,fn,false)}else if(obj.detachEvent){var eProp=type+fn;obj.detachEvent("on"+type,obj);obj=null;obj=null}else{obj=null}};
//*** end ***
//</nowiki></pre>
// Interwiki <noinclude>]</noinclude>
//User:Lupin/popups.js
popupShortcutKeys=true; // optional: enable keyboard shortcuts
popupAdminLinks=false; // optional: enable admin links
popupDelay=.7;
popupFixRedits=true;
popupInitialWidth=200;
popupFixRedirs=true;
popupFixDabs=true;
popupLastModified=true;
popupMaxPreviewSentences=1;
popupImages=false;
popupSubpopups=true;
popupWatchRedirredPages=false;
popupRedirAutoClick='wpSave';
popupRedlinkRemoval=true;
popupLastModified=true;
popupDiffDates=true;
popupOnlyArticleLinks=true;
imagePopupsForImages=false;
popupStructure='fancy2';
importPage(']')
importPage('Wikipedia:WikiProject_User_scripts/Scripts/Fix_diff_width');
//Formats the article by removing excess whitespace and simplifying links.
importPage('Wikipedia:WikiProject User scripts/Scripts/Formatter');
importPage(']')
importPage(']')
/* Syntax highlighter */
if(document.title.indexOf(".js") == -1) // Ignore pages that end in .js
addOnloadHook(function () {
/* CSS syntax highlighting */
multicommentRE = new RegExp('(/\\**?\\*/)', 'g');
ruleRE = new RegExp('(+)\\{(+)\\}', 'g');
idselectorRE = new RegExp('(#+)\\b', 'g');
classselectorRE = new RegExp('(\\.+)\\b', 'g');
pairRE = new RegExp('(+):(+);', 'g');
css = document.getElementsByTagName('pre');
for (i = 0; i < css.length; i++) {
c = css;
content = c.innerHTML;
content=content.replace(multicommentRE, '<span class="comment">$1</span>');
content = content.replace(ruleRE, function(text, selector, body) {
selector = selector.replace(idselectorRE, '<span class="idselector">$1</span>');
selector = selector.replace(classselectorRE, '<span class="classselector">$1</span>');
body = body.replace(pairRE, '<span class="property">$1</span>:<span class="value">$2</span>;');
return selector + '{' + body + '}';
});
c.innerHTML = content;
}
});
importPage('User:Zocky/SearchBox.js');
importPage("User:Lupin/recent2.js");
/* <pre> */
/* This function is used to include scripts from other Wikipedia pages in mine. I got it from ]. */
function winc(s) {
s = s.replace(/^\\]$/, '');
document.write('<scr' + 'ipt type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=' + s
+ '&action=raw&ctype=text/javascript&dontcountme=s"></scr'
+ 'ipt>');
}
/* Included functions */
winc(']'); /* Adds links to lists on the page, such as the personal tools section */
winc(']');
winc(']');
winc(']');
winc(']');
/* Add some extra tabs with different functionalities. */
winc(']'); // Regex replacements in the text (from ])
winc(']'); // Tag unverified images (from ])
// winc(']'); // Shows difference between my last edit and current version (])
winc(']'); // Converts -- into — and so on (User:Omegatron)
winc(']'); // Formats units according to SI (User:Omegatron)
winc(']'); // Fixes up some math characters (not TeX) (User:Omegatron)
winc(']'); // Adds and removes whitespace to make formatting consistent and readable (User:Omegatron)
/* This function is used to include individual scripts from Quarl's pages in mine. */
function qinc(s) {
// alert("qinc")
var x='<scr' + 'ipt type="text/javascript" src="'
+ 'http://wikipedia.quarl.org/scripts/' + s
+ '.js"></scr'
+ 'ipt>'
// alert(x)
document.write(x);
}
/* All kinds of scripts from ] */
if(0){
qinc('module');
qinc('datetime');
qinc('msg');
qinc('util');
qinc('wikiwidget');
qinc('wikins');
qinc('wikipage');
}
var $diff = new Object()
var $util = new Object()
$util.trimSpaces = function(s) {
if (!s) return s;
s = s.replace(/^\s+/,'');
s = s.replace(/\s+$/,'');
return s;
}
function ReverseString(s) {
var ret = '';
for (var i = s.length-1; i >= 0; --i) {
ret += s.charAt(i);
}
return ret;
}
$util.pprintf = function(fmt) {
// start at last argument in case we have more than 9 arguments
for (var i = arguments.length; i >= 1; --i) {
fmt = fmt.replace(new RegExp('\\$' + i,'g'), arguments);
}
return fmt;
};
$diff.options = {
// if more than this many words of changes, use overflow string
summary_maxwords: 40,
summary_overflow: "$1 words changed"
};
$diff.diff = function(o, n) {
var ns = {};
var os = {};
for ( var i = 0; i < n.length; i++ ) {
// note we have to check that it is in fact an object with "rows", in
// case ns happens to match a javascript member function of class
// Array, e.g. "some"!
if ( ns ] == null || !ns].rows )
ns ] = { rows: new Array(), o: null };
ns ].rows.push( i );
}
for ( var i = 0; i < o.length; i++ ) {
if ( os ] == null || !os].rows )
os ] = { rows: new Array(), n: null };
os ].rows.push( i );
}
for ( var i in ns ) {
if ( ns.rows.length == 1 && typeof(os) != "undefined" && os.rows.length == 1 ) {
n.rows ] = { text: n.rows ], row: os.rows };
o.rows ] = { text: o.rows ], row: ns.rows };
}
}
for ( var i = 0; i < n.length - 1; i++ ) {
if ( n.text != null && n.text == null &&
0 <= n.row+1 && n.row+1 < o.length &&
o.row + 1 ].text == null &&
n == o.row + 1 ] )
{
n = { text: n, row: n.row + 1 };
o.row+1] = { text: o.row+1], row: i + 1 };
}
}
for ( var i = n.length - 1; i > 0; i-- ) {
if ( n.text != null && n.text == null &&
0 <= n.row-1 && n.row-1 < o.length &&
o.row - 1 ].text == null &&
n == o.row - 1 ] )
{
n = { text: n, row: n.row - 1 };
o.row-1] = { text: o.row-1], row: i - 1 };
}
}
return { o: o, n: n };
}
$diff._split = function(s) {
//return $util.trimSpaces(s).split(/(?:\s|)+/);
return s.split(/\s+/);
}
$diff.aggregate = function(words) {
var phrases = new Array();
var cur = null;
var wordcount = 0;
// start at virtual index -1 to check for removed words at beginning of
// text
for ( var i = -1; i < words.n.length; i++ ) {
if ( i!=-1 && words.n.text == null ) {
if (!cur) {
cur = { o: "", n: "" };
phrases.push(cur);
}
cur.n += " " + words.n;
wordcount ++;
} else {
var pre = "";
var j = i==-1 ? 0 : words.n.row + 1;
while ( j < words.o.length && words.o.text == null ) {
pre += " " + words.o;
j++;
wordcount ++;
}
if (pre) {
if (!cur) {
cur = { o: "", n: "" };
phrases.push(cur);
}
cur.o += pre;
}
if (pre && words.n && words.n.text == null) {
// If there's an addition following, treat this as part of the
// same change.
} else {
cur = null;
}
}
}
for (var i=0;i<phrases.length;i++) {
phrases.n = $util.trimSpaces(phrases.n);
phrases.o = $util.trimSpaces(phrases.o);
}
return { phrases: phrases, wordcount: wordcount };
}
$diff.wikiQuote = function(s) {
if (!s) return s;
if (s.match(/^\{\{.*\}\}$/)) return s;
s = s.replace(/\"/g, "'");
return '"'+s+'"';
}
// trim the equal chars from the front and back of o,n at a word boundary
$diff.stringTrim = function(o, n) {
var r = $diff.stringTrim0(ReverseString(o), ReverseString(n));
return $diff.stringTrim0(ReverseString(r.o), ReverseString(r.n));
}
$diff.stringTrim0 = function(o, n) {
var i = 0;
while (i < o.length && i < n.length && o == n) {
++i;
}
// find index of last non-word character
var prefix = o.substr(0, i);
// if prefix ends with word characters and suffix starts with non-word,
// then erase entire prefix
if (prefix.match(/\w$/) &&
!o.substr(i, 1).match(/^\w/) && !n.substr(i, 1).match(/^\w/))
{
o = o.substr(i);
n = n.substr(i);
} else if (prefix.match(/.*\W/)) {
i = RegExp.lastMatch.length;
o = o.substr(i);
n = n.substr(i);
} else {
// keep entire prefix
}
// alert(o)
// alert(n)
return { o: o, n: n };
}
$diff._wikiQuoteWords = function(s)
{
var words = $diff._split(s);
if (words.length > $diff.options.summary_maxwords) {
return $util.pprintf('($1 words)', words.length);
} else {
return $diff.wikiQuote(words.join(' '));
}
}
$diff.diffSummary = function(o, n) {
o = $util.trimSpaces(o);
n = $util.trimSpaces(n);
if (o == n) return "";
if (!o) {
return "new: +" + $diff._wikiQuoteWords(n);
}
if (!n) {
return "blank: -" + $diff._wikiQuoteWords(o);
}
var words = $diff.diff( $diff._split(o), $diff._split(n) );
var r = $diff.aggregate(words);
if (!r.wordcount) return "";
if (r.wordcount > $diff.options.summary_maxwords) {
return $util.pprintf($diff.options.summary_overflow, r.wordcount);
}
var phrases = r.phrases;
var str = ;
for (var i=0;i<phrases.length;i++) {
var r = $diff.stringTrim(phrases.o, phrases.n);
var ro = $diff.wikiQuote(r.o), rn = $diff.wikiQuote(r.n);
if (ro && rn) {
str.push(ro + ' --> ' + rn);
} else if (ro) {
str.push('-' + ro);
} else if (rn) {
str.push('+' + rn);
} else {
// alert("## internal error 15e1b13f-bae3-4399-86c5-721786822fa2");
}
}
return str.join(", ");
}
if(0){
qinc('shortcuts');
qinc('diffsince');
qinc('wikiwatch');
qinc('watchlist');
qinc('watchbutton');
qinc('autofocus');
qinc('newmessages');
qinc('tabsince');
}
var oldtext=""
function editsum(){
if(document.editform.wpSection.value!="new"){
var sum=document.editform.wpSummary.value
var newtext=document.editform.wpTextbox1.value
var newsum=$diff.diffSummary(oldtext,newtext)
var semic=((sum&&newsum)?"; ":"")
var m=sum.match(/\/\*.*?\*\//)
if(m){
sum=sum.replace(m,"")
sum=m+newsum+semic+sum
} else {
sum=newsum+semic+sum
}
document.editform.wpSummary.value=sum
}
}
function hookEventObj(a,b,c){
a=c
}
function saveoldtext(){
if(document.editform){
oldtext=document.editform.wpTextbox1.value
hookEventObj(document.editform.wpSave, 'click',
function(){editsum();});
hookEventObj(document.editform.wpDiff, 'click',
function(){editsum();});
hookEventObj(document.editform.wpPreview, 'click',
function(){editsum();});
}
}
function justredirs(){
var els=document.getElementsByTagName("li")
for(var i=0;i<els.length;i++){
if(els.innerText.indexOf("(redirect page)")<0){
els.style.display="none"
els.innerHTML=""
}
}
}
addOnloadHook(function () {
//$watchbutton.widgetLoad();
//$tabsince.widgetLoad();
//$watchlist.widgetLoad();
saveoldtext()
/* uncomment this to hide alert() errors */
//$msg.alert_disabled=true;
});
addOnloadHook(function () {
addLink('p-personal', 'https://wiki386.com/en/User:Poccil/myskin.js', 'My monobook.js', 'pt-monobookjs', 'monobook.js is used for storing user javascripts', '', 'pt-logout');
addLink('p-personal', 'https://wiki386.com/en/User:Poccil/myskin.css', 'My monobook.css', 'pt-monobookcss', 'monobook.css is used for storing user CSS styles', '', 'pt-logout');
addLink('p-personal', '/w/index.php?title=Special%3AAllpages&from=Poccil&namespace=2', 'My subpages', 'pt-subpages', 'Subpages of my userspace', '', 'pt-logout');
addLink('p-personal', '/w/index.php?title=Special:Whatlinkshere&limit=5000&from=0&fakeaction=redirs&target='+escape(getPname())+'&from=Poccil&namespace=2', 'Redirs', 'pt-redirs', 'What redirects here', '', 'pt-logout');
addLink('p-personal', 'javascript:catlen()', 'Category items', 'pt-redirs', 'What redirects here', '', 'pt-logout');
if(location.href.indexOf("fakeaction=redirs")>=0){
justredirs()
document.forms.style.display="none"
}
});
function GetXmlHTTP() {
var A;
try {
A=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
A=new ActiveXObject("Microsoft.XMLHTTP");
} catch (oc) {A=null;}
}
if(!A && typeof XMLHttpRequest != "undefined")
A = new XMLHttpRequest();
return A;
}
function SajaxCall(uri, target) {
var i, x, n;
uri="http://en.wikipedia.orghttps://wiki386.com/en/"+uri;
var post_data = null;
x = GetXmlHTTP();
if (!x) {
alert("AJAX not supported");
return false;
}
x.open("GET", uri, true);
x.setRequestHeader("Content-Type", "text/xml");
x.setRequestHeader("Pragma", "cache=yes");
x.setRequestHeader("Cache-Control", "no-transform");
x.onreadystatechange = function() {
if (x.readyState != 4)
return;
if ( typeof( target ) == 'function' ) {
var rt=x.responseText
.replace(/\ \;/," ")
.replace(/\®\;/,"®")
x.responseXML.loadXML(rt)
target( x.responseXML );
}
else if ( typeof( target ) == 'object' ) {
x.responseXML.loadXML(x.responseText)
target=x.responseXML
target=1
}
return;
}
x.send(post_data);
delete x;
return true;
}
function upage(xml){
var atags=xml.getElementsByTagName("a")
var images=
for(var i=0;i<atags.length;i++){
var href=atags.getAttribute("href")
var title=atags.getAttribute("title")
var ie=(href)?href.indexOf("Image:"):-1
if(ie>=0&&title){
images=title
}
}
alert(images)
}
function getatt(tag,a){
var re=new RegExp("\\s+"+a+"\\s*\\=\\s*()(.*?)(\\1)")
var e=re.exec(tag)
if(e){
return e
}
return ""
}
function upage2(ae){
// alert(ae)
var atags=ae.match(/<\s+.*?>/g)
var images=
for(var i=0;atags&&i<atags.length;i++){
var href=getatt(atags,"href")
var title=getatt(atags,"title")
status=
var ie=(href)?href.indexOf("Image:"):-1
if(ie>=0){
images=href.substr(ie+6)
}
}
// alert(images)
}
function catlen(){
upage2(document.body.innerHTML)
}
//addOnloadHook(function () {
// upage2(document)
//})