本文整理汇总了TypeScript中tinymce/core/api/dom/DomQuery.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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);
});
示例2: 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);
});
示例3: 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);
});
示例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');
}
});
}
示例5: 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);
};
示例6: function
suite.test('TestCase-TBA: Lists: Backspace at beginning of LI on body UL', function (editor) {
editor.focus();
editor.selection.setCursorLocation(editor.getBody().firstChild.firstChild, 0);
editor.plugins.lists.backspaceDelete();
LegacyUnit.equal(DomQuery('#lists ul').length, 3);
LegacyUnit.equal(DomQuery('#lists li').length, 3);
});
示例7: 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);
});
示例8: function
suite.test('isBogusAll', function () {
LegacyUnit.strictEqual(NodeType.isBogusAll($('<div data-mce-bogus="1"></div>')[0]), false);
LegacyUnit.strictEqual(NodeType.isBogusAll($('<div data-mce-bogus="all"></div>')[0]), true);
LegacyUnit.strictEqual(NodeType.isBogusAll($('<div></div>')[0]), false);
LegacyUnit.strictEqual(NodeType.isBogusAll(document.createTextNode('test')), false);
LegacyUnit.strictEqual(NodeType.isBogusAll(null), false);
});