NEXEDITOR Documentation

A powerful, lightweight, and feature-rich WYSIWYG editor with zero dependencies.

Welcome! This documentation will guide you through everything you need to know about NEXEDITOR, from basic installation to advanced plugin development.

Key Features

  • Zero Dependencies - Pure vanilla JavaScript, no jQuery or other libraries required
  • AI-Powered - Integrated AI content generation with GPT-4 support
  • Internationalization - Built-in i18n system with 20+ languages
  • RTL Support - Full right-to-left language support
  • Dark Mode - Professional dark theme included
  • Code View - Switch between visual and code editing seamlessly
  • 10+ Plugins - Rich set of plugins for extended functionality
  • Extensible - Easy-to-use plugin API for custom extensions
  • Responsive - Works perfectly on all devices
  • Modern - Built with ES6+ and modern web standards

Quick Links

Installation

Purchase from Codester/

NEXEDITOR is available exclusively on Codester. After purchase, download the package and extract it to your project.

html
Browser Support NEXEDITOR supports all modern browsers: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+

Quick Start

Basic Setup

Create your first NEXEDITOR instance in 3 simple steps:

Step 1: HTML Structure

html

Step 2: Initialize Editor

javascript

Step 3: Get/Set Content

javascript
That's it! You now have a fully functional rich text editor. Continue reading to learn about advanced features and customization options.

Basic Usage

Setting Initial Content

You can set initial content in multiple ways:

javascript

Getting Content

javascript

Clearing Content

javascript

Focus Management

javascript

Listening to Changes

javascript

Initialization Options

NEXEDITOR accepts a comprehensive set of configuration options during initialization:

javascript

Configuration Options Reference

Option Type Default Description
content string '' Initial HTML content for the editor
placeholder string 'Start typing...' Placeholder text when editor is empty
theme string 'light' Editor theme: 'light' or 'dark'
lang string 'en' Language code (en, ro, es, fr, de, ar, etc.)
rtl boolean false Enable right-to-left text direction
minHeight string '300px' Minimum height of the editor
maxHeight string|null null Maximum height (null for unlimited)
codeView boolean true Enable code view toggle button
plugins array [] Array of plugins to load
toolbar array|null null Custom toolbar configuration

Themes

NEXEDITOR comes with two built-in themes: Light and Dark.

Setting Theme on Initialization

javascript

Changing Theme Dynamically

javascript

Theme Toggle Example

html
Custom Themes Want to create your own theme? Check out the Custom Themes section for detailed instructions.

Localization (i18n)

NEXEDITOR has built-in internationalization support for 20+ languages out of the box.

Supported Languages

The following languages are available by default:

  • English (en)
  • Romanian (ro)
  • Spanish (es)
  • French (fr)
  • German (de)
  • Italian (it)
  • Portuguese (pt)
  • Russian (ru)
  • Chinese (zh)
  • Japanese (ja)
  • Korean (ko)
  • Arabic (ar)
  • Hebrew (he)
  • Turkish (tr)
  • Polish (pl)
  • Dutch (nl)
  • Swedish (sv)
  • Norwegian (no)
  • Danish (da)
  • Finnish (fi)
  • Czech (cs)

Setting Language

javascript

Language Switcher Example

html

Adding Custom Translations

javascript
Translation Keys For a complete list of translation keys, check the src/core/i18n.js file in the source code.

RTL Support

NEXEDITOR provides full support for right-to-left (RTL) languages like Arabic, Hebrew, Persian, and Urdu.

Enabling RTL Mode

javascript

RTL with Language Switching

javascript

RTL Direction Toggle

html
Plugin RTL Support All built-in plugins automatically respect the RTL setting. When RTL is enabled, plugin modals and UI elements adjust their layout accordingly.

Toolbar

The toolbar provides quick access to formatting options and actions.

Default Toolbar

By default, NEXEDITOR includes the following toolbar buttons:

javascript

Custom Toolbar

javascript

Available Toolbar Buttons

