mozilla/talkilla — pull request #244 by tOkeshu (2013-09-27 12:29:47+00:00)
Title: Dummy worker migration

This PR migrate the current code "specific" to the Talkilla SPA to a "dummy worker".
The dummy worker simulate a sub `WebWorker` by offering a `postMessage` interface.
The goal here is to prepare the migration to a real `WebWorker` as it would makes it farily trivial to move the code to a dedicated file.

The code is now organized the following way:

- `/static/js/spa` should contain everything SPA related
- `/static/js/spa/server.js` is the old `/static/js/worker/server.js` moved to the spa directory
- `/static/js/spa/port.js` is a small abstraction on top of `WebWorker`'s ports
- `/static/js/spa/talkilla_spa.js` is the glue managing the communication between the frame worker and the sub worker. This code is specific to the talkilla spa and is thus intended to be used inside the corresponding subworker
- `/static/js/spa/spa.js` is a generic interface to abstract communicationsbetween the frame worker and spa subworkers. As it's a generic interface its intent is to be used in the frame worker (one instance per spa to communicate with)
- `/static/js/spa/dummy_worker.js` is mock of a `WebWorker`.