User:FrancoGG/botoneraflotante.js

From Simple English Wikipedia, the free encyclopedia

Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac); IE: hold Ctrl while clicking Refresh, or press Ctrl-F5; Konqueror:: simply click the Reload button, or press F5; Opera users may need to completely clear their cache in Tools→Preferences.

//<pre><nowiki>
//Personalizada por Axxgreazz, para el [[w:es:User:Axxgreazz/Monobook-Suite]]
//http://es.wikipedia.org/wiki/Usuario:Axxgreazz/Monobook-Suite


function creaBotón(title, texto, funcion, estilo)
{
   return '<a href="' + 'javascript:' + funcion + '()" style="text-decoration:none">' + 
          '<div class="botón" style="' + estilo + '" title="' + title + '">' + texto + '</div></a>';
}

function botoneraflotante()
{
   if  (typeof wpFlTop  == 'undefined') { wpFlTop  = '120px';}
   if  (typeof wpFlTopIE == 'undefined') { wpFlTopIE = '930px';}
   if  (typeof wpFlLeft    == 'undefined') { wpFlLeft    = '120px';}
   if  (typeof wpFlLeftIE  == 'undefined') { wpFlLeftIE  = '120px';}

   if (navigator.appName.indexOf("Microsoft")!=-1) 
   {  ubicacion = ' top:' + wpFlTopIE + '; left:' + wpFlLeftIE + '; position:relative;">';}
   else
   {  ubicacion = ' top:' + wpFlTop + '; left:' + wpFlLeft + '; position:fixed;' + 
                  ' float:right;">';}

   var botones = '<style type="text/css">\n .botón { background-color:white; border:1px ' + 
      'solid #e1eAee; width:20px; height:18px; float:left; font-size:80%; ' + 
      'padding:0px; line-height:1.7 }\n' +    
      '.botónbusca   {border:1px solid #e1eAee; text-decoration:none;}\n</style>' +
      '<div class="botonera" style="z-index:3; font-size:13px; font-weight:900;' + 
      ' text-align:center; width:45px;' + ubicacion;
 
   if (document.getElementById("editform")!= null) 
   { 
      for (i=0; i<misflotantes.length; i++)
      {  
         if (misflotantes[i].proy == proyecto.codigo() || misflotantes[i].proy == "0")
         {
             botones += creaBotón(misflotantes[i].nom, 
                                  misflotantes[i].code, 
                                  misflotantes[i].fx, 
                                  misflotantes[i].st);
         }
      }
      botones += '</div>';
      var toolbox = document.getElementById("column-one");
      toolbox.innerHTML += botones;
    }
}

if (window.addEventListener) window.addEventListener("load",botoneraflotante,false);
else 
  if (window.attachEvent) window.attachEvent("onload",botoneraflotante);


//</nowiki></pre>