MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus DotAWiki
Zur Navigation springenZur Suche springenGara (Diskussion | Beiträge) |
Gara (Diskussion | Beiträge) K |
||
| Zeile 24: | Zeile 24: | ||
window.attachEvent("onload", externalLinks); | window.attachEvent("onload", externalLinks); | ||
} | } | ||
| + | |||
| + | if (mwCustomEditButtons) { | ||
| + | mwCustomEditButtons[mwCustomEditButtons.length] = { | ||
| + | "imageFile": "http://www.dotawiki.de/images/d/d7/Editbutton_Video.png", | ||
| + | "speedTip": "Einbinden von youtube-videos (oder googlevideo, oder dailymotion)", | ||
| + | "tagOpen": "{{Video_ext|youtube|", | ||
| + | "tagClose": "}}", | ||
| + | "sampleText": "Video ID"} | ||
| + | } | ||
Version vom 31. März 2009, 13:23 Uhr
/* Jedes JavaScript hier wird für alle Benutzer für jede Seite geladen. */
externalLinks = function() {
if (!document.getElementsByTagName) {
return;
}
var anchors = document.getElementsByTagName("a");
for (var i = 0; i < anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") != null &&
(anchor.getAttribute("rel").indexOf("external") >= 0 ||
anchor.getAttribute("rel").indexOf("nofollow") >= 0)
) {
anchor.target = "_blank";
}
}
}
if (window.addEventListener) {
window.addEventListener("load", externalLinks, false);
}
else if (window.attachEvent) {
window.attachEvent("onload", externalLinks);
}
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://www.dotawiki.de/images/d/d7/Editbutton_Video.png",
"speedTip": "Einbinden von youtube-videos (oder googlevideo, oder dailymotion)",
"tagOpen": "{{Video_ext|youtube|",
"tagClose": "}}",
"sampleText": "Video ID"}
}