Vergleich jscripts/bbcodes_sceditor.js - 1.8.2 - 1.8.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 91Zeile 91
					size     = 1;

if(fontSize > 9)

					size     = 1;

if(fontSize > 9)

						size = 1;

						size = 2;

					if(fontSize > 12)

					if(fontSize > 12)

						size = 2;

						size = 3;

					if(fontSize > 15)

					if(fontSize > 15)

						size = 3;

						size = 4;

					if(fontSize > 17)

					if(fontSize > 17)

						size = 4;
if(fontSize > 23)

 
						size = 5;

						size = 5;

					if(fontSize > 31)

					if(fontSize > 23)

						size = 6;

						size = 6;

					if(fontSize > 47)

					if(fontSize > 31)

						size = 7;
}
else

						size = 7;
}
else

Zeile 131Zeile 129
					editor.closeDropDown(true);
e.preventDefault();
};

					editor.closeDropDown(true);
e.preventDefault();
};





			for (var i=1; i <= 7; i++)
content.append($('<a class="sceditor-fontsize-option" data-size="' + i + '" href="#"><font size="' + i + '">' + i + '</font></a>').click(clickFunc));

			for (var i=1; i <= 7; i++)
content.append($('<a class="sceditor-fontsize-option" data-size="' + i + '" href="#"><font size="' + i + '">' + i + '</font></a>').click(clickFunc));





			editor.createDropDown(caller, 'fontsize-picker', content);

			editor.createDropDown(caller, 'fontsize-picker', content);

 
		},
exec: function (caller) {
var editor = this,
sizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];

$.sceditor.command.get('size')._dropDown(
editor,
caller,
function(fontSize) {
editor.wysiwygEditorInsertHtml('<span data-scefontsize=' + sizes[fontSize-1] + ' style="font-size:' + sizes[fontSize-1] + '">', '</span>');
}
);

		},
txtExec: function(caller) {
var editor = this,

		},
txtExec: function(caller) {
var editor = this,

Zeile 149Zeile 159
					size = (size > 7) ? 7 : ( (size < 1) ? 1 : size );

editor.insertText('[size=' + sizes[size-1] + ']', '[/size]');

					size = (size > 7) ? 7 : ( (size < 1) ? 1 : size );

editor.insertText('[size=' + sizes[size-1] + ']', '[/size]');

				}
);
}
});



				}
);
}
});




