Coder Social home page Coder Social logo

xdan / jodit Goto Github PK

View Code? Open in Web Editor NEW
1.6K 53.0 345.0 71.54 MB

Jodit - Best WYSIWYG Editor for You

Home Page: https://xdsoft.net/jodit/

License: MIT License

CSS 0.04% HTML 0.42% JavaScript 45.88% TypeScript 49.70% Less 3.53% Dockerfile 0.05% Shell 0.02% Makefile 0.36%
wysiwyg wysiwyg-editor wysiwyg-html-editor editor jodit rich-text-editor ace-editor html filebrowser imageeditor

jodit's Introduction

Jodit WYSIWYG editor

Jodit Editor

Jodit Editor is an excellent WYSIWYG editor written in pure TypeScript without the use of additional libraries. It includes a file editor and image editor.

Build Status npm version npm

Get Started

How to Use

Download the latest release or via npm:

npm install jodit

You will get the following files:

  • Inside /esm: ESM version of the editor (compatible with tools like webpack)
  • Inside /es5, /es2015, /es2018, /es2021: UMD bundled files (not minified)
  • Inside /es5, /es2015, /es2018, /es2021 with .min.js extension: UMD bundled and minified files
  • types/index.d.ts: This file specifies the API of the editor. It is versioned, while everything else is considered private and may change with each release.

Include Jodit in Your Project

Include the following two files:

ES5 Version:

<link type="text/css" rel="stylesheet" href="es2015/jodit.min.css" />
<script type="text/javascript" src="es2015/jodit.min.js"></script>

ES2021 Version (for modern browsers only):

<link type="text/css" rel="stylesheet" href="es2021/jodit.min.css" />
<script type="text/javascript" src="es2021/jodit.min.js"></script>

ESM Modules:

<script type="importmap">
  {
    "imports": {
      "autobind-decorator": "https://unpkg.com/[email protected]/lib/esm/index.js"
    }
  }
</script>
<link rel="stylesheet" href="./node_modules/jodit/es2021/jodit.min.css" />
<script type="module">
  import { Jodit } from './node_modules/jodit/esm/index.js';
  Jodit.make('#editor', {
    width: 600,
    height: 400
  });
</script>

The ESM modules automatically include only the basic set of plugins and the English language. You can manually include additional plugins and languages as needed.

<script type="importmap">
  {
    "imports": {
      "autobind-decorator": "https://unpkg.com/[email protected]/lib/esm/index.js"
    }
  }
</script>
<link rel="stylesheet" href="./node_modules/jodit/es2021/jodit.min.css" />
<script type="module">
  import { Jodit } from './node_modules/jodit/esm/index.js';
  import './node_modules/jodit/esm/plugins/add-new-line/add-new-line.js';
  import './node_modules/jodit/esm/plugins/fullsize/fullsize.js';
  import de from './node_modules/jodit/esm/langs/de.js';

  Jodit.langs.de = de;

  Jodit.make('#editor', {
    width: 600,
    height: 400,
    language: 'de'
  });
</script>

Use a CDN

cdnjs

<link
  rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/jodit/4.0.1/es2021/jodit.min.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jodit/4.0.1/es2021/jodit.min.js"></script>

unpkg

<link
  rel="stylesheet"
  href="https://unpkg.com/[email protected]/es2021/jodit.min.css"
/>
<script src="https://unpkg.com/[email protected]/es2021/jodit.min.js"></script>

Usage

Add a textarea element to your HTML:

<textarea id="editor" name="editor"></textarea>

Initialize Jodit on the textarea:

const editor = Jodit.make('#editor');
editor.value = '<p>start</p>';

Create plugin

Jodit.plugins.yourplugin = function (editor) {
  editor.events.on('afterInit', function () {
    editor.s.insertHTMl('Text');
  });
};

Add custom button

const editor = Jodit.make('.someselector', {
  extraButtons: [
    {
      name: 'insertDate',
      iconURL: 'https://xdsoft.net/jodit/logo.png',
      exec: function (editor) {
        editor.s.insertHTML(new Date().toDateString());
        editor.synchronizeValues(); // For history saving
      }
    }
  ]
});

or

