Hey

Ive been given a JavaScript program (with embedded in a HTML) with several (from what Ive seen) free libraries. For example:

excanvas.js
jquery-1.6.4.min.js
prototype.js
colorpicker.js

This JavaScript program (using those and other free libraries) to draw something like this:
[img]http://img339.imageshack.us/img339/3997/dibujoajyu.jpg[/img]

As you see the dots, beside having a X and Y, have a certain order and also the last point closes with the first point.

Looking thru the code (with no comments) I cant find exactly where the points are stored so I can retreive them when I press a submit button and send them to a DB. What should I look for (besides X and Y)? What I mean is what the programmer problably did: Store in a array, make a class for each point, etc.

I cannot post the code as it is my company's and the other's so I dont know what legal inplications it may have.

Thank you very much

Recommended Answers

All 6 Replies

Member Avatar for stbuchok

Without being able to see the code it will be hard to help. My only suggestion is to store the points you want to remember into hidden text boxes. This way when you submit, those values will be submitted as well.

Without being able to see the code it will be hard to help. My only suggestion is to store the points you want to remember into hidden text boxes. This way when you submit, those values will be submitted as well.

Thanks for the help :)

The drawing type program is already made and the points are stored somewhere so there isnt any hidden text boxes.

Ill post screenshots which I think I wont have problems.

[IMG]http://img5.imageshack.us/img5/204/drawj.jpg[/IMG]

[IMG]http://img804.imageshack.us/img804/3709/debugn.jpg[/IMG]

The first image is the original drawing but in the actual program. The colors are irrelevent but the type, spline or line, is. And so is the order which is the same as the mockup original drawing.

The second image is a debug window he included so we can see the process when I click on the canvas (thats: "[info] - PointManager.js - addPoint 1 X: 143 Y:206 Tipo: spline" which stores the first click I made with the type. The next are the same but saying addPoint 2, addPoint 3, etc etc), make the lines (no debug output), change line type (that is "[info] - PointManager.js - Cambiamos a tipo: line" and "[info] - Polyline.js - Despues el dinamico es: line") , and end the drawing (that is "[info] PolylineDraw.js - Terminamos de dibujar").

Like I said, I cant post any code just in case.

All I do with changes on line types and ending the drawing are with mouse clicks on buttons which do that purpose.

Thanks again for the help.

It know it is difficult without any code but I hope you understand :)

Member Avatar for stbuchok

Honestly, this is too much work to try and help out with. I'd suggest hire someone.

Honestly, this is too much work to try and help out with. I'd suggest hire someone.

I didnt expect that type of answer but oh well. Thanks for at least looking at it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.