|
|
|
@ -558,7 +558,7 @@ var Common = require('./Common');
|
|
|
|
|
var Operation = module.exports.Operation = require('./Operation');
|
|
|
|
|
var Patch = require('./Patch');
|
|
|
|
|
var Message = require('./Message');
|
|
|
|
|
var Sha = require('./SHA256');
|
|
|
|
|
var Sha = module.exports.Sha = require('./SHA256');
|
|
|
|
|
|
|
|
|
|
var ChainPad = {};
|
|
|
|
|
|
|
|
|
@ -574,7 +574,9 @@ var enterChainPad = function (realtime, func) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var debug = function (realtime, msg) {
|
|
|
|
|
if (realtime.logLevel > 0) {
|
|
|
|
|
console.log("[" + realtime.userName + "] " + msg);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var schedule = function (realtime, func, timeout) {
|
|
|
|
@ -707,12 +709,16 @@ var onPong = function (realtime, msg) {
|
|
|
|
|
|
|
|
|
|
var create = ChainPad.create = function (userName, authToken, channelId, initialState, config) {
|
|
|
|
|
|
|
|
|
|
config = config || {};
|
|
|
|
|
|
|
|
|
|
var realtime = {
|
|
|
|
|
type: 'ChainPad',
|
|
|
|
|
|
|
|
|
|
authDoc: '',
|
|
|
|
|
|
|
|
|
|
config: config || {},
|
|
|
|
|
config: config,
|
|
|
|
|
|
|
|
|
|
logLevel: typeof(config.logLevel) !== 'undefined'? config.logLevel: 1,
|
|
|
|
|
|
|
|
|
|
userName: userName,
|
|
|
|
|
authToken: authToken,
|
|
|
|
|