diff --git a/main/document/edit_document.php b/main/document/edit_document.php index 521e8791f0..f8dc9bfcdf 100644 --- a/main/document/edit_document.php +++ b/main/document/edit_document.php @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/main/inc/lib/fckeditor/editor/plugins/Video/fck_video.js b/main/inc/lib/fckeditor/editor/plugins/Video/fck_video.js index 20d01ffe27..03b430671f 100644 --- a/main/inc/lib/fckeditor/editor/plugins/Video/fck_video.js +++ b/main/inc/lib/fckeditor/editor/plugins/Video/fck_video.js @@ -2,11 +2,15 @@ var oEditor = window.parent.InnerDialogLoaded() ; var FCK = oEditor.FCK ; var FCKLang = oEditor.FCKLang ; var FCKConfig = oEditor.FCKConfig ; +var flv_url = ""; // Set the dialog tabs. window.parent.AddTab( 'Upload', FCKLang.DlgVideoUpload ) ; window.parent.AddTab( 'Info', FCKLang.DlgVideoTab ) ; + +var oMedia = null; + // Function called when a dialog tag is selected. function OnDialogTabChange( tabCode ) { @@ -79,25 +83,56 @@ function Ok() return false ; } - + + if ( !oEmbed ) { oEmbed = FCK.EditorDocument.createElement( 'EMBED' ) ; oFakeImage = null ; } - UpdateEmbed( oEmbed ) ; - if ( !oFakeImage ) + + // check if it's a flv file + tmp_url = GetE('txtUrl').value; + extension = tmp_url.substring(tmp_url.indexOf('.')+1); + + + if(extension == 'flv') + flvplayer = true; + else + flvplayer = false; + + if(flvplayer == true) { - oFakeImage = oEditor.FCKDocumentProcessors_CreateFakeImage( 'FCK__Video', oEmbed ) ; - oFakeImage.setAttribute( '_fckVideo', 'true', 0 ) ; - oFakeImage = FCK.InsertElementAndGetIt( oFakeImage ) ; + var e = (oMedia || new Media()) ; + updateMovie(e); + FCK.InsertHtml(e.getOuterHTML()) ; + + if ( !oFakeImage ) + { + oFakeImage = oEditor.FCKDocumentProcessors_CreateFakeImage( 'FCK__Video_flv', oEmbed ) ; + oFakeImage.setAttribute( '_fckVideo', 'true', 0 ) ; + oFakeImage = FCK.InsertElementAndGetIt( oFakeImage ) ; + } + else + oEditor.FCKUndo.SaveUndoStep() ; } else - oEditor.FCKUndo.SaveUndoStep() ; + { + if ( !oFakeImage ) + { + oFakeImage = oEditor.FCKDocumentProcessors_CreateFakeImage( 'FCK__Video', oEmbed ) ; + oFakeImage.setAttribute( '_fckVideo', 'true', 0 ) ; + oFakeImage = FCK.InsertElementAndGetIt( oFakeImage ) ; + } + else + oEditor.FCKUndo.SaveUndoStep() ; + UpdateEmbed( oEmbed ) ; + } - oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ; + + oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ; return true ; } @@ -171,6 +206,7 @@ function SetUrl( url, width, height ) UpdatePreview() ; //window.parent.SetSelectedTab( 'Info' ) ; + Ok(); window.parent.close(); @@ -223,6 +259,8 @@ function CheckUpload() return false ; } + alert("ici "+oUploadAllowedExtRegex.test( sFile )); + if ( ( FCKConfig.VideoUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) || ( FCKConfig.VideoUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) ) { @@ -237,3 +275,109 @@ function OnSizeChanged( dimension, value ) { UpdatePreview() ; } + +function updateMovie(e){ + e.url = GetE('txtUrl').value; +} + + +function getObjData(txtUrl){ // to create data attribute for object + var url=txtUrl; + var configBasePath = FCKConfig.BasePath; + var cor_indx=configBasePath.indexOf("inc/")+4; + var objdata = configBasePath.substring(0, cor_indx)+"lib/flv_player/player_flv_mini.swf"; + + setVideoUrl(GetE('txtUrl').value); + + return objdata; +} + +function setVideoUrl(url){ + flv_url=url; +} + +function getVideoUrl(){ + return flv_url; +} + + + + + +var Media = function (o){ + this.url = ''; + this.width = ''; + this.height = ''; + + if (o) + this.setObjectElement(o); +}; + +/** + * Toma los datos de un elemento. + */ +Media.prototype.setObjectElement = function (e){ + if (!e) return ; + + this.width = GetAttribute( e, 'width', this.width ); + this.height = GetAttribute( e, 'height', this.height ); + this.url = GetAttribute( e, 'data', this.url ); + // params + for (var i=0;i\r\n\r\n\t\r\n\r\n'; + + //var s = 'D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="test" ALIGN=""> '; + return s; +}; + + +Media.prototype.createAttribute = function(n,v){ + return ' '+n+'="'+v+'" '; +} \ No newline at end of file diff --git a/main/inc/lib/flv_player/player_flv_mini.swf b/main/inc/lib/flv_player/player_flv_mini.swf new file mode 100644 index 0000000000..62b4180617 Binary files /dev/null and b/main/inc/lib/flv_player/player_flv_mini.swf differ diff --git a/main/inc/lib/flv_player/src.zip b/main/inc/lib/flv_player/src.zip new file mode 100644 index 0000000000..27e0c84a9a Binary files /dev/null and b/main/inc/lib/flv_player/src.zip differ