This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('click', function (evt) { | |
if (evt.target.className === 'bp3-icon bp3-icon-filter') { | |
function sleep(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
async function removeFilters(event) { | |
var filteredButtons = event.target.parentElement.parentElement.parentElement.getElementsByTagName('BUTTON') | |
if (filteredButtons.length == 0 || filteredButtons == null) { return } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//v0.3 | |
//To apply TODO filter, use Shift + Click on the query syntax when a query is loaded with results | |
//Use this link to see GIF of DEMO: https://user-images.githubusercontent.com/64155612/95497690-9c0f8680-0957-11eb-94a7-e0cd49d62a06.gif | |
//The goal of this script is to filter out TODOs that only show up because they were added on daily notes page | |
//Mainly it is if you want to find overdue tasks, like from the last week, by default a TODO due next week will still | |
//show up if you added that TODO on a daily notes page from last week (within the between range) | |
//Resources about the script: | |
//For detailed discussion, see this Slack thread: https://roamresearch.slack.com/archives/C012WK8E9DK/p1601992542022100 | |
//Here is my github repo: https://github.com/GitMurf/roam-javascript |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
**************************************************************************************** | |
**************************************************************************************** | |
**************************************************************************************** | |
NOW HOSTING CODE VIA MY MAIN GITHUB REPOSITORY FOR ROAM SO THAT USERS CAN LINK DIRECTLY TO THE CODE AND AUTO UPDATE | |
GO HERE FOR INSTALLATION INSTRUCTIONS: https://github.com/GitMurf/roam-javascript#installation | |
**************************************************************************************** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//v1.1: Changed to using the new "view.editor" instead of deprecated "view.sourceMode.cmEditor" | |
let cmEditorAct = this.app.workspace.activeLeaf.view.editor; | |
let curLine = cmEditorAct.getCursor().line; | |
cmEditorAct.setSelection({ line: curLine, ch: 0 }, { line: curLine, ch: 9999 }); | |
function createBlockHash() { | |
let result = ''; | |
var characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//v1.1: Changed to using the new "view.editor" instead of deprecated "view.sourceMode.cmEditor" | |
let thisFile = this.app.workspace.getActiveFile(); | |
let thisFileCache = this.app.metadataCache.getFileCache(thisFile); | |
let embedsOnPage = thisFileCache.embeds; | |
if(embedsOnPage) { | |
let cmEditorAct = this.app.workspace.activeLeaf.view.editor; | |
let curLine = cmEditorAct.getCursor().line; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//v1.4: Adding option for including a header for each DNP day to fold | |
//'first' will add to top of file. 'last' will add to bottom of file | |
let firstOrLastLine = 'first'; | |
//Name of the Quick Capture file. Do NOT include extension '.md' | |
let qcFileName = 'Quick Capture'; | |
//Leave this blank if you want to use the default file path location (set to '/' to use root of vault) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//v1.0 | |
let dueDateStr = await tp.system.prompt("Due Date"); | |
let parseResult; | |
let parseResultLink; | |
if(dueDateStr) { | |
let nlDatesPlugin = this.app.plugins.getPlugin('nldates-obsidian'); | |
parseResult = nlDatesPlugin.parseDate(dueDateStr); | |
if(parseResult){parseResultLink = '[' + '[' + parseResult.formattedString + ']]';} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* INLINE BLOCK REFS v1.0 */ | |
:root { | |
--block-ref-color: yellow; | |
--block-ref-link-color: transparent; | |
} | |
.markdown-preview-view span[src*="^"].internal-embed:not(.image-embed) > div.markdown-embed { | |
border-top: none; | |
border-bottom-color: var(--block-ref-color); | |
border-bottom-style: dashed; | |
padding: 0px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//v1.6.2: Fix with update to Templater where wasn't removing the selected text/line "on move" | |
//'first' will add to top of file. 'last' will add to bottom of file | |
let firstOrLastLine = 'last'; | |
//Choose a specific line to move to underneath; overrules firstOrLastLine if true | |
const bChooseLine = false; | |
//After moving the line, open the file it was moved to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//v1.2: For block refs / embeds need to add line breaks above and below otherwise block ref extends to lines around it | |
//"pull" = default: removes the line, "pull-copy" leaves line, "pull-embed" leaves embed, "pull-ref" adds block ref | |
const pullMode = "pull"; | |
const pullFromFile = await tp.system.suggester((item) => item.path, this.app.vault.getMarkdownFiles(), false); | |
if(pullFromFile) { | |
let cmEditorAct = this.app.workspace.activeLeaf.view.editor; |
OlderNewer