From 96768ef6bb691328e7a5d0b67c4ab4e3236cfd6c Mon Sep 17 00:00:00 2001 From: James Spencer Date: Mon, 29 Dec 2014 17:58:50 -0700 Subject: [PATCH 1/8] forcing change to cleaner angular local storage --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index bb9b1fe..cd6c7c1 100644 --- a/bower.json +++ b/bower.json @@ -22,8 +22,8 @@ "npm-debug.log" ], "dependencies": { - "pouchdb": "~3.0.6", - "ngStorage": "~0.1.8", + "pouchdb": "~3.2.0", + "angularLocalStorage": "~0.2.0", "angular-uuid-service": "~0.0.1" } } From d5b20ab14b4303812319d223f2584396f4a177df Mon Sep 17 00:00:00 2001 From: James Spencer Date: Mon, 29 Dec 2014 20:13:13 -0700 Subject: [PATCH 2/8] updating version --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index cd6c7c1..59cffb8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ng-pouch", - "version": "0.0.1", + "version": "0.0.2", "authors": [ "jrhicks " ], From 3dd59d144fcee9c70a84f35c36b2d53ddc817d14 Mon Sep 17 00:00:00 2001 From: James Spencer Date: Mon, 29 Dec 2014 20:17:09 -0700 Subject: [PATCH 3/8] adding closure --- ngPouch.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ngPouch.js b/ngPouch.js index e89e320..4e0b2f2 100644 --- a/ngPouch.js +++ b/ngPouch.js @@ -1,3 +1,4 @@ +(function () { //start closure 'use strict'; angular.module('ngPouch', ['angularLocalStorage']) @@ -489,4 +490,6 @@ angular.module('ngPouch', ['angularLocalStorage']) service.init(); return service }); + +})(); //end closure From 50c635e67d7aa26ba9fe4384fb9414ebc086c729 Mon Sep 17 00:00:00 2001 From: James Spencer Date: Mon, 29 Dec 2014 20:22:40 -0700 Subject: [PATCH 4/8] Update Readme.md --- Readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Readme.md b/Readme.md index 058ebbf..5597650 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,8 @@ ngPouch ======= +This is a fork from https://github.com/jrhicks/ngPouch + [PouchDB](http://pouchdb.com/) AngularJS adapter to monitor and manage replication status and 3-way data binding PouchDB supports live ( or "continious") replication where changes are propogated between the two databases as the changes occur. From b6f5951ff220d0bbd51cebd9d7fb61375e171dcc Mon Sep 17 00:00:00 2001 From: James Spencer Date: Mon, 29 Dec 2014 20:27:48 -0700 Subject: [PATCH 5/8] removing example --- example/app.js | 7 ---- example/bower.json | 22 ------------ example/config.json | 1 - example/package.json | 16 --------- example/www/app.js | 6 ---- example/www/index.html | 64 ----------------------------------- example/www/pouch_conflict.js | 29 ---------------- example/www/todo-ctrl.js | 61 --------------------------------- example/www/todo.css | 4 --- example/www/todo.js | 32 ------------------ 10 files changed, 242 deletions(-) delete mode 100644 example/app.js delete mode 100644 example/bower.json delete mode 100644 example/config.json delete mode 100644 example/package.json delete mode 100644 example/www/app.js delete mode 100644 example/www/index.html delete mode 100644 example/www/pouch_conflict.js delete mode 100644 example/www/todo-ctrl.js delete mode 100644 example/www/todo.css delete mode 100644 example/www/todo.js diff --git a/example/app.js b/example/app.js deleted file mode 100644 index 702c1f6..0000000 --- a/example/app.js +++ /dev/null @@ -1,7 +0,0 @@ -var express = require('express') -var app = express() - -app.use(express.static(__dirname + '/www')); -app.use(express.static(__dirname + '/bower_components')); -app.listen(process.env.PORT || 9292); - diff --git a/example/bower.json b/example/bower.json deleted file mode 100644 index 5c81cca..0000000 --- a/example/bower.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "ng-pouch-example", - "version": "0.0.1", - "homepage": "https://github.com/jrhicks/ngPouch", - "authors": [ - "jrhicks@cteh.com " - ], - "description": "Example app for ng-pouch", - "license": "MIT", - "private": true, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "ng-pouch": "*", - "angular": "~1.3.0" - } -} diff --git a/example/config.json b/example/config.json deleted file mode 100644 index 9e26dfe..0000000 --- a/example/config.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/example/package.json b/example/package.json deleted file mode 100644 index 93e4c26..0000000 --- a/example/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "test-ng-pouch", - "version": "0.0.1", - "description": "Basic web app and pouchdb-server to test ng-pouch", - "main": "index.js", - "scripts": { - "app": "./node app.js", - "db": "./node_modules/.bin/pouchdb-server -p 5984 -m" - }, - "author": "Jeffrey Hicks", - "license": "MIT", - "dependencies": { - "express": "^4.10.0", - "pouchdb-server": "^0.5.2" - } -} diff --git a/example/www/app.js b/example/www/app.js deleted file mode 100644 index f7727b6..0000000 --- a/example/www/app.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -angular.module('app', [ - 'app.todoCtrl', - 'app.pouch_conflict', - 'app.todo' -]) \ No newline at end of file diff --git a/example/www/index.html b/example/www/index.html deleted file mode 100644 index e228aaf..0000000 --- a/example/www/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
-

Create Todo

- -
- - -
- -

Edit Todos

- -
    -
  • - - - -
  • -
- -
- -
-

Replicate

-

- {{ng_pouch.status.localChanges}} Local Changes -

- - -
- - {{ng_pouch.statusTitle()}} -
- -
- - {{ng_pouch.statusTitle()}} -
- - -
-

Conflicts

- -
-{{conflicts | json}}
-
- - \ No newline at end of file diff --git a/example/www/pouch_conflict.js b/example/www/pouch_conflict.js deleted file mode 100644 index 752ca8d..0000000 --- a/example/www/pouch_conflict.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -// http://guide.couchdb.org/draft/conflicts.html - -angular.module('app.pouch_conflict', ['ngPouch']) - .service('PouchConflict', function(ngPouch) { - - return { - all: function() { - var x = function(doc) { - if(doc._conflicts) { - emit(doc._id, null); - } - } - return ngPouch.db.query(x, {include_docs: true, conflicts: true}); - - return ngPouch.db.query(x).then( - function(res) { - return ngPouch.db.allDocs({ - conflicts: true, - include_docs : true, - keys: res.rows.map(function(x) {return x.id}) - }); - } - ); - - } - -}}); \ No newline at end of file diff --git a/example/www/todo-ctrl.js b/example/www/todo-ctrl.js deleted file mode 100644 index 43bdd6b..0000000 --- a/example/www/todo-ctrl.js +++ /dev/null @@ -1,61 +0,0 @@ -angular.module('app.todoCtrl', ['ngPouch']) - .controller('TodoController', ['$scope', '$q', 'ngPouch','Todo', 'PouchConflict', - function($scope, $q, ngPouch, Todo, PouchConflict) { - - $scope.form = {}; - $scope.todos = []; - $scope.logged_in = false; - $scope.ng_pouch = ngPouch; - //ngPouch.reset(); - - ngPouch.publish(function() { - var p1 = Todo.all() - .then( function(results) { - $scope.todos = results["rows"]; - }); - - var p2 = PouchConflict.all() - .then ( function(results) { - $scope.conflicts = results; - - }); - return $q.all([p1,p2]); - }); - - $scope.updateTodo = function (todo) { - Todo.update(todo); - }; - - $scope.addTodo = function () { - Todo.add({text:$scope.todoText, done:false}); - $scope.todoText = ''; - }; - - $scope.remaining = function() { - var count = 0; - angular.forEach($scope.todos, function(todo) { - count += todo.doc.done ? 0 : 1; - }); - return count; - }; - - $scope.login = function() { - ngPouch.saveSettings({database:'http://localhost:5984/test20', - stayConnected: true }); - $scope.logged_in = true; - - }; - - $scope.logoff = function() { - ngPouch.logoff(); - $scope.logged_in = false; - }; - - - $scope.archive = function() { - angular.forEach($scope.todos, function(todo) { - Todo.destroy(todo); - }); - }; - - }]); \ No newline at end of file diff --git a/example/www/todo.css b/example/www/todo.css deleted file mode 100644 index 938000c..0000000 --- a/example/www/todo.css +++ /dev/null @@ -1,4 +0,0 @@ -.done-true { - text-decoration: line-through; - color: grey; -} \ No newline at end of file diff --git a/example/www/todo.js b/example/www/todo.js deleted file mode 100644 index a34016b..0000000 --- a/example/www/todo.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -angular.module('app.todo', ['ngPouch','uuid']) - .service('Todo', function(rfc4122, ngPouch, $rootScope) { - - return { - - destroy: function(obj) { - ngPouch.db.remove(obj.doc); - }, - - update: function(obj) { - ngPouch.db.put(obj.doc); - }, - - add: function(obj) { - obj._id = 'todo_'+rfc4122.v4(); - obj.doc_type = 'todo'; - obj.created_at = new Date(); - return ngPouch.db.put(obj); - }, - - all: function() { - var allTodos = function(doc) { - if (doc.doc_type === 'todo') { - emit(doc.created_at, doc._id); - } - } - return ngPouch.db.query(allTodos, {descending: true, include_docs : true}); - } - }; - }); \ No newline at end of file From 7f883e391ae0c0420a323c3c861e0bba9d5a06b5 Mon Sep 17 00:00:00 2001 From: James Spencer Date: Mon, 29 Dec 2014 20:36:06 -0700 Subject: [PATCH 6/8] adding dot bower --- .bower.json | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .bower.json diff --git a/.bower.json b/.bower.json new file mode 100644 index 0000000..bebf06f --- /dev/null +++ b/.bower.json @@ -0,0 +1,38 @@ +{ + "name": "ng-pouch", + "version": "0.0.1", + "authors": [ + "jrhicks " + ], + "description": "Angular service to persist remote connection settings and maintain continuous replication", + "main": "ngPouch.js", + "keywords": [ + "pouchdb", + "angularjs" + ], + "license": "MIT", + "homepage": "https://github.com/jrhicks/ngPouch", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests", + ".idea", + "npm-debug.log" + ], + "dependencies": { + "pouchdb": "~3.0.6", + "ngStorage": "~0.1.8", + "angular-uuid-service": "~0.0.1" + }, + "_release": "0.0.1", + "_resolution": { + "type": "version", + "tag": "0.0.1", + "commit": "129bca02c717f21c406eab15a18d24ce4abc47d8" + }, + "_source": "https://github.com/jfspencer/ngPouch.git", + "_target": "*", + "_originalSource": "https://github.com/jfspencer/ngPouch.git" +} \ No newline at end of file From 92521d0be7681884a115b43fe84e35f1313621b9 Mon Sep 17 00:00:00 2001 From: James Spencer Date: Mon, 29 Dec 2014 20:39:56 -0700 Subject: [PATCH 7/8] updating .bower file --- .bower.json | 14 +++++++------- bower.json | 29 ----------------------------- 2 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 bower.json diff --git a/.bower.json b/.bower.json index bebf06f..bee6805 100644 --- a/.bower.json +++ b/.bower.json @@ -1,6 +1,6 @@ { - "name": "ng-pouch", - "version": "0.0.1", + "name": "jn-pouch", + "version": "0.0.2", "authors": [ "jrhicks " ], @@ -22,15 +22,15 @@ "npm-debug.log" ], "dependencies": { - "pouchdb": "~3.0.6", - "ngStorage": "~0.1.8", + "pouchdb": "~3.2.0", + "angularLocalStorage": "~0.2.0", "angular-uuid-service": "~0.0.1" }, - "_release": "0.0.1", + "_release": "0.0.2", "_resolution": { "type": "version", - "tag": "0.0.1", - "commit": "129bca02c717f21c406eab15a18d24ce4abc47d8" + "tag": "0.0.2", + "commit": "b6f5951ff220d0bbd51cebd9d7fb61375e171dcc" }, "_source": "https://github.com/jfspencer/ngPouch.git", "_target": "*", diff --git a/bower.json b/bower.json deleted file mode 100644 index 59cffb8..0000000 --- a/bower.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "ng-pouch", - "version": "0.0.2", - "authors": [ - "jrhicks " - ], - "description": "Angular service to persist remote connection settings and maintain continuous replication", - "main": "ngPouch.js", - "keywords": [ - "pouchdb", - "angularjs" - ], - "license": "MIT", - "homepage": "https://github.com/jrhicks/ngPouch", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests", - ".idea", - "npm-debug.log" - ], - "dependencies": { - "pouchdb": "~3.2.0", - "angularLocalStorage": "~0.2.0", - "angular-uuid-service": "~0.0.1" - } -} From e331cd010a6439c0c341ed7444e1c5749bc51910 Mon Sep 17 00:00:00 2001 From: James Spencer Date: Mon, 29 Dec 2014 20:41:47 -0700 Subject: [PATCH 8/8] remove bower --- .bower.json | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .bower.json diff --git a/.bower.json b/.bower.json deleted file mode 100644 index bee6805..0000000 --- a/.bower.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "jn-pouch", - "version": "0.0.2", - "authors": [ - "jrhicks " - ], - "description": "Angular service to persist remote connection settings and maintain continuous replication", - "main": "ngPouch.js", - "keywords": [ - "pouchdb", - "angularjs" - ], - "license": "MIT", - "homepage": "https://github.com/jrhicks/ngPouch", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests", - ".idea", - "npm-debug.log" - ], - "dependencies": { - "pouchdb": "~3.2.0", - "angularLocalStorage": "~0.2.0", - "angular-uuid-service": "~0.0.1" - }, - "_release": "0.0.2", - "_resolution": { - "type": "version", - "tag": "0.0.2", - "commit": "b6f5951ff220d0bbd51cebd9d7fb61375e171dcc" - }, - "_source": "https://github.com/jfspencer/ngPouch.git", - "_target": "*", - "_originalSource": "https://github.com/jfspencer/ngPouch.git" -} \ No newline at end of file