思源笔记
0 篇文章
seehttps://ld246.com/article/1734109655384 版本 2//!js//查询最近 30 天创建的文档 return(async()=>{//sql 查询语句//查询过去去 30 天的文档 constsql=`SELECT*FROMblocksWHEREtype='d'ANDcreated>=strftime('%Y%m%d%H%M%S','now','localtime','-30
要确定鼠标当前位于哪个元素内,JavaScript 提供了几种方法。你可以通过监听 mousemove事件并在事件处理函数中检查 event.target来得知鼠标所在的元素。此外,还可以使用 document.elementFromPoint方法来查找特定坐标下的最顶层元素。以下是两种常见的实现方式:使用 mousemove事件你可以为整个文档或某个容器添加一个 mousemove事件监听器,然后在
seehttps://ld246.com/article/1734430072051//启动时最小化到托盘//seehttps://github.com/siyuan-note/siyuan/blob/5129ad926a21176a352cf5f630e0651011bf9c83/app/src/boot/onGetConfig.ts#L115if(!localStorage.getItem('_
seehttps://ld246.com/article/1734263645595//调用示例,当 callback 返回 true 时退出,返回 false 时取消退出 functionsleep(ms){returnnewPromise(resolve=>setTimeout(resolve,ms));}listenExit(async()=>{console.log('waiting');awaitsle
seehttps://github.com/siyuan-note/siyuan/blob/5129ad926a21176a352cf5f630e0651011bf9c83/app/src/boot/onGetConfig.ts#L167require('electron').ipcRenderer.on('siyuan-open-url',(event,url)=>{console.log(eve
toolbar 被添加事件(async()=>{observeToolbar((el)=>{console.log(el,'toolbar');});//监听 toolbar 被添加 functionobserveToolbar(callback){//创建一个观察者实例并传入回调函数 constobserver=newMutationObserver((mutationsList,observer)=>{f
圣诞快乐 css
seehttps://ld246.com/article/1734435831275#barWorkspace{position:relative;}#barWorkspacespan.toolbar__text{font-weight:bold;font-size:14px;/*彩虹文字颜色*/animation:rainbow4sinfinitelinear;}#barWorkspacespan
日志模板//!jsreturn(async()=>{//获取天气 getWeather();asyncfunctiongetWeather(){//天气 apiconstweather=awaitfetch('https://wttr.in/?format=1');consttext=awaitweather.text();//显示当时的天气 render(text);//始终显示今天的天气//rende
思源如何给日记模板添加天气
seehttps://ld246.com/article/1734002304855 一,日记模板由于思源模板中无法执行 js,也就无法调用天气 api 了。所以这里可以利用 sql 查询模板变相执行 js 实现。比如这个示例模板,只需要把这段 js 放到模板里,然后模板加载时就可以显示天气了。//!jsreturn(async()=>{//获取天气 getWeather();asyncfunctiongetWeathe
seehttps://ld246.com/article/1734407382742/comment/1734440753272?r=wilsons#comments//!jsreturn(async()=>{//等待时长,默认 60 秒 constwaitForTime=60;getWeather();asyncfunctiongetWeather(){constweather=awaitfetch('