Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
component.each(function (container) {
/// view mode
if (Swapping.isAlpha(container)) {
TinyCodeDupe.openLink(target.dom());
}
});
}
}
},
container: Element.fromDom(editor.editorContainer),
socket: Element.fromDom(editor.contentAreaContainer),
toolstrip: Element.fromDom(editor.editorContainer.querySelector('.' + Styles.resolve('toolstrip'))),
toolbar: Element.fromDom(editor.editorContainer.querySelector('.' + Styles.resolve('toolbar'))),
dropup: realm.dropup(),
alloy: realm.system(),
translate: Fun.noop,
setReadOnly (ro) {
setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, ro);
},
readOnlyOnInit () {
return Settings.readOnlyOnInit(editor);
}
});
const hideDropup = function () {
realm.dropup().disappear(function () {
realm.system().broadcastOn([ TinyChannels.dropupDismissed() ], { });
});
};
const vp = VisualViewport.getBounds(window);
return {
x: vp.x(),
y: vp.y()
};
};
const setScrollPos = function (pos) {
window.scrollTo(pos.x, pos.y);
};
/* tslint:disable-next-line:no-string-literal */
const visualViewport: VisualViewport.VisualViewport = window['visualViewport'];
const viewportUpdate = visualViewport === undefined ? { bind: Fun.noop, unbind: Fun.noop } : (() => {
const editorContainer = Singleton.value<element>();
const refreshScroll = () => {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
};
const refreshVisualViewport = () => {
window.requestAnimationFrame(() => {
editorContainer.on((container) => Css.setAll(container, {
top: visualViewport.offsetTop + 'px',
left: visualViewport.offsetLeft + 'px',
height: visualViewport.height + 'px',
width: visualViewport.width + 'px'
}));
});</element>
const toEditing = function () {
// Consider inlining, though it will make it harder to follow the API
keyboardModel.toEditing();
clearSelection();
};
const toReading = function () {
keyboardModel.toReading();
};
const onToolbarTouch = function (event) {
keyboardModel.onToolbarTouch(event);
};
const onOrientation = Orientation.onChange(outerWindow, {
onChange: Fun.noop,
onReady: structure.refresh
});
// NOTE: When the window is resizing (probably due to meta tags and viewport definitions), we are not receiving a window resize event.
// However, it happens shortly after we start Ios mode, so here we just wait for the first window size event that we get. This code
// is also the same code that is used for the Orientation ready event.
onOrientation.onAdjustment(function () {
structure.refresh();
});
const onResize = DomEvent.bind(Element.fromDom(outerWindow), 'resize', function () {
if (structure.isExpanding()) {
structure.refresh();
}
});
onAction: (data) => {
applyColour(editor, format, data.value, Fun.noop);
}
}
getNotificationManagerImpl () {
return {
open: Fun.constant({
progressBar: { value: Fun.noop },
close: Fun.noop,
text: Fun.noop,
getEl: Fun.constant(null),
moveTo: Fun.noop,
moveRel: Fun.noop,
settings: {} as NotificationSpec
}),
close: Fun.noop,
reposition: Fun.noop,
getArgs: Fun.constant({} as NotificationSpec)
};
},
renderUI
FieldSchema.defaultedFunction('onSetup', () => Fun.noop),
FieldSchema.defaulted('storage', Cell(false))
Dockables.getMorphToOriginal(component, config).each((morph) => {
morph.fold(
() => morphToStatic(component, config),
(x, y) => {
const doc = Traverse.owner(elem);
const scroll = Scroll.get(doc);
const origin = OffsetOrigin.getOrigin(elem);
morphToCoord(component, config, scroll, origin, DragCoord.absolute(x, y));
},
Fun.noop
);
});
const tempManipulate = (anyInSystem: AlloyComponent, filter: (ir: ImageResult) => ImageResult | PromiseLike): void => {
const blob = state.getTempState().blob;
const action = (blob) => state.addTempState(blob);
blobManipulate(anyInSystem, blob, filter, action, Fun.noop);
};
getNotificationManagerImpl () {
return {
open: Fun.constant({
progressBar: { value: Fun.noop },
close: Fun.noop,
text: Fun.noop,
getEl: Fun.constant(null),
moveTo: Fun.noop,
moveRel: Fun.noop,
settings: {} as NotificationSpec
}),
close: Fun.noop,
reposition: Fun.noop,
getArgs: Fun.constant({} as NotificationSpec)
};
},
renderUI
getNotificationManagerImpl () {
return {
open: Fun.constant({
progressBar: { value: Fun.noop },
close: Fun.noop,
text: Fun.noop,
getEl: Fun.constant(null),
moveTo: Fun.noop,
moveRel: Fun.noop,
settings: {} as NotificationSpec
}),
close: Fun.noop,
reposition: Fun.noop,
getArgs: Fun.constant({} as NotificationSpec)
};
},
renderUI