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
3 changes: 2 additions & 1 deletion Diagrams/.obsidian/community-plugins.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[
"advanced-canvas"
"advanced-canvas",
"theme-toggle"
]
69 changes: 69 additions & 0 deletions Diagrams/.obsidian/plugins/theme-toggle/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// main.ts
var main_exports = {};
__export(main_exports, {
default: () => ThemeToggle
});
module.exports = __toCommonJS(main_exports);
var import_obsidian = require("obsidian");
var ThemeToggle = class extends import_obsidian.Plugin {
async onload() {
this.ribbon = this.addRibbonIcon(this.getThemeIcon(), "Toggle to " + (this.getCurrentTheme() === "obsidian" ? "light" : "dark") + " mode", (evt) => {
this.app.changeTheme(this.getCurrentTheme() === "obsidian" ? "moonstone" : "obsidian");
(0, import_obsidian.setIcon)(evt.target, this.getThemeIcon());
evt.target.setAttr("aria-label", "Toggle to " + (this.getCurrentTheme() === "obsidian" ? "light" : "dark") + " mode");
});
this.ribbon.addClass("ribbon-theme-toggle-plugin");
this.registerEvent(
this.app.workspace.on("css-change", () => {
setTimeout(() => {
(0, import_obsidian.setIcon)(this.ribbon, this.getCurrentTheme() === "obsidian" ? "sun" : "moon");
this.ribbon.setAttr("aria-label", "Toggle to " + (this.getCurrentTheme() === "obsidian" ? "light" : "dark") + " mode");
}, 10);
})
);
this.addCommand({
id: "toggle-theme",
name: "Toggle theme",
callback: () => {
this.app.changeTheme(this.getCurrentTheme() === "obsidian" ? "moonstone" : "obsidian");
(0, import_obsidian.setIcon)(this.ribbon, this.getCurrentTheme() === "obsidian" ? "sun" : "moon");
}
});
}
onunload() {
this.ribbon.remove();
}
getCurrentTheme() {
let currentTheme = this.app.getTheme() === "obsidian" ? "obsidian" : "moonstone";
return currentTheme;
}
getThemeIcon() {
let moonOrSunIcon = this.getCurrentTheme() === "obsidian" ? "sun" : "moon";
return moonOrSunIcon;
}
};

/* nosourcemap */
10 changes: 10 additions & 0 deletions Diagrams/.obsidian/plugins/theme-toggle/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "theme-toggle",
"name": "Theme toggle",
"version": "0.1.6",
"minAppVersion": "0.15.0",
"description": "Dark/light theme toggle via ribbon icon or command",
"author": "@gapmiss",
"authorUrl": "https://github.com/gapmiss",
"isDesktopOnly": false
}
37 changes: 32 additions & 5 deletions Diagrams/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,32 @@
"viewState": {
"x": -670,
"y": 70,
"zoom": -0.2612571403908114
"zoom": -0.6381710945544748
}
},
"icon": "lucide-layout-dashboard",
"title": "File Structure"
}
},
{
"id": "3c98fecc6f5ddbb9",
"type": "leaf",
"state": {
"type": "canvas",
"state": {
"file": "Robot Wiring.canvas",
"viewState": {
"x": 210,
"y": 40,
"zoom": -0.39938423496735836
}
},
"icon": "lucide-layout-dashboard",
"title": "Robot Wiring"
}
}
]
],
"currentTab": 1
}
],
"direction": "vertical"
Expand Down Expand Up @@ -180,12 +198,21 @@
"daily-notes:Open today's daily note": false,
"templates:Insert template": false,
"command-palette:Open command palette": false,
"bases:Create new base": false
"bases:Create new base": false,
"theme-toggle:Toggle to dark mode": false
}
},
"active": "d3b4cee07f48b93b",
"active": "3c98fecc6f5ddbb9",
"lastOpenFiles": [
"File Structure.canvas",
"File Structure Dark.png",
"File Structure Light.png",
"Robot Wiring Light.png",
"Robot Wiring Dark.png",
"Robot Wiring.canvas",
"File Structure_Light.png",
"Robot_Wiring.png",
"File Structure.png",
"File Structure Light.png"
"Robot Controls.png"
]
}
Binary file added Diagrams/File Structure Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Diagrams/File Structure Light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Diagrams/File Structure.png
Binary file not shown.
File renamed without changes
Binary file added Diagrams/Robot Wiring Dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Diagrams/Robot Wiring Light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading