[Pkg-javascript-commits] [backbone] 02/74: Adding an Examples section to the homepage. Weak at the moment. More to come.
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 16:59:03 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.3.0
in repository backbone.
commit 013e45cfeab5613b45a035dbea0aac85e248dc82
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date: Thu Oct 21 09:44:27 2010 -0400
Adding an Examples section to the homepage. Weak at the moment. More to come.
---
index.html | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
diff --git a/index.html b/index.html
index 141bbbd..4889362 100644
--- a/index.html
+++ b/index.html
@@ -213,6 +213,9 @@
<li>– <a href="#View-make">make</a></li>
<li>– <a href="#View-handleEvents">handleEvents</a></li>
</ul>
+ <a class="toc_title" href="#examples">
+ Examples
+ </a>
<a class="toc_title" href="#changelog">
Change Log
</a>
@@ -1431,6 +1434,85 @@ var DocumentView = Backbone.View.extend({
});
</pre>
+ <h2 id="examples">Examples</h2>
+
+ <p>
+ 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 <b>Document</b>
+ model, and the <b>DocumentSet</b> collection, as used in
+ <a href="http://www.documentcloud.org">DocumentCloud</a>. In the workspace,
+ these classes work together with many others: <b>Project</b>, <b>Note</b>,
+ <b>Account</b>, <b>Entity</b>, <b>Organization</b>...
+ </p>
+
+<pre>
+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): ...
+
+});
+</pre>
+
<h2 id="changelog">Change Log</h2>
<p>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list