The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How to add rtl button to editor

View previous topic View next topic Go down

In progress How to add rtl button to editor

Post by 5arid on 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)




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

5arid
New Member

Posts : 13
Reputation : 1
Language : Farsi

http://microbaz.motionforum.net

Back to top Go down

In progress Re: How to add rtl button to editor

Post by SLGray on 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.


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


SLGray
Administrator
Administrator

Male Posts : 35641
Reputation : 2374
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

In progress Re: How to add rtl button to editor

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

How about setting the SCEditor to rtl as default?

5arid
New Member

Posts : 13
Reputation : 1
Language : Farsi

http://microbaz.motionforum.net

Back to top Go down

In progress Re: How to add rtl button to editor

Post by 5arid on 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?

5arid
New Member

Posts : 13
Reputation : 1
Language : Farsi

http://microbaz.motionforum.net

Back to top Go down

In progress Re: How to add rtl button to editor

Post by Ange Tuteur on 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 :

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: How to add rtl button to editor

Post by 5arid on 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

5arid
New Member

Posts : 13
Reputation : 1
Language : Farsi

http://microbaz.motionforum.net

Back to top Go down

In progress Re: How to add rtl button to editor

Post by Ange Tuteur on 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 :
http://help.forumotion.com/f30-suggestions-for-your-forums

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: How to add rtl button to editor

Post by 5arid on 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

5arid
New Member

Posts : 13
Reputation : 1
Language : Farsi

http://microbaz.motionforum.net

Back to top Go down

In progress Re: How to add rtl button to editor

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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