Widget:RCSandbox: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 11: Line 11:
scrolltextup(1000);
scrolltextup(1000);
});
});
function getRecentChanges(){
function getRecentChanges() {
mw.loader.using('mediawiki.api', function(){
    mw.loader.using('mediawiki.api', function () {
var api = new mw.Api();
        (new mw.Api()).get({
api.get( {
            action : 'query',
action: 'query',
            format : 'json',
format: 'json',
            rcshow : '!bot',
        rcshow: '!bot',
            list : 'recentchanges',
        list: 'recentchanges',
            rclimit : 50,
        rclimit: 50,
            rcprop : 'title|user',
        rcprop: 'title|user',
         }).done(function (data) {
         } , {
            $("#changeslist").html("");
ok:function (data) {
            $(data.query.recentchanges).each(function (key, value) {
  $("#changeslist").html("");
                $("#changeslist").append("<a class='rclink' href='http://wikidoc.org/index.php/" + value.title + "'>" + value.title + "</a> was edited by: " + value.user + "<br />");
  $(data.query.recentchanges).each( function(key, value) {
            });
  $("#changeslist").append("<a class='rclink' href='http://wikidoc.org/index.php/" + value.title + "'>" + value.title + "</a> was edited by: " + value.user + "<br />");
            );
  });
        });
}});
    }
});
            }
}
 
var scrollheight = $("#textup").height();
var scrollheight = $("#textup").height();



Revision as of 17:16, 20 August 2015