diff options
author | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2023-07-13 16:04:55 -0500 |
---|---|---|
committer | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2023-07-13 16:04:55 -0500 |
commit | 8633fe4774a83f90969e965c02b35e531d2ac6df (patch) | |
tree | 47ab02f5cf9885d0a856fcdf4a92ae1d5e180891 /src/view/index.html | |
parent | 0c39f286f6125ecc98e9216443d98a011b17a8c1 (diff) | |
download | freqtimer-web-8633fe4774a83f90969e965c02b35e531d2ac6df.tar.xz freqtimer-web-8633fe4774a83f90969e965c02b35e531d2ac6df.zip |
Refactor, move label-making components into the model class, create a single update function for all labels
Diffstat (limited to 'src/view/index.html')
-rw-r--r-- | src/view/index.html | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/view/index.html b/src/view/index.html index b92cc6d..32dd74e 100644 --- a/src/view/index.html +++ b/src/view/index.html @@ -33,12 +33,12 @@ <script src="/freqtimer/js/bundle.min.js"></script> <!-- Controller Bindings --> <script> - var timer_view = null; + var timer_controller = null; var sound_handle = null; var Module = { onRuntimeInitialized: function() { - timer_view = new Module.TimerView; + timer_controller = new Module.TimerController; } }; @@ -62,8 +62,8 @@ } setInterval(() => { - if (timer_view !== null) { - timer_view.handle_timer_update(); + if (timer_controller !== null) { + timer_controller.handle_timer_update(); } }, 10); </script> @@ -100,37 +100,37 @@ <div class="col-6 p-1"> <button class="btn btn-outline-primary w-100" - onclick="timer_view.handle_inc_time(1);" + onclick="timer_controller.handle_inc_time(1);" >1s</button> </div> <div class="col-6 p-1"> <button class="btn btn-outline-primary w-100" - onclick="timer_view.handle_inc_time(6);" + onclick="timer_controller.handle_inc_time(6);" >6s</button> </div> <div class="col-6 p-1"> <button class="btn btn-outline-primary w-100" - onclick="timer_view.handle_inc_time(10);" + onclick="timer_controller.handle_inc_time(10);" >10s</button> </div> <div class="col-6 p-1"> <button class="btn btn-outline-primary w-100" - onclick="timer_view.handle_inc_time(15);" + onclick="timer_controller.handle_inc_time(15);" >15s</button> </div> <div class="col-6 p-1"> <button class="btn btn-outline-primary w-100" - onclick="timer_view.handle_inc_time(30);" + onclick="timer_controller.handle_inc_time(30);" >30s</button> </div> <div class="col-6 p-1"> <button class="btn btn-outline-primary w-100" - onclick="timer_view.handle_inc_time(60);" + onclick="timer_controller.handle_inc_time(60);" >60s</button> </div> </div> @@ -139,12 +139,12 @@ <button class="btn btn-danger btn-llg w-100" id="clear-reset-btn" - onclick="timer_view.handle_clear_reset();" + onclick="timer_controller.handle_clear_reset();" >Reset</button> <button class="btn btn-success btn-llg w-100" id="start-stop-btn" - onclick="timer_view.handle_start_stop(); attach_ios_audio();" + onclick="timer_controller.handle_start_stop(); attach_ios_audio();" >Start</button> </div> @@ -153,14 +153,14 @@ <button class="btn btn-secondary btn-plus w-100" id="increment-counter-1-btn" - onclick="timer_view.handle_inc_counter(0);" + onclick="timer_controller.handle_inc_counter(0);" >+1</button> </div> <div class="col-6 p-1"> <button class="btn btn-secondary btn-plus w-100" id="increment-counter-2-btn" - onclick="timer_view.handle_inc_counter(1);" + onclick="timer_controller.handle_inc_counter(1);" >+1</button> </div> </div> |