moved files towards new structure. fixes #22

This commit is contained in:
logsol 2012-07-21 21:20:29 +02:00
parent 8cf8f057bb
commit 9de3147406
40 changed files with 0 additions and 110 deletions

View file

@ -0,0 +1,25 @@
define(["Protocol/Parser"], function(Parser) {
var Helper = {}
Helper.encodeCommand = function(command, options){
return Parser.encode(Helper.assemble(command, options));
}
Helper.assemble = function(command, options){
var commands = {};
commands[command] = options || null;
return commands;
}
Helper.runCommands = function(message, callback){
var commands = Parser.decode(message);
for(var command in commands) {
callback(command, commands[command]);
}
}
return Helper;
});

View file

@ -0,0 +1,14 @@
define(function() {
var Parser = {};
Parser.encode = function(message){
return JSON.stringify(message);
}
Parser.decode = function(message){
return JSON.parse(message);
}
return Parser;
});