Closed (fixed)
Project:
Facebook-style Statuses (Microblog)
Version:
6.x-2.x-dev
Component:
Code - Functionality
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
28 Jul 2008 at 02:34 UTC
Updated:
20 Apr 2009 at 02:30 UTC
The status form should be submitted using AJAX, while still calling the _validate and _submit functions. The AJAX should submit the form and then re-load the status so it can be displayed properly below the textfield.
I have no idea how to do this apart from using the JavaScript Tools module, and I don't want to add the dependency. If anyone knows how to do this, please explain or roll a patch.
Comments
Comment #1
icecreamyou commentedSwitching to 6.x-1.x-dev because 5.x-0.x-dev is hopefully being deleted. Drupal 6.x also has much better support for AJAX, so it should be easier to implement.
This is still planned for 5.x, but will be backported after the 6.x code is complete.
Comment #2
mariusooms commentedI'm not aware either how...but I happen to use the Friend module for Drupal 6 which uses a "corkboard" for messaging with Ajax support. Maybe it could help gather some ideas on how to implement this by looking at their code?
Kind regards,
Marius
Comment #3
icecreamyou commentedI mean, I know the theory, and I've looked through a few modules that do this. The problem isn't the PHP; it's the JavaScript, of which I know next to nothing. Last week I tried to integrate facebook_status with the AJAX Submit module from JSTools but couldn't figure out the JavaScript required to replace any statuses that were already displayed on the page.
...will take a look though when I have time. Which is less and less frequently these days.
Comment #4
icecreamyou commentedThis isn't going to happen until at least late summer 2009 if I'm the only one responsible for coding it. Closing, in the interest of keeping the issue queue clean.
Comment #5
igorik commentedHi
please look at this module Ajax submit, probably you will be not to need to learn ajax javascript techniques.
thanks for your promising module, with ajax it will be really useable.
Igorik
http://www.somvprahe.sk
Comment #6
icecreamyou commentedI've looked at that module, as well as its previous iterations. It doesn't work well enough because it doesn't update the status link thing.
Comment #7
michelleJust wanted to add a note that the ctools module merlinofchaos is working on will probably help with this. It's not ready, yet, but you may want to have a look when it is.
Michelle
Comment #8
icecreamyou commentedI would prefer to have a solution that applies to both 5.x and 6.x, but yes, it's possible that ctools could be useful.
The problem has nothing to do with refreshing the form though, it has to do with identifying everywhere on the page that a status is already displayed and changing it. This is particularly problematic with things like users' recent history, but the most important place is the text that you click on to show/hide the status form, and I don't even know how to do that without making it part of the form itself.
Comment #9
michelleAh, I see. I misunderstood and thought it was the ajax part you were having trouble with. I can't do ajax, myself, and am looking forward to cTools to assist.
Michelle
Comment #10
icecreamyou commentedWell, it *is* the AJAX that's the problem... but there are already tools out there that take care of the actual form submission. The problem is that there's more complexity than simply submitting the form.
Comment #11
PGiro commentedHave you looked at the popups module ? They seem to do it generically, maybe you can get an idea from there ?Or you can just have your module use that and not worry anymore about all of this... http://drupal.org/project/popups
Comment #12
icecreamyou commentedAs I've said already, it's more involved than that because there are a number of things on each page that need to be considered. Anyway, it shouldn't be particularly complicated--I just hardly know any JavaScript right now.
Comment #13
Scott Reynolds commentedPopups module will actually work. As it submits the form in the popup and you can tell it to RELOAD the page. You can also specify a callback function, which can then add the relevant changes to the page. It is very doable and not nearly as intimating as it is at first glance.
And its fun...
Comment #14
icecreamyou commentedThere are also two JavaScript-submit modules, neither of which is quite complete enough be completely dependable... plus there's a little more involved than just refreshing the form as it is at this point because the text that you click to reveal the form is handled separately right now. I haven't decided which route to take at this point but I'm thinking about either making everything part of the form or else refreshing the entire block like block_refresh.module. I have very little idea how to do either really but if no one writes a patch I'll look into it when 2.x comes around.
Comment #15
icecreamyou commentedWe're officially on 6.x-2.x now, so I'm re-opening this one. It's one of the few remaining things I need to complete before I will create an official release. Fortunately, Drupal 6 now handles almost everything involved through the #ahah form parameter, so it shouldn't be too difficult.
Comment #16
icecreamyou commentedMarking as fixed because the basic functionality is there. There are a few bugs but that can be addressed in a different issue.