2014-07-14, 05:11 AM
Hi,
possible change this codebottons template:
to this:
Reason for this is that it facilitates the addition of sceditor in quick edit...
with var "opt_editor" is more easy to add if anyone want to add sceditor in QuickEdit...
Thanks
possible change this codebottons template:
<link rel="stylesheet" href="{$mybb->asset_url}/jscripts/sceditor/editor_themes/{$theme['editortheme']}" type="text/css" media="all" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/jquery.sceditor.bbcode.min.js"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/bbcodes_sceditor.js"></script>
<script type="text/javascript">
var partialmode = {$mybb->settings['partialmode']};
{$editor_language}
$(function() {
$("#{$bind}").sceditor({
plugins: "bbcode",
style: "{$mybb->asset_url}/jscripts/sceditor/jquery.sceditor.mybb.css",
rtl: {$lang->settings['rtl']},
locale: "mybblang",
emoticonsEnabled: {$emoticons_enabled},
emoticons: {
// Emoticons to be included in the dropdown
dropdown: {
{$dropdownsmilies}
},
// Emoticons to be included in the more section
more: {
{$moresmilies}
}
},
emoticonsCompat: true,
toolbar: "{$basic1}{$align}{$font}{$size}{$color}{$removeformat}{$basic2}image,{$email}{$link}|video{$emoticon}|{$list}{$code}quote|maximize,source",
});
MyBBEditor = $("#{$bind}").sceditor("instance");
{$sourcemode}
});
</script>
to this:
<link rel="stylesheet" href="{$mybb->asset_url}/jscripts/sceditor/editor_themes/{$theme['editortheme']}" type="text/css" media="all" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/sceditor/jquery.sceditor.bbcode.min.js"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/bbcodes_sceditor.js"></script>
<script type="text/javascript">
var partialmode = {$mybb->settings['partialmode']},
opt_editor = {
plugins: "bbcode",
style: "{$mybb->asset_url}/jscripts/sceditor/jquery.sceditor.mybb.css?v=3.0",
rtl: {$lang->settings['rtl']},
locale: "mybblang",
emoticonsEnabled: {$emoticons_enabled},
emoticons: {
// Emoticons to be included in the dropdown
dropdown: {
{$dropdownsmilies}
},
// Emoticons to be included in the more section
more: {
{$moresmilies}
}
},
emoticonsCompat: true,
toolbar: "{$basic1}{$align}{$font}{$size}{$color}{$removeformat}{$basic2}image,imgur,{$email}{$link}|video{$emoticon}|{$list}{$code}quote|maximize,source",
};
{$editor_language}
$(function() {
$("#{$bind}").sceditor(opt_editor);
MyBBEditor = $("#{$bind}").sceditor("instance");
{$sourcemode}
});
</script>
Reason for this is that it facilitates the addition of sceditor in quick edit...
with var "opt_editor" is more easy to add if anyone want to add sceditor in QuickEdit...
($.fn.on || $.fn.live).call($(document), 'focus', 'textarea[name*="value"]', function () {
$(this).sceditor(opt_editor);
MyBBEditor = $('textarea[name*="value"]').sceditor("instance");
{$sourcemode}
});
Thanks