Pengguna:Kurniasan/common.js

Daripada Wiktionary

Catatan: Selepas menyiarkan perubahan, anda mungkin perlu memintas cache pelayar untuk melihatnya.

  • Firefox / Safari: Tahan Shift sambil mengklik Reload, atau tekan sama ada Ctrl-F5 atau Ctrl-R (⌘-R pada Mac)
  • Google Chrome: Tekan Ctrl-Shift-R (⌘-Shift-R pada Mac)
  • Internet Explorer / Edge: Tahan Ctrl sambil mengklik Refresh, atau tekan Ctrl-F5
  • Opera: Tekan Ctrl-F5.
/**
 * Déplacement des [modifier]
 *
 * Correction des titres qui s'affichent mal en raison de limitations dues à MediaWiki.
 * Ce script devrait pouvoir être supprimé lorsque le [[bugzilla:11555]] sera résolu (comportement équivalent)
 *
 * Copyright 2006, Marc Mongenet. Licence GPL et GFDL.
 *
 * The function looks for <span class="editsection">, and move them
 * at the end of their parent and display them inline in small font.
 * var oldEditsectionLinks=true disables the function.
 */
function setModifySectionStyle() 
{
 
        var process = function(list)
        {
                for(var i=0;i!=list.length;i++)
                {
                        var span=list[i].firstChild
 
                        if (span.className == "editsection") 
                        {
                                span.style.fontSize = "xx-small";
                                span.style.fontWeight = "normal";
                                span.style.cssFloat = span.style.styleFloat = "none";
                                span.parentNode.appendChild(document.createTextNode(" "));
                                span.parentNode.appendChild(span);
                        }
                }
        }
 
        try 
        {
                if (!(typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false)) return;
                process(document.getElementsByTagName("h2"));
        }
        catch (e) { }
}
$(setModifySectionStyle);