Common Names

We describe names we use (or would like to use) and the conventions that produce them. These evolve. Newer conventions are marked ☼.

Globals

$ — jQuery

_ — Underscore

wiki — resources used by plugins.

Locals

page — an object corresponding to the JSON for a wiki page, find original sans editing in $page.data('data'). $page aka pageElement, $('.page') — the jQuery element corresponding to page.

pageObject — a bundling of page, site and utility functions that work with them. ☼

item — an object corresponding to the JSON for a story item, find in $item.data('item'). $item aka div, $('.item') — the jQuery element corresponding to item.

site — specified site or storage, find in $page.data('site') or links from changes.coffee and federatedWiki.coffee.

host — part of a url, constructed by logic from site and location.host. ☼

slug — key identifying page in federation, find in $page.attr('id'). compute from util.asSlug(page.title) or from pageObject.

rev — index of an action in the journal, part of url _rev suffix, find in $('.revision').data('rev')

Hyper Locals

We encourage idiomatic usage of single letter variables within contained and clearly visible scopes.

s — a string, especially when handled as just a string.

e — an event, within an event handler; an exception, within an exception handler.

i, j, k — integer indices (fortran heritage?)

n — integer, often limiting count.

t — time, numeric, of arbitrary origin. Not Time objects.

@ — this, as managed by coffeescript. (questionable).

x, y — coordinates, except when row & col preferred.

m, d, y — month, day, year, when formatting dates.

h, m, s — hours, minutes, seconds, can be doubled to avoid conflict with dates.