Skip to content

Commit a1d5d6d

Browse files
authored
Merge pull request #8 from LOAD-Robotics/development
Final Code for Aberdeen scrimmage
2 parents 2a65ba8 + bf8814d commit a1d5d6d

22 files changed

Lines changed: 877 additions & 350 deletions
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[
2-
"advanced-canvas"
2+
"advanced-canvas",
3+
"theme-toggle"
34
]
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
3+
if you want to view the source, please visit the github repository of this plugin
4+
*/
5+
6+
var __defProp = Object.defineProperty;
7+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8+
var __getOwnPropNames = Object.getOwnPropertyNames;
9+
var __hasOwnProp = Object.prototype.hasOwnProperty;
10+
var __export = (target, all) => {
11+
for (var name in all)
12+
__defProp(target, name, { get: all[name], enumerable: true });
13+
};
14+
var __copyProps = (to, from, except, desc) => {
15+
if (from && typeof from === "object" || typeof from === "function") {
16+
for (let key of __getOwnPropNames(from))
17+
if (!__hasOwnProp.call(to, key) && key !== except)
18+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19+
}
20+
return to;
21+
};
22+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23+
24+
// main.ts
25+
var main_exports = {};
26+
__export(main_exports, {
27+
default: () => ThemeToggle
28+
});
29+
module.exports = __toCommonJS(main_exports);
30+
var import_obsidian = require("obsidian");
31+
var ThemeToggle = class extends import_obsidian.Plugin {
32+
async onload() {
33+
this.ribbon = this.addRibbonIcon(this.getThemeIcon(), "Toggle to " + (this.getCurrentTheme() === "obsidian" ? "light" : "dark") + " mode", (evt) => {
34+
this.app.changeTheme(this.getCurrentTheme() === "obsidian" ? "moonstone" : "obsidian");
35+
(0, import_obsidian.setIcon)(evt.target, this.getThemeIcon());
36+
evt.target.setAttr("aria-label", "Toggle to " + (this.getCurrentTheme() === "obsidian" ? "light" : "dark") + " mode");
37+
});
38+
this.ribbon.addClass("ribbon-theme-toggle-plugin");
39+
this.registerEvent(
40+
this.app.workspace.on("css-change", () => {
41+
setTimeout(() => {
42+
(0, import_obsidian.setIcon)(this.ribbon, this.getCurrentTheme() === "obsidian" ? "sun" : "moon");
43+
this.ribbon.setAttr("aria-label", "Toggle to " + (this.getCurrentTheme() === "obsidian" ? "light" : "dark") + " mode");
44+
}, 10);
45+
})
46+
);
47+
this.addCommand({
48+
id: "toggle-theme",
49+
name: "Toggle theme",
50+
callback: () => {
51+
this.app.changeTheme(this.getCurrentTheme() === "obsidian" ? "moonstone" : "obsidian");
52+
(0, import_obsidian.setIcon)(this.ribbon, this.getCurrentTheme() === "obsidian" ? "sun" : "moon");
53+
}
54+
});
55+
}
56+
onunload() {
57+
this.ribbon.remove();
58+
}
59+
getCurrentTheme() {
60+
let currentTheme = this.app.getTheme() === "obsidian" ? "obsidian" : "moonstone";
61+
return currentTheme;
62+
}
63+
getThemeIcon() {
64+
let moonOrSunIcon = this.getCurrentTheme() === "obsidian" ? "sun" : "moon";
65+
return moonOrSunIcon;
66+
}
67+
};
68+
69+
/* nosourcemap */
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"id": "theme-toggle",
3+
"name": "Theme toggle",
4+
"version": "0.1.6",
5+
"minAppVersion": "0.15.0",
6+
"description": "Dark/light theme toggle via ribbon icon or command",
7+
"author": "@gapmiss",
8+
"authorUrl": "https://github.com/gapmiss",
9+
"isDesktopOnly": false
10+
}

Diagrams/.obsidian/workspace.json

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,32 @@
1717
"viewState": {
1818
"x": -670,
1919
"y": 70,
20-
"zoom": -0.2612571403908114
20+
"zoom": -0.6381710945544748
2121
}
2222
},
2323
"icon": "lucide-layout-dashboard",
2424
"title": "File Structure"
2525
}
26+
},
27+
{
28+
"id": "3c98fecc6f5ddbb9",
29+
"type": "leaf",
30+
"state": {
31+
"type": "canvas",
32+
"state": {
33+
"file": "Robot Wiring.canvas",
34+
"viewState": {
35+
"x": 210,
36+
"y": 40,
37+
"zoom": -0.39938423496735836
38+
}
39+
},
40+
"icon": "lucide-layout-dashboard",
41+
"title": "Robot Wiring"
42+
}
2643
}
27-
]
44+
],
45+
"currentTab": 1
2846
}
2947
],
3048
"direction": "vertical"
@@ -180,12 +198,21 @@
180198
"daily-notes:Open today's daily note": false,
181199
"templates:Insert template": false,
182200
"command-palette:Open command palette": false,
183-
"bases:Create new base": false
201+
"bases:Create new base": false,
202+
"theme-toggle:Toggle to dark mode": false
184203
}
185204
},
186-
"active": "d3b4cee07f48b93b",
205+
"active": "3c98fecc6f5ddbb9",
187206
"lastOpenFiles": [
207+
"File Structure.canvas",
208+
"File Structure Dark.png",
209+
"File Structure Light.png",
210+
"Robot Wiring Light.png",
211+
"Robot Wiring Dark.png",
212+
"Robot Wiring.canvas",
213+
"File Structure_Light.png",
214+
"Robot_Wiring.png",
188215
"File Structure.png",
189-
"File Structure Light.png"
216+
"Robot Controls.png"
190217
]
191218
}

Diagrams/File Structure Dark.png

275 KB
Loading

Diagrams/File Structure Light.png

287 KB
Loading

Diagrams/Robot Wiring Dark.png

326 KB
Loading

Diagrams/Robot Wiring Light.png

332 KB
Loading

0 commit comments

Comments
 (0)