summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/summernote.js
AgeCommit message (Collapse)Author
2017-08-16[MOV] web_editor, website: reorganize filesqsm-odoo
2017-06-14[IMP] web_editor: improve icon color editiondbh
- Make sure icon colors can be edited the same way as text - Improve recent color behavior
2017-03-17[FIX] web_editor: copy/paste in the editorqsm-odoo
Commit 906875fc78cb80f6c3d5f1f14f997008cd406473 (followed by commit 76be5eed449c78eaf0b4208c381169132492ab4a) tried to tweak to copy/paste functionality of the editor. Indeed, in PDF file, when copying a paragraph, a line feed is added at each forced line break (page width end). This forced a line feed and a new paragraph in the pasted text. The goal was to get rid of those useless linebreaks when pasting. The ideal solution would be to detect that the text was copied from a PDF but it is not possible. However, this commit improves the heuristic: if this is not plain text, then nothing is done, the content is pasted normally. If it is plain text (like when copying from pdf), then each line break which is surrounded by letters or numbers is considered an useless line break and replaced by a space. This is obviously not perfect but the previous implementation was really wrong (it was removing line breaks which were not preceeded by punctuation in all cases, which was removing lots of useful line breaks). Note: this commit also fixes a bug -> text was not able to be pasted with Internet Explorer. opw-715920
2017-01-17[MERGE] forward port branch saas-11 up to a0aca47feffChristophe Simonis
2017-01-17[MERGE] forward port branch 9.0 up to 16fa61b34f9Christophe Simonis
2017-01-11[FIX] web_editor: italic odd behavior because typoNicolas Lempereur
An italic node would be taken as a basic node containing text and thus would be merged unexpectedly. For example with the following content : "<i>hello</i> world" removing a letter of 'world' would merge the text node with hello making it italic. opw-703722
2016-11-15[MERGE] forward port branch saas-12 up to ca20038Christophe Simonis
2016-11-15[MERGE] forward port branch saas-11 up to 58f68ccChristophe Simonis
2016-11-14[MERGE] forward port branch 9.0 up to fb763f3Christophe Simonis
2016-11-08[FIX] web_editor: split h5,h3,...p... node to insert tableChristophe Matthieu
opw-686393
2016-11-02[MERGE] forward port branch saas-12 up to 0ca99ffChristophe Simonis
2016-10-31[FIX] web_editor: don't paste two timesNicolas Lempereur
When pasting, the paste event is cancelled and done back with the corrected data. This works fine on firefox, but this can have unwanted results on other browser like pasting two times or copying the end of the line at the beginning. This commit replace completely the summernote functionality with our small implementation of pasting corrected text. closes #14043 opw-690814
2016-10-10[FIX] web_editor: change attachment/image icon in editor barqsm-odoo
The image icon was not clear enough. The editor bar appears in the website builder, the mail composer, the forum composer, ... In each of them, we can both link a picture or a file but a picture makes more sense in some context and in some other ones not. This commit solves the problem by changing the icon to fa-file-image-o which is a mixed of file and image. This also solves the problem of having two buttons with the image icon in the website builder (indeed an image icon is also used for the image look button).
2016-09-02[FIX] web_editor: remove some defaults in text editionqsm-odoo
* On firefox, you had to click twice on a link to be able to start typing text * When selecting text which contained a <br/>, you were not able to replacing it correctly (you had to click again before starting typing) * When replacing a whole paragraph content which was below a title, the text was not replaced and you had to click again and the title transformed into a paragraph. * ...
2016-08-19[IMP] web_editor: put the "Quote" style after "Header" stylesqsm-odoo
2016-07-04[IMP] web_editor: user text copy/pasteqsm-odoo
Users copy/past text from various king of document into the editor. These texts contain useless line breaks that should be removed before pasting. Also, the editor currently add a paragraph element between each line. To correct this behaviour the onPaste callback of the summernote lib is used. However for some reason, this is triggered after the text is pasted (we should update and refactor the lib in a better way). So this commit uses a hack: undo the past thanks to the undo command then paste the formatted text we want.
2016-03-24[MERGE] forward port of branch saas-9 up to 59d3f63Christophe Simonis
2016-03-09[FIX] web_editor: leave block after two enterNicolas Lempereur
Before 3959afc the `node` tested would be the selection containing node, but since then it may have been a `<br/>` which has some damaging effects: now entering double enter at the end of a list, quote or code block doesn't end this block. Testing the use case corrected by 3959afc, the said change seems to have no effect so this commit reverts it. opw-667618
2016-02-24[REF] web_editor,website,mass_mailing: JS/XML updateqsm-odoo
* Adapt DOM selectors * Refactore dialog XMLs to have odoo styling * New editor options (background-position, ...) * Various improvements
2016-02-24[REF] website,web_editor: complete restylingstefanorigano
2016-01-28[FIX] web_editor: enter keydown create new td only if the caret is on the ↵Christophe Matthieu
last char of the last line of the td
2016-01-20[FIX] web_editor: can indent table cell (with button and tab)Christophe Matthieu
issue: the user select some line and keypress tab without indent, and the button indent doesn't work in table cell
2016-01-11[FIX] web_editor: error when long delete keypress in mass_mailing htmlChristophe Matthieu
issue: event does not a global var in firefox, and event is already prevented
2016-01-11[FIX] web_editor: clean pasted dom and avoid crappy domChristophe Matthieu
Chrome on windows add few comment tags and insert unwanted span.
2015-12-10[FIX] web_editor: enter in a p tag empty (when user change with code view) ↵Christophe Matthieu
can be raise an exception
2015-12-10[FIX] web_editor: error when paste without any content in clipboardChristophe Matthieu
2015-12-10[FIX] web_editor: remove exceed span on paste html contentChristophe Matthieu
2015-11-30[FIX] web_editor: fallback to plain text when pastingNicolas Lempereur
Depending of the location where the "Copying" happened, only text/plain content could be available from the clipboard component. So if no text/html was retrieved, we should fall back to plain text pasting. closes #9787 opw-657137
2015-11-16[FIX] web_editor: don't think HTML comment are visibleNicolas Lempereur
Summernote sometimes doesn't take into account HTML comment could be embedded in the edited content, this can lead to issue since this situation can happen in Odoo. This commit patch the "isVisiblePoint" summernote's function to take care of this issue. opw-656332
2015-10-29[FIX] web_editor: don't remove char after a selection when click on deleteChristophe Matthieu
Issue: click on an image or create a text selection and click on delete, the char after the selection is removed
2015-10-29[FIX] web_editor: remove useless duplicated codeChristophe Matthieu
2015-10-26[FIX] web_editor: visible char have the same feature that delete keydownChristophe Matthieu
2015-10-26[FIX] web_editor: remove td content on keydown delete with multi td selectedChristophe Matthieu
2015-10-26[FIX] web_editor: don't merge tr when keydown delete on the last row table cellChristophe Matthieu
2015-10-26[FIX] web_editor: backspace and enter in table cell don't break or remove td ↵Christophe Matthieu
(remove tr but not td alone)
2015-10-26[FIX] web_editor: use arrow up/down to switch table cellChristophe Matthieu
2015-10-26[FIX] web_editor: copy-paste content keep architectureChristophe Matthieu
The paste don't keep the architecture, usability team want to past the architecture but remove extra style and wrong node like span.
2015-10-09[FIX] web_editor: alt+tab in table and tab on collapseNicolas Lempereur
When using the tab key on non text node range, it could fail in some given case. Also when removing the last element of the table row, a correction was done in d33086c03fc but if there was no element before the table (eg. the editor is empty) an error could occur.
2015-10-09[FIX] web_editor: null range and remember_selectionNicolas Lempereur
Tests for null range were not done in #8845, so in given case (where the focus is not in the editor) we could get an issue. The code for remembering the selection when clicking the editor was made useful in d33086c03fc, but there was an edge case when the editor itself was in a modal: then the selection would be lost. This commit change the code as following: 1) restore the selected range if: - the current selected range is not in the editable of the active editor - there is a corresponding saved selected range or we are in an embeded editor (and not in air mode as when editing the website) 2) save the selected range if: - we don't restore the selection, - the current selected range is in the active editor editable area
2015-10-09[FIX] web_editor: range is null if focus outside of editorMarkus Mattes
The range can be null if the focus is not in the editor at serveral places. closes #8845
2015-10-09[IMP] web_editor: rename range variable rng to rMarkus Mattes
Put all rng to r to have the same concept in the whole file as well as in the summernote codebase. closes #8845
2015-10-06[FIX] web_editor: oStyle.range can be undefinedChristophe Matthieu
On initialisation summernote call update method with oStyle.range is undefined. The range can be undefined because the update is call before any selection and attach method from summernote call the update without range. The method summernote_table_update try to use the range and raise an exception. fix: Check if oStyle.range exits.
2015-10-02[FIX] web_editor, mass_mailing: summernote oversight and videoNicolas Lempereur
* some oversight when updating summernote with d33086c, * fix style when replacing image with video
2015-09-29[IMP] web_editor: update summernote up to 2015-08-31Nicolas Lempereur
update summernote library up to revision: https://github.com/summernote/summernote/commit/a0f26e300 see https://github.com/summernote/summernote/ for history closes #8704
2015-09-25Revert "[IMP] web_editor: update summernote up to 2015-08-31"Nicolas Lempereur
Revert till several issues are solved.
2015-09-25[IMP] web_editor: update summernote up to 2015-08-31Nicolas Lempereur
update summernote library up to revision: https://github.com/summernote/summernote/commit/a0f26e300 see https://github.com/summernote/summernote/ for history closes #8704
2015-09-23[MERGE] forward port of branch saas-6 up to a669433Christophe Simonis
2015-09-04[FIX] web_editor: do paste after removing selectionNicolas Lempereur
2015-08-31[MERGE] forward port of branch saas-6 up to 7faf72cChristophe Simonis
2015-08-31[FIX] web_editor: don't loose selection when deleting an imageChristophe Simonis