[pLog-svn] r5482 - in plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo: . css images langs

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Mon Jun 4 07:06:48 EDT 2007


Author: jondaley
Date: 2007-06-04 07:06:48 -0400 (Mon, 04 Jun 2007)
New Revision: 5482

Added:
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/README.txt
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/images/dailymotion.png
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/langs/fr.js
Modified:
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/css/content.css
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/editor_plugin.js
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/functions.js
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/langs/en.js
   plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/videoinput.html
Log:
added DailyMotion and made translatable by Gabriel Rousseau (thanks).  http://bugs.lifetype.net/view.php?id=1279

Added: plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/README.txt
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/README.txt	                        (rev 0)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/README.txt	2007-06-04 11:06:48 UTC (rev 5482)
@@ -0,0 +1,18 @@
+InsertVideo:
+
+Author: Oscar Renalias / LifeType (copied from the flash plugin)
+
+A plugin for tinymce that allows to insert videos from youtube and
+google video without breaking the xhhtml compliancy. The code has been
+shamelessly ripped from the tinymce 'flash' plugin but it works.
+
+
+
+History:
+
+10/2006: Created
+
+early 2007: various bug fixes/typos
+
+06/2007: DailyMotion support and Localized for other
+         languages by Gabriel Rousseau

Modified: plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/css/content.css
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/css/content.css	2007-06-04 10:39:01 UTC (rev 5481)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/css/content.css	2007-06-04 11:06:48 UTC (rev 5482)
@@ -39,4 +39,11 @@
 	background-position: center;
 	background-repeat: no-repeat;
 	background-color: #ffffcc;
