-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathenhancements.js
53 lines (42 loc) · 1.35 KB
/
enhancements.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$('#mw-head').append('\
<div id="logo">\
<a href="/">\
<img src="http://upload.wikimedia.org/wikipedia/commons/8/84/W_logo_for_Mobile_Frontend.gif" class="desktop">\
<img src="http://upload.wikimedia.org/wikipedia/commons/8/84/W_logo_for_Mobile_Frontend.gif" class="mobile">\
</a>\
</div>\
');
$('#footer').prepend('\
<p id="enhancement_credit">The readability of this page is enhanced by <a href="http://dcxn.com">Nick Rowe</a></li>\
');
if(window.location.href.match(/File/))
{
$('#shared-image-desc').hide();
$('.firstHeading').hide();
$(document).bind('keydown.i', function() {
$('#shared-image-desc').toggle();
});
}
$(document).bind('keydown.a', function() {
$('a').toggleClass('visible-link');
});
var extraRemovables = [$('.infobox'), $('.vertical-navbox'), $('.navbox'), $('.succession-box'), $('.toccolours'), $('.wikitable'), $('#content .thumb')];
var hidden = false;
$(document).bind('keydown.i', function() {
if (hidden) {
$.each(extraRemovables, function(index, elements){
elements.css('display', 'block');
});
} else {
$.each(extraRemovables, function(index, elements){
elements.css('display', 'none');
});
}
hidden = !hidden;
});
$(document).bind('keydown.j', function() {
window.scrollBy(0,30);
});
$(document).bind('keydown.k', function() {
window.scrollBy(0,-30);
});