MediaWiki:KarteLaden.js

Aus Tiroul

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
Version vom 11:01, 16. Mär. 2007 (bearbeiten)
WikiSysop (Diskussion | Beiträge)
(Die Seite wurde neu angelegt: //<pre> //defautlts var kartetirol_coordinate_region = ''; var kartetirol_width = 720; var kartetirol_height = 500; var kartetirol_iframeurl = 'http://avslintest/htdo...)
← Zum vorherigen Versionsunterschied
Aktuelle Version (09:11, 2. Apr. 2007) (bearbeiten) (Entfernen)
WikiSysop (Diskussion | Beiträge)

 
(Der Versionsvergleich bezieht 43 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://avslintest/htdocs/entwicklung/cristian/tugaatlas/index.php';+var kartetirol_iframeurl = "http://www.tiroul.info/atlas.php";
-var kartetirol_imgbase = 'http://avslintest/htdocs/entwicklung/cristian/tugaatlas/images/';+var kartetirol_imgbase = "http://www.tiroul.info/tugaatlas/images/";
// //
Zeile 25: Zeile 25:
var nordmax; var nordmax;
- var koordinatenReg = document.getElementById('KoordinateRegion');+ var koordinatenReg = document.getElementById("KoordinateRegion");
if (koordinatenReg != null && kartetirolReg_iframe == null) if (koordinatenReg != null && kartetirolReg_iframe == null)
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");
 + myspan .setAttribute("id","atlas_");
 + myspan .innerHTML='&nbsp;<a href="#" onclick="return togglekartetirolRegIFrame();" style="color:#cc2200">Atlas</a>';
 + koordinatenReg.appendChild(myspan );
- kartetirolRegHTML = '&nbsp;<a href="#" onclick="return togglekartetirolRegIFrame();" style="color:#cc2200">Atlas</a>';+ var mydiv = document.createElement("div");
- kartetirolRegHTML += '<div id="kartetirolReg_iframe" style="position:absolute; right:2em; top: 1em; width:'+(kartetirol_width+12)+'px; height:'+(kartetirol_height+12)+'px; background-color: white; padding: 0px; margin: 0px; visibility: hidden; border: 1px solid gray">';+ mydiv.setAttribute("id","kartetirolReg_iframe");
- kartetirolRegHTML += '<img src="'+kartetirol_imgbase+'button_hide.png" style="z-index:10; position:absolute; right:11px; top: 11px; width:18px; cursor:pointer" onclick="togglekartetirolRegIFrame()">'+ mydiv.style.position="absolute";
- kartetirolRegHTML += '<iframe style="position:absolute; right:1px; top: 1px; width:'+(kartetirol_width+10)+'px; height:'+(kartetirol_height+10)+'px; background-color: white; padding: 0px; margin: 0px;" src="'+kartetirol_iframeurl+'?'+ostmin+"_"+nordmin+"_"+ostmax+"_"+nordmax+'" scrolling="no" border="0"></div>';+ 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.innerHTML = koordinatenReg.innerHTML + kartetirolRegHTML ;+ koordinatenReg.appendChild(mydiv);
- + kartetirolReg_iframe = document.getElementById('kartetirolReg_iframe');
- kartetirolReg_iframe = document.getElementById('kartetirolReg_iframe');+ }
} }
-} 
} }
function kartetirolLoader() function kartetirolLoader()
{ {
- var nord;+ var nord;
- var ost;+ var ost;
var koordinaten = document.getElementById('KoordinateUTM'); var koordinaten = document.getElementById('KoordinateUTM');
Zeile 66: Zeile 83:
nord = kor[3]; nord = kor[3];
- kartetirolHTML = '<span>&nbsp;<a href="#" onclick="return togglekartetirolIFrame();" style="color:#cc2200">Atlas</a>';+ if (koordinaten.childNodes[0] && koordinaten.childNodes[1]) {
- kartetirolHTML += '<div id="kartetirol_iframe" style="position:absolute; right:2em; top: 1em; width:'+(kartetirol_width+12)+'px; height:'+(kartetirol_height+12)+'px; background-color: white; padding: 0px; margin: 0px; visibility: hidden; border: 1px solid gray">';+ koordinaten.innerHTML=koordinaten.childNodes[0].nodeValue+' <a href="#" onclick="return togglekartetirolIFrame();">'+koordinaten.childNodes[1].innerHTML+'</a>';
- kartetirolHTML += '<img src="'+kartetirol_imgbase+'button_hide.png" style="z-index:10; position:absolute; right:11px; top: 11px; width:18px; cursor:pointer" onclick="togglekartetirolIFrame()">'+ }
- kartetirolHTML += '<iframe style="position:absolute; right:1px; top: 1px; width:'+(kartetirol_width+10)+'px; height:'+(kartetirol_height+10)+'px; background-color: white; padding: 0px; margin: 0px;" src="'+kartetirol_iframeurl+'?'+ost+"_"+nord+'" scrolling="no" border="0"></div><span>';+
- koordinaten.innerHTML = koordinaten.innerHTML + kartetirolHTML;+ var myspan = document.createElement("span");
 + myspan .setAttribute("id","atlas_");
 + myspan .innerHTML='&nbsp;<a href="#" onclick="return togglekartetirolIFrame();" style="color:#cc2200">Atlas</a>';
 + koordinaten.appendChild(myspan );
- kartetirol_iframe = document.getElementById('kartetirol_iframe');+ 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');
 + }
} }
-} 
} }

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

//
Persönliche Werkzeuge