+	}
+.ltVideoDailymot {
+	border: 1px dotted #cc0000;
+	background-image: url('../images/dailymotion.png');
+	background-position: center;
+	background-repeat: no-repeat;
+	background-color: #ffffcc;
 	}
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/editor_plugin.js
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/editor_plugin.js	2007-06-04 10:39:01 UTC (rev 5481)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/editor_plugin.js	2007-06-04 11:06:48 UTC (rev 5482)
@@ -1,5 +1,5 @@
 /* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('insertvideo', 'en,tr,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl'); // <- Add a comma separated list of all supported languages
+tinyMCE.importPluginLanguagePack('insertvideo', 'en,fr'); // <- Add a comma separated list of all supported languages
 
 // Singleton class
 var TinyMCE_insertvideoPlugin = {
@@ -9,7 +9,7 @@
 			author : 'The LifeType Project',
 			authorurl : 'http://www.lifetype.net',
 			infourl : 'http://www.lifetype.net',
-			version : "1.0"
+			version : "1.1"
 		};
 	},
 
@@ -140,6 +140,9 @@
 						else if( videoType == 6 ) {
 							cssClass = "ltVideoGrouper";
 						}
+						else if( videoType == 7 ) {
+							cssClass = "ltVideoDailymot";
+						}
 						else {
 							// ignore it, it's not a youtube or googlevideo video
 							startPos++;
@@ -171,7 +174,7 @@
 					var attribs = TinyMCE_insertvideoPlugin._parseAttributes(content.substring(startPos + 4, endPos));
 
 					// Is not flash, skip it
-					if (attribs['class'] != "ltVideoYouTube" && attribs['class'] != "ltVideoGoogleVideo" && attribs['class'] != "ltVideoMetacafe" && attribs['class'] != "ltVideoIfilm" && attribs['class'] != "ltVideoGoear" && attribs['class'] != "ltVideoGrouper")
+					if (attribs['class'] != "ltVideoYouTube" && attribs['class'] != "ltVideoGoogleVideo" && attribs['class'] != "ltVideoMetacafe" && attribs['class'] != "ltVideoIfilm" && attribs['class'] != "ltVideoGoear" && attribs['class'] != "ltVideoGrouper" && attribs['class'] != "ltVideoDailymot")
 						continue;
 
 					type = attribs['class'];
@@ -296,8 +299,10 @@
 		return 5;
 	else if( url.substring( 0, 21 ) == "http://www.grouper.com/" )
 		return 6;
+	else if( url.substring( 0, 27 ) == "http://www.dailymotion.com/" )
+		return 7;
 	else
 		return 0;
 }
 
-tinyMCE.addPlugin("insertvideo", TinyMCE_insertvideoPlugin );
\ No newline at end of file
+tinyMCE.addPlugin("insertvideo", TinyMCE_insertvideoPlugin );

Modified: plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/functions.js
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/functions.js	2007-06-04 10:39:01 UTC (rev 5481)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/functions.js	2007-06-04 11:06:48 UTC (rev 5482)
@@ -144,13 +144,21 @@
 	return( url );
 }
 
+function getDailymotionLink( url ) 
+{	
+	// check if this is a URL pointing to a dailymotion embedded video link
+	var regexp = /object\swidth="([0-9]+)"\sheight="([0-9]+)".+value="(http:\/\/www\.dailymotion\.com\/swf\/\w*)"/;
+	result = regexp.exec( url );
+	return( result );
+}
+
 function insertVideoCode()
 {
 	// get and check the URL
 	urlField = document.forms[0].url;
 	url = urlField.value;
 	if( url == "" || !isValidUrl( url )) {
-		window.alert( "The URL is not valid" );
+		window.alert( tinyMCE.getLang('lang_insertvideo_badurl', 0) );
 		return( false );
 	}
 	
@@ -160,13 +168,14 @@
 //	dalealplay = document.getElementById("dalealplay");
 	metacafe = document.getElementById("metacafe");
 	ifilm = document.getElementById("ifilm");
-      goear = document.getElementById("goear");
-      grouper = document.getElementById("grouper");
+	goear = document.getElementById("goear");
+	grouper = document.getElementById("grouper");
+	dailymot = document.getElementById("dailymot");
 
 //	bolt = document.getElementById("bolt");
 
-	if( youtube.checked==false && gvideo.checked==false && metacafe.checked==false && ifilm.checked==false && goear.checked==false && grouper.checked==false ) {
-		window.alert( "You must select the right video site." );
+	if( youtube.checked==false && gvideo.checked==false && metacafe.checked==false && ifilm.checked==false && goear.checked==false && grouper.checked==false && dailymot.checked==false ) {
+		window.alert( tinyMCE.getLang('lang_insertvideo_selectiontype', 0) );
 		return( false );	
 	}
 	
@@ -188,7 +197,7 @@
 		width=400;
 		height=345;		
 	}
-  if( ifilm.checked == true ) {
+	if( ifilm.checked == true ) {
 		link = getiFilmVideoLink( url );
 		css="ltVideoIfilm";
 		width=448;
@@ -205,7 +214,14 @@
 		css="ltVideoGrouper";
 		width=496;
 		height=398;		
-	}	
+	}
+	if( dailymot.checked == true ) {
+		result = getDailymotionLink( url );
+		width = result[1];
+		height = result[2];
+		link = result[3];
+		css="ltVideoDailymot";		
+	}
 	insertFlash( link, css, width, height );
 }
 

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


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

Modified: plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/langs/en.js
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/langs/en.js	2007-06-04 10:39:01 UTC (rev 5481)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/langs/en.js	2007-06-04 11:06:48 UTC (rev 5482)
@@ -1,5 +1,11 @@
 // UK lang variables
 
 tinyMCE.addToLang('',{
-lang_insertvideo_desc : 'Insert Video'
+lang_insertvideo_desc : 'Insert Video',
+lang_insertvideo_linklegend : 'Please provide a link to a video file.',
+lang_insertvideo_link : 'Video URL:',
+lang_insertvideo_selsource : 'Select Source:',
+lang_insertvideo_dailymotembeddableplayer : 'Embeddable Player',
+lang_insertvideo_badurl : 'Invalid URL',
+lang_insertvideo_selectiontype : 'You must select the right video site.',
 });

Added: plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/langs/fr.js
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/langs/fr.js	                        (rev 0)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/langs/fr.js	2007-06-04 11:06:48 UTC (rev 5482)
@@ -0,0 +1,11 @@
+// FR lang variables
+
+tinyMCE.addToLang('',{
+lang_insertvideo_desc : 'Ins&eacute;rer vid&eacute;o',
+lang_insertvideo_linklegend : 'Veuillez indiquer un lien vers un fichier ou une page vid&eacute;o.',
+lang_insertvideo_link : 'URL de la vid&eacute;o :',
+lang_insertvideo_selsource : 'S&eacute;lectionnez une source :',
+lang_insertvideo_dailymotembeddableplayer : 'Lecteur Exportable',
+lang_insertvideo_badurl : 'L’URL indiqu&eacute;e n’est pas valide',
+lang_insertvideo_selectiontype : 'Vous devez choisir le bon site vid&eacuteo.',
+});

Modified: plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/videoinput.html
===================================================================
--- plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/videoinput.html	2007-06-04 10:39:01 UTC (rev 5481)
+++ plog/branches/lifetype-1.2/js/tinymce/plugins/insertvideo/videoinput.html	2007-06-04 11:06:48 UTC (rev 5482)
@@ -1,6 +1,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-	<title>Insert Video</title>
+	<title>{$lang_insertvideo_desc}</title>
 	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
 	<script language="javascript" type="text/javascript" src="functions.js"></script>	
 	<base target="_self" />
@@ -9,19 +9,19 @@
 	<form name="video" id="video" method="post" action="#">
 	<div class="tabs">
 	  <ul>
-	   <li id="general_tab" class="current"><span>Insert Video</span></li>
+	   <li id="general_tab" class="current"><span>{$lang_insertvideo_desc}</span></li>
 	  </ul>
 	</div>
 	<div class="panel_wrapper">
 	  <div id="general_panel" class="panel_current">
-	     <legend>Please provide a link to a video file.</legend>	     	     
+	     <legend>{$lang_insertvideo_linklegend}</legend>	     	     
 	     <table border="0" cellpadding="4" cellspacing="0">
 	      <tr>
-	       <td nowrap="nowrap">Video URL:</td>
+	       <td nowrap="nowrap">{$lang_insertvideo_link}</td>
 	       <td><input type="text" id="url" name="url" value="" style="width:350px" /></td>
 	      </tr>
 	      <tr>
-	       <td nowrap="nowrap">Select Source:</td>
+	       <td nowrap="nowrap">{$lang_insertvideo_selsource}</td>
 	       <td>
 		    <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 />
@@ -29,7 +29,7 @@
 		    <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 />
 		    <input type="radio" id="grouper" style="border:0px"name="type" value="6"><img src="images/grouper.png" alt="Grouper" /> Grouper<br />
-
+		    <input type="radio" id="dailymot" style="border:0px"name="type" value="7"><img src="images/dailymotion.png" alt="dailymotion" /> dailymotion <span style="color: grey; font-style: oblique;">({$lang_insertvideo_dailymotembeddableplayer})</span><br />
 		   </td>
 		  </tr> 			
 		 </table>		    
@@ -37,10 +37,10 @@
 		</div>
 		<div class="mceActionPanel">
 		  <div style="float:left">		
-			<input type="button" name="insert" value="Insert Code" onClick="insertVideoCode()" id="insert" />
+			<input type="button" name="insert" value="{$lang_insert}" onClick="insertVideoCode()" id="insert" />
 		  </div>
 		  <div style="float:right">
-		    <input type="button" name="cancel" value="Close" onclick="tinyMCEPopup.close();" id="cancel" />
+		    <input type="button" name="cancel" value="{$lang_close}" onclick="tinyMCEPopup.close();" id="cancel" />
 		  </div>
 		</div>
 	 </div>



More information about the pLog-svn mailing list