mdn / samples-server

MDN samples server; used for samples that can't be hosted in-place on MDN, plus back-end server-side code for samples that need it.
https://developer.mozilla.org/
Creative Commons Zero v1.0 Universal
957 stars 930 forks source link

Structural cleanup #14

Closed a2sheppy closed 8 years ago

a2sheppy commented 8 years ago

Lots of improvements to code style. Also removed some stuff that’s not needed and generally improved awesomeness.

Renamed some things to have more descriptive names (including element IDs, messages, and variables).

Instead of calling console.error directly, now calls a new log_error() function, which timestamps the same as the log() function.

Added code to automatically use wss:// instead of ws:// if the HTML is loaded over HTTPS.

Took out the “video-close” message and its handler, since it wasn’t being used anymore.

Moved most longish switch/case code out into functions to improve readability when embedding pieces of code into articles.

Removed some unneeded logging.