MediaWiki: Common.js: Difference between revisions
From The Lost Media Wiki
No edit summary |
No edit summary |
||
Line 24: | Line 24: | ||
$('.item:first-of-type').addClass('active'); | $('.item:first-of-type').addClass('active'); | ||
scrollHTumbs(); | scrollHTumbs(); | ||
mmouseMove(); | |||
}); | }); | ||
Line 42: | Line 43: | ||
$(last_visible_element).css('background','yellow'); | $(last_visible_element).css('background','yellow'); | ||
$(first_visible_element).css('background','red'); | $(first_visible_element).css('background','red'); | ||
} | |||
function mmouseMove(){ | |||
$('.announce.wrapper').mousemove(function (e) { | |||
// values: e.clientX, e.clientY, e.pageX, e.pageY | |||
// console.log(moveX = (e.pageX)); | |||
let moveX = (e.pageX * -1 / 20); | |||
$('announce.row).css('left', moveX + 'px '); | |||
}); | |||
} | } |
Revision as of 20:32, 26 September 2020
/* Any JavaScript here will be loaded for all users on every page load. */
$("li#ca-history").unwrap();
$("#ca-views").remove();
$("#ca-actions").html("<i class='fa fa-pencil'></i><b class='caret'></b>");
$("li#ca-view").detach().insertBefore("li#ca-purge");
$("li#ca-edit").detach().insertBefore("li#ca-purge");
$("li#ca-formedit").detach().insertBefore("li#ca-purge");
$("li#ca-history").detach().insertBefore("li#ca-purge");
$("a:contains('MediaWiki spam')").parent().css("display","none");
$(document).ready(function() {
$("#sidebar-menu").detach().insertAfter("#searchform");
$("#infobox").appendTo("#sidebar-right");
$("#homelogo").appendTo("#sidebar-left");
$(window).resize(function() {
$("#contentwrapper").css({"padding-top": $("#mw-navigation").height() + 20 });
}).resize();
$(".sidebar-right-wrapper").detach().prependTo("#contentwrapper");
$("#commbutt").detach().appendTo("#sidebar-right");
$(".onload").toggle();
$(".ib-icon").toggle();
$('#searchInput').prop('placeholder','');
$('#searchInput:focus').prop('placeholder','Search');
$('.item:first-of-type').addClass('active');
scrollHTumbs();
mmouseMove();
});
function scrollHTumbs() {
var $item = $('.announce.row');
var last_visible_element = $('.announce.thumbnail:visible:last');
var first_visible_element = $('.announce.thumbnail:visible:first');
var x = $(first_visible_element).offset();
$('.handle-right').click(function(){
if(x.left > -500){
$item.animate({'left':'+=196px'});
}
});
$('.handle-left').click(function(){
$item.animate({'left':'-=196px'});
});
$(last_visible_element).css('background','yellow');
$(first_visible_element).css('background','red');
}
function mmouseMove(){
$('.announce.wrapper').mousemove(function (e) {
// values: e.clientX, e.clientY, e.pageX, e.pageY
// console.log(moveX = (e.pageX));
let moveX = (e.pageX * -1 / 20);
$('announce.row).css('left', moveX + 'px ');
});
}