Widget:RCSandbox: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:
a.rclink {color: rgb(16, 123, 181) !important;}      /* unvisited link */
a.rclink {color: rgb(16, 123, 181) !important;}      /* unvisited link */
</style>
</style>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
<script type="text/javascript">
$('#changeslist').ready(function() {
$('#changeslist').ready(function () {
getRecentChanges();
    getRecentChanges();
scrolltextup(1000);
    scrolltextup(1000);
});
function getRecentChanges(){
mw.loader.using('mediawiki.api', function(){
var api = new mw.Api();
api.get( {
action: 'query',
format: 'json',
rcexcludeuser: 'Matt_Pijoan',
        rclimit: 50,
        rcprop: 'title|user',
        } , {
ok:function (data) {
  $("#changeslist").html("");
  $(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 />");
  });
}});
});
});
function getRecentChanges() {
    mw.loader.using('mediawiki.api', function () {
        ( new mw.Api() ).get( {
            action : 'query',
            format : 'json',
            rcshow : '!bot',
            list : 'recentchanges',
            rclimit : 50,
            rcprop : 'title|user',
        } ).done( function ( data ) {
                $("#changeslist").html("");
                $(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();
function scrolltextup(dur) {
    $("#textup").animate({
        "top" : "-=20"
    }, {
        duration : dur,
        easing : "linear",
        complete : function () {
            $("#textup").children(":last").after("<div style='line-height:20px;'>" + $("#textup").children(":first").html() + "</div>");
            if ($("#textup").children(":first").height() <= (parseInt($("#textup").css("top")) * -1)) {
                $("#textup").children(":first").remove();
                $("#textup").css({
                    "top" : 0
                });
            }
            setTimeout("scrolltextup(1000)", 1000);
        }
    });
}


function scrolltextup(dur){
  $("#textup").animate({"top":"-=20"},{
    duration: dur,
    easing: "linear",
    complete:function(){
      $("#textup").children(":last").after("<div style='line-height:20px;'>"+
          $("#textup").children(":first").html()+"</div>");
      if($("#textup").children(":first").height() <=
          (parseInt($("#textup").css("top"))*-1)){
        $("#textup").children(":first").remove();
        $("#textup").css({"top":0});
      }
      setTimeout("scrolltextup(1000)", 1000);
    }
  });
}





Latest revision as of 18:14, 10 October 2017