parent
90c5e65ed2
commit
66b0d50d6e
@ -0,0 +1,29 @@
|
||||
{
|
||||
"file-explorer": true,
|
||||
"global-search": true,
|
||||
"switcher": true,
|
||||
"graph": true,
|
||||
"backlink": true,
|
||||
"outgoing-link": true,
|
||||
"tag-pane": true,
|
||||
"page-preview": true,
|
||||
"daily-notes": true,
|
||||
"templates": true,
|
||||
"note-composer": true,
|
||||
"command-palette": true,
|
||||
"slash-command": false,
|
||||
"editor-status": true,
|
||||
"starred": false,
|
||||
"markdown-importer": true,
|
||||
"zk-prefixer": false,
|
||||
"random-note": false,
|
||||
"outline": false,
|
||||
"word-count": true,
|
||||
"slides": false,
|
||||
"audio-recorder": true,
|
||||
"workspaces": false,
|
||||
"file-recovery": true,
|
||||
"publish": false,
|
||||
"sync": false,
|
||||
"canvas": true
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "better-word-count",
|
||||
"name": "Better Word Count",
|
||||
"version": "0.9.4",
|
||||
"description": "Counts the words of selected text in the editor.",
|
||||
"author": "Luke Leppan",
|
||||
"authorUrl": "https://lukeleppan.com",
|
||||
"isDesktopOnly": false
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
details.bwc-sb-item-setting {
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
border-radius: 10px;
|
||||
padding: 10px 5px 20px 10px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.bwc-sb-item-setting summary::marker {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
/* .bwc-sb-item-setting summary { */
|
||||
/* margin-bottom: 5px; */
|
||||
/* } */
|
||||
.bwc-sb-item-setting summary span.bwc-sb-buttons {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.bwc-status-bar-settings-title {
|
||||
margin-bottom: 0px;
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -1,10 +1,11 @@
|
||||
{
|
||||
"id": "cmdr",
|
||||
"name": "Commander",
|
||||
"version": "0.4.1",
|
||||
"minAppVersion": "0.16.0",
|
||||
"version": "0.4.9",
|
||||
"minAppVersion": "1.1.0",
|
||||
"description": "Customize your workspace by adding commands everywhere, create Macros and supercharge your mobile toolbar.",
|
||||
"author": "jsmorabito & phibr0",
|
||||
"authorUrl": "https://github.com/phibr0",
|
||||
"fundingUrl": "https://ko-fi.com/phibr0",
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,152 @@
|
||||
/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
if you want to view the source, please visit the github repository of this plugin
|
||||
*/
|
||||
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// main.ts
|
||||
var main_exports = {};
|
||||
__export(main_exports, {
|
||||
default: () => MailBlockPlugin
|
||||
});
|
||||
module.exports = __toCommonJS(main_exports);
|
||||
var import_obsidian = require("obsidian");
|
||||
var MailBlockPlugin = class extends import_obsidian.Plugin {
|
||||
async onload() {
|
||||
console.log("email block loading...");
|
||||
this.registerMarkdownCodeBlockProcessor("email", async (src, el, ctx) => {
|
||||
let parameters = null;
|
||||
try {
|
||||
parameters = this.readParameters(src, ctx);
|
||||
} catch (e) {
|
||||
el.createEl("h3", { text: "Email parameters invalid: \n" + e.message });
|
||||
return;
|
||||
}
|
||||
console.log("Render the Email");
|
||||
try {
|
||||
const rootEl = el.createEl("div", { cls: "email-block" });
|
||||
if (parameters.to !== void 0) {
|
||||
rootEl.createEl("div", { cls: "email-block-info", text: "To:" });
|
||||
rootEl.createEl("div", { cls: "email-block-info-value", text: this.renderAddress(parameters.to) });
|
||||
}
|
||||
if (parameters.cc !== void 0) {
|
||||
rootEl.createEl("div", { cls: "email-block-info", text: "Cc:" });
|
||||
rootEl.createEl("div", { cls: "email-block-info-value", text: this.renderAddress(parameters.cc) });
|
||||
}
|
||||
if (parameters.bcc !== void 0) {
|
||||
rootEl.createEl("div", { cls: "email-block-info", text: "Bcc:" });
|
||||
rootEl.createEl("div", { cls: "email-block-info-value", text: this.renderAddress(parameters.bcc) });
|
||||
}
|
||||
rootEl.createEl("div", { cls: "email-block-info", text: "Subject:" });
|
||||
rootEl.createEl("div", { cls: "email-block-info-value", text: parameters.subject });
|
||||
const bodyContent = rootEl.createEl("div", { cls: "email-block-body" });
|
||||
await this.renderBody(bodyContent, parameters.body, parameters.variables, ctx);
|
||||
const data = "mailto:" + this.encodeToHtml(parameters.to) + "?subject=" + this.encodeToHtml(parameters.subject) + "&cc=" + this.encodeToHtml(parameters.cc) + "&bcc=" + this.encodeToHtml(parameters.bcc) + "&body=" + this.encodeToHtml(bodyContent.innerText);
|
||||
if (parameters.showmailto) {
|
||||
rootEl.createEl("a", { href: data, text: "Mailto" });
|
||||
}
|
||||
} catch (error) {
|
||||
el.createEl("h3", { text: error });
|
||||
}
|
||||
});
|
||||
}
|
||||
readParameters(jsonString, ctx) {
|
||||
if (jsonString.contains("[[") && !jsonString.contains('"[[')) {
|
||||
jsonString = jsonString.replace("[[", '"[[');
|
||||
jsonString = jsonString.replace("]]", ']]"');
|
||||
}
|
||||
const parameters = (0, import_obsidian.parseYaml)(jsonString);
|
||||
parameters.to = this.fixAddress(parameters.to);
|
||||
parameters.cc = this.fixAddress(parameters.cc);
|
||||
parameters.bcc = this.fixAddress(parameters.bcc);
|
||||
if (parameters.subject == void 0) {
|
||||
parameters.subject = "";
|
||||
}
|
||||
if (parameters.showmailto == void 0) {
|
||||
parameters.showmailto = true;
|
||||
}
|
||||
if (parameters.body === void 0) {
|
||||
parameters.body = "";
|
||||
}
|
||||
if (parameters.variables === void 0) {
|
||||
parameters.variables = {};
|
||||
}
|
||||
const sourceFile = this.app.metadataCache.getFirstLinkpathDest(ctx.sourcePath, "");
|
||||
if (sourceFile != null) {
|
||||
const sourceCache = this.app.metadataCache.getFileCache(sourceFile);
|
||||
if (sourceCache != null) {
|
||||
if (sourceCache.frontmatter != void 0) {
|
||||
for (const [key, value] of Object.entries(sourceCache.frontmatter)) {
|
||||
parameters.variables[key] = value.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return parameters;
|
||||
}
|
||||
fixAddress(address) {
|
||||
if (address === void 0) {
|
||||
return void 0;
|
||||
}
|
||||
let fixedAddress = address.replace(/\s/g, "").replace(";", ",");
|
||||
return fixedAddress;
|
||||
}
|
||||
renderAddress(address) {
|
||||
return address.split(",").join(", ");
|
||||
}
|
||||
async renderBody(bodyContentEl, bodyContent, variables, ctx) {
|
||||
if (bodyContent === void 0) {
|
||||
return;
|
||||
}
|
||||
if (bodyContent.startsWith("[[")) {
|
||||
bodyContent = bodyContent.substring(2, bodyContent.length - 2);
|
||||
const mdFile = this.app.metadataCache.getFirstLinkpathDest(bodyContent, ctx.sourcePath);
|
||||
if (mdFile != null) {
|
||||
let mdContent = await this.app.vault.read(mdFile);
|
||||
for (const [variable, value] of Object.entries(variables)) {
|
||||
if (value != void 0) {
|
||||
mdContent = mdContent.replace("{{" + variable + "}}", value);
|
||||
}
|
||||
}
|
||||
await import_obsidian.MarkdownRenderer.renderMarkdown(mdContent, bodyContentEl, mdFile.path, new import_obsidian.Component());
|
||||
}
|
||||
} else {
|
||||
for (const [variable, value] of Object.entries(variables)) {
|
||||
if (value != void 0) {
|
||||
bodyContent = bodyContent == null ? void 0 : bodyContent.replace("{{" + variable + "}}", value);
|
||||
}
|
||||
}
|
||||
let lines = bodyContent.split("\n");
|
||||
lines.forEach((line) => {
|
||||
bodyContentEl.createEl("div", { cls: "email-block-body-line", text: line });
|
||||
});
|
||||
}
|
||||
}
|
||||
encodeToHtml(rawStr) {
|
||||
if (rawStr === void 0) {
|
||||
return "";
|
||||
}
|
||||
let retStr = encodeURIComponent(rawStr);
|
||||
return retStr;
|
||||
}
|
||||
onunload() {
|
||||
console.log("Unloading email plugin...");
|
||||
}
|
||||
};
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "email-block-plugin",
|
||||
"name": "Email code block",
|
||||
"version": "0.3.2",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "This plugin renders an email code block.",
|
||||
"author": "JoLeaf",
|
||||
"authorUrl": "https://github.com/JoLeaf",
|
||||
"fundingUrl": "https://ko-fi.com/joleaf",
|
||||
"isDesktopOnly": false
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/* Styles */
|
||||
|
||||
.email-block {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 8fr;
|
||||
row-gap: 5px;
|
||||
border: 1px solid gray;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.email-block-info {
|
||||
font-style: italic;
|
||||
font-size: 80%;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.email-block-info-value {
|
||||
font-weight: bold;
|
||||
font-size: 90%;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.email-block-body {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: span 2;
|
||||
border-left: 1px gray solid;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.email-block-body-line {
|
||||
|
||||
}
|
||||
|
||||
.email-block-mailto {
|
||||
grid-column-start: 1;
|
||||
grid-column-end: span 2;
|
||||
}
|
||||
|
||||
.email-block-error {
|
||||
color: red !important;
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,46 @@
|
||||
{
|
||||
"websites": [
|
||||
{
|
||||
"name": "Twitter",
|
||||
"color": "#3e9cec",
|
||||
"urlTemplate": "https://farside.link/nitter/{{NAME}}",
|
||||
"labelTemplate": "@{{NAME}}",
|
||||
"doesReverseResolution": false
|
||||
},
|
||||
{
|
||||
"name": "Facebook",
|
||||
"color": "#3b5998",
|
||||
"urlTemplate": "https://www.facebook.com/{{NAME}}",
|
||||
"labelTemplate": "{{NAME}}",
|
||||
"doesReverseResolution": false
|
||||
},
|
||||
{
|
||||
"name": "Instagram",
|
||||
"color": "#dc2477",
|
||||
"urlTemplate": "https://imginn.com/{{NAME}}",
|
||||
"labelTemplate": "@{{NAME}}",
|
||||
"doesReverseResolution": false
|
||||
},
|
||||
{
|
||||
"name": "GitHub",
|
||||
"color": "#0a0c10",
|
||||
"urlTemplate": "https://github.com/{{NAME}}",
|
||||
"labelTemplate": "@{{NAME}}",
|
||||
"doesReverseResolution": false
|
||||
},
|
||||
{
|
||||
"name": "Mail",
|
||||
"color": "#e7e7e7",
|
||||
"urlTemplate": "mailto:{{NAME}}",
|
||||
"labelTemplate": "{{NAME}}",
|
||||
"doesReverseResolution": false
|
||||
},
|
||||
{
|
||||
"name": "Linktree",
|
||||
"color": "#3ea195",
|
||||
"urlTemplate": "https://linktr.ee/{{NAME}}",
|
||||
"labelTemplate": "{{NAME}}",
|
||||
"doesReverseResolution": false
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "obsidian-bulk-rename-plugin",
|
||||
"name": "Bulk Rename",
|
||||
"version": "0.5.2",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Purpose of this plugin rename files based on pattern",
|
||||
"author": "Oleg Lustenko",
|
||||
"authorUrl": "https://obsidian.md",
|
||||
"isDesktopOnly": false
|
||||
}
|
@ -0,0 +1,155 @@
|
||||
.bulk_rename_plugin {
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
.bulk_rename {
|
||||
width: calc(100% - 20px);
|
||||
}
|
||||
|
||||
.bulk_rename_preview {
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 983px) {
|
||||
.bulk_rename_preview {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
.flex-col {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.m-auto {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.bulk_info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.bulk_rename_preview > textarea {
|
||||
height: 360px;
|
||||
}
|
||||
|
||||
.replaceRenderSymbols {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
.setting-item-control.replaceRenderSymbols .bulk_input {
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.setting-item-control .bulk_preview_textarea {
|
||||
min-width: 19em;
|
||||
}
|
||||
|
||||
.bulk_preview_textarea {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.bulk_button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.bulk_preview_header {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.setting-item-control .bulk_input {
|
||||
width: 100%;
|
||||
resize: none;
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
.setting-item-control .bulk_input:first-child {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.bulk_regexp_search {
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
.bulk_toggle {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.bulk_preview_label:first-child {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.bulk_preview_label {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bulk_regexp_container {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.bulk_regexp_control {
|
||||
background: var(--background-modifier-form-field);
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
transition: box-shadow 0.15s ease-in-out, border 0.15s ease-in-out;
|
||||
font-family: inherit;
|
||||
border-radius: var(--input-radius);
|
||||
outline: none;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.bulk_regexp_control:hover,
|
||||
.bulk_regexp_control:focus,
|
||||
.bulk_regexp_control:focus-visible {
|
||||
box-shadow: 0 0 0 2px var(--background-modifier-border-hover);
|
||||
}
|
||||
|
||||
.bulk_regexp_control > input {
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.bulk_regexp,
|
||||
.bulk_regexp_flags {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.bulk_regexp:hover,
|
||||
.bulk_regexp:focus,
|
||||
.bulk_regexp:focus-visible .bulk_regexp_flags:hover,
|
||||
.bulk_regexp_flags:focus,
|
||||
.bulk_regexp_flags:focus-visible {
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.bulk_regexp_flags {
|
||||
caret-color: transparent;
|
||||
max-width: 80px;
|
||||
}
|
||||
|
||||
.bulk_regexp_slash {
|
||||
font-size: 1.5em;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.bulk-flag-selected {
|
||||
background-color: lavender !important;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,10 +1,11 @@
|
||||
{
|
||||
"id": "obsidian-full-calendar",
|
||||
"name": "Full Calendar",
|
||||
"version": "0.9.1",
|
||||
"minAppVersion": "0.12.0",
|
||||
"version": "0.9.5",
|
||||
"minAppVersion": "0.16.3",
|
||||
"description": "Obsidian integration with Full Calendar (fullcalendar.io)",
|
||||
"author": "Davis Haupt",
|
||||
"authorUrl": "https://davi.sh",
|
||||
"isDesktopOnly": false
|
||||
"isDesktopOnly": false,
|
||||
"fundingUrl": "https://ko-fi.com/davish"
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"useForwardLinks": true,
|
||||
"useBackLinks": true,
|
||||
"useTags": true,
|
||||
"skipMOCs": false,
|
||||
"MOCMaxLinks": 30,
|
||||
"enableHighContrast": false,
|
||||
"skipFolders": "",
|
||||
"enableLinks": false,
|
||||
"enableTransclusion": false
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -1,10 +0,0 @@
|
||||
{
|
||||
"id": "obsidian-journey-plugin",
|
||||
"name": "Journey",
|
||||
"version": "0.0.7",
|
||||
"minAppVersion": "0.10.10",
|
||||
"description": "Discover the stories between your notes.",
|
||||
"author": "Alexis Rondeau",
|
||||
"authorUrl": "https://publish.obsidian.md/alexisrondeau",
|
||||
"isDesktopOnly": false
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
.journey-search-form select, .journey-search-form input[type=text], .journey-input-button {
|
||||
width: 100%;
|
||||
height: 50px !important;
|
||||
font-size: 24px;
|
||||
padding: 5px;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.show-me {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.hide-me {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.journey-search-form .journey-search-autocomplete-results-container {
|
||||
position: relative;
|
||||
height: 0px;
|
||||
top: -20px;
|
||||
width: 730px;
|
||||
min-width: 730px;
|
||||
max-width: 730px;
|
||||
}
|
||||
|
||||
.journey-search-autocomplete-results-container .journey-search-autocomplete-results-content {
|
||||
background-color: #222;
|
||||
}
|
||||
|
||||
.journey-search-autocomplete-results-content-item {
|
||||
font-size: 24px;
|
||||
color: white;
|
||||
border-bottom: 1px solid #000000;
|
||||
padding: 10px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.journey-input-button {
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/** Search Results */
|
||||
|
||||
.journey-result-list .journey-result-list-item-note,
|
||||
.journey-result-list .journey-result-list-item-start,
|
||||
.journey-result-list .journey-result-list-item-end,
|
||||
.journey-result-list .journey-result-list-item-tag {
|
||||
font-size: 24px;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #555;
|
||||
border: 5px solid #777;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
.journey-result-list .journey-result-list-item-start {
|
||||
background-color: darkgreen;
|
||||
border: 3px solid forestgreen;
|
||||
}
|
||||
|
||||
.journey-result-list .journey-result-list-item-end {
|
||||
background-color: darkgreen;
|
||||
border: 3px solid forestgreen;
|
||||
}
|
||||
|
||||
.journey-result-list .journey-result-list-item-tag {
|
||||
background-color: darkblue;
|
||||
border: 3px solid royalblue;
|
||||
}
|
||||
|
||||
.journey-result-list-high-contrast .journey-result-list-item-note,
|
||||
.journey-result-list-high-contrast .journey-result-list-item-start,
|
||||
.journey-result-list-high-contrast .journey-result-list-item-end,
|
||||
.journey-result-list-high-contrast .journey-result-list-item-tag {
|
||||
font-size: 24px;
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #000;
|
||||
color: white;
|
||||
border: 5px solid #333;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
|
||||
.journey-result-list-reset-link {
|
||||
text-align: center;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.discovery-settings {
|
||||
font-size: 9px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.journey-search-lucky {
|
||||
text-align: center;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.moc-max-links-counter {
|
||||
text-align: right;
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,13 @@
|
||||
{
|
||||
"location": "Zürich",
|
||||
"key": "3fc1914d4808eb2920b4ea1ba9137423",
|
||||
"units": "metric",
|
||||
"excludeFolder": "",
|
||||
"weatherFormat1": "%desc% • Current Temp: %temp%°C • Feels Like: %feels%°C\n",
|
||||
"weatherFormat2": "%name%: %dateMonth4% %dateDay2% - %timeH2%:%timeM% %ampm1%\nCurrent Temp: %temp%°C • Feels Like: %feels%°C\nWind: %wind-speed% Km/h from the %wind-dir%^ with gusts up to %wind-gust% Km/h^\nSunrise: %sunrise% • Sunset: %sunset%\n",
|
||||
"weatherFormat3": "%icon% %dateDay2% %dateMonth4% %dateYear1% 🔹 %timeH2%:%timeM% %ampm1% 🔹 %desc%<br> Recorded Temp: %temp% 🔹 Felt like: %feels%<br> Wind: %wind-speed% Km/h from the %wind-dir%^ with gusts up to %wind-gust% Km/h^<br> Sunrise: %sunrise% 🔹 Sunset: %sunset%",
|
||||
"weatherFormat4": "%icon% %dateMonth4% %dateDay2% %dateYear1% • %timeH2%:%timeM% %ampm1% • %desc%<br> Current Temp: %temp% • Feels like: %feels%<br> Wind: %wind-speed% Km/h from the %wind-dir%^ with gusts up to %wind-gust% Km/h^<br> Sunrise: %sunrise% • Sunset: %sunset%",
|
||||
"statusbarActive": false,
|
||||
"weatherFormatSB": " | %desc% | Current Temp: %temp%°C | Feels Like: %feels%°C | ",
|
||||
"statusbarUpdateFreq": "15"
|
||||
}
|
@ -0,0 +1,658 @@
|
||||
/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
if you want to view the source, please visit the github repository of this plugin
|
||||
*/
|
||||
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// main.ts
|
||||
var main_exports = {};
|
||||
__export(main_exports, {
|
||||
default: () => OpenWeather
|
||||
});
|
||||
module.exports = __toCommonJS(main_exports);
|
||||
var import_obsidian = require("obsidian");
|
||||
var displayErrorMsg = true;
|
||||
var DEFAULT_SETTINGS = {
|
||||
location: "",
|
||||
key: "",
|
||||
units: "metric",
|
||||
excludeFolder: "",
|
||||
weatherFormat1: "%desc% \u2022 Current Temp: %temp%\xB0C \u2022 Feels Like: %feels%\xB0C\n",
|
||||
weatherFormat2: "%name%: %dateMonth4% %dateDay2% - %timeH2%:%timeM% %ampm1%\nCurrent Temp: %temp%\xB0C \u2022 Feels Like: %feels%\xB0C\nWind: %wind-speed% Km/h from the %wind-dir%^ with gusts up to %wind-gust% Km/h^\nSunrise: %sunrise% \u2022 Sunset: %sunset%\n",
|
||||
weatherFormat3: "%icon% %dateMonth4% %dateDay2% %dateYear1% \u2022 %timeH2%:%timeM% %ampm1% \u2022 %desc%<br> Recorded Temp: %temp% \u2022 Felt like: %feels%<br> Wind: %wind-speed% Km/h from the %wind-dir%^ with gusts up to %wind-gust% Km/h^<br> Sunrise: %sunrise% \u2022 Sunset: %sunset%",
|
||||
weatherFormat4: "%icon% %dateMonth4% %dateDay2% %dateYear1% \u2022 %timeH2%:%timeM% %ampm1% \u2022 %desc%<br> Current Temp: %temp% \u2022 Feels like: %feels%<br> Wind: %wind-speed% Km/h from the %wind-dir%^ with gusts up to %wind-gust% Km/h^<br> Sunrise: %sunrise% \u2022 Sunset: %sunset%",
|
||||
statusbarActive: true,
|
||||
weatherFormatSB: " | %desc% | Current Temp: %temp%\xB0C | Feels Like: %feels%\xB0C | ",
|
||||
statusbarUpdateFreq: "15"
|
||||
};
|
||||
var FormatWeather = class {
|
||||
constructor(location, key, units, format) {
|
||||
this.location = location;
|
||||
this.key = key;
|
||||
this.units = units;
|
||||
this.format = format;
|
||||
}
|
||||
async getWeather() {
|
||||
let weatherData;
|
||||
let weatherString;
|
||||
let url = `https://api.openweathermap.org/data/2.5/weather?q=${this.location}&appid=${this.key}&units=${this.units}`;
|
||||
let req = await fetch(url);
|
||||
let json = await req.json();
|
||||
let conditions = json.weather[0].description;
|
||||
conditions = conditions.replace(/^\w|\s\w/g, (c2) => c2.toUpperCase());
|
||||
let iconName = json.weather[0].icon;
|
||||
const iconApi = await fetch("http://openweathermap.org/img/w/" + iconName + ".png");
|
||||
let iconUrl = iconApi.url;
|
||||
let temp = json.main.temp;
|
||||
temp = Math.round(temp);
|
||||
let feelsLike = json.main.feels_like;
|
||||
feelsLike = Math.round(feelsLike);
|
||||
let tempMin = json.main.temp_min;
|
||||
tempMin = Math.round(tempMin);
|
||||
let tempMax = json.main.temp_max;
|
||||
tempMax = Math.round(tempMax);
|
||||
let pressure = json.main.pressure;
|
||||
let humidity = json.main.humidity;
|
||||
let seaLevel = json.main.sea_level;
|
||||
let groundLevel = json.main.grnd_level;
|
||||
let visibility = json.visibility;
|
||||
let windSpeed = json.wind.speed;
|
||||
if (this.units == "metric") {
|
||||
windSpeed = Math.round(windSpeed * 3.6);
|
||||
} else {
|
||||
windSpeed = Math.round(windSpeed);
|
||||
}
|
||||
let windDirection = json.wind.deg;
|
||||
windDirection = this.getCardinalDirection(windDirection);
|
||||
let windGust = json.wind.gust;
|
||||
if (windGust != void 0) {
|
||||
if (this.units == "metric") {
|
||||
windGust = Math.round(windGust * 3.6);
|
||||
} else {
|
||||
windGust = Math.round(windGust);
|
||||
}
|
||||
} else {
|
||||
windGust = "N/A";
|
||||
}
|
||||
let dt = json.dt;
|
||||
let a = new Date(dt * 1e3);
|
||||
const months1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
|
||||
const months2 = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
|
||||
const months3 = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
const months4 = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
||||
let year1 = a.getFullYear();
|
||||
let year2str = String(year1).slice(-2);
|
||||
let year2 = Number(year2str);
|
||||
let month1 = months1[a.getMonth()];
|
||||
let month2 = months2[a.getMonth()];
|
||||
let month3 = months3[a.getMonth()];
|
||||
let month4 = months4[a.getMonth()];
|
||||
let date1 = a.getDate();
|
||||
let date2 = a.getDate() < 10 ? "0" + a.getDate() : a.getDate();
|
||||
let ampm1 = "AM";
|
||||
let ampm2 = "am";
|
||||
if (a.getHours() > 11) {
|
||||
ampm1 = "PM";
|
||||
ampm2 = "pm";
|
||||
}
|
||||
let hour1 = a.getHours();
|
||||
let hour2 = a.getHours();
|
||||
if (a.getHours() > 12) {
|
||||
hour2 = a.getHours() - 12;
|
||||
}
|
||||
if (a.getHours() == 0) {
|
||||
hour1 = 12;
|
||||
hour2 = 12;
|
||||
}
|
||||
let min = a.getMinutes() < 10 ? "0" + a.getMinutes() : a.getMinutes();
|
||||
let sec = a.getSeconds() < 10 ? "0" + a.getSeconds() : a.getSeconds();
|
||||
let sr = json.sys.sunrise;
|
||||
let b = new Date(sr * 1e3);
|
||||
let srhour = b.getHours() < 10 ? "0" + b.getHours() : b.getHours();
|
||||
let srmin = b.getMinutes() < 10 ? "0" + b.getMinutes() : b.getMinutes();
|
||||
let srsec = b.getSeconds() < 10 ? "0" + b.getSeconds() : b.getSeconds();
|
||||
let sunrise = srhour + ":" + srmin + ":" + srsec;
|
||||
let ss = json.sys.sunset;
|
||||
let c = new Date(ss * 1e3);
|
||||
let sshour = c.getHours() < 10 ? "0" + c.getHours() : c.getHours();
|
||||
let ssmin = c.getMinutes() < 10 ? "0" + c.getMinutes() : c.getMinutes();
|
||||
let sssec = c.getSeconds() < 10 ? "0" + c.getSeconds() : c.getSeconds();
|
||||
let sunset = sshour + ":" + ssmin + ":" + sssec;
|
||||
let name = json.name;
|
||||
weatherData = {
|
||||
"status": "ok",
|
||||
"conditions": conditions,
|
||||
"icon": iconUrl,
|
||||
"temp": temp,
|
||||
"feelsLike": feelsLike,
|
||||
"tempMin": tempMin,
|
||||
"tempMax": tempMax,
|
||||
"pressure": pressure,
|
||||
"humidity": humidity,
|
||||
"seaLevel": seaLevel,
|
||||
"groundLevel": groundLevel,
|
||||
"visibility": visibility,
|
||||
"windSpeed": windSpeed,
|
||||
"windDirection": windDirection,
|
||||
"windGust": windGust,
|
||||
"year1": year1,
|
||||
"year2": year2,
|
||||
"month1": month1,
|
||||
"month2": month2,
|
||||
"month3": month3,
|
||||
"month4": month4,
|
||||
"date1": date1,
|
||||
"date2": date2,
|
||||
"ampm1": ampm1,
|
||||
"ampm2": ampm2,
|
||||
"hour1": hour1,
|
||||
"hour2": hour2,
|
||||
"min": min,
|
||||
"sec": sec,
|
||||
"sunrise": sunrise,
|
||||
"sunset": sunset,
|
||||
"name": name
|
||||
};
|
||||
weatherString = this.format.replace(/%desc%/g, weatherData.conditions);
|
||||
weatherString = weatherString.replace(/%icon%/g, `<img src=${weatherData.icon} />`);
|
||||
weatherString = weatherString.replace(/%temp%/g, weatherData.temp);
|
||||
weatherString = weatherString.replace(/%feels%/g, weatherData.feelsLike);
|
||||
weatherString = weatherString.replace(/%tempmin%/g, weatherData.tempMin);
|
||||
weatherString = weatherString.replace(/%tempmax%/g, weatherData.tempMax);
|
||||
weatherString = weatherString.replace(/%pressure%/g, weatherData.pressure);
|
||||
weatherString = weatherString.replace(/%humidity%/g, weatherData.humidity);
|
||||
weatherString = weatherString.replace(/%pressure-sl%/g, weatherData.seaLevel);
|
||||
weatherString = weatherString.replace(/%pressure-gl%/g, weatherData.groundLevel);
|
||||
weatherString = weatherString.replace(/%visibility%/g, weatherData.visibility);
|
||||
weatherString = weatherString.replace(/%wind-speed%/g, weatherData.windSpeed);
|
||||
weatherString = weatherString.replace(/%wind-dir%/g, weatherData.windDirection);
|
||||
if (weatherData.windGust == "N/A") {
|
||||
weatherString = weatherString.replace(/\^.+\^/g, "");
|
||||
} else {
|
||||
weatherString = weatherString.replace(/%wind-gust%/g, weatherData.windGust);
|
||||
weatherString = weatherString.replace(/\^(.+)\^/g, "$1");
|
||||
}
|
||||
weatherString = weatherString.replace(/%dateYear1%/g, `${weatherData.year1}`);
|
||||
weatherString = weatherString.replace(/%dateYear2%/g, `${weatherData.year2}`);
|
||||
weatherString = weatherString.replace(/%dateMonth1%/g, `${weatherData.month1}`);
|
||||
weatherString = weatherString.replace(/%dateMonth2%/g, `${weatherData.month2}`);
|
||||
weatherString = weatherString.replace(/%dateMonth3%/g, `${weatherData.month3}`);
|
||||
weatherString = weatherString.replace(/%dateMonth4%/g, `${weatherData.month4}`);
|
||||
weatherString = weatherString.replace(/%dateDay1%/g, `${weatherData.date1}`);
|
||||
weatherString = weatherString.replace(/%dateDay2%/g, `${weatherData.date2}`);
|
||||
weatherString = weatherString.replace(/%ampm1%/g, `${weatherData.ampm1}`);
|
||||
weatherString = weatherString.replace(/%ampm2%/g, `${weatherData.ampm2}`);
|
||||
weatherString = weatherString.replace(/%timeH1%/g, `${weatherData.hour1}`);
|
||||
weatherString = weatherString.replace(/%timeH2%/g, `${weatherData.hour2}`);
|
||||
weatherString = weatherString.replace(/%timeM%/g, `${weatherData.min}`);
|
||||
weatherString = weatherString.replace(/%timeS%/g, `${weatherData.sec}`);
|
||||
weatherString = weatherString.replace(/%sunrise%/g, `${weatherData.sunrise}`);
|
||||
weatherString = weatherString.replace(/%sunset%/g, `${weatherData.sunset}`);
|
||||
weatherString = weatherString.replace(/%name%/g, `${weatherData.name}`);
|
||||
return weatherString;
|
||||
}
|
||||
async getWeatherString() {
|
||||
let weatherString = await this.getWeather();
|
||||
return weatherString;
|
||||
}
|
||||
getCardinalDirection(angle) {
|
||||
const directions = ["North", "Northeast", "East", "Southeast", "South", "Southwest", "West", "Northwest"];
|
||||
return directions[Math.round(angle / 45) % 8];
|
||||
}
|
||||
};
|
||||
var OpenWeather = class extends import_obsidian.Plugin {
|
||||
async onload() {
|
||||
await this.loadSettings();
|
||||
this.addRibbonIcon("thermometer-snowflake", "OpenWeather", (evt) => {
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian.MarkdownView);
|
||||
if (!view) {
|
||||
new import_obsidian.Notice("Open a Markdown file first.");
|
||||
return;
|
||||
}
|
||||
if (view.getViewType() === "markdown") {
|
||||
const md = view;
|
||||
if (md.getMode() === "source") {
|
||||
new InsertWeatherPicker(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat1, this.settings.weatherFormat2, this.settings.weatherFormat3, this.settings.weatherFormat4).open();
|
||||
} else {
|
||||
new import_obsidian.Notice("Markdown file must be in source mode to insert weather string.");
|
||||
}
|
||||
} else {
|
||||
new import_obsidian.Notice("Open a Markdown file first.");
|
||||
}
|
||||
});
|
||||
this.statusBar = this.addStatusBarItem();
|
||||
if (this.settings.statusbarActive) {
|
||||
if (this.settings.key.length == 0 || this.settings.location.length == 0) {
|
||||
if (displayErrorMsg) {
|
||||
new import_obsidian.Notice("OpenWeather plugin settings are undefined, check your settings.", 8e3);
|
||||
this.statusBar.setText("");
|
||||
console.log("Err:", displayErrorMsg);
|
||||
displayErrorMsg = false;
|
||||
}
|
||||
} else {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormatSB);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
this.statusBar.setText(weatherStr);
|
||||
}
|
||||
} else {
|
||||
this.statusBar.setText("");
|
||||
}
|
||||
this.addCommand({
|
||||
id: "replace-template-string",
|
||||
name: "Replace template strings",
|
||||
editorCallback: async (editor, view) => {
|
||||
if (this.settings.weatherFormat1.length > 0) {
|
||||
if (view.data.contains("%weather1%")) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat1);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
let doc = editor.getValue().replace(/%weather1%/gmi, weatherStr);
|
||||
editor.setValue(doc);
|
||||
}
|
||||
}
|
||||
if (this.settings.weatherFormat2.length > 0) {
|
||||
if (view.data.contains("%weather2%")) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat2);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
let doc = editor.getValue().replace(/%weather2%/gmi, weatherStr);
|
||||
editor.setValue(doc);
|
||||
}
|
||||
}
|
||||
if (this.settings.weatherFormat3.length > 0) {
|
||||
if (view.data.contains("%weather3%")) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat3);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
let doc = editor.getValue().replace(/%weather3%/gmi, weatherStr);
|
||||
editor.setValue(doc);
|
||||
}
|
||||
}
|
||||
if (this.settings.weatherFormat4.length > 0) {
|
||||
if (view.data.contains("%weather4%")) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat4);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
let doc = editor.getValue().replace(/%weather4%/gmi, weatherStr);
|
||||
editor.setValue(doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.addCommand({
|
||||
id: "insert-format-one",
|
||||
name: "Insert weather format one",
|
||||
editorCallback: async (editor, view) => {
|
||||
if (this.settings.weatherFormat1.length > 0) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat1);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
editor.replaceSelection(`${weatherStr}`);
|
||||
} else {
|
||||
new import_obsidian.Notice("Weather string 1 is undefined! Please add a definition for it in the OpenWeather plugin settings.", 5e3);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.addCommand({
|
||||
id: "insert-format-two",
|
||||
name: "Insert weather format two",
|
||||
editorCallback: async (editor, view) => {
|
||||
if (this.settings.weatherFormat2.length > 0) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat2);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
editor.replaceSelection(`${weatherStr}`);
|
||||
} else {
|
||||
new import_obsidian.Notice("Weather string 2 is undefined! Please add a definition for it in the OpenWeather plugin settings.", 5e3);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.addCommand({
|
||||
id: "insert-format-three",
|
||||
name: "Insert weather format three",
|
||||
editorCallback: async (editor, view) => {
|
||||
if (this.settings.weatherFormat3.length > 0) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat3);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
editor.replaceSelection(`${weatherStr}`);
|
||||
} else {
|
||||
new import_obsidian.Notice("Weather string 3 is undefined! Please add a definition for it in the OpenWeather plugin settings.", 5e3);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.addCommand({
|
||||
id: "insert-format-four",
|
||||
name: "Insert weather format four",
|
||||
editorCallback: async (editor, view) => {
|
||||
if (this.settings.weatherFormat4.length > 0) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat4);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
editor.replaceSelection(`${weatherStr}`);
|
||||
} else {
|
||||
new import_obsidian.Notice("Weather string 4 is undefined! Please add a definition for it in the OpenWeather plugin settings.", 5e3);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.addSettingTab(new OpenWeatherSettingsTab(this.app, this));
|
||||
this.registerEvent(this.app.workspace.on("file-open", async (file) => {
|
||||
if (file) {
|
||||
await new Promise((r) => setTimeout(r, 2e3));
|
||||
await this.replaceTemplateStrings();
|
||||
await this.updateCurrentWeatherDiv();
|
||||
}
|
||||
}));
|
||||
this.registerEvent(this.app.metadataCache.on("resolved", async () => {
|
||||
await this.replaceTemplateStrings();
|
||||
await this.updateCurrentWeatherDiv();
|
||||
}));
|
||||
let updateFreq = this.settings.statusbarUpdateFreq;
|
||||
this.registerInterval(window.setInterval(() => this.updateWeather(), Number(updateFreq) * 60 * 1e3));
|
||||
this.registerInterval(window.setInterval(() => this.updateCurrentWeatherDiv(), Number(updateFreq) * 60 * 1e3));
|
||||
}
|
||||
async updateCurrentWeatherDiv() {
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian.MarkdownView);
|
||||
if (!view)
|
||||
return;
|
||||
if (document.getElementsByClassName("weather_current_1").length === 1) {
|
||||
const divEl = document.getElementsByClassName("weather_current_1")[0];
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat1);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
divEl.innerHTML = weatherStr;
|
||||
}
|
||||
if (document.getElementsByClassName("weather_current_2").length === 1) {
|
||||
const divEl = document.getElementsByClassName("weather_current_2")[0];
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat2);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
divEl.innerHTML = weatherStr;
|
||||
}
|
||||
if (document.getElementsByClassName("weather_current_3").length === 1) {
|
||||
const divEl = document.getElementsByClassName("weather_current_3")[0];
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat3);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
divEl.innerHTML = weatherStr;
|
||||
}
|
||||
if (document.getElementsByClassName("weather_current_4").length === 1) {
|
||||
const divEl = document.getElementsByClassName("weather_current_4")[0];
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat4);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
divEl.innerHTML = weatherStr;
|
||||
}
|
||||
}
|
||||
async replaceTemplateStrings() {
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian.MarkdownView);
|
||||
if (!view)
|
||||
return;
|
||||
const file = app.workspace.getActiveFile();
|
||||
if (view.file.parent.path === this.settings.excludeFolder)
|
||||
return;
|
||||
let editor = view.getViewData();
|
||||
if (editor == null)
|
||||
return;
|
||||
if (this.settings.weatherFormat1.length > 0) {
|
||||
if (editor.contains("%weather1%")) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat1);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
editor = editor.replace(/%weather1%/gmi, weatherStr);
|
||||
file == null ? void 0 : file.vault.modify(file, editor);
|
||||
}
|
||||
}
|
||||
if (this.settings.weatherFormat2.length > 0) {
|
||||
if (editor.contains("%weather2%")) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat2);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
editor = editor.replace(/%weather2%/gmi, weatherStr);
|
||||
file == null ? void 0 : file.vault.modify(file, editor);
|
||||
}
|
||||
}
|
||||
if (this.settings.weatherFormat3.length > 0) {
|
||||
if (editor.contains("%weather3%")) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat3);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
editor = editor.replace(/%weather3%/gmi, weatherStr);
|
||||
file == null ? void 0 : file.vault.modify(file, editor);
|
||||
}
|
||||
}
|
||||
if (this.settings.weatherFormat4.length > 0) {
|
||||
if (editor.contains("%weather4%")) {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormat4);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
editor = editor.replace(/%weather4%/gmi, weatherStr);
|
||||
file == null ? void 0 : file.vault.modify(file, editor);
|
||||
}
|
||||
}
|
||||
}
|
||||
async updateWeather() {
|
||||
if (this.settings.statusbarActive) {
|
||||
if (this.settings.key.length == 0 || this.settings.location.length == 0) {
|
||||
if (displayErrorMsg) {
|
||||
new import_obsidian.Notice("OpenWeather plugin settings are undefined, check your settings.");
|
||||
this.statusBar.setText("");
|
||||
displayErrorMsg = false;
|
||||
}
|
||||
} else {
|
||||
let wstr = new FormatWeather(this.settings.location, this.settings.key, this.settings.units, this.settings.weatherFormatSB);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
this.statusBar.setText(weatherStr);
|
||||
}
|
||||
} else {
|
||||
this.statusBar.setText("");
|
||||
}
|
||||
}
|
||||
onunload() {
|
||||
}
|
||||
async loadSettings() {
|
||||
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
|
||||
}
|
||||
async saveSettings() {
|
||||
await this.saveData(this.settings);
|
||||
}
|
||||
};
|
||||
var ALL_COMMANDS = [];
|
||||
var InsertWeatherPicker = class extends import_obsidian.SuggestModal {
|
||||
constructor(location, key, units, weatherFormat1, weatherFormat2, weatherFormat3, weatherFormat4) {
|
||||
super(app);
|
||||
this.location = location;
|
||||
this.key = key;
|
||||
this.units = units;
|
||||
this.weatherFormat1 = weatherFormat1;
|
||||
this.weatherFormat2 = weatherFormat2;
|
||||
this.weatherFormat3 = weatherFormat3;
|
||||
this.weatherFormat4 = weatherFormat4;
|
||||
}
|
||||
async getSuggestions(query) {
|
||||
ALL_COMMANDS = [];
|
||||
if (this.weatherFormat1.length > 0) {
|
||||
let wstr = new FormatWeather(this.location, this.key, this.units, this.weatherFormat1);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
this.weatherFormat1 = weatherStr;
|
||||
ALL_COMMANDS.push({ command: "Insert Weather String - Format 1", format: this.weatherFormat1 });
|
||||
}
|
||||
if (this.weatherFormat2.length > 0) {
|
||||
let wstr = new FormatWeather(this.location, this.key, this.units, this.weatherFormat2);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
this.weatherFormat2 = weatherStr;
|
||||
ALL_COMMANDS.push({ command: "Insert Weather String - Format 2", format: this.weatherFormat2 });
|
||||
}
|
||||
if (this.weatherFormat3.length > 0) {
|
||||
let wstr = new FormatWeather(this.location, this.key, this.units, this.weatherFormat3);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
this.weatherFormat3 = weatherStr;
|
||||
ALL_COMMANDS.push({ command: "Insert Weather String - Format 3", format: this.weatherFormat3 });
|
||||
}
|
||||
if (this.weatherFormat4.length > 0) {
|
||||
let wstr = new FormatWeather(this.location, this.key, this.units, this.weatherFormat4);
|
||||
let weatherStr = await wstr.getWeatherString();
|
||||
this.weatherFormat4 = weatherStr;
|
||||
ALL_COMMANDS.push({ command: "Insert Weather String - Format 4", format: this.weatherFormat4 });
|
||||
}
|
||||
ALL_COMMANDS.push({ command: "Replace Template Strings", format: "Replace all occurences of %weather1%, %weather2%, %weather3% and %weather4%\nin the current document." });
|
||||
return ALL_COMMANDS.filter((command) => command.command.toLowerCase().includes(query.toLowerCase()));
|
||||
}
|
||||
renderSuggestion(command, el) {
|
||||
el.createEl("div", { text: command.command });
|
||||
el.createEl("small", { text: command.format });
|
||||
}
|
||||
async onChooseSuggestion(command, evt) {
|
||||
this.command = command.command;
|
||||
this.format = command.format;
|
||||
this.close();
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian.MarkdownView);
|
||||
if (!view)
|
||||
return;
|
||||
if (view.file.parent.path === "Templates")
|
||||
return;
|
||||
let editor = view.getViewData();
|
||||
if (editor == null)
|
||||
return;
|
||||
if (command.command == "Replace Template Strings") {
|
||||
if (this.weatherFormat1.length > 0) {
|
||||
editor = editor.replace(/%weather1%/gmi, this.weatherFormat1);
|
||||
view.setViewData(editor, false);
|
||||
}
|
||||
if (this.weatherFormat2.length > 0) {
|
||||
editor = editor.replace(/%weather2%/gmi, this.weatherFormat2);
|
||||
view.setViewData(editor, false);
|
||||
}
|
||||
if (this.weatherFormat3.length > 0) {
|
||||
editor = editor.replace(/%weather3%/gmi, this.weatherFormat3);
|
||||
view.setViewData(editor, false);
|
||||
}
|
||||
if (this.weatherFormat4.length > 0) {
|
||||
editor = editor.replace(/%weather4%/gmi, this.weatherFormat4);
|
||||
view.setViewData(editor, false);
|
||||
}
|
||||
} else {
|
||||
view.editor.replaceSelection(this.format);
|
||||
}
|
||||
}
|
||||
};
|
||||
var OpenWeatherSettingsTab = class extends import_obsidian.PluginSettingTab {
|
||||
constructor(app2, plugin) {
|
||||
super(app2, plugin);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
display() {
|
||||
const { containerEl } = this;
|
||||
containerEl.empty();
|
||||
const abstractFiles = app.vault.getAllLoadedFiles();
|
||||
const folders = [];
|
||||
abstractFiles.forEach((folder) => {
|
||||
if (folder instanceof import_obsidian.TFolder && folder.name.length > 0) {
|
||||
folders.push(folder);
|
||||
}
|
||||
});
|
||||
containerEl.createEl("h2", { text: "Settings for calling OpenWeather API" });
|
||||
new import_obsidian.Setting(containerEl).setName("Enter Location").setDesc("Name of the city you want to retrieve weather for").addText((text) => text.setPlaceholder("Enter city Eg. edmonton").setValue(this.plugin.settings.location).onChange(async (value) => {
|
||||
this.plugin.settings.location = value;
|
||||
await this.plugin.saveSettings();
|
||||
await this.plugin.updateWeather();
|
||||
}));
|
||||
new import_obsidian.Setting(containerEl).setName("OpenWeather API Key").setDesc("A free OpenWeather API key is required for the plugin to work. Go to https://openweathermap.org to register and get a key").addText((text) => text.setPlaceholder("Enter OpenWeather API Key").setValue(this.plugin.settings.key).onChange(async (value) => {
|
||||
this.plugin.settings.key = value;
|
||||
await this.plugin.saveSettings();
|
||||
await this.plugin.updateWeather();
|
||||
}));
|
||||
new import_obsidian.Setting(containerEl).setName("Units of Measurement").setDesc("Units of measurement. Standard, Metric and Imperial units are available").addDropdown((dropDown) => {
|
||||
dropDown.addOption("standard", "Standard");
|
||||
dropDown.addOption("metric", "Metric");
|
||||
dropDown.addOption("imperial", "Imperial");
|
||||
dropDown.onChange(async (value) => {
|
||||
this.plugin.settings.units = value;
|
||||
await this.plugin.saveSettings();
|
||||
await this.plugin.updateWeather();
|
||||
}).setValue(this.plugin.settings.units);
|
||||
});
|
||||
containerEl.createEl("br");
|
||||
containerEl.createEl("h2", { text: "Folder to Exclude From Automatic Template Strings Replacement" });
|
||||
new import_obsidian.Setting(containerEl).setName("Exclude Folder").setDesc("Folder to Exclude from Automatic Template String Replacement").addDropdown((dropDown) => {
|
||||
folders.forEach((e) => {
|
||||
dropDown.addOption(e.name, e.name);
|
||||
});
|
||||
dropDown.onChange(async (value) => {
|
||||
this.plugin.settings.excludeFolder = value;
|
||||
await this.plugin.saveSettings();
|
||||
}).setValue(this.plugin.settings.excludeFolder);
|
||||
});
|
||||
containerEl.createEl("br");
|
||||
containerEl.createEl("h2", { text: "Weather Strings Formatting (Up to 4 Strings are Available)" });
|
||||
new import_obsidian.Setting(containerEl).setName("Weather String Format 1").setDesc("Weather string format one").addTextArea((textArea) => {
|
||||
textArea.setPlaceholder("Weather String Format 1").setValue(this.plugin.settings.weatherFormat1).onChange(async (value) => {
|
||||
this.plugin.settings.weatherFormat1 = value;
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
textArea.inputEl.setAttr("rows", 10);
|
||||
textArea.inputEl.setAttr("cols", 60);
|
||||
});
|
||||
new import_obsidian.Setting(containerEl).setName("Weather String Format 2").setDesc("Weather string format two").addTextArea((textArea) => {
|
||||
textArea.setPlaceholder("Weather String Format 2").setValue(this.plugin.settings.weatherFormat2).onChange(async (value) => {
|
||||
this.plugin.settings.weatherFormat2 = value;
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
textArea.inputEl.setAttr("rows", 10);
|
||||
textArea.inputEl.setAttr("cols", 60);
|
||||
});
|
||||
new import_obsidian.Setting(containerEl).setName("Weather String Format 3").setDesc("Weather string format three").addTextArea((textArea) => {
|
||||
textArea.setPlaceholder("Weather String Format 3").setValue(this.plugin.settings.weatherFormat3).onChange(async (value) => {
|
||||
this.plugin.settings.weatherFormat3 = value;
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
textArea.inputEl.setAttr("rows", 10);
|
||||
textArea.inputEl.setAttr("cols", 60);
|
||||
});
|
||||
new import_obsidian.Setting(containerEl).setName("Weather String Format 4").setDesc("Weather string format four").addTextArea((textArea) => {
|
||||
textArea.setPlaceholder("Weather String Format 4").setValue(this.plugin.settings.weatherFormat4).onChange(async (value) => {
|
||||
this.plugin.settings.weatherFormat4 = value;
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
textArea.inputEl.setAttr("rows", 10);
|
||||
textArea.inputEl.setAttr("cols", 60);
|
||||
});
|
||||
if (import_obsidian.Platform.isDesktop) {
|
||||
containerEl.createEl("br");
|
||||
containerEl.createEl("h2", { text: "Show Weather in Statusbar Options" });
|
||||
new import_obsidian.Setting(containerEl).setName("Show Weather in Statusbar").setDesc("Enable weather display in statusbar").addToggle((toggle) => toggle.setValue(this.plugin.settings.statusbarActive).onChange(async (value) => {
|
||||
this.plugin.settings.statusbarActive = value;
|
||||
await this.plugin.saveSettings();
|
||||
await this.plugin.updateWeather();
|
||||
}));
|
||||
new import_obsidian.Setting(containerEl).setName("Weather String Format Statusbar").setDesc("Weather string format for the statusbar").addTextArea((textArea) => {
|
||||
textArea.setPlaceholder("Statusbar Weather Format").setValue(this.plugin.settings.weatherFormatSB).onChange(async (value) => {
|
||||
this.plugin.settings.weatherFormatSB = value;
|
||||
await this.plugin.saveSettings();
|
||||
await this.plugin.updateWeather();
|
||||
});
|
||||
textArea.inputEl.setAttr("rows", 10);
|
||||
textArea.inputEl.setAttr("cols", 60);
|
||||
});
|
||||
} else {
|
||||
this.plugin.settings.statusbarActive = false;
|
||||
}
|
||||
containerEl.createEl("br");
|
||||
containerEl.createEl("h2", { text: `Show Weather in Statusbar and Dynamic DIV's Delay` });
|
||||
new import_obsidian.Setting(containerEl).setName("Update Frequency").setDesc("Update frequency for weather information displayed on the statusbar and dynamic DIV's").addDropdown((dropDown) => {
|
||||
dropDown.addOption("1", "Every Minute");
|
||||
dropDown.addOption("5", "Every 5 Minutes");
|
||||
dropDown.addOption("10", "Every 10 Minutes");
|
||||
dropDown.addOption("15", "Every 15 Minutes");
|
||||
dropDown.addOption("20", "Every 20 Minutes");
|
||||
dropDown.addOption("30", "Every 30 Minutes");
|
||||
dropDown.addOption("60", "Every Hour");
|
||||
dropDown.onChange(async (value) => {
|
||||
this.plugin.settings.statusbarUpdateFreq = value;
|
||||
await this.plugin.saveSettings();
|
||||
await this.plugin.updateWeather();
|
||||
}).setValue(this.plugin.settings.statusbarUpdateFreq);
|
||||
});
|
||||
}
|
||||
};
|
@ -0,0 +1 @@
|
||||
{"id":"obsidian-open-weather","name":"OpenWeather","version":"1.1.0","minAppVersion":"0.15.0","description":"This plugin returns the current weather from OpenWeather in a configurable string format.","author":"willasm","authorUrl":"https://github.com/willasm/obsidian-open-weather","isDesktopOnly":false}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,15 +0,0 @@
|
||||
{
|
||||
"completedAreaHeader": "### Completed to-dos",
|
||||
"removeExpression": "",
|
||||
"appendDateFormat": "",
|
||||
"incompleteTaskValues": " ",
|
||||
"supportCanceledTasks": true,
|
||||
"rightClickComplete": false,
|
||||
"rightClickMark": false,
|
||||
"rightClickMove": true,
|
||||
"rightClickReset": false,
|
||||
"rightClickResetTask": false,
|
||||
"rightClickResetAll": false,
|
||||
"rightClickToggleAll": false,
|
||||
"completedAreaRemoveCheckbox": false
|
||||
}
|
@ -1,765 +0,0 @@
|
||||
/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
if you want to view the source, please visit the github repository of this plugin
|
||||
*/
|
||||
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
||||
var __export = (target, all) => {
|
||||
__markAsModule(target);
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __reExport = (target, module2, desc) => {
|
||||
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
||||
for (let key of __getOwnPropNames(module2))
|
||||
if (!__hasOwnProp.call(target, key) && key !== "default")
|
||||
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
||||
}
|
||||
return target;
|
||||
};
|
||||
var __toModule = (module2) => {
|
||||
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
||||
};
|
||||
var __async = (__this, __arguments, generator) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
var fulfilled = (value) => {
|
||||
try {
|
||||
step(generator.next(value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
};
|
||||
var rejected = (value) => {
|
||||
try {
|
||||
step(generator.throw(value));
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
};
|
||||
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
||||
step((generator = generator.apply(__this, __arguments)).next());
|
||||
});
|
||||
};
|
||||
|
||||
// src/main.ts
|
||||
__export(exports, {
|
||||
default: () => main_default
|
||||
});
|
||||
|
||||
// src/taskcollector-Plugin.ts
|
||||
var import_obsidian4 = __toModule(require("obsidian"));
|
||||
|
||||
// src/taskcollector-TaskCollector.ts
|
||||
var import_obsidian = __toModule(require("obsidian"));
|
||||
var TaskCollector = class {
|
||||
constructor(app) {
|
||||
this.app = app;
|
||||
this.app = app;
|
||||
this.anyListItem = new RegExp(/^([\s>]*- )([^\\[].*)$/);
|
||||
this.anyTaskMark = new RegExp(/^([\s>]*- \[).(\] .*)$/);
|
||||
this.blockQuote = new RegExp(/^(\s*>[\s>]*)(.*)$/);
|
||||
this.blockRef = new RegExp(/^(.*?)( \^[A-Za-z0-9-]+)?$/);
|
||||
this.continuation = new RegExp(/^( {2,}|\t)/);
|
||||
this.stripTask = new RegExp(/^([\s>]*-) \[.\] (.*)$/);
|
||||
}
|
||||
updateSettings(settings) {
|
||||
this.settings = settings;
|
||||
let momentMatchString = null;
|
||||
if (settings.appendDateFormat) {
|
||||
const literals = [];
|
||||
const regex1 = RegExp("(\\[.*?\\]\\]?)", "g");
|
||||
let match;
|
||||
let i = 0;
|
||||
momentMatchString = settings.appendDateFormat;
|
||||
while ((match = regex1.exec(momentMatchString)) !== null) {
|
||||
momentMatchString = momentMatchString.replace(match[0], `%$${i}$%`);
|
||||
literals.push(match[0].substring(1, match[0].length - 1).replace(/\(/g, "\\(").replace(/\)/g, "\\)").replace(/\[/g, "\\[").replace(/\]/g, "\\]"));
|
||||
i++;
|
||||
}
|
||||
momentMatchString = momentMatchString.replace("YYYY", "\\d{4}").replace("YY", "\\d{2}").replace("DD", "\\d{2}").replace("D", "\\d{1,2}").replace("MMM", "[A-Za-z]{3}").replace("MM", "\\d{2}").replace("M", "\\d{1,2}").replace("HH", "\\d{2}").replace("H", "\\d{1,2}").replace("hh", "\\d{2}").replace("h", "\\d{1,2}").replace("mm", "\\d{2}").replace("m", "\\d{1,2}");
|
||||
if (literals.length > 0) {
|
||||
for (let i2 = 0; i2 < literals.length; i2++) {
|
||||
momentMatchString = momentMatchString.replace(`%$${i2}$%`, literals[i2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
const completedTasks = (this.settings.onlyLowercaseX ? "x" : "xX") + (this.settings.supportCanceledTasks ? "-" : "");
|
||||
if (this.settings.incompleteTaskValues.indexOf(" ") < 0) {
|
||||
this.settings.incompleteTaskValues = " " + this.settings.incompleteTaskValues;
|
||||
}
|
||||
const rightClickTaskMenu = this.settings.rightClickComplete || this.settings.rightClickMark || this.settings.rightClickMove || this.settings.rightClickResetTask || this.settings.rightClickResetAll || this.settings.rightClickToggleAll;
|
||||
this.initSettings = {
|
||||
removeRegExp: this.tryCreateRemoveRegex(this.settings.removeExpression),
|
||||
resetRegExp: this.tryCreateResetRegex(momentMatchString),
|
||||
incompleteTaskRegExp: this.tryCreateIncompleteRegex(this.settings.incompleteTaskValues),
|
||||
rightClickTaskMenu,
|
||||
completedTasks,
|
||||
completedTaskRegExp: this.tryCreateCompleteRegex(completedTasks)
|
||||
};
|
||||
console.debug("TC: updated configuration %o, %o", this.settings, this.initSettings);
|
||||
}
|
||||
tryCreateRemoveRegex(param) {
|
||||
return param ? new RegExp(param, "g") : null;
|
||||
}
|
||||
tryCreateResetRegex(param) {
|
||||
return param ? new RegExp(param + "( \\^[A-Za-z0-9-]+)?$") : null;
|
||||
}
|
||||
tryCreateCompleteRegex(param) {
|
||||
return new RegExp(`^([\\s>]*- \\[)[${param}](\\] .*)$`);
|
||||
}
|
||||
tryCreateIncompleteRegex(param) {
|
||||
return new RegExp(`^([\\s>]*- \\[)[${param}](\\] .*)$`);
|
||||
}
|
||||
removeCheckboxFromLine(lineText) {
|
||||
return lineText.replace(this.stripTask, "$1 $2");
|
||||
}
|
||||
completeTaskLine(lineText, mark) {
|
||||
let marked = lineText.replace(this.initSettings.incompleteTaskRegExp, "$1" + mark + "$2");
|
||||
if (this.initSettings.removeRegExp) {
|
||||
marked = marked.replace(this.initSettings.removeRegExp, "");
|
||||
}
|
||||
if (this.settings.appendDateFormat) {
|
||||
const strictLineEnding = lineText.endsWith(" ");
|
||||
let blockid = "";
|
||||
const match = this.blockRef.exec(marked);
|
||||
if (match && match[2]) {
|
||||
marked = match[1];
|
||||
blockid = match[2];
|
||||
}
|
||||
if (!marked.endsWith(" ")) {
|
||||
marked += " ";
|
||||
}
|
||||
marked += (0, import_obsidian.moment)().format(this.settings.appendDateFormat) + blockid;
|
||||
if (strictLineEnding) {
|
||||
marked += " ";
|
||||
}
|
||||
}
|
||||
return marked;
|
||||
}
|
||||
completeEditorLineTask(editor, mark, i) {
|
||||
const lineText = editor.getLine(i);
|
||||
const incompleteTask = this.initSettings.incompleteTaskRegExp.exec(lineText);
|
||||
if (incompleteTask) {
|
||||
const marked = this.completeTaskLine(lineText, mark);
|
||||
editor.setLine(i, marked);
|
||||
}
|
||||
}
|
||||
markAllTasksComplete(source, mark) {
|
||||
const lines = source.split("\n");
|
||||
const result = [];
|
||||
for (const line of lines) {
|
||||
if (this.initSettings.incompleteTaskRegExp.exec(line)) {
|
||||
result.push(this.completeTaskLine(line, mark));
|
||||
} else {
|
||||
result.push(line);
|
||||
}
|
||||
}
|
||||
return result.join("\n");
|
||||
}
|
||||
markTaskInSource(source, mark, lines = []) {
|
||||
const split = source.split("\n");
|
||||
for (const n of lines) {
|
||||
if (!this.anyTaskMark.test(split[n])) {
|
||||
const match = this.anyListItem.exec(split[n]);
|
||||
if (match && match[2]) {
|
||||
console.debug("TC: list item, convert to a task %s", split[n]);
|
||||
split[n] = match[1] + "[ ] " + match[2];
|
||||
} else {
|
||||
console.debug("TC: not a task or list item %s", split[n]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (this.initSettings.completedTasks.indexOf(mark) >= 0) {
|
||||
if (this.isIncompleteTaskLine(split[n])) {
|
||||
console.debug("TC: complete task with %s: %s", mark, split[n]);
|
||||
split[n] = this.completeTaskLine(split[n], mark);
|
||||
} else {
|
||||
console.debug("TC: task already completed (%s): %s", mark, split[n]);
|
||||
}
|
||||
} else if (this.settings.incompleteTaskValues.indexOf(mark) >= 0) {
|
||||
console.debug("TC: reset task with %s: %s", mark, split[n]);
|
||||
split[n] = this.resetTaskLine(split[n], mark);
|
||||
} else if (mark === "Backspace") {
|
||||
split[n] = this.removeCheckboxFromLine(split[n]);
|
||||
} else {
|
||||
console.debug("TC: unrecognized mark %s, check configuration settings", mark);
|
||||
}
|
||||
}
|
||||
return split.join("\n");
|
||||
}
|
||||
resetTaskLine(lineText, mark = " ") {
|
||||
let marked = lineText.replace(this.anyTaskMark, "$1" + mark + "$2");
|
||||
const strictLineEnding = lineText.endsWith(" ");
|
||||
let blockid = "";
|
||||
const match = this.blockRef.exec(marked);
|
||||
if (match && match[2]) {
|
||||
marked = match[1];
|
||||
blockid = match[2];
|
||||
}
|
||||
if (this.initSettings.resetRegExp) {
|
||||
marked = marked.replace(this.initSettings.resetRegExp, "");
|
||||
}
|
||||
marked = marked.replace(/\s*$/, blockid);
|
||||
if (strictLineEnding) {
|
||||
marked += " ";
|
||||
}
|
||||
return marked;
|
||||
}
|
||||
resetTaskOnLine(editor, i, mark) {
|
||||
const lineText = editor.getLine(i);
|
||||
const marked = this.resetTaskLine(lineText, mark);
|
||||
editor.setLine(i, marked);
|
||||
}
|
||||
resetAllTasks(source) {
|
||||
const LOG_HEADING = this.settings.completedAreaHeader || "## Log";
|
||||
const lines = source.split("\n");
|
||||
const result = [];
|
||||
let inCompletedSection = false;
|
||||
for (const line of lines) {
|
||||
if (inCompletedSection) {
|
||||
if (line.startsWith("#") || line.trim() === "---") {
|
||||
inCompletedSection = false;
|
||||
}
|
||||
result.push(line);
|
||||
} else if (line.trim() === LOG_HEADING) {
|
||||
inCompletedSection = true;
|
||||
result.push(line);
|
||||
} else if (this.isCompletedTaskLine(line)) {
|
||||
result.push(this.resetTaskLine(line));
|
||||
} else {
|
||||
result.push(line);
|
||||
}
|
||||
}
|
||||
return result.join("\n");
|
||||
}
|
||||
moveCompletedTasksInFile(source) {
|
||||
const LOG_HEADING = this.settings.completedAreaHeader || "## Log";
|
||||
const lines = source.split("\n");
|
||||
if (source.indexOf(LOG_HEADING) < 0) {
|
||||
if (lines[lines.length - 1].trim() !== "") {
|
||||
lines.push("");
|
||||
}
|
||||
lines.push(LOG_HEADING);
|
||||
}
|
||||
const remaining = [];
|
||||
const completedSection = [];
|
||||
const newTasks = [];
|
||||
let inCompletedSection = false;
|
||||
let inTask = false;
|
||||
let inCallout = false;
|
||||
let completedItemsIndex = lines.length;
|
||||
for (let line of lines) {
|
||||
if (inCompletedSection) {
|
||||
if (line.startsWith("#") || line.trim() === "---") {
|
||||
inCompletedSection = false;
|
||||
remaining.push(line);
|
||||
} else {
|
||||
completedSection.push(line);
|
||||
}
|
||||
} else if (line.trim() === LOG_HEADING) {
|
||||
inCompletedSection = true;
|
||||
completedItemsIndex = remaining.push(line);
|
||||
remaining.push("%%%COMPLETED_ITEMS_GO_HERE%%%");
|
||||
} else {
|
||||
if (this.isCompletedTaskLine(line)) {
|
||||
if (this.settings.completedAreaRemoveCheckbox) {
|
||||
line = this.removeCheckboxFromLine(line);
|
||||
}
|
||||
inTask = true;
|
||||
inCallout = this.isCallout(line);
|
||||
newTasks.push(line);
|
||||
} else if (inTask && !this.isTaskLine(line) && this.isContinuation(line, inCallout)) {
|
||||
newTasks.push(line);
|
||||
} else {
|
||||
inTask = false;
|
||||
inCallout = false;
|
||||
remaining.push(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
let result = remaining.slice(0, completedItemsIndex).concat(...newTasks).concat(...completedSection);
|
||||
if (completedItemsIndex < remaining.length - 1) {
|
||||
result = result.concat(remaining.slice(completedItemsIndex + 1));
|
||||
}
|
||||
return result.join("\n");
|
||||
}
|
||||
isCompletedTaskLine(lineText) {
|
||||
return this.initSettings.completedTaskRegExp.test(lineText);
|
||||
}
|
||||
isIncompleteTaskLine(lineText) {
|
||||
return this.initSettings.incompleteTaskRegExp.test(lineText);
|
||||
}
|
||||
isTaskLine(lineText) {
|
||||
return this.anyTaskMark.test(lineText);
|
||||
}
|
||||
isContinuation(lineText, inCallout) {
|
||||
if (inCallout) {
|
||||
const match = this.blockQuote.exec(lineText);
|
||||
if (match) {
|
||||
return match[1].endsWith(">") || match[1].endsWith(" ") || match[1].endsWith(" ");
|
||||
}
|
||||
}
|
||||
return this.continuation.test(lineText);
|
||||
}
|
||||
isCallout(lineText) {
|
||||
return this.blockQuote.test(lineText);
|
||||
}
|
||||
};
|
||||
|
||||
// src/taskcollector-Settings.ts
|
||||
var DEFAULT_SETTINGS = {
|
||||
completedAreaHeader: "## Log",
|
||||
removeExpression: "",
|
||||
appendDateFormat: "",
|
||||
incompleteTaskValues: " ",
|
||||
supportCanceledTasks: false,
|
||||
rightClickComplete: false,
|
||||
rightClickMark: false,
|
||||
rightClickMove: false,
|
||||
rightClickReset: false,
|
||||
rightClickResetTask: false,
|
||||
rightClickResetAll: false,
|
||||
rightClickToggleAll: false,
|
||||
completedAreaRemoveCheckbox: false,
|
||||
onlyLowercaseX: false
|
||||
};
|
||||
|
||||
// src/taskcollector-SettingsTab.ts
|
||||
var import_obsidian2 = __toModule(require("obsidian"));
|
||||
var TaskCollectorSettingsTab = class extends import_obsidian2.PluginSettingTab {
|
||||
constructor(app, plugin, taskCollector) {
|
||||
super(app, plugin);
|
||||
this.plugin = plugin;
|
||||
this.taskCollector = taskCollector;
|
||||
}
|
||||
display() {
|
||||
this.containerEl.empty();
|
||||
this.containerEl.createEl("h1", { text: "Task Collector" });
|
||||
const tempSettings = Object.assign(this.taskCollector.settings);
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Only support x for completed tasks").setDesc("Only use 'x' (lower case) to indicate completed tasks.").addToggle((toggle) => toggle.setValue(tempSettings.onlyLowercaseX).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.onlyLowercaseX = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Support canceled tasks").setDesc("Use a - to indicate canceled tasks. Canceled tasks are processed in the same way as completed tasks using options below.").addToggle((toggle) => toggle.setValue(tempSettings.supportCanceledTasks).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.supportCanceledTasks = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Additional task types").setDesc("Specify the set of single characters that indicate in-progress or incomplete tasks, e.g. 'i> !?D'.").addText((text) => text.setPlaceholder("> !?").setValue(tempSettings.incompleteTaskValues).onChange((value) => __async(this, null, function* () {
|
||||
if (value.contains("x")) {
|
||||
console.log(`Set of characters should not contain the marker for completed tasks (x): ${value}`);
|
||||
} else if (!tempSettings.onlyLowercaseX && value.contains("X")) {
|
||||
console.log(`Set of characters should not contain the marker for canceled tasks (X): ${value}`);
|
||||
} else if (tempSettings.supportCanceledTasks && value.contains("-")) {
|
||||
console.log(`Set of characters should not contain the marker for canceled tasks (-): ${value}`);
|
||||
} else {
|
||||
if (!value.contains(" ")) {
|
||||
value = " " + value;
|
||||
}
|
||||
tempSettings.incompleteTaskValues = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
}
|
||||
})));
|
||||
this.containerEl.createEl("h2", { text: "Completing tasks" });
|
||||
this.containerEl.createEl("p", {
|
||||
text: "Completed tasks, marked by 'x', 'X' (and optionally '-' for canceled items) gain special treatment based on the settings below."
|
||||
});
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Append date to completed task").setDesc("If non-empty, append today's date in the given moment.js string format to the end of the task text.").addMomentFormat((momentFormat) => momentFormat.setPlaceholder("YYYY-MM-DD").setValue(tempSettings.appendDateFormat).onChange((value) => __async(this, null, function* () {
|
||||
try {
|
||||
(0, import_obsidian2.moment)().format(value);
|
||||
tempSettings.appendDateFormat = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
} catch (e) {
|
||||
console.log(`Error parsing specified date format: ${value}`);
|
||||
}
|
||||
})));
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Remove text in completed task").setDesc("Text matching this regular expression should be removed from the task text. Be careful! Test your expression first. The global flag, 'g' is used for a per-line match.").addText((text) => text.setPlaceholder(" #(todo|task)").setValue(tempSettings.removeExpression).onChange((value) => __async(this, null, function* () {
|
||||
try {
|
||||
this.taskCollector.tryCreateRemoveRegex(value);
|
||||
tempSettings.removeExpression = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
} catch (e) {
|
||||
console.log(`Error parsing regular expression for text replacement: ${value}`);
|
||||
}
|
||||
})));
|
||||
this.containerEl.createEl("h2", { text: "Moving completed tasks" });
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Completed area header").setDesc(`Completed (or canceled) items will be inserted under the specified header (most recent at the top). When scanning the document for completed/canceled tasks, the contents from this configured header to the next heading or separator (---) will be ignored. This heading will be created if the command is invoked and the heading does not exist. The default heading is '${DEFAULT_SETTINGS.completedAreaHeader}'.`).addText((text) => text.setPlaceholder("## Log").setValue(tempSettings.completedAreaHeader).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.completedAreaHeader = value.trim();
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Remove the checkbox from moved items").setDesc(`Remove the checkbox from completed (or canceled) tasks during the move to the completed area. This transforms tasks into normal list items. Task Collector will not be able to reset these items. They also will not appear in task searches or queries. The default value is: '${DEFAULT_SETTINGS.completedAreaRemoveCheckbox}'.`).addToggle((toggle) => toggle.setValue(tempSettings.completedAreaRemoveCheckbox).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.completedAreaRemoveCheckbox = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
this.containerEl.createEl("h2", { text: "Right-click Menu items" });
|
||||
this.containerEl.createEl("p", {
|
||||
text: "Task Collector creates commands that can be bound to hotkeys or accessed using slash commands for marking tasks complete (or canceled) and resetting tasks to an incomplete state. The following settings add right click context menu items for those commands."
|
||||
});
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Add menu item for marking a task").setDesc("Add an item to the right-click menu in edit mode to mark the task _on the current line (or within the current selection)_. This menu item will trigger a quick pop-up modal to select the desired mark value. The selected value will determine follow-on actions: complete, cancel, or reset.").addToggle((toggle) => toggle.setValue(tempSettings.rightClickMark).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.rightClickMark = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Add menu item for completing a task").setDesc("Add an item to the right-click menu in edit mode to mark the task _on the current line (or within the current selection)_ complete. If canceled items are supported, an additional menu item will be added to mark selected tasks as canceled.").addToggle((toggle) => toggle.setValue(tempSettings.rightClickComplete).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.rightClickComplete = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Add menu item for resetting a task").setDesc("Add an item to the right-click menu in edit mode to reset the task _on the current line (or within the current selection)_.").addToggle((toggle) => toggle.setValue(tempSettings.rightClickResetTask).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.rightClickResetTask = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Add menu items for completing all tasks").setDesc("Add an item to the right-click menu in edit mode to mark _all_ incomplete tasks in the current document complete.").addToggle((toggle) => toggle.setValue(tempSettings.rightClickToggleAll).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.rightClickToggleAll = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Add menu item for resetting all tasks").setDesc("Add an item to the right-click menu to reset _all_ completed (or canceled) tasks.").addToggle((toggle) => toggle.setValue(tempSettings.rightClickResetAll).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.rightClickResetAll = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
new import_obsidian2.Setting(this.containerEl).setName("Add menu item for moving all completed tasks").setDesc("Add an item to the right-click menu to move _all_ completed (or canceled) tasks.").addToggle((toggle) => toggle.setValue(tempSettings.rightClickMove).onChange((value) => __async(this, null, function* () {
|
||||
tempSettings.rightClickMove = value;
|
||||
this.taskCollector.updateSettings(tempSettings);
|
||||
yield this.plugin.saveSettings();
|
||||
})));
|
||||
}
|
||||
};
|
||||
|
||||
// src/taskcollector-TaskMarkModal.ts
|
||||
var import_obsidian3 = __toModule(require("obsidian"));
|
||||
function getMark(app, taskCollector) {
|
||||
return new Promise((resolve) => {
|
||||
const modal = new TaskMarkModal(app, taskCollector);
|
||||
modal.onClose = () => {
|
||||
resolve(modal.chosenMark);
|
||||
};
|
||||
modal.open();
|
||||
});
|
||||
}
|
||||
var TaskMarkModal = class extends import_obsidian3.Modal {
|
||||
constructor(app, taskCollector) {
|
||||
super(app);
|
||||
this.taskCollector = taskCollector;
|
||||
this.containerEl.id = "taskcollector-modal";
|
||||
}
|
||||
onOpen() {
|
||||
const selector = this.contentEl.createDiv("taskcollector-selector markdown-preview-view");
|
||||
const completedTasks = (this.taskCollector.settings.onlyLowercaseX ? "x" : "xX") + (this.taskCollector.settings.supportCanceledTasks ? "-" : "");
|
||||
const completedList = selector.createEl("ul");
|
||||
completedList.addClass("contains-task-list");
|
||||
this.addTaskValues(completedList, completedTasks, true);
|
||||
const list = selector.createEl("ul");
|
||||
list.addClass("contains-task-list");
|
||||
this.addTaskValues(list, this.taskCollector.settings.incompleteTaskValues, false);
|
||||
const footer = selector.createEl("nav");
|
||||
const esc = footer.createSpan();
|
||||
esc.innerHTML = "<b>esc</b> to dismiss";
|
||||
const bksp = footer.createSpan();
|
||||
bksp.innerHTML = "<b>bksp</b> to remove <code>[]</code>";
|
||||
const self = this;
|
||||
const keyListener = function(event) {
|
||||
self.chosenMark = event.key;
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
self.close();
|
||||
};
|
||||
this.scope.register([], null, keyListener);
|
||||
this.scope.register(["Shift"], null, keyListener);
|
||||
}
|
||||
addTaskValues(list, choices, markComplete) {
|
||||
const self = this;
|
||||
for (const character of choices) {
|
||||
const li = list.createEl("li", {
|
||||
cls: "task-list-item " + (character == " " ? "" : " is-checked"),
|
||||
attr: {
|
||||
"data-task": character
|
||||
}
|
||||
});
|
||||
li.addEventListener("click", function(event) {
|
||||
self.chosenMark = character;
|
||||
self.close();
|
||||
});
|
||||
const input = li.createEl("input", {
|
||||
cls: "task-list-item-checkbox",
|
||||
attr: {
|
||||
id: "task-list-item-checkbox-" + character,
|
||||
type: "checkbox",
|
||||
style: "pointer-events: none;"
|
||||
}
|
||||
});
|
||||
if (character != " ") {
|
||||
input.setAttribute("checked", "");
|
||||
}
|
||||
li.createEl("span", {
|
||||
text: character == " " ? "\u2423" : character,
|
||||
attr: {
|
||||
style: "pointer-events: none;"
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
onClose() {
|
||||
this.contentEl.empty();
|
||||
}
|
||||
};
|
||||
|
||||
// src/taskcollector-Plugin.ts
|
||||
var Icons;
|
||||
(function(Icons2) {
|
||||
Icons2["COMPLETE"] = "tc-complete-item";
|
||||
Icons2["CANCEL"] = "tc-cancel-item";
|
||||
Icons2["RESET"] = "tc-reset-item";
|
||||
Icons2["MARK"] = "tc-mark-item";
|
||||
Icons2["COMPLETE_ALL"] = "tc-complete-all-items";
|
||||
Icons2["CLEAR"] = "tc-clear-all-items";
|
||||
Icons2["MOVE"] = "tc-move-all-checked-items";
|
||||
})(Icons || (Icons = {}));
|
||||
var TaskCollectorPlugin = class extends import_obsidian4.Plugin {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.handlersRegistered = false;
|
||||
}
|
||||
onload() {
|
||||
return __async(this, null, function* () {
|
||||
console.log("loading Task Collector (TC)");
|
||||
this.taskCollector = new TaskCollector(this.app);
|
||||
this.addSettingTab(new TaskCollectorSettingsTab(this.app, this, this.taskCollector));
|
||||
yield this.loadSettings();
|
||||
(0, import_obsidian4.addIcon)(Icons.COMPLETE, '<svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px" fill="currentColor" class="bi bi-check-square-fill" viewBox="0 0 16 16"> <path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm10.03 4.97a.75.75 0 0 1 .011 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.75.75 0 0 1 1.08-.022z"/></svg>');
|
||||
(0, import_obsidian4.addIcon)(Icons.CANCEL, '<svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px" fill="currentColor" class="bi bi-dash-square-fill" viewBox="0 0 16 16"> <path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm2.5 7.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1 0-1z"/></svg>');
|
||||
(0, import_obsidian4.addIcon)(Icons.RESET, '<svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px" fill="currentColor" class="bi bi-square-fill" viewBox="0 0 16 16"><path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2z"/></svg>');
|
||||
(0, import_obsidian4.addIcon)(Icons.MARK, '<svg class="bi bi-square-fill" width="100px" height="100px" fill="currentColor" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path transform="scale(.16)" d="m12.5 0a12.5 12.5 0 00-12.5 12.5v75a12.5 12.5 0 0012.5 12.5h75a12.5 12.5 0 0012.5-12.5v-75a12.5 12.5 0 00-12.5-12.5h-75zm38.146 21.135 8.7324 19.098 20.684 3.6328-15.465 14.207 2.9355 20.793-18.289-10.316-18.869 9.2188 4.1602-20.584-14.598-15.098 20.861-2.4043 9.8477-18.547z" stroke-width="6.25"/></svg>');
|
||||
(0, import_obsidian4.addIcon)(Icons.COMPLETE_ALL, '<svg class="bi bi-square-fill" fill="currentColor" version="1.1" width="100px" height="100px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m2 0a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2v-12a2 2 0 00-2-2h-12zm1.5098 2.041h1.5a1.5 1.5 0 011.5 1.5v1.5a1.5 1.5 0 01-1.5 1.5h-1.5a1.5 1.5 0 01-1.5-1.5v-1.5a1.5 1.5 0 011.5-1.5zm4.3945 1.2207h5.6895a.40645.5 0 01.40625.5v1a.40645.5 0 01-.40625.5h-5.6895a.40645.5 0 01-.40625-.5v-1a.40645.5 0 01.40625-.5zm-4.4023 6.2656h1.5a1.5 1.5 0 011.5 1.5v1.5a1.5 1.5 0 01-1.5 1.5h-1.5a1.5 1.5 0 01-1.5-1.5v-1.5a1.5 1.5 0 011.5-1.5zm4.4023 1.2656h5.6895a.40645.5 0 01.40625.5v1a.40645.5 0 01-.40625.5h-5.6895a.40645.5 0 01-.40625-.5v-1a.40645.5 0 01.40625-.5z"/><g transform="translate(.49737 -.0026315)" fill="currentColor"><path d="m3.6171 13.149a.5.5 0 01-.708 0l-1-1a.50063.50063 0 01.708-.708l.646.647 1.646-1.647a.50063.50063 0 01.708.708z"/><path d="m3.6171 5.6181a.5.5 0 01-.708 0l-1-1a.50063.50063 0 11.708-.708l.646.647 1.646-1.647a.50063.50063 0 11.708.708z"/></g></svg>');
|
||||
(0, import_obsidian4.addIcon)(Icons.CLEAR, '<svg class="bi bi-square-fill" fill="currentColor" version="1.1" width="100px" height="100px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="m2 0a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2v-12a2 2 0 00-2-2h-12zm1.5098 2.041h1.5a1.5 1.5 0 011.5 1.5v1.5a1.5 1.5 0 01-1.5 1.5h-1.5a1.5 1.5 0 01-1.5-1.5v-1.5a1.5 1.5 0 011.5-1.5zm4.3945 1.2207h5.6895a.40645.5 0 01.40625.5v1a.40645.5 0 01-.40625.5h-5.6895a.40645.5 0 01-.40625-.5v-1a.40645.5 0 01.40625-.5zm-4.4023 6.2656h1.5a1.5 1.5 0 011.5 1.5v1.5a1.5 1.5 0 01-1.5 1.5h-1.5a1.5 1.5 0 01-1.5-1.5v-1.5a1.5 1.5 0 011.5-1.5zm4.4023 1.2656h5.6895a.40645.5 0 01.40625.5v1a.40645.5 0 01-.40625.5h-5.6895a.40645.5 0 01-.40625-.5v-1a.40645.5 0 01.40625-.5z"/></svg>');
|
||||
(0, import_obsidian4.addIcon)(Icons.MOVE, '<svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px" fill="currentColor" class="bi bi-save-fill" viewBox="0 0 16 16"> <path d="M8.5 1.5A1.5 1.5 0 0 1 10 0h4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h6c-.314.418-.5.937-.5 1.5v7.793L4.854 6.646a.5.5 0 1 0-.708.708l3.5 3.5a.5.5 0 0 0 .708 0l3.5-3.5a.5.5 0 0 0-.708-.708L8.5 9.293V1.5z"/></svg>');
|
||||
const completeTaskCommand = {
|
||||
id: "task-collector-mark-done",
|
||||
name: "Complete item",
|
||||
icon: Icons.COMPLETE,
|
||||
editorCallback: (editor, view) => {
|
||||
this.markTaskOnLines("x", this.getCurrentLinesFromEditor(editor));
|
||||
}
|
||||
};
|
||||
const cancelTaskCommand = {
|
||||
id: "task-collector-mark-canceled",
|
||||
name: "Cancel item",
|
||||
icon: Icons.CANCEL,
|
||||
editorCallback: (editor, view) => {
|
||||
this.markTaskOnLines("-", this.getCurrentLinesFromEditor(editor));
|
||||
}
|
||||
};
|
||||
const resetTaskCommand = {
|
||||
id: "task-collector-mark-reset",
|
||||
name: "Reset item",
|
||||
icon: Icons.RESET,
|
||||
editorCallback: (editor, view) => {
|
||||
this.markTaskOnLines(" ", this.getCurrentLinesFromEditor(editor));
|
||||
}
|
||||
};
|
||||
const markTaskCommand = {
|
||||
id: "task-collector-mark",
|
||||
name: "Mark item",
|
||||
icon: Icons.MARK,
|
||||
editorCallback: (editor, view) => __async(this, null, function* () {
|
||||
const mark = yield getMark(this.app, this.taskCollector);
|
||||
if (mark) {
|
||||
this.markTaskOnLines(mark, this.getCurrentLinesFromEditor(editor));
|
||||
}
|
||||
})
|
||||
};
|
||||
const completeAllTasksCommand = {
|
||||
id: "task-collector-mark-all-done",
|
||||
name: "Complete all tasks",
|
||||
icon: Icons.COMPLETE_ALL,
|
||||
callback: () => __async(this, null, function* () {
|
||||
this.completeAllTasks();
|
||||
})
|
||||
};
|
||||
const clearAllTasksCommand = {
|
||||
id: "task-collector-clear-all-items",
|
||||
name: "Reset all completed tasks",
|
||||
icon: Icons.CLEAR,
|
||||
callback: () => __async(this, null, function* () {
|
||||
this.resetAllTasks();
|
||||
})
|
||||
};
|
||||
const moveTaskCommand = {
|
||||
id: "task-collector-move-completed-tasks",
|
||||
name: "Move all completed tasks to configured heading",
|
||||
icon: Icons.MOVE,
|
||||
callback: () => __async(this, null, function* () {
|
||||
this.moveAllTasks();
|
||||
})
|
||||
};
|
||||
this.addCommand(completeTaskCommand);
|
||||
if (this.taskCollector.settings.supportCanceledTasks) {
|
||||
this.addCommand(cancelTaskCommand);
|
||||
}
|
||||
this.addCommand(markTaskCommand);
|
||||
this.addCommand(resetTaskCommand);
|
||||
this.addCommand(moveTaskCommand);
|
||||
this.addCommand(completeAllTasksCommand);
|
||||
this.addCommand(clearAllTasksCommand);
|
||||
this.registerHandlers();
|
||||
});
|
||||
}
|
||||
getCurrentLinesFromEditor(editor) {
|
||||
const lines = [];
|
||||
if (editor.somethingSelected()) {
|
||||
const cursorStart = editor.getCursor("from");
|
||||
const cursorEnd = editor.getCursor("to");
|
||||
for (let i = cursorStart.line; i <= cursorEnd.line; i++) {
|
||||
lines.push(i);
|
||||
}
|
||||
} else {
|
||||
const anchor = editor.getCursor("from");
|
||||
lines.push(anchor.line);
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
buildMenu(menu, lines) {
|
||||
if (this.taskCollector.settings.rightClickMark) {
|
||||
menu.addItem((item) => item.setTitle("(TC) Mark Task").setIcon(Icons.MARK).onClick(() => __async(this, null, function* () {
|
||||
const mark = yield getMark(this.app, this.taskCollector);
|
||||
if (mark) {
|
||||
this.markTaskOnLines(mark, lines);
|
||||
}
|
||||
})));
|
||||
}
|
||||
if (this.taskCollector.settings.rightClickComplete) {
|
||||
menu.addItem((item) => item.setTitle("(TC) Complete Task").setIcon(Icons.COMPLETE).onClick(() => {
|
||||
this.markTaskOnLines("x", lines);
|
||||
}));
|
||||
if (this.taskCollector.settings.supportCanceledTasks) {
|
||||
menu.addItem((item) => item.setTitle("(TC) Cancel Task").setIcon(Icons.CANCEL).onClick(() => {
|
||||
this.markTaskOnLines("-", lines);
|
||||
}));
|
||||
}
|
||||
}
|
||||
if (this.taskCollector.settings.rightClickResetTask) {
|
||||
menu.addItem((item) => item.setTitle("(TC) Reset Task").setIcon(Icons.RESET).onClick(() => {
|
||||
this.markTaskOnLines(" ", lines);
|
||||
}));
|
||||
}
|
||||
if (this.taskCollector.settings.rightClickMove) {
|
||||
menu.addItem((item) => item.setTitle("(TC) Move completed tasks").setIcon(Icons.MOVE).onClick(() => __async(this, null, function* () {
|
||||
this.moveAllTasks();
|
||||
})));
|
||||
}
|
||||
if (this.taskCollector.settings.rightClickToggleAll) {
|
||||
menu.addItem((item) => item.setTitle("(TC) Complete All Tasks").setIcon(Icons.COMPLETE_ALL).onClick(() => __async(this, null, function* () {
|
||||
this.completeAllTasks();
|
||||
})));
|
||||
}
|
||||
if (this.taskCollector.settings.rightClickResetAll) {
|
||||
menu.addItem((item) => item.setTitle("(TC) Reset All Tasks").setIcon(Icons.CLEAR).onClick(() => __async(this, null, function* () {
|
||||
this.resetAllTasks();
|
||||
})));
|
||||
}
|
||||
}
|
||||
markTaskOnLines(mark, lines) {
|
||||
return __async(this, null, function* () {
|
||||
const activeFile = this.app.workspace.getActiveFile();
|
||||
const source = yield this.app.vault.read(activeFile);
|
||||
const result = this.taskCollector.markTaskInSource(source, mark, lines);
|
||||
this.app.vault.modify(activeFile, result);
|
||||
});
|
||||
}
|
||||
moveAllTasks() {
|
||||
return __async(this, null, function* () {
|
||||
const activeFile = this.app.workspace.getActiveFile();
|
||||
const source = yield this.app.vault.read(activeFile);
|
||||
const result = this.taskCollector.moveCompletedTasksInFile(source);
|
||||
this.app.vault.modify(activeFile, result);
|
||||
});
|
||||
}
|
||||
completeAllTasks() {
|
||||
return __async(this, null, function* () {
|
||||
const activeFile = this.app.workspace.getActiveFile();
|
||||
const source = yield this.app.vault.read(activeFile);
|
||||
const result = this.taskCollector.markAllTasksComplete(source, "x");
|
||||
this.app.vault.modify(activeFile, result);
|
||||
});
|
||||
}
|
||||
resetAllTasks() {
|
||||
return __async(this, null, function* () {
|
||||
const activeFile = this.app.workspace.getActiveFile();
|
||||
const source = yield this.app.vault.read(activeFile);
|
||||
const result = this.taskCollector.resetAllTasks(source);
|
||||
this.app.vault.modify(activeFile, result);
|
||||
});
|
||||
}
|
||||
registerHandlers() {
|
||||
if (this.taskCollector.initSettings.rightClickTaskMenu && !this.handlersRegistered) {
|
||||
this.handlersRegistered = true;
|
||||
this.registerEvent(this.eventRef = this.app.workspace.on("editor-menu", (menu, editor) => {
|
||||
this.buildMenu(menu, this.getCurrentLinesFromEditor(editor));
|
||||
}));
|
||||
this.registerMarkdownPostProcessor(this.postProcessor = (el, ctx) => {
|
||||
const checkboxes = el.querySelectorAll(".task-list-item-checkbox");
|
||||
if (!checkboxes.length)
|
||||
return;
|
||||
const section = ctx.getSectionInfo(el);
|
||||
if (!section)
|
||||
return;
|
||||
const { lineStart } = section;
|
||||
for (const checkbox of Array.from(checkboxes)) {
|
||||
const line = Number(checkbox.dataset.line);
|
||||
this.registerDomEvent(checkbox.parentElement, "contextmenu", (ev) => {
|
||||
ev.preventDefault();
|
||||
const view = this.app.workspace.getActiveViewOfType(import_obsidian4.MarkdownView);
|
||||
if (view && view.editor) {
|
||||
const menu = new import_obsidian4.Menu(this.app);
|
||||
this.buildMenu(menu, [lineStart + line]);
|
||||
menu.showAtMouseEvent(ev);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
unregisterHandlers() {
|
||||
this.handlersRegistered = false;
|
||||
this.app.workspace.offref(this.eventRef);
|
||||
this.eventRef = null;
|
||||
import_obsidian4.MarkdownPreviewRenderer.unregisterPostProcessor(this.postProcessor);
|
||||
}
|
||||
onunload() {
|
||||
console.log("unloading Task Collector");
|
||||
}
|
||||
loadSettings() {
|
||||
return __async(this, null, function* () {
|
||||
const settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
|
||||
this.taskCollector.updateSettings(settings);
|
||||
});
|
||||
}
|
||||
saveSettings() {
|
||||
return __async(this, null, function* () {
|
||||
yield this.saveData(this.taskCollector.settings);
|
||||
if (this.taskCollector.initSettings.rightClickTaskMenu && !this.handlersRegistered) {
|
||||
this.registerHandlers();
|
||||
}
|
||||
if (!this.taskCollector.initSettings.rightClickTaskMenu && this.handlersRegistered) {
|
||||
this.unregisterHandlers();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// src/main.ts
|
||||
var main_default = TaskCollectorPlugin;
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"id": "obsidian-task-collector",
|
||||
"name": "Task Collector (TC)",
|
||||
"version": "0.7.8",
|
||||
"minAppVersion": "0.13.10",
|
||||
"description": "Manage completed tasks within a document",
|
||||
"author": "ebullient",
|
||||
"authorUrl": "https://github.com/ebullient",
|
||||
"isDesktopOnly": false
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
#taskcollector-modal .modal-close-button {
|
||||
display: none;
|
||||
}
|
||||
#taskcollector-modal .modal {
|
||||
padding: 10px;
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
}
|
||||
#taskcollector-modal .modal-content {
|
||||
background-color: var(--background-secondary);
|
||||
margin-top: 0px;
|
||||
}
|
||||
#taskcollector-modal .modal .markdown-preview-view {
|
||||
padding: 5px;
|
||||
}
|
||||
#taskcollector-modal .modal .markdown-preview-view ul {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
--gap: 3px;
|
||||
--square: 45px;
|
||||
margin: calc(-1 * var(--gap)) calc(1 * var(--gap));
|
||||
margin-block-start: 0;
|
||||
margin-block-end: 0;
|
||||
padding-inline-start: 0;
|
||||
}
|
||||
#taskcollector-modal .modal .markdown-preview-view ul > li {
|
||||
margin: var(--gap);
|
||||
display: block;
|
||||
width: var(--square);
|
||||
height: var(--square);
|
||||
background-color: var(--background-primary);
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
border-radius: 2px;
|
||||
text-indent: unset;
|
||||
line-height: var(--square);
|
||||
text-align: center;
|
||||
}
|
||||
#taskcollector-modal .modal .markdown-preview-view ul > li::before {
|
||||
display: none;
|
||||
}
|
||||
#taskcollector-modal .modal .markdown-preview-view ul > li > span {
|
||||
font-family: var(--font-monospace);
|
||||
}
|
||||
#taskcollector-modal .modal .markdown-preview-view ul > li.task-list-item .task-list-item-checkbox {
|
||||
margin-right: 4px;
|
||||
margin-left: unset;
|
||||
}
|
||||
#taskcollector-modal .modal .markdown-preview-view nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
}
|
||||
#taskcollector-modal .modal .markdown-preview-view nav span {
|
||||
display: block;
|
||||
font-size: .8em;
|
||||
color: var(--text-muted);
|
||||
}
|
@ -0,0 +1,207 @@
|
||||
{
|
||||
"globalFilter": "",
|
||||
"removeGlobalFilter": false,
|
||||
"setDoneDate": true,
|
||||
"autoSuggestInEditor": false,
|
||||
"autoSuggestMinMatch": 0,
|
||||
"autoSuggestMaxItems": 6,
|
||||
"provideAccessKeys": true,
|
||||
"useFilenameAsScheduledDate": false,
|
||||
"filenameAsDateFolders": [],
|
||||
"statusSettings": {
|
||||
"coreStatuses": [
|
||||
{
|
||||
"symbol": " ",
|
||||
"name": "Todo",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": true,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "x",
|
||||
"name": "Done",
|
||||
"nextStatusSymbol": " ",
|
||||
"availableAsCommand": true,
|
||||
"type": "DONE"
|
||||
}
|
||||
],
|
||||
"customStatuses": [
|
||||
{
|
||||
"symbol": "/",
|
||||
"name": "In Progress",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": true,
|
||||
"type": "IN_PROGRESS"
|
||||
},
|
||||
{
|
||||
"symbol": "-",
|
||||
"name": "Cancelled",
|
||||
"nextStatusSymbol": " ",
|
||||
"availableAsCommand": true,
|
||||
"type": "CANCELLED"
|
||||
},
|
||||
{
|
||||
"symbol": " ",
|
||||
"name": "to-do",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "/",
|
||||
"name": "incomplete",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "IN_PROGRESS"
|
||||
},
|
||||
{
|
||||
"symbol": "x",
|
||||
"name": "done",
|
||||
"nextStatusSymbol": " ",
|
||||
"availableAsCommand": false,
|
||||
"type": "DONE"
|
||||
},
|
||||
{
|
||||
"symbol": "-",
|
||||
"name": "canceled",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "CANCELLED"
|
||||
},
|
||||
{
|
||||
"symbol": ">",
|
||||
"name": "forwarded",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "<",
|
||||
"name": "scheduling",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "?",
|
||||
"name": "question",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "!",
|
||||
"name": "important",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "*",
|
||||
"name": "star",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "\"",
|
||||
"name": "quote",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "l",
|
||||
"name": "location",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "b",
|
||||
"name": "bookmark",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "i",
|
||||
"name": "information",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "S",
|
||||
"name": "savings",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "I",
|
||||
"name": "idea",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "p",
|
||||
"name": "pros",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "c",
|
||||
"name": "cons",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "f",
|
||||
"name": "fire",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "k",
|
||||
"name": "key",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "w",
|
||||
"name": "win",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "u",
|
||||
"name": "up",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
},
|
||||
{
|
||||
"symbol": "d",
|
||||
"name": "down",
|
||||
"nextStatusSymbol": "x",
|
||||
"availableAsCommand": false,
|
||||
"type": "TODO"
|
||||
}
|
||||
]
|
||||
},
|
||||
"features": {
|
||||
"INTERNAL_TESTING_ENABLED_BY_DEFAULT": true
|
||||
},
|
||||
"generalSettings": {},
|
||||
"headingOpened": {
|
||||
"Core Statuses": true,
|
||||
"Custom Statuses": true
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,4 @@
|
||||
{
|
||||
"createNewFile": true,
|
||||
"copyToClipboard": true
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
{"id":"pdf-to-markdown-plugin","name":"PDF to Markdown","version":"0.0.7","description":"Save a PDF's text (headings, paragraphs, lists, etc.) to a Markdown file.","author":"Alexis Rondeau","authorUrl":"https://publish.obsidian.md/alexisrondeau","js":"main.js"}
|
@ -0,0 +1 @@
|
||||
/* */
|
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,11 @@
|
||||
{
|
||||
"id": "podnotes",
|
||||
"name": "PodNotes",
|
||||
"version": "2.3.1",
|
||||
"version": "2.10.6",
|
||||
"minAppVersion": "0.15.9",
|
||||
"description": "Helps you write notes on podcasts.",
|
||||
"author": "Christian B. B. Houmann",
|
||||
"authorUrl": "https://bagerbach.com",
|
||||
"fundingUrl": "https://buymeacoffee.com/chhoumann",
|
||||
"isDesktopOnly": false
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,11 @@
|
||||
{
|
||||
"id": "quickadd",
|
||||
"name": "QuickAdd",
|
||||
"version": "0.8.0",
|
||||
"version": "0.11.6",
|
||||
"minAppVersion": "0.13.19",
|
||||
"description": "Quickly add new pages or content to your vault.",
|
||||
"author": "Christian B. B. Houmann",
|
||||
"authorUrl": "https://bagerbach.com",
|
||||
"fundingUrl": "https://www.buymeacoffee.com/chhoumann",
|
||||
"isDesktopOnly": false
|
||||
}
|
@ -1,210 +1,177 @@
|
||||
/* src/styles.css */
|
||||
.configureMacroDiv {
|
||||
display: grid;
|
||||
grid-template-rows: 1fr;
|
||||
min-width: 12rem;
|
||||
display: grid;
|
||||
grid-template-rows: 1fr;
|
||||
min-width: 12rem;
|
||||
}
|
||||
|
||||
.configureMacroDivItem {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.configureMacroDivItemButton {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.macroContainer {
|
||||
display: grid;
|
||||
grid-template-rows: repeat(auto-fill, 120px);
|
||||
grid-gap: 40px;
|
||||
|
||||
overflow-y: auto;
|
||||
max-height: 30em;
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
/* Mobile */
|
||||
display: grid;
|
||||
grid-template-rows: repeat(auto-fill, 120px);
|
||||
grid-gap: 40px;
|
||||
overflow-y: auto;
|
||||
max-height: 30em;
|
||||
padding: 2em;
|
||||
}
|
||||
@media screen and (max-width: 540px) {
|
||||
.macroContainer1 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
|
||||
.macroContainer2 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
|
||||
.macroContainer3 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
|
||||
.wideInputPromptInputEl {
|
||||
width: 20rem;
|
||||
max-width: 100%;
|
||||
height: 3rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Tablet */
|
||||
.macroContainer1 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
.macroContainer2 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
.macroContainer3 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
.wideInputPromptInputEl {
|
||||
width: 20rem;
|
||||
max-width: 100%;
|
||||
height: 3rem;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 540px) and (max-width: 780px) {
|
||||
.macroContainer1 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
|
||||
.macroContainer2 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
.macroContainer3 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
.wideInputPromptInputEl {
|
||||
width: 30rem;
|
||||
max-width: 100%;
|
||||
height: 20rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Everything else */
|
||||
.macroContainer1 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
.macroContainer2 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
.macroContainer3 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
.wideInputPromptInputEl {
|
||||
width: 30rem;
|
||||
max-width: 100%;
|
||||
height: 20rem;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 781px) {
|
||||
.macroContainer1 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
|
||||
.macroContainer2 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
.macroContainer3 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
.wideInputPromptInputEl {
|
||||
width: 40rem;
|
||||
max-width: 100%;
|
||||
height: 20rem;
|
||||
}
|
||||
}
|
||||
|
||||
.macroContainer1 {
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
}
|
||||
.macroContainer2 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
.macroContainer3 {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
.wideInputPromptInputEl {
|
||||
width: 40rem;
|
||||
max-width: 100%;
|
||||
height: 20rem;
|
||||
}
|
||||
}
|
||||
.addMacroBarContainer {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-around;
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-around;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.captureToActiveFileContainer {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.choiceNameHeader {
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.choiceNameHeader:hover {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.folderInputContainer {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 8px;
|
||||
gap: 4px;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 8px;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.selectMacroDropdownContainer {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.quickAddModal .modal {
|
||||
min-width: 35%;
|
||||
overflow-y: auto;
|
||||
max-height: 70%;
|
||||
min-width: 35%;
|
||||
overflow-y: auto;
|
||||
max-height: 70%;
|
||||
}
|
||||
|
||||
.checkboxRowContainer {
|
||||
display: grid;
|
||||
grid-template-rows: auto;
|
||||
align-content: center;
|
||||
margin: 30px 0px;
|
||||
display: grid;
|
||||
grid-template-rows: auto;
|
||||
align-content: center;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.checkboxRow {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-content: center;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.checkboxRow .checkbox-container {
|
||||
flex-shrink: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.checkboxRow span {
|
||||
font-size: 16px;
|
||||
word-break: break-all;
|
||||
font-size: 16px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.submitButtonContainer {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.chooseFolderWhenCreatingNoteContainer {
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-content: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.chooseFolderFromSubfolderContainer {
|
||||
margin: 20px 0 0 0;
|
||||
}
|
||||
|
||||
.clickable:hover {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.quickAddCommandListItem {
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
display: flex;
|
||||
flex: 1 1 auto;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.quickCommandContainer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-content: center;
|
||||
margin-bottom: 1em;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-content: center;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.yesNoPromptButtonContainer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
margin-top: 2rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.yesNoPromptParagraph {
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.qaFileSuggestionItem {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.qaFileSuggestionItem .suggestion-main-text {
|
||||
font-weight: bold;
|
||||
font-weight: bold;
|
||||
}
|
||||
.qaFileSuggestionItem .suggestion-sub-text {
|
||||
font-style: italic;
|
||||
font-style: italic;
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
{
|
||||
"recentFiles": [
|
||||
{
|
||||
"basename": "Server Tools",
|
||||
"path": "05.02 Networks/Server Tools.md"
|
||||
},
|
||||
{
|
||||
"basename": "@Main Dashboard",
|
||||
"path": "01.02 Home/@Main Dashboard.md"
|
||||
},
|
||||
{
|
||||
"basename": "2023-03-04 PSG - FC Nantes (4-2)",
|
||||
"path": "00.01 Admin/Calendars/Events/2023-03-04 PSG - FC Nantes (4-2).md"
|
||||
},
|
||||
{
|
||||
"basename": "Paris SG",
|
||||
"path": "02.02 Paris/Paris SG.md"
|
||||
},
|
||||
{
|
||||
"basename": "2023-03-04",
|
||||
"path": "00.01 Admin/Calendars/2023-03-04.md"
|
||||
},
|
||||
{
|
||||
"basename": "Bandes Dessinées",
|
||||
"path": "01.02 Home/Bandes Dessinées.md"
|
||||
},
|
||||
{
|
||||
"basename": "Life After Food",
|
||||
"path": "00.03 News/Life After Food.md"
|
||||
},
|
||||
{
|
||||
"basename": "2023-03-03",
|
||||
"path": "00.01 Admin/Calendars/2023-03-03.md"
|
||||
},
|
||||
{
|
||||
"basename": "@Shopping list",
|
||||
"path": "01.02 Home/@Shopping list.md"
|
||||
}
|
||||
],
|
||||
"omittedPaths": [],
|
||||
"maxLength": null,
|
||||
"openType": "tab"
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "recent-files-obsidian",
|
||||
"name": "Recent Files",
|
||||
"version": "1.3.5",
|
||||
"minAppVersion": "0.16.3",
|
||||
"description": "List files by most recently opened",
|
||||
"author": "Tony Grosinger",
|
||||
"authorUrl": "https://grosinger.net",
|
||||
"isDesktopOnly": false
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
.recent-files-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.recent-files-title-content {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.recent-files-file-delete {
|
||||
display: none;
|
||||
color: var(--nav-item-color);
|
||||
height: 17px;
|
||||
}
|
||||
|
||||
.recent-files-title:hover .recent-files-file-delete {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.recent-files-file-delete:hover {
|
||||
color: var(--nav-item-color-hover);
|
||||
}
|
||||
|
||||
.recent-files-donation {
|
||||
width: 70%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.recent-files-donate-button {
|
||||
margin: 10px;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue