Hello.
I am not writing anything with dojo myself, but I have a related question anyway )
I am writing some scripts for a program which is browsing some pages with dojo drag and drop on them. This program which I use divides the page into html elements and plays a sequence of events on those. For example, for the drag and drop I access source and target (DIVs in the example html), and (if I understand that correcty) play some events on those - something like onmousedown on source, ondrag on source, onmouseover on target and finally ondrop on source - which dojo "uses" to implement its own drag and drop. But I could not find the right order for those events anywhere. It seems there should be something else in between in the sequence I wrote as an example.
Could someone explain me, which events should I play on the html elements of the page so that dojo would "do" a proper drag and drop?

My understanding of the
My understanding of the problem is that you should emulate a human user. I have no idea about ondrag and ondrop events, but I think you should do onmousedown on your DnD item (which is a part of a DnD source), onmousemove it to the target, and onmousedrop it, when over the right spot. For an added realism you can onkeydown the control key to copy an item instead of moving it, or even onkeydown the escape key to cancel the move/copy operation. Basically think of yourself as a user, think what user input controls are at your disposal (mouse? keyboard?) and emulate them.
I would like to simulate a
I would like to simulate a very simple DnD sequence first.
I am not quite sure how should I play the "onmousemove it TO the target" part. I am not actually moving the mouse pointer, I am just playing events on html elements. Should I play the "onmousemove" ON the target? Or on DnD source?
Imo, when the user drags and drops the 3 essential steps are:
1) ondragstart on source item (start dragging)
2) onmouseover on target (move to target)
3) ondrop on source item (drop)
Everything else is really just for the "looks". But it seems that as it is done in dojo, some of the events which I think are unimportant are actually needed since dojo uses those for its internal mechanics.
What events are required for dojo DnD to register proprly?
Yes, you can play
Yes, you can play onmousemove on the document producing coordinates that simulate the move to the target. I think just one onmousemove over the target will be enough. And don't forget to issue onmouseout for the source, and onmouseover for the target.
Regarding your numbered sequence (the original numbering is preserved):
Still, why do you want to simulate mouse events for DnD?
I am preparing some scripts
I am preparing some scripts to test the functionality of some pages with dojo drag and drop implemented. Those scripts are played so that they emulate the behavior of the user. I.e. they don't call any javascript directly etc, they play the events on the html elements in the browser window, simulating the user working with "point and click" interface.
Anyway, it seems that it is not dojo, but the program that is playing the scripts is to blame. For some reason, it finds nothing attached to the onmousedown event of the DnD item, while there is - if I am not mistaken - some javascript played on mouse down which "transfers" the onmousedown even to its container.
There are no events attached
There are no events attached to DnD items — doing so will overload browser's event processing rather quickly if we have hundreds or thousands of DnD items. The event handling code is attached once per source, which learns what items were affected.
Then, if the events are
Then, if the events are attached to the DnD source container, how does it "know" which item should be dragged? Could I maybe set some attribute of the container and play its onmousedown to start dragging some item from it?
It is a fair question to ask
It is a fair question to ask and it is very easy to answer for me: look at the code (Dojo is an open source project after all) to see how it is done. The code is more concise than any explanation of how it is done.
I am no expert in
I am no expert in JavaScript, and reading and understanding the code, while certainly educational, would be somewhat problematic and extremely time consuming. I would really appreciate it, if you could just provide a list of events and elements we were talking about :)
Hmm. I think we are going in
Hmm. I think we are going in circles. From my previous reply: "Only onmousedown/onmousemove/onmouseup are used by the Manager. Additionally individual sources/targets process onmouseover/onmouseout to detect their own state, and report it to the Manager, so the Manager knows where we drop when onmouseup was caught." This list includes all important events and elements.
rearding timer
How to delay a function's execution and repeat the function periodically