mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 22:57:14 +02:00
Experimental: Insert e107 BBcodes using TinyMce (Insert Menu)
This commit is contained in:
@@ -135,7 +135,9 @@ TEMPL;
|
||||
$content = str_replace("{e_BASE}",e_HTTP,$content); // We want {e_BASE} in the final data going to the DB, but not the editor.
|
||||
$srch = array("<!-- bbcode-html-start -->","<!-- bbcode-html-end -->","[html]","[/html]");
|
||||
$content = str_replace($srch,"",$content);
|
||||
$content = e107::getBB()->parseBBCodes($content); // parse the <bbcode> tag so we see the HTML equivalent while editing!
|
||||
$content = $tp->parseBBTags($content,true); // parse the <bbcode> tag so we see the HTML equivalent while editing!
|
||||
$content = e107::getBB()->parseBBCodes($content);
|
||||
|
||||
|
||||
if(!empty($content) && E107_DEBUG_LEVEL > 0)
|
||||
{
|
||||
@@ -204,7 +206,7 @@ TEMPL;
|
||||
|
||||
// $content = preg_replace($psrch, $prepl, $content);
|
||||
$content = $this->updateImg($content);
|
||||
$content = $tp->parseBBTags($content,true); // replace html with bbcode equivalent
|
||||
// $content = $tp->parseBBTags($content,true); // replace html with bbcode equivalent
|
||||
|
||||
if(strip_tags($content, '<i>') == ' ') // Avoid this: [html]<p> </p>[/html]
|
||||
{
|
||||
|
@@ -49,29 +49,55 @@
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
// Emoticons
|
||||
ed.addButton('e107-bbcode', {
|
||||
text: 'bbcode',
|
||||
icon: 'emoticons',
|
||||
// ed.addButton('e107-bbcode', {
|
||||
ed.addMenuItem('e107-bbcode', {
|
||||
text: 'e107 BBcode',
|
||||
context: 'insert',
|
||||
icon: 'code',
|
||||
onclick: function() {
|
||||
// Open window
|
||||
|
||||
ed.windowManager.open({
|
||||
title: 'Example plugin',
|
||||
title: 'Insert e107 BBcode',
|
||||
body: [
|
||||
{type: 'textbox', name: 'code', label: 'BbCode'},
|
||||
{type: 'textbox', name: 'parm', label: 'Parameters'}
|
||||
{type: 'textbox', name: 'code', label: 'BbCode', text: 'widget', size: 80, tooltip: 'eg. [b]bold[/b]', autofocus: true} //,
|
||||
// {type: 'textbox', name: 'parm', label: 'Parameters'}
|
||||
],
|
||||
onsubmit: function(e) {
|
||||
|
||||
s = e.data.code;
|
||||
s = s.trim(s);
|
||||
|
||||
var html = $.ajax({
|
||||
type: 'POST',
|
||||
url: url +'/parser.php',
|
||||
data: { content: s, mode: 'tohtml' },
|
||||
async : false,
|
||||
|
||||
dataType: 'html',
|
||||
success: function(html) {
|
||||
return html;
|
||||
}
|
||||
}).responseText;
|
||||
|
||||
html = '<x-bbcode alt=\"'+btoa(s)+'\">' + html + '</x-bbcode> ' ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Insert content when the window form is submitted
|
||||
ed.insertContent('Title: ' + e.data.title);
|
||||
// console.log(url);
|
||||
// console.log(html);
|
||||
ed.insertContent(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
*/
|
||||
|
||||
// Media Manager Button
|
||||
ed.addButton('e107-image', {
|
||||
text: '',
|
||||
|
Reference in New Issue
Block a user