Skip to content

Commit

Permalink
Added update notes modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Floydv149 committed Nov 27, 2023
1 parent ca01796 commit f2b460b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
- Now you can choose whether you want to insert a space between the book number and Bible book name.
- If you have the setting to automatically get the current line enabled, and select text and then execute the command to convert the text to a link, the selected text will now be converted instead of the whole line.
- Added setting to capitalize the first character of the Bible book link output.
- Addes setting to automatically add a space between the Bible book number and Bible book name, except for when you've already added one.
- Added setting to automatically add a space between the Bible book number and Bible book name, except for when you've already added one.
- Input is now being trimmed, so that unnecessary spaces are removed.
- If an error occurs, the initial input is not being removed anymore.
- Added "What's new" popup at startup after update.
- Updated README file.

## 1.2.1~1.2.2
Expand Down
40 changes: 40 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface PluginSettings {
makeItalic: boolean;
linkPrefix: string;
linkSuffix: string;
lastVersion: string;
}

const DEFAULT_SETTINGS: Partial<PluginSettings> = {
Expand All @@ -32,6 +33,7 @@ const DEFAULT_SETTINGS: Partial<PluginSettings> = {
makeItalic: false,
linkPrefix: "",
linkSuffix: "",
lastVersion: "",
};

export default class BibleLinkerPro extends Plugin {
Expand Down Expand Up @@ -304,6 +306,16 @@ export default class BibleLinkerPro extends Plugin {
this.registerInterval(
window.setInterval(() => console.log("setInterval"), 5 * 60 * 1000)
);

//Set current plugin version
const currentPluginVersion = "1.3.0";

//Update notes modal
if (currentPluginVersion != this.settings.lastVersion) {
this.settings.lastVersion = currentPluginVersion;
this.saveSettings();
new UpdateNotesModal(this.app).open();
}
}

onunload() {}
Expand Down Expand Up @@ -356,3 +368,31 @@ class InvalidInputModal extends Modal {
contentEl.empty();
}
}

class UpdateNotesModal extends Modal {
constructor(app: App) {
super(app);
}

onOpen() {
const { contentEl } = this;

contentEl.createEl("h2", {
text: "New update Bible linker Pro V.1.3.0",
});
contentEl.createEl("h3", { text: "What's new?" });
contentEl.innerHTML +=
"- Better recognition of Bible book names, acronyms and full versions.<br>- Now you can choose whether you want to insert a space between the book number and Bible book name.<br>- If you have the setting to automatically get the current line enabled, and select text and then execute the command to convert the text to a link, the selected text will now be converted instead of the whole line.<br>- Added setting to capitalize the first character of the Bible book link output.<br>- Added setting to automatically add a space between the Bible book number and Bible book name, except for when you've already added one.<br>- Input is now being trimmed, so that unnecessary spaces are removed.<br>- If an error occurs, the initial input is not being removed anymore.<br>- Updated README file.<br><br>";
const dismisButton = contentEl.createEl("button", {
text: "Dismiss",
});
dismisButton.addEventListener("click", () => {
this.close();
});
}

onClose() {
const { contentEl } = this;
contentEl.empty();
}
}

0 comments on commit f2b460b

Please sign in to comment.