Giter Site home page Giter Site logo

froala / wysiwyg-editor Goto Github PK

View Code? Open in Web Editor NEW
5.2K 137.0 661.0 79.82 MB

The next generation Javascript WYSIWYG HTML Editor.

Home Page: https://www.froala.com/wysiwyg-editor

License: Other

CSS 52.54% HTML 43.58% PHP 3.88%
wysiwyg wysiwyg-editor rich-text-editor froala wysiwyg-html-editor javascript

wysiwyg-editor's Introduction

Build Status npm npm

Froala WYSIWYG HTML Editor is one of the most powerful JavaScript rich text editors ever.

WYSIWYG HTML Editor

Demos

Download and Install Froala Editor

Install from npm

npm install froala-editor

Install from bower

bower install froala-wysiwyg-editor

Load from CDN

Using Froala Editor from CDN is the easiest way to install it and we recommend using the jsDeliver CDN as it mirrors the NPM package.

<!-- Include Editor style. -->
<link href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />

<!-- Create a tag that we will use as the editable area. -->
<!-- You can use a div tag as well. -->
<textarea></textarea>

<!-- Include Editor JS files. -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/froala-editor@latest/js/froala_editor.pkgd.min.js"></script>

<!-- Initialize the editor. -->
<script>
  new FroalaEditor('textarea');
</script>

Load from CDN as an AMD module

Froala Editor is compatible with AMD module loaders such as RequireJS. The following example shows how to load it along with the Algin plugin from CDN using RequireJS.

<html>
<head>
  <!-- Load CSS files. -->
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.css">

  <script src="require.js"></script>
  <script>
    require.config({
      packages: [{
        name: 'froala-editor',
        main: 'js/froala_editor.min'
      }],
      paths: {
        // Change this to your server if you do not wish to use our CDN.
        'froala-editor': 'https://cdn.jsdelivr.net/npm/froala-editor@latest'
      }
    });
  </script>

  <style>
    body {
      text-align: center;
    }
    div#editor {
      width: 81%;
      margin: auto;
      text-align: left;
    }
    .ss {
      background-color: red;
    }
  </style>
</head>

<body>
  <div id="editor">
    <div id='edit' style='margin-top:30px;'>
    </div>
  </div>

  <script>
    require([
      'froala-editor',
      'froala-editor/js/plugins/align.min'
    ], function(FroalaEditor) {
      new FroalaEditor('#edit')
    });
  </script>
</body>

</html>

Load Froala Editor as a CommonJS Module

Froala Editor is using an UMD module pattern, as a result it has support for CommonJS. The following examples presumes you are using npm to install froala-editor, see Download and install FroalaEditor for more details.

var FroalaEditor = require('froala-editor');

// Load a plugin.
require('froala-editor/js/plugins/align.min');

// Initialize editor.
new FroalaEditor('#edit');

Load Froala Editor as a transpiled ES6/UMD module

Since Froala Editor supports ES6 (ESM - ECMAScript modules) and UMD (AMD, CommonJS), it can be also loaded as a module with the use of transpilers. E.g. Babel, Typescript. The following examples presumes you are using npm to install froala-editor, see Download and install FroalaEditor for more details.

import FroalaEditor from 'froala-editor'

// Load a plugin.
import 'froala-editor/js/plugins/align.min.js'

// Initialize editor.
new FroalaEditor('#edit')

For more details on customizing the editor, please check the editor documentation.

Use with your existing framework

Browser Support

At present, we officially aim to support the last two versions of the following browsers:

  • Chrome
  • Edge
  • Firefox
  • Safari
  • Opera
  • Internet Explorer 11
  • Safari iOS
  • Chrome, Firefox and Default Browser Android

Resources

Reporting Issues

We use GitHub Issues as the official bug tracker for the Froala WYSIWYG HTML Editor. Here are some advices for our users that want to report an issue:

  1. Make sure that you are using the latest version of the Froala WYSIWYG Editor. The issue that you are about to report may be already fixed in the latest master branch version: https://github.com/froala/froala-wysiwyg/tree/master/js.
  2. Providing us reproducible steps for the issue will shorten the time it takes for it to be fixed. A JSFiddle is always welcomed, and you can start from this basic one.
  3. Some issues may be browser specific, so specifying in what browser you encountered the issue might help.

