Files
stopwatch/app/views/stopwatch/hooks/_layouts_base_body_bottom.html.erb
2021-10-05 11:26:51 +08:00

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 %>