From d38296b342762b5c5eee69e9ab56b0d6001adf2d Mon Sep 17 00:00:00 2001 From: Dhruv Rajan Date: Sat, 23 Jul 2016 00:07:43 -0700 Subject: [PATCH 1/2] Preliminary print button --- public/index.html | 6 +++++- public/js/script.js | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index 0a4801d..f103cb1 100644 --- a/public/index.html +++ b/public/index.html @@ -53,7 +53,11 @@

-

Results

+

Results + +

diff --git a/public/js/script.js b/public/js/script.js index 89d7fc2..8fac981 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -55,7 +55,15 @@ $(document).ready(function() { $('#test-clear').click(function() { $('#results-table tbody').empty(); $('#test-table tbody').empty(); - }) + }); + + $('#print-button').click(function() { + var restorepage = document.body.innerHTML; + var printcontent = document.getElementById("step3").innerHTML; + document.body.innerHTML = printcontent; + window.print(); + document.body.innerHTML = restorepage; + }); }); }); From d630f76fce43397900a99f0311587f6f91c306a0 Mon Sep 17 00:00:00 2001 From: Dhruv Rajan Date: Sat, 23 Jul 2016 00:08:23 -0700 Subject: [PATCH 2/2] Changed style --- public/js/script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index 8fac981..4de9885 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -58,11 +58,11 @@ $(document).ready(function() { }); $('#print-button').click(function() { - var restorepage = document.body.innerHTML; - var printcontent = document.getElementById("step3").innerHTML; - document.body.innerHTML = printcontent; + var currentPage = document.body.innerHTML; + var printable = document.getElementById("step3").innerHTML; + document.body.innerHTML = printable; window.print(); - document.body.innerHTML = restorepage; + document.body.innerHTML = currentPage; }); });