Skip to content

Commit

Permalink
Merge pull request #207 from tomvantilburg/master
Browse files Browse the repository at this point in the history
server obsolete and new node version
  • Loading branch information
tomvantilburg committed Mar 7, 2016
2 parents 202fa30 + 5d49648 commit 10ad7bc
Show file tree
Hide file tree
Showing 59 changed files with 3,261 additions and 10 deletions.
27 changes: 27 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@ module.exports = function(grunt){
// the location of the resulting JS file
dest: 'dist/<%= pkg.name %>.node.js'
},
nodb: {
src: [
//'lib/loglevel/loglevel.min.js',
'src/events.js',
'src/cow2.utils.js',
'src/cow2.record.js',
'src/cow2.nodb.js', //this one differs from the db version
'src/cow2.syncstore.js',
'src/cow2.peer.js',
'src/cow2.socketserver.js',
'src/cow2.user.js',
'src/cow2.group.js',
'src/cow2.item.js',
'src/cow2.project.js',
'src/cow2.websocket.node.js',
'src/cow2.messenger.js',
'src/cow2.core.js'
],
// the location of the resulting JS file
dest: 'dist/<%= pkg.name %>.nodb.js'
},
superpeer: {
src: [
'src/superpeer/superpeer.js'
Expand Down Expand Up @@ -65,6 +86,11 @@ module.exports = function(grunt){
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
},
nodb: {
files: {
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
},
node: {
files: {
'dist/<%= pkg.name %>.node.min.js': ['<%= concat.node.dest %>']
Expand All @@ -83,6 +109,7 @@ module.exports = function(grunt){
grunt.registerTask('watch', ['concat','uglify']);
grunt.registerTask('default', ['concat','uglify']);
//Node requires some small differences, most notably the database
grunt.registerTask('node', ['concat:nodb','uglify:nodb']);
grunt.registerTask('node', ['concat:node','uglify:node']);
grunt.registerTask('superpeer', ['concat:superpeer']);
};
5 changes: 3 additions & 2 deletions dist/cow.js
Original file line number Diff line number Diff line change
Expand Up @@ -2516,11 +2516,12 @@ Cow.messenger.prototype._onMessage = function(message){
var PEERID = core.peerid();
var action = data.action;
if (typeof(data.payload) == 'object'){
var payload = data.payload;
data.payload = data.payload;
}
else {
var payload = JSON.parse(decode_utf8(lzw_decode(data.payload)));
data.payload = JSON.parse(decode_utf8(lzw_decode(data.payload)));
}
var payload = data.payload;
var target = data.target;
if (sender != PEERID){
//console.info('Receiving '+JSON.stringify(data));
Expand Down
4 changes: 2 additions & 2 deletions dist/cow.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 10ad7bc

Please sign in to comment.