Skip to content

Commit

Permalink
Merge pull request quirkey#111 from lukas-vlcek/master
Browse files Browse the repository at this point in the history
Fixing several typos in the documentation
  • Loading branch information
quirkey committed Oct 2, 2011
2 parents 4dcd483 + bd9d3fc commit fa8f070
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions lib/sammy.js
Expand Up @@ -44,7 +44,7 @@
// // returns the app at #main or a new app
// Sammy('#main')
//
// // equivilent to "new Sammy.Application", except appends to apps
// // equivalent to "new Sammy.Application", except appends to apps
// Sammy();
// Sammy(function() { ... });
//
Expand All @@ -65,7 +65,7 @@
app.use(plugin);
});
}
// if the selector changes make sure the refrence in Sammy.apps changes
// if the selector changes make sure the reference in Sammy.apps changes
if (app.element_selector != selector) {
delete Sammy.apps[selector];
}
Expand Down Expand Up @@ -383,7 +383,7 @@
// When set to true, logs all of the default events using `log()`
debug: false,

// When set to true, and the error() handler is not overriden, will actually
// When set to true, and the error() handler is not overridden, will actually
// raise JS errors in routes (500) and when routes can't be found (404)
raise_errors: false,

Expand All @@ -398,7 +398,7 @@
// `EventContext`. `template_engine` can either be a string that
// corresponds to the name of a method/helper on EventContext or it can be a function
// that takes two arguments, the content of the unrendered partial and an optional
// JS object that contains interpolation data. Template engine is only called/refered
// JS object that contains interpolation data. Template engine is only called/referred
// to if the extension of the partial is null or unknown. See `partial()`
// for more information
template_engine: null,
Expand Down Expand Up @@ -447,7 +447,7 @@
// });
//
// If plugin is passed as a string it assumes your are trying to load
// Sammy."Plugin". This is the prefered way of loading core Sammy plugins
// Sammy."Plugin". This is the preferred way of loading core Sammy plugins
// as it allows for better error-messaging.
//
// ### Example
Expand Down Expand Up @@ -521,7 +521,7 @@
// the first argument is the path, the second is the callback and the verb
// is assumed to be 'any'.
// * `path` A Regexp or a String representing the path to match to invoke this verb.
// * `callback` A Function that is called/evaluated whent the route is run see: `runRoute()`.
// * `callback` A Function that is called/evaluated when the route is run see: `runRoute()`.
// It is also possible to pass a string as the callback, which is looked up as the name
// of a method on the application.
//
Expand Down Expand Up @@ -622,7 +622,7 @@
return ['sammy-app', this.namespace].join('-');
},

// Works just like `jQuery.fn.bind()` with a couple noteable differences.
// Works just like `jQuery.fn.bind()` with a couple notable differences.
//
// * It binds all events to the application element
// * All events are bound within the `eventNamespace()`
Expand Down Expand Up @@ -735,7 +735,7 @@
// that take a single argument `callback` which is the entire route
// execution path wrapped up in a closure. This means you can decide whether
// or not to proceed with execution by not invoking `callback` or,
// more usefuly wrapping callback inside the result of an asynchronous execution.
// more usefully wrapping callback inside the result of an asynchronous execution.
//
// ### Example
//
Expand Down Expand Up @@ -899,7 +899,7 @@
},

