From: Luis M <rea...@us...> - 2006-03-29 22:48:30
|
Update of /cvsroot/sashimi/tpp_gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31213 Modified Files: tpp_gui.pl Log Message: Now you can watch a whirlygif while waiting!; Use of an extra html class when command output unseen; Some code clean-up, including a hopefully cleaner way to set up navigation tabs. Index: tpp_gui.pl =================================================================== RCS file: /cvsroot/sashimi/tpp_gui/tpp_gui.pl,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tpp_gui.pl 24 Mar 2006 22:08:20 -0000 1.23 --- tpp_gui.pl 29 Mar 2006 22:48:25 -0000 1.24 *************** *** 1637,1662 **** print header(); ! # clean this up once it's all working smoooothly FIXME ! if ($command_status ne 'none') { ! print start_html(-title=>"SPCTools UI 2.0dev: $title", ! -author=>'Institute for Systems Biology', ! -encoding=>'UTF-8', ! -dtd=>'HTML 4.0 Transitional', ! -style=>'./tpp_gui.css', ! -bgcolor=>"#c0c0c0", ! -onLoad=>"getStatus()" ! ); - } else { - print start_html(-title=>"SPCTools UI 2.0dev: $title", - -author=>'Institute for Systems Biology', - -encoding=>'UTF-8', - -dtd=>'HTML 4.0 Transitional', - -style=>'./tpp_gui.css', - -bgcolor=>"#c0c0c0", #1d3887", #c0c0c0", ! ); ! } print <<"EOSCRIPT"; --- 1637,1654 ---- print header(); ! my $onLoad = ($command_status eq 'none') ? "" : 'getStatus()'; ! ! print start_html(-title=>"SPCTools UI 2.0dev: $title", ! -author=>'Institute for Systems Biology', ! -encoding=>'UTF-8', ! -dtd=>'HTML 4.0 Transitional', ! -style=>'./tpp_gui.css', ! -bgcolor=>"#c0c0c0", ! -onLoad=>"$onLoad" ! ); #1d3887", #c0c0c0", ! print <<"EOSCRIPT"; *************** *** 1769,1775 **** linktext = "Click <a href=\\"$tpp_url?Action=$web_actions{'showpage'}&page=" + rpage + "\\"> here </a> to view log file and output files"; if (updateClass == 'true') { ! document.getElementById('cmdstatus').className = "cmddone"; } ! document.getElementById('cmdstatus_head').className = "cmddonehead"; tt = 'stop'; } else if (rstat == 'running') { --- 1761,1767 ---- linktext = "Click <a href=\\"$tpp_url?Action=$web_actions{'showpage'}&page=" + rpage + "\\"> here </a> to view log file and output files"; if (updateClass == 'true') { ! document.getElementById('cmdstatus').className = "messages"; } ! document.getElementById('cmdstatus_head').className = "messageshead"; tt = 'stop'; } else if (rstat == 'running') { *************** *** 1784,1790 **** linktext = "View <a href=\\"$tpp_url?Action=$web_actions{'showpage'}&page=" + rpage + "\\"> results </a> of previous commands."; if (updateClass == 'true') { ! document.getElementById('cmdstatus').className = "cmddone"; } ! document.getElementById('cmdstatus_head').className = "cmddonehead"; tt = 'stop'; } else if (rstat == 'none') { --- 1776,1782 ---- linktext = "View <a href=\\"$tpp_url?Action=$web_actions{'showpage'}&page=" + rpage + "\\"> results </a> of previous commands."; if (updateClass == 'true') { ! document.getElementById('cmdstatus').className = "cmdready"; } ! document.getElementById('cmdstatus_head').className = "cmdreadyhead"; tt = 'stop'; } else if (rstat == 'none') { *************** *** 1797,1801 **** } ! htmlstat = "<ul>"; htmlstat += "<li>Status as of: " + rdate + "</li>"; if (stattext) { --- 1789,1797 ---- } ! htmlstat = ""; ! if (rstat == 'running') { ! htmlstat += "<img align=\\"right\\" src=\\"images/logo_anim.gif\\">"; ! } ! htmlstat += "<ul>"; htmlstat += "<li>Status as of: " + rdate + "</li>"; if (stattext) { *************** *** 1840,1914 **** "</div>\n"; ! #navigation ! my $tHnav = ($page eq "home") ? "navselected" : "nav"; ! my $tZnav = ($page eq "mzxml") ? "navselected" : "nav"; ! my $tSnav = ($page eq "runsearch") ? "navselected" : "nav"; ! my $tCnav = ($page eq "converters") ? "navselected" : "nav"; ! my $tXnav = ($page eq "xinteract") ? "navselected" : "nav"; ! my $tPnav = ($page eq "runprophet") ? "navselected" : "nav"; ! my $tAnav = ($page eq "account") ? "navselected" : "nav"; ! my $tBnav = ($page eq "filebrowser") ? "navselected" : "nav"; ! my $tMnav = ($page eq "mzxml2other") ? "navselected" : "nav"; ! my $THnav = ("$tHnav" =~ /selected/ ) ? "black" : "gray"; ! my $TPnav = ("$tZnav.$tSnav.$tCnav.$tXnav.$tPnav" =~ /selected/ ) ? "black" : "gray"; ! my $TAnav = ("$tAnav" =~ /selected/ ) ? "black" : "gray"; ! my $TTnav = ("$tBnav.$tMnav" =~ /selected/ ) ? "black" : "gray"; ! print << "EONAV"; ! <a class="$THnav" href="$tpp_url?Action=$web_actions{'showpage'}&page=home">Home</a> | ! <a class="$TAnav" href="$tpp_url?Action=$web_actions{'showpage'}&page=account">Account</a> | ! <a class="$TPnav" href="$tpp_url?Action=$web_actions{'showpage'}&page=mzxml">Analysis Pipeline ($pipeline)</a> | ! <a class="$TTnav" href="$tpp_url?Action=$web_actions{'showpage'}&page=filebrowser">Tools</a> ! <br><br> <table cellspacing="0" cellpadding="0" width="100%"> <tr><td> <table cellpadding="3" cellspacing="0"> <tr> - <td class=$tHnav><a href="$tpp_url?Action=$web_actions{'showpage'}&page=home"> Home </a></td> - - EONAV - - if ($TPnav eq 'black') { - print << "EONAV"; - <td class=$tZnav><a href="$tpp_url?Action=$web_actions{'showpage'}&page=mzxml"> mzXML </a></td> - EONAV - if ($pipeline eq 'Sequest') { - print << "EORUNSEARCH"; - <td class=$tSnav><a href="$tpp_url?Action=$web_actions{'showpage'}&page=runsearch"> Database Search </a></td> - EORUNSEARCH - } - print << "EONAV"; - <td class=$tCnav><a href="$tpp_url?Action=$web_actions{'showpage'}&page=converters"> pepXML </a></td> - <td class=$tXnav><a href="$tpp_url?Action=$web_actions{'showpage'}&page=xinteract"> Analyze Peptides </a></td> - <td class=$tPnav><a href="$tpp_url?Action=$web_actions{'showpage'}&page=runprophet"> Analyze Proteins </a></td> EONAV ! } elsif ($TAnav eq 'black') { ! print << "EONAV"; ! <td class=$tAnav><a href="$tpp_url?Action=$web_actions{'showpage'}&page=account"> Manage My Account </a></td> ! EONAV ! ! } elsif ($TTnav eq 'black') { ! print << "EONAV"; ! <td class=$tBnav><a href="$tpp_url?Action=$web_actions{'showpage'}&page=filebrowser"> Browse Files </a></td> ! <td class=$tMnav><a href="$tpp_url?Action=$web_actions{'showpage'}&page=mzxml2other"> Convert mzXML Files </a></td> ! EONAV ! ! } elsif ($THnav eq 'black') { ! print << "EONAV"; ! <td class="nav"><a href="$tpp_url?Action=$web_actions{'showpage'}&page=account"> ACCOUNT </a></td> ! <td class="nav"><a href="$tpp_url?Action=$web_actions{'showpage'}&page=mzxml"> ANALYSIS PIPELINE </a></td> ! <td class="nav"><a href="$tpp_url?Action=$web_actions{'showpage'}&page=filebrowser"> TOOLS </a></td> ! EONAV } - - print "</tr></table>", --- 1836,1909 ---- "</div>\n"; ! #navigation ## still have to deal with 'wait' and 'results' pages... FIXME ! my $page_list = ""; ! my @sections = ( ! { name => 'Home', pages=> 'account,mzxml,filebrowser'}, ! { name => 'Account', pages=> 'account'}, ! { name => 'Analysis Pipeline', pages=> 'mzxml,runsearch,converters,xinteract,runprophet'}, ! { name => 'Tools', pages=> 'filebrowser,mzxml2other'} ! ); ! if ($pipeline eq 'Mascot') { ! $sections[2] = { name => 'Analysis Pipeline', pages=> 'mzxml,converters,xinteract,runprophet'}; ! } ! my %tabs = ( ! home => 'Home', ! account => 'Manage My Account', ! mzxml => 'mzXML', ! runsearch => 'Database Search', ! converters => 'pepXML', ! xinteract => 'Analyze Peptides', ! runprophet => 'Analyze Proteins', ! filebrowser=> 'Browse Files', ! mzxml2other=> 'Convert mzXML Files' ! ); ! if ($page eq 'home') { #special case... ! $tabs{account} = 'ACCOUNT'; ! $tabs{mzxml} = 'ANALYSIS PIPELINE'; ! $tabs{filebrowser} = 'TOOLS'; ! } ! foreach my $section (@sections) { ! my $html_class = ( $section->{pages} =~ /\b$page\b/ ) ? 'black' : 'gray'; ! my $link_to = (split /,/, $section->{pages})[0]; ! my $sect_name = $section->{name}; ! $sect_name .= " ($pipeline)" if ($sect_name eq "Analysis Pipeline"); ! if ($sect_name eq 'Home') { #special case... ! $html_class = ($page eq 'home') ? 'black' : 'gray'; ! $link_to = 'home'; ! } else { ! print ' | '; # separator ! } ! $page_list = $section->{pages} if ($html_class eq 'black'); ! print ! a({-href => "$tpp_url?Action=$web_actions{'showpage'}&page=$link_to", ! -class=> "$html_class"}, ! $sect_name ! ); ! } ! print br,br; + print << "EONAV"; <table cellspacing="0" cellpadding="0" width="100%"> <tr><td> <table cellpadding="3" cellspacing="0"> <tr> EONAV ! foreach my $tab (split /,/, "home,$page_list") { ! my $html_class = ($page eq $tab) ? "navselected" : "nav"; + print + "<td class=$html_class>", + a({-href => "$tpp_url?Action=$web_actions{'showpage'}&page=$tab"}, + " $tabs{$tab} " + ), + "</td>"; } print "</tr></table>", *************** *** 1916,1920 **** "<td align=right>"; ! # ADD THIS LATER. # if ($command_status eq 'running') { # my $a_title = "Your commands are still running. Click here to view output so far."; --- 1911,1915 ---- "<td align=right>"; ! # ADD THIS LATER? # if ($command_status eq 'running') { # my $a_title = "Your commands are still running. Click here to view output so far."; *************** *** 1953,1961 **** # div for command status display if ($command_status ne 'none') { ! my $div_class = ($command_status eq 'running') ? 'cmdrun' : 'cmddone'; print &printTitle(' Command Status ',$div_class.'head','cmdstatus',$div_class), ! "<div id=cmdstatus class=$div_class>\n", " -- checking ... --", "</div>", --- 1948,1957 ---- # div for command status display if ($command_status ne 'none') { ! my $div_class = ($command_status eq 'running') ? 'cmdrun' : 'messages'; print &printTitle(' Command Status ',$div_class.'head','cmdstatus',$div_class), ! # "<div id=cmdstatus class=$div_class>\n", ! "<div id=cmdstatus class=hideit>\n", " -- checking ... --", "</div>", *************** *** 1967,1972 **** if (@messages) { print ! &printTitle(' Messages ','msghead'), ! "<div class=messages>\n<ul>"; for my $msg (@messages) { if ($msg =~ /DIALOG:\[(.+)\]\[(.+)\]/) { --- 1963,1968 ---- if (@messages) { print ! &printTitle(' Messages ','messageshead','messages'), ! "<div id=messages class=messages>\n<ul>"; for my $msg (@messages) { if ($msg =~ /DIALOG:\[(.+)\]\[(.+)\]/) { *************** *** 2995,2999 **** if (! -f $cmd_file) { print ! &printTitle(' Cannot Open File ','msghead'), "<div class=messages>\n<ul>", "<li>File not found: $cmd_file</li>\n", --- 2991,2995 ---- if (! -f $cmd_file) { print ! &printTitle(' Cannot Open File ','messageshead'), "<div class=messages>\n<ul>", "<li>File not found: $cmd_file</li>\n", *************** *** 3155,3159 **** if (! -f $filepath) { print ! &printTitle(' Cannot Open File ','msghead'), "<div class=messages>\n<ul>", "<li>File not found: $filepath</li>\n", --- 3151,3155 ---- if (! -f $filepath) { print ! &printTitle(' Cannot Open File ','messageshead'), "<div class=messages>\n<ul>", "<li>File not found: $filepath</li>\n", *************** *** 3162,3166 **** } elsif (! -T $filepath) { print ! &printTitle(' Cannot Open File ','msghead'), "<div class=messages>\n<ul>", "<li>Cannot open binary file: $filepath Sorry!</li>\n", --- 3158,3162 ---- } elsif (! -T $filepath) { print ! &printTitle(' Cannot Open File ','messageshead'), "<div class=messages>\n<ul>", "<li>Cannot open binary file: $filepath Sorry!</li>\n", *************** *** 3586,3590 **** # returns xml response to specific AJAX queries # ! # All xml documents have the following structure: # <response> # <date></date> --- 3582,3586 ---- # returns xml response to specific AJAX queries # ! # All xml response documents have the following structure: # <response> # <date></date> |