Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<script src="./patchtails.js" defer></script>
<script src="../plugins/plugins.conf.js" defer></script>
<script src="./pluginWorker.js" defer></script>
<script src="./lsSaveHandler.js" defer></script>
<link rel="stylesheet" type="text/css" href="../output/tailwind.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
Expand Down Expand Up @@ -98,6 +99,7 @@ <h1 class="font-bold text-xl">Preferences</h1>
Clear Data</button>
<button onclick="togglePreferences()" class="text-center p-2 bg-blue-300 hover:bg-blue-400 transition rounded dark:text-gray-800">Close
Preferences</button>
<button onclick="lsSaveBookmarks()" class="text-center p-2 bg-blue-300 hover:bg-blue-400 transition rounded dark:text-gray-800">Export Bookmarks</button>
</div>
<!-- Suggestions -->
<div class="suggestions-box" id="autocomplete-suggestions">
Expand Down
19 changes: 19 additions & 0 deletions src/lsSaveHandler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function lsSaveBookmarks() {
let bookmarksFile = new Blob([JSON.stringify(bookmarks)], { type: "text/plain" });
let bookmarksURL = URL.createObjectURL(bookmarksFile);
let bookmarksLink = document.createElement("a");
bookmarksLink.href = bookmarksURL;
bookmarksLink.download = "bookmarks.json";
bookmarksLink.click();
URL.revokeObjectURL(bookmarksURL);
}

function loadBookmarksJSON(pathToFile) {
// if pathToFile ends with json continue, if not stop function
if (!pathToFile.endsWith(".json")) {
console.log("This functionality is incomplete")
} else {
return;
}

}