diff --git a/bower.json b/bower.json index 51760dbeda..5a3ad43ed9 100644 --- a/bower.json +++ b/bower.json @@ -25,6 +25,7 @@ "angular-bootstrap": "~0.5.0", "angular-ui-router": "ca3b4777a603df8f86cfd653c8f6c38b2ae05d89", "angular-loading-bar": "~0.0.5", + "angular-bindonce": "~0.2.1", "bootstrap": "v2.3.2", "bootstrap-datepicker": "~1.2.0", "bootstrap-tour": "0.5.0", @@ -38,7 +39,8 @@ }, "resolutions": { "jquery": "~2.0.3", - "bootstrap": "v2.3.2" + "bootstrap": "v2.3.2", + "angular": "~1.2.1" }, "devDependencies": { "angular-mocks": "~1.2.1" diff --git a/public/js/app.js b/public/js/app.js index 1b4d1d5d18..59ae20a32c 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -9,7 +9,7 @@ window.env.t = function(string){ window.habitrpg = angular.module('habitrpg', ['ngResource', 'ngSanitize', 'userServices', 'groupServices', 'memberServices', 'challengeServices', 'sharedServices', 'authServices', 'notificationServices', 'guideServices', - 'ui.bootstrap', 'ui.keypress', 'ui.router', 'chieffancypants.loadingBar', 'At']) + 'ui.bootstrap', 'ui.keypress', 'ui.router', 'chieffancypants.loadingBar', 'At', 'pasvaz.bindonce']) // @see https://github.com/angular-ui/ui-router/issues/110 and https://github.com/HabitRPG/habitrpg/issues/1705 // temporary hack until they have a better solution diff --git a/public/manifest.json b/public/manifest.json index 4cd6bdf6cd..de6a0bef8b 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -15,6 +15,7 @@ "bower_components/angular-loading-bar/build/loading-bar.js", "bower_components/Angular-At-Directive/src/at.js", "bower_components/Angular-At-Directive/src/caret.js", + "bower_components/angular-bindonce/bindonce.js", "bower_components/bootstrap/docs/assets/js/bootstrap.js", "bower_components/angular-bootstrap/ui-bootstrap.js", diff --git a/views/options/social/chat-message.jade b/views/options/social/chat-message.jade index 65f747df51..24d16810b7 100644 --- a/views/options/social/chat-message.jade +++ b/views/options/social/chat-message.jade @@ -1,10 +1,10 @@ -li(ng-repeat='message in group.chat', ng-class='{highlight: isUserMentioned(user,message), "own-message": user._id == message.uuid}') - a.label.chat-message(class='label-contributor-{{message.contributor.level}}', ng-class='{"label-npc": message.backer.npc}', ng-click='clickMember(message.uuid, true)') +li(bindonce='group.chat', ng-repeat='message in group.chat', bo-class='{highlight: isUserMentioned(user,message), "own-message": user._id == message.uuid}') + a.label.chat-message(class='label-contributor-{{message.contributor.level}}', bo-class='{"label-npc": message.backer.npc}', ng-click='clickMember(message.uuid, true)') span(tooltip='{{contribText(message.contributor, message.backer)}}') {{message.user}}  |   markdown(ng-model='message.text') |  -  span.muted.time(from-now='message.timestamp') - a(ng-show='user.contributor.admin || message.uuid == user.id', ng-click='deleteChatMessage(group, message)') + a(bo-show='user.contributor.admin || message.uuid == user.id', ng-click='deleteChatMessage(group, message)') | i.icon-remove(tooltip='Delete')