The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to add rtl button to editor

3 posters

Go down

In progress How to add rtl button to editor

Post by 5arid August 1st 2014, 10:00 am

Hi
I want to add these two buttons to the editor (post a message) :
Right-to-Left (rtl)(/rtl)
Left-to-Right (ltr)(/ltr)

How to add rtl button to editor Elejl3qg8i3s043688bt_thumb


Here is My forum which is phpBB2

Here is a demo for SEEditor which has these buttons

How can I do it?

Thanks in advance
avatar
5arid
New Member

Posts : 13
Reputation : 2
Language : Farsi

https://microbaz.forumotion.com/

Back to top Go down

In progress Re: How to add rtl button to editor

Post by SLGray August 1st 2014, 10:35 am

Sorry, but those BBCodes will not work on Forumotion forums.  Not all BBCodes can work on forums hosted by different companies.


How to add rtl button to editor Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51481
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: How to add rtl button to editor

Post by 5arid August 1st 2014, 11:55 am

How about setting the SCEditor to rtl as default?
avatar
5arid
New Member

Posts : 13
Reputation : 2
Language : Farsi

https://microbaz.forumotion.com/

Back to top Go down

In progress Re: How to add rtl button to editor

Post by 5arid August 2nd 2014, 8:19 am

I could set the SCEditor to RTL as default :

Administration Panel > Modules > HTML & JAVASCRIPT > Javascript codes managment > Create a new javascript :

Title : RTL Dir
Placement : In all the pages
Javascript Code :
Code:
$(function(){$(function(){$('.sceditor-container iframe').contents().find('p').attr('dir','rtl')})});

Enable Javascript code management : Yes

***************************************************

The above code works fine for RTL function.
So this code should work for LTR function :
Code:
$(function(){$(function(){$('.sceditor-container iframe').contents().find('p').attr('dir','ltr')})});

Now how can I make those new buttons using these codes?
avatar
5arid
New Member

Posts : 13
Reputation : 2
Language : Farsi

https://microbaz.forumotion.com/

Back to top Go down

In progress Re: How to add rtl button to editor

Post by Ange Tuteur August 2nd 2014, 1:56 pm

Those tags exist for typing in the Sceditor already.

ltr :
Code:
[left][/left]

rtl :
Code:
[right][/right]

The text alignment buttons :
How to add rtl button to editor Captur68
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: How to add rtl button to editor

Post by 5arid August 2nd 2014, 2:23 pm

@ Ange Tuteur
No that is different!
Read this to find out their difference :
align Attribute (left|right|center|justify)
dir Attribute (ltr|rtl|auto)

Also you can see the difference practically with this : Here is a demo for SEEditor which has these buttons
avatar
5arid
New Member

Posts : 13
Reputation : 2
Language : Farsi

https://microbaz.forumotion.com/

Back to top Go down

In progress Re: How to add rtl button to editor

Post by Ange Tuteur August 2nd 2014, 2:41 pm

I see what you mean now. Unfortunately the rtl and ltr tags are not in the bbcodes for Forumotion's Sceditor.

You can always suggest to add these tags though :
https://help.forumotion.com/f30-suggestions-for-your-forums
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: How to add rtl button to editor

Post by 5arid August 2nd 2014, 3:05 pm

Well, for now I am pleased with my sceditor to some extent because by using the above code it is RTL and typing Farsi works fine.
For typing English I need LTR button for sure but fortunately it is not really necessary, so I can live without that!

By the way here is a nice tutorial : Tutorial: How to add buttons in your SCEditor (Quick reply and New Topic form)
By using it I could add LTR button, but it seems it is useless as you mentioned it :

Ange Tuteur wrote:Unfortunately the rtl and ltr tags are not in the bbcodes for Forumotion's Sceditor

Or maybe I messed up something?!  Mr. Green
avatar
5arid
New Member

Posts : 13
Reputation : 2
Language : Farsi

https://microbaz.forumotion.com/

Back to top Go down

In progress Re: How to add rtl button to editor

Post by Ange Tuteur August 2nd 2014, 4:14 pm

Correct, rtl and ltr are not in Forumotion's bbcodes, so :

writing
[rtl]text[/rtl]
and
[ltr]text[/ltr]
would do nothing.

That topic only uses the insertText method which does no parsing of tags you make up.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum