Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 4 users online :: 0 Registered, 0 Hidden and 4 Guests :: 2 Bots
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
[SOLVED] Editor botton
Page 1 of 1 • Share
- Kisskiss
- Gender :
Posts : 47
Points : 3132
Reputation : 1
Language : Italian, spanish
Browser : Forum Version :
Hello,
How could I add a button in the editor visible to the staff ?
I have some tables that uses only the staff and those buttons would need to place the code in the editor no longer copy and paste.
Thank you!
How could I add a button in the editor visible to the staff ?
I have some tables that uses only the staff and those buttons would need to place the code in the editor no longer copy and paste.
Thank you!
Last edited by Kisskiss on Fri 05 Aug 2016, 19:21; edited 1 time in total
Hi @Kisskiss,
Are any of these topics related to what you're asking ?
http://help.forumotion.com/t141539-is-that-possible-simple-menu-with-quick-replys#965626
http://help.forumotion.com/t131427-staff-modding-editer-problem
http://help.forumotion.com/t144390-staff-button-on-text-editor
Let me know.
Are any of these topics related to what you're asking ?
http://help.forumotion.com/t141539-is-that-possible-simple-menu-with-quick-replys#965626
http://help.forumotion.com/t131427-staff-modding-editer-problem
http://help.forumotion.com/t144390-staff-button-on-text-editor
Let me know.
- Kisskiss
- Gender :
Posts : 47
Points : 3132
Reputation : 1
Language : Italian, spanish
Browser : Forum Version :
http://help.forumotion.com/t141539-is-that-possible-simple-menu-with-quick-replys#965626
I used that, it works !
I want to add more , just want them to have different images , as I customize the CSS ?
botton 1
botton 2
????
I used that, it works !
I want to add more , just want them to have different images , as I customize the CSS ?
botton 1
- Code:
.sceditor-button-messages div {
background-image:url('IMAGE') !important;
}
botton 2
????
Hello again @Kisskiss,
For creating a second button follow the same steps, BUT in the script replace all instances of 'messages' ( apostrophes included ), with something like 'messages_2'. Then your CSS will look like this :
For creating a second button follow the same steps, BUT in the script replace all instances of 'messages' ( apostrophes included ), with something like 'messages_2'. Then your CSS will look like this :
- Code:
.sceditor-button-messages_2 div {
background-image:url('IMAGE') !important;
}
- Kisskiss
- Gender :
Posts : 47
Points : 3132
Reputation : 1
Language : Italian, spanish
Browser : Forum Version :
But I have not figured out how to make it visible only to staff groups ( possibly only a few ) because even now users see the button
Thanks
Thanks
- Kisskiss
- Gender :
Posts : 47
Points : 3132
Reputation : 1
Language : Italian, spanish
Browser : Forum Version :
you can also choose the groups to make it visible here ?
- Kisskiss
- Gender :
Posts : 47
Points : 3132
Reputation : 1
Language : Italian, spanish
Browser : Forum Version :
We have to change all the code to do this with the member ID ?
Well if you wanted to do it by member id we'd have to replace this :
with this :
You have to separate each user id by "||" which literally translates to "OR"
- Code:
if (!$.sceditor) return;
with this :
- Code:
if (!$.sceditor && _userdata.user_id == 1 || 2 || 3 || 4) return;
You have to separate each user id by "||" which literally translates to "OR"
- Kisskiss
- Gender :
Posts : 47
Points : 3132
Reputation : 1
Language : Italian, spanish
Browser : Forum Version :
one last question ... in that code I can add only 3 buttons, but if I do not want to 5 ?? I tried to add more ' title ' : ' code ' but not the button appears
Ah about that ! On the last pair :
you need to add a comma "," after it to end that line. It's sorta like a period in a sentence. If you leave it out it'll cause an error.
This is how it would look with 2 additional presets :
|
This is how it would look with 2 additional presets :
- Code:
var messages = {
'Title' : 'Message content',
'Hello' : 'Good day !',
'Goodbye' : 'See you !',
'NEW PRESET 1' : 'message..',
'NEW PRESET 2' : 'message..'
},
- Kisskiss
- Gender :
Posts : 47
Points : 3132
Reputation : 1
Language : Italian, spanish
Browser : Forum Version :
Hmmmm no, the problem not solved
Last edited by Kisskiss on Fri 05 Aug 2016, 19:20; edited 1 time in total
You need to escape any apostrophes inside the string with the escape character : "\", otherwise it'll cause an error.
For example : l'apposita icona ----> l\'apposita icona
Here's the corrected code :
For example : l'apposita icona ----> l\'apposita icona
Here's the corrected code :
- Code:
$(function() {
if (!$.sceditor) return;
$.sceditor.command.set('messages_2', {
dropDown : function(editor, caller, callback) {
var messages_2 = {
'Risolto - admin' : '[table class="moderation-message" style="width: 100%;background: #F03333;margin-top: 5px;margin-bottom: 5px;border-bottom: 3px solid #F03333;padding: 5px;border-radius: 4px;font-weight: bold;color: #fff;font-size: 12px;text-shadow: 1px 1px 3px rgba(0,0,0,0.1);font-family: Trebuchet MS, Helvetica, Arial, sans-serif"][tr][td width="1%"][img]http://i21.servimg.com/u/f21/11/80/17/98/solved10.png[/img][/td]\n[td]Caro Utente,\nti ricordiamo che se il tuo problema puo essere considerato [b]Risolto[/b], è necessario inserire l\'apposita icona, in modo da permettere allo staff di archiviare il topic.\n \nGrazie per la comprensione, A presto! 8) [/td]\n[/tr]\n[/table]',
'Risolto - mod' : '[table class="moderation-message" style="width: 100%;background: #787EEB;margin-top: 5px;margin-bottom: 5px;border-bottom: 3px solid #787EEB;padding: 5px;border-radius: 4px;font-weight: bold;color: #fff;font-size: 12px;text-shadow: 1px 1px 3px rgba(0,0,0,0.1);font-family: Trebuchet MS, Helvetica, Arial, sans-serif"][tr][td width="1%"][img]http://i21.servimg.com/u/f21/11/80/17/98/solved10.png[/img][/td]\n[td]Caro Utente,\nti ricordiamo che se il tuo problema puo essere considerato [b]Risolto[/b], è necessario inserire l\'apposita icona, in modo da permettere allo staff di archiviare il topic.\n \nGrazie per la comprensione, A presto! 8) [/td]\n[/tr]\n[/table]',
'Abband - mod' : '[table class="moderation-message" style="width: 100%;background: #787EEB;margin-top: 5px;margin-bottom: 5px;border-bottom: 3px solid #787EEB;padding: 5px;border-radius: 4px;font-weight: bold;color: #fff;font-size: 12px;text-shadow: 1px 1px 3px rgba(0,0,0,0.1);font-family: Trebuchet MS, Helvetica, Arial, sans-serif"][tr][td width="1%"][img]http://i21.servimg.com/u/f21/11/80/17/98/garbag11.png[/img][/td]\n[td]Caro Utente,\nPurtroppo sono passati 15 giorni dal tuo ultimo messaggio in qusto topic, e secondo il nostro regolamento i topic che non ricevono alcuna risposta da almeno [b]15 giorni[/b], vengono considerati [u]Abbandonati[/u]\n \nGrazie per la Comprensione, A presto! :) :) [/td]\n[/tr]\n[/table]',
'Abband - admin' : '[table class="moderation-message" style="width: 100%;background: #F03333;margin-top: 5px;margin-bottom: 5px;border-bottom: 3px solid #F03333;padding: 5px;border-radius: 4px;font-weight: bold;color: #fff;font-size: 12px;text-shadow: 1px 1px 3px rgba(0,0,0,0.1);font-family: Trebuchet MS, Helvetica, Arial, sans-serif"][tr][td width="1%"][img]http://i21.servimg.com/u/f21/11/80/17/98/garbag11.png[/img][/td]\n[td]Caro Utente,\nPurtroppo sono passati 15 giorni dal tuo ultimo messaggio in qusto topic, e secondo il nostro regolamento i topic che non ricevono alcuna risposta da almeno [b]15 giorni[/b], vengono considerati [u]Abbandonati[/u]\n \nGrazie per la Comprensione, A presto! :) :) [/td]\n[/tr]\n[/table]',
'Vuoto - admin' : '[table class="moderation-message" style="width: 100%;background: #F03333;margin-top: 5px;margin-bottom: 5px;border-bottom: 3px solid #F03333;padding: 5px;border-radius: 4px;font-weight: bold;color: #fff;font-size: 12px;text-shadow: 1px 1px 3px rgba(0,0,0,0.1);font-family: Trebuchet MS, Helvetica, Arial, sans-serif"][tr][td width="1%"][img]http://i21.servimg.com/u/f21/11/80/17/98/garbag11.png[/img][/td]\n[td]Caro Utente,\n \n \n \n [/td]\n[/tr]\n[/table]',
'Vuoto - mod ' : '[table class="moderation-message" style="width: 100%;background: #787EEB;margin-top: 5px;margin-bottom: 5px;border-bottom: 3px solid #787EEB;padding: 5px;border-radius: 4px;font-weight: bold;color: #fff;font-size: 12px;text-shadow: 1px 1px 3px rgba(0,0,0,0.1);font-family: Trebuchet MS, Helvetica, Arial, sans-serif"][tr][td width="1%"][img]http://i21.servimg.com/u/f21/11/80/17/98/garbag11.png[/img][/td]\n[td]Caro Utente,\n \n \n \n [/td]\n[/tr]\n[/table]',
},
a, d = document.createElement('DIV'), i;
for (i in messages_2) {
a = document.createElement('A');
a.className = 'sceditor-font-option';
a.title = messages_2[i];
a.innerHTML = i;
a.onclick = function() {
callback(this.title);
editor.closeDropDown(true);
return false;
};
d.appendChild(a);
}
editor.createDropDown(caller, 'messages_2', d);
},
exec : function(c) {
var e = this;
$.sceditor.command.get('messages_2').dropDown(e, c, function(content) {
e.insertText(content);
});
},
txtExec : function(c) {
var e = this;
$.sceditor.command.get('messages_2').dropDown(e, c, function(content) {
e.insertText(content);
});
},
tooltip : 'Preset messages_2'
});
toolbar += '|messages_2'
});
- Kisskiss
- Gender :
Posts : 47
Points : 3132
Reputation : 1
Language : Italian, spanish
Browser : Forum Version :
friendly , problem solved.
thank you very much
thank you very much
- Sponsored content
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum