commit 8070a22d08ba6b1a3527f08380be6b76f5d8f86a
parent 11b05a5a41b8eac5f1531aa834838d657e0b188d
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 27 Oct 2008 16:39:18 +0000
Load TinyMCE as chrome to avoid NoScript blockage
Diffstat:
5 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml
@@ -249,17 +249,14 @@
var ios = Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
var uri = ios.newURI("chrome://zotero/content/tinymce/" + htmlFile + ".html", null, null);
- var chromeReg = Components.classes["@mozilla.org/chrome/chrome-registry;1"].
- getService(Components.interfaces.nsIChromeRegistry);
- var fileURI = chromeReg.convertChromeURL(uri);
- Zotero.debug("Loading " + fileURI.spec);
+ Zotero.debug("Loading " + uri.spec);
// Register handler for deferred setting of content
var self = this;
var listener = function() {
self._iframe.removeEventListener("DOMContentLoaded", listener, false);
- var editor = self._iframe.contentWindow.wrappedJSObject.tinyMCE.get("tinymce");
+ var editor = self._iframe.contentWindow.tinyMCE.get("tinymce");
editor.onInit.add(function() {
self._editor = editor;
@@ -269,13 +266,12 @@
});
if (self._eventHandler) {
- self._iframe.contentWindow.wrappedJSObject.handleEvent = self._eventHandler;
+ self._iframe.contentWindow.handleEvent = self._eventHandler;
}
};
this._iframe.addEventListener("DOMContentLoaded", listener, false);
- Zotero.debug("Loading " + fileURI.spec);
- this._iframe.webNavigation.loadURI(fileURI.spec,
+ this._iframe.webNavigation.loadURI(uri.spec,
Components.interfaces.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
]]>
</body>
@@ -284,7 +280,7 @@
</implementation>
<content>
- <xul:iframe flex="1" anonid="rt-view" class="rt-view" type="content"
+ <xul:iframe flex="1" anonid="rt-view" class="rt-view"
xbl:inherits="onfocus,onblur,flex,width,height,hidden"
style="overflow: hidden"/>
</content>
diff --git a/chrome/content/zotero/tinymce/integration.html b/chrome/content/zotero/tinymce/integration.html
@@ -26,7 +26,7 @@ html, body {
// General options
mode : "none",
theme : "advanced",
- content_css : "../../../skin/default/zotero/tinymce/integration-content.css",
+ content_css : "chrome://zotero/skin/tinymce/integration-content.css",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,|,sub,sup,|,removeformat",
diff --git a/chrome/content/zotero/tinymce/note.html b/chrome/content/zotero/tinymce/note.html
@@ -2,14 +2,14 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TinyMCE</title>
-<link type="text/css" rel="stylesheet" href="../../../skin/default/zotero/tinymce/note-ui.css"/>
+<link type="text/css" rel="stylesheet" href="chrome://zotero/skin/tinymce/note-ui.css"/>
<script type="text/javascript" src="tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "none",
theme : "advanced",
- content_css : "../../../skin/default/zotero/tinymce/note-content.css",
+ content_css : "chrome://zotero/skin/tinymce/note-content.css",
button_tile_map : true,
language : "en", // TODO: localize
entity_encoding : "raw",
diff --git a/chrome/content/zotero/tinymce/noteview.html b/chrome/content/zotero/tinymce/noteview.html
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TinyMCE</title>
-<link type="text/css" rel="stylesheet" href="../../../skin/default/zotero/tinymce/note-ui.css"/>
+<link type="text/css" rel="stylesheet" href="chrome://zotero/skin/tinymce/note-ui.css"/>
<style>
table.mceLayout > tbody > tr.mceLast {
top: 0;
@@ -14,7 +14,7 @@ table.mceLayout > tbody > tr.mceLast {
// General options
mode : "none",
theme : "advanced",
- content_css : "../../../skin/default/zotero/tinymce/note-content.css",
+ content_css : "chrome://zotero/skin/tinymce/note-content.css",
button_tile_map : true,
language : "en", // TODO: localize
entity_encoding : "raw",
diff --git a/chrome/content/zotero/tinymce/tiny_mce.js b/chrome/content/zotero/tinymce/tiny_mce.js
@@ -6311,8 +6311,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
tinymce.EditorManager.baseURI = new tinymce.util.URI(tinymce.baseURL);
// User already specified a document.domain value
- if (document.domain && lo.hostname != document.domain)
- tinymce.relaxedDomain = document.domain;
+ // try/catch added by Dan S./Zotero
+ try {
+ if (document.domain && lo.hostname != document.domain)
+ tinymce.relaxedDomain = document.domain;
+ }
+ catch (e) {}
// Setup document domain if tinymce is loaded from other domain
if (!tinymce.relaxedDomain && tinymce.EditorManager.baseURI.host != lo.hostname && lo.hostname)