diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml
index 31ca1763dd..d37836eb43 100644
--- a/chrome/content/zotero/bindings/styled-textbox.xml
+++ b/chrome/content/zotero/bindings/styled-textbox.xml
@@ -27,272 +27,153 @@
xmlns:xbl="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
":"\x0B",
+ "":"\\super ",
+ "":"\\super0 ",
+ "":"\\sub ",
+ "":"\\sub0 ",
+ // there's no way to mimic a tab stop in CSS without
+ // tables, which wouldn't work here.
+ ' ':"\t"
};
- // globals
- this._formatMap = {
- "Integration":{
- "\\":"\\\\",
- "&":"&",
- "<":"<",
- ">":">",
- "":"\\i ",
- "":"\\i0 ",
- "":"\\b ",
- "":"\\b0 ",
- "":"\\ul ",
- "":"\\ul0 ",
- "
":"\x0B",
- "":"\\super ",
- "":"\\super0 ",
- "":"\\sub ",
- "":"\\sub0 ",
- // there's no way to mimic a tab stop in CSS without
- // tables, which wouldn't work here.
- ' ':"\t"
- }
- };
-
- // defaults
- this._format = "HTML";
- this._readonly = false;
- this._styleWithCSS = false;
- // storage variables before loaded
- this._value = false;
- this._toggle = [];
-
- // why is this necessary? because the browser takes time to
- // load, but doesn't appear to fire an event when loaded,
- // when recovering from being hidden. why does this work?
- // no idea.
- this._isLoaded = false;
+ // not sure why an event is necessary here, but it is
var me = this;
- if(this.hasAttribute("hidden")) {
- window.setTimeout(function() {me._loaded()}, 1);
- } else {
- this._browser.contentWindow.addEventListener("load", function() {me._loaded()}, false);
- }
+ this._loadHandler = function() {me._browserLoaded()};
+ this._browser.addEventListener("DOMContentLoaded", this._loadHandler, false);
]]>
"); - this._browser.contentDocument.close(); - this._browser.contentDocument.designMode = (this._readonly ? "off" : "on"); - try { - this._browser.contentDocument.execCommand("styleWithCSS", false, this._styleWithCSS); - } catch(e) {} - - this._updateButtons(); - } else { - this._value = val; + // do appropriate replacement operations + for(var needle in this._rtfMap) { + if(this._rtfMap[needle]) { + html = html.replace(this._rtfMap[needle], needle, "g"); + } + } + html = '
'+html.replace("\par ", "
")+"
";
+ Zotero.debug("setting content to "+html);
}
+
+ this._editor.setContent(html);
return val;
]]>
-
-
-
+ + + +
+