Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

imported futon2 as couchapp work

Originally this work was tangled up with the rest
of CouchDB at http://github.com/BigBlueHat/couchdb
I have untangled it for faster iteration.
  • Loading branch information...
commit 71db4320486acbe2a9eabffaffbe1973674524ea 0 parents
@BigBlueHat BigBlueHat authored
Showing with 33,877 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +34 −0 README
  3. +33 −0 _attachments/dialog/_admin_party.html
  4. +31 −0 _attachments/dialog/_change_password.html
  5. +51 −0 _attachments/dialog/_compact_cleanup.html
  6. +50 −0 _attachments/dialog/_create_admin.html
  7. +42 −0 _attachments/dialog/_create_config.html
  8. +50 −0 _attachments/dialog/_database_security.html
  9. +27 −0 _attachments/dialog/_delete_database.html
  10. +26 −0 _attachments/dialog/_delete_document.html
  11. +34 −0 _attachments/dialog/_login.html
  12. +35 −0 _attachments/dialog/_save_view_as.html
  13. +42 −0 _attachments/dialog/_share_test_reports.html
  14. +35 −0 _attachments/dialog/_signup.html
  15. +36 −0 _attachments/dialog/_upload_attachment.html
  16. BIN  _attachments/favicon.ico
  17. BIN  _attachments/favicon.png
  18. BIN  _attachments/image/add.png
  19. BIN  _attachments/image/apply.gif
  20. BIN  _attachments/image/bg.png
  21. BIN  _attachments/image/cancel.gif
  22. BIN  _attachments/image/compact.png
  23. BIN  _attachments/image/delete-mini.png
  24. BIN  _attachments/image/delete.png
  25. BIN  _attachments/image/down.png
  26. BIN  _attachments/image/grippie.gif
  27. BIN  _attachments/image/hgrad.gif
  28. BIN  _attachments/image/key.png
  29. BIN  _attachments/image/load.png
  30. BIN  _attachments/image/logo.png
  31. BIN  _attachments/image/order-asc.gif
  32. BIN  _attachments/image/order-desc.gif
  33. BIN  _attachments/image/path.gif
  34. BIN  _attachments/image/progress.gif
  35. BIN  _attachments/image/rarrow.png
  36. BIN  _attachments/image/run-mini.png
  37. BIN  _attachments/image/run.png
  38. BIN  _attachments/image/running.png
  39. BIN  _attachments/image/save.png
  40. BIN  _attachments/image/sidebar-toggle.png
  41. BIN  _attachments/image/spinner.gif
  42. BIN  _attachments/image/test_failure.gif
  43. BIN  _attachments/image/test_success.gif
  44. BIN  _attachments/image/thead-key.gif
  45. BIN  _attachments/image/thead.gif
  46. BIN  _attachments/image/toggle-collapse.gif
  47. BIN  _attachments/image/toggle-expand.gif
  48. BIN  _attachments/image/twisty.gif
  49. +346 −0 _attachments/index.html
  50. +618 −0 _attachments/old.layout.css
  51. +124 −0 _attachments/script/base64.js
  52. +473 −0 _attachments/script/couch.js
  53. +443 −0 _attachments/script/couch_test_runner.js
  54. +135 −0 _attachments/script/couch_tests.js
  55. +286 −0 _attachments/script/futon-dialogs.js
  56. +849 −0 _attachments/script/futon.js
  57. +81 −0 _attachments/script/jquery-ui-1.8.11.custom.min.js
  58. +668 −0 _attachments/script/jquery.couch.js
  59. +6,240 −0 _attachments/script/jquery.js
  60. +482 −0 _attachments/script/json2.js
  61. +149 −0 _attachments/script/jspec/jspec.css
  62. +72 −0 _attachments/script/jspec/jspec.jquery.js
  63. +1,756 −0 _attachments/script/jspec/jspec.js
  64. +195 −0 _attachments/script/jspec/jspec.xhr.js
  65. +511 −0 _attachments/script/oauth.js
  66. +517 −0 _attachments/script/old-futon.js
  67. +22 −0 _attachments/script/sammy/LICENSE
  68. +115 −0 _attachments/script/sammy/plugins/sammy.cache.js
  69. +78 −0 _attachments/script/sammy/plugins/sammy.data_location_proxy.js
  70. +700 −0 _attachments/script/sammy/plugins/sammy.ejs.js
  71. +274 −0 _attachments/script/sammy/plugins/sammy.form.js
  72. +553 −0 _attachments/script/sammy/plugins/sammy.haml.js
  73. +362 −0 _attachments/script/sammy/plugins/sammy.json.js
  74. +140 −0 _attachments/script/sammy/plugins/sammy.meld.js
  75. +444 −0 _attachments/script/sammy/plugins/sammy.mustache.js
  76. +118 −0 _attachments/script/sammy/plugins/sammy.nested_params.js
  77. +29 −0 _attachments/script/sammy/plugins/sammy.path_location_proxy.js
  78. +757 −0 _attachments/script/sammy/plugins/sammy.pure.js
  79. +577 −0 _attachments/script/sammy/plugins/sammy.storage.js
  80. +117 −0 _attachments/script/sammy/plugins/sammy.template.js
  81. +59 −0 _attachments/script/sammy/plugins/sammy.title.js
  82. +1,671 −0 _attachments/script/sammy/sammy.js
  83. +202 −0 _attachments/script/sha1.js
  84. +95 −0 _attachments/script/test/all_docs.js
  85. +87 −0 _attachments/script/test/attachment_names.js
  86. +153 −0 _attachments/script/test/attachment_paths.js
  87. +134 −0 _attachments/script/test/attachment_ranges.js
  88. +98 −0 _attachments/script/test/attachment_views.js
  89. +275 −0 _attachments/script/test/attachments.js
  90. +282 −0 _attachments/script/test/attachments_multipart.js
  91. +249 −0 _attachments/script/test/auth_cache.js
  92. +250 −0 _attachments/script/test/basics.js
  93. +48 −0 _attachments/script/test/batch_save.js
  94. +100 −0 _attachments/script/test/bulk_docs.js
  95. +465 −0 _attachments/script/test/changes.js
  96. +59 −0 _attachments/script/test/compact.js
  97. +163 −0 _attachments/script/test/config.js
  98. +64 −0 _attachments/script/test/conflicts.js
  99. +39 −0 _attachments/script/test/content_negotiation.js
  100. +256 −0 _attachments/script/test/cookie_auth.js
  101. +51 −0 _attachments/script/test/copy_doc.js
  102. +154 −0 _attachments/script/test/delayed_commits.js
  103. +317 −0 _attachments/script/test/design_docs.js
  104. +74 −0 _attachments/script/test/design_options.js
  105. +72 −0 _attachments/script/test/design_paths.js
  106. +133 −0 _attachments/script/test/erlang_views.js
  107. +78 −0 _attachments/script/test/etags_head.js
  108. +212 −0 _attachments/script/test/etags_views.js
  109. +26 −0 _attachments/script/test/form_submit.js
  110. +54 −0 _attachments/script/test/http.js
  111. +77 −0 _attachments/script/test/invalid_docids.js
  112. +82 −0 _attachments/script/test/jsonp.js
  113. +33 −0 _attachments/script/test/large_docs.js
  114. +450 −0 _attachments/script/test/list_views.js
  115. +103 −0 _attachments/script/test/lorem.txt
  116. +1 −0  _attachments/script/test/lorem_b64.txt
  117. +55 −0 _attachments/script/test/lots_of_docs.js
  118. +40 −0 _attachments/script/test/method_override.js
  119. +80 −0 _attachments/script/test/multiple_rows.js
  120. +267 −0 _attachments/script/test/oauth.js
  121. +130 −0 _attachments/script/test/proxyauth.js
  122. +105 −0 _attachments/script/test/purge.js
  123. +198 −0 _attachments/script/test/reader_acl.js
  124. +80 −0 _attachments/script/test/recreate_doc.js
  125. +170 −0 _attachments/script/test/reduce.js
  126. +179 −0 _attachments/script/test/reduce_builtin.js
  127. +44 −0 _attachments/script/test/reduce_false.js
  128. +37 −0 _attachments/script/test/reduce_false_temp.js
  129. +731 −0 _attachments/script/test/replication.js
  130. +715 −0 _attachments/script/test/replicator_db.js
  131. +99 −0 _attachments/script/test/rev_stemming.js
  132. +443 −0 _attachments/script/test/rewrite.js
  133. +336 −0 _attachments/script/test/security_validation.js
  134. +436 −0 _attachments/script/test/show_documents.js
  135. +330 −0 _attachments/script/test/stats.js
  136. +168 −0 _attachments/script/test/update_documents.js
  137. +103 −0 _attachments/script/test/users_db.js
  138. +41 −0 _attachments/script/test/utf8.js
  139. +120 −0 _attachments/script/test/uuids.js
  140. +116 −0 _attachments/script/test/view_collation.js
  141. +123 −0 _attachments/script/test/view_collation_raw.js
  142. +104 −0 _attachments/script/test/view_compaction.js
  143. +49 −0 _attachments/script/test/view_conflicts.js
  144. +189 −0 _attachments/script/test/view_errors.js
  145. +138 −0 _attachments/script/test/view_include_docs.js
  146. +91 −0 _attachments/script/test/view_multi_key_all_docs.js
  147. +216 −0 _attachments/script/test/view_multi_key_design.js
  148. +37 −0 _attachments/script/test/view_multi_key_temp.js
  149. +108 −0 _attachments/script/test/view_offsets.js
  150. +122 −0 _attachments/script/test/view_pagination.js
  151. +52 −0 _attachments/script/test/view_sandboxing.js
  152. +106 −0 _attachments/script/test/view_update_seq.js
  153. +39 −0 _attachments/script/test/view_xml.js
  154. +107 −0 _attachments/session.html
  155. +401 −0 _attachments/spec/couch_js_class_methods_spec.js
  156. +311 −0 _attachments/spec/couch_js_instance_methods_1_spec.js
  157. +246 −0 _attachments/spec/couch_js_instance_methods_2_spec.js
  158. +215 −0 _attachments/spec/couch_js_instance_methods_3_spec.js
  159. +51 −0 _attachments/spec/custom_helpers.js
  160. +523 −0 _attachments/spec/jquery_couch_js_class_methods_spec.js
  161. +202 −0 _attachments/spec/jquery_couch_js_instance_methods_1_spec.js
Sorry, we could not display the entire diff because it was too big.
1  .gitignore
@@ -0,0 +1 @@
+.couchapprc
34 README
@@ -0,0 +1,34 @@
+Apache CouchDB Futon (_utils) as a CouchApp
+===========================================
+
+Futon 2 is a Sammy-based UI for CouchDB. The hope is that
+it will eventually replace the current Futon in CouchDB.
+
+One of the current limitations to Futon is that hacking on
+it is slowed by the setup time of compiling CouchDB, or
+symlinking Futon 2 into an existing CouchDB repo, or some
+other similar setup.
+
+By providing this CouchApp directory, the hope is that
+anyone with client-side web UI experience can contribute
+to the further development of Futon 2.
+
+Installation
+------------
+
+First you will need to install CouchApp:
+
+ http://couchapp.org/page/installing
+
+Next, create a DB with any name you like ('futon2' seems
+reasonable enough).
+
+Then, within this directory, type:
+
+ couchapp push . http://localhost:5984/futon2
+
+Last, visit your CouchApp Futon 2 at:
+
+ http://localhost:5984/futon2/_design/futon/index.html
+
+Really last, enjoy!
33 _attachments/dialog/_admin_party.html
@@ -0,0 +1,33 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Admin Party!</h2>
+ <fieldset>
+ <p class="help">
+ The test suite requires CouchDB to be in <em>Admin Party</em> mode. This
+ mode give all users admin capabilities. This is the least secure mode of
+ operation. Do not run the tests on production servers, as you'll impact
+ both performance and security.
+ </p>
+ <p class="help">
+ Clicking “Remove Admins” will remove all admins from the configuration. You will
+ have to recreate any admins by hand after the tests have finished.
+ </p>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Remove Admins</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
31 _attachments/dialog/_change_password.html
@@ -0,0 +1,31 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Change Password</h2>
+ <fieldset>
+ <table summary=""><tbody><tr>
+ <th><label>New Password:</label></th>
+ <td><input type="password" name="password" size="24" /></td>
+ </tr><tr>
+ <th><label>Verify New Password:</label></th>
+ <td><input type="password" name="verify_password" size="24" /></td>
+ </tr>
+ </tbody></table>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Login</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
51 _attachments/dialog/_compact_cleanup.html
@@ -0,0 +1,51 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Compact &amp; Cleanup</h2>
+ <fieldset class="radiogroup">
+ <label>
+ <input type="radio" name="action" value="compact_database" checked>
+ Compact Database
+ </label>
+ <p class="help">
+ Compacting a database removes deleted documents and previous revisions.
+ It is an <strong>irreversible operation</strong> and may take
+ a while to complete for large databases.
+ </p>
+ <hr>
+ <label>
+ <input type="radio" name="action" value="compact_views">
+ Compact Views
+ </label>
+ <p class="help">
+ View compaction will affect all views in this design document. This
+ operation may take some time to complete. Your views will still operate
+ normally during compaction.
+ </p>
+ <hr>
+ <label>
+ <input type="radio" name="action" value="view_cleanup">
+ Cleanup Views
+ </label>
+ <p class="help">
+ Cleaning up views in a database removes old view files still stored
+ on the filesystem. It is an <strong>irreversible operation</strong>.
+ </p>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Run</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
50 _attachments/dialog/_create_admin.html
@@ -0,0 +1,50 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Create Server Admin</h2>
+ <fieldset>
+ <p class="help">
+ Before a server admin is configured, all clients have admin privileges.
+ This is fine when HTTP access is restricted
+ to trusted users. <strong>If end-users will be accessing this CouchDB, you must
+ create an admin account to prevent accidental (or malicious) data loss.</strong>
+ </p>
+ <p class="help">Server admins can create and destroy databases, install
+ and update _design documents, run the test suite, and edit all aspects of CouchDB
+ configuration.
+ </p>
+ <table summary=""><tbody><tr>
+ <th><label>Username:</label></th>
+ <td><input type="text" name="name" size="24"></td>
+ </tr><tr>
+ <th><label>Password:</label></th>
+ <td><input type="password" name="password" size="24"></td>
+ </tr>
+ </tbody></table>
+ <p class="help">Non-admin users have read and write access to all databases, which
+ are controlled by validation functions. CouchDB can be configured to block all
+ access to anonymous users.
+ </p>
+ <h3>About Authentication</h3>
+ <p class="help">
+ Couch has a pluggable authentication mechanism. Futon exposes a user friendly cookie-auth which handles login and logout, so app developers can relax. Just use <tt>$.couch.session()</tt> to load the current user's info.
+ </p>
+
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Create</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
42 _attachments/dialog/_create_config.html
@@ -0,0 +1,42 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Create New Config Option</h2>
+ <fieldset>
+ <p class="help">
+ Please enter the section, option, and value.
+ </p>
+ <table summary="">
+ <tbody>
+ <tr>
+ <th><label>section:</label></th>
+ <td><input type="text" name="section" size="24"></td>
+ </tr>
+ <tr>
+ <th><label>option:</label></th>
+ <td><input type="text" name="option" size="24"></td>
+ </tr>
+ <tr>
+ <th><label>value:</label></th>
+ <td><input type="text" name="val" size="24"></td>
+ </tr>
+ </tbody>
+ </table>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Create</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
50 _attachments/dialog/_database_security.html
@@ -0,0 +1,50 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Security</h2>
+ <fieldset>
+ <p class="help">
+ Each database contains lists of admins and readers.
+ Admins and readers are each defined by <tt>names</tt> and <tt>roles</tt>, which are lists of strings.
+ </p>
+
+ <h3>Admins</h3>
+ <p class="help">Database admins can update design documents and edit the readers list.</p>
+ <table summary=""><tbody><tr>
+ <th><label>Names:</label></th>
+ <td><input type="text" name="admin_names" size="40"></td>
+ </tr><tr>
+ <th><label>Roles:</label></th>
+ <td><input type="text" name="admin_roles" size="40"></td>
+ </tr>
+ </tbody></table>
+
+ <h3>Readers</h3>
+ <p class="help">Database readers can access the database. If no readers are defined, the database is public.</p>
+ <table summary=""><tbody><tr>
+ <th><label>Names:</label></th>
+ <td><input type="text" name="reader_names" size="40"></td>
+ </tr><tr>
+ <th><label>Roles:</label></th>
+ <td><input type="text" name="reader_roles" size="40"></td>
+ </tr>
+ </tbody></table>
+
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Update</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
27 _attachments/dialog/_delete_database.html
@@ -0,0 +1,27 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Delete Database</h2>
+ <fieldset>
+ <p class="help">
+ Are you sure you want to delete this database? Note that this is an
+ <strong>irreversible operation</strong>!
+ </p>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Delete</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
26 _attachments/dialog/_delete_document.html
@@ -0,0 +1,26 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Delete Document</h2>
+ <fieldset>
+ <p class="help">
+ Are you sure you want to delete this document?
+ </p>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Delete</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
34 _attachments/dialog/_login.html
@@ -0,0 +1,34 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Login</h2>
+ <fieldset>
+ <p class="help">
+ Login to CouchDB with your name and password.
+ </p>
+ <table summary=""><tbody><tr>
+ <th><label>Username:</label></th>
+ <td><input type="text" name="name" size="24"></td>
+ </tr><tr>
+ <th><label>Password:</label></th>
+ <td><input type="password" name="password" size="24"></td>
+ </tr>
+ </tbody></table>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Login</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
35 _attachments/dialog/_save_view_as.html
@@ -0,0 +1,35 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post" id="view-save-as" onload="initForm(this)">
+ <h2>Save View As&hellip;</h2>
+ <fieldset>
+ <p class="help">
+ You can save this function code as a permanent view in the database. Just
+ enter or select the design document and the name of the view below. Note
+ that if you choose an existing view, it will be overwritten!
+ </p>
+ <table summary=""><tbody><tr>
+ <th><label for="input_docid">Design Document:</label></th>
+ <td><tt>_design/</tt><input type="text" id="input_docid" name="docid" size="20"></td>
+ </tr><tr>
+ <th><label for="input_name">View Name:<label></th>
+ <td><input type="text" id="input_name" name="name" size="30"></td>
+ </tr></table>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Save</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
42 _attachments/dialog/_share_test_reports.html
@@ -0,0 +1,42 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Share Test Reports</h2>
+ <fieldset>
+ <p class="help">
+ After each test run, a results summary document is stored in
+ <a href="/_utils/database.html?test_suite_reports">your local
+ <tt>test_suite_reports</tt> database.</a> The data has no personally
+ identifying information, just details about the test run and your CouchDB
+ and browser versions. (Click the red link above to see what's stored.)
+ The data remains private until you click the "share" button below.
+ </p>
+ <p class="help">
+ Test reports are very valuable to the CouchDB community, and are easy to share.
+ Clicking the "share" button below triggers replication from
+ your local <tt>test_suite_reports</tt> database, to a database hosted by the
+ project.
+ </p>
+ <p class="help">
+ <a href="http://couchdb.couchdb.org/_utils/database.html?test_suite_reports">
+ Browse test reports shared by other users.</a>
+ Thank you for sharing!
+ </p>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Share</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
35 _attachments/dialog/_signup.html
@@ -0,0 +1,35 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post">
+ <h2>Create User Account</h2>
+ <fieldset>
+ <p class="help">
+ Create a user document on this CouchDB. You will be logged in as this
+ user after the document is created.
+ </p>
+ <table summary=""><tbody><tr>
+ <th><label>Username:</label></th>
+ <td><input type="text" name="name" size="24"></td>
+ </tr><tr>
+ <th><label>Password:</label></th>
+ <td><input type="password" name="password" size="24"></td>
+ </tr>
+ </tbody></table>
+ </fieldset>
+ <div class="buttons">
+ <button type="submit">Create</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
36 _attachments/dialog/_upload_attachment.html
@@ -0,0 +1,36 @@
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<form action="" method="post" id="upload-form">
+ <h2>Upload Attachment</h2>
+ <fieldset>
+ <p class="help">
+ Please select the file you want to upload as an attachment to this
+ document. Please note that this will result in the immediate creation of
+ a new revision of the document, so it's not necessary to save the
+ document after the upload.
+ </p>
+ <table summary=""><tbody><tr>
+ <th><label>File:</label></th>
+ <td><input type="file" name="_attachments"></td>
+ </tr><tr>
+ <td id="progress" colspan="2">&nbsp;</td>
+ </tr></table>
+ </fieldset>
+ <div class="buttons">
+ <input type="hidden" name="_rev" value="">
+ <button type="submit">Upload</button>
+ <button type="button" class="cancel">Cancel</button>
+ </div>
+</form>
BIN  _attachments/favicon.ico
Binary file not shown
BIN  _attachments/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/apply.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/cancel.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/compact.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/delete-mini.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/delete.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/down.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/grippie.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/hgrad.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/key.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/load.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/order-asc.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/order-desc.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/path.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/progress.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/rarrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/run-mini.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/run.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/running.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/save.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/sidebar-toggle.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/spinner.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  _attachments/image/test_failure.gif
Diff not rendered
BIN  _attachments/image/test_success.gif
Diff not rendered
BIN  _attachments/image/thead-key.gif
Diff not rendered
BIN  _attachments/image/thead.gif
Diff not rendered
BIN  _attachments/image/toggle-collapse.gif
Diff not rendered
BIN  _attachments/image/toggle-expand.gif
Diff not rendered
BIN  _attachments/image/twisty.gif
Diff not rendered
346 _attachments/index.html
@@ -0,0 +1,346 @@
+<!DOCTYPE html>
+<!--
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+-->
+<html lang="en">
+ <head>
+ <title>Overview</title>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
+ <link rel="shortcut icon" type="image/png" href="favicon.png" />
+ <link rel="stylesheet" href="style/layout.css" type="text/css" />
+ <link rel="stylesheet" href="style/ui-lightness/jquery-ui-1.8.11.custom.css" type="text/css" />
+ </head>
+ <body>
+ <div id="wrap">
+ <h1>
+ <span id="topbar">&#160;</span>
+ <span id="raw-link" >&#160;</span>
+ </h1>
+ <div id="content"></div>
+ <div id="sidebar">
+ <span id="sidebar-toggle" title="Hide Sidebar">&#9651;</span>
+ <a href="index.html">
+ <img id="logo" src="image/logo.png" width="175" height="150" alt="Apache CouchDB: Relax">
+ </a>
+ <ul id="nav">
+ <li><span>Tools</span><ul>
+ <li><a href="#/">Overview</a></li>
+ <li><a href="#/_config">Configuration</a></li>
+ <li><a href="#/_replicate">Replicator</a></li>
+ <li><a href="#/_stats">Status</a></li>
+ <li><a href="#/_tests">Test Suite</a></li>
+ </ul></li>
+ <li><span>Recent Databases</span>
+ <ul id="dbs"></ul>
+ </li>
+ </ul>
+ <div id="footer">
+ <span id="userCtx">
+ <span class="loggedout">
+ <a href="#" class="signup">Signup</a> or <a href="#" class="login">Login</a>
+ </span>
+ <span class="loggedin">
+ Welcome <a class="name">?</a>!
+ <br/>
+ <span class="loggedinadmin">
+ <a href="#" class="createadmin">Setup more admins</a> or
+ <br/>
+ </span>
+ <a href="#" class="changepass">Change password</a> or
+ <a href="#" class="logout">Logout</a>
+ </span>
+ <span class="adminparty">
+ Welcome to Admin Party!
+ <br/>
+ Everyone is admin. <a href="#" class="createadmin">Fix this</a>
+ </span>
+ </span>
+ <hr/>
+ <span class="couch">
+ <a href="http://couchdb.apache.org/">Apache CouchDB </a><span id="version">?</span>
+ </span>
+ </div>
+ </div>
+ </div>
+ </body>
+ <script src="script/jquery.js"></script>
+ <script src="script/jquery.couch.js"></script>
+ <script src="script/jquery-ui-1.8.11.custom.min.js"></script>
+ <script src="script/futon-dialogs.js"></script>
+
+ <script src="script/sha1.js"></script>
+ <script src="script/sammy/sammy.js"></script>
+ <script src="script/sammy/plugins/sammy.mustache.js"></script>
+ <script src="script/sammy/plugins/sammy.title.js"></script>
+ <script src="script/sammy/plugins/sammy.json.js"></script>
+ <script src="script/sammy/plugins/sammy.storage.js"></script>
+ <script src="script/futon.js"></script>
+
+ <!-- snippets -->
+ <script type="text/html" id="all-dbs-template"><ul id="all-dbs">{{#dbs}}<li{{#current}} class="current"{{/current}}><a href="#/{{url}}/_all_docs">{{db}}</a></li>{{/dbs}}</ul></script>
+
+ <script>
+ (function($) {
+ // Start Sammy app
+ futonApp.run();
+
+ // Sidebar toggling
+
+ $('div#sidebar span#sidebar-toggle').click(function (e) {
+ var hide = !$("#sidebar").is(".x-hidden");
+ $("div#sidebar span#sidebar-toggle")[hide ? "addClass" : "removeClass"]("sidebar-toggle-expand")
+ $("#wrap").css({"margin-right": hide ? 0 : 210});
+ $('#sidebar')
+ .toggleClass("x-hidden", hide)
+ .css({
+ width: hide ? 26 : 210,
+ height: hide ? $("h1").outerHeight() - 1 : "100%",
+ right: hide ? 0 : -210
+ })
+ .children(":not(#sidebar-toggle)")[hide ? "hide" : "show"]()
+ ;
+ $("h1").css({"margin-right": hide ? 26 : 0});
+
+ $(document.body).toggleClass("fullwidth", hide);
+ })
+
+ // Futon login & admin setup
+
+ var doLogin = function (name, password, callback) {
+ $.couch.login({
+ name : name,
+ password : password,
+ success : function() {
+ sidebar();
+ callback();
+ },
+ error : function(code, error, reason) {
+ sidebar();
+ callback({name : "Error logging in: "+reason});
+ }
+ });
+ };
+
+ var doSignup = function (name, password, callback, runLogin) {
+ $.couch.signup({
+ name : name
+ }, password, {
+ success : function() {
+ if (runLogin) {
+ doLogin(name, password, callback);
+ } else {
+ callback();
+ }
+ },
+ error : function(status, error, reason) {
+ sidebar();
+ if (error == "conflict") {
+ callback({name : "Name '"+name+"' is taken"});
+ } else {
+ callback({name : "Signup error: "+reason});
+ }
+ }
+ });
+ };
+
+ var validateUsernameAndPassword = function (data, callback) {
+ if (!data.name || data.name.length == 0) {
+ callback({name: "Please enter a name."});
+ return false;
+ };
+ return validatePassword(data, callback);
+ };
+
+ var validatePassword = function (data, callback) {
+ if (!data.password || data.password.length == 0) {
+ callback({password: "Please enter a password."});
+ return false;
+ };
+ return true;
+ };
+
+ var createAdmin = function () {
+ $.showDialog("dialog/_create_admin.html", {
+ submit: function(data, callback) {
+ if (!validateUsernameAndPassword(data, callback)) return;
+ $.couch.config({
+ success : function() {
+ doLogin(data.name, data.password, function(errors) {
+ if(!$.isEmptyObject(errors)) {
+ callback(errors);
+ return;
+ }
+ doSignup(data.name, null, function(errors) {
+ if (errors && errors.name && errors.name.indexOf && errors.name.indexOf("taken") == -1) {
+ callback(errors);
+ } else {
+ callback();
+ }
+ }, false);
+ });
+ }
+ }, "admins", data.name, data.password);
+ }
+ });
+ return false;
+ };
+
+ var login = function () {
+ $.showDialog("dialog/_login.html", {
+ submit: function(data, callback) {
+ if (!validateUsernameAndPassword(data, callback)) return;
+ doLogin(data.name, data.password, callback);
+ }
+ });
+ return false;
+ };
+
+ var logout = function () {
+ $.couch.logout({
+ success : function(resp) {
+ sidebar();
+ }
+ })
+ };
+
+ var signup = function () {
+ $.showDialog("dialog/_signup.html", {
+ submit: function(data, callback) {
+ if (!validateUsernameAndPassword(data, callback)) return;
+ doSignup(data.name, data.password, callback, true);
+ }
+ });
+ return false;
+ };
+
+ var changePassword = function () {
+ $.showDialog("dialog/_change_password.html", {
+ submit: function(data, callback) {
+ if (validatePassword(data, callback)) {
+ if (data.password != data.verify_password) {
+ callback({verify_password: "Passwords don't match."});
+ return false;
+ }
+ } else {
+ return false;
+ }
+ $.couch.session({success: function (resp) {
+ if (resp.userCtx.roles.indexOf("_admin") > -1) {
+ $.couch.config({
+ success : function () {
+ doLogin(resp.userCtx.name, data.password, function(errors) {
+ if(!$.isEmptyObject(errors)) {
+ callback(errors);
+ return;
+ } else {
+ location.reload();
+ }
+ });
+ }
+ }, "admins", resp.userCtx.name, data.password);
+ } else {
+ $.couch.db(resp.info.authentication_db).openDoc("org.couchdb.user:"+resp.userCtx.name, {
+ success: function (user) {
+ // we have this in $.couch, but we hide it... :/
+ function prepareUserDoc(user_doc, new_password) {
+ if (typeof hex_sha1 == "undefined") {
+ alert("creating a user doc requires sha1.js to be loaded in the page");
+ return;
+ }
+ var user_prefix = "org.couchdb.user:";
+ user_doc._id = user_doc._id || user_prefix + user_doc.name;
+ if (new_password) {
+ // handle the password crypto
+ user_doc.salt = $.couch.newUUID();
+ user_doc.password_sha = hex_sha1(new_password + user_doc.salt);
+ }
+ user_doc.type = "user";
+ if (!user_doc.roles) {
+ user_doc.roles = [];
+ }
+ return user_doc;
+ };
+
+ $.couch.db(resp.info.authentication_db).saveDoc(prepareUserDoc(user, data.password), {
+ success: function() {
+ doLogin(user.name, data.password, function(errors) {
+ if(!$.isEmptyObject(errors)) {
+ callback(errors);
+ return;
+ } else {
+ location.reload();
+ }
+ });
+ }
+ });
+ }
+ });
+ }
+ }});
+ }
+ });
+ return false;
+ };
+
+ var setupSidebar = function() {
+ $("#userCtx .login").click(login);
+ $("#userCtx .logout").click(logout);
+ $("#userCtx .signup").click(signup);
+ $("#userCtx .createadmin").click(createAdmin);
+ $("#userCtx .changepass").click(changePassword);
+ };
+
+ var sidebar = function() {
+ // get users db info?
+ $("#userCtx span").hide();
+ request({url:'/_session'}, function (err, r) {
+ if (err) handleError(err, r);
+ var userCtx = r.userCtx;
+ $("#userCtx").userCtx = userCtx;
+ if (userCtx.name) {
+ $("#userCtx .name").text(userCtx.name).attr({href : "#/"+encodeURIComponent(r.info.authentication_db)+"/org.couchdb.user%3A"+encodeURIComponent(userCtx.name)});
+ if (userCtx.roles.indexOf("_admin") != -1) {
+ $("#userCtx .loggedin").show();
+ $("#userCtx .loggedinadmin").show();
+ } else {
+ $("#userCtx .loggedin").show();
+ }
+ } else if (userCtx.roles.indexOf("_admin") != -1) {
+ $("#userCtx .adminparty").show();
+ } else {
+ $("#userCtx .loggedout").show();
+ };
+ })
+ };
+
+ setupSidebar();
+ sidebar();
+ $.futonSidebar = sidebar;
+
+ $.couch.info({
+ success: function(info, status) {
+ $("#version").text(info.version);
+ }
+ });
+
+ $("span#raw-link").click(function () {
+ var redir = window.location.hash.replace('#','');
+ window.location = (redir == '' || redir == '/') ? '/_all_dbs' : redir;
+ })
+ })(jQuery);
+
+ </script>
+
+</html>
618 _attachments/old.layout.css
@@ -0,0 +1,618 @@
+/*
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+CONDITIONS OF ANY KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+
+*/
+
+/* General styles */
+
+html, body { color: #000; font: normal 90% Arial,Helvetica,sans-serif;
+ height: 100%; margin: 0; padding: 0; overflow: hidden;
+}
+:link, :visited { color: #ba1e16; text-decoration: none; }
+:link img, :visited img { border: none; }
+
+h1 { background: #333; border-right: 2px solid #111;
+ border-bottom: 1px solid #333; color: #999;
+ font: normal 125% Arial,Helvetica,sans-serif; height: 32px;
+ line-height: 32px; margin: 0; padding: 0 0 0 .5em; position: relative;
+}
+h1 :link, h1 :visited, h1 strong { padding: .4em .5em; }
+h1 :link, h1 :visited {
+ background: url(../image/path.gif) 100% 50% no-repeat;
+ color: #bbb; cursor: pointer; padding-right: 2.2em;
+ text-shadow: #333 2px 2px 1px;
+}
+h1 strong { color: #fff; font-weight: normal; padding-right: 25px; }
+h1 strong a {color:#fff !important;background:none !important;}
+h1 :link.raw, h1 :visited.raw {
+ background: url(../image/rarrow.png) 100% 50% no-repeat; position: absolute;
+ right: 20px; width: 35px; height: 100%; padding: 0; margin: 0;
+}
+body.loading h1 strong {
+ background: url(../image/spinner.gif) right center no-repeat;
+}
+
+hr { border: 1px solid #999; border-width: 1px 0 0; }
+dl dt { font-weight: bold; }
+code, tt, pre {
+ font-family: "DejaVu Sans Mono",Menlo,Courier,monospace;
+}
+code.key { color: #333; font-weight: bold; }
+code.string { color: #393; }
+code.number, code.boolean { color: #339; }
+code.null { color: #666; }
+
+button { font-size: 100%; -webkit-appearance: square-button; }
+button[disabled] { color: #999; }
+input, select, textarea { background: #fff; border: 1px solid;
+ border-color: #999 #ddd #ddd #999; color: #000; margin: 0; padding: 1px;
+}
+input.placeholder { color: #999; }
+textarea {
+ font-family: "DejaVu Sans Mono",Menlo,Courier,monospace;
+ font-size: 100%;
+}
+fieldset { border: none; font-size: 95%; margin: 0; padding: .2em 0 0; }
+fieldset legend { color: #666; font-weight: bold; padding: 0; }
+fieldset input, fieldset select { font-size: 95%; }
+fieldset p { margin: .4em; }
+
+p.help { color: #999; font-size: 90%; margin: 0 2em 1em; }
+
+/* Tabular listings */
+
+table.listing { border-collapse: separate; border-spacing: 0;
+ border: 1px solid #a7a7a7; clear: both; width: 100%;
+}
+table.listing caption { display: none; }
+table.listing th, table.listing td { padding: .2em .5em; }
+table.listing thead th { background: #dadada url(../image/thead.gif) repeat-x;
+ border: 1px solid #a7a7a7; border-width: 0 0 1px 1px; color: #333;
+ font-size: 95%; font-weight: normal; text-align: left;
+ text-shadow: #999 2px 1px 2px; white-space: nowrap;
+}
+table.listing thead th:first-child { border-left: none; }
+table.listing thead th.key {
+ background: #a7afb6 url(../image/thead-key.gif) 0 0 repeat-x;
+ padding-top: 2px;
+}
+table.listing thead th.key span {
+ background: url(../image/order-asc.gif) 100% 3px no-repeat; cursor: pointer;
+ padding-right: 20px;
+}
+table.listing thead th.desc span {
+ background-image: url(../image/order-desc.gif);
+}
+table.listing tbody tr th, table.listing tbody tr td { background: #feffea; }
+table.listing tbody tr.odd th, table.listing tbody tr.odd td,
+table.listing tbody.odd tr th, table.listing tbody.odd tr td {
+ background: #fff;
+}
+table.listing tbody th, table.listing tbody td {
+ border-left: 1px solid #d9d9d9; padding: .4em .5em; vertical-align: top;
+}
+table.listing tbody th:first-child, table.listing tbody td:first-child {
+ border-left: none;
+}
+table.listing tbody th { text-align: left; }
+table.listing tbody th :link, table.listing tbody th :visited {
+ display: block;
+}
+table.listing tbody.footer tr td { background: #e9e9e9;
+ border-top: 1px solid #a7a7a7; color: #999; font-size: 90%;
+ line-height: 1.8em;
+}
+table.listing tbody.footer #paging { float: right; }
+table.listing tbody.footer #paging a,
+table.listing tbody.footer #paging label {
+ padding: 0 .5em;
+}
+table.listing tbody.footer #paging label { color: #666; }
+table.listing tbody.footer #paging select { font-size: 90%; padding: 0; }
+
+/* Inline editing */
+
+span.editinline-tools { margin: 2px 2px 0; float: right; margin-right: -45px; }
+span.editinline-tools button { background: transparent 0 0 no-repeat;
+ border: none; cursor: pointer; display: block; float: left; margin: 0 .2em;
+ width: 11px; height: 11px;
+}
+span.editinline-tools button:hover { background-position: 0 -22px; }
+span.editinline-tools button:active { background-position: 0 -44px; }
+span.editinline-tools button.apply {
+ background-image: url(../image/apply.gif);
+}
+span.editinline-tools button.cancel {
+ background-image: url(../image/cancel.gif);
+}
+
+/* Resizer grippies */
+
+div.grippie { background: #e9e9e9 url(../image/grippie.gif) 50% 50% no-repeat;
+ border: 1px solid #aaa; border-top: none; min-height: 10px;
+}
+
+/* Suggest results */
+
+ul.suggest-dropdown { border: 1px solid #999; background-color: #eee;
+ padding: 0; margin: 0; list-style: none; opacity: .85;
+ -moz-box-shadow: 2px 2px 10px #333; -webkit-box-shadow: 2px 2px 10px #333;
+}
+ul.suggest-dropdown li { padding: 2px 5px; white-space: nowrap; color: #101010;
+ text-align: left;
+}
+ul.suggest-dropdown li.selected { cursor: pointer; background: Highlight;
+ color: HighlightText;
+}
+
+/* Logo & Navigation */
+
+#sidebar { background: #fff; position: absolute; top: 0; right: -210px;
+ width: 210px; height: 100%;
+}
+body.fullwidth #sidebar { border-bottom: 1px solid #333; right: 0;
+ width: 26px;
+}
+#sidebar-toggle { background: url(../image/sidebar-toggle.png) 0 0 no-repeat;
+ color: #999; cursor: pointer; display: block; position: absolute; right: 0;
+ top: 0; font-size: 110%; width: 26px; height: 32px; text-indent: -9999px;
+}
+#sidebar-toggle:hover { background-position: -26px 0; }
+#sidebar-toggle:focus { outline: none; }
+#sidebar.hidden #sidebar-toggle { background-position: 0 -32px; }
+#sidebar.hidden #sidebar-toggle:hover { background-position: -26px -32px; }
+
+#logo { margin: 30px 0 0; padding: 0 18px 10px; }
+
+#nav { color: #333; font-size: 110%; font-weight: bold; list-style: none;
+ margin: 0; overflow: auto; overflow-x: hidden; padding: 0; width: 210px;
+}
+#nav ul { list-style: none; margin: 0; padding: 0; }
+#nav li { color: #999; margin: 5px 0 0; padding: 3px 0; }
+#nav li span { padding: 0 20px; }
+#nav li.selected { background: #e9e9e9; }
+#nav li li { font-size: 90%; font-weight: normal; margin: 0;
+ padding: 2px 20px 2px 40px;
+}
+#nav li li:hover { background: #e4e4e4; }
+#nav li.selected li:hover { background: #d7d7d7; }
+#nav li li :link, #nav li li :visited { color: #333; display: block;
+ overflow: hidden; text-decoration: none; text-overflow: ellipsis;
+}
+#nav li li :link:hover, #nav li li :visited:hover { color: #000; }
+#nav li li :link:focus, #nav li li :visited:focus { outline: none; }
+#nav li li.selected { background: #aaa !important; border-top: 1px solid #999;
+ color: #fff; padding-top: 1px;
+}
+#nav li li.selected :link, #nav li li.selected :visited { color: #fff; }
+#nav li li.selected :link:hover, #nav li li.selected :visited:hover {
+ color: #fff;
+}
+#nav li button { background: transparent 0 0 no-repeat; border: none;
+ cursor: pointer; width: 15px; height: 15px; margin-left: -20px;
+ position: absolute; vertical-align: top;
+}
+#nav li li:hover button.remove {
+ background-image: url(../image/delete-mini.png);
+}
+#nav li button.remove:hover { background-position: -15px 0; }
+
+#footer { background: #ddd; border-top: 1px solid #bbb; color: #000;
+ font-size: 80%; opacity: .7; padding: 5px 10px; position: absolute; right: 0;
+ bottom: 0; min-height: 1.3em; width: 190px; text-align: right;
+}
+#footer .couch :link, #footer .couch :visited { color: #000; }
+
+#userCtx span { display:none; }
+
+#wrap { background: #fff url(../image/bg.png) 100% 0 repeat-y;
+ height: 100%; margin-right: 210px; position: relative;
+}
+body.fullwidth #wrap { margin-right: 0; }
+#content { padding: 1em 16px 3em 10px; overflow: auto; overflow-y: scroll;
+ position: absolute; top: 33px; bottom: 0; left: 0; right: 0;
+}
+
+/* Toolbar */
+
+#toolbar { font-size: 90%; line-height: 16px; list-style: none;
+ margin: 0 0 .5em; padding: 5px 5px 5px 3px;
+}
+#toolbar li { display: inline; }
+#toolbar li.current {float:right;}
+#toolbar button { background: transparent 2px 2px no-repeat; border: none;
+ color: #666; margin: 0; padding: 2px 1em 2px 22px; cursor: pointer;
+ font-size: 95%; line-height: 16px;
+}
+#toolbar button:hover { background-position: 2px -30px; color: #000; }
+#toolbar button:active { background-position: 2px -62px; color: #000; }
+#toolbar button.add { background-image: url(../image/add.png); }
+#toolbar button.security { background-image: url(../image/key.png); }
+#toolbar button.compact { background-image: url(../image/compact.png); }
+#toolbar button.delete { background-image: url(../image/delete.png); }
+#toolbar button.load { background-image: url(../image/load.png); }
+#toolbar button.run { background-image: url(../image/run.png); }
+#toolbar button.save { background-image: url(../image/save.png); }
+#toolbar button.share { background-image: url(../image/compact.png); }
+
+/* Dialogs */
+
+#overlay { background: #bbb; cursor: wait; position: fixed; width: 100%;
+ height: 100%; top: 0; left: 0;
+}
+*html #overlay { position: absolute;
+ width: expression(document.body.clientWidth + 'px');
+ height: expression(document.body.clientHeight + 'px');
+}
+#dialog { background: #333 url(../image/progress.gif) 50% 50% no-repeat;
+ color: #f4f4f4; overflow: hidden; opacity: .95; max-width: 33em;
+ padding: 1em 1em 0; -moz-border-radius: 7px;
+ -moz-box-shadow: 4px 4px 6px #333; -webkit-border-radius: 7px;
+ -webkit-box-shadow: 4px 4px 6px #333;
+}
+*html #dialog { width: 33em; }
+#dialog.loading { width: 220px; height: 80px; }
+#dialog.loaded { background-image: none; }
+#dialog h2 { background: #666 98% 50% no-repeat;
+ border-top: 1px solid #555; border-bottom: 1px solid #777; color: #ccc;
+ font-size: 110%; font-weight: bold; margin: 0 -1em; padding: .35em 1em;
+}
+body.loading #dialog h2 {
+ background-image: url(../image/spinner.gif);
+}
+#dialog h3 { color: #ccc; font-size: 100%; font-weight: bold; margin: 0 -2em;
+ padding: .35em 2em 0;
+}
+#dialog fieldset { background: #222; border-top: 1px solid #111;
+ margin: 0 0 1em; padding: .5em 1em 1em;
+ -moz-border-radius-bottomleft: 7px; -moz-border-radius-bottomright: 7px;
+ -webkit-border-bottom-left-radius: 7px;
+ -webkit-border-bottom-right-radius: 7px;
+}
+#dialog p.help { color: #bbb; font-size: 95%; margin: 0 0 1em; }
+#dialog fieldset table { margin-top: 1em; }
+#dialog fieldset th, #dialog fieldset td { padding: .5em;
+ vertical-align: top;
+}
+#dialog fieldset th { color: #999; font-weight: bold;
+ text-align: right;
+}
+#dialog fieldset input { background-color: #e9e9e9; vertical-align: middle; }
+#dialog fieldset input.error { background-color: #f9e4e4; }
+#dialog fieldset div.error { padding-top: .3em; color: #b33; }
+#dialog fieldset.radiogroup { padding-top: 1em; }
+#dialog fieldset.radiogroup label { position: relative; padding-left: 25px; }
+#dialog fieldset.radiogroup input { position: absolute; left: 5px; top: 2px; }
+#dialog fieldset.radiogroup p.help { margin-top: .5em; margin-left: 25px; }
+#dialog fieldset.radiogroup hr { border-color: #333; margin-left: 25px; }
+#dialog .buttons { padding: 0 .5em .5em; text-align: right; }
+#dialog .buttons button { background: #444; border: 1px solid #aaa;
+ color: #ddd; cursor: pointer; font-size: 90%; font-weight: normal;
+ margin: 0 0 0 5px; padding: .2em 2em; -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+}
+#dialog .buttons button[type=submit] { font-weight: bold; }
+#dialog .buttons button:hover { background: #555; }
+#dialog .buttons button:active { background: #333; color: #fff; }
+
+#dialog fieldset td#progress {
+ background: url(../image/progress.gif) 50% 50% no-repeat;
+ visibility: hidden;
+}
+
+/* Document quick jump */
+
+#jumpto { float: right; padding: 5px 10px 5px 5px; line-height: 16px;
+ font-weight: bold; color: #666; font-size: 90%; }
+
+#jumpto input { font-size: 90%; }
+
+/* View selector */
+
+#switch { color: #666; float: right; font-size: 90%; font-weight: bold;
+ line-height: 16px; padding: 5px;
+}
+#switch select { font-size: 90%; }
+
+/* Stale views checkbox */
+
+#staleviews {
+ color: #666; float: right; font-size: 90%;
+ font-weight: bold; line-height: 16px; padding: 5px;
+}
+
+/* View function editing */
+
+#viewcode { background: #fff; border: 1px solid;
+ border-color: #999 #ddd #ddd #999; margin: 0 0 1em; overflow: hidden;
+}
+#viewcode .top, #viewcode .bottom { background-color: #e9e9e9;
+ border: 1px solid; border-color: #ddd #ddd #e9e9e9 #ddd; color: #333;
+ padding: 0 .5em 2px;
+}
+#viewcode .top { border-bottom: 1px solid #ddd; color: #aaa; font-size: 95%; }
+#viewcode .top span { border: none; color: #666; cursor: pointer;
+ display: block; font-size: 90%; margin: 0; padding: 2px 0 0;
+}
+#viewcode .top span#view-toggle {
+ background: url(../image/twisty.gif) 0 -96px no-repeat; padding-left: 15px;
+}
+#viewcode.collapsed .top span#view-toggle { background-position: 0 4px; }
+#viewcode .top a { float: right; font-size: 90%; line-height: 1.4em;
+ padding: 2px 2px 0 0;
+}
+#viewcode .top a:link, #viewcode .top a:visited { color: #999; }
+#viewcode table { border: none; border-collapse: separate; border-spacing: 0;
+ margin: 0; table-layout: fixed; width: 100%; max-width: 100%;
+}
+#viewcode table td { border: none; padding: 0; }
+#viewcode table td.splitter { background: #e9e9e9; width: 4px; }
+#viewcode table td.map { border-right: 1px solid #ccc; }
+#viewcode table td.reduce { border-left: 1px solid #ccc; }
+#viewcode .code label { font-size: 90%; color: #999; padding: 0 .5em;
+ white-space: nowrap;
+}
+#viewcode .code textarea { border: none; border-top: 1px solid #ccc;
+ color: #333; font-size: 11px; margin: 0; min-height: 50px; overflow: auto;
+ padding: .4em 0 0; resize: none; width: 100%;
+}
+#viewcode .code textarea:focus { background: #e9f4ff; }
+#viewcode .bottom { border-bottom: none; clear: left; padding: 1px 3px; }
+#viewcode .bottom button { font-size: 90%; margin: 0 1em 0 0;
+ padding-left: 2em; padding-right: 2em;
+}
+*html #viewcode .bottom button { padding: 0 .5em; }
+*+html #viewcode .bottom button { padding: 0 .5em; }
+#viewcode .bottom button.revert, #viewcode .bottom button.save,
+#viewcode .bottom button.saveas {
+ float: right; margin: 0 0 0 1em;
+}
+#viewcode .bottom button.save { font-weight: bold; }
+#viewcode .bottom label { color: #666; font-size: 90%; }
+#viewcode .grippie { background-position: 50% 50%; }
+#viewcode.collapsed { background: #e9e9e9; }
+#viewcode.collapsed .top { border-bottom: none; }
+#viewcode.collapsed .top span { background-position: 0 3px; }
+#viewcode.collapsed table, #viewcode.collapsed .bottom { display: none; }
+
+#tempwarn { display: none; font-size: 90%; margin: 0 2em 1.5em; }
+#grouptruenotice { display: none; font-size: 90%; margin: 1ex 2em 1.5em; }
+
+/* Database table */
+
+#databases thead th.size, #databases thead th.count, #databases thead th.seq,
+#databases tbody td.size, #databases tbody td.count, #databases tbody td.seq {
+ text-align: right;
+}
+
+/* Documents table */
+
+#documents thead th { line-height: 150%; width: 50%; }
+#documents thead th label { color: #333; float: right; font-size: 90%;
+ text-shadow: none;
+}
+#documents thead th label.disabled { color: #777; }
+#documents thead th label input { vertical-align: middle; }
+#documents thead th label input[type=range] { width: 7em; }
+#documents thead th label output { width: 4em; display: inline-block; }
+#documents tbody.content td { color: #999;
+ font: normal 11px "DejaVu Sans Mono",Menlo,Courier,monospace;
+}
+#documents tbody.content td.key { color: #333; }
+#documents tbody.content td.key a { display: block; }
+#documents tbody.content td.key a strong { font-weight: normal; }
+#documents tbody.content td.key span.docid { color: #999;
+ font: normal 10px Arial,Helvetica,sans-serif;
+}
+#documents tbody.content td.value { font-size: 10px; }
+
+/* Document display tabs */
+
+#tabs { float: right; list-style: none; margin: -1.4em 0 0; }
+#tabs li { display: inline; font-size: 95%; padding: 0; }
+#tabs li.active { font-weight: bold; }
+#tabs :link, #tabs :visited { background: #dadada; color: #666;
+ border: 1px solid #a7a7a7; float: left; margin: 0 0 0 .5em;
+ padding: .5em 2em .3em; position: relative; top: 1px;
+}
+#tabs .active :link, #tabs .active :visited { background: #e9e9e9;
+ border-bottom-color: #e9e9e9; color: #333;
+}
+#tabs :link:focus, #tabs :visited:focus { outline: none; }
+
+/* Document fields table */
+
+#fields { clear: right; table-layout: fixed; }
+#fields col.field { width: 33%; }
+#fields tbody.content th { padding-left: 25px; padding-right: 48px; }
+#fields tbody.content th button.delete {
+ background: url(../image/delete-mini.png) no-repeat; border: none;
+ cursor: pointer; float: left; margin: .2em 5px 0 -20px; padding: 0;
+ width: 15px; height: 15px;
+}
+#fields tbody.content th button.delete:hover { background-position: -15px 0; }
+#fields tbody.content th b { display: block; padding: 2px 2px 2px 3px; }
+#fields tbody.content th b.editinline-container { padding: 0; }
+#fields tbody.content td { color: #999; padding-left: 14px;
+ padding-right: 48px;
+}
+#fields tbody.content td code { display: block; font-size: 11px;
+ padding: 2px 2px 2px 3px; position: relative;
+}
+#fields tbody.content td code.string { white-space: pre-wrap; }
+#fields tbody.content td code.string:before { color: #ccc; content: "";
+ position: absolute; left: -4px;
+}
+#fields tbody.content td code.string:after { color: #ccc; content: ""; }
+
+#fields tbody.content td dl { margin: 0; padding: 0; }
+#fields tbody.content td dt {
+ background: transparent url(../image/toggle-collapse.gif) 0 3px no-repeat;
+ clear: left; color: #333; cursor: pointer; line-height: 1em;
+ margin-left: -12px; padding-left: 14px;
+}
+#fields tbody.content td dd { line-height: 1em; margin: 0;
+ padding: 0 0 0 1em;
+}
+#fields tbody.content td dt.collapsed {
+ background-image: url(../image/toggle-expand.gif);
+}
+#fields tbody.content td dt.inline { background-image: none; cursor: default;
+ float: left; margin-left: 0; padding-left: 2px; padding-right: .5em;
+ padding-top: 2px;
+}
+#fields tbody.content td dd code.string { left: 4px; text-indent: -6px; }
+#fields tbody.content td dd code.string:before { position: static; }
+#fields tbody.content input, #fields tbody.content textarea,
+#fields tbody.source textarea {
+ background: #fff; border: 1px solid; border-color: #999 #ddd #ddd #999;
+ margin: 0; padding: 1px; width: 100%;
+}
+#fields tbody.content th input { font-family: inherit; font-size: inherit;
+ font-weight: bold;
+}
+#fields tbody.content td input, #fields tbody.content td textarea,
+#fields tbody.source textarea {
+ font: normal 11px "DejaVu Sans Mono",Menlo,Courier,monospace;
+}
+#fields tbody.content input.invalid,
+#fields tbody.content textarea.invalid,
+#fields tbody.source textarea.invalid {
+ background: #f9f4f4; border-color: #b66 #ebb #ebb #b66;
+}
+#fields tbody.content div.grippie, #fields tbody.source div.grippie {
+ padding: 0 1px; width: 100%;
+}
+#fields tbody.content div.error, #fields tbody.source div.error {
+ color: #d33;
+}
+
+#fields tbody.content td ul.attachments { list-style: none; margin: 0;
+ padding: 0;
+}
+#fields tbody.content td ul.attachments li {
+ margin-bottom: .3em; min-height: 20px; padding-left: 20px;
+}
+#fields tbody.content td ul.attachments tt { font-size: 11px; }
+#fields tbody.content td ul.attachments li span.info { color: #666;
+ display: block; font-size: 95%;
+}
+#fields tbody.content td ul.attachments li button {
+ background: transparent no-repeat; border: none; cursor: pointer;
+ float: left; margin: 0 2px 0 -20px; padding: 0; width: 15px; height: 15px;
+ vertical-align: middle;
+}
+#fields tbody.content td ul.attachments li button:hover {
+ background-position: -15px 0;
+}
+#fields tbody.content td ul.attachments li button.delete {
+ background-image: url(../image/delete-mini.png);
+}
+#fields tbody.source td pre { color: #999; font-size: 11px; line-height: 1.6em;
+ margin: 0; overflow: auto; white-space: pre-wrap; width: 100%;
+}
+#fields tbody.source td.editinline-container { padding-left: 14px; padding-right: 48px; }
+
+/* Test suite */
+
+#tests { table-layout: fixed; }
+#tests thead th.name { width: 20%; }
+#tests thead th.status { padding-left: 20px; width: 10em; }
+#tests thead th.duration { text-align: right; width: 7em; }
+#tests tbody.content th { cursor: help; padding-left: 25px;
+ white-space: nowrap;
+}
+#tests tbody.content th button.run {
+ background: url(../image/run-mini.png) no-repeat; border: none;
+ cursor: pointer; float: left; margin: .2em 5px 0 -20px; padding: 0;
+ width: 15px; height: 15px;
+}
+#tests tbody.content th button.run:hover { background-position: -15px 0; }
+#tests tbody.content td.duration { text-align: right; width: 6em; }
+#tests tbody.content td.status { background-position: 5px 8px;
+ background-repeat: no-repeat; color: #999; padding-left: 20px;
+}
+#tests tbody.content td.details { width: 50%; }
+#tests tbody.content td.details a { border-bottom: 1px dashed #ccc;
+ color: #999; float: right; font-size: 85%;
+}
+#tests tbody.content td.details ol { color: #999; margin: 0;
+ padding: 0 0 0 1.5em;
+}
+#tests tbody.content td.details ol b { color: #333; font-weight: normal; }
+#tests tbody.content td.details ol code { color: #c00; font-size: 100%; }
+#tests tbody.content td.details ol code.error { white-space: pre; }
+#tests tbody.content td.running {
+ background-image: url(../image/running.png); color: #333;
+}
+#tests tbody.content td.success, span.success {
+ background-image: url(../image/test_success.gif) no-repeat; color: #060;
+}
+#tests tbody.content td.error, #tests tbody.content td.failure, span.failure {
+ background-image: url(../image/test_failure.gif) no-repeat; color: #c00;
+}
+
+/* Configuration */
+
+#config tbody th { background: #e6e6e6; border-right: none;
+ border-top: 1px solid #d9d9d9;
+}
+#config tbody td.name { border-left: 1px solid #d9d9d9; color: #333;
+ font-weight: bold;
+}
+#config tbody td.value { padding: 1px 48px 1px 1px; }
+#config tbody td.value code { display: block; font-size: 11px;
+ padding: 2px 2px 2px 3px;
+}
+#config tbody td.value code.editinline-container { padding: 0; }
+#config tbody td input {
+ background: #fff; border: 1px solid; border-color: #999 #ddd #ddd #999;
+ font: normal 11px "DejaVu Sans Mono",Menlo,Courier,monospace;
+ margin: 0; padding: 1px; width: 100%;
+}
+
+/* Replication */
+
+form#replicator { background: #f4f4f4; border: 1px solid;
+ border-color: #999 #ccc #ccc #999; margin: .5em 1em 1.5em; padding: .5em;
+ -moz-border-radius: 7px; -webkit-border-radius: 7px;
+}
+form#replicator fieldset { float: left; padding: 1px; }
+form#replicator p.swap { float: left; margin: 2em 0 0; padding: 1px 1em; }
+form#replicator p.swap button { background: transparent; border: none;
+ color: #666; cursor: pointer; font-size: 150%;
+}
+form#replicator p.swap button:hover { color: #000; }
+form#replicator p.actions { padding: 1px; clear: left; margin: 0;
+ text-align: right;
+}
+
+/* Active tasks */
+
+#interval { color: #666; float: right; font-size: 90%; font-weight: bold;
+ line-height: 16px; padding: 5px;
+}
+#interval input { vertical-align: top; }
+#interval .secs { display: inline-block; width: 2em; text-align: right; }
+
+#status tr.none th { color: #666; font-weight: normal; }
+#status td.object, #status td.pid {
+ font-family: "DejaVu Sans Mono",Menlo,Courier,monospace;
+ font-size: 11px;
+}
+
+
+/* Session */
+#loginSignup {
+ font-size:200%;
+}
124 _attachments/script/base64.js
@@ -0,0 +1,124 @@
+/* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
+ * Version: 1.0
+ * LastModified: Dec 25 1999
+ * This library is free. You can redistribute it and/or modify it.
+ */
+ /* Modified by Chris Anderson to not use CommonJS */
+ /* Modified by Dan Webb not to require Narwhal's binary library */
+
+var Base64 = {};
+(function(exports) {
+
+ var encodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ var decodeChars = [
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
+ -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1
+ ];
+
+ exports.encode = function (str) {
+ var out, i, length;
+ var c1, c2, c3;
+
+ length = len(str);
+ i = 0;
+ out = [];
+ while(i < length) {
+ c1 = str.charCodeAt(i++) & 0xff;
+ if(i == length)
+ {
+ out.push(encodeChars.charCodeAt(c1 >> 2));
+ out.push(encodeChars.charCodeAt((c1 & 0x3) << 4));
+ out.push("=".charCodeAt(0));
+ out.push("=".charCodeAt(0));
+ break;
+ }
+ c2 = str.charCodeAt(i++);
+ if(i == length)
+ {
+ out.push(encodeChars.charCodeAt(c1 >> 2));
+ out.push(encodeChars.charCodeAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)));
+ out.push(encodeChars.charCodeAt((c2 & 0xF) << 2));
+ out.push("=".charCodeAt(0));
+ break;
+ }
+ c3 = str.charCodeAt(i++);
+ out.push(encodeChars.charCodeAt(c1 >> 2));
+ out.push(encodeChars.charCodeAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)));
+ out.push(encodeChars.charCodeAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)));
+ out.push(encodeChars.charCodeAt(c3 & 0x3F));
+ }
+
+ var str = "";
+ out.forEach(function(chr) { str += String.fromCharCode(chr) });
+ return str;
+ };
+
+ exports.decode = function (str) {
+ var c1, c2, c3, c4;
+ var i, length, out;
+
+ length = len(str);
+ i = 0;
+ out = [];
+ while(i < length) {
+ /* c1 */
+ do {
+ c1 = decodeChars[str.charCodeAt(i++) & 0xff];
+ } while(i < length && c1 == -1);
+ if(c1 == -1)
+ break;
+
+ /* c2 */
+ do {
+ c2 = decodeChars[str.charCodeAt(i++) & 0xff];
+ } while(i < length && c2 == -1);
+ if(c2 == -1)
+ break;
+
+ out.push(String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4)));
+
+ /* c3 */
+ do {
+ c3 = str.charCodeAt(i++) & 0xff;
+ if(c3 == 61)
+ return out.join('');
+ c3 = decodeChars[c3];
+ } while(i < length && c3 == -1);
+ if(c3 == -1)
+ break;
+
+ out.push(String.fromCharCode(((c2 & 0xF) << 4) | ((c3 & 0x3C) >> 2)));
+
+ /* c4 */
+ do {
+ c4 = str.charCodeAt(i++) & 0xff;
+ if(c4 == 61)
+ return out.join('');
+ c4 = decodeChars[c4];
+ } while(i < length && c4 == -1);
+
+ if(c4 == -1)
+ break;
+
+ out.push(String.fromCharCode(((c3 & 0x03) << 6) | c4));
+ }
+
+ return out.join('');
+ };
+
+ var len = function (object) {
+ if (object.length !== undefined) {
+ return object.length;
+ } else if (object.getLength !== undefined) {
+ return object.getLength();
+ } else {
+ return undefined;
+ }
+ };
+})(Base64);
473 _attachments/script/couch.js
@@ -0,0 +1,473 @@
+// Licensed under the Apache License, Version 2.0 (the "License"); you may not
+// use this file except in compliance with the License. You may obtain a copy of
+// the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+// License for the specific language governing permissions and limitations under
+// the License.
+
+// A simple class to represent a database. Uses XMLHttpRequest to interface with
+// the CouchDB server.
+
+function CouchDB(name, httpHeaders) {
+ this.name = name;
+ this.uri = "/" + encodeURIComponent(name) + "/";
+
+ // The XMLHttpRequest object from the most recent request. Callers can
+ // use this to check result http status and headers.
+ this.last_req = null;
+
+ this.request = function(method, uri, requestOptions) {
+ requestOptions = requestOptions || {};
+ requestOptions.headers = combine(requestOptions.headers, httpHeaders);
+ return CouchDB.request(method, uri, requestOptions);
+ };
+
+ // Creates the database on the server
+ this.createDb = function() {
+ this.last_req = this.request("PUT", this.uri);
+ CouchDB.maybeThrowError(this.last_req);
+ return JSON.parse(this.last_req.responseText);
+ };
+
+ // Deletes the database on the server
+ this.deleteDb = function() {
+ this.last_req = this.request("DELETE", this.uri);
+ if (this.last_req.status == 404) {
+ return false;
+ }
+ CouchDB.maybeThrowError(this.last_req);
+ return JSON.parse(this.last_req.responseText);
+ };
+
+ // Save a document to the database
+ this.save = function(doc, options) {