From 0aff0b0f2248e4ec3d852bb669371144f82a9cea Mon Sep 17 00:00:00 2001 From: Joy Clark Date: Fri, 24 Apr 2015 19:56:26 +0200 Subject: [PATCH 01/86] mounts are wider than pets and the empty paw prints in the mount view are smaller than the mounts that have been found. This makes the grid view uneven. Adjusted the css so that the mounts and paw prints are aligned. --- website/public/css/inventory.styl | 6 ++++++ website/views/options/inventory/stable.jade | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/website/public/css/inventory.styl b/website/public/css/inventory.styl index d3bdc6d2ef..a8ced56dfd 100644 --- a/website/public/css/inventory.styl +++ b/website/public/css/inventory.styl @@ -110,6 +110,12 @@ menu.pets .customize-menu -o-filter: brightness(0%) -ms-filter: brightness(0%)*/ + .PixelPaw + margin-top: 36px // align paw with pets, at the bottom of the button +.mount-not-owned + width: 104px; + height: 99px; + .PixelPaw margin-top: 36px // align paw with pets, at the bottom of the button diff --git a/website/views/options/inventory/stable.jade b/website/views/options/inventory/stable.jade index af8329f996..83c448d4f1 100644 --- a/website/views/options/inventory/stable.jade +++ b/website/views/options/inventory/stable.jade @@ -24,7 +24,7 @@ mixin mountList(source) div(popover-trigger='mouseenter', popover=env.t('mountName', {potion: potion.text(env.language.code), mount: egg.mountText(env.language.code)}), popover-placement='bottom') button(class="pet-button Mount_Head_#{mount}", ng-show='user.items.mounts["#{mount}"]', ng-class='{active: user.items.currentMount == "#{mount}"}', ng-click='chooseMount("#{egg.key}", "#{potion.key}")') //div(class='Mount_Head_{{mount}}') - button(class="pet-button pet-not-owned", ng-hide='user.items.mounts["#{mount}"]') + button(class="pet-button mount-not-owned", ng-hide='user.items.mounts["#{mount}"]') .PixelPaw -} From 78dd949f2079508aecf3848625658d44841082a8 Mon Sep 17 00:00:00 2001 From: Negue Date: Sat, 25 Apr 2015 18:30:11 +0200 Subject: [PATCH 02/86] copy chat messages as todo --- common/locales/en/groups.json | 4 ++- website/public/js/controllers/groupsCtrl.js | 33 ++++++++++++++++++- .../views/options/social/chat-message.jade | 3 ++ website/views/options/social/index.jade | 14 ++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) diff --git a/common/locales/en/groups.json b/common/locales/en/groups.json index c5c2cf8183..c9a731b6b0 100644 --- a/common/locales/en/groups.json +++ b/common/locales/en/groups.json @@ -96,5 +96,7 @@ "abuseReported": "Thank you for reporting this violation. The moderators have been notified.", "abuseAlreadyReported": "You have already reported this message.", "needsText": "Please type a message.", - "needsTextPlaceholder": "Type your message here." + "needsTextPlaceholder": "Type your message here.", + "copyMessageAsToDo": "copy message as to-do", + "messageAddedAsToDo": "Message copied as to-do." } diff --git a/website/public/js/controllers/groupsCtrl.js b/website/public/js/controllers/groupsCtrl.js index 36233ff1f7..d22358ee60 100644 --- a/website/public/js/controllers/groupsCtrl.js +++ b/website/public/js/controllers/groupsCtrl.js @@ -344,7 +344,21 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', ' }); }); } - } + }; + + $scope.copyToDo = function(message) { + var taskNotes = '[' + message.user + '](' + env.BASE_URL + '/static/front/#?memberId=' + message.uuid + + ') wrote in [' + $scope.group.name + '](' + window.location.href + ')'; + + var newScope = $scope.$new(); + newScope.text = message.text; + newScope.notes = taskNotes; + + $rootScope.openModal('copyChatToDo',{ + controller:'CopyMessageModalCtrl', + scope: newScope + }); + }; $scope.sync = function(group){ group.$get(); @@ -549,3 +563,20 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', ' } } ]) + + .controller("CopyMessageModalCtrl", ['$scope', 'User', 'Notification', + function($scope, User, Notification){ + $scope.saveTodo = function() { + var newTask = { + text: $scope.text, + type: 'todo', + notes: $scope.notes + }; + + User.user.ops.addTask({body:newTask}); + Notification.text(window.env.t('messageAddedAsToDo')); + + $scope.$close(); + } + } + ]); diff --git a/website/views/options/social/chat-message.jade b/website/views/options/social/chat-message.jade index 48c6d85e7f..944088faa4 100644 --- a/website/views/options/social/chat-message.jade +++ b/website/views/options/social/chat-message.jade @@ -31,6 +31,9 @@ mixin chatMessages(inbox) |     a(ng-click="flagChatMessage(group._id, message)", ng-if=':: user.contributor.admin || (!message.sent && user.flags.communityGuidelinesAccepted && message.uuid != user.id && message.uuid != "system")') span.glyphicon.glyphicon-flag(tooltip="{{message.flags[user._id] ? env.t('abuseAlreadyReported') : env.t('abuseFlag')}}" ng-class='message.flags[user._id] ? "text-danger" : ""') + |     + a(ng-click="copyToDo(message)") + span.glyphicon.glyphicon-share(tooltip=env.t('copyMessageAsToDo')) span.float-label(ng-class='::contribText(message.contributor, message.backer).length > 30 ? "long-title" : ""') a.label.label-default.chat-message(ng-if=':: message.user', ng-class='::userLevelStyleFromLevel(message.contributor.level, message.backer.npc, style)', ng-click='clickMember(message.uuid, true)') span.glyphicon.glyphicon-arrow-right(ng-if='::message.sent') diff --git a/website/views/options/social/index.jade b/website/views/options/social/index.jade index 54469e5ca5..2516b569e9 100644 --- a/website/views/options/social/index.jade +++ b/website/views/options/social/index.jade @@ -113,3 +113,17 @@ script(type='text/ng-template', id='partials/options.social.html') .tab-content .tab-pane.active div(ui-view) + +script(type='text/ng-template', id='modals/copyChatToDo.html') + .modal-header + h4=env.t('copyMessageAsToDo') + .modal-body + p + input.form-control(type='text',ng-model='text') + br + p + textarea.form-control(type='text',rows='5',ng-model='notes', focus-me) + + .modal-footer + button.btn.btn-default(ng-click='$close()')=env.t('close') + button.btn.btn-default(ng-click='saveTodo()')=env.t('submit') \ No newline at end of file From 75579a7c369ed88bf4f7f9625c5840f676cb8ea1 Mon Sep 17 00:00:00 2001 From: Negue Date: Mon, 27 Apr 2015 19:23:56 +0200 Subject: [PATCH 03/86] add previewMarkdown / click as popover-trigger / misc changes --- common/locales/en/groups.json | 6 ++++-- website/public/js/controllers/groupsCtrl.js | 6 ++++-- website/views/options/social/index.jade | 16 ++++++++++------ website/views/shared/mixins.jade | 6 ++++++ website/views/shared/tasks/task.jade | 2 +- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/common/locales/en/groups.json b/common/locales/en/groups.json index c9a731b6b0..6ade797459 100644 --- a/common/locales/en/groups.json +++ b/common/locales/en/groups.json @@ -97,6 +97,8 @@ "abuseAlreadyReported": "You have already reported this message.", "needsText": "Please type a message.", "needsTextPlaceholder": "Type your message here.", - "copyMessageAsToDo": "copy message as to-do", - "messageAddedAsToDo": "Message copied as to-do." + "copyMessageAsToDo": "Copy message as To-Do", + "messageAddedAsToDo": "Message copied as To-Do.", + "messageWroteIn": "<%= user %> wrote in <%= group %>", + "msgPreviewHeading": "Message Preview" } diff --git a/website/public/js/controllers/groupsCtrl.js b/website/public/js/controllers/groupsCtrl.js index d22358ee60..e37c697658 100644 --- a/website/public/js/controllers/groupsCtrl.js +++ b/website/public/js/controllers/groupsCtrl.js @@ -347,8 +347,10 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', ' }; $scope.copyToDo = function(message) { - var taskNotes = '[' + message.user + '](' + env.BASE_URL + '/static/front/#?memberId=' + message.uuid + - ') wrote in [' + $scope.group.name + '](' + window.location.href + ')'; + var taskNotes = env.t("messageWroteIn", { + user: '[' + message.user + '](' + env.BASE_URL + '/static/front/#?memberId=' + message.uuid + ')', + group: '[' + $scope.group.name + '](' + window.location.href + ')' + }); var newScope = $scope.$new(); newScope.text = message.text; diff --git a/website/views/options/social/index.jade b/website/views/options/social/index.jade index 2516b569e9..ecb2215d3d 100644 --- a/website/views/options/social/index.jade +++ b/website/views/options/social/index.jade @@ -118,12 +118,16 @@ script(type='text/ng-template', id='modals/copyChatToDo.html') .modal-header h4=env.t('copyMessageAsToDo') .modal-body - p - input.form-control(type='text',ng-model='text') - br - p - textarea.form-control(type='text',rows='5',ng-model='notes', focus-me) + .form-group + input.form-control(type='text',ng-model='text', ng-model-options="{debounce: 1000}") + .form-group + textarea.form-control(rows='5',ng-model='notes', ng-model-options="{debounce: 1000}", focus-me) + + hr + + div(popover-trigger='click', data-popover-html="{{notes | markdown}}", popover-placement="top") + +previewMarkdown('text') .modal-footer button.btn.btn-default(ng-click='$close()')=env.t('close') - button.btn.btn-default(ng-click='saveTodo()')=env.t('submit') \ No newline at end of file + button.btn.btn-primary(ng-click='saveTodo()')=env.t('submit') \ No newline at end of file diff --git a/website/views/shared/mixins.jade b/website/views/shared/mixins.jade index f2c37b9b56..00bf60c9ce 100644 --- a/website/views/shared/mixins.jade +++ b/website/views/shared/mixins.jade @@ -11,3 +11,9 @@ mixin aLink(url, label) a(href="", ng-click="externalLink('#{url}')")= label else a(href='#{url}', target='_blank')= label + +mixin previewMarkdown(text) + .panel.panel-warning + .panel-heading=env.t('msgPreviewHeading') + .panel-body + markdown(text='#{text}') \ No newline at end of file diff --git a/website/views/shared/tasks/task.jade b/website/views/shared/tasks/task.jade index 9a5644094f..a87ae7bf0e 100644 --- a/website/views/shared/tasks/task.jade +++ b/website/views/shared/tasks/task.jade @@ -1,4 +1,4 @@ -li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s"] | conditionalOrderBy: list.view=="dated":"date"', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && (list.type != "reward") && castEnd(task, "task", $event)', ng-class='{"cast-target":spell && (list.type != "reward"), "locked-task":obj._locked === true}', popover-trigger='mouseenter', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}', ng-show='shouldShow(task, list, user.preferences)') +li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s"] | conditionalOrderBy: list.view=="dated":"date"', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && (list.type != "reward") && castEnd(task, "task", $event)', ng-class='{"cast-target":spell && (list.type != "reward"), "locked-task":obj._locked === true}', popover-trigger='click', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}', ng-show='shouldShow(task, list, user.preferences)') // right-hand side control buttons .task-meta-controls From 189423b0dbb6cd06cb6c46236381e521897fedb8 Mon Sep 17 00:00:00 2001 From: Negue Date: Mon, 27 Apr 2015 19:47:42 +0200 Subject: [PATCH 04/86] markdown preview - code "inherit white-space" / hide links for 'system' --- website/public/css/index.styl | 3 +++ website/public/js/controllers/groupsCtrl.js | 4 +++- website/views/shared/mixins.jade | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/website/public/css/index.styl b/website/public/css/index.styl index b7fd653a05..b93b9f77fd 100644 --- a/website/public/css/index.styl +++ b/website/public/css/index.styl @@ -187,3 +187,6 @@ a.label color: #fff !important .line-through text-decoration line-through + +.markdown-preview markdown code + white-space inherit \ No newline at end of file diff --git a/website/public/js/controllers/groupsCtrl.js b/website/public/js/controllers/groupsCtrl.js index e37c697658..e865878f89 100644 --- a/website/public/js/controllers/groupsCtrl.js +++ b/website/public/js/controllers/groupsCtrl.js @@ -348,7 +348,9 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', ' $scope.copyToDo = function(message) { var taskNotes = env.t("messageWroteIn", { - user: '[' + message.user + '](' + env.BASE_URL + '/static/front/#?memberId=' + message.uuid + ')', + user: message.uuid == 'system' + ? 'system' + : '[' + message.user + '](' + env.BASE_URL + '/static/front/#?memberId=' + message.uuid + ')', group: '[' + $scope.group.name + '](' + window.location.href + ')' }); diff --git a/website/views/shared/mixins.jade b/website/views/shared/mixins.jade index 00bf60c9ce..c4dde11e38 100644 --- a/website/views/shared/mixins.jade +++ b/website/views/shared/mixins.jade @@ -15,5 +15,5 @@ mixin aLink(url, label) mixin previewMarkdown(text) .panel.panel-warning .panel-heading=env.t('msgPreviewHeading') - .panel-body + .panel-body.markdown-preview markdown(text='#{text}') \ No newline at end of file From fbc1a9ae86e34e01c0f68a54df2969711fc20867 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Thu, 30 Apr 2015 08:53:14 -0500 Subject: [PATCH 05/86] Add two unit tests for copyToDo PR --- test/spec/groupCtrlSpec.js | 118 +++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/test/spec/groupCtrlSpec.js b/test/spec/groupCtrlSpec.js index bd633b914c..fd3d133925 100644 --- a/test/spec/groupCtrlSpec.js +++ b/test/spec/groupCtrlSpec.js @@ -68,6 +68,70 @@ describe('Groups Controller', function() { }); }); +describe("Chat Controller", function() { + var scope, ctrl, user, $rootScope, $controller; + + beforeEach(function() { + module(function($provide) { + $provide.value('User', {}); + }); + + inject(function(_$rootScope_, _$controller_){ + user = specHelper.newUser(); + user._id = "unique-user-id"; + $rootScope = _$rootScope_; + + scope = _$rootScope_.$new(); + + $controller = _$controller_; + + // Load RootCtrl to ensure shared behaviors are loaded + $controller('RootCtrl', {$scope: scope, User: {user: user}}); + + ctrl = $controller('ChatCtrl', {$scope: scope}); + }); + }); + + describe('copyToDo', function() { + it('when copying a user message it opens modal with information from message', function() { + scope.group = { + name: "Princess Bride" + }; + + var modalSpy = sinon.spy($rootScope, "openModal"); + var message = { + uuid: 'the-dread-pirate-roberts', + user: 'Wesley', + text: 'As you wish' + }; + + scope.copyToDo(message); + + modalSpy.should.have.been.calledOnce; + // @TODO, should probably check the modal options that get passed in as well + modalSpy.should.have.been.calledWith('copyChatToDo'); + }); + + it('when copying a system message it opens modal with information from message', function() { + scope.group = { + name: "Princess Bride" + }; + + var modalSpy = sinon.spy($rootScope, "openModal"); + var message = { + uuid: 'system', + text: 'Wesley attacked the ROUS in the Fire Swamp' + }; + + scope.copyToDo(message); + + modalSpy.should.have.been.calledOnce; + // @TODO, should probably check the modal options that get passed in as well + modalSpy.should.have.been.calledWith('copyChatToDo'); + }); + }); +}); + describe("Autocomplete controller", function() { var scope, ctrl, user, $rootScope, $controller; @@ -172,3 +236,57 @@ describe("Autocomplete controller", function() { }); }); }); + +describe("CopyMessageModal controller", function() { + var scope, ctrl, user, Notification, $rootScope, $controller; + + beforeEach(function() { + module(function($provide) { + $provide.value('User', {}); + }); + + inject(function($rootScope, _$controller_, _Notification_){ + user = specHelper.newUser(); + user._id = "unique-user-id"; + user.ops = { + addTask: sinon.spy() + }; + + scope = $rootScope.$new(); + scope.$close = sinon.spy(); + + $controller = _$controller_; + + // Load RootCtrl to ensure shared behaviors are loaded + $controller('RootCtrl', {$scope: scope, User: {user: user}}); + + ctrl = $controller('CopyMessageModalCtrl', {$scope: scope, User: {user: user}}); + + Notification = _Notification_; + Notification.text = sinon.spy(); + }); + }); + + describe("saveTodo", function() { + it('saves todo', function() { + + scope.text = "A Tavern msg"; + scope.notes = "Some notes"; + var payload = { + body: { + text: scope.text, + type: 'todo', + notes: scope.notes + } + }; + + scope.saveTodo(); + + user.ops.addTask.should.have.been.calledOnce; + user.ops.addTask.should.have.been.calledWith(payload); + Notification.text.should.have.been.calledOnce; + Notification.text.should.have.been.calledWith(window.env.t('messageAddedAsToDo')); + scope.$close.should.have.been.calledOnce; + }); + }); +}); From c3b09d8cce1749a886e26c96faa862f2da7df2e3 Mon Sep 17 00:00:00 2001 From: Negue Date: Fri, 1 May 2015 13:55:33 +0200 Subject: [PATCH 06/86] test 2nd argument for openModal --- test/spec/groupCtrlSpec.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/spec/groupCtrlSpec.js b/test/spec/groupCtrlSpec.js index fd3d133925..21a43affb0 100644 --- a/test/spec/groupCtrlSpec.js +++ b/test/spec/groupCtrlSpec.js @@ -108,8 +108,11 @@ describe("Chat Controller", function() { scope.copyToDo(message); modalSpy.should.have.been.calledOnce; - // @TODO, should probably check the modal options that get passed in as well - modalSpy.should.have.been.calledWith('copyChatToDo'); + + modalSpy.should.have.been.calledWith('copyChatToDo', sinon.match(function(callArgToMatch){ + return callArgToMatch.controller == 'CopyMessageModalCtrl' + && callArgToMatch.scope.text == message.text + })); }); it('when copying a system message it opens modal with information from message', function() { @@ -126,8 +129,11 @@ describe("Chat Controller", function() { scope.copyToDo(message); modalSpy.should.have.been.calledOnce; - // @TODO, should probably check the modal options that get passed in as well - modalSpy.should.have.been.calledWith('copyChatToDo'); + + modalSpy.should.have.been.calledWith('copyChatToDo', sinon.match(function(callArgToMatch){ + return callArgToMatch.controller == 'CopyMessageModalCtrl' + && callArgToMatch.scope.text == message.text + })); }); }); }); From 1f85b5bf675a908c81fc6e024907929ffc0eae8a Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 1 May 2015 22:12:00 -0500 Subject: [PATCH 07/86] add hack to have both mouseover and persisten click behavior --- website/views/shared/tasks/task.jade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/views/shared/tasks/task.jade b/website/views/shared/tasks/task.jade index a87ae7bf0e..09253f8f28 100644 --- a/website/views/shared/tasks/task.jade +++ b/website/views/shared/tasks/task.jade @@ -1,4 +1,4 @@ -li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s"] | conditionalOrderBy: list.view=="dated":"date"', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && (list.type != "reward") && castEnd(task, "task", $event)', ng-class='{"cast-target":spell && (list.type != "reward"), "locked-task":obj._locked === true}', popover-trigger='click', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}', ng-show='shouldShow(task, list, user.preferences)') +li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s"] | conditionalOrderBy: list.view=="dated":"date"', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && (list.type != "reward") && castEnd(task, "task", $event)', ng-class='{"cast-target":spell && (list.type != "reward"), "locked-task":obj._locked === true}', popover-trigger='mouseenter', data-popover-html="{{task.popoverOpen ? '' : task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}', ng-show='shouldShow(task, list, user.preferences)') // right-hand side control buttons .task-meta-controls @@ -53,7 +53,7 @@ li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s span.glyphicon.glyphicon-signal |   // notes - span.task-notes(ng-show='task.notes && !task._editing') + span.task-notes(ng-show='task.notes && !task._editing', ng-click='task.popoverOpen = !task.popoverOpen' popover-trigger='click', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}') span.glyphicon.glyphicon-comment |   From de71db310ae5bccc0c81365e5f7824fecd5b80c1 Mon Sep 17 00:00:00 2001 From: Negue Date: Sun, 3 May 2015 16:34:57 +0200 Subject: [PATCH 08/86] revert popover click trigger --- website/views/shared/tasks/task.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/views/shared/tasks/task.jade b/website/views/shared/tasks/task.jade index a87ae7bf0e..9a5644094f 100644 --- a/website/views/shared/tasks/task.jade +++ b/website/views/shared/tasks/task.jade @@ -1,4 +1,4 @@ -li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s"] | conditionalOrderBy: list.view=="dated":"date"', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && (list.type != "reward") && castEnd(task, "task", $event)', ng-class='{"cast-target":spell && (list.type != "reward"), "locked-task":obj._locked === true}', popover-trigger='click', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}', ng-show='shouldShow(task, list, user.preferences)') +li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s"] | conditionalOrderBy: list.view=="dated":"date"', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && (list.type != "reward") && castEnd(task, "task", $event)', ng-class='{"cast-target":spell && (list.type != "reward"), "locked-task":obj._locked === true}', popover-trigger='mouseenter', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}', ng-show='shouldShow(task, list, user.preferences)') // right-hand side control buttons .task-meta-controls From b2bad4d77f439df6ee3eec42f590f458803dcb98 Mon Sep 17 00:00:00 2001 From: Negue Date: Sun, 3 May 2015 17:12:08 +0200 Subject: [PATCH 09/86] Update todo preview in dialog --- website/public/css/tasks.styl | 8 ++++++++ website/views/options/social/index.jade | 16 ++++++++++++++-- website/views/shared/tasks/task.jade | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/website/public/css/tasks.styl b/website/public/css/tasks.styl index 5b1bbdc348..59ea60e0e7 100644 --- a/website/public/css/tasks.styl +++ b/website/public/css/tasks.styl @@ -142,6 +142,14 @@ for $stage in $stages padding: 0 font-weight: 300 +.task-column.preview + padding: 0 + background: transparent + border: 0; + + .task:hover + cursor: auto + // 50% width columns with scrollbars for tablets @media (min-width: 768px) and (max-width: 970px) .task-column diff --git a/website/views/options/social/index.jade b/website/views/options/social/index.jade index 0b41721987..a965b5d1d3 100644 --- a/website/views/options/social/index.jade +++ b/website/views/options/social/index.jade @@ -125,8 +125,20 @@ script(type='text/ng-template', id='modals/copyChatToDo.html') hr - div(popover-trigger='click', data-popover-html="{{notes | markdown}}", popover-placement="top") - +previewMarkdown('text') + div.task-column.preview + div(ng-init='popoverOpen = false', class='task todo uncompleted color-neutral', popover-trigger='mouseenter', data-popover-html="{{popoverOpen ? '' : notes | markdown}}", popover-placement="top") + // right-hand side control buttons + .task-meta-controls + // Icons only available if you own the tasks (aka, hidden from challenge stats) + span(ng-if='!obj._locked') + // notes + span.task-notes(ng-show='notes', ng-click='popoverOpen = !popoverOpen', popover-trigger='click', data-popover-html="{{notes | markdown}}", popover-placement="top") + span.glyphicon.glyphicon-comment + |   + + // main content + div.task-text + markdown(text='text',target='_blank') .modal-footer button.btn.btn-default(ng-click='$close()')=env.t('close') diff --git a/website/views/shared/tasks/task.jade b/website/views/shared/tasks/task.jade index 09253f8f28..05661a939e 100644 --- a/website/views/shared/tasks/task.jade +++ b/website/views/shared/tasks/task.jade @@ -53,7 +53,7 @@ li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s span.glyphicon.glyphicon-signal |   // notes - span.task-notes(ng-show='task.notes && !task._editing', ng-click='task.popoverOpen = !task.popoverOpen' popover-trigger='click', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}') + span.task-notes(ng-show='task.notes && !task._editing', ng-click='task.popoverOpen = !task.popoverOpen', popover-trigger='click', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='{{::modal ? "false":"true"}}') span.glyphicon.glyphicon-comment |   From 4450a5d7c399ed840340ed43033130ccdbc51e78 Mon Sep 17 00:00:00 2001 From: Joy Clark Date: Sun, 3 May 2015 18:14:28 +0200 Subject: [PATCH 10/86] Fixes #5094 Now show list based on whether or not a search query is defined. The autocomplete function from the directive is encapsulated so that it can be called and then the query can be set to null. --- test/spec/groupCtrlSpec.js | 14 ++++++++++++++ website/public/js/controllers/groupsCtrl.js | 5 +++++ website/views/options/social/chat-box.jade | 6 +++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/test/spec/groupCtrlSpec.js b/test/spec/groupCtrlSpec.js index bd633b914c..a64385545a 100644 --- a/test/spec/groupCtrlSpec.js +++ b/test/spec/groupCtrlSpec.js @@ -149,6 +149,20 @@ describe("Autocomplete controller", function() { }); }); + describe("performCompletion", function() { + it('auto complete triggers', function() { + scope.autoComplete = function(v) {}; // this function normally will be filled in by the auto-complete directive + var autoCompleteTriggered = sinon.spy(scope, 'autoComplete'); + scope.query = {text: "b"}; + + scope.performCompletion({user: "boo"}); + + expect(scope.query).to.be.eq(null); + expect(autoCompleteTriggered.callCount).to.be.eq(1); + }); + + }); + describe("addNewUser", function() { it('a new message from a new user will modify the usernames', function() { expect(scope.response).to.be.empty; diff --git a/website/public/js/controllers/groupsCtrl.js b/website/public/js/controllers/groupsCtrl.js index 26a4196a97..205b5f35b7 100644 --- a/website/public/js/controllers/groupsCtrl.js +++ b/website/public/js/controllers/groupsCtrl.js @@ -232,6 +232,11 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', ' return user.indexOf(text) == 0; } + $scope.performCompletion = function(msg) { + $scope.autoComplete(msg); + $scope.query = null; + } + $scope.addNewUser = function(user) { if($.inArray(user.user,$scope.usernames) == -1) { user.username = user.user; diff --git a/website/views/options/social/chat-box.jade b/website/views/options/social/chat-box.jade index 047f6e4eea..2266fd5e31 100644 --- a/website/views/options/social/chat-box.jade +++ b/website/views/options/social/chat-box.jade @@ -13,9 +13,9 @@ div.chat-form.guidelines-not-accepted(ng-if='!user.flags.communityGuidelinesAcce form.chat-form(ng-if='user.flags.communityGuidelinesAccepted' ng-submit='postChat(group,message.content)') div(ng-controller='AutocompleteCtrl') textarea.form-control(rows=4, ui-keydown='{"meta-enter":"postChat(group,message.content)"}', ui-keypress='{13:"postChat(group,message.content)"}', ng-model='message.content', updateinterval='250', flag='@', at-user, auto-complete placeholder="{{group._id == 'habitrpg' ? env.t('tavernCommunityGuidelinesPlaceholder') : ''}}") - span.user-list(ng-show='!isAtListHidden') - ul.list-at-user - li(ng-repeat='msg in response | filter:filterUser | limitTo: 5', ng-click='autoComplete(msg)') + span.user-list + ul.list-at-user(ng-show="query") + li(ng-repeat='msg in response | filter:filterUser | limitTo: 5', ng-click='performCompletion(msg)') span.username.label.label-default(ng-class=':: userLevelStyle(msg)') {{::msg.user}} .chat-controls .chat-formatting From a45390321ea09e65a9cce312d626339ae1e08f0a Mon Sep 17 00:00:00 2001 From: NotGonnaGitUs Date: Sun, 3 May 2015 23:41:42 +0530 Subject: [PATCH 11/86] Patched translation fixes and added a few phrases to locales. --- CHANGELOG.md | 6 +++++- common/locales/en/communityGuidelines.json | 4 +++- common/locales/en/settings.json | 4 +++- website/views/options/settings.jade | 10 +++++----- website/views/static/community-guidelines.jade | 2 +- website/views/static/press-kit.jade | 2 +- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40acd69c2f..0761bb889b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ My app - Changelog -# (2015-05-02) +# (2015-05-03) ## Bug Fixes +- **Spring:** WHO IS LESLIE + ([6685e935](watch/commits/6685e93554a1274dedb55dae054e787fb80eb440)) - **invite-friends:** text should be valid for both parties and guilds ([54e82a14](watch/commits/54e82a14a252c3b9923449a7ef7cee6033a5d160)) - **mystery:** It's 2015 now, Sabe @@ -16,6 +18,8 @@ ## Features +- **Spring:** Flung + ([d50d4ad8](watch/commits/d50d4ad8bb0f89e39ceb6562e0f8f392f94b5444)) - **emails:** add support for weekly recap emails ([37f7db3c](watch/commits/37f7db3c4e3859d03fd55a44e63819e273a06442)) - **i18n:** upload japanese, serbian and chinese (taiwan) diff --git a/common/locales/en/communityGuidelines.json b/common/locales/en/communityGuidelines.json index ba77715b8a..dc08558fd1 100644 --- a/common/locales/en/communityGuidelines.json +++ b/common/locales/en/communityGuidelines.json @@ -180,5 +180,7 @@ "commGuideLink07": "The Art Trello", "commGuideLink07description": "for submitting pixel art.", "commGuideLink08": "The Quest Trello", - "commGuideLink08description": "for submitting quest writing." + "commGuideLink08description": "for submitting quest writing.", + + "lastUpdated": "Last updated" } diff --git a/common/locales/en/settings.json b/common/locales/en/settings.json index 6aa4d0293d..f77b4ef75d 100644 --- a/common/locales/en/settings.json +++ b/common/locales/en/settings.json @@ -112,5 +112,7 @@ "benefits": "Benefits", "coupon": "Coupon", "couponPlaceholder": "Enter Coupon Code", - "couponText": "We sometimes have events and give out coupon codes for special gear. (eg, those who stop by our Wondercon booth)" + "couponText": "We sometimes have events and give out coupon codes for special gear. (eg, those who stop by our Wondercon booth)", + "apply": "Apply", + "resubscribe": "Resubscribe" } diff --git a/website/views/options/settings.jade b/website/views/options/settings.jade index 378a534e25..002702cec3 100644 --- a/website/views/options/settings.jade +++ b/website/views/options/settings.jade @@ -162,7 +162,7 @@ script(type='text/ng-template', id='partials/options.settings.coupon.html') h2= env.t('coupon') form.form-inline(role='form',ng-submit='enterCoupon(_couponCode)') input.form-control(type='text', ng-model='_couponCode', placeholder=env.t('couponPlaceholder')) - button.btn.btn-primary(type='submit') Submit + button.btn.btn-primary(type='submit')= env.t('submit') div small= env.t('couponText') div(ng-if='user.contributor.sudo') @@ -379,12 +379,12 @@ script(id='partials/options.settings.subscription.html',type='text/ng-template') .form-inline .form-group - input.form-control(type='text', ng-model='_subscription.coupon', placeholder='Promo Code') + input.form-control(type='text', ng-model='_subscription.coupon', placeholder= env.t('couponPlaceholder')) .form-group - button.btn.btn-small(type='button',ng-click='applyCoupon(_subscription.coupon)') Apply + button.btn.btn-small(type='button',ng-click='applyCoupon(_subscription.coupon)')= env.t("apply") - h3(ng-if='(user.purchased.plan.customerId && user.purchased.plan.dateTerminated)') Resubscribe - a.btn.btn-primary(ng-click='Payments.showStripe({subscription:_subscription.key, coupon:_subscription.coupon})', ng-disabled='!_subscription.key') Card + h3(ng-if='(user.purchased.plan.customerId && user.purchased.plan.dateTerminated)')= env.t("resubscribe") + a.btn.btn-primary(ng-click='Payments.showStripe({subscription:_subscription.key, coupon:_subscription.coupon})', ng-disabled='!_subscription.key')= env.t('card') a.btn.btn-warning(href='/paypal/subscribe?_id={{user._id}}&apiToken={{user.apiToken}}&sub={{_subscription.key}}{{_subscription.coupon ? "&coupon="+_subscription.coupon : ""}}', ng-disabled='!_subscription.key') PayPal div(ng-if='user.purchased.plan.customerId') .btn.btn-primary(ng-if='!user.purchased.plan.dateTerminated && user.purchased.plan.paymentMethod=="Stripe"', ng-click='Payments.showStripeEdit()')=env.t('subUpdateCard') diff --git a/website/views/static/community-guidelines.jade b/website/views/static/community-guidelines.jade index 4af0c13a60..23c887a73b 100644 --- a/website/views/static/community-guidelines.jade +++ b/website/views/static/community-guidelines.jade @@ -26,7 +26,7 @@ block content .page-header h1=env.t('communityGuidelines') p.pagemeta - |Last updated  + =env.t('lastUpdated') =env.t('February') | 9, 2015 h2=env.t('commGuideHeadingWelcome') diff --git a/website/views/static/press-kit.jade b/website/views/static/press-kit.jade index 7439cff41c..427da56098 100644 --- a/website/views/static/press-kit.jade +++ b/website/views/static/press-kit.jade @@ -5,7 +5,7 @@ block vars - var menuItem = 'pressKit' block title - title Press Kit + title= env.t('presskit') block extraHead style. From 78e8499c5fd9ee1eeb7847650422c6ab3f94e2d9 Mon Sep 17 00:00:00 2001 From: NotGonnaGitUs Date: Mon, 4 May 2015 01:12:43 +0530 Subject: [PATCH 12/86] Fixed missing space. --- CHANGELOG.md | 2 +- website/views/static/community-guidelines.jade | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0761bb889b..1d9f229788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ My app - Changelog -# (2015-05-03) +# (2015-05-04) ## Bug Fixes diff --git a/website/views/static/community-guidelines.jade b/website/views/static/community-guidelines.jade index 23c887a73b..c6bb49a838 100644 --- a/website/views/static/community-guidelines.jade +++ b/website/views/static/community-guidelines.jade @@ -27,6 +27,7 @@ block content h1=env.t('communityGuidelines') p.pagemeta =env.t('lastUpdated') + |  =env.t('February') | 9, 2015 h2=env.t('commGuideHeadingWelcome') From 65a0ecdd6aa399d16af2ca85fdc577d1fb36bf04 Mon Sep 17 00:00:00 2001 From: TheHollidayInn Date: Thu, 2 Apr 2015 14:18:00 -0500 Subject: [PATCH 13/86] Added query to always include user when populating group members --- website/src/controllers/groups.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/website/src/controllers/groups.js b/website/src/controllers/groups.js index e515cd95a7..90b223606a 100644 --- a/website/src/controllers/groups.js +++ b/website/src/controllers/groups.js @@ -25,7 +25,7 @@ var api = module.exports; var partyFields = api.partyFields = 'profile preferences stats achievements party backer contributor auth.timestamps items'; var nameFields = 'profile.name'; var challengeFields = '_id name'; -var guildPopulate = {path: 'members', select: nameFields, options: {limit: 15} }; +var guildPopulate = {path: 'members', select: nameFields, options: {limit:15} }; /** * For parties, we want a lot of member details so we can show their avatars in the header. For guilds, we want very * limited fields - and only a sampling of the members, beacuse they can be in the thousands @@ -34,11 +34,16 @@ var guildPopulate = {path: 'members', select: nameFields, options: {limit: 15} } * @param additionalFields: if we want to populate some additional field not fetched normally * pass it as a string, parties only */ -var populateQuery = function(type, q, additionalFields){ - if (type == 'party') +var populateQuery = function(type, q, additionalFields, user){ + if (type == 'party') { q.populate('members', partyFields + (additionalFields ? (' ' + additionalFields) : '')); - else + } else { + if ( user ) { + //Use Conditional Semantics to always include the user + guildPopulate.match = {"$or" : [{"_id" : {"$gt" : 1}}, {"_id" : user._id}]}; + } q.populate(guildPopulate); + } q.populate('invites', nameFields); q.populate({ path: 'challenges', @@ -133,7 +138,7 @@ api.get = function(req, res, next) { {_id:gid, privacy:'public'}, {_id:gid, privacy:'private', members: {$in:[user._id]}} // if the group is private, only return if they have access ]}); - populateQuery(gid, q); + populateQuery(gid, q, null, user); q.exec(function(err, group){ if (err) return next(err); if (!group && gid!=='party') return res.json(404,{err: "Group not found or you don't have access."}); From 5fe6121495df9e5408f841dd14e9fd074ca0e6f0 Mon Sep 17 00:00:00 2001 From: TheHollidayInn Date: Fri, 24 Apr 2015 16:04:05 -0500 Subject: [PATCH 14/86] Added user to group.member if they are a member of the group and not included in the query --- website/src/controllers/groups.js | 40 +++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/website/src/controllers/groups.js b/website/src/controllers/groups.js index 90b223606a..081db85c89 100644 --- a/website/src/controllers/groups.js +++ b/website/src/controllers/groups.js @@ -25,7 +25,7 @@ var api = module.exports; var partyFields = api.partyFields = 'profile preferences stats achievements party backer contributor auth.timestamps items'; var nameFields = 'profile.name'; var challengeFields = '_id name'; -var guildPopulate = {path: 'members', select: nameFields, options: {limit:15} }; +var guildPopulate = {path: 'members', select: nameFields, options: {limit: 15} }; /** * For parties, we want a lot of member details so we can show their avatars in the header. For guilds, we want very * limited fields - and only a sampling of the members, beacuse they can be in the thousands @@ -34,16 +34,11 @@ var guildPopulate = {path: 'members', select: nameFields, options: {limit:15} }; * @param additionalFields: if we want to populate some additional field not fetched normally * pass it as a string, parties only */ -var populateQuery = function(type, q, additionalFields, user){ - if (type == 'party') { +var populateQuery = function(type, q, additionalFields){ + if (type == 'party') q.populate('members', partyFields + (additionalFields ? (' ' + additionalFields) : '')); - } else { - if ( user ) { - //Use Conditional Semantics to always include the user - guildPopulate.match = {"$or" : [{"_id" : {"$gt" : 1}}, {"_id" : user._id}]}; - } + else q.populate(guildPopulate); - } q.populate('invites', nameFields); q.populate({ path: 'challenges', @@ -138,11 +133,32 @@ api.get = function(req, res, next) { {_id:gid, privacy:'public'}, {_id:gid, privacy:'private', members: {$in:[user._id]}} // if the group is private, only return if they have access ]}); - populateQuery(gid, q, null, user); + populateQuery(gid, q); q.exec(function(err, group){ if (err) return next(err); - if (!group && gid!=='party') return res.json(404,{err: "Group not found or you don't have access."}); - res.json(group); + if (!group && group != null && gid!=='party') return res.json(404,{err: "Group not found or you don't have access."}); + + //Since we have a limit on how many members are populate to the group, we want to make sure the user is always in the group + var userInGroup = _.find(group.members, function(member){ return member._id == user._id; }); + + //If the group is private or the group is a party, then the user must be a member of the group based on access restrictions above + if (group.privacy === 'private' && gid !== 'party') { + //If the user is not in the group query, add them + if (userInGroup === undefined) { group.members.push(user); } + res.json(group); + } else if ( group.privacy === "public" ) { //The group is public, we must do an extra check to see if the user is already in the group query + + //We must see how to check if a user is a member of a public group, so we requery + var q2 = Group.findOne({ _id: group._id, privacy:'public', members: {$in:[user._id]} }); + q2.exec(function(err, group2){ + if (err) return next(err); + if (group2 !== null) { + if (userInGroup === undefined) { group.members.push(user); } + } + res.json(group); + }); + } + gid = null; }); }; From 0bd39120aa069078783a6c591bb677998c329db0 Mon Sep 17 00:00:00 2001 From: TheHollidayInn Date: Tue, 28 Apr 2015 10:51:44 -0500 Subject: [PATCH 15/86] Updated conditionals --- website/src/controllers/groups.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/src/controllers/groups.js b/website/src/controllers/groups.js index 081db85c89..47f666a0bc 100644 --- a/website/src/controllers/groups.js +++ b/website/src/controllers/groups.js @@ -136,13 +136,13 @@ api.get = function(req, res, next) { populateQuery(gid, q); q.exec(function(err, group){ if (err) return next(err); - if (!group && group != null && gid!=='party') return res.json(404,{err: "Group not found or you don't have access."}); + if (!group && gid!=='party') return res.json(404,{err: "Group not found or you don't have access."}); //Since we have a limit on how many members are populate to the group, we want to make sure the user is always in the group var userInGroup = _.find(group.members, function(member){ return member._id == user._id; }); //If the group is private or the group is a party, then the user must be a member of the group based on access restrictions above - if (group.privacy === 'private' && gid !== 'party') { + if (group.privacy === 'private' || gid === 'party') { //If the user is not in the group query, add them if (userInGroup === undefined) { group.members.push(user); } res.json(group); @@ -152,7 +152,7 @@ api.get = function(req, res, next) { var q2 = Group.findOne({ _id: group._id, privacy:'public', members: {$in:[user._id]} }); q2.exec(function(err, group2){ if (err) return next(err); - if (group2 !== null) { + if (!group2) { if (userInGroup === undefined) { group.members.push(user); } } res.json(group); From 41a6818ea8ec630b3dfbbf8922654f7d759d37a3 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sun, 3 May 2015 20:21:53 -0500 Subject: [PATCH 16/86] Revert inn text --- common/locales/en/npc.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/locales/en/npc.json b/common/locales/en/npc.json index e0a6403dcf..b18d6e16e0 100644 --- a/common/locales/en/npc.json +++ b/common/locales/en/npc.json @@ -5,8 +5,8 @@ "mattShall": "Shall I bring you your steed, <%= name %>? Click a mount to saddle up.", "mattBochText1": "Welcome to the Stable! I'm Matt, the beast master. Choose a pet here to venture at your side. Feed them and they'll grow into powerful steeds.", "daniel": "Daniel", - "danielText": "Welcome to the Tavern! Stay a while and meet the locals. If you need to rest (vacation? illness?), I'll set you up at the Inn. While checked-in, your Dailies won't hurt you at the day's end, but you can still check them off.", - "danielText2": "Be warned: If you are participating in a boss quest, the boss will still damage you for your party mates' missed Dailies! Also, your own damage to the Boss (or items collected) will not be applied until you check out of the Inn.", + "danielText": "Welcome to the Tavern! Stay a while and meet the locals. If you need to rest (vacation? illness?), I'll set you up at the inn. While checked-in, your Dailies are frozen as-is (checked/unchecked) until the day after check-out. You will not suffer for missing them at the day's end.", + "danielText2": "Be warned: If you are participating in a boss quest, the boss will still damage you for your party mates' missed Dailies!", "alexander": "Alexander the Merchant", "welcomeMarket": "Welcome to the Market! Buy hard-to-find eggs and potions! Sell your extras! Commission useful services! Come see what we have to offer.", "sellForGold": "Sell <%= item %> for <%= gold %> Gold", From 076cc76e5d1e597598a8e86b287d71059f8d838f Mon Sep 17 00:00:00 2001 From: NotGonnaGitUs Date: Mon, 4 May 2015 21:26:45 +0530 Subject: [PATCH 17/86] Fixed broken link --- website/views/static/front.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/views/static/front.jade b/website/views/static/front.jade index 21207c2ef6..e4a9e0a692 100644 --- a/website/views/static/front.jade +++ b/website/views/static/front.jade @@ -170,7 +170,7 @@ html(ng-app='habitrpg', ng-controller='RootCtrl') = env.t('work') br small - a(href='/business.html')= env.t('businessText') + a(href='/static/plans')= env.t('businessText') .carousel-content.row .sampletasks.col-lg-4.col-md-6.col-sm-12.col-xs-12 h4= env.t('sampleHabits') From 25b63cfacd40747e3baef43a645a644ce60565e5 Mon Sep 17 00:00:00 2001 From: NotGonnaGitUs Date: Mon, 4 May 2015 23:37:54 +0530 Subject: [PATCH 18/86] Made daniel's text in the inn based on current rest status of the user. --- website/views/options/social/tavern.jade | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/views/options/social/tavern.jade b/website/views/options/social/tavern.jade index 54657ecff8..768f746e74 100644 --- a/website/views/options/social/tavern.jade +++ b/website/views/options/social/tavern.jade @@ -14,14 +14,14 @@ h3.popover-title a(target='_blank', href='http://www.kickstarter.com/profile/2014640723')=env.t('daniel') .popover-content - =env.t('danielText') + span(ng-hide='user.preferences.sleep')=env.t('danielText') + span(ng-show='user.preferences.sleep')=env.t('innText',{name:"{{user.profile.name}}"}) div button.btn.btn-lg.btn-success(ng-class='{active: user.preferences.sleep}', ng-click='User.user.ops.sleep({})') span(ng-show='user.preferences.sleep')=env.t('innCheckOut') span(ng-hide='user.preferences.sleep')=env.t('innCheckIn') - =env.t('danielText2') - .alert.alert-info(ng-show='user.preferences.sleep') - =env.t('innText',{name:"{{user.profile.name}}"}) + span(ng-hide='user.preferences.sleep')=env.t('danielText2') + // Resources .panel.panel-default From a090fed10bd171e9ff9a9b15c8084f29b99520e8 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 4 May 2015 15:31:00 -0400 Subject: [PATCH 19/86] feat(analytics): "motivate yourself" 3 variants @lemoness --- common/locales/en/front.json | 2 ++ website/public/js/controllers/footerCtrl.js | 2 +- website/public/js/services/guideServices.js | 5 +++-- website/views/static/front.jade | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/locales/en/front.json b/common/locales/en/front.json index b599bb1815..2da2f59e07 100644 --- a/common/locales/en/front.json +++ b/common/locales/en/front.json @@ -120,6 +120,8 @@ "mobileAndroid": "Android", "mobileIOS": "iOS", "motivate": "Motivate yourself and your team!", + "motivate1": "Motivate yourself to do anything.", + "motivate2": "Get Organized. Get Motivated. Get Gold.", "passConfirm": "Confirm Password", "passMan": "In case you are using a password manager (like 1Password) and have problems logging in, try typing username and password manually.", "password": "Password", diff --git a/website/public/js/controllers/footerCtrl.js b/website/public/js/controllers/footerCtrl.js index b70f6c863e..f7fda11580 100644 --- a/website/public/js/controllers/footerCtrl.js +++ b/website/public/js/controllers/footerCtrl.js @@ -28,7 +28,7 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl) { // Google Analytics, only in production if (window.env.NODE_ENV === 'production') { // Get experiments API - $.getScript('//www.google-analytics.com/cx/api.js?experiment=pi26hZ3rRFaEPNiKqXbhqA', function(){ + $.getScript('//www.google-analytics.com/cx/api.js?experiment=t-AFggRWQnuJ6Teck_x1-Q', function(){ $rootScope.variant = cxApi.chooseVariation(); $rootScope.$apply(); diff --git a/website/public/js/services/guideServices.js b/website/public/js/services/guideServices.js index 35f3676646..379e90fe39 100644 --- a/website/public/js/services/guideServices.js +++ b/website/public/js/services/guideServices.js @@ -185,13 +185,14 @@ function($rootScope, User, $timeout, $state) { var showFinish = step.final || k == 'classes'; var showCounter = k=='intro' && !step.final; - $rootScope.variant=2; // temporarily set finish & counter on until we can get experiment working - // Experiment wud1Ba5qT1m9qR3PP0-Mmg , remove this when experiment complete // 0=No Finish; Yes Counter 1=No Finish; No Counter 2=Yes Finish; Yes Counter 3=Yes Finish; No Counter showFinish = showFinish || $rootScope.variant==2 || $rootScope.variant==3; showCounter = showCounter && ($rootScope.variant==0 || $rootScope.variant==2); + // FIXME temporarily set finish & counter on until we can get experiment working + showFinish=true;showCounter=true; + return '