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.

Easy write for staff on editor

View previous topic View next topic Go down

Solved Easy write for staff on editor

Post by Luffy on November 13th 2013, 2:41 pm

Hello.. Well my problem is this..

I am using this code in Forum Widgets and its visible only for staff.

Code:
<script>jQuery(function(){jQuery(function(){jQuery('<a class="sceditor-button" unselectable="on" title="BBCode ( Ready Code)"><div unselectable="on" style="background-image:url(https://cdn1.iconfinder.com/data/icons/fatcow/16/text_letter_omega.png)"></div></a>').insertBefore('.sceditor-button-size').click(function(){jQuery('#text_editor_textarea').sceditor("instance").insertText("<center>???code???</center>")})})});</script>
All i want is, in the code to complete the code where it says ???code??? so as soon as you push it, to show this:

Code:
[font=Comic Sans MS][size=16][color=red][/color][/size][/font]
Thank you...


Last edited by Marios94 on November 19th 2013, 11:54 am; edited 1 time in total

Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 14th 2013, 6:49 pm

bump






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ikerepc on November 14th 2013, 7:37 pm

Hello

You need just html code for this:
Code:
[font=Comic Sans MS][size=16][color=red][/color][/size][/font]
I'm I right?

If yes try this:
Code:
<font style="Comic Sans MS" size="16px" color="#ff0000"></font>
if you don't want that, please try to explain better.

Ikerepc
Active Poster

Male Posts : 1114
Reputation : 152
Language : Croatian, HTML, CSS, jQuery, JavaScript, PHP, SQL, Bascom, Python, C, FBD & LAD for PLC and more... Little English :D
Location : Around electronics and progmamming ;)

http://help.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 14th 2013, 8:07 pm

This code should work as the first code u wrote in the reply from. for example if i use this:
<font style="Comic Sans MS" size="16px" color="#ff0000">Text Here!</font>
i should have as preview message this:
Text Here!

Unfortunately this code doesn't work.. Sad

Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ikerepc on November 14th 2013, 9:37 pm

Then you can use css.

Paste this in css stylesheet:
Code:
.stms {
  font-family: "Comic Sans MS",Arial,Verdana,Tahoma;
  color: #f00;
  text-height: 16px;
}
Then paste in that code in place of font tag this tag:
Code:
<span class="stms"></span>

Ikerepc
Active Poster

Male Posts : 1114
Reputation : 152
Language : Croatian, HTML, CSS, jQuery, JavaScript, PHP, SQL, Bascom, Python, C, FBD & LAD for PLC and more... Little English :D
Location : Around electronics and progmamming ;)

http://help.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 14th 2013, 11:56 pm

now it doesn't show the button...

