Changeset 6975


Ignore:
Timestamp:
Oct 8, 2015, 8:11:11 AM (6 years ago)
Author:
Nicklas Nordborg
Message:

References #1941: Store experimental factor values as part experiments

Added 'Clone' button in the 'Inherit annotations' dialog to make it possible to clone annotations in a single step without having to re-select and clone in a second step.

Location:
branches/3.6-stable
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/3.6-stable/doc/src/docbook/user/annotations.xml

    r6961 r6975  
    807807        </para>
    808808       
     809        <para>
     810          Use the <guibutton>Inherit</guibutton> button to inherit the selected
     811          annotations by reference, and the <guibutton>Clone</guibutton> button
     812          to clone the values of the selected annotations.
     813        </para>
     814       
    809815        <note>
    810816          <itemizedlist>
    811817          <listitem>
    812818            <para>
    813             Already inherited annotations are not shown in the dialog.
    814             </para>
    815           </listitem>
    816           <listitem>
    817             <para>
    818             By default, the inheritance is implemented by reference. To convert
    819             it to a cloned annotation select it in the list and click on <guilabel>clone</guilabel>.
     819            Already inherited or cloned annotations are not shown in the dialog.
     820            </para>
     821          </listitem>
     822          <listitem>
     823            <para>
     824            Annotations that are inherited by reference can easily be converted to
     825            cloned annotations. Select the annotation in the list and click on the
     826            <guilabel>clone</guilabel> link.
    820827            <nohelp>
    821828            <figure>
     
    831838            </figure>
    832839            </nohelp>
    833 
    834840            </para>
    835841          </listitem>
  • branches/3.6-stable/www/common/annotations/annotate.js

    r6974 r6975  
    981981    Doc.show('inherited-list');
    982982    var inheritedId = event.detail.id;
     983    var clone = event.detail.clone;
    983984   
    984985    // Check if we have info about this annotation already
     
    989990      {
    990991        entry.modified = INHERITED;
     992        if (clone && entry.source != 'CLONED')
     993        {
     994          annotate.convertToCloned(entry);
     995        }
     996        else if (!clone && entry.source != 'INHERITED')
     997        {
     998          annotate.convertToInherited(entry);
     999        }
    9911000        Doc.show(entry.id);
    9921001        return;
     
    10021011    request.open("GET", url, true);
    10031012    request.send(null);
    1004     Ajax.setReadyStateHandler(request, annotate.inheritInfoLoaded, annotate.inheritInfoLoaded);
     1013    var callback = clone ? annotate.inheritInfoLoadedAndClone : annotate.inheritInfoLoaded;
     1014    Ajax.setReadyStateHandler(request, callback, callback);
     1015  }
     1016 
     1017  /**
     1018    Callback that converts the inherited annotation to a cloned
     1019    annotation.
     1020  */
     1021  annotate.inheritInfoLoadedAndClone = function(request)
     1022  {
     1023    var entry = annotate.inheritInfoLoaded(request);
     1024    annotate.convertToCloned(entry);
    10051025  }
    10061026 
     
    10231043    annotations[annotations.length] = entry;
    10241044    annotate.createAnnotationEntryInList(entry, true);
     1045    return entry;
    10251046  }
    10261047 
  • branches/3.6-stable/www/common/annotations/inherit.js

    r6947 r6975  
    3232    // Buttons (on standalone dialog)
    3333    Buttons.addClickHandler('close', App.closeWindow);
    34     Buttons.addClickHandler('btnOk', inherit.save);
     34    Buttons.addClickHandler('btnInherit', inherit.save);
     35    Buttons.addClickHandler('btnClone', inherit.save);
    3536   
    3637    Events.addEventHandler('quickFilter', 'keyup', inherit.quickFilter);
     
    8081  }
    8182 
    82   inherit.saveInheritedAnnotations = function()
     83  inherit.saveInheritedAnnotations = function(clone)
    8384  {
    8485    var tree = Doc.element('joust');
     
    100101          var detail = {};
    101102          detail.id = menuItem.externalId;
     103          detail.clone = clone;
    102104          if (isInherited)
    103105          {
     
    140142    Save the annotations in standalone mode.
    141143  */
    142   inherit.save = function()
     144  inherit.save = function(event)
    143145  {
    144     inherit.saveInheritedAnnotations();
     146    var clone = Data.int(event.currentTarget, 'clone', 0);
     147    inherit.saveInheritedAnnotations(clone);
    145148    App.closeWindow();
    146149  }
  • branches/3.6-stable/www/common/annotations/inherit.jsp

    r6947 r6975  
    371371
    372372  <base:buttongroup subclass="dialogbuttons">
    373     <base:button id="btnOk" title="Ok" />
     373    <base:button id="btnClone" title="Clone" image="copy.png" data-clone="1" />
     374    <base:button id="btnInherit" title="Inherit" image="inherit.png" />
    374375    <base:button id="close" title="Cancel" />
    375376  </base:buttongroup>
Note: See TracChangeset for help on using the changeset viewer.