[pLog-svn] r4447 - in plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo: . css images

oscar at devel.lifetype.net oscar at devel.lifetype.net
Fri Dec 29 11:30:31 GMT 2006


Author: oscar
Date: 2006-12-29 11:30:30 +0000 (Fri, 29 Dec 2006)
New Revision: 4447

Added:
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/bolt.png
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/dalealplay.png
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/goear.png
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/ifilm.png
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/metacafe.png
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/zippyvideos.png
Modified:
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/css/content.css
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/editor_plugin.js
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/functions.js
   plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/videoinput.html
Log:
updated version of the plugin with support for more video hosting sites, thanks to one of the users in the Spanish Lt forums.


Modified: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/css/content.css
===================================================================
--- plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/css/content.css	2006-12-29 06:22:21 UTC (rev 4446)
+++ plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/css/content.css	2006-12-29 11:30:30 UTC (rev 4447)
@@ -5,7 +5,6 @@
 	background-repeat: no-repeat;
 	background-color: #ffffcc;
 }
-
 .ltVideoGoogleVideo {
 	border: 1px dotted #cc0000;
 	background-image: url('../images/gvideo.png');
@@ -13,3 +12,24 @@
 	background-repeat: no-repeat;
 	background-color: #ffffcc;
 }
+.ltVideoMetacafe {
+	border: 1px dotted #cc0000;
+	background-image: url('../images/metacafe.png');
+	background-position: center;
+	background-repeat: no-repeat;
+	background-color: #ffffcc;
+	}
+.ltVideoIfilm {
+	border: 1px dotted #cc0000;
+	background-image: url('../images/ifilm.png');
+	background-position: center;
+	background-repeat: no-repeat;
+	background-color: #ffffcc;
+	}
+.ltVideoGoear {
+	border: 1px dotted #cc0000;
+	background-image: url('../images/goear.png');
+	background-position: center;
+	background-repeat: no-repeat;
+	background-color: #ffffcc;
+	}
\ No newline at end of file

Modified: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/editor_plugin.js
===================================================================
--- plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/editor_plugin.js	2006-12-29 06:22:21 UTC (rev 4446)
+++ plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/editor_plugin.js	2006-12-29 11:30:30 UTC (rev 4447)
@@ -49,7 +49,7 @@
 
 					insertvideo['file'] = '../../plugins/insertvideo/videoinput.html'; // Relative to theme
 					insertvideo['width'] = 500;
-					insertvideo['height'] = 160;
+					insertvideo['height'] = 260;
 
 					tinyMCE.openWindow(insertvideo, {editor_id : editor_id, resizable : "no", scrollbars : "no", inline : "yes"});
 				}
@@ -63,7 +63,6 @@
 	cleanup : function(type, content) {
 		switch (type) {
 			case "insert_to_editor_dom":
-			
 				// Force relative/absolute
 				if (tinyMCE.getParam('convert_urls')) {
 					var imgs = content.getElementsByTagName("img");
@@ -80,7 +79,6 @@
 						}
 					}
 				}
-				
 				break;
 
 			case "get_from_editor_dom":
@@ -130,6 +128,15 @@
 						else if( videoType == 2 ) {
 							cssClass = "ltVideoYouTube";
 						}
+						else if( videoType == 3 ) {
+							cssClass = "ltVideoMetacafe";
+						}
+						else if( videoType == 4 ) {
+							cssClass = "ltVideoIfilm";
+						}
+						else if( videoType == 5 ) {
+							cssClass = "ltVideoGoear";
+						}
 						else {
 							// ignore it, it's not a youtube or googlevideo video
 							startPos++;
@@ -161,7 +168,7 @@
 					var attribs = TinyMCE_insertvideoPlugin._parseAttributes(content.substring(startPos + 4, endPos));
 
 					// Is not flash, skip it
-					if (attribs['class'] != "ltVideoYouTube" && attribs['class'] != "ltVideoGoogleVideo")
+					if (attribs['class'] != "ltVideoYouTube" && attribs['class'] != "ltVideoGoogleVideo" && attribs['class'] != "ltVideoMetacafe" && attribs['class'] != "ltVideoIfilm" && attribs['class'] != "ltVideoGoear" )
 						continue;
 
 					type = attribs['class'];
@@ -173,7 +180,7 @@
 					var quality = tinyMCE.getParam("flash_quality", "high");
 					var menu = tinyMCE.getParam("flash_menu", "false");
 					
-					embedHTML = getVideoFlashHTML( attribs["title"], attribs["width"], attribs["height"] );
+					embedHTML = getVideoFlashHTML( attribs["title"], attribs["width"], attribs["height"] , type );
 
 					// Insert embed/object chunk
 					chunkBefore = content.substring(0, startPos);
@@ -251,19 +258,23 @@
 	}
 };
 
-function getVideoFlashHTML( url, width, height )
+function getVideoFlashHTML( url, width, height , type )
 {
-	html = "<object type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\" data=\""+url+"\">"+
+	html = "<object type=\"application/x-shockwave-flash\" width=\""+width+"\" height=\""+height+"\" data=\""+url+"\" id=\""+type+"\">"+
 		"<param name=\"movie\" value=\""+url+"\" />"+
 		"<param name=\"wmode\" value=\"transparent\" />"+
 		"<param name=\"allowScriptAcess\" value=\"sameDomain\" />"+
 		"<param name=\"quality\" value=\"best\" />"+
-		"<param name=\"bgcolor\" value=\"#FFFFFF\" />"+
-		"<param name=\"scale\" value=\"noScale\" />"+
-		"<param name=\"salign\" value=\"TL\" />"+
-		"<param name=\"FlashVars\" value=\"playerMode=embedded\" />"+
-	"</object>";
+		"<param name=\"bgcolor\" value=\"#FFFFFF\" />";
+//		"<param name=\"scale\" value=\"noScale\" />";
+  if (type=='ltVideoGoear') {
+		html= html + "<param name=\"FlashVars\" value=\""+url.substring( 43, url.length ) + "\" />";
+	}	else {
+	   html = html + "<param name=\"FlashVars\" value=\"playerMode=embedded\" />";
+	}
 	
+	html = html + "</object>";
+	
 	return( html );
 }
 
@@ -274,6 +285,12 @@
 		return 1;
 	else if( url.substring( 0, 23 ) == "http://www.youtube.com/" )
 		return 2;
+	else if( url.substring( 0, 24 ) == "http://www.metacafe.com/" )
+		return 3;
+	else if( url.substring( 0, 21 ) == "http://www.ifilm.com/" )
+		return 4;
+	else if( url.substring( 0, 21 ) == "http://www.goear.com/" )
+		return 5;
 	else
 		return 0;
 }

Modified: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/functions.js
===================================================================
--- plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/functions.js	2006-12-29 06:22:21 UTC (rev 4446)
+++ plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/functions.js	2006-12-29 11:30:30 UTC (rev 4447)
@@ -48,6 +48,65 @@
 	return( url );
 }
 
