Added grunt minifyer

This commit is contained in:
Kevin Jahns 2014-08-05 17:04:39 +02:00
parent 7660771cea
commit c1194a49ea
81 changed files with 2644 additions and 2406 deletions

View File

@ -10,14 +10,14 @@ module.exports = (grunt) ->
sourceMap: true
expand: true
src: ["lib/**/*.coffee"]
dest: "dest/lib"
dest: "dest/"
ext: ".js"
test:
#options:
#bare: true
expand: true
src: ["test/**/*.coffee"]
dest: "dest/test"
dest: "dest/"
ext: ".js"
watch:
@ -32,7 +32,7 @@ module.exports = (grunt) ->
"<%= coffee.test.src %>"
"examples/*"
]
tasks: ["coffeelint", "literate", "browserify", "test", "codo"]
tasks: ["build"]
simplemocha:
all:
@ -65,22 +65,36 @@ module.exports = (grunt) ->
options:
name: "Yatta!"
title: "Yatta! Documentation"
extras: ["LICENSE-LGPL"]
extras: ["LICENSE-LGPL", "examples/README.md", "examples/IwcJson.md"]
#undocumented: yes
verbose: false
stats: true
src: ["./lib"]
browserify:
dist:
dest:
files:
'dest/browser/Yatta_test.js': ['test/**/*.coffee']
'dest/browser/Connectors/IwcConnector.js': ['lib/Connectors/IwcConnector.coffee']
options:
transform: ['coffeeify']
debug: true
bundleOptions: {debug: true}
# Serve files via http-server
lib:
files:
'dest/browser/Frameworks/JsonIwcYatta.js': ['./lib/Frameworks/JsonYatta.coffee', './lib/Connectors/IwcConnector.coffee']
options:
transform: ['coffeeify']
debug: false
bundleOptions: {debug: false}
# Serve files via http-server
uglify:
browser:
files: [
expand: true
cwd: './dest/browser/'
src: '**/*.js'
dest: './dest/browser'
ext: '.min.js'
]
connect:
server:
options:
@ -105,6 +119,7 @@ module.exports = (grunt) ->
# These plugins provide necessary tasks.
grunt.loadNpmTasks "grunt-browserify"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.loadNpmTasks "grunt-contrib-watch"
@ -113,6 +128,7 @@ module.exports = (grunt) ->
grunt.loadNpmTasks "grunt-coffeelint"
grunt.loadNpmTasks "grunt-codo"
grunt.registerTask "default", ["coffee","coffeelint", "literate", "browserify", "simplemocha", "watch"]
grunt.registerTask "build", ["test", "coffee","coffeelint", "literate", "browserify", "uglify", "codo"]
grunt.registerTask "default", ["build", "watch"]
grunt.registerTask "production", ["coffee"]
grunt.registerTask "test", ["simplemocha"]

View File

@ -1,4 +1,4 @@
# Yatta!
A Collaboration Framework for arbitrary data structures that is _not_ based on the Operational Transformation.
A Collaboration Framework for arbitrary data structures that is _not_ based on Operational Transformation.

View File

@ -1,130 +0,0 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var createIwcConnector;
createIwcConnector = function(callback) {
var IwcConnector, duiClient, get_root_intent, init, iwcHandler, received_HB, root_element;
iwcHandler = {};
duiClient = new DUIClient();
duiClient.connect((function(_this) {
return function(intent) {
var _ref;
return (_ref = iwcHandler[intent.action]) != null ? _ref.map(function(f) {
return setTimeout(function() {
return f(intent);
}, 0);
}) : void 0;
};
})(this));
duiClient.initOK();
root_element = null;
received_HB = null;
IwcConnector = (function() {
function IwcConnector(engine, HB, execution_listener, yatta) {
var receive_, sendRootElement, send_;
this.engine = engine;
this.HB = HB;
this.execution_listener = execution_listener;
this.yatta = yatta;
this.duiClient = duiClient;
this.iwcHandler = iwcHandler;
send_ = (function(_this) {
return function(o) {
return _this.send(o);
};
})(this);
this.execution_listener.push(send_);
receive_ = (function(_this) {
return function(intent) {
var o;
o = intent.extras;
return _this.receive(o);
};
})(this);
this.iwcHandler["Yatta_new_operation"] = [receive_];
if (root_element != null) {
this.engine.applyOps(received_HB);
}
sendRootElement = (function(_this) {
return function() {
var json;
json = {
root_element: _this.yatta.getRootElement(),
HB: _this.yatta.getHistoryBuffer()._encode()
};
return _this.sendIwcIntent("Yatta_push_root_element", json);
};
})(this);
this.iwcHandler["Yatta_get_root_element"] = [sendRootElement];
}
IwcConnector.prototype.getRootElement = function() {
return root_element;
};
IwcConnector.prototype.send = function(o) {
if (o.uid.creator === this.HB.getUserId() && (typeof o.uid.op_number !== "string")) {
return this.sendIwcIntent("Yatta_new_operation", o);
}
};
IwcConnector.prototype.receive = function(o) {
if (o.uid.creator !== this.HB.getUserId()) {
return this.engine.applyOp(o);
}
};
IwcConnector.prototype.sendIwcIntent = function(action_name, content) {
var intent;
intent = {
action: action_name,
component: "",
data: "",
dataType: "",
extras: content
};
return this.duiClient.sendIntent(intent);
};
IwcConnector.prototype.sync = function() {
throw new Error("Can't use this a.t.m.");
};
return IwcConnector;
})();
get_root_intent = {
action: "Yatta_get_root_element",
component: "",
data: "",
dataType: "",
extras: {}
};
init = function() {
var is_initialized, receiveRootElement;
duiClient.sendIntent(get_root_intent);
is_initialized = false;
receiveRootElement = function(json) {
var proposed_user_id;
proposed_user_id = duiClient.getIwcClient()._componentName;
root_element = json != null ? json.extras.root_element : void 0;
received_HB = json != null ? json.extras.HB : void 0;
if (!is_initialized) {
is_initialized = true;
return callback(IwcConnector, proposed_user_id);
}
};
iwcHandler["Yatta_push_root_element"] = [receiveRootElement];
return setTimeout(receiveRootElement, 800);
};
setTimeout(init, Math.random() * 4000);
return void 0;
};
module.exports = createIwcConnector;
if (typeof window !== "undefined" && window !== null) {
window.createConnector = createIwcConnector;
}
},{}]},{},[1]);

