-
Notifications
You must be signed in to change notification settings - Fork 60
/
newWindow.html
66 lines (49 loc) · 1.91 KB
/
newWindow.html
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
58
59
60
61
62
63
64
65
66
<script type="text/javascript">
// pageChanged & sizeChanged functions are needed in every model file
// other functions for model should also be in here to avoid conflicts
var newWindow = new function() {
// function called every time the page is viewed after it has initially loaded
this.pageChanged = function() {
}
// function called every time the size of the LO is changed
this.sizeChanged = function() {
}
}
$("#textHolder").html(x_addLineBreaks(x_currentPageXML.getAttribute("text")) + '<p><a class="newWindowLink" href="#">' + x_currentPageXML.getAttribute("tip") + '</a></p>');
var imgMaxW = 500; // desktop / tablet
var imgMaxH = 400;
if (x_browserInfo.mobile == true) {
imgMaxW = 250; // mobile
imgMaxH = 250;
}
$("#pageImg").attr({
"src": eval(x_currentPageXML.getAttribute("previewImage")),
"alt": x_currentPageXML.getAttribute("tip")
});
$("#pageContents .newWindowLink").bind("click", function() {
if (x_currentPageXML.getAttribute("htm") != undefined && x_currentPageXML.getAttribute("htm") != "") {
var popupWindow = window.open("", "", "width=" + x_currentPageXML.getAttribute("windowWidth") + ", height=" + x_currentPageXML.getAttribute("windowHeight"));
popupWindow.document.write(x_currentPageXML.getAttribute("htm"));
popupWindow.focus();
} else {
var src = x_currentPageXML.getAttribute("url");
window.open(src, "_blank", "width=" + x_currentPageXML.getAttribute("windowWidth") + ", height=" + x_currentPageXML.getAttribute("windowHeight"));
}
});
</script>
<style type="text/css">
#pageImg {
cursor: pointer;
}
</style>
<div id="pageContents">
<div class="mobileAlign">
<div id="imgHolder" class="panel inline x_floatRight">
<a class="newWindowLink">
<img id="pageImg" style="visibility: hidden" onload="x_scaleImg(this, imgMaxW, imgMaxH); x_pageLoaded();" />
</a>
</div>
</div>
<div id="textHolder">
</div>
</div>