Skip to content

Commit

Permalink
Merge pull request #53 from jparkerweb/develop
Browse files Browse the repository at this point in the history
v1.10.5
  • Loading branch information
jparkerweb authored Dec 26, 2024
2 parents 8c4ac67 + 4b23d74 commit 832d56d
Show file tree
Hide file tree
Showing 16 changed files with 449 additions and 356 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to Rich Foot will be documented in this file.

## [1.10.5] - 2024-12-26
### 📦 Updated
- Support for more date formats in `frontmatter` created/modified fields (ISO, space-separated, and just date)

## [1.10.4] - 2024-12-23
### 🐛 Fixed
- Fixed issue with Rich Foot not loading all user defined colors when Obsidian is restarted
Expand Down
4 changes: 4 additions & 0 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## 🛑 Exclude Me Please

### [1.10.5] - 2024-12-26
#### 📦 Updated
- Support for more date formats in `frontmatter` created/modified fields (ISO, space-separated, and just date)

### [1.10.4] - 2024-12-23
#### 🐛 Fixed
- Fixed issue with Rich Foot not loading all user defined colors when Obsidian is restarted
Expand Down
Binary file modified example-vault.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"showReleaseNotes": true,
"lastVersion": "2.16.2",
"showRefreshIcon": true,
"showViewImageIcon": false,
"showViewImageIcon": true,
"hidePixelBannerFields": true,
"hidePropertiesSectionIfOnlyBanner": true,
"titleColor": "var(--inline-title-color)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
"[data-type=\"thino_view\"]"
],
"frontmatterExclusionField": "",
"lastVersion": "1.10.3"
"lastVersion": "1.10.4"
}
116 changes: 43 additions & 73 deletions example-vault/rich-foot-example/.obsidian/plugins/rich-foot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,35 +107,12 @@ var ReleaseNotesModal = class extends import_obsidian.Modal {
};

// virtual-module:virtual:release-notes
var releaseNotes = '<h2>\u{1F6D1} Exclude Me Please</h2>\n<h3>[1.10.4] - 2024-12-23</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Fixed issue with Rich Foot not loading all user defined colors when Obsidian is restarted</li>\n</ul>\n<h3>[1.10.3] - 2024-12-14</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Improved parent selector matching to properly detect and exclude Rich Foot when specified selectors are present in the view or its parent elements</li>\n</ul>\n<h3>[1.10.2] - 2024-12-11</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Missing <code>Excluded Folders</code> section in the settings</li>\n</ul>\n<h3>[1.10.1] - 2024-12-10</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Extra padding on the bottom of the editor in Canvas / Kanban Cards</li>\n</ul>\n<h3>[1.10.0] - 2024-12-08</h3>\n<h4>\u2728 Added</h4>\n<ul>\n<li>Exclusion rule via <code>frontmatter</code> field</li>\n<li>Custom exclusions using specified DOM parent selectors for advanced control</li>\n</ul>\n<p><a href="https://raw.githubusercontent.com/jparkerweb/ref/refs/heads/main/equill-labs/rich-foot/rich-foot-v1.10.0.jpg"><img src="https://raw.githubusercontent.com/jparkerweb/ref/refs/heads/main/equill-labs/rich-foot/rich-foot-v1.10.0.jpg" alt="screenshot"></a></p>\n';
var releaseNotes = '<h2>\u{1F6D1} Exclude Me Please</h2>\n<h3>[1.10.5] - 2024-12-26</h3>\n<h4>\u{1F4E6} Updated</h4>\n<ul>\n<li>Support for more date formats in <code>frontmatter</code> created/modified fields (ISO, space-separated, and just date)</li>\n</ul>\n<h3>[1.10.4] - 2024-12-23</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Fixed issue with Rich Foot not loading all user defined colors when Obsidian is restarted</li>\n</ul>\n<h3>[1.10.3] - 2024-12-14</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Improved parent selector matching to properly detect and exclude Rich Foot when specified selectors are present in the view or its parent elements</li>\n</ul>\n<h3>[1.10.2] - 2024-12-11</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Missing <code>Excluded Folders</code> section in the settings</li>\n</ul>\n<h3>[1.10.1] - 2024-12-10</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Extra padding on the bottom of the editor in Canvas / Kanban Cards</li>\n</ul>\n<h3>[1.10.0] - 2024-12-08</h3>\n<h4>\u2728 Added</h4>\n<ul>\n<li>Exclusion rule via <code>frontmatter</code> field</li>\n<li>Custom exclusions using specified DOM parent selectors for advanced control</li>\n</ul>\n<p><a href="https://raw.githubusercontent.com/jparkerweb/ref/refs/heads/main/equill-labs/rich-foot/rich-foot-v1.10.0.jpg"><img src="https://raw.githubusercontent.com/jparkerweb/ref/refs/heads/main/equill-labs/rich-foot/rich-foot-v1.10.0.jpg" alt="screenshot"></a></p>\n';

// src/settings.js
var import_obsidian2 = require("obsidian");
var DEFAULT_SETTINGS = {
borderWidth: 1,
borderStyle: "dashed",
borderOpacity: 1,
borderRadius: 15,
datesOpacity: 1,
linksOpacity: 1,
showReleaseNotes: true,
excludedFolders: [],
dateColor: "var(--text-accent)",
borderColor: "var(--text-accent)",
linkColor: "var(--link-color)",
linkBackgroundColor: "var(--tag-background)",
linkBorderColor: "rgba(255, 255, 255, 0.204)",
customCreatedDateProp: "",
customModifiedDateProp: "",
dateDisplayFormat: "mmmm dd, yyyy",
showBacklinks: true,
showOutlinks: true,
showDates: true,
combineLinks: false,
updateDelay: 3e3,
excludedParentSelectors: [],
frontmatterExclusionField: ""
};

