From d309ad253914cf4a66768f659f06f0df12005def Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 9 Oct 2010 18:03:03 +0000 Subject: [PATCH] Hide location and status bar and skip Zotero translators on TinyMCE popups --- chrome/content/zotero/bindings/styled-textbox.xml | 7 ++++++- chrome/content/zotero/browser.js | 5 +++++ chrome/content/zotero/tinymce/note.html | 8 ++------ chrome/content/zotero/tinymce/tiny_mce.js | 6 +++++- 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 index 1a8e9f853..95b0cbaab 100644 --- 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 index 86d65b173..50a408e6d 100644 --- 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 index 507fe6d0f..99e0bad4f 100755 --- 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 index c1c868759..dd9bc16b3 100755 --- 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'));