View File

@ -5,16 +5,14 @@ createIwcConnector = function(callback) {
var IwcConnector, duiClient, get_root_intent, init, iwcHandler, received_HB, root_element;
iwcHandler = {};
duiClient = new DUIClient();
duiClient.connect((function(_this) {
return function(intent) {
var _ref;
return (_ref = iwcHandler[intent.action]) != null ? _ref.map(function(f) {
return setTimeout(function() {
return f(intent);
}, 0);
}) : void 0;
};
})(this));
duiClient.connect(function(intent) {
var _ref;
return (_ref = iwcHandler[intent.action]) != null ? _ref.map(function(f) {
return setTimeout(function() {
return f(intent);
}, 0);
}) : void 0;
});
duiClient.initOK();
root_element = null;
received_HB = null;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

52
dest/browser/Yatta_test.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -4,16 +4,14 @@ createIwcConnector = function(callback) {
var IwcConnector, duiClient, get_root_intent, init, iwcHandler, received_HB, root_element;
iwcHandler = {};
duiClient = new DUIClient();
duiClient.connect((function(_this) {
return function(intent) {
var _ref;
return (_ref = iwcHandler[intent.action]) != null ? _ref.map(function(f) {
return setTimeout(function() {
return f(intent);
}, 0);
}) : void 0;
};
})(this));
duiClient.connect(function(intent) {
var _ref;
return (_ref = iwcHandler[intent.action]) != null ? _ref.map(function(f) {
return setTimeout(function() {
return f(intent);
}, 0);
}) : void 0;
});
duiClient.initOK();
root_element = null;
received_HB = null;

View File

@ -0,0 +1,10 @@
{
"version": 3,
"file": "IwcConnector.js",
"sourceRoot": "../../../lib/Connectors/",
"sources": [
"IwcConnector.coffee"
],
"names": [],
"mappings": "AACA,IAAA,kBAAA;;AAAA,kBAAA,GAAqB,SAAC,QAAD,GAAA;AACnB,MAAA,qFAAA;AAAA,EAAA,UAAA,GAAa,EAAb,CAAA;AAAA,EACA,SAAA,GAAgB,IAAA,SAAA,CAAA,CADhB,CAAA;AAAA,EAGA,SAAS,CAAC,OAAV,CAAkB,SAAC,MAAD,GAAA;AAGhB,QAAA,IAAA;4DAAyB,CAAE,GAA3B,CAA+B,SAAC,CAAD,GAAA;aAC7B,UAAA,CAAW,SAAA,GAAA;eACP,CAAA,CAAE,MAAF,EADO;MAAA,CAAX,EAEI,CAFJ,EAD6B;IAAA,CAA/B,WAHgB;EAAA,CAAlB,CAHA,CAAA;AAAA,EAWA,SAAS,CAAC,MAAV,CAAA,CAXA,CAAA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A;;;EAgGA,MAAM,CAAE,eAAR,GAA0B;CAhG1B"
}

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "TestConnector.js",
"sourceRoot": "../../../../lib/Connectors/",
"sourceRoot": "../../../lib/Connectors/",
"sources": [
"TestConnector.coffee"
],

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "Engine.js",
"sourceRoot": "../../../lib/",
"sourceRoot": "../../lib/",
"sources": [
"Engine.coffee"
],

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "JsonYatta.js",
"sourceRoot": "../../../../lib/Frameworks/",
"sourceRoot": "../../../lib/Frameworks/",
"sources": [
"JsonYatta.coffee"
],

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "TextYatta.js",
"sourceRoot": "../../../../lib/Frameworks/",
"sourceRoot": "../../../lib/Frameworks/",
"sources": [
"TextYatta.coffee"
],

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "HistoryBuffer.js",
"sourceRoot": "../../../lib/",
"sourceRoot": "../../lib/",
"sources": [
"HistoryBuffer.coffee"
],

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "BasicTypes.js",
"sourceRoot": "../../../../lib/Types/",
"sourceRoot": "../../../lib/Types/",
"sources": [
"BasicTypes.coffee"
],

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "JsonTypes.js",
"sourceRoot": "../../../../lib/Types/",
"sourceRoot": "../../../lib/Types/",
"sources": [
"JsonTypes.coffee"
],

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "StructuredTypes.js",
"sourceRoot": "../../../../lib/Types/",
"sourceRoot": "../../../lib/Types/",
"sources": [
"StructuredTypes.coffee"
],

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "TextTypes.js",
"sourceRoot": "../../../../lib/Types/",
"sourceRoot": "../../../lib/Types/",
"sources": [
"TextTypes.coffee"
],

View File

@ -1,7 +1,7 @@
{
"version": 3,
"file": "XmlTypes.js",
"sourceRoot": "../../../../lib/Types/",
"sourceRoot": "../../../lib/Types/",
"sources": [
"XmlTypes.coffee"
],

View File

@ -1,10 +0,0 @@
{
"version": 3,
"file": "IwcConnector.js",
"sourceRoot": "../../../../lib/Connectors/",
"sources": [
"IwcConnector.coffee"
],
"names": [],
"mappings": "AACA,IAAA,kBAAA;;AAAA,kBAAA,GAAqB,SAAC,QAAD,GAAA;AACnB,MAAA,qFAAA;AAAA,EAAA,UAAA,GAAa,EAAb,CAAA;AAAA,EACA,SAAA,GAAgB,IAAA,SAAA,CAAA,CADhB,CAAA;AAAA,EAGA,SAAS,CAAC,OAAV,CAAkB,CAAA,SAAA,KAAA,GAAA;WAAA,SAAC,MAAD,GAAA;AAGhB,UAAA,IAAA;8DAAyB,CAAE,GAA3B,CAA+B,SAAC,CAAD,GAAA;eAC7B,UAAA,CAAW,SAAA,GAAA;iBACP,CAAA,CAAE,MAAF,EADO;QAAA,CAAX,EAEI,CAFJ,EAD6B;MAAA,CAA/B,WAHgB;IAAA,EAAA;EAAA,CAAA,CAAA,CAAA,IAAA,CAAlB,CAHA,CAAA;AAAA,EAWA,SAAS,CAAC,MAAV,CAAA,CAXA,CAAA;AAAA,EAaA,YAAA,GAAe,IAbf,CAAA;AAAA,EAcA,WAAA,GAAc,IAdd,CAAA;AAAA,EAqBM;AACS,IAAA,sBAAE,MAAF,EAAW,EAAX,EAAgB,kBAAhB,EAAqC,KAArC,GAAA;AACX,UAAA,gCAAA;AAAA,MADY,IAAC,CAAA,SAAA,MACb,CAAA;AAAA,MADqB,IAAC,CAAA,KAAA,EACtB,CAAA;AAAA,MAD0B,IAAC,CAAA,qBAAA,kBAC3B,CAAA;AAAA,MAD+C,IAAC,CAAA,QAAA,KAChD,CAAA;AAAA,MAAA,IAAC,CAAA,SAAD,GAAa,SAAb,CAAA;AAAA,MACA,IAAC,CAAA,UAAD,GAAc,UADd,CAAA;AAAA,MAGA,KAAA,GAAQ,CAAA,SAAA,KAAA,GAAA;eAAA,SAAC,CAAD,GAAA;iBACN,KAAC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A,kBAAA,GAAqB,SAAC,IAAD,GAAA;AACnB,UAAA,gBAAA;AAAA,MAAA,gBAAA,GAAmB,SAAS,CAAC,YAAV,CAAA,CAAwB,CAAC,cAA5C,CAAA;AAAA,MACA,YAAA,kBAAe,IAAI,CAAE,MAAM,CAAC,qBAD5B,CAAA;AAAA,MAEA,WAAA,kBAAc,IAAI,CAAE,MAAM,CAAC,WAF3B,CAAA;AAGA,MAAA,IAAG,CAAA,cAAH;AACE,QAAA,cAAA,GAAiB,IAAjB,CAAA;eACA,QAAA,CAAS,YAAT,EAAuB,gBAAvB,EAFF;OAJmB;IAAA,CAHrB,CAAA;AAAA,IAUA,UAAW,CAAA,yBAAA,CAAX,GAAwC,CAAC,kBAAD,CAVxC,CAAA;WAWA,UAAA,CAAW,kBAAX,EAA+B,GAA/B,EAZK;EAAA,CA7EP,CAAA;AAAA,EA2FA,UAAA,CAAW,IAAX,EAAkB,IAAI,CAAC,MAAL,CAAA,CAAA,GAAc,IAAhC,CA3FA,CAAA;SA6FA,OA9FmB;AAAA,CAArB,CAAA;;AAAA,MA+FM,CAAC,OAAP,GAAiB,kBA/FjB,CAAA;;;EAgGA,MAAM,CAAE,eAAR,GAA0B;CAhG1B"
}

View File

@ -1,33 +0,0 @@
var Replaceable, y, _,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
y = require("Engine");
_ = require("underscore");
Replaceable = (function(_super) {
__extends(Replaceable, _super);
function Replaceable(user_id, content) {
Replaceable.__super__.constructor.call(this, user_id, []);
this.replace(content);
}
Replaceable.prototype.replace = function(content) {
var o, op;
o = this.HB.getLastOperation();
op = new I(content, this.user_id, this.HB.getOperationCounter(this.user_id), o, o.next_cl);
this.HB.addOperation(op).IT();
return op.toJson();
};
Replaceable.prototype.getContent = function() {
return this.HB.getLastOperation().execute();
};
return Replaceable;
})(y.Engine);
//# sourceMappingURL=ReplaceType.js.map

View File

@ -1,10 +0,0 @@
{
"version": 3,
"file": "ReplaceType.js",
"sourceRoot": "../../../lib/",
"sources": [
"ReplaceType.coffee"
],
"names": [],
"mappings": "AACA,IAAA,iBAAA;EAAA;iSAAA;;AAAA,CAAA,GAAI,OAAA,CAAQ,QAAR,CAAJ,CAAA;;AAAA,CACA,GAAI,OAAA,CAAQ,YAAR,CADJ,CAAA;;AAAA;AAIE,gCAAA,CAAA;;AAAa,EAAA,qBAAC,OAAD,EAAU,OAAV,GAAA;AACX,IAAA,6CAAM,OAAN,EAAe,EAAf,CAAA,CAAA;AAAA,IACA,IAAC,CAAA,OAAD,CAAS,OAAT,CADA,CADW;EAAA,CAAb;;AAAA,wBAIA,OAAA,GAAS,SAAC,OAAD,GAAA;AACP,QAAA,KAAA;AAAA,IAAA,CAAA,GAAI,IAAC,CAAA,EAAE,CAAC,gBAAJ,CAAA,CAAJ,CAAA;AAAA,IACA,EAAA,GAAS,IAAA,CAAA,CAAE,OAAF,EAAW,IAAC,CAAA,OAAZ,EAAqB,IAAC,CAAA,EAAE,CAAC,mBAAJ,CAAwB,IAAC,CAAA,OAAzB,CAArB,EAAwD,CAAxD,EAA2D,CAAC,CAAC,OAA7D,CADT,CAAA;AAAA,IAEA,IAAC,CAAA,EAAE,CAAC,YAAJ,CAAiB,EAAjB,CAAoB,CAAC,EAArB,CAAA,CAFA,CAAA;WAGA,EAAE,CAAC,MAAH,CAAA,EAJO;EAAA,CAJT,CAAA;;AAAA,wBAUA,UAAA,GAAY,SAAA,GAAA;WACV,IAAC,CAAA,EAAE,CAAC,gBAAJ,CAAA,CAAsB,CAAC,OAAvB,CAAA,EADU;EAAA,CAVZ,CAAA;;qBAAA;;GADwB,CAAC,CAAC,OAH5B,CAAA"
}

View File

@ -28,9 +28,9 @@
this.generateReplaceOp = __bind(this.generateReplaceOp, this);
this.generateInsertOp = __bind(this.generateInsertOp, this);
this.number_of_test_cases_multiplier = 1;
this.repeat_this = 10 * this.number_of_test_cases_multiplier;
this.doSomething_amount = 200 * this.number_of_test_cases_multiplier;
this.number_of_engines = 12 + this.number_of_test_cases_multiplier - 1;
this.repeat_this = 1 * this.number_of_test_cases_multiplier;
this.doSomething_amount = 5000 * this.number_of_test_cases_multiplier;
this.number_of_engines = 10 + this.number_of_test_cases_multiplier - 1;
this.time = 0;
this.ops = 0;
this.time_now = 0;
@ -133,7 +133,7 @@
this.ops += number_of_created_operations * this.users.length;
ops_per_msek = Math.floor(this.ops / this.time);
if (test_number != null) {
console.log(("" + test_number + "/" + this.repeat_this + ": Every collaborator (" + this.users.length + ") applied " + this.number_of_created_operations + " ops in a different order.") + (" Over all we consumed " + this.ops + " operations in " + (this.time / 1000) + " seconds (" + ops_per_msek + " ops/msek)."));
console.log(("" + test_number + "/" + this.repeat_this + ": Every collaborator (" + this.users.length + ") applied " + number_of_created_operations + " ops in a different order.") + (" Over all we consumed " + this.ops + " operations in " + (this.time / 1000) + " seconds (" + ops_per_msek + " ops/msek)."));
}
_results = [];
for (i = _j = 0, _ref1 = this.users.length - 1; 0 <= _ref1 ? _j < _ref1 : _j > _ref1; i = 0 <= _ref1 ? ++_j : --_j) {
@ -233,10 +233,16 @@
this.yTest.getSomeUser().val('b', {
'a': {}
});
this.yTest.getSomeUser().val('c', {
'a': 'c'
});
this.yTest.getSomeUser().val('c', {
'a': 'b'
});
return this.yTest.compareAll();
this.yTest.compareAll();
this.yTest.getSomeUser().value.a.a.q.insertText(0, 'AAA');
this.yTest.compareAll();
return expect(this.yTest.getSomeUser().value.a.a.q.val()).to.equal("AAAdtrndtrtdrntdrnrtdnrtdnrtdnrtdnrdnrdt");
});
it("handles some immutable tests", function() {
this.yTest.getSomeUser().val('string', "text", "immutable");

View File

@ -29,6 +29,16 @@
LICENSE-LGPL
</a>
</li>
<li>
<a href='extra/examples/README.md.html' title='examples/README.md'>
examples&#47;README.md
</a>
</li>
<li>
<a href='extra/examples/IwcJson.md.html' title='examples/IwcJson.md'>
examples&#47;IwcJson.md
</a>
</li>
</ul>
<h2>Class Listing A-Z</h2>
<div class='index'>
@ -332,7 +342,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -142,7 +142,7 @@ only one will AddName operation will be executed.</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -157,7 +157,7 @@ This result can be sent to other clients.</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -118,7 +118,7 @@ of the Engine is empty.</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -139,7 +139,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -228,7 +228,7 @@ other operations (it wont executed)</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -156,7 +156,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -256,7 +256,7 @@ TODO (Unused)</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -168,7 +168,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -286,7 +286,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -103,7 +103,7 @@ console.log(w.newProperty == &quot;Awesome&quot;) # true!</code></pre>
<a href='../class/JsonType.html'>JsonType</a>
</li>
<li>
<a href='getter'>https:&#47;&#47;developer.mozilla.org&#47;en-US&#47;docs&#47;Web&#47;JavaScript&#47;Reference&#47;Global_Objects&#47;Object&#47;defineProperty</a>
<a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty'>https:&#47;&#47;developer.mozilla.org&#47;en-US&#47;docs&#47;Web&#47;JavaScript&#47;Reference&#47;Global_Objects&#47;Object&#47;defineProperty</a>
</li>
</ul>
</div>
@ -121,7 +121,7 @@ console.log(w.newProperty == &quot;Awesome&quot;) # true!</code></pre>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -250,7 +250,7 @@ JsonYatta was initialized (Depending on the HistoryBuffer implementation).</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -208,7 +208,7 @@ Doesn&#39;t return left-right delimiter.</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -99,7 +99,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -284,7 +284,7 @@ an easy way to refer to these operations via an uid or object reference.</p><p>F
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -189,7 +189,7 @@ Each Replaceable holds a value that is now replaceable.</p><p>The Word-type has
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -191,7 +191,7 @@ This result can be send to other clients.</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -219,7 +219,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -53,7 +53,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -173,7 +173,7 @@ This result can be send to other clients.</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -239,7 +239,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -241,7 +241,7 @@ to provide replace functionality.</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -38,7 +38,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -34,11 +34,11 @@
</p>
</nav>
<div id='filecontents'>
<h1 id="yatta-">Yatta!</h1><p>A Collaboration Framework for arbitrary data structures that is <em>not</em> based on the Operational Transformation.</p>
<h1 id="yatta-">Yatta!</h1><p>A Collaboration Framework for arbitrary data structures that is <em>not</em> based on Operational Transformation.</p>
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -0,0 +1,176 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>Yatta! Documentation</title>
<script src='../../javascript/application.js'></script>
<script src='../../javascript/search.js'></script>
<link rel='stylesheet' href='../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../extra/README.md.html' title='Yatta!'>
Yatta!
</a>
&raquo;
<a href='../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>examples</span>
&raquo;
<span class='title'>IwcJson.md</span>
</div>
</div>
<div id='content'>
<nav class='toc'>
<p class='title'>
<a class='hide_toc' href='#'>
<strong>Table of Contents</strong>
</a>
<small>
(<a class='float_toc' href='#'>left</a>)
</small>
</p>
</nav>
<div id='filecontents'>
<h2 id="iwc-json-example">IWC + JSON Example</h2><p>Here, I will give a short overview on how to use the IwcJson Framework in Role-SDK widgets.
First you have to include the following libraries in your widget file:</p><pre><code>&lt;script src=&quot;http://open-app.googlecode.com/files/openapp.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://dbis.rwth-aachen.de/gadgets/iwc/lib/iwc.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://dbis.rwth-aachen.de/~jahns/role-widgets/widgetbundles/libraries/DUIClient.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;../dest/browser/Frameworks/JsonIwcYatta.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;./IwcJson.js&quot;&gt;&lt;/script&gt;
</code></pre><pre><code class="lang-js">function init(){
createConnector(function(Connector, user_id){
</code></pre><p>yatta is the shared json object</p><pre><code class="lang-js"> yatta = new JsonYatta(user_id, Connector);
</code></pre><p>Add a integer-property like this</p><pre><code class="lang-js"> yatta.val(&#39;x&#39;, 7);
</code></pre><p>Get the value of property x like this</p><pre><code class="lang-js"> console.log(yatta.val(&#39;x&#39;) === 7); // true
</code></pre><p>A string property can be either mutable or immutable.</p><pre><code class="lang-js"> yatta.val(&#39;mutable_string&#39;, &quot;text&quot;, &quot;mutable&quot;);
yatta.val(&#39;immutable_string&#39;, &quot;text&quot;, &quot;immutable&quot;);
console.log(yatta.val(&#39;immutable_string&#39;) === &quot;text&quot;); // true
yatta.val(&#39;mutable_string&#39;).insertText(2,&quot;XXX&quot;); // position, string
yatta.val(&#39;mutable_string&#39;).deleteText(0,1); // position, deletion length
console.log(yatta.val(&#39;mutable_string&#39;).val() === &quot;eXXXxt&quot;); // true
</code></pre><p>You can omit the mutable - parameter. In that case the default will be used.
Initially the default is &#39;mutable&#39;. You can set it like this:</p><pre><code class="lang-js"> yatta.setMutableDefault(&#39;mutable&#39;);
// or
yatta.setMutableDefault(&#39;immutable&#39;);
yatta.val(&#39;new_string&#39;, &quot;string&quot;);
console.log(yatta.val(&#39;new_string&#39;) === &quot;string&quot;); // true
</code></pre><p>yatta is chainable:</p><pre><code class="lang-js"> yatta.val(&#39;a&#39;, 4).val(&#39;b&#39;,5);
console.log(yatta.val(&#39;a&#39;) === 4); // true
console.log(yatta.val(&#39;b&#39;) === 5); // true
</code></pre><p>You can alse set objects.</p><pre><code class="lang-js"> yatta.val(&#39;object&#39;, {a : {b : &quot;b&quot;}, c : { d : 5 }});
console.log(yatta.val(&#39;object&#39;).val(&#39;c&#39;).val(&#39;d&#39;) === 5); // true
</code></pre><p>Lists are always immutable.</p><pre><code class="lang-js"> yatta.val(&#39;list&#39;, [1,2,3]);
console.log(yatta.val(&#39;list&#39;)[2] === 3); // true
</code></pre><p>But there is a much more convenient way!</p><pre><code class="lang-js"> console.log(yatta.value.list[2] === 3) // true
yatta.value.list = [3,4,5]
console.log(yatta.val(&#39;list&#39;)[2] === 5) // true
yatta.value.object = {c : 4}
console.log(yatta.value.object.c === 4) // true
</code></pre><p>The downside is that you are only allowed to overwrite existing properties.</p><pre><code class="lang-js"> yatta.value.newProperty = &quot;Awesome&quot;
console.log(yatta.value.newProperty !== &quot;Awesome&quot;) // true, yatta.value.newProperty is undefined.
</code></pre><p>So, how do we create new properties?</p><pre><code class="lang-js"> yatta.value = {newProperty : &quot;Awesome&quot;}
console.log(yatta.value.newProperty === &quot;Awesome&quot;) // true, it&#39;s awesome ;)
</code></pre><p>This is stupid! I don&#39;t want to overwrite all my existing properties!
Very well.. The solution is that we merge yatta.value with the new assignment.
For example: assuming we want to overwrite yatta.value with some object o.
Then these two rules apply:</p><ul>
<li>The result has all properties of o</li>
<li>The result has all properties of yatta.value if they don&#39;t occur under the same property-name in o</li>
</ul>
<pre><code class="lang-js"> yatta.value = {newProperty : {Awesome : true }}
console.log(yatta.value.list[2] === 5) // true, old value list still exists.
console.log(yatta.value.newProperty.Awesome === true) // true, newProperty is overwritten.
</code></pre><p>Consider this case.</p><pre><code class="lang-js"> yatta.value = {newProperty : { x : 4} }
console.log(yatta.value.newProperty.Awesome == null) // true, newProperty was replaced, therefore it is now undefined
</code></pre><p>Did you notice that you always set immutable objects if you set properties like this?
Even if the default is &#39;mutable&#39;. If you want to work with mutable objects you have to work with .val().</p><p>One last thing. You are only allowed to set properties like this <code>yatta.value = o</code>.
Yatta can&#39;t observe if you overwrite object references <code>yatta = &quot;Awesome&quot;</code>.</p><pre><code class="lang-js"> w = yatta.value.newProperty
w = &quot;Awesome&quot;
console.log(yatta.value.newProperty !== &quot;Awesome&quot;) // true, still not awesome..
</code></pre><p>Please also read <a href="https://rawgit.com/DadaMonad/Yatta/master/doc/class/JsonWrapper.html">JsonWrapper</a></p><pre><code class="lang-js"> })
}
window.onload = init
</code></pre>
</div>
</div>
<div id='footer'>
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -0,0 +1,117 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>Yatta! Documentation</title>
<script src='../../javascript/application.js'></script>
<script src='../../javascript/search.js'></script>
<link rel='stylesheet' href='../../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../../'></div>
<div id='header'>
<div id='menu'>
<a href='../../extra/README.md.html' title='Yatta!'>
Yatta!
</a>
&raquo;
<a href='../../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>examples</span>
&raquo;
<span class='title'>README.md</span>
</div>
</div>
<div id='content'>
<nav class='toc'>
<p class='title'>
<a class='hide_toc' href='#'>
<strong>Table of Contents</strong>
</a>
<small>
(<a class='float_toc' href='#'>left</a>)
</small>
</p>
</nav>
<div id='filecontents'>
<h1 id="examples">Examples</h1><p>Here you find some (hopefully) usefull examples on how to use Yatta!</p><ul>
<li><a href="./IwcJson.md">IWC + Json</a></li>
</ul>
</div>
</div>
<div id='footer'>
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>

View File

@ -39,6 +39,24 @@
LICENSE-LGPL
</a>
</li>
<li>
<span>
examples
</span>
</li>
<ul>
<li>
<a href='extra/examples/README.md.html' target='main'>
README.md
</a>
</li>
<li>
<a href='extra/examples/IwcJson.md.html' target='main'>
IwcJson.md
</a>
</li>
</ul>
</ul>
</div>

View File

@ -84,7 +84,7 @@
</div>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -58,7 +58,7 @@
</dl>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -68,7 +68,7 @@
</dl>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -60,7 +60,7 @@
</dl>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -58,7 +58,7 @@
</dl>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

View File

@ -39,7 +39,7 @@
</table>
</div>
<div id='footer'>
August 05, 14 05:11:25 by
August 05, 14 16:58:39 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>

File diff suppressed because one or more lines are too long

View File

@ -7,12 +7,12 @@
<script src="http://open-app.googlecode.com/files/openapp.js"></script>
<script src="http://dbis.rwth-aachen.de/gadgets/iwc/lib/iwc.js"></script>
<script src="http://dbis.rwth-aachen.de/~jahns/role-widgets/widgetbundles/libraries/DUIClient.js"></script>
<script src="../dest/browser/Frameworks/JsonIwcYatta.js"></script>
<script src="../dest/browser/Frameworks/JsonIwcYatta.min.js"></script>
<script src="./IwcJson.js"></script>
```
*/
function init(){
window.createConnector(function(Connector, user_id){
createConnector(function(Connector, user_id){
/**
yatta is the shared json object
*/
@ -74,9 +74,9 @@ function init(){
*/
console.log(yatta.value.list[2] === 3) // true
yatta.value.list = [3,4,5]
console.log(yatta.val('list')[2] === 5)
console.log(yatta.val('list')[2] === 5) // true
yatta.value.object = {c : 4}
console.log(yatta.value.object.c === 4)
console.log(yatta.value.object.c === 4) // true
/**
The downside is that you are only allowed to overwrite existing properties.
@ -106,7 +106,7 @@ function init(){
Consider this case.
*/
yatta.value = {newProperty : { x : 4} }
console.log(yatta.value.newProperty.Awesome == null) // true, Awesome was replaced, therefore it is now undefined
console.log(yatta.value.newProperty.Awesome == null) // true, newProperty was replaced, therefore it is now undefined
/**
Did you notice that you always set immutable objects if you set properties like this?

View File

@ -5,14 +5,14 @@ First you have to include the following libraries in your widget file:
<script src="http://open-app.googlecode.com/files/openapp.js"></script>
<script src="http://dbis.rwth-aachen.de/gadgets/iwc/lib/iwc.js"></script>
<script src="http://dbis.rwth-aachen.de/~jahns/role-widgets/widgetbundles/libraries/DUIClient.js"></script>
<script src="../dest/browser/Frameworks/JsonIwcYatta.js"></script>
<script src="../dest/browser/Frameworks/JsonIwcYatta.min.js"></script>
<script src="./IwcJson.js"></script>
```
```js
function init(){
window.createConnector(function(Connector, user_id){
createConnector(function(Connector, user_id){
```
@ -102,9 +102,9 @@ But there is a much more convenient way!
```js
console.log(yatta.value.list[2] === 3) // true
yatta.value.list = [3,4,5]
console.log(yatta.val('list')[2] === 5)
console.log(yatta.val('list')[2] === 5) // true
yatta.value.object = {c : 4}
console.log(yatta.value.object.c === 4)
console.log(yatta.value.object.c === 4) // true
```
@ -146,7 +146,7 @@ Consider this case.
```js
yatta.value = {newProperty : { x : 4} }
console.log(yatta.value.newProperty.Awesome == null) // true, Awesome was replaced, therefore it is now undefined
console.log(yatta.value.newProperty.Awesome == null) // true, newProperty was replaced, therefore it is now undefined
```

View File

@ -3,7 +3,7 @@ createIwcConnector = (callback)->
iwcHandler = {}
duiClient = new DUIClient()
#@duiClient = new iwc.Client()
duiClient.connect (intent)=>
duiClient.connect (intent)->
#console.log "intent received iwc: #{JSON.stringify(intent)}"
#console.log "#{JSON.stringify(@iwcHandler)}"
iwcHandler[intent.action]?.map (f)->

View File

@ -17,7 +17,7 @@ module.exports = (HB)->
# w = yatta.value
#
# It creates Javascripts -getter and -setter methods for each property that JsonType maintains.
# @see getter https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
# @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty
#
# @example Getter Example
# # you can access the x property of yatta by calling

View File

@ -1,7 +1,7 @@
{
"name": "Yatta",
"version": "0.0.1",
"description": "A Collaboration Framework for arbitrary data structures that is NOT based on the Operational Transformation.",
"description": "A Collaboration Framework for arbitrary data structures that is NOT based on Operational Transformation.",
"main": "lib/index.js",
"scripts": {
"test": "grunt test"
@ -23,24 +23,22 @@
"url": "https://github.com/DadaMonad/Yatta/issues"
},
"homepage": "https://github.com/DadaMonad/Yatta",
"dependencies": {
"grunt-literate": "^0.2.0"
},
"dependencies": {},
"devDependencies": {
"grunt-contrib-coffee": "^0.10.1",
"grunt": "^0.4.5",
"sinon-chai": "^2.5.0",
"grunt-simple-mocha": "^0.4.0",
"grunt-contrib-watch": "^0.6.1",
"chai": "^1.9.1",
"coffeeify": "^0.6.0",
"sinon": "^1.10.2",
"grunt": "^0.4.5",
"grunt-browserify": "^2.1.3",
"grunt-coffeelint": "0.0.10",
"mocha": "^1.20.1",
"browserify": "^4.2.0",
"grunt-codo": "^0.2.0",
"underscore": "^1.6.0",
"grunt-contrib-connect": "~0.8.0"
"grunt-coffeelint": "0.0.10",
"grunt-contrib-coffee": "^0.10.1",
"grunt-contrib-connect": "~0.8.0",
"grunt-contrib-uglify": "^0.5.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-literate": "^0.2.0",
"grunt-simple-mocha": "^0.4.0",
"sinon": "^1.10.2",
"sinon-chai": "^2.5.0",
"chai": "^1.9.1",
"underscore": "^1.6.0"
}
}

View File

@ -13,9 +13,9 @@ Connector_uninitialized = require "../lib/Connectors/TestConnector.coffee"
class Test
constructor: ()->
@number_of_test_cases_multiplier = 1
@repeat_this = 10 * @number_of_test_cases_multiplier
@doSomething_amount = 200 * @number_of_test_cases_multiplier
@number_of_engines = 12 + @number_of_test_cases_multiplier - 1
@repeat_this = 1 * @number_of_test_cases_multiplier
@doSomething_amount = 5000 * @number_of_test_cases_multiplier
@number_of_engines = 10 + @number_of_test_cases_multiplier - 1
@time = 0
@ops = 0
@ -91,7 +91,7 @@ class Test
ops_per_msek = Math.floor(@ops/@time)
if test_number?
console.log "#{test_number}/#{@repeat_this}: Every collaborator (#{@users.length}) applied #{@number_of_created_operations} ops in a different order." + " Over all we consumed #{@ops} operations in #{@time/1000} seconds (#{ops_per_msek} ops/msek)."
console.log "#{test_number}/#{@repeat_this}: Every collaborator (#{@users.length}) applied #{number_of_created_operations} ops in a different order." + " Over all we consumed #{@ops} operations in #{@time/1000} seconds (#{ops_per_msek} ops/msek)."
#console.log users[0].val('name').val()
for i in [0...(@users.length-1)]
@ -156,8 +156,13 @@ describe "JsonYatta", ->
@yTest.getSomeUser().val('x', {'a':'b'})
@yTest.getSomeUser().val('a', {'a':{q:"dtrndtrtdrntdrnrtdnrtdnrtdnrtdnrdnrdt"}})
@yTest.getSomeUser().val('b', {'a':{}})
@yTest.getSomeUser().val('c', {'a':'c'})
@yTest.getSomeUser().val('c', {'a':'b'})
@yTest.compareAll()
@yTest.getSomeUser().value.a.a.q.insertText(0,'AAA')
@yTest.compareAll()
expect(@yTest.getSomeUser().value.a.a.q.val()).to.equal("AAAdtrndtrtdrntdrnrtdnrtdnrtdnrtdnrdnrdt")
it "handles some immutable tests", ->
@yTest.getSomeUser().val('string', "text", "immutable")