Technical Support or Questions

If you have questions or need help integrating the editor please contact us instead of opening an issue.

Licensing

In order to use the Froala Editor you have to purchase one of the following licenses according to your needs. You can find more about that on our website on the pricing plan page.

wysiwyg-editor's People

Contributors

andelf avatar awkr avatar dianaprajescu avatar florinpopescu avatar froala-bot avatar gitter-badger avatar harasunu-narayan avatar iradustefan avatar kapil2704 avatar lalitnarde-nitorinfotech avatar largeden avatar sh0e avatar stefanneculai avatar suyogklp avatar yoshimannaert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wysiwyg-editor's Issues

Unselecting ordered list resets style

  1. On homepage demo, highlight "Click And Edit" header
  2. Click "ordered list" button
  3. Click it again
  4. The size styles are reverted

Also note that sometimes your selection will get reset after step 2

Table support?

There is, I can't find it, or will be support for generating tables? Tranks

On autosave froala removes line breaks!

I am trying to save the content via provided API with preserved line breaks, however all line breaks are being removed.

Instead of saving:
<p>Hello World</p>
<p><br></p>
<p><br></p>
<p>Hello World</p>
It saves:
<p>Hello World</p>
<p>Hello World</p>

Is this a feature? Also when i set option {paragraphy: false} it still uses <p><br></p> as new line. Please help or explain.

getHTML skips non-ascii characters

Hi!

There seems to be a problem with how getHTML handles UTF-8 encoded characters. The setHTML method on the other hand works as expected; the characters are inserted in the editor and displayed correctly. But getHTML seems to strip any non-ascii characters.

This issue is present in Safari, Chrome and Firefox (the only ones I've tested).

I modified the basic.html example slightly to provide an example. I've added the UTF-8 meta tag and inserted a few lines of JS further down.

<!DOCTYPE html>
<html>
<head>
    <link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="../css/froala_editor.min.css" rel="stylesheet" type="text/css">

    <style>
        body {
            text-align: center;
        }

        section {
            width: 80%;
            margin: auto;
            text-align: left;
        }
    </style>

    <meta charset="UTF-8">

</head>

<body>
  <section id="editor">
      <div id='edit' style="margin-top: 30px;">
          <img src="../img/cute_cat.jpg" alt="Cute cat" width="300" style="float: left; margin-right: 10px; margin-bottom: 10px; margin-top: 10px;"/>

          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec facilisis diam in odio iaculis blandit. Nunc eu mauris sit amet purus viverra gravida ut a dui. Vivamus nec rutrum augue, pharetra faucibus purus. Maecenas non orci sagittis, vehicula lorem et, dignissim nunc. Suspendisse suscipit, diam non varius facilisis, enim libero tincidunt magna, sit amet iaculis eros libero sit amet eros. Vestibulum a rhoncus felis. Nam lacus nulla, consequat ac lacus sit amet, accumsan pellentesque risus. Aenean viverra mi at urna mattis fermentum. Curabitur porta metus in tortor elementum, in semper nulla ullamcorper. Vestibulum mattis tempor tortor quis gravida. In rhoncus risus nibh. Nullam condimentum dapibus massa vel fringilla. Sed hendrerit sed est quis facilisis. Ut sit amet nibh sem. Pellentesque imperdiet mollis libero.</p>

          <p><a href="http://google.com" title="Aenean sed hendrerit">Aenean sed hendrerit</a> velit. Nullam eu mi dolor. Maecenas et erat risus. Nulla ac auctor diam, non aliquet ante. Fusce ullamcorper, ipsum id tempor lacinia, sem tellus malesuada libero, quis ornare sem massa in orci. Sed dictum dictum tristique. Proin eros turpis, ultricies eu sapien eget, ornare rutrum ipsum. Pellentesque eros nisl, ornare nec ipsum sed, aliquet sollicitudin erat. Nulla tincidunt porta vehicula.</p>

          <p>Nullam laoreet imperdiet orci ac euismod. Curabitur vel lectus nisi. Phasellus accumsan aliquet augue, eu rutrum tellus iaculis in. Nunc viverra ultrices mollis. Curabitur malesuada nunc massa, ut imperdiet arcu lobortis sed. Cras ac arcu mauris. Maecenas id lectus nisl. Donec consectetur scelerisque quam at ultricies. Nam quis magna iaculis, condimentum metus ut, elementum metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus id tempus nisi.</p>
      </div>


      <div id="target"></div>
  </section>

  <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
  <script src="../js/froala_editor.min.js"></script>

  <script>
      $(function(){
          $('#edit').editable({inlineMode: false})

          original_string = "abc åäö ÅÄÖ ghi";
          alert(original_string);
          console.log(original_string);

          $('#edit').editable("setHTML", original_string);
          froala_string = $('#edit').editable("getHTML")[0];

          alert(froala_string);
          console.log(froala_string);
      });
  </script>
</body>
</html>

Autofocus on page load

Sorry for maybe stupid question, but can I disable autofocus?

I setup the editor and when page is loaded — editable zone have focus... But I don't need this :)

insertHTML method not working.

$("#editor").editable("insertHTML","foo bar");
It seems this method not working. Nothing happens when I invoke this method.

XSS in FROALA WYSIWYG

Hi,

The editor is vulnerable to an XSS. The editor allows users to insert link and if instead of normal link, I input JavaScript URI

javascript:alert%28location%29

then it works. The attacker can execute arbitrary code of his choice. Please fix this issue. Thanks!

Font Awesome Icons get striped

When applying a Font Awesome icon to the editor it gets striped out.

screen shot 2014-03-21 at 1 19 40 pm

Both views of the editor are missing the icons. I did notice in another situation that the element for Font Awesome icons got converted to EM but not in this example.

screen shot 2014-03-21 at 1 20 16 pm

screen shot 2014-03-21 at 1 20 55 pm

405 error upload picture

I get a 405 Method Not Allowed error while uploading picture. System runs on Windows 2008 R2 classic asp. Kind regards Marius

weird contentChanged callback

I decided to show user when his content is not saved and show when saved. So, i want to draw some checkmark when i receive OK from server. I do this with afterSaveCallback Everithing ok here.
But i want show some red cross or red border maybe when content is edited, but still not saved. I thought that contentChangedCallback will solve my problem. But it doesnt, it works only just before save. I dont know how to detect changes in editable...

buttons option generating error - uncaught TypeError: Cannot call method 'on' of undefined

When I run the following standard html code I get an error: "uncaught TypeError: Cannot call method 'on' of undefined"

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="css/font-awesome.min.css" rel="stylesheet" />
    <link href="froala_editor.min.css" rel="stylesheet" />
    <style>
        body {
            text-align: center;
        }

        section {
            width: 80%;
            margin: auto;
            text-align: left;
        }
    </style>
</head>
<body>
    <section id="editor">
        <textarea class='edit' style="margin-top: 30px;">
            <p>wwwwwLorem ipsum dolor sit amet, consectetur adipiscing elit. Donec facilisis diam in odio iaculis blandit. Nunc eu mauris sit amet purus viverra gravida ut a dui. Vivamus nec rutrum augue, pharetra faucibus purus. Maecenas non orci sagittis, vehicula lorem et, dignissim nunc. Suspendisse suscipit, diam non varius facilisis, enim libero tincidunt magna, sit amet iaculis eros libero sit amet eros. Vestibulum a rhoncus felis. Nam lacus nulla, consequat ac lacus sit amet, accumsan pellentesque risus. Aenean viverra mi at urna mattis fermentum. Curabitur porta metus in tortor elementum, in semper nulla ullamcorper. Vestibulum mattis tempor tortor quis gravida. In rhoncus risus nibh. Nullam condimentum dapibus massa vel fringilla. Sed hendrerit sed est quis facilisis. Ut sit amet nibh sem. Pellentesque imperdiet mollis libero.</p>

            <p><a href="http://google.com" title="Aenean sed hendrerit">Aenean sed hendrerit</a> velit. Nullam eu mi dolor. Maecenas et erat risus. Nulla ac auctor diam, non aliquet ante. Fusce ullamcorper, ipsum id tempor lacinia, sem tellus malesuada libero, quis ornare sem massa in orci. Sed dictum dictum tristique. Proin eros turpis, ultricies eu sapien eget, ornare rutrum ipsum. Pellentesque eros nisl, ornare nec ipsum sed, aliquet sollicitudin erat. Nulla tincidunt porta vehicula.</p>

            <p>Nullam laoreet imperdiet orci ac euismod. Curabitur vel lectus nisi. Phasellus accumsan aliquet augue, eu rutrum tellus iaculis in. Nunc viverra ultrices mollis. Curabitur malesuada nunc massa, ut imperdiet arcu lobortis sed. Cras ac arcu mauris. Maecenas id lectus nisl. Donec consectetur scelerisque quam at ultricies. Nam quis magna iaculis, condimentum metus ut, elementum metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus id tempus nisi.</p>
        </textarea>
    </section>
    <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script src="Scripts/froala_editor.min.js"></script>fs
    <script>
        $(function () {
            $('.edit').editable({ buttons: ['undo'] });
        });
    </script>
</body>
</html>

Markdown Support

I love the editor, but I would buy if it supports markdown. Because their is no great markdown editor out there.

Image upload is not work

Hello,

Thank you for your work. I think the best wysiwyg editor.
but I have a problem with image upload.

I do follow > http://editor.froala.com/docs/image-upload-php
but it don't work for me.

This is my js code
[test.php]

  $(function(){
      $('#edit').editable({inlineMode: false,
      imageUploadURL: 'http://www.thaihondacityclub.com/forum/upload.php'})
  });

[upload.php]

// Allowed extentions.
$allowedExts = array("gif", "jpeg", "jpg", "png");

// Get filename.
$temp = explode(".", $_FILES["file"]["name"]);

// Get extension.
$extension = end($temp);

// An image check is being done in the editor but it is best to
// check that again on the server side.
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/jpg")
|| ($_FILES["file"]["type"] == "image/pjpeg")
|| ($_FILES["file"]["type"] == "image/x-png")
|| ($_FILES["file"]["type"] == "image/png"))
&& in_array($extension, $allowedExts)) {
// Generate new random name.
$name = sha1(microtime()) . "." . $extension;

// Save file in the uploads folder.
move_uploaded_file($_FILES["file"]["tmp_name"], "/uploads/" . $name);

// Generate response.
$response = new StdClass;
$response->link = "/uploads/" . $name;
echo stripslashes(json_encode($response));

}


