MediaWiki:Skin/Kamelopedia:Aktive Seiten.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
J* (Diskussion | Beiträge) K |
J* (Diskussion | Beiträge) (namespace-auswahl) |
||
Zeile 1: | Zeile 1: | ||
+ | var as_regex = location.href.match(/namespaces=([0-9|]+)/); | ||
+ | window.as_namespaces = as_regex ? as_regex[1] : "0|6|106|108|112"; | ||
+ | |||
addOnloadHook( function () { | addOnloadHook( function () { | ||
Zeile 11: | Zeile 14: | ||
rcprop: "title", | rcprop: "title", | ||
rctype: "edit|new", | rctype: "edit|new", | ||
− | rcnamespace: | + | rcnamespace: window.as_namespaces, |
rcshow: "!minor|!bot", | rcshow: "!minor|!bot", | ||
format: "xml" | format: "xml" |
Version vom 16. Oktober 2011, 19:00 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,
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 /> </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%");
}
});
}
});
});