diff -u -ruN -x .svn video_filter-2x/tinymce/editor_plugin.js video_filter-2x-if/tinymce/editor_plugin.js
--- video_filter-2x/tinymce/editor_plugin.js 1970-01-01 01:00:00.000000000 +0100
+++ video_filter-2x-if/tinymce/editor_plugin.js 2009-05-27 14:02:35.000000000 +0200
@@ -0,0 +1 @@
+(function(){tinymce.create('tinymce.plugins.VideoFilterPlugin',{init:function(ed,url){ed.addCommand('mceVideoFilter',function(){ed.windowManager.open({file:Drupal.settings.basePath+'video_filter/load',width:480,height:480,inline:1,scrollbars:1})});ed.addButton('videofilter',{title:'Video Filter',cmd:'mceVideoFilter'})},getInfo:function(){return{longname:'Video Filter',author:'Video Filter',authorurl:'http://drupal.org/project/video_filter',infourl:'http://drupal.org/project/video_filter',version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add('videofilter',tinymce.plugins.VideoFilterPlugin)})();
\ No newline at end of file
diff -u -ruN -x .svn video_filter-2x/tinymce/editor_plugin_src.js video_filter-2x-if/tinymce/editor_plugin_src.js
--- video_filter-2x/tinymce/editor_plugin_src.js 1970-01-01 01:00:00.000000000 +0100
+++ video_filter-2x-if/tinymce/editor_plugin_src.js 2009-05-27 14:02:35.000000000 +0200
@@ -0,0 +1,35 @@
+(function() {
+ tinymce.create('tinymce.plugins.VideoFilterPlugin', {
+ init : function(ed, url) {
+ // Register commands
+ ed.addCommand('mceVideoFilter', function() {
+ ed.windowManager.open({
+ file : Drupal.settings.basePath + 'video_filter/load',
+ width : 480,
+ height : 480,
+ inline : 1,
+ scrollbars : 1
+ });
+ });
+
+ // Register buttons
+ ed.addButton('videofilter', {
+ title : 'Video Filter',
+ cmd : 'mceVideoFilter'
+ });
+ },
+
+ getInfo : function() {
+ return {
+ longname : 'Video Filter',
+ author : 'Video Filter',
+ authorurl : 'http://drupal.org/project/video_filter',
+ infourl : 'http://drupal.org/project/video_filter',
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
+ };
+ }
+ });
+
+ // Register plugin
+ tinymce.PluginManager.add('videofilter', tinymce.plugins.VideoFilterPlugin);
+})();
\ No newline at end of file
Binary files video_filter-2x/tinymce/images/movie_track.png and video_filter-2x-if/tinymce/images/movie_track.png differ
diff -u -ruN -x .svn video_filter-2x/tinymce/jscripts/video_filter.js video_filter-2x-if/tinymce/jscripts/video_filter.js
--- video_filter-2x/tinymce/jscripts/video_filter.js 1970-01-01 01:00:00.000000000 +0100
+++ video_filter-2x-if/tinymce/jscripts/video_filter.js 2009-05-27 14:02:35.000000000 +0200
@@ -0,0 +1,21 @@
+function insertVideo() {
+ var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
+ tinyMCEPopup.restoreSelection();
+
+ // Fixes crash in Safari
+ if (tinymce.isWebKit) {
+ ed.getWin().focus();
+ }
+
+ if (nl.file.value === '') {
+ ed.execCommand('mceRepaint');
+ tinyMCEPopup.close();
+ return;
+ }
+ else {
+ ed.execCommand('mceInsertContent', false, '[video:'+nl.file.value+']');
+ ed.undoManager.add();
+ tinyMCEPopup.close();
+ return;
+ }
+}
\ No newline at end of file
diff -u -ruN -x .svn video_filter-2x/tinymce/langs/en_dlg.js video_filter-2x-if/tinymce/langs/en_dlg.js
--- video_filter-2x/tinymce/langs/en_dlg.js 1970-01-01 01:00:00.000000000 +0100
+++ video_filter-2x-if/tinymce/langs/en_dlg.js 2009-05-27 14:02:35.000000000 +0200
@@ -0,0 +1,5 @@
+tinyMCE.addI18n('en.videofilter_dlg', {
+ title: 'Insert Video',
+ desc: 'Add a 3rd party video.',
+ instr: "
Instructions
Paste URL's from the following providers:
YouTube
Accepts URLs like http://www.youtube.com/watch?v=uN1qUeId
Google Video
Accepts URLs like http://video.google.com/videoplay?docid=-uN1qUeId
GodTube
Accepts URLs like http://www.godtube.com/view_video.php?viewkey=uN1qUeId
DailyMotion
Accepts URLs like http://www.dailymotion.com/us/featured/video/x59guz_iron-man-addictive-tv-remix_shortfilms
Eyespot
Accepts URLs like http://eyespot.com/share?cmd=permalink&r=0XCzIG2UEx9hoXiEJW07IWpUtT
Jumpcut
Accepts URLs like http://jumpcut.com/view?id=31410FA4169E11DDB25E000423CF385C
Revver
Accepts URLs like http://revver.com/video/856351/the-next-levelwith-nike/
Vimeo
Accepts URLs like http://www.vimeo.com/319782
"
+});
diff -u -ruN -x .svn video_filter-2x/tinymce/video_filter.css video_filter-2x-if/tinymce/video_filter.css
--- video_filter-2x/tinymce/video_filter.css 1970-01-01 01:00:00.000000000 +0100
+++ video_filter-2x-if/tinymce/video_filter.css 2009-05-27 14:02:35.000000000 +0200
@@ -0,0 +1,15 @@
+.defaultSkin span.mce_videofilter {
+ background-image: url('images/movie_track.png');
+ background-position: center;
+ background-repeat: no-repeat;
+}
+
+#mceVideoPopup #file {
+ width: 97%;
+ padding:5px;
+}
+
+#mceVideoPopup ul {
+ margin:0;
+ padding-left:13px;
+}
\ No newline at end of file
diff -u -ruN -x .svn video_filter-2x/video_filter.codecs.inc video_filter-2x-if/video_filter.codecs.inc
--- video_filter-2x/video_filter.codecs.inc 2009-05-02 12:56:30.000000000 +0200
+++ video_filter-2x-if/video_filter.codecs.inc 2009-05-28 09:09:37.000000000 +0200
@@ -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
+}
diff -u -ruN -x .svn video_filter-2x/video_filter.module video_filter-2x-if/video_filter.module
--- video_filter-2x/video_filter.module 2009-05-02 11:51:15.000000000 +0200
+++ video_filter-2x-if/video_filter.module 2009-05-28 09:03:46.000000000 +0200
@@ -255,4 +255,95 @@
'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',
+ ),
+ );
+ }
+ 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() . drupal_get_path('module', 'wysiwyg');
+ $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 .= ''. 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 = "";
+ foreach ($codecs as $codec) {
+ $output .= '- '.$codec['name'].'
'.$codec['sample_url'].' ';
+ }
+ $output .= '
';
+ return $output;
+}