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


TypeScript DomQuery.default函数代码示例

本文整理汇总了TypeScript中tinymce/core/dom/DomQuery.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: function

 suite.test('isEditableCaretCandidate', function () {
   setupHtml('abc<b>xx</b><span contentEditable="false"><span contentEditable="false">X</span></span>');
   LegacyUnit.equal(CaretCandidate.isEditableCaretCandidate(getRoot().firstChild, getRoot()), true);
   LegacyUnit.equal(CaretCandidate.isEditableCaretCandidate($('b', getRoot())[0]), false);
   LegacyUnit.equal(CaretCandidate.isEditableCaretCandidate($('span', getRoot())[0]), true);
   LegacyUnit.equal(CaretCandidate.isEditableCaretCandidate($('span span', getRoot())[0]), false);
 });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:7,代码来源:CaretCandidateTest.ts

示例2: function

  suite.test('positionsUntil', function () {
    let result, predicateCallCount = 0;

    const predicate = function () {
      predicateCallCount++;
      return false;
    };

    $(getRoot()).html('<span contentEditable="false">a</span><span>b</span>');
    result = LineWalker.positionsUntil(1, getRoot(), predicate, getRoot().firstChild);
    LegacyUnit.equal(result.length, 3);
    LegacyUnit.equalDom(result[0].position.getNode(), getRoot().lastChild);
    LegacyUnit.equalDom(result[1].position.getNode(), getRoot().lastChild.firstChild);
    LegacyUnit.equalDom(result[2].position.getNode(), getRoot().lastChild.firstChild);
    LegacyUnit.equal(predicateCallCount, 3);

    predicateCallCount = 0;
    $(getRoot()).html('<span>a</span><span contentEditable="false">b</span>');
    result = LineWalker.positionsUntil(-1, getRoot(), predicate, getRoot().lastChild);
    LegacyUnit.equal(result.length, 3);
    LegacyUnit.equalDom(result[0].position.getNode(), getRoot().lastChild);
    LegacyUnit.equalDom(result[1].position.getNode(), getRoot().firstChild.firstChild);
    LegacyUnit.equalDom(result[2].position.getNode(), getRoot().firstChild.firstChild);
    LegacyUnit.equal(predicateCallCount, 3);
  });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:25,代码来源:LineWalkerTest.ts

示例3: function

  start = function (e) {
    const docSize = getDocumentSize(doc);
    let handleElm, cursor;

    updateWithTouchData(e);

    e.preventDefault();
    downButton = e.button;
    handleElm = getHandleElm();
    startX = e.screenX;
    startY = e.screenY;

    // Grab cursor from handle so we can place it on overlay
    if (window.getComputedStyle) {
      cursor = window.getComputedStyle(handleElm, null).getPropertyValue('cursor');
    } else {
      cursor = handleElm.runtimeStyle.cursor;
    }

    $eventOverlay = DomQuery('<div></div>').css({
      position: 'absolute',
      top: 0, left: 0,
      width: docSize.width,
      height: docSize.height,
      zIndex: 0x7FFFFFFF,
      opacity: 0.0001,
      cursor
    }).appendTo(doc.body);

    DomQuery(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop);

    settings.start(e);
  };
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:33,代码来源:DragHelper.ts

示例4: addScrollAxis

      function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) {
        let scrollStart;
        const axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix;

        $(self.getEl()).append(
          '<div id="' + axisId + '" class="' + prefix + 'scrollbar ' + prefix + 'scrollbar-' + axisName + '">' +
          '<div id="' + axisId + 't" class="' + prefix + 'scrollbar-thumb"></div>' +
          '</div>'
        );

        self.draghelper = new DragHelper(axisId + 't', {
          start () {
            scrollStart = self.getEl('body')['scroll' + posName];
            $('#' + axisId).addClass(prefix + 'active');
          },

          drag (e) {
            let ratio, hasScrollH, hasScrollV, containerSize;
            const layoutRect = self.layoutRect();

            hasScrollH = layoutRect.contentW > layoutRect.innerW;
            hasScrollV = layoutRect.contentH > layoutRect.innerH;
            containerSize = self.getEl('body')['client' + sizeName] - (margin * 2);
            containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)['client' + ax] : 0;

            ratio = containerSize / self.getEl('body')['scroll' + sizeName];
            self.getEl('body')['scroll' + posName] = scrollStart + (e['delta' + deltaPosName] / ratio);
          },

          stop () {
            $('#' + axisId).removeClass(prefix + 'active');
          }
        });
      }
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:34,代码来源:Scrollable.ts

示例5: function

 suite.test('isBogus', function () {
   LegacyUnit.strictEqual(NodeType.isBogus($('<div data-mce-bogus="1"></div>')[0]), true);
   LegacyUnit.strictEqual(NodeType.isBogus($('<div data-mce-bogus="all"></div>')[0]), true);
   LegacyUnit.strictEqual(NodeType.isBogus($('<div></div>')[0]), false);
   LegacyUnit.strictEqual(NodeType.isBogus(document.createTextNode('test')), false);
   LegacyUnit.strictEqual(NodeType.isBogus(null), false);
 });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:7,代码来源:NodeTypeTest.ts

示例6: function

 suite.test('Delete at end of LI on body UL', function (editor) {
   editor.focus();
   editor.selection.setCursorLocation(editor.getBody().firstChild.firstChild, 1);
   editor.plugins.lists.backspaceDelete(true);
   LegacyUnit.equal(DomQuery('#lists ul').length, 3);
   LegacyUnit.equal(DomQuery('#lists li').length, 3);
 });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:7,代码来源:BackspaceDeleteInlineTest.ts

示例7: function

 suite.test('isCaretContainerInline', function () {
   LegacyUnit.equal(CaretContainer.isCaretContainerInline(document.createTextNode('text')), false);
   LegacyUnit.equal(CaretContainer.isCaretContainerInline(DomQuery('<span></span>')[0]), false);
   LegacyUnit.equal(CaretContainer.isCaretContainerInline(DomQuery('<span data-mce-caret="1"></span>')[0]), false);
   LegacyUnit.equal(CaretContainer.isCaretContainerInline(DomQuery('<span data-mce-caret="1">a</span>')[0].firstChild), false);
   LegacyUnit.equal(CaretContainer.isCaretContainerInline(document.createTextNode(Zwsp.ZWSP)), true);
 });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:7,代码来源:CaretContainerTest.ts

示例8: function

  suite.test('show/hide (before, block)', function () {
    let rng, $fakeCaretElm;

    $(getRoot()).html('<div>a</div>');

    rng = fakeCaret.show(false, $('div', getRoot())[0]);
    $fakeCaretElm = $(getRoot()).children();

    LegacyUnit.equal($fakeCaretElm[1].nodeName, 'P');
    LegacyUnit.equal($fakeCaretElm.eq(1).attr('data-mce-caret'), 'after');
    CaretAsserts.assertRange(rng, CaretAsserts.createRange($fakeCaretElm[1], 0, $fakeCaretElm[1], 0));

    fakeCaret.hide();
    LegacyUnit.equal($('*[data-mce-caret]', getRoot()).length, 0);
  });
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:15,代码来源:FakeCaretTest.ts


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