Skip to content

Commit

Permalink
Merge pull request #72 from jparkerweb/develop
Browse files Browse the repository at this point in the history
v2.11.0
  • Loading branch information
jparkerweb authored Nov 30, 2024
2 parents 6fce8da + 6bd85f5 commit 2b79661
Show file tree
Hide file tree
Showing 16 changed files with 330 additions and 50 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 the Pixel Banner plugin will be documented in this file.

## v2.11.0
#### ✨ Added
- Abity to 📌 Pin URL banners

## v2.10.2
#### 🐛 Fixed
- Banners were being applied to the background of embedded media (images, videos, etc.)
Expand Down
21 changes: 4 additions & 17 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
## 🎉 What's New

### v2.10.2
#### 🐛 Fixed
- Banners were being applied to the background of embedded media (images, videos, etc.)

#### 📦 Updated
- Improved Pexels API key validation

### v2.10.1
### v2.11.0
#### ✨ Added
- Color Picker Reset button for Folder Images tab (only applies if Inline Titles are enabled in Obsidian Settings)
- Ability to 📌 Pin URL banners

#### 🐛 Fixed
- Display the correct color in the Color Picker for Inline Titles when the control is reset
_Great for when you find a URL for an image you want to use in Pixel Banner, you can quickly save it by adding the URL and then "Pinning" it._

### v2.10.0
#### ✨ Added
- Color Picker for Inline Titles
- Only applied if Inline Titles are enabled in Obsidian Settings:
- `Appearance` > `Show inline title`
- Can be defined on the General, Custom Field Names, and Folder Images tabs
[![screenshot](https://raw.githubusercontent.com/jparkerweb/pixel-banner/refs/heads/main/img/releases/pixel-banner-v2.11.0.jpg)](https://raw.githubusercontent.com/jparkerweb/pixel-banner/refs/heads/main/img/releases/pixel-banner-v2.11.0.jpg)
Binary file modified example-vault.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pinned": [
"pexels-banner:pin-banner-image",
"pexels-banner:refresh-banner-image"
]
}
11 changes: 10 additions & 1 deletion example-vault/pixel-banner-example/.obsidian/hotkeys.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Mod",
"Shift"
],
"key": "D"
"key": "K"
}
],
"advanced-cursors:add-next-match-to-selections": [
Expand Down Expand Up @@ -67,5 +67,14 @@
],
"key": "ArrowUp"
}
],
"app:delete-file": [
{
"modifiers": [
"Mod",
"Shift"
],
"key": "D"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"apiProvider": "all",
"pexelsApiKey": "",
"pexelsApiKey": "RoKgyYgLEu0BEzqw5Z4LMnknOquciriNYvtfEe2yHh0sbVLG422J58qq",
"pixabayApiKey": "",
"flickrApiKey": "",
"unsplashApiKey": "",
Expand Down Expand Up @@ -69,7 +69,7 @@
"showPinIcon": true,
"pinnedImageFolder": "pixel-banner-images",
"showReleaseNotes": true,
"lastVersion": "2.10.2",
"lastVersion": "2.11.0",
"showRefreshIcon": true,
"hidePixelBannerFields": true,
"hidePropertiesSectionIfOnlyBanner": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ var ReleaseNotesModal = class extends import_obsidian2.Modal {
};

// virtual-module:virtual:release-notes
var releaseNotes = "<h2>\u{1F389} What&#39;s New</h2>\n<h3>v2.10.2</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Banners were being applied to the background of embedded media (images, videos, etc.)</li>\n</ul>\n<h4>\u{1F4E6} Updated</h4>\n<ul>\n<li>Improved Pexels API key validation</li>\n</ul>\n<h3>v2.10.1</h3>\n<h4>\u2728 Added</h4>\n<ul>\n<li>Color Picker Reset button for Folder Images tab (only applies if Inline Titles are enabled in Obsidian Settings)</li>\n</ul>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Display the correct color in the Color Picker for Inline Titles when the control is reset</li>\n</ul>\n<h3>v2.10.0</h3>\n<h4>\u2728 Added</h4>\n<ul>\n<li>Color Picker for Inline Titles<ul>\n<li>Only applied if Inline Titles are enabled in Obsidian Settings:<ul>\n<li><code>Appearance</code> &gt; <code>Show inline title</code></li>\n</ul>\n</li>\n<li>Can be defined on the General, Custom Field Names, and Folder Images tabs</li>\n</ul>\n</li>\n</ul>\n";
var releaseNotes = '<h2>\u{1F389} What&#39;s New</h2>\n<h3>v2.11.0</h3>\n<h4>\u2728 Added</h4>\n<ul>\n<li><p>Ability to \u{1F4CC} Pin URL banners</p>\n<p><em>Great for when you find a URL for an image you want to use in Pixel Banner, you can quickly save it by adding the URL and then &quot;Pinning&quot; it.</em></p>\n</li>\n</ul>\n<p><a href="https://raw.githubusercontent.com/jparkerweb/pixel-banner/refs/heads/main/img/releases/pixel-banner-v2.11.0.jpg"><img src="https://raw.githubusercontent.com/jparkerweb/pixel-banner/refs/heads/main/img/releases/pixel-banner-v2.11.0.jpg" alt="screenshot"></a></p>\n';

// src/main.js
module.exports = class PixelBannerPlugin extends import_obsidian3.Plugin {
Expand Down Expand Up @@ -1281,7 +1281,7 @@ module.exports = class PixelBannerPlugin extends import_obsidian3.Plugin {
}
}
const inputType = this.getInputType(bannerImage);
const canPin = imageUrl && inputType === "keyword" && this.settings.showPinIcon;
const canPin = imageUrl && (inputType === "keyword" || inputType === "url") && this.settings.showPinIcon;
if (checking) return canPin;
if (canPin) {
setTimeout(() => handlePinIconClick(imageUrl, this, usedField), 0);
Expand Down Expand Up @@ -2144,7 +2144,7 @@ module.exports = class PixelBannerPlugin extends import_obsidian3.Plugin {
const frontmatterContentStart = getFrontmatterValue(frontmatter, this.settings.customContentStartField);
const effectiveContentStart = (_b = frontmatterContentStart != null ? frontmatterContentStart : folderSpecific == null ? void 0 : folderSpecific.contentStartPosition) != null ? _b : this.settings.contentStartPosition;
this.applyContentStartPosition(viewContent, effectiveContentStart);
if (!isEmbedded && inputType === "keyword" && this.settings.showPinIcon) {
if (!isEmbedded && (inputType === "keyword" || inputType === "url") && this.settings.showPinIcon) {
const refreshIcon = container.querySelector(":scope > .refresh-icon");
if (pinIcon) {
pinIcon.style.display = "block";
Expand All @@ -2164,7 +2164,7 @@ module.exports = class PixelBannerPlugin extends import_obsidian3.Plugin {
}
};
}
if (refreshIcon && this.settings.showRefreshIcon) {
if (refreshIcon && inputType === "keyword" && this.settings.showRefreshIcon) {
refreshIcon.style.display = "block";
refreshIcon.onclick = async () => {
try {
Expand All @@ -2177,6 +2177,8 @@ module.exports = class PixelBannerPlugin extends import_obsidian3.Plugin {
new import_obsidian3.Notice("\u{1F62D} Failed to refresh image");
}
};
} else if (refreshIcon) {
refreshIcon.style.display = "none";
}
} else {
if (pinIcon) pinIcon.style.display = "none";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "pexels-banner",
"name": "Pixel Banner",
"version": "2.10.2",
"version": "2.11.0",
"minAppVersion": "1.6.0",
"description": "Apply an image from various sources as a banner to your notes.",
"author": "Justin Parker (eQui\\\\ Labs)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"customCreatedDateProp": "",
"customModifiedDateProp": "",
"dateDisplayFormat": "mmmm dd, yyyy",
"lastVersion": "1.7.2",
"lastVersion": "1.8.0",
"showBacklinks": true,
"showOutlinks": true,
"showDates": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var ReleaseNotesModal = class extends import_obsidian.Modal {
};

// virtual-module:virtual:release-notes
var releaseNotes = '<h2>\u{1F4C6} Dates Your Way</h2>\n<h3>v1.7.2</h3>\n<h4>\u2728 Added</h4>\n<ul>\n<li><code>Date Display Format</code> option to allow users to specify their own date format</li>\n</ul>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Date not formatted correctly if timestamp was included in the Custom Created/Modified Date Property</li>\n</ul>\n<h3>v1.7.1</h3>\n<h4>\u{1F41B} Fixed</h4>\n<ul>\n<li>Note embeds in canvas now have the correct height</li>\n<li>Duplicate &quot;show dates&quot; option in settings</li>\n</ul>\n<h4>\u2728 Added</h4>\n<ul>\n<li>If using custom created/modified date properties, the date now displays in the format of &quot;Month Day, Year&quot; if in proper date format, otherwise it displays the raw frontmatter filed string value.</li>\n</ul>\n<h3>v1.7.0</h3>\n<h4>\u2728 Added</h4>\n<ul>\n<li><code>Custom Created/Modified Date Property</code> fields to allow users to specify their own frontmatter properties for dates, useful when file system dates are affected by sync processes and you track them separately.</li>\n</ul>\n<p><a href="https://raw.githubusercontent.com/jparkerweb/rich-foot/refs/heads/develop/img/releases/rich-foot-v1.7.0.jpg"><img src="https://raw.githubusercontent.com/jparkerweb/rich-foot/refs/heads/develop/img/releases/rich-foot-v1.7.0.jpg" alt="screenshot"></a></p>\n';
var releaseNotes = '<h2>\u{1FAE3} Page Preview Support</h2>\n<h3>[1.8.0] - 2024-11-29</h3>\n<h4>\u2728 Added</h4>\n<ul>\n<li>Support for <code>Page Preview</code> core plugin for <code>Outlinks</code> &amp; <code>Backlinks</code></li>\n</ul>\n<p><a href="https://raw.githubusercontent.com/jparkerweb/rich-foot/refs/heads/main/img/releases/rich-foot-v1.8.0.jpg"><img src="https://raw.githubusercontent.com/jparkerweb/rich-foot/refs/heads/main/img/releases/rich-foot-v1.8.0.jpg" alt="screenshot"></a></p>\n';

// src/main.js
var DEFAULT_SETTINGS = {
Expand Down Expand Up @@ -352,8 +352,10 @@ var RichFootPlugin = class extends import_obsidian2.Plugin {
const li = backlinksUl.createEl("li");
const link = li.createEl("a", {
href: linkPath,
text: linkPath.split("/").pop().slice(0, -3)
text: linkPath.split("/").pop().slice(0, -3),
cls: this.isEditMode() ? "cm-hmd-internal-link" : "internal-link"
});
link.dataset.href = linkPath;
link.addEventListener("click", (event) => {
event.preventDefault();
this.app.workspace.openLinkText(linkPath, file.path);
Expand All @@ -375,8 +377,10 @@ var RichFootPlugin = class extends import_obsidian2.Plugin {
const li = outlinksUl.createEl("li");
const link = li.createEl("a", {
href: linkPath,
text: displayName
text: displayName,
cls: this.isEditMode() ? "cm-hmd-internal-link" : "internal-link"
});
link.dataset.href = linkPath;
link.addEventListener("click", (event) => {
event.preventDefault();
this.app.workspace.openLinkText(linkPath, file.path);
Expand Down Expand Up @@ -552,6 +556,12 @@ var RichFootPlugin = class extends import_obsidian2.Plugin {
}
return this.settings.excludedFolders.some((folder) => filePath.startsWith(folder));
}
isEditMode() {
var _a, _b;
const activeView = this.app.workspace.getActiveViewOfType(import_obsidian2.MarkdownView);
if (!activeView) return false;
return ((_b = (_a = activeView.getMode) == null ? void 0 : _a.call(activeView)) != null ? _b : activeView.mode) === "source";
}
};
var RichFootSettingTab = class extends import_obsidian2.PluginSettingTab {
constructor(app, plugin) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "rich-foot",
"name": "Rich Foot",
"version": "1.7.2",
"version": "1.8.0",
"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 2b79661

Please sign in to comment.