46 lines
15 KiB
JavaScript
46 lines
15 KiB
JavaScript
|
|
/*
|
||
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||
|
|
if you want to view the source, please visit the github repository of this plugin
|
||
|
|
*/
|
||
|
|
|
||
|
|
"use strict";var y=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var T=(d,i)=>{for(var a in i)y(d,a,{get:i[a],enumerable:!0})},L=(d,i,a,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of E(i))!k.call(d,t)&&t!==a&&y(d,t,{get:()=>i[t],enumerable:!(n=F(i,t))||n.enumerable});return d};var N=d=>L(y({},"__esModule",{value:!0}),d);var M={};T(M,{default:()=>w});module.exports=N(M);var h=require("obsidian");var S=require("obsidian");var u={frames:[],padding:5},C={obsidian:{url:"https://forum.obsidian.md/",displayName:"Obsidian Forum",icon:"edit",hideOnMobile:!0,addRibbonIcon:!0,openInCenter:!0,zoomLevel:1,forceIframe:!1,customCss:"",customJs:""},detexify:{url:"https://detexify.kirelabs.org/classify.html",displayName:"Detexify",icon:"type",hideOnMobile:!0,addRibbonIcon:!0,openInCenter:!1,zoomLevel:.95,forceIframe:!1,customCss:`/* hide info clutter and ad banner */
|
||
|
|
#classify--info-area,
|
||
|
|
.adsbygoogle {
|
||
|
|
display: none !important
|
||
|
|
}`,customJs:""},calendar:{url:"https://calendar.google.com/calendar",displayName:"Google Calendar",icon:"calendar",hideOnMobile:!0,addRibbonIcon:!0,openInCenter:!0,zoomLevel:1,forceIframe:!1,customCss:`/* hide the menu bar "Calendar" text and remove minimum width */
|
||
|
|
div[style*="min-width: 238px"] {
|
||
|
|
min-width: 0 !important;
|
||
|
|
padding-right: 0 !important;
|
||
|
|
}
|
||
|
|
div[style*="min-width: 238px"] span[role*="heading"] {
|
||
|
|
display: none !important;
|
||
|
|
}`,customJs:""},keep:{url:"https://keep.google.com",displayName:"Google Keep",icon:"files",hideOnMobile:!0,addRibbonIcon:!1,openInCenter:!1,zoomLevel:1,forceIframe:!1,customCss:`/* hide the menu bar, the "Keep" text and the Google Apps button */
|
||
|
|
html > body > div:nth-child(2) > div:nth-child(2) > div:first-child,
|
||
|
|
html > body > div:first-child > header:first-child > div > div:first-child > div > div:first-child > a:first-child > span,
|
||
|
|
html > body > div:first-child > header:first-child > div:nth-child(2) > div:first-child > div:first-child,
|
||
|
|
html > body > div:first-child > header:first-child > div:nth-child(2) > div:nth-child(3) > div:first-child > div:first-child > div:first-child {
|
||
|
|
display: none !important;
|
||
|
|
}
|
||
|
|
html > body > div:first-child > header:first-child > div > div:first-child > div > div:first-child > a:first-child {
|
||
|
|
cursor: default;
|
||
|
|
}`,customJs:""},todoist:{url:"https://todoist.com",displayName:"Todoist",icon:"list-checks",hideOnMobile:!0,addRibbonIcon:!1,openInCenter:!1,zoomLevel:1,forceIframe:!1,customCss:`/* hide the help, home, search, and productivity overview buttons, create extra space, and prevent toast pop-up from acting weird */
|
||
|
|
[aria-label="Go to Home view"], #quick_find, [aria-label="Productivity"], [aria-label="Help & Feedback"] {
|
||
|
|
display: none !important;
|
||
|
|
}
|
||
|
|
|
||
|
|
.view_content {
|
||
|
|
padding-left: 15px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.view_header {
|
||
|
|
padding-left: 15px;
|
||
|
|
padding-top: 10px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.undo_toast {
|
||
|
|
width: 95%;
|
||
|
|
}`,customJs:""},notion:{url:"https://www.notion.so/",displayName:"Notion",icon:"box",hideOnMobile:!0,addRibbonIcon:!0,openInCenter:!0,zoomLevel:1,forceIframe:!1,customCss:"",customJs:""},twitter:{url:"https://twitter.com",displayName:"Twitter",icon:"twitter",hideOnMobile:!0,addRibbonIcon:!1,openInCenter:!1,zoomLevel:1,forceIframe:!1,customCss:"",customJs:""},tasks:{url:"https://tasks.google.com/embed/?origin=https://calendar.google.com&fullWidth=1",displayName:"Google Tasks",icon:"list-checks",hideOnMobile:!0,addRibbonIcon:!1,openInCenter:!1,zoomLevel:1,forceIframe:!1,customCss:"",customJs:""},"readwise-daily-review":{url:"https://readwise.io/dailyreview",displayName:"Readwise Daily Review",icon:"highlighter",hideOnMobile:!0,addRibbonIcon:!1,openInCenter:!1,zoomLevel:1,forceIframe:!1,customCss:`.fixed-nav {
|
||
|
|
display: none !important;
|
||
|
|
}`,customJs:""}};function g(d){return d.icon?`lucide-${d.icon}`:"documents"}function v(d){return d.displayName.toLowerCase().replace(/\s/g,"-")}var m=class{constructor(i,a){this.settings=i,this.data=a}create(i,a,n,t){let s=`padding: ${this.settings.padding}px;`;if(n&&(s+=n),S.Platform.isDesktopApp&&!this.data.forceIframe){let e=a.doc;this.frame=a.createEl("webview"),this.frame.partition="persist:vault-"+i.appId,a.appendChild(this.frame),this.frame.setAttribute("allowpopups",""),this.frame.addEventListener("dom-ready",()=>{this.frame.setZoomFactor(this.data.zoomLevel),this.frame.insertCSS(this.data.customCss),this.frame.executeJavaScript(this.data.customJs)}),this.frame.addEventListener("destroyed",()=>{e!=a.doc&&(this.frame.detach(),this.create(i,a,n,t))})}else this.frame=a.createEl("iframe"),a.appendChild(this.frame),this.frame.setAttribute("sandbox","allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation allow-downloads"),this.frame.setAttribute("allow","encrypted-media; fullscreen; oversized-images; picture-in-picture; sync-xhr; geolocation;"),s+=`transform: scale(${this.data.zoomLevel}); transform-origin: 0 0;`;this.frame.addClass("custom-frames-frame"),this.frame.addClass(`custom-frames-${v(this.data)}`),this.frame.setAttribute("style",s);let o=new URL(this.data.url);if(t){let e=new URL(t,o.origin);e.searchParams.forEach((r,l)=>{o.searchParams.set(l,r)}),e.pathname!=="/"&&(o.pathname+=e.pathname),o.hash=e.hash||o.hash}this.frame.setAttribute("src",o.toString())}refresh(){this.frame instanceof HTMLIFrameElement?this.frame.contentWindow.location.reload():this.frame.reload()}return(){this.frame instanceof HTMLIFrameElement?this.frame.contentWindow.open(this.data.url):this.frame.loadURL(this.data.url)}goBack(){this.frame instanceof HTMLIFrameElement?this.frame.contentWindow.history.back():this.frame.goBack()}goForward(){this.frame instanceof HTMLIFrameElement?this.frame.contentWindow.history.forward():this.frame.goForward()}toggleDevTools(){this.frame instanceof HTMLIFrameElement||(this.frame.isDevToolsOpened()?this.frame.closeDevTools():this.frame.openDevTools())}getCurrentUrl(){return this.frame instanceof HTMLIFrameElement?this.frame.contentWindow.location.href:this.frame.getURL()}focus(){this.frame instanceof HTMLIFrameElement?this.frame.contentWindow.focus():this.frame.focus()}};var c=require("obsidian");var b=class extends c.PluginSettingTab{constructor(i,a){super(i,a),this.plugin=a}display(){this.containerEl.empty();let i=new c.SettingGroup(this.containerEl);i.addSetting(t=>void t.setName(createFragment(s=>s.createSpan({text:"Please note that Obsidian has to be restarted or reloaded for most Custom Frames settings to take effect.",cls:"mod-warning"})))),i.addSetting(t=>void t.setName("Frame padding").setDesc("The padding that should be left around the inside of custom frame panes, in pixels.").addText(s=>{s.inputEl.type="number",s.setValue(String(this.plugin.settings.padding)),s.onChange(async o=>{this.plugin.settings.padding=o.length?Number(o):u.padding,await this.plugin.saveSettings()})}));for(let t of this.plugin.settings.frames){let s=new c.SettingGroup(this.containerEl).setHeading(t.displayName||"Unnamed frame");s.addSetting(o=>void o.setName("Display name").setDesc("The display name that this frame should have.").addText(e=>{e.setValue(t.displayName),e.onChange(async r=>{t.displayName=r,s.setHeading(t.displayName||"Unnamed frame"),await this.plugin.saveSettings()})})),s.addSetting(o=>void o.setName("Icon").setDesc(createFragment(e=>{e.createSpan({text:"The icon that this frame's pane should have. The names of any "}),e.createEl("a",{text:"Lucide icons",href:"https://lucide.dev/"}),e.createSpan({text:" can be used."})})).addText(e=>{e.setValue(t.icon),e.onChange(async r=>{t.icon=r,await this.plugin.saveSettings()})})),s.addSetting(o=>void o.setName("URL").setDesc("The URL that should be opened in this frame.").addText(e=>{e.setValue(t.url),e.onChange(async r=>{t.url=r,await this.plugin.saveSettings()})})),s.addSetting(o=>void o.setNam
|
||
|
|
|
||
|
|
/* nosourcemap */
|