Skip to content

Commit

Permalink
Release 5.0.28 Parametrizar ver quien hace likes
Browse files Browse the repository at this point in the history
  • Loading branch information
ilopezsmx committed Dec 9, 2021
1 parent 4815f2b commit fe09359
Show file tree
Hide file tree
Showing 18 changed files with 1,064 additions and 1,369 deletions.
17 changes: 12 additions & 5 deletions builds/5.0.28/maxui.js
Original file line number Diff line number Diff line change
Expand Up @@ -8076,7 +8076,7 @@ max.templates = function() {
<div class="maxui-actions">\
<a href="" class="maxui-action maxui-commentaction maxui-icon- {{#replies}}maxui-has-comments{{/replies}}"><strong>{{replies.length}}</strong> {{literals.toggle_comments}}</a>\
<a href="" class="maxui-action maxui-favorites {{#favorited}}maxui-favorited{{/favorited}} maxui-icon-">{{literals.favorite}}</a>\
<a title="{{likesUsernames}}" href="" class="maxui-action maxui-likes {{#liked}}maxui-liked{{/liked}} maxui-icon-"><strong>{{likes}}</strong> {{literals.like}}</a>\
<a {{#showLikes}}title="{{likesUsernames}}" {{/showLikes}}href="" class="maxui-action maxui-likes {{#liked}}maxui-liked{{/liked}} maxui-icon-"><strong>{{likes}}</strong> {{literals.like}}</a>\
{{#canFlagActivity}}\
<a href="" class="maxui-action maxui-flag {{#flagged}}maxui-flagged{{/flagged}} maxui-icon-">{{literals.flag_activity_icon}}</a>\
{{/canFlagActivity}}\
Expand Down Expand Up @@ -9898,7 +9898,8 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
'maxTalkURL': "",
'generator': "",
'domain': "",
'showSubscriptionList': false
'showSubscriptionList': false,
'showLikes': true
};
// extend defaults with user-defined settings
maxui.settings = jq.extend(defaults, options);
Expand Down Expand Up @@ -10320,7 +10321,7 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
var liked = $likes.hasClass('maxui-liked');
var $likes_count = $likes.children('strong');
var likesUsernames = [];
if ($likes.attr('title') !== "") {
if ($likes.attr('title') && $likes.attr('title') !== "") {
likesUsernames = $likes.attr('title').split('\n');
}
if (liked) {
Expand All @@ -10331,14 +10332,18 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
likesUsernames = jq.grep(likesUsernames, function(value) {
return value !== maxui.settings.username;
});
$likes.attr('title', likesUsernames.join('\n'));
if (maxui.settings.showLikes) {
$likes.attr('title', likesUsernames.join('\n'));
}
} else {
maxui.maxClient.likeActivity(activityid, function(event) {
$likes.toggleClass('maxui-liked', true);
});
$likes_count.text(parseInt($likes_count.text(), 10) + 1);
likesUsernames.push(maxui.settings.username);
$likes.attr('title', likesUsernames.join('\n'));
if (maxui.settings.showLikes) {
$likes.attr('title', likesUsernames.join('\n'));
}
}
});
//Toggle flagged status via delegating the click to the activities container
Expand Down Expand Up @@ -11397,6 +11402,7 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
favorited: activity.favorited,
likes: activity.likesCount ? activity.likesCount : 0,
showLikesCount: maxui.currentSortOrder === 'likes',
showLikes: maxui.settings.showLikes,
liked: activity.liked,
likesUsernames: likesUsernames.join('\n'),
flagged: activity.flagged,
Expand Down Expand Up @@ -11577,6 +11583,7 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
if (arguments.length > 1) {
var callback = arguments[1];
func_params.push(function(items) {
maxui.settings.showLikes = window._MAXUI.showLikes;
// Determine write permission, granted by default if we don't find a restriction
maxui.settings.canwrite = true;
// If we don't have a context, we're in timeline, so we can write
Expand Down
2 changes: 1 addition & 1 deletion builds/5.0.28/maxui.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions builds/5.0.28/maxui.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/5.0.28/maxui.min.js.map

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions builds/5.0.28/maxuiactivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -7023,7 +7023,7 @@ max.templates = function() {
<div class="maxui-actions">\
<a href="" class="maxui-action maxui-commentaction maxui-icon- {{#replies}}maxui-has-comments{{/replies}}"><strong>{{replies.length}}</strong> {{literals.toggle_comments}}</a>\
<a href="" class="maxui-action maxui-favorites {{#favorited}}maxui-favorited{{/favorited}} maxui-icon-">{{literals.favorite}}</a>\
<a title="{{likesUsernames}}" href="" class="maxui-action maxui-likes {{#liked}}maxui-liked{{/liked}} maxui-icon-"><strong>{{likes}}</strong> {{literals.like}}</a>\
<a {{#showLikes}}title="{{likesUsernames}}" {{/showLikes}}href="" class="maxui-action maxui-likes {{#liked}}maxui-liked{{/liked}} maxui-icon-"><strong>{{likes}}</strong> {{literals.like}}</a>\
{{#canFlagActivity}}\
<a href="" class="maxui-action maxui-flag {{#flagged}}maxui-flagged{{/flagged}} maxui-icon-">{{literals.flag_activity_icon}}</a>\
{{/canFlagActivity}}\
Expand Down Expand Up @@ -8695,7 +8695,8 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
'maxTalkURL': "",
'generator': "",
'domain': "",
'showSubscriptionList': false
'showSubscriptionList': false,
'showLikes': true
};
// extend defaults with user-defined settings
maxui.settings = jq.extend(defaults, options);
Expand Down Expand Up @@ -9117,7 +9118,7 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
var liked = $likes.hasClass('maxui-liked');
var $likes_count = $likes.children('strong');
var likesUsernames = [];
if ($likes.attr('title') !== "") {
if ($likes.attr('title') && $likes.attr('title') !== "") {
likesUsernames = $likes.attr('title').split('\n');
}
if (liked) {
Expand All @@ -9128,14 +9129,18 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
likesUsernames = jq.grep(likesUsernames, function(value) {
return value !== maxui.settings.username;
});
$likes.attr('title', likesUsernames.join('\n'));
if (maxui.settings.showLikes) {
$likes.attr('title', likesUsernames.join('\n'));
}
} else {
maxui.maxClient.likeActivity(activityid, function(event) {
$likes.toggleClass('maxui-liked', true);
});
$likes_count.text(parseInt($likes_count.text(), 10) + 1);
likesUsernames.push(maxui.settings.username);
$likes.attr('title', likesUsernames.join('\n'));
if (maxui.settings.showLikes) {
$likes.attr('title', likesUsernames.join('\n'));
}
}
});
//Toggle flagged status via delegating the click to the activities container
Expand Down Expand Up @@ -10194,6 +10199,7 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
favorited: activity.favorited,
likes: activity.likesCount ? activity.likesCount : 0,
showLikesCount: maxui.currentSortOrder === 'likes',
showLikes: maxui.settings.showLikes,
liked: activity.liked,
likesUsernames: likesUsernames.join('\n'),
flagged: activity.flagged,
Expand Down Expand Up @@ -10372,6 +10378,7 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
if (arguments.length > 1) {
var callback = arguments[1];
func_params.push(function(items) {
maxui.settings.showLikes = window._MAXUI.showLikes;
// Determine write permission, granted by default if we don't find a restriction
maxui.settings.canwrite = true;
// If we don't have a context, we're in timeline, so we can write
Expand Down
4 changes: 2 additions & 2 deletions builds/5.0.28/maxuiactivity.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/5.0.28/maxuiactivity.min.js.map

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions builds/5.0.28/maxuichat.js
Original file line number Diff line number Diff line change
Expand Up @@ -9733,7 +9733,8 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
'maxTalkURL': "",
'generator': "",
'domain': "",
'showSubscriptionList': false
'showSubscriptionList': false,
'showLikes': true
};
// extend defaults with user-defined settings
maxui.settings = jq.extend(defaults, options);
Expand Down Expand Up @@ -9763,8 +9764,8 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
maxui.settings.readContext = undefined;
maxui.settings.writeContexts = [];
}
// Check showSubscriptionList consistency
if (maxui.settings.showSubscriptionList && maxui.settings.activitySource === 'activities') {
// Check showLikes consistency
if (maxui.settings.showLikes && maxui.settings.activitySource === 'activities') {
maxui.settings.showSubscriptionList = false;
}
// Get language from options or set default.
Expand Down Expand Up @@ -10154,7 +10155,7 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
var liked = $likes.hasClass('maxui-liked');
var $likes_count = $likes.children('strong');
var likesUsernames = [];
if ($likes.attr('title') !== "") {
if ($likes.attr('title') && $likes.attr('title') !== "") {
likesUsernames = $likes.attr('title').split('\n');
}
if (liked) {
Expand All @@ -10165,14 +10166,18 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
likesUsernames = jq.grep(likesUsernames, function(value) {
return value !== maxui.settings.username;
});
$likes.attr('title', likesUsernames.join('\n'));
if (maxui.settings.showLikes) {
$likes.attr('title', likesUsernames.join('\n'));
}
} else {
maxui.maxClient.likeActivity(activityid, function(event) {
$likes.toggleClass('maxui-liked', true);
});
$likes_count.text(parseInt($likes_count.text(), 10) + 1);
likesUsernames.push(maxui.settings.username);
$likes.attr('title', likesUsernames.join('\n'));
if (maxui.settings.showLikes) {
$likes.attr('title', likesUsernames.join('\n'));
}
}
});
//Toggle flagged status via delegating the click to the activities container
Expand Down Expand Up @@ -11231,6 +11236,7 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
favorited: activity.favorited,
likes: activity.likesCount ? activity.likesCount : 0,
showLikesCount: maxui.currentSortOrder === 'likes',
showLikes: maxui.settings.showLikes,
liked: activity.liked,
likesUsernames: likesUsernames.join('\n'),
flagged: activity.flagged,
Expand Down Expand Up @@ -11409,6 +11415,7 @@ MaxClient.prototype.unflagActivity = function(activityid, callback) {
if (arguments.length > 1) {
var callback = arguments[1];
func_params.push(function(items) {
maxui.settings.showLikes = window._MAXUI.showLikes;
// Determine write permission, granted by default if we don't find a restriction
maxui.settings.canwrite = true;
// If we don't have a context, we're in timeline, so we can write
Expand Down
4 changes: 2 additions & 2 deletions builds/5.0.28/maxuichat.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/5.0.28/maxuichat.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit fe09359

Please sign in to comment.