const editor = Jodit.make('.someselector', {
  buttons: ['bold', 'insertDate'],
  controls: {
    insertDate: {
      name: 'insertDate',
      iconURL: 'https://xdsoft.net/jodit/logo.png',
      exec: function (editor) {
        editor.s.insertHTML(new Date().toDateString());
      }
    }
  }
});

button with plugin

Jodit.plugins.add('insertText', function (editor) {
  editor.events.on('someEvent', function (text) {
    editor.s.insertHTMl('Hello ' + text);
  });
});

// or

Jodit.plugins.add('textLength', {
  init(editor) {
    const div = editor.create.div('jodit_div');
    editor.container.appendChild(div);
    editor.events.on('change.textLength', () => {
      div.innerText = editor.value.length;
    });
  },
  destruct(editor) {
    editor.events.off('change.textLength');
  }
});

// or use class

Jodit.plugins.add(
  'textLength',
  class textLength {
    init(editor) {
      const div = editor.create.div('jodit_div');
      editor.container.appendChild(div);
      editor.events.on('change.textLength', () => {
        div.innerText = editor.value.length;
      });
    }
    destruct(editor) {
      editor.events.off('change.textLength');
    }
  }
);

const editor = Jodit.make('.someselector', {
  buttons: ['bold', 'insertText'],
  controls: {
    insertText: {
      iconURL: 'https://xdsoft.net/jodit/logo.png',
      exec: function (editor) {
        editor.events.fire('someEvent', 'world!!!');
      }
    }
  }
});

FileBrowser and Uploader

For testing FileBrowser and Uploader modules, need install PHP Connector

composer create-project --no-dev jodit/connector

Run test PHP server

php -S localhost:8181 -t ./

and set options for Jodit:

const editor = Jodit.make('#editor', {
  uploader: {
    url: 'http://localhost:8181/index-test.php?action=fileUpload'
  },
  filebrowser: {
    ajax: {
      url: 'http://localhost:8181/index-test.php'
    }
  }
});

Browser Support

  • Internet Explorer 11
  • Latest Chrome
  • Latest Firefox
  • Latest Safari
  • Microsoft Edge

License

MIT

jodit's People

Contributors

ako0 avatar amrita-syn avatar bubnoff avatar carry0987 avatar dannystyleart avatar dbp-fr avatar dependabot[bot] avatar dexeroui avatar exreanimator avatar gojuukaze avatar haruanm avatar hodade avatar huizarmx avatar jessicarobins avatar lievenjanssen avatar matteogatti avatar mirabeer avatar mmcakir avatar mtulikowski avatar n84ck avatar newproplus avatar pmasekito avatar poldridge avatar s-renier-taonix-fr avatar sauter-fr avatar serialine avatar superelement avatar vpksoft avatar xdan avatar zp1ke 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

jodit's Issues

Jodit and Tributejs

Jodit Version: 3.1.71
Jodit angular: 1.0.29
Tributejs: 3.2.0

Code

Attaching zurb/tribute to Jodit works fine, here's the essential:

