commit 79334fdbd59fa1578dc53dea86c2ee290f9cc2a0
parent c7c27935d02336d521f7ae966303acf4d04185d2
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 9 Oct 2010 09:37:07 +0000
Tell NoScript users how to fix note display
Diffstat:
5 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml
@@ -344,8 +344,24 @@
// Register handler for deferred setting of content
var self = this;
var listener = function() {
+ var win = self._iframe.contentWindow;
var SJOW = self._iframe.contentWindow.wrappedJSObject;
+ if (!SJOW.tinyMCE) {
+ var exts = Zotero.getInstalledExtensions();
+ for each(var ext in exts) {
+ if (ext.indexOf('NoScript') != -1) {
+ var warning = win.document.getElementById('noScriptWarning');
+ var str = "The NoScript extension is preventing Zotero "
+ + "from displaying notes. To use NoScript and Zotero together, "
+ + "whitelist the 'file://' scheme in the NoScript preferences.";
+ warning.appendChild(document.createTextNode(str));
+ break;
+ }
+ }
+ return;
+ }
+
var editor = SJOW.tinyMCE.get("tinymce");
if (!editor) {
// Not ready yet
diff --git a/chrome/content/zotero/tinymce/css/note-ui.css b/chrome/content/zotero/tinymce/css/note-ui.css
@@ -33,3 +33,9 @@ td.mceIframeContainer {
#tinymce_formatselect_text {
width: 65px;
}
+
+#noScriptWarning {
+ padding: 4px;
+ font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
diff --git a/chrome/content/zotero/tinymce/integration.html b/chrome/content/zotero/tinymce/integration.html
@@ -1,7 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
-
<style>
html, body {
height: 100%;
@@ -18,6 +17,11 @@ html, body {
width: 100% !important;
}
+#noScriptWarning {
+ padding: 10px 8px 4px;
+ font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
+ font-size: 12px;
+}
</style>
<script type="text/javascript" src="tiny_mce.js"></script>
@@ -40,6 +44,6 @@ html, body {
</script>
</head>
<body>
-<div id="tinymce"></div>
+<div id="tinymce"><div id="noScriptWarning"/></div>
</body>
</html>
diff --git a/chrome/content/zotero/tinymce/note.html b/chrome/content/zotero/tinymce/note.html
@@ -1,7 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
-<title>TinyMCE</title>
<link type="text/css" rel="stylesheet" href="css/note-ui.css"/>
<script type="text/javascript" src="tiny_mce.js"></script>
<script type="text/javascript">
@@ -65,6 +64,6 @@
</script>
</head>
<body>
-<div id="tinymce"></div>
+<div id="tinymce"><div id="noScriptWarning"/></div>
</body>
</html>
diff --git a/chrome/content/zotero/tinymce/noteview.html b/chrome/content/zotero/tinymce/noteview.html
@@ -57,6 +57,6 @@ table.mceLayout > tbody > tr.mceLast {
</script>
</head>
<body>
-<div id="tinymce"></div>
+<div id="tinymce"><div id="noScriptWarning"/></div>
</body>
</html>