Merge branch 'develop' into gh-pages

This commit is contained in:
Bengt Brodersen 2015-12-11 11:55:24 +01:00
commit 77f645b718
3 changed files with 65 additions and 74 deletions

View File

@ -6,7 +6,7 @@
// YouTrack: http://qoomon.myjetbrains.com/youtrack/dashboard // YouTrack: http://qoomon.myjetbrains.com/youtrack/dashboard
var global = {}; var global = {};
global.version = "4.3.5"; global.version = "4.3.6";
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;
@ -70,7 +70,7 @@
if (issueKeyList.length <= 0) { if (issueKeyList.length <= 0) {
alert("Please select at least one issue."); alert("Please select at least one issue.");
return; return;
} else if (issueKeyList.length > 100) { } else if (issueKeyList.length > 30) {
confirm("Are you sure you want select " + issueKeyList.length + " issues?"); confirm("Are you sure you want select " + issueKeyList.length + " issues?");
return; return;
} }
@ -97,9 +97,10 @@
jQuery("#columnCount").val(settings.colCount); jQuery("#columnCount").val(settings.colCount);
jQuery("#single-card-page-checkbox").attr('checked', settings.singleCardPage ); jQuery("#single-card-page-checkbox").attr('checked', settings.singleCardPage );
jQuery("#hide-description-checkbox").attr('checked', settings.hideDescription ); jQuery("#description-checkbox").attr('checked', !settings.hideDescription );
jQuery("#hide-assignee-checkbox").attr('checked', settings.hideAssignee ); jQuery("#assignee-checkbox").attr('checked', !settings.hideAssignee );
jQuery("#hide-due-date-checkbox").attr('checked', settings.hideDueDate ); 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..."); jQuery("#card-print-dialog-title").text("Card Printer " + global.version + " - Loading issues...");
promises.push(renderCards(issueKeyList).then(function() { promises.push(renderCards(issueKeyList).then(function() {
@ -161,6 +162,7 @@
writeCookie("card_printer_hide_description", settings.hideDescription); writeCookie("card_printer_hide_description", settings.hideDescription);
writeCookie("card_printer_hide_assignee", settings.hideAssignee); writeCookie("card_printer_hide_assignee", settings.hideAssignee);
writeCookie("card_printer_hide_due_date", settings.hideDueDate); writeCookie("card_printer_hide_due_date", settings.hideDueDate);
writeCookie("card_printer_hide_qr_code", settings.hideQrCode);
} }
function loadSettings(){ function loadSettings(){
@ -173,6 +175,7 @@
settings.hideDescription = parseBool(readCookie("card_printer_hide_description"), false); settings.hideDescription = parseBool(readCookie("card_printer_hide_description"), false);
settings.hideAssignee = parseBool(readCookie("card_printer_hide_assignee"), false); settings.hideAssignee = parseBool(readCookie("card_printer_hide_assignee"), false);
settings.hideDueDate = parseBool(readCookie("card_printer_hide_due_date"), false); settings.hideDueDate = parseBool(readCookie("card_printer_hide_due_date"), false);
settings.hideQrCode = parseBool(readCookie("card_printer_hide_qr_code"), false);
} }
function print() { function print() {
@ -230,6 +233,7 @@
}); });
console.log("wait for resources loaded..."); console.log("wait for resources loaded...");
printDocument.close(); printDocument.close();
redrawCards();
}); });
} }
@ -266,26 +270,26 @@
card.find(".issue-assignee").text(data.assignee[0].toUpperCase()); card.find(".issue-assignee").text(data.assignee[0].toUpperCase());
} }
} else { } else {
card.find(".issue-assignee").addClass("hidden"); card.find(".issue-assignee").remove();
} }
//Due-Date //Due-Date
if (data.dueDate) { if (data.dueDate) {
card.find(".issue-due-date").text(data.dueDate); card.find(".issue-due-date").text(data.dueDate);
} else { } else {
card.find(".issue-due-box").addClass("hidden"); card.find(".issue-due-box").remove();
} }
//Attachment //Attachment
if (data.hasAttachment) {} else { if (data.hasAttachment) {} else {
card.find('.issue-attachment').addClass('hidden'); card.find('.issue-attachment').remove();
} }
//Story Points //Story Points
if (data.storyPoints) { if (data.storyPoints) {
card.find(".issue-estimate").text(data.storyPoints); card.find(".issue-estimate").text(data.storyPoints);
} else { } else {
card.find(".issue-estimate").addClass("hidden"); card.find(".issue-estimate").remove();
} }
//Epic //Epic
@ -293,7 +297,7 @@
card.find(".issue-epic-id").text(data.superIssue.key); card.find(".issue-epic-id").text(data.superIssue.key);
card.find(".issue-epic-name").text(data.superIssue.summary); card.find(".issue-epic-name").text(data.superIssue.summary);
} else { } else {
card.find(".issue-epic-box").addClass("hidden"); card.find(".issue-epic-box").remove();
} }
//QR-Code //QR-Code
@ -309,43 +313,18 @@
var printDocument = printWindow.document; var printDocument = printWindow.document;
// hide/show description // hide/show description
jQuery("#styleHideDescription", printDocument).remove(); jQuery(".issue-description", printDocument).toggle(!settings.hideDescription);
if (settings.hideDescription) {
var style = document.createElement('style');
style.id = 'styleHideDescription';
style.type = 'text/css';
style.innerHTML = ".issue-description { display: none; }"
jQuery("head", printDocument).append(style);
}
// hide/show assignee // hide/show assignee
jQuery("#styleHideAssignee", printDocument).remove(); jQuery(".issue-assignee", printDocument).toggle(!settings.hideAssignee);
if (settings.hideAssignee) {
var style = document.createElement('style');
style.id = 'styleHideAssignee';
style.type = 'text/css';
style.innerHTML = ".issue-assignee { display: none; }"
jQuery("head", printDocument).append(style);
}
// hide/show assignee // hide/show assignee
jQuery("#styleHideDueDate", printDocument).remove(); jQuery(".issue-due-box", printDocument).toggle(!settings.hideDueDate);
if (settings.hideDueDate) { // hide/show cr code
var style = document.createElement('style'); jQuery(".issue-qr-code", printDocument).toggle(!settings.hideQrCode);
style.id = 'styleHideDueDate';
style.type = 'text/css';
style.innerHTML = ".issue-due-box { display: none; }"
jQuery("head", printDocument).append(style);
}
// enable/disable single card page // enable/disable single card page
jQuery("#styleSingleCardPage", printDocument).remove(); jQuery(".card", printDocument).css({ 'page-break-after' : '', 'float' : '', 'margin-bottom': '' });
if (settings.singleCardPage) { if (settings.singleCardPage) {
var style = document.createElement('style'); jQuery(".card", printDocument).css({ 'page-break-after': 'always', 'float': 'none', 'margin-bottom': '10px' });
style.id = 'styleSingleCardPage';
style.type = 'text/css';
style.innerHTML = ".card { page-break-after: always; float: none; margin-bottom: 0.5cm}"
jQuery("head", printDocument).append(style);
} }
} }
@ -466,8 +445,8 @@
// hide description // hide description
result.find("#hide-description-checkbox").click(function() { result.find("#description-checkbox").click(function() {
global.settings.hideDescription = this.checked; global.settings.hideDescription = !this.checked;
saveSettings(); saveSettings();
redrawCards(); redrawCards();
return true; return true;
@ -475,8 +454,8 @@
// show assignee // show assignee
result.find("#hide-assignee-checkbox").click(function() { result.find("#assignee-checkbox").click(function() {
global.settings.hideAssignee = this.checked; global.settings.hideAssignee = !this.checked;
saveSettings(); saveSettings();
redrawCards(); redrawCards();
return true; return true;
@ -484,8 +463,17 @@
// show due date // show due date
result.find("#hide-due-date-checkbox").click(function() { result.find("#due-date-checkbox").click(function() {
global.settings.hideDueDate = this.checked; global.settings.hideDueDate = !this.checked;
saveSettings();
redrawCards();
return true;
});
// show QR Code
result.find("#qr-code-checkbox").click(function() {
global.settings.hideQrCode = !this.checked;
saveSettings(); saveSettings();
redrawCards(); redrawCards();
return true; return true;

View File

@ -18,7 +18,7 @@ body {
} }
.badge, .shadow { .badge, .shadow {
border-style: solid; border-style: solid;
border-color: #333; border-color: #454545;
border-top-width: 0.12rem; border-top-width: 0.12rem;
border-left-width: 0.12rem; border-left-width: 0.12rem;
border-bottom-width: 0.21rem; border-bottom-width: 0.21rem;
@ -35,17 +35,18 @@ body {
border-bottom-width: 0rem; border-bottom-width: 0rem;
} }
.zigzag::after { .zigzag::after {
position: absolute; box-sizing: border-box;
bottom: 0.03rem; position: absolute;
left: -0.16rem; bottom: 0.00rem;
content: ""; left: 0.0rem;
width: 100%; content: "";
border-style: solid; width: 100%;
border-bottom-width: 1rem; border-style: solid;
border-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/Tearing.png); border-bottom-width: 0.5rem;
border-image-width: 0 0 0.7rem 0; border-image: url(https://rawgit.com/qoomon/Jira-Issue-Card-Printer/develop/resources//Tearing.png);
border-image-slice: 56 0 56 1; border-image-width: 0 0 0.7rem 0;
border-image-repeat: round round; border-image-slice: 56 0 56 1;
border-image-repeat: round round;
} }
#preload { #preload {
position: fixed; position: fixed;
@ -75,19 +76,20 @@ body {
padding: 0.5rem; padding: 0.5rem;
min-width: 14.5rem; min-width: 14.5rem;
min-height: 8.65rem; min-height: 8.65rem;
overflow: visible; overflow: hidden;
} }
.card::after { .card::after {
overflow: visible; box-sizing: border-box;
position: absolute; overflow: visible;
top: -0.015rem; position: absolute;
left: -0.015rem; top: 0.0rem;
content: ""; left: 0.0rem;
width: calc(100% - 0.015cm); content: "";
height: calc(100% - 0.015cm); width: 100%;
border-color: LightGray; height: 100%;
border-style: dashed; border-color: LightGray;
border-width: 0.03cm; border-style: dashed;
border-width: 0.03cm;
} }
.card-content { .card-content {
position: relative; position: relative;

View File

@ -24,9 +24,10 @@
<output name="amount" for="scaleRange"></output> Scale</form> <output name="amount" for="scaleRange"></output> Scale</form>
</div> </div>
<div style="float: left; margin-right:10px"><input id="single-card-page-checkbox" type="checkbox"/>Single Card Per Page</div> <div style="float: left; margin-right:10px"><input id="single-card-page-checkbox" type="checkbox"/>Single Card Per Page</div>
<div style="float: left; margin-right:10px"><input id="hide-description-checkbox" type="checkbox"/>Hide Description</div> <div style="float: left; margin-right:10px"><input id="description-checkbox" type="checkbox"/>Description</div>
<div style="float: left; margin-right:10px"><input id="hide-assignee-checkbox" type="checkbox"/>Hide Assignee</div> <div style="float: left; margin-right:10px"><input id="assignee-checkbox" type="checkbox"/>Assignee</div>
<div style="float: left; margin-right:10px"><input id="hide-due-date-checkbox" type="checkbox"/>Hide Due Date</div> <div style="float: left; margin-right:10px"><input id="due-date-checkbox" type="checkbox"/>Due Date</div>
<div style="float: left; margin-right:10px"><input id="qr-code-checkbox" type="checkbox"/>QR Code</div>
<input style="float: right;" id="card-print-dialog-print" type="button" class="aui-button aui-button-primary" value="Print" /> <input style="float: right;" id="card-print-dialog-print" type="button" class="aui-button aui-button-primary" value="Print" />
<a style="float: right;" id="card-print-dialog-cancel" title="Cancel" class="cancel">Cancel</a> <a style="float: right;" id="card-print-dialog-cancel" title="Cancel" class="cancel">Cancel</a>