// src/utils.js
function rgbToHex(color) {
if (color.startsWith("hsl")) {
const temp = document.createElement("div");
Expand Down Expand Up @@ -188,6 +165,33 @@ function formatDate(date, format) {
});
return result;
}

// src/settings.js
var DEFAULT_SETTINGS = {
borderWidth: 1,
borderStyle: "dashed",
borderOpacity: 1,
borderRadius: 15,
datesOpacity: 1,
linksOpacity: 1,
showReleaseNotes: true,
excludedFolders: [],
dateColor: "var(--text-accent)",
borderColor: "var(--text-accent)",
linkColor: "var(--link-color)",
linkBackgroundColor: "var(--tag-background)",
linkBorderColor: "rgba(255, 255, 255, 0.204)",
customCreatedDateProp: "",
customModifiedDateProp: "",
dateDisplayFormat: "mmmm dd, yyyy",
showBacklinks: true,
showOutlinks: true,
showDates: true,
combineLinks: false,
updateDelay: 3e3,
excludedParentSelectors: [],
frontmatterExclusionField: ""
};
var RichFootSettingTab = class extends import_obsidian2.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
Expand Down Expand Up @@ -646,42 +650,6 @@ var FolderSuggestModal = class extends import_obsidian2.FuzzySuggestModal {
};

// src/main.js
function formatDate2(date, format) {
const d = new Date(date);
const year = d.getFullYear();
const month = d.getMonth();
const day = d.getDate();
const weekday = d.getDay();
const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
const monthsShort = months.map((m) => m.slice(0, 3));
const weekdays = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
const weekdaysShort = weekdays.map((w) => w.slice(0, 3));
const pad = (num) => num.toString().padStart(2, "0");
const tokens = {
"dddd": weekdays[weekday],
"ddd": weekdaysShort[weekday],
"dd": pad(day),
"d": day.toString(),
"mmmm": months[month],
"mmm": monthsShort[month],
"mm": pad(month + 1),
"m": (month + 1).toString(),
"yyyy": year.toString(),
"yy": year.toString().slice(-2)
};
const sortedTokens = Object.keys(tokens).sort((a, b) => b.length - a.length);
let result = format;
const replacements = /* @__PURE__ */ new Map();
sortedTokens.forEach((token, index) => {
const placeholder = `__${index}__`;
replacements.set(placeholder, tokens[token]);
result = result.replace(new RegExp(token, "g"), placeholder);
});
replacements.forEach((value, placeholder) => {
result = result.replace(new RegExp(placeholder, "g"), value);
});
return result;
}
var RichFootPlugin = class extends import_obsidian3.Plugin {
async onload() {
await this.loadSettings();
Expand Down Expand Up @@ -916,7 +884,7 @@ var RichFootPlugin = class extends import_obsidian3.Plugin {
}
async createRichFoot(file) {
const richFoot = createDiv({ cls: "rich-foot rich-foot--hidden" });
const richFootDashedLine = richFoot.createDiv({ cls: "rich-foot--dashed-line" });
richFoot.createDiv({ cls: "rich-foot--dashed-line" });
const backlinksData = this.app.metadataCache.getBacklinksForFile(file);
const outlinks = await this.getOutlinks(file);
if (this.settings.combineLinks) {
Expand Down Expand Up @@ -1032,16 +1000,17 @@ var RichFootPlugin = class extends import_obsidian3.Plugin {
}
}
if (isValidDate) {
const datePart = tempDate.split("T")[0];
const dateStr = tempDate.includes("T") ? tempDate : `${datePart}T00:00:00`;
const dateObj = new Date(dateStr);
modifiedDate = formatDate2(dateObj, this.settings.dateDisplayFormat);
if (!tempDate.includes("T") && !tempDate.includes(" ")) {
tempDate = `${tempDate}T00:00:00`;
}
const dateObj = new Date(tempDate);
modifiedDate = formatDate(dateObj, this.settings.dateDisplayFormat);
} else {
modifiedDate = modifiedDate;
}
} else {
modifiedDate = new Date(file.stat.mtime);
modifiedDate = formatDate2(modifiedDate, this.settings.dateDisplayFormat);
modifiedDate = formatDate(modifiedDate, this.settings.dateDisplayFormat);
}
datesWrapper.createDiv({
cls: "rich-foot--modified-date",
Expand Down Expand Up @@ -1076,16 +1045,17 @@ var RichFootPlugin = class extends import_obsidian3.Plugin {
}
}
if (isValidDate) {
const datePart = tempDate.split("T")[0];
const dateStr = tempDate.includes("T") ? tempDate : `${datePart}T00:00:00`;
const dateObj = new Date(dateStr);
createdDate = formatDate2(dateObj, this.settings.dateDisplayFormat);
if (!tempDate.includes("T") && !tempDate.includes(" ")) {
tempDate = `${tempDate}T00:00:00`;
}
const dateObj = new Date(tempDate);
createdDate = formatDate(dateObj, this.settings.dateDisplayFormat);
} else {
createdDate = createdDate;
}
} else {
createdDate = new Date(file.stat.ctime);
createdDate = formatDate2(createdDate, this.settings.dateDisplayFormat);
createdDate = formatDate(createdDate, this.settings.dateDisplayFormat);
}
datesWrapper.createDiv({
cls: "rich-foot--created-date",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "rich-foot",
"name": "Rich Foot",
"version": "1.10.4",
"version": "1.10.5",
"minAppVersion": "1.5.0",
"description": "Adds backlink tags and created/modified dates to the footer of your notes.",
"author": "Justin Parker (eQui\\\\ Labs)",
Expand Down
Loading

0 comments on commit 832d56d

Please sign in to comment.