DITA and XMetaL Discussion
XMetaL Community Forum › DITA and XMetaL Discussion › Alpha-Sort IDs on Insert Content Reference Dialog
-
jperkins January 6, 2009 at 2:51 pm
Alpha-Sort IDs on Insert Content Reference Dialog
January 6, 2009 at 2:51 pmParticipants 1Replies 0Last Activity 14 years, 2 months agoAs 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] -
AuthorPosts
- You must be logged in to reply to this topic.