-
Notifications
You must be signed in to change notification settings - Fork 1
/
PrintDialog.js
55 lines (49 loc) · 2.78 KB
/
PrintDialog.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
define(["config.js"], function(Config) {
window.resetForm = function() {
$('#print-form').show();
$('#print-loading').hide();
$('#print-error').hide();
$('#print-result').empty();
$('#print-result').hide();
}
return {
html: function() {
// IE11 does not support multiline strings, use lines ending with \ instead
return '\
<div id="print-form">\
<div class="form-group"> \
<label for="scale">Skala</label> \
<select class="form-control" id="scale" onchange="window.updatePrintExtent()"> \
<option value="200">200</option> \
<option value="500" selected>500</option> \
<option value="1000">1000</option> \
<option value="2000">2000</option> \
<option value="5000">5000</option> \
</select> \
<label for="template">Format</label> \
<select class="form-control" id="template" onchange="window.updatePrintExtent()"> \
<option value="A3">A3</option> \
<option value="A4" selected>A4</option> \
</select> \
<div id="print-form-submit">\
<button class="btn btn-success" id="download-pdf" onclick="window.submitPrintJob()">Ladda ner PDF</button> \
<button class="btn" onclick="location.href='+"'/situationsplan'" + ';">Börja om</button> \
</div>\
</div> \
</div>\
<div id="print-loading" hidden>\
<div id="loader" class="lds-dual-ring"></div>\
</div> \
<div id="print-error" hidden>\
<p> Någonting gick fel! Försök igen, eller kontakta [email protected] </p>\
</div> \
<div id="print-result" hidden></div>'
},
showResult: function(result) {
$('#print-result').append("<p>Din beställning är nu färdig. Visa eller ändra den med knapparna nedan, alternativt gör en ny sökning i sökrutan högst upp till vänster.</p>")
$('#print-result').append("<a target='_blank' href='" + result.url + "'><button class='btn btn-success'>Öppna PDF!</button></a>")
$('#print-result').append("<button class='btn' onclick='window.resetForm()'>Ändra</button>")
$('#print-result').append('<button class="btn" onclick="location.href='+"'/situationsplan'" + ';">Börja om</button>')
}
};
});