MediaWiki:KarteLaden.js

Aus Tiroul

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
Version vom 17:08, 23. Mär. 2007 (bearbeiten)
WikiSysop (Diskussion | Beiträge)

← Zum vorherigen Versionsunterschied
Version vom 13:10, 28. Mär. 2007 (bearbeiten) (Entfernen)
WikiSysop (Diskussion | Beiträge)

Zum nächsten Versionsunterschied →
Zeile 39: Zeile 39:
nordmax = kor[7]; nordmax = kor[7];
 + koordinatenReg.onclick="togglekartetirolRegIFrame()";
var myspan = document.createElement("span"); var myspan = document.createElement("span");
myspan .setAttribute("id","atlas_"); myspan .setAttribute("id","atlas_");

Version vom 13:10, 28. Mär. 2007

//

//defautlts

var kartetirol_coordinate_region = '';
var kartetirol_width = 720;
var kartetirol_height = 500;
var kartetirol_iframeurl = "http://server13/tiroul/atlas.php";
var kartetirol_imgbase = "http://server13/tiroul/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];
 
   koordinatenReg.onclick="togglekartetirolRegIFrame()";
   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];

   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;
}

//
Persönliche Werkzeuge