/********************************************
* Update quote to support pid and dateline *


/********************************************
* Update quote to support pid and dateline *

Zeile 164Zeile 174
			var	author = '',
$elm = $(element),
$cite = $elm.children('cite').first();

			var	author = '',
$elm = $(element),
$cite = $elm.children('cite').first();

 
				$cite.html($cite.text());


if($cite.length === 1 || $elm.data('author'))
{


if($cite.length === 1 || $elm.data('author'))
{

Zeile 177Zeile 188

$elm.prepend($cite);
}


$elm.prepend($cite);
}





			if($elm.data('pid'))
author += " pid='" + $elm.data('pid') + "'";

			if($elm.data('pid'))
author += " pid='" + $elm.data('pid') + "'";





			if($elm.data('dateline'))
author += " dateline='" + $elm.data('dateline') + "'";

return '[quote' + author + ']' + content + '[/quote]';

			if($elm.data('dateline'))
author += " dateline='" + $elm.data('dateline') + "'";

return '[quote' + author + ']' + content + '[/quote]';

		},

		},

		html: function(token, attrs, content) {
var data = '';


		html: function(token, attrs, content) {
var data = '';


Zeile 215Zeile 226
	$.sceditor.plugins.bbcode.bbcode.set('font', {
format: function(element, content) {
var font;

	$.sceditor.plugins.bbcode.bbcode.set('font', {
format: function(element, content) {
var font;





			if(element[0].nodeName.toLowerCase() !== 'font' || !(font = element.attr('face')))
font = element.css('font-family');


			if(element[0].nodeName.toLowerCase() !== 'font' || !(font = element.attr('face')))
font = element.css('font-family');






			if(typeof font == 'string' && font != '' && font != 'defaultattr')
{
return '[font=' + this.stripQuotes(font) + ']' + content + '[/font]';

			if(typeof font == 'string' && font != '' && font != 'defaultattr')
{
return '[font=' + this.stripQuotes(font) + ']' + content + '[/font]';

			}

			}

			else
{
return content;

			else
{
return content;

Zeile 231Zeile 242
		},
html: function(token, attrs, content) {
if(typeof attrs.defaultattr == 'string' && attrs.defaultattr != '' && attrs.defaultattr != '{defaultattr}')

		},
html: function(token, attrs, content) {
if(typeof attrs.defaultattr == 'string' && attrs.defaultattr != '' && attrs.defaultattr != '{defaultattr}')

			{

			{

				return '<font face="' +
attrs.defaultattr +
'">' + content + '</font>';

				return '<font face="' +
attrs.defaultattr +
'">' + content + '</font>';

Zeile 257Zeile 268
	});

$.sceditor.command.set("php", {

	});

$.sceditor.command.set("php", {

		_dropDown: function (editor, caller, html) {

		_dropDown: function (editor, caller) {

			var $content;

$content = $(

			var $content;

$content = $(

Zeile 276Zeile 287
				var	val = $content.find('#php').val(),
before = '[php]',
end = '[/php]';

				var	val = $content.find('#php').val(),
before = '[php]',
end = '[/php]';


if (html) {
before = before + html + end;
end = null;
}
else if (val) {


if (val) {





					before = before + val + end;
end = null;
}

					before = before + val + end;
end = null;
}

Zeile 294Zeile 301
			editor.createDropDown(caller, 'insertphp', $content);
},
exec: function (caller) {

			editor.createDropDown(caller, 'insertphp', $content);
},
exec: function (caller) {

 
			if ($.trim(this.getRangeHelper().selectedRange())) {
this.insert('[php]', '[/php]');
return;
}

			$.sceditor.command.get('php')._dropDown(this, caller);
},
txtExec: ['[php]', '[/php]'],

			$.sceditor.command.get('php')._dropDown(this, caller);
},
txtExec: ['[php]', '[/php]'],

Zeile 322Zeile 333
	});

$.sceditor.command.set("code", {

	});

$.sceditor.command.set("code", {

		_dropDown: function (editor, caller, html) {

		_dropDown: function (editor, caller) {

			var $content;

$content = $(

			var $content;

$content = $(

Zeile 341Zeile 352
				var	val = $content.find('#code').val(),
before = '[code]',
end = '[/code]';

				var	val = $content.find('#code').val(),
before = '[code]',
end = '[/code]';


if (html) {
before = before + html + end;
end = null;
}
else if (val) {


if (val) {





					before = before + val + end;
end = null;
}

editor.insert(before, end);

					before = before + val + end;
end = null;
}

editor.insert(before, end);

				editor.closeDropDown(true);
e.preventDefault();

				editor.closeDropDown(true);
e.preventDefault();

			});

editor.createDropDown(caller, 'insertcode', $content);
},
exec: function (caller) {

			});

editor.createDropDown(caller, 'insertcode', $content);
},
exec: function (caller) {

 
			if ($.trim(this.getRangeHelper().selectedRange())) {
this.insert('[code]', '[/code]');
return;
}

			$.sceditor.command.get('code')._dropDown(this, caller);
},
txtExec: ['[code]', '[/code]'],

			$.sceditor.command.get('code')._dropDown(this, caller);
},
txtExec: ['[code]', '[/code]'],

Zeile 402Zeile 413
					else
editor.execCommand('createlink', 'mailto:' + val);
}

					else
editor.execCommand('createlink', 'mailto:' + val);
}


editor.closeDropDown(true);
e.preventDefault();
});



editor.closeDropDown(true);
e.preventDefault();
});


			editor.createDropDown(caller, 'insertemail', $content);
},
exec: function (caller) {

			editor.createDropDown(caller, 'insertemail', $content);
},
exec: function (caller) {

Zeile 415Zeile 426
	});



	});







	/**************************
* Add MyBB video command *
**************************/
$.sceditor.plugins.bbcode.bbcode.set('video', {
allowsEmpty: true,

	/**************************
* Add MyBB video command *
**************************/
$.sceditor.plugins.bbcode.bbcode.set('video', {
allowsEmpty: true,

 
		allowedChildren: ['#', '#newline'],

		tags: {
iframe: {
'data-mybb-vt': null

		tags: {
iframe: {
'data-mybb-vt': null

Zeile 527Zeile 539
			editor.createDropDown(caller, 'insertvideo', $content);
},
exec: function (caller) {

			editor.createDropDown(caller, 'insertvideo', $content);
},
exec: function (caller) {

			$.sceditor.command.get('video')._dropDown(this, caller);
},

			$.sceditor.command.get('video')._dropDown(this, caller);
},

		txtExec: function (caller) {
$.sceditor.command.get('video')._dropDown(this, caller);
},
tooltip: 'Insert a video'

		txtExec: function (caller) {
$.sceditor.command.get('video')._dropDown(this, caller);
},
tooltip: 'Insert a video'

	});




	});




	/*************************************

	/*************************************

	 * Remove last bits of table support *

	 * Remove last bits of table, superscript/subscript, youtube and ltr/rtl support *

	 *************************************/

	 *************************************/

	$.sceditor.command.remove('table');
$.sceditor.plugins.bbcode.bbcode.remove('table')
.remove('tr')
.remove('th')
.remove('td');

	$.sceditor.command
.remove('table').remove('subscript').remove('superscript').remove('youtube').remove('ltr').remove('rtl');

$.sceditor.plugins.bbcode.bbcode
.remove('table').remove('tr').remove('th').remove('td').remove('sub').remove('sup').remove('youtube').remove('ltr').remove('rtl');









Zeile 565Zeile 577
								this._("Height (optional):")
))
.submit(function () {return false;});

								this._("Height (optional):")
))
.submit(function () {return false;});





					content.append($(this._('<div><input type="button" class="button" value="Insert" /></div>',
this._("Insert")
)).click(function (e) {

					content.append($(this._('<div><input type="button" class="button" value="Insert" /></div>',
this._("Insert")
)).click(function (e) {

Zeile 588Zeile 600
					}));

editor.createDropDown(caller, 'insertimage', content);

					}));

editor.createDropDown(caller, 'insertimage', content);

				}

				}

			})
.set('quote', {
exec: function() {

			})
.set('quote', {
exec: function() {

Zeile 596Zeile 608
				}
});
}

				}
});
}

 



/****************
* Fix url code *
****************/
$.sceditor.plugins.bbcode.bbcode.set('url', {
html: function(token, attrs, content) {

if(!attrs.defaultattr)
attrs.defaultattr = content;

return '<a href="' + $.sceditor.escapeUriScheme($.sceditor.escapeEntities(attrs.defaultattr)) + '">' + content + '</a>';
}
});

});

});