DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Alpha-Sort IDs on Insert Content Reference Dialog

  • jperkins

    Alpha-Sort IDs on Insert Content Reference Dialog

    Participants 1
    Replies 0
    Last Activity 13 years, 5 months ago

    As part of our online module authoring process, we make several dozen content references into a large topic with many IDs. To speed up the process, I created a startup macro that will alpha sort the IDs on the “Insert Content Reference” dialog, making it easier to locate a particular ID.

    I thought I'd share it in case anyone else might find it useful. Just create a new .mcr file in your startup folder and paste it in.

    [pre]



     
         
      InsertConrefDlgDataModel.prototype._old_setCandidateElems = InsertConrefDlgDataModel.prototype.setCandidateElems;   InsertConrefDlgDataModel.prototype.setCandidateElems = function()
      {
        this._old_setCandidateElems();     var sortfn = function(a, b) {
    var aid = a.getAttribute(“id”);
    var bid = b.getAttribute(“id”);
    if (aid < bid)
    return -1;
    else if (aid > bid)
    return 1;
    else
    return 0;
    } this.fCandidateElems.sort(sortfn);
      }
      ]]>


    [/pre]

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support