+function getMetacafeVideoLink( url )
+{
+	// check if it's a link to a video page or a link to the video player
+	if( url.substring( 0, 30 ) == "http://www.metacafe.com/watch/" ) {
+		// if it's a link to a video page, generate the right one
+		var regexp = /http:\/\/www.metacafe.com\/watch\/.*?docid=([\-0-9a-zA-z_]*).*/i;
+		result = regexp.exec( url );
+		if( result ) {
+			videoId = result[1];
+		}
+		else {		
+			videoId = url.substring( 30, url.length - 1 );
+		}				
+		
+		url = "http://www.metacafe.com/fplayer/" + videoId + ".swf";
+	}
+	
+	return( url );
+}
+
+function getiFilmVideoLink( url )
+{
+	// check if it's a link to a video page or a link to the video player
+	if( url.substring( 0, 27 ) == "http://www.ifilm.com/video/" ) {
+		// if it's a link to a video page, generate the right one
+		var regexp = /http:\/\/www.ifilm.com\/video\/.*?docid=([\-0-9a-zA-z_]*).*/i;
+		result = regexp.exec( url );
+		if( result ) {
+			videoId = result[1];
+		}
+		else {		
+			videoId = url.substring( 27, url.length );
+		}				
+		
+		url = "http://www.ifilm.com/efp?flvbaseclip=" + videoId ;
+	}
+
+	return( url );
+}
+
+function getGoearVideoLink( url )
+{
+	// check if it's a link to a video page or a link to the video player
+	if( url.substring( 0, 34 ) == "http://www.goear.com/listen.php?v=" ) {
+		// if it's a link to a video page, generate the right one
+		var regexp = /http:\/\/www.goear.com\/.*?v=([\-0-9a-zA-z_]*).*/i;
+		result = regexp.exec( url );
+		if( result ) {
+			videoId = result[1];
+		}
+		else {		
+			videoId = url.substring( 34, url.length );
+		}				
+		url = "http://www.goear.com/files/localplayer.swf?file=" + videoId ;
+	}
+
+	return( url );
+}
+
 function insertVideoCode()
 {
 	// get and check the URL
@@ -61,8 +120,14 @@
 	// check if a destination system was selected
 	youtube = document.getElementById("youtube");
 	gvideo = document.getElementById("gvideo");
-	if( youtube.checked==false && gvideo.checked==false) {
-		window.alert( "You must select one of the video services" );
+//	dalealplay = document.getElementById("dalealplay");
+	metacafe = document.getElementById("metacafe");
+	ifilm = document.getElementById("ifilm");
+  goear = document.getElementById("goear");
+//	bolt = document.getElementById("bolt");
+
+	if( youtube.checked==false && gvideo.checked==false && metacafe.checked==false && ifilm.checked==false && goear.checked==false ) {
+		window.alert( "Debes seleccionar el tipo de video." );
 		return( false );	
 	}
 	
@@ -72,12 +137,30 @@
 		width=450;
 		height=350;
 	}
-	else {
+	if( gvideo.checked == true ) {
 		link = getGoogleVideoLink( url );	
 		css="ltVideoGoogleVideo";
 		width=400;
 		height=326;		
 	}
+	if( metacafe.checked == true ) {
+		link = getMetacafeVideoLink( url );	
+		css="ltVideoMetacafe";
+		width=400;
+		height=345;		
+	}
+  if( ifilm.checked == true ) {
+		link = getiFilmVideoLink( url );
+		css="ltVideoIfilm";
+		width=448;
+		height=365;
+	}
+	if( goear.checked == true ) {
+		link = getGoearVideoLink( url );	
+		css="ltVideoGoear";
+		width=366;
+		height=75;		
+	}	
 
 	insertFlash( link, css, width, height );
 }

Added: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/bolt.png
===================================================================
(Binary files differ)


Property changes on: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/bolt.png
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/dalealplay.png
===================================================================
(Binary files differ)


Property changes on: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/dalealplay.png
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/goear.png
===================================================================
(Binary files differ)


Property changes on: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/goear.png
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/ifilm.png
===================================================================
(Binary files differ)


Property changes on: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/ifilm.png
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/metacafe.png
===================================================================
(Binary files differ)


Property changes on: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/metacafe.png
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Added: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/zippyvideos.png
===================================================================
(Binary files differ)


Property changes on: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/images/zippyvideos.png
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:mime-type
   + application/octet-stream

Modified: plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/videoinput.html
===================================================================
--- plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/videoinput.html	2006-12-29 06:22:21 UTC (rev 4446)
+++ plog/branches/lifetype-1.1.4/js/tinymce/plugins/insertvideo/videoinput.html	2006-12-29 11:30:30 UTC (rev 4447)
@@ -23,8 +23,11 @@
 	      <tr>
 	       <td nowrap="nowrap">Source:</td>
 	       <td>
-		    <input type="radio" id="youtube" style="border:0px" name="type" value="1"><img src="images/youtube.png" alt="YouTube" /> YouTube&nbsp;
-		    <input type="radio" id="gvideo" style="border:0px"name="type" value="2"><img src="images/gvideo.png" alt="Google Video" /> Google Video&nbsp;
+		    <input type="radio" id="youtube" style="border:0px" name="type" value="1"><img src="images/youtube.png" alt="YouTube" /> YouTube<br />
+		    <input type="radio" id="gvideo" style="border:0px"name="type" value="2"><img src="images/gvideo.png" alt="Google Video" /> Google Video<br />
+		    <input type="radio" id="metacafe" style="border:0px"name="type" value="3"><img src="images/metacafe.png" alt="Metacafe" /> Metacafe<br />
+		    <input type="radio" id="ifilm" style="border:0px"name="type" value="4"><img src="images/ifilm.png" alt="iFilm" /> iFilm<br />
+		    <input type="radio" id="goear" style="border:0px"name="type" value="5"><img src="images/goear.png" alt="Goear" /> Goear<br />
 		   </td>
 		  </tr> 			
 		 </table>		    



More information about the pLog-svn mailing list