mirror of
https://github.com/Ximi1970/systray-x.git
synced 2026-07-05 23:29:32 +02:00
Add new mail indicator option
This commit is contained in:
@@ -560,15 +560,17 @@ SysTrayX.Messaging = {
|
||||
"iconType",
|
||||
"iconMime",
|
||||
"icon",
|
||||
"theme",
|
||||
"showNumber",
|
||||
"showNewIndicator",
|
||||
"countType",
|
||||
"startupDelay",
|
||||
"numberColor",
|
||||
"numberSize",
|
||||
"numberAlignment",
|
||||
"numberMargins",
|
||||
"countType",
|
||||
"startupDelay",
|
||||
"theme",
|
||||
"newIndicatorType",
|
||||
"newShadeColor",
|
||||
"startApp",
|
||||
"startAppArgs",
|
||||
"closeApp",
|
||||
@@ -594,8 +596,11 @@ SysTrayX.Messaging = {
|
||||
const iconType = result.iconType || "0";
|
||||
const iconMime = result.iconMime || "image/png";
|
||||
const icon = result.icon || [];
|
||||
const theme = result.theme || "0";
|
||||
const showNumber = result.showNumber || "true";
|
||||
const showNewIndicator = result.showNewIndicator || "true";
|
||||
const countType = result.countType || "0";
|
||||
const startupDelay = result.startupDelay || "5";
|
||||
let numberColor = result.numberColor || "#000000";
|
||||
const numberSize = result.numberSize || "10";
|
||||
const numberAlignment = result.numberAlignment || "4";
|
||||
@@ -605,9 +610,8 @@ SysTrayX.Messaging = {
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
};
|
||||
const countType = result.countType || "0";
|
||||
const startupDelay = result.startupDelay || "5";
|
||||
const theme = result.theme || "0";
|
||||
const newIndicatorType = result.newIndicatorType || "2";
|
||||
const newShadeColor = result.newShadeColor || "#ff8000";
|
||||
const startApp = result.startApp || "";
|
||||
const startAppArgs = result.startAppArgs || "";
|
||||
const closeApp = result.closeApp || "";
|
||||
@@ -635,15 +639,17 @@ SysTrayX.Messaging = {
|
||||
iconType,
|
||||
iconMime,
|
||||
icon,
|
||||
theme,
|
||||
showNumber,
|
||||
showNewIndicator,
|
||||
countType,
|
||||
startupDelay,
|
||||
numberColor,
|
||||
numberSize,
|
||||
numberAlignment,
|
||||
numberMargins,
|
||||
countType,
|
||||
startupDelay,
|
||||
theme,
|
||||
newIndicatorType,
|
||||
newShadeColor,
|
||||
startApp,
|
||||
startAppArgs,
|
||||
closeApp,
|
||||
@@ -720,6 +726,41 @@ SysTrayX.Link = {
|
||||
|
||||
if (response["preferences"]) {
|
||||
// Store the preferences from the app
|
||||
const minimizeType = response["preferences"].minimizeType;
|
||||
if (minimizeType) {
|
||||
await storage().set({
|
||||
minimizeType: minimizeType,
|
||||
});
|
||||
}
|
||||
|
||||
const minimizeIconType = response["preferences"].minimizeIconType;
|
||||
if (minimizeIconType) {
|
||||
await storage().set({
|
||||
minimizeIconType: minimizeIconType,
|
||||
});
|
||||
}
|
||||
|
||||
const closeType = response["preferences"].closeType;
|
||||
if (closeType) {
|
||||
await storage().set({
|
||||
closeType: closeType,
|
||||
});
|
||||
}
|
||||
|
||||
const startMinimized = response["preferences"].startMinimized;
|
||||
if (startMinimized) {
|
||||
await storage().set({
|
||||
startMinimized: startMinimized,
|
||||
});
|
||||
}
|
||||
|
||||
const restorePositions = response["preferences"].restorePositions;
|
||||
if (restorePositions) {
|
||||
await storage().set({
|
||||
restorePositions: restorePositions,
|
||||
});
|
||||
}
|
||||
|
||||
const defaultIconMime = response["preferences"].defaultIconMime;
|
||||
if (defaultIconMime) {
|
||||
await storage().set({
|
||||
@@ -769,6 +810,13 @@ SysTrayX.Link = {
|
||||
});
|
||||
}
|
||||
|
||||
const theme = response["preferences"].theme;
|
||||
if (theme) {
|
||||
await storage().set({
|
||||
theme: theme,
|
||||
});
|
||||
}
|
||||
|
||||
const showNumber = response["preferences"].showNumber;
|
||||
if (showNumber) {
|
||||
await storage().set({
|
||||
@@ -783,6 +831,20 @@ SysTrayX.Link = {
|
||||
});
|
||||
}
|
||||
|
||||
const countType = response["preferences"].countType;
|
||||
if (countType) {
|
||||
await storage().set({
|
||||
countType: countType,
|
||||
});
|
||||
}
|
||||
|
||||
const startupDelay = response["preferences"].startupDelay;
|
||||
if (startupDelay) {
|
||||
await storage().set({
|
||||
startupDelay: startupDelay,
|
||||
});
|
||||
}
|
||||
|
||||
const numberColor = response["preferences"].numberColor;
|
||||
if (numberColor) {
|
||||
await storage().set({
|
||||
@@ -811,59 +873,17 @@ SysTrayX.Link = {
|
||||
});
|
||||
}
|
||||
|
||||
const countType = response["preferences"].countType;
|
||||
if (countType) {
|
||||
const newIndicatorType = response["preferences"].newIndicatorType;
|
||||
if (newIndicatorType) {
|
||||
await storage().set({
|
||||
countType: countType,
|
||||
newIndicatorType: newIndicatorType,
|
||||
});
|
||||
}
|
||||
|
||||
const startupDelay = response["preferences"].startupDelay;
|
||||
if (startupDelay) {
|
||||
const newShadeColor = response["preferences"].newShadeColor;
|
||||
if (newShadeColor) {
|
||||
await storage().set({
|
||||
startupDelay: startupDelay,
|
||||
});
|
||||
}
|
||||
|
||||
const minimizeType = response["preferences"].minimizeType;
|
||||
if (minimizeType) {
|
||||
await storage().set({
|
||||
minimizeType: minimizeType,
|
||||
});
|
||||
}
|
||||
|
||||
const minimizeIconType = response["preferences"].minimizeIconType;
|
||||
if (minimizeIconType) {
|
||||
await storage().set({
|
||||
minimizeIconType: minimizeIconType,
|
||||
});
|
||||
}
|
||||
|
||||
const closeType = response["preferences"].closeType;
|
||||
if (closeType) {
|
||||
await storage().set({
|
||||
closeType: closeType,
|
||||
});
|
||||
}
|
||||
|
||||
const startMinimized = response["preferences"].startMinimized;
|
||||
if (startMinimized) {
|
||||
await storage().set({
|
||||
startMinimized: startMinimized,
|
||||
});
|
||||
}
|
||||
|
||||
const restorePositions = response["preferences"].restorePositions;
|
||||
if (restorePositions) {
|
||||
await storage().set({
|
||||
restorePositions: restorePositions,
|
||||
});
|
||||
}
|
||||
|
||||
const theme = response["preferences"].theme;
|
||||
if (theme) {
|
||||
await storage().set({
|
||||
theme: theme,
|
||||
newShadeColor: newShadeColor,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -74,78 +74,17 @@ body {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#minimizeselect {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#minimizeiconselect {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#closeselect {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#defaulticonselect {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#iconselect {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#numberprops {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#themeselect {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#storageselect {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#startappselect {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 10px 10px 10px 10px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#minimizeselect,
|
||||
#minimizeiconselect,
|
||||
#closeselect,
|
||||
#defaulticonselect,
|
||||
#iconselect,
|
||||
#numberprops,
|
||||
#themeselect,
|
||||
#counttypeselect,
|
||||
#newindicatorselect,
|
||||
#storageselect,
|
||||
#startappselect,
|
||||
#closeappselect {
|
||||
width: 25em;
|
||||
border-style: solid;
|
||||
|
||||
@@ -333,124 +333,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="numberprops">
|
||||
<caption>
|
||||
__MSG_icons_number_options__
|
||||
</caption>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="numberColor">__MSG_icons_number_color__</label>
|
||||
<input
|
||||
type="color"
|
||||
id="numberColor"
|
||||
name="numberColor"
|
||||
value=""
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="numberSize">__MSG_icons_number_size__</label>
|
||||
<input
|
||||
type="number"
|
||||
id="numberSize"
|
||||
name="numberSize"
|
||||
value="0"
|
||||
min="1"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="numberAlignment"
|
||||
>__MSG_icons_number_alignment__</label
|
||||
>
|
||||
<select name="numberAlignment" id="numberAlignment">
|
||||
<option value="0">__MSG_icons_number_top_left__</option>
|
||||
<option value="1">__MSG_icons_number_top_center__</option>
|
||||
<option value="2">__MSG_icons_number_top_right__</option>
|
||||
<option value="3">__MSG_icons_number_middle_left__</option>
|
||||
<option value="4">__MSG_icons_number_middle_center__</option>
|
||||
<option value="5">__MSG_icons_number_middle_right__</option>
|
||||
<option value="6">__MSG_icons_number_bottom_left__</option>
|
||||
<option value="7">__MSG_icons_number_bottom_center__</option>
|
||||
<option value="8">__MSG_icons_number_bottom_right__</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>__MSG_icons_number_margins__</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input
|
||||
type="number"
|
||||
id="numberMarginLeft"
|
||||
name="numberMarginLeft"
|
||||
value="0"
|
||||
min="0"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
id="numberMarginTop"
|
||||
name="numberMarginTop"
|
||||
value="0"
|
||||
min="0"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
id="numberMarginRight"
|
||||
name="numberMarginRight"
|
||||
value="0"
|
||||
min="0"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
id="numberMarginBottom"
|
||||
name="numberMarginBottom"
|
||||
value="0"
|
||||
min="0"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="startupDelay">__MSG_icons_startup_delay__</label>
|
||||
<input
|
||||
type="number"
|
||||
id="startupDelay"
|
||||
name="startupDelay"
|
||||
value="5"
|
||||
min="0"
|
||||
max="99"
|
||||
step="1"
|
||||
size="2"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table id="themeselect">
|
||||
<caption>
|
||||
__MSG_icons_theme__
|
||||
@@ -507,30 +390,167 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="startupDelay">__MSG_count_startup_delay__</label>
|
||||
<input
|
||||
type="number"
|
||||
id="startupDelay"
|
||||
name="startupDelay"
|
||||
value="5"
|
||||
min="0"
|
||||
max="99"
|
||||
step="1"
|
||||
size="2"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
<tr id="counttype">
|
||||
<td>
|
||||
<label for="countType">__MSG_count_number_count_type__</label>
|
||||
<input
|
||||
type="radio"
|
||||
name="countType"
|
||||
id="numberUnread"
|
||||
value="0"
|
||||
/>
|
||||
<label for="numberUnread"
|
||||
>__MSG_count_number_count_unread__</label
|
||||
>
|
||||
<input type="radio" name="countType" id="numberNew" value="1" />
|
||||
<label for="numberNew">__MSG_count_number_count_new__</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<table id="counttypeselect">
|
||||
<caption>
|
||||
__MSG_count_number_count_type__
|
||||
</caption>
|
||||
<tr id="unreadtype">
|
||||
<td>
|
||||
<input type="radio" name="countType" id="numberUnread" value="0" />
|
||||
<label for="numberUnread">__MSG_count_number_count_unread__</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="newtype">
|
||||
<td>
|
||||
<input type="radio" name="countType" id="numberNew" value="1" />
|
||||
<label for="numberNew">__MSG_count_number_count_new__</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="numberprops">
|
||||
<caption>
|
||||
__MSG_count_number_options__
|
||||
</caption>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="numberColor">__MSG_count_number_color__</label>
|
||||
<input
|
||||
type="color"
|
||||
id="numberColor"
|
||||
name="numberColor"
|
||||
value=""
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="numberSize">__MSG_count_number_size__</label>
|
||||
<input
|
||||
type="number"
|
||||
id="numberSize"
|
||||
name="numberSize"
|
||||
value="0"
|
||||
min="1"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="numberAlignment"
|
||||
>__MSG_count_number_alignment__</label
|
||||
>
|
||||
<select name="numberAlignment" id="numberAlignment">
|
||||
<option value="0">__MSG_count_number_top_left__</option>
|
||||
<option value="1">__MSG_count_number_top_center__</option>
|
||||
<option value="2">__MSG_count_number_top_right__</option>
|
||||
<option value="3">__MSG_count_number_middle_left__</option>
|
||||
<option value="4">__MSG_count_number_middle_center__</option>
|
||||
<option value="5">__MSG_count_number_middle_right__</option>
|
||||
<option value="6">__MSG_count_number_bottom_left__</option>
|
||||
<option value="7">__MSG_count_number_bottom_center__</option>
|
||||
<option value="8">__MSG_count_number_bottom_right__</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>__MSG_count_number_margins__</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input
|
||||
type="number"
|
||||
id="numberMarginLeft"
|
||||
name="numberMarginLeft"
|
||||
value="0"
|
||||
min="0"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
id="numberMarginTop"
|
||||
name="numberMarginTop"
|
||||
value="0"
|
||||
min="0"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
id="numberMarginRight"
|
||||
name="numberMarginRight"
|
||||
value="0"
|
||||
min="0"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
<input
|
||||
type="number"
|
||||
id="numberMarginBottom"
|
||||
name="numberMarginBottom"
|
||||
value="0"
|
||||
min="0"
|
||||
max="999"
|
||||
step="1"
|
||||
size="3"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="newindicatorselect">
|
||||
<caption>
|
||||
__MSG_count_new_indicator__
|
||||
</caption>
|
||||
|
||||
<tr id="newindicatorround">
|
||||
<td>
|
||||
<input type="radio" name="newIndicatorType" id="newIndicatorRound" value="0" />
|
||||
<label for="newIndicatorRound">__MSG_count_new_indicator_round__</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="newindicatorstar">
|
||||
<td>
|
||||
<input type="radio" name="newIndicatorType" id="newIndicatorStar" value="1" />
|
||||
<label for="newIndicatorStar">__MSG_count_new_indicator_star__</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="newshade">
|
||||
<td>
|
||||
<input type="radio" name="newIndicatorType" id="newShade" value="2" />
|
||||
<label for="newShade">__MSG_count_new_shade_color__</label>
|
||||
<input type="color" name="newShadeColor" id="newShadeColor" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -202,6 +202,16 @@ SysTrayX.SaveOptions = {
|
||||
icon: iconBase64,
|
||||
});
|
||||
|
||||
//
|
||||
// Save theme preferences
|
||||
//
|
||||
const theme = document.querySelector('input[name="theme"]:checked').value;
|
||||
|
||||
// Store theme preferences
|
||||
await storage().set({
|
||||
theme: theme,
|
||||
});
|
||||
|
||||
//
|
||||
// Save show number state
|
||||
//
|
||||
@@ -223,13 +233,23 @@ SysTrayX.SaveOptions = {
|
||||
});
|
||||
|
||||
//
|
||||
// Save theme preferences
|
||||
// Save count type preferences
|
||||
//
|
||||
const theme = document.querySelector('input[name="theme"]:checked').value;
|
||||
|
||||
// Store theme preferences
|
||||
const countType = document.querySelector(
|
||||
'input[name="countType"]:checked'
|
||||
).value;
|
||||
await storage().set({
|
||||
theme: theme,
|
||||
countType: countType,
|
||||
});
|
||||
|
||||
//
|
||||
// Save startup delay
|
||||
//
|
||||
const startupDelay = document.querySelector(
|
||||
'input[name="startupDelay"]'
|
||||
).value;
|
||||
await storage().set({
|
||||
startupDelay: startupDelay,
|
||||
});
|
||||
|
||||
//
|
||||
@@ -291,23 +311,24 @@ SysTrayX.SaveOptions = {
|
||||
});
|
||||
|
||||
//
|
||||
// Save count type preferences
|
||||
// Save new indicator type
|
||||
//
|
||||
const countType = document.querySelector(
|
||||
'input[name="countType"]:checked'
|
||||
const newIndicatorType = document.querySelector(
|
||||
'input[name="newIndicatorType"]:checked'
|
||||
).value;
|
||||
|
||||
// Store neew indicator type
|
||||
await storage().set({
|
||||
countType: countType,
|
||||
newIndicatorType: newIndicatorType,
|
||||
});
|
||||
|
||||
//
|
||||
// Save startup delay
|
||||
// Save new shade color
|
||||
//
|
||||
const startupDelay = document.querySelector(
|
||||
'input[name="startupDelay"]'
|
||||
).value;
|
||||
let newShadeColor = document.querySelector('input[name="newShadeColor"]').value;
|
||||
|
||||
await storage().set({
|
||||
startupDelay: startupDelay,
|
||||
newShadeColor: `${newShadeColor}`,
|
||||
});
|
||||
|
||||
//
|
||||
@@ -353,6 +374,16 @@ SysTrayX.RestoreOptions = {
|
||||
SysTrayX.RestoreOptions.onDebugError
|
||||
);
|
||||
|
||||
//
|
||||
// Restore filters
|
||||
//
|
||||
await storage()
|
||||
.get("filters")
|
||||
.then(
|
||||
SysTrayX.RestoreOptions.setFilters,
|
||||
SysTrayX.RestoreOptions.onFiltersError
|
||||
);
|
||||
|
||||
//
|
||||
// Restore minimize type
|
||||
//
|
||||
@@ -454,13 +485,13 @@ SysTrayX.RestoreOptions = {
|
||||
);
|
||||
|
||||
//
|
||||
// Restore filters
|
||||
// Restore theme
|
||||
//
|
||||
await storage()
|
||||
.get("filters")
|
||||
.get("theme")
|
||||
.then(
|
||||
SysTrayX.RestoreOptions.setFilters,
|
||||
SysTrayX.RestoreOptions.onFiltersError
|
||||
SysTrayX.RestoreOptions.setTheme,
|
||||
SysTrayX.RestoreOptions.onThemeError
|
||||
);
|
||||
|
||||
//
|
||||
@@ -483,6 +514,26 @@ SysTrayX.RestoreOptions = {
|
||||
SysTrayX.RestoreOptions.onShowNewIndicatorError
|
||||
);
|
||||
|
||||
//
|
||||
// Restore count type
|
||||
//
|
||||
await storage()
|
||||
.get("countType")
|
||||
.then(
|
||||
SysTrayX.RestoreOptions.setCountType,
|
||||
SysTrayX.RestoreOptions.onCountTypeError
|
||||
);
|
||||
|
||||
//
|
||||
// Restore startup delay
|
||||
//
|
||||
await storage()
|
||||
.get("startupDelay")
|
||||
.then(
|
||||
SysTrayX.RestoreOptions.setStartupDelay,
|
||||
SysTrayX.RestoreOptions.ontartupDelayError
|
||||
);
|
||||
|
||||
//
|
||||
// Restore number color
|
||||
//
|
||||
@@ -524,33 +575,23 @@ SysTrayX.RestoreOptions = {
|
||||
);
|
||||
|
||||
//
|
||||
// Restore count type
|
||||
// Restore new indicator type
|
||||
//
|
||||
await storage()
|
||||
.get("countType")
|
||||
.get("newIndicatorType")
|
||||
.then(
|
||||
SysTrayX.RestoreOptions.setCountType,
|
||||
SysTrayX.RestoreOptions.onCountTypeError
|
||||
SysTrayX.RestoreOptions.setNewIndicatorType,
|
||||
SysTrayX.RestoreOptions.onNewIndicatorTypeError
|
||||
);
|
||||
|
||||
//
|
||||
// Restore startup delay
|
||||
// Restore new shade color
|
||||
//
|
||||
await storage()
|
||||
.get("startupDelay")
|
||||
.get("newShadeColor")
|
||||
.then(
|
||||
SysTrayX.RestoreOptions.setStartupDelay,
|
||||
SysTrayX.RestoreOptions.ontartupDelayError
|
||||
);
|
||||
|
||||
//
|
||||
// Restore theme
|
||||
//
|
||||
await storage()
|
||||
.get("theme")
|
||||
.then(
|
||||
SysTrayX.RestoreOptions.setTheme,
|
||||
SysTrayX.RestoreOptions.onThemeError
|
||||
SysTrayX.RestoreOptions.setNewShadeColor,
|
||||
SysTrayX.RestoreOptions.onNewShadeColorError
|
||||
);
|
||||
|
||||
//
|
||||
@@ -849,6 +890,22 @@ SysTrayX.RestoreOptions = {
|
||||
console.log(`Icon Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
// Restore theme callbacks
|
||||
//
|
||||
setTheme: function (result) {
|
||||
const theme = result.theme || "0";
|
||||
|
||||
const radioButton = document.querySelector(
|
||||
`input[name="theme"][value="${theme}"]`
|
||||
);
|
||||
radioButton.checked = true;
|
||||
},
|
||||
|
||||
onThemeError: function (error) {
|
||||
console.log(`Theme Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
// Restore show number state
|
||||
//
|
||||
@@ -877,6 +934,36 @@ SysTrayX.RestoreOptions = {
|
||||
console.log(`showNewIndicator Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
// Restore count type
|
||||
//
|
||||
setCountType: function (result) {
|
||||
const countType = result.countType || "0";
|
||||
|
||||
const radioButton = document.querySelector(
|
||||
`input[name="countType"][value="${countType}"]`
|
||||
);
|
||||
radioButton.checked = true;
|
||||
},
|
||||
|
||||
onCountTypeError: function (error) {
|
||||
console.log(`countType Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
// Restore startup delay
|
||||
//
|
||||
setStartupDelay: function (result) {
|
||||
const startupDelay = result.startupDelay || "5";
|
||||
|
||||
const input = document.querySelector(`input[name="startupDelay"]`);
|
||||
input.value = startupDelay;
|
||||
},
|
||||
|
||||
onStartupDelayError: function (error) {
|
||||
console.log(`StartupDelay Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
// Restore number color
|
||||
//
|
||||
@@ -952,49 +1039,33 @@ SysTrayX.RestoreOptions = {
|
||||
},
|
||||
|
||||
//
|
||||
// Restore count type
|
||||
// Restore new indicator type
|
||||
//
|
||||
setCountType: function (result) {
|
||||
const countType = result.countType || "0";
|
||||
setNewIndicatorType: function (result) {
|
||||
const newIndicatorType = result.newIndicatorType || "2";
|
||||
|
||||
const radioButton = document.querySelector(
|
||||
`input[name="countType"][value="${countType}"]`
|
||||
`input[name="newIndicatorType"][value="${newIndicatorType}"]`
|
||||
);
|
||||
radioButton.checked = true;
|
||||
},
|
||||
|
||||
onCountTypeError: function (error) {
|
||||
console.log(`countType Error: ${error}`);
|
||||
onNewIndicatorTypeError: function (error) {
|
||||
console.log(`newIndicatorType Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
// Restore startup delay
|
||||
// Restore number color
|
||||
//
|
||||
setStartupDelay: function (result) {
|
||||
const startupDelay = result.startupDelay || "5";
|
||||
setNewShadeColor: function (result) {
|
||||
const newShadeColor = result.newShadeColor || "#ff8000";
|
||||
|
||||
const input = document.querySelector(`input[name="startupDelay"]`);
|
||||
input.value = startupDelay;
|
||||
const input = document.querySelector(`input[name="newShadeColor"]`);
|
||||
input.value = newShadeColor;
|
||||
},
|
||||
|
||||
onStartupDelayError: function (error) {
|
||||
console.log(`StartupDelay Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
// Restore theme callbacks
|
||||
//
|
||||
setTheme: function (result) {
|
||||
const theme = result.theme || "0";
|
||||
|
||||
const radioButton = document.querySelector(
|
||||
`input[name="theme"][value="${theme}"]`
|
||||
);
|
||||
radioButton.checked = true;
|
||||
},
|
||||
|
||||
onThemeError: function (error) {
|
||||
console.log(`Theme Error: ${error}`);
|
||||
onNewShadeColorError: function (error) {
|
||||
console.log(`newShadeColor Error: ${error}`);
|
||||
},
|
||||
|
||||
//
|
||||
@@ -1201,6 +1272,31 @@ SysTrayX.StorageChanged = {
|
||||
let changed_icon = false;
|
||||
let changed_default_icon = false;
|
||||
for (let item of changedItems) {
|
||||
if (item === "minimizeType") {
|
||||
SysTrayX.RestoreOptions.setMinimizeType({
|
||||
minimizeType: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "minimizeIconType") {
|
||||
SysTrayX.RestoreOptions.setMinimizeIconType({
|
||||
minimizeIconType: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "closeType") {
|
||||
SysTrayX.RestoreOptions.setCloseType({
|
||||
closeType: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "startMinimized") {
|
||||
SysTrayX.RestoreOptions.setStartMinimized({
|
||||
startMinimized: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "restorePositions") {
|
||||
SysTrayX.RestoreOptions.setRestorePositions({
|
||||
restorePositions: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "iconMime") {
|
||||
SysTrayX.RestoreOptions.setIconMime({
|
||||
iconMime: changes[item].newValue,
|
||||
@@ -1238,6 +1334,11 @@ SysTrayX.StorageChanged = {
|
||||
hideDefaultIcon: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "theme") {
|
||||
SysTrayX.RestoreOptions.setTheme({
|
||||
theme: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "showNumber") {
|
||||
SysTrayX.RestoreOptions.setShowNumber({
|
||||
showNumber: changes[item].newValue,
|
||||
@@ -1248,6 +1349,16 @@ SysTrayX.StorageChanged = {
|
||||
showNewIndicator: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "countType") {
|
||||
SysTrayX.RestoreOptions.setCountType({
|
||||
countType: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "startupDelay") {
|
||||
SysTrayX.RestoreOptions.setStartupDelay({
|
||||
startupDelay: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "numberColor") {
|
||||
SysTrayX.RestoreOptions.setNumberColor({
|
||||
numberColor: changes[item].newValue,
|
||||
@@ -1268,44 +1379,14 @@ SysTrayX.StorageChanged = {
|
||||
numberMargins: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "countType") {
|
||||
SysTrayX.RestoreOptions.setCountType({
|
||||
countType: changes[item].newValue,
|
||||
if (item === "newIndicatorType") {
|
||||
SysTrayX.RestoreOptions.setIndicatorType({
|
||||
newIndicatorType: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "startupDelay") {
|
||||
SysTrayX.RestoreOptions.setStartupDelay({
|
||||
startupDelay: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "minimizeType") {
|
||||
SysTrayX.RestoreOptions.setMinimizeType({
|
||||
minimizeType: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "minimizeIconType") {
|
||||
SysTrayX.RestoreOptions.setMinimizeIconType({
|
||||
minimizeIconType: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "closeType") {
|
||||
SysTrayX.RestoreOptions.setCloseType({
|
||||
closeType: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "startMinimized") {
|
||||
SysTrayX.RestoreOptions.setStartMinimized({
|
||||
startMinimized: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "restorePositions") {
|
||||
SysTrayX.RestoreOptions.setRestorePositions({
|
||||
restorePositions: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "theme") {
|
||||
SysTrayX.RestoreOptions.setTheme({
|
||||
theme: changes[item].newValue,
|
||||
if (item === "newShadeColor") {
|
||||
SysTrayX.RestoreOptions.setNewShadeColor({
|
||||
newShadeColor: changes[item].newValue,
|
||||
});
|
||||
}
|
||||
if (item === "startApp") {
|
||||
@@ -1360,6 +1441,7 @@ SysTrayX.StorageChanged = {
|
||||
document.getElementById("minimizeiconselect").className = "active";
|
||||
document.getElementById("closeselect").className = "active";
|
||||
document.getElementById("themeselect").className = "active";
|
||||
document.getElementById("newindicatorselect").className = "active";
|
||||
document.getElementById("startappselect").className = "active";
|
||||
document.getElementById("closeappselect").className = "active";
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user