/
home
/
aqcert
/
public_html
/
admin
/
tinymce
/
js
/
tinymce
/
classes
/
ui
/
/home/aqcert/public_html/admin/tinymce/js/tinymce/classes/ui
mkdir
upload
Name
Size
Mode
Actions
AbsoluteLayout.js
1536
0644
edit
dl
rm
BoxUtils.js
2046
0644
edit
dl
rm
Button.js
4695
0644
edit
dl
rm
ButtonGroup.js
1447
0644
edit
dl
rm
Checkbox.js
3799
0644
edit
dl
rm
ClassList.js
2964
0644
edit
dl
rm
Collection.js
11931
0644
edit
dl
rm
ColorBox.js
1468
0644
edit
dl
rm
ColorButton.js
3379
0644
edit
dl
rm
ColorPicker.js
4962
0644
edit
dl
rm
ComboBox.js
7202
0644
edit
dl
rm
Container.js
12702
0644
edit
dl
rm
Control.js
32902
0644
edit
dl
rm
DomUtils.js
2815
0644
edit
dl
rm
DragHelper.js
3335
0644
edit
dl
rm
ElementPath.js
1822
0644
edit
dl
rm
Factory.js
2582
0644
edit
dl
rm
FieldSet.js
1399
0644
edit
dl
rm
FilePicker.js
2399
0644
edit
dl
rm
FitLayout.js
1250
0644
edit
dl
rm
FlexLayout.js
8282
0644
edit
dl
rm
FloatPanel.js
9176
0644
edit
dl
rm
FlowLayout.js
1014
0644
edit
dl
rm
Form.js
3423
0644
edit
dl
rm
FormatControls.js
13501
0644
edit
dl
rm
FormItem.js
1385
0644
edit
dl
rm
GridLayout.js
7106
0644
edit
dl
rm
Iframe.js
1859
0644
edit
dl
rm
InfoBox.js
2027
0644
edit
dl
rm
KeyboardNavigation.js
10055
0644
edit
dl
rm
Label.js
3340
0644
edit
dl
rm
Layout.js
2594
0644
edit
dl
rm
ListBox.js
3453
0644
edit
dl
rm
Menu.js
3647
0644
edit
dl
rm
MenuBar.js
593
0644
edit
dl
rm
MenuButton.js
5691
0644
edit
dl
rm
MenuItem.js
7219
0644
edit
dl
rm
MessageBox.js
4230
0644
edit
dl
rm
Movable.js
4384
0644
edit
dl
rm
Notification.js
3335
0644
edit
dl
rm
Panel.js
1421
0644
edit
dl
rm
PanelButton.js
2360
0644
edit
dl
rm
Path.js
2827
0644
edit
dl
rm
Progress.js
1592
0644
edit
dl
rm
Radio.js
520
0644
edit
dl
rm
ReflowQueue.js
1918
0644
edit
dl
rm
Resizable.js
1555
0644
edit
dl
rm
ResizeHandle.js
1717
0644
edit
dl
rm
Scrollable.js
4268
0644
edit
dl
rm
SelectBox.js
2575
0644
edit
dl
rm
Selector.js
8659
0644
edit
dl
rm
Slider.js
5266
0644
edit
dl
rm
Spacer.js
823
0644
edit
dl
rm
SplitButton.js
3439
0644
edit
dl
rm
StackLayout.js
691
0644
edit
dl
rm
TabPanel.js
4093
0644
edit
dl
rm
TextBox.js
4724
0644
edit
dl
rm
Throbber.js
1935
0644
edit
dl
rm
Toolbar.js
1023
0644
edit
dl
rm
Tooltip.js
1587
0644
edit
dl
rm
Widget.js
3284
0644
edit
dl
rm
Window.js
11561
0644
edit
dl
rm
Edit:
/home/aqcert/public_html/admin/tinymce/js/tinymce/classes/ui/KeyboardNavigation.js
(10055B)
/** * KeyboardNavigation.js * * Released under LGPL License. * Copyright (c) 1999-2015 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ /** * This class handles keyboard navigation of controls and elements. * * @class tinymce.ui.KeyboardNavigation */ define("tinymce/ui/KeyboardNavigation", [ ], function() { "use strict"; /** * This class handles all keyboard navigation for WAI-ARIA support. Each root container * gets an instance of this class. * * @constructor */ return function(settings) { var root = settings.root, focusedElement, focusedControl; function isElement(node) { return node && node.nodeType === 1; } try { focusedElement = document.activeElement; } catch (ex) { // IE sometimes fails to return a proper element focusedElement = document.body; } focusedControl = root.getParentCtrl(focusedElement); /** * Returns the currently focused elements wai aria role of the currently * focused element or specified element. * * @private * @param {Element} elm Optional element to get role from. * @return {String} Role of specified element. */ function getRole(elm) { elm = elm || focusedElement; if (isElement(elm)) { return elm.getAttribute('role'); } return null; } /** * Returns the wai role of the parent element of the currently * focused element or specified element. * * @private * @param {Element} elm Optional element to get parent role from. * @return {String} Role of the first parent that has a role. */ function getParentRole(elm) { var role, parent = elm || focusedElement; while ((parent = parent.parentNode)) { if ((role = getRole(parent))) { return role; } } } /** * Returns a wai aria property by name for example aria-selected. * * @private * @param {String} name Name of the aria property to get for example "disabled". * @return {String} Aria property value. */ function getAriaProp(name) { var elm = focusedElement; if (isElement(elm)) { return elm.getAttribute('aria-' + name); } } /** * Is the element a text input element or not. * * @private * @param {Element} elm Element to check if it's an text input element or not. * @return {Boolean} True/false if the element is a text element or not. */ function isTextInputElement(elm) { var tagName = elm.tagName.toUpperCase(); // Notice: since type can be "email" etc we don't check the type // So all input elements gets treated as text input elements return tagName == "INPUT" || tagName == "TEXTAREA" || tagName == "SELECT"; } /** * Returns true/false if the specified element can be focused or not. * * @private * @param {Element} elm DOM element to check if it can be focused or not. * @return {Boolean} True/false if the element can have focus. */ function canFocus(elm) { if (isTextInputElement(elm) && !elm.hidden) { return true; } if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(getRole(elm))) { return true; } return false; } /** * Returns an array of focusable visible elements within the specified container element. * * @private * @param {Element} elm DOM element to find focusable elements within. * @return {Array} Array of focusable elements. */ function getFocusElements(elm) { var elements = []; function collect(elm) { if (elm.nodeType != 1 || elm.style.display == 'none') { return; } if (canFocus(elm)) { elements.push(elm); } for (var i = 0; i < elm.childNodes.length; i++) { collect(elm.childNodes[i]); } } collect(elm || root.getEl()); return elements; } /** * Returns the navigation root control for the specified control. The navigation root * is the control that the keyboard navigation gets scoped to for example a menubar or toolbar group. * It will look for parents of the specified target control or the currently focused control if this option is omitted. * * @private * @param {tinymce.ui.Control} targetControl Optional target control to find root of. * @return {tinymce.ui.Control} Navigation root control. */ function getNavigationRoot(targetControl) { var navigationRoot, controls; targetControl = targetControl || focusedControl; controls = targetControl.parents().toArray(); controls.unshift(targetControl); for (var i = 0; i < controls.length; i++) { navigationRoot = controls[i]; if (navigationRoot.settings.ariaRoot) { break; } } return navigationRoot; } /** * Focuses the first item in the specified targetControl element or the last aria index if the * navigation root has the ariaRemember option enabled. * * @private * @param {tinymce.ui.Control} targetControl Target control to focus the first item in. */ function focusFirst(targetControl) { var navigationRoot = getNavigationRoot(targetControl); var focusElements = getFocusElements(navigationRoot.getEl()); if (navigationRoot.settings.ariaRemember && "lastAriaIndex" in navigationRoot) { moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements); } else { moveFocusToIndex(0, focusElements); } } /** * Moves the focus to the specified index within the elements list. * This will scope the index to the size of the element list if it changed. * * @private * @param {Number} idx Specified index to move to. * @param {Array} elements Array with dom elements to move focus within. * @return {Number} Input index or a changed index if it was out of range. */ function moveFocusToIndex(idx, elements) { if (idx < 0) { idx = elements.length - 1; } else if (idx >= elements.length) { idx = 0; } if (elements[idx]) { elements[idx].focus(); } return idx; } /** * Moves the focus forwards or backwards. * * @private * @param {Number} dir Direction to move in positive means forward, negative means backwards. * @param {Array} elements Optional array of elements to move within defaults to the current navigation roots elements. */ function moveFocus(dir, elements) { var idx = -1, navigationRoot = getNavigationRoot(); elements = elements || getFocusElements(navigationRoot.getEl()); for (var i = 0; i < elements.length; i++) { if (elements[i] === focusedElement) { idx = i; } } idx += dir; navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements); } /** * Moves the focus to the left this is called by the left key. * * @private */ function left() { var parentRole = getParentRole(); if (parentRole == "tablist") { moveFocus(-1, getFocusElements(focusedElement.parentNode)); } else if (focusedControl.parent().submenu) { cancel(); } else { moveFocus(-1); } } /** * Moves the focus to the right this is called by the right key. * * @private */ function right() { var role = getRole(), parentRole = getParentRole(); if (parentRole == "tablist") { moveFocus(1, getFocusElements(focusedElement.parentNode)); } else if (role == "menuitem" && parentRole == "menu" && getAriaProp('haspopup')) { enter(); } else { moveFocus(1); } } /** * Moves the focus to the up this is called by the up key. * * @private */ function up() { moveFocus(-1); } /** * Moves the focus to the up this is called by the down key. * * @private */ function down() { var role = getRole(), parentRole = getParentRole(); if (role == "menuitem" && parentRole == "menubar") { enter(); } else if (role == "button" && getAriaProp('haspopup')) { enter({key: 'down'}); } else { moveFocus(1); } } /** * Moves the focus to the next item or previous item depending on shift key. * * @private * @param {DOMEvent} e DOM event object. */ function tab(e) { var parentRole = getParentRole(); if (parentRole == "tablist") { var elm = getFocusElements(focusedControl.getEl('body'))[0]; if (elm) { elm.focus(); } } else { moveFocus(e.shiftKey ? -1 : 1); } } /** * Calls the cancel event on the currently focused control. This is normally done using the Esc key. * * @private */ function cancel() { focusedControl.fire('cancel'); } /** * Calls the click event on the currently focused control. This is normally done using the Enter/Space keys. * * @private * @param {Object} aria Optional aria data to pass along with the enter event. */ function enter(aria) { aria = aria || {}; focusedControl.fire('click', {target: focusedElement, aria: aria}); } root.on('keydown', function(e) { function handleNonTabOrEscEvent(e, handler) { // Ignore non tab keys for text elements if (isTextInputElement(focusedElement)) { return; } if (getRole(focusedElement) === 'slider') { return; } if (handler(e) !== false) { e.preventDefault(); } } if (e.isDefaultPrevented()) { return; } switch (e.keyCode) { case 37: // DOM_VK_LEFT handleNonTabOrEscEvent(e, left); break; case 39: // DOM_VK_RIGHT handleNonTabOrEscEvent(e, right); break; case 38: // DOM_VK_UP handleNonTabOrEscEvent(e, up); break; case 40: // DOM_VK_DOWN handleNonTabOrEscEvent(e, down); break; case 27: // DOM_VK_ESCAPE cancel(); break; case 14: // DOM_VK_ENTER case 13: // DOM_VK_RETURN case 32: // DOM_VK_SPACE handleNonTabOrEscEvent(e, enter); break; case 9: // DOM_VK_TAB if (tab(e) !== false) { e.preventDefault(); } break; } }); root.on('focusin', function(e) { focusedElement = e.target; focusedControl = e.control; }); return { focusFirst: focusFirst }; }; });
Save
cmd:
run