diff --git a/assets/github120.png b/assets/github120.png
new file mode 100644
index 0000000..ea6ff54
Binary files /dev/null and b/assets/github120.png differ
diff --git a/css/style.css b/css/style.css
index 979f870..19730b0 100644
--- a/css/style.css
+++ b/css/style.css
@@ -4,4 +4,12 @@
padding: .2rem .5rem;
border: 1px solid rgba(0,0,0,.2);
border-radius: .25rem;
- }
\ No newline at end of file
+ }
+
+#shareLink {
+ display: inline-flex;
+ vertical-align: middle;
+ float: right;
+ padding-top: 1%;
+ color: black;
+}
\ No newline at end of file
diff --git a/manifest.json b/manifest.json
index 26c2f2b..2b0e54f 100755
--- a/manifest.json
+++ b/manifest.json
@@ -3,7 +3,7 @@
"name": "Moodle Downloader",
"description": "A chrome extension for downloading Moodle resources",
- "version": "1.4.6",
+ "version": "1.4.7",
"icons": {
"16": "assets/icon16.png",
"24": "assets/icon24.png",
diff --git a/src/popup.html b/src/popup.html
index 34f8208..f3d0061 100755
--- a/src/popup.html
+++ b/src/popup.html
@@ -40,8 +40,25 @@
moodleDownloader 📚
Organize into folder (experimental)
+
+
+
+
+ share
+
+
+
You just downloaded 50th file using this tool! 🎉
I have spent more than 30 hours to learn & develop this extension, could you please rate my efforts? 😬
diff --git a/src/popup.js b/src/popup.js
index 4f9fef0..ba1b1fb 100755
--- a/src/popup.js
+++ b/src/popup.js
@@ -21,6 +21,20 @@ function main() {
downloadResources()
});
+ document.getElementById("shareLink").addEventListener("click", () => {
+ var copyFrom = document.createElement("textarea");
+ copyFrom.textContent = "https://chrome.google.com/webstore/detail/geckodm/pgkfjobhhfckamidemkddfnnkknomobe";
+ document.body.appendChild(copyFrom);
+ copyFrom.select();
+ document.execCommand('copy');
+ copyFrom.blur();
+ document.body.removeChild(copyFrom);
+ })
+
+ document.getElementById("sourceCode").addEventListener("click", () => {
+ chrome.tabs.create({url: 'https:github.com/harsilspatel/moodleDownloader'})
+ })
+
// filter resources on input
const searchField = document.getElementById("search");
searchField.addEventListener("input", () => {
@@ -133,7 +147,7 @@ function suggestFilename(downloadItem, suggest) {
item = resourcesList.filter(r => r.url==downloadItem.url)[0],
console.log(downloadItem),
console.log(resourcesList),
- suggest({filename: item.course + '/' + item.section + '/' + downloadItem.filename})
+ suggest({filename: `${item.course}/${item.section}/${downloadItem.filename}`.replace(/[^\w.]+/g," ")})
}
function downloadResources() {