From 09920275ac8dc088dd11e2441f3d9f64d19313a3 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 3 Jan 2007 01:41:28 +0000 Subject: [PATCH] Closes #424, "Create Zotero Note from Selection" should create a webpage item automatically Also make "Add Selection to Zotero Note" note not add two newlines before the text if the note is empty --- chrome/content/zotero/overlay.js | 4 +++- chrome/content/zotero/overlay.xul | 2 +- chrome/locale/en-US/zotero/zotero.dtd | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index ff168b6aa..b93d11654 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -1165,7 +1165,7 @@ var ZoteroPane = new function() if (itemsView.selection.count == 1 && items[0] && items[0].isNote()) { var note = items[0].getNote() - items[0].updateNote(note + "\n\n" + text); + items[0].updateNote(note == '' ? text : note + "\n\n" + text); var noteElem = document.getElementById('zotero-note-editor') noteElem.focus(); noteElem.id('noteField').inputField.editor. @@ -1242,6 +1242,8 @@ var ZoteroPane = new function() { addAttachmentFromPage(false, item.getID(), true); } + + return item.getID(); } diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul index 5940ee8d1..15220d81a 100644 --- a/chrome/content/zotero/overlay.xul +++ b/chrome/content/zotero/overlay.xul @@ -51,7 +51,7 @@ oncommand="ZoteroPane.addTextToNote(window.content.getSelection().toString())"/> + oncommand="var itemID = ZoteroPane.addItemFromPage(); ZoteroPane.newNote(false, itemID, window.content.getSelection().toString())"/> diff --git a/chrome/locale/en-US/zotero/zotero.dtd b/chrome/locale/en-US/zotero/zotero.dtd index d602b277a..51b95fda8 100644 --- a/chrome/locale/en-US/zotero/zotero.dtd +++ b/chrome/locale/en-US/zotero/zotero.dtd @@ -1,5 +1,5 @@ - +