From dea69fac3d5a82ebbe7b8169b4a46b98a6d696d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikko=20R=C3=B6nkk=C3=B6?= Date: Thu, 3 Nov 2011 16:31:31 +0200 Subject: [PATCH] Added grouping of items by library and separators for libraries to QuickFormat dialog --- .../content/zotero/integration/quickFormat.js | 72 +++++++++++++++++-- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index 9c2e0e270..b7d53d6f9 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -265,19 +265,38 @@ var Zotero_QuickFormat = new function () { while(referenceBox.hasChildNodes()) referenceBox.removeChild(referenceBox.firstChild); + var firstSelectableIndex = 0; + if(ids.length) { if(ids.length > 50) ids = ids.slice(0, 50); var items = Zotero.Items.get(ids); + + firstSelectableIndex = 1; + + //TODO: sort the currently used items in before any other items + items.sort(function(a, b) {return a.libraryID > b.libraryID}) + + var previousLibrary = -1; + for(var i=0, n=items.length; i