Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »




플러그인 관련 API

플러그인 추가

SynapEditor.addPlugin(pluginName, pluginObject)

릴리즈 2.3.0 이상

에디터에 플러그인을 추가합니다.

Params:

Name

Type

Attribute

Description

pluginNamestring
플러그인의 이름입니다.
pluginObjectobject
'init' 함수를 포함하고 있는 플러그인 객체입니다.

Example:

myPlugin.js
var pluginName = "pluginName";


SynapEditor.addPlugin(pluginName, {
	init: function (editor) {
		// 플러그인 코드
	}
});


플러그인 버튼 정의

editor.definePluginButton(pluginName, buttonDefinition)

릴리즈 2.3.0 이상

에디터에 버튼 정의를 등록합니다.

Params:

Name

Type

Attribute

Description

pluginNamestring
플러그인의 이름입니다.
buttonDefinitionobject
버튼의 아이콘, 레이블, 클릭했을 때의 동작 정의입니다.

Example:

myPlugin.js
var pluginName = "pluginName";


SynapEditor.addPlugin(pluginName, {
	init: function (editor) {
		// 플러그인 버튼 정의
		editor.definePluginButton(pluginName, {
			icon: '<svg><g>........</g></svg>',
			label: '버튼이름', // 버튼에 마우스를 올리면 툴팁으로 보여집니다.
			onClickFunc: function (editor) {
				// 버튼을 클릭하면 실행
			}
		});
	}
});



  • No labels