{"id":15160316,"url":"https://github.com/bymayo/jquery-svg-convert","last_synced_at":"2025-09-30T11:31:57.438Z","repository":{"id":35461265,"uuid":"39728980","full_name":"bymayo/jquery-svg-convert","owner":"bymayo","description":"Convert .svg images to code on the fly with jQuery","archived":true,"fork":false,"pushed_at":"2019-01-16T10:08:03.000Z","size":208,"stargazers_count":30,"open_issues_count":2,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-06T22:45:01.569Z","etag":null,"topics":["jquery","jquery-plugin","svg","svg-converter","svg-icons","svg-path"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bymayo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-26T14:47:41.000Z","updated_at":"2023-01-28T15:47:48.000Z","dependencies_parsed_at":"2022-08-31T06:51:20.800Z","dependency_job_id":null,"html_url":"https://github.com/bymayo/jquery-svg-convert","commit_stats":null,"previous_names":["bymayo/svg-convert","madebyshape/shape-svg-convert","madebyshape/svg-convert"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymayo%2Fjquery-svg-convert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymayo%2Fjquery-svg-convert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymayo%2Fjquery-svg-convert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymayo%2Fjquery-svg-convert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bymayo","download_url":"https://codeload.github.com/bymayo/jquery-svg-convert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234604523,"owners_count":18859164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jquery","jquery-plugin","svg","svg-converter","svg-icons","svg-path"],"created_at":"2024-09-26T22:43:59.952Z","updated_at":"2025-09-30T11:31:57.137Z","avatar_url":"https://github.com/bymayo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e ⚠️ Deprecated - This plugin is no longer supported, but it is fully functional.\n\n\u003cimg src=\"https://raw.githubusercontent.com/bymayo/svg-convert/master/screenshots/icon.png\" width=\"50\"\u003e\n\n# SVG Convert\n\nSVG Convert is a jQuery plugin that takes an `.svg` image (`\u003cimg\u003e`) and converts it in to raw SVG code (`\u003csvg\u003e`) \n\nIt is useful when dealing with Content Management Systems (CMS) where users upload `.svg` files. It allows you to then interact with the raw code, changing fills, strokes etc within the sites CSS.\n\n## Usage\n\n\u003e **Important: SVG's can only be converted when ran on a server environment. \"Cross Origin Requests\" fail on local environments.**\n\n## Getting Started\n\n### Install\n\nThe simplest way to get up and running is to copy the `svg-convert.js` file from `dist` and place it in to your `js` folder inside your project. \n\nInsert the code below before your `\u003c/body\u003e` tag.\n\n```html\n\u003cscript src=\"js/svg-convert.js\"\u003e\u003c/script\u003e\n```\n\nTo initialise the plugin, use the code below in your JS files.\n\n```javascript\n$('.svg-convert').svgConvert();\n```\nThe SVG Convert class `.svg-convert` needs to just be added to .svg's that you want converting from images, to raw code.\n\n```html\n\u003cimg src=\"images/monkey.svg\" class=\"svg-convert\"\u003e\n```\n\nThis will then convert the image. Any attributes (E.g. class, id, data- etc) you add to the image will be carried across after it has been converted (See `Options` below for more information)\n\n**Remember** to load [jQuery](https://code.jquery.com/) _before to use this plugin_.\n\n## Options\n\n### General\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003cstrong\u003eName\u003c/strong\u003e\u003c/td\u003e\n\t\t\u003ctd\u003e\u003cstrong\u003eType\u003c/strong\u003e\u003c/td\u003e\n\t\t\u003ctd\u003e\u003cstrong\u003eDefault Value\u003c/strong\u003e\u003c/td\u003e\n\t\t\u003ctd\u003e\u003cstrong\u003eDescription\u003c/strong\u003e\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003esvgCleanupAttr\u003c/td\u003e\n\t\t\u003ctd\u003earray\u003c/td\u003e\n\t\t\u003ctd\u003e['width','height','id','x','y',\n\t\t'xmlns','xmlns:a','xmlns:xlink',\n\t\t'xml:space','enable-background',\n\t\t'version','style']\u003c/td\u003e\n\t\t\u003ctd\u003eWhen converting to svg the script removes any attributes on the svg set inside this array. Use this to remove these attributes.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eimgIncludeAttr\u003c/td\u003e\n\t\t\u003ctd\u003eboolean\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\t\u003ctd\u003eAny attributes (class, id, data-, width etc) you add to the image before it gets converted will be added to the svg after completion.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eimgCleanupAttr\u003c/td\u003e\n\t\t\u003ctd\u003earray\u003c/td\u003e\n\t\t\u003ctd\u003e['alt','src']\u003c/td\u003e\n\t\t\u003ctd\u003eIf you don't want certain attributes from the image to be added on to the svg then add them in to the array\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eremoveClass\u003c/td\u003e\n\t\t\u003ctd\u003eboolean\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\t\u003ctd\u003eRemoves the selector class from the svg after it's been converted. In the example above, this would remove .svg-convert from the class attribute\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eaddClass\u003c/td\u003e\n\t\t\u003ctd\u003estring\u003c/td\u003e\n\t\t\u003ctd\u003esvg-converted\u003c/td\u003e\n\t\t\u003ctd\u003eAfter the image has been converted you can optionally add a class to the svg\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eonComplete\u003c/td\u003e\n\t\t\u003ctd\u003efunction\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\t\u003ctd\u003eCallback that is called when all SVG's have been converted\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n## Roadmap\n- Ability to set options on images with a `data` attribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbymayo%2Fjquery-svg-convert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbymayo%2Fjquery-svg-convert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbymayo%2Fjquery-svg-convert/lists"}