summaryrefslogtreecommitdiff
path: root/print
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2019-04-10 23:37:16 -0400
committerLex Neva <github.com@lexneva.name>2019-04-10 23:37:16 -0400
commit9ccf2f552be246f7912e9dc923f8da8ae47fe544 (patch)
tree334b9bea8e0837625e551431d06ad061a0a1e098 /print
parent75fdfe22deddbfc8a875840cde48844207b7b76e (diff)
switch print pdf gui to electron
Diffstat (limited to 'print')
-rw-r--r--print/resources/inkstitch.js24
-rw-r--r--print/templates/index.html2
2 files changed, 3 insertions, 23 deletions
diff --git a/print/resources/inkstitch.js b/print/resources/inkstitch.js
index 86bc213e..c58aed8a 100644
--- a/print/resources/inkstitch.js
+++ b/print/resources/inkstitch.js
@@ -11,12 +11,6 @@ var realistic_rendering = {};
var realistic_cache = {};
var normal_rendering = {};
-function ping() {
- $.get("/ping")
- .done(function() { setTimeout(ping, 1000) })
- .fail(function() { $('#errors').attr('class', 'show') });
-}
-
//function to chunk opd view into pieces
// source: https://stackoverflow.com/questions/3366529/wrap-every-3-divs-in-a-div
$.fn.chunk = function(size) {
@@ -199,7 +193,6 @@ function setSVGTransform(figure, transform) {
}
$(function() {
- setTimeout(ping, 1000);
/* SCALING AND MOVING SVG */
/* Mousewheel scaling */
@@ -369,22 +362,7 @@ $(function() {
/* Settings Bar */
$('button.close').click(function() {
- $.post('/shutdown', {})
- .always(function(data) {
- window.close();
-
- /* Chrome and Firefox both have a rule: scripts can only close windows
- * that they opened. Chrome seems to have an exception for windows that
- * were opened by an outside program, so the above works fine. Firefox
- * steadfastly refuses to allow us to close the window, so we'll tell
- * the user (in their language) that they can close it.
- */
- setTimeout(function() {
- document.open();
- document.write("<html><body>" + data + "</body></html>");
- document.close();
- }, 1000);
- });
+ window.close();
});
$('button.print').click(function() {
diff --git a/print/templates/index.html b/print/templates/index.html
index d0ab848f..375fdc77 100644
--- a/print/templates/index.html
+++ b/print/templates/index.html
@@ -2,6 +2,8 @@
<html>
<head>
<title>Ink/Stitch Print Preview</title>
+ <!-- https://stackoverflow.com/a/37480521/4249120 -->
+ <script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script src="resources/jquery-3.3.1.min.js"></script>
<script src="resources/inkstitch.js"></script>
<link rel="stylesheet" href="resources/style.css" />