diff --git a/bookmarklet.js b/bookmarklet.js
index 9598b68..583a73c 100644
--- a/bookmarklet.js
+++ b/bookmarklet.js
@@ -1,10 +1,10 @@
(function () {
- var version = "3.1.21";
+ var version = "3.2.0";
console.log("Version: " + version);
-
+
var isDev = typeof isDev !== 'undefined' && isDev ;
var isTest = typeof isTest !== 'undefined' && isTest ;
-
+
var hostOrigin = "https://qoomon.github.io/Jira-Issue-Card-Printer/";
if(isDev){
console.log("DEVELOPMENT");
@@ -13,10 +13,10 @@
if(isTest){
console.log("TEST");
}
-
+
//cors = "https://cors-anywhere.herokuapp.com/";
//$("#card").load("https://cors-anywhere.herokuapp.com/"+"https://qoomon.github.io/Jira-Issue-Card-Printer/card.html");
-
+
//
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@@ -29,69 +29,69 @@
} else {
ga('set', 'page', '/cardprinter');
}
-
+
//ga('set', 'referrer', window.location.hostname);
//ga('set', 'location', window.location.protocol + '//' + window.location.host + window.location.pathname);
//ga('set', 'hostname', window.location.hostname);
//ga('set', 'title', document.title);
-
+
//ga('set', 'campaignSource', '(direct)');
//ga('set', 'campaignMedium', '(none)');
//
-
+
try {
-
+
// load jQuery
if (window.jQuery === undefined) {
appendScript('//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js');
}
-
+
// wait untill all scripts loaded
appendScript('https://qoomon.github.io/void', function(){
init();
main();
});
-
+
function init(){
addJQueryFunctions();
addConsoleFunctions();
addStringFunctions();
addDateFunctions();
-
+
printScopeDeviderToken = "Attachment";
-
+
console.logLevel = console.INFO;
-
+
resourceOrigin = hostOrigin+ "resources/";
}
-
+
function main(){
//preconditions
if(jQuery("#card-print-overlay").length > 0){
alert("Print Card already opened!");
return;
}
-
+
var issueKeyList = getSelectedIssueKeyList();
-
+
if(issueKeyList.length <= 0){
alert("Please select at least one issue.");
return;
}
-
+
// open print preview
jQuery("body").append(printOverlayHTML);
jQuery("#card-print-overlay").prepend(printOverlayStyle);
-
+
ga('send', 'pageview');
-
+
jQuery("#card-print-dialog-title").text("Card Print - Loading " + issueKeyList.length + " issues...");
renderCards(issueKeyList, function(){
jQuery("#card-print-dialog-title").text("Card Print");
//print();
});
}
-
+
function print(){
var printFrame = jQuery("#card-print-dialog-content-iframe");
var printWindow = printFrame[0].contentWindow;
@@ -99,23 +99,47 @@
ga('send', 'event', 'button', 'click', 'print', jQuery(".card", printDocument).length );
printWindow.print();
}
-
- function renderCards(issueKeyList, callback) {
-
+
+ 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");
+ var printWindow = printFrame[0].contentWindow;
+ var printDocument = printWindow.document;
+
printDocument.open();
printDocument.write("