Changeset 6255


Ignore:
Timestamp:
Mar 22, 2013, 10:50:51 AM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #1729 and #1730. Use lazy loading for the 'Annotations' frame on the view page as well. Started to work on the 'Inherit annotations' dialog, but the Joust tree can't be done at the moment so there is still some work to do.

Location:
trunk/www
Files:
3 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/admin/pluginconfigurations/view_configuration.jsp

    r6244 r6255  
    443443      <t:tab id="annotations" title="Annotations"
    444444        tooltip="View annotation values" clazz="white"
    445         visible="<%=plugin != null && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin") %>">
    446         <jsp:include page="../../common/annotations/list_annotations.jsp">
     445        visible="<%=plugin != null && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin") %>"
     446        activate="AnnotationsList.loadOnce()">
     447        <jsp:include page="../../common/annotations/list_frameset.jsp">
    447448          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    448449          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/admin/plugindefinitions/view_plugin.jsp

    r6147 r6255  
    721721    <t:tab id="annotations" title="Annotations"
    722722      tooltip="View annotation values" clazz="white"
    723       visible="<%=!plugin.requiresConfiguration() && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin") %>">
    724         <jsp:include page="../../common/annotations/list_annotations.jsp">
    725           <jsp:param name="item_type" value="<%=itemType.name()%>" />
    726           <jsp:param name="item_id" value="<%=itemId%>" />
    727           <jsp:param name="ID" value="<%=ID%>" />
    728         </jsp:include>
     723      visible="<%=!plugin.requiresConfiguration() && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin") %>"
     724      activate="AnnotationsList.loadOnce()">
     725      <jsp:include page="../../common/annotations/list_frameset.jsp">
     726        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     727        <jsp:param name="item_id" value="<%=itemId%>" />
     728        <jsp:param name="ID" value="<%=ID%>" />
     729      </jsp:include>
    729730    </t:tab>     
    730731    </t:tabcontrol>
  • trunk/www/admin/protocols/view_protocol.jsp

    r6244 r6255  
    369369    </t:tab>
    370370    <t:tab id="annotations" title="Annotations"
    371       tooltip="View annotation values" clazz="white">
    372       <jsp:include page="../../common/annotations/list_annotations.jsp">
     371      tooltip="View annotation values" clazz="white"
     372      activate="AnnotationsList.loadOnce()">
     373      <jsp:include page="../../common/annotations/list_frameset.jsp">
    373374        <jsp:param name="item_type" value="<%=itemType.name()%>" />
    374375        <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/biomaterials/bioplates/view_bioplate.jsp

    r6244 r6255  
    567567     
    568568      <t:tab id="annotations" title="Annotations"
    569         tooltip="View annotation values" clazz="white">
    570         <jsp:include page="../../common/annotations/list_annotations.jsp">
     569        tooltip="View annotation values" clazz="white"
     570        activate="AnnotationsList.loadOnce()">
     571        <jsp:include page="../../common/annotations/list_frameset.jsp">
    571572          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    572573          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/biomaterials/biosources/biosources.js

    r6246 r6255  
    6060      Buttons.addClickHandler('btnRunPlugin', Buttons.runPlugin, attributes);
    6161     
     62      TabControl.addTabActivateListener('main.annotations', AnnotationsList.loadOnce);
    6263      TabControl.addTabActivateListener('main.overview', Overview.loadOnce);
    6364      TabControl.addTabActivateListener('main.history', History.loadOnce);
  • trunk/www/biomaterials/biosources/view_biosource.jsp

    r6245 r6255  
    342342      <t:tab id="annotations" title="Annotations"
    343343        tooltip="View annotation values" clazz="white">
    344         <jsp:include page="../../common/annotations/list_annotations.jsp">
     344        <jsp:include page="../../common/annotations/list_frameset.jsp">
    345345          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    346346          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/biomaterials/extracts/view_extract.jsp

    r6244 r6255  
    610610     
    611611      <t:tab id="annotations" title="Annotations &amp; parameters"
    612         tooltip="View annotation values and protocol parameters" clazz="white">
    613         <jsp:include page="../../common/annotations/list_annotations.jsp">
     612        tooltip="View annotation values and protocol parameters" clazz="white"
     613        activate="AnnotationsList.loadOnce()">
     614        <jsp:include page="../../common/annotations/list_frameset.jsp">
    614615          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    615616          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/biomaterials/samples/view_sample.jsp

    r6244 r6255  
    585585     
    586586      <t:tab id="annotations" title="Annotations &amp; parameters"
    587         tooltip="View annotation values and protocol parameters" clazz="white">
    588         <jsp:include page="../../common/annotations/list_annotations.jsp">
     587        tooltip="View annotation values and protocol parameters" clazz="white"
     588        activate="AnnotationsList.loadOnce()">
     589        <jsp:include page="../../common/annotations/list_frameset.jsp">
    589590          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    590591          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/common/annotations/inherit.jsp

    r6136 r6255  
    253253  %>
    254254  <base:page type="popup" title="Inherit annotations">
    255   <base:head  scripts="annotations.js,parameters.js,newjoust.js,linkitems.js" styles="parameters.css,newjoust.css">
     255  <base:head  scripts="newjoust.js,linkitems.js,~inherit.js" styles="newjoust.css">
    256256  <script>
    257257  var annotationValues = new Array();
    258   function init()
     258  function buildJoustTree()
    259259  {
    260260    <%
     
    262262    {
    263263      %>
    264       IconStore.init();
    265       var path = getRoot() + 'images/joust/';
    266       IconStore.addIcon('Annotatable', path + 'annotatable.gif', 18, 16);
    267       IconStore.addIcon('Annotation', path + 'annotation.gif', 18, 16);
    268       IconStore.addIcon('Parameter', path + 'parameter.gif', 18, 16);
    269       IconStore.addIcon('NonParent', path + 'itemerror.gif', 18, 16);
    270264      <%=generateJoustTree(parentAnnotations, nonParents, inheritedAnnotations, inheritedSets)%>
    271265      JoustMenu.alwaysSendOnClickToSelected = true;
     
    341335    event.cancelBubble = true;
    342336  }
    343  
    344   function saveAnnotations()
    345   {
    346     var frm = document.forms['modified'];
    347     Annotations.addInheritedAnnotationsToForm(window, frm);
    348     frm.submit();
    349   }
    350 
    351337  </script>
    352338  </base:head>
    353   <base:body onload="init()">
     339  <base:body>
    354340    <%
    355341    if (standalone)
     
    401387      </div>
    402388      <base:buttongroup subclass="dialogbuttons">
    403         <base:button onclick="saveAnnotations()" title="Save" />
    404         <base:button onclick="window.close()" title="Cancel" />
     389        <base:button id="btnSave" title="Save" />
     390        <base:button id="close" title="Cancel" />
    405391      </base:buttongroup>
    406392      <form name="modified" method="post" action="index.jsp?ID=<%=ID%>">
  • trunk/www/common/annotations/list_annotations.jsp

    r6136 r6255  
    141141  }
    142142  %>
    143   <base:page type="include">
     143  <base:page type="iframe" id="list-annotations">
     144  <base:head scripts="~list.js" styles="table.css" />
    144145  <base:body>
    145     <script>
    146     function editAnnotation(annotationTypeId)
    147     {
    148       var url = getRoot() + 'common/annotations/annotate.jsp?ID=<%=ID%>';
    149       url += '&item_type=<%=itemType.name()%>';
    150       url += '&item_id=<%=itemId%>';
    151       url += '&annotationtype_id='+annotationTypeId;
    152       url += '&standalone=1';
    153       Main.openPopup(url, 'EditAnnotation', 750, 500);
    154     }
    155     function editInheritedAnnotation(itemType, itemId, annotationTypeId)
    156     {
    157       var url = getRoot() + 'common/annotations/annotate.jsp?ID=<%=ID%>';
    158       url += '&item_type='+itemType;
    159       url += '&item_id='+itemId;
    160       url += '&annotationtype_id='+annotationTypeId;
    161       url += '&standalone=1';
    162       Main.openPopup(url, 'EditAnnotation', 750, 500);
    163     }
    164     </script>
    165146    <%
    166147    if (message != null)
     
    236217                    if (writePermission)
    237218                    {
    238                       %>: <base:icon image="edit.png"
    239                         onclick="<%="editAnnotation("+at.getId()+")"%>"
     219                      %>: <base:icon image="edit.png" subclass="auto-init link"
     220                        data-auto-init="edit-annotation" data-annotation-type="<%=at.getId()%>"
     221                        data-item-type="<%=itemType.name()%>" data-item-id="<%=itemId %>"
    240222                        tooltip="Modify the values of this annotation" />
    241223                      <%
     
    329311                      if (writePermission)
    330312                      {
    331                         %>: <base:icon image="edit.png"
    332                           onclick="<%="editAnnotation("+at.getId()+")"%>"
     313                        %>: <base:icon image="edit.png" subclass="auto-init link"
     314                          data-auto-init="edit-annotation" data-annotation-type="<%=at.getId()%>"
     315                          data-item-type="<%=itemType.name()%>" data-item-id="<%=itemId %>"
    333316                          tooltip="Modify the values of this protocol parameter" />
    334317                        <%
     
    448431                  if (writeInherited && aItem != null)
    449432                  {
    450                     %>: <base:icon image="edit.png"
    451                       onclick="<%="editInheritedAnnotation('"+aItem.getType().name()+"', "+aItem.getId()+", "+at.getId()+")"%>"
     433                    %>: <base:icon image="edit.png" subclass="auto-init link"
     434                      data-auto-init="edit-annotation" data-annotation-type="<%=at.getId()%>"
     435                      data-item-type="<%=aItem.getType().name()%>" data-item-id="<%=aItem.getId() %>"
    452436                      tooltip="Modify the values of this annotation" />
    453437                    <%
  • trunk/www/include/scripts/annotations.js

    r6246 r6255  
    106106  {
    107107    if (!inheritFrameLoaded) return;
    108    
    109     var theFrame = frames['inheritedAnnotations'];
    110     var addedAnnotations = theFrame.Link.getActionIds(1, 'A');
    111     var removedAnnotations = theFrame.Link.getActionIds(-1, 'A');
    112     var addedAnnotationSets = theFrame.Link.getActionIds(1, 'AS');
    113     var removedAnnotationSets = theFrame.Link.getActionIds(-1, 'AS');
    114 
    115     if (frm.addedAnnotations)
    116     {
    117       frm.addedAnnotations.value = addedAnnotations.join(',');
    118     }
    119     else
    120     {
    121       Forms.createHidden(frm, 'addedAnnotations', addedAnnotations.join(','));
    122     }
    123     if (frm.removedAnnotations)
    124     {
    125       frm.removedAnnotations.value = removedAnnotations.join(',');
    126     }
    127     else
    128     {
    129       Forms.createHidden(frm, 'removedAnnotations', removedAnnotations.join(','));
    130     }
    131     if (frm.addedAnnotationSets)
    132     {
    133       frm.addedAnnotationSets.value = addedAnnotationSets.join(',');
    134     }
    135     else
    136     {
    137       Forms.createHidden(frm, 'addedAnnotationSets', addedAnnotationSets.join(','));
    138     }
    139     if (frm.removedAnnotationSets)
    140     {
    141       frm.removedAnnotationSets.value = removedAnnotationSets.join(',');
    142     }
    143     else
    144     {
    145       Forms.createHidden(frm, 'removedAnnotationSets', removedAnnotationSets.join(','));
    146     }
     108    frames['inheritedAnnotations'].Inherit.saveInheritedAnnotationsToForm(frm);
    147109  }
    148110 
     
    163125}();
    164126
    165 
    166   Annotations.loadAnnotateFrame = function(theFrame, ID, itemType, itemId, protocolId, subtypeId)
    167   {
    168     var url = getRoot()+'common/annotations/annotate.jsp?ID='+ID;
    169     url += '&item_type='+itemType+'&item_id='+itemId;
    170     if (protocolId) url += '&protocol_id='+protocolId;
    171     if (subtypeId) url += '&subtype_id='+subtypeId;
    172     theFrame.location.href = url;
    173   }
    174  
    175   Annotations.loadInheritFrame = function(theFrame, ID, itemType, itemId, parents)
    176   {
    177     var url = getRoot()+'common/annotations/inherit.jsp?ID='+ID+'&item_type='+itemType+'&item_id='+itemId;
    178     if (parents && parents.length)
    179     {
    180       for (var i = 0; i < parents.length; i++)
    181       {
    182         url += '&parents='+parents[i];
    183       }
    184     }
    185     theFrame.location.href = url;
    186   }
    187 
    188   Annotations.addModifiedAnnotationsToForm = function(theFrame, frm)
    189   {
    190     theFrame.Annotate.saveModifiedAnnotationToForm(frm);
    191   }
    192  
    193   Annotations.addInheritedAnnotationsToForm = function(theFrame, frm)
    194   {
    195     var addedAnnotations = theFrame.Link.getActionIds(1, 'A');
    196     var removedAnnotations = theFrame.Link.getActionIds(-1, 'A');
    197     var addedAnnotationSets = theFrame.Link.getActionIds(1, 'AS');
    198     var removedAnnotationSets = theFrame.Link.getActionIds(-1, 'AS');
    199 
    200     if (frm.addedAnnotations)
    201     {
    202       frm.addedAnnotations.value = addedAnnotations.join(',');
    203     }
    204     else
    205     {
    206       Forms.createHidden(frm, 'addedAnnotations', addedAnnotations.join(','));
    207     }
    208     if (frm.removedAnnotations)
    209     {
    210       frm.removedAnnotations.value = removedAnnotations.join(',');
    211     }
    212     else
    213     {
    214       Forms.createHidden(frm, 'removedAnnotations', removedAnnotations.join(','));
    215     }
    216     if (frm.addedAnnotationSets)
    217     {
    218       frm.addedAnnotationSets.value = addedAnnotationSets.join(',');
    219     }
    220     else
    221     {
    222       Forms.createHidden(frm, 'addedAnnotationSets', addedAnnotationSets.join(','));
    223     }
    224     if (frm.removedAnnotationSets)
    225     {
    226       frm.removedAnnotationSets.value = removedAnnotationSets.join(',');
    227     }
    228     else
    229     {
    230       Forms.createHidden(frm, 'removedAnnotationSets', removedAnnotationSets.join(','));
    231     }
    232   }
    233 
  • trunk/www/lims/arraybatches/view_batch.jsp

    r6244 r6255  
    394394     
    395395      <t:tab id="annotations" title="Annotations &amp; parameters"
    396         tooltip="View annotation values and protocol parameters" clazz="white">
    397         <jsp:include page="../../common/annotations/list_annotations.jsp">
     396        tooltip="View annotation values and protocol parameters" clazz="white"
     397        activate="AnnotationsList.loadOnce()">
     398        <jsp:include page="../../common/annotations/list_frameset.jsp">
    398399          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    399400          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/lims/arraydesigns/view_design.jsp

    r6244 r6255  
    554554     
    555555    <t:tab id="annotations" title="Annotations"
    556       tooltip="View annotation values" clazz="white">
    557       <jsp:include page="../../common/annotations/list_annotations.jsp">
     556      tooltip="View annotation values" clazz="white"
     557        activate="AnnotationsList.loadOnce()">
     558        <jsp:include page="../../common/annotations/list_frameset.jsp">
    558559        <jsp:param name="item_type" value="<%=itemType.name()%>" />
    559560        <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/lims/arrayslides/view_slide.jsp

    r6244 r6255  
    313313     
    314314      <t:tab id="annotations" title="Annotations &amp; parameters"
    315         tooltip="View annotation values and protocol parameters" clazz="white">
    316         <jsp:include page="../../common/annotations/list_annotations.jsp">
     315        tooltip="View annotation values and protocol parameters" clazz="white"
     316        activate="AnnotationsList.loadOnce()">
     317        <jsp:include page="../../common/annotations/list_frameset.jsp">
    317318          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    318319          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/lims/plates/view_plate.jsp

    r6244 r6255  
    491491     
    492492      <t:tab id="annotations" title="Annotations"
    493         tooltip="View annotation values" clazz="white">
    494         <jsp:include page="../../common/annotations/list_annotations.jsp">
     493        tooltip="View annotation values" clazz="white"
     494        activate="AnnotationsList.loadOnce()">
     495        <jsp:include page="../../common/annotations/list_frameset.jsp">
    495496          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    496497          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/lims/plates/wells/view_well.jsp

    r6146 r6255  
    340340      </t:tab>
    341341      <t:tab id="annotations" title="Annotations"
    342         tooltip="View annotation values" clazz="white">
    343         <jsp:include page="../../../common/annotations/list_annotations.jsp">
     342        tooltip="View annotation values" clazz="white"
     343        activate="AnnotationsList.loadOnce()">
     344        <jsp:include page="../../../common/annotations/list_frameset.jsp">
    344345          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    345346          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/views/derivedbioassays/view_bioassay.jsp

    r6244 r6255  
    757757     
    758758      <t:tab id="annotations" title="Annotations &amp; parameters"
    759         tooltip="View annotation values and protocol parameters" clazz="white">
    760         <jsp:include page="../../common/annotations/list_annotations.jsp">
     759        tooltip="View annotation values and protocol parameters" clazz="white"
     760        activate="AnnotationsList.loadOnce()">
     761        <jsp:include page="../../common/annotations/list_frameset.jsp">
    761762          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    762763          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/views/experiments/bioassays/view_bioassay.jsp

    r6143 r6255  
    356356   
    357357    <t:tab id="annotations" title="Annotations"
    358       tooltip="View annotation values" clazz="white">
    359       <jsp:include page="../../../common/annotations/list_annotations.jsp">
     358      tooltip="View annotation values" clazz="white"
     359      activate="AnnotationsList.loadOnce()">
     360      <jsp:include page="../../../common/annotations/list_frameset.jsp">
    360361        <jsp:param name="item_type" value="<%=itemType.name()%>" />
    361362        <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/views/experiments/bioassaysets/view_bioassayset.jsp

    r6143 r6255  
    555555     
    556556      <t:tab id="annotations" title="Annotations"
    557         tooltip="View annotation values" clazz="white">
    558         <jsp:include page="../../../common/annotations/list_annotations.jsp">
     557        tooltip="View annotation values" clazz="white"
     558        activate="AnnotationsList.loadOnce()">
     559        <jsp:include page="../../../common/annotations/list_frameset.jsp">
    559560          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    560561          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/views/experiments/view_experiment.jsp

    r6244 r6255  
    795795      </t:tab>
    796796      <t:tab id="annotations" title="Annotations"
    797         tooltip="View annotation values" clazz="white">
    798         <jsp:include page="../../common/annotations/list_annotations.jsp">
     797        tooltip="View annotation values" clazz="white"
     798        activate="AnnotationsList.loadOnce()">
     799        <jsp:include page="../../common/annotations/list_frameset.jsp">
    799800          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    800801          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/views/physicalbioassays/view_bioassay.jsp

    r6244 r6255  
    513513     
    514514      <t:tab id="annotations" title="Annotations &amp; parameters"
    515         tooltip="View annotation values and protocol parameters" clazz="white">
    516         <jsp:include page="../../common/annotations/list_annotations.jsp">
     515        tooltip="View annotation values and protocol parameters" clazz="white"
     516        activate="AnnotationsList.loadOnce()">
     517        <jsp:include page="../../common/annotations/list_frameset.jsp">
    517518          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    518519          <jsp:param name="item_id" value="<%=itemId%>" />
  • trunk/www/views/rawbioassays/view_rawbioassay.jsp

    r6244 r6255  
    592592     
    593593      <t:tab id="annotations" title="Annotations &amp; parameters"
    594         tooltip="View annotation values and protocol parameters" clazz="white">
    595         <jsp:include page="../../common/annotations/list_annotations.jsp">
     594        tooltip="View annotation values and protocol parameters" clazz="white"
     595        activate="AnnotationsList.loadOnce()">
     596        <jsp:include page="../../common/annotations/list_frameset.jsp">
    596597          <jsp:param name="item_type" value="<%=itemType.name()%>" />
    597598          <jsp:param name="item_id" value="<%=itemId%>" />
Note: See TracChangeset for help on using the changeset viewer.