From cb608838156eb55819736951d6670b6bb2dadd99 Mon Sep 17 00:00:00 2001 From: zuluwi <111116092+zuluwi@users.noreply.github.com> Date: Thu, 7 Mar 2024 07:23:20 +0300 Subject: [PATCH] edited setting names + updated minAppVersion --- manifest.json | 2 +- src/language/locale/en.ts | 28 +++++++-------- src/language/locale/tr.ts | 32 ++++++++--------- src/settings.ts | 75 +++++++++++++++------------------------ src/vlcHelper.ts | 5 +++ versions.json | 16 ++++----- 6 files changed, 72 insertions(+), 86 deletions(-) diff --git a/manifest.json b/manifest.json index 6dfbf2c..75abafa 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "id": "vlc-bridge", "name": "VLC Bridge", "version": "0.0.7", - "minAppVersion": "0.15.0", + "minAppVersion": "1.4.11", "description": "It allows you to control VLC Player via Obsidian and add a timestamped link or snapshot from the current video to your note. By clicking on these timestamped links, you can reopen the video at the specified time in VLC Player.", "author": "zuluwi", "authorUrl": "https://github.com/zuluwi", diff --git a/src/language/locale/en.ts b/src/language/locale/en.ts index 7fe8802..f8c338e 100644 --- a/src/language/locale/en.ts +++ b/src/language/locale/en.ts @@ -24,7 +24,7 @@ export default { "Snapshot not found, if you made a change to the snapshot folder name, try restarting VLC.", /* settings */ - "VLC Path": "VLC Path", + "VLC path": "VLC path", "Select 'vlc.exe' from the folder where VLC Player is installed": "Select 'vlc.exe' from the folder where VLC Player is installed", "Select vlc.exe": "Select vlc.exe", Port: "Port", @@ -38,22 +38,22 @@ export default { "Allows you to open more precise (sub-second) time values. It is recommended to enable this option if you want to open exactly the same frame as when you get the link.": "Allows you to open more precise (sub-second) time values. It is recommended to enable this option if you want to open exactly the same frame as when you get the link.", "Show 'open video' icon in the sidebar": "Show 'open video' icon in the sidebar", - "Timestamp Offset": "Timestamp Offset", + "Timestamp offset (in seconds)": "Timestamp offset (in seconds)", // - "Link Templates": "Link Templates", - "Timestamp Link": "Timestamp Link", - "Timestamp Linktext": "Timestamp Linktext", - "Timestamp Template": "Timestamp Template", - "Snapshot Embed": "Snapshot Embed", - "Snapshot Path": "Snapshot Path", - "Snapshot Linktext": "Snapshot Linktext", - "Snapshot Template": "Snapshot Template", + "Link templates": "Link templates", + "Timestamp link": "Timestamp link", + "Timestamp linktext": "Timestamp linktext", + "Timestamp template": "Timestamp template", + "Snapshot embed": "Snapshot embed", + "Snapshot path": "Snapshot path", + "Snapshot linktext": "Snapshot linktext", + "Snapshot template": "Snapshot template", Placeholders: "Placeholders", // - "Seeking Amounts": "Seeking Amounts", - "Normal Seek Amount (in seconds)": "Normal Seek Amount (in seconds)", + "Seeking amounts": "Seeking amounts", + "Normal seek amount (in seconds)": "Normal seek amount (in seconds)", "Set the seek amount for 'Seek forward/backward' commands": "Set the seek amount for 'Seek forward/backward' commands", - "Long Seek Amount (in seconds)": "Long Seek Amount (in seconds)", + "Long seek amount (in seconds)": "Long seek amount (in seconds)", "Set the seek amount for 'Long seek forward/backward' commands": "Set the seek amount for 'Long seek forward/backward' commands", // Snapshot: "Snapshot", @@ -63,7 +63,7 @@ export default { "Snapshot Format": "Snapshot Format", "Select the image format in which the snapshots will be saved": "Select the image format in which the snapshots will be saved", // - "Syncplay Path": "Syncplay Path", + "Syncplay path": "Syncplay path", "Select 'Syncplay.exe' from the folder where Syncplay is installed": "Select 'Syncplay.exe' from the folder where Syncplay is installed", "Select Syncplay.exe": "Select Syncplay.exe", "Start Syncplay with plugin arguments": "Start Syncplay with plugin arguments", diff --git a/src/language/locale/tr.ts b/src/language/locale/tr.ts index a7f130d..d5f663f 100644 --- a/src/language/locale/tr.ts +++ b/src/language/locale/tr.ts @@ -24,7 +24,7 @@ export default { "Snapshot bulunamadı, eğer snapshot klasörü adında bir değişiklik yaptıysanız VLC'yi yeniden başlatmayı deneyiniz.", /* settings */ - "VLC Path": "VLC Yolu", + "VLC path": "VLC dosya yolu", "Select 'vlc.exe' from the folder where VLC Player is installed": "VLC Player'ın kurulu olduğu klasörden vlc.exe'yi seçiniz", "Select vlc.exe": "vlc.exe'yi seç", Port: "Port", @@ -38,25 +38,25 @@ export default { "Allows you to open more precise (sub-second) time values. It is recommended to enable this option if you want to open exactly the same frame as when you get the link.": "Daha isabetli zaman değerlerini açmanıza olanak tanır. Eğer tam olarak link aldığınızdaki aynı kareyi açmak istiyorsanız bu ayarı kullanmanız önerilir.", "Show 'open video' icon in the sidebar": "Yan çubukta 'video aç' ikonunu göster", - "Timestamp Offset": "Zaman Damgası Gecikmesi", + "Timestamp offset (in seconds)": "Zaman damgası gecikmesi (saniye cinsinden)", // - "Link Templates": "Link Şablonları", - "Timestamp Link": "Zaman Damgası Linki", - "Timestamp Linktext": "Zaman Damgası Link Yazısı", - "Timestamp Template": "Zaman Damgası Şablonu", - "Snapshot Embed": "Snapshot", - "Snapshot Path": "Snapshot Adresi", - "Snapshot Linktext": "Snapshot Açıklaması", - "Snapshot Template": "Snapshot Şablonu", + "Link templates": "Link şablonları", + "Timestamp link": "Zaman damgası linki", + "Timestamp linktext": "Zaman damgası link yazısı", + "Timestamp template": "Zaman damgası şablonu", + "Snapshot embed": "Snapshot", + "Snapshot path": "Snapshot adresi", + "Snapshot linktext": "Snapshot açıklaması", + "Snapshot template": "Snapshot şablonu", Placeholders: "Kullanılabilir Bilgiler", // - "Seeking Amounts": "İleri/Geri Sarma Miktarları", - "Normal Seek Amount (in seconds)": "Normal İleri/Geri Sarma Miktarı (saniye cinsinden)", - "Set the seek amount for 'Seek forward/backward' commands": "İleri/Geri Sar komutları için atmala miktarını seçiniz", - "Long Seek Amount (in seconds)": "Uzun İleri/Geri Sarma Miktarı (saniye cinsinden)", - "Set the seek amount for 'Long seek forward/backward' commands": "Uzun İleri/Geri Sar komutları için atmala miktarını seçiniz", + "Seeking amounts": "İleri/Geri sarma miktarları", + "Normal seek amount (in seconds)": "Normal ileri/geri sarma miktarı (saniye cinsinden)", + "Set the seek amount for 'Seek forward/backward' commands": "'İleri/Geri sar' komutları için atmala miktarını seçiniz", + "Long seek amount (in seconds)": "Uzun ileri/geri sarma Miktarı (saniye cinsinden)", + "Set the seek amount for 'Long seek forward/backward' commands": "'Uzun ileri/geri sar' komutları için atmala miktarını seçiniz", // - "Syncplay Path": "Syncplay Yolu", + "Syncplay path": "Syncplay yolu", "Select 'Syncplay.exe' from the folder where Syncplay is installed": "Syncplay'in kurulu olduğu klasörden Syncplay.exe'yi seçiniz", "Select Syncplay.exe": "Syncplay.exe'yi seç", "Start Syncplay with plugin arguments": "Plugin argümanlarıyla Syncplay'i çalıştır", diff --git a/src/settings.ts b/src/settings.ts index 24fbadd..d20c518 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -4,11 +4,6 @@ import { t } from "./language/helpers"; import { currentConfig } from "./vlcHelper"; import isPortReachable from "is-port-reachable"; -declare module "obsidian" { - interface DataAdapter { - getFullRealPath(arg: string): string; - } -} export interface VBPluginSettings { port: number; password: string; @@ -117,7 +112,7 @@ export class VBPluginSettingsTab extends PluginSettingTab { createFragment((el) => { MarkdownRenderer.render( this.app, - `## \\!\\[[ {{${t("Snapshot Path")}}} | **${this.plugin.settings.snapshotLinktext}** ]] \n#### ${t("Placeholders")} \n- \`{{filename}}\` \n- \`{{timestamp}}\` \n`, + `## \\!\\[[ {{${t("Snapshot path")}}} | **${this.plugin.settings.snapshotLinktext}** ]] \n#### ${t("Placeholders")} \n- \`{{filename}}\` \n- \`{{timestamp}}\` \n`, el.createDiv(), "", this.plugin @@ -128,7 +123,7 @@ export class VBPluginSettingsTab extends PluginSettingTab { let selectVLCDescEl: HTMLElement; const selectVLC = new Setting(containerEl) - .setName(t("VLC Path")) + .setName(t("VLC path")) .setDesc(t("Select 'vlc.exe' from the folder where VLC Player is installed")) .addButton((btn) => { btn.setButtonText(t("Select vlc.exe")).onClick(() => { @@ -218,7 +213,7 @@ export class VBPluginSettingsTab extends PluginSettingTab { let tsOffsetSlider: SliderComponent; let tsOffsetText: TextComponent; new Setting(containerEl) - .setName(t("Timestamp Offset")) + .setName(t("Timestamp offset (in seconds)")) .addSlider((slider) => { tsOffsetSlider = slider; slider @@ -235,26 +230,21 @@ export class VBPluginSettingsTab extends PluginSettingTab { .addText((text) => { tsOffsetText = text; text.setValue(this.plugin.settings.timestampOffset.toString()).onChange(async (value) => { - if (!Number.isInteger(Number(value))) { - text.inputEl.addClass("warning"); - } else { - text.inputEl.removeClass("warning"); - this.plugin.settings.timestampOffset = Number(value); - await this.plugin.saveSettings(); - tsOffsetSlider.setValue(this.plugin.settings.timestampOffset); - } + this.plugin.settings.timestampOffset = Number(value); + await this.plugin.saveSettings(); + tsOffsetSlider.setValue(this.plugin.settings.timestampOffset); }); - + text.inputEl.type = "number"; text.inputEl.addClasses(["vlc-bridge-text-input", "number"]); }); } - new Setting(containerEl).setName(t("Link Templates")).setHeading(); + new Setting(containerEl).setName(t("Link templates")).setHeading(); - new Setting(containerEl).setName(t("Timestamp Link")).setHeading(); + new Setting(containerEl).setName(t("Timestamp link")).setHeading(); const tsLinkTextSetting = new Setting(containerEl) - .setName(t("Timestamp Linktext")) + .setName(t("Timestamp linktext")) .addText((text) => { text .setPlaceholder(this.plugin.settings.timestampLinktext) @@ -276,7 +266,7 @@ export class VBPluginSettingsTab extends PluginSettingTab { ); new Setting(containerEl) - .setName(t("Timestamp Template")) + .setName(t("Timestamp template")) .setDesc( createFragment((el) => { MarkdownRenderer.render(this.app, `#### ${t("Placeholders")} \n- \`{{timestamplink}}\` \n- \`{{filename}}\` \n- \`{{timestamp}}\`\n`, el.createDiv(), "", this.plugin); @@ -304,10 +294,10 @@ export class VBPluginSettingsTab extends PluginSettingTab { }) ); - containerEl.createEl("h2", { text: t("Snapshot Embed") }); + containerEl.createEl("h2", { text: t("Snapshot embed") }); const ssLinkTextSetting = new Setting(containerEl) - .setName(t("Snapshot Linktext")) + .setName(t("Snapshot linktext")) .addText((text) => { text .setPlaceholder(this.plugin.settings.snapshotLinktext) @@ -327,7 +317,7 @@ export class VBPluginSettingsTab extends PluginSettingTab { }) ); new Setting(containerEl) - .setName(t("Snapshot Template")) + .setName(t("Snapshot template")) .setDesc( createFragment((el) => { MarkdownRenderer.render( @@ -361,12 +351,12 @@ export class VBPluginSettingsTab extends PluginSettingTab { }) ); - new Setting(containerEl).setName(t("Seeking Amounts")).setHeading(); + new Setting(containerEl).setName(t("Seeking amounts")).setHeading(); let seekOffsetSlider: SliderComponent; let seekOffsetText: TextComponent; new Setting(containerEl) - .setName(t("Normal Seek Amount (in seconds)")) + .setName(t("Normal seek amount (in seconds)")) .setDesc(t("Set the seek amount for 'Seek forward/backward' commands")) .addSlider((slider) => { seekOffsetSlider = slider; @@ -383,28 +373,23 @@ export class VBPluginSettingsTab extends PluginSettingTab { .addText((text) => { seekOffsetText = text; text.setValue(this.plugin.settings.normalSeek.toString()).onChange(async (value) => { - if (!Number.isInteger(Number(value))) { - text.inputEl.addClass("warning"); - } else { - text.inputEl.removeClass("warning"); - this.plugin.settings.normalSeek = Number(value); - await this.plugin.saveSettings(); - seekOffsetSlider.setValue(this.plugin.settings.normalSeek); - } + this.plugin.settings.normalSeek = Number(value); + await this.plugin.saveSettings(); + seekOffsetSlider.setValue(this.plugin.settings.normalSeek); }); - + text.inputEl.type = "number"; text.inputEl.addClasses(["vlc-bridge-text-input", "number"]); }); let longSeekOffsetSlider: SliderComponent; let longSeekOffsetText: TextComponent; new Setting(containerEl) - .setName(t("Long Seek Amount (in seconds)")) + .setName(t("Long seek amount (in seconds)")) .setDesc(t("Set the seek amount for 'Long seek forward/backward' commands")) .addSlider((slider) => { longSeekOffsetSlider = slider; slider - .setLimits(5, 10 * 60, 5) + .setLimits(0, 10 * 60, 5) .setDynamicTooltip() .setValue(this.plugin.settings.largeSeek) .onChange(async (value) => { @@ -416,16 +401,12 @@ export class VBPluginSettingsTab extends PluginSettingTab { .addText((text) => { longSeekOffsetText = text; text.setValue(this.plugin.settings.largeSeek.toString()).onChange(async (value) => { - if (!Number.isInteger(Number(value))) { - text.inputEl.addClass("warning"); - } else { - text.inputEl.removeClass("warning"); - this.plugin.settings.largeSeek = Number(value); - await this.plugin.saveSettings(); - longSeekOffsetSlider.setValue(this.plugin.settings.largeSeek); - } + this.plugin.settings.largeSeek = Number(value); + await this.plugin.saveSettings(); + longSeekOffsetSlider.setValue(this.plugin.settings.largeSeek); }); - + text.inputEl.type = "number"; + text.inputEl.step = "5"; text.inputEl.addClasses(["vlc-bridge-text-input", "number"]); }); @@ -477,7 +458,7 @@ export class VBPluginSettingsTab extends PluginSettingTab { let selectSPDescEl: HTMLElement; const selectSP = new Setting(containerEl) - .setName(t("Syncplay Path")) + .setName(t("Syncplay path")) .setDesc(t("Select 'Syncplay.exe' from the folder where Syncplay is installed")) .addButton((btn) => { btn diff --git a/src/vlcHelper.ts b/src/vlcHelper.ts index c5a01a8..2676903 100644 --- a/src/vlcHelper.ts +++ b/src/vlcHelper.ts @@ -8,6 +8,11 @@ import { t } from "./language/helpers"; import { fileURLToPath } from "url"; import isPortReachable from "is-port-reachable"; +declare module "obsidian" { + interface DataAdapter { + getFullRealPath(arg: string): string; + } +} interface config { port: number | null; password: string | null; diff --git a/versions.json b/versions.json index adca0e8..273112d 100644 --- a/versions.json +++ b/versions.json @@ -1,10 +1,10 @@ { - "0.0.1": "0.15.0", - "0.0.11": "0.15.0", - "0.0.2": "0.15.0", - "0.0.3": "0.15.0", - "0.0.4": "0.15.0", - "0.0.5": "0.15.0", - "0.0.6": "0.15.0", - "0.0.7": "0.15.0" + "0.0.1": "1.4.11", + "0.0.11": "1.4.11", + "0.0.2": "1.4.11", + "0.0.3": "1.4.11", + "0.0.4": "1.4.11", + "0.0.5": "1.4.11", + "0.0.6": "1.4.11", + "0.0.7": "1.4.11" } \ No newline at end of file