MCPcopy Create free account
hub / github.com/Yantesoft/LinuxdoAssistant / createSVGIcon

Function createSVGIcon

linuxdo-helper.user.js:316–327  ·  view source on GitHub ↗

* 创建SVG图标元素 * @param {string} iconHref - 图标引用(如 '#play' 或 '#pause') * @returns {SVGElement} SVG元素

(iconHref)

Source from the content-addressed store, hash-verified

314 * @returns {SVGElement} SVG元素
315 */
316 function createSVGIcon(iconHref) {
317 const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
318 svg.setAttribute('class', 'fa d-icon d-icon-rocket svg-icon prefix-icon svg-string');
319 svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
320
321 const use = document.createElementNS('http://www.w3.org/2000/svg', 'use');
322 use.setAttribute('href', iconHref);
323
324 svg.appendChild(use);
325
326 return svg;
327 }
328
329 /**
330 * 创建控制开关按钮

Callers 1

createSwitchButtonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected