i want add indent & remove one indent buttons in SCEditor
4 posters
Page 1 of 1
i want add indent & remove one indent buttons in SCEditor
Last edited by coolkool on September 24th 2015, 4:05 pm; edited 1 time in total
Re: i want add indent & remove one indent buttons in SCEditor
Hello @coolkool
Ange Tuteur has developed a javascript code to add/remove/edit the BBcode buttons of the new editor. You can find the documentation here: https://github.com/SethClydesdale/fa-sceditor-customization
Full javascript code => https://github.com/SethClydesdale/fa-sceditor-customization/blob/master/fa-sceditor-options.js
Have a nice day
Ange Tuteur has developed a javascript code to add/remove/edit the BBcode buttons of the new editor. You can find the documentation here: https://github.com/SethClydesdale/fa-sceditor-customization
Full javascript code => https://github.com/SethClydesdale/fa-sceditor-customization/blob/master/fa-sceditor-options.js
Have a nice day
Re: i want add indent & remove one indent buttons in SCEditor
Can't remember if these buttons are in our Editor code, but try the following :
- Code:
$(function() {
if (toolbar) toolbar += '|indent,outdent';
});
Re: i want add indent & remove one indent buttons in SCEditor
I pulled the indent and outdent commands from the update to date sceditor source. Try adding this script in all the pages.
You'll of course need to add images yourself since our source doesn't contain them.
CSS :
- Code:
$(function() {
if ($.sceditor) {
$.sceditor.command.set('indent', {
state: function (parents, firstBlock) {
var range, startParent, endParent,
$firstBlock = $(firstBlock),
parentLists = $firstBlock.parents('ul,ol,menu'),
parentList = parentLists.first();
if (parentLists.length > 1 ||
parentList.children().length > 1) {
return 0;
}
if ($firstBlock.is('ul,ol,menu')) {
range = this.getRangeHelper().selectedRange();
if (window.Range && range instanceof Range) {
startParent = range.startContainer.parentNode;
endParent = range.endContainer.parentNode;
if (startParent !== startParent.parentNode.firstElementChild || ($(endParent).is('li') && endParent !== endParent.parentNode.lastElementChild)) {
return 0;
}
} else {
return $firstBlock.is('li,ul,ol,menu') ? 0 : -1;
}
}
return -1;
},
exec: function () {
var editor = this,
$elm = $(editor.getRangeHelper().getFirstBlockParent());
editor.focus();
if ($elm.parents('ul,ol,menu')) {
editor.execCommand('indent');
}
},
tooltip: 'Add indent'
});
$.sceditor.command.set('outdent', {
state: function (parents, firstBlock) {
return $(firstBlock).is('ul,ol,menu') || $(firstBlock).parents('ul,ol,menu').length > 0 ? 0 : -1;
},
exec: function () {
var editor = this,
$elm = $(editor.getRangeHelper().getFirstBlockParent());
if ($elm.parents('ul,ol,menu')) {
editor.execCommand('outdent');
}
},
tooltip: 'Remove one indent'
});
toolbar += '|indent,outdent';
}
});
You'll of course need to add images yourself since our source doesn't contain them.
CSS :
- Code:
.sceditor-button-indent div { background-image:url('IMAGE') !important }
.sceditor-button-outdent div { background-image:url('IMAGE') !important }
Re: i want add indent & remove one indent buttons in SCEditor
Did you remove the previous script I gave you ?
https://help.forumotion.com/t143510-i-want-add-indent-remove-one-indent-buttons-in-sceditor#978707
https://help.forumotion.com/t143510-i-want-add-indent-remove-one-indent-buttons-in-sceditor#978707
Re: i want add indent & remove one indent buttons in SCEditor
Thank you very much my brother, but how I can change their places?
Re: i want add indent & remove one indent buttons in SCEditor
In this script you have to modify this part which modified the editor toolbar :
Currently it's adding them to the end in a new group.
- Code:
toolbar += '|indent,outdent';
Currently it's adding them to the end in a new group.
Re: i want add indent & remove one indent buttons in SCEditor
I've done as you told me, but not the most successful can you do instead of me?
I want more before Button
Re: i want add indent & remove one indent buttons in SCEditor
Sure.
Replace :
by :
Replace :
- Code:
toolbar += '|indent,outdent';
by :
- Code:
toolbar = toolbar.replace(/more/, 'more,indent,outdent');
Re: i want add indent & remove one indent buttons in SCEditor
thank you ^.^
it's work 100%
I ask you to go to:
I want you to help me a bit if you can
Re: i want add indent & remove one indent buttons in SCEditor
@coolkool is this topic now solved or do you need more help ?
Re: i want add indent & remove one indent buttons in SCEditor
No thanks you can locked this topic now ^^
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum