# 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}=""; # Выводим верхних строк # и нижних строк, @@ -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 (" ", map("$_=$cl->{$_}", grep (!/^(output|diff)$/, sort(keys(%{$cl}))))); - $cline = "".$cl->{"prompt"}."".$cl->{"cline"}; + $cline = "".$cl->{"prompt"}."" + ."{time}."')\" onmouseout=\"myHint.hide()\">".$cl->{"cline"}.""; $cline =~ s/\n//; if ($cl->{"hint"}) { - $cline = "$cline" ; +# $cline = "$cline" ; + $cline = "$cline" ; } else { $cline = "$cline"; } $this_day_result .= "
\n
\n"; - $this_day_result .= "
{time}."')\" onmouseout=\"myHint.hide()\">\n" . $cline ; #cline + $this_day_result .= "
" . $cline ; #cline $this_day_result .= "\n" . "\n" . "\n" if $cl->{"err"}; @@ -773,7 +780,6 @@ $this_day_result .= "screenshot id ".$cl->{"screenshot"}
                 ."" if ( $Config{"show_screenshots"} =~ /^y/i && $cl->{"screenshot"}); @@ -1814,7 +1820,7 @@

LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
- (c) Игорь Чубин, 2004-2006
+ (c) Игорь Чубин, 2004-2008

ABOUT $Html_About.='$Id$

'; 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 "" + echo + echo "" - 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 ()