diff --git a/bookmarklet.js b/bookmarklet.js index 4d03494..e41591b 100644 --- a/bookmarklet.js +++ b/bookmarklet.js @@ -25,7 +25,7 @@ init().then(function(){ main(); }).catch(function(cause){ - alert("ERROR on init!\n\n" + cause); + alert("ERROR on init!\n\n" + JSON.stringify(cause,2,2)); }); }); @@ -113,11 +113,14 @@ initGoogleAnalytics(); } - promises.push(httpGetCors(global.hostOrigin + "card.html", function(data){ global.cardHtml = data; - console.log("foooooo: " + data); })); + + promises.push(httpGetCors(global.hostOrigin + "card.css", function(data){ + global.cardCss = data.replace(/https:\/\/qoomon.github.io\/Jira-Issue-Card-Printer\/resources/g, global.resourceOrigin); + })); + return Promise.all(promises); } @@ -682,332 +685,7 @@ function cardCss() { var result = jQuery(document.createElement('style')) .attr("type", "text/css") - .html(multilineString(function() { -/*! -* { - box-sizing: border-box; - overflow: hidden; -} -html { - background: WHITE; - padding: 0rem; - margin: 0rem; - font-size: 1.3cm; - overflow-y: scroll; -} -body { - padding: 0rem; - margin: 0rem; -} -.badge, .shadow { - border-style: solid; - border-color: #333; - border-top-width: 0.12rem; - border-left-width: 0.12rem; - border-bottom-width: 0.21rem; - border-right-width: 0.21rem; - border-radius: 0.25rem; -} -.badge { - // WHITESMOKE, GAINSBOROM; - background-color: #E0E0E0; -} -.hidden { - display: none; -} -.zigzag { - border-bottom-width: 0rem; -} -.zigzag::after { - position: absolute; - bottom: 0.03rem; - left:-0.16rem; - content:""; - width: 100%; - border-style:solid; - border-bottom-width: 1rem; - border-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/Tearing.png); - border-image-width: 0 0 0.7rem 0; - border-image-slice: 56 0 56 1; - border-image-repeat: round round; -} -#preload { - position: fixed; - top: 0rem; - left: 100%; -} -.author { - color: DIMGREY; - position: absolute; - top:0.35rem; - left:calc(50% - 2rem); - font-size: 0.6rem; - overflow:visible; - line-height: 0.38rem; -} -.author > span { - position: relative; - left: 0.23rem; - font-size: 0.6em; - text-align: center; -} -.card { - position: relative; - float:left; - height: 100%; - width: 100%; - padding: 0.5cm; - min-width:14.5rem; - min-height:10.0rem; - border-color: LightGray; - border-style: dotted; - border-width: 0.03cm; -} -.card-content { - position: relative; - height: 100%; - // find .card-header; - padding-top: 2rem; - // find .card-footer; - padding-bottom: 1.3rem; -} -.card-body { - position: relative; - height: 100%; - margin-left: 0.4rem; - margin-right: 0.4rem; - padding-top: 1.1rem; - padding-bottom: 1.1rem; - padding-left: 0.4rem; - padding-right: 0.4rem; - background: WHITE; -} -.card-header { - position: absolute; - top: 0rem; - height: 4.2rem; - width: 100%; -} -.card-footer { - position: absolute; - bottom: 0rem; - height: 2.2rem; - width: 100%; -} -.issue-summary { - font-weight: bold; - font-size: 0.9rem; -} -.issue-description { - margin-top: 0.1rem; - display: block; - font-size: 0.6rem; - line-height: 0.62rem; - overflow: hidden; -} -.issue-description p:first-of-type { - margin-top: 0rem; -} -.issue-description p:last-of-type { - margin-bottom: 0rem; -} -.issue-id { - position: absolute; - left: 1rem; - top: 1.2rem; - height: 1.5rem; - max-width: calc(100% - 7.5rem); - min-width: 6.0rem; - padding-left: 2.1rem; - padding-right: 0.4rem; - background-color: WHITESMOKE; - line-height: 1.3rem; - font-size: 0.8rem; - font-weight: bold; - text-align: center; - white-space: nowrap; - direction: rtl; -} -.issue-id-fadeout { - position: absolute; - left: 2.4rem; - top: 1.2rem; - width: 1.2rem; - height: 1.3rem; - z-index: 0; - background: linear-gradient(to left, rgba(224, 224, 224, 0) 0%, rgba(224, 224, 224, 1) 60%); -} -.issue-icon { - position: absolute; - left: 0rem; - top: 0rem; - height: 3.0rem; - width: 3.0rem; - border-radius: 50%; - background-color: LIGHTSEAGREEN; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Objects.png); - background-repeat: no-repeat; - background-position: center; - background-size: 63%; -} -.issue-icon[type="story"], .issue-icon[type="user story"] { - background-color: GOLD; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Bulb.png); -} -.issue-icon[type="bug"], .issue-icon[type="correction"] { - background-color: CRIMSON; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Bug.png); -} -.issue-icon[type="epic"] { - background-color: ROYALBLUE; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Flash.png); -} -.issue-icon[type="task"] { - background-color: WHEAT; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Task.png); -} -.issue-icon[type="new feature"] { - background-color: LIMEGREEN; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Plus.png); -} -.issue-icon[type="improvement"] { - background-color: CORNFLOWERBLUE; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Arrow.png); -} -.issue-estimate { - position: absolute; - left: 2.5rem; - top: 0.0rem; - height: 1.6rem; - width: 1.6rem; - border-radius: 50%; - 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.5rem; - top: 0rem; - width: 2.0rem; - height: 2.0rem; - border-radius: 50%; - background-color: LIGHTSKYBLUE; - 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%; - 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; - font-weight: bold; - font-size: 1.4rem; - line-height: 1.9rem; -} -.issue-epic-box { - position: absolute; - right:2.5rem; - top: 0rem; - width: auto; - min-width: 2rem; - width: auto; - max-width: calc(100% - 7.5rem); - 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.5rem; - line-height: 0.55rem; -} -.issue-epic-id { - font-size: 0.5rem; - font-weight: bold; - max-width: 1rem; -} -.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; - height: 1.3rem; - padding-left: 0.2rem; - padding-right: 1.4rem; - text-align: center; - font-weight: bold; - font-size: 0.7rem; - line-height: 1.0rem; -} -.issue-due-icon { - position: absolute; - top: 0.5rem; - right: 0rem; - width: 2.5rem; - height: 2.5rem; - border-radius: 50%; - background-color: ORCHID; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/AlarmClock.png); - background-repeat: no-repeat; - background-position: center; - background-size: 65%; -} - -@media print { - @page { - margin: 0.0mm; - padding: 0.0mm; - } - html { - -webkit-print-color-adjust:exact; - print-color-adjust: exact; - } - .card { - page-break-inside: avoid; - } -} -} -*/ - }).replace(/https:\/\/qoomon.github.io\/Jira-Issue-Card-Printer\/resources/g, global.resourceOrigin)); + .html(global.cardCss); return result; } diff --git a/card.css b/card.css new file mode 100644 index 0000000..92c5ba2 --- /dev/null +++ b/card.css @@ -0,0 +1,321 @@ +* { + box-sizing: border-box; + overflow: hidden; +} +html { + background: WHITE; + padding: 0rem; + margin: 0rem; + font-size: 1.3cm; + overflow-y: scroll; +} +body { + padding: 0rem; + margin: 0rem; +} +.badge, .shadow { + border-style: solid; + border-color: #333; + border-top-width: 0.12rem; + border-left-width: 0.12rem; + border-bottom-width: 0.21rem; + border-right-width: 0.21rem; + border-radius: 0.25rem; +} +.badge { + // WHITESMOKE, GAINSBOROM; + background-color: #E0E0E0; +} +.hidden { + display: none; +} +.zigzag { + border-bottom-width: 0rem; +} +.zigzag::after { + position: absolute; + bottom: 0.03rem; + left:-0.16rem; + content:""; + width: 100%; + border-style:solid; + border-bottom-width: 1rem; + border-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/Tearing.png); + border-image-width: 0 0 0.7rem 0; + border-image-slice: 56 0 56 1; + border-image-repeat: round round; +} +#preload { + position: fixed; + top: 0rem; + left: 100%; +} +.author { + color: DIMGREY; + position: absolute; + top:0.35rem; + left:calc(50% - 2rem); + font-size: 0.6rem; + overflow:visible; + line-height: 0.38rem; +} +.author > span { + position: relative; + left: 0.23rem; + font-size: 0.6em; + text-align: center; +} +.card { + position: relative; + float:left; + height: 100%; + width: 100%; + padding: 0.5cm; + min-width:14.5rem; + min-height:10.0rem; + border-color: LightGray; + border-style: dotted; + border-width: 0.03cm; +} +.card-content { + position: relative; + height: 100%; + // find .card-header; + padding-top: 2rem; + // find .card-footer; + padding-bottom: 1.3rem; +} +.card-body { + position: relative; + height: 100%; + margin-left: 0.4rem; + margin-right: 0.4rem; + padding-top: 1.1rem; + padding-bottom: 1.1rem; + padding-left: 0.4rem; + padding-right: 0.4rem; + background: WHITE; +} +.card-header { + position: absolute; + top: 0rem; + height: 4.2rem; + width: 100%; +} +.card-footer { + position: absolute; + bottom: 0rem; + height: 2.2rem; + width: 100%; +} +.issue-summary { + font-weight: bold; + font-size: 0.9rem; +} +.issue-description { + margin-top: 0.1rem; + display: block; + font-size: 0.6rem; + line-height: 0.62rem; + overflow: hidden; +} +.issue-description p:first-of-type { + margin-top: 0rem; +} +.issue-description p:last-of-type { + margin-bottom: 0rem; +} +.issue-id { + position: absolute; + left: 1rem; + top: 1.2rem; + height: 1.5rem; + max-width: calc(100% - 7.5rem); + min-width: 6.0rem; + padding-left: 2.1rem; + padding-right: 0.4rem; + background-color: WHITESMOKE; + line-height: 1.3rem; + font-size: 0.8rem; + font-weight: bold; + text-align: center; + white-space: nowrap; + direction: rtl; +} +.issue-id-fadeout { + position: absolute; + left: 2.4rem; + top: 1.2rem; + width: 1.2rem; + height: 1.3rem; + z-index: 0; + background: linear-gradient(to left, rgba(224, 224, 224, 0) 0%, rgba(224, 224, 224, 1) 60%); +} +.issue-icon { + position: absolute; + left: 0rem; + top: 0rem; + height: 3.0rem; + width: 3.0rem; + border-radius: 50%; + background-color: LIGHTSEAGREEN; + background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Objects.png); + background-repeat: no-repeat; + background-position: center; + background-size: 63%; +} +.issue-icon[type="story"], .issue-icon[type="user story"] { + background-color: GOLD; + background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Bulb.png); +} +.issue-icon[type="bug"], .issue-icon[type="correction"] { + background-color: CRIMSON; + background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Bug.png); +} +.issue-icon[type="epic"] { + background-color: ROYALBLUE; + background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Flash.png); +} +.issue-icon[type="task"] { + background-color: WHEAT; + background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Task.png); +} +.issue-icon[type="new feature"] { + background-color: LIMEGREEN; + background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Plus.png); +} +.issue-icon[type="improvement"] { + background-color: CORNFLOWERBLUE; + background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Arrow.png); +} +.issue-estimate { + position: absolute; + left: 2.5rem; + top: 0.0rem; + height: 1.6rem; + width: 1.6rem; + border-radius: 50%; + 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.5rem; + top: 0rem; + width: 2.0rem; + height: 2.0rem; + border-radius: 50%; + background-color: LIGHTSKYBLUE; + 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%; + 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; + font-weight: bold; + font-size: 1.4rem; + line-height: 1.9rem; +} +.issue-epic-box { + position: absolute; + right:2.5rem; + top: 0rem; + width: auto; + min-width: 2rem; + width: auto; + max-width: calc(100% - 7.5rem); + 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.5rem; + line-height: 0.55rem; +} +.issue-epic-id { + font-size: 0.5rem; + font-weight: bold; + max-width: 1rem; +} +.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; + height: 1.3rem; + padding-left: 0.2rem; + padding-right: 1.4rem; + text-align: center; + font-weight: bold; + font-size: 0.7rem; + line-height: 1.0rem; +} +.issue-due-icon { + position: absolute; + top: 0.5rem; + right: 0rem; + width: 2.5rem; + height: 2.5rem; + border-radius: 50%; + background-color: ORCHID; + background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/AlarmClock.png); + background-repeat: no-repeat; + background-position: center; + background-size: 65%; +} + +@media print { + @page { + margin: 0.0mm; + padding: 0.0mm; + } + html { + -webkit-print-color-adjust:exact; + print-color-adjust: exact; + } + .card { + page-break-inside: avoid; + } +}