]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19184 more tinymce integration and upgrade related improvements
authorskodak <skodak>
Sun, 17 May 2009 07:47:04 +0000 (07:47 +0000)
committerskodak <skodak>
Sun, 17 May 2009 07:47:04 +0000 (07:47 +0000)
lib/editor/tinymce/extra/patches/tinymce_plugin_media.patch
lib/editor/tinymce/plugins/media/js/media.js
lib/editor/tinymce/readme_moodle.txt

index 5251ca0cc188d14c5532491bd669d513784c46ce..15e102c3c2bdd30bffac67e5dfab33a0fe12f48c 100644 (file)
@@ -1,54 +1,50 @@
-Index: tinymce/plugins/media/js/media.js
+Index: lib/editor/tinymce/plugins/media/js/media.js
 ===================================================================
 RCS file: /cvsroot/moodle/moodle/lib/editor/tinymce/plugins/media/js/media.js,v
-retrieving revision 1.3
-diff -u -r1.3 media.js
---- tiny_mce/plugins/media/js/media.js 23 Sep 2008 04:10:42 -0000      1.3
-+++ tiny_mce/plugins/media/js/media.js 25 Nov 2008 10:39:39 -0000
-@@ -263,6 +263,11 @@
\r
-               h += ' />';\r
\r
-+        var is_youtube = repo_hook(f.src.value);\r
-+        if (is_youtube) {\r
+retrieving revision 1.1
+diff -u -r1.1 media.js
+--- lib/editor/tinymce/plugins/media/js/media.js    16 May 2009 20:54:41 -0000  1.1
++++ lib/editor/tinymce/plugins/media/js/media.js    17 May 2009 07:44:27 -0000
+@@ -263,6 +263,13 @@
+        h += ' />';
++        var is_youtube = repo_hook(f.src.value);
++        if (is_youtube) {
 +            var re = new RegExp("v\/(.+)\#(.+)", "i");
 +            var result = f.src.value.match(re);
 +            h = '<a href="'+f.src.value+'">'+result[2]+'</a>';
-+        }\r
-+\r
-               ed.execCommand('mceInsertContent', false, h);\r
-       }\r
\r
-@@ -305,12 +310,14 @@
-       fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');\r
\r
-       // YouTube\r
--      if (v.match(/watch\?v=(.+)(.*)/)) {\r
-+    if (v.match(/watch\?v=(.+)(.*)/)) {\r
-               f.width.value = '425';\r
-               f.height.value = '350';\r
--      }\r
-+      } else if (v.match(/v\/(.+)(.*)/)) {\r
-+              f.width.value = '425';\r
-+              f.height.value = '350';\r
-+              return 'flash';\r
-+    }\r
\r
-       // Google video\r
-       if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {\r
-@@ -625,4 +632,15 @@
-       p.innerHTML = "<!-- x --->" + h;\r
- }\r
\r
-+function repo_hook(url){\r
-+      var f = document.forms[0];\r
-+      if (url.match(/v\/(.+)(.*)/)) {\r
-+              f.width.value = '425';\r
-+              f.height.value = '350';\r
-+        return true;\r
-+      } else {\r
-+        return false;\r
-+    }\r
-+}\r
-+\r
- tinyMCEPopup.onInit.add(init);\r
++        }
++
+        ed.execCommand('mceInsertContent', false, h);
+    }
+@@ -310,7 +317,11 @@
+        f.height.value = '350';
+        f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];
+        return 'flash';
+-   }
++   } else if (v.match(/v\/(.+)(.*)/)) {
++       f.width.value = '425';
++       f.height.value = '350';
++       return 'flash';
++    }
+    // Google video
+    if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {
+@@ -627,4 +638,15 @@
+    p.innerHTML = "<!-- x --->" + h;
+ }
++function repo_hook(url){
++   var f = document.forms[0];
++   if (url.match(/v\/(.+)(.*)/)) {
++       f.width.value = '425';
++       f.height.value = '350';
++        return true;
++   } else {
++        return false;
++    }
++}
++
+ tinyMCEPopup.onInit.add(init);
index 86cfa98563d829fed029f6bc164bc4bc6493b0ef..380d073a473d08a0c32443898df416a4bc0da4e9 100644 (file)
@@ -263,6 +263,13 @@ function insertMedia() {
 \r
                h += ' />';\r
 \r
+        var is_youtube = repo_hook(f.src.value);\r
+        if (is_youtube) {\r
+            var re = new RegExp("v\/(.+)\#(.+)", "i");\r
+            var result = f.src.value.match(re);\r
+            h = '<a href="'+f.src.value+'">'+result[2]+'</a>';\r
+        }\r
+\r
                ed.execCommand('mceInsertContent', false, h);\r
        }\r
 \r
@@ -310,7 +317,11 @@ function getType(v) {
                f.height.value = '350';\r
                f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];\r
                return 'flash';\r
-       }\r
+       } else if (v.match(/v\/(.+)(.*)/)) {\r
+               f.width.value = '425';\r
+               f.height.value = '350';\r
+               return 'flash';\r
+    }\r
 \r
        // Google video\r
        if (v.indexOf('http://video.google.com/videoplay?docid=') == 0) {\r
@@ -627,4 +638,15 @@ function generatePreview(c) {
        p.innerHTML = "<!-- x --->" + h;\r
 }\r
 \r
+function repo_hook(url){\r
+       var f = document.forms[0];\r
+       if (url.match(/v\/(.+)(.*)/)) {\r
+               f.width.value = '425';\r
+               f.height.value = '350';\r
+        return true;\r
+       } else {\r
+        return false;\r
+    }\r
+}\r
+\r
 tinyMCEPopup.onInit.add(init);\r
index cf24d02b658e9b361fc70c3bed88f8d792419c75..ce921aa6654b67efee16528e8212ee371f507f9e 100644 (file)
@@ -8,12 +8,14 @@ Upgrade procedure:
  1/ Download latest dev package from http://tinymce.moxiecode.com/download.php
  2/ replace tiny_mce*.* files, themes/*, utils/* and plugins/* (keep dragmath, moodlenolink, spellchecker)
  3/ copy tinymce/jscripts/tiny_mce/classes/Popup.js to Popup.js
- 4/ apply patches
- 5/ compress modified js files using yuicompressor.jar from dev package, use shell file extra/tools/compress.sh
- 6/ download all TinyMCE lang files and update moodle lang string files 
+ 4/ apply plugins/media/* (extra/tinymce_plugin_media.patch) - MDL-16650
+ 5/ apply strings patch
+ 6/ compress modified js files using yuicompressor.jar from dev package, use shell file extra/tools/compress.sh
+ 7/ download all TinyMCE lang files and update moodle lang string files
+ 8/ rebuild string files 
 
 TODO:
- * apply plugins/media/* (extra/tinymce_plugin_media.patch) - MDL-16650
+
  * lang string handling
  * customize spellchecker
  * finish update with info from http://docs.moodle.org/en/Development:TinyMCE_Upgrade