[wp-trac] [WordPress Trac] #26333: svg-painter.js and friends

WordPress Trac noreply at wordpress.org
Fri Nov 29 22:50:09 UTC 2013


#26333: svg-painter.js and friends
----------------------------+-------------------
 Reporter:  azaozz          |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  high            |  Milestone:  3.8
Component:  Administration  |    Version:  trunk
 Severity:  normal          |   Keywords:
----------------------------+-------------------
 Not convinced that this functionality is needed.
 - Not used in core.
 - Would work only if a plugin decides to add svg icon for use in the admin
 menu or the toolbar, and that icon is supplied as base64 encoded code in
 CSS. Then if the user changes admin color schemes, svg-painter would kick
 in and try to hack any svg icons to change their color so it matches the
 rest of the admin menu icons color.

 A (much?) better option would be for the plugin to use icon font, the same
 way as used in core.

 In addition, the way this is currently implemented is not so good:
 - svg-painter.js requires jQuery to run (would throw a fatal error
 otherwise) but jQiery is not listed as dependency.
 - It runs on $(document).ready() but is enqueued for the HTML head...
 - It is available to be enqueued on the front-end, but the needed
 `wp_color_scheme` JS global cannot be outputted there.

 Also, looking at `set_color_scheme_json()` in wp-admin/misc.php: it
 erroneously outputs an empty array by default (`isset` should probably be
 `! empty`). The name could probably be better, and the JS global should
 probably be `wpColorScheme`.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26333>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list