Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourYellow
title릴리즈 2.6.0 이상

It adds an icon resource to be used in the editor.
If there is an icon with the same name, it is overwritten에디터에 아이콘 리소스를 추가합니다.

동일한 키의 아이콘이 있는 경우 덮어씁니다. 이를 활용하여 기존에 설정된 아이콘을 변경할 수 있습니다.


Parameters:

NameTypeDescription
iconResourcesObjectkey: Icon name (function name)아이콘 이름, value: Object in the svg tag or img tag formatSVG 태그 또는 IMG 태그 형식의 string


Example:

Code Block
languagejs
themeEmacs
var iconResources = {
	'image': '<img src="data:image/png;base64,iVBORw0KGgoAA.......BJRU5ErkJggg==">', // IMG 태그 형식
	'bold': '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 16"><rect y="6.062" width="16" height="4"/></svg>', // SVG 태그 형식
	......
};
 
SynapEditor.addIcons(iconResources);

...