Files
stopwatch/init.rb
T
Claude fe0933c132 Readable Start/Stop colours, exact selectors, fork notes
- Colour-coded Start/Stop links use #2e7d32 / #c62828, which meet the
  4.5:1 text contrast ratio on white and on the mobile backgrounds
  (limegreen was ~2:1, red ~4:1)
- Selectors match the end of the link address (/timer/start,
  /timer/stop), exactly what stopwatch.js rewrites, instead of any
  address containing "start"/"stop"
- highlighted_links setting uses a string key like default_activity,
  has a default, and the form sends 0 when unticked
- Context-menu hook uses the calling view (hook_caller) instead of
  building a new view context
- README: "Changes in this fork" section (GPLv3 modification notice)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-28 23:54:19 -04:00

22 lines
729 B
Ruby

Redmine::Plugin.register :stopwatch do
name 'Redmine Stopwatch Plugin'
author 'Jens Krämer'
author_url 'https://jkraemer.net/'
description "Start/stop timer and quick access to today's time bookings for Redmine"
version '2026.7.0'
requires_redmine version_or_higher: '7.0.0'
settings default: {
'default_activity' => 'always_ask',
'highlighted_links' => '0',
}, partial: 'stopwatch/settings'
menu :account_menu, :stopwatch,
:new_stopwatch_timer_path,
caption: :button_log_time,
html: { method: :get, id: 'stopwatch-menu', 'data-remote': true },
before: :my_account,
if: ->(*_){ User.current.logged? and User.current.allowed_to?(:log_time, nil, global: true) }
end
Stopwatch.setup