- Fix error saving attachments
- Increase default separate note window height
This commit is contained in:
parent
1d6dea45ec
commit
ad5ac7ba64
2 changed files with 16 additions and 14 deletions
|
@ -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">
|
||||
|
|
|
@ -1996,21 +1996,23 @@ 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, ' ')
|
||||
.replace(/ /g, ' ')
|
||||
+ '</p>';
|
||||
note = note.replace(/<p>\s*<\/p>/g, '<p> </p>');
|
||||
var sql = "UPDATE itemNotes SET note=? WHERE itemID=?";
|
||||
Zotero.DB.query(sql, [note, this.id]);
|
||||
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, ' ')
|
||||
.replace(/ /g, ' ')
|
||||
+ '</p>';
|
||||
note = note.replace(/<p>\s*<\/p>/g, '<p> </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');
|
||||
}
|
||||
|
||||
// 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 : '';
|
||||
|
||||
return this._noteText;
|
||||
|
|
Loading…
Add table
Reference in a new issue