Skip to content

Commit

Permalink
Merge pull request #177 from tomvantilburg/master
Browse files Browse the repository at this point in the history
merge from Tom
  • Loading branch information
tomvantilburg committed Mar 18, 2015
2 parents 0b5cb56 + 091962d commit 8e34cae
Show file tree
Hide file tree
Showing 146 changed files with 54 additions and 3,266 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules
tmp
demo.obs
*.log
config
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion dist/cow.js
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ Cow.syncstore.prototype =
**/
_addRecord: function(config){
if (!config.source || !config.data){
log.warn('Wrong input: ' + config);
console.warn('Wrong input: ' + config);
return false;
}
var promise = null;
Expand Down
3 changes: 2 additions & 1 deletion dist/cow.min.js

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions dist/cow.node.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*! loglevel - v1.1.0 - https://github.com/pimterry/loglevel - (c) 2014 Tim Perry - licensed MIT */
!function(a,b){"object"==typeof module&&module.exports&&"function"==typeof require?module.exports=b():"function"==typeof define&&"object"==typeof define.amd?define(b):a.log=b()}(this,function(){function a(a){return typeof console===k?j:void 0===console[a]?void 0!==console.log?b(console,"log"):j:b(console,a)}function b(a,b){var d=a[b];if(void 0!==d.bind)return a[b].bind(a);if(void 0===Function.prototype.bind)return c(d,a);try{return Function.prototype.bind.call(a[b],a)}catch(e){return c(d,a)}}function c(a,b){return function(){Function.prototype.apply.apply(a,[b,arguments])}}function d(a){for(var b=0;b<l.length;b++)i[l[b]]=a(l[b])}function e(){return typeof window!==k&&void 0!==window.document&&void 0!==window.document.cookie}function f(){try{return typeof window!==k&&void 0!==window.localStorage&&null!==window.localStorage}catch(a){return!1}}function g(a){var b,c=!1;for(var d in i.levels)if(i.levels.hasOwnProperty(d)&&i.levels[d]===a){b=d;break}if(f())try{window.localStorage.loglevel=b}catch(g){c=!0}else c=!0;c&&e()&&(window.document.cookie="loglevel="+b+";")}function h(){var a;if(f()&&(a=window.localStorage.loglevel),void 0===a&&e()){var b=m.exec(window.document.cookie)||[];a=b[1]}void 0===i.levels[a]&&(a="WARN"),i.setLevel(i.levels[a])}var i={},j=function(){},k="undefined",l=["trace","debug","info","warn","error"],m=/loglevel=([^;]+)/;i.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},i.setLevel=function(b){if("number"==typeof b&&b>=0&&b<=i.levels.SILENT){if(g(b),b===i.levels.SILENT)return void d(function(){return j});if(typeof console===k)return d(function(a){return function(){typeof console!==k&&(i.setLevel(b),i[a].apply(i,arguments))}}),"No console available for logging";d(function(c){return b<=i.levels[c.toUpperCase()]?a(c):j})}else{if("string"!=typeof b||void 0===i.levels[b.toUpperCase()])throw"log.setLevel() called with invalid level: "+b;i.setLevel(i.levels[b.toUpperCase()])}},i.enableAll=function(){i.setLevel(i.levels.TRACE)},i.disableAll=function(){i.setLevel(i.levels.SILENT)};var n=typeof window!==k?window.log:void 0;return i.noConflict=function(){return typeof window!==k&&window.log===i&&(window.log=n),i},h(),i});
(function(){

// Create local references to array methods we'll want to use later.
Expand Down Expand Up @@ -957,7 +955,7 @@ Cow.syncstore.prototype =
**/
_addRecord: function(config){
if (!config.source || !config.data){
log.warn('Wrong input: ' + config);
console.warn('Wrong input: ' + config);
return false;
}
var promise = null;
Expand Down
4 changes: 2 additions & 2 deletions dist/cow.node.min.js

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions dist/superpeer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
configfile = process.argv[2];
config = require('./'+ configfile);

_ = require('../node_modules/underscore/underscore.js')._
Promise = require('../node_modules/es6-promise').Promise;
Events = require('../src/events.js');

WebSocket = require('websocket').client;
pg = require('pg').native;
//Set global dbUrl
GLOBAL.dbUrl = config.dbUrl;
//Set env var to accept all certificates
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
Cow = require('./cow.node.js');


core = new Cow.core({
herdname: config.herdname,
maxage: 1000 * 60 * 60 * 24 * 365 //one year
});
core.socketservers({
_id: 'default',
data: {
protocol: config.protocol,
ip: config.ip,
port: config.port,
dir: config.dir}
});
core.socketserver('default');
core.connect();
core.userStore().loaded.then(function(){
console.log(core.users().length, ' users loaded');
});

core.projectStore().loaded.then(function(){
console.log(core.projects().length, ' projects loaded');
core.peer().data('superpeer', true).sync();
console.log('My peerid: ', core.peerid());
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion src/cow2.syncstore.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Cow.syncstore.prototype =
**/
_addRecord: function(config){
if (!config.source || !config.data){
log.warn('Wrong input: ' + config);
console.warn('Wrong input: ' + config);
return false;
}
var promise = null;
Expand Down
Loading

0 comments on commit 8e34cae

Please sign in to comment.