WIP new layout

This commit is contained in:
Bengt Brodersen 2015-05-30 01:34:05 +02:00
parent fc519bcfe2
commit 87d08a3ac5

View File

@ -1,4 +1,3 @@
// card layout: https://jsfiddle.net/qoomon/cdsy7h8k/#base
(function() { (function() {
var version = "3.5.0"; var version = "3.5.0";
console.log("Version: " + version); console.log("Version: " + version);
@ -13,8 +12,6 @@
|| /.*pivotaltracker.com\/n\/projects\/510733.*/g.test(document.URL) // PivotTracker || /.*pivotaltracker.com\/n\/projects\/510733.*/g.test(document.URL) // PivotTracker
|| ( /.*trello.com\/.*/g.test(document.URL) && jQuery("span.js-member-name").text() =='Bengt Brodersen'); // Trello || ( /.*trello.com\/.*/g.test(document.URL) && jQuery("span.js-member-name").text() =='Bengt Brodersen'); // Trello
var isProd = !isDev; var isProd = !isDev;
var appFunctions = null;
var printScopeDeviderToken = "<b>Attachment</b>";
var hostOrigin = "https://qoomon.github.io/Jira-Issue-Card-Printer/"; var hostOrigin = "https://qoomon.github.io/Jira-Issue-Card-Printer/";
if (isDev) { if (isDev) {
@ -23,9 +20,21 @@
} }
var resourceOrigin = hostOrigin + "resources/"; var resourceOrigin = hostOrigin + "resources/";
var appFunctions = null;
// wait untill all scripts loaded // wait untill all scripts loaded
appendScript('https://qoomon.github.io/void', function() { appendScript('https://qoomon.github.io/void', function() {
try {
main(); main();
} catch (err) {
console.log(err.message);
if (isProd) {
ga('send', 'exception', {
'exDescription': err.message,
'exFatal': true
});
}
}
}); });
} catch (err) { } catch (err) {
@ -58,8 +67,6 @@
} }
if (isProd){ if (isProd){
//cors = "https://cors-anywhere.herokuapp.com/";
//$("#card").load("https://cors-anywhere.herokuapp.com/"+"https://qoomon.github.io/Jira-Issue-Card-Printer/card.html");
initGoogleAnalytics(); initGoogleAnalytics();
} }
} }
@ -122,27 +129,42 @@
} }
var currentScale = jQuery("html", printDocument).css("font-size").replace("px", ""); var currentScale = jQuery("html", printDocument).css("font-size").replace("px", "");
printWindow.matchMedia("print").addListener(function() { printWindow.matchMedia("print").addListener(function() {
jQuery("html", printDocument).css("font-size",currentScale +"px");
jQuery(".page", printDocument).css("height", "calc( 100% / " + rowCount + " )");
jQuery(".page", printDocument).css("width", "calc( 100% / " + columnCount + " )");
var pageWidth = jQuery(".page", printDocument).width(); jQuery(".card", printDocument).css("height", "calc( 100% / " + rowCount + " )");
var cardWidth = jQuery(".card", printDocument).width(); jQuery(".card", printDocument).css("width", "calc( 100% / " + columnCount + " )");
var pageWidth = jQuery("body", printDocument).outerWidth();
var cardWidth = jQuery(".card", printDocument).outerWidth();
var newScale = currentScale * pageWidth / cardWidth; var newScale = currentScale * pageWidth / cardWidth;
jQuery("html", printDocument).css("font-size",newScale +"px"); //jQuery("html", printDocument).css("font-size",newScale +"px");
jQuery(".card", printDocument).each(function(position, element) {
var height = jQuery(element).height()
- jQuery(element).find(".card-header").height()
- jQuery(element).find(".card-footer").height()
- jQuery(element).find(".content-header").height()
- 40;
jQuery(element).find(".description").css("max-height", height + "px");
}); });
/////////////////////////////////////////
printWindow.addEventListener("resize", refreshCard);
printWindow.matchMedia("print").addListener(refreshCard);
function refreshCard() {
var cardElements = printDocument.querySelectorAll(".card");
forEach(cardElements, function (cardElement) {
var cardContent = cardElement.querySelectorAll(".card-content")[0];
if (cardContent.scrollHeight > cardContent.offsetHeight) {
cardContent.classList.add("zigzag");
} else {
cardContent.classList.remove("zigzag");
}
}); });
}
function forEach(array, callback) {
for (i = 0; i < array.length; i++) {
callback(array[i]);
}
}
/////////////////////////////////////////
printWindow.print(); printWindow.print();
jQuery("html", printDocument).css("font-size",currentScale +"px"); jQuery("html", printDocument).css("font-size",currentScale +"px");
@ -181,17 +203,18 @@
printDocument.open(); printDocument.open();
printDocument.write("<head/><body/>"); printDocument.write("<head/><body/>");
jQuery("head", printDocument).append(printPanelPageCSS()); jQuery("head", printDocument).append(cardCss());
jQuery("head", printDocument).append(printPanelCardCSS()); // jQuery("head", printDocument).append(cardJavaScript()); // NOT WORKING
console.log("load " + issueKeyList.length + " issues..."); console.log("load " + issueKeyList.length + " issues...");
var deferredList = []; var deferredList = [];
jQuery.each(issueKeyList, function(index, issueKey) { jQuery.each(issueKeyList, function(index, issueKey) {
var page = newPage(issueKey); var page = cardHtml(issueKey);
page.attr("index", index); page.attr("index", index);
page.hide(); page.hide();
page.find('.key').text(issueKey); page.find('.issue-id').text(issueKey);
jQuery("body", printDocument).append(page); jQuery("body", printDocument).append(page);
var deferred = addDeferred(deferredList); var deferred = addDeferred(deferredList);
appFunctions.getCardData(issueKey, function(cardData) { appFunctions.getCardData(issueKey, function(cardData) {
@ -225,62 +248,62 @@
function fillCard(card, data) { function fillCard(card, data) {
//Key //Key
card.find('.key').text(data.key); card.find('.issue-id').text(data.key);
//Type //Type
card.find(".card").attr("type", data.type); card.find(".issue-icon").attr("type", data.type);
//Summary //Summary
card.find('.summary').text(data.summary); card.find('.issue-summary').text(data.summary);
//Description //Description
if (data.description) { if (data.description) {
card.find('.description').html(data.description); card.find('.issue-description').html(data.description);
} else { } else {
card.find(".description").addClass("hidden"); card.find(".issue-description").addClass("hidden");
} }
//Assignee //Assignee
if (data.assignee) { if (data.assignee) {
if (data.avatarUrl) { if (data.avatarUrl) {
card.find(".assignee").css("background-image", "url('" + data.avatarUrl + "')"); card.find(".issue-assignee").css("background-image", "url('" + data.avatarUrl + "')");
} else { } else {
card.find(".assignee").text(data.assignee[0].toUpperCase()); card.find(".issue-assignee").text(data.assignee[0].toUpperCase());
} }
} else { } else {
card.find(".assignee").addClass("hidden"); card.find(".issue-assignee").addClass("hidden");
} }
//Due-Date //Due-Date
if (data.dueDate) { if (data.dueDate) {
card.find(".due-date").text(data.dueDate); card.find(".issue-due-date").text(data.dueDate);
} else { } else {
card.find(".due").addClass("hidden"); card.find(".issue-due-box").addClass("hidden");
} }
//Attachment //Attachment
if (data.hasAttachment) {} else { if (data.hasAttachment) {} else {
card.find('.attachment').addClass('hidden'); card.find('.issue-attachment').addClass('hidden');
} }
//Story Points //Story Points
if (data.storyPoints) { if (data.storyPoints) {
card.find(".estimate").text(data.storyPoints); card.find(".issue-estimate").text(data.storyPoints);
} else { } else {
card.find(".estimate").addClass("hidden"); card.find(".issue-estimate").addClass("hidden");
} }
//Epic //Epic
if (data.epicKey) { if (data.epicKey) {
card.find(".epic-key").text(data.epicKey); card.find(".issue-epic-id").text(data.epicKey);
card.find(".epic-name").text(data.epicName); card.find(".issue-epic-name").text(data.epicName);
} else { } else {
card.find(".epic").addClass("hidden"); card.find(".issue-epic-box").addClass("hidden");
} }
//QR-Code //QR-Code
var qrCodeUrl = 'https://chart.googleapis.com/chart?cht=qr&chs=256x256&chld=L|1&chl=' + encodeURIComponent(data.url); var qrCodeUrl = 'https://chart.googleapis.com/chart?cht=qr&chs=256x256&chld=L|1&chl=' + encodeURIComponent(data.url);
card.find(".qr-code").css("background-image", "url('" + qrCodeUrl + "')"); card.find(".issue-qr-code").css("background-image", "url('" + qrCodeUrl + "')");
} }
//############################################################################################################################ //############################################################################################################################
@ -454,7 +477,7 @@
height: calc(100% - 106px); height: calc(100% - 106px);
width: 100%; width: 100%;
overflow-y: scroll; overflow: hidden;
} }
#card-print-dialog-content-iframe { #card-print-dialog-content-iframe {
@ -462,6 +485,7 @@
height: 100%; height: 100%;
width: 100%; width: 100%;
overflow: hidden;
border:none; border:none;
} }
@ -511,397 +535,335 @@
return result; return result;
} }
function printPanelPageCSS() { // card layout: http://jsfiddle.net/qoomon/ykbLb2pw/
var result = jQuery(document.createElement('style')) function cardHtml(issueKey) {
.attr("id", "printPanelPageStyle")
.attr("type", "text/css")
.html(multilineString(function() {
/*!
* {
box-sizing: border-box;
}
HTML {
font-size: 1.0cm;
overflow: hidden;
}
.page {
position: relative;
overflow: auto;
margin-left: auto;
margin-right: auto;
padding: 1.0cm;
margin: 1.0cm;
width: auto;
height: 15cm;
page-break-after: always;
page-break-inside: avoid;
background:white;
-webkit-box-shadow: 0px 0px 7px 3px rgba(31,31,31,0.4);
box-shadow: 0px 0px 7px 3px rgba(31,31,31,0.4);
border-style: solid;
border-color: #bfbfbf;
border-width: 0.05cm;
-webkit-border-radius: 0.1cm;
border-radius: 0.1cm;
overflow: hidden;
}
@media print {
@page {
margin: 0.0cm;
}
.page {
background: white;
border-color: light-grey;
border-style: dashed;
border-width: 1.0px;
padding: 0.8cm;
margin: 0.0cm;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-print-color-adjust:exact;
print-color-adjust: exact;
}
.multiCardPage {
height: auto;
page-break-after: avoid;
float: left;
}
.page:last-of-type {
page-break-after: avoid;
}
}
*/
}));
return result;
}
// http://www.cssdesk.com/scHcP
function newPage(issueKey) {
var page = jQuery(document.createElement('div')) var page = jQuery(document.createElement('div'))
.attr("id", issueKey) .attr("id", issueKey)
.addClass("page") .addClass("card")
.addClass("singleCardPage")
.html(multilineString(function() { .html(multilineString(function() {
/*! /*!
<div class="card"> <div class="card-body">
<div class="author author-page">qoomon.com</div> <div class="card-content shadow">
<div class="author author-name">Bengt Brodersen</div> <div class="issue-summary"></div>
<div class="card-border"></div> <div class="issue-description"></div>
</div>
<div class="card-header"> <div class="card-header">
<div class="type-icon badge circular"></div> <div class="issue-id badge"></div>
<div class="key badge"></div> <div class="issue-icon badge" type="story"></div>
<div class="estimate badge circular " contenteditable="true"></div> <div class="issue-estimate badge"></div>
<div class="due"> <div class="issue-due-box">
<div class="due-icon badge circular "></div> <div class="issue-due-date badge"></div>
<div class="due-date badge" contenteditable="true"></div> <div class="issue-due-icon badge"></div>
</div> </div>
</div> </div>
<div class="card-content">
<div class="content-header">
<span class="summary" contenteditable="true"></span>
</div>
<div class="description" contenteditable="true"></div>
</div>
<div class="card-footer"> <div class="card-footer">
<div class="assignee badge circular"></div> <div class="issue-qr-code badge"></div>
<div class="qr-code badge"></div> <div class="issue-attachment badge"></div>
<div class="attachment badge circular"></div> <div class="issue-assignee badge"></div>
<div class="epic badge"> <div class="issue-epic-box badge">
<span class="epic-key"></span> <span class="issue-epic-id"></span>
<span class="epic-name" contenteditable="true"></span> <span class="issue-epic-name"></span>
</div> </div>
</div> </div>
</div> </div>
<div class="author">© qoomon.com Bengt Brodersen</div>
*/ */
})); }));
return page; return page;
} }
function printPanelCardCSS() { function cardCss() {
var result = jQuery(document.createElement('style')) var result = jQuery(document.createElement('style'))
.attr("type", "text/css") .attr("type", "text/css")
.html(multilineString(function() { .html(multilineString(function() {
/*! /*!
* { * {
color: black; box-sizing: border-box;
font-family:"Droid Serif"; overflow: hidden;
} }
body { html, body {
margin: 0;
background: WHITE;
padding: 0px;
margin: 0px;
font-size: 0.9cm;
overflow: scroll;
} }
.hidden { .author {
visibility: hidden; position: absolute;
} top:0.6rem;
.card-header:after, left:calc(50% - 3rem);
.card-footer:after { font-size: 0.5rem;
content: "";
display: block;
clear: both;
height:0
}
.card-border,
.badge,
.shadow {
border-style: solid;
border-color: #2f2f2f;
border-top-width: 0.14rem;
border-left-width: 0.14rem;
border-bottom-width: 0.24rem;
border-right-width: 0.24rem;
-webkit-border-radius: 0.25rem;
border-radius: 0.25rem;
}
.circular {
-webkit-border-radius: 50%;
border-radius: 50%;
}
.badge {
width: 3.2rem;
height: 3.2rem;
background: #d0d0d0;
} }
.card { .card {
position: relative; position: relative;
min-width: 17.0rem; float:left;
height: 100%; height: 100%; height: 12rem;
max-height: 100%; width: 100%;
overflow: hidden; padding: 0.5rem;
padding-top: 0.6rem;
min-width:21.0rem;
min-height:10.0rem;
border-color: light-grey;
border-style: dashed;
border-width: 1.0px;
} }
.author{ .card-body {
line-height: 0.8rem;
}
.author-page {
z-index: 999;
position: absolute;
top:2.5rem;
right:0.55rem;
font-size: 0.45rem;
-webkit-transform-origin: 100% 100%;
transform-origin: 100% 100%;
-webkit-transform: rotate(-90deg);
transform: rotate(-90deg);
}
.author-name {
z-index: 0;
position: absolute;
top:3.26rem;
right:-2.6rem;
font-size: 0.35rem;
-webkit-transform-origin: 0% 0%;
transform-origin: 0% 0%;
-webkit-transform: rotate(90deg);
transform: rotate(90deg);
}
.card-border {
position: absolute;
top:2.0rem;
left:0.4rem;
right:0.4rem;
height: calc(100% - 3.3rem);
background: #ffffff;
}
.card-header {
position: relative; position: relative;
height: 100%;
// find .card-header;
padding-top: 2rem;
// find .card-footer;
padding-bottom: 1.3rem;
} }
.card-content { .card-content {
position: relative; position: relative;
margin-top: 0.2rem; height: 100%;
margin-left: 1.0rem; margin-left: 0.4rem;
margin-right: 1.1rem; margin-right: 0.4rem;
margin-bottom: 0.2rem; padding-top: 1.2rem;
min-height: 1.2rem; padding-bottom: 1.1rem;
width: auto; padding-left: 0.4rem;
padding-right: 0.4rem;
background: WHITE;
} }
.content-header { .card-header {
position: relative; position: absolute;
font-size: 1.1rem; top: 0rem;
line-height: 1.1rem; height: 4.2rem;
width: auto; width: 100%;
} }
.card-footer { .card-footer {
position: absolute; position: absolute;
bottom: 0; bottom: 0rem;
height: 2.2rem;
width: 100%; width: 100%;
} }
.summary { .issue-summary {
font-weight: bold; font-weight: bold;
display: -webkit-box;
//-webkit-line-clamp: 2;
//-webkit-box-orient: vertical;
} }
.description { .issue-description {
margin-top: 0.4rem; margin-top: 0.4rem;
display: block; display: block;
font-size: 0.6rem; font-size: 0.6rem;
line-height: 0.6rem; line-height: 0.6rem;
overflow: hidden; overflow: hidden;
} }
.key { .issue-id {
position: absolute; position: absolute;
float: left; left: 1rem;
width: auto; top: 1.2rem;
min-width: 3.0rem;
height: 1.5rem; height: 1.5rem;
left: 2.5rem; max-width: 10rem;
margin-top: 1.2rem; min-width: 5rem;
padding-left: 0.9rem; padding-left: 2.4rem;
padding-right: 0.4rem; padding-right: 0.4rem;
text-align: center; background-color: WHITESMOKE;
font-weight: bold; line-height: 1.3rem;
font-size: 0.8rem; font-size: 0.8rem;
line-height: 1.2rem; font-weight: bold;
text-align: center;
white-space: nowrap;
text-overflow: ellipsis;
} }
.type-icon { .issue-icon {
position: relative; position: absolute;
float: left; left: 0rem;
width: 3.15rem; top: 0rem;
height: 3.15rem; height: 3.2rem;
background-color: GREENYELLOW; width: 3.2rem;
background-image: url(https://googledrive.com/host/0Bwgd0mVaLU_KU0N5b3JyRnJaNTA/resources/icons/Objects.png); border-radius: 50% !important;
background-color: GREENYELLOW !important;
background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Objects.png);
background-repeat: no-repeat; background-repeat: no-repeat;
-webkit-background-size: 70%;
background-size: 70%;
background-position: center; background-position: center;
z-index: 1; background-size: 70%;
} }
.issue-icon[type="story"] {
.card[type="story"] .type-icon { background-color: GOLD !important;
background-color: GOLD; background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Bulb.png);
background-image: url(https://googledrive.com/host/0Bwgd0mVaLU_KU0N5b3JyRnJaNTA/resources/icons/Bulb.png);
} }
.card[type="bug"] .type-icon { .issue-icon[type="bug"] {
background-color: CRIMSON; background-color: CRIMSON !important;
background-image: url(https://googledrive.com/host/0Bwgd0mVaLU_KU0N5b3JyRnJaNTA/resources/icons/Bug.png); background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Bug.png);
} }
.card[type="epic"] .type-icon { .issue-icon[type="epic"] {
background-color: ROYALBLUE; background-color: ROYALBLUE !important;
background-image: url(https://googledrive.com/host/0Bwgd0mVaLU_KU0N5b3JyRnJaNTA/resources/icons/Flash.png); background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Flash.png);
} }
.issue-estimate {
.estimate { position: absolute;
position: relative; left: 2.5rem;
float: left; top: 0.0rem;
left: -0.60rem; height: 1.6rem;
top:-1.5rem; width: 1.6rem;
height: 1.5rem; border-radius: 49.5% !important;
width: 1.5rem; background-color: WHITESMOKE;
line-height: 1.4rem;
font-size: 0.9rem;
font-weight: bold;
text-align: center;
}
.issue-qr-code {
position: absolute;
left:0rem;
top: 0rem;
width: 2.2rem;
height: 2.2rem;
background-image: url(https://chart.googleapis.com/chart?cht=qr&chs=256x256&chld=L|1&chl=blog.qoomon.com);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
}
.issue-attachment {
position: absolute;
left:2.8rem;
top: 0rem;
width: 2.0rem;
height: 2.0rem;
border-radius: 50% !important;
background-color: LIGHTSKYBLUE !important;
background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Attachment.png);
background-repeat: no-repeat;
background-position: center;
background-size: 70%;
}
.issue-assignee {
position: absolute;
top:0rem;
right:0rem;
width: 2.2rem;
height: 2.2rem;
border-radius: 50% !important;
background-color: WHITESMOKE;
//background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Person.png);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
//-webkit-filter: contrast(200%) grayscale(100%);
//filter: contrast(200%) grayscale(100%);
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
font-size: 0.9rem; font-size: 1.4rem;
line-height: 1.15rem; line-height: 1.8rem;
margin-top:1.5rem;
z-index: 999;
overflow: hidden;
} }
.issue-epic-box {
.due { position: absolute;
position: relative; right:3.0rem;
float: right; top: 0rem;
}
.due-icon {
position: relative;
float: right;
width: 2.5rem;
height: 2.5rem;
margin-top: 0.45rem;
background-color: MEDIUMPURPLE;
background-image: url(https://googledrive.com/host/0Bwgd0mVaLU_KU0N5b3JyRnJaNTA/resources/icons/AlarmClock.png);
background-repeat: no-repeat;
-webkit-background-size: 65%;
background-size: 65%;
background-position: center;
z-index: 1;
}
.due-date {
position: relative;
float: right;
width: auto; width: auto;
min-width: 6rem;
width: auto;
max-width: 10rem;
height: auto;
max-height: 2.2rem;
padding-top: 0.1rem;
padding-bottom: 0.2rem;
padding-left: 0.3rem;
padding-right: 0.3rem;
text-align: left;
font-size: 0.6rem;
line-height: 0.8rem;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.issue-epic-id {
font-size: 0.5rem;
font-weight: bold;
}
.issue-epic-name {
margin-left: 0.1rem;
font-size: 0.6rem;
font-weight: bold;
}
.issue-due-date-box {
position: absolute;
right: 0rem;
top: 0rem;
overflow: visible !important;
}
.issue-due-date {
position: absolute;
top: 1.3rem;
right: 1rem;
width: 5.3rem;
min-width: 2.8rem; min-width: 2.8rem;
height: 1.3rem; height: 1.3rem;
right: -0.6rem; padding-left: 0.2rem;
margin-top: 1.3rem; padding-right: 1.4rem;
padding-left: 0.3rem;
padding-right: 0.6rem;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
font-size: 0.7rem; font-size: 0.7rem;
line-height: 1.0rem; line-height: 1.0rem;
} }
.attachment { .issue-due-icon {
position: relative; position: absolute;
float: left; top: 0.5rem;
margin-left: 0.6rem; right: 0rem;
width: 2.1rem; width: 2.5rem;
height: 2.1rem; height: 2.5rem;
background-color: LIGHTSKYBLUE; border-radius: 50% !important;
background-image: url(https://images.weserv.nl/?url=www.iconsdb.com/icons/download/color/2f2f2f/attach-256.png); background-color: ORCHID !important;
background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/AlarmClock.png);
background-repeat: no-repeat; background-repeat: no-repeat;
-webkit-background-size: 70%;
background-size: 70%;
background-position: center; background-position: center;
background-size: 65%;
} }
.assignee { .badge, .shadow {
position: relative; border-style: solid;
float: right; border-color: #555;
width: 2.1rem; border-top-width: 0.12rem;
height: 2.1rem; border-left-width: 0.12rem;
text-align: center; border-bottom-width: 0.21rem;
font-weight: bold; border-right-width: 0.21rem;
font-size: 1.4rem; border-radius: 0.25rem;
line-height: 1.8rem;
background-image: url(https://images.weserv.nl/?url=www.iconsdb.com/icons/download/color/aaaaaa/contacts-256.png);
background-repeat: no-repeat;
-webkit-background-size: cover;
background-size: cover;
-webkit-background-size: 100%;
background-size: 100%;
-webkit-filter: contrast(150%) grayscale(100%);
filter: contrast(150%) grayscale(100%);
background-position: center;
} }
.qr-code { .badge {
position: relative; // WHITESMOKE, GAINSBOROM;
float: left; background-color: WHITESMOKE;
width: 2.1rem;
height: 2.1rem;
background-image: url(https://chart.googleapis.com/chart?cht=qr&chs=256x256&chld=L|1&chl=blog.qoomon.com);
background-repeat: no-repeat;
-webkit-background-size: cover;
background-size: cover;
background-position: center;
} }
.epic { .hidden {
width: auto; display: none;
height: auto; }
position: relative; .zigzag {
float:right; border-bottom-width: 0rem;
margin-right:0.6rem; }
padding-top: 0.2rem; .zigzag::after {
padding-bottom: 0.2rem; position: absolute;
padding-left: 0.3rem; bottom: -0.04rem;
padding-right: 0.3rem; left:-0.07rem;
text-align: left; content:"";
font-size: 0.7rem; width: 100%;
line-height: 0.7rem; border-bottom-width: 0.8rem;
max-width: calc( 100% - 10.2rem); border-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/ZigZag.png) 0 0 56 fill round repeat;
}
@media print {
@page {
margin: 0.0cm;
padding: 0.0cm;
}
html {
-webkit-print-color-adjust:exact;
print-color-adjust: exact;
}
.pageBreak {
page-break-after: always;
float: none;
}
.card {
height: 100%;
} }
.epic-key {
} }
.epic-name {
font-weight: bold;
} }
*/ */
}).replace(/{RESOURCE_ORIGIN}/g, resourceOrigin)); }).replace(/{RESOURCE_ORIGIN}/g, resourceOrigin));
@ -1188,7 +1150,7 @@
} }
function resizeIframe(iframe) { function resizeIframe(iframe) {
iframe.height(iframe[0].contentWindow.document.body.scrollHeight); iframe.height(iframe[0].contentWindow.document.body.height);
} }
// APP Specific Functions // APP Specific Functions
@ -1242,13 +1204,6 @@
} }
issueData.hasAttachment = data.fields.attachment.length > 0; issueData.hasAttachment = data.fields.attachment.length > 0;
if (issueData.description) {
var printScope = issueData.description.indexOf(printScopeDeviderToken);
if (printScope >= 0) {
issueData.description = issueData.description.substring(0, printScope);
issueData.hasAttachment = true;
}
}
issueData.storyPoints = data.fields.storyPoints; issueData.storyPoints = data.fields.storyPoints;
@ -1342,14 +1297,8 @@
issueData.dueDate = new Date(data.deadline).format('D d.m.'); issueData.dueDate = new Date(data.deadline).format('D d.m.');
} }
// TODO
issueData.hasAttachment = false; issueData.hasAttachment = false;
if (issueData.description) {
var printScope = issueData.description.indexOf(printScopeDeviderToken);
if (printScope >= 0) {
issueData.description = issueData.description.substring(0, printScope);
issueData.hasAttachment = true;
}
}
issueData.storyPoints = data.estimate; issueData.storyPoints = data.estimate;
@ -1424,13 +1373,6 @@
} }
issueData.hasAttachment = data.attachments > 0; issueData.hasAttachment = data.attachments > 0;
if (issueData.description) {
var printScope = issueData.description.indexOf(printScopeDeviderToken);
if (printScope >= 0) {
issueData.description = issueData.description.substring(0, printScope);
issueData.hasAttachment = true;
}
}
issueData.url = data.shortUrl; issueData.url = data.shortUrl;