From 37b8d6d7a9b7f9d24de6459d4f85e28549d38f3e Mon Sep 17 00:00:00 2001 From: WardPearce Date: Thu, 19 Sep 2024 13:57:52 +1200 Subject: [PATCH] Start nodejs --- materialious/android/app/build.gradle | 4 ++-- materialious/electron/package.json | 2 +- materialious/package-lock.json | 4 ++-- materialious/package.json | 2 +- materialious/src/lib/i18n/locales/en.json | 2 +- materialious/src/routes/(app)/+layout.svelte | 24 ++++++++++++++++++++ update_versions.py | 2 +- 7 files changed, 32 insertions(+), 8 deletions(-) diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle index 717e6d0d..05670a89 100644 --- a/materialious/android/app/build.gradle +++ b/materialious/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "us.materialio.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 40 - versionName "1.4.3" + versionCode 41 + versionName "1.5.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/materialious/electron/package.json b/materialious/electron/package.json index 78bb6713..8c1dcbd2 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -1,6 +1,6 @@ { "name": "Materialious", - "version": "1.4.3", + "version": "1.5.0", "description": "Modern material design for Invidious.", "author": { "name": "Ward Pearce", diff --git a/materialious/package-lock.json b/materialious/package-lock.json index 2dc24ed4..951b6342 100644 --- a/materialious/package-lock.json +++ b/materialious/package-lock.json @@ -1,12 +1,12 @@ { "name": "materialious", - "version": "1.4.1", + "version": "1.4.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "materialious", - "version": "1.4.1", + "version": "1.4.3", "dependencies": { "@capacitor-community/electron": "^5.0.1", "@capacitor/android": "6.1.2", diff --git a/materialious/package.json b/materialious/package.json index fefa9e91..5acdb91b 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -1,6 +1,6 @@ { "name": "materialious", - "version": "1.4.3", + "version": "1.5.0", "private": true, "scripts": { "dev": "vite dev", diff --git a/materialious/src/lib/i18n/locales/en.json b/materialious/src/lib/i18n/locales/en.json index 5d687f8f..9d181d0e 100644 --- a/materialious/src/lib/i18n/locales/en.json +++ b/materialious/src/lib/i18n/locales/en.json @@ -124,7 +124,7 @@ "backgroundPlay": "Play audio in background", "dash": "Dash", "silenceSkipper": "Silence skipper (Experimental)", - "youtubeJsFallback": "Locally video processing fallback" + "youtubeJsFallback": "Local video processing fallback" }, "bookmarklet": "Bookmarklet", "instanceUrl": "Instance URL", diff --git a/materialious/src/routes/(app)/+layout.svelte b/materialious/src/routes/(app)/+layout.svelte index 72dc2ab2..9bd06955 100644 --- a/materialious/src/routes/(app)/+layout.svelte +++ b/materialious/src/routes/(app)/+layout.svelte @@ -123,6 +123,30 @@ notifications = feed.notifications; } + function channelListener(msg) { + console.log('[cordova] received:' + msg); + } + + function startupCallback(err) { + if (err) { + console.log(err); + } else { + console.log('Node.js Mobile Engine Started'); + nodejs.channel.send('Hello from Cordova!'); + } + } + + function startNodeProject() { + nodejs.channel.setListener(channelListener); + nodejs.start('main.js', startupCallback); + // To disable the stdout/stderr redirection to the Android logcat: + // nodejs.start('main.js', startupCallback, { redirectOutputToLogcat: false }); + } + + addEventListener('deviceready', () => { + startNodeProject(); + }); + onMount(async () => { ui(); diff --git a/update_versions.py b/update_versions.py index 493140ed..0c3afdc6 100644 --- a/update_versions.py +++ b/update_versions.py @@ -5,7 +5,7 @@ import json import os import re -LATEST_VERSION = "1.4.3" +LATEST_VERSION = "1.5.0" WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious") ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")