Skip to content

enable the use of the WEB's TEXTAREA as a text editor. It supports line number display and TAB input.

Notifications You must be signed in to change notification settings

impressionestudio/textarea-editor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

textarea-editor

Transform the HTML TEXTAREA tag into a basic text editor. The features include the inclusion of line numbers and the capability to input tabs.

Screen capture

HOW TO USE

First, load the sweEditor.js and sweEditor.css files.

    <link rel="stylesheet" href="/css/sweEditor.css">
    <script defer src="/js/sweEditor.js"></script>

Then, place a TEXTAREA tag in your HTML.

    <textarea id="fugafuga"></textarea>

Please attach a JavaScript class to the textarea tag.

    <script>
        window.onload = (e) => {
            const sedt = document.getElementById("fugafuga");
            if (sedt) {
                new sweEditor(sedt);
            }
        };
    </script>


The size of the editor is designed to automatically match the dimensions specified in the textarea tag.

colors,and sizes

Feel free to experiment with the CSS file for things like color, font, and text size.

issue

While it has been completed, there are performance issues. Text editing at the level of a few thousand lines poses no problem, but when it exceeds tens of thousands of lines, editing becomes difficult. The cause seems to be related to the use of HTML's TEXTAREA, possibly indicating a performance issue in the browser (perhaps a design flaw). It is likely that TEXTAREA is not designed to handle such lengthy texts.

About

enable the use of the WEB's TEXTAREA as a text editor. It supports line number display and TAB input.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 59.0%
  • CSS 20.8%
  • HTML 20.2%