Changeset 1927


Ignore:
Timestamp:
Apr 12, 2013, 10:49:41 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #425, #457, #479. Format comment text with line breaks.

Location:
extensions/net.sf.basedb.reggie/trunk/resources
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/libprep_protocol.jsp

    r1925 r1927  
    190190  var frm = document.forms['reggie'];
    191191  var bioplate = frm.bioplate[frm.bioplate.selectedIndex].bioplate;
    192   setInnerHTML('comments', bioplate.comments);
     192  setInnerHTML('comments', formatText(bioplate.comments));
    193193  frm.poolSchema.value = bioplate.poolSchema;
    194194  frm.barcodeVariant.value = bioplate.barcodeVariant;
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/libprep_protocol2.jsp

    r1925 r1927  
    376376    <th style="width: 30%;">Work plate: <%=HTML.encodeTags(plate.getName())%></th>
    377377    <th style="width: 20%; text-align: right;">Comments:&nbsp;</th>
    378     <td rowspan="3"><%=HTML.encodeTags(plate.getDescription()) %></td>
     378    <td rowspan="3"><%=HTML.niceFormat(plate.getDescription()) %></td>
    379379  </tr>
    380380  <tr>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/mrna_protocol.jsp

    r1919 r1927  
    110110  var frm = document.forms['reggie'];
    111111  var bioplate = frm.bioplate[frm.bioplate.selectedIndex].bioplate;
    112   setInnerHTML('comments', bioplate.comments);
     112  setInnerHTML('comments', formatText(bioplate.comments));
    113113  frm.poolSchema.value = bioplate.poolSchema;
    114114}
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/mrna_protocol2.jsp

    r1919 r1927  
    499499    <th style="width: 30%;">Work plate: <%=HTML.encodeTags(plate.getName())%></th>
    500500    <th style="width: 20%; text-align: right;">Comments:&nbsp;</th>
    501     <td rowspan="3"><%=HTML.encodeTags(plate.getDescription()) %></td>
     501    <td rowspan="3"><%=HTML.niceFormat(plate.getDescription()) %></td>
    502502  </tr>
    503503  <tr>
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/pool_protocol.jsp

    r1925 r1927  
    102102  var frm = document.forms['reggie'];
    103103  var bioplate = frm.bioplate[frm.bioplate.selectedIndex].bioplate;
    104   setInnerHTML('comments', bioplate.comments);
     104  setInnerHTML('comments', formatText(bioplate.comments));
    105105  frm.poolSchema.value = bioplate.poolSchema;
    106106  frm.barcodeVariant.value = bioplate.barcodeVariant;
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/pool_protocol2.jsp

    r1925 r1927  
    451451    <th style="width: 30%;">Work plate: <%=HTML.encodeTags(plate.getName())%></th>
    452452    <th style="width: 20%; text-align: right;">Comments:&nbsp;</th>
    453     <td rowspan="3"><%=HTML.encodeTags(plate.getDescription()) %></td>
     453    <td rowspan="3"><%=HTML.niceFormat(plate.getDescription()) %></td>
    454454  </tr>
    455455  <tr>
  • extensions/net.sf.basedb.reggie/trunk/resources/reggie.js

    r1915 r1927  
    377377  if (unit) result += unit;
    378378  return result;
     379}
     380
     381function formatText(text)
     382{
     383  if (text == null) return '';
     384  text = text.replace(/\&/g, '&amp;');
     385  text = text.replace(/\</g, '&lt;');
     386  text = text.replace(/\>/g, '&gt;');
     387  text = text.replace(/\n/g, '<br>');
     388  return text;
    379389}
    380390
Note: See TracChangeset for help on using the changeset viewer.