inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Apr 18, 2014 15:35:00 GMT -8
Tim CamaraI am looking at the Events page and wondering if the "afterSearch" event is what I want to use for a script that runs on the micro-profile in a PM message? When I run the script like this: pb.events.on('afterSearch',function() { lionlikes(); }); It doesn't seem to work, but when I run it on that page on all ajax calls: $(document).ajaxComplete(function() { lionlikes(); }); the call works...does afterSearch not work on the Messages page after looking up a user?
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Apr 18, 2014 15:40:04 GMT -8
The messages page as in the page where you compose a message in the WYSIWYG/BBCode editors? It should be running after an autosearch is completed in a board, thread, or conversation (which is on first load, pagination, and search/filtering once on the page).
|
|
inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Apr 18, 2014 15:45:13 GMT -8
Yes, I am talking about calling it on the create a new message page.I am trying to make a code that gives a person a rank based off of the amount of likes they have. What I am doing is going in and removing their "post rank" and replacing it with the like rank. I have gotten the code to work on the profile page and thread list, but can't seem to get it to run on the create message page unless I run it on every ajax call like I showed above... I am probably just missing something stupid. I have been out of coding for a while now and just picked it back up with a lot of help from my brother who's been doing it more often now. I've found that I very often miss stupid things that I just don't catch cause I am not used to the coding yet If it's like that, I am sorry I wasted your time Edit:Actually the call one isn't really working either...right now when I have the function run on: $(document).ajaxComplete it does this when I start searching for a username: However, once I actually accept that name it reverts back to the script not running: So I am lost
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,852
December 2005
horace
|
Post by Chris on Apr 18, 2014 17:08:10 GMT -8
|
|
inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Apr 18, 2014 18:10:17 GMT -8
Thanks a TON Eton that helps a lot! I can now get it to change once it has added the user, however, this doesn't fix the problem with doing the change as the search is going on. Above in my first image I did that by running a script every time there is an ajax call, however, I doubt that is the best way to do it and there are simply too many pages to add to an if statement to make it only run on those pages... Edit:
Guess I could do: if($('[name="user_search_box_input"]') != null) { $(document).ajaxComplete(function() { lionlikes(); }); } ?? I did run into something else... If I need to create a new thread for this just let me know. For some reason my template edits to the micro-profile do not appear to be working on my forum right now when you go straight to the PM user link AKA "url.com/conversation/new/USER#". Is that intentional? I am actually not really sure what this page falls under in the template mod either...I just know it says that the content there is still a micro-profile.
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,852
December 2005
horace
|
Post by Chris on Apr 19, 2014 16:22:22 GMT -8
Thanks a TON Eton that helps a lot! I can now get it to change once it has added the user, however, this doesn't fix the problem with doing the change as the search is going on. Above in my first image I did that by running a script every time there is an ajax call, however, I doubt that is the best way to do it and there are simply too many pages to add to an if statement to make it only run on those pages... Edit:
Guess I could do: if($('[name="user_search_box_input"]') != null) { $(document).ajaxComplete(function() { lionlikes(); }); } ?? The widget unfortunately does not emit a similar event when it is in the middle of performing a search. You would need to hook directly into its _createListItem function in order to be notified whenever it creates a new user microprofile in the list. The following code should get you hooked in (function () { var cli = $.ui.selectlist.prototype._createListedItem; $.ui.selectlist.prototype._createListedItem = function (g) { var microProfile = cli.apply(this, arguments); //call original and grab the created element (is jQuery wrapped) /*var microProfile now contains the div of a user's microProfile returned from the search but not yet attached to the result window. You can modify the microprofile here then return it so it gets attached */ //(EXAMPLE) ADD A RED BACKGROUND TO EACH MICROPROFILE microProfile.css('background-color', 'red'); return microProfile; //make sure to return it!! } })()
btw an empty jquery array would not be equivalent to null I did run into something else... If I need to create a new thread for this just let me know. For some reason my template edits to the micro-profile do not appear to be working on my forum right now when you go straight to the PM user link AKA "url.com/conversation/new/USER#". Is that intentional? I am actually not really sure what this page falls under in the template mod either...I just know it says that the content there is still a micro-profile. If that is indeed the case then that would be something Tim would need to address
|
|
inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Apr 22, 2014 5:17:28 GMT -8
Tim Camara do you know anything about the conversation page issue?
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Apr 22, 2014 7:26:35 GMT -8
It's a known bug.
|
|
inherit
153968
0
Nov 19, 2012 15:03:05 GMT -8
Thesealion
New Phone Who Dis?
4,124
April 2010
joemaggio
|
Post by Thesealion on Apr 22, 2014 12:43:26 GMT -8
Any idea when it will be fixed?
Thanks everyone!!
|
|