mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-04-02 09:51:57 -04:00
17 lines
541 B
Plaintext
17 lines
541 B
Plaintext
<%= javascript_tag do %>
|
|
window.stopwatch = window.initStopwatch({
|
|
currentTimerUrl: '<%= j current_stopwatch_timers_url %>',
|
|
hourFormat: '<%= j format_hours 0.0 %>',
|
|
locales: {
|
|
startTimer: '<%= j l :label_stopwatch_start %>',
|
|
stopTimer: '<%= j l :label_stopwatch_stop %>'
|
|
},
|
|
});
|
|
<% if User.current.logged? %>
|
|
window.stopwatch.highlightRunningTimer(
|
|
<%= raw Stopwatch::Timer.new(User.current).to_json %>
|
|
);
|
|
window.stopwatch.setProjectId('<%= j @project&.id.to_s %>');
|
|
<% end %>
|
|
<% end %>
|