My re-write of the Stageplan app is going well, despite the fact that I have little time to do it. So I'm posting a demo here. It uses Raphael 0.71. I had some difficulties with this, but have solved them, albeit somewhat inelegantly.
Click on an item and drag it onto the "stage" area. When you do, a slider control appears. It allows you to rotate the object. When multiple objects are on the stage, clicking on any one of them selects the item shows its slider control. When you click on the stage, a selected item is deselected and its slider disappears.
I've added an "amplifier" object. I should also add a DI box and a keyboard as these are regularly specified by students in their stageplans. Other items, such as the drumkit and piano, tend to be static (as they are difficult to move). The latter can probably be added to the stage as partly opaque objects.
Here's the demo.
The next step is to figure out how to save objects on the server so that stageplans can be recalled, viewed and edited. Bolt on an authentication system and it'll be done!
I've come across a script called JSONstringify which includes functions for converting Javascript data structures to a text string and back again. It's written by Thomas Frank based on the work of others. This is perfect for saving all stage objects and their essential coordinates.
I'll work this into a means of saving stageplans using an AJAX request. It should be possible to wrap the basic objects retrieved in an Item class and restore them when a stage plan is loaded for viewing or editing.
A number of people have told me that this does not work on IE. Debugging in plain-vanilla IE is a real pain because it gives the error and a line number but not the name of the script where the error occurred (very helpful...not!).
The error in this demo might be down to one line in the script which does not terminate with a ';' character. Firefox is OK with that but IE is not and aborts the script as a result.
Previous demos did not work and the sparse debugging info suggests it's an issue with Raphael-0.5.4a that I was using at the time. With luck I'll get these issues sorted, but since IE is a buggy piece of shit I'm not really inclined to that much!