mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
25 lines
651 B
JavaScript
25 lines
651 B
JavaScript
|
/**
|
|||
|
* $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);
|