Now the SVGs are loaded via AJAX and are directly embedded into the
HTML. This allows for styling them via CSS and we can apply proper hover
styles.
The svg dispatcher was extended with an embed option (boolean parameter
'e') which will return an absolute minimum svg with absolutely no
styles.
I had a really hard time to understand the existing CSS which seemed
much too complicated for what it does.
Variable use was suboptimal. I couldn't figure out which variable
defines the proper size for the icon and the resulting margin.
This implements the JS logic as discussed in our meeting. A sidebar can
now contain virtually any wiki syntax. (currently hardcoded) H2 elements
will toggle all their following content which is wrapped in a wrapper
div.
This is currently implemented on top of the old JavaScript which should
be removed.
The toggle element should be made configurable.
We probably want to reuse some of the toggle logic for the user tools.
A SVG not found in the template or in the local media storage will now
be looked up in the Material Design Icon library (via a cached HTTP
request to the rawgit CDN).
* origin/svg-dispatch:
add caching and fix <g> wrapping
fixed content type header
fixed auth check
feat: add background-colors to SVG-dispatcher
first go at a dispatcher to dynamically recolor SVGs
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
The script accepts the following parameters:
svg - the SVG to load. Either an image in the img directory next to the
script or a media file id. ACLs are checked
f - wanted fill color
s - wanted stroke color
fh - wanted fill color on hover
sh - wanted stroke color on hover
Colors are to be given in hex in the following formats:
RGB
RRGGBB
RRGGBBAA
What's missing:
* being able to define what is styled, currently hardcoded to 'path'
elements only
* caching - no need to do all the processing every time
* background setting - that would require wrapping an additional <g>
or <rect> element around all content and style. I'm not sure how to do
that best.
* unit tests