add scale option

This commit is contained in:
Bengt Brodersen 2015-11-26 22:45:39 +01:00
parent 0bbdafee99
commit 8cff8991ca
4 changed files with 33 additions and 37 deletions

View File

@ -1,6 +1,6 @@
(function() { (function() {
var global = {}; var global = {};
global.version = "4.2.4"; global.version = "4.2.5";
global.issueTrackingUrl = "https://github.com/qoomon/Jira-Issue-Card-Printer"; global.issueTrackingUrl = "https://github.com/qoomon/Jira-Issue-Card-Printer";
global.isDev = document.currentScript == null; global.isDev = document.currentScript == null;
global.isProd = !global.isDev; global.isProd = !global.isDev;
@ -79,7 +79,7 @@
jQuery("#rowCount").val(readCookie("card_printer_row_count", 2)); jQuery("#rowCount").val(readCookie("card_printer_row_count", 2));
jQuery("#columnCount").val(readCookie("card_printer_column_count", 1)); jQuery("#columnCount").val(readCookie("card_printer_column_count", 1));
//jQuery("#font-scale-range").val(readCookie("card_printer_font_scale",1)); jQuery("#font-scale-range").val(readCookie("card_printer_font_scale",1));
jQuery("#single-card-page-checkbox").attr('checked', readCookie("card_printer_single_card_page", 'true') == 'true'); jQuery("#single-card-page-checkbox").attr('checked', readCookie("card_printer_single_card_page", 'true') == 'true');
jQuery("#hide-description-checkbox").attr('checked', readCookie("card_printer_hide_description", 'false') == 'true'); jQuery("#hide-description-checkbox").attr('checked', readCookie("card_printer_hide_description", 'false') == 'true');
jQuery("#hide-assignee-checkbox").attr('checked', readCookie("card_printer_hide_assignee", 'true') == 'true'); jQuery("#hide-assignee-checkbox").attr('checked', readCookie("card_printer_hide_assignee", 'true') == 'true');
@ -354,7 +354,7 @@
var scaleHeight = cardMaxHeight / cardMinHeight - 0.01; var scaleHeight = cardMaxHeight / cardMinHeight - 0.01;
// scale down // scale down
var scale = Math.min(scaleWidth, scaleHeight, 1); var scale = Math.min(scaleWidth, scaleHeight, 1) * global.scale;
if (scale < 1) { if (scale < 1) {
jQuery("html", printDocument).css("font-size", scale + "cm"); jQuery("html", printDocument).css("font-size", scale + "cm");
} }
@ -468,11 +468,7 @@
result.find("#font-scale-range").on("input", function() { result.find("#font-scale-range").on("input", function() {
writeCookie("card_printer_font_scale", jQuery(this).val()); writeCookie("card_printer_font_scale", jQuery(this).val());
var printFrame = result.find("#card-print-dialog-content-iframe"); global.scale = jQuery(this).val();
var printWindow = printFrame[0].contentWindow;
var printDocument = printWindow.document;
jQuery("html", printDocument).css("font-size", jQuery(this).val() + "cm");
redrawCards(); redrawCards();
}); });

View File

@ -59,11 +59,11 @@ body {
overflow:visible; overflow:visible;
line-height: 0.38rem; line-height: 0.38rem;
} }
.author > span { .author > span:nth-of-type(2) {
position: relative; position: relative;
left: 0.23rem; top: -0.07rem;
font-size: 0.6em; left: 0.49rem;
text-align: center; font-size: 0.5em;
} }
.card { .card {
position: relative; position: relative;

View File

@ -25,7 +25,8 @@
</div> </div>
</div> </div>
<div class="author"> <div class="author">
<span>©BengtBrodersen</span><br> <span>qoomon.com</span>
qoomon.com <br>
<span>©BengtBrodersen</span>
</div> </div>
</div> </div>

View File

@ -13,14 +13,13 @@
</div> </div>
<div id="card-print-dialog-footer"> <div id="card-print-dialog-footer">
<div class="buttons"> <div class="buttons">
<label style="display:none; margin-right:10px"><input id="font-scale-range" type="range" min="0.4" max="1.6" step="0.1" value="1.0" />Font Scale</label> <label style="margin-right:10px"><input id="font-scale-range" type="range" min="0.5" max="1.0" step="0.01" value="1.0" />Scale</label>
<label style="margin-right:10px;"><input id="rowCount" type="text" class="text" maxlength="1" style="width: 10px;" value="2"/>Row Count</label> <label style="margin-right:10px;"><input id="rowCount" type="text" class="text" maxlength="1" style="width: 10px;" value="2"/>Row Count</label>
<label style="margin-right:10px;"><input id="columnCount" type="text" class="text" maxlength="1" style="width: 10px;" value="1"/>Column Count</label> <label style="margin-right:10px;"><input id="columnCount" type="text" class="text" maxlength="1" style="width: 10px;" value="1"/>Column Count</label>
<label style="margin-right:10px"><input id="single-card-page-checkbox" type="checkbox"/>Single Card Per Page</label> <label style="margin-right:10px"><input id="single-card-page-checkbox" type="checkbox"/>Single Card Per Page</label>
<label style="margin-right:10px"><input id="hide-description-checkbox" type="checkbox"/>Hide Description</label> <label style="margin-right:10px"><input id="hide-description-checkbox" type="checkbox"/>Hide Description</label>
<label style="margin-right:10px"><input id="hide-assignee-checkbox" type="checkbox"/>Hide Assignee</label> <label style="margin-right:10px"><input id="hide-assignee-checkbox" type="checkbox"/>Hide Assignee</label>
<label style="margin-right:10px"><input id="hide-due-date-checkbox" type="checkbox"/>Hide Due Date</label> <label style="margin-right:10px"><input id="hide-due-date-checkbox" type="checkbox"/>Hide Due Date</label>
<label style="display:none; margin-right:10px"><input id="hide-status-checkbox" type="checkbox"/>Hide Status</label>
<input id="card-print-dialog-print" type="button" class="aui-button aui-button-primary" value="Print" /> <input id="card-print-dialog-print" type="button" class="aui-button aui-button-primary" value="Print" />
<a id="card-print-dialog-cancel" title="Cancel" class="cancel">Cancel</a> <a id="card-print-dialog-cancel" title="Cancel" class="cancel">Cancel</a>
</div> </div>