Tell NoScript users how to fix note display

This commit is contained in:
Dan Stillman 2010-10-09 09:37:07 +00:00
parent c7c27935d0
commit 79334fdbd5
5 changed files with 30 additions and 5 deletions

View file

@ -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

View file

@ -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;
}

View file

@ -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>

View file

@ -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>

View file

@ -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>