Merge pull request #4 from qoomon/develop

Google Analytix
This commit is contained in:
Bengt Brodersen 2015-01-28 01:13:18 +01:00
commit de3e3e6100

View File

@ -1,16 +1,24 @@
var qoomon_dev;
var isDev = qoomon_dev;
version = "3.1.7";
console.logInfo("Version: " + version);
// <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');
ga('create', 'UA-50840116-3', 'auto', {'alwaysSendReferrer': true});
ga('send', {'hitType': 'pageview', 'page': '/jiracardprinter/Bookmarklet.js'});
ga('create', 'UA-50840116-3', 'auto');
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>
try {
var qoomon_dev;
var isDev = qoomon_dev;
// load jQuery
if (window.jQuery === undefined) {
appendScript('//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js');
@ -51,6 +59,7 @@ function main(){
}
var issueKeyList = getSelectedIssueKeyList();
if(issueKeyList.length <= 0){
alert("Please select at least one issue.");
return;
@ -60,13 +69,20 @@ function main(){
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");
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) {
var printFrame = jQuery("#card-print-dialog-content-iframe");
@ -332,7 +348,7 @@ function printOverlayHTML(){
result.find("#card-print-dialog-print")
.click(function(event){
jQuery('#card-print-dialog-content-iframe')[0].contentWindow.print();
print();
return false;
});
@ -1060,3 +1076,11 @@ function multilineString(commentFunction) {
function resizeIframe(iframe) {
iframe.height(iframe[0].contentWindow.document.body.scrollHeight);
}
} catch (err) {
console.logError(err.message);
ga('send', 'exception', {
'exDescription': err.message,
'exFatal': true
});
}