Skip to content
This repository has been archived by the owner on Aug 8, 2021. It is now read-only.

Commit

Permalink
Resurrected title change function.
Browse files Browse the repository at this point in the history
  • Loading branch information
ujiro99 committed Jan 29, 2017
1 parent 5b45629 commit ca92d9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/coffee/controllers/timerCtrl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,15 @@ timeTracker.controller 'TimerCtrl', ($scope, $timeout, Redmine, Project, Ticket,
return if preCheck() isnt CHECK.OK
if State.isAutoTracking
State.isAutoTracking = false
State.title = Resource.string("extName")
checkResult = checkEntry($scope.time.min)
if checkResult is CHECK.CANCEL
$scope.$broadcast 'timer-clear'
else if checkResult is CHECK.OK
$scope.$broadcast 'timer-stop'
else
State.isAutoTracking = true
State.title = "Tracking..."
$scope.$broadcast 'timer-start'

onTimerStopped: (time) =>
Expand Down Expand Up @@ -276,13 +278,15 @@ timeTracker.controller 'TimerCtrl', ($scope, $timeout, Redmine, Project, Ticket,
return if preCheck() isnt CHECK.OK
if State.isPomodoring
State.isPomodoring = false
State.title = Resource.string("extName")
checkResult = checkEntry(($scope.countDownSec / 60) - ($scope.time.min + 1))
if checkResult is CHECK.CANCEL
$scope.$broadcast 'timer-clear'
else if checkResult is CHECK.OK
$scope.$broadcast 'timer-stop'
else
State.isPomodoring = true
State.title = "Pomodoro..."
$scope.countDownSec = options.pomodoroTime * 60 # sec
$scope.$broadcast 'timer-start', $scope.countDownSec

Expand All @@ -291,6 +295,7 @@ timeTracker.controller 'TimerCtrl', ($scope, $timeout, Redmine, Project, Ticket,
@trackedTime = time
else
State.isPomodoring = false
State.title = Resource.string("extName")
postEntry(Math.round(($scope.countDownSec / 60) - Math.round(time.millis / 1000 / 60)))


Expand Down
2 changes: 1 addition & 1 deletion src/coffee/state.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ timeTracker.provider("State", (LogProvider) ->
debug: false
log: true
logLevel: LogProvider.Level.INFO
title: ""
title: "RedmineTimeTracker"
isAutoTracking: false
isPomodoring: false
isAddingAccount: false
Expand Down
1 change: 1 addition & 0 deletions src/jade/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ html(ng-app='timeTracker', ng-csp="", style="font-size:{{options.fontSize}}%", n

head
meta(http-equiv='Content-Type', content='text/html; charset=UTF-8')
title(ng-bind="state.title")
// bower
link(rel='stylesheet', href='../components/angular/css/angular-csp.css')
link(rel='stylesheet', href='../components/bootstrap/css/bootstrap.min.css')
Expand Down

0 comments on commit ca92d9d

Please sign in to comment.