www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit ad5ac7ba641044765735eeaf8f02ab84a39c8b3f
parent 1d6dea45ecd2fa61474eb8a4addafd9443cad58f
Author: Dan Stillman <dstillman@zotero.org>
Date:   Wed, 15 Oct 2008 05:30:59 +0000

- Fix error saving attachments
- Increase default separate note window height


Diffstat:
Mchrome/content/zotero/note.xul | 2+-
Mchrome/content/zotero/xpcom/data/item.js | 30++++++++++++++++--------------
2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/chrome/content/zotero/note.xul b/chrome/content/zotero/note.xul @@ -8,7 +8,7 @@ id="zotero-note-window" orient="vertical" width="400" - height="250" + height="350" title="&zotero.items.menu.attach.note;" persist="screenX screenY width height" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -1996,20 +1996,22 @@ Zotero.Item.prototype.getNote = function() { var note = Zotero.DB.valueQuery(sql, this.id); // Convert non-HTML notes on-the-fly - if (!note.match(/^<div class="zotero-note znv[0-9]+">[\s\S]*<\/div>$/)) { - note = Zotero.Utilities.prototype.htmlSpecialChars(note); - note = '<p>' - + note.replace(/\n/g, '</p><p>') - .replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;') - .replace(/ /g, '&nbsp;&nbsp;') - + '</p>'; - note = note.replace(/<p>\s*<\/p>/g, '<p>&nbsp;</p>'); - var sql = "UPDATE itemNotes SET note=? WHERE itemID=?"; - Zotero.DB.query(sql, [note, this.id]); - } - - // Don't include <div> wrapper when returning value - note = note.replace(/^<div class="zotero-note znv[0-9]+">([\s\S]*)<\/div>$/, '$1'); + if (note) { + if (!note.match(/^<div class="zotero-note znv[0-9]+">[\s\S]*<\/div>$/)) { + note = Zotero.Utilities.prototype.htmlSpecialChars(note); + note = '<p>' + + note.replace(/\n/g, '</p><p>') + .replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;') + .replace(/ /g, '&nbsp;&nbsp;') + + '</p>'; + note = note.replace(/<p>\s*<\/p>/g, '<p>&nbsp;</p>'); + var sql = "UPDATE itemNotes SET note=? WHERE itemID=?"; + Zotero.DB.query(sql, [note, this.id]); + } + + // Don't include <div> wrapper when returning value + note = note.replace(/^<div class="zotero-note znv[0-9]+">([\s\S]*)<\/div>$/, '$1'); + } this._noteText = note ? note : '';