mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-25 04:07:23 +00:00
Expose obsidian plugin api and allow saving/loading
This commit is contained in:
15
dist/userscript/birb.user.js
vendored
15
dist/userscript/birb.user.js
vendored
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name Pocket Bird
|
||||
// @namespace https://idreesinc.com
|
||||
// @version 2025.11.13.8
|
||||
// @version 2025.11.13.16
|
||||
// @description It's a bird that hops around your web browser, the future is here
|
||||
// @author Idrees
|
||||
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
|
||||
@@ -1080,21 +1080,22 @@
|
||||
* @returns {Promise<BirbSaveData|{}>}
|
||||
*/
|
||||
async getSaveData() {
|
||||
log("Loading save data from Obsidian plugin storage unimplemented");
|
||||
return {};
|
||||
// @ts-expect-error
|
||||
return await OBSIDIAN_PLUGIN.loadData() ?? {};
|
||||
}
|
||||
|
||||
/**
|
||||
* @override
|
||||
* @param {BirbSaveData} saveData
|
||||
* @param {BirbSaveData|{}} saveData
|
||||
*/
|
||||
async putSaveData(saveData) {
|
||||
log("Saving data to Obsidian plugin storage unimplemented");
|
||||
// @ts-expect-error
|
||||
return await OBSIDIAN_PLUGIN.saveData(saveData);
|
||||
}
|
||||
|
||||
/** @override */
|
||||
resetSaveData() {
|
||||
log("Resetting save data in Obsidian plugin storage unimplemented");
|
||||
this.putSaveData({});
|
||||
}
|
||||
|
||||
/** @override */
|
||||
@@ -1937,7 +1938,7 @@
|
||||
insertModal(`${birdBirb()} Mode`, message);
|
||||
}),
|
||||
new Separator(),
|
||||
new MenuItem("2025.11.13.8", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.8"); }, false),
|
||||
new MenuItem("2025.11.13.16", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.13.16"); }, false),
|
||||
];
|
||||
|
||||
const styleElement = document.createElement("style");
|
||||
|
||||
Reference in New Issue
Block a user