aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Vitkov <alexvitkov98@gmail.com>2021-03-07 10:28:34 +0200
committerAlex Vitkov <alexvitkov98@gmail.com>2021-03-07 10:28:34 +0200
commita670aee7f555f6eee6e3ef5d88307b9dae052db1 (patch)
tree69896bbc4d704679d53a9de6807db1f15c8fec0e
parent833c29c5f31e70ba26ca113c192d6fe1eb6e8dde (diff)
downloadfileup-a670aee7f555f6eee6e3ef5d88307b9dae052db1.tar.gz
asdf
-rw-r--r--actions.js2
-rw-r--r--loggedin.js9
2 files changed, 7 insertions, 4 deletions
diff --git a/actions.js b/actions.js
index 776e7ad..69912e4 100644
--- a/actions.js
+++ b/actions.js
@@ -13,6 +13,6 @@ const actions = [
{
"extension": ".txt",
"text": "Google search contents",
- "url": "https://www.google.com/search?q=$filename"
+ "url": "https://www.google.com/search?q=$content_urlencoded"
}
];
diff --git a/loggedin.js b/loggedin.js
index f015658..18bd785 100644
--- a/loggedin.js
+++ b/loggedin.js
@@ -292,7 +292,7 @@ function read_file_contents(text, cb, folder, filename) {
if (text) {
xhr.onload = function () {
- cb(e.responseText);
+ cb(xhr.responseText);
};
} else {
xhr.responseType = 'arraybuffer';
@@ -966,8 +966,11 @@ function add_file_visuals(fileview) {
if (fileview.filename.endsWith(a.extension)) {
context_list.push(
[a.text, () => {
- read_file_contents(false, (x) => {
- alert (encodeURIComponent(x));
+ read_file_contents(true, (x) => {
+ const ue = encodeURIComponent(x);
+ let url = a.url.replace("$content_urlencoded", ue)
+ .replace("$filename", fileview.filename);
+ window.location = url;
}, get_path(), fileview.filename);
}]
);