From 880a74e4543457e16e5ad5fbd62c2d1ef663ef5d Mon Sep 17 00:00:00 2001 From: Phil Banks Date: Sat, 16 May 2020 22:16:12 +0100 Subject: [PATCH 1/3] move constants to seperate js file --- calendar/config.js | 10 ++++++++++ calendar/manifest.json | 2 +- calendar/meet-calendar.js | 11 ----------- 3 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 calendar/config.js diff --git a/calendar/config.js b/calendar/config.js new file mode 100644 index 0000000..e4dd86b --- /dev/null +++ b/calendar/config.js @@ -0,0 +1,10 @@ +const BASE_DOMAIN = "meet.jit.si"; +const BASE_URL = "https://" + BASE_DOMAIN + "/"; +const APP_NAME = "Jitsi"; +const NUMBER_RETRIEVE_SCRIPT = false; +const CONFERENCE_MAPPER_SCRIPT = false; + +// A text to be used when adding info to the location field. +const LOCATION_TEXT = APP_NAME + ' Meeting'; + +let generateRoomNameAsDigits = false; diff --git a/calendar/manifest.json b/calendar/manifest.json index 7b7e44c..083c153 100644 --- a/calendar/manifest.json +++ b/calendar/manifest.json @@ -20,7 +20,7 @@ "content_scripts": [ { "matches": ["https://calendar.google.com/calendar/*", "https://outlook.live.com/owa/*"], - "js": ["jquery.js", "RandomUtil.js", "RoomnameGenerator.js", "meet-calendar.js"], + "js": ["jquery.js", "RandomUtil.js", "RoomnameGenerator.js", "config.js", "meet-calendar.js"], "css": ["/css/all.css"], "all_frames" : false, "run_at" : "document_end" diff --git a/calendar/meet-calendar.js b/calendar/meet-calendar.js index 4cc405c..85566b6 100644 --- a/calendar/meet-calendar.js +++ b/calendar/meet-calendar.js @@ -1,14 +1,3 @@ -const BASE_DOMAIN = "meet.jit.si"; -const BASE_URL = "https://" + BASE_DOMAIN + "/"; -const APP_NAME = "Jitsi"; -const NUMBER_RETRIEVE_SCRIPT = false; -const CONFERENCE_MAPPER_SCRIPT = false; - -//A text to be used when adding info to the location field. -const LOCATION_TEXT = APP_NAME + ' Meeting'; - -let generateRoomNameAsDigits = false; - /** * The event page we will be updating. */ From d726bd97789e48aa39813f519fd974ce66f5d3a7 Mon Sep 17 00:00:00 2001 From: Phil Banks Date: Sat, 16 May 2020 22:17:18 +0100 Subject: [PATCH 2/3] remove extid checks --- calendar/meet-calendar.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/calendar/meet-calendar.js b/calendar/meet-calendar.js index 85566b6..fa073ea 100644 --- a/calendar/meet-calendar.js +++ b/calendar/meet-calendar.js @@ -1112,8 +1112,7 @@ function checkAndUpdateCalendar() { if(!c.isButtonPresent()) { // popup adds autoCreateMeeting param when open directly event // create page - if (findGetParameter('autoCreateMeeting') - && findGetParameter('extid') === chrome.runtime.id) { + if (findGetParameter('autoCreateMeeting')) { c.scheduleAutoCreateMeeting = true; } @@ -1191,8 +1190,7 @@ function checkAndUpdateCalendarG2() { && !c.isButtonPresent()) { // popup adds autoCreateMeeting param when open directly event // create page - if (findGetParameter('autoCreateMeeting') - && findGetParameter('extid') === chrome.runtime.id) { + if (findGetParameter('autoCreateMeeting')) { c.scheduleAutoCreateMeeting = true; } From df34d5b655afa2244c0e1681ad265baa94ff7d89 Mon Sep 17 00:00:00 2001 From: Phil Banks Date: Sat, 16 May 2020 22:18:24 +0100 Subject: [PATCH 3/3] gcal native templates instead of js injection --- calendar/popup.html | 5 ++++- calendar/popup.js | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/calendar/popup.html b/calendar/popup.html index 39b3b32..5054750 100644 --- a/calendar/popup.html +++ b/calendar/popup.html @@ -56,12 +56,15 @@ } + + +