Add Page/Card Setup Features
This commit is contained in:
parent
07bef49c61
commit
b28722f6f7
268
bookmarklet.js
268
bookmarklet.js
@ -1,5 +1,5 @@
|
||||
(function () {
|
||||
var version = "3.1.21";
|
||||
var version = "3.2.0";
|
||||
console.log("Version: " + version);
|
||||
|
||||
var isDev = typeof isDev !== 'undefined' && isDev ;
|
||||
@ -100,6 +100,30 @@
|
||||
printWindow.print();
|
||||
}
|
||||
|
||||
function hideDescription(hide){
|
||||
var printFrame = jQuery("#card-print-dialog-content-iframe");
|
||||
var printWindow = printFrame[0].contentWindow;
|
||||
var printDocument = printWindow.document;
|
||||
if(hide){
|
||||
jQuery(".description", printDocument).hide();
|
||||
} else {
|
||||
jQuery(".description", printDocument).show();
|
||||
}
|
||||
|
||||
resizeIframe(printFrame);
|
||||
}
|
||||
|
||||
function endableMultiCardPage(enable){
|
||||
var printFrame = jQuery("#card-print-dialog-content-iframe");
|
||||
var printWindow = printFrame[0].contentWindow;
|
||||
var printDocument = printWindow.document;
|
||||
if(enable){
|
||||
jQuery(".page", printDocument).addClass("multiCardPage");
|
||||
} else {
|
||||
jQuery(".page", printDocument).removeClass("multiCardPage");
|
||||
}
|
||||
}
|
||||
|
||||
function renderCards(issueKeyList, callback) {
|
||||
|
||||
var printFrame = jQuery("#card-print-dialog-content-iframe");
|
||||
@ -337,20 +361,24 @@
|
||||
<input id="report-issue" type="button" class="aui-button" value="Report Issues" />
|
||||
<input id="about" type="button" class="aui-button" value="About" />
|
||||
</div>
|
||||
<div id="buttons">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div id="card-print-dialog-content">
|
||||
<iframe id="card-print-dialog-content-iframe"></iframe>
|
||||
</div>
|
||||
<div id="card-print-dialog-footer"></div>
|
||||
<div id="card-print-dialog-footer">
|
||||
<div class="buttons">
|
||||
<label style="margin-right:10px"><input id="card-scale-range" type="range" min="0.2" max="1.6" step="0.1" value="1.0" />Scale</label>
|
||||
<label style="margin-right:10px"><input id="hide-description-checkbox" type="checkbox"/>Hide Description</label>
|
||||
<label style="margin-right:10px"><input id="multi-card-page-checkbox" type="checkbox"/>Multi Card Page</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
*/
|
||||
}));
|
||||
// info
|
||||
|
||||
// info
|
||||
result.find("#report-issue")
|
||||
.click(function(event){
|
||||
window.open('https://github.com/qoomon/Jira-Issue-Card-Printer/issues');
|
||||
@ -363,6 +391,31 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
// enable multe card page
|
||||
|
||||
result.find("#multi-card-page-checkbox")
|
||||
.click(function() {
|
||||
endableMultiCardPage(this.checked);
|
||||
return true;
|
||||
});
|
||||
|
||||
// hide description
|
||||
|
||||
result.find("#hide-description-checkbox")
|
||||
.click(function() {
|
||||
hideDescription(this.checked);
|
||||
return true;
|
||||
});
|
||||
|
||||
// scale card
|
||||
|
||||
result.find("#card-scale-range").on("input", function() {
|
||||
var printFrame = jQuery("#card-print-dialog-content-iframe");
|
||||
var printWindow = printFrame[0].contentWindow;
|
||||
var printDocument = printWindow.document;
|
||||
jQuery("HTML", printDocument).css("font-size", jQuery(this).val() +"cm");
|
||||
});
|
||||
|
||||
// print
|
||||
|
||||
result.find("#card-print-dialog-print")
|
||||
@ -383,7 +436,7 @@
|
||||
if( event.target == this ){
|
||||
closePrintPreview();
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
|
||||
jQuery(document).keyup(function(e) {
|
||||
@ -485,9 +538,8 @@
|
||||
}
|
||||
|
||||
#info {
|
||||
position: absolute;
|
||||
right: 400px;
|
||||
float: left;
|
||||
position: relative;
|
||||
float: right;
|
||||
display: inline-block;
|
||||
height 30px;
|
||||
}
|
||||
@ -503,6 +555,13 @@
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
.cancel{
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
display: inline-block;
|
||||
padding: 5px 10px;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
*/
|
||||
}));
|
||||
return result;
|
||||
@ -516,16 +575,21 @@
|
||||
.attr("type", "text/css")
|
||||
.html(multilineString(function() {
|
||||
/*!
|
||||
HTML {
|
||||
font-size: 1.0cm;
|
||||
}
|
||||
.page {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
padding: 1.0rem;
|
||||
margin: 1.0rem;
|
||||
width: auto;
|
||||
max-width: 29.7cm;
|
||||
min-width: 21cm;
|
||||
min-width: 21rem;
|
||||
height: auto;
|
||||
page-break-after: always;
|
||||
page-break-inside: avoid;
|
||||
|
||||
background:rgba(256, 256, 256, 0.85);
|
||||
|
||||
@ -535,26 +599,30 @@
|
||||
|
||||
border-style: solid;
|
||||
border-color: #bfbfbf;
|
||||
border-width: 0.05cm;
|
||||
-moz-border-radius: 0.1cm;
|
||||
-webkit-border-radius: 0.1cm;
|
||||
border-radius: 0.1cm;
|
||||
border-width: 0.05rem;
|
||||
-moz-border-radius: 0.1rem;
|
||||
-webkit-border-radius: 0.1rem;
|
||||
border-radius: 0.1rem;
|
||||
|
||||
padding: 1.0cm;
|
||||
margin: 1.0cm;
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
.multiCardPage {
|
||||
page-break-after: avoid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media print {
|
||||
|
||||
.page {
|
||||
|
||||
page-break-after: always;
|
||||
|
||||
background:rgba(256, 256, 256, 0.0);
|
||||
border-style: none;
|
||||
padding: 0.0cm;
|
||||
margin: 0.0cm;
|
||||
padding: 0.0rem;
|
||||
margin: 0.0rem;
|
||||
margin-top: 2.0rem;
|
||||
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
@ -567,9 +635,14 @@
|
||||
filter:opacity(1.0);
|
||||
}
|
||||
|
||||
.page:first-of-type {
|
||||
margin-top: 0rem;
|
||||
}
|
||||
|
||||
.page:last-of-type {
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
}));
|
||||
@ -584,10 +657,11 @@
|
||||
var page = jQuery(document.createElement('div'))
|
||||
.attr("id",issueKey)
|
||||
.addClass("page")
|
||||
.addClass("singleCardPage")
|
||||
.html(multilineString(function() {
|
||||
/*!
|
||||
<div class="card">
|
||||
<div class="author">Bengt Brodersen - qoomon.com</div>
|
||||
<div class="author">qoomon.com<br>Bengt Brodersen</div>
|
||||
<div class="card-border"></div>
|
||||
<div class="card-header">
|
||||
<div class="type-icon badge circular"></div>
|
||||
@ -647,12 +721,12 @@
|
||||
.shadow {
|
||||
border-style: solid;
|
||||
border-color: #2f2f2f;
|
||||
border-top-width: 0.14cm;
|
||||
border-left-width: 0.14cm;
|
||||
border-bottom-width: 0.24cm;
|
||||
border-right-width: 0.24cm;
|
||||
-webkit-border-radius: 0.25cm;
|
||||
border-radius: 0.25cm;
|
||||
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;
|
||||
// -webkit-filter: drop-shadow(0px 5px 10px black)
|
||||
}
|
||||
.circular {
|
||||
@ -661,34 +735,36 @@
|
||||
border-radius: 50%;
|
||||
}
|
||||
.badge {
|
||||
width: 3.2cm;
|
||||
height: 3.2cm;
|
||||
width: 3.2rem;
|
||||
height: 3.2rem;
|
||||
background: #d0d0d0;
|
||||
}
|
||||
|
||||
.card {
|
||||
position: relative;
|
||||
min-width: 21.0cm;
|
||||
min-width: 21.0rem;
|
||||
|
||||
}
|
||||
.author {
|
||||
z-index: 999;
|
||||
position: absolute;
|
||||
top:3.1cm;
|
||||
right:0.7cm;
|
||||
top:2.0rem;
|
||||
right:-0.25rem;
|
||||
-webkit-transform-origin: 100% 100%;
|
||||
transform-origin: 100% 100%;
|
||||
-webkit-transform: rotate(-90deg);
|
||||
transform: rotate(-90deg);
|
||||
font-size: 0.4cm;
|
||||
font-size: 0.4rem;
|
||||
line-height: 0.8rem;
|
||||
text-align: center;
|
||||
color: DARKGREY;
|
||||
}
|
||||
.card-border {
|
||||
position: absolute;
|
||||
top:2.0cm;
|
||||
left:0.4cm;
|
||||
right:0.4cm;
|
||||
height: calc(100% - 4.0cm);
|
||||
top:2.0rem;
|
||||
left:0.4rem;
|
||||
right:0.4rem;
|
||||
height: calc(100% - 4.0rem);
|
||||
background: #ffffff;
|
||||
|
||||
}
|
||||
@ -697,17 +773,17 @@
|
||||
}
|
||||
.card-content {
|
||||
position: relative;
|
||||
margin-top: 0.3cm;
|
||||
margin-left: 1.0cm;
|
||||
margin-right: 1.1cm;
|
||||
margin-bottom: 0.2cm;
|
||||
min-height: 3.0cm;
|
||||
margin-top: 0.3rem;
|
||||
margin-left: 1.0rem;
|
||||
margin-right: 1.1rem;
|
||||
margin-bottom: 0.2rem;
|
||||
min-height: 1.2rem;
|
||||
}
|
||||
.content-header {
|
||||
position: relative;
|
||||
font-size: 1.1cm;
|
||||
line-height: 1.1cm;
|
||||
margin-bottom: 0.6cm;
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.1rem;
|
||||
margin-bottom: 0.6rem;
|
||||
}
|
||||
.card-footer {
|
||||
position: relative;
|
||||
@ -717,24 +793,23 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
.description {
|
||||
min-height: 3.0cm;
|
||||
font-size: 0.6cm;
|
||||
line-height: 0.6cm;
|
||||
font-size: 0.6rem;
|
||||
line-height: 0.6rem;
|
||||
}
|
||||
.key {
|
||||
position: absolute;
|
||||
float: left;
|
||||
width: auto;
|
||||
min-width: 4.4cm;
|
||||
height: 1.35cm;
|
||||
left: 3.0cm;
|
||||
margin-top: 1.2cm;
|
||||
padding-left: 0.7cm;
|
||||
padding-right: 0.4cm;
|
||||
min-width: 4.4rem;
|
||||
height: 1.35rem;
|
||||
left: 3.0rem;
|
||||
margin-top: 1.2rem;
|
||||
padding-left: 0.7rem;
|
||||
padding-right: 0.4rem;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 1.0cm;
|
||||
line-height: 1.6cm;
|
||||
font-size: 1.0rem;
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
.type-icon {
|
||||
position: relative;
|
||||
@ -764,15 +839,15 @@
|
||||
.estimate {
|
||||
position: relative;
|
||||
float: left;
|
||||
left: -0.65cm;
|
||||
top:-1.5cm;
|
||||
height: 1.1cm;
|
||||
width: 1.1cm;
|
||||
left: -0.65rem;
|
||||
top:-1.5rem;
|
||||
height: 1.1rem;
|
||||
width: 1.1rem;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 1cm;
|
||||
line-height: 1.15cm;
|
||||
margin-top:1.5cm;
|
||||
font-size: 1rem;
|
||||
line-height: 1.15rem;
|
||||
margin-top:1.5rem;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
@ -783,9 +858,9 @@
|
||||
.due-icon {
|
||||
position: relative;
|
||||
float:right;
|
||||
width: 2.5cm;
|
||||
height: 2.5cm;
|
||||
margin-top: 0.4cm;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
margin-top: 0.4rem;
|
||||
background-color: MEDIUMPURPLE;
|
||||
background-image: url(https://googledrive.com/host/0Bwgd0mVaLU_KU0N5b3JyRnJaNTA/resources/icons/AlarmClock.png);
|
||||
background-repeat: no-repeat;
|
||||
@ -797,26 +872,26 @@
|
||||
.due-date {
|
||||
position: relative;
|
||||
float: right;
|
||||
right: -0.6cm;
|
||||
right: -0.6rem;
|
||||
width: auto;
|
||||
min-width: 2.8cm;
|
||||
min-width: 2.8rem;
|
||||
height: auto;
|
||||
margin-top: 1.3cm;
|
||||
padding-top: 0.2cm;
|
||||
padding-bottom: 0.2cm;
|
||||
padding-left: 0.3cm;
|
||||
padding-right: 0.6cm;
|
||||
margin-top: 1.3rem;
|
||||
padding-top: 0.2rem;
|
||||
padding-bottom: 0.2rem;
|
||||
padding-left: 0.3rem;
|
||||
padding-right: 0.6rem;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 0.7cm;
|
||||
line-height: 0.7cm;
|
||||
font-size: 0.7rem;
|
||||
line-height: 0.7rem;
|
||||
}
|
||||
.attachment {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin-left: 0.6cm;
|
||||
width: 2.1cm;
|
||||
height: 2.1cm;
|
||||
margin-left: 0.6rem;
|
||||
width: 2.1rem;
|
||||
height: 2.1rem;
|
||||
background-color: LIGHTSKYBLUE;
|
||||
background-image: url(https://images.weserv.nl/?url=www.iconsdb.com/icons/download/color/2f2f2f/attach-256.png);
|
||||
background-repeat: no-repeat;
|
||||
@ -828,12 +903,12 @@
|
||||
.assignee {
|
||||
position: relative;
|
||||
float: right;
|
||||
width: 2.1cm;
|
||||
height: 2.1cm;
|
||||
width: 2.1rem;
|
||||
height: 2.1rem;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 1.8cm;
|
||||
line-height: 2.5cm;
|
||||
font-size: 1.8rem;
|
||||
line-height: 2.2rem;
|
||||
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;
|
||||
@ -847,8 +922,8 @@
|
||||
.qr-code {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 2.1cm;
|
||||
height: 2.1cm;
|
||||
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;
|
||||
@ -860,15 +935,15 @@
|
||||
height: auto;
|
||||
position: relative;
|
||||
float:right;
|
||||
margin-right:0.6cm;
|
||||
padding-top: 0.2cm;
|
||||
padding-bottom: 0.2cm;
|
||||
padding-left: 0.3cm;
|
||||
padding-right: 0.3cm;
|
||||
margin-right:0.6rem;
|
||||
padding-top: 0.2rem;
|
||||
padding-bottom: 0.2rem;
|
||||
padding-left: 0.3rem;
|
||||
padding-right: 0.3rem;
|
||||
text-align: left;
|
||||
font-size: 0.7cm;
|
||||
line-height: 0.7cm;
|
||||
max-width: calc( 100% - 10.2cm);
|
||||
font-size: 0.7rem;
|
||||
line-height: 0.7rem;
|
||||
max-width: calc( 100% - 10.2rem);
|
||||
}
|
||||
.epic-key {
|
||||
}
|
||||
@ -1053,7 +1128,7 @@
|
||||
// Time
|
||||
a: function() { return this.getHours() < 12 ? 'am' : 'pm'; },
|
||||
A: function() { return this.getHours() < 12 ? 'AM' : 'PM'; },
|
||||
B: function() { return Math.floor((((this.getUTCHours() + 1) % 24) + this.getUTCMinutes() / 60 + this.getUTCSeconds() / 3600) * 1000 / 24); }, // Fixed now
|
||||
B: function() { return Math.floor((((this.getUTCHours() + 1) % 24) + this.getUTreminutes() / 60 + this.getUTCSeconds() / 3600) * 1000 / 24); }, // Fixed now
|
||||
g: function() { return this.getHours() % 12 || 12; },
|
||||
G: function() { return this.getHours(); },
|
||||
h: function() { return ((this.getHours() % 12 || 12) < 10 ? '0' : '') + (this.getHours() % 12 || 12); },
|
||||
@ -1104,4 +1179,3 @@
|
||||
});
|
||||
};
|
||||
})();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user