(2014-07-07, 01:18 PM)OMID_HXC Wrote: and can you offer a code without description for anyone that are use spoiler MYCode?
but you can add too spoiler tag with description in mycode...
you need two mycode, with and without description...
anyway later'll add the button without description in this topic
OMID_HXC below spoiler button without description. I don´t tested code below. If code below work, plz tell me to put in the original post.
1 - Edit root/jscripts/sceditor/jquery.sceditor.mybb.css (this used to style spoiler tag in WYSIWYG mode)
1.1 - Find
blockquote cite {
font-weight: bold;
font-style: normal;
display: block;
font-size: 1em;
border-bottom: 1px solid #ccc;
margin-bottom: 10px;
padding-bottom: 3px;
}
1.2 - Add after
blockquote.spoiler:before {
position: absolute;
content: 'SPOILER:';
top: -1.35em;
left: 0;
font-size: 0.8em;
display: block;
text-align: left;
font-weight: bold;
}
blockquote.spoiler {
margin-top: 1.5em;
background-color: #F5F5F5;
}
2 - Edit root/jscripts/sceditor/editor_themes/mybb.css
2.1 - Add after all
.sceditor-button-spoiler div {
background-image:url(s.png);
}
3 - Copy s.png [attachment=31902] in root/jscripts/sceditor/editor_themes/ (you can use any image in 16x16 or use attached file)
4 - Edit root/jscripts/bbcodes_sceditor.js (this used to add new command in sceditor)
4.1 - Find
/********************************************
* Update quote to support pid and dateline *
********************************************/
$.sceditor.plugins.bbcode.bbcode.set('quote', {
format: function(element, content) {
var author = '',
$elm = $(element),
$cite = $elm.children('cite').first();
4.2 - Add after
if ($(element[0]).hasClass('spoiler')) {
return '[spoiler]' + content + '[/spoiler]';
}
4.3 - Find
tooltip: 'Insert a video'
});
4.4 - Add after
/***********************
* Add Spoiler command *
***********************/
$.sceditor.plugins.bbcode.bbcode.set("spoiler", {
allowsEmpty: true,
isInline: false,
format: '[spoiler]{0}[/spoiler]'
html: '<blockquote class="spoiler">{0}</blockquote>',
breakStart: true,
breakEnd: true
});
$.sceditor.command.set("spoiler", {
exec: function () {
this.wysiwygEditorInsertHtml('<blockquote class="spoiler">', '</blockquote>');
},
txtExec: ['[spoiler]', '[/spoiler]'],
tooltip: 'Insert a spoiler'
});
4.5 - Find
$.sceditor.plugins.bbcode.bbcode.remove('code').remove('php').remove('quote').remove('video').remove('img');
4.6 - Replace
$.sceditor.plugins.bbcode.bbcode.remove('code').remove('php').remove('quote').remove('video').remove('img').remove('spoiler');
5 - Go to codebuttons template in ACP
5.1 - Find
{$code}quote|
5.2 - Replace
{$code}quote,spoiler|