mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
remove trailing whitespace
This commit is contained in:
@@ -33,7 +33,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
group.$save();
|
group.$save();
|
||||||
group._editing = false;
|
group._editing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.deleteAllMessages = function() {
|
$scope.deleteAllMessages = function() {
|
||||||
if (confirm(window.env.t('confirmDeleteAllMessages'))) {
|
if (confirm(window.env.t('confirmDeleteAllMessages'))) {
|
||||||
User.user.ops.clearPMs({});
|
User.user.ops.clearPMs({});
|
||||||
@@ -72,7 +72,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
}
|
}
|
||||||
|
|
||||||
$scope.openInviteModal = function(group){
|
$scope.openInviteModal = function(group){
|
||||||
$rootScope.openModal('invite-friends', {controller:'InviteToGroupCtrl', resolve:
|
$rootScope.openModal('invite-friends', {controller:'InviteToGroupCtrl', resolve:
|
||||||
{injectedGroup: function(){
|
{injectedGroup: function(){
|
||||||
return group;
|
return group;
|
||||||
}}});
|
}}});
|
||||||
@@ -103,7 +103,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.controller('InviteToGroupCtrl', ['$scope', 'User', 'Groups', 'injectedGroup', '$http', 'Notification', function($scope, User, Groups, injectedGroup, $http, Notification){
|
.controller('InviteToGroupCtrl', ['$scope', 'User', 'Groups', 'injectedGroup', '$http', 'Notification', function($scope, User, Groups, injectedGroup, $http, Notification){
|
||||||
$scope.group = injectedGroup;
|
$scope.group = injectedGroup;
|
||||||
|
|
||||||
$scope.inviter = User.user.profile.name;
|
$scope.inviter = User.user.profile.name;
|
||||||
@@ -165,14 +165,14 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
Groups.Group.flagChatMessage({gid: groupId, messageId: message.id}, undefined, function(data){
|
Groups.Group.flagChatMessage({gid: groupId, messageId: message.id}, undefined, function(data){
|
||||||
Notification.text(window.env.t('abuseReported'));
|
Notification.text(window.env.t('abuseReported'));
|
||||||
$scope.$close();
|
$scope.$close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$scope.clearFlagCount = function(message, groupId) {
|
$scope.clearFlagCount = function(message, groupId) {
|
||||||
Groups.Group.clearFlagCount({gid: groupId, messageId: message.id}, undefined, function(data){
|
Groups.Group.clearFlagCount({gid: groupId, messageId: message.id}, undefined, function(data){
|
||||||
message.flagCount = 0;
|
message.flagCount = 0;
|
||||||
Notification.text("Flags cleared");
|
Notification.text("Flags cleared");
|
||||||
$scope.$close();
|
$scope.$close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
@@ -182,7 +182,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
$scope.response = [];
|
$scope.response = [];
|
||||||
$scope.usernames = [];
|
$scope.usernames = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.addNewUser = function(user) {
|
$scope.addNewUser = function(user) {
|
||||||
if($.inArray(user.user,$scope.usernames) == -1) {
|
if($.inArray(user.user,$scope.usernames) == -1) {
|
||||||
user.username = user.user;
|
user.username = user.user;
|
||||||
@@ -190,9 +190,9 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
$scope.response.push(user);
|
$scope.response.push(user);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.clearUserlist();
|
$scope.clearUserlist();
|
||||||
|
|
||||||
$scope.chatChanged = function(newvalue,oldvalue){
|
$scope.chatChanged = function(newvalue,oldvalue){
|
||||||
if($scope.group.chat && $scope.group.chat.length > 0){
|
if($scope.group.chat && $scope.group.chat.length > 0){
|
||||||
for(var i = 0; i < $scope.group.chat.length; i++) {
|
for(var i = 0; i < $scope.group.chat.length; i++) {
|
||||||
@@ -200,9 +200,9 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.$watch('group.chat',$scope.chatChanged);
|
$scope.$watch('group.chat',$scope.chatChanged);
|
||||||
|
|
||||||
$scope.caretChanged = function(newCaretPos) {
|
$scope.caretChanged = function(newCaretPos) {
|
||||||
var relativeelement = $('.chat-form div:first');
|
var relativeelement = $('.chat-form div:first');
|
||||||
var textarea = $('.chat-form textarea');
|
var textarea = $('.chat-form textarea');
|
||||||
@@ -219,23 +219,23 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.updateTimer = false;
|
$scope.updateTimer = false;
|
||||||
|
|
||||||
$scope.$watch(function () { return $scope.caretPos; },function(newCaretPos) {
|
$scope.$watch(function () { return $scope.caretPos; },function(newCaretPos) {
|
||||||
if($scope.updateTimer){
|
if($scope.updateTimer){
|
||||||
$timeout.cancel($scope.updateTimer)
|
$timeout.cancel($scope.updateTimer)
|
||||||
}
|
}
|
||||||
$scope.updateTimer = $timeout(function(){
|
$scope.updateTimer = $timeout(function(){
|
||||||
$scope.caretChanged(newCaretPos);
|
$scope.caretChanged(newCaretPos);
|
||||||
},$scope.watchDelay)
|
},$scope.watchDelay)
|
||||||
});
|
});
|
||||||
}])
|
}])
|
||||||
|
|
||||||
.controller('ChatCtrl', ['$scope', 'Groups', 'User', '$http', 'ApiUrl', 'Notification', 'Members', '$rootScope', function($scope, Groups, User, $http, ApiUrl, Notification, Members, $rootScope){
|
.controller('ChatCtrl', ['$scope', 'Groups', 'User', '$http', 'ApiUrl', 'Notification', 'Members', '$rootScope', function($scope, Groups, User, $http, ApiUrl, Notification, Members, $rootScope){
|
||||||
$scope.message = {content:''};
|
$scope.message = {content:''};
|
||||||
$scope._sending = false;
|
$scope._sending = false;
|
||||||
|
|
||||||
$scope.isUserMentioned = function(user, message) {
|
$scope.isUserMentioned = function(user, message) {
|
||||||
if(message.hasOwnProperty("highlight"))
|
if(message.hasOwnProperty("highlight"))
|
||||||
return message.highlight;
|
return message.highlight;
|
||||||
@@ -279,7 +279,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
if(data.chat) group.chat = data.chat;
|
if(data.chat) group.chat = data.chat;
|
||||||
|
|
||||||
var i = _.findIndex(group.chat, {id: message.id});
|
var i = _.findIndex(group.chat, {id: message.id});
|
||||||
if(i !== -1) group.chat.splice(i, 1);
|
if(i !== -1) group.chat.splice(i, 1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,7 +301,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
|
|
||||||
$scope.flagChatMessage = function(groupId,message) {
|
$scope.flagChatMessage = function(groupId,message) {
|
||||||
if(!message.flags) message.flags = {};
|
if(!message.flags) message.flags = {};
|
||||||
if(message.flags[User.user._id])
|
if(message.flags[User.user._id])
|
||||||
Notification.text(window.env.t('abuseAlreadyReported'));
|
Notification.text(window.env.t('abuseAlreadyReported'));
|
||||||
else {
|
else {
|
||||||
$scope.abuseObject = message;
|
$scope.abuseObject = message;
|
||||||
|
|||||||
Reference in New Issue
Block a user