MediaWiki:KarteLaden.js
Aus Tiroul
(Unterschied zwischen Versionen)
Version vom 14:01, 28. Mär. 2007 (bearbeiten) WikiSysop (Diskussion | Beiträge) ← Zum vorherigen Versionsunterschied |
Aktuelle Version (09:11, 2. Apr. 2007) (bearbeiten) (Entfernen) WikiSysop (Diskussion | Beiträge) |
||
(Der Versionsvergleich bezieht 15 dazwischen liegende Versionen mit ein.) | |||
Zeile 6: | Zeile 6: | ||
var kartetirol_width = 720; | var kartetirol_width = 720; | ||
var kartetirol_height = 500; | var kartetirol_height = 500; | ||
- | var kartetirol_iframeurl = "http://server13/tiroul/atlas.php"; | + | var kartetirol_iframeurl = "http://www.tiroul.info/atlas.php"; |
- | var kartetirol_imgbase = "http://server13/tiroul/tugaatlas/images/"; | + | var kartetirol_imgbase = "http://www.tiroul.info/tugaatlas/images/"; |
// | // | ||
Zeile 38: | Zeile 38: | ||
ostmax = kor[5]; | ostmax = kor[5]; | ||
nordmax = kor[7]; | nordmax = kor[7]; | ||
- | + | ||
+ | if (koordinatenReg.childNodes[0] && koordinatenReg.childNodes[1]) { | ||
+ | koordinatenReg.innerHTML=koordinatenReg.childNodes[0].nodeValue+' <a href="#" onclick="return togglekartetirolRegIFrame();">'+koordinatenReg.childNodes[1].innerHTML+'</a>'; | ||
+ | } | ||
var myspan = document.createElement("span"); | var myspan = document.createElement("span"); | ||
myspan .setAttribute("id","atlas_"); | myspan .setAttribute("id","atlas_"); | ||
Zeile 66: | Zeile 69: | ||
function kartetirolLoader() | function kartetirolLoader() | ||
{ | { | ||
- | var nord; | + | var nord; |
- | var ost; | + | var ost; |
var koordinaten = document.getElementById('KoordinateUTM'); | var koordinaten = document.getElementById('KoordinateUTM'); | ||
Zeile 80: | Zeile 83: | ||
nord = kor[3]; | nord = kor[3]; | ||
- | alert(koordinaten.childNodes[0].nodeValue +" "+koordinaten.childNodes[1].nodeValue +" "+ koordinaten.childNodes.length); | + | if (koordinaten.childNodes[0] && koordinaten.childNodes[1]) { |
- | //koordinaten.innerHTML='<a href="#" onclick="return togglekartetirolIFrame();">asdf</a>'; | + | koordinaten.innerHTML=koordinaten.childNodes[0].nodeValue+' <a href="#" onclick="return togglekartetirolIFrame();">'+koordinaten.childNodes[1].innerHTML+'</a>'; |
+ | } | ||
+ | |||
var myspan = document.createElement("span"); | var myspan = document.createElement("span"); | ||
myspan .setAttribute("id","atlas_"); | myspan .setAttribute("id","atlas_"); |
Aktuelle Version
////defautlts var kartetirol_coordinate_region = ''; var kartetirol_width = 720; var kartetirol_height = 500; var kartetirol_iframeurl = "http://www.tiroul.info/atlas.php"; var kartetirol_imgbase = "http://www.tiroul.info/tugaatlas/images/"; // // globals // var kartetirol_iframe = null; var kartetirolReg_iframe = null; // // Einfügen des IFrames // function kartetirolRegLoader() { var ostmin; var nordmin; var ostmax; var nordmax; var koordinatenReg = document.getElementById("KoordinateRegion"); if (koordinatenReg != null && kartetirolReg_iframe == null) { var coordReg_index = (koordinatenReg.innerHTML).indexOf('params='); if(coordReg_index>-1) { var coordReg_params = (koordinatenReg.innerHTML).substr(coordReg_index+7); var kor = coordReg_params.split("_"); ostmin = kor[1]; nordmin = kor[3]; ostmax = kor[5]; nordmax = kor[7]; if (koordinatenReg.childNodes[0] && koordinatenReg.childNodes[1]) { koordinatenReg.innerHTML=koordinatenReg.childNodes[0].nodeValue+' <a href="#" onclick="return togglekartetirolRegIFrame();">'+koordinatenReg.childNodes[1].innerHTML+'</a>'; } var myspan = document.createElement("span"); myspan .setAttribute("id","atlas_"); myspan .innerHTML=' <a href="#" onclick="return togglekartetirolRegIFrame();" style="color:#cc2200">Atlas</a>'; koordinatenReg.appendChild(myspan ); var mydiv = document.createElement("div"); mydiv.setAttribute("id","kartetirolReg_iframe"); mydiv.style.position="absolute"; mydiv.style.right='2em'; mydiv.style.top='1em'; mydiv.style.height=(kartetirol_height+12)+'px'; mydiv.style.width=(kartetirol_width+12)+'px'; mydiv.style.backgroundColor='white'; mydiv.style.padding='0px'; mydiv.style.margin='0px'; mydiv.style.visibility='hidden'; mydiv.style.border='1px solid gray'; mydiv.style.zIndex=10; mydiv.innerHTML = '<img src="'+kartetirol_imgbase+'button_hide.png" style="z-index:10; position:absolute; right:5px; top: 5px; width:18px; cursor:pointer" onclick="togglekartetirolRegIFrame()"><iframe style="position:absolute; right:1px; top: 1px; width:'+(kartetirol_width+10)+'px; height:'+(kartetirol_height+10)+'px; background-color: white;" src="'+kartetirol_iframeurl+'?'+ostmin+"_"+nordmin+"_"+ostmax+"_"+nordmax+'" scrolling="no" frameborder="0" marginwidth="0" marginheight="0"></iframe>'; koordinatenReg.appendChild(mydiv); kartetirolReg_iframe = document.getElementById('kartetirolReg_iframe'); } } } function kartetirolLoader() { var nord; var ost; var koordinaten = document.getElementById('KoordinateUTM'); if (koordinaten != null && kartetirol_iframe == null) { var coord_index = (koordinaten.innerHTML).indexOf('params='); if(coord_index>-1) { var coord_params = (koordinaten.innerHTML).substr(coord_index+7); var kor = coord_params.split("_"); ost = kor[1]; nord = kor[3]; if (koordinaten.childNodes[0] && koordinaten.childNodes[1]) { koordinaten.innerHTML=koordinaten.childNodes[0].nodeValue+' <a href="#" onclick="return togglekartetirolIFrame();">'+koordinaten.childNodes[1].innerHTML+'</a>'; } var myspan = document.createElement("span"); myspan .setAttribute("id","atlas_"); myspan .innerHTML=' <a href="#" onclick="return togglekartetirolIFrame();" style="color:#cc2200">Atlas</a>'; koordinaten.appendChild(myspan ); var mydiv = document.createElement("div"); mydiv.setAttribute("id","kartetirol_iframe"); mydiv.style.position="absolute"; mydiv.style.right='2em'; mydiv.style.top='1em'; mydiv.style.height=(kartetirol_height+12)+'px'; mydiv.style.width=(kartetirol_width+12)+'px'; mydiv.style.backgroundColor='white'; mydiv.style.padding='0px'; mydiv.style.margin='0px'; mydiv.style.visibility='hidden'; mydiv.style.border='1px solid gray'; mydiv.style.zIndex=10; mydiv.innerHTML = '<img src="'+kartetirol_imgbase+'button_hide.png" style="z-index:10; position:absolute; right:5px; top: 5px; width:18px; cursor:pointer" onclick="togglekartetirolIFrame()"><iframe style="position:absolute; right:1px; top: 1px; width:'+(kartetirol_width+10)+'px; height:'+(kartetirol_height+10)+'px; background-color: white;" src="'+kartetirol_iframeurl+'?'+ost+"_"+nord+'" scrolling="no" frameborder="0" marginwidth="0" marginheight="0"></iframe>'; koordinaten.appendChild(mydiv); kartetirol_iframe = document.getElementById('kartetirol_iframe'); } } } // // Installation // addOnloadHook(kartetirolRegLoader); addOnloadHook(kartetirolLoader); function togglekartetirolRegIFrame() { if(kartetirolReg_iframe.style.visibility != "visible") { kartetirolReg_iframe.style.visibility="visible"; } else { kartetirolReg_iframe.style.visibility="hidden"; } return false; } function togglekartetirolIFrame() { if(kartetirol_iframe.style.visibility != "visible") { kartetirol_iframe.style.visibility="visible"; } else { kartetirol_iframe.style.visibility="hidden"; } return false; } //