Skip to content

Commit

Permalink
Start with clock in stopped state (was ClockChecker) (#47)
Browse files Browse the repository at this point in the history
* ClockChecker

* Allow to check if the clock is running
* Do bookkeeping of the number of checks

* Intial clock state is stopped.

* Revert "ClockChecker"

This reverts commit 6a896b6.

* add start_running property

Co-authored-by: Juergen Fuhrmann <[email protected]>
Co-authored-by: fonsp <[email protected]>
  • Loading branch information
3 people authored Oct 2, 2020
1 parent 4f368bc commit d1011cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ button.onclick = (e) => {
if (!clock.classList.contains("stopped")) {
t = 1 - 1
}
}
}
5 changes: 3 additions & 2 deletions src/Clock.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export Clock
struct Clock
interval::Real
fixed::Bool
Clock(interval=1, fixed=false) = interval >= 0 ? new(interval, fixed) : error("interval must be non-negative")
start_running::Bool
Clock(interval=1, fixed=false, start_running=false) = interval >= 0 ? new(interval, fixed, start_running) : error("interval must be non-negative")
end

function show(io::IO, ::MIME"text/html", clock::Clock)
Expand All @@ -15,7 +16,7 @@ function show(io::IO, ::MIME"text/html", clock::Clock)
css = read(joinpath(PKG_ROOT_DIR, "assets", "clock.css"), String)

result = """
<clock$(clock.fixed ? " class='fixed'" : "")>
<clock class='$(clock.fixed ? " fixed" : "")$(clock.start_running ? "" : " stopped")'>
<analog>
<back>$(cb)</back>
<front>$(cf)</front>
Expand Down

2 comments on commit d1011cf

@fonsp
Copy link
Member

@fonsp fonsp commented on d1011cf Oct 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/22346

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.6 -m "<description of version>" d1011cfe523d2b9deaeacd49caf599a66ef9887e
git push origin v0.6.6

Please sign in to comment.