Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: odoo-dev/odoo-editor
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: odoo-dev/odoo-editor
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: saas-14.4
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 18 commits
  • 5 files changed
  • 4 contributors

Commits on Jun 15, 2021

  1. [FIX] fix getRangePosition util in Iframe context

    (cherry picked from commit 184744e)
    sebgeelen authored and dmo-odoo committed Jun 15, 2021
    Configuration menu
    Copy the full SHA
    ec18689 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    304fa59 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2021

  1. Configuration menu
    Copy the full SHA
    5fea955 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2021

  1. Configuration menu
    Copy the full SHA
    6aac22a View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2021

  1. Configuration menu
    Copy the full SHA
    dc1e6e1 View commit details
    Browse the repository at this point in the history
  2. [IMP] keep cursor in an unremovable inline element after it was emptied

    We achieve this by inserting and selecting a zero-width space when
    deleting the element.
    This is so far limited to unremovable elements but we could potentially
    expand this logic to all inlines if we choose to have that behavior. In
    that case though we'd have to handle the systematic removal of these
    potentially parasitic zero-width spaces, and adapt a lot of tests.
    Zynton authored and dmo-odoo committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    396f590 View commit details
    Browse the repository at this point in the history
  3. [FIX] always identify and unbold bold text

    The current method to identify bold text failed when the "bolder"
    font-weight was smaller than 500, which happens if the normal
    font-weight is set to less than 400. This is the case with Bootstrap's
    "lead" class for instance.
    Checking if it's bigger than 500 is useful for marking headings as being
    bold. However we need to also check if the element's font-weight is
    bigger than its parent block - in which case it should be considered
    bold.
    Using `font-weight: normal` to unbold again fails if the inherited
    font-weight is smaller than 400 (eg: text in a ".lead" element inherits
    a font-weight of 300 but `font-weight: normal` is the same as
    `font-weight: 400` so setting `font-weight: normal` would make the text
    still end up bolder than the ".lead" element). In these cases we need to
    use the font-weight of said block.
    It's an imperfect heuristic but it gets the job done in the vast
    majority of cases.
    Zynton authored and dmo-odoo committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    52f7fd5 View commit details
    Browse the repository at this point in the history
  4. [FIX] properly paste escaped text and filtered html

    Thus far, the editor only handled text-only pasting. This commit makes
    it so that it now handles html pasting, and ensures that text pasting is
    properly escaped (to prevent evaluating html strings on paste).
    When pasting html, the editor filters the nodes, their attributes and
    their classes through a combination of a whitelist and a blacklist.
    Nodes that match blacklisted or non-whitelisted selectors are removed
    and their contents are unwrapped recursively. Attributes and classes
    that are blacklisted or non-whitelisted are removed.
    What is kept are basic styling elements (eg: h1, strong, ...), images
    (with their src attribute), links (with the href attribute), and a
    selection of classes the edition of which is supported by the editor.
    Zynton authored and dmo-odoo committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    4901eb8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c66c4a5 View commit details
    Browse the repository at this point in the history
  6. [FIX] prevent <p><p><br/></p></p> on insert html

    When pasting a paragraph within a paragraph, the original paragraph
    should split rather than allowing for nested paragraphs.
    Zynton authored and dmo-odoo committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    3eb6522 View commit details
    Browse the repository at this point in the history
  7. [FIX] prevent editing the toolbar with the toolbar

    Clicking in the (non-floating) toolbar, then on one of its buttons would
    edit the toolbar itself (eg., clicking on a list button would insert a
    list in the toolbar).
    This adds a check on toolbar events so they can only affect what is in
    the editable area.
    Zynton authored and dmo-odoo committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    0a9d42c View commit details
    Browse the repository at this point in the history
  8. [FIX] properly create multi-paragraph list with whitespace

    This addresses a bug that occurs when selecting over two paragraphs that
    are separated by some whitespace. It would create multiple indented
    lists.
    
    Task: 2567795
    Zynton authored and dmo-odoo committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    225993e View commit details
    Browse the repository at this point in the history
  9. [FIX] prevent shrunk blocks on split during insert html

    When inserting HTML, we sometimes need to split blocks to prevent weird
    nesting of blocks. However, that process has the potential of generating
    shrunk blocks (blocks without a height), such as <p></p>. This prevents
    it from happening.
    Zynton authored and dmo-odoo committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    e3a55f4 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2021

  1. [FIX] do not merge similar option elements when sanitizing

    The sanitizer merges similar elements together but <option> elements
    should never be merged because they each represent a separate option,
    no matter if several consecutive options are the same. Options are
    blocks by default so failing to recognize that was the cause of the
    issue.
    Zynton committed Jun 25, 2021
    Configuration menu
    Copy the full SHA
    e61b0b5 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2021

  1. [FIX] deleteContentForward on google chrome

    Sometimes Google Chrome wrongly triggers an input event with `data`
    being `null` on `deleteContentForward` and `insertParagraph`. Luckily
    Chrome provides the proper signal with the event `beforeinput`.
    
    A fix had already been made for enter but not for `deleteContentForward`.
    Goaman authored and Zynton committed Jun 28, 2021
    Configuration menu
    Copy the full SHA
    38cb8d2 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2021

  1. [IMP] paste text safely in editor without wrapping code in PRE tags

    The system to detect if the text that was pasted contained javascript or
    xml was weird, buggy and risky. This reverts it so we can make use of
    insertText instead of insertHTML and be perfectly safe. We also preserve
    linebreaks in HTML.
    Zynton committed Jun 29, 2021
    Configuration menu
    Copy the full SHA
    7130990 View commit details
    Browse the repository at this point in the history
  2. [FIX] prevent splitting the wrong parent on paste

    When inserting blocks, we often need to split the node in which we're
    inserting. The code that makes that happen had an issue in its while
    statement that checked the wrong node, resulting in overreaching splits.
    This fixes that while statement.
    Zynton committed Jun 29, 2021
    Configuration menu
    Copy the full SHA
    e9346f8 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2021

  1. [FIX] only send observerApply event when needed

    REASON FOR THE FIX
    To correctly display the overlay over a rotated element, we need to
    reset the transform of the element, to be able to apply it on the
    overlay.
    
    Changing the style of the element in the SnippetEditor cover method
    would trigger a DOM mutation, which will result in setting the
    odooEditor observer unactive.
    
    The issue was that flushing the observer (when setting it unactive)
    would always send an event observerApply, even if no record was
    processed.
    
    It was an issue as the SnippetsMenu was triggering a content_changed
    event at the reception of this event, which would rerender the
    SnippetEditor overlay cover (and create an infinite loop of events).
    
    SOLUTION
    To avoid that, the observerApply event is sent only if records were
    processed.
    
    task-2554608
    younn-o authored and Zynton committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    f63c3f9 View commit details
    Browse the repository at this point in the history
Loading