silverstripe-framework/thirdparty/tinymce/classes/commands/CutCopyPaste.js

25 lines
651 B
JavaScript
Raw Normal View History

/**
* $Id: EditorCommands.js 1042 2009-03-04 16:00:50Z spocke $
*
* @author Moxiecode
* @copyright Copyright <EFBFBD> 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
(function(tinymce) {
tinymce.each(['Cut', 'Copy', 'Paste'], function(cmd) {
tinymce.GlobalCommands.add(cmd, function() {
var ed = this, doc = ed.getDoc();
try {
doc.execCommand(cmd, false, null);
// On WebKit the command will just be ignored if it's not enabled
if (!doc.queryCommandSupported(cmd))
throw 'Error';
} catch (ex) {
ed.windowManager.alert(ed.getLang('clipboard_no_support'));
}
});
});
})(tinymce);