-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpaperInclude.js
57 lines (41 loc) · 1.62 KB
/
paperInclude.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
54
55
56
57
/*
Styling Javascript for paper iframes
*/
$( document ).ready(function() {
// Attach font as stylesheet
$('head').append('<link href="//fonts.googleapis.com/css?family=Raleway:400,300,600" rel="stylesheet" type="text/css">');
$("body").css({'font-family':'"Raleway", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif'});
// Don't show Errors
$(".ltx_ERROR").css("display","none");
// Center tables
$(".ltx_tabular").css("margin-left","auto");
$(".ltx_tabular").css("margin-right","auto");
// Remove MathML Error if MathJax is unable to fix it
$("merror").remove(".ltx_ERROR");
// Remove footer
$("footer").css("display","none");
// Align text in paragraphs
$(".ltx_p").css("text-indent","0");
$(".ltx_p").css("text-align","justify");
// Making big images not overflow the iframe
$("img").css("max-width","100%");
$("img").css("height","auto");
// Remove scroll bar if any
$("body").css("overflow","hidden");
$.each(['widget'], function(i, classname) {
var $elements = $('.' + classname);
$elements.each(function() {
new Waypoint({
element: this,
handler: function(direction) {
var srcValue = $(this.element).attr('src');
$(this.element).attr('src', '/data/widgets/' + srcValue + '.html');
this.disable();
},
offset: '200%',
context: window.parent,
group: classname
});
});
});
});