And then using that (with a tiny bit of JS on the onclick attribute) to toggle between inline styles on the element (I think toggling between style="" and style="direction: rtl;" would probably do it).
I sent theymos a PM to check if he'd merge something like this: if he's agreeable, then I'll put together a proper patch.
Thank you PowerGlove definitely that should work. I just want to highlight that style="direction: rtl;" will work while writing and it will make it easy to write in Urdu/Arbaic as text will be RTL. But when post is posted and if it's without [ right ] [ /right ] tags then the text will still not be readable as it will be show LTR by default.
So in addition to direction style tag for composing a post, a Right Align BBCode must be added to make the post RTL readable.
To really solve the issue either RGHT ALIGN BBCode need to be added in the post or Urdu/Arabic posts must be shown RTL by default, which I'm sure wont be a small task to patch.
Perhaps the "RTL" function, when clicked, automatically adds the BBCode [ right ][ /right ] in the text box.
I don't know, it's just an idea.