Index: video_filter.module =================================================================== --- video_filter.module (revision 682) +++ video_filter.module (working copy) @@ -255,4 +255,96 @@ 'arguments' => array('video' => NULL, 'params' => array()), ), ); -} \ No newline at end of file +} + +/** + * Implementation of hook_menu(). + */ +function video_filter_menu() { + $items = array(); + + $items['video_filter/load'] = array( + 'title' => t('Video Filter'), + 'page callback' => 'video_filter_loader', + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + + return $items; +} + +/** + * Implementation of hook_wysiwyg_plugin(). + */ +function video_filter_wysiwyg_plugin($editor, $version) { + switch ($editor) { + case 'tinymce': + if ($version > 3) { + drupal_add_css(drupal_get_path('module', 'video_filter') . '/tinymce/video_filter.css'); + return array( + 'videofilter' => array( + 'path' => drupal_get_path('module', 'video_filter') . '/tinymce/editor_plugin.js', + 'buttons' => array('videofilter' => t('Video Filter')), + 'url' => 'http://drupal.org/project/video_filter', + 'load' => TRUE, + ), + ); + } + break; + } +} + +/** + * Output tinymce popup html. + * + * @todo Remove hard-coded TinyMCE integration. + */ +function video_filter_loader() { + $output = ''."\n"; + $output .= "\n"; + $output .= "\n"; + $output .= '{#videofilter_dlg.title}' ."\n"; + $path = base_path() . drupal_get_path('module', 'video_filter'); + $tinymce_path = base_path() .'sites/all/libraries'; + $tinymce_js = $tinymce_path .'/tinymce/jscripts/tiny_mce/tiny_mce_popup.js'; + $output .= '' . "\n"; + $output .= ''."\n"; + $output .= ''."\n"; + $output .= '' . "\n"; + $output .= "\n\n"; + $output .= ''; + $output .= '
' . "\n"; + $output .= '

{#videofilter_dlg.title}

' . "\n"; + $output .= '' . "\n"; + $output .= '
' . "\n"; + $output .= '' . "\n"; + $output .= '
' . "\n"; + $output .= '
' . "\n"; + $output .= '
' . "\n"; + $output .= '' . "\n"; + $output .= '
' . "\n"; + $output .= '
' . "\n"; + $output .= '' . "\n"; + $output .= '
' . "\n"; + $output .= '
' . "\n"; + $output .= '

'. t('Instructions') . '

' . "\n"; + $output .= '

' . t('Insert a 3rd party video from one of the following providers.') . '

' . "\n"; + $output .= _video_filter_instructions(); + $output .= '
' . "\n"; + $output .= '' . "\n"; + $output .= "\n"; + echo $output; +} + +/** + * Parses Codec into instructions for tinymce popup + */ +function _video_filter_instructions(){ + $codecs = module_invoke_all('codec_info'); + $output = "'; + return $output; +} Index: video_filter.codecs.inc =================================================================== --- video_filter.codecs.inc (revision 682) +++ video_filter.codecs.inc (working copy) @@ -6,48 +6,56 @@ $codecs['youtube'] = array( 'name' => t('YouTube'), + 'sample_url' => 'http://www.youtube.com/watch?v=uN1qUeId', 'callback' => 'video_filter_youtube', 'regexp' => '/youtube\.com\/watch\?v=([a-z0-9\-_]+)/i', 'ratio' => 425 / 355, ); $codecs['google'] = array( 'name' => t('Google Video'), + 'sample_url' => 'http://video.google.com/videoplay?docid=-uN1qUeId', 'callback' => 'video_filter_google', 'regexp' => '/video\.google\.com\/videoplay\?docid=(\-?[0-9]+)/', 'ratio' => 400 / 326, ); $codecs['tangle'] = array( 'name' => t('Tangle'), + 'sample_url' => 'http://www.tangle.com/view_video.php?viewkey=b2e45d2a30cb0f5cad38', 'callback' => 'video_filter_tangle', 'regexp' => '/tangle\.com\/view_video\.php\?viewkey=([a-z0-9]+)/', 'ratio' => 330 / 270, ); $codecs['dailymotion'] = array( 'name' => t('DailyMotion'), + 'sample_url' => 'http://www.dailymotion.com/us/featured/video/x59_some_title', 'callback' => 'video_filter_dailymotion', 'regexp' => '/dailymotion\.com\/.*video\/([a-z0-9]+)/i', 'ratio' => 420 / 336, ); $codecs['eyespot'] = array( 'name' => t('Eyespot'), + 'sample_url' => 'http://eyespot.com/share?cmd=permalink&r=0XCzIG2UEx9hoXiEJW07IWpUtT', 'callback' => 'video_filter_eyespot', 'regexp' => '/eyespot\.com\/.*r=([a-z0-9]+)/i', 'ratio' => 432 / 407, ); $codecs['jumpcut'] = array( 'name' => t('Jumpcut'), + 'sample_url' => 'http://jumpcut.com/view?id=31410FA4169E11DDB25E000423CF385C', 'callback' => 'video_filter_jumpcut', 'regexp' => '/jumpcut\.com\/.*id=([A-Z0-9]+)/', 'ratio' => 408 / 324, ); $codecs['revver'] = array( 'name' => t('Revver'), + 'sample_url' => 'http://revver.com/video/856351/the-title/', 'callback' => 'video_filter_revver', 'regexp' => '/revver\.com\/video\/([0-9]+)/', 'ratio' => 408 / 324, ); $codecs['vimeo'] = array( 'name' => t('Vimeo'), + 'sample_url' => 'http://www.vimeo.com/319782', 'callback' => 'video_filter_vimeo', 'regexp' => '/vimeo\.com\/([0-9]+)/', 'ratio' => 400 / 225, @@ -206,4 +214,4 @@ $video['source'] = 'http://capped.micksam7.com/playeralt.swf?vid='.$video['codec']['matches'][1]; return video_filter_flash($video); -} \ No newline at end of file +}