PHP Classes

File: public/js/tinymce/src/core/src/main/js/keyboard/DeleteBackspaceKeys.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/core/src/main/js/keyboard/DeleteBackspaceKeys.js   Download  
File: public/js/tinymce/src/core/src/main/js/keyboard/DeleteBackspaceKeys.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 2,947 bytes
 

Contents

Class file image Download
/** * DeleteBackspaceKeys.js * * Released under LGPL License. * Copyright (c) 1999-2017 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ define( 'tinymce.core.keyboard.DeleteBackspaceKeys', [ 'tinymce.core.delete.BlockBoundaryDelete', 'tinymce.core.delete.BlockRangeDelete', 'tinymce.core.delete.CefDelete', 'tinymce.core.delete.InlineBoundaryDelete', 'tinymce.core.delete.InlineFormatDelete', 'tinymce.core.delete.TableDelete', 'tinymce.core.keyboard.MatchKeys', 'tinymce.core.util.VK' ], function (BlockBoundaryDelete, BlockRangeDelete, CefDelete, InlineBoundaryDelete, InlineFormatDelete, TableDelete, MatchKeys, VK) { var executeKeydownOverride = function (editor, caret, evt) { MatchKeys.execute([ { keyCode: VK.BACKSPACE, action: MatchKeys.action(CefDelete.backspaceDelete, editor, false) }, { keyCode: VK.DELETE, action: MatchKeys.action(CefDelete.backspaceDelete, editor, true) }, { keyCode: VK.BACKSPACE, action: MatchKeys.action(InlineBoundaryDelete.backspaceDelete, editor, caret, false) }, { keyCode: VK.DELETE, action: MatchKeys.action(InlineBoundaryDelete.backspaceDelete, editor, caret, true) }, { keyCode: VK.BACKSPACE, action: MatchKeys.action(BlockRangeDelete.backspaceDelete, editor, false) }, { keyCode: VK.DELETE, action: MatchKeys.action(BlockRangeDelete.backspaceDelete, editor, true) }, { keyCode: VK.BACKSPACE, action: MatchKeys.action(BlockBoundaryDelete.backspaceDelete, editor, false) }, { keyCode: VK.DELETE, action: MatchKeys.action(BlockBoundaryDelete.backspaceDelete, editor, true) }, { keyCode: VK.BACKSPACE, action: MatchKeys.action(TableDelete.backspaceDelete, editor, false) }, { keyCode: VK.DELETE, action: MatchKeys.action(TableDelete.backspaceDelete, editor, true) }, { keyCode: VK.BACKSPACE, action: MatchKeys.action(InlineFormatDelete.backspaceDelete, editor, false) }, { keyCode: VK.DELETE, action: MatchKeys.action(InlineFormatDelete.backspaceDelete, editor, true) } ], evt).each(function (_) { evt.preventDefault(); }); }; var executeKeyupOverride = function (editor, evt) { MatchKeys.execute([ { keyCode: VK.BACKSPACE, action: MatchKeys.action(CefDelete.paddEmptyElement, editor) }, { keyCode: VK.DELETE, action: MatchKeys.action(CefDelete.paddEmptyElement, editor) } ], evt); }; var setup = function (editor, caret) { editor.on('keydown', function (evt) { if (evt.isDefaultPrevented() === false) { executeKeydownOverride(editor, caret, evt); } }); editor.on('keyup', function (evt) { if (evt.isDefaultPrevented() === false) { executeKeyupOverride(editor, evt); } }); }; return { setup: setup }; } );