MediaWiki:Skin/Kamelopedia:Aktive Seiten.js: Unterschied zwischen den Versionen

aus Kamelopedia, der wüsten Enzyklopädie
Zur Navigation springen Zur Suche springen
(grr)
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 14: Zeile 14:
 
         rcprop: "title",
 
         rcprop: "title",
 
         rctype: "edit|new",
 
         rctype: "edit|new",
         rcnamespace: window.as_namespaces.replace("¦","|"),
+
         rcnamespace: window.as_namespaces.replace(/\./g,"|"),
 
         rcshow: "!minor|!bot",
 
         rcshow: "!minor|!bot",
 
         format: "xml"
 
         format: "xml"

Aktuelle Version vom 16. Oktober 2011, 19:18 Uhr

var as_regex = location.href.match(/namespaces=([0-9|.]+)/);
window.as_namespaces = as_regex ? as_regex[1] : "0|6|106|108|112";

addOnloadHook( function () {

clowd_prio = {};

jQuery.ajax({
    url: "/api.php",
    data: {
        action: "query",
        list: "recentchanges",
        rclimit: 500,
        rcprop: "title",
        rctype: "edit|new",
        rcnamespace: window.as_namespaces.replace(/\./g,"|"),
        rcshow: "!minor|!bot",
        format: "xml"
    },
    success: function (r) {
        jQuery("#clowd").html("");
        var rcs = jQuery(r).find("rc");
        rcs.each( function () {
            var title = jQuery(this).attr("title");
            var id = "tag_for_page_"+escape(title).replace(/[%.:'"]/g,"_");
            if( jQuery("#"+id).length == 0 )
            {
                jQuery("#clowd").append("<span class='clowd_item' id='"+id+"'><a />&emsp;</span>");
                jQuery("#"+id+" a").text(title);               
                jQuery("#"+id+" a")[0].href = "/index.php/"+title;
                clowd_prio[title] = 1;
            }
            else
            {
                clowd_prio[title] = clowd_prio[title] + 1;
                jQuery("#"+id).css("font-size", (1+Math.log(clowd_prio[title]))*100 + "%");
                jQuery("#"+id).css("line-height","100%");
            }
        });
    }
});
});