TogetherJS Source Code

analytics

A small bit of code for handling Google Analytics

channels

An abstraction over WebSockets and other communication channels (like postMessage).

chat

Handles the chat messages (except actual display, which is in ui.js).

console

An console replacement that collects messages and allows TogetherJS-specific log levels

cursor

Handles the shared cursors, display and capturing the events. Also handles clicks and scrolls. Includes UI.

elementFinder

Generates something like a CSS selector for an element, and finds said elements based on selectors. A portable description of an element.

eventMaker

Creates artificial events, like a fake click event.

forms

Handles synchronization of forms, including CodeMirror and ACE support. Implements a portion of OT.

jqueryPlugins

Some plugins for jQuery; doesn't export anything, just patches $.

linkify

Detects and adds links to plain text.

ot

Operational transformation support: what keeps big chunks of text in sync when multiple people are simultaneously editing those fields.

peers

Handles the objects representing the peers and oneself.

playback

Handles the magic /playback command that plays recordings.

randomutil

Some functions/methods for random numbers, really just for testing support.

recorder

Used by recorder.html, which is a kind of alternate mini-client used to record sessions when you put /record in the chat box.

session

The most important and most core module in the system. This sets up the channels, routes messages, tracks peers, and is used for inter-module communication using events.

startup

Handles the logic of what to display when TogetherJS is first started up (including warning messages, introductory stuff, the share link, confirmation of joining the session).

storage

An abstraction (over localStorage) of per-tab and client storage.

templates

This is generated from interface.html and other sources, including the content as inline strings.

templating

Handles creating new nodes based on DOM templates. Does some substitution based on specific class names.

togetherjs

This is the bootstrap code. It is included on all pages, defines the TogetherJS variable, and handles configuration and initial loading.

ui

This has most of the UI, meaning everything involving HTML, and reacting to that interface.

util

Lots of support code in here. It doesn't depend on other things, and has fairly abstract general-purpose code. It includes a pattern for creating classes, assertions, events.

videos
visibilityApi

Handles cross-browser tab visibility events

walkthrough

Implements the walkthrough interface (content is in walkthrough.html).

webrtc

Handles live audio chat.

who

Lets clients peek into rooms and invite people from those rooms without joining the room

windowing

Handles the creation of different windows, notifications, and modal windows.

youtubeVideos

Support for the YouTube video sync feature