Changeset 6254


Ignore:
Timestamp:
Mar 22, 2013, 8:28:26 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #1729 and #1730. Use lazy loading of 'Annotations'/'Inherited annotations' for all other items.

Location:
trunk/www
Files:
16 edited

Legend:

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

    r6217 r6254  
    130130  if (configuration != null) configuration.checkPermission(Permission.WRITE);
    131131 
    132  
    133  
    134132  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), configuration);
    135133  ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext);
    136134  %>
    137135  <base:page type="popup" title="<%=title%>">
    138   <base:head scripts="tabcontrol.js,annotations.js" styles="tabcontrol.css">
     136  <base:head scripts="tabcontrol.js" styles="tabcontrol.css">
    139137    <ext:scripts context="<%=jspContext%>" />
    140138    <ext:stylesheets context="<%=jspContext%>" />
     
    163161      if (TabControl.validateActiveTab('settings'))
    164162      {
    165         if (annotationsLoaded)
    166         {
    167           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    168         }
     163        Annotations.saveModifiedAnnotationsToForm(frm);
    169164        frm.configure.value = configure;
    170165        frm.submit();
    171166      }
    172167    }
    173 
    174     var annotationsLoaded = false;
    175     function switchTab(tabControlId, tabId)
    176     {
    177       if (TabControl.setActiveTab(tabControlId, tabId))
    178       {
    179         if (tabId == 'annotations' && !annotationsLoaded)
    180         {
    181           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    182           annotationsLoaded = true;
    183         }
    184       }
    185     }
    186168   
     169    function loadAnnotationsFrame()
     170    {
     171      Annotations.autoLoadEditFrame();
     172    }
     173
    187174    function init()
    188175    {
     
    249236    <t:tabcontrol id="settings"
    250237      subclass="content dialogtabcontrol"
    251       position="bottom" remember="<%=configuration != null%>" switch="switchTab"
     238      position="bottom" remember="<%=configuration != null%>"
    252239      extensions="<%=invoker%>">
    253240    <t:tab id="info" title="Configuration" validate="validateConfiguration()" helpid="pluginconfiguration.edit">
     
    303290    <t:tab id="annotations" title="Annotations"
    304291      helpid="annotations.edit" tooltip="Enter values for annotations"
    305       visible="<%=currentPlugin != null && currentPlugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin")%>"><iframe
    306       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    307       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     292      visible="<%=currentPlugin != null && currentPlugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin")%>"
     293      activate="loadAnnotationsFrame()">
     294      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     295        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     296        <jsp:param name="item_id" value="<%=itemId%>" />
     297        <jsp:param name="ID" value="<%=ID%>" />
     298      </jsp:include>
     299    </t:tab>
    308300    </t:tabcontrol>
    309301    </form>
  • trunk/www/admin/plugindefinitions/edit_plugin.jsp

    r6217 r6254  
    173173  }
    174174 
    175  
    176  
    177175  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), plugin);
    178176  ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext);
    179177  %>
    180178  <base:page type="popup" title="<%=title%>">
    181   <base:head scripts="tabcontrol.js,annotations.js,linkitems.js" styles="tabcontrol.css">
     179  <base:head scripts="tabcontrol.js,linkitems.js" styles="tabcontrol.css">
    182180    <ext:scripts context="<%=jspContext%>" />
    183181    <ext:stylesheets context="<%=jspContext%>" />
     
    226224        frm.allAgents.value = agents.join(',');
    227225        frm.removeAgents.value = Link.getActionIds(-1, 'A').join(',');
    228         if (annotationsLoaded)
    229         {
    230           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    231         }
     226        Annotations.saveModifiedAnnotationsToForm(frm);
    232227        frm.submit();
    233228      }
    234229    }
    235230   
    236     var annotationsLoaded = false;
    237     function switchTab(tabControlId, tabId)
    238     {
    239       if (TabControl.setActiveTab(tabControlId, tabId))
    240       {
    241         if (tabId == 'annotations' && !annotationsLoaded)
    242         {
    243           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    244           annotationsLoaded = true;
    245         }
    246       }
     231    function loadAnnotationsFrame()
     232    {
     233      Annotations.autoLoadEditFrame();
    247234    }
    248235   
     
    704691      subclass="content dialogtabcontrol"
    705692      position="bottom" remember="<%=plugin != null%>"
    706       active="<%=selectedAgentId == -1 ? null : "agents" %>" switch="switchTab"
     693      active="<%=selectedAgentId == -1 ? null : "agents" %>"
    707694      extensions="<%=invoker%>">
    708695    <t:tab id="info" title="Plugin" validate="validatePlugin()" helpid="plugindefinition.edit">
     
    10151002    <t:tab id="annotations" title="Annotations"
    10161003      helpid="annotations.edit" tooltip="Enter values for annotations"
    1017       visible="<%=plugin != null && !plugin.requiresConfiguration() && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin")%>"><iframe
    1018       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    1019       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>   
     1004      visible="<%=plugin != null && !plugin.requiresConfiguration() && plugin.supports("net.sf.basedb.core.plugin.AnnotationSetterPlugin")%>"
     1005      activate="loadAnnotationsFrame()">
     1006      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     1007        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     1008        <jsp:param name="item_id" value="<%=itemId%>" />
     1009        <jsp:param name="ID" value="<%=ID%>" />
     1010      </jsp:include>     
     1011    </t:tab>   
    10201012    </t:tabcontrol>
    10211013    <%
  • trunk/www/admin/protocols/edit_protocol.jsp

    r6217 r6254  
    118118  final ItemQuery<ItemSubtype> subtypesQuery = Base.getSubtypesQuery(itemType);
    119119  subtypesQuery.include(Include.ALL);
    120  
    121  
    122  
     120
    123121  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), protocol);
    124122  ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext);
    125123  %>
    126 
    127124  <base:page type="popup" title="<%=title%>">
    128   <base:head scripts="tabcontrol.js,annotations.js,linkitems.js,subtypes.js" styles="tabcontrol.css">
     125  <base:head scripts="tabcontrol.js,linkitems.js,subtypes.js" styles="tabcontrol.css">
    129126    <ext:scripts context="<%=jspContext%>" />
    130127    <ext:stylesheets context="<%=jspContext%>" />
     
    153150      if (TabControl.validateActiveTab('settings'))
    154151      {
    155         if (annotationsLoaded)
    156         {
    157           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    158         }
     152        Annotations.saveModifiedAnnotationsToForm(frm);
    159153        frm.addedAnnotationTypes.value = Link.getActionIds(1, 'A').join(',');
    160154        frm.removedAnnotationTypes.value = Link.getActionIds(-1, 'A').join(',');
     
    163157    }
    164158   
    165     var annotationsLoaded = false;
    166     function switchTab(tabControlId, tabId)
    167     {
    168       if (TabControl.setActiveTab(tabControlId, tabId))
    169       {
    170         if (tabId == 'annotations' && !annotationsLoaded)
    171         {
    172           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>);
    173           annotationsLoaded = true;
    174         }
    175       }
     159    function loadAnnotationsFrame()
     160    {
     161      Annotations.autoLoadEditFrame(null, ItemSubtype.getSubtypeId('protocol'));
    176162    }
    177163   
     
    303289    <t:tabcontrol id="settings"
    304290      subclass="content dialogtabcontrol"
    305       position="bottom"  remember="<%=protocol != null%>" switch="switchTab"
     291      position="bottom"  remember="<%=protocol != null%>"
    306292      extensions="<%=invoker%>">
    307293    <t:tab id="info" title="Protocol" validate="validateProtocol()" helpid="protocol.edit">
     
    449435    </t:tab>
    450436   
    451     <t:tab id="annotations" title="Annotations" helpid="annotations.edit"><iframe
    452       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    453       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
    454 
     437    <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     438      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     439        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     440        <jsp:param name="item_id" value="<%=itemId%>" />
     441        <jsp:param name="ID" value="<%=ID%>" />
     442      </jsp:include>
     443    </t:tab>
    455444    </t:tabcontrol>
    456445    </form>
  • trunk/www/biomaterials/bioplates/edit_bioplate.jsp

    r6217 r6254  
    184184  %>
    185185  <base:page type="popup" title="<%=title%>">
    186   <base:head scripts="tabcontrol.js,annotations.js,subtypes.js" styles="tabcontrol.css">
     186  <base:head scripts="tabcontrol.js,subtypes.js" styles="tabcontrol.css">
    187187    <ext:scripts context="<%=jspContext%>" />
    188188    <ext:stylesheets context="<%=jspContext%>" />
     
    216216      if (TabControl.validateActiveTab('settings'))
    217217      {
    218         if (annotationsLoaded)
    219         {
    220           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    221         }
    222         if (inheritedAnnotationsLoaded)
    223         {
    224           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    225         }
     218        Annotations.saveModifiedAnnotationsToForm(frm);
    226219        frm.submit();
    227220      }
    228221    }
    229222   
    230     var annotationsLoaded = false;
    231     var inheritedAnnotationsLoaded = false;
    232     var parentsChanged = false;
    233     function switchTab(tabControlId, tabId)
    234     {
    235       if (TabControl.setActiveTab(tabControlId, tabId))
    236       {
    237         if (tabId == 'annotations' && !annotationsLoaded)
    238         {
    239           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=bioplate == null ? 0 : bioplate.getId()%>);
    240           annotationsLoaded = true;
    241         }
    242         else if (tabId == 'inheritedAnnotations' &&
    243           (parentsChanged || !inheritedAnnotationsLoaded))
    244         {
    245           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    246           inheritedAnnotationsLoaded = true;
    247           parentsChanged = false;
    248         }
    249       }
    250     }
    251     function getParents()
    252     {
    253       return new Array();
    254     }
     223    function loadAnnotationsFrame()
     224    {
     225      Annotations.autoLoadEditFrame();
     226    }
     227
    255228    function selectPlateGeometryOnClick()
    256229    {
     
    361334    <t:tabcontrol id="settings"
    362335      subclass="content dialogtabcontrol"
    363       position="bottom"  remember="<%=bioplate != null%>" switch="switchTab"
     336      position="bottom"  remember="<%=bioplate != null%>"
    364337      extensions="<%=invoker%>">
    365338    <t:tab id="info" title="Plate" validate="validateBioPlate()" helpid="bioplate.edit">
     
    521494    </t:tab>
    522495   
    523     <t:tab id="annotations" title="Annotations" helpid="annotations.edit"><iframe
    524       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    525       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>   
     496    <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     497      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     498        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     499        <jsp:param name="item_id" value="<%=itemId%>" />
     500        <jsp:param name="ID" value="<%=ID%>" />
     501      </jsp:include>
     502   
     503    </t:tab>   
    526504    </t:tabcontrol>
    527505    </form>
  • trunk/www/biomaterials/extracts/edit_extract.jsp

    r6217 r6254  
    286286  %>
    287287  <base:page type="popup" title="<%=title%>">
    288   <base:head scripts="tabcontrol.js,annotations.js,linkitems.js,subtypes.js" styles="tabcontrol.css">
     288  <base:head scripts="tabcontrol.js,linkitems.js,subtypes.js" styles="tabcontrol.css">
    289289    <ext:scripts context="<%=jspContext%>" />
    290290    <ext:stylesheets context="<%=jspContext%>" />
     
    313313      if (TabControl.validateActiveTab('settings'))
    314314      {
    315         if (annotationsLoaded)
    316         {
    317           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    318         }
    319         if (inheritedAnnotationsLoaded)
    320         {
    321           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    322         }
     315        Annotations.saveModifiedAnnotationsToForm(frm);
     316        Annotations.saveInheritedAnnotationsToForm(frm);
    323317        frm.modifiedExtracts.value = Link.exportModified(frm, 'E', true).join(',');
    324318        frm.removedExtracts.value = Link.getActionIds(-1, 'E').join(',');
     
    326320      }
    327321    }
    328    
    329     var annotationsLoaded = false;
    330     var inheritedAnnotationsLoaded = false;
    331     var parentsChanged = false;
    332     var protocolChanged = false;
    333     function switchTab(tabControlId, tabId)
    334     {
    335       if (TabControl.setActiveTab(tabControlId, tabId))
    336       {
    337         if (tabId == 'annotations' && (protocolChanged || !annotationsLoaded))
    338         {
    339           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getProtocolId());
    340           annotationsLoaded = true;
    341           protocolChanged = false;
    342         }
    343         else if (tabId == 'inheritedAnnotations' &&
    344           (parentsChanged || !inheritedAnnotationsLoaded))
    345         {
    346           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    347           inheritedAnnotationsLoaded = true;
    348           parentsChanged = false;
    349         }
    350       }
    351     }
    352 
     322 
     323    function loadAnnotationsFrame()
     324    {
     325      Annotations.autoLoadEditFrame(getProtocolId(), ItemSubtype.getSubtypeId('extract'));
     326    }
     327   
     328    function loadInheritedAnnotationsFrame()
     329    {
     330      Annotations.autoLoadInheritFrame(getParents());
     331    }
     332   
    353333    function getProtocolId()
    354334    {
     
    387367      var subtypeId = ItemSubtype.getSubtypeId('extract');
    388368      var recentInfo = ItemSubtype.getRecentAndRelatedInfo(subtypeId, 'EXTRACT', ['PROTOCOL', 'BIOPLATE', 'TAG', 'SAMPLE', 'EXTRACT']);
    389       protocolChanged = ItemSubtype.updateSelectionList(frm.protocol_id, recentInfo.PROTOCOL['recent'], recentInfo.PROTOCOL['default']);
     369      ItemSubtype.updateSelectionList(frm.protocol_id, recentInfo.PROTOCOL['recent'], recentInfo.PROTOCOL['default']);
    390370      ItemSubtype.updateSelectionList(frm.tag_id, recentInfo.TAG['recent']);
    391371      ItemSubtype.updateSelectionList(frm.bioplate_id, recentInfo.BIOPLATE['recent']);
     
    416396      list[1].text = name;
    417397      list.selectedIndex = 1;
    418       protocolChanged = true;
    419     }
    420     function protocolOnChange()
    421     {
    422       protocolChanged = true;
    423398    }
    424399    function selectTagOnClick()
     
    548523      frm.extracts.disabled = !useExtracts;
    549524      frm.used_quantity.disabled = !useExtracts;
    550       parentsChanged = true;
    551     }
    552     function sampleOnChange()
    553     {
    554       parentsChanged = true;
    555525    }
    556526   
     
    582552      frm.parentType[1].checked = false;
    583553      parentTypeOnClick();
    584       parentsChanged = true;
    585554    }
    586555   
     
    603572      frm.parentType[1].checked = true;
    604573      parentTypeOnClick();
    605       parentsChanged = true;
    606574    }
    607575    function extractsOnChange()
     
    650618    {
    651619      Link.removeSelected(document.forms['extract'].extracts);
    652       parentsChanged = true;
    653620    }
    654621
     
    707674    <t:tabcontrol id="settings"
    708675      subclass="content dialogtabcontrol"
    709       position="bottom"  remember="<%=extract != null%>" switch="switchTab"
     676      position="bottom"  remember="<%=extract != null%>"
    710677      extensions="<%=invoker%>">
    711678    <t:tab id="info" title="Extract" validate="validateExtract()" helpid="extract.edit">
     
    824791            newitem="<%=extract == null%>"
    825792            onselect="selectProtocolOnClick()"
    826             onchange="protocolOnChange()"
    827793            disabled="<%=lockEventProperties%>"
    828794          />
     
    910876            newitem="<%=extract == null%>"
    911877            onselect="selectSampleOnClick()"
    912             onchange="sampleOnChange()"
    913878          />
    914879        </td>
     
    976941    </t:tab>
    977942
    978     <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit"><iframe
    979       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    980       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     943    <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     944      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     945        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     946        <jsp:param name="item_id" value="<%=itemId%>" />
     947        <jsp:param name="ID" value="<%=ID%>" />
     948      </jsp:include>
     949    </t:tab>
    981950   
    982951    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    983       helpid="annotations.edit.inherited"><iframe
    984         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../common/annotations/wait.jsp"
    985         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     952      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     953      <jsp:include page="../../common/annotations/inherit_frameset.jsp">
     954        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     955        <jsp:param name="item_id" value="<%=itemId%>" />
     956        <jsp:param name="ID" value="<%=ID%>" />
     957      </jsp:include>     
     958    </t:tab>
    986959    </t:tabcontrol>
    987960    </form>
  • trunk/www/lims/arraybatches/edit_batch.jsp

    r6217 r6254  
    175175  %>
    176176  <base:page type="popup" title="<%=title%>">
    177   <base:head scripts="tabcontrol.js,annotations.js" styles="tabcontrol.css">
     177  <base:head scripts="tabcontrol.js" styles="tabcontrol.css">
    178178    <ext:scripts context="<%=jspContext%>" />
    179179    <ext:stylesheets context="<%=jspContext%>" />
     
    202202      if (TabControl.validateActiveTab('settings'))
    203203      {
    204         if (annotationsLoaded)
    205         {
    206           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    207         }
    208         if (inheritedAnnotationsLoaded)
    209         {
    210           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    211         }
     204        Annotations.saveModifiedAnnotationsToForm(frm);
     205        Annotations.saveInheritedAnnotationsToForm(frm);
    212206        frm.submit();
    213207      }
    214208    }
    215209   
    216     var annotationsLoaded = false;
    217     var inheritedAnnotationsLoaded = false;
    218     var parentsChanged = false;
    219     var protocolChanged = false;
    220     function switchTab(tabControlId, tabId)
    221     {
    222       if (TabControl.setActiveTab(tabControlId, tabId))
    223       {
    224         if (tabId == 'annotations' && (protocolChanged || !annotationsLoaded))
    225         {
    226           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=batch == null ? 0 : batch.getId()%>, getProtocolId());
    227           annotationsLoaded = true;
    228           protocolChanged = false;
    229         }
    230         else if (tabId == 'inheritedAnnotations' &&
    231           (parentsChanged || !inheritedAnnotationsLoaded))
    232         {
    233           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    234           inheritedAnnotationsLoaded = true;
    235           parentsChanged = false;
    236         }
    237       }
     210    function loadAnnotationsFrame()
     211    {
     212      Annotations.autoLoadEditFrame(getProtocolId());
    238213    }
    239214   
     215    function loadInheritedAnnotationsFrame()
     216    {
     217      Annotations.autoLoadInheritFrame(getParents());
     218    }
     219
    240220    function getProtocolId()
    241221    {
     
    261241    }
    262242
    263     function arrayDesignOnChange()
    264     {
    265       parentsChanged = true;
    266     }
    267243    function selectArrayDesignOnClick()
    268244    {
     
    287263      list[0].text = name;
    288264      list.selectedIndex = 0;
    289       parentsChanged = true;
    290265    }
    291266
     
    313288      list[1].text = name;
    314289      list.selectedIndex = 1;
    315       protocolChanged = true;
    316     }
    317     function protocolOnChange()
    318     {
    319       protocolChanged = true;
    320     }
    321 
     290    }
    322291    function selectPrintRobotOnClick()
    323292    {
     
    368337    <t:tabcontrol id="settings"
    369338      subclass="content dialogtabcontrol"
    370       position="bottom"  remember="<%=batch != null%>" switch="switchTab"
     339      position="bottom"  remember="<%=batch != null%>"
    371340      extensions="<%=invoker%>">
    372341    <t:tab id="info" title="Array batch" validate="validateArrayBatch()" helpid="arraybatch.edit">
     
    402371              newitem="true"
    403372              onselect="selectArrayDesignOnClick()"
    404               onchange="arrayDesignOnChange()"
    405373            />
    406374            <%
     
    440408            newitem="<%=batch == null%>"
    441409            onselect="selectProtocolOnClick()"
    442             onchange="protocolOnChange()"
    443410          />
    444411        </td>
     
    458425    </t:tab>
    459426   
    460     <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit"><iframe
    461       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    462       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     427    <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     428      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     429        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     430        <jsp:param name="item_id" value="<%=itemId%>" />
     431        <jsp:param name="ID" value="<%=ID%>" />
     432      </jsp:include>
     433    </t:tab>
    463434   
    464435    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    465       helpid="annotations.edit.inherited"><iframe
    466         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../common/annotations/wait.jsp"
    467         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     436      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     437      <jsp:include page="../../common/annotations/inherit_frameset.jsp">
     438        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     439        <jsp:param name="item_id" value="<%=itemId%>" />
     440        <jsp:param name="ID" value="<%=ID%>" />
     441      </jsp:include>
     442    </t:tab>
    468443    </t:tabcontrol>
    469444    </form>
  • trunk/www/lims/arraydesigns/edit_design.jsp

    r6217 r6254  
    149149  ItemResultList<PlatformVariant> variants = variantQuery.list(dc);
    150150 
    151  
    152  
    153151  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), design);
    154152  ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext);
    155153  %>
    156154  <base:page type="popup" title="<%=title%>">
    157   <base:head scripts="tabcontrol.js,annotations.js,platforms.js" styles="tabcontrol.css">
     155  <base:head scripts="tabcontrol.js,platforms.js" styles="tabcontrol.css">
    158156    <ext:scripts context="<%=jspContext%>" />
    159157    <ext:stylesheets context="<%=jspContext%>" />
     
    187185      if (TabControl.validateActiveTab('settings'))
    188186      {
    189         if (annotationsLoaded)
    190         {
    191           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    192         }
    193         if (inheritedAnnotationsLoaded)
    194         {
    195           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    196         }
     187        Annotations.saveModifiedAnnotationsToForm(frm);
     188        Annotations.saveInheritedAnnotationsToForm(frm);
    197189        if (dataFilesLoaded)
    198190        {
     
    203195    }
    204196   
    205     var annotationsLoaded = false;
    206     var inheritedAnnotationsLoaded = false;
    207     var parentsChanged = false;
     197    function loadAnnotationsFrame()
     198    {
     199      Annotations.autoLoadEditFrame();
     200    }
     201   
     202    function loadInheritedAnnotationsFrame()
     203    {
     204      Annotations.autoLoadInheritFrame();
     205    }
     206   
    208207    var dataFilesLoaded = false;
    209208    var platformChanged = false;
    210     function switchTab(tabControlId, tabId)
    211     {
    212       var frm = document.forms['design'];
    213       if (TabControl.setActiveTab(tabControlId, tabId))
    214       {
    215         if (tabId == 'annotations' && !annotationsLoaded)
    216         {
    217           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=design == null ? 0 : design.getId()%>);
    218           annotationsLoaded = true;
    219         }
    220         else if (tabId == 'inheritedAnnotations' &&
    221           (parentsChanged || !inheritedAnnotationsLoaded))
    222         {
    223           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    224           inheritedAnnotationsLoaded = true;
    225           parentsChanged = false;
    226         }
    227         else if (tabId == 'datafiles' && (platformChanged || !dataFilesLoaded))
    228         {
    229           var platform = Platforms.getSelectedPlatform(frm.platform);
    230           var variant = Platforms.getSelectedVariant(frm.platform);
    231           Platforms.loadDataFilesFrame(frames.datafiles, '<%=ID%>', '<%=itemType.name()%>', <%=design == null ? 0 : design.getId()%>, platform == null ? 0 : platform.id, variant == null ? 0 : variant.id);
    232           dataFilesLoaded = true;
    233           platformChanged = false;
    234         }
    235       }
    236     }
    237    
    238     function getParents()
    239     {
    240       return new Array();
    241     }
    242    
     209    function loadDataFilesFrame()
     210    {
     211      var frm = document.forms['design'];
     212      if (platformChanged || !dataFilesLoaded)
     213      {
     214        var platform = Platforms.getSelectedPlatform(frm.platform);
     215        var variant = Platforms.getSelectedVariant(frm.platform);
     216        Platforms.loadDataFilesFrame(frames.datafiles, '<%=ID%>', '<%=itemType.name()%>', <%=design == null ? 0 : design.getId()%>, platform == null ? 0 : platform.id, variant == null ? 0 : variant.id);
     217        dataFilesLoaded = true;
     218        platformChanged = false;
     219      }
     220    }
     221
    243222    function platformOnChange()
    244223    {
     
    298277    <t:tabcontrol id="settings"
    299278      subclass="content dialogtabcontrol"
    300       position="bottom" active="<%=tabId%>" remember="<%=tabId == null && design != null%>" switch="switchTab"
     279      position="bottom" active="<%=tabId%>" remember="<%=tabId == null && design != null%>"
    301280      extensions="<%=invoker%>">
    302281    <t:tab id="info" title="Array design" validate="validateArrayDesign()" helpid="arraydesign.edit">
     
    361340    </t:tab>
    362341
    363     <t:tab id="datafiles" title="Data files" helpid="datafiles.edit"><iframe
     342    <t:tab id="datafiles" title="Data files" helpid="datafiles.edit" activate="loadDataFilesFrame()"><iframe
    364343      name="datafiles" id="idDatafiles" src="../../common/datafiles/wait.jsp"
    365344      class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
    366345
    367     <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit"><iframe
    368       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    369       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     346    <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     347      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     348        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     349        <jsp:param name="item_id" value="<%=itemId%>" />
     350        <jsp:param name="ID" value="<%=ID%>" />
     351      </jsp:include>
     352    </t:tab>
    370353   
    371354    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    372       helpid="annotations.edit.inherited"><iframe
    373         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../common/annotations/wait.jsp"
    374         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     355      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     356      <jsp:include page="../../common/annotations/inherit_frameset.jsp">
     357        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     358        <jsp:param name="item_id" value="<%=itemId%>" />
     359        <jsp:param name="ID" value="<%=ID%>" />
     360      </jsp:include>
     361    </t:tab>
    375362    </t:tabcontrol>
    376363    </form>
  • trunk/www/lims/arrayslides/edit_slide.jsp

    r6217 r6254  
    118118  %>
    119119  <base:page type="popup" title="<%=title%>">
    120   <base:head scripts="tabcontrol.js,annotations.js" styles="tabcontrol.css">
     120  <base:head scripts="tabcontrol.js" styles="tabcontrol.css">
    121121    <ext:scripts context="<%=jspContext%>" />
    122122    <ext:stylesheets context="<%=jspContext%>" />
     
    145145      if (TabControl.validateActiveTab('settings'))
    146146      {
    147         if (annotationsLoaded)
    148         {
    149           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    150         }
    151         if (inheritedAnnotationsLoaded)
    152         {
    153           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    154         }
     147        Annotations.saveModifiedAnnotationsToForm(frm);
     148        Annotations.saveInheritedAnnotationsToForm(frm);
    155149        frm.submit();
    156150      }
    157151    }
    158152   
    159     var annotationsLoaded = false;
    160     var inheritedAnnotationsLoaded = false;
    161     var parentsChanged = false;
    162     function switchTab(tabControlId, tabId)
    163     {
    164       if (TabControl.setActiveTab(tabControlId, tabId))
    165       {
    166         if (tabId == 'annotations' && !annotationsLoaded)
    167         {
    168           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=slide == null ? 0 : slide.getId()%>);
    169           annotationsLoaded = true;
    170         }
    171         else if (tabId == 'inheritedAnnotations' &&
    172           (parentsChanged || !inheritedAnnotationsLoaded))
    173         {
    174           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    175           inheritedAnnotationsLoaded = true;
    176           parentsChanged = false;
    177         }
    178       }
     153    function loadAnnotationsFrame()
     154    {
     155      Annotations.autoLoadEditFrame();
     156    }
     157   
     158    function loadInheritedAnnotationsFrame()
     159    {
     160      Annotations.autoLoadInheritFrame(getParents());
    179161    }
    180162   
     
    191173    }
    192174   
    193     function arrayBatchOnChange()
    194     {
    195       parentsChanged = true;
    196     }   
    197175    function selectArrayBatchOnClick()
    198176    {
     
    213191      list[0].text = name;
    214192      list.selectedIndex = 0;
    215       parentsChanged = true;
    216193    }
    217194
     
    238215    <t:tabcontrol id="settings"
    239216      subclass="content dialogtabcontrol"
    240       position="bottom"  remember="<%=slide != null%>" switch="switchTab"
     217      position="bottom"  remember="<%=slide != null%>"
    241218      extensions="<%=invoker%>">
    242219    <t:tab id="info" title="Array slide" validate="validateArraySlide()" helpid="arrayslide.edit">
     
    285262              newitem="true"
    286263              onselect="selectArrayBatchOnClick()"
    287               onchange="arrayBatchOnChange()()"
    288264            />
    289265            <%
     
    313289    </t:tab>
    314290   
    315     <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit"><iframe
    316       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    317       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     291    <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     292      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     293        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     294        <jsp:param name="item_id" value="<%=itemId%>" />
     295        <jsp:param name="ID" value="<%=ID%>" />
     296      </jsp:include>
     297    </t:tab>
    318298   
    319299    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    320       helpid="annotations.edit.inherited"><iframe
    321         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../common/annotations/wait.jsp"
    322         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     300      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     301      <jsp:include page="../../common/annotations/inherit_frameset.jsp">
     302        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     303        <jsp:param name="item_id" value="<%=itemId%>" />
     304        <jsp:param name="ID" value="<%=ID%>" />
     305      </jsp:include>
     306    </t:tab>
    323307    </t:tabcontrol>
    324308    </form>
  • trunk/www/lims/plates/edit_plate.jsp

    r6217 r6254  
    111111  %>
    112112  <base:page type="popup" title="<%=title%>">
    113   <base:head scripts="tabcontrol.js,annotations.js" styles="tabcontrol.css">
     113  <base:head scripts="tabcontrol.js" styles="tabcontrol.css">
    114114    <ext:scripts context="<%=jspContext%>" />
    115115    <ext:stylesheets context="<%=jspContext%>" />
     
    138138      if (TabControl.validateActiveTab('settings'))
    139139      {
    140         if (annotationsLoaded)
    141         {
    142           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    143         }
    144         if (inheritedAnnotationsLoaded)
    145         {
    146           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    147         }
     140        Annotations.saveModifiedAnnotationsToForm(frm);
     141        Annotations.saveInheritedAnnotationsToForm(frm);
    148142        frm.submit();
    149143      }
    150144    }
    151145   
    152     var annotationsLoaded = false;
    153     var inheritedAnnotationsLoaded = false;
    154     var parentsChanged = false;
    155     function switchTab(tabControlId, tabId)
    156     {
    157       if (TabControl.setActiveTab(tabControlId, tabId))
    158       {
    159         if (tabId == 'annotations' && !annotationsLoaded)
    160         {
    161           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=plate == null ? 0 : plate.getId()%>);
    162           annotationsLoaded = true;
    163         }
    164         else if (tabId == 'inheritedAnnotations' &&
    165           (parentsChanged || !inheritedAnnotationsLoaded))
    166         {
    167           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    168           inheritedAnnotationsLoaded = true;
    169           parentsChanged = false;
    170         }
    171       }
    172     }
    173     function getParents()
    174     {
    175       return new Array();
    176     }
     146    function loadAnnotationsFrame()
     147    {
     148      Annotations.autoLoadEditFrame();
     149    }
     150   
     151    function loadInheritedAnnotationsFrame()
     152    {
     153      Annotations.autoLoadInheritFrame();
     154    }
     155
    177156    function selectPlateTypeOnClick()
    178157    {
     
    216195    <t:tabcontrol id="settings"
    217196      subclass="content dialogtabcontrol"
    218       position="bottom"  remember="<%=plate != null%>" switch="switchTab"
     197      position="bottom"  remember="<%=plate != null%>"
    219198      extensions="<%=invoker%>">
    220199    <t:tab id="info" title="Plate" validate="validatePlate()" helpid="plate.edit">
     
    301280    </t:tab>
    302281   
    303     <t:tab id="annotations" title="Annotations" helpid="annotations.edit"><iframe
    304       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    305       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>   
     282    <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     283      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     284        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     285        <jsp:param name="item_id" value="<%=itemId%>" />
     286        <jsp:param name="ID" value="<%=ID%>" />
     287      </jsp:include>
     288    </t:tab>
    306289   
    307290    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    308       helpid="annotations.edit.inherited"><iframe
    309         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../common/annotations/wait.jsp"
    310         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
    311 
     291      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     292      <jsp:include page="../../common/annotations/inherit_frameset.jsp">
     293        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     294        <jsp:param name="item_id" value="<%=itemId%>" />
     295        <jsp:param name="ID" value="<%=ID%>" />
     296      </jsp:include>
     297    </t:tab>
    312298    </t:tabcontrol>
    313299    </form>
  • trunk/www/lims/plates/wells/edit_well.jsp

    r6217 r6254  
    6666 
    6767  title = "Edit well -- " + HTML.encodeTags(plate.getName()) + " [" + rowFormatter.format(well.getRow()) + columnFormatter.format(well.getColumn()) + "]";
    68 
    69  
    70  
    7168 
    7269  if (well != null && !well.hasPermission(Permission.WRITE))
     
    7976  %>
    8077  <base:page type="popup" title="<%=title%>">
    81   <base:head scripts="tabcontrol.js,annotations.js" styles="tabcontrol.css">
     78  <base:head scripts="tabcontrol.js" styles="tabcontrol.css">
    8279    <ext:scripts context="<%=jspContext%>" />
    8380    <ext:stylesheets context="<%=jspContext%>" />
     
    9693      if (TabControl.validateActiveTab('settings'))
    9794      {
    98         if (annotationsLoaded)
    99         {
    100           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    101         }
    102         if (inheritedAnnotationsLoaded)
    103         {
    104           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    105         }
     95        Annotations.saveModifiedAnnotationsToForm(frm);
     96        Annotations.saveInheritedAnnotationsToForm(frm);
    10697        frm.submit();
    10798      }
    10899    }
    109100   
    110     var annotationsLoaded = false;
    111     var inheritedAnnotationsLoaded = false;
    112     var parentsChanged = false;
    113     function switchTab(tabControlId, tabId)
     101    function loadAnnotationsFrame()
    114102    {
    115       if (TabControl.setActiveTab(tabControlId, tabId))
    116       {
    117         if (tabId == 'annotations' && !annotationsLoaded)
    118         {
    119           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=well == null ? 0 : well.getId()%>);
    120           annotationsLoaded = true;
    121         }
    122         else if (tabId == 'inheritedAnnotations' &&
    123           (parentsChanged || !inheritedAnnotationsLoaded))
    124         {
    125           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    126           inheritedAnnotationsLoaded = true;
    127           parentsChanged = false;
    128         }
    129       }
     103      Annotations.autoLoadEditFrame();
    130104    }
    131     function getParents()
     105   
     106    function loadInheritedAnnotationsFrame()
    132107    {
    133       return new Array();
     108      Annotations.autoLoadInheritFrame();
    134109    }
    135110    </script>
     
    143118    <t:tabcontrol id="settings"
    144119      subclass="content dialogtabcontrol"
    145       position="bottom" switch="switchTab"
     120      position="bottom"
    146121      extensions="<%=invoker%>">
    147122    <t:tab id="info" title="Well" validate="validateWell()" helpid="well.edit">
     
    170145    </t:tab>
    171146
    172     <t:tab id="annotations" title="Annotations" helpid="annotations.edit"><iframe
    173       name="annotations" id="idAnnotations" src="../../../common/annotations/wait.jsp"
    174       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>   
     147    <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     148      <jsp:include page="../../../common/annotations/annotate_frameset.jsp">
     149        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     150        <jsp:param name="item_id" value="<%=itemId%>" />
     151        <jsp:param name="ID" value="<%=ID%>" />
     152      </jsp:include>
     153    </t:tab>
    175154   
    176155    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    177       helpid="annotations.edit.inherited"><iframe
    178         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../../common/annotations/wait.jsp"
    179         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     156      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     157      <jsp:include page="../../../common/annotations/inherit_frameset.jsp">
     158        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     159        <jsp:param name="item_id" value="<%=itemId%>" />
     160        <jsp:param name="ID" value="<%=ID%>" />
     161      </jsp:include>
     162    </t:tab>
    180163    </t:tabcontrol>
    181164    </form>
  • trunk/www/views/derivedbioassays/edit_bioassay.jsp

    r6217 r6254  
    244244  %>
    245245  <base:page type="popup" title="<%=title%>">
    246   <base:head scripts="tabcontrol.js,annotations.js,platforms.js,subtypes.js,linkitems.js" styles="tabcontrol.css">
     246  <base:head scripts="tabcontrol.js,platforms.js,subtypes.js,linkitems.js" styles="tabcontrol.css">
    247247    <ext:scripts context="<%=jspContext%>" />
    248248    <ext:stylesheets context="<%=jspContext%>" />
     
    266266      if (TabControl.validateActiveTab('settings'))
    267267      {
    268         if (annotationsLoaded)
    269         {
    270           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    271         }
    272         if (inheritedAnnotationsLoaded)
    273         {
    274           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    275         }
     268        Annotations.saveModifiedAnnotationsToForm(frm);
     269        Annotations.saveInheritedAnnotationsToForm(frm);
    276270        if (dataFilesLoaded)
    277271        {
     
    292286    }
    293287   
    294     var annotationsLoaded = false;
    295     var inheritedAnnotationsLoaded = false;
    296     var parentsChanged = false;
    297     var protocolChanged = false;
     288    function loadAnnotationsFrame()
     289    {
     290      Annotations.autoLoadEditFrame(getProtocolId(), ItemSubtype.getSubtypeId('bioAssay'));
     291    }
     292   
     293    function loadInheritedAnnotationsFrame()
     294    {
     295      Annotations.autoLoadInheritFrame(getParents());
     296    }
     297
    298298    var subtypeChanged = false;
    299299    var dataFilesLoaded = false;
    300     function switchTab(tabControlId, tabId)
    301     {
    302       if (TabControl.setActiveTab(tabControlId, tabId))
    303       {
    304         if (tabId == 'annotations' && (protocolChanged || !annotationsLoaded))
    305         {
    306           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getProtocolId());
    307           annotationsLoaded = true;
    308           protocolChanged = false;
    309         }
    310         else if (tabId == 'inheritedAnnotations' &&
    311           (parentsChanged || !inheritedAnnotationsLoaded))
    312         {
    313           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    314           inheritedAnnotationsLoaded = true;
    315           parentsChanged = false;
    316         }
    317         else if (tabId == 'datafiles' && (subtypeChanged || !dataFilesLoaded))
    318         {
    319           var subtypeId = ItemSubtype.getSubtypeId('bioAssay');
    320           Platforms.loadDataFilesFrame(frames.datafiles, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, 0, 0, subtypeId);
    321           dataFilesLoaded = true;
    322           subtypeChanged = false;
    323         }
    324       }
    325     }
    326    
     300   
     301    function loadDataFilesFrame()
     302    {
     303      if (subtypeChanged || !dataFilesLoaded)
     304      {
     305        var subtypeId = ItemSubtype.getSubtypeId('bioAssay');
     306        Platforms.loadDataFilesFrame(frames.datafiles, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, 0, 0, subtypeId);
     307        dataFilesLoaded = true;
     308        subtypeChanged = false;
     309      }
     310    }
     311     
    327312    function getProtocolId()
    328313    {
     
    368353      subtypeChanged = true;
    369354      var recentInfo = ItemSubtype.getRecentAndRelatedInfo(subtypeId, 'BIOASSAY', ['PROTOCOL', 'HARDWARE', 'SOFTWARE']);
    370       protocolChanged = ItemSubtype.updateSelectionList(frm.protocol_id, recentInfo.PROTOCOL['recent'], recentInfo.PROTOCOL['default']);
     355      ItemSubtype.updateSelectionList(frm.protocol_id, recentInfo.PROTOCOL['recent'], recentInfo.PROTOCOL['default']);
    371356      ItemSubtype.updateSelectionList(frm.hardware_id, recentInfo.HARDWARE['recent'], recentInfo.HARDWARE['default']);
    372357      ItemSubtype.updateSelectionList(frm.software_id, recentInfo.SOFTWARE['recent'], recentInfo.SOFTWARE['default']);
     
    398383      list[1].text = name;
    399384      list.selectedIndex = 1;
    400       protocolChanged = true;
    401     }
    402     function protocolOnChange()
    403     {
    404       protocolChanged = true;
    405     }
    406    
    407     function physicalBioAssayOnChange()
    408     {
    409       parentsChanged = true;
    410     }
    411    
    412     function parentBioAssayOnChange()
    413     {
    414       parentsChanged = true;
    415385    }
    416386   
     
    538508      list[1].text = name;
    539509      list.selectedIndex = 1;
    540       extractOnChange();
    541     }
    542    
    543     function extractOnChange()
    544     {
    545       parentsChanged = true;
    546     }
    547 
     510    }
     511   
    548512    function addPhysicalBioAssayOnClick()
    549513    {
     
    561525      if (!item) item = new Item('P', pbaId, name);
    562526      Link.addItem(frm.physicalBioAssays, item);
    563       parentsChanged = true;
    564527    }
    565528
     
    567530    {
    568531      Link.removeSelected(document.forms['bioAssay'].physicalBioAssays);
    569       parentsChanged = true;
    570532    }
    571533
     
    586548      if (!item) item = new Item('D', dbaId, name);
    587549      Link.addItem(frm.parents, item);
    588       parentsChanged = true;
    589550    }
    590551
     
    592553    {
    593554      Link.removeSelected(document.forms['bioAssay'].parents);
    594       parentsChanged = true;
    595555    }
    596556
     
    699659      subclass="content dialogtabcontrol"
    700660      position="bottom" active="<%=tabId%>" remember="<%=tabId == null && bioAssay != null%>"
    701       switch="switchTab"
    702661      extensions="<%=invoker%>">
    703662    <t:tab id="info" title="Bioassay" validate="validateBioAssay()" helpid="derivedbioassay.edit">
     
    778737            <tr>
    779738            <td>
    780               <select name="physicalBioAssays" size="4" multiple onchange="physicalBioAssayOnChange()">
     739              <select name="physicalBioAssays" size="4" multiple>
    781740              </select>
    782741            </td>
     
    820779            <tr>
    821780            <td>
    822               <select name="parents" size="4" multiple onchange="parentsOnChange()">
     781              <select name="parents" size="4" multiple>
    823782              </select>
    824783            </td>
     
    865824            newitem="<%=bioAssay == null%>"
    866825            onselect="selectExtractOnClick()"
    867             onchange="extractOnChange()"
    868826          />
    869827        </td>
     
    883841            newitem="<%=bioAssay == null%>"
    884842            onselect="selectProtocolOnClick()"
    885             onchange="protocolOnChange()"
    886843          />
    887844        </td>
     
    936893    </t:tab>
    937894
    938     <t:tab id="datafiles" title="Data files" helpid="datafiles.edit"><iframe
     895    <t:tab id="datafiles" title="Data files" helpid="datafiles.edit" activate="loadDataFilesFrame()"><iframe
    939896      name="datafiles" id="idDatafiles" src="../../common/datafiles/wait.jsp"
    940897      class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
    941898
    942     <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit"><iframe
    943       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    944       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     899    <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     900      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     901        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     902        <jsp:param name="item_id" value="<%=itemId%>" />
     903        <jsp:param name="ID" value="<%=ID%>" />
     904      </jsp:include>
     905    </t:tab>
    945906   
    946907    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    947       helpid="annotations.edit.inherited"><iframe
    948         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../common/annotations/wait.jsp"
    949         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     908      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     909      <jsp:include page="../../common/annotations/inherit_frameset.jsp">
     910        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     911        <jsp:param name="item_id" value="<%=itemId%>" />
     912        <jsp:param name="ID" value="<%=ID%>" />
     913      </jsp:include>
     914    </t:tab>
    950915    </t:tabcontrol>
    951916    </form>
  • trunk/www/views/experiments/bioassays/edit_bioassay.jsp

    r6217 r6254  
    6868  %>
    6969  <base:page type="popup" title="<%=title%>">
    70   <base:head scripts="tabcontrol.js,annotations.js" styles="tabcontrol.css">
     70  <base:head scripts="tabcontrol.js" styles="tabcontrol.css">
    7171    <ext:scripts context="<%=jspContext%>" />
    7272    <ext:stylesheets context="<%=jspContext%>" />
     
    9090      if (TabControl.validateActiveTab('settings'))
    9191      {
    92         if (annotationsLoaded)
    93         {
    94           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    95         }
    96         if (inheritedAnnotationsLoaded)
    97         {
    98           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    99         }
     92        Annotations.saveModifiedAnnotationsToForm(frm);
     93        Annotations.saveInheritedAnnotationsToForm(frm);
    10094        frm.submit();
    10195      }
    10296    }
    10397   
    104     var annotationsLoaded = false;
    105     var inheritedAnnotationsLoaded = false;
    106     var parentsChanged = false;
    107     var protocolChanged = false;
    108     function switchTab(tabControlId, tabId)
     98    function loadAnnotationsFrame()
    10999    {
    110       if (TabControl.setActiveTab(tabControlId, tabId))
    111       {
    112         if (tabId == 'annotations' && (protocolChanged || !annotationsLoaded))
    113         {
    114           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getProtocolId());
    115           annotationsLoaded = true;
    116           protocolChanged = false;
    117         }
    118         else if (tabId == 'inheritedAnnotations' &&
    119           (parentsChanged || !inheritedAnnotationsLoaded))
    120         {
    121           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    122           inheritedAnnotationsLoaded = true;
    123           parentsChanged = false;
    124         }
    125       }
     100      Annotations.autoLoadEditFrame();
    126101    }
    127     function getProtocolId()
     102   
     103    function loadInheritedAnnotationsFrame()
    128104    {
    129       // No protocol
    130       return 0;
     105      Annotations.autoLoadInheritFrame();
    131106    }
    132     function getParents()
    133     {
    134       // Parents are always fixed and if we pass null they will be loaded by
    135       // the annotate.jsp page
    136       return null;
    137     }   
    138107    function init()
    139108    {
     
    158127    <t:tabcontrol id="settings"
    159128      subclass="content dialogtabcontrol"
    160       position="bottom"  remember="<%=bioAssay != null%>" switch="switchTab"
     129      position="bottom"  remember="<%=bioAssay != null%>"
    161130      extensions="<%=invoker%>">
    162131    <t:tab id="info" title="Bioassay" validate="validateBioAssay()" helpid="bioassay.edit">
     
    181150      </table>
    182151    </t:tab> 
    183     <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit"><iframe
    184       name="annotations" id="idAnnotations" src="../../../common/annotations/wait.jsp"
    185       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     152    <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     153      <jsp:include page="../../../common/annotations/annotate_frameset.jsp">
     154        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     155        <jsp:param name="item_id" value="<%=itemId%>" />
     156        <jsp:param name="ID" value="<%=ID%>" />
     157      </jsp:include>
     158    </t:tab>
    186159   
    187160    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    188       helpid="annotations.edit.inherited"><iframe
    189         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../../common/annotations/wait.jsp"
    190         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     161      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     162      <jsp:include page="../../../common/annotations/inherit_frameset.jsp">
     163        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     164        <jsp:param name="item_id" value="<%=itemId%>" />
     165        <jsp:param name="ID" value="<%=ID%>" />
     166      </jsp:include>
     167    </t:tab>
    191168    </t:tabcontrol>
    192169    </form>
  • trunk/www/views/experiments/bioassaysets/edit_bioassayset.jsp

    r6217 r6254  
    7878  %>
    7979  <base:page type="popup" title="<%=title%>">
    80   <base:head scripts="tabcontrol.js,annotations.js" styles="tabcontrol.css">
     80  <base:head scripts="tabcontrol.js" styles="tabcontrol.css">
    8181    <ext:scripts context="<%=jspContext%>" />
    8282    <ext:stylesheets context="<%=jspContext%>" />
     
    100100      if (TabControl.validateActiveTab('settings'))
    101101      {
    102         if (annotationsLoaded)
    103         {
    104           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    105         }
    106         if (inheritedAnnotationsLoaded)
    107         {
    108           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    109         }
     102        Annotations.saveModifiedAnnotationsToForm(frm);
     103        Annotations.saveInheritedAnnotationsToForm(frm);
    110104        frm.submit();
    111105      }
    112106    }
    113107   
    114     var annotationsLoaded = false;
    115     var inheritedAnnotationsLoaded = false;
    116     var parentsChanged = false;
    117     var protocolChanged = false;
    118     function switchTab(tabControlId, tabId)
    119     {
    120       if (TabControl.setActiveTab(tabControlId, tabId))
    121       {
    122         if (tabId == 'annotations' && (protocolChanged || !annotationsLoaded))
    123         {
    124           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getProtocolId());
    125           annotationsLoaded = true;
    126           protocolChanged = false;
    127         }
    128         else if (tabId == 'inheritedAnnotations' &&
    129           (parentsChanged || !inheritedAnnotationsLoaded))
    130         {
    131           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    132           inheritedAnnotationsLoaded = true;
    133           parentsChanged = false;
    134         }
    135       }
    136     }
    137    
    138     function getProtocolId()
    139     {
    140       // No protocol
    141       return 0;
    142     }
    143    
    144     function getParents()
    145     {
    146       // Parents are always fixed and if we pass null they will be loaded by
    147       // the annotate.jsp page
    148       return null;
     108    function loadAnnotationsFrame()
     109    {
     110      Annotations.autoLoadEditFrame();
     111    }
     112   
     113    function loadInheritedAnnotationsFrame()
     114    {
     115      Annotations.autoLoadInheritFrame();
    149116    }
    150117   
     
    171138    <t:tabcontrol id="settings"
    172139      subclass="content dialogtabcontrol"
    173       position="bottom"  remember="<%=bioAssaySet != null%>" switch="switchTab"
     140      position="bottom"  remember="<%=bioAssaySet != null%>"
    174141      extensions="<%=invoker%>">
    175142    <t:tab id="info" title="Bioassay set" validate="validateBioAssaySet()" helpid="bioassayset.edit">
     
    212179      </table>
    213180    </t:tab>
    214     <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit"><iframe
    215       name="annotations" id="idAnnotations" src="../../../common/annotations/wait.jsp"
    216       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     181    <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     182      <jsp:include page="../../../common/annotations/annotate_frameset.jsp">
     183        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     184        <jsp:param name="item_id" value="<%=itemId%>" />
     185        <jsp:param name="ID" value="<%=ID%>" />
     186      </jsp:include>
     187    </t:tab>
    217188   
    218189    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    219       helpid="annotations.edit.inherited"><iframe
    220         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../../common/annotations/wait.jsp"
    221         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     190      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     191      <jsp:include page="../../../common/annotations/inherit_frameset.jsp">
     192        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     193        <jsp:param name="item_id" value="<%=itemId%>" />
     194        <jsp:param name="ID" value="<%=ID%>" />
     195      </jsp:include>
     196    </t:tab>
    222197    </t:tabcontrol>
    223198    </form>
  • trunk/www/views/experiments/edit_experiment.jsp

    r6217 r6254  
    152152  %>
    153153  <base:page type="popup" title="<%=title%>">
    154   <base:head scripts="tabcontrol.js,linkitems.js,annotations.js" styles="tabcontrol.css">
     154  <base:head scripts="tabcontrol.js,linkitems.js" styles="tabcontrol.css">
    155155    <ext:scripts context="<%=jspContext%>" />
    156156    <ext:stylesheets context="<%=jspContext%>" />
     
    188188      if (TabControl.validateActiveTab('settings'))
    189189      {
    190         if (annotationsLoaded)
    191         {
    192           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    193         }
     190        Annotations.saveModifiedAnnotationsToForm(frm);
    194191
    195192        frm.addedRawBioAssays.value = Link.getActionIds(1, 'R').join(',');
     
    203200    }
    204201   
    205     var annotationsLoaded = false;
    206     function switchTab(tabControlId, tabId)
    207     {
    208       var frm = document.forms['experiment'];
    209       if (TabControl.setActiveTab(tabControlId, tabId))
    210       {
    211         if (tabId == 'annotations' && (!annotationsLoaded))
    212         {
    213           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=experiment == null ? 0 : experiment.getId()%>);
    214           annotationsLoaded = true;
    215         }
    216       }
    217     }
    218 
     202    function loadAnnotationsFrame()
     203    {
     204      Annotations.autoLoadEditFrame();
     205    }
     206   
    219207    function addRawBioAssaysOnClick()
    220208    {
     
    359347      subclass="content dialogtabcontrol"
    360348      position="bottom" remember="<%=tabId == null && experiment != null%>"
    361       switch="switchTab"
    362349      extensions="<%=invoker%>">
    363350    <t:tab id="info" title="Experiment" validate="validateExperiment()" helpid="experiment.edit">
     
    623610      </t:tab>
    624611     
    625       <t:tab id="annotations" title="Annotations" helpid="annotations.edit"><iframe
    626         name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    627         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     612    <t:tab id="annotations" title="Annotations" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     613      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     614        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     615        <jsp:param name="item_id" value="<%=itemId%>" />
     616        <jsp:param name="ID" value="<%=ID%>" />
     617      </jsp:include>
     618    </t:tab>
    628619
    629620    </t:tabcontrol>
  • trunk/www/views/physicalbioassays/edit_bioassay.jsp

    r6217 r6254  
    248248  %>
    249249  <base:page type="popup" title="<%=title%>">
    250   <base:head scripts="tabcontrol.js,annotations.js,linkitems.js,subtypes.js" styles="tabcontrol.css">
     250  <base:head scripts="tabcontrol.js,linkitems.js,subtypes.js" styles="tabcontrol.css">
    251251    <ext:scripts context="<%=jspContext%>" />
    252252    <ext:stylesheets context="<%=jspContext%>" />
     
    280280      if (TabControl.validateActiveTab('settings'))
    281281      {
    282         if (annotationsLoaded)
    283         {
    284           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    285         }
    286         if (inheritedAnnotationsLoaded)
    287         {
    288           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    289         }
     282        Annotations.saveModifiedAnnotationsToForm(frm);
     283        Annotations.saveInheritedAnnotationsToForm(frm);
    290284        frm.modifiedExtracts.value = Link.exportModified(frm, 'E', true).join(',');
    291285        frm.removedExtracts.value = Link.getActionIds(-1, 'E').join(',');
     
    294288    }
    295289   
    296     var annotationsLoaded = false;
    297     var inheritedAnnotationsLoaded = false;
    298     var parentsChanged = false;
    299     var protocolChanged = false;
    300     function switchTab(tabControlId, tabId)
    301     {
    302       if (TabControl.setActiveTab(tabControlId, tabId))
    303       {
    304         if (tabId == 'annotations' && (protocolChanged || !annotationsLoaded))
    305         {
    306           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=pba == null ? 0 : pba.getId()%>, getProtocolId());
    307           annotationsLoaded = true;
    308           protocolChanged = false;
    309         }
    310         else if (tabId == 'inheritedAnnotations' &&
    311           (parentsChanged || !inheritedAnnotationsLoaded))
    312         {
    313           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    314           inheritedAnnotationsLoaded = true;
    315           parentsChanged = false;
    316         }
    317       }
     290    function loadAnnotationsFrame()
     291    {
     292      Annotations.autoLoadEditFrame(getProtocolId(), ItemSubtype.getSubtypeId('bioassay'));
     293    }
     294   
     295    function loadInheritedAnnotationsFrame()
     296    {
     297      Annotations.autoLoadInheritFrame(getParents());
    318298    }
    319299   
     
    337317      if (arraySlideId > 0) parents[parents.length] = 'ARRAYSLIDE:'+arraySlideId;
    338318
    339       var ids = Link.getListIds(frm.extracts, 'L');
     319      var ids = Link.getListIds(frm.extracts, 'E');
    340320      if (ids.length > 0)
    341321      {
     
    351331      var recentInfo = ItemSubtype.getRecentAndRelatedInfo(subtypeId, 'BIOASSAY', ['PROTOCOL', 'HARDWARE']);
    352332     
    353       protocolChanged = ItemSubtype.updateSelectionList(frm.protocol_id, recentInfo.PROTOCOL['recent'], recentInfo.PROTOCOL['default']);
     333      ItemSubtype.updateSelectionList(frm.protocol_id, recentInfo.PROTOCOL['recent'], recentInfo.PROTOCOL['default']);
    354334      ItemSubtype.updateSelectionList(frm.hardware_id, recentInfo.HARDWARE['recent'], recentInfo.HARDWARE['default']);
    355335    }
     
    379359      list[1].text = name;
    380360      list.selectedIndex = 1;
    381       protocolChanged = true;
    382     }
    383     function protocolOnChange()
    384     {
    385       protocolChanged = true;
    386361    }
    387362   
     
    418393      var arraySlideId = frm.arrayslide_id[selectedIndex].value;
    419394      if (arraySlideId > 0) updateSize(arraySlideId);
    420       parentsChanged = true;
    421395    }
    422396    function selectArraySlideOnClick()
     
    444418      frm.arrayslide_id.selectedIndex = 1;
    445419      updateSize(arraySlideId);
    446       parentsChanged = true;
    447420    }
    448421    function updateSize(arraySlideId)
     
    491464      if (!item) item = new Item('E', extractId, '1: '+name+' [-]', '', '');
    492465      Link.addItem(document.forms['bioassay'].extracts, item);
    493       parentsChanged = true;
    494466      extractsOnChange();
    495467    }
     
    544516    {
    545517      Link.removeSelected(document.forms['bioassay'].extracts);
    546       parentsChanged = true;
    547518    }
    548519
     
    595566    <t:tabcontrol id="settings"
    596567      subclass="content dialogtabcontrol"
    597       position="bottom"  remember="<%=pba != null%>" switch="switchTab"
     568      position="bottom"  remember="<%=pba != null%>"
    598569      extensions="<%=invoker%>">
    599570    <t:tab id="info" title="Physical bioassay" validate="validatePhysicalBioAssay()" helpid="physicalbioassay.edit">
     
    686657            newitem="<%=pba == null%>"
    687658            onselect="selectProtocolOnClick()"
    688             onchange="protocolOnChange()"
    689659          />
    690660        </td>
     
    802772    </t:tab>
    803773
    804     <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit"><iframe
    805       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    806       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     774    <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     775      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     776        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     777        <jsp:param name="item_id" value="<%=itemId%>" />
     778        <jsp:param name="ID" value="<%=ID%>" />
     779      </jsp:include>
     780    </t:tab>
    807781   
    808782    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    809       helpid="annotations.edit.inherited"><iframe
    810         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../common/annotations/wait.jsp"
    811         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     783      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     784      <jsp:include page="../../common/annotations/inherit_frameset.jsp">
     785        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     786        <jsp:param name="item_id" value="<%=itemId%>" />
     787        <jsp:param name="ID" value="<%=ID%>" />
     788      </jsp:include>
     789    </t:tab>
    812790    </t:tabcontrol>
    813791    </form>
  • trunk/www/views/rawbioassays/edit_rawbioassay.jsp

    r6217 r6254  
    332332  %>
    333333  <base:page type="popup" title="<%=title%>">
    334   <base:head scripts="tabcontrol.js,annotations.js,platforms.js" styles="tabcontrol.css">
     334  <base:head scripts="tabcontrol.js,platforms.js" styles="tabcontrol.css">
    335335    <ext:scripts context="<%=jspContext%>" />
    336336    <ext:stylesheets context="<%=jspContext%>" />
     
    354354      if (TabControl.validateActiveTab('settings'))
    355355      {
    356         if (annotationsLoaded)
    357         {
    358           Annotations.addModifiedAnnotationsToForm(frames.annotations, frm);
    359         }
    360         if (inheritedAnnotationsLoaded)
    361         {
    362           Annotations.addInheritedAnnotationsToForm(frames.inheritedAnnotations, frm);
    363         }
     356        Annotations.saveModifiedAnnotationsToForm(frm);
     357        Annotations.saveInheritedAnnotationsToForm(frm);
    364358        if (dataFilesLoaded)
    365359        {
     
    370364    }
    371365   
    372     var annotationsLoaded = false;
    373     var inheritedAnnotationsLoaded = false;
    374     var parentsChanged = false;
    375     var protocolChanged = false;
     366    function loadAnnotationsFrame()
     367    {
     368      Annotations.autoLoadEditFrame(getProtocolId());
     369    }
     370   
     371    function loadInheritedAnnotationsFrame()
     372    {
     373      Annotations.autoLoadInheritFrame(getParents());
     374    }
     375 
    376376    var dataFilesLoaded = false;
    377377    var platformChanged = false;
    378     function switchTab(tabControlId, tabId)
    379     {
    380       var frm = document.forms['rawbioassay'];
    381       if (TabControl.setActiveTab(tabControlId, tabId))
    382       {
    383         if (tabId == 'annotations' && (protocolChanged || !annotationsLoaded))
    384         {
    385           Annotations.loadAnnotateFrame(frames.annotations, '<%=ID%>', '<%=itemType.name()%>', <%=rawBioAssay == null ? 0 : rawBioAssay.getId()%>, getProtocolId());
    386           annotationsLoaded = true;
    387           protocolChanged = false;
    388         }
    389         else if (tabId == 'inheritedAnnotations' &&
    390           (parentsChanged || !inheritedAnnotationsLoaded))
    391         {
    392           Annotations.loadInheritFrame(frames.inheritedAnnotations, '<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, getParents());
    393           inheritedAnnotationsLoaded = true;
    394           parentsChanged = false;
    395         }
    396         else if (tabId == 'datafiles' && (platformChanged || !dataFilesLoaded))
    397         {
    398           var platform = Platforms.getSelectedPlatform(frm.platform);
    399           var variant = Platforms.getSelectedVariant(frm.platform);
    400           Platforms.loadDataFilesFrame(frames.datafiles, '<%=ID%>', '<%=itemType.name()%>', <%=rawBioAssay == null ? 0 : rawBioAssay.getId()%>, platform == null ? 0 : platform.id, variant == null ? 0 : variant.id);
    401           dataFilesLoaded = true;
    402           platformChanged = false;
    403         }
    404       }
    405     }
    406 
     378
     379    function loadDataFilesFrame()
     380    {
     381      var frm = document.forms['rawbioassay'];
     382      if (platformChanged || !dataFilesLoaded)
     383      {
     384        var platform = Platforms.getSelectedPlatform(frm.platform);
     385        var variant = Platforms.getSelectedVariant(frm.platform);
     386        Platforms.loadDataFilesFrame(frames.datafiles, '<%=ID%>', '<%=itemType.name()%>', <%=rawBioAssay == null ? 0 : rawBioAssay.getId()%>, platform == null ? 0 : platform.id, variant == null ? 0 : variant.id);
     387        dataFilesLoaded = true;
     388        platformChanged = false;
     389      }
     390    }
     391   
    407392    function platformOnChange()
    408393    {
     
    489474      list[1].text = name;
    490475      list.selectedIndex = 1;
    491       protocolChanged = true;
    492     }
    493     function protocolOnChange()
    494     {
    495       protocolChanged = true;
    496476    }
    497477   
     
    502482      var bioAssayId = Math.abs(frm.bioassay_id[frm.bioassay_id.selectedIndex].value);
    503483      if (bioAssayId > 0) updateArrayDesign(bioAssayId);
    504       parentsChanged = true;
    505484    }
    506485    function selectBioAssayOnClick()
     
    529508    }
    530509
    531     function extractOnChange()
    532     {
    533       parentsChanged = true;
    534     }
    535510    function selectExtractOnClick()
    536511    {
     
    580555      list[1].text = name;
    581556      list.selectedIndex = 1;
    582       extractOnChange();
    583557    }
    584558   
     
    610584    function arrayDesignOnChange()
    611585    {
    612       parentsChanged = true;
    613586      <%
    614587      if (rawBioAssay != null && rawBioAssay.getNumDbSpots() > 0)
     
    654627      list[1].text = name;
    655628      list.selectedIndex = 1;
    656       parentsChanged = true;
    657629      arrayDesignOnChange();
    658630    }
     
    743715      position="bottom" active="<%=tabId%>"
    744716      remember="<%=tabId == null && rawBioAssay != null%>"
    745       switch="switchTab"
    746717      extensions="<%=invoker%>">
    747718    <t:tab id="info" title="Raw bioassay" validate="validateRawBioAssay()" helpid="rawbioassay.edit">
     
    823794            selectrecent="false"
    824795            onselect="selectExtractOnClick()"
    825             onchange="extractOnChange()"
    826796          />
    827797        </td>
     
    875845            newitem="<%=rawBioAssay == null%>"
    876846            onselect="selectProtocolOnClick()"
    877             onchange="protocolOnChange()"
    878847          />
    879848        </td>
     
    910879    </t:tab>
    911880   
    912     <t:tab id="datafiles" title="Data files" helpid="datafiles.edit"><iframe
     881    <t:tab id="datafiles" title="Data files" helpid="datafiles.edit" activate="loadDataFilesFrame()"><iframe
    913882      name="datafiles" id="idDatafiles" src="../../common/datafiles/wait.jsp"
    914883      class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
    915884
    916     <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit"><iframe
    917       name="annotations" id="idAnnotations" src="../../common/annotations/wait.jsp"
    918       class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     885    <t:tab id="annotations" title="Annotations &amp; parameters" helpid="annotations.edit" activate="loadAnnotationsFrame()">
     886      <jsp:include page="../../common/annotations/annotate_frameset.jsp">
     887        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     888        <jsp:param name="item_id" value="<%=itemId%>" />
     889        <jsp:param name="ID" value="<%=ID%>" />
     890      </jsp:include>
     891    </t:tab>
    919892   
    920893    <t:tab id="inheritedAnnotations" title="Inherited annotations"
    921       helpid="annotations.edit.inherited"><iframe
    922         name="inheritedAnnotations" id="idInheritedAnnotations" src="../../common/annotations/wait.jsp"
    923         class="absolutefull" style="width: 100%; height: 100%;"></iframe></t:tab>
     894      helpid="annotations.edit.inherited" activate="loadInheritedAnnotationsFrame()">
     895      <jsp:include page="../../common/annotations/inherit_frameset.jsp">
     896        <jsp:param name="item_type" value="<%=itemType.name()%>" />
     897        <jsp:param name="item_id" value="<%=itemId%>" />
     898        <jsp:param name="ID" value="<%=ID%>" />
     899      </jsp:include>
     900    </t:tab>
    924901    </t:tabcontrol>
    925902    </form>
Note: See TracChangeset for help on using the changeset viewer.