Vergleich jscripts/bbcodes_sceditor.js - 1.8.5 - 1.8.20

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 2Zeile 2




$(document).ready(function($) {

$(function($) {

	'use strict';

var $document = $(document);

	'use strict';

var $document = $(document);

Zeile 78Zeile 78
		format: function($elm, content) {
var fontSize,
sizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'],

		format: function($elm, content) {
var fontSize,
sizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'],

				size  = $elm.data('scefontsize');

				size = $elm.attr('size');





			if(!size)
{
fontSize = $elm.css('fontSize');

// Most browsers return px value but IE returns 1-7
if(fontSize.indexOf('px') > -1) {
// convert size to an int
fontSize = fontSize.replace('px', '') - 0;
size = 1;

				if (!size) {
fontSize = $elm.css('fontSize');
// Most browsers return px value but IE returns 1-7
if(fontSize.indexOf('px') > -1) {
// convert size to an int
fontSize = fontSize.replace('px', '') - 0;
size = 1;







					if(fontSize > 9)
size = 2;
if(fontSize > 12)
size = 3;
if(fontSize > 15)
size = 4;
if(fontSize > 17)
size = 5;
if(fontSize > 23)
size = 6;
if(fontSize > 31)








						if(fontSize > 9)
size = 2;
if(fontSize > 12)
size = 3;
if(fontSize > 15)
size = 4;
if(fontSize > 17)
size = 5;
if(fontSize > 23)
size = 6;
if(fontSize > 31)
size = 7;
}
else {
size = (~~fontSize) + 1;
}

if(size > 7)

						size = 7;

						size = 7;

 
					if(size < 1)
size = 1;

size = sizes[size-1];
}
else {
size = sizes[size-1];

				}

				}

				else
size = (~~fontSize) + 1;

 




 
			return '[size=' + size + ']' + content + '[/size]';
},
html: function(token, attrs, content) {
var sizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'],
size = $.inArray(attrs.defaultattr, sizes)+1;
if (!isNaN(attrs.defaultattr)) {
size = attrs.defaultattr;

				if(size > 7)
size = 7;
if(size < 1)
size = 1;

				if(size > 7)
size = 7;
if(size < 1)
size = 1;


size = sizes[size-1];

 
			}

			}


return '[size=' + size + ']' + content + '[/size]';
},
html: function(token, attrs, content) {
return '<span data-scefontsize="' + attrs.defaultattr + '" style="font-size:' + attrs.defaultattr + '">' + content + '</span>';

			if (size < 0) {
size = 0;
}
return '<font data-scefontsize="' + attrs.defaultattr + '" size="' + size + '">' + content + '</font>';


		}
});


		}
});


Zeile 136Zeile 150
			editor.createDropDown(caller, 'fontsize-picker', content);
},
exec: function (caller) {

			editor.createDropDown(caller, 'fontsize-picker', content);
},
exec: function (caller) {

			var	editor = this,
sizes = ['xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'];

			var	editor = this;



$.sceditor.command.get('size')._dropDown(
editor,
caller,
function(fontSize) {


$.sceditor.command.get('size')._dropDown(
editor,
caller,
function(fontSize) {

					editor.wysiwygEditorInsertHtml('<span data-scefontsize=' + sizes[fontSize-1] + ' style="font-size:' + sizes[fontSize-1] + '">', '</span>');

					editor.execCommand('fontsize', fontSize);

				}
);
},

				}
);
},

Zeile 242Zeile 255
		},
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 252Zeile 265
				return content;
}
}

				return content;
}
}

	});


	});




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



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

Zeile 270Zeile 283
	$.sceditor.command.set("php", {
_dropDown: function (editor, caller) {
var $content;

	$.sceditor.command.set("php", {
_dropDown: function (editor, caller) {
var $content;





			$content = $(
'<div>' +
'<label for="php">' + editor._('PHP') + ':</label> ' +

			$content = $(
'<div>' +
'<label for="php">' + editor._('PHP') + ':</label> ' +

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

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


if (val) {


if (val) {

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

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





				editor.insert(before, end);
editor.closeDropDown(true);
e.preventDefault();

				editor.insert(before, end);
editor.closeDropDown(true);
e.preventDefault();

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

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

			}

			}

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

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

	});

	});









Zeile 333Zeile 346
	});

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

	});

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

		_dropDown: function (editor, caller) {
var $content;


		_dropDown: function (editor, caller) {
var $content;


			$content = $(
'<div>' +
'<label for="code">' + editor._('Code') + ':</label> ' +

			$content = $(
'<div>' +
'<label for="code">' + editor._('Code') + ':</label> ' +

Zeile 448Zeile 461
					facebook: '<iframe src="{url}" width="625" height="350" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',
liveleak: '<iframe width="500" height="300" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',
metacafe: '<iframe src="{url}" width="440" height="248" frameborder=0 data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',

					facebook: '<iframe src="{url}" width="625" height="350" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',
liveleak: '<iframe width="500" height="300" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',
metacafe: '<iframe src="{url}" width="440" height="248" frameborder=0 data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',

					veoh: '<iframe src="{url}" width="410" height="341" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',

					mixer: '<iframe allowfullscreen="true" src="{url}" width="620" height="349" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',

					vimeo: '<iframe src="{url}" width="500" height="281" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',

					vimeo: '<iframe src="{url}" width="500" height="281" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',

					youtube: '<iframe width="560" height="315" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'


					youtube: '<iframe width="560" height="315" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>',
twitch: '<iframe src="{url}" frameborder="0" scrolling="no" height="378" width="620" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'

				};

if(html[attrs.defaultattr])

				};

if(html[attrs.defaultattr])

Zeile 458Zeile 472
				switch(attrs.defaultattr)
{
case 'dailymotion':

				switch(attrs.defaultattr)
{
case 'dailymotion':

						matches = content.match(/dailymotion\.com\/video\/([^_]+)/);
url = matches ? 'http://www.dailymotion.com/embed/video/' + matches[1] : false;

						matches = content.match(/(dailymotion\.com\/video\/|dai\.ly\/)([^\/]+)/);
url = matches ? '//www.dailymotion.com/embed/video/' + matches[2] : false;

						break;
case 'facebook':
matches = content.match(/facebook\.com\/(?:photo.php\?v=|video\/video.php\?v=|video\/embed\?video_id=|v\/?)(\d+)/);
url = matches ? 'https://www.facebook.com/video/embed?video_id=' + matches[1] : false;
break;
case 'liveleak':

						break;
case 'facebook':
matches = content.match(/facebook\.com\/(?:photo.php\?v=|video\/video.php\?v=|video\/embed\?video_id=|v\/?)(\d+)/);
url = matches ? 'https://www.facebook.com/video/embed?video_id=' + matches[1] : false;
break;
case 'liveleak':

						matches = content.match(/liveleak\.com\/(?:view\?i=)([^\/]+)/);

						matches = content.match(/liveleak\.com\/(?:view\?[a-z]=)([^\/]+)/);

						url     = matches ? 'http://www.liveleak.com/ll_embed?i=' + matches[1] : false;
break;
case 'metacafe':
matches = content.match(/metacafe\.com\/watch\/([^\/]+)/);

						url     = matches ? 'http://www.liveleak.com/ll_embed?i=' + matches[1] : false;
break;
case 'metacafe':
matches = content.match(/metacafe\.com\/watch\/([^\/]+)/);

						url     = matches ? 'http://www.metacafe.com/embed/' + matches[1] : false;

						url     = matches ? 'http://www.metacafe.com/embed/' + matches[1] + '/' : false;

						break;

						break;

					case 'veoh':
matches = content.match(/veoh\.com\/watch\/([^\/]+)/);
url = matches ? '//www.veoh.com/swf/webplayer/WebPlayer.swf?videoAutoPlay=0&permalinkId=' + matches[1] : false;

					case 'mixer':
matches = content.match(/mixer\.com\/([^\/]+)/);
url = matches ? '//mixer.com/embed/player/' + matches[1] + "?disableLowLatency=1" : false;

						break;
case 'vimeo':
matches = content.match(/vimeo.com\/(\d+)($|\/)/);

						break;
case 'vimeo':
matches = content.match(/vimeo.com\/(\d+)($|\/)/);

Zeile 484Zeile 498
					case 'youtube':
matches = content.match(/(?:v=|v\/|embed\/|youtu\.be\/)(.{11})/);
url = matches ? '//www.youtube.com/embed/' + matches[1] : false;

					case 'youtube':
matches = content.match(/(?:v=|v\/|embed\/|youtu\.be\/)(.{11})/);
url = matches ? '//www.youtube.com/embed/' + matches[1] : false;

 
						break;
case 'twitch':
matches = content.match(/twitch\.tv\/(?:[\w+_-]+)\/v\/(\d+)/);
url = matches ? '//player.twitch.tv/?video=v' + matches[1] : false;

						break;
}


						break;
}


Zeile 496Zeile 514
				}
}


				}
}


			return token.val + content + (token.closing ? token.closing.val : '');

			return $.sceditor.escapeEntities(token.val + content + (token.closing ? token.closing.val : ''));

		}
});


		}
});


Zeile 513Zeile 531
						'<option value="facebook">' + editor._('Facebook') + '</option>' +
'<option value="liveleak">' + editor._('LiveLeak') + '</option>' +
'<option value="metacafe">' + editor._('MetaCafe') + '</option>' +

						'<option value="facebook">' + editor._('Facebook') + '</option>' +
'<option value="liveleak">' + editor._('LiveLeak') + '</option>' +
'<option value="metacafe">' + editor._('MetaCafe') + '</option>' +

						'<option value="veoh">' + editor._('Veoh') + '</option>' +

						'<option value="mixer">' + editor._('Mixer') + '</option>' +

						'<option value="vimeo">' + editor._('Vimeo') + '</option>' +
'<option value="youtube">' + editor._('Youtube') + '</option>' +

						'<option value="vimeo">' + editor._('Vimeo') + '</option>' +
'<option value="youtube">' + editor._('Youtube') + '</option>' +

 
						'<option value="twitch">' + editor._('Twitch') + '</option>' +

					'</select>'+
'</div>' +
'<div>' +

					'</select>'+
'</div>' +
'<div>' +