This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

sync

  • Loading branch information...
barbalex committed Sep 11, 2014
1 parent f264904 commit 4d0bef0b9c57d99d633750a99c6144797ef9b02e
Showing with 25 additions and 17 deletions.
  1. +10 −2 gulp-tasks/watch.js
  2. +2 −2 vendor/couchapp/_attachments/evab.js
  3. +13 −13 vendor/couchapp/_attachments/modules/dbSync.js
View
@@ -1,7 +1,8 @@
var gulp = require('gulp');
return gulp.task('watch', function() {
gulp.watch([
gulp.watch(
[
'_attachments/*',
'-_attachments/style',
'vendor/couchapp/_attachments/*',
@@ -13,7 +14,14 @@ return gulp.task('watch', function() {
],
['dev_src_1', 'dev_src_2']
);
gulp.watch(['_attachments/style/*', '-_attachments/style/main.css', '-_attachments/style/evab.min.css'], ['dev_style']);
gulp.watch(
[
'_attachments/style/*',
'-_attachments/style/main.css',
'-_attachments/style/evab.min.css'
],
['dev_style']
);
// browserify soll wissen, das gewatched wird
global.isWatching = true;
});
@@ -4,8 +4,8 @@ Diese Funktionen werden in evab auf mehreren Seiten benutzt
window.em = window.em || {};
var sync = require('./modules/dbSync');
sync();
//var sync = require('./modules/dbSync');
//sync();
window.em.melde = function(Meldung) {
'use strict';
@@ -4,22 +4,22 @@
'use strict';
var PouchDB = require('pouchdb'),
db = new PouchDB('ab'),
remoteCouch = 'http://barbalex:dLhdMg12@127.0.0.1:5984/evab';
exports.sync = function() {
var PouchDB = require('pouchdb'),
db = new PouchDB('ab'),
remoteCouch = 'http://barbalex:dLhdMg12@127.0.0.1:5984/evab';
function sync() {
if (remoteCouch) {
var opts = {live: true};
db.replicate.to(remoteCouch, opts, syncError);
db.replicate.from(remoteCouch, opts, syncError);
function sync() {
if (remoteCouch) {
var opts = {live: true};
db.replicate.to(remoteCouch, opts, syncError);
db.replicate.from(remoteCouch, opts, syncError);
}
}
}
function syncError() {
console.log('error syncing');
}
function syncError() {
console.log('error syncing');
}
exports.sync = function() {
return sync();
};

0 comments on commit 4d0bef0

Please sign in to comment.