All Projects → webfashionist → Richtext

webfashionist / Richtext

Licence: agpl-3.0
WYSIWYG editor developed as jQuery plugin

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Richtext

cazary
jQuery plugin of WYSIWYG editor that aims for fast, lightweight, stylish, customizable, cross-browser, and multi-language.
Stars: ✭ 12 (-84.42%)
Mutual labels:  jquery-plugin, wysiwyg
Tui.editor
🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
Stars: ✭ 14,016 (+18102.6%)
Mutual labels:  jquery-plugin, wysiwyg
Brickyeditor
WYSIWYG block editor jQuery plugin.
Stars: ✭ 112 (+45.45%)
Mutual labels:  jquery-plugin, wysiwyg
Trumbowyg
A lightweight and amazing WYSIWYG JavaScript editor under 10kB
Stars: ✭ 3,664 (+4658.44%)
Mutual labels:  jquery-plugin, wysiwyg
Jquery Lockfixed
jQuery lockfixed plugin
Stars: ✭ 69 (-10.39%)
Mutual labels:  jquery-plugin
Ajax Image Upload
jQuery图片上传插件,支持批量上传、预览、删除、放大、上传数量和尺寸限制以及上传前、上传中和上传后的回调函数。
Stars: ✭ 59 (-23.38%)
Mutual labels:  jquery-plugin
Cmd Resume
Web-based Command Line Resume
Stars: ✭ 55 (-28.57%)
Mutual labels:  jquery-plugin
Jwysiwyg
WYSIWYG jQuery Plugin
Stars: ✭ 1,076 (+1297.4%)
Mutual labels:  jquery-plugin
Applozic Web Plugin
Javascript (jQuery) Real Time Chat & Messaging plugin
Stars: ✭ 76 (-1.3%)
Mutual labels:  jquery-plugin
Jquery.toaster
jQuery plugin for displaying customizable toast notifications via Bootstrap alerts
Stars: ✭ 74 (-3.9%)
Mutual labels:  jquery-plugin
Jtap
Tap Event for jQuery
Stars: ✭ 65 (-15.58%)
Mutual labels:  jquery-plugin
Yawysiwygee
Yet another what-you-see-is-what-you-get equation editor
Stars: ✭ 60 (-22.08%)
Mutual labels:  wysiwyg
Wyg
A new WYSIWYG editing experience for the modern web
Stars: ✭ 73 (-5.19%)
Mutual labels:  wysiwyg
Jscroll
An infinite scrolling plugin for jQuery.
Stars: ✭ 1,084 (+1307.79%)
Mutual labels:  jquery-plugin
Swiftype Search Jquery
Elastic Site Search jQuery search plugin
Stars: ✭ 74 (-3.9%)
Mutual labels:  jquery-plugin
Jquery.balloon.js
A jQuery plugin to add balloon tips to elements User-friendly, fine-tunable and without css and images
Stars: ✭ 54 (-29.87%)
Mutual labels:  jquery-plugin
Datepicker
⚠️ [Deprecated] No longer maintained. A simple jQuery datepicker plugin.
Stars: ✭ 1,133 (+1371.43%)
Mutual labels:  jquery-plugin
Tokenize2
Tokenize2 is a plugin which allows your users to select multiple items from a predefined list or ajax, using autocompletion as they type to find each item. You may have seen a similar type of text entry when filling in the recipients field sending messages on facebook or tags on tumblr.
Stars: ✭ 74 (-3.9%)
Mutual labels:  jquery-plugin
Mricheditor
A rich text editor sample (based on summernote)
Stars: ✭ 1,123 (+1358.44%)
Mutual labels:  wysiwyg
Deckdeckgo
The web open source editor for presentations
Stars: ✭ 1,117 (+1350.65%)
Mutual labels:  wysiwyg

RichText

WYSIWYG editor developed as jQuery plugin.

Requirements

  • jQuery (v.3+, v.3.2+ recommended)
  • FontAwesome (v.4.7.0 / v.5+)
  • src/jquery.richtext.min.js
  • src/richtext.min.css

Demo

To see the latest demo version, you might want to use the following URL: Demo from htmlpreview.github.io

Initialize editor

Simply call .richText() on your jQuery('textarea') or jQuery('input') field (other HTML tags are allowed as well, but not recommended).

Options

.richText() allows several options to be set, the default option object is:

$(element).richText({

  // text formatting
  bold: true,
  italic: true,
  underline: true,

  // text alignment
  leftAlign: true,
  centerAlign: true,
  rightAlign: true,
  justify: true,

  // lists
  ol: true,
  ul: true,

  // title
  heading: true,

  // fonts
  fonts: true,
  fontList: [
      "Arial", 
      "Arial Black", 
      "Comic Sans MS", 
      "Courier New", 
      "Geneva", 
      "Georgia", 
      "Helvetica", 
      "Impact", 
      "Lucida Console", 
      "Tahoma", 
      "Times New Roman",
      "Verdana"
  ],
  fontColor: true,
  fontSize: true,

  // uploads
  imageUpload: true,
  fileUpload: true,

  // media
  videoEmbed: true,

  // link
  urls: true,

  // tables
  table: true,

  // code
  removeStyles: true,
  code: true,

  // colors
  colors: [],

  // dropdowns
  fileHTML: '',
  imageHTML: '',

  // translations
  translations: {
      'title': 'Title',
      'white': 'White',
      'black': 'Black',
      'brown': 'Brown',
      'beige': 'Beige',
      'darkBlue': 'Dark Blue',
      'blue': 'Blue',
      'lightBlue': 'Light Blue',
      'darkRed': 'Dark Red',
      'red': 'Red',
      'darkGreen': 'Dark Green',
      'green': 'Green',
      'purple': 'Purple',
      'darkTurquois': 'Dark Turquois',
      'turquois': 'Turquois',
      'darkOrange': 'Dark Orange',
      'orange': 'Orange',
      'yellow': 'Yellow',
      'imageURL': 'Image URL',
      'fileURL': 'File URL',
      'linkText': 'Link text',
      'url': 'URL',
      'size': 'Size',
      'responsive': 'Responsive',
      'text': 'Text',
      'openIn': 'Open in',
      'sameTab': 'Same tab',
      'newTab': 'New tab',
      'align': 'Align',
      'left': 'Left',
      'center': 'Center',
      'right': 'Right',
      'rows': 'Rows',
      'columns': 'Columns',
      'add': 'Add',
      'pleaseEnterURL': 'Please enter an URL',
      'videoURLnotSupported': 'Video URL not supported',
      'pleaseSelectImage': 'Please select an image',
      'pleaseSelectFile': 'Please select a file',
      'bold': 'Bold',
      'italic': 'Italic',
      'underline': 'Underline',
      'alignLeft': 'Align left',
      'alignCenter': 'Align centered',
      'alignRight': 'Align right',
      'addOrderedList': 'Add ordered list',
      'addUnorderedList': 'Add unordered list',
      'addHeading': 'Add Heading/title',
      'addFont': 'Add font',
      'addFontColor': 'Add font color',
      'addFontSize' : 'Add font size',
      'addImage': 'Add image',
      'addVideo': 'Add video',
      'addFile': 'Add file',
      'addURL': 'Add URL',
      'addTable': 'Add table',
      'removeStyles': 'Remove styles',
      'code': 'Show HTML code',
      'undo': 'Undo',
      'redo': 'Redo',
      'close': 'Close'
  },
            
  // privacy
  youtubeCookies: false,
  
  // developer settings
  useSingleQuotes: false,
  height: 0,
  heightPercentage: 0,
  id: "",
  class: "",
  useParagraph: false,
  maxlength: 0,
  callback: undefined,
  useTabForNext: false
});

Text formatting

  • bold (default: (boolean) true) :: Defines if the bold button should be displayed in the editor toolbar
  • italic (default: (boolean) true) :: Defines if the italic button should be displayed
  • underline (default: (boolean) true) :: Displays the underline button

Fonts

  • fonts (default: (boolean) true) :: Enables font formatting
  • fontList :: Array of allowed fonts. The fonts set by default are fonts which should work on Windows, Mac and Linux by default. Setting fonts manually will overwrite the array.
  • fontSize (default: (boolean) true) :: Allows to use different font sizes

Text alignment

  • leftAlign (default: (boolean) true)
  • centerAlign (default: (boolean) true)
  • rightAlign (default: (boolean) true)
  • justify (default: (boolean) true)

Lists

  • ol (default: (boolean) true) :: Ordered list
  • ul (default: (boolean) true) :: Unordered list

Titles

  • heading (default: (boolean) true)

Colors

  • fontColor (default: (boolean) true)
  • colors :: Set own colors for the editor. They will replace the default colors. Example:
var colors;
colors["#FFFFFF"] = 'White';
colors["#000000"] = 'Black';

Uploads/Files

  • imageUpload (default: (boolean) true)
  • fileUpload (default: (boolean) true)

Media/Videos

  • videoEmbed (default: (boolean) true) :: Simplify embedding videos from YouTube, Facebook, Vimeo and Dailymotion

Links

  • urls (default: (boolean) true)

Tables

  • table (default: (boolean) true)

Code

  • removeStyles (default: (boolean) true) :: Allows to remove the CSS styles from the selection
  • code (default: (boolean) true) :: Allows to display the raw HTML code

Custom dropdowns

Custom dropdowns allow to customize in a restricted way the dropdowns in the editor.

  • fileHTML :: HTML string of the file dropdown. MUST include an input field (select, input or textarea) with the id equal to fileURL.
  • imageHTML :: HTML string of the image dropdown. MUST include an input field (select, input or textarea) with the id equal to imageURL.

Translations

  • translations :: An object of key-value entries allowing to set other texts/translations for the editor. The keys must stay the same as in the default translation object.

Privacy settings

  • youtubeCookies (default: (boolean) false) :: If set to true, YouTube might set tracking cookies. By default (if the value is set to false), youtube-nocookie.com will be used to display YouTube videos.

Tabbing

  • useTabForNext (default: (boolean) false) :: If set to true, you can tab to the next input element or RichText editor within the contenteditable part of the editor.

Developer settings

  • useSingleQuotes (default: (boolean) false) :: Replaces all double quotes from HTML attributes to single quotes, if set to (boolean) true.
  • height (default: (int) 0) :: Sets a custom height for the editor frame and code view. The default value 0 uses the initial height set with CSS. To overwrite the height without using this setting (and without using inline CSS), use the CSS selectors .richText .richText-editor and .richText .richText-initial to change the height.
  • heightPercentage (default: (int) 0) :: Sets a custom percentage height based on the editor's parent element. This won't work if the height option is used as well.
  • id (default: (string) "") :: Sets a custom ID for the editor
  • class (default: (string) "") :: Sets additional custom classes for the editor
  • useParagraph (default: (boolean) false) :: Uses paragraph tags instead of div containers (browser default) when pressing ENTER, if set to true.
  • maxlength (default: (int) 0) :: Defines a max length for the text (HTML length not considered!). The default value 0 doesn't define any limit
  • callback (default: undefined) :: Sets a callback if the editor has been loaded. The first and only parameter of the callback contains the jQuery element of the editor

Undo RichText

There's now the possibility to undo the RichText editor to the state before .richText() has been called.

For this to work, simply call .unRichText() on the initial textarea, on which .richText() has previously been called.

It is possible to delay unRichText() by a given amount of milliseconds with the parameter: {delay: 2000}. Additionally the callback option is available as well.

FAQ

How do I set the RichText value through jQuery? Using .val() doesn't work?

The change event needs to be triggered, in order to update the value within RichText. Using .val('Some text').trigger('change') on your jQuery node will solve your issue.

Contributing

If you have any ideas, suggestions, issues or bugfixes, feel free to contribute.

Check out the contributing guidelines for ways to offer feedback and contribute.

Planned changes

  • Add/remove columns/cells in table after it was created
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].