diff options
author | Mango0x45 <thomasvoss@live.com> | 2021-05-14 20:20:45 +0200 |
---|---|---|
committer | Mango0x45 <thomasvoss@live.com> | 2021-05-14 20:20:45 +0200 |
commit | 7c2c4b47cb6c756952de542451d9c4b86ee3628f (patch) | |
tree | 05752398244210379a3896d6dfcda476f1dbf781 | |
parent | 94ac64a92e9d43b7bf20fccca9329b16cb931097 (diff) |
Reformatted
-rw-r--r-- | main.js | 45 | ||||
-rw-r--r-- | settings.js | 6 |
2 files changed, 24 insertions, 27 deletions
@@ -25,19 +25,14 @@ function compute() document.getElementById("time").value = time; document.getElementById("mod_message").disabled = false; - document.getElementById("mod_message").innerText = generate_mod_message(fps, - s_time, - e_time, - time, - s_frame, - e_frame, - frames, - seconds); + document.getElementById("mod_message").innerText = generate_mod_message( + fps, s_time, e_time, time, s_frame, e_frame, frames, seconds); document.getElementById("mod_message_button").disabled = false; } /* Support custom mod messages. Find a better way to do this, it is very cringe! */ -function generate_mod_message(fps, start_time, end_time, total_time, start_frame, end_frame, total_frames, total_seconds) +function generate_mod_message( + fps, start_time, end_time, total_time, start_frame, end_frame, total_frames, total_seconds) { let mod_message = localStorage.getItem("custom_mod_message"); @@ -55,27 +50,27 @@ function generate_mod_message(fps, start_time, end_time, total_time, start_frame const three_prec_millis = milliseconds.toFixed(3).replace("0.", ""); mod_message = mod_message.replaceAll("${FPS}", fps) - .replaceAll("${H}", hours) - .replaceAll("${M}", minutes) - .replaceAll("${S}", seconds) - .replaceAll("${MS}", milliseconds) + .replaceAll("${H}", hours) + .replaceAll("${M}", minutes) + .replaceAll("${S}", seconds) + .replaceAll("${MS}", milliseconds) - .replaceAll("${PM}", padded_minutes) - .replaceAll("${PS}", padded_seconds) + .replaceAll("${PM}", padded_minutes) + .replaceAll("${PS}", padded_seconds) - .replaceAll("${1MS}", one_prec_millis) - .replaceAll("${2MS}", two_prec_millis) - .replaceAll("${3MS}", three_prec_millis) + .replaceAll("${1MS}", one_prec_millis) + .replaceAll("${2MS}", two_prec_millis) + .replaceAll("${3MS}", three_prec_millis) - .replaceAll("${TS}", total_seconds) + .replaceAll("${TS}", total_seconds) - .replaceAll("${ST}", start_time) - .replaceAll("${ET}", end_time) - .replaceAll("${TT}", total_time) + .replaceAll("${ST}", start_time) + .replaceAll("${ET}", end_time) + .replaceAll("${TT}", total_time) - .replaceAll("${SF}", start_frame) - .replaceAll("${EF}", end_frame) - .replaceAll("${TF}", total_frames) + .replaceAll("${SF}", start_frame) + .replaceAll("${EF}", end_frame) + .replaceAll("${TF}", total_frames) return mod_message; } diff --git a/settings.js b/settings.js index 84a078c..5584911 100644 --- a/settings.js +++ b/settings.js @@ -1,4 +1,5 @@ -const mod_message_default = "Mod Note: Retimed (Start Frame: ${SF}, End Frame: ${EF}, FPS: ${FPS}, Total Time: ${TT})"; +const mod_message_default = + "Mod Note: Retimed (Start Frame: ${SF}, End Frame: ${EF}, FPS: ${FPS}, Total Time: ${TT})"; /* Set all the settings any time someone loads a page */ function set_settings() @@ -17,7 +18,8 @@ function settings_init() document.getElementById("page_text").checked = (localStorage.getItem("remove_text") === "true"); const mod_message = localStorage.getItem("custom_mod_message"); - document.getElementById("custom_mod_message").value = mod_message ? mod_message : mod_message_default; + document.getElementById("custom_mod_message").value = mod_message ? mod_message + : mod_message_default; } /* Change the users preferred theme. */ |