Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

[Added] New Object Type: WYSIWYG Editor

Information about updates, news, Code Library
Post Reply
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

[Added] New Object Type: WYSIWYG Editor

Unread post by admin »

The "Quill Rich Text Editor" has been added as nuBuilder Object.
wysiwyg editor.png
editor.png
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: [Added] New Object Type: WYSIWYG Editor

Unread post by admin »

Example to load the WYSIWYG editor with a minimal toolbar. (min. Files Version: V.4.5-2021.10.04.01)

Add in the form's Custom Code:

Code: Select all

function nuOnEditorLoad() {

	var myToolbar = [

			['bold', 'italic', 'underline', 'strike'], // toggled buttons
			[{ 'list': 'ordered' }, { 'list': 'bullet' }],
			[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
			[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
			[{ 'color': [] }], // dropdown with defaults from theme
			[{ 'align': [] }]

	];
	
		var options = {
		  modules: {
			toolbar: myToolbar
		  },
		  fontNames: null,
		  readOnly: false,
		  theme: 'snow'
		};	
	
	$('.nuEditor').each((index, element) => {
		nuQuill(element.id, options);
	});

}
You do not have the required permissions to view the files attached to this post.
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: [Added] New Object Type: WYSIWYG Editor

Unread post by admin »

Example to hide the toolbar and set the editor to read-only mode:

Code: Select all

function nuOnEditorLoad() {
   
      var options = {
        modules: {
         toolbar: false
        },
        fontNames: null,
        readOnly: true,
        theme: 'snow'
      };   
   
   $('.nuEditor').each((index, element) => {
      nuQuill(element.id, options);
   });

}
You do not have the required permissions to view the files attached to this post.
Post Reply