1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-12 13:34:39 +02:00

Experimental: Insert e107 BBcodes using TinyMce (Insert Menu)

This commit is contained in:
Cameron
2017-12-14 17:44:29 -08:00
parent 8dee70cef5
commit bad3a54eee
3 changed files with 52 additions and 22 deletions

View File

@@ -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: '',