From 8e8c1597fc1c80829abd7f769632bdaefce3837d Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Fri, 11 Dec 2015 11:16:50 +0100 Subject: [PATCH] cleanup --- bookmarklet.js | 32 ++++++++++++++------------------ card.css | 46 ++++++++++++++++++++++++---------------------- printPreview.html | 8 ++++---- 3 files changed, 42 insertions(+), 44 deletions(-) diff --git a/bookmarklet.js b/bookmarklet.js index c5deccc..ce69a3a 100644 --- a/bookmarklet.js +++ b/bookmarklet.js @@ -6,7 +6,7 @@ // YouTrack: http://qoomon.myjetbrains.com/youtrack/dashboard var global = {}; - global.version = "4.3.5"; + global.version = "4.3.6"; global.issueTrackingUrl = "https://github.com/qoomon/Jira-Issue-Card-Printer"; global.isDev = document.currentScript == null; global.isProd = !global.isDev; @@ -97,10 +97,10 @@ jQuery("#columnCount").val(settings.colCount); jQuery("#single-card-page-checkbox").attr('checked', settings.singleCardPage ); - jQuery("#hide-description-checkbox").attr('checked', settings.hideDescription ); - jQuery("#hide-assignee-checkbox").attr('checked', settings.hideAssignee ); - jQuery("#hide-due-date-checkbox").attr('checked', settings.hideDueDate ); - jQuery("#hide-qr-code-checkbox").attr('checked', settings.hideQrCode ); + jQuery("#description-checkbox").attr('checked', !settings.hideDescription ); + jQuery("#assignee-checkbox").attr('checked', !settings.hideAssignee ); + jQuery("#due-date-checkbox").attr('checked', !settings.hideDueDate ); + jQuery("#qr-code-checkbox").attr('checked', !settings.hideQrCode ); jQuery("#card-print-dialog-title").text("Card Printer " + global.version + " - Loading issues..."); promises.push(renderCards(issueKeyList).then(function() { @@ -321,13 +321,9 @@ jQuery(".issue-qr-code", printDocument).toggle(!settings.hideQrCode); // enable/disable single card page - jQuery("#styleSingleCardPage", printDocument).remove(); + jQuery(".card", printDocument).css({ 'page-break-after' : '', 'float' : '', 'margin-bottom': '' }); if (settings.singleCardPage) { - var style = document.createElement('style'); - style.id = 'styleSingleCardPage'; - style.type = 'text/css'; - style.innerHTML = ".card { page-break-after: always; float: none;}" - jQuery("head", printDocument).append(style); + jQuery(".card", printDocument).css({ 'page-break-after': 'always', 'float': 'none', 'margin-bottom': '10px' }); } } @@ -448,8 +444,8 @@ // hide description - result.find("#hide-description-checkbox").click(function() { - global.settings.hideDescription = this.checked; + result.find("#description-checkbox").click(function() { + global.settings.hideDescription = !this.checked; saveSettings(); redrawCards(); return true; @@ -457,8 +453,8 @@ // show assignee - result.find("#hide-assignee-checkbox").click(function() { - global.settings.hideAssignee = this.checked; + result.find("#assignee-checkbox").click(function() { + global.settings.hideAssignee = !this.checked; saveSettings(); redrawCards(); return true; @@ -466,8 +462,8 @@ // show due date - result.find("#hide-due-date-checkbox").click(function() { - global.settings.hideDueDate = this.checked; + result.find("#due-date-checkbox").click(function() { + global.settings.hideDueDate = !this.checked; saveSettings(); redrawCards(); return true; @@ -475,7 +471,7 @@ // show QR Code - result.find("#hide-qr-code-checkbox").click(function() { + result.find("#qr-code-checkbox").click(function() { global.settings.hideQrCode = this.checked; saveSettings(); redrawCards(); diff --git a/card.css b/card.css index 5139381..28c4324 100644 --- a/card.css +++ b/card.css @@ -18,7 +18,7 @@ body { } .badge, .shadow { border-style: solid; - border-color: #333; + border-color: #454545; border-top-width: 0.12rem; border-left-width: 0.12rem; border-bottom-width: 0.21rem; @@ -35,17 +35,18 @@ body { border-bottom-width: 0rem; } .zigzag::after { - position: absolute; - bottom: 0.03rem; - left: -0.16rem; - content: ""; - width: 100%; - border-style: solid; - border-bottom-width: 1rem; - border-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/Tearing.png); - border-image-width: 0 0 0.7rem 0; - border-image-slice: 56 0 56 1; - border-image-repeat: round round; + box-sizing: border-box; + position: absolute; + bottom: 0.00rem; + left: 0.0rem; + content: ""; + width: 100%; + border-style: solid; + border-bottom-width: 0.5rem; + border-image: url(https://rawgit.com/qoomon/Jira-Issue-Card-Printer/develop/resources//Tearing.png); + border-image-width: 0 0 0.7rem 0; + border-image-slice: 56 0 56 1; + border-image-repeat: round round; } #preload { position: fixed; @@ -78,16 +79,17 @@ body { overflow: hidden; } .card::after { - overflow: visible; - position: absolute; - top: -0.015rem; - left: -0.015rem; - content: ""; - width: calc(100% - 0.03cm); - height: calc(100% - 0.03cm); - border-color: LightGray; - border-style: dashed; - border-width: 0.03cm; + + overflow: visible; + position: absolute; + top: 0.0rem; + left: 0.0rem; + content: ""; + width: 100%; + height: 100%; + border-color: LightGray; + border-style: dashed; + border-width: 0.03cm; } .card-content { position: relative; diff --git a/printPreview.html b/printPreview.html index 1b13073..21a6a18 100644 --- a/printPreview.html +++ b/printPreview.html @@ -24,10 +24,10 @@ Scale
Single Card Per Page
-
Hide Description
-
Hide Assignee
-
Hide Due Date
-
Hide QR Code
+
Description
+
Assignee
+
Due Date
+
QR Code
Cancel