Permalink
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...
0 parents commit 71db4320486acbe2a9eabffaffbe1973674524ea @BigBlueHat committed Jun 22, 2012
Showing with 37,663 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
  162. +433 −0 _attachments/spec/jquery_couch_js_instance_methods_2_spec.js
  163. +540 −0 _attachments/spec/jquery_couch_js_instance_methods_3_spec.js
  164. +46 −0 _attachments/spec/run.html
  165. +1,089 −0 _attachments/style/layout.css
  166. +347 −0 _attachments/style/ui-lightness/jquery-ui-1.8.11.custom.css
  167. +39 −0 _attachments/templates/changes.mustache
  168. +124 −0 _attachments/templates/config.mustache
  169. +65 −0 _attachments/templates/database.mustache
  170. +533 −0 _attachments/templates/document.mustache
  171. +94 −0 _attachments/templates/index.mustache
  172. +158 −0 _attachments/templates/replicator.mustache
  173. +94 −0 _attachments/templates/stats.mustache
  174. +83 −0 _attachments/templates/tests.mustache
  175. +140 −0 _attachments/templates/view.mustache
  176. +1 −0 _id
@@ -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!
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
Oops, something went wrong.

0 comments on commit 71db432

Please sign in to comment.