diff --git a/sites/all/modules/contrib/editor/video_filter/README.txt b/sites/all/modules/contrib/editor/video_filter/README.txt index cee06290..e6958da7 100644 --- a/sites/all/modules/contrib/editor/video_filter/README.txt +++ b/sites/all/modules/contrib/editor/video_filter/README.txt @@ -1,4 +1,3 @@ - This is a highly flexible and easy extendable filter module to embed any type of video in your site using a simple tag. Other modules can add video sites/formats (called codecs) using an easy plug-in architecture. @@ -22,6 +21,9 @@ processed after that filter. To enable WYSIWYG support, go to the WYSIWYG settings for each input format and enable the Video Filter button. +To enable CKEditor (standalone) support, please see plugin instructions in: +editors/ckeditor/README.txt + ========= Usage ========= Single video: [video:url] diff --git a/sites/all/modules/contrib/editor/video_filter/editors/ckeditor/README.txt b/sites/all/modules/contrib/editor/video_filter/editors/ckeditor/README.txt index 6f21e91e..dcfc553b 100644 --- a/sites/all/modules/contrib/editor/video_filter/editors/ckeditor/README.txt +++ b/sites/all/modules/contrib/editor/video_filter/editors/ckeditor/README.txt @@ -1,35 +1,15 @@ - -############################################## -## ONLY if you use ckeditor WITHOUT wysiwyg ## -############################################## +############################################################ +## ONLY if with the CKEditor module, *NOT* WYSIWYG module ## +############################################################ Installation: Do the following steps to add video_filter button to the CKEditor toolbar: - 1. Open ckeditor.config.js (in the ckeditor module root) + 1. Go to Configuration -> CKEditor (admin/config/content/ckeditor) + Click "Edit" on the profile you what to use with the video filter. - 2. Scroll down to the end of the file, right before "};" insert: + 2. Expand "Editor appearance" and go to "Toolbar". Drag the new video_filter + button from the "All Buttons" toolbar to the "Used Buttons" toolbar. - // Video_filter plugin. - config.extraPlugins += (config.extraPlugins ? ',video_filter' : 'video_filter' ); - CKEDITOR.plugins.addExternal('video_filter', Drupal.settings.basePath + Drupal.settings.video_filter.modulepath + '/editors/ckeditor/'); - - 3. Add button to the toolbar. - - 3.1 Go to Configuration -> CKEditor (admin/config/content/ckeditor) - Click "Edit" on the profile you what to use with Linkit. - - 3.2 Expand "Editor appearance" and go to "Toolbar". - - The button name is: video_filter - For example if you have a toolbar with an array of buttons defined as - follows: - - ['Bold','Italic'] - - simply add the button somewhere in the array: - - ['Bold','Italic','video_filter'] - - (remember the single quotes). + 3. Go to "Plugins" on the same page. Enable the video filter plugin. diff --git a/sites/all/modules/contrib/editor/video_filter/editors/ckeditor/plugin.js b/sites/all/modules/contrib/editor/video_filter/editors/ckeditor/plugin.js index 2dcd53dc..a19ba936 100644 --- a/sites/all/modules/contrib/editor/video_filter/editors/ckeditor/plugin.js +++ b/sites/all/modules/contrib/editor/video_filter/editors/ckeditor/plugin.js @@ -7,25 +7,126 @@ requires : [], init: function(editor) { - // Add Button editor.ui.addButton('video_filter', { label: 'Video filter', command: 'video_filter', icon: this.path + 'video_filter.png' }); - // Add Command - editor.addCommand('video_filter', { - exec : function () { - var path = (Drupal.settings.video_filter.url.wysiwyg_ckeditor) ? Drupal.settings.video_filter.url.wysiwyg_ckeditor : Drupal.settings.video_filter.url.ckeditor - var media = window.showModalDialog(path, { 'opener' : window, 'editorname' : editor.name }, "dialogWidth:580px; dialogHeight:480px; center:yes; resizable:yes; help:no;"); - } - }); - // Register an extra fucntion, this will be used in the popup. - editor._.video_filterFnNum = CKEDITOR.tools.addFunction(insert, editor); + if(typeof window.showModalDialog !== 'undefined') { + editor.addCommand('video_filter', { + exec : function () { + var path = (Drupal.settings.video_filter.url.wysiwyg_ckeditor) ? Drupal.settings.video_filter.url.wysiwyg_ckeditor : Drupal.settings.video_filter.url.ckeditor + var media = window.showModalDialog(path, { 'opener' : window, 'editorname' : editor.name }, "dialogWidth:580px; dialogHeight:480px; center:yes; resizable:yes; help:no;"); + } + }); + + // Register an extra function, this will be used in the popup. + editor._.video_filterFnNum = CKEDITOR.tools.addFunction(insert, editor); + } + else { + editor.addCommand('video_filter', new CKEDITOR.dialogCommand('video_filterDialog')); + } } + }); + CKEDITOR.dialog.add('video_filterDialog', function( editor ) { + var instructions_path = Drupal.settings.video_filter.instructions_url; + + return { + title : 'Add Video', + minWidth : 600, + minHeight : 180, + contents : [{ + id : 'general', + label : 'Settings', + elements : [ + { + type : 'text', + id : 'file_url', + label : 'URL', + validate : CKEDITOR.dialog.validate.notEmpty( 'The link must have a URL.' ), + required : true, + commit : function( data ) + { + data.file_url = this.getValue(); + } + }, + { + type : 'text', + id : 'width', + label : 'Width', + commit : function( data ) + { + data.width = this.getValue(); + } + }, + { + type : 'text', + id : 'height', + label : 'Height', + commit : function( data ) + { + data.height = this.getValue(); + } + }, + { + type : 'select', + id : 'align', + label : 'Align', + 'default': 'none', + items: [ + ['None', ''], + ['Left', 'left'], + ['Right', 'right'], + ['Center', 'center'] + ], + commit : function( data ) + { + data.align = this.getValue(); + } + }, + { + type : 'checkbox', + id : 'autoplay', + label : 'Autoplay', + 'default': '', + commit : function( data ) + { + data.autoplay = this.getValue() ? 1 : 0; + } + }, + { + type: 'html', + html: '', + }, + ] + }], + onOk : function() + { + var dialog = this, + data = {}, + link = editor.document.createElement( 'p' ); + this.commitContent( data ); + var str = '[video:' + data.file_url; + if (data.width) { + str += ' width:' + data.width; + } + if (data.height) { + str += ' height:' + data.height; + } + if (data.align) { + str += ' align:' + data.align; + } + if (data.autoplay) { + str += ' autoplay:' + data.autoplay; + } + str += ']'; + link.setHtml( str ); + editor.insertElement( link ); + } + }; }); function insert(params, editor) { @@ -49,6 +150,9 @@ if (params.autoplay) { str += ' autoplay:' + params.autoplay; } + else { + str += ' autoplay:' + '0'; + } str += ']'; for (var i = 0, len = ranges.length; i < len; i++) { diff --git a/sites/all/modules/contrib/editor/video_filter/editors/fckeditor/video_filter/video_filter_dialog.js b/sites/all/modules/contrib/editor/video_filter/editors/fckeditor/video_filter/video_filter_dialog.js index 71727fbb..5260a74b 100644 --- a/sites/all/modules/contrib/editor/video_filter/editors/fckeditor/video_filter/video_filter_dialog.js +++ b/sites/all/modules/contrib/editor/video_filter/editors/fckeditor/video_filter/video_filter_dialog.js @@ -43,6 +43,9 @@ function Ok() { if ($('#edit-autoplay').is(':checked')) { str += ' autoplay:' + $('#edit-autoplay').val(); } + else { + str += ' autoplay:' + '0'; + } str += ']'; oEditor.FCKUndo.SaveUndoStep(); diff --git a/sites/all/modules/contrib/editor/video_filter/editors/tinymce/video_filter.js b/sites/all/modules/contrib/editor/video_filter/editors/tinymce/video_filter.js index e9d0c76b..0b2e8c8a 100644 --- a/sites/all/modules/contrib/editor/video_filter/editors/tinymce/video_filter.js +++ b/sites/all/modules/contrib/editor/video_filter/editors/tinymce/video_filter.js @@ -34,6 +34,9 @@ video_filter_dialog = { if ($('#edit-autoplay').is(':checked')) { str += ' autoplay:' + $('#edit-autoplay').val(); } + else { + str += ' autoplay:' + '0'; + } str += ']'; ed.execCommand('mceInsertContent', false, str); diff --git a/sites/all/modules/contrib/editor/video_filter/video_filter.api.php b/sites/all/modules/contrib/editor/video_filter/video_filter.api.php new file mode 100644 index 00000000..6692b807 --- /dev/null +++ b/sites/all/modules/contrib/editor/video_filter/video_filter.api.php @@ -0,0 +1,70 @@ + t('Minimal Example'), + 'sample_url' => 'http://minimal.example.com/uN1qUeId', + 'callback' => 'MODULE_minimal_example', + 'regexp' => '/minimal\.example\.com\/([a-z0-9\-_]+)/i', + 'ratio' => 4 / 3, + ); + + $codecs['complete_example'] = array( + 'name' => t('Complete Example'), + 'sample_url' => 'http://complete.example.com/username/uN1qUeId', + 'callback' => 'MODULE_complete_example', + 'html5_callback' => 'MODULE_complete_example_html5', + 'instructions' => t('Your Complete Example username can be the first URL argument or a sub-subdomain.'), + 'regexp' => array( + '/complete\.example\.com\/([a-z0-9\-_]+)\/([a-z0-9\-_]+)/i', + '/([a-z0-9\-_]+)\.complete\.example\.com\/([a-z0-9\-_]+)/i', + ), + 'ratio' => 4 / 3, + 'control_bar_height' => 25, + ); + + return $codecs; +} + +/** + * Alters the codecs available to Video Filter. + * + * @param array $codecs + */ +function hook_video_filter_codec_info_alter(&$codecs) {} + +/** + * Alters a video's attributes previous to rendering. + * + * @param array $video + */ +function hook_video_filter_video_alter(&$video) {} diff --git a/sites/all/modules/contrib/editor/video_filter/video_filter.codecs.inc b/sites/all/modules/contrib/editor/video_filter/video_filter.codecs.inc index 802df372..06ac3f69 100644 --- a/sites/all/modules/contrib/editor/video_filter/video_filter.codecs.inc +++ b/sites/all/modules/contrib/editor/video_filter/video_filter.codecs.inc @@ -34,6 +34,15 @@ function video_filter_codec_info() { 'control_bar_height' => 30, ); + $codecs['candidcareer'] = array( + 'name' => t('Candid Career'), + 'sample_url' => 'https://www.candidcareer.com/embed.php?vkey=ed5fdd900a274930252f&shared=CandidCareer&uid=30', + 'callback' => 'video_filter_candidcareer', + 'regexp' => '/candidcareer\.com\/embed\.php\?vkey=([a-zA-Z0-9\-_&;]+)shared=([a-zA-Z0-9\-_&;]+)uid=([a-zA-Z0-9\-_&;]+)/', + 'ratio' => 16 / 9, + 'control_bar_height' => 20, + ); + $codecs['capped'] = array( 'name' => t('Capped'), 'sample_url' => 'http://capped.tv/playeralt.php?vid=some-title', @@ -196,7 +205,7 @@ function video_filter_codec_info() { 'sample_url' => 'http://wistia.com/medias/9pj9n6ftlk', 'callback' => 'video_filter_wistia_html5', 'html5_callback' => 'video_filter_wistia_html5', - 'regexp' => '@https?://(.+\.)?(wistia\.com|wi\.st)/((m|medias|projects)|embed/(iframe|playlists))/([a-zA-Z0-9]+)@', + 'regexp' => '@https?://(.+\.)?(wistia\.(com|net)|wi\.st)/((m|medias|projects)|embed/(iframe|playlists))/([a-zA-Z0-9]+)@', ); $codecs['youtube'] = array( @@ -205,9 +214,10 @@ function video_filter_codec_info() { 'callback' => 'video_filter_youtube', 'html5_callback' => 'video_filter_youtube_html5', 'regexp' => array( - '/youtube\.com\/watch\?v=([a-z0-9\-_]+)/i', + '/youtube\.com\/watch\?.*?v=([a-z0-9\-_]+)/i', '/youtu.be\/([a-z0-9\-_]+)/i', '/youtube\.com\/v\/([a-z0-9\-_]+)/i', + '/youtube\.com\/embed\/([a-z0-9\-_]+)/i', ), 'ratio' => 16 / 9, 'control_bar_height' => 25, @@ -233,7 +243,7 @@ function video_filter_codec_info() { * @see video_filter_codec_info() */ function video_filter_archive($video) { - $video['source'] = 'http://www.archive.org/embed/' . $video['codec']['matches'][1]; + $video['source'] = '//www.archive.org/embed/' . $video['codec']['matches'][1]; return video_filter_iframe($video); } @@ -290,7 +300,7 @@ function video_filter_bliptv($video) { } } - $video['source'] = 'http://blip.tv/play/' . $id; + $video['source'] = '//blip.tv/play/' . $id; $params = array( 'allowscriptaccess' => 'always', ); @@ -298,13 +308,27 @@ function video_filter_bliptv($video) { return video_filter_flash($video, $params); } +/** + * Callback for Candid Career codec. + * + * @see video_filter_codec_info() + */ +function video_filter_candidcareer($video) { + // Their urls contain & symbols which Drupal is encoding, so decode those. + $decoded = decode_entities($video['codec']['matches'][0]); + $video['source'] = '//' . $decoded; + $video['attributes']['marginwidth'] = 0; + $video['attributes']['marginheight'] = 0; + return video_filter_iframe($video); +} + /** * Callback for Capped codec. * * @see video_filter_codec_info() */ function video_filter_capped($video) { - $video['source'] = 'http://capped.micksam7.com/playeralt.swf?vid=' . $video['codec']['matches'][1]; + $video['source'] = '//capped.micksam7.com/playeralt.swf?vid=' . $video['codec']['matches'][1]; return video_filter_flash($video); } @@ -315,7 +339,7 @@ function video_filter_capped($video) { * @see video_filter_codec_info() */ function video_filter_collegehumor($video) { - $video['source'] = 'http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&fullscreen=1'; + $video['source'] = '//www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&fullscreen=1'; return video_filter_flash($video); } @@ -326,7 +350,7 @@ function video_filter_collegehumor($video) { * @see video_filter_codec_info() */ function video_filter_dailymotion($video) { - $video['source'] = 'http://www.dailymotion.com/swf/' . $video['codec']['matches'][1]; + $video['source'] = '//www.dailymotion.com/swf/' . $video['codec']['matches'][1]; return video_filter_flash($video); } @@ -354,7 +378,7 @@ function video_filter_flickr_slideshows($video) { * @see video_filter_codec_info() */ function video_filter_flickr_video($video) { - $video['source'] = 'http://www.flickr.com/apps/video/stewart.swf?v=1.161'; + $video['source'] = '//www.flickr.com/apps/video/stewart.swf?v=1.161'; $params['flashvars'] = '&photo_id=' . $video['codec']['matches'][2] . '&flickr_show_info_box=true'; @@ -373,7 +397,7 @@ function video_filter_gametrailers($video) { elseif (is_numeric($video['codec']['matches'][2])) { $match = $video['codec']['matches'][2]; } - $video['source'] = 'http://media.mtvnservices.com/embed/mgid:moses:video:gametrailers.com:' . $match; + $video['source'] = '//media.mtvnservices.com/embed/mgid:moses:video:gametrailers.com:' . $match; return video_filter_iframe($video); } @@ -384,7 +408,7 @@ function video_filter_gametrailers($video) { * @see video_filter_codec_info() */ function video_filter_gamevideos($video) { - $video['source'] = 'http://gamevideos.1up.com/swf/gamevideos12.swf?embedded=1&fullscreen=1&autoplay=0&src=http://gamevideos.1up.com/do/videoListXML%3Fid%3D' . $video['codec']['matches'][1]; + $video['source'] = '//gamevideos.1up.com/swf/gamevideos12.swf?embedded=1&fullscreen=1&autoplay=0&src=http://gamevideos.1up.com/do/videoListXML%3Fid%3D' . $video['codec']['matches'][1]; return video_filter_flash($video); } @@ -395,7 +419,7 @@ function video_filter_gamevideos($video) { * @see video_filter_codec_info() */ function video_filter_godtube($video) { - $video['source'] = 'http://www.godtube.com/embed/watch/' . $video['codec']['matches'][1]; + $video['source'] = '//www.godtube.com/embed/watch/' . $video['codec']['matches'][1]; return video_filter_iframe($video); } @@ -406,7 +430,7 @@ function video_filter_godtube($video) { * @see video_filter_codec_info() */ function video_filter_google($video) { - $video['source'] = 'http://video.google.com/googleplayer.swf?docId=' . $video['codec']['matches'][1]; + $video['source'] = '//video.google.com/googleplayer.swf?docId=' . $video['codec']['matches'][1]; return video_filter_flash($video); } @@ -417,7 +441,7 @@ function video_filter_google($video) { * @see video_filter_codec_info() */ function video_filter_metacafe($video) { - $video['source'] = 'http://metacafe.com/fplayer/' . $video['codec']['matches'][1] . '/' . $video['codec']['matches'][2] . '.swf'; + $video['source'] = '//metacafe.com/fplayer/' . $video['codec']['matches'][1] . '/' . $video['codec']['matches'][2] . '.swf'; return video_filter_flash($video); } @@ -430,7 +454,7 @@ function video_filter_metacafe($video) { function video_filter_myspace($video) { // The last match is the ID we need. $last = count($video['codec']['matches']); - $video['source'] = 'http://mediaservices.myspace.com/services/media/embed.aspx/m=' . $video['codec']['matches'][$last - 1]; + $video['source'] = '//mediaservices.myspace.com/services/media/embed.aspx/m=' . $video['codec']['matches'][$last - 1]; return video_filter_flash($video, $params); } @@ -441,7 +465,7 @@ function video_filter_myspace($video) { * @see video_filter_codec_info() */ function video_filter_picasa_slideshows($video) { - $video['source'] = 'http://picasaweb.google.com/s/c/bin/slideshow.swf'; + $video['source'] = '//picasaweb.google.com/s/c/bin/slideshow.swf'; $user_name = $video['codec']['matches'][1]; $set_id = $video['codec']['matches'][2]; @@ -457,7 +481,7 @@ function video_filter_picasa_slideshows($video) { * @see video_filter_codec_info() */ function video_filter_slideshare($video) { - $video['source'] = 'http://www.slideshare.net/slideshow/embed_code/' . $video['codec']['matches'][1]; + $video['source'] = '//www.slideshare.net/slideshow/embed_code/' . $video['codec']['matches'][1]; return video_filter_iframe($video); } @@ -468,7 +492,7 @@ function video_filter_slideshare($video) { * @see video_filter_codec_info() */ function video_filter_streamhoster($video) { - $video['source'] = 'http://public.streamhoster.com/Resources/Flash/JWFLVMediaPlayer/mediaplayer.swf'; + $video['source'] = '//public.streamhoster.com/Resources/Flash/JWFLVMediaPlayer/mediaplayer.swf'; $params = array('allowscriptaccess' => 'always'); $protocol = $video['codec']['matches'][1]; @@ -496,7 +520,7 @@ function video_filter_streamhoster($video) { * @see video_filter_codec_info() */ function video_filter_teachertube($video) { - $video['source'] = 'http://www.teachertube.com/embed/player.swf'; + $video['source'] = '//www.teachertube.com/embed/player.swf'; $params['flashvars'] = 'file=http://www.teachertube.com/embedFLV.php?pg=video_' . $video['codec']['matches'][1] . '&menu=false&frontcolor=ffffff&lightcolor=FF0000&logo=http://www.teachertube.com/www3/images/greylogo.swf&skin=http://www.teachertube.com/embed/overlay.swf&volume=80&controlbar=over&displayclick=link&viral.link=http://www.teachertube.com/viewVideo.php?video_id=' . $video['codec']['matches'][1] . '&stretching=exactfit&plugins=viral-2&viral.callout=none&viral.onpause=false'; @@ -509,7 +533,7 @@ function video_filter_teachertube($video) { * @see video_filter_codec_info() */ function video_filter_vimeo($video) { - $video['source'] = 'http://www.vimeo.com/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=&autoplay=' . $video['autoplay']; + $video['source'] = '//www.vimeo.com/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=&autoplay=' . $video['autoplay']; return video_filter_flash($video); } @@ -520,7 +544,7 @@ function video_filter_vimeo($video) { * @see video_filter_codec_info() */ function video_filter_vimeo_html5($video) { - $video['source'] = 'http://player.vimeo.com/video/' . $video['codec']['matches'][1] . ($video['autoplay'] ? '?autoplay=1' : ''); + $video['source'] = '//player.vimeo.com/video/' . $video['codec']['matches'][1] . ($video['autoplay'] ? '?autoplay=1' : ''); return video_filter_iframe($video); } @@ -537,7 +561,7 @@ function video_filter_youtube($video) { 'fs' => 'fs=1', ); - $video['source'] = 'http://www.youtube.com/v/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes); + $video['source'] = '//www.youtube.com/v/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes); $params['wmode'] = 'opaque'; @@ -551,11 +575,12 @@ function video_filter_youtube($video) { */ function video_filter_youtube_html5($video) { $attributes = array( + 'html5' => 'html5=1', 'rel' => $video['related'] ? 'rel=1' : 'rel=0', 'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0', 'wmode' => 'wmode=opaque', ); - $video['source'] = 'http://www.youtube.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes); + $video['source'] = '//www.youtube.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes); return video_filter_iframe($video); } @@ -571,7 +596,7 @@ function video_filter_youtube_playlist_html5($video) { 'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0', 'wmode' => 'wmode=opaque', ); - $video['source'] = 'http://www.youtube.com/embed/videoseries?list=' . $video['codec']['matches'][1] . '&' . implode('&', $attributes); + $video['source'] = '//www.youtube.com/embed/videoseries?list=' . $video['codec']['matches'][1] . '&' . implode('&', $attributes); return video_filter_iframe($video); } @@ -584,9 +609,9 @@ function video_filter_youtube_playlist_html5($video) { * @see video_filter_codec_info() */ function video_filter_wistia_html5($video) { - $video_code = $video['codec']['matches'][6]; + $video_code = $video['codec']['matches'][7]; $matches = $video['codec']['matches']; - $embed_type = ($matches[3] == 'projects' || $matches[5] == 'playlists') ? 'playlists' : 'iframe'; + $embed_type = ($matches[4] == 'projects' || $matches[6] == 'playlists') ? 'playlists' : 'iframe'; // Get embed code via oEmbed. $endpoint = 'http://fast.wistia.com/oembed'; @@ -599,12 +624,12 @@ function video_filter_wistia_html5($video) { $html = $data['html']; // See if the video source is already an iframe src. - $pattern = '@https?://fast.wistia.com/embed/(iframe|playlists)/[a-zA-Z0-9]+\?+.+@'; + $pattern = '@https?://fast.wistia.(com|net)/embed/(iframe|playlists)/[a-zA-Z0-9]+\?+.+@'; $matches = array(); if (preg_match($pattern, $video['source'], $matches)) { // Replace the oEmbed iframe src with that provided in the token, in order // to support embed builder URLs. - $pattern = '@https?://fast.wistia.com/embed/(iframe|playlists)/[a-zA-Z0-9]+\?[^"]+@'; + $pattern = '@https?://fast.wistia.(com|net)/embed/(iframe|playlists)/[a-zA-Z0-9]+\?[^"]+@'; $replacement = $matches[0]; $html = preg_replace($pattern, $replacement, $html); } diff --git a/sites/all/modules/contrib/editor/video_filter/video_filter.info b/sites/all/modules/contrib/editor/video_filter/video_filter.info index 2476f081..68cef44f 100644 --- a/sites/all/modules/contrib/editor/video_filter/video_filter.info +++ b/sites/all/modules/contrib/editor/video_filter/video_filter.info @@ -5,9 +5,9 @@ package = Input filters stylesheets[all][] = video_filter.css -; Information added by drupal.org packaging script on 2012-11-14 -version = "7.x-3.1" +; Information added by Drupal.org packaging script on 2015-09-24 +version = "7.x-3.1+17-dev" core = "7.x" project = "video_filter" -datestamp = "1352915891" +datestamp = "1443119944" diff --git a/sites/all/modules/contrib/editor/video_filter/video_filter.module b/sites/all/modules/contrib/editor/video_filter/video_filter.module index 926e6b3c..5a05024a 100644 --- a/sites/all/modules/contrib/editor/video_filter/video_filter.module +++ b/sites/all/modules/contrib/editor/video_filter/video_filter.module @@ -284,9 +284,14 @@ function theme_video_filter_flash($variables) { $classes = video_filter_get_classes($video); - $output .= '' . "\n"; + $output .= '
' . "\n"; $defaults = array( 'movie' => $video['source'], @@ -300,7 +305,7 @@ function theme_video_filter_flash($variables) { $output .= ' ' . "\n"; } - $output .= '' . "\n"; + $output .= '
' . "\n"; return $output; } @@ -312,10 +317,13 @@ function theme_video_filter_flash($variables) { */ function theme_video_filter_iframe($variables) { $video = $variables['video']; - $classes = video_filter_get_classes($video); + $attributes = ''; + if (!empty($video['attributes'])) { + $attributes = drupal_attributes($video['attributes']); + } - $output = ''; + $output = '
'; return $output; } @@ -378,6 +386,15 @@ function video_filter_menu() { 'theme callback' => '_video_filter_dashboard_theme', ); + $items['video_filter/instructions'] = array( + 'title' => 'Videofilter instructions', + 'description' => 'instructions', + 'page callback' => 'video_filter_instructions_page', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + 'theme callback' => '_video_filter_dashboard_theme', + ); + return $items; } @@ -432,7 +449,19 @@ function video_filter_dashboard_page($editor) { break; } - print theme('video_filter_dashboard', array('form' => render(drupal_get_form('_video_filter_form')))); + $form = drupal_get_form('_video_filter_form'); + print theme('video_filter_dashboard', array('form' => render($form))); + exit(); +} + +/** + * Creates the instructions page. + */ +function video_filter_instructions_page() { + module_invoke('admin_menu', 'suppress'); + + $form = drupal_get_form('_video_filter_instructions_form'); + print theme('video_filter_dashboard', array('form' => render($form))); exit(); } @@ -492,6 +521,25 @@ function _video_filter_form() { '#weight' => 5, ); + $form += _video_filter_instructions_form(); + + $form['cancel'] = array( + '#type' => 'button', + '#value' => t('Cancel'), + '#weight' => 98, + ); + + $form['insert'] = array( + '#type' => 'button', + '#value' => t('Insert'), + '#weight' => 99, + ); + + return $form; +} + +function _video_filter_instructions_form() { + $form['instructions'] = array( '#type' => 'fieldset', '#title' => t('Instructions'), @@ -509,21 +557,28 @@ function _video_filter_form() { '#markup' => $text, ); - $form['cancel'] = array( - '#type' => 'button', - '#value' => t('Cancel'), - '#weight' => 98, - ); - - $form['insert'] = array( - '#type' => 'button', - '#value' => t('Insert'), - '#weight' => 99, - ); - return $form; } +/** + * Implements hook_ckeditor_plugin(). + */ +function video_filter_ckeditor_plugin() { + $plugins = array(); + $plugins['video_filter'] = array( + 'name' => 'video_filter', + 'desc' => t('Plugin to directly embed videos with the video filter module.'), + 'path' => drupal_get_path('module', 'video_filter') . '/editors/ckeditor/', + 'buttons' => array( + 'video_filter' => array( + 'label' => t('Video filter'), + 'icon' => 'video_filter.png', + ), + ), + ); + return $plugins; +} + function video_filter_wysiwyg_plugin($editor, $version) { _video_filter_add_settings('wysiwyg_' . $editor); @@ -582,7 +637,10 @@ function _video_filter_add_settings($editor) { // Add popup url. $settings = array( - 'video_filter' => array('url' => array($editor => url('video_filter/dashboard/' . $editor))), + 'video_filter' => array( + 'url' => array($editor => url('video_filter/dashboard/' . $editor)), + 'instructions_url' => url('video_filter/instructions'), + ), ); drupal_add_js($settings, 'setting'); }