www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit ee6c386bae1edc593917590676d00c2de15a7a64
parent 4913af2370cda415100f614859f54113a268e79c
Author: Dan Stillman <dstillman@zotero.org>
Date:   Sat,  9 Oct 2010 17:21:25 +0000

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


Diffstat:
Mchrome/content/zotero/bindings/styled-textbox.xml | 5+++++
Mchrome/content/zotero/tinymce/note.html | 14++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml @@ -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); diff --git a/chrome/content/zotero/tinymce/note.html b/chrome/content/zotero/tinymce/note.html @@ -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",