Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. config.keystrokes = [
  2. [ 9, 'disableTab' ] // disable TAB key to avoid nesting!
  3. ];
  4.  
  5. config.blockedKeystrokes = [ 9 ];
  6.  
  7. for (instance in CKEDITOR.instances) {
  8. var editor = CKEDITOR.instances[instance];
  9. editor.setKeystroke(9, false);
  10. }
  11.  
  12. editor.on('key', function(e) { alert ("hi"); return false; });
  13.  
  14. requires: 'indentlist',
  15.  
  16. indentlist: 1,
  17. indentblock: 1,
  18.  
  19. editor = CKEDITOR.replace( 'element_name' );
  20.  
  21. editor.on('key', function(e) {
  22. var key = e.data.keyCode;
  23. if(key==9) {
  24. return false;
  25. }
  26.  
  27. editor.on('key', function (evt) {
  28. if (editor.mode != 'wysiwyg') {
  29. return false;
  30. }
  31.  
  32. if (evt.data.keyCode == this.indentKey || evt.data.keyCode == 9) {
  33. evt.cancel();
  34. return false;
  35. }
  36. }, null, null, 1);
  37.  
  38. editor.on('key', function (evt) {
  39. var path = editor.elementPath();
  40.  
  41. if (editor.mode != 'wysiwyg') {
  42. return false;
  43. }
  44.  
  45. if (evt.data.keyCode == this.indentKey || evt.data.keyCode == 9 && path.contains('ol')) {
  46. evt.cancel();
  47. return false;
  48. }
  49. }, null, null, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement