You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! First of all I'm not a developer, I just used ChatGPT to fix issues I encountered since the plugin hasn't been updated in a while and I really like it. I'd be glad if this helps anyone 😄
Fixed issues:
The palette for color selection in the Groups section of the "graph" view does not open.
Checkboxes in the property panel don't change their state when clicked.
How to fix:
Open file "main.js" in Obsidian plugin folder at \.obsidian\plugins\obsidian-link-opener.
Replace the code starting on line // src/main.ts with provided below and save file.
(Optional) Restart Obsidian, if it was running.
// src/main.tsvarglobalLink="";varLinkOpenPlugin=classextendsimport_obsidian4.Plugin{asynconload(){awaitthis.loadSettings();this.registerView(LINK_VIEW,(leaf)=>newLinkView(this.app.workspace,leaf,""));constclickEvt=async(evt)=>{constel=evt.target;if(el.classList.contains("external-link")){consthref=el.getAttribute("linkto");if(this.settings.openMethod==="modal"&&href){newLinkModal(this.app,href,this.settings.modalWidth,this.settings.modalHeight).open();}elseif(this.settings.openMethod==="browser"&&href){window.open(href);}elseif(this.settings.openMethod==="tab"&&href){globalLink=href;awaitthis.app.workspace.getLeaf("tab").setViewState({type: LINK_VIEW,active: true});this.app.workspace.revealLeaf(this.app.workspace.getLeavesOfType(LINK_VIEW)[0]);return;}}else{// Вернуть управление по умолчанию для внутренних ссылокreturn;}};// Используйте capture: true, чтобы обработчик события срабатывал раньше другихthis.registerDomEvent(document,"click",clickEvt,true);constremoveUrl=(evt)=>{constel=evt.target;if(!el.classList.contains("external-link")){return;}if(el.getAttribute("href")=="javascript:void(0);"){return;}consthref=el.getAttribute("href");el.setAttribute("linkto",href ? href : "");el.setAttribute("href","javascript:void(0);");};this.registerDomEvent(document,"mouseover",(evt)=>{returnremoveUrl(evt);});// Ваш код с обработчиком чекбоксаconstupdateCheckboxState=()=>{constcheckbox=document.querySelector('.metadata-input-checkbox');if(checkbox){this.registerDomEvent(checkbox,'click',(evt)=>{evt.stopPropagation();// Ваша текущая логика обновления состояния чекбоксаconstcurrentValue=checkbox.checked;checkbox.checked=!currentValue;// Дополнительные действия, если необходимо});}};// Вызов функции при загрузке панели параметровthis.register(()=>{updateCheckboxState();});this.addSettingTab(newLinkOpenSettingTab(this.app,this));}onunload(){this.app.workspace.detachLeavesOfType(LINK_VIEW);}asyncloadSettings(){this.settings=Object.assign({},DEFAULT_SETTINGS,awaitthis.loadData());}asyncsaveSettings(){awaitthis.saveData(this.settings);}};
The text was updated successfully, but these errors were encountered:
Hi! First of all I'm not a developer, I just used ChatGPT to fix issues I encountered since the plugin hasn't been updated in a while and I really like it. I'd be glad if this helps anyone 😄
Fixed issues:
How to fix:
\.obsidian\plugins\obsidian-link-opener
.// src/main.ts
with provided below and save file.The text was updated successfully, but these errors were encountered: