includes/clientside/tinymce/plugins/media/js/media.js
changeset 543 dffcbfbc4e59
parent 476 f26a69c40431
child 778 57ce13805b6f
--- a/includes/clientside/tinymce/plugins/media/js/media.js	Mon May 05 20:06:37 2008 -0400
+++ b/includes/clientside/tinymce/plugins/media/js/media.js	Mon May 05 20:08:44 2008 -0400
@@ -180,6 +180,8 @@
 function insertMedia() {
 	var fe, f = document.forms[0], h;
 
+	tinyMCEPopup.restoreSelection();
+
 	if (!AutoValidator.validate(f)) {
 		alert(ed.getLang('invalid_data'));
 		return false;
@@ -303,7 +305,7 @@
 	fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');
 
 	// YouTube
-	if (v.match(/v=(.+)(.*)/)) {
+	if (v.match(/watch\?v=(.+)(.*)/)) {
 		f.width.value = '425';
 		f.height.value = '350';
 		f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];
@@ -596,14 +598,17 @@
 	pl.name = !pl.name ? 'eobj' : pl.name;
 	pl.align = !pl.align ? '' : pl.align;
 
-	h += '<object classid="clsid:' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
+	// Avoid annoying warning about insecure items
+	if (!tinymce.isIE || document.location.protocol != 'https:') {
+		h += '<object classid="clsid:' + cls + '" codebase="' + codebase + '" width="' + pl.width + '" height="' + pl.height + '" id="' + pl.id + '" name="' + pl.name + '" align="' + pl.align + '">';
 
-	for (n in pl) {
-		h += '<param name="' + n + '" value="' + pl[n] + '">';
+		for (n in pl) {
+			h += '<param name="' + n + '" value="' + pl[n] + '">';
 
-		// Add extra url parameter if it's an absolute URL
-		if (n == 'src' && pl[n].indexOf('://') != -1)
-			h += '<param name="url" value="' + pl[n] + '" />';
+			// Add extra url parameter if it's an absolute URL
+			if (n == 'src' && pl[n].indexOf('://') != -1)
+				h += '<param name="url" value="' + pl[n] + '" />';
+		}
 	}
 
 	h += '<embed type="' + type + '" ';
@@ -611,7 +616,11 @@
 	for (n in pl)
 		h += n + '="' + pl[n] + '" ';
 
-	h += '></embed></object>';
+	h += '></embed>';
+
+	// Avoid annoying warning about insecure items
+	if (!tinymce.isIE || document.location.protocol != 'https:')
+		h += '</object>';
 
 	p.innerHTML = "<!-- x --->" + h;
 }