How to use froala-editor - 9 common examples

To help you get started, we’ve selected a few froala-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github froala / vue-froala-wysiwyg / src / vue-froala.js View on Github external
createEditor: function() {

        if (this.editorInitialized) {
          return;
        }

        this.currentConfig = this.config || this.defaultConfig;

        this.setContent(true);

        // Bind editor events.
        this.registerEvents();
        this.initListeners();

        this._editor = new FroalaEditor(this.$el, this.currentConfig)

        this.editorInitialized = true;

      },
github froala / react-froala-wysiwyg / lib / FroalaEditorFunctionality.jsx View on Github external
this.element = this.el;

    if (this.props.model) {
      this.element.innerHTML = this.props.model;
    }

    this.setContent(true);

    // Default initialized.
    this.registerEvent('initialized', this.config.events && this.config.events.initialized);

    // Check if events are set.
    if (!this.config.events) this.config.events = {};
    this.config.events.initialized = () => this.initListeners();

    this.editor = new FroalaEditor(this.element, this.config);
    // Call init events.
    if (this._initEvents) {
      for (let i = 0; i < this._initEvents.length; i++) {
        this._initEvents[i].call(this.editor);
      }
    }
  }
github froala / angular-froala-wysiwyg / src / editor / editor.directive.ts View on Github external
if (!this._opts.events) this._opts.events = {}

      // Register initialized event.
      this.registerEvent('initialized', this._opts.events && this._opts.events.initialized);
      const existingInitCallback = this._opts.events.initialized;
      // Default initialized event.
      if (!this._opts.events.initialized || !this._opts.events.initialized.overridden) {
        this._opts.events.initialized = () => {
          this.initListeners();
          existingInitCallback && existingInitCallback.call(this._editor, this);
        };
        this._opts.events.initialized.overridden = true;
      }

      // Initialize the Froala Editor.
      this._editor = new FroalaEditor(
        this._element,
        this._opts
      );
    });
  }
github froala / aurelia-froala-editor / src / froala-editor.js View on Github external
// Set events.
		if (this.eventHandlers && this.eventHandlers.length != 0) {
			for(let eventHandlerName in this.eventHandlers) {
				let handler = this.eventHandlers[eventHandlerName];
				this.instance.addEventListener(`${eventHandlerName}`, function() {
					let p = arguments;
					return handler.apply(this, p)
				});

			}
		}
		this.instance.addEventListener('contentChanged', (e, editor) => this.value = editor.html.get());
		this.instance.addEventListener('blur', (e, editor) => this.value = editor.html.get())

    // Initialize editor.
		this.instance = new FroalaEditor(this.element, Object.assign({}, this.config));
	}
github froala / ember-froala-editor / addon / components / froala-editor.js View on Github external
@action createEditor(element, [options]) {
    new FroalaEditor(element, options);
  }
github froala / aurelia-froala-editor / dist / es2015 / froala-editor.js View on Github external
this.instance.innerHTML = this.value;

		if (this.eventHandlers && this.eventHandlers.length != 0) {
			for (let eventHandlerName in this.eventHandlers) {
				let handler = this.eventHandlers[eventHandlerName];
				this.instance.addEventListener(`${eventHandlerName}`, function () {
					let p = arguments;
					return handler.apply(this, p);
				});
			}
		}
		this.instance.addEventListener('contentChanged', (e, editor) => this.value = editor.html.get());
		this.instance.addEventListener('blur', (e, editor) => this.value = editor.html.get());

		this.instance = new FroalaEditor(this.element, Object.assign({}, this.config));
	}
github froala / ember-froala-editor / addon / components / froala-editor.js View on Github external
get argumentOptions() {
    let options = {};
    for (let argumentName in this.args) {
      if (FroalaEditor.DEFAULTS.hasOwnProperty(argumentName)) {
        options[argumentName] = this.args[argumentName];
      }
    }
    return options;
  }
github froala / angular-froala-wysiwyg / demo / src / app / app.component.ts View on Github external
ngOnInit () {
    FroalaEditor.DefineIcon('alert', { SVG_KEY: 'help' });
    FroalaEditor.RegisterCommand('alert', {
      title: 'Hello',
      focus: false,
      undo: false,
      refreshAfterCallback: false,

      callback: function () {
        alert('Hello!');
      }
    });
  }
github froala / angular-froala-wysiwyg / demo / src / app / app.component.ts View on Github external
ngOnInit () {
    FroalaEditor.DefineIcon('alert', { SVG_KEY: 'help' });
    FroalaEditor.RegisterCommand('alert', {
      title: 'Hello',
      focus: false,
      undo: false,
      refreshAfterCallback: false,

      callback: function () {
        alert('Hello!');
      }
    });
  }

froala-editor

The next generation Javascript WYSIWYG HTML rich text editor made by devs for devs. High performance and modern design make it easy to use for developers and loved by users.

https://www.froala.com/wysiwy…
Latest version published 1 month ago

Package Health Score

70 / 100
Full package analysis