Index: lams_central/web/ckeditor/plugins/movieplayer/LICENSE.TXT
===================================================================
diff -u
--- lams_central/web/ckeditor/plugins/movieplayer/LICENSE.TXT (revision 0)
+++ lams_central/web/ckeditor/plugins/movieplayer/LICENSE.TXT (revision 63caec7d86903e659e906042390eee95cba3a801)
@@ -0,0 +1,25 @@
+FLV Player
+-------------------------------
+HomePage: [http://flv-player.net/]
+License in page: [http://flv-player.net/players/normal/license/]
+ The player is under the Creative Commons BY SA and MPL 1.1 license.
+ You can use the player without citing the author.
+Files: player_flv_maxi.swf
+
+
+MP3 Player
+------------------------------
+HomePage: [http://flash-mp3-player.net/]
+License in page: [http://flash-mp3-player.net/players/maxi/license/]
+ The player is under the Creative Commons BY SA and MPL 1.1 license.
+ You can use the player without citing the author.
+Files: player_mp3_maxi.swf
+
+ICON
+-------------------------------
+HomePage: [http://commons.wikimedia.org/wiki/File:Filmreel.png]
+License in page: [http://commons.wikimedia.org/wiki/File:Filmreel.png]
+ I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.
+ In case this is not legally possible:
+ I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.
+Files: filmreel.png, filmreel.gif
\ No newline at end of file
Index: lams_central/web/ckeditor/plugins/movieplayer/filmreel.gif
===================================================================
diff -u
Binary files differ
Index: lams_central/web/ckeditor/plugins/movieplayer/filmreel.png
===================================================================
diff -u
Binary files differ
Index: lams_central/web/ckeditor/plugins/movieplayer/lang/en.js
===================================================================
diff -u
--- lams_central/web/ckeditor/plugins/movieplayer/lang/en.js (revision 0)
+++ lams_central/web/ckeditor/plugins/movieplayer/lang/en.js (revision 63caec7d86903e659e906042390eee95cba3a801)
@@ -0,0 +1,33 @@
+CKEDITOR.plugins.setLang( 'movieplayer', 'en',
+ {
+ movieplayer :
+ {
+
+ // Toolbar button
+
+ MoviePlayerBtn : 'Media Player',
+
+ MoviePlayerTooltip : 'Insert/Edit Movies or Audio',
+
+
+ // Dialog
+
+ DlgMoviePlayerTitle : 'Media Player Properties',
+
+ MoviePlayerURL : 'URL:',
+
+ MoviePlayerURLDesc : 'Select a .avi, .flv, .mov, .mp3, .mp4, .mpv, .wma, .wmv file or youtube URL',
+
+ MoviePlayerWidth : 'Width:',
+
+ MoviePlayerHeight : 'Height:',
+
+ MoviePlayerAutoplay : 'Auto Play:',
+
+ MoviePlayerBrowseServer : 'Browse Server',
+
+ // Dialog errors
+
+ MoviePlayerNoUrl : 'Please specify a movie URL.'
+ }
+ });
Index: lams_central/web/ckeditor/plugins/movieplayer/movieplayer.html
===================================================================
diff -u
--- lams_central/web/ckeditor/plugins/movieplayer/movieplayer.html (revision 0)
+++ lams_central/web/ckeditor/plugins/movieplayer/movieplayer.html (revision 63caec7d86903e659e906042390eee95cba3a801)
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_central/web/ckeditor/plugins/movieplayer/movieplayer.js
===================================================================
diff -u
--- lams_central/web/ckeditor/plugins/movieplayer/movieplayer.js (revision 0)
+++ lams_central/web/ckeditor/plugins/movieplayer/movieplayer.js (revision 63caec7d86903e659e906042390eee95cba3a801)
@@ -0,0 +1,644 @@
+var CKEDITOR = window.parent.CKEDITOR;
+
+var thisDialog = CKEDITOR.dialog.getCurrent();
+
+var CK = thisDialog.getParentEditor();
+
+var oMovie = null;
+
+var isNew = true;
+
+var flashPlayer = CKEDITOR.plugins.getPath('movieplayer') + 'player_flv_maxi.swf';
+
+var mp3Player = CKEDITOR.plugins.getPath('movieplayer')+ 'player_mp3_maxi.swf';
+
+var SetUrlRef = CKEDITOR.tools.addFunction(SetUrl);
+
+/** Initial setup */
+
+window.onload = function() {
+
+ // Translate dialog box
+
+ document.getElementById("MoviePlayerURL").firstChild.data = CK.lang.movieplayer.MoviePlayerURL;
+
+ document.getElementById("MoviePlayerURLDesc").firstChild.data = CK.lang.movieplayer.MoviePlayerURLDesc;
+
+ document.getElementById("btnBrowse").value = CK.lang.movieplayer.MoviePlayerBrowseServer;
+
+ document.getElementById("MoviePlayerWidth").firstChild.data = CK.lang.movieplayer.MoviePlayerWidth;
+
+ document.getElementById("MoviePlayerHeight").firstChild.data = CK.lang.movieplayer.MoviePlayerHeight;
+
+ document.getElementById("MoviePlayerAutoplay").firstChild.data = CK.lang.movieplayer.MoviePlayerAutoplay;
+
+
+
+
+ // Show the "Ok" button - doesn't work in CKEditor 3, but shouldn't cause problems
+ // window.parent.SetOkButton( true ) ;
+
+ // remove our previously registered listeners and reregister a new one
+ var okButton = thisDialog.getButton('ok');
+ var newListeners = [];
+ var oldListeners = okButton._.events.click.listeners;
+ for (var i = 0; i < okButton._.events.click.listeners.length; i++){
+ if (okButton._.events.click.listeners[i].priority != 1) {
+ newListeners.push(okButton._.events.click.listeners[i]);
+ }
+ }
+ okButton._.events.click.listeners = newListeners;
+ okButton.on('click', triggerOK, null, null, 1);
+
+ // Load selected movie
+
+ loadMovieSelection();
+
+}
+
+
+/** Movie object */
+
+var Movie = function (o){
+
+ this.id = '';
+
+ this.contentType = '';
+
+ this.url = '';
+
+ this.autoplay = '0';
+
+ this.width = '320';
+
+ this.height = '240';
+
+ if(o) this.setObjectElement(o);
+
+};
+
+
+/** Load FCKEditor selection */
+
+function loadMovieSelection() {
+
+ oMovie = new Movie();
+
+ var oSel = CK.getSelection().getSelectedElement();
+
+
+ if (oSel != null) {
+
+
+ var realElementHtml = oSel.getAttribute('_cke_realelement');
+
+ if (realElementHtml != 'undefined'){
+
+ realElementHtml = decodeURIComponent(realElementHtml);
+
+ realElementHtml = realElementHtml.replace(/cke:/g,'');
+
+ oSel = CKEDITOR.dom.element.createFromHtml(realElementHtml, thisDialog.document);
+
+ }
+
+ oSel = oSel.$;
+
+ if (oSel.id != null && oSel.id.match(/^movie[0-9]*$/)) {
+
+ oMovie.setAttribute('id', oSel.id);
+ }
+
+
+
+ var children = oSel.children;
+
+ if (children.length == 0){
+
+ children = oSel.childNodes;
+ }
+
+ for ( var i = 0; i < children.length; i++) {
+
+ var node = children[i];
+
+ if (node.tagName == 'PARAM') {
+
+ var name = GetAttribute(node, 'name');
+
+ var value = GetAttribute(node, 'value');
+
+ if (name == 'FlashVars') {
+
+ // Flash video
+
+ var vars = value.split('&');
+
+ for ( var fv = 0; fv < vars.length; fv++) {
+
+ var varsT = vars[fv].split('=');
+
+ name = varsT[0];
+
+ value = varsT[1];
+
+ if (name == 'flv') {
+
+ oMovie.setAttribute('url', value);
+
+ } else {
+
+ oMovie.setAttribute(name, value);
+
+ }
+
+ }
+
+ } else if (name == 'autostart' || name == 'autoplay') {
+
+ value = (value == 'true' || value == '1') ? 1 : 0;
+
+ oMovie.setAttribute('autoplay', value);
+
+ } else if (name == 'src'
+
+ || (name == 'movie' && !name.endsWith(flashPlayer))) {
+
+ oMovie.setAttribute('url', value);
+
+ } else {
+
+ // Other movie types
+
+ oMovie.setAttribute(name, value);
+
+ }
+
+ isNew = false;
+
+ }
+
+ }
+
+ }
+
+
+
+ // Read current settings (existing movie)
+
+ document.getElementById('txtUrl').value = oMovie.url;
+
+ if(!isNew) {
+
+ oMovie.contentType = getContentType(oMovie.url);
+
+ }
+
+ document.getElementById('txtWidth').value = oMovie.width;
+
+ document.getElementById('txtHeight').value = oMovie.height;
+
+ document.getElementById('chkAutoplay').checked = oMovie.autoplay == '1';
+
+
+
+ // Show/Hide according to settings
+
+ showElement('tdBrowse', CK.config.filebrowserImageBrowseUrl != 'undefined');
+
+ return oMovie;
+
+}
+
+
+
+
+
+/** Browse/upload a file on server */
+
+function BrowseServer() {
+
+ var mediaBrowserWindowURL = CK.config.filebrowserImageBrowseUrl.replace(/(&|\?)Type=Image/i, "$1Type=Media");
+
+ mediaBrowserWindowURL += '&CKEditor=' + CK.name;
+
+ mediaBrowserWindowURL += '&CKEditorFuncNum=' + SetUrlRef;
+
+ var mediaBrowserWindowWidth = CK.config.filebrowserWindowWidth * 0.7;
+
+ var mediaBrowserWindowHeight = CK.config.filebrowserWindowHeight * 0.7;
+
+ var iLeft = ( CK.config.filebrowserWindowWidth - mediaBrowserWindowWidth ) / 2 ;
+
+ var iTop = ( CK.config.filebrowserWindowHeight - mediaBrowserWindowHeight ) / 2 ;
+
+ var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes,scrollbars=yes" ;
+ sOptions += ",width=" + mediaBrowserWindowWidth ;
+ sOptions += ",height=" + mediaBrowserWindowHeight ;
+ sOptions += ",left=" + iLeft ;
+ sOptions += ",top=" + iTop ;
+
+ window.open( mediaBrowserWindowURL, 'FCKBrowseWindow', sOptions ) ;
+}
+
+
+
+
+
+/** Start processing */
+
+function triggerOK(ev) {
+
+ if(document.getElementById('txtUrl').value.length == 0) {
+
+ document.getElementById('txtUrl').focus();
+
+ // window.parent.SetSelectedTab('Info');
+
+ alert(CK.lang.movieplayer.MoviePlayerNoUrl) ;
+
+ ev.stop();
+
+ return;
+
+ }
+
+
+
+ CK.fire('saveSnapshot', null, CK);
+
+
+
+ var e = (oMovie || new Movie()) ;
+
+ updateMovieObject(e) ;
+
+ /*
+ if(!isNew) {
+
+ if(!navigator.userAgent.contains('Safari')) {
+
+ FCK.Selection.Delete();
+
+ }
+
+ CK.insertHtml(e.getInnerHTML());
+
+ } else{
+
+ */
+
+ CK.insertHtml(e.getInnerHTML());
+
+ return true;
+}
+
+
+
+
+
+/** Update Movie object from Form */
+
+function updateMovieObject(e){
+
+ e.url = document.getElementById('txtUrl').value;
+
+ e.contentType = getContentType(e.url);
+
+ e.width = (isNaN(document.getElementById('txtWidth').value)) ? 0 : parseInt(document.getElementById('txtWidth').value);
+
+ e.height = (isNaN(document.getElementById('txtHeight').value)) ? 0 : parseInt(document.getElementById('txtHeight').value);
+
+ e.autoplay = (document.getElementById('chkAutoplay').checked) ? '1' : '0';
+
+}
+
+
+
+
+
+/** Create Movie html */
+
+Movie.prototype.getInnerHTML = function (objectId){
+
+ var rnd = Math.floor(Math.random()*1000001);
+
+ var s = "";
+
+
+
+ // html
+
+ if(this.contentType == "application/x-shockwave-flash") {
+
+ if(getExtension(this.url) == 'flv') {
+
+ // Flash video (FLV)
+
+ s += '';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+
+
+ }else{
+
+ // Fix youtube url
+
+ if(this.url.contains('youtube.com/')) {
+
+ this.url = this.url.replace(/youtube\.com\/watch\?v=/i, "youtube.com/v/");
+
+ }
+
+
+
+ // Flash object (SWF)
+
+ s += '';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ }
+
+
+
+ }else if (this.contentType == "audio/mpeg") {
+
+ // We use the flash mp3 player
+
+ s += '';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+
+
+
+
+ }else {
+
+ // Other video types
+
+ var pluginspace, codebase, classid;
+
+ if(this.contentType == "video/quicktime" || this.contentType == "video/mp4" || this.contentType == "video/mpeg" || this.contentType == "video/x-msvideo" ) {
+
+ // QUICKTIME
+
+ this.autoplay = (this.autoplay == 'true' || this.autoplay == '1') ? 'true' : 'false';
+
+ s += '';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' '; // for IE6 only
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ }else{
+
+ // WINDOWS MEDIA & OTHERS
+
+ this.autoplay = (this.autoplay == 'true' || this.autoplay == '1') ? 'true' : 'false';
+
+ s += '';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+ s += ' ';
+
+
+
+ }
+
+
+
+ }
+
+
+
+ return s;
+
+}
+
+
+
+
+
+/** Set movie attribute */
+
+Movie.prototype.setAttribute = function(attr, val) {
+
+ if (val=="true") {
+
+ this[attr]=true;
+
+ } else if (val=="false") {
+
+ this[attr]=false;
+
+ } else {
+
+ this[attr]=val;
+
+ }
+
+};
+
+
+
+/** Get the file extension */
+
+function getExtension(url) {
+
+ var ext = url.match(/\.(avi|asf|fla|flv|mov|mp3|mp4|m4v|mpg|mpeg|mpv|qt|swf|wma|wmv)$/i);
+
+ if(ext != null && ext.length && ext.length > 0) {
+
+ ext = ext[1];
+
+ }else{
+
+ if(url.contains('youtube.com/')) {
+
+ ext = 'swf';
+
+ }else{
+
+ ext = '';
+
+ }
+
+ }
+
+ return ext;
+
+}
+
+
+
+/** Configure content type basing on provided url */
+
+function getContentType(url) {
+
+ var ext = getExtension(url);
+
+ var contentType =
+
+ (ext=="mpg"||ext=="mpeg"||ext=="mpv") ? "video/mpeg":
+
+ (ext=="mp4") ? "video/mp4":
+
+ (ext=="m4v") ? "video/mp4":
+
+ (ext=="mp3") ? "audio/mpeg":
+
+ (ext=="flv"||ext=="fla"||ext=="swf") ? "application/x-shockwave-flash":
+
+ (ext=="wmv"||ext=="wm") ? "video/x-ms-wmv":
+
+ (ext=="avi") ? "video/x-msvideo":
+
+ (ext=="asf") ? "video/x-ms-asf":
+
+ (ext=="wma") ? "audio/x-ms-wma":
+
+ (ext=="mov"||ext=="qt") ? "video/quicktime" : "video/x-ms-wmv";
+
+ return contentType;
+
+}
+
+
+
+Movie.prototype.setObjectElement = function (e){
+
+ if (!e) return ;
+
+ this.width = GetAttribute( e, 'width', this.width );
+
+ this.height = GetAttribute( e, 'height', this.height );
+
+};
+
+
+
+String.prototype.endsWith = function(str)
+
+{return (this.match(str+"$")==str)}
+
+String.prototype.startsWith = function(str)
+
+{return (this.match("^"+str)==str)}
+
+
+
+String.prototype.contains = function(str)
+
+{return (this.match(str)==str)}
+
+
+
+/** Set selected URL from Browser */
+
+function SetUrl(url) {
+ document.getElementById('txtUrl').value = url;
+}
+
+
+function showElement(element, isVisible) {
+ if (typeof (element) == 'string')
+ element = document.getElementById(element);
+ element.style.display = isVisible ? '' : 'none';
+}
+
+function GetAttribute( element, attName, valueIfNull )
+{
+ var oAtt = element.attributes[attName] ;
+
+ if ( oAtt == null || !oAtt.specified )
+ return valueIfNull ? valueIfNull : '' ;
+
+ var oValue = element.getAttribute( attName, 2 ) ;
+
+ if ( oValue == null )
+ oValue = oAtt.nodeValue ;
+
+ return ( oValue == null ? valueIfNull : oValue ) ;
+}
Index: lams_central/web/ckeditor/plugins/movieplayer/player_flv_maxi.swf
===================================================================
diff -u
Binary files differ
Index: lams_central/web/ckeditor/plugins/movieplayer/player_mp3_maxi.swf
===================================================================
diff -u
Binary files differ
Index: lams_central/web/ckeditor/plugins/movieplayer/plugin.js
===================================================================
diff -u
--- lams_central/web/ckeditor/plugins/movieplayer/plugin.js (revision 0)
+++ lams_central/web/ckeditor/plugins/movieplayer/plugin.js (revision 63caec7d86903e659e906042390eee95cba3a801)
@@ -0,0 +1,38 @@
+/*
+ * CKEditior plugin.js for Movie Player
+ * ------------
+ */
+
+CKEDITOR.plugins.add('movieplayer',
+ {
+ requires : ['iframedialog'],
+ lang : [ 'en' ],
+ init : function(editor) {
+ var pluginPath = CKEDITOR.plugins.getPath('movieplayer');
+
+ editor.ui.addButton(
+ 'MoviePlayer',
+ {
+ label : editor.lang.movieplayer.MoviePlayerBtn,
+ command : 'MoviePlayer',
+ icon : pluginPath + 'filmreel.gif',
+ title : editor.lang.movieplayer.MoviePlayerTooltip
+ }
+ );
+
+ editor.addCommand('MoviePlayer', {exec:showDialogPlugin});
+
+ CKEDITOR.dialog.addIframe(
+ 'MoviePlayer',
+ editor.lang.movieplayer.DlgMoviePlayerTitle,
+ pluginPath + 'movieplayer.html',
+ 450,
+ 260
+ );
+ }
+ }
+ );
+
+function showDialogPlugin(e){
+ e.openDialog('MoviePlayer');
+}
\ No newline at end of file
Index: lams_central/web/includes/javascript/ckconfig_custom.js
===================================================================
diff -u -r656d1f554ccd1f49df2c4831639c7584d8f49bdb -r63caec7d86903e659e906042390eee95cba3a801
--- lams_central/web/includes/javascript/ckconfig_custom.js (.../ckconfig_custom.js) (revision 656d1f554ccd1f49df2c4831639c7584d8f49bdb)
+++ lams_central/web/includes/javascript/ckconfig_custom.js (.../ckconfig_custom.js) (revision 63caec7d86903e659e906042390eee95cba3a801)
@@ -43,8 +43,7 @@
CKEDITOR.config.format_tags = 'div;h1;h2;h3;h4;h5;h6;pre;address;p' ;
CKEDITOR.config.enterMode = 'div' ;
CKEDITOR.plugins.addExternal('WikiLink', CKEDITOR.basePath + '../tool/lawiki10/wikilink/', 'plugin.js') ;
-//CKEDITOR.config.extraPlugins = 'equation,movieplayer,videorecorder,paint,wikilink' ;
-CKEDITOR.config.extraPlugins = 'videorecorder,WikiLink,equation_html,paint' ;
+CKEDITOR.config.extraPlugins = 'videorecorder,WikiLink,equation_html,paint,movieplayer' ;
// ---- Additional scripts -----
// Hides editor instaces until they are fully initialized