mirror of
https://github.com/Ellpeck/ObsidianCustomFrames.git
synced 2024-11-28 03:58:34 +01:00
Compare commits
No commits in common. "4b6b2083a6dcf98e077b83eb642acf26094fb915" and "47f9d1142aeb452021412987855dfd19c97c10e3" have entirely different histories.
4b6b2083a6
...
47f9d1142a
3 changed files with 8 additions and 34 deletions
|
@ -24,7 +24,6 @@ export class CustomFrame {
|
||||||
this.frame.addEventListener("dom-ready", () => {
|
this.frame.addEventListener("dom-ready", () => {
|
||||||
this.frame.setZoomFactor(this.data.zoomLevel);
|
this.frame.setZoomFactor(this.data.zoomLevel);
|
||||||
this.frame.insertCSS(this.data.customCss);
|
this.frame.insertCSS(this.data.customCss);
|
||||||
this.frame.executeJavaScript(this.data.customJs)
|
|
||||||
});
|
});
|
||||||
this.frame.addEventListener("destroyed", () => {
|
this.frame.addEventListener("destroyed", () => {
|
||||||
// recreate the webview if it was moved to a new window
|
// recreate the webview if it was moved to a new window
|
||||||
|
|
|
@ -149,22 +149,6 @@ export class CustomFramesSettingTab extends PluginSettingTab {
|
||||||
await this.plugin.saveSettings();
|
await this.plugin.saveSettings();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
new Setting(content)
|
|
||||||
.setName("Additional JavaScript")
|
|
||||||
.setDesc(createFragment(f => {
|
|
||||||
f.createSpan({ text: "A snippet of additional JavaScript that should be applied to this frame." });
|
|
||||||
f.createEl("br");
|
|
||||||
f.createEl("em", { text: "Note that this is only applied on Desktop." });
|
|
||||||
}))
|
|
||||||
.addTextArea(t => {
|
|
||||||
t.inputEl.rows = 5;
|
|
||||||
t.inputEl.cols = 50;
|
|
||||||
t.setValue(frame.customJs);
|
|
||||||
t.onChange(async v => {
|
|
||||||
frame.customJs = v;
|
|
||||||
await this.plugin.saveSettings();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
new ButtonComponent(content)
|
new ButtonComponent(content)
|
||||||
.setButtonText("Remove Frame")
|
.setButtonText("Remove Frame")
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
|
|
|
@ -12,8 +12,7 @@ export const presets: Record<string, CustomFrameSettings> = {
|
||||||
openInCenter: true,
|
openInCenter: true,
|
||||||
zoomLevel: 1,
|
zoomLevel: 1,
|
||||||
forceIframe: false,
|
forceIframe: false,
|
||||||
customCss: "",
|
customCss: ""
|
||||||
customJs: ""
|
|
||||||
},
|
},
|
||||||
"detexify": {
|
"detexify": {
|
||||||
url: "https://detexify.kirelabs.org/classify.html",
|
url: "https://detexify.kirelabs.org/classify.html",
|
||||||
|
@ -28,8 +27,7 @@ export const presets: Record<string, CustomFrameSettings> = {
|
||||||
#classify--info-area,
|
#classify--info-area,
|
||||||
.adsbygoogle {
|
.adsbygoogle {
|
||||||
display: none !important
|
display: none !important
|
||||||
}`,
|
}`
|
||||||
customJs: ""
|
|
||||||
},
|
},
|
||||||
"calendar": {
|
"calendar": {
|
||||||
url: "https://calendar.google.com/calendar",
|
url: "https://calendar.google.com/calendar",
|
||||||
|
@ -47,8 +45,7 @@ div[style*="min-width: 238px"] {
|
||||||
}
|
}
|
||||||
div[style*="min-width: 238px"] span[role*="heading"] {
|
div[style*="min-width: 238px"] span[role*="heading"] {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}`,
|
}`
|
||||||
customJs: ""
|
|
||||||
},
|
},
|
||||||
"keep": {
|
"keep": {
|
||||||
url: "https://keep.google.com",
|
url: "https://keep.google.com",
|
||||||
|
@ -68,8 +65,7 @@ html > body > div:first-child > header:first-child > div:nth-child(2) > div:nth-
|
||||||
}
|
}
|
||||||
html > body > div:first-child > header:first-child > div > div:first-child > div > div:first-child > a:first-child {
|
html > body > div:first-child > header:first-child > div > div:first-child > div > div:first-child > a:first-child {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}`,
|
}`
|
||||||
customJs: ""
|
|
||||||
},
|
},
|
||||||
"todoist": {
|
"todoist": {
|
||||||
url: "https://todoist.com",
|
url: "https://todoist.com",
|
||||||
|
@ -96,8 +92,7 @@ html > body > div:first-child > header:first-child > div > div:first-child > div
|
||||||
|
|
||||||
.undo_toast {
|
.undo_toast {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
}`,
|
}`
|
||||||
customJs: ""
|
|
||||||
},
|
},
|
||||||
"notion": {
|
"notion": {
|
||||||
url: "https://www.notion.so/",
|
url: "https://www.notion.so/",
|
||||||
|
@ -108,8 +103,7 @@ html > body > div:first-child > header:first-child > div > div:first-child > div
|
||||||
openInCenter: true,
|
openInCenter: true,
|
||||||
zoomLevel: 1,
|
zoomLevel: 1,
|
||||||
forceIframe: false,
|
forceIframe: false,
|
||||||
customCss: "",
|
customCss: ""
|
||||||
customJs: ""
|
|
||||||
},
|
},
|
||||||
"twitter": {
|
"twitter": {
|
||||||
url: "https://twitter.com",
|
url: "https://twitter.com",
|
||||||
|
@ -120,8 +114,7 @@ html > body > div:first-child > header:first-child > div > div:first-child > div
|
||||||
openInCenter: false,
|
openInCenter: false,
|
||||||
zoomLevel: 1,
|
zoomLevel: 1,
|
||||||
forceIframe: false,
|
forceIframe: false,
|
||||||
customCss: "",
|
customCss: ""
|
||||||
customJs: ""
|
|
||||||
},
|
},
|
||||||
"tasks": {
|
"tasks": {
|
||||||
url: "https://tasks.google.com/embed/?origin=https://calendar.google.com&fullWidth=1",
|
url: "https://tasks.google.com/embed/?origin=https://calendar.google.com&fullWidth=1",
|
||||||
|
@ -132,8 +125,7 @@ html > body > div:first-child > header:first-child > div > div:first-child > div
|
||||||
openInCenter: false,
|
openInCenter: false,
|
||||||
zoomLevel: 1,
|
zoomLevel: 1,
|
||||||
forceIframe: false,
|
forceIframe: false,
|
||||||
customCss: "",
|
customCss: ""
|
||||||
customJs: ""
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -152,7 +144,6 @@ export interface CustomFrameSettings {
|
||||||
zoomLevel: number;
|
zoomLevel: number;
|
||||||
forceIframe: boolean;
|
forceIframe: boolean;
|
||||||
customCss: string;
|
customCss: string;
|
||||||
customJs: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getIcon(settings: CustomFrameSettings) {
|
export function getIcon(settings: CustomFrameSettings) {
|
||||||
|
|
Loading…
Reference in a new issue