[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Thu Dec 19 19:08:23 EST 2013


raeburn		Fri Dec 20 00:08:23 2013 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - Extraction of contents of archive files (zip, tar etc.) from a file
    - Option to process contents automatically for Camtasia zip files now
      supported for conten packaging used in Camtasia 8, as well as (different) 
      packaging used in older Camtasia versions.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1163 loncom/interface/loncommon.pm:1.1164
--- loncom/interface/loncommon.pm:1.1163	Wed Dec 18 01:32:16 2013
+++ loncom/interface/loncommon.pm	Fri Dec 20 00:08:22 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1163 2013/12/18 01:32:16 raeburn Exp $
+# $Id: loncommon.pm,v 1.1164 2013/12/20 00:08:22 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -11005,16 +11005,43 @@
         }
     }
     if ($mimetype =~ m{^application/(x\-)?(compressed|zip)}) {
-        my @camtasia = ("$topdir/","$topdir/index.html",
+        my @camtasia6 = ("$topdir/","$topdir/index.html",
                         "$topdir/media/",
                         "$topdir/media/$topdir.mp4",
                         "$topdir/media/FirstFrame.png",
                         "$topdir/media/player.swf",
                         "$topdir/media/swfobject.js",
                         "$topdir/media/expressInstall.swf");
-        my @diffs = &compare_arrays(\@paths,\@camtasia);
+        my @camtasia8 = ("$topdir/","$topdir/$topdir.html",
+                         "$topdir/$topdir.mp4",
+                         "$topdir/$topdir\_config.xml",
+                         "$topdir/$topdir\_controller.swf",
+                         "$topdir/$topdir\_embed.css",
+                         "$topdir/$topdir\_First_Frame.png",
+                         "$topdir/$topdir\_player.html",
+                         "$topdir/$topdir\_Thumbnails.png",
+                         "$topdir/playerProductInstall.swf",
+                         "$topdir/scripts/",
+                         "$topdir/scripts/config_xml.js",
+                         "$topdir/scripts/handlebars.js",
+                         "$topdir/scripts/jquery-1.7.1.min.js",
+                         "$topdir/scripts/jquery-ui-1.8.15.custom.min.js",
+                         "$topdir/scripts/modernizr.js",
+                         "$topdir/scripts/player-min.js",
+                         "$topdir/scripts/swfobject.js",
+                         "$topdir/skins/",
+                         "$topdir/skins/configuration_express.xml",
+                         "$topdir/skins/express_show/",
+                         "$topdir/skins/express_show/player-min.css",
+                         "$topdir/skins/express_show/spritesheet.png");
+        my @diffs = &compare_arrays(\@paths,\@camtasia6);
         if (@diffs == 0) {
-            $is_camtasia = 1;
+            $is_camtasia = 6;
+        } else {
+            @diffs = &compare_arrays(\@paths,\@camtasia8);
+            if (@diffs == 0) {
+                $is_camtasia = 8;
+            }
         }
     }
     my $output;
@@ -11026,7 +11053,7 @@
 function camtasiaToggle() {
     for (var i=0; i<document.uploaded_decompress.autoextract_camtasia.length; i++) {
         if (document.uploaded_decompress.autoextract_camtasia[i].checked) {
-            if (document.uploaded_decompress.autoextract_camtasia[i].value == 1) {
+            if (document.uploaded_decompress.autoextract_camtasia[i].value == $is_camtasia) {
 
                 document.getElementById('camtasia_titles').style.display='block';
             } else {
@@ -11089,7 +11116,7 @@
     if ($is_camtasia) {
         $output .= $lt{'auto'}.'<br />'.
                    '<span class="LC_nobreak">'.$lt{'proa'}.'<label>'.
-                   '<input type="radio" name="autoextract_camtasia" value="1" onclick="javascript:camtasiaToggle();" checked="checked" />'.
+                   '<input type="radio" name="autoextract_camtasia" value="'.$is_camtasia.'" onclick="javascript:camtasiaToggle();" checked="checked" />'.
                    $lt{'yes'}.'</label> <label>'.
                    '<input type="radio" name="autoextract_camtasia" value="0" onclick="javascript:camtasiaToggle();" />'.
                    $lt{'no'}.'</label></span><br />'.
@@ -11322,6 +11349,7 @@
                                                            \%titles,\%children);
                         }
                         if ($env{'form.autoextract_camtasia'}) {
+                            my $version = $env{'form.autoextract_camtasia'};
                             my %displayed;
                             my $total = 1;
                             $env{'form.archive_directory'} = [];
@@ -11340,12 +11368,15 @@
                                     $env{'form.archive_'.$i} = 'display';
                                     $env{'form.archive_title_'.$i} = $env{'form.camtasia_foldername'};
                                     $displayed{'folder'} = $i;
-                                } elsif ($item eq "$contents[0]/index.html") {
+                                } elsif ((($item eq "$contents[0]/index.html") && ($version == 6)) ||
+                                         (($item eq "$contents[0]/$contents[0]".'.html') && ($version == 8))) { 
                                     $env{'form.archive_'.$i} = 'display';
                                     $env{'form.archive_title_'.$i} = $env{'form.camtasia_moviename'};
                                     $displayed{'web'} = $i;
                                 } else {
-                                    if ($item eq "$contents[0]/media") {
+                                    if ((($item eq "$contents[0]/media") && ($version == 6)) ||
+                                        ((($item eq "$contents[0]/scripts") || ($item eq "$contents[0]/skins") ||
+                                             ($item eq "$contents[0]/skins/express_show")) && ($version == 8))) {
                                         push(@{$env{'form.archive_directory'}},$i);
                                     }
                                     $env{'form.archive_'.$i} = 'dependency';




More information about the LON-CAPA-cvs mailing list