this.tribute.attach(document.getElementsByClassName('jodit_wysiwyg));

Everything works, except selecting item with keypress enter, which Jodit captures.

Expected behavior:
Should be able to configure Jodit to disable capturing keypress when Tribute (or other) is open.

See this Quill with Tribute comment

Actual behavior:
Jodit captures keypress enter and inserts the configured enter type

Editor doesn't scroll down on Enter press

There is an issue which seems to be caused by the enter plugin.
When the editor is full of content and you press Enter to add some more, it doesn't scroll down and the cursor becomes invisible. I should scroll down manually to see it.
Scrolling is the default behaviour of contenteditable divs, so I hope it's easy to fix.
This issue disappears if I add enter to the list of disabled plugins.

Jodit Version: 3.1.3

File browser internal error

we have download the project from url provided by you in email https://xdsoft.net/jodit . At same time got PHP connector from GitHub.com . I have changed the uploaded path in index.html from download php connector. After changing the path of index.php we are getting internal server error. How to use purchased License key on project. I am sharing link to check the error http://www.inteliclass.com/jodit/

<b> tag is not handled by "Bold" toolbar button

Jodit Version: 3.1.xxxxx

Code

If i try to remove bold from a text encapsulated between <b> tags, the "B" (bold) button in the toolbar encapsulate all the tag in <strong>.

<b>Text</b>

become:

<strong><b>Text</b></strong>

And if i press the "B" (bold) button again i get:

<b>Text</b>

So it is impossible to remove bold from a text without act manually on the source.

Expected behavior:
the <b> tag should be converted to <strong> or removed when the "B" (bold) button is pressed to remove Bold from a text.

Actual behavior:
<b> is not affected by "B" (bold) toolbar button, it gets encapsulated by <strong> tag.

Allowed memory size of 67108864 bytes exhausted...

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in D:\OpenServer\Domains\fw.loc\vendor\jodit\application\src\Config.php on line 213

Jodit Version: 3.1.81

Code
config:

return [
    'datetimeFormat' => 'm/d/Y H:i',
    'quality' => 90,
    'defaultPermission' => 0775,
    'createThumb' => true,
    'thumbFolderName' => '_thumbs',
    'excludeDirectoryNames' => ['.tmb', '.quarantine'],
    'maxFileSize' => '8mb',

    'allowCrossOrigin' => true,
    'allowReplaceSourceFile' => true,

    'extensions' => ['jpg', 'png', 'gif', 'jpeg'],

    'roleSessionVar' => 'JoditUserRole',

    "path" => PATH . '/media/images/',
    'root' => WWW . '/media/images/',
    'baseurl' => PATH . '/media/images/',

    'sources' => [
        'Images for PAGES' => [
            'root' => WWW . '/media/images/',
            'baseurl' => PATH . '/media/images/',
            "path" => PATH . '/media/images/',
            'createThumb' => true,
            'thumbFolderName' => '_thumbs',
            'extensions' => array('jpg', 'png', 'gif', 'jpeg'),
        ],
    ]
];

JS:

var editor = new Jodit('#editor', {
    uploader: {
        url: '/admin/jodit/filebrowser?action=fileUpload'
    },
    filebrowser: {
        ajax: {
            url: '/admin/jodit/filebrowser'
        }
    }
});

No upload files... Nothing...
Error:
@##> Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in D:\OpenServer\Domains\fw.loc\vendor\jodit\application\src\Config.php on line 213

in debuger find this:

JoditRestApplication Object
(
    [response] => Jodit\Response Object
        (
            [success] => 1
            [time] => 2018-05-10 22:48:07
            [data] => stdClass Object
                (
                    [messages] => Array
                        (
                        )

                    [code] => 220
                )

        )

    [request] => Jodit\Request Object
        (
            [_raw_data:Jodit\Request:private] => Array
                (
                )

        )

    [action] => fileUpload
    [config] => Jodit\Config Object
        (
            [parent:Jodit\Config:private] => Jodit\Config Object
                (
                    [parent:Jodit\Config:private] => 
                    [data:Jodit\Config:private] => stdClass Object
                        (
                            [defaultFilesKey] => files
                            [debug] => 1
                            [sources] => Array
                                (
                                )

                            [datetimeFormat] => m/d/Y g:i A
                            [quality] => 90
                            [defaultPermission] => 509
                            [createThumb] => 1
                            [thumbFolderName] => _thumbs
                            [excludeDirectoryNames] => Array
                                (
                                    [0] => .tmb
                                    [1] => .quarantine
                                )

                            [maxFileSize] => 8mb
                            [allowCrossOrigin] => 
                            [accessControl] => Array
                                (
                                )

                            [roleSessionVar] => JoditUserRole
                            [defaultRole] => guest
                            [allowReplaceSourceFile] => 1
                            [baseurl] => 
                            [root] => 
                            [extensions] => Array
                                (
                                    [0] => jpg
                                    [1] => png
                                    [2] => gif
                                    [3] => jpeg
                                    [4] => bmp
                                    [5] => ico
                                    [6] => jpeg
                                    [7] => psd
                                    [8] => svg
                                    [9] => ttf
                                    [10] => tif
                                    [11] => ai
                                    [12] => txt
                                    [13] => css
                                    [14] => html
                                    [15] => js
                                    [16] => htm
                                    [17] => ini
                                    [18] => xml
                                    [19] => zip
                                    [20] => rar
                                    [21] => 7z
                                    [22] => gz
                                    [23] => tar
                                    [24] => pps
                                    [25] => ppt
                                    [26] => pptx
                                    [27] => odp
                                    [28] => xls
                                    [29] => xlsx
                                    [30] => csv
                                    [31] => doc
                                    [32] => docx
                                    [33] => pdf
                                    [34] => rtf
                                    [35] => 
                                    [36] => 
                                    [37] => 
                                    [38] => avi
                                    [39] => flv
                                    [40] => 3gp
                                    [41] => mov
                                    [42] => mkv
                                    [43] => mp4
                                    [44] => wmv
                                )

                            [imageExtensions] => Array
                                (
                                    [0] => jpg
                                    [1] => png
                                    [2] => gif
                                    [3] => jpeg
                                    [4] => bmp
                                    [5] => svg
                                    [6] => ico
                                )

                            [maxImageWidth] => 1900
                            [maxImageHeight] => 1900
                        )

                    [sources] => Array
                        (
                            [default] => Jodit\Config Object
 *RECURSION*
                        )

                )

            [data:Jodit\Config:private] => stdClass Object
                (
                    [datetimeFormat] => m/d/Y H:i
                    [quality] => 90
                    [defaultPermission] => 509
                    [createThumb] => 1
                    [thumbFolderName] => _thumbs
                    [excludeDirectoryNames] => Array
                        (
                            [0] => .tmb
                            [1] => .quarantine
                        )

                    [maxFileSize] => 8mb
                    [allowCrossOrigin] => 1
                    [allowReplaceSourceFile] => 1
                    [extensions] => Array
                        (
                            [0] => jpg
                            [1] => png
                            [2] => gif
                            [3] => jpeg
                        )

                    [roleSessionVar] => JoditUserRole
                    [path] => http://fw.loc/media/images/
                    [root] => D:\OpenServer\Domains\fw.loc/public/media/images/
                    [baseurl] => http://fw.loc/media/images/
                    [sources] => Array
                        (
                            [Images for PAGES] => Array
                                (
                                    [root] => D:\OpenServer\Domains\fw.loc/public/media/images/
                                    [baseurl] => http://fw.loc/media/images/
                                    [path] => http://fw.loc/media/images/
                                    [createThumb] => 1
                                    [thumbFolderName] => _thumbs
                                    [extensions] => Array
                                        (
                                            [0] => jpg
                                            [1] => png
                                            [2] => gif
                                            [3] => jpeg
                                        )

                                )

                        )

                )

            [sources] => Array
                (
                    [Images for PAGES] => Jodit\Config Object
                        (
                            [parent:Jodit\Config:private] => Jodit\Config Object
 *RECURSION*
                            [data:Jodit\Config:private] => stdClass Object
                                (
                                    [root] => D:\OpenServer\Domains\fw.loc/public/media/images/
                                    [baseurl] => http://fw.loc/media/images/
                                    [path] => http://fw.loc/media/images/
                                    [createThumb] => 1
                                    [thumbFolderName] => _thumbs
                                    [extensions] => Array
                                        (
                                            [0] => jpg
                                            [1] => png
                                            [2] => gif
                                            [3] => jpeg
                                        )

                                )

                            [sources] => Array
                                (
                                    [default] => Jodit\Config Object
 *RECURSION*
                                )

                        )

                )

        )

    [accessControl] => Jodit\AccessControl Object
        (
            [accessList:Jodit\AccessControl:private] => Array
                (
                )

        )

    [startedTime:Jodit\BaseApplication:private] => 1525981687.0853
)

Joomla errors!

Jodit Version: 3.0.66

Code

// A *self-contained* demonstration of the problem follows...

Expected behavior:

Actual behavior:

Privet Valeriy!
Your extension looks awesome and very promising, but unfortunately does not work properly in Joomla! The package (downloaded from extensions.joomla.org) installed successfully under the newest Joomla 3.8.7 but when I try upload image, "Internal server error" is displayed. Also error occurs during the Configuration process. After removing any of the buttons, the Toolbar completly disappear, and need to use the "Restore default" button to recover it.
The next error I found in the Components menu, when the "Jodit editor" submenu don't work, the page is empty.
My last question about the languages. How can I add another language file to the Joedit?
Under the 'media\com_jodit\js\jodit-play\node_modules\jodit\src\langs' I found some language-files, try to add another, but this is not enough!
Can You help me solve it?
I see that Joedit - without these problems - will be by far the best editor for Joomla CMS!!!

How to customize image upload request?

Hello @xdan,

I like this wyswyg editor, it is fast and fullpacked but I can't figure out how to customize the image upload.

The default implementation forces a multipart formdata as request payload and somehow flips rabdomly a get request before the post when using cors.

I have to pass a json object in the request body and inside it the image base64 encoded.
Is there anyway to override the uploader class to use own custom logic?

Im using it wit react and axios as http client. It would be cool to pass a custom uploader class that gets the files.

Thanks in advance

jodit resizer

Jodit Version: 3.1.91
Jodit options
inline : true,
toolbar : false,
toolbarInline : true,
useAceEditor : false,
disablePlugins : 'imageProcessor,imageProperties,DragAndDrop,xpath,stat,fullsize,iframe',
useNativeTooltip : true, // show OS tooltips
toolbarButtonSize : "small", // toolbar button size
enter : "BR", // internal content
popup : {selection: ['bold','strikethrough','underline','italic','superscript','subscript']},
showXPathInStatusbar: false,
showCharsCounter : false,
showWordsCounter : false,
showPlaceholder : false,
minHeight : 10

Expected behavior:
jodit_resizer should not be created for an editor that does not handle images at all. In my case there could be plenty of editors this means the dom gets messed up with jodit_resizer which are not needed.
Actual behavior:
jodit_bug14

Issue editing table content in IE (Edge works OK)

When using IE (IE11 on windows 10 at least) content in a table cannot be edited, although Edge is fine.

Jodit Version: 3.1.83

Code

<div style="background-position: 50% top; margin: 0px; padding: 0px; color: rgb(54, 54, 54); line-height: 14px; font-family: Verdana; font-size: 11px;">
   <div>This can be edited</div>
    <table style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td align="middle" valign="top">
                    <table style="width: 100%; height: 552px;" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <td valign="top" style="text-align: right; color: rgb(255, 255, 255); padding-top: 7px; padding-right: 5px; font-size: 24px; font-weight: bold;" bgcolor="#2295b5">This content cannot be edited</td>
                            </tr>
                            <tr>
                                <td valign="top" style="text-align: center;" bgcolor="#5d5d5d"><span style="color: rgb(255, 255, 255);">Blurb</span></td>
                            </tr>
                            <tr>
                                <td valign="top" style="padding-top: 7px; font-size: 12px; background-color: rgb(255, 153, 0);" bgcolor="#ffffff">
                                    <p></p>
                                    <p></p>
                                    <p>Dear «Name»,</p>
                                    <p>This is a test</p>
                                    <p>&nbsp;</p>
                                </td>
                            </tr>
                            <tr>
                                <td height="10" bgcolor="#e9e9e9">
                                    <div align="center" style="padding-top: 4px; font-size: 10px; text-decoration: none;">«EditProfile»<br>&nbsp;</div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <br></td>
            </tr>
        </tbody>
    </table>
</div>

Expected behavior:
Able to edit content of table in IE

Actual behavior:
Does not let me edit content of table, but will a div outside the table

Error if element does not exist

Hi. There was a problem: if for new Jodit (element) to submit an element which does not exist on page, we will receive the Exception
Jodit Version: 3.1.18

Code

var element = new Jodit(element);
//TypeError: cannot use 'in' operator to search for 'nodeType' in 'n.element'

Image resize frame and resize handlebars

Jodit Version: 3.1.91

Playground Safari , Electron/Chrome

Editor with fixed height

<div class="jodit_wysiwyg" contenteditable="" aria-disabled="false" tabindex="-1" spellcheck="true" style="
min-height: 114px;height: 500px;">
<p><img src="build/images/artio.jpg" style="width: 767px; float: right; height: 1000px;">
<ul>
    <li>Copy/Paste image</li>
    <li>Drag&amp;Drop </li>
    <li>Open source  - GPL v.2 </li>
    <li>ACE editor out of the box </li>
    <li>Pure TypeScript. No libraries</li>
    <li>Lightweight: ~96.73kB gzipped.</li>
</ul>
</p>
</div

Expected behavior:
image edit popup is displayed within the visible area of the editor and should not be placed outside. Resize frame and resize handles should be hidden outside the editor. If the image is very big no popup at all is displayed (second picture)

Actual behavior:
see picture
jodit_bug12
jodit_bug13

Inline Contextmenu Positioning

Jodit Version: 3.1.90

Playground Safari
Electron/chrome app

Expected behavior:
After selecting the text the context menu should align with the mouse cursor

Actual behavior:
context menu is centered over the selected text

jodit_bug7

Paste bug

Jodit Version: 3.1.73
OS: Windows 10
Browser: Microsoft Edge & MS Internet Explorer 11

Expected behavior:
Should paste html inside Jodit Editor right in the place where cursor stands.

Actual behavior:
Does nothing in MS Edge.
Always pastes plain text in the very beginning of the Editor container (with a class - "jodit_wysiwyg") in MS IE11.
Both situations were tested locally and from your main page example - https://xdsoft.net/jodit/

"Element "[object HTMLDivElement]" should be string or HTMLElement" in IE

Example code:
var element = document.getElementById('<elementId>'); // e.g. HTMLDivElement
new Jodit(element, options);

Throws error: "Element "[object HTMLDivElement]" should be string or HTMLElement" in every IE version.
In all other browsers, the condition in jodit.ts line 153 works (this.element instanceof HTMLElement).

New font list functionality does not work

Jodit Version: 3.1.71

Code
font: {
list: {
"font-family: -apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,Ubuntu,Droid Sans,sans-serif;": "OS System Font",
"Helvetica,sans-serif": "Helvetica",
"Arial,Helvetica,sans-serif": "Arial",
"Georgia,serif": "Georgia",
"Impact,Charcoal,sans-serif": "Impact",
"Tahoma,Geneva,sans-serif": "Tahoma",
"'Times New Roman',Times,serif": "Times New Roman",
"Verdana,Geneva,sans-serif": "Verdana"
}
}
Expected behavior:
Set the selected font family
Actual behavior:
Does not set the font family

jodit_bug4

append data

**
var editor = new Jodit('#editor', {
uploader: {
url: '/api.php/upload/mutiupload',
defaultHandlerSuccess:function(success,data){
if(success==true){
$('p').append('dddddddddddd');
}

    }
}

});
**
$('p').append('dddddddddddd'); this line(jquery) does not working.
please guild. thanks

Display problem for font size popup

Jodit Version: 3.1.71

Expected behavior:
Scrollable select list
Actual behavior:
Does not scroll font sizes, instead sizes are shown outside the popup list

jodit_bug3

How to disable HTML auto escape

I use Liquid within my editor and the editor automatically escapes the html e.g.

{% if a > b %} this gets changed to {% if a &gt; b %}

Both methods
getNativeEditorValue() and getEditorValue() return the same thing

How can I fix this.

Error on pasting table

Whenever i try to paste a table onto the plugin, the table toolbar does not show, on console it keeps showing the following error:
"jodit.min.xdsoft.js?2.5.62:11 Uncaught TypeError: Cannot read property 'NaN' of undefined
at L (jodit.min.xdsoft.js?2.5.62:11)
at HTMLTableCellElement. (jodit.min.xdsoft.js?2.5.62:11)
at HTMLTableElement.i (jodit.min.xdsoft.js?2.5.62:7)"

Image edit popup position

Jodit Version: 3.1.92

Playground Safari

Expected behavior:
After aligning an image, e.g. from left to right the edit popup should align with the new position of the image or should be hidden after replacing the image

Actual behavior:
Image edit popup just stays at the same place

jodit_bug00

Inline Mode Context-Menu visibility

Jodit Version: 3.1.90

Electron/Chrome app
multiple inline editors

Expected behavior:
when focus is lost in one editor div the context menu should vanish
Actual behavior:
when selecting a new editor inline div the context menu is still visible in the previously selected inline editor div

jodit_bug8

brackets support

This editor support brackets tags?
For example:

<table>
<tbody>
{{each myList}}
<tr>
     <td>{{Name}}</td>
</tr>
{{/each}}
</tbody>
</table>

Editor crashes with error - Maximum call stack size exceeded

Jodit Version: 3.1.68

Code

var jodit = new Jodit('#editor', {
  cleanHTML: {
    cleanOnPaste: true,
    allowTags: 'p,a[href]'
  }
});

OR

var jodit = new Jodit('#editor', {
  allowTags: {
    p: true,
    a: {
      href: true
    }
  }
});

Expected behavior:
Clean inserted HTML with the rules above without errors both after paste HTML or changing editor's value.

Actual behavior:
Editor crashes with an error - Maximum call stack size exceeded (http://joxi.ru/YmEKvEnF083xdA). No matter after which action: inserting HTML or changing editor's value like in the docs.

Wrong image selection position

wrong_image_selection
simple test variant:

<div style="width:800px; margin:auto; border:1px solid red;">
	wrong image selection
	<div style="position:relative;">
		<textarea id="text_area0"> <img src="tigr.jpg" style="width:100px;"/> </textarea>
		<script>
			var object = document.getElementById("text_area0");
			new Jodit(object);
		</script>
	</div>
</div>

bootstrap variant: (with bootstrap.min.css)

<div class="container">
<div class="row">
	<div class="col-md-12">
		wrong image selection
		<textarea id="text_area"> <img src="tigr.jpg" style="width:100px;"/> </textarea>
		<script>
			var object = document.getElementById("text_area");
			new Jodit(object);
		</script>
	</div>
</div>

Feature request

Hi Valeriy,

I have multiple (more than 30 divs/textareas) which need inline mode editor support. Currently this means I have 30 Jodit instances. The number of 30 can be increased through user interaction and I don't know how many the user will insert at runtime. Therefore, to reduce overhead and complexity, it would be really good if I only need 1 inline mode instance for all divs/textareas. This would mean that I need a function with which I can register/unregister all divs/textareas (at initialization or at runtime dynamically). Or a function where I can register a className at initialization and all dynamically added divs/textareas will be supported as default without further interaction.

Unexpected token<

when I upload images, I got callback "Unexpected token<"
I don't know why?

Drag and drop in IE

Jodit Version: 3.1.84

Using IE11

Expected behavior:
Dragging text from outside into the editor, copy the text, and dragging within should move it.

Actual behavior:
No text is created/moved, but carat ends up at where mouse is dropped.

EU GDPR issues

Hi Valery

I have some concerns using your editor in my project according to the new European Data protection law EU GDPR.

  • First of all Jodit makes certain connections to the sources, code below. If the cdnjs Servers are not located within the EU they are regarded as to be not 'safe harbour' and therefore not conform with the new EU GDPR law which will be introduced this month on the 25th! Are there any other sources that are loaded from the internet as well?
  • Second and also most important, I need to clarify the legal issues with the copyright of Jodit and all its direct and indirect dependencies (as shown in the code below: license of ace editor, beautifyHTML, etc.). Since German law is very restrictive and strict I need to clarify these issues in order to use the Jodit OEM license in a legal and correct way. Therefore, can you provide me with a full list of all direct and indirect dependent source codes and their licenses?
Config.prototype.sourceEditorCDNUrlsJS = [
    'https://cdnjs.cloudflare.com/ajax/libs/ace/1.3.1/ace.js',
];
Config.prototype.beautifyHTMLCDNUrlsJS = [
    'https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.5/beautify.min.js',
    'https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.7.5/beautify-html.min.js',
];

cleanHTML bug

Jodit Version: 3.1.67

Code

var jodit = new Jodit('#editor', {
  cleanHTML: {
    cleanOnPaste: true,
    allowTags: 'p,a[href]'
  }

OR

var jodit = new Jodit('#editor', {
  allowTags: {
    p: true,
    a: {
      href: true
    }
  }
});

Expected behavior:
Should clean up HTML after inserting into editor with the only allowed tags.

Actual behavior:
Paste HTML with all the tags copied before, meta tags, styles etc.

Incorrect controls position inside a relatively positioned div

Hi there, at first I want to thank you for this great editor.

I have a small problem which I'm sure can be fixed with some editor options.
My editor is placed in a div with position: relative. It makes all the editor absolutely-positioned elements (like image or link controls) appear on incorrect places (shifted somewhere to the right and bottom). When I remove position: relative from parent div, they are positioned well.

Is it possible to set the element which all calculations are relative to? I suppose currently it's <body>.
Or maybe you can just make all the positions calc relatively to the first parent with position: relative or position: absolute instead of <body>?

Jodit Version: 3.0.34

Expected behavior:
All editor controls are positioned correctly regardless parent blocks CSS positions.

Actual behavior:
All editor controls are positioned incorrectly when editor is placed inside a div with position: relative.

internal server error

when I use upload images. I got callback "internal server error". I don't know why?

Problem with assets-manager

Hi. If you install jodit and use assets-plugin (not npm-assets) then you application after install showing exception:
"The file or directory to be published does not exist: /.../vendor/npm-asset/jodit/build"

Am i the only one struggling with the image/upload?

Love the WYSIWYG however naturally I dont want to upload my images to your webserver and am finding the documentation confusion... where can i change the settings for this so that it uploads new images to my server and it browses my own webserver for already uploaded images?

Error when creating a new text node

Jodit Version: 3.1.68

Code
Jodit.modules.Dom.create('text', 'Hello world');
Expected behavior:
create a new text node

Actual behavior:
Uncaught TypeError: Cannot read property 'createTextNode' of undefined

jodit_bug01

Can't to set different margins to image

Hi guys!
Thanks for your work. I'm trying out your product and going to buy a license, if it will be appropriate for my project.

I found a bug:
Press to edit image -> Advanced -> Unlock right/left/bottom margins -> fill it by different values (for example: 10px/20px/30px/40px) -> OK
I expected that image will have different margins, but it has only margin: 10px;. And the same in advanced settings :(

Image resizing

Jodit Version: 3.1.90
Code

Safari Playground page
Electron/chrome app

Expected behavior:
Resizing the image while keeping the width/height proportion

Actual behavior:
image gets stretched when hitting the maximum width of the editor window -> this leads to problems to restore the original width/height proportion

jodit_bug6

Value as string, without tags

Jodit Version: 3.1.73

Expected behavior:
Double mouse click should simply select needed text. And it might be great to cover plain text with <p> or even <div> tag.

Actual behavior:
When editor`s value is set with plain text without covering it in any html tag there is an issue with selecting this text. Double mouse click doesn't select the text it adds new empty <p> tag randomly in the top or bottom of the Jodit workspace each time you want to select the word.
When Jodit value is covered with html tags , no issue occured.

Strange Content &#65279;

Jodit Version: 3.1.90 and 3.1.91

Code

Electron/Chrome App

Expected behavior:
After initialization of multiple inline editor, changing between those editors without inserting anything should result in empty content for each individual editor

Actual behavior:
After switching forth and back between the inline editors a strange value is set by Jodit '' in all inline editors



Playground is broken

Jodit Version: N/A

When playing around with button exclusion in the Playground (https://xdsoft.net/jodit/play.html), the code snippet generated after you've unchecked a few of the buttons on the right hand side doesn't seem to be serializing the options correctly:

var editor = new Jodit("#editor", {
  "buttons": "[object Object]"
});

Preview:

screen shot 2018-05-15 at 12 10 00

Just thought I'd give you the heads up!

Using Jodit with Angular 5/Ionic

Hello, I was trying to import Jodit for use with my Ionic/Angular app, but I can't import the module in Angular. Do you know if I could create a module wrapper for it or anything like that?

Image resizing

Jodit Version: 3.1.73

Expected behavior:
Image can only be resized to the maximum of the current editor width.

Actual behavior:
Resize handle bars and the image exceed the visual width of the editor.

jodit_bug5

Inline Popup Menu position

Jodit Version: 3.1.91

Electron/chrome app

Expected behavior:
on text selection or doubt click the popup should be rendered in the visible area

Actual behavior:
is rendered not completely in a visible area

jodit_bug10

Inline mode buttons

Jodit Version: 3.1.90

On Playground page Safari
and in Electron/chrome app

Expected behavior:
only show allowed buttons in inline mode

Actual behavior:
All buttons are shown in the context menu when switching to the inline mode, toolbar mode is fine

jodit_bug5

Furthermore on the playground page when deselecting buttons the code div shows "[object Object]" and not the selected buttons
var editor = new Jodit("#editor", {
"buttons": "[object Object]"
});

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.