Changeset 4838


Ignore:
Timestamp:
Mar 24, 2009, 1:10:48 PM (13 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1242: Generate <img> tag for spot images with a class attribute

All spot images now have <img class="spotimage" ...>

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/formatter/SpotImageFormatter.java

    r4512 r4838  
    4343  private final String ID;
    4444  private final String root;
     45  public String imgClass = "spotimage";
    4546 
    4647  public SpotImageFormatter(DbControl dc, RawDataType rawDataType, String root)
     
    5051    this.root = root;
    5152    this.ID = dc.getSessionControl().getId();
     53  }
     54 
     55  /**
     56    Sets the class attribute for the generated &lt;img&gt; tag
     57    that displays the spot image. The default value
     58    is "spotimage".
     59    @since 2.11
     60  */
     61  public void setImgClass(String imgClass)
     62  {
     63    this.imgClass = imgClass;
    5264  }
    5365 
     
    6476    if (rawBioAssay.hasSpotImages())
    6577    {
    66       sb.append("<img src=\"").append(root).append("/views/rawbioassays/rawdata/spotimage/");
     78      sb.append("<img");
     79      if (imgClass != null) sb.append(" class=\"").append(imgClass).append("\"");
     80      sb.append(" src=\"").append(root).append("/views/rawbioassays/rawdata/spotimage/");
    6781      sb.append(ID).append("/").append(rawBioAssay.getId()).append("/");
    6882      sb.append(rawData.getId()).append("/spot").append(rawData.getPosition()).append(".png");
  • trunk/www/views/rawbioassays/rawdata/list_rawdata.jsp

    r4746 r4838  
    700700                  {
    701701                    %>
    702                     <img src="spotimage/<%=ID%>/<%=rawBioAssay.getId()%>/<%=itemId%>/spot<%=item.getPosition()%>.png">
     702                    <img class="spotimage" src="spotimage/<%=ID%>/<%=rawBioAssay.getId()%>/<%=itemId%>/spot<%=item.getPosition()%>.png">
    703703                    <%
    704704                  }
  • trunk/www/views/rawbioassays/rawdata/view_rawdata.jsp

    r4511 r4838  
    169169            {
    170170              %>
    171               <img src="spotimage/<%=ID%>/<%=rawBioAssay.getId()%>/<%=itemId%>/spot<%=rawData.getPosition()%>.png">
     171              <img class="spotimage" src="spotimage/<%=ID%>/<%=rawBioAssay.getId()%>/<%=itemId%>/spot<%=rawData.getPosition()%>.png">
    172172              <%
    173173            }
Note: See TracChangeset for help on using the changeset viewer.