andrewnicols / moodle-atto_htmlplus

HTMLPlus plugin for Atto
6 stars 9 forks source link

Problem with LTR in a RTL site #1

Closed mikidream closed 10 years ago

mikidream commented 10 years ago

When the Moodle website is within RTL language (eg Hebrew in my case) the layout of the htmlpluss is rtl instead of ltr. and I cant move it tl the left even without crtl+shift. in the regular html editor it work well . see images please reply me also to my email miki.alliel@gmail.com Thanks

htmlplus html-regular

ks

andrewnicols commented 10 years ago

Hi,

I'm afraid that I must plead my ignorance here. What is the expected behaviour with an RTL language?

Thanks,

Andrew

andrewnicols commented 10 years ago

@nadavkav, perhaps you can advise here ..?

nadavkav commented 10 years ago

Sure :smile: I will upload a suggested patch

nadavkav commented 10 years ago

You'll need to add:

.dir-rtl .CodeMirror-lines {text-align: left;}

to: lib/editor/atto/plugins/htmlplus/yui/src/codemirror/assets/moodle-atto_htmlplus-codemirror-core.css

(And run shifter & Moodle's purge caches for it to work, locally)

nadavkav commented 10 years ago

BTW, Great plugin :smile:

andrewnicols commented 10 years ago

Thanks @nadavkav,

I've added your commit. I moved it to the plugin styles.css instead of keeping it in Codemirror because codemirror only contains upstream code. I wonder if they need a pull request too actually...

andrewnicols commented 10 years ago

Actually @nadavkav, while the fix looks right, it makes the content unmanageable.

Do I understand correctly that the content should be LTR when in code view?

nadavkav commented 10 years ago

Indeed, I forgot to test it for usability. me bad.

I have added .dir-rtl .CodeMirror pre {direction:ltr;} Which seems to fix it. Please try it too and verify that it solve this issue

On 30 May 2014 06:18, Andrew Nicols notifications@github.com wrote:

Reopened #1 https://github.com/andrewnicols/moodle-atto_htmlplus/issues/1.

— Reply to this email directly or view it on GitHub https://github.com/andrewnicols/moodle-atto_htmlplus/issues/1#event-126276938 .

andrewnicols commented 10 years ago

That's the kind of solution I went for:

.dir-rtl .CodeMirror {
  direction: ltr;
}

Can I ask, why LTR? Just trying to understand the issue. I'll push out another version of the plugin this afternoon.

nadavkav commented 10 years ago

When a user is viewing Moodle from an RTL perspective, All the UI is right aligned and the directionality too. If you run any LTR CSS code into http://cssjanus.commoner.com/ you will get a converted CSS code that can display (mostly correct) the UI properly for RTL reading people to feel confortable with. Everything is mirrored. :-)

Exception to the above, should be all TEXTAREA and INPUT fields where we are absolutely always need to input English data: HTML, eMail, Date, file system path, URL, ...

On 30 May 2014 10:59, Andrew Nicols notifications@github.com wrote:

That's the kind of solution I went for:

.dir-rtl .CodeMirror { direction: ltr; }

Can I ask, why LTR? Just trying to understand the issue. I'll push out another version of the plugin this afternoon.

— Reply to this email directly or view it on GitHub https://github.com/andrewnicols/moodle-atto_htmlplus/issues/1#issuecomment-44624456 .

andrewnicols commented 10 years ago

Just to check, this is correct? screen shot 2014-05-30 at 16 28 25

nadavkav commented 10 years ago

Yes. Looks great.

BTW, I am also using CodeMirror in a forked version of block/configurable_reports. And I made a similar fix over there too. Where It seems I should have pushed it upstream.

On 30 May 2014 11:28, Andrew Nicols notifications@github.com wrote:

Just to check, this is correct? [image: screen shot 2014-05-30 at 16 28 25] https://cloud.githubusercontent.com/assets/370047/3128479/683b0c04-e7d4-11e3-97f3-b713615a0777.png

— Reply to this email directly or view it on GitHub https://github.com/andrewnicols/moodle-atto_htmlplus/issues/1#issuecomment-44626532 .

andrewnicols commented 10 years ago

The codemirror config suggests that it can support RTL, but that seems generally like the wrong thing: http://codemirror.net/doc/manual.html#option_rtlMoveVisually

nadavkav commented 10 years ago

http://codemirror.net/doc/manual.html#option_rtlMoveVisually - Is used for managing directionality corsor movements in a mixed RTL & LTR text in paragraphs. Where you wish to edit the text (not the HTML tags) when in HTML mode. It is useful in several cases.

On 30 May 2014 11:59, Andrew Nicols notifications@github.com wrote:

Closed #1 https://github.com/andrewnicols/moodle-atto_htmlplus/issues/1 via ed9165d https://github.com/andrewnicols/moodle-atto_htmlplus/commit/ed9165d4072e8844f85667418ca46c1d59d3eebb .

— Reply to this email directly or view it on GitHub https://github.com/andrewnicols/moodle-atto_htmlplus/issues/1#event-126340762 .

mikidream commented 10 years ago

Thank you Guys I just git pull and update the plugin in my moodle test and it looks great see image :-) htmlplus-fixed-rtl-ltr