mirror of
https://github.com/friendica/friendica
synced 2025-04-24 11:50:10 +00:00
Make "like" links one way
- Updated dolike() function to accept a "un-" switch - [frio] Updated doLikeAction() function to call dolike() instead of having duplicated code - Added boolean logic (with explanatory truth table) to smartly delete existing activities in Model\Item::performActivity - Moved verb/activity parameter handling closer to their use in Model\Item::performActivity - Updated all references to dolike() and doLikeAction() to include the "un-" switch
This commit is contained in:
parent
e20d5ff0b5
commit
df1c74bd33
13 changed files with 117 additions and 92 deletions
|
@ -649,9 +649,15 @@ function imgdull(node) {
|
|||
// trickery. This still could cause confusion if the "like" ajax call
|
||||
// is delayed and NavUpdate runs before it completes.
|
||||
|
||||
function dolike(ident,verb) {
|
||||
/**
|
||||
* @param {int} ident The id of the relevant item
|
||||
* @param {string} verb The verb of the action
|
||||
* @param {boolean} un Whether to perform an activity removal instead of creation
|
||||
*/
|
||||
function dolike(ident, verb, un) {
|
||||
unpause();
|
||||
$('#like-rotator-' + ident.toString()).show();
|
||||
verb = un ? 'un' + verb : verb;
|
||||
$.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate);
|
||||
liking = 1;
|
||||
force_update = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue