在ms office中,为了对齐文本,我们首先必须选择文本,然后通过分别按ctrl+L、ctrl+r、ctrl+e左、右和居中,我们就可以对齐文本。
但是对于在线文本编辑器,例如tinymce和cke编辑器,我不知道什么是快捷键,有图标可以让我们这样做,但我想知道有没有快捷键。
发布于 2015-11-06 12:54:56
TinyMCE有一些默认的快捷键,如undo (Ctrl+Z),Bold (Ctrl+B)等(参见此处:http://www.tinymce.com/forum/viewtopic.php?id=9445),但也可以定义在特定按键时发生的功能。
例如:
editor.shortcuts.add('ctrl+a', function() {});
editor.shortcuts.add('meta+a', function() {}); // "meta" maps to Command on Mac and Ctrl on PC
editor.shortcuts.add('ctrl+alt+a', function() {});
editor.shortcuts.add('access+a', function() {}); // "access" maps to ctrl+alt on Mac and shift+alt on PChttp://www.tinymce.com/wiki.php/api4:class.tinymce.Shortcuts
发布于 2015-11-06 13:30:59
this is how my code looks
where can i add editor.shortcuts.add('ctrl+a', function() {});
$(document).ready(function()
{tinymce.init({
selector: "textarea",
plugins: [
"textcolor advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen ",
"insertdatetime media table contextmenu paste jbimages",
],
relative_urls: false,
toolbar: "insertfile undo redo | styleselect | fontselect | forecolor | backcolor | fontsizeselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image jbimages | fullscreen |preview | mybutton",
setup: function(editor) {
editor.addButton('mybutton', {
text: 'Preview it!!!',
icon: true,
onclick: function(e) {
editor.execCommand('mcePreview');
}
});
}
});
});https://stackoverflow.com/questions/33559710
复制相似问题