1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Partial fix for Issue #3386 - TinyMce with Appearance params.

This commit is contained in:
Cameron
2018-09-03 17:48:55 -07:00
parent c360ba2476
commit 937af7595e

View File

@@ -143,6 +143,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
{
var $this = $(that);
var style = '';
var css = '';
var bb = '';
var src = $('#src').attr('value'); // working old
@@ -159,6 +160,8 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
var _float = $('#float').val();
var alt = $('#alt').val();
var target = $this.attr('data-target');
var $htmlHolder = $('#html_holder');
@@ -186,7 +189,12 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
if(_float == 'left' || _float == 'right')
{
style = style + 'float:' + _float + ';';
// style = style + 'float:' + _float + ';';
}
if(_float == 'left' || _float == 'right')
{
css = 'bbcode-img-' + _float;
}
if(width === undefined)
@@ -201,11 +209,33 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
// Set the Html / Wysiwyg Value.
var $img = $('<img/>');
$img.attr('style', style);
if(css != '')
{
$img.attr('class', css);
}
if(style != '')
{
$img.attr('style', style);
}
$img.attr('src', src);
$img.attr('alt', alt);
$img.attr('width', width);
$img.attr('height', height);
if(alt != '')
{
$img.attr('alt', alt);
}
if(width > 0)
{
$img.attr('width', width);
}
if(height > 0)
{
$img.attr('height', height);
}
if($htmlHolder.length > 0)
{
@@ -218,7 +248,6 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
// Only Do width/height styling on bbcodes --
if(width != '' && width != 0 && width !== undefined)
{
console.log('Width: '+ width);
style = style + 'width:' + width + 'px;';
}
@@ -231,16 +260,30 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
{
bb = '[img';
var bparm = {};
if(css != '')
{
// bb = bb + '&class=' + css;
bparm['class'] = css;
}
if(style != '')
{
bb = bb + ' style=' + style;
// bb = bb + ' style=' + style;
bparm['style'] = style;
}
if(alt != '')
{
bb = bb + '&alt=' + alt;
// bb = bb + '&alt=' + alt;
bparm['alt'] = alt;
}
var bbquery = decodeURIComponent(jQuery.param(bparm, true));
console.log(bbquery);
bb = bb + ' ' + bbquery;
bb = bb + ']';
bb = bb + path;
bb = bb + '[/img]';