OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
themes
/
mobile
/
main
/
ts
/
ios
/
view
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:36:33 AM
rwxr-xr-x
📄
DeviceZones.ts
2.75 KB
02/20/2020 06:36:36 AM
rw-r--r--
📄
Devices.ts
1.62 KB
02/20/2020 06:36:36 AM
rw-r--r--
📄
Greenzone.ts
980 bytes
02/20/2020 06:36:37 AM
rw-r--r--
📄
IosKeyboard.ts
4.86 KB
02/20/2020 06:36:37 AM
rw-r--r--
📄
IosUpdates.ts
1.59 KB
02/20/2020 06:36:38 AM
rw-r--r--
📄
IosViewport.ts
5.89 KB
02/20/2020 06:36:38 AM
rw-r--r--
Editing: DeviceZones.ts
Close
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ import { Css, Height, Traverse } from '@ephox/sugar'; import Orientation from '../../touch/view/Orientation'; import Devices from './Devices'; // Green zone is the area below the toolbar and above the keyboard, its considered the viewable // region that is not obstructed by the keyboard. If the keyboard is down, then the Green Zone is larger. /* _______________________ | toolbar | |_____________________| | | | | | greenzone | |_____________________| | | | keyboard | |_____________________| */ const softKeyboardLimits = function (outerWindow) { return Devices.findDevice(outerWindow.screen.width, outerWindow.screen.height); }; const accountableKeyboardHeight = function (outerWindow) { const portrait = Orientation.get(outerWindow).isPortrait(); const limits = softKeyboardLimits(outerWindow); const keyboard = portrait ? limits.portrait : limits.landscape; const visualScreenHeight = portrait ? outerWindow.screen.height : outerWindow.screen.width; // This is our attempt to detect when we are in a webview. If the DOM window height is smaller than the // actual screen height by about the size of a keyboard, we assume that's because a keyboard is // causing it to be that small. We will improve this at a later date. return (visualScreenHeight - outerWindow.innerHeight) > keyboard ? 0 : keyboard; }; const getGreenzone = function (socket, dropup) { const outerWindow = Traverse.owner(socket).dom().defaultView; // Include the dropup for this calculation because it represents the total viewable height. const viewportHeight = Height.get(socket) + Height.get(dropup); const acc = accountableKeyboardHeight(outerWindow); return viewportHeight - acc; }; const updatePadding = function (contentBody, socket, dropup) { const greenzoneHeight = getGreenzone(socket, dropup); const deltaHeight = (Height.get(socket) + Height.get(dropup)) - greenzoneHeight; // TBIO-3878 Changed the element that was receiving the padding from the iframe to the body of the // iframe's document. The reasoning for this is that the syncHeight function of IosSetup.js relies on // the scrollHeight of the body to set the height of the iframe itself. If we don't set the // padding-bottom on the body, the scrollHeight is too short, effectively disappearing the content from view. Css.set(contentBody, 'padding-bottom', deltaHeight + 'px'); }; export default { getGreenzone, updatePadding };