-
Improvement
-
Resolution: Fixed
-
Minor
-
3.0.11, 3.1.0-dev
-
None
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.