Menu

#50 BiDi support

open
nobody
None
5
2006-05-27
2006-05-27
No

This plugin shows how to add two buttons to set the
directionality of the current block of text.

it allows to use two buttons: 'rtl' and 'ltr' that you
can place in the toolbar after registering the plugin
(currently the tooltips aren't translated and they are
hardcoded in the plugin)

This solution isn't perfect as it doesn't allow to
select several paragraphs and apply the directionality
to all of them in one click, and there might be other
errors that I'm forgetting about right now.

If you can improve it any fix is welcome.

Discussion

  • Alfonso Martinez

    BiDi plugin

     
  • Abdul-Aziz Al-Oraij (pk Top Man)

    Logged In: YES
    user_id=337120

    Hello Alfonso & everyone,
    I used to use styles for this approach, I just add:
    <Style name="RTL" element="div">
    <Attribute name="dir" value="rtl" />
    </Style>
    <Style name="LTR" element="div">
    <Attribute name="dir" value="ltr" />
    </Style>
    to "fckstyles.xml".
    But having a button is very much better.

    I truly belive that, it should be embedded in the full
    version, not just as a plug-in, it is there in all Text
    Editors (web based and non-web based ones).

    Thank you for such great effort.

    All The Best..
    Aziz

     
  • Abdul-Aziz Al-Oraij (pk Top Man)

    Logged In: YES
    user_id=337120

    Hello Alfonso

     
  • Alfonso Martinez

    Logged In: YES
    user_id=1356422

    Hello, I'm glad that you find the plugin useful, but as I
    said I know that it isn't a perfect solution.

    As I don't use such languages I don't need the functionality
    and I can't really test it properly so it would be better if
    someone that uses it can take it and make it work 100%.

     
  • yair

    yair - 2007-05-17

    Logged In: YES
    user_id=1795458
    Originator: NO

    I tested your plug in hebrew, it works fine but you comment the justify order . Ussually people work in hebrew or english not together, they expect that the dir order changes the jutification. Then this order must work always

    var justify = (dir == "rtl") ? "justifyright" : "justifyleft";
    FCK.Commands.GetCommand( justify ).Execute();

    The plug is very useful for bidi language, we need this feature we can't without it.

    thanks!

     
  • TIM

    TIM - 2010-03-08

    I'm using this plugin with the latest FCKeditor on Hebrew intrface wiki

    i can see the buttons, and when i press them the lines are align as it shut, but when saving noting happen.
    is this plugins shud work with FCK for wikimedia ? or only HTML ?

     
  • hadaso

    hadaso - 2010-03-08

    Looking at the code (with my limited amateur capabilities) I can see that it selects the block that contains the the selection and that block element may be the body (ays comment inside the code). Then if the saved source does not include the body node the formatting is lost. This is a problem that also happens with some other html editors. The workaround for a user is to manually create a block element to apply the formatting to (usually by explicitly applying right justification).

    FastMail.FM uses a different plugin (originally Alfonso developped the plugin for FM, but it seems that it has been extensively changed since then). It uses the dir attribute rather than the direction style which is a bit more W3C-friendly (per http://www.w3.org/International/questions/qa-bidi-css-markup\).

    It can be seen here: http://www.fastmail.fm/js/fckplugins/textdir/fckplugin.js
    It might work with the standard FCKeditor distribution and it might include stuff to make it work with other customization they made to the copy or FCKeditor in their webmail. I don't know since I'm not a FastMail developer. What I do know is that I use it daily and it works within FastMail's webmail.

    OTOH it might not completely solve rabin_y's problem since FM's code generates all content within div elements (by default every line is a <div> in their instance of FCKeditor).

     

Log in to post a comment.

Monday.com Logo