From dadd365ae8691a38f6de816d017aa3ed5117049a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Danyi?= Date: Mon, 29 Aug 2016 16:38:01 +0200 Subject: [PATCH] * ETH-ified --- bookmarklet.js | 114 +++++++++++++++++++++++++++---------------------- deploy.php | 11 +++++ 2 files changed, 74 insertions(+), 51 deletions(-) create mode 100644 deploy.php diff --git a/bookmarklet.js b/bookmarklet.js index 631bcfd..fa4b880 100644 --- a/bookmarklet.js +++ b/bookmarklet.js @@ -4,7 +4,7 @@ // PivotTracker: https://www.pivotaltracker.com/n/projects/510733 // Trello: https://trello.com/b/8zlPSh70/spike // YouTrack: http://qoomon.myjetbrains.com/youtrack/dashboard - + if (!String.prototype.startsWith) { String.prototype.startsWith = function(searchString, position) { position = position || 0; @@ -14,7 +14,7 @@ var global = {}; global.version = "4.7.4"; - global.issueTrackingUrl = "github.com/qoomon/Jira-Issue-Card-Printer"; + global.issueTrackingUrl = "vasgyuro.tsp/~edvidan/jira-card-printer"; global.isDev = document.currentScript == null; @@ -25,7 +25,7 @@ alert("jQuery is required!\n\nPlease create an issue at\n" + global.issueTrackingUrl); return; } - + // run try { @@ -118,19 +118,19 @@ addStringFunctions(); loadSettings(); - global.hostOrigin = "https://qoomon.github.io/Jira-Issue-Card-Printer/"; - if (global.isDev) { - console.log("DEVELOPMENT"); - global.hostOrigin = "https://rawgit.com/qoomon/Jira-Issue-Card-Printer/develop/"; - } + global.hostOrigin = "http://vasgyuro.tsp/~edvidan/jira-card-printer/"; + // if (global.isDev) { + // console.log("DEVELOPMENT"); + // global.hostOrigin = "https://rawgit.com/qoomon/Jira-Issue-Card-Printer/develop/"; + // } global.resourceOrigin = global.hostOrigin + "resources/"; var resources = getResources(); global.cardHtml = resources.cardHtml; - global.cardCss = resources.cardCss.replace(/https:\/\/qoomon.github.io\/Jira-Issue-Card-Printer\/resources/g, global.resourceOrigin); + global.cardCss = resources.cardCss.replace(/http:\/\/vasgyuro.tsp\/~edvidan\/jira-card-printer\/resources/g, global.resourceOrigin); global.printPreviewHtml = resources.printPreviewHtml; - global.printPreviewCss = resources.printPreviewCss.replace(/https:\/\/qoomon.github.io\/Jira-Issue-Card-Printer\/resources/g, global.resourceOrigin); + global.printPreviewCss = resources.printPreviewCss.replace(/http:\/\/vasgyuro.tsp\/~edvidan\/jira-card-printer\/resources/g, global.resourceOrigin); return Promise.all(promises); } @@ -427,7 +427,7 @@ // info result.find("#report-issue").click(function(event) { - window.open('https://github.com/qoomon/Jira-Issue-Card-Printer/issues'); + window.open('http://vasgyuro.tsp/~edvidan/jira-card-printer/issues'); return false; }); @@ -678,6 +678,11 @@ })); } + // edvidan + if(data.fields.externalIssueId) { + issueData.externalIssueId = data.fields.externalIssueId; + } + issueData.url = module.baseUrl() + "/browse/" + issueData.key; return Promise.all(promises); @@ -711,7 +716,14 @@ fieldName = 'storyPoints' } } - + + // ETH- taurusxft customfield_10010-val + if(/jirapducc.mo.ca.am.ericsson.se/g.test(window.location.hostname)){ + if (key == 'customfield_10010'){ + fieldName = 'externalIssueId' + } + } + //lufthansa specific field mapping if(/.*trackspace.lhsystems.com/g.test(window.location.hostname)){ if (key == 'Xcustomfield_10006'){ @@ -728,7 +740,7 @@ fieldValue = formatDate(new Date(fieldValue)); } } - + //console.log("add new field: " + fieldName + " with value from " + key); responseData.fields[fieldName] = fieldValue; } @@ -894,21 +906,21 @@ var issueKeys = $( ".card-composer").parent().find(".list-card > .list-card-details > .list-card-title").map(function() { return $(this).attr("href").match(/.*\/c\/([^/]*).*/)[1]; }); - + //read only board - + var issueKeys2 = $( "textarea.list-header-name.is-editing" ).parent().parent().find(".list-cards > .list-card > .list-card-details > .list-card-title").map(function() { return $(this).attr("href").match(/.*\/c\/([^/]*).*/)[1]; }) return jQuery.merge(issueKeys,issueKeys2 ); } - + //Card View if (/.*\/c\/.*/g.test(document.URL)) { return [document.URL.match(/.*\/c\/([^/]*).*/)[1]]; } - + return []; }; @@ -1033,27 +1045,27 @@ //############################################################################################################################ function initGoogleAnalytics() { - if (global.isDev) { - this.ga = function(){ console.log("GoogleAnalytics: " + Object.keys(arguments).map(key => arguments[key]))} - return; - } - // - (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', { - 'alwaysSendReferrer': true - }); - ga('set', 'page', '/cardprinter'); + // if (global.isDev) { + // this.ga = function(){ console.log("GoogleAnalytics: " + Object.keys(arguments).map(key => arguments[key]))} + // return; + // } + // // + // (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', { + // 'alwaysSendReferrer': true + // }); + // ga('set', 'page', '/cardprinter'); } //############################################################################################################################ @@ -1256,7 +1268,7 @@ width: 100%; border-style: solid; border-bottom-width: 0.5rem; - border-image: url(https://rawgit.com/qoomon/Jira-Issue-Card-Printer/develop/resources//Tearing.png); + border-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/Tearing.png); border-image-width: 0 0 0.7rem 0; border-image-slice: 56 0 56 1; border-image-repeat: round round; @@ -1387,48 +1399,48 @@ width: 3.0rem; border-radius: 50%; background-color: LIGHTSEAGREEN; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Objects.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/Objects.png); background-repeat: no-repeat; background-position: center; background-size: 63%; } .issue-icon[type="loading"]{ background-color: DEEPSKYBLUE; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/CloudLoading.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/CloudLoading.png); } .issue-icon[type="story"], .issue-icon[type="user story"] { background-color: GOLD; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Bulb.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/Bulb.png); } .issue-icon[type="bug"], .issue-icon[type="problem"], .issue-icon[type="correction"] { background-color: CRIMSON; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Bug.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/Bug.png); } .issue-icon[type="epic"] { background-color: ROYALBLUE; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Flash.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/Flash.png); } .issue-icon[type="task"], .issue-icon[type="sub-task"], .issue-icon[type="technical task"], .issue-icon[type="aufgabe"], .issue-icon[type="unteraufgabe"], .issue-icon[type="technische aufgabe"] { background-color: WHEAT; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Task.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/Task.png); } .issue-icon[type="new feature"] { background-color: LIMEGREEN; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Plus.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/Plus.png); } .issue-icon[type="improvement"], .issue-icon[type="verbesserung"] { background-color: CORNFLOWERBLUE; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Arrow.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/Arrow.png); } .issue-icon[type="research"] { background-color: MEDIUMTURQUOISE; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/ErlenmeyerFlask.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/ErlenmeyerFlask.png); } .issue-icon[type="test"] { background-color: ORANGE; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/CrashDummy.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/CrashDummy.png); } .issue-estimate { position: absolute; @@ -1462,7 +1474,7 @@ height: 2.0rem; border-radius: 50%; background-color: LIGHTSKYBLUE; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/Attachment.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/Attachment.png); background-repeat: no-repeat; background-position: center; background-size: 70%; @@ -1540,7 +1552,7 @@ height: 2.5rem; border-radius: 50%; background-color: ORCHID; - background-image: url(https://qoomon.github.io/Jira-Issue-Card-Printer/resources/icons/AlarmClock.png); + background-image: url(http://vasgyuro.tsp/~edvidan/jira-card-printer/resources/icons/AlarmClock.png); background-repeat: no-repeat; background-position: center; background-size: 65%; diff --git a/deploy.php b/deploy.php new file mode 100644 index 0000000..0162875 --- /dev/null +++ b/deploy.php @@ -0,0 +1,11 @@ +user('edvidan') + ->forwardAgent() // You can use identity key, ssh config, or username/password to auth on the server. + ->stage('production') + ->env('deploy_path', '/home/edvidan/applications/jira-card-printer'); // Define the base path to deploy your project to. + +set('repository', '/home/edvidan/git/jira-card-printer.git');