[Bio] / Sprout / SearchHelper.pm Repository:
ViewVC logotype

Diff of /Sprout/SearchHelper.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36, Wed Jul 25 16:21:21 2007 UTC revision 1.37, Mon Aug 20 23:22:42 2007 UTC
# Line 468  Line 468 
468                                -override => 1) .                                -override => 1) .
469                   $cgi->hidden(-name => 'SPROUT',                   $cgi->hidden(-name => 'SPROUT',
470                                -value => 1) .                                -value => 1) .
471                   $cgi->h3($title);                   $cgi->h3("$title" . Hint($self->{class}, "Click here for more information."));
     # If tracing is on, add it to the form.  
     if ($cgi->param('Trace')) {  
         $retVal .= $cgi->hidden(-name => 'Trace',  
                                 -value => $cgi->param('Trace')) .  
                    $cgi->hidden(-name => 'TF',  
                                 -value => ($cgi->param('TF') ? 1 : 0));  
     }  
472      # Put in an anchor tag in case there's a table of contents.      # Put in an anchor tag in case there's a table of contents.
473      my $anchorName = $self->FormName();      my $anchorName = $self->FormName();
474      $retVal .= "<a name=\"$anchorName\"></a>\n";      $retVal .= "<a name=\"$anchorName\"></a>\n";
# Line 1333  Line 1326 
1326          my $searchThingName = "${menuName}_SearchThing";          my $searchThingName = "${menuName}_SearchThing";
1327          push @lines, "<br />" .          push @lines, "<br />" .
1328                       "<INPUT type=\"button\" name=\"MacroSearch\" class=\"button\" value=\"Select genomes containing\" onClick=\"selectViaSearch($menuName, $searchThingName); $showSelect\" />&nbsp;" .                       "<INPUT type=\"button\" name=\"MacroSearch\" class=\"button\" value=\"Select genomes containing\" onClick=\"selectViaSearch($menuName, $searchThingName); $showSelect\" />&nbsp;" .
1329                       "<INPUT type=\"text\" name=\"$searchThingName\" size=\"30\" />" . Hint("Enter a genome number, then click the button to the left " .                       "<INPUT type=\"text\" name=\"$searchThingName\" size=\"30\" />" . Hint("Genome Control",
1330                                                                                                "Enter a genome number, then click the button to the left " .
1331                                                                                              "in order to select the genome with that number. " .                                                                                              "in order to select the genome with that number. " .
1332                                                                                              "Enter a genus, species, or strain and click the " .                                                                                              "Enter a genus, species, or strain and click the " .
1333                                                                                              "button to select all genomes with that genus, species, " .                                                                                              "button to select all genomes with that genus, species, " .
# Line 1343  Line 1337 
1337          push @lines, "<INPUT type=\"button\" name=\"ClearAll\" class=\"bigButton\"  value=\"Clear All\" onClick=\"clearAll($menuName); $showSelect\" />";          push @lines, "<INPUT type=\"button\" name=\"ClearAll\" class=\"bigButton\"  value=\"Clear All\" onClick=\"clearAll($menuName); $showSelect\" />";
1338          push @lines, "<INPUT type=\"button\" name=\"SelectAll\" class=\"bigButton\" value=\"Select All\" onClick=\"selectAll($menuName); $showSelect\" />";          push @lines, "<INPUT type=\"button\" name=\"SelectAll\" class=\"bigButton\" value=\"Select All\" onClick=\"selectAll($menuName); $showSelect\" />";
1339          push @lines, "<INPUT type=\"button\" name=\"NMPDROnly\" class=\"bigButton\"  value=\"Select NMPDR\" onClick=\"selectSome($menuName, $nmpdrCount, true); $showSelect\" />";          push @lines, "<INPUT type=\"button\" name=\"NMPDROnly\" class=\"bigButton\"  value=\"Select NMPDR\" onClick=\"selectSome($menuName, $nmpdrCount, true); $showSelect\" />";
1340          push @lines, "<INPUT type=\"button\" name=\"OtherOnly\" class=\"bigButton\" value=\"Select Supporting\" onClick=\"selectSome($menuName, $nmpdrCount, false); $showSelect\" />";          # push @lines, "<INPUT type=\"button\" name=\"OtherOnly\" class=\"bigButton\" value=\"Select Supporting\" onClick=\"selectSome($menuName, $nmpdrCount, false); $showSelect\" />";
1341          # Add the status display, too.          # Add the status display, too.
1342          push @lines, "<DIV id=\"$divID\" class=\"selectStatus\"></DIV>";          push @lines, "<DIV id=\"$divID\" class=\"selectStatus\"></DIV>";
1343          # Queue to update the status display when the form loads. We need to modify the show statement          # Queue to update the status display when the form loads. We need to modify the show statement
# Line 1509  Line 1503 
1503      # Get the current feature ID type.      # Get the current feature ID type.
1504      my $aliasType = $self->GetPreferredAliasType();      my $aliasType = $self->GetPreferredAliasType();
1505      # Create the rows.      # Create the rows.
1506      my $retVal = $cgi->Tr($cgi->td("ID Type"), $cgi->td({ colspan => 2 },      my $retVal = $cgi->Tr($cgi->td("Identifier Type "),
1507                              $cgi->td({ colspan => 2 },
1508                                                          $cgi->popup_menu(-name => 'AliasType',                                                          $cgi->popup_menu(-name => 'AliasType',
1509                                                                           -values => ['FIG', AliasAnalysis::AliasTypes() ],                                                                           -values => ['FIG', AliasAnalysis::AliasTypes() ],
1510                                                                           -default => $aliasType) .                                                                           -default => $aliasType) .
1511                                                          Hint("Specify how you want gene names to be displayed."))) .                                     Hint("Identifier type", "Specify how you want gene names to be displayed."))) .
1512                   "\n" .                   "\n" .
1513                   $cgi->Tr($cgi->td("Results/Page"),                   $cgi->Tr($cgi->td("Results/Page"),
1514                            $cgi->td($cgi->popup_menu(-name => 'PageSize',                            $cgi->td($cgi->popup_menu(-name => 'PageSize',
# Line 2459  Line 2454 
2454    
2455  =head3 Hint  =head3 Hint
2456    
2457  C<< my $htmlText = SearchHelper::Hint($hintText); >>  C<< my $htmlText = SearchHelper::Hint($wikiPage, $hintText); >>
2458    
2459  Return the HTML for a small question mark that displays the specified hint text when it is clicked.  Return the HTML for a small question mark that displays the specified hint text when it is clicked.
2460  This HTML can be put in forms to provide a useful hinting mechanism.  This HTML can be put in forms to provide a useful hinting mechanism.
2461    
2462  =over 4  =over 4
2463    
2464    =item wikiPage
2465    
2466    Name of the wiki page to be popped up when the hint maek is clicked.
2467    
2468  =item hintText  =item hintText
2469    
2470  Text to display for the hint. It is raw html, but may not contain any double quotes.  Text to display for the hint. It is raw html, but may not contain any double quotes.
# Line 2481  Line 2480 
2480    
2481  sub Hint {  sub Hint {
2482      # Get the parameters.      # Get the parameters.
2483      my ($hintText) = @_;      my ($wikiPage, $hintText) = @_;
2484      # Escape the single quotes.      # Escape the single quotes in the hint text.
2485      my $quotedText = $hintText;      my $quotedText = $hintText;
2486      $quotedText =~ s/'/\\'/g;      $quotedText =~ s/'/\\'/g;
2487        # Convert the wiki page name to a URL.
2488        my $wikiURL = ucfirst $wikiPage;
2489        $wikiURL =~ s/ /_/g;
2490        $wikiURL = "../wiki/index.php/$wikiURL";
2491      # Create the html.      # Create the html.
2492      my $retVal = "&nbsp;<input type=\"button\" class=\"hintbutton\" onMouseOver=\"javascript:if (!this.tooltip) { " .      my $retVal = "&nbsp;<input type=\"button\" class=\"hintbutton\" onMouseOver=\"javascript:if (!this.tooltip) { " .
2493                   "this.tooltip = new Popup_Tooltip(this, 'Search Hint', '$quotedText', '', 1); this.tooltip.addHandler(); } " .                   "this.tooltip = new Popup_Tooltip(this, 'Search Hint', '$quotedText', '', 1); this.tooltip.addHandler(); } " .
2494                   "return false;\" value=\"?\" />";                   "return false;\" value=\"?\" onClick=\"javascript:window.open('$wikiURL', 'nmpdrHelp');\" />";
2495      # Return it.      # Return it.
2496      return $retVal;      return $retVal;
2497  }  }

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3