Skip to content

Commit

Permalink
Update 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Floydv149 committed Jan 14, 2024
1 parent 7832144 commit 39db8e6
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 95 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Bible linker Pro Changelog

## 1.5.2 Community plugin

- Fixed code issues in order to be a better candidate for addition to the community plugins.

## 1.5.1 - Bug fixes

- Fixed incorrect text of an error message.
Expand Down
34 changes: 0 additions & 34 deletions ExampleView.ts

This file was deleted.

35 changes: 20 additions & 15 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { MainSettingTab } from "settings";
// import { ExampleView, VIEW_TYPE_EXAMPLE } from "ExampleView";
import * as translations from "translations.json";
import { moment } from "obsidian";

import {
App,
Expand Down Expand Up @@ -41,12 +42,12 @@ const DEFAULT_SETTINGS: Partial<PluginSettings> = {
lastVersion: "",
};

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

export default class BibleLinkerPro extends Plugin {
settings: PluginSettings;

//Set current plugin version
currentPluginVersion = this.manifest.version;

getTranslation(key: string) {
const langBase = this.getLangBase();
const attemptTranslating =
Expand All @@ -70,6 +71,16 @@ export default class BibleLinkerPro extends Plugin {
async onload() {
await this.loadSettings();

console.log("Bible linker Pro V." + this.currentPluginVersion);

if (moment.locale() == "en" || moment.locale() == "nl") {
this.settings.pluginLanguage = moment.locale();
} else {
this.settings.pluginLanguage = "en";
}

await this.saveSettings();

// this.registerView(VIEW_TYPE_EXAMPLE, (leaf) => new ExampleView(leaf));

// this.addRibbonIcon("canvas", "Activate view", () => {
Expand Down Expand Up @@ -431,14 +442,9 @@ export default class BibleLinkerPro extends Plugin {
// This adds a settings tab so the user can configure various aspects of the plugin
this.addSettingTab(new MainSettingTab(this.app, this));

// When registering intervals, this function will automatically clear the interval when the plugin is disabled.
this.registerInterval(
window.setInterval(() => console.log(), 5 * 60 * 1000)
);

//Update notes modal
if (currentPluginVersion != this.settings.lastVersion) {
this.settings.lastVersion = currentPluginVersion;
if (this.currentPluginVersion != this.settings.lastVersion) {
this.settings.lastVersion = this.currentPluginVersion;
this.saveSettings();
new UpdateNotesModal(this.app).open();
}
Expand Down Expand Up @@ -500,6 +506,8 @@ class ErrorModal extends Modal {
}

class UpdateNotesModal extends Modal {
plugin: BibleLinkerPro;

constructor(app: App) {
super(app);
}
Expand All @@ -508,14 +516,11 @@ class UpdateNotesModal extends Modal {
const { contentEl } = this;

contentEl.createEl("h2", {
text: "New update: Bible linker Pro V." + currentPluginVersion,
text: "New update to Bible linker Pro",
});
contentEl.createEl("h3", { text: "What's new?" });
contentEl.createEl("p", {
text: "- Fixed incorrect text of an error message.",
});
contentEl.createEl("p", {
text: "- Fixed bug where single verse Bible links could not be generated.",
text: "- Fixed code issues in order to be a better candidate for addition to the community plugins.",
});

const dismisButton = contentEl.createEl("button", {
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"id": "bible-linker-pro",
"name": "Bible linker Pro",
"version": "1.5.1",
"version": "1.5.2",
"minAppVersion": "0.15.0",
"description": "This is a plugin that converts Bible texts to JW Library links.",
"description": "Convert Bible texts to JW Library links.",
"author": "Floydv149",
"authorUrl": "https://floydv.rf.gd",
"isDesktopOnly": false
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bible-linker-pro",
"version": "1.5.1",
"version": "1.5.2",
"description": "This is a plugin that converts Bible texts to JW Library links.",
"main": "main.js",
"style": "styles.css",
Expand Down
57 changes: 25 additions & 32 deletions settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ export class MainSettingTab extends PluginSettingTab {
const { containerEl } = this;

containerEl.empty();
containerEl.createEl("h1", { text: "Bible linker Pro " });
containerEl.createEl("h3", {
text: "ℹ️ " + this.getTranslation("ABOUT"),
});

new Setting(containerEl)
.setName("ℹ️ " + this.getTranslation("ABOUT"))
.setHeading();

containerEl.createEl("p", {
text: this.getTranslation("CREATED_WITH_LOVE") + " Floydv149",
});
Expand All @@ -50,34 +51,26 @@ export class MainSettingTab extends PluginSettingTab {
text: this.getTranslation("CHANGELOG"),
href: "https://github.com/Floydv149/bibleLinkerPro/blob/main/CHANGELOG.MD",
});
containerEl.createEl("br");
containerEl.createEl("br");

containerEl.createEl("hr");

containerEl.createEl("h3", {
text: "⚙️ " + this.getTranslation("SETTINGS"),
});

containerEl.createEl("h4", {
text: "🏠 " + this.getTranslation("MAIN"),
});
// new Setting(containerEl)
// .setName(this.getTranslation("LANGUAGE"))
// .setDesc("")
// .addDropdown((String) =>
// String.addOption("en", "English")
// .addOption("nl", "Nederlands")
// .setValue(this.plugin.settings.pluginLanguage)
// .onChange(async (value) => {
// this.plugin.settings.pluginLanguage = value;
// await this.plugin.saveSettings();
// this.display();
// })
// );

new Setting(containerEl)
.setName(this.getTranslation("LANGUAGE"))
.setDesc("")
.addDropdown((String) =>
String.addOption("en", "English")
.addOption("nl", "Nederlands")
.setValue(this.plugin.settings.pluginLanguage)
.onChange(async (value) => {
this.plugin.settings.pluginLanguage = value;
await this.plugin.saveSettings();
this.display();
})
);

containerEl.createEl("h4", {
text: "🧠 " + this.getTranslation("PROCESSING"),
});
.setName("🧠 " + this.getTranslation("PROCESSING"))
.setHeading();

new Setting(containerEl)
.setName(this.getTranslation("EXPAND_BIBLE_BOOK_NAME"))
Expand Down Expand Up @@ -115,9 +108,9 @@ export class MainSettingTab extends PluginSettingTab {
)
);

containerEl.createEl("h4", {
text: "🖌️ " + this.getTranslation("STYLING"),
});
new Setting(containerEl)
.setName("🖌️ " + this.getTranslation("STYLING"))
.setHeading();

new Setting(containerEl)
.setName(this.getTranslation("CAPITALIZE_FIRST_CHARACTER"))
Expand Down
8 changes: 0 additions & 8 deletions styles.css

This file was deleted.

2 changes: 0 additions & 2 deletions translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"DOCUMENTATION": "Documentation",
"CHANGELOG": "Changelog",
"SETTINGS": "Settings",
"MAIN": "Main",
"LANGUAGE": "Language",
"PROCESSING": "Processing",
"EXPAND_BIBLE_BOOK_NAME": "Expand Bible book name",
Expand Down Expand Up @@ -39,7 +38,6 @@
"DOCUMENTATION": "Documentatie",
"CHANGELOG": "Wijzigingslogboek",
"SETTINGS": "Instellingen",
"MAIN": "Algemeen",
"LANGUAGE": "Taal",
"PROCESSING": "Verwerking",
"EXPAND_BIBLE_BOOK_NAME": "Breid Bijbelboek naam uit",
Expand Down

0 comments on commit 39db8e6

Please sign in to comment.