Skip to content

Commit

Permalink
Merge pull request #190 from joelthorner/2.x
Browse files Browse the repository at this point in the history
2.3.15
  • Loading branch information
joelthorner authored Sep 9, 2019
2 parents cbadfe4 + 003c91e commit b4172ed
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 29 deletions.
18 changes: 16 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const VERSION = "2.3.15";

var gulp = require('gulp');
var replace = require('gulp-replace');

const libsJs = [
'node_modules/jquery/dist/jquery.min.js',
Expand All @@ -21,7 +24,7 @@ const libsCss = [
'node_modules/node-snackbar/dist/snackbar.min.css',
]

gulp.task('default', function () {
gulp.task('update-libs', function () {
libsJs.forEach(libJs => {
gulp.src(libJs).pipe(gulp.dest('js/libs'));
});
Expand All @@ -33,7 +36,18 @@ gulp.task('default', function () {
});
});


gulp.task('version', function(){
gulp.src(['package.json', 'package-lock.json'])
.pipe(replace(/"version":\s"\d{1,3}.\d{1,3}.\d{1,3}"/, `"version": "${VERSION}"`))
.pipe(gulp.dest('.'));

gulp.src(['manifest.json'])
.pipe(replace(/"version":\s"\d{1,3}.\d{1,3}.\d{1,3}"/, `"version": "${VERSION}"`))
.pipe(gulp.dest('.'));
});

// execute for update dependencies:
// $ npm update
// $ gulp
// $ gulp update-libs
// Execute any scss compiler (pending to do in gulp)
39 changes: 17 additions & 22 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,24 @@ chrome.runtime.onInstalled.addListener(function (details) {

// TicketConsume system
function openTicketConsumeTab() {
chrome.windows.create({
url: 'http://192.168.110.109:12853/zdreports/rtm.cfm?TicketConsume=true',
// url: 'https://joelthorner.github.io/temp/?TicketConsume=true',
state: 'minimized',
// focused: true
}, function (window) {
// console.log(window);

// chrome.tabs.create({
// // url: 'http://192.168.110.109:12853/zdreports/rtm.cfm?TicketConsume=true',
// url: 'https://joelthorner.github.io/temp/?TicketConsume=true',
// active: false,
// index: 0,
// pinned: true,
// windowId: window.id
// });
chrome.tabs.query({
url: '*://zdreports/rtm.cfm?TicketConsume=true'
// url: '*://joelthorner.github.io/temp/?TicketConsume=true'
}, function (tabs) {
if (!tabs.length) {
chrome.tabs.create({
url: 'http://192.168.110.109:12853/zdreports/rtm.cfm?TicketConsume=true',
// url: 'https://joelthorner.github.io/temp/?TicketConsume=true',
active: false,
pinned: true,
});
} else {
tabs.forEach(tab => {
chrome.tabs.reload(tab.id);
});
}
});

}
chrome.runtime.onMessage.addListener(function (message, sender) {
if (message.name == 'openTicketConsumeTab') {
Expand All @@ -112,12 +113,6 @@ chrome.runtime.onMessage.addListener(function (message, sender) {
chrome.tabs.query({ url: '*://tlgcommercehelp.zendesk.com/*' }, function (tabs) {
tabs.forEach(tab => {
chrome.tabs.sendMessage(tab.id, { data: message.data });
chrome.tabs.query({
url: '*://zdreports/rtm.cfm?TicketConsume=true'
// url: '*://joelthorner.github.io/temp/?TicketConsume=true'
}, function (tabs) {
tabs.forEach(tab => { chrome.tabs.remove(tab.id) });
});
});
});
}
Expand Down
1 change: 0 additions & 1 deletion js/inject/zendesk/ticket-consume.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ TicketConsume = {
chrome.runtime.sendMessage({ name: 'openTicketConsumeTab' });
} catch (error) {
console.log(error);

}
}
});
Expand Down
6 changes: 6 additions & 0 deletions js/options/changelog.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
const CHANGELOG = [
{
version: 'v2.3.15', date: '10 Sep 2019',
lines: [
'FIXED Fix multiple open windows by TicketConsume (Zendesk) #188',
'IMPROVED Gulp automatic version replace (dev) #189'
]
}, {
version: 'v2.3.14', date: '04 Sep 2019',
lines: [
'FIXED Ticket consume get wrong data #184',
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "__MSG_appName__",
"version": "2.3.14",
"version": "2.3.15",
"manifest_version": 2,
"author": "joelthorner",
"description": "__MSG_appDesc__",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tlmanager",
"version": "2.3.14",
"version": "2.3.15",
"description": "Development tool",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -27,6 +27,7 @@
"sweetalert2": "^8.17.1"
},
"devDependencies": {
"gulp": "^4.0.2"
"gulp": "^4.0.2",
"gulp-replace": "^1.0.0"
}
}

0 comments on commit b4172ed

Please sign in to comment.