Permalink
Browse files

Merge https://github.com/kidrecursive/mobilefuton

  • Loading branch information...
2 parents 5ad3c31 + 32d7b2c commit be3c7d08338b999ec4fa88f018ebf369cd87ca6b @daleharvey committed Nov 6, 2011
Showing with 22 additions and 1 deletion.
  1. +2 −1 .gitignore
  2. +2 −0 _attachments/index.html
  3. +18 −0 _attachments/js/mobile.futon.js
View
@@ -1 +1,2 @@
-.couchapprc
+.couchapprc
+.project
View
@@ -199,6 +199,8 @@ <h1 id="title">Mobile Futon</h1>
<div style="padding:10px;">
<a href="#/db/{{db}}/_create_doc/" class="button">Create New Document</a>
<br />
+ <a href="#/db/{{db}}/_compact/" class="button">Compact Database</a>
+ <br />
<a href="#/db/{{db}}/_delete/" class="button warning">Delete</a>
</div>
@@ -180,6 +180,15 @@ var MobileFuton = (function () {
});
+ router.get('#/db/:database/_compact/', function (rtr, db) {
+ var data = { action: "#compact_database"
+ , cancel: "#/db/" + db + "/"
+ , notice: "compact the database " + db
+ , action_btn: "Compact"
+ , form: [{key:"db", value:db}] };
+ renderer.render('confirm_tpl', data, rtr);
+ });
+
router.get('#/db/:db/views/*view', function (rtr, db, view) {
var dbname = decodeURIComponent(db)
@@ -562,6 +571,15 @@ var MobileFuton = (function () {
});
});
+ router.post('#compact_database', function (_, e, form) {
+ $.couch.db(form.db).compact({
+ fail : function(e){
+ console.log(e);
+ }
+ }).then(function() {
+ location.href = "#/db/";
+ });
+ });
router.post('#delete_key', function (_, e, form) {
$.couch.db(form.db).openDoc(form.doc).then(function(json) {

0 comments on commit be3c7d0

Please sign in to comment.