From b28722f6f74e34fa22c2dedd6aef3d1680f7f8c5 Mon Sep 17 00:00:00 2001 From: Bengt Brodersen Date: Sat, 18 Apr 2015 01:34:10 +0200 Subject: [PATCH] Add Page/Card Setup Features --- bookmarklet.js | 618 +++++++++++++++++++++++++++---------------------- 1 file changed, 346 insertions(+), 272 deletions(-) diff --git a/bookmarklet.js b/bookmarklet.js index 3ad079d..583a73c 100644 --- a/bookmarklet.js +++ b/bookmarklet.js @@ -1,10 +1,10 @@ (function () { - var version = "3.1.21"; + var version = "3.2.0"; console.log("Version: " + version); - + var isDev = typeof isDev !== 'undefined' && isDev ; var isTest = typeof isTest !== 'undefined' && isTest ; - + var hostOrigin = "https://qoomon.github.io/Jira-Issue-Card-Printer/"; if(isDev){ console.log("DEVELOPMENT"); @@ -13,10 +13,10 @@ if(isTest){ console.log("TEST"); } - + //cors = "https://cors-anywhere.herokuapp.com/"; //$("#card").load("https://cors-anywhere.herokuapp.com/"+"https://qoomon.github.io/Jira-Issue-Card-Printer/card.html"); - + // (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), @@ -29,69 +29,69 @@ } else { 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', 'campaignSource', '(direct)'); //ga('set', 'campaignMedium', '(none)'); // - + try { - + // load jQuery if (window.jQuery === undefined) { appendScript('//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js'); } - + // wait untill all scripts loaded appendScript('https://qoomon.github.io/void', function(){ init(); main(); }); - + function init(){ addJQueryFunctions(); addConsoleFunctions(); addStringFunctions(); addDateFunctions(); - + printScopeDeviderToken = "Attachment"; - + console.logLevel = console.INFO; - + resourceOrigin = hostOrigin+ "resources/"; } - + function main(){ //preconditions if(jQuery("#card-print-overlay").length > 0){ alert("Print Card already opened!"); return; } - + var issueKeyList = getSelectedIssueKeyList(); - + if(issueKeyList.length <= 0){ alert("Please select at least one issue."); return; } - + // open print preview 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"); //print(); }); } - + function print(){ var printFrame = jQuery("#card-print-dialog-content-iframe"); var printWindow = printFrame[0].contentWindow; @@ -99,23 +99,47 @@ ga('send', 'event', 'button', 'click', 'print', jQuery(".card", printDocument).length ); printWindow.print(); } - - function renderCards(issueKeyList, callback) { - + + function hideDescription(hide){ var printFrame = jQuery("#card-print-dialog-content-iframe"); var printWindow = printFrame[0].contentWindow; var printDocument = printWindow.document; - + if(hide){ + jQuery(".description", printDocument).hide(); + } else { + jQuery(".description", printDocument).show(); + } + + resizeIframe(printFrame); + } + + function endableMultiCardPage(enable){ + var printFrame = jQuery("#card-print-dialog-content-iframe"); + var printWindow = printFrame[0].contentWindow; + var printDocument = printWindow.document; + if(enable){ + jQuery(".page", printDocument).addClass("multiCardPage"); + } else { + jQuery(".page", printDocument).removeClass("multiCardPage"); + } + } + + function renderCards(issueKeyList, callback) { + + var printFrame = jQuery("#card-print-dialog-content-iframe"); + var printWindow = printFrame[0].contentWindow; + var printDocument = printWindow.document; + printDocument.open(); printDocument.write(""); - + jQuery("head", printDocument).append(printPanelPageCSS()); jQuery("head", printDocument).append(printPanelCardCSS()); - + console.logInfo("load " + issueKeyList.length + " issues..."); - + var deferredList = []; - + issueKeyList.each(function(position, issueKey) { var page = newPage(issueKey); page.hide(); @@ -130,7 +154,7 @@ }); }); console.logInfo("wait for issues loaded..."); - + applyDeferred(deferredList,function() { console.logInfo("...all issues loaded."); jQuery(printWindow).load(function(){ @@ -141,15 +165,15 @@ console.logInfo("wait for resources loaded..."); }); } - + function closePrintPreview(){ jQuery("#card-print-overlay").remove(); jQuery("#card-print-overlay-style").remove(); } - - + + function getSelectedIssueKeyList() { - + //JIRA if (jQuery("meta[name='application-name'][ content='JIRA']").length > 0) { //Browse @@ -158,7 +182,7 @@ return jQuery(this).attr('data-issue-key'); }); } - + // RapidBoard if (/.*\/secure\/RapidBoard.jspa.*/g.test(document.URL)) { return jQuery('div[data-issue-key].ghx-selected').map(function() { @@ -166,33 +190,33 @@ }); } } - + return []; } - + function fillCardWithJSONData(card, data) { //Key var key = data.key; console.logDebug("key: " + key); card.find('.key').text(key); - + //Type var type = data.fields.issuetype.name.toLowerCase(); console.logDebug("type: " + type); card.find(".card").attr("type", type); - + ga('send', 'event', 'task', 'generate', 'card', type ); - + //Summary var summary = data.fields.summary; console.logDebug("summary: " + summary); card.find('.summary').text(summary); - + //Description var description = data.renderedFields.description; console.logDebug("description: " + description); card.find('.description').html(description); - + //Assignee var assignee = data.fields.assignee; console.logDebug("assignee: " + assignee); @@ -208,7 +232,7 @@ } else { card.find(".assignee").addClass("hidden"); } - + //Due-Date var duedate = data.fields.duedate; console.logDebug("duedate: " + duedate); @@ -218,7 +242,7 @@ } else { card.find(".due").addClass("hidden"); } - + //Attachment var hasAttachment = false; var indexOfPrintScopeDeviderToken = description.indexOf(printScopeDeviderToken); @@ -234,7 +258,7 @@ } else{ card.find('.attachment').addClass('hidden'); } - + //Story Points var storyPoints = data.fields.storyPoints; console.logDebug("storyPoints: " + storyPoints); @@ -243,7 +267,7 @@ } else { card.find(".estimate").addClass("hidden"); } - + //Epic var epicKey = data.fields.epicLink; console.logDebug("epicKey: " + epicKey); @@ -257,21 +281,21 @@ } else { card.find(".epic").addClass("hidden"); } - + //QR-Code var qrCodeImageUrl = 'https://chart.googleapis.com/chart?cht=qr&chs=256x256&chld=L|1&chl=' + window.location.origin + "/browse/" + key; console.logTrace("qrCodeImageUrl: " + qrCodeImageUrl); card.find(".qr-code").css("background-image", "url('" + qrCodeImageUrl + "')"); - + //handle Site specifics switch (window.location.hostname) { case "lrs-support.com": fillCardWithJSONDataLRS(card, data); break; default: } - + } - + function fillCardWithJSONDataLRS(card, data) { console.logInfo("Apply LRS Specifics"); //Desired-Date @@ -285,10 +309,10 @@ card.find(".due").addClass("hidden"); } } - - + + 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); @@ -313,19 +337,19 @@ data: {}, }); } - - - + + + //############################################################################################################################ //############################################################################################################################ //############################################################################################################################ - - + + // http://www.cssdesk.com/T9hXg - + function printOverlayHTML(){ - - + + var result = jQuery(document.createElement('div')) .attr("id","card-print-overlay") .html(multilineString(function() { @@ -337,69 +361,98 @@ -
- - Cancel -
- + */ })); + // info - result.find("#report-issue") .click(function(event){ window.open('https://github.com/qoomon/Jira-Issue-Card-Printer/issues'); return false; }); - - result.find("#about") + + result.find("#about") .click(function(event){ window.open('http://qoomon.blogspot.de/2014/01/jira-issue-card-printer-bookmarklet.html'); return false; }); - + + // enable multe card page + + result.find("#multi-card-page-checkbox") + .click(function() { + endableMultiCardPage(this.checked); + return true; + }); + + // hide description + + result.find("#hide-description-checkbox") + .click(function() { + hideDescription(this.checked); + return true; + }); + + // scale card + + result.find("#card-scale-range").on("input", function() { + var printFrame = jQuery("#card-print-dialog-content-iframe"); + var printWindow = printFrame[0].contentWindow; + var printDocument = printWindow.document; + jQuery("HTML", printDocument).css("font-size", jQuery(this).val() +"cm"); + }); + // print - + result.find("#card-print-dialog-print") .click(function(event){ print(); return false; }); - + // closePrintPreview - + result.find("#card-print-dialog-cancel") .click(function(event){ closePrintPreview(); return false; }); - + result.click(function(event) { if( event.target == this ){ closePrintPreview(); } - return false; + return true; }); - + jQuery(document).keyup(function(e) { if (e.keyCode == 27) { // esc closePrintPreview(); } }); - + // prevent background scrolling result.scroll(function(event) { return false; }); - + return result; } - + function printOverlayStyle(){ var result = jQuery(document.createElement('style')) .attr("id", "card-print-overlay-style") @@ -413,61 +466,61 @@ top: 0; left: 0; background:rgba(0, 0, 0, 0.5); - + box-sizing: border-box; word-wrap:break-word; z-index: 99999; - + } - + #card-print-dialog { position: relative; - + top: 60px; right:0px; left:0px; - + height: calc(100% - 120px); width: 1000px; margin: auto; - + border-style: solid; border-color: #cccccc; border-width: 1px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; - + overflow: hidden; } - + #card-print-dialog-header { position: relative; background: #f0f0f0; height: 25px; - + border-bottom: 1px solid #cccccc; - + padding: 15px 20px 15px 20px; } - + #card-print-dialog-content { position: relative; background: white; height: calc(100% - 106px); + height: 100px; - width: 100%; - - overflow-y: scroll; - } - - #card-print-dialog-content-iframe { - position: relative; - height: 100%; width: 100%; - + + overflow-y: scroll; + } + + #card-print-dialog-content-iframe { + position: relative; + height: 100%; + width: 100%; + border:none; } - + #card-print-dialog-footer { position: relative; background: #f0f0f0; @@ -476,22 +529,21 @@ padding: 10px; text-align: right; } - + #buttons { position: relative; float: right; display: inline-block; height 30px; } - + #info { - position: absolute; - right: 400px; - float: left; + position: relative; + float: right; display: inline-block; height 30px; } - + #card-print-dialog-title{ position: relative; float: left; @@ -503,91 +555,113 @@ height: 30px; line-height: 30px; } + .cancel{ + cursor: pointer; + font-size: 14px; + display: inline-block; + padding: 5px 10px; + vertical-align: baseline; + } */ })); return result; } - - + + function printPanelPageCSS(){ - + var result = jQuery(document.createElement('style')) .attr("id", "printPanelPageStyle") .attr("type", "text/css") .html(multilineString(function() { /*! - .page { + HTML { + font-size: 1.0cm; + } + .page { position: relative; overflow: auto; margin-left: auto; margin-right: auto; + padding: 1.0rem; + margin: 1.0rem; width: auto; - max-width: 29.7cm; - min-width: 21cm; + min-width: 21rem; height: auto; page-break-after: always; - + page-break-inside: avoid; + background:rgba(256, 256, 256, 0.85); - + -webkit-box-shadow: 0px 0px 7px 3px rgba(31,31,31,0.4); -moz-box-shadow: 0px 0px 7px 3px rgba(31,31,31,0.4); box-shadow: 0px 0px 7px 3px rgba(31,31,31,0.4); - + border-style: solid; border-color: #bfbfbf; - border-width: 0.05cm; - -moz-border-radius: 0.1cm; - -webkit-border-radius: 0.1cm; - border-radius: 0.1cm; - - padding: 1.0cm; - margin: 1.0cm; - + border-width: 0.05rem; + -moz-border-radius: 0.1rem; + -webkit-border-radius: 0.1rem; + border-radius: 0.1rem; + + overflow: hidden; + } - + + .multiCardPage { + page-break-after: avoid; + } + + + @media print { - - .page { - - 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); - } - - .page:last-of-type { - page-break-after: auto; - } - } + + .page { + + background:rgba(256, 256, 256, 0.0); + border-style: none; + padding: 0.0rem; + margin: 0.0rem; + margin-top: 2.0rem; + + -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); + } + + .page:first-of-type { + margin-top: 0rem; + } + + .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") + .addClass("singleCardPage") .html(multilineString(function() { /*!
-
Bengt Brodersen - qoomon.com
+
qoomon.com
Bengt Brodersen
@@ -616,10 +690,10 @@
*/ })); - + return page; } - + function printPanelCardCSS(){ var result = jQuery(document.createElement('style')) .attr("type", "text/css") @@ -635,24 +709,24 @@ .hidden { visibility: hidden; } - .card-header:after, + .card-header:after, .card-footer:after { content:" "; display: block; clear: both; height:0 } - .card-border, - .badge, + .card-border, + .badge, .shadow { border-style: solid; border-color: #2f2f2f; - border-top-width: 0.14cm; - border-left-width: 0.14cm; - border-bottom-width: 0.24cm; - border-right-width: 0.24cm; - -webkit-border-radius: 0.25cm; - border-radius: 0.25cm; + border-top-width: 0.14rem; + border-left-width: 0.14rem; + border-bottom-width: 0.24rem; + border-right-width: 0.24rem; + -webkit-border-radius: 0.25rem; + border-radius: 0.25rem; // -webkit-filter: drop-shadow(0px 5px 10px black) } .circular { @@ -661,53 +735,55 @@ border-radius: 50%; } .badge { - width: 3.2cm; - height: 3.2cm; + width: 3.2rem; + height: 3.2rem; background: #d0d0d0; } - + .card { position: relative; - min-width: 21.0cm; - + min-width: 21.0rem; + } .author { z-index: 999; position: absolute; - top:3.1cm; - right:0.7cm; + top:2.0rem; + right:-0.25rem; -webkit-transform-origin: 100% 100%; transform-origin: 100% 100%; -webkit-transform: rotate(-90deg); transform: rotate(-90deg); - font-size: 0.4cm; + font-size: 0.4rem; + line-height: 0.8rem; + text-align: center; color: DARKGREY; } .card-border { position: absolute; - top:2.0cm; - left:0.4cm; - right:0.4cm; - height: calc(100% - 4.0cm); + top:2.0rem; + left:0.4rem; + right:0.4rem; + height: calc(100% - 4.0rem); background: #ffffff; - + } .card-header { position: relative; } .card-content { position: relative; - margin-top: 0.3cm; - margin-left: 1.0cm; - margin-right: 1.1cm; - margin-bottom: 0.2cm; - min-height: 3.0cm; + margin-top: 0.3rem; + margin-left: 1.0rem; + margin-right: 1.1rem; + margin-bottom: 0.2rem; + min-height: 1.2rem; } .content-header { position: relative; - font-size: 1.1cm; - line-height: 1.1cm; - margin-bottom: 0.6cm; + font-size: 1.1rem; + line-height: 1.1rem; + margin-bottom: 0.6rem; } .card-footer { position: relative; @@ -717,24 +793,23 @@ font-weight: bold; } .description { - min-height: 3.0cm; - font-size: 0.6cm; - line-height: 0.6cm; + font-size: 0.6rem; + line-height: 0.6rem; } .key { position: absolute; float: left; width: auto; - min-width: 4.4cm; - height: 1.35cm; - left: 3.0cm; - margin-top: 1.2cm; - padding-left: 0.7cm; - padding-right: 0.4cm; + min-width: 4.4rem; + height: 1.35rem; + left: 3.0rem; + margin-top: 1.2rem; + padding-left: 0.7rem; + padding-right: 0.4rem; text-align: center; font-weight: bold; - font-size: 1.0cm; - line-height: 1.6cm; + font-size: 1.0rem; + line-height: 1.5rem; } .type-icon { position: relative; @@ -747,7 +822,7 @@ background-position: center; z-index: 1; } - + .card[type="story"] .type-icon { background-color: GOLD; background-image: url(https://googledrive.com/host/0Bwgd0mVaLU_KU0N5b3JyRnJaNTA/resources/icons/Bulb.png); @@ -760,22 +835,22 @@ background-color: ROYALBLUE; background-image: url(https://googledrive.com/host/0Bwgd0mVaLU_KU0N5b3JyRnJaNTA/resources/icons/Flash.png); } - + .estimate { position: relative; float: left; - left: -0.65cm; - top:-1.5cm; - height: 1.1cm; - width: 1.1cm; + left: -0.65rem; + top:-1.5rem; + height: 1.1rem; + width: 1.1rem; text-align: center; font-weight: bold; - font-size: 1cm; - line-height: 1.15cm; - margin-top:1.5cm; + font-size: 1rem; + line-height: 1.15rem; + margin-top:1.5rem; z-index: 999; } - + .due { position: relative; float: right; @@ -783,9 +858,9 @@ .due-icon { position: relative; float:right; - width: 2.5cm; - height: 2.5cm; - margin-top: 0.4cm; + width: 2.5rem; + height: 2.5rem; + margin-top: 0.4rem; background-color: MEDIUMPURPLE; background-image: url(https://googledrive.com/host/0Bwgd0mVaLU_KU0N5b3JyRnJaNTA/resources/icons/AlarmClock.png); background-repeat: no-repeat; @@ -797,43 +872,43 @@ .due-date { position: relative; float: right; - right: -0.6cm; + right: -0.6rem; width: auto; - min-width: 2.8cm; + min-width: 2.8rem; height: auto; - margin-top: 1.3cm; - padding-top: 0.2cm; - padding-bottom: 0.2cm; - padding-left: 0.3cm; - padding-right: 0.6cm; + margin-top: 1.3rem; + padding-top: 0.2rem; + padding-bottom: 0.2rem; + padding-left: 0.3rem; + padding-right: 0.6rem; text-align: center; font-weight: bold; - font-size: 0.7cm; - line-height: 0.7cm; + font-size: 0.7rem; + line-height: 0.7rem; } .attachment { position: relative; float: left; - margin-left: 0.6cm; - width: 2.1cm; - height: 2.1cm; + margin-left: 0.6rem; + width: 2.1rem; + height: 2.1rem; background-color: LIGHTSKYBLUE; background-image: url(https://images.weserv.nl/?url=www.iconsdb.com/icons/download/color/2f2f2f/attach-256.png); background-repeat: no-repeat; -webkit-background-size: 70%; background-size: 70%; background-position: center; - + } .assignee { position: relative; float: right; - width: 2.1cm; - height: 2.1cm; + width: 2.1rem; + height: 2.1rem; text-align: center; font-weight: bold; - font-size: 1.8cm; - line-height: 2.5cm; + font-size: 1.8rem; + line-height: 2.2rem; background-image: url(https://images.weserv.nl/?url=www.iconsdb.com/icons/download/color/aaaaaa/contacts-256.png); background-repeat: no-repeat; -webkit-background-size: cover; @@ -847,8 +922,8 @@ .qr-code { position: relative; float: left; - width: 2.1cm; - height: 2.1cm; + width: 2.1rem; + height: 2.1rem; background-image: url(https://chart.googleapis.com/chart?cht=qr&chs=256x256&chld=L|1&chl=blog.qoomon.com); background-repeat: no-repeat; -webkit-background-size: cover; @@ -860,15 +935,15 @@ height: auto; position: relative; float:right; - margin-right:0.6cm; - padding-top: 0.2cm; - padding-bottom: 0.2cm; - padding-left: 0.3cm; - padding-right: 0.3cm; + margin-right:0.6rem; + padding-top: 0.2rem; + padding-bottom: 0.2rem; + padding-left: 0.3rem; + padding-right: 0.3rem; text-align: left; - font-size: 0.7cm; - line-height: 0.7cm; - max-width: calc( 100% - 10.2cm); + font-size: 0.7rem; + line-height: 0.7rem; + max-width: calc( 100% - 10.2rem); } .epic-key { } @@ -879,114 +954,114 @@ }).replace(/{RESOURCE_ORIGIN}/g, resourceOrigin)); return result; } - + //############################################################################################################################ //############################################################################################################################ //############################################################################################################################ - + function appendScript(url, callback){ - + var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.src = url; - + // Then bind the event to the callback function. // There are several events for cross browser compatibility. script.onreadystatechange = callback; script.onload = callback; - + head.appendChild(script); } - + //############################################################################################################################ //############################################################################################################################ //############################################################################################################################ - + function addDeferred(deferredList){ var deferred = new jQuery.Deferred() deferredList.push(deferred); return deferred; } - + function applyDeferred(deferredList, callback){ jQuery.when.apply(jQuery, deferredList).done(callback); } - + //############################################################################################################################ //############################################################################################################################ //############################################################################################################################ - - + + function addJQueryFunctions() { //jQuery Extention jQuery.expr[':']['is'] = function(node, index, props){ return node.textContent == props[3]; } } - - + + function addConsoleFunctions() { - + console.ERROR = 0; console.WARN = 1; console.INFO = 2; console.DEBUG = 3; console.TRACE = 4; - + console.logLevel = console.INFO ; - + console.logError = function(msg){ if(console.logLevel >= console.ERROR ) { console.log("ERROR: " + msg); } } - + console.logWarn = function(msg){ if(console.logLevel >= console.WARN ) { console.log("WARN: " + msg); } } - + console.logInfo = function(msg){ if(console.logLevel >= console.INFO ) { console.log("INFO: " + msg); } } - + console.logDebug = function(msg){ if(console.logLevel >= console.DEBUG ) { console.log("DEBUG: " + msg); } } - + console.logTrace = function(msg){ if(console.logLevel >= console.TRACE ) { console.log("TRACE: " + msg); } } } - + function addStringFunctions() { - + //trim string - remove leading and trailing whitespaces if (!String.prototype.trim) { String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }; } - + if (!String.prototype.startsWith) { String.prototype.startsWith = function (str){ return this.slice(0, str.length) == str; }; } - + if (!String.prototype.endsWith) { String.prototype.endsWith = function (str){ return this.slice(-str.length) == str; }; } - + if (!String.prototype.toCamelCase) { String.prototype.toCamelCase = function() { // remove all characters that should not be in a variable name @@ -1004,9 +1079,9 @@ } } } - + function addDateFunctions() { - + Date.prototype.format = function(format) { var returnStr = ''; var replace = Date.replaceChars; @@ -1021,13 +1096,13 @@ } return returnStr; }; - + Date.replaceChars = { shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], longMonths: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], longDays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], - + // Day d: function() { return (this.getDate() < 10 ? '0' : '') + this.getDate(); }, D: function() { return Date.replaceChars.shortDays[this.getDay()]; }, @@ -1053,7 +1128,7 @@ // Time a: function() { return this.getHours() < 12 ? 'am' : 'pm'; }, A: function() { return this.getHours() < 12 ? 'AM' : 'PM'; }, - B: function() { return Math.floor((((this.getUTCHours() + 1) % 24) + this.getUTCMinutes() / 60 + this.getUTCSeconds() / 3600) * 1000 / 24); }, // Fixed now + B: function() { return Math.floor((((this.getUTCHours() + 1) % 24) + this.getUTreminutes() / 60 + this.getUTCSeconds() / 3600) * 1000 / 24); }, // Fixed now g: function() { return this.getHours() % 12 || 12; }, G: function() { return this.getHours(); }, h: function() { return ((this.getHours() % 12 || 12) < 10 ? '0' : '') + (this.getHours() % 12 || 12); }, @@ -1084,18 +1159,18 @@ U: function() { return this.getTimep() / 1000; } }; } - + function multilineString(commentFunction) { return commentFunction.toString() .replace(/^[^\/]+\/\*!?/, '') .replace(/\*\/[^\/]+$/, ''); } - - + + function resizeIframe(iframe) { iframe.height(iframe[0].contentWindow.document.body.scrollHeight); } - + } catch (err) { console.logError(err.message); ga('send', 'exception', { @@ -1104,4 +1179,3 @@ }); }; })(); -