inherit
97216
0
Nov 23, 2024 12:51:52 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on May 16, 2014 22:15:20 GMT -8
I'm trying to change the words that are used for "likes", and there's no reliable way to do it because of the time the server takes to process the request and send a response back. If there would be a way to add an ajax-related after like event, that would be spectacular. Wouldn't be very hard to add either; just another argument to your ajax function call that is executed after receiving a server response. I could see it being used as either post.on_like or something.
|
|
inherit
97216
0
Nov 23, 2024 12:51:52 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Jun 6, 2014 10:52:32 GMT -8
Bumping.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jun 6, 2014 14:53:14 GMT -8
Just roll your own by extending the ProBoards events.
(function(){
proboards.events.liked = []; proboards.events.likedOne = []; $.ajaxPrefilter(function(opts, orig_opts){ if(orig_opts.url == proboards.routeMap["post_like"]){ var orig_success = orig_opts.success;
opts.success = function(){ orig_success.apply(this, arguments); proboards.events.run("liked"); }; } }); })();
And an example of how to use it...
proboards.on("liked", function(){ $("span.likes").html($("span.likes").html().replace("likes", "<strong>eats</strong>")) });
|
|