릴리즈 2.4.0 이상
주민등록번호, 이메일, 전화번호와 같은 개인정보들을 필터링하여 '*'로 치환해주는 '개인정보보호' 플러그인입니다.
사용방법
플러그인 파일 불러오기
<!-- SynapEditor 객체가 존재해야 적용할 수 있기 때문에 에디터 스크립트 파일 아래에 include 해야 합니다 --> <script src="personalDataProtection.min.js의 url"></script> <link rel="stylesheet" href="personalDataProtection.min.css의 url">
UI
플러그인 이름인 'personalDataProtection'을 사용하여 툴바 영역, 메뉴 영역에 버튼을 추가할 수 있습니다.
툴바에 추가
에디터 설정
//... 'editor.toolbar': [ //..., 'personalDataProtection', //... ], // ...
메뉴에 추가
에디터 설정
//... 'editor.menu.definition': { //..., 'tools': [ //..., 'personalDataProtection', //... ], //... }, //...
config설정
릴리즈 2.15.0 이상
개인정보보호 검사규칙을 추가하거나 수정 할 수 있습니다.
에디터 설정
// config설정 예제 'personalDataProtection.config': { 'phoneNumber': { // 기존 개인정보보호 설정값 수정 replaceText: (text, replaceChar, regExp) => { let index = 0; return text.replace(/\d+/g, (match) => index++ === 1 ? match.replace(/\d/g, replaceChar) : match); } }, 'SynapSoft': { // 새로운 개인정보보호 설정 regExp: /synapsoft/gi, replaceText: (text, replaceChar, regExp) => { return text.replace(/[s]/gi, replaceChar); } } }
API
editor.checkPersonalData(callback)
릴리즈 2.13.0 이상
개인정보보호 검사를 수행하고 결과를 인자로 받은 callback 함수로 반환합니다.
Parameters:
name | Type | Description | |
---|---|---|---|
callback | Function | 개인정보 검사 결과를 받을 콜백함수입니다. 검사 결과가 Boolean 으로 반환됩니다.
|
Example
editor.checkPersonalData(function (result) { if (!result) { // 개인 정보 검사가 통과되지 않으면 개인 정보 검사 다이얼로그 열기 editor.getUIManager().showDialog('personalDataProtection'); } });