Hide location and status bar and skip Zotero translators on TinyMCE popups

This commit is contained in:
Dan Stillman 2010-10-09 18:03:03 +00:00
parent ee6c386bae
commit d309ad2539
4 changed files with 18 additions and 8 deletions

View File

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

View File

@ -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) {}

View File

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

View File

@ -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'));