commit
de3e3e6100
@ -1,16 +1,24 @@
|
|||||||
var qoomon_dev;
|
version = "3.1.7";
|
||||||
var isDev = qoomon_dev;
|
console.logInfo("Version: " + version);
|
||||||
|
|
||||||
// <GoogleAnalytics>
|
// <GoogleAnalytics>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(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),
|
(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)
|
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', 'auto', {'alwaysSendReferrer': true});
|
ga('create', 'UA-50840116-3', 'auto');
|
||||||
ga('send', {'hitType': 'pageview', 'page': '/jiracardprinter/Bookmarklet.js'});
|
ga('set', 'location', window.location.protocol + '//' + window.location.host + window.location.pathname);
|
||||||
|
ga('set', 'hostname', window.location.hostname);
|
||||||
|
ga('set', 'page', '/cardprinter');
|
||||||
|
ga('set', 'title', document.title);
|
||||||
|
//ga('set', 'campaignSource', '(direct)');
|
||||||
|
//ga('set', 'campaignMedium', '(none)');
|
||||||
// </GoogleAnalytics>
|
// </GoogleAnalytics>
|
||||||
|
|
||||||
|
try {
|
||||||
|
var qoomon_dev;
|
||||||
|
var isDev = qoomon_dev;
|
||||||
|
|
||||||
// load jQuery
|
// load jQuery
|
||||||
if (window.jQuery === undefined) {
|
if (window.jQuery === undefined) {
|
||||||
appendScript('//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js');
|
appendScript('//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js');
|
||||||
@ -51,6 +59,7 @@ function main(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
var issueKeyList = getSelectedIssueKeyList();
|
var issueKeyList = getSelectedIssueKeyList();
|
||||||
|
|
||||||
if(issueKeyList.length <= 0){
|
if(issueKeyList.length <= 0){
|
||||||
alert("Please select at least one issue.");
|
alert("Please select at least one issue.");
|
||||||
return;
|
return;
|
||||||
@ -60,13 +69,20 @@ function main(){
|
|||||||
jQuery("body").append(printOverlayHTML);
|
jQuery("body").append(printOverlayHTML);
|
||||||
jQuery("#card-print-overlay").prepend(printOverlayStyle);
|
jQuery("#card-print-overlay").prepend(printOverlayStyle);
|
||||||
|
|
||||||
|
ga('send', 'pageview');
|
||||||
|
|
||||||
jQuery("#card-print-dialog-title").text("Card Print - Loading " + issueKeyList.length + " issues...");
|
jQuery("#card-print-dialog-title").text("Card Print - Loading " + issueKeyList.length + " issues...");
|
||||||
renderCards(issueKeyList, function(){
|
renderCards(issueKeyList, function(){
|
||||||
jQuery("#card-print-dialog-title").text("Card Print");
|
jQuery("#card-print-dialog-title").text("Card Print");
|
||||||
jQuery('#card-print-dialog-content-iframe')[0].contentWindow.print();
|
print();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function print(){
|
||||||
|
ga('send', 'event', 'button', 'click', 'print', $(".card").length );
|
||||||
|
jQuery('#card-print-dialog-content-iframe')[0].contentWindow.print();
|
||||||
|
}
|
||||||
|
|
||||||
function renderCards(issueKeyList, callback) {
|
function renderCards(issueKeyList, callback) {
|
||||||
|
|
||||||
var printFrame = jQuery("#card-print-dialog-content-iframe");
|
var printFrame = jQuery("#card-print-dialog-content-iframe");
|
||||||
@ -332,7 +348,7 @@ function printOverlayHTML(){
|
|||||||
|
|
||||||
result.find("#card-print-dialog-print")
|
result.find("#card-print-dialog-print")
|
||||||
.click(function(event){
|
.click(function(event){
|
||||||
jQuery('#card-print-dialog-content-iframe')[0].contentWindow.print();
|
print();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1060,3 +1076,11 @@ function multilineString(commentFunction) {
|
|||||||
function resizeIframe(iframe) {
|
function resizeIframe(iframe) {
|
||||||
iframe.height(iframe[0].contentWindow.document.body.scrollHeight);
|
iframe.height(iframe[0].contentWindow.document.body.scrollHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.logError(err.message);
|
||||||
|
ga('send', 'exception', {
|
||||||
|
'exDescription': err.message,
|
||||||
|
'exFatal': true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user