forked from capnrefsmmat/ipbLatex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
templates.txt
52 lines (44 loc) · 2 KB
/
templates.txt
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
--------------------------------------------------------------------------
INSERT BEFORE </head> IN YOUR globalTemplate (CHANGE PATH AS APPROPRIATE):
REMEMBER TO ALSO CHANGE PATH FOR SRCSET SCRIPT.
--------------------------------------------------------------------------
<script>
latexPopup = function(e)
{
Event.stop(e);
$('latexCode').innerHTML = "[latex]\n" + e.findElement().alt + "\n[/latex]";
popup = new ipb.Popup('latexPopup', { type: 'balloon', modal: false, w: '500px', h: '500px', initial: $('latexPopup').innerHTML, hideAtStart: false, close: 'a[rel="close"]', attach: e, stem: true }, {afterHide: function(pop){observeTex() },});
}
observeTex = function() {
$$("img[src^='/latex/img/']").each(function(element) {
element.observe('click', latexPopup)
});
}
document.observe("dom:loaded", observeTex);
</script>
<script src="/path/to/img.srcset.min.js"></script>
----------------------------------------------------------
INSERT AFTER YOUR <body> TAG (CHANGE LINK AS APPROPRIATE):
----------------------------------------------------------
<div id="latexPopup" style="display:none;">
<div class="userpopup">
<h3>LaTeX Code</h3>
<div>
<p>This equation was made with the following code:</p><br/>
<div id="latexCode" style="white-space: pre-wrap; font-family: monospace;"></div><br/>
<p>Online LaTeX editor: <a href=http://www.codecogs.com/latex/eqneditor.php>CodeCogs.com/latex/eqneditor.php</a></p>
</div>
</div>
</div>
-------------------------------------------------------------
INSERT INTO YOUR ipb_styles.css (CHANGE PATH AS APPROPRIATE):
-------------------------------------------------------------
div#latexPopup_popup.popupWrapper>div#latexPopup_inner.popupInner>div.userpopup>div {
margin: 10px;
}
div#latexPopup_popup.popupWrapper>div#latexPopup_inner.popupInner>div.userpopup>h3 {
padding-left: 10px;
}
img[src^="/latex/img/"]{
cursor: pointer;
}