Skip to content

Commit

Permalink
v 0.2.9-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
drlight17 authored Oct 26, 2024
1 parent 9bd1ec5 commit 07a86a9
Show file tree
Hide file tree
Showing 9 changed files with 323 additions and 40 deletions.
326 changes: 291 additions & 35 deletions main.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions nextcloud_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function checkURL(auto_login){
//window.location.replace("/apps/spreed")
}
} else {

// to force show app window if not logged in
// 5s timeout to pass SSO procedure
if (!(auto_login)) {
Expand All @@ -92,6 +93,8 @@ function checkURL(auto_login){
$("#alternative-logins > a").hide();
}
setTimeout(function() {
// check localStorage to drop unread counter
recalc_counters_summary(true);
console.log(JSON.stringify({action: "force_show_app_win"}));
}, 5000);
} else {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"icon": "icon.png",
"main": "./main.js",
"version": "0.2.8-alpha",
"version": "0.2.9-alpha",
"author": "drlight17",
"build": {
"appId": "com.electron.talk-electron",
Expand Down Expand Up @@ -80,6 +80,7 @@
"dependencies": {
"@electron/packager": "latest",
"@paymoapp/electron-shutdown-handler": "latest",
"desktop-idle": "^1.3.0",
"electron-fetch": "^1.9.1",
"electron-prompt": "latest",
"electron-store": "^8.2.0",
Expand All @@ -88,6 +89,7 @@
"devDependencies": {
"@paymoapp/electron-shutdown-handler": "latest",
"electron": "^22.3.27",
"electron-builder": "^24.13.3"
"electron-builder": "^24.13.3",
"electron-rebuild": "^3.2.9"
}
}
8 changes: 5 additions & 3 deletions package.json.linux
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"icon": "icon.png",
"main": "./main.js",
"version": "0.2.8-alpha",
"version": "0.2.9-alpha",
"author": "Yuri Samoilov <[email protected]>",
"homepage": "https://github.com/drlight17/talk-electron",
"build": {
Expand Down Expand Up @@ -65,14 +65,16 @@
"dependencies": {
"@electron/packager": "latest",
"@paymoapp/electron-shutdown-handler": "latest",
"electron-prompt": "latest",
"desktop-idle": "^1.3.0",
"electron-fetch": "^1.9.1",
"electron-prompt": "latest",
"electron-store": "^8.2.0",
"sharp": "^0.32"
},
"devDependencies": {
"@paymoapp/electron-shutdown-handler": "latest",
"electron": "^22.3.27",
"electron-builder": "^24.13.3"
"electron-builder": "^24.13.3",
"electron-rebuild": "^3.2.9"
}
}
4 changes: 4 additions & 0 deletions settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
<input type='hidden' value=false name='start_hidden'>
<input type="checkbox" value=true name="start_hidden" id="start_hidden">
<label id="start_hidden_id" for="start_hidden"></label>
<br>
<!--<input type='hidden' value=false name='allow_multiple'>
<input type="checkbox" value=true name="allow_multiple" id="allow_multiple">
<label id="allow_multiple_id" for="allow_multiple"></label>-->
<br><br>
<div class="buttons">
<button id="save_button_id" type="submit" onclick="return saveSettings();"></button>
Expand Down
6 changes: 6 additions & 0 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ function loadSettings(settings,locales) {
} else {
document.getElementById('start_hidden').checked = false;
}

/*if (settings.allow_multiple !== undefined) {
document.getElementById('allow_multiple').checked = settings.allow_multiple;
} else {
document.getElementById('allow_multiple').checked = false;
}*/
}

function saveSettings() {
Expand Down
2 changes: 2 additions & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"allow_domain": "Allow SSO from domains (* for any):",
"auto_login": "Try to login automatically (if SSO is configured)",
"run_at_startup": "Autorun app during system startup",
"allow_multiple": "Allow multiple app instances with own confirations",
"use_server_icon": "Use server logo icon",
"show_on_new_message": "Show app on new message receive",
"always_on_top": "App always on top",
Expand Down Expand Up @@ -49,6 +50,7 @@
"copy": "Copy",
"cut": "Cut",
"select_all": "Select all",
"new_version": "New version available: ",
"paste": "Paste",
"about": "About",
"user_settings_link": "User settings",
Expand Down
2 changes: 2 additions & 0 deletions translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"allow_domain_title": "Несколько значений через запятую, * - wildcard (может обозначать любой поддомен)",
"allow_domain": "Разрешить SSO с доменов (* для всех):",
"auto_login": "Попробовать войти автоматически (для настроенного SSO)",
"allow_multiple": "Разрешить запуск нескольких процессов приложения с различной конфигурацией",
"run_at_startup": "Автозапуск при входе пользователя",
"use_server_icon": "Использовать логотип сервера",
"show_on_new_message": "Показывать окно чата при получении сообщения",
Expand Down Expand Up @@ -49,6 +50,7 @@
"copy": "Скопировать",
"cut": "Вырезать",
"select_all": "Выбрать всё",
"new_version": "Доступна новая версия: ",
"paste": "Вставить",
"about": "О программе",
"user_settings_link": "Настройки пользователя",
Expand Down
6 changes: 6 additions & 0 deletions unread_observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function getItemsByPartialKey(partialKey) {
}

function recalc_counters_summary (removed) {

let totalUnreadMessages = 0;
try {
// Шаг 1: Извлечение данных из localStorage
Expand Down Expand Up @@ -59,14 +60,19 @@ function recalc_counters_summary (removed) {

// Шаг 5: Вывод результата
//console.log(`Общее количество непрочитанных сообщений: ${totalUnreadMessages}`);
if (removed) {
localStorage.removeItem(found_key);
}
console.log(JSON.stringify({'action': {'unread': totalUnreadMessages, 'removed': removed}}));
return found_key;

} catch (error) {
console.log(JSON.stringify({'action': {'unread': 0, 'removed': removed}}));
//console.error('Произошла ошибка при обработке "_cachedConversations":', error);
}
}


// Сохраняем оригинальные методы localStorage
const originalSetItem = localStorage.setItem;
const originalRemoveItem = localStorage.removeItem;
Expand Down

0 comments on commit 07a86a9

Please sign in to comment.