Skip to content

Possibility to choose things to save #8

@MikaelMayer

Description

@MikaelMayer

Related to #7
Sometimes we add a plug-in which adds tons of boxes and attributes.
We would like to be able, from the Editor's interface to specify which elements should be saved and which should not, and which should always not.

Interface

  • In the settings icon (gears), all changes to be saved should be displayed. It should be possible to know the previous value and restore it if necessary.
  • It should be also possible to specify that a change should be ignored for saving purposes, just for this session or always.

Implementation

  • It should be different from the Undo/Redo feature as it should present a summary of what differences are going to be saved. We should reuse sns.objEnv.string.evaluate({a: domNodeToNative(...), b: (original one obtained after first execution of script or after a save)})("diff a b") to obtain an expected list of differences (the diff language might change in the distant future)
  • This list of changes follows the document order.
  • For each change, three possible actions:
    • Dismiss the change. It should revert the element to its previous state.
    • Ignore the change. It should ignore the change for this session. For attributes, with the newest Editor's API, one can do: elem.editor.ignoredAttrs["name"] = default value. For inserted nodes, just setting .isghost = true should be sufficient. For deleted nodes, we should figure out something else.
    • Always ignore the change. It should ignore the change as in the previous bullet point. To do so, it suggests a way to recognize the change and save it to the file .editorignore as following:
      • .editorignore has the following shape:
      {
         ghostNodes= [list of node selectors which should be ignored for this file]
         ghostAttrs:= [pairs of node selectors and list of attributes that should be marked as ghost]
         ignoredAttrs = [pairs of node selectors and list of attributes that should be marked as ignored]
      }
      

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions