Skip to content
This repository was archived by the owner on Jun 14, 2018. It is now read-only.

Commit e377b5f

Browse files
committed
Hopefully fixed all remaining layout issues with the readme now...
1 parent 2855aad commit e377b5f

File tree

1 file changed

+77
-72
lines changed

1 file changed

+77
-72
lines changed

README.md

+77-72
Original file line numberDiff line numberDiff line change
@@ -142,163 +142,168 @@ jQuery.mvc.model
142142
----------------
143143

144144
The model singleton assumes the following responsibilities:
145-
- Maintaining a cache of data proxy instances.
146-
- Providing methods for registering, unregistering and retrieving data proxies.
147-
- Notifiying data proxies when they are registered or removed.
145+
146+
* Maintaining a cache of data proxy instances.
147+
* Providing methods for registering, unregistering and retrieving data proxies.
148+
* Notifiying data proxies when they are registered or removed.
148149

149150
### jQuery.mvc.model.register( [name], proxy, options, [data] )
150151

151152
Creates and registers a new named instance of a particular proxy class with the model. If no name is given, one will automatically be generated. The proxy can be configured using a hash of key-value options and may optionally be given an initial data object to act upon.
152153

153-
// creating a manually named instance
154-
proxy = jQuery.mvc.model.register( "instanceName", ProxyClass, { key: "value" });
155-
156-
// creating an automatically named instance
157-
proxy = jQuery.mvc.model.register( ProxyClass, { key: "value" });
158-
159-
// creating a manually named instance with initial data object
160-
proxy = jQuery.mvc.model.register( "instanceName", ProxyClass, { key: "value" }, { foo: 1, bar: "2" })
154+
// creating a manually named instance
155+
proxy = jQuery.mvc.model.register( "instanceName", ProxyClass, { key: "value" });
156+
157+
// creating an automatically named instance
158+
proxy = jQuery.mvc.model.register( ProxyClass, { key: "value" });
159+
160+
// creating a manually named instance with initial data object
161+
proxy = jQuery.mvc.model.register( "instanceName", ProxyClass, { key: "value" }, { foo: 1, bar: "2" })
161162

162163
### jQuery.mvc.model.remove( {name|proxy} )
163164

164165
Removes a proxy instance previously registered with the model.
165166

166-
// assuming a proxy named "instanceName"
167-
jQuery.mvc.model.remove( "instanceName" );
167+
// assuming a proxy named "instanceName"
168+
jQuery.mvc.model.remove( "instanceName" );
168169

169-
// assuming 'proxy' refers to a registered proxy instance
170-
jQuery.mvc.model.remove( proxy );
170+
// assuming 'proxy' refers to a registered proxy instance
171+
jQuery.mvc.model.remove( proxy );
171172

172173
### jQuery.mvc.model.has( name )
173174

174175
Checks if a proxy has been registered with the model under the given name.
175176

176-
// assuming a proxy named "instanceName" is registered
177-
jQuery.mvc.model.has( "instanceName" ); // true
177+
// assuming a proxy named "instanceName" is registered
178+
jQuery.mvc.model.has( "instanceName" ); // true
178179

179-
// assuming a proxy named "instanceName" is not registered
180-
jQuery.mvc.model.has( "instanceName" ); // false
180+
// assuming a proxy named "instanceName" is not registered
181+
jQuery.mvc.model.has( "instanceName" ); // false
181182

182183
### jQuery.mvc.model.get( name )
183184

184185
Retrieves an existing instance of a proxy from the model, if one exists.
185186

186-
// assuming a registered proxy named "instanceName"
187-
proxy = jQuery.mvc.model.get( "instanceName" ); // the proxy instance
187+
// assuming a registered proxy named "instanceName"
188+
proxy = jQuery.mvc.model.get( "instanceName" ); // the proxy instance
188189

189-
// assuming a proxy named "instanceName" is not registered
190-
proxy = jQuery.mvc.model.get( "instanceName" ); // null
190+
// assuming a proxy named "instanceName" is not registered
191+
proxy = jQuery.mvc.model.get( "instanceName" ); // null
191192

192193
193194
jQuery.mvc.view
194195
---------------
195196

196197
The view singleton assumes the following responsibilities:
197-
- Maintaining a cache of view mediator instances.
198-
- Providing methods for registering, unregistering or retrieving view mediators.
199-
- Notifiying view mediators when they are registered or unregistered.
198+
199+
* Maintaining a cache of view mediator instances.
200+
* Providing methods for registering, unregistering or retrieving view mediators.
201+
* Notifiying view mediators when they are registered or unregistered.
200202

201203
### jQuery.mvc.view.register( [name], mediator, options, [element] )
202204

203205
Creates and registers a new named instance of a particular mediator class with the view. If no name is given, one will automatically be generated. The mediator can be configured using a hash of key-value options. Generally, the mediator should be given a DOM element to act upon. However, for those cases where a mediator has no ties to the DOM the element parameter is made optional. You may pass a string-based selector, a DOM element or a jQuery selector object.
204206

205-
// creating a manually named instance
206-
mediator = jQuery.mvc.view.register( "instanceName", MediatorClass, { key: "value" }, "body" );
207+
// creating a manually named instance
208+
mediator = jQuery.mvc.view.register( "instanceName", MediatorClass, { key: "value" }, "body" );
207209

208-
// passing a DOM element
209-
mediator = jQuery.mvc.view.register( "instanceName", MediatorClass, { key: "value" }, document.body );
210-
211-
// passing a jQuery selector object
212-
mediator = jQuery.mvc.view.register( "instanceName", MediatorClass, { key: "value" }, $( "body" ));
213-
214-
// creating an automatically named instance
215-
mediator = jQuery.mvc.view.register( MediatorClass, { key: "value" }, "body" );
210+
// passing a DOM element
211+
mediator = jQuery.mvc.view.register( "instanceName", MediatorClass, { key: "value" }, document.body );
212+
213+
// passing a jQuery selector object
214+
mediator = jQuery.mvc.view.register( "instanceName", MediatorClass, { key: "value" }, $( "body" ));
215+
216+
// creating an automatically named instance
217+
mediator = jQuery.mvc.view.register( MediatorClass, { key: "value" }, "body" );
216218
217219
### jQuery.mvc.view.remove( {name|mediator} )
218220

219221
Removes a mediator instance previously registered with the view.
220222

221-
// assuming a mediator named "instanceName" is registered
222-
jQuery.mvc.view.remove( "instanceName" );
223+
// assuming a mediator named "instanceName" is registered
224+
jQuery.mvc.view.remove( "instanceName" );
223225

224-
// assuming 'mediator' refers to a registered mediator instance
225-
jQuery.mvc.view.remove( mediator );
226+
// assuming 'mediator' refers to a registered mediator instance
227+
jQuery.mvc.view.remove( mediator );
226228

227229
### jQuery.mvc.view.has( name )
228230

229231
Checks if a mediator has been registered with the view under the given name.
230232

231-
// assuming a mediator named "instanceName" is registered
232-
jQuery.mvc.view.has( "instanceName" ); // true
233+
// assuming a mediator named "instanceName" is registered
234+
jQuery.mvc.view.has( "instanceName" ); // true
233235

234-
// assuming a mediator named "instanceName" is not registered
235-
jQuery.mvc.view.has( "instanceName" ); // false
236+
// assuming a mediator named "instanceName" is not registered
237+
jQuery.mvc.view.has( "instanceName" ); // false
236238

237239
### jQuery.mvc.view.get( name )
238240

239241
Retrieves an existing instance of a mediator from the view, if one exists.
240242

241-
// assuming a registered mediator named "instanceName"
242-
mediator = jQuery.mvc.view.get( "instanceName" ); // the mediator instance
243+
// assuming a registered mediator named "instanceName"
244+
mediator = jQuery.mvc.view.get( "instanceName" ); // the mediator instance
243245

