My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

try it now.

Goal

The schematic is the language of electronics. Webtronics exists to try and simplify posting of schematics. It is an online circuit diagram editor. When posting electronic schematics to the web a binary image format is normally used. A person copying that circuit image cannot then easily re-edit it. XML and SVG make editing schematics possible in a browser. I have tried to keep the output format pure svg, but I could add more xml later to improve performance. Ideally It could be used in a page that allowed you to open a hosted image inside of it,edit it,and resubmit it by hitting save. It's like a schematic editor in your browser!

Status

The code is javascript based on Richdraw. It uses AJAX to get parts from a library. It can save and open svg files. I have tried to keep the program simple. It has a small parts library right now. It also has a chip maker that makes rectangles with up to 200 pins. Currently it only works right in Firefox and Chrome. If you want to download Webtronics please use Subversion to get the latest version. You can use it here at Google any time you want. Another problem with this approach to schematics is that few sites currently support SVG. I am hoping SVG will rise in popularity soon. If you would like to contribute, you can do so by opening issues for bugs, helping me solve open issues or just suggesting improvements.

latest changes

Working on the webapp version.The file format has changed again.Probably going to add it to the repository later.I may only release the javascript.

Try it now

Security strategy

Here is the solution I have come up with so far.Not sure how well it would work.If there are any white hat hackers out there pelase let me know what you think. SVG has a lot of vulnerabilities. I'm going to add this to the javascript even though it offers little protection.I would implement the same filters on the server in php. It would probably be easy to bypass the javascript.

I want to use a whitelist for elements a whitelist for attributes and a blacklist for attribute values.here is the javascript i'm going to use.

Vlist:/\s*expression|\s*url|.*script/,
Alist:/^(x|y|x1|y1|x2|y2|cx|cy|r|width|height|transform|d|id|class|fill|stroke|visibility|stroke-width|xmlns|xmlns:wtx|connects|partvalue|flippable|font-size|font-weight|font-style|font-family)$/,
		Elist:/^(path|circle|rect|line|text|g|tspan|svg|spicemodel)$/,


		sanitize:function(xmldoc){
			var elems=xmldoc.getElementsByTagName('*');
			for(var i=0;i<elems.length;i++){
				if(!elems[i].tagName.match(this.Elist))return elems[i].tagName;
				var attr=elems[i].attributes;
				for(var j=0;j<attr.length;j++){
					if(!attr[j].name.match(this.Alist))return attr[j].name;
					if(attr[j].value.match(this.Vlist))return attr[j].value;
				} 
			}
		},

If you have any schematics saved that you would like to reedit they will no longer open because of this filter You will have to redraw them.

Powered by Google Project Hosting