mirror of
https://github.com/NohamR/Pocket-Bird.git
synced 2026-05-24 19:59:36 +00:00
Add obsidian context
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Pocket Bird",
|
"name": "Pocket Bird",
|
||||||
"description": "It's a pet bird in your browser, what more could you want?",
|
"description": "It's a pet bird in your browser, what more could you want?",
|
||||||
"version": "2025.11.3.34",
|
"version": "2025.11.3.37",
|
||||||
"homepage_url": "https://idreesinc.com",
|
"homepage_url": "https://idreesinc.com",
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "images/icons/transparent/48x48x1.png",
|
"48": "images/icons/transparent/48x48x1.png",
|
||||||
|
|||||||
39
dist/birb.js
vendored
39
dist/birb.js
vendored
@@ -1012,8 +1012,43 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ObsidianContext extends Context {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isContextActive() {
|
||||||
|
// @ts-expect-error
|
||||||
|
return typeof app !== "undefined" && typeof app.vault !== "undefined";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {Promise<BirbSaveData|{}>}
|
||||||
|
*/
|
||||||
|
async getSaveData() {
|
||||||
|
log("Loading save data from Obsidian plugin storage unimplemented");
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @param {BirbSaveData} saveData
|
||||||
|
*/
|
||||||
|
async putSaveData(saveData) {
|
||||||
|
log("Saving data to Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
resetSaveData() {
|
||||||
|
log("Resetting save data in Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const CONTEXTS = [
|
const CONTEXTS = [
|
||||||
new UserScriptContext(),
|
new UserScriptContext(),
|
||||||
|
new ObsidianContext(),
|
||||||
new BrowserExtensionContext(),
|
new BrowserExtensionContext(),
|
||||||
new LocalContext()
|
new LocalContext()
|
||||||
];
|
];
|
||||||
@@ -1025,7 +1060,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
error("No applicable context found, defaulting to LocalContext");
|
error("No applicable context found, defaulting to LocalContext");
|
||||||
return CONTEXTS[0];
|
return new LocalContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1867,7 +1902,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.11.3.34", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.34"); }, false),
|
new MenuItem("2025.11.3.37", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.37"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
|
|||||||
BIN
dist/extension.zip
vendored
BIN
dist/extension.zip
vendored
Binary file not shown.
39
dist/extension/birb.js
vendored
39
dist/extension/birb.js
vendored
@@ -1012,8 +1012,43 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ObsidianContext extends Context {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isContextActive() {
|
||||||
|
// @ts-expect-error
|
||||||
|
return typeof app !== "undefined" && typeof app.vault !== "undefined";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {Promise<BirbSaveData|{}>}
|
||||||
|
*/
|
||||||
|
async getSaveData() {
|
||||||
|
log("Loading save data from Obsidian plugin storage unimplemented");
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @param {BirbSaveData} saveData
|
||||||
|
*/
|
||||||
|
async putSaveData(saveData) {
|
||||||
|
log("Saving data to Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
resetSaveData() {
|
||||||
|
log("Resetting save data in Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const CONTEXTS = [
|
const CONTEXTS = [
|
||||||
new UserScriptContext(),
|
new UserScriptContext(),
|
||||||
|
new ObsidianContext(),
|
||||||
new BrowserExtensionContext(),
|
new BrowserExtensionContext(),
|
||||||
new LocalContext()
|
new LocalContext()
|
||||||
];
|
];
|
||||||
@@ -1025,7 +1060,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
error("No applicable context found, defaulting to LocalContext");
|
error("No applicable context found, defaulting to LocalContext");
|
||||||
return CONTEXTS[0];
|
return new LocalContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1867,7 +1902,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.11.3.34", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.34"); }, false),
|
new MenuItem("2025.11.3.37", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.37"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
|
|||||||
2
dist/extension/manifest.json
vendored
2
dist/extension/manifest.json
vendored
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "Pocket Bird",
|
"name": "Pocket Bird",
|
||||||
"description": "It's a pet bird in your browser, what more could you want?",
|
"description": "It's a pet bird in your browser, what more could you want?",
|
||||||
"version": "2025.11.3.34",
|
"version": "2025.11.3.37",
|
||||||
"homepage_url": "https://idreesinc.com",
|
"homepage_url": "https://idreesinc.com",
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "images/icons/transparent/48x48x1.png",
|
"48": "images/icons/transparent/48x48x1.png",
|
||||||
|
|||||||
39
dist/obsidian/main.js
vendored
39
dist/obsidian/main.js
vendored
@@ -1012,8 +1012,43 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ObsidianContext extends Context {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isContextActive() {
|
||||||
|
// @ts-expect-error
|
||||||
|
return typeof app !== "undefined" && typeof app.vault !== "undefined";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {Promise<BirbSaveData|{}>}
|
||||||
|
*/
|
||||||
|
async getSaveData() {
|
||||||
|
log("Loading save data from Obsidian plugin storage unimplemented");
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @param {BirbSaveData} saveData
|
||||||
|
*/
|
||||||
|
async putSaveData(saveData) {
|
||||||
|
log("Saving data to Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
resetSaveData() {
|
||||||
|
log("Resetting save data in Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const CONTEXTS = [
|
const CONTEXTS = [
|
||||||
new UserScriptContext(),
|
new UserScriptContext(),
|
||||||
|
new ObsidianContext(),
|
||||||
new BrowserExtensionContext(),
|
new BrowserExtensionContext(),
|
||||||
new LocalContext()
|
new LocalContext()
|
||||||
];
|
];
|
||||||
@@ -1025,7 +1060,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
error("No applicable context found, defaulting to LocalContext");
|
error("No applicable context found, defaulting to LocalContext");
|
||||||
return CONTEXTS[0];
|
return new LocalContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1867,7 +1902,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.11.3.34", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.34"); }, false),
|
new MenuItem("2025.11.3.37", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.37"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
|
|||||||
2
dist/obsidian/manifest.json
vendored
2
dist/obsidian/manifest.json
vendored
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "pocket-bird",
|
"id": "pocket-bird",
|
||||||
"name": "Pocket Bird",
|
"name": "Pocket Bird",
|
||||||
"version": "2025.11.3.34",
|
"version": "2025.11.3.37",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "It's a pet bird in your Obsidian, what more could you want?",
|
"description": "It's a pet bird in your Obsidian, what more could you want?",
|
||||||
"author": "Idrees Hassan",
|
"author": "Idrees Hassan",
|
||||||
|
|||||||
41
dist/userscript/birb.user.js
vendored
41
dist/userscript/birb.user.js
vendored
@@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Pocket Bird
|
// @name Pocket Bird
|
||||||
// @namespace https://idreesinc.com
|
// @namespace https://idreesinc.com
|
||||||
// @version 2025.11.3.34
|
// @version 2025.11.3.37
|
||||||
// @description It's a bird that hops around your web browser, the future is here
|
// @description It's a bird that hops around your web browser, the future is here
|
||||||
// @author Idrees
|
// @author Idrees
|
||||||
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
|
// @downloadURL https://github.com/IdreesInc/Pocket-Bird/raw/refs/heads/main/dist/userscript/birb.user.js
|
||||||
@@ -1026,8 +1026,43 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ObsidianContext extends Context {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isContextActive() {
|
||||||
|
// @ts-expect-error
|
||||||
|
return typeof app !== "undefined" && typeof app.vault !== "undefined";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {Promise<BirbSaveData|{}>}
|
||||||
|
*/
|
||||||
|
async getSaveData() {
|
||||||
|
log("Loading save data from Obsidian plugin storage unimplemented");
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @param {BirbSaveData} saveData
|
||||||
|
*/
|
||||||
|
async putSaveData(saveData) {
|
||||||
|
log("Saving data to Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
resetSaveData() {
|
||||||
|
log("Resetting save data in Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const CONTEXTS = [
|
const CONTEXTS = [
|
||||||
new UserScriptContext(),
|
new UserScriptContext(),
|
||||||
|
new ObsidianContext(),
|
||||||
new BrowserExtensionContext(),
|
new BrowserExtensionContext(),
|
||||||
new LocalContext()
|
new LocalContext()
|
||||||
];
|
];
|
||||||
@@ -1039,7 +1074,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
error("No applicable context found, defaulting to LocalContext");
|
error("No applicable context found, defaulting to LocalContext");
|
||||||
return CONTEXTS[0];
|
return new LocalContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1881,7 +1916,7 @@
|
|||||||
insertModal(`${birdBirb()} Mode`, message);
|
insertModal(`${birdBirb()} Mode`, message);
|
||||||
}),
|
}),
|
||||||
new Separator(),
|
new Separator(),
|
||||||
new MenuItem("2025.11.3.34", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.34"); }, false),
|
new MenuItem("2025.11.3.37", () => { alert("Thank you for using Pocket Bird! You are on version: 2025.11.3.37"); }, false),
|
||||||
];
|
];
|
||||||
|
|
||||||
const styleElement = document.createElement("style");
|
const styleElement = document.createElement("style");
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "pocket-bird",
|
"id": "pocket-bird",
|
||||||
"name": "Pocket Bird",
|
"name": "Pocket Bird",
|
||||||
"version": "2025.11.3.34",
|
"version": "2025.11.3.37",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "It's a pet bird in your Obsidian, what more could you want?",
|
"description": "It's a pet bird in your Obsidian, what more could you want?",
|
||||||
"author": "Idrees Hassan",
|
"author": "Idrees Hassan",
|
||||||
|
|||||||
@@ -174,8 +174,43 @@ class BrowserExtensionContext extends Context {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ObsidianContext extends Context {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isContextActive() {
|
||||||
|
// @ts-expect-error
|
||||||
|
return typeof app !== "undefined" && typeof app.vault !== "undefined";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @returns {Promise<BirbSaveData|{}>}
|
||||||
|
*/
|
||||||
|
async getSaveData() {
|
||||||
|
log("Loading save data from Obsidian plugin storage unimplemented");
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @override
|
||||||
|
* @param {BirbSaveData} saveData
|
||||||
|
*/
|
||||||
|
async putSaveData(saveData) {
|
||||||
|
log("Saving data to Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @override */
|
||||||
|
resetSaveData() {
|
||||||
|
log("Resetting save data in Obsidian plugin storage unimplemented");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const CONTEXTS = [
|
const CONTEXTS = [
|
||||||
new UserScriptContext(),
|
new UserScriptContext(),
|
||||||
|
new ObsidianContext(),
|
||||||
new BrowserExtensionContext(),
|
new BrowserExtensionContext(),
|
||||||
new LocalContext()
|
new LocalContext()
|
||||||
];
|
];
|
||||||
@@ -187,5 +222,5 @@ export function getContext() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
error("No applicable context found, defaulting to LocalContext");
|
error("No applicable context found, defaulting to LocalContext");
|
||||||
return CONTEXTS[0];
|
return new LocalContext();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user