Benutzer:Melancholie/Wiktionary/monobook.js
Hywys: Nôch dyner Änderig muess no der Browser-Cache gleert wärde!
Mozilla/Safari/Konqueror: Strg-Umschalttaste-R (oder Umschalttaste drückt halte und uf’s Neu-Laden-Symbol klicke), IE: Strg-F5, Opera/Firefox: F5
function $(ID) {return document.getElementById(ID);}
url = document.URL;
/*
The following visitor counter will allow to:
Count a visitor if he/she is interested in *content* (article namespace, no main page, no users)
Safely make use of an external server log
Only count once
The following visitor counter will *not* do:
[NOT] expose any referrer (the only *too* sensitive (private) information)
except "http://als.wiktionary.org/wiki/Wiktionary:VisitCounter"!
[NOT] count non-JavaScript visitors (= 5%)
Allowed external servers:
Wikimedia ones (*or* any server hosted by an non-corrupt company/person in an non-corrupt state ;-)
Why non-corrupt? Privacy Policy!
So, then no data about observed Iranian or Chinese IPs will be published
[!] And even if so, all visitors counted, only seem to have been on [[Wiktionary:VisitCounter]] then;
by mistake of course ;-)
So, the data stored in the log file of the external server will just *not* be useful for third parties!
To be replaced:
"Melancholie" with: null
"Houptsyte" with: "Main_Page"
"http://als.wiktionary.org/wiki/Wiktionary:VisitCounter" with: Local address
"Wiktionary:VisitCounter" with: Local page
"http://upload.wikimedia.org/....png" with: File (404) on (individual external) server
See also: [[Wiktionary:VisitCounter]]
*/
currentTime = new Date();
function currentDate() {
visitYear = currentTime.getFullYear();
visitMonth = currentTime.getMonth();
visitDay = currentTime.getDate();
}
if (wgNamespaceNumber == 0 && wgUserName == "Melancholie" && wgPageName != "Houptsyte") {
currentDate();
if (document.cookie.indexOf("visitCounted="+visitYear+visitMonth+visitDay) < 0) {
function visitCounter() {
var iFrame = document.createElement("iframe");
iFrame.src = "http://als.wiktionary.org/wiki/Wiktionary:VisitCounter";
iFrame.style.display = "none";
$("footer").appendChild(iFrame);
}
addOnloadHook(visitCounter);
}
} else if (url.indexOf("Wiktionary:VisitCounter") > 0) {
currentDate();
if (document.cookie.indexOf("visitCounted="+visitYear+visitMonth+visitDay) < 0) {
function counterPic() {
$("visitCounter").innerHTML = '<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Nuvola_apps_important.svg/600px-Nuvola_apps_important.svg.png" alt="" \/>';
document.cookie = "visitCounted="+visitYear+visitMonth+visitDay+"; path=/";
}
addOnloadHook(counterPic);
}
}
function preparePortlets() {
var pArray = new Array("navigation", "contribution", "support", "search", "tb", "lang");
for (var p = 0; p < pArray.length; p++) {
if ($("p-"+pArray[p])) {
var pHead = $("p-"+pArray[p]).getElementsByTagName("h5")[0];
pHead.title = "Die Rubrik „"+pHead.innerHTML+"“ ein- und ausklappen";
if (pArray[p] == "search") {
pHead.firstChild.style.cursor = "pointer";
pHead.title = "Das Suchfeld ein- und ausblenden";
}
pHead.innerHTML = '<span onclick="togglePortlet(\'p-'+pArray[p]+'\')" style="cursor: pointer !important;">'+pHead.innerHTML+'<\/span>';
}
}
var newLI = document.createElement("li");
newLI.id = "t-toggle";
newLI.innerHTML = '<a href="javascript:toggleSidebar()">Seitenleiste entf.<\/a>';
var tbUL = $("p-tb").getElementsByTagName("ul")[0];
tbUL.appendChild(newLI);
}
addOnloadHook(preparePortlets);
function togglePortlet(p) {
var pBody = $(p).getElementsByTagName("div")[0];
if (document.cookie.indexOf("p-"+p+"=hidden") < 0) {
pBody.className = "hiddenStructure";
document.cookie = "p-"+p+"=hidden; path=/";
} else {
pBody.className = "pBody";
document.cookie = "p-"+p+"=shown; path=/";
}
}
function toggleSidebar() {
var pArray = new Array("logo", "language", "navigation", "contribution", "support", "search", "tb", "p-feedback", "lang");
if (document.cookie.indexOf("sidebar=hidden") < 0) {
pClass = "hiddenStructure";
$("content").style.borderRight = "1px solid #aaa !important";
$("content").style.margin = "2.8em 25px 0 !important";
$("p-cactions").style.left = "5px !important";
document.cookie = "sidebar=hidden; path=/";
} else {
pClass = "portlet";
document.cookie = "sidebar=shown; path=/";
}
for (var p = 0; p < pArray.length; p++) {
if ($("p-"+pArray[p])) {
$("p-"+pArray[p]).className = pClass;
}
}
}