Merge branch 'gh-pages' into develop
Conflicts: bookmarklet.js
This commit is contained in:
commit
f32825876f
283
bookmarklet.js
283
bookmarklet.js
@ -1,44 +1,45 @@
|
||||
version = "3.1.15";
|
||||
console.log("Version: " + version);
|
||||
(function () {
|
||||
var version = "3.1.21";
|
||||
console.log("Version: " + version);
|
||||
|
||||
var isDev = typeof isDev === 'undefined' || isDev ;
|
||||
var isTest = typeof isTest === 'undefined' || isTest ;
|
||||
var isDev = typeof isDev !== 'undefined' && isDev ;
|
||||
var isTest = typeof isTest !== 'undefined' && isTest ;
|
||||
|
||||
referrer = window.location.hostname
|
||||
hostOrigin = "https://qoomon.github.io/Jira-Issue-Card-Printer/";
|
||||
if(isDev){
|
||||
var hostOrigin = "https://qoomon.github.io/Jira-Issue-Card-Printer/";
|
||||
if(isDev){
|
||||
console.log("DEVELOPMENT");
|
||||
referrer = "dev.qoomon.com"
|
||||
hostOrigin = "https://rawgit.com/qoomon/Jira-Issue-Card-Printer/develop/";
|
||||
}
|
||||
if(isTest){
|
||||
}
|
||||
if(isTest){
|
||||
console.log("TEST");
|
||||
referrer = "dev.qoomon.com"
|
||||
}
|
||||
}
|
||||
|
||||
cors = "https://cors-anywhere.herokuapp.com/";
|
||||
//$("#card").load("https://cors-anywhere.herokuapp.com/"+"https://qoomon.github.io/Jira-Issue-Card-Printer/card.html");
|
||||
//cors = "https://cors-anywhere.herokuapp.com/";
|
||||
//$("#card").load("https://cors-anywhere.herokuapp.com/"+"https://qoomon.github.io/Jira-Issue-Card-Printer/card.html");
|
||||
|
||||
// <GoogleAnalytics>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
// <GoogleAnalytics>
|
||||
(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),
|
||||
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});
|
||||
if(isTest || isDev){
|
||||
ga('set', 'page', '/dev/cardprinter');
|
||||
} else {
|
||||
ga('set', 'page', '/cardprinter');
|
||||
}
|
||||
|
||||
ga('create', 'UA-50840116-3');
|
||||
ga('set', 'referrer', referrer);
|
||||
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', '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)');
|
||||
// </GoogleAnalytics>
|
||||
//ga('set', 'campaignSource', '(direct)');
|
||||
//ga('set', 'campaignMedium', '(none)');
|
||||
// </GoogleAnalytics>
|
||||
|
||||
try {
|
||||
try {
|
||||
|
||||
// load jQuery
|
||||
if (window.jQuery === undefined) {
|
||||
@ -217,6 +218,79 @@ try {
|
||||
} else {
|
||||
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
|
||||
var hasAttachment = false;
|
||||
@ -329,25 +403,27 @@ try {
|
||||
.attr("id","card-print-overlay")
|
||||
.html(multilineString(function() {
|
||||
/*!
|
||||
<div id="card-print-dialog">
|
||||
<div id="card-print-dialog">
|
||||
<div id="card-print-dialog-header">
|
||||
<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="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">
|
||||
<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 id="card-print-dialog-footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
*/
|
||||
}));
|
||||
// info
|
||||
>>>>>>> gh-pages
|
||||
|
||||
result.find("#report-issue")
|
||||
.click(function(event){
|
||||
@ -482,6 +558,14 @@ try {
|
||||
height 30px;
|
||||
}
|
||||
|
||||
#info {
|
||||
position: absolute;
|
||||
right: 400px;
|
||||
float: left;
|
||||
display: inline-block;
|
||||
height 30px;
|
||||
}
|
||||
|
||||
#card-print-dialog-title{
|
||||
position: relative;
|
||||
float: left;
|
||||
@ -539,6 +623,84 @@ try {
|
||||
|
||||
.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;
|
||||
|
||||
background:rgba(256, 256, 256, 0.0);
|
||||
@ -601,6 +763,53 @@ try {
|
||||
<div class="epic badge">
|
||||
<span class="epic-key"></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>
|
||||
@ -1086,12 +1295,12 @@ try {
|
||||
iframe.height(iframe[0].contentWindow.document.body.scrollHeight);
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
} catch (err) {
|
||||
console.logError(err.message);
|
||||
ga('send', 'exception', {
|
||||
'exDescription': err.message,
|
||||
'exFatal': true
|
||||
});
|
||||
};
|
||||
|
||||
};
|
||||
})();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user