本文整理汇总了TypeScript中wed/util.encodeAttrName函数的典型用法代码示例。如果您正苦于以下问题:TypeScript encodeAttrName函数的具体用法?TypeScript encodeAttrName怎么用?TypeScript encodeAttrName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了encodeAttrName函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it("on elements inside _phantom_wrap", () => {
const p =
guiRoot.querySelector(`.body .p[${encodeAttrName("rend")}='wrap']`)!;
const dataNode = $.data(p, "wed_mirror_node") as Element;
const rend = dataNode.getAttribute("rend");
// Make sure the paragraph has rend="wrap".
assert.equal(rend, "wrap");
activateContextMenu(editor, p);
});
开发者ID:lddubeau,项目名称:wed,代码行数:9,代码来源:wed-menu-test.ts
示例2: DLocRoot
.then((sourceXML) => {
root = document.createElement("div");
document.body.appendChild(root);
$root = $(root);
const parser = new window.DOMParser();
const xmlDoc = parser.parseFromString(sourceXML, "text/xml");
const htmlTree = convert.toHTMLTree(window.document,
xmlDoc.firstElementChild!);
root.appendChild(htmlTree);
rootObj = new DLocRoot(root);
encodedType = encodeAttrName("type");
}));
开发者ID:lddubeau,项目名称:wed,代码行数:12,代码来源:dloc-test.ts
示例3: it
it("dispatch to proper decorators", () => {
const wrapped =
editor.guiRoot.querySelectorAll(
`[${encodeAttrName("rend")}='wrap'].tei\\:p._real`);
expect(wrapped).to.have.length(2);
function parentTest(el: HTMLElement, msg: string, expected: boolean): void {
const parent = el.parentNode as HTMLElement;
expect(parent.classList.contains("_gui_test"), msg).to.equal(expected);
}
parentTest(wrapped[0] as HTMLElement,
"the first paragraph with rend='wrap' should be decorated by \
the test mode",
true);
parentTest(wrapped[1] as HTMLElement,
"the second paragraph with rend='wrap' should not be decorated \
by the test mode",
false);
});
开发者ID:lddubeau,项目名称:wed,代码行数:19,代码来源:wed-submode-test.ts
示例4: it
it("with qualifier", () => {
assert.equal(util.encodeAttrName("blah", "ns"), "data-wed--ns-blah-");
});
开发者ID:lddubeau,项目名称:wed,代码行数:3,代码来源:util-test.ts
注:本文中的wed/util.encodeAttrName函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论