It would be nice to make the form empty when the user clicks on input textarea. This will avoid selecting the whole space to create a new status.
Thanks
It would be nice to make the form empty when the user clicks on input textarea. This will avoid selecting the whole space to create a new status.
Thanks
Comments
Comment #1
icecreamyou commentedYeah, it would be nice. But I have no idea how to do it. I'll probably rewrite the module from scratch for a 2.x branch at some point, and I'll look at this when that happens or if someone submits a patch in the mean time.
Comment #2
dave_trigeia commentedThis isn't too tough, if you're willing to accept a JavaScript solution. I don't know how to do patches the drupal way, so I'll just share the code I used. I edited the facebook_status.js file in this module. I know it's not "the right way" to do it, but maybe you could add this into the module and then it wouldn't matter next time. I picked the function name that I did because I figured it probably wouldn't conflict with anything else that's out there. Feel free to choose something more appropriate. This is the full contents of the file now:
Comment #3
icecreamyou commentedThanks dave:
To get your spacing to stay the same when you submit a post, surround your code with <code></code> tags. Also you should name functions like this:
modulename_description(). If you clean that up a little I'll test it out and if it works I'll add it to the module.Comment #4
dave_trigeia commentedThanks for the <code> hint. I edited the post with it, but that one line is so long that it runs right off the edge. I also renamed the function, I believe properly, so it should be ready for you to test.
Comment #5
icecreamyou commentedCool. I was inspired enough by a few tweaks I wanted to make that I went and spent an hour learning basic JQuery. Here's the result. I tested on 5.x and 6.x (remember to refresh your JS cache, especially on 6.x at admin/settings/performance, before testing). However I'm far from a JQ expert so I'd like someone to check this and mark it RTBC if it works and can't be simplified. At that point I'll commit it to both branches.
Comment #6
gausarts commentedThanks for the great support.
I was about to try some theme override I found somewhere which is fine for the login block:
But I had no idea to do it right with the facebook_status module:) Thanks
Comment #7
icecreamyou commentedHah, even if you knew how that code has to be implemented, and assuming it works, it would clear the form every time you clicked it.
Anyway, even though I'd like someone who knows a lot about JQ syntax to review this to make sure I can't dramatically simplify the code, I've been using it and I know it works, and apparently at least one person confirms that, so... committed!
Comment #8
dave_trigeia commentedI updated the module with your new release and it works great. Thanks for the attention.