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.

Easy write for staff on editor

5 posters

Go down

Solved Easy write for staff on editor

Post by TheCrow 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
TheCrow
TheCrow
Manager
Manager

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow November 14th 2013, 6:49 pm

bump
TheCrow
TheCrow
Manager
Manager

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ikerepc 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
Ikerepc
Active Poster

Male Posts : 1186
Reputation : 167
Language : Who cares...
Location : Where web help & support is needed

View user profile http://admins.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow 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
TheCrow
TheCrow
Manager
Manager

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ikerepc 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
Ikerepc
Active Poster

Male Posts : 1186
Reputation : 167
Language : Who cares...
Location : Where web help & support is needed

View user profile http://admins.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow 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...
TheCrow
TheCrow
Manager
Manager

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

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

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


Easy write for staff on 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 : 50262
Reputation : 3466
Language : English
Location : United States

View user profile https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow 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..
TheCrow
TheCrow
Manager
Manager

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

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

What exactly happens when you press the button now?


Easy write for staff on 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 : 50262
Reputation : 3466
Language : English
Location : United States

View user profile https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow November 15th 2013, 12:37 am

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

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ange Tuteur 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:
Easy write for staff on editor Captu118

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

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow 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.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Kaizer Lee 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
Kaizer Lee
Active Poster

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

View user profile http://www.medievalchaos.net/forum

Back to top Go down

Solved Re: Easy write for staff on editor

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

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow 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
TheCrow
TheCrow
Manager
Manager

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

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

That is very weird, I have it working perfect on my test forum.
Easy write for staff on editor Captu119

So to clarify you've done the following:

Created HTML page with script:
Easy write for staff on editor Captu120

Created widget with script source, applied to forum.
Easy write for staff on editor Captu121
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow November 16th 2013, 11:14 am

Ok, so i show? I Show you:

HTML:
Easy write for staff on editor Lh94oNw

Widget:
Easy write for staff on editor K8IZMJU

Reply Form:
Easy write for staff on editor I7uM9Td
TheCrow
TheCrow
Manager
Manager

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by Ange Tuteur 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?
Easy write for staff on editor Captu122

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
Ange Tuteur
Forumaster

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow November 16th 2013, 3:32 pm

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

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow November 19th 2013, 1:13 am

up
TheCrow
TheCrow
Manager
Manager

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

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

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

Post by TheCrow November 19th 2013, 11:53 am

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

Male Posts : 6786
Reputation : 786
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Easy write for staff on editor

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

You're welcome I love you 

Topic Solved and Archived
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile 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