Currently, QR codes download as a PNG with a white background. This works fine for basic use cases, but designers usually prefer an SVG format to make it easier to scale and colorize.
added QR Code submenu with two options for download: "PNG (default)" and "SVG".
moved QR Code out of the Share submenu in order to prevent overly nested submenus.
updated QR code controller endpoint to take a format parameter: /shortener/urls/:short_code/download_qrcode.svg
removed some css with high specificity that was difficult to style around since it target font-awesome's :before element directly.
moved require statements that were in the controller. My understanding is that putting these in the controller causes them to be invoked on every request, rather than when the class is loaded. I've only seen require statements at the top... (and even that's rare given that the rails autoloader should take care of most things).
Screenshots
Example SVG QR Code with transparent background (beware dark mode users):
Changed QR Code button to split button with a dropdown menu:
Changed help text for PNG and SVG to "Standard" and "Advanced"
Fixed issue where an SVG QRCode may appear in Illustrator with a black background (changed fill from transparent to none).
Fixed an issue where the QRCode dropdown menu would be clipped in the panel below a new url. (The panel had an overflow: hidden)
Fixed an issue where SVG would not scale properly when stretched: the x dimension would remained fixed, while the y dimension would scale. After some unsuccessful futzing with the barby gem, I switched the popular rqrcode gem for QR Code generation. barby and chunkypng gems removed.
Adds an option to download a QR code as an SVG.
Currently, QR codes download as a PNG with a white background. This works fine for basic use cases, but designers usually prefer an SVG format to make it easier to scale and colorize.
/shortener/urls/:short_code/download_qrcode.svg
:before
element directly.require
statements that were in the controller. My understanding is that putting these in the controller causes them to be invoked on every request, rather than when the class is loaded. I've only seenrequire
statements at the top... (and even that's rare given that the rails autoloader should take care of most things).Screenshots
Example SVG QR Code with transparent background (beware dark mode users):
On https://cla-z-dev-02.oit.umn.edu for testing
Resolves #157, #152