Merge branch 'gh-pages' into develop
Conflicts: bookmarklet.js
This commit is contained in:
commit
f32825876f
243
bookmarklet.js
243
bookmarklet.js
@ -1,22 +1,20 @@
|
|||||||
version = "3.1.15";
|
(function () {
|
||||||
|
var version = "3.1.21";
|
||||||
console.log("Version: " + version);
|
console.log("Version: " + version);
|
||||||
|
|
||||||
var isDev = typeof isDev === 'undefined' || isDev ;
|
var isDev = typeof isDev !== 'undefined' && isDev ;
|
||||||
var isTest = typeof isTest === 'undefined' || isTest ;
|
var isTest = typeof isTest !== 'undefined' && isTest ;
|
||||||
|
|
||||||
referrer = window.location.hostname
|
var hostOrigin = "https://qoomon.github.io/Jira-Issue-Card-Printer/";
|
||||||
hostOrigin = "https://qoomon.github.io/Jira-Issue-Card-Printer/";
|
|
||||||
if(isDev){
|
if(isDev){
|
||||||
console.log("DEVELOPMENT");
|
console.log("DEVELOPMENT");
|
||||||
referrer = "dev.qoomon.com"
|
|
||||||
hostOrigin = "https://rawgit.com/qoomon/Jira-Issue-Card-Printer/develop/";
|
hostOrigin = "https://rawgit.com/qoomon/Jira-Issue-Card-Printer/develop/";
|
||||||
}
|
}
|
||||||
if(isTest){
|
if(isTest){
|
||||||
console.log("TEST");
|
console.log("TEST");
|
||||||
referrer = "dev.qoomon.com"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cors = "https://cors-anywhere.herokuapp.com/";
|
//cors = "https://cors-anywhere.herokuapp.com/";
|
||||||
//$("#card").load("https://cors-anywhere.herokuapp.com/"+"https://qoomon.github.io/Jira-Issue-Card-Printer/card.html");
|
//$("#card").load("https://cors-anywhere.herokuapp.com/"+"https://qoomon.github.io/Jira-Issue-Card-Printer/card.html");
|
||||||
|
|
||||||
// <GoogleAnalytics>
|
// <GoogleAnalytics>
|
||||||
@ -25,10 +23,13 @@ cors = "https://cors-anywhere.herokuapp.com/";
|
|||||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
|
ga('create', 'UA-50840116-3', {'alwaysSendReferrer': true});
|
||||||
ga('create', 'UA-50840116-3');
|
if(isTest || isDev){
|
||||||
ga('set', 'referrer', referrer);
|
ga('set', 'page', '/dev/cardprinter');
|
||||||
|
} else {
|
||||||
ga('set', 'page', '/cardprinter');
|
ga('set', 'page', '/cardprinter');
|
||||||
|
}
|
||||||
|
|
||||||
//ga('set', 'referrer', window.location.hostname);
|
//ga('set', 'referrer', window.location.hostname);
|
||||||
//ga('set', 'location', window.location.protocol + '//' + window.location.host + window.location.pathname);
|
//ga('set', 'location', window.location.protocol + '//' + window.location.host + window.location.pathname);
|
||||||
//ga('set', 'hostname', window.location.hostname);
|
//ga('set', 'hostname', window.location.hostname);
|
||||||
@ -217,6 +218,79 @@ try {
|
|||||||
} else {
|
} else {
|
||||||
card.find(".due").addClass("hidden");
|
card.find(".due").addClass("hidden");
|
||||||
}
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function loadCardDataJSON(issueKey, callback) {
|
||||||
|
|
||||||
|
//https://docs.atlassian.com/jira/REST/latest/
|
||||||
|
var url = '/rest/api/2/issue/' + issueKey + '?expand=renderedFields,names';
|
||||||
|
console.logDebug("IssueUrl: " + window.location.hostname + url);
|
||||||
|
console.logDebug("Issue: " + issueKey + " Loading...");
|
||||||
|
return jQuery.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: url,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(responseData){
|
||||||
|
fields = responseData.fields;
|
||||||
|
// add custom fields with field names
|
||||||
|
jQuery.each(responseData.names, function(key, value) {
|
||||||
|
if(key.startsWith("customfield_")){
|
||||||
|
var newFieldId = value.toCamelCase();
|
||||||
|
console.logTrace("add new field: " + newFieldId +" with value from "+ key);
|
||||||
|
fields[value.toCamelCase()] = fields[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.logDebug("Issue: " + issueKey + " Loaded!");
|
||||||
|
callback(responseData);
|
||||||
|
},
|
||||||
|
data: {},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//############################################################################################################################
|
||||||
|
//############################################################################################################################
|
||||||
|
//############################################################################################################################
|
||||||
|
|
||||||
|
|
||||||
|
// http://www.cssdesk.com/T9hXg
|
||||||
|
|
||||||
|
function printOverlayHTML(){
|
||||||
|
|
||||||
|
|
||||||
|
var result = jQuery(document.createElement('div'))
|
||||||
|
.attr("id","card-print-overlay")
|
||||||
|
.html(multilineString(function() {
|
||||||
|
/*!
|
||||||
|
<div id="card-print-dialog">
|
||||||
|
<div id="card-print-dialog-header">
|
||||||
|
<div id="card-print-dialog-title">Card Print</div>
|
||||||
|
<div id="buttons">
|
||||||
|
<input id="report-issue" type="button" class="aui-button" value="Report Issues" />
|
||||||
|
<input id="about" type="button" class="aui-button" value="About" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="card-print-dialog-content">
|
||||||
|
<iframe id="card-print-dialog-content-iframe"></iframe>
|
||||||
|
</div>
|
||||||
|
<div id="card-print-dialog-footer">
|
||||||
|
<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>
|
||||||
|
*/
|
||||||
|
}));
|
||||||
|
// info
|
||||||
|
|
||||||
|
result.find("#report-issue")
|
||||||
|
.click(function(event){
|
||||||
|
window.open('https://github.com/qoomon/Jira-Issue-Card-Printer/issues');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
=======
|
||||||
|
|
||||||
//Attachment
|
//Attachment
|
||||||
var hasAttachment = false;
|
var hasAttachment = false;
|
||||||
@ -332,22 +406,24 @@ try {
|
|||||||
<div id="card-print-dialog">
|
<div id="card-print-dialog">
|
||||||
<div id="card-print-dialog-header">
|
<div id="card-print-dialog-header">
|
||||||
<div id="card-print-dialog-title">Card Print</div>
|
<div id="card-print-dialog-title">Card Print</div>
|
||||||
<div id="buttons">
|
<div id="info">
|
||||||
<input id="report-issue" type="button" class="aui-button" value="Report Issues" />
|
<input id="report-issue" type="button" class="aui-button" value="Report Issues" />
|
||||||
<input id="about" type="button" class="aui-button" value="About" />
|
<input id="about" type="button" class="aui-button" value="About" />
|
||||||
</div>
|
</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>
|
||||||
<div id="card-print-dialog-content">
|
<div id="card-print-dialog-content">
|
||||||
<iframe id="card-print-dialog-content-iframe"></iframe>
|
<iframe id="card-print-dialog-content-iframe"></iframe>
|
||||||
</div>
|
</div>
|
||||||
<div id="card-print-dialog-footer">
|
<div id="card-print-dialog-footer"></div>
|
||||||
<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
|
||||||
|
>>>>>>> gh-pages
|
||||||
|
|
||||||
result.find("#report-issue")
|
result.find("#report-issue")
|
||||||
.click(function(event){
|
.click(function(event){
|
||||||
@ -482,6 +558,14 @@ try {
|
|||||||
height 30px;
|
height 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#info {
|
||||||
|
position: absolute;
|
||||||
|
right: 400px;
|
||||||
|
float: left;
|
||||||
|
display: inline-block;
|
||||||
|
height 30px;
|
||||||
|
}
|
||||||
|
|
||||||
#card-print-dialog-title{
|
#card-print-dialog-title{
|
||||||
position: relative;
|
position: relative;
|
||||||
float: left;
|
float: left;
|
||||||
@ -539,6 +623,84 @@ try {
|
|||||||
|
|
||||||
.page {
|
.page {
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
border:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#card-print-dialog-footer {
|
||||||
|
position: relative;
|
||||||
|
background: #f0f0f0;
|
||||||
|
border-top: 1px solid #cccccc;
|
||||||
|
height: 30px;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
#buttons {
|
||||||
|
position: relative;
|
||||||
|
float: right;
|
||||||
|
display: inline-block;
|
||||||
|
height 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#card-print-dialog-title{
|
||||||
|
position: relative;
|
||||||
|
float: left;
|
||||||
|
color: rgb(51, 51, 51);
|
||||||
|
display: block;
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: normal;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function printPanelPageCSS(){
|
||||||
|
|
||||||
|
var result = jQuery(document.createElement('style'))
|
||||||
|
.attr("id", "printPanelPageStyle")
|
||||||
|
.attr("type", "text/css")
|
||||||
|
.html(multilineString(function() {
|
||||||
|
/*!
|
||||||
|
.page {
|
||||||
|
position: relative;
|
||||||
|
overflow: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
width: auto;
|
||||||
|
max-width: 29.7cm;
|
||||||
|
min-width: 21cm;
|
||||||
|
height: auto;
|
||||||
|
=======
|
||||||
|
>>>>>>> gh-pages
|
||||||
|
page-break-after: always;
|
||||||
|
|
||||||
|
background:rgba(256, 256, 256, 0.0);
|
||||||
|
border-style: none;
|
||||||
|
padding: 0.0cm;
|
||||||
|
margin: 0.0cm;
|
||||||
|
|
||||||
|
-webkit-box-shadow: none;
|
||||||
|
-moz-box-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
|
-webkit-print-color-adjust:exact;
|
||||||
|
print-color-adjust: exact;
|
||||||
|
|
||||||
|
-webkit-filter:opacity(1.0);
|
||||||
|
filter:opacity(1.0);
|
||||||
|
}
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
|
||||||
|
.page {
|
||||||
|
|
||||||
page-break-after: always;
|
page-break-after: always;
|
||||||
|
|
||||||
background:rgba(256, 256, 256, 0.0);
|
background:rgba(256, 256, 256, 0.0);
|
||||||
@ -601,6 +763,53 @@ try {
|
|||||||
<div class="epic badge">
|
<div class="epic badge">
|
||||||
<span class="epic-key"></span>
|
<span class="epic-key"></span>
|
||||||
<span class="epic-name"></span>
|
<span class="epic-name"></span>
|
||||||
|
=======
|
||||||
|
|
||||||
|
.page:last-of-type {
|
||||||
|
page-break-after: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// http://www.cssdesk.com/scHcP
|
||||||
|
|
||||||
|
function newPage(issueKey){
|
||||||
|
var page = jQuery(document.createElement('div'))
|
||||||
|
.attr("id",issueKey)
|
||||||
|
.addClass("page")
|
||||||
|
.html(multilineString(function() {
|
||||||
|
/*!
|
||||||
|
<div class="card">
|
||||||
|
<div class="author">Bengt Brodersen - qoomon.com</div>
|
||||||
|
<div class="card-border"></div>
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="type-icon badge circular"></div>
|
||||||
|
<div class="key badge"></div>
|
||||||
|
<div class="estimate badge circular " contenteditable="true"></div>
|
||||||
|
<div class="due">
|
||||||
|
<div class="due-icon badge circular "></div>
|
||||||
|
<div class="due-date badge" contenteditable="true"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="content-header">
|
||||||
|
<span class="summary" contenteditable="true"></span>
|
||||||
|
>>>>>>> gh-pages
|
||||||
|
</div>
|
||||||
|
<div class="description" contenteditable="true"></div>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<div class="assignee badge circular"></div>
|
||||||
|
<div class="qr-code badge"></div>
|
||||||
|
<div class="attachment badge circular"></div>
|
||||||
|
<div class="epic badge">
|
||||||
|
<span class="epic-key"></span>
|
||||||
|
<span class="epic-name" contenteditable="true"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1093,5 +1302,5 @@ try {
|
|||||||
'exFatal': true
|
'exFatal': true
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user