and I created "uploads" folder and changed permission to 777.
Editor: http://www.thaihondacityclub.com/forum/test.php
Upload path folder: http://www.thaihondacityclub.com/forum/uploads
Upload file: http://www.thaihondacityclub.com/forum/upload.php

Please help me, Thank you very very much.

Deleting image from server

Hi,
Thank you for your great work. it is very userful!
I have a problem: how delete file when I delete it from the web textarea?
Thank you in advance,
Oda

Move image or insert image where I want

I can't move or insert image where I want. I've tried in Froala web page and in local. I test it with firefox an chrome. For example, I put the cursor after a paragraph and after the upload the image appears in the top left corrner of the wysiwyg.
Thanks.

Option to disable autofocus

Hi!

I'm using multiple editable areas on a single page, and every time the page is loaded, one of the editors gets focus. Thus, if I start to type directly after page load, text appears in one of the editable areas.

I'm guessing this is a result of a focus() call being made from javascript for each editable area, as a result of running .editable() on them.

Is this how it works? If so, is there a way to disable that behavior?

I have Bought Tech Support

Do you have event support, can I customize the save function to include other data that just the body of the editable?

PopUp for a Link is behind Modal Dialog

Place the editor onto a modal dialog (such as a bootstrap modal) that does not allow clicks behind, data-backdrop="static". Open the dialog and then highlight some text and try to apply a link. The little popup link dialog box is behind the dialog and cannot be accessed.

