added support for namespaces on types

This commit is contained in:
DadaMonad
2015-03-09 17:38:26 +00:00
parent 148e46f043
commit 446560d9e8
14 changed files with 546 additions and 356 deletions

View File

@@ -131,7 +131,7 @@ module.exports = {
for (_i = 0, _len = hb.length; _i < _len; _i++) {
o = hb[_i];
_hb.push(o);
if (_hb.length > 30) {
if (_hb.length > 10) {
this.broadcast({
sync_step: "applyHB_",
data: _hb
@@ -159,7 +159,7 @@ module.exports = {
for (_i = 0, _len = hb.length; _i < _len; _i++) {
o = hb[_i];
_hb.push(o);
if (_hb.length > 30) {
if (_hb.length > 10) {
this.broadcast({
sync_step: "applyHB_",
data: _hb
@@ -221,7 +221,7 @@ module.exports = {
for (_j = 0, _len1 = hb.length; _j < _len1; _j++) {
o = hb[_j];
_hb.push(o);
if (_hb.length > 30) {
if (_hb.length > 10) {
sendApplyHB({
sync_step: "applyHB_",
data: _hb

View File

@@ -190,11 +190,18 @@ module.exports = function() {
};
Operation.prototype.getCustomType = function() {
var Type, t, _i, _len, _ref;
if (this.custom_type == null) {
throw new Error("This operation was not initialized with a custom type");
}
if (this.custom_type.constructor === String) {
this.custom_type = new this.custom_types[this.custom_type]();
Type = this.custom_types;
_ref = this.custom_type.split(".");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
t = _ref[_i];
Type = Type[t];
}
this.custom_type = new Type();
this.custom_type._setModel(this);
}
return this.custom_type;