diff --git a/index.html b/index.html index 141bbbdd..4889362c 100644 --- a/index.html +++ b/index.html @@ -213,6 +213,9 @@
+ As a quick example to help get an idea of how Backbone can be used in a + real-world project, here are the method signatures (beyond the built-in + methods that Backbone provides) of the Document + model, and the DocumentSet collection, as used in + DocumentCloud. In the workspace, + these classes work together with many others: Project, Note, + Account, Entity, Organization... +
+ +
+dc.model.Document = Backbone.Model.extend({
+
+ initialize(attributes): ...
+
+ canonicalId: ...
+
+ url: ...
+ viewerUrl: ...
+ publishedUrl: ...
+ pageThumbnailURL(page): ...
+
+ openViewer: ...
+ openPublishedViewer: ...
+ openText: ...
+ openPDF: ...
+
+ allowedToEdit: ...
+ checkAllowedToEdit(errorMessage): ...
+ checkBusy: ...
+
+ uniquePageEntities: ...
+
+ isPending: ...
+ isPublic: ...
+ isPublished: ...
+
+ toString: ...
+
+});
+
+
+dc.model.DocumentSet = Backbone.Collection.extend({
+
+ model: dc.model.Document,
+
+ url: '/documents',
+
+ initialize(options): ...
+
+ comparator(document): ...
+
+ selectAll: ...
+ deselectAll: ...
+ selectedIds: ...
+
+ filterPending: ...
+ filterSelected: ...
+
+ getCommonAttribute(documents, attribute): ...
+
+ allowedToEdit(documents, errorMessage): ...
+ editAccess(documents): ...
+
+ downloadSelectedViewers: ...
+ downloadSelectedPDFs: ...
+ downloadSelectedTexts: ...
+
+ poll: ...
+ startPolling: ...
+ stopPolling: ...
+
+ verifyDestroy(documents): ...
+
});