From db6ec2b160b6f80bfb70d3c06a53a98be85d9405 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 28 May 2014 14:31:58 -0400 Subject: [PATCH] Persist single position/size for all note windows Previously, position/size was persisted for each item's note individually, but that meant that there was no default position/size for the note window and an entry was created in localstore.rdf for every note opened in a new window. There's also a good chance people had no idea what was going on. --- chrome/content/zotero/note.js | 15 +++++---------- chrome/content/zotero/note.xul | 1 + chrome/content/zotero/zoteroPane.js | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/chrome/content/zotero/note.js b/chrome/content/zotero/note.js index c4cb38ecc..0de594413 100644 --- a/chrome/content/zotero/note.js +++ b/chrome/content/zotero/note.js @@ -34,17 +34,12 @@ function onLoad() { // Set font size from pref Zotero.setFontSize(noteEditor); - var params = []; - var b = document.location.href.substr(document.location.href.indexOf('?')+1).split('&'); - for(var i = 0; i < b.length; i++) - { - var mid = b[i].indexOf('='); - - params[b[i].substr(0,mid)] = b[i].substr(mid+1); + if (window.arguments) { + var io = window.arguments[0]; } - var itemID = params.id; - var collectionID = params.coll; - var parentItemID = params.p; + var itemID = io.itemID; + var collectionID = io.collectionID; + var parentItemID = io.parentItemID; if (itemID) { var ref = Zotero.Items.get(itemID); diff --git a/chrome/content/zotero/note.xul b/chrome/content/zotero/note.xul index 2a83fd819..ec4ea7e4b 100644 --- a/chrome/content/zotero/note.xul +++ b/chrome/content/zotero/note.xul @@ -11,6 +11,7 @@ height="350" title="&zotero.items.menu.attach.note;" persist="screenX screenY width height" + windowtype="zotero:note" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">