Initiation to js files
main
Mel 3 years ago
parent e69540b2dd
commit 6e34ae07e3

@ -20,5 +20,7 @@
"meld-encrypt", "meld-encrypt",
"find-and-replace-in-selection", "find-and-replace-in-selection",
"obsidian-auto-link-title", "obsidian-auto-link-title",
"obsidian-itinerary" "obsidian-itinerary",
"file-tree-alternative",
"customjs"
] ]

@ -0,0 +1,4 @@
{
"jsFiles": "",
"jsFolder": "00.01 Admin/dv-views"
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,10 @@
{
"id": "customjs",
"name": "CustomJS",
"version": "1.0.10",
"minAppVersion": "0.9.12",
"description": "This plugin allows for the loading and reuse of custom JS inside your vault.",
"author": "Sam Lewis",
"authorUrl": "https://github.com/samlewis0602",
"isDesktopOnly": false
}

@ -1,11 +1,18 @@
{ {
"renderNullAs": "\\-", "renderNullAs": "\\-",
"taskLinkLocation": "end",
"taskLinkText": "🔗",
"warnOnEmptyResult": true, "warnOnEmptyResult": true,
"refreshInterval": 1000, "refreshInterval": 1000,
"defaultDateFormat": "dd/MM/yyyy", "defaultDateFormat": "dd/MM/yyyy",
"defaultDateTimeFormat": "h:mm a - MMMM dd, yyyy", "defaultDateTimeFormat": "h:mm a - MMMM dd, yyyy",
"maxRecursiveRenderDepth": 6,
"tableIdColumnName": "File",
"tableGroupColumnName": "Group",
"inlineQueryPrefix": "=", "inlineQueryPrefix": "=",
"inlineJsQueryPrefix": "$=", "inlineJsQueryPrefix": "$=",
"enableDataviewJs": true, "enableDataviewJs": true,
"enableInlineDataviewJs": true,
"prettyRenderInlineFields": true,
"schemaVersion": 1 "schemaVersion": 1
} }

@ -0,0 +1,19 @@
{
"ribbonIcon": true,
"showRootFolder": true,
"showFilesFromSubFolders": true,
"searchFunction": true,
"showFilesFromSubFoldersButton": true,
"excludedExtensions": "",
"excludedFolders": "",
"folderCount": true,
"folderCountOption": "notes",
"openFolders": [],
"pinnedFiles": [],
"customHeight": 0,
"evernoteView": true,
"filePreviewOnHover": false,
"sortFilesBy": "name",
"fixedHeaderInFileList": false,
"activeFolderPath": "03.01 Reading list"
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,10 @@
{
"id": "file-tree-alternative",
"name": "File Tree Alternative Plugin",
"version": "1.5.4",
"minAppVersion": "0.9.12",
"description": "This plugin allows you to have an alternative file tree view.",
"author": "Ozan Tellioglu",
"authorUrl": "https://www.ozan.pl",
"isDesktopOnly": false
}

@ -0,0 +1,212 @@
.oz-file-tree-header {
height: 22px;
color: var(--text-normal);
font-size: 15px;
font-weight: bold;
text-align: center;
}
.oz-nav-action-button {
color: var(--text-normal);
display: inline-block;
padding: 3px 0px 0 3px !important;
}
.oz-input-container {
margin-bottom: 3px !important;
margin-top: 3px !important;
}
.oz-nav-buttons-right-block {
text-align: right;
}
.oz-nav-file-title {
padding-left: 2px !important;
padding-right: 2px !important;
}
div.workspace-leaf-content[data-type='file-tree-view'] > div.view-content {
padding: 10px 5px 5px 5px;
}
.oz-flex-container {
display: flex;
flex-direction: row;
justify-content: space-between;
height: 26px;
}
.oz-explorer-container {
padding-left: 3px !important;
padding-right: 3px !important;
}
.oz-file-tree-files {
padding-top: 3px !important;
}
.drag-entered,
.oz-folder-element:hover,
.oz-nav-file:hover {
background-color: var(--text-selection);
}
.oz-folder-contents {
will-change: transform, opacity, height;
margin-left: 6;
padding: 4px 0px 0px 14px;
border-left: 1px dashed;
border-left-color: var(--text-muted);
font-size: 12.8px;
}
.oz-folder-toggle {
width: 1em;
height: 1em;
margin-right: 10px;
cursor: pointer;
vertical-align: middle;
}
.treeview {
position: relative;
padding: 4px 0px 0px 0px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
vertical-align: middle;
}
.oz-folder-type {
text-transform: uppercase;
font-family: monospace;
font-size: 0.6em;
vertical-align: middle;
display: inline-block;
}
.oz-folder-name {
vertical-align: middle;
display: inline-block;
color: var(--text-normal);
font-size: 13px;
}
div.oz-folder-name.is-root-folder {
font-size: 16px;
}
.is-mobile .oz-folder-name.is-root-folder {
font-size: 18px;
}
.is-mobile .oz-folder-name {
font-size: 15.5px;
}
.is-mobile div.oz-nav-file-title .nav-file-title-content {
font-size: 15px;
}
.oz-icon-div {
display: inline-block;
}
.oz-folder-block {
display: inline-block;
width: 100%;
}
.oz-folder-count.no-root {
float: right;
padding-right: 25px;
}
.oz-folder-count.with-root {
float: right;
padding-right: 32px;
}
.oz-folders-tree-wrapper {
overflow: hidden;
overflow-y: auto;
padding-bottom: 5px;
padding-left: 8px;
height: 100%;
}
.oz-folder-element {
line-height: 1.35em;
padding: 0px 0px 0px 0px;
}
.oz-input-container > input {
padding-left: 8px;
padding-right: 4px;
}
.oz-nav-action-button:hover {
color: var(--interactive-accent);
}
.oz-nav-action-button .fa-lg {
font-size: 1.15em;
}
.file-tree-container {
display: flex;
flex-direction: column;
height: 100%;
max-height: 100%;
}
.file-tree-plugin-view {
height: 100%;
}
.oz-folder-pane {
display: block;
width: 100%;
overflow-y: auto;
height: 50%;
resize: vertical;
}
.oz-file-list-pane {
display: block;
width: 100%;
overflow-y: auto;
flex: 1;
}
.oz-coffee-div {
text-align: center;
margin-top: 20px;
}
#file-tree-divider {
height: 2.5px;
background-color: var(--text-muted);
cursor: row-resize;
}
.is-folder-active {
color: var(--text-accent);
font-weight: bold;
}
.file-tree-header-fixed {
position: fixed;
width: 100%;
left: 0;
padding-left: 4px;
padding-right: 4px;
background-color: var(--background-secondary);
}
.file-tree-files-fixed {
padding-top: 50px !important;
display: flex;
flex-direction: column;
}

@ -9,7 +9,7 @@
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
"file": "01.01 Life Orga/@Life Organisation.md", "file": "03.01 Reading list/@Reading master.md",
"mode": "preview" "mode": "preview"
} }
} }
@ -54,9 +54,17 @@
"useHierarchy": true "useHierarchy": true
} }
} }
},
{
"id": "4e65a6bd71a6a3f4",
"type": "leaf",
"state": {
"type": "file-tree-view",
"state": {}
}
} }
], ],
"currentTab": 0 "currentTab": 3
}, },
"right": { "right": {
"id": "901f0677c871de02", "id": "901f0677c871de02",
@ -68,7 +76,7 @@
"state": { "state": {
"type": "backlink", "type": "backlink",
"state": { "state": {
"file": "01.01 Life Orga/@Life Organisation.md", "file": "03.01 Reading list/@Reading master.md",
"collapseAll": false, "collapseAll": false,
"extraContext": false, "extraContext": false,
"sortOrder": "alphabetical", "sortOrder": "alphabetical",
@ -107,15 +115,15 @@
}, },
"active": "c1cbd199334b4022", "active": "c1cbd199334b4022",
"lastOpenFiles": [ "lastOpenFiles": [
"03.01 Reading list/@Reading master.md",
"01.02 Home/MRCK.md",
"03.01 Reading list/Comprendre l'islam.md",
"03.01 Reading list/The Girls.md",
"05.01 Computer setup/@Computer Set Up.md",
"05.01 Computer setup/Storage and Syncing.md",
"01.01 Life Orga/@Life Organisation.md", "01.01 Life Orga/@Life Organisation.md",
"01.01 Life Orga/Finances.md", "01.01 Life Orga/Finances.md",
"06.02 Investments/VC Tasks.md", "06.02 Investments/VC Tasks.md",
"06.02 Investments/VC Investments.md", "06.02 Investments/VC Investments.md"
"06.02 Investments/Equity Tasks.md",
"06.02 Investments/Equity Investments.md",
"06.02 Investments/Crypto Tasks.md",
"06.02 Investments/Crypto Investments.md",
"06.02 Investments/@Investment Task master.md",
"06.02 Investments/@Investment master.md"
] ]
} }

@ -0,0 +1,64 @@
let curr = dv.current();
let {dateadded, language, author, publicationd, theme, readingd} = input;
let page = dv.pages()
.filter(p => {return !p.file.path.contains('00.01') && p.DocType !== undefined && p.DocType !== null && p.DocType.contains('Source') && p.Source.Type !== undefined && p.Source.Type !== null && p.Source.Type.contains('Book')})
function DataCheck(arg1, arg2) {
var iarg1 = arg1
if (moment(iarg1).isValid()) {iarg1 = arg1.toString()}
var iarg2 = arg2
if (moment(iarg2).isValid()) {iarg2 = arg2.toString()}
if (!Array.isArray(iarg2)) {
var result = iarg1.contains(iarg2)
} else if (!Array.isArray(iarg1)) {
var result = iarg2.contains(iarg1)
} else {
let count = iarg2.length
let tempresult = false
let tempresult2 = false
for (let i = 0; i < count; i++) {
tempresult = tempresult2 || iarg1.contains(iarg2[i])
tempresult2 = tempresult
}
var result = tempresult
}
return result
}
function IsInSearch(book) {
if (Boolean(theme)) {
var result_tag = DataCheck(book.Tag, theme)
} else {var result_tag = true}
if (Boolean(dateadded)) {
var result_date = DataCheck(book.Date, dateadded)
} else {var result_date = true}
if (Boolean(language)) {
var result_lang = DataCheck(book.Source.Language, language)
} else {var result_lang = true}
if (Boolean(author)) {
var result_auth = DataCheck(book.Source.Author, author)
} else {var result_auth = true}
if (Boolean(publicationd)) {
var result_pub = DataCheck(book.Source.Published, publicationd)
} else {var result_pub = true}
if (readingd !== undefined && readingd !== null) {
if (readingd == true) {
var result_read = Boolean(book.Source.Read)
} else if (!Boolean(readingd)) {
var result_read = !Boolean(book.Source.Read)
} else {
if (Boolean(book.Source.Read)) {
var result_read = DataCheck(book.Source.Read, readingd)
} else { var result_read = false}
}
} else {var result_read = true}
var result = result_tag && result_date && result_lang && result_auth && result_pub && result_read
return result
}
if (page.length > 0) {
dv.table(["Title", "Author", "Published date", "Language", "Themes", "Date read"], page
.where(p => p && IsInSearch(p))
.sort(p => p.file.name, `asc`)
.map(p => [p.file.link, p.Source.Author, p.Source.Published, p.Source.Language, p.Tag, p.Source.Read])); } else { return '"No result matching your query"'}

@ -0,0 +1,70 @@
var debug = "found"
var debugtitle = "string"
let curr = dv.current();
let {dateadded, language, author, publicationd, theme, readingd} = input;
let page = dv.pages()
.filter(p => {return !p.file.path.contains('00.01') && p.DocType !== undefined && p.DocType !== null && p.DocType.contains('Source') && p.Source.Type !== undefined && p.Source.Type !== null && p.Source.Type.contains('Book')})
function DataCheck(arg1, arg2) {
var iarg1 = arg1
if (moment(iarg1).isValid()) {iarg1 = arg1.toString()}
var iarg2 = arg2
if (moment(iarg2).isValid()) {iarg2 = arg2.toString()}
if (!Array.isArray(iarg2)) {
var result = iarg1.contains(iarg2)
} else if (!Array.isArray(iarg1)) {
var result = iarg2.contains(iarg1)
} else {
let count = iarg2.length
let tempresult = false
let tempresult2 = false
for (let i = 0; i < count; i++) {
tempresult = tempresult2 || iarg1.contains(iarg2[i])
tempresult2 = tempresult
}
var result = tempresult
}
return result
}
debug = dateadded
function IsInSearch(book) {
if (Boolean(theme)) {
var result_tag = DataCheck(book.Tag, theme)
} else {var result_tag = true}
if (Boolean(dateadded)) {
var result_date = DataCheck(book.Date, dateadded)
} else {var result_date = true}
if (Boolean(language)) {
var result_lang = DataCheck(book.Source.Language, language)
} else {var result_lang = true}
if (Boolean(author)) {
var result_auth = DataCheck(book.Source.Author, author)
} else {var result_auth = true}
if (Boolean(publicationd)) {
var result_pub = DataCheck(book.Source.Published, publicationd)
} else {var result_pub = true}
if (readingd !== undefined && readingd !== null) {
if (readingd == true) {
var result_read = Boolean(book.Source.Read)
} else if (!Boolean(readingd)) {
var result_read = !Boolean(book.Source.Read)
} else {
if (Boolean(book.Source.Read)) {
var result_read = DataCheck(book.Source.Read, readingd)
} else { var result_read = false}
}
} else {var result_read = true}
var result = result_tag && result_date && result_lang && result_auth && result_pub && result_read
return result
}
if (page.length > 0) {
dv.table(["Title", "Author", "Published date", "Language", "Themes", "Date read"], page
.where(p => p && IsInSearch(p))
.sort(p => p.file.name, `asc`)
.map(p => [p.file.link, p.Source.Author, p.Source.Published, p.Source.Language, p.Tag, p.Source.Read])); } else { return '"No result matching your query"'}
dv.paragraph(debug)

@ -101,7 +101,7 @@ Paris, Zürich, London
&emsp; &emsp;
- [ ] :gift: stay at Le Manoir, Oxfordshire - [ ] :gift: stay at Le Manoir, Oxfordshire
- [ ] :gift: Mulburry, black top with pearls - [ ] :gift: Mulberry, black top with pearls
- [ ] :gift: Fashion - [ ] :gift: Fashion
- [ ] :gift: French designer - [ ] :gift: French designer
- [ ] :gift: [Mylo bag](https://plantbasednews.org/lifestyle/fashion/stella-mccartney-vegan-leather-bag-mushrooms/) - [ ] :gift: [Mylo bag](https://plantbasednews.org/lifestyle/fashion/stella-mccartney-vegan-leather-bag-mushrooms/)

@ -1,7 +1,11 @@
--- ---
QueryField: Themes QueryTheme: Social
QueryTerm: Alcohol QueryAddedDate: 2021
QueryLanguage:
QueryAuthor:
QueryPublishedD:
QueryReadD:
Alias: ["Reading", "Reading list"] Alias: ["Reading", "Reading list"]
Tag: ["Lifestyle", "LifeHacks", "Book"] Tag: ["Lifestyle", "LifeHacks", "Book"]
Date: 2021-09-25 Date: 2021-09-25
@ -76,16 +80,10 @@ action MetaEdit: Run MetaEdit
id EditMetaData id EditMetaData
``` ```
Current search parameter: `=this.QueryField`
&emsp; &emsp;
```dataview ```dataviewjs
Table without id file.link as "Title", Source.Author as "Author", Source.Published as "Published Date", Source.Language as "Language", Tag as "Themes", Source.Read as "Date read" dv.view("00.01 Admin/dv-views/book_query", {dateadded: dv.current().QueryAddedDate, language: dv.current().QueryLanguage, author: dv.current().QueryAuthor, publicationd: dv.current().QueryPublishedD, theme: dv.current().QueryTheme, readingd: dv.current().QueryReadD})
Where contains(choice(contains(this.QueryField,"Author"), Source.Author, choice(contains(this.QueryField,"Title"),file.link,choice(contains(this.QueryField,"Language"), Source.Language, choice(contains(this.QueryField,"Theme"), Tag, Source.Read)))), this.QueryTerm)
where Source.Type = "Book"
Where !startswith(file.name, "Template")
Sort file.name ascending
``` ```
&emsp; &emsp;
@ -98,12 +96,8 @@ Current search parameter: `=this.QueryField`
&emsp; &emsp;
```dataview ```dataviewjs
Table without id file.link as "Title", Source.Author as "Author", Source.Published as "Published Date", Source.Language as "Language", Tag as "Themes" dv.view("00.01 Admin/dv-views/book_query", {readingd: false})
Where Source.Read < date(today) - dur(100 years)
where Source.Type = "Book"
Where !startswith(file.name, "Template")
Sort file.name ascending
``` ```
&emsp; &emsp;
@ -115,12 +109,8 @@ Current search parameter: `=this.QueryField`
### Read books ### Read books
&emsp; &emsp;
```dataview ```dataviewjs
Table without id file.link as "Title", Source.Author as "Author", Source.Published as "Published Date", Source.Language as "Language", Tag as "Themes", Source.Read as "Date read" dv.view("00.01 Admin/dv-views/book_query", {readingd: true})
Where Source.Read <= date(today) and Source.Read > date(today) - dur(100 years)
where Source.Type = "Book"
Where !startswith(file.name, "Template")
Sort file.name ascending
``` ```
&emsp; &emsp;
@ -136,12 +126,8 @@ Current search parameter: `=this.QueryField`
#### French literature #### French literature
```dataview ```dataviewjs
Table without id file.link as "Title", Source.Author as "Author", Source.Published as "Published Date", Source.Language as "Language", Tag as "Themes", Source.Read as "Date read" dv.view("00.01 Admin/dv-views/book_query", {language: "FR"})
Where Source.Language = "FR"
where Source.Type = "Book"
Where !startswith(file.name, "Template")
Sort file.name ascending
``` ```
&emsp; &emsp;
@ -152,12 +138,8 @@ Current search parameter: `=this.QueryField`
#### English literature #### English literature
```dataview ```dataviewjs
Table without id file.link as "Title", Source.Author as "Author", Source.Published as "Published Date", Source.Language as "Language", Tag as "Themes", Source.Read as "Date read" dv.view("00.01 Admin/dv-views/book_query", {language: "EN"})
Where Source.Language = "EN"
where Source.Type = "Book"
Where !startswith(file.name, "Template")
Sort file.name ascending
``` ```
&emsp; &emsp;
@ -168,12 +150,8 @@ Current search parameter: `=this.QueryField`
#### International literature #### International literature
```dataview ```dataviewjs
Table without id file.link as "Title", Source.Author as "Author", Source.Published as "Published Date", Source.Language as "Language", Tag as "Themes", Source.Read as "Date read" dv.view("00.01 Admin/dv-views/book_query", {language: "BR"})
Where Source.Language != "FR" AND Source.Language != "EN"
where Source.Type = "Book"
Where !startswith(file.name, "Template")
Sort file.name ascending
``` ```
&emsp; &emsp;
@ -189,12 +167,8 @@ Current search parameter: `=this.QueryField`
#### Novel #### Novel
```dataview ```dataviewjs
Table without id file.link as "Title", Source.Author as "Author", Source.Published as "Published Date", Source.Language as "Language", Tag as "Themes", Source.Read as "Date read" dv.view("00.01 Admin/dv-views/book_query", {theme: "Novel"})
Where contains(Tag,"Novel")
where Source.Type = "Book"
Where !startswith(file.name, "Template")
Sort file.name ascending
``` ```
&emsp; &emsp;
@ -205,12 +179,8 @@ Current search parameter: `=this.QueryField`
#### Essay #### Essay
```dataview ```dataviewjs
Table without id file.link as "Title", Source.Author as "Author", Source.Published as "Published Date", Source.Language as "Language", Tag as "Themes", Source.Read as "Date read" dv.view("00.01 Admin/dv-views/book_query", {theme: "Essay"})
Where contains(Tag,"Essay")
where Source.Type = "Book"
Where !startswith(file.name, "Template")
Sort file.name ascending
``` ```
&emsp; &emsp;
@ -221,12 +191,8 @@ Current search parameter: `=this.QueryField`
#### Biography #### Biography
```dataview ```dataviewjs
Table without id file.link as "Title", Source.Author as "Author", Source.Published as "Published Date", Source.Language as "Language", Tag as "Themes", Source.Read as "Date read" dv.view("00.01 Admin/dv-views/book_query", {theme: "Biography"})
Where contains(Tag,"Biography")
where Source.Type = "Book"
Where !startswith(file.name, "Template")
Sort file.name ascending
``` ```
&emsp; &emsp;

@ -105,12 +105,12 @@ Service name | Available space | Current usage
-----------------|:------------------:|:---------------: -----------------|:------------------:|:---------------:
_**[[iCloud]]**_ | _5G_ | _2G_ _**[[iCloud]]**_ | _5G_ | _2G_
_**[[Nextcloud]]**_ | _32G_ | _16G_ _**[[Nextcloud]]**_ | _32G_ | _16G_
_**[[Sync]]**_ | _2T_ | _79.3G_ _**[[Sync]]**_ | _2T_ | _197.2G_
_**[[SecureSafe]]**_ | _1G_ | _240M_ _**[[SecureSafe]]**_ | _1G_ | _240M_
<mark class="green">Cloud Storage</mark> | Available space | Current usage <mark class="green">Cloud Storage</mark> | Available space | Current usage
-----------------|:------------------:|:---------------: -----------------|:------------------:|:---------------:
_**Total storage**_ | _2.04T_ | _98G_ _**Total storage**_ | _2.04T_ | _215.5G_
^CurrentCloudStorage ^CurrentCloudStorage
&emsp; &emsp;
@ -180,7 +180,8 @@ The following Apps require a manual backup:
- [ ] Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] 🔁 every 3 months on the 1st Friday 📅 2021-10-14 - [ ] Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] 🔁 every 3 months on the 1st Friday 📅 2021-10-14
- [x] Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] 🔁 every 3 months on the 1st Friday 📅 2021-10-03 ✅ 2021-10-13 - [x] Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] 🔁 every 3 months on the 1st Friday 📅 2021-10-03 ✅ 2021-10-13
- [x] Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] 🔁 every 3 months on the 1st Friday ✅ 2021-10-02 - [x] Backup [[Storage and Syncing#Instructions for FV|Folder Vault]] 🔁 every 3 months on the 1st Friday ✅ 2021-10-02
- [ ] [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] 🔁 every 3 months on the 2nd Monday 📅 2021-09-16 - [ ] [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] 🔁 every 3 months on the 2nd Monday 📅 2021-12-01
- [x] [[Storage and Syncing|Storage & Sync]]: Backup Volumes to [[Sync|Sync.com]] 🔁 every 3 months on the 2nd Monday 📅 2021-09-16 ✅ 2021-10-16
- [x] Backup Volumes to [[Sync|Sync.com]] 🔁 every 3 months on the 2nd Monday ✅ 2021-09-15 - [x] Backup Volumes to [[Sync|Sync.com]] 🔁 every 3 months on the 2nd Monday ✅ 2021-09-15
- [ ] [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED 🔁 every 3 months on the 2nd Thursday - [ ] [[Storage and Syncing|Storage & Sync]]: Transfer pictures to ED 🔁 every 3 months on the 2nd Thursday

Loading…
Cancel
Save