From 2bbf3d7c80795238ca105f8343e4c83e8e6df4dc Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 15 Oct 2008 05:24:38 +0000 Subject: [PATCH] - Restored read-only mode for notes (using a separate HTML file, for lack of a better way) - HTML file is now loaded on-demand the first time it's required --- .../zotero/bindings/styled-textbox.xml | 89 +++++++++++-------- chrome/content/zotero/tinymce/note.html | 38 +------- chrome/content/zotero/tinymce/noteview.html | 54 +++++++++++ .../skin/default/zotero/tinymce/note-ui.css | 32 +++++++ 4 files changed, 141 insertions(+), 72 deletions(-) create mode 100644 chrome/content/zotero/tinymce/noteview.html create mode 100644 chrome/skin/default/zotero/tinymce/note-ui.css diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml index fabf725412..1475b117ca 100644 --- a/chrome/content/zotero/bindings/styled-textbox.xml +++ b/chrome/content/zotero/bindings/styled-textbox.xml @@ -28,6 +28,7 @@ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + @@ -63,11 +64,6 @@ // tables, which wouldn't work here. ' ':"\t" }; - - // not sure why an event is necessary here, but it is - var me = this; - this._loadHandler = function() {me._iframeLoaded()}; - this._iframe.addEventListener("DOMContentLoaded", this._loadHandler, false); ]]> @@ -214,8 +181,13 @@ } if(!this._editor) { - // if not loaded, wait until it is to set - return this._value = val; + Zotero.debug('No editor yet'); + + this._value = val; + if (!this._loaded) { + this._load(); + } + return ; } if (this.value == val) { @@ -270,6 +242,51 @@ + + + + + + + + diff --git a/chrome/content/zotero/tinymce/note.html b/chrome/content/zotero/tinymce/note.html index c84d53efb6..1064566458 100755 --- a/chrome/content/zotero/tinymce/note.html +++ b/chrome/content/zotero/tinymce/note.html @@ -2,39 +2,7 @@ TinyMCE - + diff --git a/chrome/content/zotero/tinymce/noteview.html b/chrome/content/zotero/tinymce/noteview.html new file mode 100644 index 0000000000..ba89735e13 --- /dev/null +++ b/chrome/content/zotero/tinymce/noteview.html @@ -0,0 +1,54 @@ + + + +TinyMCE + + + + + + +
+ + diff --git a/chrome/skin/default/zotero/tinymce/note-ui.css b/chrome/skin/default/zotero/tinymce/note-ui.css new file mode 100644 index 0000000000..3c04ff60e3 --- /dev/null +++ b/chrome/skin/default/zotero/tinymce/note-ui.css @@ -0,0 +1,32 @@ +html, body { + height: 100%; + margin: 0; +} +#tinymce_parent { + display: block; + height: 100%; +} +#tinymce_tbl { + height: 100% !important; + width: 100% !important; +} + +table.mceLayout > tbody > tr.mceLast { + position: absolute; + display: block; + top: 54px; + bottom: 2px; + left: 1px; + right: 1px; +} + +td.mceIframeContainer { + display: block; + height: 100% !important; + width: 100% !important; +} +#tinymce_ifr { + height: 100% !important; + width: 100% !important; +} +