PHP Classes

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

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/core/src/main/js/keyboard/ArrowKeys.js   Download  
File: public/js/tinymce/src/core/src/main/js/keyboard/ArrowKeys.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: 1,750 bytes
 

Contents

Class file image Download
/** * ArrowKeys.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.ArrowKeys', [ 'ephox.sand.api.PlatformDetection', 'tinymce.core.keyboard.BoundarySelection', 'tinymce.core.keyboard.CefNavigation', 'tinymce.core.keyboard.MatchKeys', 'tinymce.core.util.VK' ], function (PlatformDetection, BoundarySelection, CefNavigation, MatchKeys, VK) { var executeKeydownOverride = function (editor, caret, evt) { var os = PlatformDetection.detect().os; MatchKeys.execute([ { keyCode: VK.RIGHT, action: CefNavigation.moveH(editor, true) }, { keyCode: VK.LEFT, action: CefNavigation.moveH(editor, false) }, { keyCode: VK.UP, action: CefNavigation.moveV(editor, false) }, { keyCode: VK.DOWN, action: CefNavigation.moveV(editor, true) }, { keyCode: VK.RIGHT, action: BoundarySelection.move(editor, caret, true) }, { keyCode: VK.LEFT, action: BoundarySelection.move(editor, caret, false) }, { keyCode: VK.RIGHT, ctrlKey: !os.isOSX(), altKey: os.isOSX(), action: BoundarySelection.moveNextWord(editor, caret) }, { keyCode: VK.LEFT, ctrlKey: !os.isOSX(), altKey: os.isOSX(), action: BoundarySelection.movePrevWord(editor, caret) } ], evt).each(function (_) { evt.preventDefault(); }); }; var setup = function (editor, caret) { editor.on('keydown', function (evt) { if (evt.isDefaultPrevented() === false) { executeKeydownOverride(editor, caret, evt); } }); }; return { setup: setup }; } );