How to use the medium-editor.MediumEditor function in medium-editor

To help you get started, we’ve selected a few medium-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 ticktackim / ticktack-workplan / app / page / blogNew.js View on Github external
function initialiseMedium ({ api, page, el, meta }) {
  const strings = api.translations.sync.strings()
  const draft = api.drafts.sync.get(DRAFT_LOCATION) || {}

  var editor = new MediumEditor(el, {
    placeholder: {
      text: draft.body ? '' : strings.blogNew.actions.writeBlog
    },
    elementsContainer: page,
    // autoLink: true,
    buttonLabels: 'fontawesome',
    imageDragging: true,
    toolbar: {
      allowMultiParagraphSelection: true,
      buttons: [
        'bold',
        'italic',
        'anchor',
        {
          name: 'h2',
          contentFA: '<i class="fa fa-header">',</i>
github OpenBazaar / openbazaar-desktop / js / views / modals / EditListing.js View on Github external
setTimeout(() => {
        if (this.descriptionMediumEditor) this.descriptionMediumEditor.destroy();
        this.descriptionMediumEditor = new MediumEditor('#editListingDescription', {
          placeholder: {
            text: '',
          },
          toolbar: {
            buttons: ['bold', 'italic', 'underline', 'anchor', 'unorderedlist', 'orderedlist'],
          },
        });

        if (!this.rendered) {
          this.rendered = true;
          this.$titleInput.focus();
        }
      });