用戶:WikiCantona/MediaWiki:Common.js

出自維基百科

注意: 保存之後, 倷要清吥瀏覽器嗰緩存才眵得正改嗰內容。 Mozilla / Firefox / Safari: 按到 Shift 接到按刷新(或按吖Ctrl-Shift-R,到蘋果Mac上按Cmd-Shift-R);IE: 按到 Ctrl接到按刷新,或按吖Ctrl-F5Konqueror: 單只要按 刷新Opera: 用戶要到 工具-設置 完全嗰清除緩存。

/**
 * Déplacement des [modifier]
 *
 * Correction des titres qui s'affichent mal en raison de limitations dues à MediaWiki.
 *
 * 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"));
                process(document.getElementsByTagName("h3"));
                process(document.getElementsByTagName("h4"));
                process(document.getElementsByTagName("h5"));
                process(document.getElementsByTagName("h6"));
 
        }
        catch (e) { }
}
 
$(setModifySectionStyle);