Widget:RCSandbox: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision 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 () {
Line 13: Line 14:
function getRecentChanges() {
function getRecentChanges() {
     mw.loader.using('mediawiki.api', function () {
     mw.loader.using('mediawiki.api', function () {
         (new mw.Api()).get({
         ( new mw.Api() ).get( {
             action : 'query',
             action : 'query',
             format : 'json',
             format : 'json',
Line 20: Line 21:
             rclimit : 50,
             rclimit : 50,
             rcprop : 'title|user',
             rcprop : 'title|user',
         }).done(function (data) {
         } ).done( function ( data ) {
            $("#changeslist").html("");
                $("#changeslist").html("");
            $(data.query.recentchanges).each(function (key, value) {
                $(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 />");
                    $("#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) {
    function scrolltextup(dur) {
    $("#textup").animate({
        $("#textup").animate({
        "top" : "-=20"
            "top" : "-=20"
    }, {
        }, {
        duration : dur,
            duration : dur,
        easing : "linear",
            easing : "linear",
        complete : function () {
            complete : function () {
            $("#textup").children(":last").after("<div style='line-height:20px;'>" + $("#textup").children(":first").html() + "</div>");
                $("#textup").children(":last").after("<div style='line-height:20px;'>" + $("#textup").children(":first").html() + "</div>");
            if ($("#textup").children(":first").height() <= (parseInt($("#textup").css("top")) * -1)) {
                if ($("#textup").children(":first").height() <= (parseInt($("#textup").css("top")) * -1)) {
                $("#textup").children(":first").remove();
                    $("#textup").children(":first").remove();
                $("#textup").css({
                    $("#textup").css({
                    "top" : 0
                        "top" : 0
                 });
                    });
                 }
                setTimeout("scrolltextup(1000)", 1000);
             }
             }
         });
            setTimeout("scrolltextup(1000)", 1000);
    }
         }
                    }
    });
}
 
 
 


</script>
</script>

Latest revision as of 18:14, 10 October 2017