html - Customizing an SVG in Mediawiki -
i have imagemagick 6.8.5-6 , running on mediawiki 1.20.2 (running on server 2008 r2, iis 7.5). it's doing it's thing , appears functioning perfectly. i'm trying figure out how can pass parameters svg, either in wikicode or using html tag wrap svg in object tag.
here svg i'm using. (created on http://svg-edit.googlecode.com/) simple arrow or tag i'm going use point @ stuff , label stuff.
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 200 100" width="100%" height="100%"> <path stroke="#000000" id="arrow" d="m2.749992,2.750002l106.118515,0l88.431496,47.250097l-88.431496,47.249901l-106.118515,0l0,-94.499998z" stroke-width="3"/> </svg>
i need figure out how pass width, height, , fill parameters, can set size , color of tag.
wikicode doesn't work i've tried, i've enabled raw html , i'm calling this.
<html> <object type="image/svg+xml" data="/wiki/images/3/32/arrow.svg"> </object> </html>
how parameters wiki page svg have no idea?
edit:
desktops in environment running ie8, doesn't support svg. have figure out how tell imagemagick 'fill' svg given color before generates png thumbnail.
you can't pass parameters svg, can manipulate javascript. if want position it, can position svg element in right place if image.
<html> <head> <script> function pointatme(e) { var svg = document.getelementbyid("arrow"); svg.style.display = "block"; svg.style.position = "absolute"; svg.style.top = (e.target.offsettop - 40) + "px"; svg.style.left = (e.target.offsetleft - 110) + "px"; } </script> <style> object { position: absolute; display: none } /* hide */ button { display: block; margin: 100 auto } </style> </head> <body> <object id="arrow" width="100px" height="100px"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewbox="0 0 200 100" width="100%" height="100%"> <path stroke="#000000" id="arrow" d="m2.749992,2.750002l106.118515,0l88.431496,47.250097l-88.431496,47.249901l-106.118515,0l0,-94.499998z" stroke-width="3"/> </svg> </object> <div> <button onclick="pointatme(event)">button 1</button> <button onclick="pointatme(event)">button 2</button> </div> </body> </html>
note have wrap in object element because svg elements cannot styled.
if want more clever, such altering contents of svg dynamically, can js.
Comments
Post a Comment