[Pkg-javascript-commits] [backbone] 29/34: 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:58:54 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.2.0
in repository backbone.

commit 869861df9d1daf5eb16a23c988e4189451dc6445
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 8bf965a..5dae9f4 100644
--- a/index.html
+++ b/index.html
@@ -214,6 +214,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>
@@ -1460,6 +1463,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