Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 34 additions & 27 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,21 @@ <h6 id="new-feature-title" class="rest align-content-center small text-left"></h
$("#new-feature").hide();

//new feature message
if (require("./update.json")["feature-introduction"] && !store.has("introduced-" + require("./update.json").version)) {
$("#new-feature-title").html(require("./update.json")["introduce"][store.get("i18n")]["title"]);
$("#new-feature-description").html(require("./update.json")["introduce"][store.get("i18n")]["description"][process.platform]);
$("#new-feature-description-universal").html(require("./update.json")["introduce"][store.get("i18n")]["description"]["universal"]);
//$("#new-feature-image").attr("src", require("./update.json")["introduce"][store.get("i18n")]["image"]);
const updateInfo = require("./update.json");
const { getLanguageValue } = require("./update-language");
const introduction = getLanguageValue(updateInfo.introduce, store.get("i18n"));
if (updateInfo["feature-introduction"] && introduction && !store.has("introduced-" + updateInfo.version)) {
$("#new-feature-title").html(introduction["title"]);
$("#new-feature-description").html(introduction["description"][process.platform]);
$("#new-feature-description-universal").html(introduction["description"]["universal"]);
//$("#new-feature-image").attr("src", introduction["image"]);
$("#new-feature").show();
$("#bottom-btn").hide();
$("#set").hide();
$("#all-sum").hide();
$("#statistics").hide();
$("#settings").hide();
store.set("introduced-" + require("./update.json").version, true);
store.set("introduced-" + updateInfo.version, true);
}

function newFeatureClose() {
Expand All @@ -379,11 +382,12 @@ <h6 id="new-feature-title" class="rest align-content-center small text-left"></h
onlyrest = true;
let countdownTime = store.has("simple-countdown-time") ? store.get("simple-countdown-time") : 2;
let countdownFocus = store.has("simple-countdown-focus") ? store.get("simple-countdown-focus") : false;
$("#rest-time-onlyrest").val(shi.ArabicNumberTimeParser(countdownTime, {
as: 'm',
lang: store.get("i18n").replace(/-/g, '_'),
ignoreError: true
}));
// $("#rest-time-onlyrest").val(shi.ArabicNumberTimeParser(countdownTime, {
// as: 'm',
// lang: store.get("i18n").replace(/-/g, '_'),
// ignoreError: true
// }));
$("#rest-time-onlyrest").val(countdownTime);
document.getElementById("focus-rest-set-onlyrest").checked = countdownFocus;
allSet();
$("#rest-time-onlyrest").focus();
Expand Down Expand Up @@ -489,12 +493,13 @@ <h6 id="new-feature-title" class="rest align-content-center small text-left"></h
let calculatedRestTime = workTimeGet * getBreakPercentage();
restTimeGet = removeRedundantEnd(calculatedRestTime);
// Format the display value for the input field
$("#rest-time").val(shi.ArabicNumberTimeParser(restTimeGet, {
lang: store.get("i18n").toString().replace("-", "_"),
as: "m",
to: "m",
ignoreError: true
}));
// $("#rest-time").val(shi.ArabicNumberTimeParser(restTimeGet, {
// lang: store.get("i18n").toString().replace("-", "_"),
// as: "m",
// to: "m",
// ignoreError: true
// }));
$("#rest-time").val(restTimeGet);
} else
restTimeGet = shi.humanTimeParser($("#rest-time").val(), {
as: "m",
Expand Down Expand Up @@ -568,16 +573,18 @@ <h6 id="new-feature-title" class="rest align-content-center small text-left"></h

function defaultSet(name, workTime, restTime, loops, focusWhenWorking, focusWhenResting) {
$("#expand-left").html(name);
$("#work-time").val(shi.ArabicNumberTimeParser(workTime, {
as: 'm',
lang: store.get("i18n").replace(/-/g, '_'),
ignoreError: true
}));
$("#rest-time").val(shi.ArabicNumberTimeParser(restTime, {
as: 'm',
lang: store.get("i18n").replace(/-/g, '_'),
ignoreError: true
}));
// $("#work-time").val(shi.ArabicNumberTimeParser(workTime, {
// as: 'm',
// lang: store.get("i18n").replace(/-/g, '_'),
// ignoreError: true
// }));
// $("#rest-time").val(shi.ArabicNumberTimeParser(restTime, {
// as: 'm',
// lang: store.get("i18n").replace(/-/g, '_'),
// ignoreError: true
// }));
$("#work-time").val(workTime);
$("#rest-time").val(restTime);
if (loops > 1) $("#loop").val(loops + ' ' + i18n.__('times'));
else $("#loop").val(loops + ' ' + i18n.__('times').replace(new RegExp('s(?!\w)', "g"), ""));
document.getElementById("focus-work-set").checked = focusWhenWorking;
Expand Down
Loading
Loading