commit d309ad253914cf4a66768f659f06f0df12005def
parent ee6c386bae1edc593917590676d00c2de15a7a64
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 9 Oct 2010 18:03:03 +0000
Hide location and status bar and skip Zotero translators on TinyMCE popups
Diffstat:
4 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml
@@ -406,13 +406,18 @@
});
if (self._eventHandler) {
- self._iframe.contentWindow.wrappedJSObject.handleEvent = self._eventHandler;
+ self._iframe.contentWindow.wrappedJSObject.zoteroHandleEvent = self._eventHandler;
}
// Run Cut/Copy/Paste with chrome privileges
self._iframe.contentWindow.wrappedJSObject.zoteroExecCommand = function (doc, command, ui, value) {
return doc.execCommand(command, ui, value);
}
+
+ self._iframe.contentWindow.wrappedJSObject.zoteroFixWindow = function (win) {
+ win.locationbar.visible = false;
+ win.statusbar.visible = false;
+ }
};
this._iframe.addEventListener("DOMContentLoaded", listener, false);
diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js
@@ -350,6 +350,11 @@ var Zotero_Browser = new function() {
if (_locationBlacklist.indexOf(doc.location.href) != -1) {
return;
}
+
+ // Ignore TinyMCE popups
+ if (!doc.location.host && doc.location.href.indexOf("tinymce/themes/advanced") != -1) {
+ return;
+ }
}
catch (e) {}
diff --git a/chrome/content/zotero/tinymce/note.html b/chrome/content/zotero/tinymce/note.html
@@ -16,16 +16,12 @@
gecko_spellcheck : true,
handle_event_callback : function (event) {
- if (handleEvent) {
- handleEvent(event);
- }
+ zoteroHandleEvent(event);
},
onchange_callback : function () {
var event = { type: 'change' };
- if (handleEvent) {
- handleEvent(event);
- }
+ zoteroHandleEvent(event);
},
setup : function (ed) {
diff --git a/chrome/content/zotero/tinymce/tiny_mce.js b/chrome/content/zotero/tinymce/tiny_mce.js
@@ -1,3 +1,5 @@
+// Contains modifications by Dan S./Zotero
+
(function(win) {
var whiteSpaceRe = /^\s*|\s*$/g,
undefined, isRegExpBroken = 'B'.replace(/A(.)|B/, '$1') === '$1';
@@ -11120,7 +11122,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
if (value === undefined)
value = null;
-
+
return editor.getDoc().execCommand(command, ui, value);
};
@@ -12739,6 +12741,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', {
// Ignore
}
+ // Added by Dan S./Zotero
+ zoteroFixWindow(w);
if (!w)
alert(t.editor.getLang('popup_blocked'));