OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
themes
/
mobile
/
main
/
ts
/
ui
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 06:45:48 AM
rwxr-xr-x
📄
AndroidRealm.ts
2.43 KB
02/20/2020 06:32:39 AM
rw-r--r--
📄
Buttons.ts
2.4 KB
02/20/2020 06:32:40 AM
rw-r--r--
📄
ColorSlider.ts
3.21 KB
02/20/2020 06:32:40 AM
rw-r--r--
📄
CommonRealm.ts
1.49 KB
02/20/2020 06:32:41 AM
rw-r--r--
📄
Dropup.ts
2.38 KB
02/20/2020 06:32:41 AM
rw-r--r--
📄
FontSizeSlider.ts
1.34 KB
02/20/2020 06:32:42 AM
rw-r--r--
📄
HeadingSlider.ts
1.63 KB
02/20/2020 06:32:42 AM
rw-r--r--
📄
ImagePicker.ts
2.13 KB
02/20/2020 06:32:43 AM
rw-r--r--
📄
Inputs.ts
2.86 KB
02/20/2020 06:32:43 AM
rw-r--r--
📄
IosRealm.ts
2.65 KB
02/20/2020 06:32:44 AM
rw-r--r--
📄
LinkButton.ts
2.33 KB
02/20/2020 06:32:45 AM
rw-r--r--
📄
OuterContainer.ts
953 bytes
02/20/2020 06:32:45 AM
rw-r--r--
📄
SerialisedDialog.ts
8.2 KB
02/20/2020 06:32:46 AM
rw-r--r--
📄
SizeSlider.ts
2.32 KB
02/20/2020 06:32:46 AM
rw-r--r--
📄
StylesMenu.ts
6.51 KB
02/20/2020 06:32:47 AM
rw-r--r--
📄
ToolbarWidgets.ts
645 bytes
02/20/2020 06:32:47 AM
rw-r--r--
Editing: LinkButton.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 { Representing, SketchSpec } from '@ephox/alloy'; import { Option, Thunk } from '@ephox/katamari'; import LinkBridge from '../bridge/LinkBridge'; import RangePreserver from '../util/RangePreserver'; import Buttons from './Buttons'; import * as Inputs from './Inputs'; import * as SerialisedDialog from './SerialisedDialog'; const getGroups = Thunk.cached(function (realm, editor) { return [ { label: 'the link group', items: [ SerialisedDialog.sketch({ fields: [ Inputs.field('url', 'Type or paste URL'), Inputs.field('text', 'Link text'), Inputs.field('title', 'Link title'), Inputs.field('target', 'Link target'), Inputs.hidden('link') ], // Do not include link maxFieldIndex: [ 'url', 'text', 'title', 'target' ].length - 1, getInitialValue (/* dialog */) { return Option.some( LinkBridge.getInfo(editor) ); }, onExecute (dialog/*, simulatedEvent */) { const info = Representing.getValue(dialog); LinkBridge.applyInfo(editor, info); realm.restoreToolbar(); editor.focus(); } }) ] } ]; }); const sketch = function (realm, editor): SketchSpec { return Buttons.forToolbarStateAction(editor, 'link', 'link', function () { const groups = getGroups(realm, editor); realm.setContextToolbar(groups); // Focus inside // On Android, there is a bug where if you position the cursor (collapsed) within a // word, and you blur the editor (by focusing an input), the selection moves to the // end of the word (http://fiddle.tinymce.com/xNfaab/3 or 4). This is actually dependent // on your keyboard (Google Keyboard) and is probably considered a feature. It does // not happen on Samsung (for example). RangePreserver.forAndroid(editor, function () { realm.focusToolbar(); }); LinkBridge.query(editor).each(function (link) { editor.selection.select(link.dom()); }); }); }; export { sketch };