Widget:RCSandbox: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
 
(39 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>
<includeonly>
<style type="text/css">
<style type="text/css">
#changeslist{
#textup{
background-color:#AAAAAA;
background-color:rgb(208,208,208);
}
 
.rclink{
a:link {color:#FFFFFF;}      /* unvisited link */
a:visited {color:#FFFFFF;}  /* visited 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 () {
$.getScript("http://wikidoc.org/resources/mediawiki.api/mediawiki.api.js", function(){
    getRecentChanges();
getRecentChanges();
    scrolltextup(1000);
scrolltextup(1000);
});
});
function getRecentChanges(){
function getRecentChanges() {
var api = new mw.Api();
    mw.loader.using('mediawiki.api', function () {
api.get( {
        ( new mw.Api() ).get( {
action: 'query',
            action : 'query',
format: 'json',
            format : 'json',
        list: 'recentchanges',
            rcshow : '!bot',
        rclimit: 50,
            list : 'recentchanges',
        rcprop: 'title|user',
            rclimit : 50,
         } , {
            rcprop : 'title|user',
ok:function (data) {
         } ).done( function ( data ) {
  document.getElementById('changeslist').innerHTML = "";
                $("#changeslist").html("");
  $(data.query.recentchanges).each( function(key, value) {
                $(data.query.recentchanges).each(function (key, value) {
    document.getElementById('changeslist').innerHTML += "<a class='rclink' href='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) {
    $("#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);
    }
  });
}






</script>
</script>
<div id="scrolltextup" style="border:1px ridge #004F72; overflow:hidden;
<div id="scrolltextup" style="overflow:hidden; position:relative; width:100%; height:245px;">
    position:relative; width:750px; height:100px;">
   <div id="textup" style="text-align:center; position:absolute; top:0; left:0; width:100%;">
   <div id="textup" style="text-align:center; position:absolute; top:0;
     <div id="changeslist" style="line-height:25px;">
      left:0; width:750px;">
     <div id="changeslist" style="line-height:20px;">
     </div>
     </div>
   </div>
   </div>

Latest revision as of 18:14, 10 October 2017