Run Cut/Copy/Paste commands in notes with chrome privileges so they work

This commit is contained in:
Dan Stillman 2010-10-09 17:21:25 +00:00
parent 4913af2370
commit ee6c386bae
2 changed files with 17 additions and 2 deletions

View file

@ -408,6 +408,11 @@
if (self._eventHandler) {
self._iframe.contentWindow.wrappedJSObject.handleEvent = 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);
}
};
this._iframe.addEventListener("DOMContentLoaded", listener, false);

View file

@ -2,8 +2,8 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" rel="stylesheet" href="css/note-ui.css"/>
<script type="text/javascript" src="tiny_mce.js"></script>
<script type="text/javascript">
<script type="text/javascript;version=1.8" src="tiny_mce.js"></script>
<script type="text/javascript;version=1.8">
tinyMCE.init({
// General options
body_id : "zotero-tinymce-note",
@ -28,6 +28,16 @@
}
},
setup : function (ed) {
var commands = ["Cut", "Copy", "Paste"];
for each(var command in commands) {
let cmd = command;
ed.addCommand(command, function (ui, value) {
zoteroExecCommand(ed.getDoc(), cmd, ui, value);
});
}
},
fix_list_elements : true,
fix_table_elements : true,
plugins : "paste,contextmenu",