244-
// assuming a mediator named "instanceName" is not registered
245-
mediator = jQuery.mvc.view.get( "instanceName" ); // null
246-
247-
248-
246+
// assuming a mediator named "instanceName" is not registered
247+
mediator = jQuery.mvc.view.get( "instanceName" ); // null
248+
249+
250+
249251
jQuery.mvc.controller
250252
---------------------
251253

252254
The controller singleton assumes these responsibilities:
253-
- Maintaining a cache of constructor functions for commands intended to handle notifications.
254-
- Registering itself as an observer for each notification that it receives a command mapping for.
255-
- Creating and executing instances of the proper command to handle an observed notification.
256255

256+
* Maintaining a cache of constructor functions for commands intended to handle notifications.
257+
* Registering itself as an observer for each notification that it receives a command mapping for.
258+
* Creating and executing instances of the proper command to handle an observed notification.
257259

258260
### jQuery.mvc.controller.register( notificationName, command, options )
259261

260262
Registers a command class with the controller. Individual instances of the command will be created and executed for each observed notification of the given name. Created instances can be configured using a hash of key-value options.
261263

262-
// registering a command for a notification
263-
jQuery.mvc.controller.register( "notificationName", CommandClass, { key: "value" });
264+
// registering a command for a notification
265+
jQuery.mvc.controller.register( "notificationName", CommandClass, { key: "value" });
264266
265267
### jQuery.mvc.controller.remove( notificationName )
266268

267269
Removes a command registered for a particular notifcation from the controller.
268270

269-
// assuming a notification named "notificationName" has a command registered
270-
jQuery.mvc.controller.remove( "notificationName" );
271+
// assuming a notification named "notificationName" has a command registered
272+
jQuery.mvc.controller.remove( "notificationName" );
271273
272274
### jQuery.mvc.controller.has( notificationName )
273275

274276
Checks if a notification has a command registered with the controller.
275277

276-
// assuming a notification named "notificationName" has a command registered
277-
jQuery.mvc.controller.has( "notificationName" ); // true
278+
// assuming a notification named "notificationName" has a command registered
279+
jQuery.mvc.controller.has( "notificationName" ); // true
278280

279-
// assuming a notification named "notificationName" has no command registered
280-
jQuery.mvc.controller.has( "notificationName" ); // false
281+
// assuming a notification named "notificationName" has no command registered
282+
jQuery.mvc.controller.has( "notificationName" ); // false
281283

282284
### jQuery.mvc.controller.get( notificationName )
283285

284286
Retrieves a registered command's constructor function from the controller, if one exists.
285287

286-
// assuming a notification named "notificationName" has a command registered
287-
Command = jQuery.mvc.controller.get( "notificationName" ); // the command's constructor function
288+
// assuming a notification named "notificationName" has a command registered
289+
Command = jQuery.mvc.controller.get( "notificationName" ); // the command's constructor function
290+
291+
// assuming a notification named "notificationName" has no command registered
292+
Command = jQuery.mvc.controller.get( "notificationName" ); // null
293+
294+
288295

289-
// assuming a notification named "notificationName" has no command registered
290-
Command = jQuery.mvc.controller.get( "notificationName" ); // null
291-
292-
293296
jQuery.mvc.notifier
294297
-------------------
295298

296299
The notifier assumes these responsibilities:
297-
- Managing the observer lists for each notification in the application.
298-
- Providing a method for attaching observers to a notification's observer list.
299-
- Providing a method for broadcasting a notification.
300-
- Notifying observers of a given notification when it is broadcast.
301300

301+
* Managing the observer lists for each notification in the application.
302+
* Providing a method for attaching observers to a notification's observer list.
303+
* Providing a method for broadcasting a notification.
304+
* Notifying observers of a given notification when it is broadcast.
305+
306+
*IMPORTANT*
302307
The notifier should not be used directly by the programmer, unless performing such activities as unit testing.
303308

304309
### jQuery.mvc.notifier.register( "notificationName", observer )

0 commit comments

Comments
 (0)