To show you my problem...
I have this widget that i named BBcode. In this widget i have this code:
Code:
<script>jQuery(function(){jQuery(function(){jQuery('<a class="sceditor-button" unselectable="on" title="BBCode ( Έτοιμος Κώδικας)"><div unselectable="on" style="background-image:url(https://cdn1.iconfinder.com/data/icons/fatcow/16/text_letter_omega.png)"></div></a>').insertBefore('.sceditor-button-size').click(function(){jQuery('#text_editor_textarea').sceditor("instance").insertText("<center>????? Here the text ?????</center>")})})});</script>
All i want is to complete the ????? so that the code in the reply form to show after posting this:
Code:
[font=Comic Sans MS][size=16][color=#ff0000]Here the text[/color][/size][/font]
Result of button after posting:
Here the text

Just this...

Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by SLGray on November 15th 2013, 12:15 am

How you removed this - ????? Here the text ????? - and added what you want?


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


SLGray
Administrator
Administrator

Male Posts : 35606
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 15th 2013, 12:18 am

That 's what i want.. TO make a code that as soon as you press the button to paste one code so the result will be as the one above..






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by SLGray on November 15th 2013, 12:20 am

What exactly happens when you press the button now?


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


SLGray
Administrator
Administrator

Male Posts : 35606
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 15th 2013, 12:37 am

the way i gave the code it shows :
Code:
<center>????? Here the text ?????</center>






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ange Tuteur on November 15th 2013, 12:40 am

Hello Marios94,

Widgets do not preserve bbcodes, they instead are converted to HTML. If you want this to be visible only to staff do the following.

Administration Panel > Modules > HTML & JAVASCRIPT > HTML pages management

create a new HTML page, name what you wish, and paste the source code:
Code:
<!--
jQuery(function(){jQuery(function(){jQuery('<a class="sceditor-button" unselectable="on" title="BBCode ( Έτοιμος Κώδικας)"><div unselectable="on" style="background-image:url(https://cdn1.iconfinder.com/data/icons/fatcow/16/text_letter_omega.png)"></div></a>').insertBefore('.sceditor-button-size').click(function(){jQuery('#text_editor_textarea').sceditor("instance").insertText("[font=Comic Sans MS][size=16][color=#ff0000]Here the text[/color][/size][/font]")})})});
-->
Now edit your widget with the following content modifying the src:
Code:
<script src="/MYHTMLPAGE"></script>
Your script source must be your HTML page location which has the script:


If you do everything correctly the button should apply the correct bbcodes.

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 15th 2013, 7:36 am

I used the exact code to the HTML, and then i went to widget i added both links: the first was "/h1-page" and the other one "*link of forum*/h1-page" but in both occasions, the button did not appear to the text editor.






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Kaizer Lee on November 15th 2013, 10:33 am

Because the code you want is for the old editor Smile.

No one has done any new codes for the Staff buttons lol. Just informing anyone if they're wondering since I've asked this problem too ._.

Kaizer Lee
Active Poster

Female Posts : 1064
Reputation : 54
Language : English, Tagalog, Spanish and Chinese
Location : Philippines

http://www.medievalchaos.net/forum

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ange Tuteur on November 15th 2013, 2:13 pm

Marios94 wrote:I used the exact code to the HTML, and then i went to widget i added both links: the first was "/h1-page" and the other one "*link of forum*/h1-page" but in both occasions, the button did not appear to the text editor.
How did you copy the HTML script I provided? I've been noticing the code tags have been messing with scripts adding line breaks where they're not needed.

If you haven't, copy the script I've provided using the 'select content' button.

Try this also instead of the other script tags:
Code:
<script type="text/javascript" src="/h1-page"></script>
Kaizer Lee,

This script is for the sceditor.

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 15th 2013, 2:37 pm

Seth i did that and the code u gave me, made the button disappear..

Lets try the second one u just gave me


Edit: Still nothing

Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ange Tuteur on November 15th 2013, 2:50 pm

That is very weird, I have it working perfect on my test forum.


So to clarify you've done the following:

Created HTML page with script:


Created widget with script source, applied to forum.

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 16th 2013, 11:14 am

Ok, so i show? I Show you:

HTML:


Widget:


Reply Form:






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ange Tuteur on November 16th 2013, 1:53 pm

Well there's one more thing for you to try then, because I'm not exactly sure what could be preventing it from working.

Are your forum widget settings set as the following?


Left and/or right need to be at 180 depending on which column this widget is in.

If that isn't it perhaps you should try resyncing your forum.
Administration Panel > General > Forum > Configuration

Scroll to bottom, tick 'Resynchronize your forum', and save.

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 16th 2013, 3:32 pm

the settings are like that and also, i made the resynchronize but still nothing!






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 19th 2013, 1:13 am

up






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ange Tuteur on November 19th 2013, 1:57 am

Hello Marios94,

Apologies for the wait as I've just figured the issue as to why it is not showing today. Chrome cannot read scripts in comments which renders the past method useless.

Please do the following.
Administration Panel > Modules > HTML & JAVASCRIPT > HTML pages management

Edit your old page, delete the contents, and paste this in its place:
Code:
jQuery('#modBouton').click(function(){
jQuery('#text_editor_textarea').sceditor("instance").insertText("[font=Comic Sans MS][size=16][color=#ff0000]Here the text[/color][/size][/font]");
});
Save and then head over to widgets management.

Edit your current widget, delete the contents, and paste this in its place:
Code:
<script type="text/javascript">jQuery(function(){
jQuery(function(){
jQuery('<a id="modBouton" class="sceditor-button" unselectable="on" title="BBCode ( Έτοιμος Κώδικας)"><div unselectable="on" style="background-image:url(https://cdn1.iconfinder.com/data/icons/fatcow/16/text_letter_omega.png)"></div></a>').insertBefore('.sceditor-button-size');
});
});
jQuery.getScript('/h2-page');
</script>
Before you save you need to edit one thing, this line:(its at the bottom of the widget)
Code:
jQuery.getScript('/h2-page');
Change the source to your HTML page which has the script and it should work.

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Luffy on November 19th 2013, 11:53 am

Seth you are amazing!! Thank you very much!! The code works!!! Topic solved!






Luffy
Manager
Manager

Male Posts : 4035
Reputation : 407
Language : Greek, English
Location : Greece

http://www.thinktankforum.net

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ange Tuteur on November 19th 2013, 4:16 pm

You're welcome I love you 

Topic Solved and Archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
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