当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Mouse.cMouseUpTo方法代码示例

本文整理汇总了TypeScript中@ephox/agar.Mouse.cMouseUpTo方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Mouse.cMouseUpTo方法的具体用法?TypeScript Mouse.cMouseUpTo怎么用?TypeScript Mouse.cMouseUpTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ephox/agar.Mouse的用法示例。


在下文中一共展示了Mouse.cMouseUpTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

 const sDragDrop = function (container, selector, dx, dy) {
   return Chain.asStep(container, [
     UiFinder.cFindIn(selector),
     Mouse.cMouseDown,
     Mouse.cMouseMoveTo(dx, dy),
     Mouse.cMouseUpTo(dx, dy)
   ]);
 };
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:8,代码来源:DragResizeTest.ts

示例2:

 const sDragDrop = (container, selector, dx, dy) => {
   return Logger.t('Drag from a point and drop at specified point', Chain.asStep(container, [
     UiFinder.cFindIn(selector),
     Mouse.cMouseDown,
     Mouse.cMouseMoveTo(dx, dy),
     Mouse.cMouseUpTo(dx, dy)
   ]));
 };
开发者ID:tinymce,项目名称:tinymce,代码行数:8,代码来源:DragResizeTest.ts

示例3: function

export default function (editor) {
  const ui = TinyUi(editor);

  const cHasState = function (predicate) {
    return Chain.control(
      Chain.binder(function (element) {
        return predicate(element) ? Result.value(element) : Result.error('Predicate didn\'t match.');
      }),
      Guard.addLogging('Assert element has state')
    );
  };

  const cWaitForState = function (predicate) {
    return Chain.control(
      cHasState(predicate),
      Guard.tryUntil('Predicate has failed.', 10, 3000)
    );
  };

  const cDragDrop = Chain.control(
    Chain.fromChains([
      UiFinder.cFindIn('.tox-slider__handle'),
      Mouse.cMouseDown,
      Mouse.cMouseMoveTo(5, 0),
      Mouse.cMouseUpTo(5, 0)
    ]),
    Guard.addLogging('Drag and drop')
);

  const cExecCommandFromDialog = function (label) {
    let cInteractWithUi;

    switch (label) {
      case 'Rotate counterclockwise':
      case 'Rotate clockwise':
      case 'Flip vertically':
      case 'Flip horizontally':
        // Orientation operations, like Flip or Rotate are grouped in a sub-panel
        cInteractWithUi = cClickToolbarButton(label);
        label = 'Orientation';
        break;

      case 'Brightness':
      case 'Contrast':
      case 'Color levels':
      case 'Gamma':
        cInteractWithUi = cDragDrop;
        break;

      default:
        cInteractWithUi = Chain.wait(1);
    }

    return Chain.control(
      Chain.fromChains([
        cClickToolbarButton('Edit image'),
        Chain.fromParent(ui.cWaitForPopup('wait for Edit Image dialog', '[role="dialog"]'), [
          ui.cWaitForUi('wait for canvas', '.tox-image-tools__image > img'),
          Chain.wait(200),
          cClickToolbarButton(label),
          cInteractWithUi,
          Chain.wait(200),
          cClickButton('Apply'),
          cClickButton('Save'),
          cWaitForDialogClose()
        ])
      ]),
      Guard.addLogging(`Execute ${label} command from dialog`)
    );
  };

  const cWaitForUi = function (label, selector) {
    return Chain.control(
      UiFinder.cWaitForState(label, selector, Fun.constant(true)),
      Guard.addLogging('Wait for UI')
    );
  };

  const cWaitForDialogClose = () => {
    return Chain.control(
      UiFinder.cNotExists('[role="dialog"]'),
      Guard.tryUntil('Waiting for dialog to go away', 10, 3000)
    );
  };

  const cClickButton = function (text) {
    return Chain.control(
      Chain.fromChains([
        cWaitForUi('wait for ' + text + ' button', 'button:contains(' + text + ')'),
        cWaitForState(function (el) {
          return Attr.get(el, 'disabled') === undefined;
        }),
        Mouse.cClick
      ]),
      Guard.addLogging('Wait for UI')
    );
  };

  const cClickToolbarButton = function (label) {
    return Chain.control(
//.........这里部分代码省略.........
开发者ID:tinymce,项目名称:tinymce,代码行数:101,代码来源:ImageOps.ts


注:本文中的@ephox/agar.Mouse.cMouseUpTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。