Usuario:Oleinad/botoneraflotante.js

De Wikilibros, la colección de libros de texto de contenido libre.

Nota: Después de publicar, quizás necesite actualizar la caché de su navegador para ver los cambios.

  • Firefox/Safari: Mantenga presionada la tecla Shift mientras pulsa el botón Actualizar, o presiona Ctrl+F5 o Ctrl+R (⌘+R en Mac)
  • Google Chrome: presione Ctrl+Shift+R (⌘+Shift+R en Mac)
  • Internet Explorer/Edge: mantenga presionada Ctrl mientras pulsa Actualizar, o presione Ctrl+F5
  • Opera: Presiona Ctrl+F5.
//<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>