Skip to content

Commit

Permalink
Added pro tip for people who cannot rtfm
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacopo Jannone committed Nov 5, 2020
1 parent 2593dab commit bc7b791
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 26 deletions.
Binary file added src/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 29 additions & 20 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
{
"icons": {
"128": "icon.png"
},
"name": "WebXDownloader",
"manifest_version": 2,
"version": "1.1.2",
"description": "Enables downloading of Webex meeting recordings",
"version": "1.1.3",
"permissions": [
"storage",
"tabs",
"https://*.webex.com/*"
],
"homepage_url": "https://github.com/jacopo-j/WebXDownloader",
"background": {
"scripts": [
"background.js"
]
},
"content_scripts": [
{
"matches": [
"*://*.webex.com/*"
],
"js": [
"content.js"
],
"run_at": "document_end"
}
],
"browser_action": {
"default_icon": "icon.png",
"default_title": "WebXDownloader",
"default_popup": "popup.html"
},
"content_scripts": [{
"js": ["content.js"],
"matches": ["*://*.webex.com/*"],
"run_at": "document_end"
}],
"background": {
"scripts": ["background.js"]
},
"homepage_url": "https://github.com/jacopo-j/WebXDownloader",
"permissions": [
"tabs",
"https://*.webex.com/*"
]
}
"manifest_version": 2,
"name": "WebXDownloader",
"icons": {
"128": "icon.png"
}
}
19 changes: 19 additions & 0 deletions src/options.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function saveOptions() {
chrome.storage.local.set({
hideprotip: document.getElementById("hide-protip").checked
});
}

function restoreOptions() {

function setCurrentChoice(result) {
if (! result.hideprotip && document.getElementById("errpage").style.display === "none") {
document.getElementById("protip").style.display = "block";
}
}

chrome.storage.local.get("hideprotip", setCurrentChoice);
}

document.addEventListener("DOMContentLoaded", restoreOptions);
document.getElementById("hide-protip").addEventListener("click", saveOptions);
29 changes: 28 additions & 1 deletion src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<style>
body {
width: 20em;
max-height: 25em;
max-height: 35em;
font-size: 100%;
margin: 1em;
background-color: #fcfcfc;
Expand Down Expand Up @@ -49,6 +49,21 @@
li {
margin-bottom: .5em;
}

.image {
width: 60%;
display: block;
margin-left: auto;
margin-right: auto;
}

#protip {
font-size: 90%;
}

hr {
opacity: 20%;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -89,6 +104,18 @@
<input id="download" type="button" value="Download" />
</div>
</div>
<div id="protip" style="display: none">
<br>
<hr>
<div><i>Pro tip: to just download the recording, look for the download icon on the bottom right. You didn't need to open this menu.</i></div>
<br>
<img src="image.png" class="image" />
<br>
<input type="checkbox" id="hide-protip"></input>
<label for="hide-protip">I know, don't show this again</label>
<br>
</div>
</body>
</html>
<script src="options.js"></script>
<script src="popup.js"></script>
14 changes: 9 additions & 5 deletions src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ function callback(tabs) {
let messages = data.getElementsByTagName("Message");
let chat = [];
for (let i = 0; i < messages.length; i++) {
chat.push({
"timecode": timeCode(messages[i].getElementsByTagName("DateTimeUTC")[0].textContent),
"name": messages[i].getElementsByTagName("LoginName")[0].textContent,
"message": messages[i].getElementsByTagName("Content")[0].textContent
});
try {
chat.push({
"timecode": timeCode(messages[i].getElementsByTagName("DateTimeUTC")[0].textContent),
"name": messages[i].getElementsByTagName("LoginName")[0].textContent,
"message": messages[i].getElementsByTagName("Content")[0].textContent
});
} catch(exception) {
continue;
}
}
let hlsUrl = `${host}/hls-vod/recordingDir/${recording_dir}/timestamp/${timestamp}/token/${token}/fileName/${filename}.m3u8`;
renderSuccess(meeting_name, hlsUrl, chat);
Expand Down

0 comments on commit bc7b791

Please sign in to comment.