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.

Staff " modding" editer problem

2 posters

Go down

Solved Staff " modding" editer problem

Post by Ape March 9th 2014, 7:56 pm

Hi all i have been trying to get this staff only button made from this thread
https://help.forumotion.com/t128220-easy-write-for-staff-on-editor

the problem i have is i want to make a set of buttons with this code in them
but when i add the code the buttons don't work they come up but then they don't post the code 

This in the HTML page

Code:
jQuery('#modBouton').click(function(){
jQuery('#text_editor_textarea').sceditor("instance").insertText("[table style="background: url('http://cdn3.iconfinder.com/data/icons/fatcow/32x32_0020/accept.png') no-repeat 6px #effeb9; border: 1px solid #9ac601; color: #4F8A10; padding: 6px 6px 6px 40px; width: 99%; text-shadow: 0 1px 0 #FFFAF1; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset; font-weight: bold; border-radius: 3px 3px 3px 3px;"][tr][td]Content goes here...Content goes here...Content goes here...Content goes here...Content goes here...Content goes here... [/td]
[/tr]
[/table]");
});

and this is in the Widgets

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('/h1-staffbutton1');
</script>

Spoiler:
there is a set of 3 staff buttons i want to have in place

any help with this will be really good

Thanks

Ape


Last edited by APE on March 10th 2014, 4:31 am; edited 1 time in total
Ape
Ape
Administrator
Administrator

Male Posts : 19454
Reputation : 2012
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Staff " modding" editer problem

Post by Ange Tuteur March 10th 2014, 3:38 am

Hello APE,

Have you see this topic ?
https://help.forumotion.com/t131256-#880019

A little down further I have an exemple of a list.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Staff " modding" editer problem

Post by Ape March 10th 2014, 3:49 am

Ange Tuteur wrote:Hello APE,

Have you see this topic ?
https://help.forumotion.com/t131256-#880019

A little down further I have an exemple of a list.
Yes but i wanted the way it is in the link :(with 3 buttons  in the new editor
each with
on of them items in it
Spoiler:
Ape
Ape
Administrator
Administrator

Male Posts : 19454
Reputation : 2012
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Staff " modding" editer problem

Post by Ange Tuteur March 10th 2014, 4:21 am

Try this :
Admin panel > modules > javascript codes management > create a new script

Title : what you wish
Placement : in all the pages
Paste the code below and save :
Code:
$(window).load(function() {
    var settings = {
       // button 1
       img1 : 'backgroud img for button',
       title1 : 'title of button',
       tagStart1 : '[table style="background: url(\'http://cdn1.iconfinder.com/data/icons/musthave/24/Information.png\') no-repeat 6px #d1e4f3; border: 1px solid #4d8fcb; color: #00529B; padding: 6px 6px 6px 40px; width: 99%; text-shadow: 0 1px 0 #FFFAF1; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset; font-weight: bold; border-radius: 3px 3px 3px 3px;"][tr][td]',
       tagEnd1 : '[/td][/tr][/table]',
       // button 2
       img2 : 'backgroud img for button',
       title2 : 'title of button',
       tagStart2 : '[table style="background: url(\'http://cdn3.iconfinder.com/data/icons/fatcow/32x32_0020/accept.png\') no-repeat 6px #effeb9; border: 1px solid #9ac601; color: #4F8A10; padding: 6px 6px 6px 40px; width: 99%; text-shadow: 0 1px 0 #FFFAF1; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset; font-weight: bold; border-radius: 3px 3px 3px 3px;"][tr][td]',
       tagEnd2 : '[/td][/tr][/table]',
       // button 3
       img3 : 'backgroud img for button',
       title3 : 'title of button',
       tagStart3 : '[table style="background: url(\'http://cdn1.iconfinder.com/data/icons/CrystalClear/32x32/actions/messagebox_critical.png\') no-repeat 6px #fccac3; border: 1px solid #db3f23; color: #D8000C; padding: 6px 6px 6px 40px; width: 99%; text-shadow: 0 1px 0 #FFFAF1; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset; font-weight: bold; border-radius: 3px 3px 3px 3px;"][tr][td]',
       tagEnd3 : '[/td][/tr][/table]'
    };
    if (_userdata["user_level"] == '1' || _userdata["user_level"] == "2") {
       $('.sceditor-button-fahide').after('<a class="sceditor-button sceditor-button-message1" title="'+settings["title1"]+'"><div style="background:url('+settings["img1"]+') no-repeat;"></div></a><a class="sceditor-button sceditor-button-message2" title="'+settings["title2"]+'"><div style="background:url('+settings["img2"]+') no-repeat;"></div></a><a class="sceditor-button sceditor-button-message3" title="'+settings["title3"]+'"><div style="background:url('+settings["img3"]+') no-repeat;"></div></a>');
      
      $('.sceditor-button-message1').click(function() { $('#text_editor_textarea').sceditor('instance').insertText(settings["tagStart1"],settings["tagEnd1"]) });
       $('.sceditor-button-message2').click(function() { $('#text_editor_textarea').sceditor('instance').insertText(settings["tagStart2"],settings["tagEnd2"]) });
       $('.sceditor-button-message3').click(function() { $('#text_editor_textarea').sceditor('instance').insertText(settings["tagStart3"],settings["tagEnd3"]) });
    }
});

In the settings, there's some stuff you can modify.

img : is the background image of the button. It can be an url, of about 16*16
title : is the title of the button
tagStart : is the starting tags
tagEnd : is the ending tags
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Staff " modding" editer problem

Post by Ape March 10th 2014, 4:30 am

Wow thats just how i wanted it thank you so so so much


Staff " modding" editer problem Left1212Staff " modding" editer problem Center11Staff " modding" editer problem Right112
Staff " modding" editer problem Ape_b110
Staff " modding" editer problem Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19454
Reputation : 2012
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Staff " modding" editer problem

Post by Ange Tuteur March 10th 2014, 4:33 am

You're welcome :rose:

Topic solved and archived

Have a good day and see you. Very Happy
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Back to top


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