F diff --git a/actions.js b/actions.js
new file mode 100644
--- /dev/null
+++ b/actions.js
+
+ // Patterns in the URL:
+ // $fileanme - filename
+ // $content_urlencoded - file contents, urlencoded
+ // $content_base64 - file contents, base64'd
+
+ const actions = [
+ {
+ "extension": ".txt",
+ "text": "Google search filename",
+ "url": "https://www.google.com/search?q=$filename"
+ },
+ {
+ "extension": ".txt",
+ "text": "Google search contents",
+ "url": "https://www.google.com/search?q=$filename"
+ }
+ ];
F diff --git a/css/style.css b/css/style.css
--- a/css/style.css
+++ b/css/style.css
background-color: black;
background-repeat: no-repeat;
background-position: center;
- background-size: contain;
}
.filecontentsroot, .foldercontents {
F diff --git a/loggedin.js b/loggedin.js
--- a/loggedin.js
+++ b/loggedin.js
let b = `data:image/png;base64,${base64ArrayBuffer(xhr.response)}`;
focus.filecontents.style.backgroundImage = `url('${b}')`;
focus.filecontents.classList.add('imgview');
+ focus.filecontents.innerText = "asdf";
}
}
else {
open_file = fileview;
openfile(fileview.is_directory);
}],
+
+
];
if (is_in_trash) {
['Rename', () => { rename_file(fileview.filename); }],
);
if (!fileview.is_directory) {
+ for (let a of actions) {
+ if (fileview.filename.endsWith(a.extension)) {
+ context_list.push(
+ [a.text, () => {
+ read_file_contents(false, (x) => {
+ alert (encodeURIComponent(x));
+ }, get_path(), fileview.filename);
+ }]
+ );
+ }
+ }
+
if (fileview.write_permissions) {
context_list.push(
['Replace', () => { replace_file(false, fileview.filename); }],
F diff --git a/loggedin.php b/loggedin.php
--- a/loggedin.php
+++ b/loggedin.php
<input type="hidden" name="parent_directory" id="upload_parent_directory">
</form>
-
+ <script src="actions.js"></script>
<script src="loggedin.js"></script>