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
Version vom 12:18, 20. Mär. 2007 (bearbeiten) (Entfernen)
WikiSysop (Diskussion | Beiträge)

Zum nächsten Versionsunterschied →
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://avslintest/htdocs/entwicklung/cristian/tugaatlas/index.php";
-var kartetirol_imgbase = 'http://avslintest/htdocs/entwicklung/cristian/tugaatlas/images/';+var kartetirol_imgbase = "http://avslintest/htdocs/entwicklung/cristian/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];
 +
 + 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.innerHTML = '<img src="'+kartetirol_imgbase+'button_hide.png" style="z-index:10; position:absolute; right:11px; top: 11px; 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; padding: 0px; margin: 0px;" src="'+kartetirol_iframeurl+'?'+ostmin+"_"+nordmin+"_"+ostmax+"_"+nordmax+'" scrolling="no" border="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()
Zeile 66: Zeile 79:
nord = kor[3]; nord = kor[3];
- kartetirolHTML = '<span>&nbsp;<a href="#" onclick="return togglekartetirolIFrame();" style="color:#cc2200">Atlas</a>';+ var myspan = document.createElement("span");
- 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">';+ myspan .setAttribute("id","atlas_");
- kartetirolHTML += '<img src="'+kartetirol_imgbase+'button_hide.png" style="z-index:10; position:absolute; right:11px; top: 11px; width:18px; cursor:pointer" onclick="togglekartetirolIFrame()">'+ myspan .innerHTML='&nbsp;<a href="#" onclick="return togglekartetirolIFrame();" style="color:#cc2200">Atlas</a>';
- 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.appendChild(myspan );
- koordinaten.innerHTML = koordinaten.innerHTML + kartetirolHTML;+ 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.innerHTML = '<img src="'+kartetirol_imgbase+'button_hide.png" style="z-index:10; position:absolute; right:11px; top: 11px; 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; padding: 0px; margin: 0px;" src="'+kartetirol_iframeurl+'?'+ost+"_"+nord+'" scrolling="no" border="0"></iframe>';
- kartetirol_iframe = document.getElementById('kartetirol_iframe');+ koordinaten.appendChild(mydiv);
 + 
 + kartetirol_iframe = document.getElementById('kartetirol_iframe');
 + }
} }
-} 
} }

Version vom 12:18, 20. Mär. 2007

//

//defautlts

var kartetirol_coordinate_region = '';
var kartetirol_width = 720;
var kartetirol_height = 500;
var kartetirol_iframeurl = "http://avslintest/htdocs/entwicklung/cristian/tugaatlas/index.php";
var kartetirol_imgbase = "http://avslintest/htdocs/entwicklung/cristian/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];
 
   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.innerHTML = '<img src="'+kartetirol_imgbase+'button_hide.png" style="z-index:10; position:absolute; right:11px; top: 11px; 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; padding: 0px; margin: 0px;" src="'+kartetirol_iframeurl+'?'+ostmin+"_"+nordmin+"_"+ostmax+"_"+nordmax+'" scrolling="no" border="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.innerHTML = '<img src="'+kartetirol_imgbase+'button_hide.png" style="z-index:10; position:absolute; right:11px; top: 11px; 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; padding: 0px; margin: 0px;" src="'+kartetirol_iframeurl+'?'+ost+"_"+nord+'" scrolling="no" border="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