Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
+1
-2
@@ -38,8 +38,7 @@
|
||||
},
|
||||
"resolutions": {
|
||||
"jquery": "~2.0.3",
|
||||
"bootstrap": "v2.3.2",
|
||||
"angular": "~1.2.1"
|
||||
"bootstrap": "v2.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"angular-mocks": "~1.2.1"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// TODO figure out why this is happening in the first place
|
||||
|
||||
db.users.find({},{habits:1, dailys:1, todos:1, rewards:1}).forEach(function(user){
|
||||
_.each(user.habits, function(task){
|
||||
task.type = 'habit';
|
||||
})
|
||||
_.each(user.dailys, function(task){
|
||||
task.type = 'daily';
|
||||
})
|
||||
_.each(user.todos, function(task){
|
||||
task.type = 'todo';
|
||||
})
|
||||
_.each(user.rewards, function(task){
|
||||
task.type = 'reward';
|
||||
})
|
||||
|
||||
db.users.update({_id:user._id}, {$set:{habits: user.habits, dailys: user.dailys, todos: user.todos, rewards: user.rewards}});
|
||||
});
|
||||
+1
-2
@@ -11,7 +11,7 @@
|
||||
"express": "*",
|
||||
"gzippo": "*",
|
||||
"guid": "*",
|
||||
"moment": "*",
|
||||
"moment": "~2.4.0",
|
||||
"stripe": "*",
|
||||
"coffee-script": "*",
|
||||
"nconf": "*",
|
||||
@@ -19,7 +19,6 @@
|
||||
"superagent": "~0.12.4",
|
||||
"resolve": "~0.2.3",
|
||||
"expect.js": "~0.2.0",
|
||||
"relative-date": "~1.1.1",
|
||||
"lodash": "~2.2.1",
|
||||
"async": "~0.2.9",
|
||||
"optimist": "~0.5.2",
|
||||
|
||||
@@ -22,7 +22,7 @@ menu
|
||||
line-height: 2
|
||||
|
||||
.customize-option
|
||||
border: 1px solid grey;
|
||||
border: 0px solid grey;
|
||||
background-color: hsl(0, 0%, 93%);
|
||||
margin-bottom: 10px
|
||||
|
||||
|
||||
@@ -128,6 +128,24 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A
|
||||
.controller('ChatCtrl', ['$scope', 'Groups', 'User', function($scope, Groups, User){
|
||||
$scope.message = {content:''};
|
||||
$scope._sending = false;
|
||||
|
||||
$scope.isUserMentioned = function(user, message) {
|
||||
if(message.hasOwnProperty("highlight"))
|
||||
return message.highlight;
|
||||
message.highlight = false;
|
||||
var messagetext = message.text.toLowerCase();
|
||||
var username = user.profile.name;
|
||||
var mentioned = messagetext.indexOf(username.toLowerCase());
|
||||
var pattern = "(\s|@|^){1}"+username+"([^\w]|$){1}";
|
||||
if(mentioned > -1) {
|
||||
var preceedingchar = messagetext.substring(mentioned-1,mentioned);
|
||||
if(mentioned == 0 || preceedingchar.trim() == '' || preceedingchar == '@'){
|
||||
var regex = new RegExp(pattern,'i');
|
||||
message.highlight = regex.test(messagetext);
|
||||
}
|
||||
}
|
||||
return message.highlight;
|
||||
}
|
||||
|
||||
$scope.postChat = function(group, message){
|
||||
if (_.isEmpty(message) || $scope._sending) return;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
li(ng-repeat='message in group.chat', ng-class='{highlight: indexOf(message.text.toLowerCase(), user.profile.name.toLowerCase()), "own-message": user._id == message.uuid}')
|
||||
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)')
|
||||
span(tooltip='{{contribText(message.contributor, message.backer)}}') {{message.user}}
|
||||
|
|
||||
span(ng-bind-html="message.text | linky:'_blank'")
|
||||
| -
|
||||
span.muted.time
|
||||
| {{relativeDate(message.timestamp, _currentTime) + ' '}}
|
||||
| {{moment(message.timestamp).fromNow() + ' '}}
|
||||
a(ng-show='user.contributor.admin || message.uuid == user.id', ng-click='deleteChatMessage(group, message)')
|
||||
i.icon-remove(tooltip='Delete')
|
||||
|
||||
@@ -47,10 +47,12 @@
|
||||
// Player Tiers
|
||||
.modal(style='position: relative;top: auto;left: auto;right: auto;margin: 0 auto 20px;z-index: 1;max-width: 100%;')
|
||||
.modal-header
|
||||
h3 Player Tier Legend
|
||||
h3 Player Tiers
|
||||
.modal-body
|
||||
small.
|
||||
Click labels to expand. See <a href='http://habitrpg.wikia.com/wiki/Contributor_Rewards' target='_blank'>contribution details.</a>
|
||||
Click tier labels below for more information. <br />
|
||||
<a href='http://habitrpg.wikia.com/wiki/Contributor_Rewards' target='_blank'>Learn more about contributor rewards</a> <br />
|
||||
<a href='http://habitrpg.wikia.com/wiki/Contributing_to_HabitRPG' target='_blank'>Learn how to contribute to HabitRPG</a>
|
||||
table.table.table-striped
|
||||
tr
|
||||
td
|
||||
|
||||
Reference in New Issue
Block a user