diff --git a/common/locales/en/tasks.json b/common/locales/en/tasks.json index f40797789b..c353765433 100644 --- a/common/locales/en/tasks.json +++ b/common/locales/en/tasks.json @@ -54,7 +54,7 @@ "complete": "Done", "dated": "Dated", "due": "Due", - "notDue": "Not Due", + "notDue": "Not Due", "grey": "Grey", "score": "Score", "rewards": "Rewards", @@ -89,7 +89,7 @@ "sureDelete": "Are you sure you want to delete this task?", "streakCoins": "Streak Bonus!", "pushTaskToTop": "Push task to top", - "pushTaskToBottom": "Push task to bottom", + "pushTaskToBottom": "Push task to bottom. Hold ctrl or cmd to push to top.", "emptyTask": "Enter the task's title first.", "dailiesRestingInInn": "You're Resting in the Inn! Your Dailies will NOT hurt you tonight, but they WILL still refresh every day. If you're in a quest, you won't deal damage/collect items until you check out of the Inn, but you can still be injured by a Boss if your Party mates skip their own Dailies.", "habitHelp1": "Good Habits are things that you do often. They award Gold and Experience every time you click the <%= plusIcon %>.", diff --git a/website/public/css/tasks.styl b/website/public/css/tasks.styl index 0318d9b5c8..e87b28186c 100644 --- a/website/public/css/tasks.styl +++ b/website/public/css/tasks.styl @@ -394,6 +394,11 @@ for $stage in $stages a.badge position: relative; top:-2px + a.push-down span + -ms-transform: rotate(180deg); /* IE 9 */ + -webkit-transform: rotate(180deg); /* Chrome, Safari, Opera */ + transform: rotate(180deg); + .task:hover .task-meta-controls opacity: 1 diff --git a/website/public/js/controllers/tasksCtrl.js b/website/public/js/controllers/tasksCtrl.js index 7eee145e37..9a7a8829d0 100644 --- a/website/public/js/controllers/tasksCtrl.js +++ b/website/public/js/controllers/tasksCtrl.js @@ -76,10 +76,23 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N * Pushes task to top or bottom of list */ $scope.pushTask = function(task, index, location) { - var to = (location === 'bottom') ? -1 : 0; + var to = (location === 'bottom' || $scope.pushLocation === 'bottom') ? -1 : 0; User.user.ops.sortTask({params:{id:task.id},query:{from:index, to:to}}) }; + var ctrlKeys = [17, 224, 91]; + $scope.$on("habit:keydown", function (e, keyEvent) { + if (ctrlKeys.indexOf(keyEvent.keyCode) !== -1) { + $scope.pushLocation = "bottom"; + } + }); + + $scope.$on("habit:keyup", function (e, keyEvent) { + if (ctrlKeys.indexOf(keyEvent.keyCode) !== -1) { + $scope.pushLocation = "top"; + } + }); + /** * This is calculated post-change, so task.completed=true if they just checked it */ diff --git a/website/views/index.jade b/website/views/index.jade index 33d1c78f68..7173062222 100644 --- a/website/views/index.jade +++ b/website/views/index.jade @@ -1,6 +1,6 @@ doctype html //html(ng-app="habitrpg", ng-controller="RootCtrl", ng-class='{"applying-action":applyingAction}', ui-keypress="{27:'castCancel()'}") -html(ng-app="habitrpg", ng-controller="RootCtrl", ng-class='{"applying-action":applyingAction}', ui-keyup="{27:'castCancel()'}", ng-keydown="$broadcast('habit:keyup', $event)") +html(ng-app="habitrpg", ng-controller="RootCtrl", ng-class='{"applying-action":applyingAction}', ui-keyup="{27:'castCancel()'}", ng-keydown="$broadcast('habit:keydown', $event)", ng-keyup="$broadcast('habit:keyup', $event)") head title=env.t('titleIndex') // ?v=1 needed to force refresh diff --git a/website/views/shared/tasks/meta_controls.jade b/website/views/shared/tasks/meta_controls.jade index e42210f240..c9c344a01b 100644 --- a/website/views/shared/tasks/meta_controls.jade +++ b/website/views/shared/tasks/meta_controls.jade @@ -13,7 +13,7 @@ // Icons only available if you own the tasks (aka, hidden from challenge stats) span(ng-if='!obj._locked') - a(ng-click='pushTask(task,$index,"top")', tooltip=env.t('pushTaskToTop')) + a(ng-click='pushTask(task,$index,"top")', tooltip=env.t('pushTaskToTop'), ng-class="{'push-down': pushLocation == 'bottom'}") span.glyphicon.glyphicon-open // a(ng-click='pushTask(task,$index,"bottom")', tooltip=env.t('pushTaskToBottom')) // span.glyphicon.glyphicon-import