Commit graph

11 commits

Author SHA1 Message Date
Andreas Gohr
3a6c6601fa SVG dispatch: allow passing ini colors without underscores
The surrounding underscores can be left out.
2017-02-21 16:34:26 +01:00
Andreas Gohr
e988c1764f fix problems with ini handling in svg dispatch 2017-02-21 13:03:41 +01:00
Andreas Gohr
9fd3d99b8f directly embed SVGs for better styling
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.
2017-02-13 16:19:43 +01:00
Andreas Gohr
94def893f0 allow style.ini replacements in SVG dispatcher 2017-02-13 14:28:04 +01:00
Andreas Gohr
c24a2e1e52 SVG Dispatch: allow for referencing material design icons
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).
2017-02-13 14:02:16 +01:00
Andreas Gohr
24ab1f725c add caching and fix <g> wrapping 2017-01-19 18:30:37 +01:00
Andreas Gohr
5a65cb36d8 Merge branch 'svg-background' into 'svg-dispatch'
feat: add background-colors to SVG-dispatcher

See merge request !12
2017-01-19 16:08:06 +01:00
Andreas Gohr
4fd6492bc9 fixed content type header 2017-01-12 09:25:28 +01:00
Andreas Gohr
3ec07d58b7 fixed auth check 2017-01-12 09:25:13 +01:00
Michael Grosse
80d784e1de feat: add background-colors to SVG-dispatcher
This extends the query with to parameters for the background:

b - wanted background color
bh - wanted background color on hover
2017-01-11 14:42:51 +01:00
Andreas Gohr
1072ee525d first go at a dispatcher to dynamically recolor SVGs
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
2017-01-10 17:31:34 +01:00