Add src and build folders

Please create a src folder with the non-minified versions and a build folder for the minified output.

Not much point in putting this on Github if most of it is unreadable by human eyes.

$(window) events affecting elements outside of editor

initEditorSelection() { ....

// Mouse up anywhere else.
$(window).on('mouseup touchend', $.proxy(function() {
if (this.selectionInEditor() && this.text() !== '' && !this.isTouch()) {
this.show(null);
} else {
this.hide();
this.closeImageMode();
}
}, this));
....
}

clicking on a link outside the Froala editor caused the div with Froala initialised then destroyed ,to apply contenteditable='true'

File support

Hi,

Your image upload solution is beautiful, and if you add a file upload feature for handling links to documents the solution would be complete.

Great work!

Destroy method seems to not be working

I have a simple use case in which I have a button to start editing (calls .editable()) and then a save button that gets the HTML (.editable("getHTML")) and destroys the editor (.editable("destroy")). However, it seems that the destroy method call does nothing.

I've even opened up the minifed version (even from current master branch) and plugged in a console.log into the callback for the destroy method. Never seems to be invoked.

This behavior is also present in the inline example that comes in the download. Open the console and fire $("#edit").editable("destroy") and nothing will change.

Platform: Mac
Browser: Chrome 32.0.1700.107

Custom HTML gets removed or changed

Inserting custom HTML such as <foo-bar></foo-bar> either removes the tags completely or changes them to <foo></foo>, even if entered manually through HTML mode.

Inserting custom HTML:
screen shot 2014-04-02 at 3 24 40 am

After pressing the HTML button to return back to normal mode.
screen shot 2014-04-02 at 3 25 02 am

After pressing the HTML button again to return to HTML mode.
screen shot 2014-04-02 at 3 25 11 am

Modernizr included?

Hi!

Why you include your custom Modernizr and same time rewrite it's original window.Modernizr??

This wysiwyg redactor case many errors in my project, because rewriting my custom Modernizr!

Paragraphy not working correctly

Default true - still adding <div> on enter.

Problem is in:

d.options.paragraphy===!0?"<p>":"<div>"
-- probably elsewhere, it's not fency to analyze minimized js and I don't want to "un-minimizing" it.

Explanation:
JavaScript has own types for boolean, it's convertible to integer values (it's not like in C) but if you're using === it's not converting it - it's checking type and value! So (true === 1) is false because the type is different.

WORKAROUND: $(".selector").editable("option", "paragraphy", 1);

using bootsrap modal, image-wrapper/video-wrapper - invisible

hello, i wish to integrate bootstrap modal and froala-editor, but i have problem

without modal

without_modal

with modal

with_modal

as seen in with modal image, image-wrapper / video-wrapper is behind modal, i try to increase z-index on it, but seems does not have effect.

ps. i use flat-ui designmodo bootstrap3

JS FIddle link
Thanks.

Paragrapg tags inside list-items

When doing a new ordered or un-ordered list with paragraphy set to true, froala 1.1.3 inserts a new paragraph tag inside every list item.

Uploaded Image Disappered when click in editor

In the editor I use to upload image by my own computer not yours by your URL. I got the JSON data and Image is showing in the editor. After that When I click in the editor Image disapper. Please help me

Node undefined in IE8

When loading the editor in IE8 it throws a "Node undefined" error, probably because IE8 doesn't implement the Node interface. So using the constant value this.nodeType == 3 would solve this. I am not sure in how far you are not supporting IE8, but it shouldn't break the rest of the Javascript loaded on that page. Also, a lot of people are still using IE8, switching from 7, would be good to have IE8 included.

Invoking editable() after editable("destroy") has no effect

Hi!

I'm using editable() and editable("destroy") to implement a "enable" and "disable" button to control the editing capabilities provided by Froala dynamically. The "enable" button invokes editable() and the "disable" button invokes editable("destroy").

I have found that editable() won't work once editable("destroy") has been invoked once.

$('#edit').editable(); // Works
$('#edit').editable("destroy"); // Works
$('#edit').editable(); // No effect

It seems like editable("destroy") has a permanent effect on the use of Froala on the page, as the following example also demonstrates the behavior:

$('#edit').editable("destroy");
$('#edit').editable(); // No effect

I've tested with 1.0.6, 1.0.5 and 1.0.4. Same behavior at every release, except that editable("destroy") didn't seem to work at all in 1.0.4.

Custom Button not displaying FontAwesome Icons

Button is not appearing on the iconbar

customButtons: {
imagePicker: {
title: "Insert Image",
icon: {
type: "fa",
value: "fa-info"
}
}

Button appears on iconbar
customButtons: {
imagePicker: {
title: "Insert Image",
icon: {
type: "txt",
value: "img"
}
}

Allow to paste only tags passed in the buttons option

Currently there are two ways of pasting the text in froala

plainPaste: true and false

The problem is that when you use false, you completely remove all the markup from you text. But if you have true, and in your froala editor you selected only some markups
editable({buttons: ["bold", "italic", "underline"]}); you can still add links, images and all other markup.

Is it possible to have plainPaste to paste only markup that you specified?

getHTML() in HTML mode returns only textarea

When the editor is in the normal mode and you call lastEditor.editable("getHTML") the actual HTML entered by the user is there. When the editor is in the HTML mode the call returns a textarea element.

(Offtopic) How to correctly paste text

So I have script which translates latin keyboard to other language.
Here is a function which is responsible for pasting this script

function pasteTo(field) {
    if (document.selection) {
        field.focus();
        var sel = document.selection.createRange();
        if(sel) {
            sel.text = this;
            field.focus();
        }
    } else if (field.selectionStart || field.selectionStart == '0') {
        var startPos = field.selectionStart;
        var endPos = field.selectionEnd;
        var scrollTop = field.scrollTop;
        field.value = field.value.substring(0, startPos)+ this+ field.value.substring(endPos,field.value.length);
        field.focus();
        field.selectionStart = startPos + this.length;
        field.selectionEnd = startPos + this.length;
        field.scrollTop = scrollTop;
    } else if($(field).hasClass('froala-element')) {
        console.log(field)
        console.log(this);
                    // need help here
    } else {
        field.value += this;
        field.focus();
    }
};

So I can deal with usual textarea and input elements, but problem rises with Froala.

I went through froala methods but coud not really decide how to correctly deal with this so maybe you can help me here.
field is element where I'm typing and this is a key (one letter) to paste

Custom button dropdown

Allow a method of building a custom dropdown like font selector and a callback for what to do with the selection. Similar to Redactor add dropdown.

http://imperavi.com/redactor/examples/dropdown/

Example use case I am building an email template editor and want to select from a list of mustache template keys that would get dropped into the editor, like {{ first_name }} {{ last_name }}.

getHTML() returns array instead of string

Hi,

When invoking the getHTML() method to get the HTML from a Froala element, an array is returned instead of a string. This appears a little inconsistent since the setHTML() method accepts a string as input, thus you would think of the getHTML() method to return the same.

$(".selector").editable("getHTML");

I'm currently using these lines of code to account for possible future updates :)

var html = element.editable('getHTML');
if(Object.prototype.toString.call(html) === '[object Array]') {
    html = html[0]
}

Clicking on the Link dialog background hides it

Select the text, click the Link button, the dialog is shown
Click somewhere on it (not inside the field, but on the dialog itself, like on the dialog title "Insert link"). The dialog is hidden, data entered is lost
Much worse, the checkbox title is not the label, so when I expect standard behavior by clicking the "label" to check the box the dialog is hidden and the URL I just typed is lost.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.