Page tree

Versions Compared

Key

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

Status
colourYellow
title릴리즈 3.2.2507 이상

셀렉션한 텍스트에 style, className, attribute를 attributes를 추가합니다.

기존에 적용되어 있는 속성에 추가로 적용됩니다.

Parameters:

actionNamestring액션 이름
propertiesObject
propertiesObject적용할 속성
styleObject적용할 스타일

classNamestring적용할 클래스 이름
attribute
attributesObject적용할 HTML 속성

attribute의 값이 null인 경우 해당 속성을 제거합니다.


Example:


Example 1Example 2
action


Code Block
language

...

xml
editor.execCommand('addRunProperties', {
    

...

className: 

...

'Butterfly',
    

...

attributes: {

...


...

 

...

     

...

  

...

'title': '

...

Beautiful butterfly',

...


  

...

 

...

     

...

'aria-label': '

...

아름다운 나비'
    }
});

...



Code Block
languagexml
editor.execCommand('addRunProperties', {
    

...

className: 

...

'Beautiful',
    

...

attributes: {

...


...

 

...

     

...

  

...

'title': '

...

'

...


    

...

editor.execCommand('addRunProperties', {style: {fontSize: {value: 20, unit: 'pt'} }}); // 글자 크기 추가
editor.execCommand('addRunProperties', { color: {r: 255, g: 0, b: 0} }); // 글자 색 추가
editor.execCommand('addRunProperties', { backgroundColor: {r: 0, g: 0, b: 255} }); // 글자 배경색 추가
}
});


before


Code Block
languagexml
<span>아름다운 나비</span>



Code Block
languagexml
<span class="Butterfly" aria-label="아름다운 나비" title="Beautiful butterfly">아름다운 나비</span>


after


Code Block
languagexml
<span class="Butterfly" aria-label="아름다운 나비" title="Beautiful butterfly">아름다운 나비</span>



Code Block
languagexml
<span class="Butterfly Beautiful" aria-label="아름다운 나비">아름다운 나비</span>