Button Action Icon
bold Apply bold formatting
italic Apply italic formatting
underline Apply underline formatting
strikethrough Apply strikethrough formatting
h1 Format as heading 1
h2 Format as heading 2
h3 Format as heading 3
orderedList Insert numbered list
unorderedList Insert bulleted list
link Insert/edit link
image Insert image
alignLeft Align text left
alignCenter Align text center
alignRight Align text right
undo Undo last action
redo Redo last undone action
codeView Toggle code view
| Toolbar separator โ€”
Plugin Buttons When you load plugins, they can add their own buttons to the toolbar. Check each plugin's documentation for details.

Code View

Code View allows users to switch between visual editing and raw HTML editing with syntax highlighting.

Enabling Code View

javascript

Toggling Code View Programmatically

javascript

Custom Code View Button

html
HTML Validation Code View includes basic HTML validation. Invalid HTML will be automatically cleaned and formatted when switching back to visual mode.

Content Management

Getting Content

javascript

Setting Content

javascript

Clearing Content

javascript

Form Integration

html

Plugin System

NEXEDITOR includes a powerful plugin system that allows you to extend functionality. The package comes with 10+ premium plugins ready to use.

Loading Plugins

javascript

Available Plugins

Plugin Loading Patterns

javascript

AI Content Generator Plugin AI-Powered

Generate high-quality content using Anthropic's Claude or OpenAI's GPT. This plugin supports multiple content types and automatically respects the editor's language and RTL settings.

Backend Required This plugin requires a backend endpoint to proxy requests to AI APIs. Direct browser requests are not supported for security reasons (API key protection).

Quick Setup - Choose Your Provider

๐Ÿ”ฎ Claude (Anthropic)

Most intelligent and context-aware AI, excellent for complex content generation.

  • Best for creative writing
  • Superior context understanding
  • Excellent at following instructions
Setup Claude

โšก GPT-4 (OpenAI)

Widely adopted and versatile AI, great for general-purpose content generation.

  • Fast response times
  • Extensive training data
  • Well-documented API
Setup GPT-4

Backend Setup - Claude (Anthropic)

PHP Endpoint (Simple)

php

Laravel Example

php

Backend Setup - GPT (OpenAI)

PHP Endpoint (Simple)

php

Node.js/Express Example

javascript

Frontend Installation

javascript

Configuration Options

Option Type Default Description
provider string 'claude' AI provider: 'claude' or 'gpt'
claudeEndpoint string '/api/ai/claude-generate' Claude backend endpoint URL
claudeModel string 'claude-sonnet-4-5-20250929' Claude model to use
openaiEndpoint string '/api/ai/openai-generate' OpenAI backend endpoint URL
openaiModel string 'gpt-4' OpenAI model to use
maxTokens number 2048 Maximum tokens in response
temperature number 0.7 Response creativity (0-2)
useStaticFallback boolean true Use static templates if API fails
respectLocale boolean true Generate in editor's language
respectRTL boolean true Format RTL for Arabic/Hebrew
customPrompts array [] Add custom quick templates

Available AI Models

Claude (Anthropic)

  • claude-sonnet-4-5-20250929 - Latest Sonnet, most intelligent (recommended)
  • claude-opus-4-1 - Most powerful for complex tasks
  • claude-4 - Standard Claude 4 model

GPT (OpenAI)

  • gpt-4 - Most capable GPT model (recommended)
  • gpt-4-turbo - Faster, more cost-effective
  • gpt-3.5-turbo - Budget-friendly option

Usage

Click the ๐Ÿค– AI button in the toolbar to open the AI Content Generator modal. The plugin provides:

  • Provider Selection - Switch between Claude and GPT-4 in the UI
  • Quick Templates - Pre-built prompts for common content types
  • Content Types - Generate, Improve, Translate, Expand, or Summarize
  • Multi-language Support - Translate to 21+ languages
  • Language Detection - Automatically generates in editor's current language
  • RTL Support - Properly formats RTL content for Arabic, Hebrew, etc.
  • Bootstrap 5 - Generates responsive, modern HTML
  • Advanced Settings - Model selection, temperature, max tokens

Built-in Quick Prompts

Template Description
๐Ÿ’ฌ FAQ Section Create an FAQ with Bootstrap accordion
โœจ Features Grid Generate feature cards with icons
๐Ÿ“Š Pricing Table Create pricing plans with CTA buttons
โญ Testimonials Customer reviews section
๐ŸŽฏ Hero Section Modern hero with CTA buttons
๐Ÿ“ Blog Post Blog post structure with sections
๐Ÿ›๏ธ Product Cards Product showcase with cards
๐Ÿ“ฑ Contact Section Contact info and form

Content Generation Types

  1. Generate New Content - Create content from scratch based on your description
  2. Improve Selected Text - Enhance quality while maintaining meaning
  3. Translate Content - Translate to 21+ languages
  4. Expand Content - Add more details and elaboration
  5. Summarize Content - Condense while keeping key points

Translation Languages

The plugin supports translation to 21 languages:

  • English
  • Romanian
  • Spanish
  • French
  • German
  • Italian
  • Portuguese
  • Russian
  • Chinese
  • Japanese
  • Korean
  • Arabic (RTL)
  • Hebrew (RTL)
  • Turkish
  • Polish
  • Dutch
  • Swedish
  • Norwegian
  • Danish
  • Finnish
  • Czech

Security Best Practices

Critical Security Notes
  • Never expose API keys in frontend code
  • Always use a backend endpoint to proxy API requests
  • Implement rate limiting (10-20 requests/minute recommended)
  • Add authentication middleware to protect endpoints
  • Validate and sanitize all user inputs
  • Include CSRF token protection
  • Use HTTPS in production
  • Monitor API usage and costs

Provider Comparison

Feature Claude GPT-4
Context Understanding โญโญโญโญโญ Excellent โญโญโญโญ Very Good
Creative Writing โญโญโญโญโญ Excellent โญโญโญโญ Very Good
Following Instructions โญโญโญโญโญ Excellent โญโญโญโญ Very Good
Speed โญโญโญโญ Fast โญโญโญโญโญ Very Fast
Cost $$$ Moderate $$ Affordable
Best For Complex content, creative writing General purpose, quick tasks
Pro Tips
  • The more specific your prompt, the better the results
  • Use Quick Templates as starting points, then customize
  • Try both providers to see which works best for your needs
  • Adjust temperature: lower (0.3-0.5) for factual content, higher (0.7-0.9) for creative content
  • Use the Advanced Settings to fine-tune generation

Auto Save Plugin Popular

Automatically save editor content to localStorage at regular intervals. Never lose your work!

Installation

javascript

Configuration Options

Option Type Default Description
interval number 30000 Auto-save interval in milliseconds
storageKey string 'nexeditor-autosave' localStorage key for saving
showIndicator boolean true Show visual save indicator
onSave function null Callback function on save

Manual Save

javascript

Restore Saved Content

javascript

Server-Side Auto Save

javascript

Emoji Picker Plugin

Insert emojis with a beautiful picker featuring 1000+ emojis, categories, search, and recent history.

Installation

javascript

Features

  • 1000+ emojis from all categories
  • Category filtering (Smileys, People, Animals, Food, etc.)
  • Emoji search with keywords
  • Recently used emojis
  • Skin tone variations
  • Keyboard navigation

Usage

Click the emoji button in the toolbar to open the picker.

Programmatic Usage

javascript

Table Builder Plugin

Create and manage responsive tables with custom rows, columns, and styling.

Installation

javascript

Configuration Options

Option Type Default Description
maxRows number 20 Maximum number of rows
maxColumns number 10 Maximum number of columns
defaultRows number 3 Default number of rows
defaultColumns number 3 Default number of columns

Features

  • Custom row and column count
  • Add/remove rows and columns
  • Merge cells
  • Table styling options
  • Responsive design
  • Header row support

Usage

Click the table button in the toolbar to insert a table.

Video Embed Plugin

Embed videos from YouTube, Vimeo, and other platforms with responsive containers.

Installation

javascript

Supported Platforms

  • YouTube - Full support for YouTube videos
  • Vimeo - Vimeo video embedding
  • Direct URLs - MP4, WebM, OGG video files

Usage

javascript

Features

  • Automatic platform detection
  • Responsive 16:9 aspect ratio
  • Custom dimensions
  • Autoplay support
  • Preview thumbnail

Click the video button in the toolbar to insert a video.

Other Plugins

Icon Picker

Insert icons from Bootstrap Icons and Font Awesome libraries.

javascript

Special Characters

Insert special characters, symbols, and mathematical notation.

javascript

Text Statistics

Real-time word count, character count, and reading time statistics.

javascript

Find & Replace

Advanced search and replace with regex support.

javascript

Callout Boxes

Insert styled callout boxes for notes, warnings, tips, etc.

javascript

All Plugins at Once

javascript

API Methods

Complete reference of all available methods in the NEXEDITOR API.

Content Methods

Method Parameters Returns Description
getContent() โ€” string Get HTML content from editor
setContent(html) string void Set HTML content in editor
getTextContent() โ€” string Get plain text (no HTML tags)
clear() โ€” void Clear all content
isEmpty() โ€” boolean Check if editor is empty
insertContent(html) string void Insert HTML at cursor position
appendContent(html) string void Append HTML to end of content
prependContent(html) string void Prepend HTML to start of content

Theme & Appearance Methods

Method Parameters Returns Description
setTheme(theme) string void Set theme ('light' or 'dark')
getTheme() โ€” string Get current theme
setLanguage(lang) string void Set interface language
getLanguage() โ€” string Get current language
setRTL(enabled) boolean void Enable/disable RTL mode
isRTL() โ€” boolean Check if RTL is enabled

Editor State Methods

Method Parameters Returns Description
focus() โ€” void Focus the editor
blur() โ€” void Remove focus from editor
isFocused() โ€” boolean Check if editor is focused
enable() โ€” void Enable editor (make editable)
disable() โ€” void Disable editor (read-only)
isEnabled() โ€” boolean Check if editor is enabled
destroy() โ€” void Destroy editor instance

Code View Methods

Method Parameters Returns Description
showCodeView() โ€” void Show code view
showVisualEditor() โ€” void Show visual editor
toggleCodeView() โ€” void Toggle between views
isCodeViewActive() โ€” boolean Check if code view is active

Plugin Methods

Method Parameters Returns Description
getPlugin(name) string Plugin|null Get plugin instance by name
hasPlugin(name) string boolean Check if plugin is loaded

Utility Methods

Method Parameters Returns Description
getWordCount() โ€” number Get word count
getCharacterCount() โ€” number Get character count
getVersion() โ€” string Get NEXEDITOR version

API Events

NEXEDITOR emits various events that you can listen to for custom behavior.

Event Listener Methods

javascript

Available Events

Event Parameters Description
init editor Fired when editor is initialized
change content Fired when content changes
focus event Fired when editor gains focus
blur event Fired when editor loses focus
keydown event Fired on keydown in editor
keyup event Fired on keyup in editor
paste event Fired when content is pasted
beforeDestroy editor Fired before editor is destroyed
destroy editor Fired when editor is destroyed

Event Examples

javascript

API Properties

Read-only properties available on the NEXEDITOR instance.

Property Type Description
element HTMLElement The container element
editorElement HTMLElement The contenteditable element
config object Configuration options
plugins Map Map of loaded plugins
i18n I18n Internationalization instance
version string NEXEDITOR version number

Usage Example

javascript

Creating Custom Plugins

NEXEDITOR provides a powerful plugin API that makes it easy to extend functionality.

Plugin Structure

javascript

Plugin with Modal

javascript

Plugin with Options

javascript
Best Practices
  • Always provide metadata via getMetadata()
  • Use this.i18n.t() for all user-facing text
  • Respect editor.config.rtl for RTL layouts
  • Clean up resources in destroy() method
  • Provide default options that can be overridden

Custom Themes

Create your own themes by overriding CSS variables.

CSS Variables

css

Complete Custom Theme Example

css

Using Custom Theme

javascript

Framework Integration

React Integration

jsx

Vue.js Integration

vue

Angular Integration

typescript

FAQ

Does NEXEDITOR require jQuery?

No! NEXEDITOR is built with pure vanilla JavaScript and has zero external dependencies. It works standalone without jQuery or any other library.

Can I use NEXEDITOR in a commercial project?

Yes! With a Regular License ($49), you can use NEXEDITOR in a single end product. For SaaS or applications where end users are charged, you need an Extended License ($249).

How do I get an API key for the AI plugin?

You need an OpenAI API key. Sign up at platform.openai.com and generate an API key in your account dashboard. Note that API usage will be charged according to OpenAI's pricing.

Is NEXEDITOR mobile-friendly?

Yes! NEXEDITOR is fully responsive and works perfectly on mobile devices, tablets, and desktops. The toolbar adapts to smaller screens automatically.

Can I create my own plugins?

Absolutely! NEXEDITOR has a well-documented plugin API. Check the Creating Custom Plugins section for detailed guides and examples.

How do I add a custom language?

Use the i18n.addTranslation() method to add custom translations. See the Localization section for details.

Can I customize the toolbar?

Yes! You can customize which buttons appear in the toolbar by passing a toolbar array in the configuration. See the Toolbar section.

Does NEXEDITOR support RTL languages?

Yes! NEXEDITOR has full RTL (right-to-left) support for languages like Arabic, Hebrew, Persian, and Urdu. Enable it with rtl: true in the config.

How do I integrate with a form?

Use a hidden input field and sync the editor content on form submit. See the Content Management section for a complete example.

Can I use NEXEDITOR with React/Vue/Angular?

Yes! Check out the Framework Integration section for ready-to-use examples for React, Vue, and Angular.

Troubleshooting

Editor not initializing

Problem: Editor doesn't appear or throws an error

Solutions:

  • Check that the CSS file is loaded: <link rel="stylesheet" href="nexeditor.css">
  • Verify the JavaScript file is loaded: <script src="nexeditor.umd.js">
  • Make sure the target element exists in the DOM before initialization
  • Check browser console for error messages

Plugins not loading

Problem: Plugins don't appear in toolbar or throw errors

Solutions:

  • Verify plugin names are spelled correctly (case-sensitive)
  • Check that plugins are properly configured with options if required
  • Ensure plugin files are included if using custom plugins
  • Check console for plugin initialization errors

Content not saving

Problem: Form submits but content is empty

Solutions:

  • Sync editor content to hidden input before form submit
  • Use editor.getContent() to retrieve current content
  • Check that form is not submitting before content is synced
  • Verify the hidden input has the correct name attribute

Styling conflicts

Problem: Editor styles look broken or conflict with site CSS

Solutions:

  • Load NEXEDITOR CSS after your site's CSS
  • Use more specific CSS selectors if needed
  • Check for CSS reset styles affecting the editor
  • Use browser dev tools to identify conflicting styles

Performance issues

Problem: Editor is slow or laggy

Solutions:

  • Reduce the number of plugins loaded
  • Disable plugins you don't need
  • Avoid loading too many editor instances on one page
  • Check for memory leaks (destroy editors when not needed)
Still having issues? Contact support through your Codester purchase page. Include:
  • NEXEDITOR version
  • Browser and version
  • Console error messages
  • Minimal code example reproducing the issue

Changelog

Version 1.0.0 (2024-11-06)

Initial Release

  • Core WYSIWYG editor with zero dependencies
  • Complete toolbar with 15+ formatting options
  • Code View with syntax highlighting
  • i18n system with 20+ languages
  • Full RTL support
  • Light and Dark themes
  • 10+ premium plugins included
  • AI Content Generator plugin (GPT-4)
  • Auto Save plugin
  • Emoji Picker (1000+ emojis)
  • Table Builder
  • Video Embed
  • Icon Picker
  • Special Characters
  • Text Statistics
  • Find & Replace
  • Callout Boxes
  • Complete API documentation
  • React/Vue/Angular integration examples
Thank you for choosing NEXEDITOR! We're committed to providing regular updates and excellent support. Stay tuned for new features and improvements!