# HG changeset patch
# User igor
# Date 1203162108 -7200
# Node ID 99ea38e538c9c91807de02ec034c1365bb450464
# Parent  2fc1f3f08760f7fa3132f86ab2ebfa61935455d6
Добавил:
 * l3upload

Исправил:
 * хинт теперь всплывает только при наведении непосредственно на команду
   (а не на приглашение и не на символ кода завершения)
 * подсветка неизвестных команд не такая сильная

diff -r 2fc1f3f08760 -r 99ea38e538c9 l3-frontend
--- a/l3-frontend	Wed Feb 13 02:43:33 2008 +0200
+++ b/l3-frontend	Sat Feb 16 13:41:48 2008 +0200
@@ -425,7 +425,7 @@
         }
         $tigra_hints{$$cl->{"time"}} = $hint;
 
-        $$cl->{hint}="";
+        #$$cl->{hint}="";
 
 # Выводим <head_lines> верхних строк
 # и <tail_lines> нижних строк,
@@ -466,6 +466,11 @@
 
         if ($$cl->{cline} =~ /l3shot/) {
                 if ($$cl->{output} =~ m@Screenshot is written to.*/(.*)\.xwd@) {
+                    $$cl->{screenshot}="$1".$Config{l3shot_suffix};
+                }
+        }
+        if ($$cl->{cline} =~ /l3upload/) {
+                if ($$cl->{output} =~ m@Uploaded file name is (.*)@) {
                     $$cl->{screenshot}="$1";
                 }
         }
@@ -739,18 +744,20 @@
 # COMMAND
         my $cline;
         $prompt_hint = join ("&#10;", map("$_=$cl->{$_}", grep (!/^(output|diff)$/, sort(keys(%{$cl})))));
-        $cline = "<span title='$prompt_hint'>".$cl->{"prompt"}."</span>".$cl->{"cline"};
+        $cline = "<span title='$prompt_hint'>".$cl->{"prompt"}."</span>"
+                ."<span onmouseover=\"myHint.show('".$cl->{time}."')\" onmouseout=\"myHint.hide()\">".$cl->{"cline"}."</span>";
         $cline =~ s/\n//;
 
         if ($cl->{"hint"}) {
-            $cline = "<span title='$cl->{hint}' class='with_hint'>$cline</span>" ;
+#            $cline = "<span title='$cl->{hint}' class='with_hint'>$cline</span>" ;
+            $cline = "<span class='with_hint'>$cline</span>" ;
         } 
         else {
             $cline = "<span class='without_hint'>$cline</span>";
         }
 
         $this_day_result .= "<DIV class='fixed_div'><table cellpadding='0' cellspacing='0'><tr><td>\n<div class='cblock_$cl->{class}'>\n";
-        $this_day_result .= "<div class='cline' onmouseover=\"myHint.show('".$cl->{time}."')\" onmouseout=\"myHint.hide()\">\n" . $cline ;      #cline
+        $this_day_result .= "<div class='cline'>" . $cline ;      #cline
         $this_day_result .= "<span title='Код завершения ".$cl->{"err"}."'>\n"
                          .  "<img src='".$Config{frontend_ico_path}."/error.png'/>\n"
                          .  "</span>\n" if $cl->{"err"};
@@ -773,7 +780,6 @@
         $this_day_result .= "<img src='"
                 .$Config{l3shot_path}
                 .$cl->{"screenshot"}
-                .$Config{l3shot_suffix}
                 ."' alt ='screenshot id ".$cl->{"screenshot"}
                 ."'/>"
             if ( $Config{"show_screenshots"} =~ /^y/i && $cl->{"screenshot"});
@@ -1814,7 +1820,7 @@
     <p>
     <a href='http://xgu.ru/lilalo/'>LiLaLo</a> (L3) расшифровывается как Live Lab Log.<br/>
     Программа разработана для повышения эффективности обучения Unix/Linux-системам.<br/>
-    (c) Игорь Чубин, 2004-2006<br/>
+    (c) Игорь Чубин, 2004-2008<br/>
     </p>
 ABOUT
 $Html_About.='$Id$ </p>';
diff -r 2fc1f3f08760 -r 99ea38e538c9 l3bashrc
--- a/l3bashrc	Wed Feb 13 02:43:33 2008 +0200
+++ b/l3bashrc	Sat Feb 16 13:41:48 2008 +0200
@@ -188,10 +188,8 @@
         echo -n Choose window to be shoot ... >&2
         [ -d ${_l3_home} ] || mkdir -p ${_l3_home}
         xwd -out "$_l3_home/$shot_name" \
-        && echo  Ok\
-        && echo Shot was successful. \
         && echo Screenshot is written to ${_l3_home}/${shot_name} \
-        && echo Screenshot will appears in the lablog.
+        && curl -s -F photo=@$_l3_home/$shot_name http://xgu.ru/l3-upload
     else
         {
             echo
@@ -205,10 +203,35 @@
     fi
 }
 
+l3upload()
+{
+    if [ $# -lt 1 ]
+    then
+        echo Usage:
+        echo 
+        echo    l3upload "<filename>"
+        echo
+        echo "<filename>" - name of the file to upload
+        return 1
+    else
+        source=$1 
+        target="${L3_SESSION_ID}_`date +%s`"_"$(echo $source|sed s@.*/@@)"
+        if echo $source | grep -q http://
+        then
+            curl -s "$source" > /tmp/$target 
+        else 
+            [ -r "$source" ] || { echo "l3upload: Can't open $source for reading" > /dev/stderr; return 1; }
+            cp $source /tmp/$target
+        fi
+        echo Uploaded file name is ${target}
+        curl -s -F photo=@/tmp/$target http://xgu.ru/l3-upload && rm -f /tmp/$target
+    fi
+}
+
 # Append lines from "$@" files to the end of the shell history
-hist_append () 
-{ 
-    eval $(cat "$@" | sed 's/"/\\\\"/g' | while read line; do echo history -s \"$line\"\;; done); 
+hist_append ()
+{
+    eval $(cat "$@" | sed 's/"/\\\\"/g' | while read line; do echo history -s \"$line\"\;; done);
 }
 
 l3_save_last_line ()