MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 2: | Zeile 2: | ||
/* JV Test */ | /* JV Test */ | ||
/* alert("hello world"); */ | /* alert("hello world"); */ | ||
<!-- | |||
// PopUp -- | |||
// Institute for Human and Machine Cognition, http://www.ihmc.us/ | |||
// CmapTools, Version 4.15, http://cmap.ihmc.us/ | |||
// Modify by: CmapTools Developers, cmapsupport@ihmc.us | |||
// Date: 02/05/2008 | |||
var IE = 0; | |||
var IE4PC = 0; | |||
var NS = 0; | |||
var GECKO = 0; | |||
var openpopups = new Array(); | |||
if (document.all) { // Internet Explorer Detected | |||
IE = true; | |||
} | |||
else if (document.layers) { // Netscape Navigator Detected | |||
NS = true; | |||
} | |||
else if (document.getElementById) { // Netscape 6 Detected | |||
GECKO = true; | |||
} | |||
else { | |||
alert("Unrecognized Browser Detected::\nSorry, your browser is not compatible."); | |||
} | |||
if (IE) | |||
{ | |||
OS = navigator.platform; | |||
VER = new String(navigator.appVersion); | |||
VER = VER.substr (0, VER.indexOf(" ")); | |||
if ((VER < 4.8) && (OS == "Win32")) | |||
{ | |||
IE4PC = 1; | |||
} | |||
} | |||
function handleResize() { | |||
location.reload(); | |||
return false; | |||
} | |||
if ((NS) && (navigator.platform == "MacPPC")) { | |||
window.captureEvents (Event.RESIZE); | |||
window.onresize = handleResize; | |||
} | |||
function openResource(event, resourcePath, resourceName, resourceType) | |||
{ | |||
var newwindow; | |||
// Resource MIMETypes are enumerated as follows: | |||
// cMap = Undefined | |||
// Image = 0 | |||
// Video = 1 | |||
// Text = 2 | |||
// Audio = 3 | |||
popDown(); | |||
switch (resourceType) | |||
{ | |||
case 0: //Image | |||
newwindow = window.open (resourcePath,resourceName); | |||
newwindow.onBlur = newwindow.focus() | |||
var text ='<center><img src=\"'; | |||
text += resourcePath; | |||
text +='\"> </center>'; | |||
break; | |||
case 1: text // Video | |||
newwindow = window.open (resourcePath,resourceName); | |||
newwindow.onBlur = newwindow.focus() | |||
var text ='<embed src=\"'; | |||
text += resourcePath; | |||
text +='\" autostart=true> </embed> '; | |||
break; | |||
case 2: // Text or Unknown | |||
newwindow = window.open(resourcePath,resourceName); | |||
newwindow.onBlur = newwindow.focus() | |||
break; | |||
case 3: // Audio | |||
newwindow = window.open (resourcePath,resourceName); | |||
newwindow.onBlur = newwindow.focus() | |||
var text ='<embed src=\"'; | |||
text += resourcePath; | |||
text +='\" autoplay=true> </embed> '; | |||
break; | |||
case 4: | |||
newwindow = window.open(resourcePath,resourceName); | |||
newwindow.onBlur = newwindow.focus() | |||
break; | |||
} | |||
return; | |||
} | |||
function popUpEvt(event, popupName) | |||
{ | |||
popDown(); | |||
if (GECKO) | |||
{ | |||
document.getElementById(popupName).style.left = event.layerX; | |||
document.getElementById(popupName).style.top = event.layerY; | |||
document.getElementById(popupName).style.background = "#B3B3B3"; | |||
document.getElementById(popupName).style.visibility = "visible"; | |||
openpopups.push(popupName); | |||
} | |||
else if (NS) | |||
{ | |||
document.layers[popupName].moveTo (event.pageX, event.pageY); | |||
document.layers[popupName].bgColor = "#B3B3B3"; | |||
document.layers[popupName].visibility = "show"; | |||
openpopups.push(popupName); | |||
} | |||
else // if (IE) | |||
{ | |||
window.event.cancelBubble = true; | |||
if (!IE4PC) { | |||
document.all[popupName].style.backgroundColor = "#B3B3B3"; | |||
} | |||
document.all[popupName].style.left = window.event.clientX + document.body.scrollLeft; | |||
document.all[popupName].style.top = window.event.clientY + document.body.scrollTop; | |||
document.all[popupName].style.visibility = "visible"; | |||
openpopups[openpopups.length] = popupName; | |||
} | |||
return false; | |||
} | |||
function popDown() | |||
{ | |||
var popupname; | |||
for (var i = 0; i < openpopups.length; i++) | |||
{ | |||
popupname = new String (openpopups[i]); | |||
if (GECKO) { | |||
document.getElementById(popupname).style.visibility = "hidden"; | |||
} | |||
else if (NS) { | |||
document.layers[popupname].visibility = "hide"; | |||
} | |||
else { | |||
document.all[popupname].style.visibility = "hidden"; | |||
} | |||
} | |||
openpopups = new Array(); | |||
return; | |||
} | |||
function popDownNoGecko() | |||
{ | |||
var popupname; | |||
for (var i = 0; i < openpopups.length; i++) | |||
{ | |||
popupname = new String (openpopups[i]); | |||
if (GECKO) { | |||
// document.getElementById(popupname).style.visibility = "hidden"; | |||
return; // erased for test purposes | |||
} | |||
else if (NS) { | |||
document.layers[popupname].visibility = "hide"; | |||
} | |||
else { | |||
document.all[popupname].style.visibility = "hidden"; | |||
} | |||
} | |||
openpopups = new Array(); | |||
return; | |||
} | |||
//--> |
Version vom 9. Mai 2008, 11:12 Uhr
/* Jedes JavaScript hier wird für alle Benutzer für jede Seite geladen. */
/* JV Test */
/* alert("hello world"); */
<!--
// PopUp --
// Institute for Human and Machine Cognition, http://www.ihmc.us/
// CmapTools, Version 4.15, http://cmap.ihmc.us/
// Modify by: CmapTools Developers, cmapsupport@ihmc.us
// Date: 02/05/2008
var IE = 0;
var IE4PC = 0;
var NS = 0;
var GECKO = 0;
var openpopups = new Array();
if (document.all) { // Internet Explorer Detected
IE = true;
}
else if (document.layers) { // Netscape Navigator Detected
NS = true;
}
else if (document.getElementById) { // Netscape 6 Detected
GECKO = true;
}
else {
alert("Unrecognized Browser Detected::\nSorry, your browser is not compatible.");
}
if (IE)
{
OS = navigator.platform;
VER = new String(navigator.appVersion);
VER = VER.substr (0, VER.indexOf(" "));
if ((VER < 4.8) && (OS == "Win32"))
{
IE4PC = 1;
}
}
function handleResize() {
location.reload();
return false;
}
if ((NS) && (navigator.platform == "MacPPC")) {
window.captureEvents (Event.RESIZE);
window.onresize = handleResize;
}
function openResource(event, resourcePath, resourceName, resourceType)
{
var newwindow;
// Resource MIMETypes are enumerated as follows:
// cMap = Undefined
// Image = 0
// Video = 1
// Text = 2
// Audio = 3
popDown();
switch (resourceType)
{
case 0: //Image
newwindow = window.open (resourcePath,resourceName);
newwindow.onBlur = newwindow.focus()
var text ='<center><img src=\"';
text += resourcePath;
text +='\"> </center>';
break;
case 1: text // Video
newwindow = window.open (resourcePath,resourceName);
newwindow.onBlur = newwindow.focus()
var text ='<embed src=\"';
text += resourcePath;
text +='\" autostart=true> </embed> ';
break;
case 2: // Text or Unknown
newwindow = window.open(resourcePath,resourceName);
newwindow.onBlur = newwindow.focus()
break;
case 3: // Audio
newwindow = window.open (resourcePath,resourceName);
newwindow.onBlur = newwindow.focus()
var text ='<embed src=\"';
text += resourcePath;
text +='\" autoplay=true> </embed> ';
break;
case 4:
newwindow = window.open(resourcePath,resourceName);
newwindow.onBlur = newwindow.focus()
break;
}
return;
}
function popUpEvt(event, popupName)
{
popDown();
if (GECKO)
{
document.getElementById(popupName).style.left = event.layerX;
document.getElementById(popupName).style.top = event.layerY;
document.getElementById(popupName).style.background = "#B3B3B3";
document.getElementById(popupName).style.visibility = "visible";
openpopups.push(popupName);
}
else if (NS)
{
document.layers[popupName].moveTo (event.pageX, event.pageY);
document.layers[popupName].bgColor = "#B3B3B3";
document.layers[popupName].visibility = "show";
openpopups.push(popupName);
}
else // if (IE)
{
window.event.cancelBubble = true;
if (!IE4PC) {
document.all[popupName].style.backgroundColor = "#B3B3B3";
}
document.all[popupName].style.left = window.event.clientX + document.body.scrollLeft;
document.all[popupName].style.top = window.event.clientY + document.body.scrollTop;
document.all[popupName].style.visibility = "visible";
openpopups[openpopups.length] = popupName;
}
return false;
}
function popDown()
{
var popupname;
for (var i = 0; i < openpopups.length; i++)
{
popupname = new String (openpopups[i]);
if (GECKO) {
document.getElementById(popupname).style.visibility = "hidden";
}
else if (NS) {
document.layers[popupname].visibility = "hide";
}
else {
document.all[popupname].style.visibility = "hidden";
}
}
openpopups = new Array();
return;
}
function popDownNoGecko()
{
var popupname;
for (var i = 0; i < openpopups.length; i++)
{
popupname = new String (openpopups[i]);
if (GECKO) {
// document.getElementById(popupname).style.visibility = "hidden";
return; // erased for test purposes
}
else if (NS) {
document.layers[popupname].visibility = "hide";
}
else {
document.all[popupname].style.visibility = "hidden";
}
}
openpopups = new Array();
return;
}
//-->