mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Partial fix for Issue #3386 - TinyMce with Appearance params.
This commit is contained in:
@@ -143,6 +143,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
{
|
{
|
||||||
var $this = $(that);
|
var $this = $(that);
|
||||||
var style = '';
|
var style = '';
|
||||||
|
var css = '';
|
||||||
var bb = '';
|
var bb = '';
|
||||||
|
|
||||||
var src = $('#src').attr('value'); // working old
|
var src = $('#src').attr('value'); // working old
|
||||||
@@ -159,6 +160,8 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
var _float = $('#float').val();
|
var _float = $('#float').val();
|
||||||
var alt = $('#alt').val();
|
var alt = $('#alt').val();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var target = $this.attr('data-target');
|
var target = $this.attr('data-target');
|
||||||
|
|
||||||
var $htmlHolder = $('#html_holder');
|
var $htmlHolder = $('#html_holder');
|
||||||
@@ -186,7 +189,12 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
|
|
||||||
if(_float == 'left' || _float == 'right')
|
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)
|
if(width === undefined)
|
||||||
@@ -201,11 +209,33 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
|
|
||||||
// Set the Html / Wysiwyg Value.
|
// Set the Html / Wysiwyg Value.
|
||||||
var $img = $('<img/>');
|
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('src', src);
|
||||||
$img.attr('alt', alt);
|
|
||||||
$img.attr('width', width);
|
if(alt != '')
|
||||||
$img.attr('height', height);
|
{
|
||||||
|
$img.attr('alt', alt);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(width > 0)
|
||||||
|
{
|
||||||
|
$img.attr('width', width);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(height > 0)
|
||||||
|
{
|
||||||
|
$img.attr('height', height);
|
||||||
|
}
|
||||||
|
|
||||||
if($htmlHolder.length > 0)
|
if($htmlHolder.length > 0)
|
||||||
{
|
{
|
||||||
@@ -218,7 +248,6 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
// Only Do width/height styling on bbcodes --
|
// Only Do width/height styling on bbcodes --
|
||||||
if(width != '' && width != 0 && width !== undefined)
|
if(width != '' && width != 0 && width !== undefined)
|
||||||
{
|
{
|
||||||
console.log('Width: '+ width);
|
|
||||||
style = style + 'width:' + width + 'px;';
|
style = style + 'width:' + width + 'px;';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,16 +260,30 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
|
|||||||
{
|
{
|
||||||
bb = '[img';
|
bb = '[img';
|
||||||
|
|
||||||
|
var bparm = {};
|
||||||
|
|
||||||
|
if(css != '')
|
||||||
|
{
|
||||||
|
// bb = bb + '&class=' + css;
|
||||||
|
bparm['class'] = css;
|
||||||
|
}
|
||||||
|
|
||||||
if(style != '')
|
if(style != '')
|
||||||
{
|
{
|
||||||
bb = bb + ' style=' + style;
|
// bb = bb + ' style=' + style;
|
||||||
|
bparm['style'] = style;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(alt != '')
|
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 + ']';
|
||||||
bb = bb + path;
|
bb = bb + path;
|
||||||
bb = bb + '[/img]';
|
bb = bb + '[/img]';
|
||||||
|
Reference in New Issue
Block a user