GithubHelp home page GithubHelp logo

simple-wysiwyg-editor's Introduction

위지윅에디터

텍스트를 입력할 수 있고 B I U S 스타일을 적용 할 수 있는 간단한 에디터 입니다.
contenteditable로 구현되어 있으며, 편집은 Web API를 사용하고 있습니다.
지원 브라우저는 IE9이상, Chrome입니다.


image


현재 지원 하는 편집

B - 선택된 텍스트에 굵게 적용.
I - 선택된 텍스트에 기울기 적용.
U - 선택된 텍스트에 밑줄 적용.
S - 선택된 텍스트에 취소선 적용.
image


설치 방법

git clone https://github.com/editorteam/interview-h2ck4u.git

npm install // 에디터에 필요한 패키지를 다운로드 합니다.

npm run build // 프로젝트를 빌드 합니다.


테스트 코드 실행

npm run test // 테스트 코드를 실행합니다.  

연동 방법

<!DOCTYPE html>
<html>

<head>
  <title>Comment Editor</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  <script src="./dist/editor.js"></script> <!-- 빌드된 에디터 파일 -->
  <script src="./resource/config.js"></script> <!-- 설정파일 -->

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!-- jqeury -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <!-- fontawesom -->
</head>

<body onload="createEditor();">
  <div id="editor"></div> // 에디터를 생성할 태그
  <script>
    function createEditor() {
      new EditorJS('editor', config); // 첫번째 인자는 에디터를 생성할 태그의 id와 일치 시켜야 합니다. 두번째 인자는
    }
  </script>
</body>
</html>

에디터를 여러개 생성하는 방법.

<div id="editor1"></div> 
<div id="editor2"></div> 
<div id="editor3"></div> 

new EditorJS('editor1', config);
new EditorJS('editor2', config);
new EditorJS('editor3', config);

image


설정 파일

편집창의 최대 글자수를 설정 할 수 있습니다.

var config = {
    MAX_TEXT_COUNT: 3000 // 편집창의 최대 글자수를 설정합니다.
}

simple-wysiwyg-editor's People

Contributors

h2ck4u avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.