// The opposite of `run()`, un-binds all event listeners and intervals
// `run()` Automaticaly binds a `onunload` event to run this when
// `run()` Automatically binds a `onunload` event to run this when
// the document is closed.
unload: function() {
if (!this.isRunning()) { return false; }
Expand Down Expand Up @@ -966,7 +966,7 @@
// possible URL params and then invokes the route's callback within a new
// `Sammy.EventContext`. If the route can not be found, it calls
// `notFound()`. If `raise_errors` is set to `true` and
// the `error()` has not been overriden, it will throw an actual JS
// the `error()` has not been overridden, it will throw an actual JS
// error.
//
// You probably will never have to call this directly.
Expand Down Expand Up @@ -1073,7 +1073,7 @@
// // match against a path string
// app.contextMatchesOptions(context, '#/mypath'); //=> true
// app.contextMatchesOptions(context, '#/otherpath'); //=> false
// // equivilent to
// // equivalent to
// app.contextMatchesOptions(context, {only: {path:'#/mypath'}}); //=> true
// app.contextMatchesOptions(context, {only: {path:'#/otherpath'}}); //=> false
// // match against a path regexp
Expand Down Expand Up @@ -1109,7 +1109,7 @@
}
var path_matched = true, verb_matched = true;
if (options.path) {
// wierd regexp test
// weird regexp test
if (!_isFunction(options.path.test)) {
options.path = new RegExp(options.path.toString() + '$');
}
Expand Down Expand Up @@ -1168,7 +1168,7 @@

// a simple global cache for templates. Uses the same semantics as
// `Sammy.Cache` and `Sammy.Storage` so can easily be replaced with
// a persistant storage that lasts beyond the current request.
// a persistent storage that lasts beyond the current request.
templateCache: function(key, value) {
if (typeof value != 'undefined') {
return _template_cache[key] = value;
Expand All @@ -1182,7 +1182,7 @@
return _template_cache = {};
},

// This thows a '404 Not Found' error by invoking `error()`.
// This throws a '404 Not Found' error by invoking `error()`.
// Override this method or `error()` to provide custom
// 404 behavior (i.e redirecting to / or showing a warning)
notFound: function(verb, path) {
Expand Down Expand Up @@ -1314,11 +1314,11 @@
});

// `Sammy.RenderContext` is an object that makes sequential template loading,
// rendering and interpolation seamless even when dealing with asyncronous
// rendering and interpolation seamless even when dealing with asynchronous
// operations.
//
// `RenderContext` objects are not usually created directly, rather they are
// instatiated from an `Sammy.EventContext` by using `render()`, `load()` or
// instantiated from an `Sammy.EventContext` by using `render()`, `load()` or
// `partial()` which all return `RenderContext` objects.
//
// `RenderContext` methods always returns a modified `RenderContext`
Expand All @@ -1327,7 +1327,7 @@
// The core magic is in the `then()` method which puts the callback passed as
// an argument into a queue to be executed once the previous callback is complete.
// All the methods of `RenderContext` are wrapped in `then()` which allows you
// to queue up methods by chaining, but maintaing a guarunteed execution order
// to queue up methods by chaining, but maintaining a guaranteed execution order
// even with remote calls to fetch templates.
//
Sammy.RenderContext = function(event_context) {
Expand All @@ -1348,9 +1348,9 @@
// is executed immediately.
//
// The value returned from the callback is stored in `content` for the
// subsiquent operation. If you return `false`, the queue will pause, and
// subsequent operation. If you return `false`, the queue will pause, and
// the next callback in the queue will not be executed until `next()` is
// called. This allows for the guarunteed order of execution while working
// called. This allows for the guaranteed order of execution while working
// with async operations.
//
// If then() is passed a string instead of a function, the string is looked
Expand Down Expand Up @@ -1438,7 +1438,7 @@
},

// Load a template into the context.
// The `location` can either be a string specifiying the remote path to the
// The `location` can either be a string specifying the remote path to the
// file, a jQuery object, or a DOM element.
//
// No interpolation happens by default, the content is stored in
Expand Down Expand Up @@ -1553,7 +1553,7 @@
}
},

// `render()` the the `location` with `data` and then `swap()` the
// `render()` the `location` with `data` and then `swap()` the
// app's `$element` with the rendered content.
partial: function(location, data) {
return this.render(location, data).swap();
Expand Down Expand Up @@ -1588,7 +1588,7 @@
});
},

// itterates over an array, applying the callback for each item item. the
// iterates over an array, applying the callback for each item item. the
// callback takes the same style of arguments as `jQuery.each()` (index, item).
// The return value of each callback is collected as a single string and stored
// as `content` to be used in the next iteration of the `RenderContext`.
Expand Down Expand Up @@ -1692,7 +1692,7 @@
},

// trigger the event in the order of the event context. Same semantics
// as `Sammy.EventContext#trigger()`. If data is ommitted, `content`
// as `Sammy.EventContext#trigger()`. If data is omitted, `content`
// is sent as `{content: content}`
trigger: function(name, data) {
return this.then(function(content) {
Expand Down Expand Up @@ -1752,10 +1752,10 @@
// Look up a templating engine within the current app and context.
// `engine` can be one of the following:
//
// * a function: should conform to `function(content, data) { return interploated; }`
// * a function: should conform to `function(content, data) { return interpolated; }`
// * a template path: 'template.ejs', looks up the extension to match to
// the `ejs()` helper
// * a string referering to the helper: "mustache" => `mustache()`
// * a string referring to the helper: "mustache" => `mustache()`
//
// If no engine is found, use the app's default `template_engine`
//
Expand Down Expand Up @@ -1825,7 +1825,7 @@
return new Sammy.RenderContext(this).load(location, options, callback);
},

// `render()` the the `location` with `data` and then `swap()` the
// `render()` the `location` with `data` and then `swap()` the
// app's `$element` with the rendered content.
partial: function(location, data) {
return new Sammy.RenderContext(this).partial(location, data);
Expand All @@ -1845,7 +1845,7 @@
// ### Example
//
// redirect('#/other/route');
// // equivilent to
// // equivalent to
// redirect('#', 'other', 'route');
//
redirect: function() {
Expand Down

0 comments on commit fa8f070

Please sign in to comment.