Usuario:Axxgreazz/botoneraflotante.js

De Wikipedia, la enciclopedia libre

Nota: Después de guardar, debes refrescar la caché de tu navegador para ver los cambios. Internet Explorer: mantén presionada Ctrl mientras pulsas Actualizar. Firefox: mientras presionas Mayús pulsas el botón Actualizar, (o presiona Ctrl-Shift-R). Los usuarios de Google Chrome y Safari pueden simplemente pulsar el botón Recargar. Para más detalles e instrucciones acerca de otros exploradores, véase Ayuda:Cómo limpiar la caché.

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


function botoneraflotante()
{
   if (typeof ms_Activa_Botoneraflotante == 'undefined') { ms_Activa_Botoneraflotante = true;}
   if (!msActivarModulo(ms_Activa_Botoneraflotante)) return;

   if  (typeof wpFlBottom   == 'undefined') { wpFlBottom   = '60px';}
   if  (typeof wpFlBottomIE == 'undefined') { wpFlBottomIE = '60px';}
   if  (typeof wpFlLeft     == 'undefined') { wpFlLeft     = '120px';}
   if  (typeof wpFlLeftIE   == 'undefined') { wpFlLeftIE   = '120px';}

   if (navigator.appName.indexOf("Microsoft")!=-1) 
   {  ubicacion = ' top:' + wpFlBottomIE + '; left:' + wpFlLeftIE + '; position:absolute;">';}
   else
   {  ubicacion = ' top:' + wpFlBottom + '; 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</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;
    }
}

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

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


//</nowiki></pre>