Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11275

editor.js::colorPalette() breaks page with document.write > add proper target

    XMLWordPrintable

Details

    • Improvement
    • Status: Unverified Fix (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.0.11, 3.1.0-dev
    • 3.1.0-a1
    • Styles
    • None

    Description

      The current (3.0.11) function colorPalette(dir, width, height) in /styles/prosilver/template/editor.js uses document.write to directly write to the browser output. In this current state it is impossible to call this function from outside its target-environment or with another javascript. The document.write will cause the entire page to be overwritten.

      I'm proposing the usage of a variable to store the output while its being composed rather than writing it directly to the browser, the addition of an optional target argument and then the fallback to document.write if no target is present.

      I have attached how the new colorPallete() could look like, the +"\n" are optional, but replaces the old "writeln".

      This modification is fully backwards compatible and will not break any current implementation.

      Attachments

        Activity

          People

            EXreaction EXreaction [X] (Inactive)
            vindex vindex
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: