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

Diff of /Sprout/Sprout.pm

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

revision 1.124, Wed Mar 4 00:09:43 2009 UTC revision 1.125, Mon Mar 16 00:24:23 2009 UTC
# Line 299  Line 299 
299                  $retVal = $superGroup;                  $retVal = $superGroup;
300              }              }
301          }          }
         # Make sure we found something.  
         if (! $retVal) {  
             Confess("No super-group found for \"$groupName\".");  
         }  
302      }      }
303      # Return the result.      # Return the result.
304      return $retVal;      return $retVal;
# Line 726  Line 722 
722          my $searchThingName = "${menuID}_SearchThing";          my $searchThingName = "${menuID}_SearchThing";
723          my $searchThingLabel = "Type to narrow selection";          my $searchThingLabel = "Type to narrow selection";
724          my $searchThingButton = "";          my $searchThingButton = "";
         my $goHint = "";  
725          if ($multiSelect) {          if ($multiSelect) {
726              $searchThingButton = qq(<INPUT type="button" name="MacroSearch" class="button" value="Go" onClick="selectShowing('$menuID', '$searchThingName'); $showSelect;" />);              $searchThingButton = qq(<INPUT type="button" name="MacroSearch" class="button" value="Go" onClick="selectShowing('$menuID', '$searchThingName'); $showSelect;" />);
             $goHint = " Click <strong>Go</strong> to select them.";  
727          }          }
728          push @lines, "<br />$searchThingLabel&nbsp;" .          push @lines, "<br />$searchThingLabel&nbsp;" .
729                       qq(<INPUT type="text" id="$searchThingName" name="$searchThingName" class="genomeSearchThing" onKeyup="showTyped('$menuID', '$searchThingName');" />) .                       qq(<INPUT type="text" id="$searchThingName" name="$searchThingName" class="genomeSearchThing" onKeyup="showTyped('$menuID', '$searchThingName');" />) .
730                       $searchThingButton .                       $searchThingButton .
731                       Hint("GenomeControl", "Type a genome ID or part of an organism name to filter the genomes displayed.$goHint") . "<br />";                       Hint("GenomeControl", 28) . "<br />";
732          # For multi-select mode, we also have buttons to set and clear selections.          # For multi-select mode, we also have buttons to set and clear selections.
733          if ($multiSelect) {          if ($multiSelect) {
734              push @lines, qq(<INPUT type="button" name="ClearAll" class="bigButton genomeButton" value="Clear All" onClick="clearAll(getElementById('$menuID')); $showSelect" />);              push @lines, qq(<INPUT type="button" name="ClearAll" class="bigButton genomeButton" value="Clear All" onClick="clearAll(getElementById('$menuID')); $showSelect" />);
# Line 3985  Line 3979 
3979    
3980  =over 4  =over 4
3981    
3982  =item page  =item specials
3983    
3984  The super-group's web page in the NMPDR.  Reference to a hash whose keys are the names of special species.
3985    
3986  =item contents  =item contents
3987    
# Line 4010  Line 4004 
4004          my @groupLines = Tracer::GetFile("$FIG_Config::sproutData/groups.tbl");          my @groupLines = Tracer::GetFile("$FIG_Config::sproutData/groups.tbl");
4005          # Loop through the list of sort-of groups.          # Loop through the list of sort-of groups.
4006          for my $groupLine (@groupLines) {          for my $groupLine (@groupLines) {
4007              my ($name, $page, @contents) = split /\t/, $groupLine;              my ($name, $specials, @contents) = split /\t/, $groupLine;
4008              $groupHash{$name} = { page => $page,              $groupHash{$name} = { specials => { map { $_ => 1 } split /\s*,\s*/, $specials },
4009                                    contents => [ map { [ split /\s*,\s*/, $_ ] } @contents ]                                    contents => [ map { [ split /\s*,\s*/, $_ ] } @contents ]
4010                                  };                                  };
4011          }          }
# Line 4326  Line 4320 
4320    
4321  =head3 Hint  =head3 Hint
4322    
4323      my $htmlText = SearchHelper::Hint($wikiPage, $hintText);      my $htmlText = Sprout::Hint($wikiPage, $hintID);
4324    
4325  Return the HTML for a small question mark that displays the specified hint text when it is clicked.  Return the HTML for a help link that displays the specified hint text when it is clicked.
4326  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.
4327    
4328  =over 4  =over 4
# Line 4337  Line 4331 
4331    
4332  Name of the wiki page to be popped up when the hint mark is clicked.  Name of the wiki page to be popped up when the hint mark is clicked.
4333    
4334  =item hintText  =item hintID
4335    
4336  Text to display for the hint. It is raw html, but may not contain any double quotes.  ID of the text to display for the hint. This should correspond to a tip number
4337    in the Wiki.
4338    
4339  =item RETURN  =item RETURN
4340    
4341  Returns the html for the hint facility. The resulting html shows a small button-like thing that  Returns the html for the hint facility. The resulting html shows the word "help" and
4342  uses the standard FIG popup technology.  uses the standard FIG popup technology.
4343    
4344  =back  =back
# Line 4352  Line 4347 
4347    
4348  sub Hint {  sub Hint {
4349      # Get the parameters.      # Get the parameters.
4350      my ($wikiPage, $hintText) = @_;      my ($wikiPage, $hintID) = @_;
4351      # Escape the single quotes in the hint text.      # Declare the return variable.
4352      my $quotedText = $hintText;      my $retVal;
     $quotedText =~ s/'/\\'/g;  
4353      # Convert the wiki page name to a URL.      # Convert the wiki page name to a URL.
4354      my $wikiURL = join("", map { ucfirst $_ } split /\s+/, $wikiPage);      my $wikiURL;
4355      $wikiURL = "$FIG_Config::cgi_url/wiki/view.cgi/FIG/$wikiURL";      if ($wikiPage =~ m#/#) {
4356      # Compute the mouseover script.          # Here it's a URL of some sort.
4357      my $mouseOver = "doTooltip(this, '$quotedText')";          $wikiURL = $wikiPage;
4358      # Create the html.      } else {
4359      my $retVal = "&nbsp;<a href=\"$wikiURL\"><img src=\"$FIG_Config::cgi_url/Html/button-h.png\" class=\"helpicon\" onmouseover=\"$mouseOver\"/></a>";          # Here it's a wiki page.
4360      # Return it.          my $page = join("", map { ucfirst $_ } split /\s+/, $wikiPage);
4361            if ($page =~ /^(.+?)\.(.+)$/) {
4362                $page = "$1/$2";
4363            } else {
4364                $page = "FIG/$page";
4365            }
4366            $wikiURL = "$FIG_Config::cgi_url/wiki/view.cgi/$page";
4367        }
4368        # Is there hint text?
4369        if (! $hintID) {
4370            # No. Create a new-page hint.
4371            $retVal = qq(&nbsp;<a class="hint" onclick="doPagePopup(this, '$wikiURL')">(help)</a>);
4372        } else {
4373            # With hint text, we create a popup window hint. We need to compute the hint URL.
4374            my $tipURL = "$FIG_Config::cgi_url/wiki/view.cgi/FIG/TWikiCustomTip" .
4375                Tracer::Pad($hintID, 3, 1, "0");
4376            # Create a hint pop-up link.
4377            $retVal = qq(&nbsp;<a class="hint" onclick="doHintPopup(this, '$wikiURL', '$tipURL')">(help)</a>);
4378        }
4379        # Return the HTML.
4380      return $retVal;      return $retVal;
4381  }  }
4382    

Legend:
Removed from v.1.124  
changed lines
  Added in v.1.125

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3