Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f444b25ac9 | ||
|
|
86849ae8b1 | ||
|
|
77739deda3 | ||
|
|
ad5898a77a | ||
|
|
465a2f18e6 | ||
|
|
974d2ba0de | ||
|
|
9e6c238870 | ||
|
|
d8a4d8613e | ||
|
|
f4fdfda9ba | ||
|
|
2f73c499d3 | ||
|
|
6ea027b8c0 | ||
|
|
a39767723f | ||
|
|
a998f81211 | ||
|
|
9d871adb00 | ||
|
|
71c01fbb9e | ||
|
|
e6b5706aad | ||
|
|
a7dffa6ce9 | ||
|
|
671174e17f | ||
|
|
92e23b7007 | ||
|
|
9a1b0b7ced | ||
|
|
bb18c8d0f4 | ||
|
|
c40fe0e0b7 | ||
|
|
e9783c8a25 | ||
|
|
8aa5dc9866 | ||
|
|
c27618bc0a | ||
|
|
4ebd362a2b | ||
|
|
339908d1de | ||
|
|
d8a7367c20 | ||
|
|
9d61dd87fc | ||
|
|
f348ca8f5e | ||
|
|
79eb0ae3b4 | ||
|
|
0c610e4551 | ||
|
|
716fbd40d8 | ||
|
|
c6ca102bce | ||
|
|
5ce4fbe950 | ||
|
|
184f0efdff | ||
|
|
2a10fe45fa | ||
|
|
eb541fd473 | ||
|
|
a637633a1c | ||
|
|
089ae137dc | ||
|
|
6bbee4ef40 | ||
|
|
2f0d902b1a | ||
|
|
1039f169c3 | ||
|
|
3f5f3cae97 | ||
|
|
de399bf7b7 | ||
|
|
a13a79b791 | ||
|
|
0cc265ac65 | ||
|
|
dfd7cc567d | ||
|
|
28b48de454 | ||
|
|
49f56859ae | ||
|
|
b340bbe806 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
.kateproject.d
|
||||
.kateproject
|
||||
.directory
|
||||
myftppass
|
||||
|
||||
135
Gruntfile.coffee
135
Gruntfile.coffee
@@ -1,135 +0,0 @@
|
||||
"use strict"
|
||||
module.exports = (grunt) ->
|
||||
|
||||
# Project configuration.
|
||||
grunt.initConfig
|
||||
coffee:
|
||||
lib:
|
||||
options:
|
||||
bare: true
|
||||
sourceMap: true
|
||||
expand: true
|
||||
src: ["lib/**/*.coffee"]
|
||||
dest: "dest/"
|
||||
ext: ".js"
|
||||
test:
|
||||
#options:
|
||||
#bare: true
|
||||
expand: true
|
||||
src: ["test/**/*.coffee"]
|
||||
dest: "dest/"
|
||||
ext: ".js"
|
||||
|
||||
watch:
|
||||
lib:
|
||||
files: [
|
||||
"<%= coffee.lib.src %>"
|
||||
]
|
||||
tasks: ["coffee:lib"]
|
||||
test:
|
||||
files: [
|
||||
"<%= coffee.lib.src %>"
|
||||
"<%= coffee.test.src %>"
|
||||
"examples/*"
|
||||
]
|
||||
tasks: ["build"]
|
||||
|
||||
simplemocha:
|
||||
all:
|
||||
src: ['test/**/*.coffee']
|
||||
options:
|
||||
timeout: 9999999
|
||||
ignoreLeaks: false
|
||||
ui: 'bdd'
|
||||
reporter: 'list'
|
||||
compilers: 'coffee:coffee-script'
|
||||
|
||||
pkg: grunt.file.readJSON('package.json')
|
||||
|
||||
coffeelint:
|
||||
app: [
|
||||
'lib/**/*.coffee'
|
||||
'test/**/.coffee'
|
||||
"Gruntfile.coffee"
|
||||
]
|
||||
options:
|
||||
"indentation":
|
||||
"level": "ignore"
|
||||
"no_trailing_whitespace":
|
||||
"level": "warn"
|
||||
"max_line_length":
|
||||
"level": "ignore"
|
||||
#"line_endings":
|
||||
# "level": "error"
|
||||
codo:
|
||||
options:
|
||||
name: "Yatta!"
|
||||
title: "Yatta! Documentation"
|
||||
extras: ["LICENSE.txt", "examples/README.md", "examples/IwcJson.md"]
|
||||
#undocumented: yes
|
||||
verbose: false
|
||||
stats: true
|
||||
src: ["./lib"]
|
||||
browserify:
|
||||
dest:
|
||||
files:
|
||||
'dest/browser/test/Yatta_test.js': ['test/**/*.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}
|
||||
uglify:
|
||||
browser:
|
||||
files: [
|
||||
expand: true
|
||||
cwd: './dest/browser/'
|
||||
src: '**/*.js'
|
||||
dest: './dest/browser'
|
||||
ext: '.min.js'
|
||||
]
|
||||
connect:
|
||||
server:
|
||||
options:
|
||||
hostname: '*'
|
||||
port: 1337
|
||||
base: './'
|
||||
keepalive: true
|
||||
middleware: (connect, options, middlewares)->
|
||||
middlewares.push (req, res, next)->
|
||||
if res.header?
|
||||
res.header('Access-Control-Allow-Origin', "*")
|
||||
res.header('Access-Control-Allow-Credentials', true)
|
||||
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept")
|
||||
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS')
|
||||
res.header('Cache-Control', 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0')
|
||||
return next()
|
||||
return middlewares
|
||||
literate:
|
||||
"examples/IwcJson.md": "examples/IwcJson.js"
|
||||
options:
|
||||
code: true
|
||||
|
||||
# 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"
|
||||
grunt.loadNpmTasks "grunt-literate"
|
||||
grunt.loadNpmTasks "grunt-simple-mocha"
|
||||
grunt.loadNpmTasks "grunt-coffeelint"
|
||||
grunt.loadNpmTasks "grunt-codo"
|
||||
|
||||
grunt.registerTask "build", ["coffeelint", "codo", "browserify", "test"]
|
||||
grunt.registerTask "production", ["test", "coffee","coffeelint", "literate", "browserify", "uglify", "codo"]
|
||||
grunt.registerTask "default", ["build", "watch"]
|
||||
grunt.registerTask "production", ["coffee"]
|
||||
grunt.registerTask "test", ["simplemocha"]
|
||||
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Kevin Jahns.
|
||||
Copyright (c) 2014 Kevin Jahns <kevin.jahns@rwth-aachen.de>.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
67
README.md
67
README.md
@@ -1,31 +1,46 @@
|
||||
|
||||
# 
|
||||
|
||||
A real-time web framework that manages concurrency control for arbitrary data structures and is _not_ based on Operational Transformation.
|
||||
Yatta! provides similar functionality as [ShareJs](https://github.com/share/ShareJS) and [OpenCoweb](https://github.com/opencoweb/coweb)
|
||||
A Real-Time web framework that manages concurrency control for arbitrary data structures.
|
||||
Yatta! provides similar functionality as [ShareJs](https://github.com/share/ShareJS) and [OpenCoweb](https://github.com/opencoweb/coweb),
|
||||
but does not require you to understand how the internals work. The predefined data structures provide a simple API to access your shared data structures.
|
||||
|
||||
Predefined data structures:
|
||||
* Text
|
||||
* Json - [example](./examples/IwcJson.md)
|
||||
* Text - [Collaborative Text Editing Example](http://dadamonad.github.io/Yatta/examples/TextEditing/) and [Source](./examples/TextEditing/)
|
||||
* Json - [Tutorial](./examples/PeerJs-Json/)
|
||||
* XML (coming soon)
|
||||
|
||||
Unlike other frameworks, Yatta! supports P2P message propagation and is not bound to a specific communication protocol.
|
||||
|
||||
Currently supported communication protocols:
|
||||
* [IWC](http://dbis.rwth-aachen.de/gadgets/iwc/resources/iwc.manual.pdf) - Inter-widget Communication
|
||||
It is possible to add any communication protocol to Yatta. Currently it supports:
|
||||
* [PeerJs](http://peerjs.com/) - A WebRTC Framework
|
||||
* [IWC](http://dbis.rwth-aachen.de/cms/projects/the-xmpp-experience#interwidget-communication) - Inter-widget Communication
|
||||
|
||||
## Use it!
|
||||
The [examples](./examples/) provide an excellent starting point for beginners. Also the [API Documentation](http://dadamonad.github.io/Yatta/doc/) could prove to be very helpful.
|
||||
|
||||
# Use it!
|
||||
Either clone this git repository or install this package with [bower](http://bower.io/).
|
||||
Either clone this git repository, install it with [bower](http://bower.io/), or install it with [npm](https://www.npmjs.org/package/yatta).
|
||||
|
||||
### Bower
|
||||
```
|
||||
bower install Yatta
|
||||
```
|
||||
Then you include the libraries directly from the installation folder.
|
||||
|
||||
Use the [examples](./examples/README.md) to struggle your way through this mess..
|
||||
### Npm
|
||||
```
|
||||
npm install yatta --save
|
||||
```
|
||||
|
||||
# About
|
||||
And use it like this with *npm*:
|
||||
```
|
||||
Y = require("yatta");
|
||||
Y.createPeerJsConnector({key: 'xxx'}, function(Connector, user_id){
|
||||
yatta = new Y.JsonFramework(user_id, Connector);
|
||||
```
|
||||
|
||||
|
||||
## About
|
||||
Find out more about the concurrent editing problem here
|
||||
[Cooperation, Concurrency, Conflicts, and Convergence](http://opencoweb.org/ocwdocs/intro/openg.html) and here
|
||||
[Operational Transformation (OT)](http://en.wikipedia.org/wiki/Operational_transformation)
|
||||
@@ -34,34 +49,44 @@ My Bachelor Thesis project aim was to develop a P2P OT Framework that enables co
|
||||
[Intention Preservation](http://www3.ntu.edu.sg/home/czsun/projects/otfaq/#intentionPreservation).
|
||||
After some time I realized that OT has significant drawbacks in P2P environments.
|
||||
|
||||
With my gained experiences I came up with a new approach. I named it Yata - Yet Another Transformation Approach.
|
||||
With my gained experiences I came up with a new approach. I named it *Yata* - Yet Another Transformation Approach.
|
||||
It enables concurrent editing with the following space and time properties:
|
||||
* Time complexity: O(S), whereby S is the number of operations that are inserted concurrently at the same position. This means that my approach does not transform against operations that happen on other positions.
|
||||
* Space complexity = O(|Document|), whereby |Document| is the size of the shared document. Depending on the used data structure, Yata may needs 4*|Document| of space.
|
||||
* Time complexity: O(S), whereby S is the number of operations that are inserted concurrently at the same position (no transformation against operations that happen on different positions).
|
||||
* Space complexity = O(|Document|), whereby |Document| is the size of the shared document.
|
||||
|
||||
This means that my approach beats all OT time complexities. Furthermore, it is possible to make a very strict definition of Intention Preservation, and I was able to
|
||||
This means that my approach beats all OT time complexities. Furthermore, Yatta has a very strict definition of Intention Preservation, and I was able to
|
||||
show that it is never violated.
|
||||
|
||||
Another advantage of my approach is that propagated messages are very small.
|
||||
Background: In real-time P2P OT algorithms you have to send a state-vector with every message that defines the state of the History Buffer
|
||||
Another advantage of Yata is that propagated messages are very small.
|
||||
Background: In Real-Time P2P OT algorithms you have to send a state-vector with each message that defines the state of the History Buffer
|
||||
on which the operation was created. This is not necessary in Yata.
|
||||
|
||||
One downside is that the History Buffer holds at least as many operations as there are characters in the document.
|
||||
The downside of this approach is that the History Buffer holds at least as many operations as there are characters in the document.
|
||||
In contrast, an OT algorithm can have an empty History Buffer while the document size is very big.
|
||||
|
||||
Eventually (after my thesis), I will publish more information about Yata.
|
||||
|
||||
So, how did I come up with the name for the implementation (Yatta! is not Yata)?
|
||||
Yatta! means "I did it!" in Japanese. You scream it when you accomplish something (for proper application I refer to the Yatta-man in [Heroes](http://heroeswiki.com/Yatta!)).
|
||||
There is also this awesome video on the Internet that will change your life [Yatta](https://www.youtube.com/watch?v=kL5DDSglM_s).
|
||||
|
||||
# Status
|
||||
Yatta! is still in an early development phase.
|
||||
## Status
|
||||
Yatta! is still in an early development phase. Don't expect that everything is working fine.
|
||||
But I would become really motivated if you gave me some feedback :) ([github](https://github.com/DadaMonad/Yatta/issues)).
|
||||
|
||||
# Support
|
||||
### Current Issues
|
||||
Currently, I don't perform Garbage Collection. Therefore, the space requirement will never decrease.
|
||||
* Garbage Collection
|
||||
* XML support
|
||||
|
||||
|
||||
## Support
|
||||
Please report any issues to the [Github issue page](https://github.com/DadaMonad/Yatta/issues)!
|
||||
|
||||
# License
|
||||
## License
|
||||
Yatta! is licensed under the [MIT License](./LICENSE.txt).
|
||||
|
||||
<kevin.jahns@rwth-aachen.de>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "Yatta",
|
||||
"version": "0.0.0",
|
||||
"version": "0.0.5",
|
||||
"homepage": "https://github.com/DadaMonad/Yatta",
|
||||
"authors": [
|
||||
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
||||
],
|
||||
"description": "A Framework for Real-Time collaboration on arbitrary data structures.",
|
||||
"main": "./dest/browser/**",
|
||||
"description": "A Framework that enables Real-Time Collaboration on arbitrary data structures.",
|
||||
"main": "./build/**",
|
||||
"keywords": [
|
||||
"OT",
|
||||
"collaboration",
|
||||
@@ -17,7 +17,6 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
|
||||
142
build/browser/Connectors/IwcConnector.js
Normal file
142
build/browser/Connectors/IwcConnector.js
Normal file
File diff suppressed because one or more lines are too long
1
build/browser/Connectors/IwcConnector.min.js
vendored
Normal file
1
build/browser/Connectors/IwcConnector.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function t(n,e,r){function i(u,a){if(!e[u]){if(!n[u]){var s="function"==typeof require&&require;if(!a&&s)return s(u,!0);if(o)return o(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=e[u]={exports:{}};n[u][0].call(c.exports,function(t){var e=n[u][1][t];return i(e?e:t)},c,c.exports,t,n,e,r)}return e[u].exports}for(var o="function"==typeof require&&require,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(t,n){var e;e=function(t,n){var e,r,i,o,u,a;return a=null,null!=n&&(a=n.iwcHandler),o={},r=new DUIClient,r.connect(function(t){var n;return null!=(n=o[t.action])&&n.map(function(n){return setTimeout(function(){return n(t)},0)}),null!=a?a(t):void 0}),r.initOK(),u=null,e=function(){function t(t,n,e,i){var a,s,c,l;this.engine=t,this.HB=n,this.execution_listener=e,this.yatta=i,this.duiClient=r,this.iwcHandler=o,l=function(t){return function(n){return 0!==Object.getOwnPropertyNames(t.initialized).length?t.send(n):void 0}}(this),this.execution_listener.push(l),this.initialized={},a=function(t){return function(e){var r;return n=e.extras.HB,r=e.extras.user,t.engine.applyOpsCheckDouble(n),t.initialized[r]=!0}}(this),o.Yatta_push_HB_element=[a],this.sendIwcIntent("Yatta_get_HB_element",this.HB.getOperationCounter()),s=function(t){return function(n){var e;return e=n.extras,null!=t.initialized[e.uid.creator]?t.receive(e):void 0}}(this),this.iwcHandler.Yatta_new_operation=[s],null!=u&&this.engine.applyOpsCheckDouble(u),c=function(t){return function(n){var e,r;return r=n.extras,console.log(r),e={HB:t.yatta.getHistoryBuffer()._encode(r),user:t.yatta.getUserId()},t.sendIwcIntent("Yatta_push_HB_element",e)}}(this),this.iwcHandler.Yatta_get_HB_element=[c]}return t.prototype.setIwcHandler=function(t){return a=t},t.prototype.sendIwcIntent=function(t,n){var e;return e=null,arguments.length>=2?(t=arguments[0],n=arguments[1],e={action:t,component:"",data:"",dataType:"",flags:["PUBLISH_GLOBAL"],extras:n}):e=arguments[0],this.duiClient.sendIntent(e)},t.prototype.send=function(t){return t.uid.creator===this.HB.getUserId()&&"string"!=typeof t.uid.op_number?this.sendIwcIntent("Yatta_new_operation",t):void 0},t.prototype.receive=function(t){return t.uid.creator!==this.HB.getUserId()?this.engine.applyOp(t):void 0},t}(),i=function(){var n;return n=Math.floor(1e6*Math.random()),t(e,n)},void setTimeout(i,5e3)},n.exports=e,"undefined"!=typeof window&&null!==window&&(null==window.Y&&(window.Y={}),window.Y.createIwcConnector=e)},{}]},{},[1]);
|
||||
132
build/browser/Connectors/PeerJsConnector.js
Normal file
132
build/browser/Connectors/PeerJsConnector.js
Normal file
File diff suppressed because one or more lines are too long
1
build/browser/Connectors/PeerJsConnector.min.js
vendored
Normal file
1
build/browser/Connectors/PeerJsConnector.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function n(e,t,r){function o(u,s){if(!t[u]){if(!e[u]){var c="function"==typeof require&&require;if(!s&&c)return c(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var f=t[u]={exports:{}};e[u][0].call(f.exports,function(n){var t=e[u][1][n];return o(t?t:n)},f,f.exports,n,e,t,r)}return t[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(n,e){var t;t=function(){var n,e,t;return t=null,2===arguments.length?(t=new Peer(arguments[0]),e=arguments[1]):(t=new Peer(arguments[0],arguments[1]),e=arguments[2]),n=function(){function n(n,e,r,o){var i;this.engine=n,this.HB=e,this.execution_listener=r,this.yatta=o,this.peer=t,this.connections={},this.peer.on("connection",function(n){return function(e){return n.addConnection(e)}}(this)),i=function(n){return function(e){var t,r,o,i;if(e.uid.creator===n.HB.getUserId()&&"string"!=typeof e.uid.op_number){o=n.connections,i=[];for(r in o)t=o[r],i.push(t.send({op:e}));return i}}}(this),this.execution_listener.push(i)}return n.prototype.connectToPeer=function(n){return null==this.connections[n]&&n!==this.yatta.getUserId()?this.addConnection(t.connect(n)):void 0},n.prototype.getAllConnectionIds=function(){var n,e;e=[];for(n in this.connections)e.push(n);return e},n.prototype.addConnection=function(n){var e,t,r;return this.connections[n.peer]=n,t=!1,e=!1,n.on("data",function(r){return function(o){var i,u,s,c,f;if("empty_message"===o);else{if(null!=o.HB)return t=!0,r.engine.applyOpsCheckDouble(o.HB),n.send({conns:r.getAllConnectionIds()});if(null!=o.op)return r.engine.applyOp(o.op);if(null!=o.conns){for(c=o.conns,f=[],u=0,s=c.length;s>u;u++)i=c[u],f.push(r.connectToPeer(i));return f}if(null==o.state_vector)throw new Error("Can't parse this operation");if(!e)return n.send({HB:r.yatta.getHistoryBuffer()._encode(o.state_vector)}),e=!0}}}(this)),(r=function(e){return function(){return n.send({state_vector:e.HB.getOperationCounter()}),t?void 0:setTimeout(r,100)}}(this))()},n}(),t.on("open",function(t){return e(n,t)})},e.exports=t,"undefined"!=typeof window&&null!==window&&(null==window.Y&&(window.Y={}),window.Y.createPeerJsConnector=t)},{}]},{},[1]);
|
||||
1434
build/browser/Connectors/TestConnector.js
Normal file
1434
build/browser/Connectors/TestConnector.js
Normal file
File diff suppressed because one or more lines are too long
1
build/browser/Connectors/TestConnector.min.js
vendored
Normal file
1
build/browser/Connectors/TestConnector.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1575
build/browser/Frameworks/JsonFramework.js
Normal file
1575
build/browser/Frameworks/JsonFramework.js
Normal file
File diff suppressed because one or more lines are too long
1
build/browser/Frameworks/JsonFramework.min.js
vendored
Normal file
1
build/browser/Frameworks/JsonFramework.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1387
build/browser/Frameworks/TextFramework.js
Normal file
1387
build/browser/Frameworks/TextFramework.js
Normal file
File diff suppressed because one or more lines are too long
1
build/browser/Frameworks/TextFramework.min.js
vendored
Normal file
1
build/browser/Frameworks/TextFramework.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
142
build/node/Connectors/IwcConnector.js
Normal file
142
build/node/Connectors/IwcConnector.js
Normal file
@@ -0,0 +1,142 @@
|
||||
(function() {
|
||||
var createIwcConnector;
|
||||
|
||||
createIwcConnector = function(callback, options) {
|
||||
var IwcConnector, duiClient, init, iwcHandler, received_HB, userIwcHandler;
|
||||
userIwcHandler = null;
|
||||
if (options != null) {
|
||||
userIwcHandler = options.iwcHandler;
|
||||
}
|
||||
iwcHandler = {};
|
||||
duiClient = new DUIClient();
|
||||
duiClient.connect(function(intent) {
|
||||
var _ref;
|
||||
if ((_ref = iwcHandler[intent.action]) != null) {
|
||||
_ref.map(function(f) {
|
||||
return setTimeout(function() {
|
||||
return f(intent);
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
if (userIwcHandler != null) {
|
||||
return userIwcHandler(intent);
|
||||
}
|
||||
});
|
||||
duiClient.initOK();
|
||||
received_HB = null;
|
||||
IwcConnector = (function() {
|
||||
function IwcConnector(engine, HB, execution_listener, yatta) {
|
||||
var receiveHB, receive_, sendHistoryBuffer, 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) {
|
||||
if (Object.getOwnPropertyNames(_this.initialized).length !== 0) {
|
||||
return _this.send(o);
|
||||
}
|
||||
};
|
||||
})(this);
|
||||
this.execution_listener.push(send_);
|
||||
this.initialized = {};
|
||||
receiveHB = (function(_this) {
|
||||
return function(json) {
|
||||
var him;
|
||||
HB = json.extras.HB;
|
||||
him = json.extras.user;
|
||||
_this.engine.applyOpsCheckDouble(HB);
|
||||
return _this.initialized[him] = true;
|
||||
};
|
||||
})(this);
|
||||
iwcHandler["Yatta_push_HB_element"] = [receiveHB];
|
||||
this.sendIwcIntent("Yatta_get_HB_element", this.HB.getOperationCounter());
|
||||
receive_ = (function(_this) {
|
||||
return function(intent) {
|
||||
var o;
|
||||
o = intent.extras;
|
||||
if (_this.initialized[o.uid.creator] != null) {
|
||||
return _this.receive(o);
|
||||
}
|
||||
};
|
||||
})(this);
|
||||
this.iwcHandler["Yatta_new_operation"] = [receive_];
|
||||
if (received_HB != null) {
|
||||
this.engine.applyOpsCheckDouble(received_HB);
|
||||
}
|
||||
sendHistoryBuffer = (function(_this) {
|
||||
return function(intent) {
|
||||
var json, state_vector;
|
||||
state_vector = intent.extras;
|
||||
console.log(state_vector);
|
||||
json = {
|
||||
HB: _this.yatta.getHistoryBuffer()._encode(state_vector),
|
||||
user: _this.yatta.getUserId()
|
||||
};
|
||||
return _this.sendIwcIntent("Yatta_push_HB_element", json);
|
||||
};
|
||||
})(this);
|
||||
this.iwcHandler["Yatta_get_HB_element"] = [sendHistoryBuffer];
|
||||
}
|
||||
|
||||
IwcConnector.prototype.setIwcHandler = function(f) {
|
||||
return userIwcHandler = f;
|
||||
};
|
||||
|
||||
IwcConnector.prototype.sendIwcIntent = function(action_name, content) {
|
||||
var intent;
|
||||
intent = null;
|
||||
if (arguments.length >= 2) {
|
||||
action_name = arguments[0], content = arguments[1];
|
||||
intent = {
|
||||
action: action_name,
|
||||
component: "",
|
||||
data: "",
|
||||
dataType: "",
|
||||
flags: ["PUBLISH_GLOBAL"],
|
||||
extras: content
|
||||
};
|
||||
} else {
|
||||
intent = arguments[0];
|
||||
}
|
||||
return this.duiClient.sendIntent(intent);
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
return IwcConnector;
|
||||
|
||||
})();
|
||||
init = function() {
|
||||
var proposed_user_id;
|
||||
proposed_user_id = Math.floor(Math.random() * 1000000);
|
||||
return callback(IwcConnector, proposed_user_id);
|
||||
};
|
||||
setTimeout(init, 5000);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
module.exports = createIwcConnector;
|
||||
|
||||
if (typeof window !== "undefined" && window !== null) {
|
||||
if (window.Y == null) {
|
||||
window.Y = {};
|
||||
}
|
||||
window.Y.createIwcConnector = createIwcConnector;
|
||||
}
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Connectors/IwcConnector.js.map
|
||||
1
build/node/Connectors/IwcConnector.js.map
Executable file
1
build/node/Connectors/IwcConnector.js.map
Executable file
File diff suppressed because one or more lines are too long
132
build/node/Connectors/PeerJsConnector.js
Normal file
132
build/node/Connectors/PeerJsConnector.js
Normal file
@@ -0,0 +1,132 @@
|
||||
(function() {
|
||||
var createPeerJsConnector;
|
||||
|
||||
createPeerJsConnector = function() {
|
||||
var PeerJsConnector, callback, peer;
|
||||
peer = null;
|
||||
if (arguments.length === 2) {
|
||||
peer = new Peer(arguments[0]);
|
||||
callback = arguments[1];
|
||||
} else {
|
||||
peer = new Peer(arguments[0], arguments[1]);
|
||||
callback = arguments[2];
|
||||
}
|
||||
PeerJsConnector = (function() {
|
||||
function PeerJsConnector(engine, HB, execution_listener, yatta) {
|
||||
var send_;
|
||||
this.engine = engine;
|
||||
this.HB = HB;
|
||||
this.execution_listener = execution_listener;
|
||||
this.yatta = yatta;
|
||||
this.peer = peer;
|
||||
this.connections = {};
|
||||
this.peer.on('connection', (function(_this) {
|
||||
return function(conn) {
|
||||
return _this.addConnection(conn);
|
||||
};
|
||||
})(this));
|
||||
send_ = (function(_this) {
|
||||
return function(o) {
|
||||
var conn, conn_id, _ref, _results;
|
||||
if (o.uid.creator === _this.HB.getUserId() && (typeof o.uid.op_number !== "string")) {
|
||||
_ref = _this.connections;
|
||||
_results = [];
|
||||
for (conn_id in _ref) {
|
||||
conn = _ref[conn_id];
|
||||
_results.push(conn.send({
|
||||
op: o
|
||||
}));
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
})(this);
|
||||
this.execution_listener.push(send_);
|
||||
}
|
||||
|
||||
PeerJsConnector.prototype.connectToPeer = function(id) {
|
||||
if ((this.connections[id] == null) && id !== this.yatta.getUserId()) {
|
||||
return this.addConnection(peer.connect(id));
|
||||
}
|
||||
};
|
||||
|
||||
PeerJsConnector.prototype.getAllConnectionIds = function() {
|
||||
var conn_id, _results;
|
||||
_results = [];
|
||||
for (conn_id in this.connections) {
|
||||
_results.push(conn_id);
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
PeerJsConnector.prototype.addConnection = function(conn) {
|
||||
var initialized_him, initialized_me, sendStateVector;
|
||||
this.connections[conn.peer] = conn;
|
||||
initialized_me = false;
|
||||
initialized_him = false;
|
||||
conn.on('data', (function(_this) {
|
||||
return function(data) {
|
||||
var conn_id, _i, _len, _ref, _results;
|
||||
if (data === "empty_message") {
|
||||
|
||||
} else if (data.HB != null) {
|
||||
initialized_me = true;
|
||||
_this.engine.applyOpsCheckDouble(data.HB);
|
||||
return conn.send({
|
||||
conns: _this.getAllConnectionIds()
|
||||
});
|
||||
} else if (data.op != null) {
|
||||
return _this.engine.applyOp(data.op);
|
||||
} else if (data.conns != null) {
|
||||
_ref = data.conns;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
conn_id = _ref[_i];
|
||||
_results.push(_this.connectToPeer(conn_id));
|
||||
}
|
||||
return _results;
|
||||
} else if (data.state_vector != null) {
|
||||
if (!initialized_him) {
|
||||
conn.send({
|
||||
HB: _this.yatta.getHistoryBuffer()._encode(data.state_vector)
|
||||
});
|
||||
return initialized_him = true;
|
||||
}
|
||||
} else {
|
||||
throw new Error("Can't parse this operation");
|
||||
}
|
||||
};
|
||||
})(this));
|
||||
sendStateVector = (function(_this) {
|
||||
return function() {
|
||||
conn.send({
|
||||
state_vector: _this.HB.getOperationCounter()
|
||||
});
|
||||
if (!initialized_me) {
|
||||
return setTimeout(sendStateVector, 100);
|
||||
}
|
||||
};
|
||||
})(this);
|
||||
return sendStateVector();
|
||||
};
|
||||
|
||||
return PeerJsConnector;
|
||||
|
||||
})();
|
||||
return peer.on('open', function(id) {
|
||||
return callback(PeerJsConnector, id);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = createPeerJsConnector;
|
||||
|
||||
if (typeof window !== "undefined" && window !== null) {
|
||||
if (window.Y == null) {
|
||||
window.Y = {};
|
||||
}
|
||||
window.Y.createPeerJsConnector = createPeerJsConnector;
|
||||
}
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Connectors/PeerJsConnector.js.map
|
||||
1
build/node/Connectors/PeerJsConnector.js.map
Executable file
1
build/node/Connectors/PeerJsConnector.js.map
Executable file
File diff suppressed because one or more lines are too long
89
build/node/Connectors/TestConnector.js
Normal file
89
build/node/Connectors/TestConnector.js
Normal file
@@ -0,0 +1,89 @@
|
||||
(function() {
|
||||
var _;
|
||||
|
||||
_ = require("underscore");
|
||||
|
||||
module.exports = function(user_list) {
|
||||
var TestConnector;
|
||||
return TestConnector = (function() {
|
||||
function TestConnector(engine, HB, execution_listener) {
|
||||
var appliedOperationsListener, send_;
|
||||
this.engine = engine;
|
||||
this.HB = HB;
|
||||
this.execution_listener = execution_listener;
|
||||
send_ = (function(_this) {
|
||||
return function(o) {
|
||||
return _this.send(o);
|
||||
};
|
||||
})(this);
|
||||
this.execution_listener.push(send_);
|
||||
this.applied_operations = [];
|
||||
appliedOperationsListener = (function(_this) {
|
||||
return function(o) {
|
||||
return _this.applied_operations.push(o);
|
||||
};
|
||||
})(this);
|
||||
this.execution_listener.push(appliedOperationsListener);
|
||||
if (!((user_list != null ? user_list.length : void 0) === 0)) {
|
||||
this.engine.applyOps(user_list[0].getHistoryBuffer()._encode());
|
||||
}
|
||||
this.unexecuted = {};
|
||||
}
|
||||
|
||||
TestConnector.prototype.getOpsInExecutionOrder = function() {
|
||||
return this.applied_operations;
|
||||
};
|
||||
|
||||
TestConnector.prototype.send = function(o) {
|
||||
var user, _i, _len, _results;
|
||||
if ((o.uid.creator === this.HB.getUserId()) && (typeof o.uid.op_number !== "string")) {
|
||||
_results = [];
|
||||
for (_i = 0, _len = user_list.length; _i < _len; _i++) {
|
||||
user = user_list[_i];
|
||||
if (user.getUserId() !== this.HB.getUserId()) {
|
||||
_results.push(user.getConnector().receive(o));
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
|
||||
TestConnector.prototype.receive = function(o) {
|
||||
var _base, _name;
|
||||
if ((_base = this.unexecuted)[_name = o.uid.creator] == null) {
|
||||
_base[_name] = [];
|
||||
}
|
||||
return this.unexecuted[o.uid.creator].push(o);
|
||||
};
|
||||
|
||||
TestConnector.prototype.flushOne = function(user) {
|
||||
var _ref;
|
||||
if (((_ref = this.unexecuted[user]) != null ? _ref.length : void 0) > 0) {
|
||||
return this.engine.applyOp(this.unexecuted[user].shift());
|
||||
}
|
||||
};
|
||||
|
||||
TestConnector.prototype.flushOneRandom = function() {
|
||||
return this.flushOne(_.random(0, user_list.length - 1));
|
||||
};
|
||||
|
||||
TestConnector.prototype.flushAll = function() {
|
||||
var n, ops, _ref;
|
||||
_ref = this.unexecuted;
|
||||
for (n in _ref) {
|
||||
ops = _ref[n];
|
||||
this.engine.applyOps(ops);
|
||||
}
|
||||
return this.unexecuted = {};
|
||||
};
|
||||
|
||||
return TestConnector;
|
||||
|
||||
})();
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Connectors/TestConnector.js.map
|
||||
1
build/node/Connectors/TestConnector.js.map
Executable file
1
build/node/Connectors/TestConnector.js.map
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["Connectors/TestConnector.coffee"],"names":[],"mappings":"AACA;AAAA,MAAA,CAAA;;AAAA,EAAA,CAAA,GAAI,OAAA,CAAQ,YAAR,CAAJ,CAAA;;AAAA,EAEA,MAAM,CAAC,OAAP,GAAiB,SAAC,SAAD,GAAA;AAMf,QAAA,aAAA;WAAM;AAQS,MAAA,uBAAE,MAAF,EAAW,EAAX,EAAgB,kBAAhB,GAAA;AACX,YAAA,gCAAA;AAAA,QADY,IAAC,CAAA,SAAA,MACb,CAAA;AAAA,QADqB,IAAC,CAAA,KAAA,EACtB,CAAA;AAAA,QAD0B,IAAC,CAAA,qBAAA,kBAC3B,CAAA;AAAA,QAAA,KAAA,GAAQ,CAAA,SAAA,KAAA,GAAA;iBAAA,SAAC,CAAD,GAAA;mBACN,KAAC,CAAA,IAAD,CAAM,CAAN,EADM;UAAA,EAAA;QAAA,CAAA,CAAA,CAAA,IAAA,CAAR,CAAA;AAAA,QAEA,IAAC,CAAA,kBAAkB,CAAC,IAApB,CAAyB,KAAzB,CAFA,CAAA;AAAA,QAIA,IAAC,CAAA,kBAAD,GAAsB,EAJtB,CAAA;AAAA,QAKA,yBAAA,GAA4B,CAAA,SAAA,KAAA,GAAA;iBAAA,SAAC,CAAD,GAAA;mBAC1B,KAAC,CAAA,kBAAkB,CAAC,IAApB,CAAyB,CAAzB,EA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AD,GAAA;AACR,YAAA,IAAA;AAAA,QAAA,kDAAoB,CAAE,gBAAnB,GAA4B,CAA/B;iBACE,IAAC,CAAA,MAAM,CAAC,OAAR,CAAgB,IAAC,CAAA,UAAW,CAAA,IAAA,CAAK,CAAC,KAAlB,CAAA,CAAhB,EADF;SADQ;MAAA,CA1CV,CAAA;;AAAA,8BAiDA,cAAA,GAAgB,SAAA,GAAA;eACd,IAAC,CAAA,QAAD,CAAW,CAAC,CAAC,MAAF,CAAS,CAAT,EAAa,SAAS,CAAC,MAAV,GAAiB,CAA9B,CAAX,EADc;MAAA,CAjDhB,CAAA;;AAAA,8BAuDA,QAAA,GAAU,SAAA,GAAA;AACR,YAAA,YAAA;AAAA;AAAA,aAAA,SAAA;wBAAA;AACE,UAAA,IAAC,CAAA,MAAM,CAAC,QAAR,CAAiB,GAAjB,CAAA,CADF;AAAA,SAAA;eAEA,IAAC,CAAA,UAAD,GAAc,GAHN;MAAA,CAvDV,CAAA;;2BAAA;;SAda;EAAA,CAFjB,CAAA;AAAA","file":"Connectors/TestConnector.js","sourceRoot":"/source/","sourcesContent":["\n_ = require \"underscore\"\n\nmodule.exports = (user_list)->\n\n #\n # @nodoc\n # A trivial Connector that simulates network delay.\n #\n class TestConnector\n\n #\n # @param {Engine} engine The transformation engine\n # @param {HistoryBuffer} HB\n # @param {Array<Function>} execution_listener You must ensure that whenever an operation is executed, every function in this Array is called.\n # @param {Yatta} yatta The Yatta framework.\n #\n constructor: (@engine, @HB, @execution_listener)->\n send_ = (o)=>\n @send o\n @execution_listener.push send_\n\n @applied_operations = []\n appliedOperationsListener = (o)=>\n @applied_operations.push o\n @execution_listener.push appliedOperationsListener\n if not (user_list?.length is 0)\n @engine.applyOps user_list[0].getHistoryBuffer()._encode()\n\n @unexecuted = {}\n\n #\n # This engine applied operations in a specific order.\n # Get the ops in the right order.\n #\n getOpsInExecutionOrder: ()->\n @applied_operations\n\n #\n # This function is called whenever an operation was executed.\n # @param {Operation} o The operation that was executed.\n #\n send: (o)->\n if (o.uid.creator is @HB.getUserId()) and (typeof o.uid.op_number isnt \"string\")\n for user in user_list\n if user.getUserId() isnt @HB.getUserId()\n user.getConnector().receive(o)\n\n #\n # This function is called whenever an operation was received from another peer.\n # @param {Operation} o The operation that was received.\n #\n receive: (o)->\n @unexecuted[o.uid.creator] ?= []\n @unexecuted[o.uid.creator].push o\n\n #\n # Flush one operation from the line of a specific user.\n #\n flushOne: (user)->\n if @unexecuted[user]?.length > 0\n @engine.applyOp @unexecuted[user].shift()\n\n #\n # Flush one operation on a random line.\n #\n flushOneRandom: ()->\n @flushOne (_.random 0, (user_list.length-1))\n\n #\n # Flush all operations on every line.\n #\n flushAll: ()->\n for n,ops of @unexecuted\n @engine.applyOps ops\n @unexecuted = {}\n\n"]}
|
||||
110
build/node/Engine.js
Normal file
110
build/node/Engine.js
Normal file
@@ -0,0 +1,110 @@
|
||||
(function() {
|
||||
var Engine;
|
||||
|
||||
Engine = (function() {
|
||||
function Engine(HB, parser) {
|
||||
this.HB = HB;
|
||||
this.parser = parser;
|
||||
this.unprocessed_ops = [];
|
||||
}
|
||||
|
||||
Engine.prototype.parseOperation = function(json) {
|
||||
var typeParser;
|
||||
typeParser = this.parser[json.type];
|
||||
if (typeParser != null) {
|
||||
return typeParser(json);
|
||||
} else {
|
||||
throw new Error("You forgot to specify a parser for type " + json.type + ". The message is " + (JSON.stringify(json)) + ".");
|
||||
}
|
||||
};
|
||||
|
||||
Engine.prototype.applyOpsBundle = function(ops_json) {
|
||||
var o, ops, _i, _j, _k, _len, _len1, _len2;
|
||||
ops = [];
|
||||
for (_i = 0, _len = ops_json.length; _i < _len; _i++) {
|
||||
o = ops_json[_i];
|
||||
ops.push(this.parseOperation(o));
|
||||
}
|
||||
for (_j = 0, _len1 = ops.length; _j < _len1; _j++) {
|
||||
o = ops[_j];
|
||||
this.HB.addOperation(o);
|
||||
}
|
||||
for (_k = 0, _len2 = ops.length; _k < _len2; _k++) {
|
||||
o = ops[_k];
|
||||
if (!o.execute()) {
|
||||
this.unprocessed_ops.push(o);
|
||||
}
|
||||
}
|
||||
return this.tryUnprocessed();
|
||||
};
|
||||
|
||||
Engine.prototype.applyOpsCheckDouble = function(ops_json) {
|
||||
var o, _i, _len, _results;
|
||||
_results = [];
|
||||
for (_i = 0, _len = ops_json.length; _i < _len; _i++) {
|
||||
o = ops_json[_i];
|
||||
if (this.HB.getOperation(o.uid) == null) {
|
||||
_results.push(this.applyOp(o));
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Engine.prototype.applyOps = function(ops_json) {
|
||||
var o, _i, _len, _results;
|
||||
_results = [];
|
||||
for (_i = 0, _len = ops_json.length; _i < _len; _i++) {
|
||||
o = ops_json[_i];
|
||||
_results.push(this.applyOp(o));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Engine.prototype.applyOp = function(op_json) {
|
||||
var o;
|
||||
o = this.parseOperation(op_json);
|
||||
this.HB.addToCounter(o);
|
||||
if (!o.execute()) {
|
||||
this.unprocessed_ops.push(o);
|
||||
} else {
|
||||
this.HB.addOperation(o);
|
||||
}
|
||||
return this.tryUnprocessed();
|
||||
};
|
||||
|
||||
Engine.prototype.tryUnprocessed = function() {
|
||||
var old_length, op, unprocessed, _i, _len, _ref, _results;
|
||||
_results = [];
|
||||
while (true) {
|
||||
old_length = this.unprocessed_ops.length;
|
||||
unprocessed = [];
|
||||
_ref = this.unprocessed_ops;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
op = _ref[_i];
|
||||
if (!op.execute()) {
|
||||
unprocessed.push(op);
|
||||
} else {
|
||||
this.HB.addOperation(op);
|
||||
}
|
||||
}
|
||||
this.unprocessed_ops = unprocessed;
|
||||
if (this.unprocessed_ops.length === old_length) {
|
||||
break;
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
return Engine;
|
||||
|
||||
})();
|
||||
|
||||
module.exports = Engine;
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=Engine.js.map
|
||||
1
build/node/Engine.js.map
Executable file
1
build/node/Engine.js.map
Executable file
File diff suppressed because one or more lines are too long
95
build/node/Frameworks/JsonFramework.js
Normal file
95
build/node/Frameworks/JsonFramework.js
Normal file
@@ -0,0 +1,95 @@
|
||||
(function() {
|
||||
var Engine, HistoryBuffer, JsonFramework, json_types_uninitialized;
|
||||
|
||||
json_types_uninitialized = require("../Types/JsonTypes");
|
||||
|
||||
HistoryBuffer = require("../HistoryBuffer");
|
||||
|
||||
Engine = require("../Engine");
|
||||
|
||||
JsonFramework = (function() {
|
||||
function JsonFramework(user_id, Connector) {
|
||||
var first_word, type_manager;
|
||||
this.HB = new HistoryBuffer(user_id);
|
||||
type_manager = json_types_uninitialized(this.HB);
|
||||
this.types = type_manager.types;
|
||||
this.engine = new Engine(this.HB, type_manager.parser);
|
||||
this.connector = new Connector(this.engine, this.HB, type_manager.execution_listener, this);
|
||||
first_word = new this.types.JsonType(this.HB.getReservedUniqueIdentifier());
|
||||
this.HB.addOperation(first_word).execute();
|
||||
this.root_element = first_word;
|
||||
}
|
||||
|
||||
JsonFramework.prototype.getSharedObject = function() {
|
||||
return this.root_element;
|
||||
};
|
||||
|
||||
JsonFramework.prototype.getConnector = function() {
|
||||
return this.connector;
|
||||
};
|
||||
|
||||
JsonFramework.prototype.getHistoryBuffer = function() {
|
||||
return this.HB;
|
||||
};
|
||||
|
||||
JsonFramework.prototype.setMutableDefault = function(mutable) {
|
||||
return this.root_element.setMutableDefault(mutable);
|
||||
};
|
||||
|
||||
JsonFramework.prototype.getUserId = function() {
|
||||
return this.HB.getUserId();
|
||||
};
|
||||
|
||||
JsonFramework.prototype.toJson = function() {
|
||||
return this.root_element.toJson();
|
||||
};
|
||||
|
||||
JsonFramework.prototype.val = function(name, content, mutable) {
|
||||
return this.root_element.val(name, content, mutable);
|
||||
};
|
||||
|
||||
JsonFramework.prototype.on = function() {
|
||||
var _ref;
|
||||
return (_ref = this.root_element).on.apply(_ref, arguments);
|
||||
};
|
||||
|
||||
JsonFramework.prototype.deleteListener = function() {
|
||||
var _ref;
|
||||
return (_ref = this.root_element).deleteListener.apply(_ref, arguments);
|
||||
};
|
||||
|
||||
Object.defineProperty(JsonFramework.prototype, 'value', {
|
||||
get: function() {
|
||||
return this.root_element.value;
|
||||
},
|
||||
set: function(o) {
|
||||
var o_name, o_obj, _results;
|
||||
if (o.constructor === {}.constructor) {
|
||||
_results = [];
|
||||
for (o_name in o) {
|
||||
o_obj = o[o_name];
|
||||
_results.push(this.val(o_name, o_obj, 'immutable'));
|
||||
}
|
||||
return _results;
|
||||
} else {
|
||||
throw new Error("You must only set Object values!");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return JsonFramework;
|
||||
|
||||
})();
|
||||
|
||||
module.exports = JsonFramework;
|
||||
|
||||
if (typeof window !== "undefined" && window !== null) {
|
||||
if (window.Y == null) {
|
||||
window.Y = {};
|
||||
}
|
||||
window.Y.JsonFramework = JsonFramework;
|
||||
}
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Frameworks/JsonFramework.js.map
|
||||
1
build/node/Frameworks/JsonFramework.js.map
Executable file
1
build/node/Frameworks/JsonFramework.js.map
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["Frameworks/JsonFramework.coffee"],"names":[],"mappings":"AACA;AAAA,MAAA,8DAAA;;AAAA,EAAA,wBAAA,GAA2B,OAAA,CAAQ,oBAAR,CAA3B,CAAA;;AAAA,EACA,aAAA,GAAgB,OAAA,CAAQ,kBAAR,CADhB,CAAA;;AAAA,EAEA,MAAA,GAAS,OAAA,CAAQ,WAAR,CAFT,CAAA;;AAAA,EAWM;AAMS,IAAA,uBAAC,OAAD,EAAU,SAAV,GAAA;AACX,UAAA,wBAAA;AAAA,MAAA,IAAC,CAAA,EAAD,GAAU,IAAA,aAAA,CAAc,OAAd,CA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,CADF;GAhGA;AAAA","file":"Frameworks/JsonFramework.js","sourceRoot":"/source/","sourcesContent":["\njson_types_uninitialized = require \"../Types/JsonTypes\"\nHistoryBuffer = require \"../HistoryBuffer\"\nEngine = require \"../Engine\"\n\n#\n# Framework for Json data-structures.\n# Known values that are supported:\n# * String\n# * Integer\n# * Array\n#\nclass JsonFramework\n\n #\n # @param {String} user_id Unique id of the peer.\n # @param {Connector} Connector the connector class.\n #\n constructor: (user_id, Connector)->\n @HB = new HistoryBuffer user_id\n type_manager = json_types_uninitialized @HB\n @types = type_manager.types\n @engine = new Engine @HB, type_manager.parser\n @connector = new Connector @engine, @HB, type_manager.execution_listener, @\n first_word = new @types.JsonType @HB.getReservedUniqueIdentifier()\n @HB.addOperation(first_word).execute()\n @root_element = first_word\n\n #\n # @return JsonType\n #\n getSharedObject: ()->\n @root_element\n\n #\n # Get the initialized connector.\n #\n getConnector: ()->\n @connector\n\n #\n # @see HistoryBuffer\n #\n getHistoryBuffer: ()->\n @HB\n\n #\n # @see JsonType.setMutableDefault\n #\n setMutableDefault: (mutable)->\n @root_element.setMutableDefault(mutable)\n\n #\n # Get the UserId from the HistoryBuffer object.\n # In most cases this will be the same as the user_id value with which\n # JsonFramework was initialized (Depending on the HistoryBuffer implementation).\n #\n getUserId: ()->\n @HB.getUserId()\n\n #\n # @see JsonType.toJson\n #\n toJson : ()->\n @root_element.toJson()\n\n #\n # @see JsonType.val\n #\n val : (name, content, mutable)->\n @root_element.val(name, content, mutable)\n\n #\n # @see Operation.on\n #\n on: ()->\n @root_element.on arguments...\n\n #\n # @see Operation.deleteListener\n #\n deleteListener: ()->\n @root_element.deleteListener arguments...\n\n #\n # @see JsonType.value\n #\n Object.defineProperty JsonFramework.prototype, 'value',\n get : -> @root_element.value\n set : (o)->\n if o.constructor is {}.constructor\n for o_name,o_obj of o\n @val(o_name, o_obj, 'immutable')\n else\n throw new Error \"You must only set Object values!\"\n\nmodule.exports = JsonFramework\nif window?\n if not window.Y?\n window.Y = {}\n window.Y.JsonFramework = JsonFramework\n"]}
|
||||
111
build/node/Frameworks/TextFramework.js
Normal file
111
build/node/Frameworks/TextFramework.js
Normal file
@@ -0,0 +1,111 @@
|
||||
(function() {
|
||||
var Engine, HistoryBuffer, TextFramework, text_types_uninitialized;
|
||||
|
||||
text_types_uninitialized = require("../Types/TextTypes");
|
||||
|
||||
HistoryBuffer = require("../HistoryBuffer");
|
||||
|
||||
Engine = require("../Engine");
|
||||
|
||||
TextFramework = (function() {
|
||||
function TextFramework(user_id, Connector) {
|
||||
var beg, beginning, end, first_word, text_types, uid_beg, uid_end, uid_r;
|
||||
this.HB = new HistoryBuffer(user_id);
|
||||
text_types = text_types_uninitialized(this.HB);
|
||||
this.types = text_types.types;
|
||||
this.engine = new Engine(this.HB, text_types.parser);
|
||||
this.connector = new Connector(this.engine, this.HB, text_types.execution_listener, this);
|
||||
beginning = this.HB.addOperation(new this.types.Delimiter({
|
||||
creator: '_',
|
||||
op_number: '_beginning'
|
||||
}, void 0, void 0));
|
||||
end = this.HB.addOperation(new this.types.Delimiter({
|
||||
creator: '_',
|
||||
op_number: '_end'
|
||||
}, beginning, void 0));
|
||||
beginning.next_cl = end;
|
||||
beginning.execute();
|
||||
end.execute();
|
||||
first_word = new this.types.WordType({
|
||||
creator: '_',
|
||||
op_number: '_'
|
||||
}, beginning, end);
|
||||
this.HB.addOperation(first_word).execute();
|
||||
uid_r = {
|
||||
creator: '_',
|
||||
op_number: "RM"
|
||||
};
|
||||
uid_beg = {
|
||||
creator: '_',
|
||||
op_number: "_RM_beginning"
|
||||
};
|
||||
uid_end = {
|
||||
creator: '_',
|
||||
op_number: "_RM_end"
|
||||
};
|
||||
beg = this.HB.addOperation(new this.types.Delimiter(uid_beg, void 0, uid_end)).execute();
|
||||
end = this.HB.addOperation(new this.types.Delimiter(uid_end, beg, void 0)).execute();
|
||||
this.root_element = this.HB.addOperation(new this.types.ReplaceManager(void 0, uid_r, beg, end)).execute();
|
||||
this.root_element.replace(first_word, {
|
||||
creator: '_',
|
||||
op_number: 'Replaceable'
|
||||
});
|
||||
}
|
||||
|
||||
TextFramework.prototype.getSharedObject = function() {
|
||||
return this.root_element.val();
|
||||
};
|
||||
|
||||
TextFramework.prototype.getConnector = function() {
|
||||
return this.connector;
|
||||
};
|
||||
|
||||
TextFramework.prototype.getHistoryBuffer = function() {
|
||||
return this.HB;
|
||||
};
|
||||
|
||||
TextFramework.prototype.getUserId = function() {
|
||||
return this.HB.getUserId();
|
||||
};
|
||||
|
||||
TextFramework.prototype.val = function() {
|
||||
return this.getSharedObject().val();
|
||||
};
|
||||
|
||||
TextFramework.prototype.insertText = function(pos, content) {
|
||||
return this.getSharedObject().insertText(pos, content);
|
||||
};
|
||||
|
||||
TextFramework.prototype.deleteText = function(pos, length) {
|
||||
return this.getSharedObject().deleteText(pos, length);
|
||||
};
|
||||
|
||||
TextFramework.prototype.bind = function(textarea) {
|
||||
return this.getSharedObject().bind(textarea);
|
||||
};
|
||||
|
||||
TextFramework.prototype.replaceText = function(text) {
|
||||
return this.getSharedObject().replaceText(text);
|
||||
};
|
||||
|
||||
TextFramework.prototype.on = function() {
|
||||
var _ref;
|
||||
return (_ref = this.root_element).on.apply(_ref, arguments);
|
||||
};
|
||||
|
||||
return TextFramework;
|
||||
|
||||
})();
|
||||
|
||||
module.exports = TextFramework;
|
||||
|
||||
if (typeof window !== "undefined" && window !== null) {
|
||||
if (window.Y == null) {
|
||||
window.Y = {};
|
||||
}
|
||||
window.Y.TextFramework = TextFramework;
|
||||
}
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Frameworks/TextFramework.js.map
|
||||
1
build/node/Frameworks/TextFramework.js.map
Executable file
1
build/node/Frameworks/TextFramework.js.map
Executable file
File diff suppressed because one or more lines are too long
139
build/node/HistoryBuffer.js
Normal file
139
build/node/HistoryBuffer.js
Normal file
@@ -0,0 +1,139 @@
|
||||
(function() {
|
||||
var HistoryBuffer;
|
||||
|
||||
HistoryBuffer = (function() {
|
||||
function HistoryBuffer(user_id) {
|
||||
this.user_id = user_id;
|
||||
this.operation_counter = {};
|
||||
this.buffer = {};
|
||||
this.change_listeners = [];
|
||||
}
|
||||
|
||||
HistoryBuffer.prototype.getUserId = function() {
|
||||
return this.user_id;
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.getReservedUniqueIdentifier = function() {
|
||||
return {
|
||||
creator: '_',
|
||||
op_number: '_'
|
||||
};
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.getOperationCounter = function() {
|
||||
var ctn, res, user, _ref;
|
||||
res = {};
|
||||
_ref = this.operation_counter;
|
||||
for (user in _ref) {
|
||||
ctn = _ref[user];
|
||||
res[user] = ctn;
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype._encode = function(state_vector) {
|
||||
var json, o, o_json, o_next, o_number, o_prev, u_name, unknown, user, _ref;
|
||||
if (state_vector == null) {
|
||||
state_vector = {};
|
||||
}
|
||||
json = [];
|
||||
unknown = function(user, o_number) {
|
||||
if ((user == null) || (o_number == null)) {
|
||||
throw new Error("dah!");
|
||||
}
|
||||
return (state_vector[user] == null) || state_vector[user] <= o_number;
|
||||
};
|
||||
_ref = this.buffer;
|
||||
for (u_name in _ref) {
|
||||
user = _ref[u_name];
|
||||
for (o_number in user) {
|
||||
o = user[o_number];
|
||||
if ((!isNaN(parseInt(o_number))) && unknown(u_name, o_number)) {
|
||||
o_json = o._encode();
|
||||
if (o.next_cl != null) {
|
||||
o_next = o.next_cl;
|
||||
while ((o_next.next_cl != null) && unknown(o_next.creator, o_next.op_number)) {
|
||||
o_next = o_next.next_cl;
|
||||
}
|
||||
o_json.next = o_next.getUid();
|
||||
} else if (o.prev_cl != null) {
|
||||
o_prev = o.prev_cl;
|
||||
while ((o_prev.prev_cl != null) && unknown(o_prev.creator, o_prev.op_number)) {
|
||||
o_prev = o_prev.prev_cl;
|
||||
}
|
||||
o_json.prev = o_prev.getUid();
|
||||
}
|
||||
json.push(o_json);
|
||||
}
|
||||
}
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.getNextOperationIdentifier = function(user_id) {
|
||||
var uid;
|
||||
if (user_id == null) {
|
||||
user_id = this.user_id;
|
||||
}
|
||||
if (this.operation_counter[user_id] == null) {
|
||||
this.operation_counter[user_id] = 0;
|
||||
}
|
||||
uid = {
|
||||
'creator': user_id,
|
||||
'op_number': this.operation_counter[user_id]
|
||||
};
|
||||
this.operation_counter[user_id]++;
|
||||
return uid;
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.getOperation = function(uid) {
|
||||
var _ref;
|
||||
if (uid instanceof Object) {
|
||||
return (_ref = this.buffer[uid.creator]) != null ? _ref[uid.op_number] : void 0;
|
||||
} else if (uid == null) {
|
||||
|
||||
} else {
|
||||
throw new Error("This type of uid is not defined!");
|
||||
}
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.addOperation = function(o) {
|
||||
if (this.buffer[o.creator] == null) {
|
||||
this.buffer[o.creator] = {};
|
||||
}
|
||||
if (this.buffer[o.creator][o.op_number] != null) {
|
||||
throw new Error("You must not overwrite operations!");
|
||||
}
|
||||
this.buffer[o.creator][o.op_number] = o;
|
||||
return o;
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.addToCounter = function(o) {
|
||||
var _results;
|
||||
if (this.operation_counter[o.creator] == null) {
|
||||
this.operation_counter[o.creator] = 0;
|
||||
}
|
||||
if (typeof o.op_number === 'number' && o.creator !== this.getUserId()) {
|
||||
if (o.op_number === this.operation_counter[o.creator]) {
|
||||
this.operation_counter[o.creator]++;
|
||||
_results = [];
|
||||
while (this.getOperation({
|
||||
creator: o.creator,
|
||||
op_number: this.operation_counter[o.creator]
|
||||
}) != null) {
|
||||
_results.push(this.operation_counter[o.creator]++);
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return HistoryBuffer;
|
||||
|
||||
})();
|
||||
|
||||
module.exports = HistoryBuffer;
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=HistoryBuffer.js.map
|
||||
1
build/node/HistoryBuffer.js.map
Executable file
1
build/node/HistoryBuffer.js.map
Executable file
File diff suppressed because one or more lines are too long
420
build/node/Types/BasicTypes.js
Normal file
420
build/node/Types/BasicTypes.js
Normal file
@@ -0,0 +1,420 @@
|
||||
(function() {
|
||||
var __slice = [].slice,
|
||||
__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; };
|
||||
|
||||
module.exports = function(HB) {
|
||||
var Delete, Delimiter, ImmutableObject, Insert, Operation, execution_listener, parser;
|
||||
parser = {};
|
||||
execution_listener = [];
|
||||
Operation = (function() {
|
||||
function Operation(uid) {
|
||||
if (uid == null) {
|
||||
uid = HB.getNextOperationIdentifier();
|
||||
}
|
||||
this.creator = uid['creator'], this.op_number = uid['op_number'];
|
||||
}
|
||||
|
||||
Operation.prototype.on = function(events, f) {
|
||||
var e, _base, _i, _len, _results;
|
||||
if (this.event_listeners == null) {
|
||||
this.event_listeners = {};
|
||||
}
|
||||
if (events.constructor !== [].constructor) {
|
||||
events = [events];
|
||||
}
|
||||
_results = [];
|
||||
for (_i = 0, _len = events.length; _i < _len; _i++) {
|
||||
e = events[_i];
|
||||
if ((_base = this.event_listeners)[e] == null) {
|
||||
_base[e] = [];
|
||||
}
|
||||
_results.push(this.event_listeners[e].push(f));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Operation.prototype.deleteListener = function(events, f) {
|
||||
var e, _i, _len, _ref, _results;
|
||||
if (events.constructor !== [].constructor) {
|
||||
events = [events];
|
||||
}
|
||||
_results = [];
|
||||
for (_i = 0, _len = events.length; _i < _len; _i++) {
|
||||
e = events[_i];
|
||||
if (((_ref = this.event_listeners) != null ? _ref[e] : void 0) != null) {
|
||||
_results.push(this.event_listeners[e] = this.event_listeners[e].filter(function(g) {
|
||||
return f !== g;
|
||||
}));
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Operation.prototype.callEvent = function() {
|
||||
return this.forwardEvent.apply(this, [this].concat(__slice.call(arguments)));
|
||||
};
|
||||
|
||||
Operation.prototype.forwardEvent = function() {
|
||||
var args, event, f, op, _i, _len, _ref, _ref1, _results;
|
||||
op = arguments[0], event = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
|
||||
if (((_ref = this.event_listeners) != null ? _ref[event] : void 0) != null) {
|
||||
_ref1 = this.event_listeners[event];
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
||||
f = _ref1[_i];
|
||||
_results.push(f.call.apply(f, [op, event].concat(__slice.call(args))));
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
|
||||
Operation.prototype.setParent = function(parent) {
|
||||
this.parent = parent;
|
||||
};
|
||||
|
||||
Operation.prototype.getParent = function() {
|
||||
return this.parent;
|
||||
};
|
||||
|
||||
Operation.prototype.getUid = function() {
|
||||
return {
|
||||
'creator': this.creator,
|
||||
'op_number': this.op_number
|
||||
};
|
||||
};
|
||||
|
||||
Operation.prototype.execute = function() {
|
||||
var l, _i, _len;
|
||||
this.is_executed = true;
|
||||
for (_i = 0, _len = execution_listener.length; _i < _len; _i++) {
|
||||
l = execution_listener[_i];
|
||||
l(this._encode());
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
Operation.prototype.saveOperation = function(name, op) {
|
||||
if ((op != null ? op.execute : void 0) != null) {
|
||||
return this[name] = op;
|
||||
} else if (op != null) {
|
||||
if (this.unchecked == null) {
|
||||
this.unchecked = {};
|
||||
}
|
||||
return this.unchecked[name] = op;
|
||||
}
|
||||
};
|
||||
|
||||
Operation.prototype.validateSavedOperations = function() {
|
||||
var name, op, op_uid, success, uninstantiated, _ref;
|
||||
uninstantiated = {};
|
||||
success = this;
|
||||
_ref = this.unchecked;
|
||||
for (name in _ref) {
|
||||
op_uid = _ref[name];
|
||||
op = HB.getOperation(op_uid);
|
||||
if (op) {
|
||||
this[name] = op;
|
||||
} else {
|
||||
uninstantiated[name] = op_uid;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
delete this.unchecked;
|
||||
if (!success) {
|
||||
this.unchecked = uninstantiated;
|
||||
}
|
||||
return success;
|
||||
};
|
||||
|
||||
return Operation;
|
||||
|
||||
})();
|
||||
Delete = (function(_super) {
|
||||
__extends(Delete, _super);
|
||||
|
||||
function Delete(uid, deletes) {
|
||||
this.saveOperation('deletes', deletes);
|
||||
Delete.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
Delete.prototype._encode = function() {
|
||||
return {
|
||||
'type': "Delete",
|
||||
'uid': this.getUid(),
|
||||
'deletes': this.deletes.getUid()
|
||||
};
|
||||
};
|
||||
|
||||
Delete.prototype.execute = function() {
|
||||
if (this.validateSavedOperations()) {
|
||||
this.deletes.applyDelete(this);
|
||||
return Delete.__super__.execute.apply(this, arguments);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
return Delete;
|
||||
|
||||
})(Operation);
|
||||
parser['Delete'] = function(o) {
|
||||
var deletes_uid, uid;
|
||||
uid = o['uid'], deletes_uid = o['deletes'];
|
||||
return new Delete(uid, deletes_uid);
|
||||
};
|
||||
Insert = (function(_super) {
|
||||
__extends(Insert, _super);
|
||||
|
||||
function Insert(uid, prev_cl, next_cl, origin) {
|
||||
this.saveOperation('prev_cl', prev_cl);
|
||||
this.saveOperation('next_cl', next_cl);
|
||||
if (origin != null) {
|
||||
this.saveOperation('origin', origin);
|
||||
} else {
|
||||
this.saveOperation('origin', prev_cl);
|
||||
}
|
||||
Insert.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
Insert.prototype.applyDelete = function(o) {
|
||||
if (this.deleted_by == null) {
|
||||
this.deleted_by = [];
|
||||
}
|
||||
this.deleted_by.push(o);
|
||||
if ((this.parent != null) && this.deleted_by.length === 1) {
|
||||
return this.parent.callEvent("delete", this);
|
||||
}
|
||||
};
|
||||
|
||||
Insert.prototype.isDeleted = function() {
|
||||
var _ref;
|
||||
return ((_ref = this.deleted_by) != null ? _ref.length : void 0) > 0;
|
||||
};
|
||||
|
||||
Insert.prototype.getDistanceToOrigin = function() {
|
||||
var d, o;
|
||||
d = 0;
|
||||
o = this.prev_cl;
|
||||
while (true) {
|
||||
if (this.origin === o) {
|
||||
break;
|
||||
}
|
||||
d++;
|
||||
if (this === this.prev_cl) {
|
||||
throw new Error("this should not happen ;) ");
|
||||
}
|
||||
o = o.prev_cl;
|
||||
}
|
||||
return d;
|
||||
};
|
||||
|
||||
Insert.prototype.update_sl = function() {
|
||||
var o;
|
||||
o = this.prev_cl;
|
||||
({
|
||||
update: function(dest_cl, dest_sl) {
|
||||
var _results;
|
||||
_results = [];
|
||||
while (true) {
|
||||
if (o.isDeleted()) {
|
||||
_results.push(o = o[dest_cl]);
|
||||
} else {
|
||||
this[dest_sl] = o;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
});
|
||||
update("prev_cl", "prev_sl");
|
||||
return update("next_cl", "prev_sl");
|
||||
};
|
||||
|
||||
Insert.prototype.execute = function() {
|
||||
var distance_to_origin, i, o, parent, _ref, _ref1, _ref2;
|
||||
if (this.is_executed != null) {
|
||||
return this;
|
||||
}
|
||||
if (!this.validateSavedOperations()) {
|
||||
return false;
|
||||
} else {
|
||||
if (((_ref = this.prev_cl) != null ? _ref.validateSavedOperations() : void 0) && ((_ref1 = this.next_cl) != null ? _ref1.validateSavedOperations() : void 0) && this.prev_cl.next_cl !== this) {
|
||||
distance_to_origin = 0;
|
||||
o = this.prev_cl.next_cl;
|
||||
i = 0;
|
||||
while (true) {
|
||||
if (o == null) {
|
||||
console.log(JSON.stringify(this.prev_cl.getUid()));
|
||||
console.log(JSON.stringify(this.next_cl.getUid()));
|
||||
}
|
||||
if (o !== this.next_cl) {
|
||||
if (o.getDistanceToOrigin() === i) {
|
||||
if (o.creator < this.creator) {
|
||||
this.prev_cl = o;
|
||||
distance_to_origin = i + 1;
|
||||
} else {
|
||||
|
||||
}
|
||||
} else if (o.getDistanceToOrigin() < i) {
|
||||
if (i - distance_to_origin <= o.getDistanceToOrigin()) {
|
||||
this.prev_cl = o;
|
||||
distance_to_origin = i + 1;
|
||||
} else {
|
||||
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
o = o.next_cl;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.next_cl = this.prev_cl.next_cl;
|
||||
this.prev_cl.next_cl = this;
|
||||
this.next_cl.prev_cl = this;
|
||||
}
|
||||
parent = (_ref2 = this.prev_cl) != null ? _ref2.getParent() : void 0;
|
||||
if (parent != null) {
|
||||
this.setParent(parent);
|
||||
this.parent.callEvent("insert", this);
|
||||
}
|
||||
return Insert.__super__.execute.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
Insert.prototype.getPosition = function() {
|
||||
var position, prev;
|
||||
position = 0;
|
||||
prev = this.prev_cl;
|
||||
while (true) {
|
||||
if (prev instanceof Delimiter) {
|
||||
break;
|
||||
}
|
||||
if ((prev.isDeleted != null) && !prev.isDeleted()) {
|
||||
position++;
|
||||
}
|
||||
prev = prev.prev_cl;
|
||||
}
|
||||
return position;
|
||||
};
|
||||
|
||||
return Insert;
|
||||
|
||||
})(Operation);
|
||||
ImmutableObject = (function(_super) {
|
||||
__extends(ImmutableObject, _super);
|
||||
|
||||
function ImmutableObject(uid, content, prev, next, origin) {
|
||||
this.content = content;
|
||||
ImmutableObject.__super__.constructor.call(this, uid, prev, next, origin);
|
||||
}
|
||||
|
||||
ImmutableObject.prototype.val = function() {
|
||||
return this.content;
|
||||
};
|
||||
|
||||
ImmutableObject.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "ImmutableObject",
|
||||
'uid': this.getUid(),
|
||||
'content': this.content
|
||||
};
|
||||
if (this.prev_cl != null) {
|
||||
json['prev'] = this.prev_cl.getUid();
|
||||
}
|
||||
if (this.next_cl != null) {
|
||||
json['next'] = this.next_cl.getUid();
|
||||
}
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return ImmutableObject;
|
||||
|
||||
})(Insert);
|
||||
parser['ImmutableObject'] = function(json) {
|
||||
var content, next, origin, prev, uid;
|
||||
uid = json['uid'], content = json['content'], prev = json['prev'], next = json['next'], origin = json['origin'];
|
||||
return new ImmutableObject(uid, content, prev, next, origin);
|
||||
};
|
||||
Delimiter = (function(_super) {
|
||||
__extends(Delimiter, _super);
|
||||
|
||||
function Delimiter(uid, prev_cl, next_cl, origin) {
|
||||
this.saveOperation('prev_cl', prev_cl);
|
||||
this.saveOperation('next_cl', next_cl);
|
||||
this.saveOperation('origin', prev_cl);
|
||||
Delimiter.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
Delimiter.prototype.isDeleted = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
Delimiter.prototype.execute = function() {
|
||||
var _ref, _ref1;
|
||||
if (((_ref = this.unchecked) != null ? _ref['next_cl'] : void 0) != null) {
|
||||
return Delimiter.__super__.execute.apply(this, arguments);
|
||||
} else if ((_ref1 = this.unchecked) != null ? _ref1['prev_cl'] : void 0) {
|
||||
if (this.validateSavedOperations()) {
|
||||
if (this.prev_cl.next_cl != null) {
|
||||
throw new Error("Probably duplicated operations");
|
||||
}
|
||||
this.prev_cl.next_cl = this;
|
||||
delete this.prev_cl.unchecked.next_cl;
|
||||
return Delimiter.__super__.execute.apply(this, arguments);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if ((this.prev_cl != null) && (this.prev_cl.next_cl == null)) {
|
||||
delete this.prev_cl.unchecked.next_cl;
|
||||
return this.prev_cl.next_cl = this;
|
||||
} else if ((this.prev_cl != null) || (this.next_cl != null)) {
|
||||
return Delimiter.__super__.execute.apply(this, arguments);
|
||||
} else {
|
||||
throw new Error("Delimiter is unsufficient defined!");
|
||||
}
|
||||
};
|
||||
|
||||
Delimiter.prototype._encode = function() {
|
||||
var _ref, _ref1;
|
||||
return {
|
||||
'type': "Delimiter",
|
||||
'uid': this.getUid(),
|
||||
'prev': (_ref = this.prev_cl) != null ? _ref.getUid() : void 0,
|
||||
'next': (_ref1 = this.next_cl) != null ? _ref1.getUid() : void 0
|
||||
};
|
||||
};
|
||||
|
||||
return Delimiter;
|
||||
|
||||
})(Operation);
|
||||
parser['Delimiter'] = function(json) {
|
||||
var next, prev, uid;
|
||||
uid = json['uid'], prev = json['prev'], next = json['next'];
|
||||
return new Delimiter(uid, prev, next);
|
||||
};
|
||||
return {
|
||||
'types': {
|
||||
'Delete': Delete,
|
||||
'Insert': Insert,
|
||||
'Delimiter': Delimiter,
|
||||
'Operation': Operation,
|
||||
'ImmutableObject': ImmutableObject
|
||||
},
|
||||
'parser': parser,
|
||||
'execution_listener': execution_listener
|
||||
};
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Types/BasicTypes.js.map
|
||||
1
build/node/Types/BasicTypes.js.map
Executable file
1
build/node/Types/BasicTypes.js.map
Executable file
File diff suppressed because one or more lines are too long
206
build/node/Types/JsonTypes.js
Normal file
206
build/node/Types/JsonTypes.js
Normal file
@@ -0,0 +1,206 @@
|
||||
(function() {
|
||||
var text_types_uninitialized,
|
||||
__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; },
|
||||
__slice = [].slice;
|
||||
|
||||
text_types_uninitialized = require("./TextTypes");
|
||||
|
||||
module.exports = function(HB) {
|
||||
var JsonType, createJsonTypeWrapper, parser, text_types, types;
|
||||
text_types = text_types_uninitialized(HB);
|
||||
types = text_types.types;
|
||||
parser = text_types.parser;
|
||||
createJsonTypeWrapper = function(_jsonType) {
|
||||
var JsonTypeWrapper;
|
||||
JsonTypeWrapper = (function() {
|
||||
function JsonTypeWrapper(jsonType) {
|
||||
var name, obj, _fn, _ref;
|
||||
_ref = jsonType.map;
|
||||
_fn = function(name, obj) {
|
||||
return Object.defineProperty(JsonTypeWrapper.prototype, name, {
|
||||
get: function() {
|
||||
var x;
|
||||
x = obj.val();
|
||||
if (x instanceof JsonType) {
|
||||
return createJsonTypeWrapper(x);
|
||||
} else if (x instanceof types.ImmutableObject) {
|
||||
return x.val();
|
||||
} else {
|
||||
return x;
|
||||
}
|
||||
},
|
||||
set: function(o) {
|
||||
var o_name, o_obj, overwrite, _results;
|
||||
overwrite = jsonType.val(name);
|
||||
if (o.constructor === {}.constructor && overwrite instanceof types.Operation) {
|
||||
_results = [];
|
||||
for (o_name in o) {
|
||||
o_obj = o[o_name];
|
||||
_results.push(overwrite.val(o_name, o_obj, 'immutable'));
|
||||
}
|
||||
return _results;
|
||||
} else {
|
||||
return jsonType.val(name, o, 'immutable');
|
||||
}
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: false
|
||||
});
|
||||
};
|
||||
for (name in _ref) {
|
||||
obj = _ref[name];
|
||||
_fn(name, obj);
|
||||
}
|
||||
}
|
||||
|
||||
return JsonTypeWrapper;
|
||||
|
||||
})();
|
||||
return new JsonTypeWrapper(_jsonType);
|
||||
};
|
||||
JsonType = (function(_super) {
|
||||
__extends(JsonType, _super);
|
||||
|
||||
function JsonType(uid, initial_value, mutable) {
|
||||
var name, o;
|
||||
JsonType.__super__.constructor.call(this, uid);
|
||||
if (initial_value != null) {
|
||||
if (typeof initial_value !== "object") {
|
||||
throw new Error("The initial value of JsonTypes must be of type Object! (current type: " + (typeof initial_value) + ")");
|
||||
}
|
||||
for (name in initial_value) {
|
||||
o = initial_value[name];
|
||||
this.val(name, o, mutable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JsonType.prototype.type = "JsonType";
|
||||
|
||||
JsonType.prototype.toJson = function() {
|
||||
var json, name, o, val;
|
||||
val = this.val();
|
||||
json = {};
|
||||
for (name in val) {
|
||||
o = val[name];
|
||||
if (o.constructor === {}.constructor) {
|
||||
json[name] = this.val(name).toJson();
|
||||
} else if (o instanceof types.Operation) {
|
||||
while (o instanceof types.Operation) {
|
||||
o = o.val();
|
||||
}
|
||||
json[name] = o;
|
||||
} else {
|
||||
json[name] = o;
|
||||
}
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
JsonType.prototype.setReplaceManager = function(rm) {
|
||||
this.parent = rm.parent;
|
||||
return this.on(['change', 'addProperty'], function() {
|
||||
var _ref;
|
||||
return (_ref = rm.parent).forwardEvent.apply(_ref, [this].concat(__slice.call(arguments)));
|
||||
});
|
||||
};
|
||||
|
||||
JsonType.prototype.getParent = function() {
|
||||
return this.parent;
|
||||
};
|
||||
|
||||
JsonType.prototype.mutable_default = true;
|
||||
|
||||
JsonType.prototype.setMutableDefault = function(mutable) {
|
||||
if (mutable === true || mutable === 'mutable') {
|
||||
JsonType.prototype.mutable_default = true;
|
||||
} else if (mutable === false || mutable === 'immutable') {
|
||||
JsonType.prototype.mutable_default = false;
|
||||
} else {
|
||||
throw new Error('Set mutable either "mutable" or "immutable"!');
|
||||
}
|
||||
return 'OK';
|
||||
};
|
||||
|
||||
JsonType.prototype.val = function(name, content, mutable) {
|
||||
var json, o, o_name, obj, word;
|
||||
if (typeof name === 'object') {
|
||||
for (o_name in name) {
|
||||
o = name[o_name];
|
||||
this.val(o_name, o, content);
|
||||
}
|
||||
return this;
|
||||
} else if ((name != null) && (content != null)) {
|
||||
if (mutable != null) {
|
||||
if (mutable === true || mutable === 'mutable') {
|
||||
mutable = true;
|
||||
} else {
|
||||
mutable = false;
|
||||
}
|
||||
} else {
|
||||
mutable = this.mutable_default;
|
||||
}
|
||||
if (typeof content === 'function') {
|
||||
return this;
|
||||
} else if (((!mutable) || typeof content === 'number') && content.constructor !== Object) {
|
||||
obj = HB.addOperation(new types.ImmutableObject(void 0, content)).execute();
|
||||
return JsonType.__super__.val.call(this, name, obj);
|
||||
} else {
|
||||
if (typeof content === 'string') {
|
||||
word = HB.addOperation(new types.WordType(void 0)).execute();
|
||||
word.insertText(0, content);
|
||||
return JsonType.__super__.val.call(this, name, word);
|
||||
} else if (content.constructor === Object) {
|
||||
json = HB.addOperation(new JsonType(void 0, content, mutable)).execute();
|
||||
return JsonType.__super__.val.call(this, name, json);
|
||||
} else {
|
||||
throw new Error("You must not set " + (typeof content) + "-types in collaborative Json-objects!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return JsonType.__super__.val.call(this, name, content);
|
||||
}
|
||||
};
|
||||
|
||||
Object.defineProperty(JsonType.prototype, 'value', {
|
||||
get: function() {
|
||||
return createJsonTypeWrapper(this);
|
||||
},
|
||||
set: function(o) {
|
||||
var o_name, o_obj, _results;
|
||||
if (o.constructor === {}.constructor) {
|
||||
_results = [];
|
||||
for (o_name in o) {
|
||||
o_obj = o[o_name];
|
||||
_results.push(this.val(o_name, o_obj, 'immutable'));
|
||||
}
|
||||
return _results;
|
||||
} else {
|
||||
throw new Error("You must only set Object values!");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
JsonType.prototype._encode = function() {
|
||||
return {
|
||||
'type': "JsonType",
|
||||
'uid': this.getUid()
|
||||
};
|
||||
};
|
||||
|
||||
return JsonType;
|
||||
|
||||
})(types.MapManager);
|
||||
parser['JsonType'] = function(json) {
|
||||
var uid;
|
||||
uid = json['uid'];
|
||||
return new JsonType(uid);
|
||||
};
|
||||
types['JsonType'] = JsonType;
|
||||
return text_types;
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Types/JsonTypes.js.map
|
||||
1
build/node/Types/JsonTypes.js.map
Executable file
1
build/node/Types/JsonTypes.js.map
Executable file
File diff suppressed because one or more lines are too long
314
build/node/Types/StructuredTypes.js
Normal file
314
build/node/Types/StructuredTypes.js
Normal file
@@ -0,0 +1,314 @@
|
||||
(function() {
|
||||
var basic_types_uninitialized,
|
||||
__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; };
|
||||
|
||||
basic_types_uninitialized = require("./BasicTypes");
|
||||
|
||||
module.exports = function(HB) {
|
||||
var AddName, ListManager, MapManager, ReplaceManager, Replaceable, basic_types, parser, types;
|
||||
basic_types = basic_types_uninitialized(HB);
|
||||
types = basic_types.types;
|
||||
parser = basic_types.parser;
|
||||
MapManager = (function(_super) {
|
||||
__extends(MapManager, _super);
|
||||
|
||||
function MapManager(uid) {
|
||||
this.map = {};
|
||||
MapManager.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
MapManager.prototype.val = function(name, content) {
|
||||
var o, obj, result, _ref, _ref1;
|
||||
if (content != null) {
|
||||
if (this.map[name] == null) {
|
||||
HB.addOperation(new AddName(void 0, this, name)).execute();
|
||||
}
|
||||
this.map[name].replace(content);
|
||||
return this;
|
||||
} else if (name != null) {
|
||||
obj = (_ref = this.map[name]) != null ? _ref.val() : void 0;
|
||||
if (obj instanceof types.ImmutableObject) {
|
||||
return obj.val();
|
||||
} else {
|
||||
return obj;
|
||||
}
|
||||
} else {
|
||||
result = {};
|
||||
_ref1 = this.map;
|
||||
for (name in _ref1) {
|
||||
o = _ref1[name];
|
||||
obj = o.val();
|
||||
if (obj instanceof types.ImmutableObject || obj instanceof MapManager) {
|
||||
obj = obj.val();
|
||||
}
|
||||
result[name] = obj;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
return MapManager;
|
||||
|
||||
})(types.Operation);
|
||||
AddName = (function(_super) {
|
||||
__extends(AddName, _super);
|
||||
|
||||
function AddName(uid, map_manager, name) {
|
||||
this.name = name;
|
||||
this.saveOperation('map_manager', map_manager);
|
||||
AddName.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
AddName.prototype.execute = function() {
|
||||
var beg, end, uid_beg, uid_end, uid_r;
|
||||
if (!this.validateSavedOperations()) {
|
||||
return false;
|
||||
} else {
|
||||
uid_r = this.map_manager.getUid();
|
||||
uid_r.op_number = "_" + uid_r.op_number + "_RM_" + this.name;
|
||||
if (HB.getOperation(uid_r) == null) {
|
||||
uid_beg = this.map_manager.getUid();
|
||||
uid_beg.op_number = "_" + uid_beg.op_number + "_RM_" + this.name + "_beginning";
|
||||
uid_end = this.map_manager.getUid();
|
||||
uid_end.op_number = "_" + uid_end.op_number + "_RM_" + this.name + "_end";
|
||||
beg = HB.addOperation(new types.Delimiter(uid_beg, void 0, uid_end)).execute();
|
||||
end = HB.addOperation(new types.Delimiter(uid_end, beg, void 0)).execute();
|
||||
this.map_manager.map[this.name] = HB.addOperation(new ReplaceManager(void 0, uid_r, beg, end));
|
||||
this.map_manager.map[this.name].setParent(this.map_manager, this.name);
|
||||
this.map_manager.map[this.name].execute();
|
||||
}
|
||||
return AddName.__super__.execute.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
AddName.prototype._encode = function() {
|
||||
return {
|
||||
'type': "AddName",
|
||||
'uid': this.getUid(),
|
||||
'map_manager': this.map_manager.getUid(),
|
||||
'name': this.name
|
||||
};
|
||||
};
|
||||
|
||||
return AddName;
|
||||
|
||||
})(types.Operation);
|
||||
parser['AddName'] = function(json) {
|
||||
var map_manager, name, uid;
|
||||
map_manager = json['map_manager'], uid = json['uid'], name = json['name'];
|
||||
return new AddName(uid, map_manager, name);
|
||||
};
|
||||
ListManager = (function(_super) {
|
||||
__extends(ListManager, _super);
|
||||
|
||||
function ListManager(uid, beginning, end, prev, next, origin) {
|
||||
if ((beginning != null) && (end != null)) {
|
||||
this.saveOperation('beginning', beginning);
|
||||
this.saveOperation('end', end);
|
||||
} else {
|
||||
this.beginning = HB.addOperation(new types.Delimiter(void 0, void 0, void 0));
|
||||
this.end = HB.addOperation(new types.Delimiter(void 0, this.beginning, void 0));
|
||||
this.beginning.next_cl = this.end;
|
||||
this.beginning.execute();
|
||||
this.end.execute();
|
||||
}
|
||||
ListManager.__super__.constructor.call(this, uid, prev, next, origin);
|
||||
}
|
||||
|
||||
ListManager.prototype.execute = function() {
|
||||
if (this.validateSavedOperations()) {
|
||||
this.beginning.setParent(this);
|
||||
this.end.setParent(this);
|
||||
return ListManager.__super__.execute.apply(this, arguments);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
ListManager.prototype.getLastOperation = function() {
|
||||
return this.end.prev_cl;
|
||||
};
|
||||
|
||||
ListManager.prototype.getFirstOperation = function() {
|
||||
return this.beginning.next_cl;
|
||||
};
|
||||
|
||||
ListManager.prototype.toArray = function() {
|
||||
var o, result;
|
||||
o = this.beginning.next_cl;
|
||||
result = [];
|
||||
while (o !== this.end) {
|
||||
result.push(o);
|
||||
o = o.next_cl;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
ListManager.prototype.getOperationByPosition = function(position) {
|
||||
var o;
|
||||
o = this.beginning.next_cl;
|
||||
if ((position > 0 || o.isDeleted()) && !(o instanceof types.Delimiter)) {
|
||||
while (o.isDeleted() && !(o instanceof types.Delimiter)) {
|
||||
o = o.next_cl;
|
||||
}
|
||||
while (true) {
|
||||
if (o instanceof types.Delimiter) {
|
||||
break;
|
||||
}
|
||||
if (position <= 0 && !o.isDeleted()) {
|
||||
break;
|
||||
}
|
||||
o = o.next_cl;
|
||||
if (!o.isDeleted()) {
|
||||
position -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
return ListManager;
|
||||
|
||||
})(types.Insert);
|
||||
ReplaceManager = (function(_super) {
|
||||
__extends(ReplaceManager, _super);
|
||||
|
||||
function ReplaceManager(initial_content, uid, beginning, end, prev, next, origin) {
|
||||
ReplaceManager.__super__.constructor.call(this, uid, beginning, end, prev, next, origin);
|
||||
if (initial_content != null) {
|
||||
this.replace(initial_content);
|
||||
}
|
||||
}
|
||||
|
||||
ReplaceManager.prototype.replace = function(content, replaceable_uid) {
|
||||
var o, op;
|
||||
o = this.getLastOperation();
|
||||
op = new Replaceable(content, this, replaceable_uid, o, o.next_cl);
|
||||
return HB.addOperation(op).execute();
|
||||
};
|
||||
|
||||
ReplaceManager.prototype.setParent = function(parent, property_name) {
|
||||
var addPropertyListener;
|
||||
this.on('insert', (function(_this) {
|
||||
return function(event, op) {
|
||||
if (op.next_cl instanceof types.Delimiter) {
|
||||
return _this.parent.callEvent('change', property_name);
|
||||
}
|
||||
};
|
||||
})(this));
|
||||
this.on('change', (function(_this) {
|
||||
return function(event) {
|
||||
return _this.parent.callEvent('change', property_name);
|
||||
};
|
||||
})(this));
|
||||
addPropertyListener = (function(_this) {
|
||||
return function(event, op) {
|
||||
if (op.next_cl instanceof types.Delimiter && op.prev_cl instanceof types.Delimiter) {
|
||||
_this.parent.callEvent('addProperty', property_name);
|
||||
}
|
||||
return _this.deleteListener('addProperty', addPropertyListener);
|
||||
};
|
||||
})(this);
|
||||
this.on('insert', addPropertyListener);
|
||||
return ReplaceManager.__super__.setParent.call(this, parent);
|
||||
};
|
||||
|
||||
ReplaceManager.prototype.val = function() {
|
||||
var o;
|
||||
o = this.getLastOperation();
|
||||
return typeof o.val === "function" ? o.val() : void 0;
|
||||
};
|
||||
|
||||
ReplaceManager.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "ReplaceManager",
|
||||
'uid': this.getUid(),
|
||||
'beginning': this.beginning.getUid(),
|
||||
'end': this.end.getUid()
|
||||
};
|
||||
if ((this.prev_cl != null) && (this.next_cl != null)) {
|
||||
json['prev'] = this.prev_cl.getUid();
|
||||
json['next'] = this.next_cl.getUid();
|
||||
}
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return ReplaceManager;
|
||||
|
||||
})(ListManager);
|
||||
parser["ReplaceManager"] = function(json) {
|
||||
var beginning, content, end, next, origin, prev, uid;
|
||||
content = json['content'], uid = json['uid'], prev = json['prev'], next = json['next'], origin = json['origin'], beginning = json['beginning'], end = json['end'];
|
||||
return new ReplaceManager(content, uid, beginning, end, prev, next, origin);
|
||||
};
|
||||
Replaceable = (function(_super) {
|
||||
__extends(Replaceable, _super);
|
||||
|
||||
function Replaceable(content, parent, uid, prev, next, origin) {
|
||||
this.saveOperation('content', content);
|
||||
this.saveOperation('parent', parent);
|
||||
if (!((prev != null) && (next != null) && (content != null))) {
|
||||
throw new Error("You must define content, prev, and next for Replaceable-types!");
|
||||
}
|
||||
Replaceable.__super__.constructor.call(this, uid, prev, next, origin);
|
||||
}
|
||||
|
||||
Replaceable.prototype.val = function() {
|
||||
return this.content;
|
||||
};
|
||||
|
||||
Replaceable.prototype.replace = function(content) {
|
||||
return this.parent.replace(content);
|
||||
};
|
||||
|
||||
Replaceable.prototype.execute = function() {
|
||||
var _base;
|
||||
if (!this.validateSavedOperations()) {
|
||||
return false;
|
||||
} else {
|
||||
if (typeof (_base = this.content).setReplaceManager === "function") {
|
||||
_base.setReplaceManager(this.parent);
|
||||
}
|
||||
return Replaceable.__super__.execute.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
Replaceable.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "Replaceable",
|
||||
'content': this.content.getUid(),
|
||||
'ReplaceManager': this.parent.getUid(),
|
||||
'prev': this.prev_cl.getUid(),
|
||||
'next': this.next_cl.getUid(),
|
||||
'uid': this.getUid()
|
||||
};
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return Replaceable;
|
||||
|
||||
})(types.Insert);
|
||||
parser["Replaceable"] = function(json) {
|
||||
var content, next, origin, parent, prev, uid;
|
||||
content = json['content'], parent = json['ReplaceManager'], uid = json['uid'], prev = json['prev'], next = json['next'], origin = json['origin'];
|
||||
return new Replaceable(content, parent, uid, prev, next, origin);
|
||||
};
|
||||
types['ListManager'] = ListManager;
|
||||
types['MapManager'] = MapManager;
|
||||
types['ReplaceManager'] = ReplaceManager;
|
||||
types['Replaceable'] = Replaceable;
|
||||
return basic_types;
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Types/StructuredTypes.js.map
|
||||
1
build/node/Types/StructuredTypes.js.map
Executable file
1
build/node/Types/StructuredTypes.js.map
Executable file
File diff suppressed because one or more lines are too long
303
build/node/Types/TextTypes.js
Normal file
303
build/node/Types/TextTypes.js
Normal file
@@ -0,0 +1,303 @@
|
||||
(function() {
|
||||
var structured_types_uninitialized,
|
||||
__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; };
|
||||
|
||||
structured_types_uninitialized = require("./StructuredTypes");
|
||||
|
||||
module.exports = function(HB) {
|
||||
var TextDelete, TextInsert, WordType, parser, structured_types, types;
|
||||
structured_types = structured_types_uninitialized(HB);
|
||||
types = structured_types.types;
|
||||
parser = structured_types.parser;
|
||||
TextDelete = (function(_super) {
|
||||
__extends(TextDelete, _super);
|
||||
|
||||
function TextDelete() {
|
||||
return TextDelete.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
return TextDelete;
|
||||
|
||||
})(types.Delete);
|
||||
parser["TextDelete"] = parser["Delete"];
|
||||
TextInsert = (function(_super) {
|
||||
__extends(TextInsert, _super);
|
||||
|
||||
function TextInsert(content, uid, prev, next, origin) {
|
||||
this.content = content;
|
||||
if (!((prev != null) && (next != null))) {
|
||||
throw new Error("You must define prev, and next for TextInsert-types!");
|
||||
}
|
||||
TextInsert.__super__.constructor.call(this, uid, prev, next, origin);
|
||||
}
|
||||
|
||||
TextInsert.prototype.getLength = function() {
|
||||
if (this.isDeleted()) {
|
||||
return 0;
|
||||
} else {
|
||||
return this.content.length;
|
||||
}
|
||||
};
|
||||
|
||||
TextInsert.prototype.val = function(current_position) {
|
||||
if (this.isDeleted()) {
|
||||
return "";
|
||||
} else {
|
||||
return this.content;
|
||||
}
|
||||
};
|
||||
|
||||
TextInsert.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "TextInsert",
|
||||
'content': this.content,
|
||||
'uid': this.getUid(),
|
||||
'prev': this.prev_cl.getUid(),
|
||||
'next': this.next_cl.getUid()
|
||||
};
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return TextInsert;
|
||||
|
||||
})(types.Insert);
|
||||
parser["TextInsert"] = function(json) {
|
||||
var content, next, origin, prev, uid;
|
||||
content = json['content'], uid = json['uid'], prev = json['prev'], next = json['next'], origin = json['origin'];
|
||||
return new TextInsert(content, uid, prev, next, origin);
|
||||
};
|
||||
WordType = (function(_super) {
|
||||
__extends(WordType, _super);
|
||||
|
||||
function WordType(uid, beginning, end, prev, next, origin) {
|
||||
WordType.__super__.constructor.call(this, uid, beginning, end, prev, next, origin);
|
||||
}
|
||||
|
||||
WordType.prototype.type = "WordType";
|
||||
|
||||
WordType.prototype.insertText = function(position, content) {
|
||||
var c, o, op, _i, _len;
|
||||
o = this.getOperationByPosition(position);
|
||||
for (_i = 0, _len = content.length; _i < _len; _i++) {
|
||||
c = content[_i];
|
||||
op = new TextInsert(c, void 0, o.prev_cl, o);
|
||||
HB.addOperation(op).execute();
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
WordType.prototype.deleteText = function(position, length) {
|
||||
var d, delete_ops, i, o, _i;
|
||||
o = this.getOperationByPosition(position);
|
||||
delete_ops = [];
|
||||
for (i = _i = 0; 0 <= length ? _i < length : _i > length; i = 0 <= length ? ++_i : --_i) {
|
||||
if (o instanceof types.Delimiter) {
|
||||
break;
|
||||
}
|
||||
d = HB.addOperation(new TextDelete(void 0, o)).execute();
|
||||
o = o.next_cl;
|
||||
while (!(o instanceof types.Delimiter) && o.isDeleted()) {
|
||||
o = o.next_cl;
|
||||
}
|
||||
delete_ops.push(d._encode());
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
WordType.prototype.replaceText = function(text) {
|
||||
var word;
|
||||
if (this.replace_manager != null) {
|
||||
word = HB.addOperation(new WordType(void 0)).execute();
|
||||
word.insertText(0, text);
|
||||
this.replace_manager.replace(word);
|
||||
return word;
|
||||
} else {
|
||||
throw new Error("This type is currently not maintained by a ReplaceManager!");
|
||||
}
|
||||
};
|
||||
|
||||
WordType.prototype.val = function() {
|
||||
var c, o;
|
||||
c = (function() {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = this.toArray();
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
o = _ref[_i];
|
||||
if (o.val != null) {
|
||||
_results.push(o.val());
|
||||
} else {
|
||||
_results.push("");
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
return c.join('');
|
||||
};
|
||||
|
||||
WordType.prototype.toString = function() {
|
||||
return this.val();
|
||||
};
|
||||
|
||||
WordType.prototype.setReplaceManager = function(op) {
|
||||
this.saveOperation('replace_manager', op);
|
||||
this.validateSavedOperations();
|
||||
return this.on(['insert', 'delete'], (function(_this) {
|
||||
return function() {
|
||||
var _ref;
|
||||
return (_ref = _this.replace_manager) != null ? _ref.callEvent('change') : void 0;
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
WordType.prototype.bind = function(textfield) {
|
||||
var word;
|
||||
word = this;
|
||||
textfield.value = this.val();
|
||||
this.on("insert", function(event, op) {
|
||||
var fix, left, o_pos, right;
|
||||
o_pos = op.getPosition();
|
||||
fix = function(cursor) {
|
||||
if (cursor <= o_pos) {
|
||||
return cursor;
|
||||
} else {
|
||||
cursor += 1;
|
||||
return cursor;
|
||||
}
|
||||
};
|
||||
left = fix(textfield.selectionStart);
|
||||
right = fix(textfield.selectionEnd);
|
||||
textfield.value = word.val();
|
||||
return textfield.setSelectionRange(left, right);
|
||||
});
|
||||
this.on("delete", function(event, op) {
|
||||
var fix, left, o_pos, right;
|
||||
o_pos = op.getPosition();
|
||||
fix = function(cursor) {
|
||||
if (cursor < o_pos) {
|
||||
return cursor;
|
||||
} else {
|
||||
cursor -= 1;
|
||||
return cursor;
|
||||
}
|
||||
};
|
||||
left = fix(textfield.selectionStart);
|
||||
right = fix(textfield.selectionEnd);
|
||||
textfield.value = word.val();
|
||||
return textfield.setSelectionRange(left, right);
|
||||
});
|
||||
textfield.onkeypress = function(event) {
|
||||
var char, diff, new_pos, pos;
|
||||
char = null;
|
||||
if (event.key != null) {
|
||||
if (event.charCode === 32) {
|
||||
char = " ";
|
||||
} else if (event.keyCode === 13) {
|
||||
char = '\n';
|
||||
} else {
|
||||
char = event.key;
|
||||
}
|
||||
} else {
|
||||
char = String.fromCharCode(event.keyCode);
|
||||
}
|
||||
if (char.length > 0) {
|
||||
pos = Math.min(textfield.selectionStart, textfield.selectionEnd);
|
||||
diff = Math.abs(textfield.selectionEnd - textfield.selectionStart);
|
||||
word.deleteText(pos, diff);
|
||||
word.insertText(pos, char);
|
||||
new_pos = pos + char.length;
|
||||
textfield.setSelectionRange(new_pos, new_pos);
|
||||
return event.preventDefault();
|
||||
} else {
|
||||
return event.preventDefault();
|
||||
}
|
||||
};
|
||||
textfield.onpaste = function(event) {
|
||||
return event.preventDefault();
|
||||
};
|
||||
textfield.oncut = function(event) {
|
||||
return event.preventDefault();
|
||||
};
|
||||
return textfield.onkeydown = function(event) {
|
||||
var del_length, diff, new_pos, pos, val;
|
||||
pos = Math.min(textfield.selectionStart, textfield.selectionEnd);
|
||||
diff = Math.abs(textfield.selectionEnd - textfield.selectionStart);
|
||||
if ((event.keyCode != null) && event.keyCode === 8) {
|
||||
if (diff > 0) {
|
||||
word.deleteText(pos, diff);
|
||||
textfield.setSelectionRange(pos, pos);
|
||||
} else {
|
||||
if ((event.ctrlKey != null) && event.ctrlKey) {
|
||||
val = textfield.value;
|
||||
new_pos = pos;
|
||||
del_length = 0;
|
||||
if (pos > 0) {
|
||||
new_pos--;
|
||||
del_length++;
|
||||
}
|
||||
while (new_pos > 0 && val[new_pos] !== " " && val[new_pos] !== '\n') {
|
||||
new_pos--;
|
||||
del_length++;
|
||||
}
|
||||
word.deleteText(new_pos, pos - new_pos);
|
||||
textfield.setSelectionRange(new_pos, new_pos);
|
||||
} else {
|
||||
word.deleteText(pos - 1, 1);
|
||||
}
|
||||
}
|
||||
return event.preventDefault();
|
||||
} else if ((event.keyCode != null) && event.keyCode === 46) {
|
||||
if (diff > 0) {
|
||||
word.deleteText(pos, diff);
|
||||
textfield.setSelectionRange(pos, pos);
|
||||
} else {
|
||||
word.deleteText(pos, 1);
|
||||
textfield.setSelectionRange(pos, pos);
|
||||
}
|
||||
return event.preventDefault();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
WordType.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "WordType",
|
||||
'uid': this.getUid(),
|
||||
'beginning': this.beginning.getUid(),
|
||||
'end': this.end.getUid()
|
||||
};
|
||||
if (this.prev_cl != null) {
|
||||
json['prev'] = this.prev_cl.getUid();
|
||||
}
|
||||
if (this.next_cl != null) {
|
||||
json['next'] = this.next_cl.getUid();
|
||||
}
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return WordType;
|
||||
|
||||
})(types.ListManager);
|
||||
parser['WordType'] = function(json) {
|
||||
var beginning, end, next, origin, prev, uid;
|
||||
uid = json['uid'], beginning = json['beginning'], end = json['end'], prev = json['prev'], next = json['next'], origin = json['origin'];
|
||||
return new WordType(uid, beginning, end, prev, next, origin);
|
||||
};
|
||||
types['TextInsert'] = TextInsert;
|
||||
types['TextDelete'] = TextDelete;
|
||||
types['WordType'] = WordType;
|
||||
return structured_types;
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Types/TextTypes.js.map
|
||||
1
build/node/Types/TextTypes.js.map
Executable file
1
build/node/Types/TextTypes.js.map
Executable file
File diff suppressed because one or more lines are too long
6
build/node/Types/XmlTypes.js
Normal file
6
build/node/Types/XmlTypes.js
Normal file
@@ -0,0 +1,6 @@
|
||||
(function() {
|
||||
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=../Types/XmlTypes.js.map
|
||||
1
build/node/Types/XmlTypes.js.map
Executable file
1
build/node/Types/XmlTypes.js.map
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["Types/XmlTypes.coffee"],"names":[],"mappings":"AAoGwC;AAAA;AAAA","file":"Types/XmlTypes.js","sourceRoot":"/source/","sourcesContent":[""]}
|
||||
12
build/node/index.js
Normal file
12
build/node/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
(function() {
|
||||
exports['IwcConnector'] = require('./Connectors/IwcConnector');
|
||||
|
||||
exports['TestConnector'] = require('./Connectors/TestConnector');
|
||||
|
||||
exports['JsonFramework'] = require('./Frameworks/JsonFramework');
|
||||
|
||||
exports['TextFramework'] = require('./Frameworks/TextFramework');
|
||||
|
||||
}).call(this);
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
build/node/index.js.map
Executable file
1
build/node/index.js.map
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.coffee"],"names":[],"mappings":"AAEA;AAAA,EAAA,OAAQ,CAAA,cAAA,CAAR,GACE,OAAA,CAAQ,2BAAR,CADF,CAAA;;AAAA,EAEA,OAAQ,CAAA,eAAA,CAAR,GACE,OAAA,CAAQ,4BAAR,CAHF,CAAA;;AAAA,EAIA,OAAQ,CAAA,eAAA,CAAR,GACE,OAAA,CAAQ,4BAAR,CALF,CAAA;;AAAA,EAMA,OAAQ,CAAA,eAAA,CAAR,GACE,OAAA,CAAQ,4BAAR,CAPF,CAAA;AAAA","file":"index.js","sourceRoot":"/source/","sourcesContent":["\n\nexports['IwcConnector'] =\n require './Connectors/IwcConnector'\nexports['TestConnector'] =\n require './Connectors/TestConnector'\nexports['JsonFramework'] =\n require './Frameworks/JsonFramework'\nexports['TextFramework'] =\n require './Frameworks/TextFramework'\n\n"]}
|
||||
14498
build/test/JsonYatta_test.js
Normal file
14498
build/test/JsonYatta_test.js
Normal file
File diff suppressed because one or more lines are too long
14194
build/test/TextYatta_test.js
Normal file
14194
build/test/TextYatta_test.js
Normal file
File diff suppressed because one or more lines are too long
@@ -2,13 +2,14 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test Yatta!</title>
|
||||
<link rel="stylesheet" href="../../../node_modules/mocha/mocha.css" />
|
||||
<link rel="stylesheet" href="../../node_modules/mocha/mocha.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="mocha"></div>
|
||||
<script src="../../../node_modules/mocha/mocha.js"></script>
|
||||
<script src="../../node_modules/mocha/mocha.js"></script>
|
||||
<script>mocha.setup('bdd')</script>
|
||||
<script src="Yatta_test.js"></script>
|
||||
<script src="TextYatta_test.js"></script>
|
||||
<script src="JsonYatta_test.js"></script>
|
||||
<script>
|
||||
mocha.checkLeaks();
|
||||
mocha.run();
|
||||
File diff suppressed because it is too large
Load Diff
10
dest/browser/Frameworks/JsonIwcYatta.min.js
vendored
10
dest/browser/Frameworks/JsonIwcYatta.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Module>
|
||||
<ModulePrefs title="Video upload" description="Upload videos in Sevianno" author="Kevin Jahns, Chair of Computer Science 5, RWTH Aachen University, Germany" author_email="jahns@dbis.rwth-aachen.de" scrolling="true">
|
||||
<Require feature="dynamic-height"/>
|
||||
|
||||
</ModulePrefs>
|
||||
|
||||
<Content type="html"><![CDATA[
|
||||
<script src="http://open-app.googlecode.com/files/openapp.js"></script>
|
||||
<script src="http://dbis.rwth-aachen.de/gadgets/lib/las/storage.js"></script>
|
||||
<script src="http://dbis.rwth-aachen.de/gadgets/iwc/lib/iwc.js"></script>
|
||||
<script src="http://dbis.rwth-aachen.de/gadgets/lib/las/lasAjaxClient.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="../Frameworks/JsonIwcYatta.js"></script>
|
||||
<script>
|
||||
function init(){
|
||||
window.createIwcConnector(function(Connector){
|
||||
console.log("initializing..");
|
||||
yatta = new window.JsonYatta(1, Connector);
|
||||
var dui = yatta.getConnector().duiClient
|
||||
dui.getAppState()
|
||||
console.log("initialized!");
|
||||
|
||||
})
|
||||
}
|
||||
$(document).ready(init)
|
||||
</script>
|
||||
<h1> awesomewidget </h1>
|
||||
]]></Content>
|
||||
</Module>
|
||||
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Module>
|
||||
<ModulePrefs title="Video upload" description="Upload videos in Sevianno" author="Kevin Jahns, Chair of Computer Science 5, RWTH Aachen University, Germany" author_email="jahns@dbis.rwth-aachen.de" scrolling="true">
|
||||
<Require feature="dynamic-height"/>
|
||||
|
||||
</ModulePrefs>
|
||||
|
||||
<Content type="html"><![CDATA[
|
||||
<script type="application/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||
<script src="http://open-app.googlecode.com/files/openapp.js"></script>
|
||||
<script src="http://dbis.rwth-aachen.de/gadgets/lib/las/storage.js"></script>
|
||||
<script src="http://dbis.rwth-aachen.de/gadgets/iwc/lib/iwc.js"></script>
|
||||
<script src="http://dbis.rwth-aachen.de/gadgets/lib/las/lasAjaxClient.js"></script>
|
||||
<script src="../Widgets/libs/DUIClient.js"></script>
|
||||
<script src="../Frameworks/JsonIwcYatta.js"></script>
|
||||
<script>
|
||||
function init(){
|
||||
function f(){
|
||||
console.log("beginning");
|
||||
window.createIwcConnector(function(Connector){
|
||||
console.log("initializing..");
|
||||
yatta = new window.JsonYatta(2, Connector);
|
||||
console.log("initialized!");
|
||||
});
|
||||
}
|
||||
setTimeout(f, 8000)
|
||||
}
|
||||
$(document).ready(init)
|
||||
</script>
|
||||
<h1> awesomewidget </h1>
|
||||
]]></Content>
|
||||
</Module>
|
||||
@@ -1,241 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Module>
|
||||
<ModulePrefs
|
||||
title="IWC Test Stub"
|
||||
description="A widget for tracing and sending ROLE IWC intents. Recommended for developers of IWC-enabled widgets."
|
||||
author="Dominik Renzel, Chair of Computer Science 5, RWTH Aachen University, Germany"
|
||||
author_email="renzel@dbis.rwth-aachen.de"
|
||||
height="500">
|
||||
<Require feature="dynamic-height"/>
|
||||
</ModulePrefs>
|
||||
<Content type="html">
|
||||
<![CDATA[
|
||||
<style type="text/css">
|
||||
* {
|
||||
font-family: Verdana;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
#accordion {
|
||||
overflow: auto;
|
||||
height: 310px;
|
||||
}
|
||||
|
||||
#pubform, .entry {
|
||||
border: 1pt solid black
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr td.ui-state-default{
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
tr td.input, tr td.ui-widget-content {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
#pub_form tr td input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#pub_form tr td textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"/>
|
||||
|
||||
<script type="application/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
|
||||
<script type="application/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"</script>
|
||||
|
||||
<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/gadgets/iwc/lib/date.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var counter = 0;
|
||||
var iwcClient = null;
|
||||
|
||||
function renderIntent(intent){
|
||||
var result = "<table class='entry'>";
|
||||
|
||||
|
||||
var sender = intent.sender;
|
||||
var publisher = "me";
|
||||
var source = sender;
|
||||
|
||||
if (sender.indexOf("?sender=") > -1){
|
||||
var ts = sender.split("?sender=");
|
||||
publisher = ts[0].split("/")[0];
|
||||
source = ts[1];
|
||||
} else {
|
||||
publisher = "<b><i>me</i></b>";
|
||||
source = sender;
|
||||
}
|
||||
|
||||
result += "<tr><td class='ui-state-default'>Publisher</td><td class='ui-widget-content'>" + publisher + "</td></tr>";
|
||||
result += "<tr><td class='ui-state-default'>Source</td><td class='ui-widget-content'>" + source + "</td></tr>";
|
||||
|
||||
|
||||
|
||||
var comp = intent.component;
|
||||
if(comp === ""){
|
||||
comp = "*";
|
||||
}
|
||||
|
||||
result += "<tr><td class='ui-state-default'>Component</td><td class='ui-widget-content,value'>" + comp + "</td></tr>";
|
||||
result += "<tr><td class='ui-state-default'>Action</td><td class='ui-widget-content'>" + intent.action + "</td></tr>";
|
||||
result += "<tr><td class='ui-state-default'>Data</td><td class='ui-widget-content'>" + intent.data + "</td></tr>";
|
||||
result += "<tr><td class='ui-state-default'>Datatype</td><td class='ui-widget-content'>" + intent.dataType + "</td></tr>";
|
||||
result += "<tr><td class='ui-state-default'>Categories</td><td class='ui-widget-content'>" + intent.categories + "</td></tr>";
|
||||
result += "<tr><td class='ui-state-default'>Flags</td><td class='ui-widget-content'>" + intent.flags + "</td></tr>";
|
||||
result += "<tr><td class='ui-state-default'>Extras</td><td class='ui-widget-content'> " + JSON.stringify(intent.extras) + "</td></tr>";
|
||||
|
||||
result += "</table>";
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function collectIntent(){
|
||||
var action = $("#pub_action").val();
|
||||
console.log("Action: " + action);
|
||||
|
||||
var sender = $("#pub_source").val();
|
||||
if(!($("#pub_publisher").val() == 'me')){
|
||||
sender = $("#pub_publisher").val() + "?sender=" + sender;
|
||||
}
|
||||
|
||||
var categories = $("#pub_categories").val().split(",");
|
||||
var flags = $("#pub_flags").val().split(",");
|
||||
|
||||
try{
|
||||
var extras = $.parseJSON($("#pub_extras").val());
|
||||
} catch(error) {
|
||||
alert("Corrupt JSON specified for extras");
|
||||
return;
|
||||
}
|
||||
var intent = {
|
||||
"component": $("#pub_component").val(),
|
||||
"sender": sender,
|
||||
"data": $("#pub_data").val(),
|
||||
"dataType":$("#pub_datatype").val(),
|
||||
"action":$("#pub_action").val(),
|
||||
"categories":categories,
|
||||
"flags": flags,
|
||||
"extras": extras
|
||||
};
|
||||
return intent;
|
||||
}
|
||||
|
||||
function init(){
|
||||
|
||||
iwcClient = new iwc.Client();
|
||||
|
||||
var iwcCallback = function(intent) {
|
||||
var date = new Date();
|
||||
var format = "yyyy-MM-dd kk:mm:ss";
|
||||
var dates = formatDate(date,format)+"."+date.getMilliseconds();
|
||||
$('#accordion').prepend("<h3><a href='#'>#" + counter + " - " + intent.action + " (" + dates + ")</a></h3><div>" + renderIntent(intent) + "</div>").accordion('destroy').accordion();
|
||||
counter += 1;
|
||||
}
|
||||
|
||||
iwcClient.connect(iwcCallback);
|
||||
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$( "#accordion" ).accordion({
|
||||
collapsible: true
|
||||
});
|
||||
|
||||
$( "#clearb" ).button().click(function() {
|
||||
counter = 0;
|
||||
$( "#accordion" ).accordion('destroy').empty().accordion();
|
||||
});
|
||||
|
||||
$( "#sendb" ).button().click(function() {
|
||||
$("#sendintent").dialog('open');
|
||||
});
|
||||
|
||||
$("#exint").dialog({
|
||||
autoOpen: false,
|
||||
heigth: 340,
|
||||
width: 350,
|
||||
modal: true
|
||||
});
|
||||
|
||||
$("#sendintent").dialog({
|
||||
autoOpen: false,
|
||||
height: 340,
|
||||
width: 350,
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Send": function() {
|
||||
var intent = collectIntent();
|
||||
|
||||
console.log(intent);
|
||||
|
||||
if(iwc.util.validateIntent(intent)) {
|
||||
iwcClient.publish(intent);
|
||||
}
|
||||
else {
|
||||
alert("Intent not valid! ");
|
||||
}
|
||||
|
||||
},
|
||||
Export: function() {
|
||||
var intent = collectIntent();
|
||||
var istr = JSON.stringify(intent);
|
||||
console.log(istr);
|
||||
$("#intsnip").html(istr);
|
||||
$("#exint").dialog("open");
|
||||
},
|
||||
Cancel: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
},
|
||||
close: function(){
|
||||
//$(this).dialog('close');
|
||||
}
|
||||
});
|
||||
|
||||
gadgets.window.adjustHeight();
|
||||
});
|
||||
|
||||
$(document).ready(init());
|
||||
|
||||
|
||||
</script>
|
||||
<button id="sendb">Send Intent</button> <button id="clearb">Clear List</button>
|
||||
<h1>Received Intents</h1>
|
||||
<div id="accordion">
|
||||
</div>
|
||||
|
||||
<div id='sendintent' title='Send Intent'>
|
||||
<table id='pub_form'>
|
||||
<tr><td class='ui-state-default'>Publisher</td><td class='input'><input id='pub_publisher' type='text' value='me'/></td></tr>
|
||||
<tr><td class='ui-state-default'>Source</td><td class='input'><input id='pub_source' type='text' value='http://widget.org/sender.xml'/></td></tr>
|
||||
<tr><td class='ui-state-default'>Component</td><td class='input'><input id='pub_component' type='text'/></td></tr>
|
||||
<tr><td class='ui-state-default'>Action</td><td class='input'><input id='pub_action' type='text' value='ACTION_UPDATE'/></td></tr>
|
||||
<tr><td class='ui-state-default'>Data</td><td class='input'><input id='pub_data' type='text' value='http://example.org/some/data'/></td></tr>
|
||||
<tr><td class='ui-state-default'>Data Type</td><td class='input'><input id='pub_datatype' type='text' value='text/plain'/></td></tr>
|
||||
<tr><td class='ui-state-default'>Flags</td><td class='input'><input id='pub_flags' type='text' value='PUBLISH_GLOBAL'/></td></tr>
|
||||
<tr><td class='ui-state-default'>Categories</td><td class='input'><input id='pub_categories' type='text' value='cat1,cat2'/></td></tr>
|
||||
<!-- <tr><td class='ui-state-default'>Extras</td><td class='input'><input id='pub_extras' type='text' value='{"key":"value"}'/></td></tr> -->
|
||||
<tr><td class='ui-state-default'>Extras</td><td class='input'><textarea id='pub_extras' value='{"key":"value"}'/></td></tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="exint" title="Exported Intent JSON">
|
||||
Copy the snippet below to your code to specify a respective intent message.
|
||||
<p id="intsnip"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
]]>
|
||||
</Content>
|
||||
</Module>
|
||||
@@ -1,371 +0,0 @@
|
||||
//get the iwc.Client class def.
|
||||
/*
|
||||
iwc = iwc || {};
|
||||
iwc.Client = iwc.Client || {};
|
||||
|
||||
/**
|
||||
* Add a function to set the compnent name of the iwc.Client class.<br/>
|
||||
* This component name is for filtering incoming intent at the iwc.Client. The intent can be further processed
|
||||
* only when the intent.component attribute matches the component name of the iwc.Client or the intent.component is an empty string(pseudo broadcast).
|
||||
* @param componentName The component name
|
||||
*/
|
||||
/*
|
||||
iwc.Client.prototype.setComponentName = function(componentName){
|
||||
this._componentName = componentName;
|
||||
};
|
||||
*/
|
||||
|
||||
DUIClient = function(){
|
||||
//in role framework the parent div of the widget ifr is IDed as "widget-{widgetId}-body" sth. like this
|
||||
var _widgetId = parent.document.getElementById(self.frameElement.id).parentNode.id.split("-")[1];
|
||||
var that = this;
|
||||
var _iwcClient = new iwc.Client(["*"]);
|
||||
_iwcClient._componentName = "duiclient-"+_widgetId;
|
||||
|
||||
this.externalCallback = function(intent){};
|
||||
|
||||
/**
|
||||
* The target function when the intent is for updating widget state request
|
||||
*/
|
||||
this._onUpdateState = function(intent){
|
||||
var isForMigration = intent.extras.isForMigration;
|
||||
if (isForMigration)
|
||||
this.finishMigration(intent);
|
||||
else
|
||||
this.updateState(intent);
|
||||
};
|
||||
|
||||
this.getIwcClient = function(){
|
||||
return _iwcClient;
|
||||
}
|
||||
/**
|
||||
* The target function when the intent is for getting the current widget state.<br/>
|
||||
* The intent.extras object here is always a Json object.
|
||||
*/
|
||||
this._onGetWidgetState = function(intent){
|
||||
var target = null;
|
||||
var forMigration = false;
|
||||
if (intent.extras.target != null){
|
||||
target = intent.extras.target;
|
||||
forMigration = true;
|
||||
}
|
||||
var states = this.getWidgetState(forMigration);
|
||||
|
||||
var resIntent = {};
|
||||
if (forMigration)
|
||||
resIntent = {
|
||||
"action": "DUI_WS_MIG",
|
||||
"categories": ["DUI"],
|
||||
"component": "duimanager",
|
||||
"data":"",
|
||||
"dataType":"",
|
||||
"extras":{"target": target, "widgetId": _widgetId, "widgetStates": states}
|
||||
};
|
||||
else
|
||||
resIntent = {
|
||||
"action": "DUI_WS",
|
||||
"categories": ["DUI"],
|
||||
"component": intent.sender,
|
||||
"data":"",
|
||||
"dataType":"",
|
||||
"extras":{"widgetId": _widgetId, "widgetStates": states}
|
||||
};
|
||||
|
||||
_iwcClient.publish(resIntent);
|
||||
};
|
||||
|
||||
/**
|
||||
* The target function when the intent is to inform a change in the scope of the application
|
||||
*/
|
||||
this._onAppStateChange = function(intent){
|
||||
this.changeWithApp(intent);
|
||||
};
|
||||
|
||||
/**
|
||||
* The target function when the intent is to inform a migration of this widget is waiting to be taken place
|
||||
*/
|
||||
this._prepareMigration = function(intent){
|
||||
console.log("do sth before the widget is removed");
|
||||
this.prepareMigration();
|
||||
};
|
||||
|
||||
this._logOff = function(intent){
|
||||
var states = this.getWidgetState(false);
|
||||
resIntent = {
|
||||
"action": "DUI_WS_LOGOFF",
|
||||
"categories": ["DUI"],
|
||||
"component": "duimanager",
|
||||
"data":"",
|
||||
"dataType":"",
|
||||
"extras":{"widgetId": _widgetId, "widgetStates": states}
|
||||
};
|
||||
|
||||
_iwcClient.publish(resIntent);
|
||||
};
|
||||
|
||||
/**
|
||||
* The intent dispatcher and the callback function connected to the private field of iwc.Client.onIntent.<br/>
|
||||
* This function is called once an intent is received by the iwc.Client and passed the first level filter of the iwc.Client.<br/>
|
||||
* @param intent The incoming intent. Technically all intents will come, the filter of the iwc.Client class is weak...
|
||||
*/
|
||||
var _iwcCallback = function(intent){
|
||||
that.externalCallback(intent);
|
||||
//does not accept global intents(global intents are processed by normal iwc.Client, normal iwc.Proxy and DUI manager)
|
||||
//does not accept intents that are not categorized as "DUI"
|
||||
if ((typeof intent.flags != "undefined" && intent.flags.indexOf("PUBLISH_GLOBAL")!=-1)
|
||||
|| typeof intent.categories == "undefined" || intent.categories.indexOf("DUI") == -1)
|
||||
return;
|
||||
//then does not accept intents for other widgets
|
||||
//if the widget id is undefined here, this is an DUI intent from the DUI manager for all involved widget, e.g. application state changed
|
||||
var action = intent.action;
|
||||
if (typeof intent.extras.widgetId != "undefined" && intent.extras.widgetId == _widgetId){
|
||||
if (action == "DUI_UPDATE_STATE"){
|
||||
that._onUpdateState(intent);
|
||||
return;
|
||||
}
|
||||
if (action == "DUI_GET_WS"){
|
||||
that._onGetWidgetState(intent);
|
||||
return;
|
||||
}
|
||||
if (action == "DUI_PRE_MIG"){
|
||||
that._prepareMigration(intent);
|
||||
return;
|
||||
}
|
||||
}else if (typeof intent.extras.widgetId == "undefined"){
|
||||
if (action == "DUI_LOG_OFF"){
|
||||
that._logOff(intent);
|
||||
return;
|
||||
}
|
||||
if (action == "DUI_APP_CHANGE"){
|
||||
that._onAppStateChange(intent);
|
||||
return;
|
||||
}
|
||||
if (action == "DUI_REG_CLIENT"){
|
||||
that.initOK();
|
||||
return;
|
||||
}
|
||||
if (action == "DUI_AS"){
|
||||
that.onAppState(intent.extras.appStates);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
_iwcClient.connect(_iwcCallback);
|
||||
|
||||
//remember to bind(this) the function when override
|
||||
|
||||
/**
|
||||
* The function is called when the dui manager wants the widget states.<br/>
|
||||
* <strong>Notice</strong>: avoid putting complex data and data structure to the state value, the browser and Java JSON encoder and parser might cause inconsistent input and output.
|
||||
* @param isForMigration A boolean. True if special state for migration is needed otherwise not.
|
||||
* @returns an object containing the widget states, e.g. {"selectIndex":1, "phaseNum":2, "textinput":"iamatextvalueinatextinput"}
|
||||
*/
|
||||
this.getWidgetState = function(isForMigration){
|
||||
console.log("the widget collects it is state and return, overwrite it");
|
||||
var states = {};
|
||||
return states;
|
||||
};
|
||||
|
||||
/**
|
||||
* The function is called when there detected a application state change at the dui manager and the manager informs the widget about the change.<br/>
|
||||
* Override this function to apply changes to the widget according to the valuable application state changes.<br/>
|
||||
* @param intent intent The infos are in intent.extras object e.g. intent.extras = {"oldStates":{}, "newStates":{"statename":value, "state2":value2}}. the property 'oldStates' can be null if the space has not set app state ever before.
|
||||
*/
|
||||
this.changeWithApp = function(intent){
|
||||
//sample
|
||||
var oldStates = intent.extras.oldStates;
|
||||
var newStates = intent.extras.newStates;
|
||||
console.log(oldStates);
|
||||
console.log(newStates);
|
||||
console.log("the widget may need to change something following the whole app");
|
||||
};
|
||||
|
||||
/**
|
||||
* The function is called right before a migration for this widget and the widget state is already saved to the server in previous migration phases.<br/>
|
||||
* And it is the last chance to perform any moves before the widget is removed from current web page.<br/>
|
||||
* Override this method to perform state update for each different widget.<br/>
|
||||
* <strong>AND DO REMEMBER TO CALL {@link DUIClient#prepareMigDone} AT THE END OF THIS FUNCTION!</strong>
|
||||
*/
|
||||
this.prepareMigration = function(){
|
||||
//e.g. ..... just a joke....
|
||||
/*
|
||||
if (confirm("you sure to sign out?..."))
|
||||
parent.location = parent.location.protocol + "//" + parent.location.host + "/:authentication?return=&action=signout";
|
||||
console.log("the migration is at hand, the widget may need to do sth special before it is removed from the role widget container e.g. disconnect from the lasServer etc.");
|
||||
*/
|
||||
this.prepareMigDone();
|
||||
};
|
||||
|
||||
/**
|
||||
* The function is called when the dui manager asks the widget to update its states.<br/>
|
||||
* Compared to the function DUIClient.finishMigration(), this is a typical normal state update for active widget on presence.<br/>
|
||||
* This method will be called as a callback for DUIClient#requireWidgetState(); or DUIClient#initOK() when it is not a migration.
|
||||
* Override this method to perform state update for each different widget.
|
||||
* @param intent The Intent object that contains infos of required widget states, the infos are in intent.extras.widgetStates e.g. {"state1":value1,"state2":value2}.
|
||||
* The object might contain appStates as well if there is any application state, get it in intent.extras.appStates e.g. {"appstate1":value1,"appstate2":value2}.
|
||||
*/
|
||||
this.updateState = function(intent){
|
||||
var states = {};
|
||||
states = intent.extras.widgetStates;
|
||||
var appStates = intent.extras.appStates;
|
||||
console.log(states);
|
||||
if (typeof appStates != "undefined")
|
||||
console.log(appStates);
|
||||
console.log("update the widget state, widget need to overwrite it");
|
||||
};
|
||||
|
||||
/**
|
||||
* The function is called to finish the Migration and update the widget state.<br/>
|
||||
* Compared to the method DUIClient.updateState(), this method is a special widget state update for the widget that has just migrated.<br/>
|
||||
* Override this method to perform finishing moves for each different widget.
|
||||
* @param intent The Intent object that contains infos to complete the migration, the infos are in intent.extras.states e.g. {"state1":value1, "state2":value2}.
|
||||
* The object might contain appStates as well if there is any application state, get it in intent.extras.appStates e.g. {"appstate1":value1,"appstate2":value2}.
|
||||
*/
|
||||
this.finishMigration = function(intent){
|
||||
var states = {};
|
||||
states = intent.extras.widgetStates;
|
||||
var appStates = intent.extras.appStates;
|
||||
console.log(states);
|
||||
if (typeof appStates != "undefined")
|
||||
console.log(appStates);
|
||||
console.log("the migration is done, the widget may need to perform special inits before update the widget state e.g. login to the lasServer again.");
|
||||
};
|
||||
|
||||
/**
|
||||
* The function to signal the dui manager that the preparation for the migration is ready on this widget.<br/>
|
||||
* This function should be called at the end of the overwritten function {@link DUIClient#prepareMigration}<br/>
|
||||
* Do not override this method unless there is really an unstoppable reason.
|
||||
*/
|
||||
this.prepareMigDone = function(){
|
||||
//prepared and send OK response to DUIMgr
|
||||
var intent = {
|
||||
"component": "duimanager",
|
||||
"categories": ["DUI"],
|
||||
"action": "DUI_PRE_MIG_OK",
|
||||
"data": "",
|
||||
"dataType": "",
|
||||
"extras": {"widgetId": _widgetId}
|
||||
};
|
||||
_iwcClient.publish(intent);
|
||||
};
|
||||
|
||||
/**
|
||||
* The function to call the DUI manager to save the widget state on the server.<br/>
|
||||
* Do not override this method unless there is really an unstoppable reason.
|
||||
* @param states An array of widget state object {"stateName": stateValue}
|
||||
*/
|
||||
this.saveWidgetState = function(){
|
||||
var states = this.getWidgetState(false);
|
||||
var intent = {
|
||||
"action": "DUI_SAVE_WS",
|
||||
"categories": ["DUI"],
|
||||
"component": "duimanager",// the overwritten dui manager from the iwc.Proxy should have the _componentName set to "duimanager"
|
||||
"data":"",
|
||||
"dataType":"",
|
||||
"extras":{"widgetStates":states, "widgetId": _widgetId}
|
||||
};
|
||||
_iwcClient.publish(intent);
|
||||
};
|
||||
|
||||
/**
|
||||
* An open interface to send any intent
|
||||
*/
|
||||
this.sendIntent = function(intent){
|
||||
//or to send the intent to "duimanager"
|
||||
_iwcClient.publish(intent);
|
||||
};
|
||||
|
||||
/**
|
||||
* This function asks the framework for the states stored on the server.
|
||||
* Do not override it.
|
||||
*/
|
||||
this.requireWidgetState = function(){
|
||||
var intent = {
|
||||
"action": "DUI_REQ_WS",
|
||||
"categories": ["DUI"],
|
||||
"component": "duimanager",// the overwritten dui manager from the iwc.Proxy should have the _componentName set to "duimanager"
|
||||
"data":"",
|
||||
"dataType":"",
|
||||
"extras":{"widgetId": _widgetId}
|
||||
};
|
||||
_iwcClient.publish(intent);
|
||||
};
|
||||
|
||||
/**
|
||||
* Store the global app state
|
||||
* @param states the app state to be stored e.g. {"state1":value1, "state2":value2}
|
||||
*/
|
||||
this.setAppState = function(states){
|
||||
var intent = {
|
||||
"action": "DUI_SET_AS",
|
||||
"categories": ["DUI"],
|
||||
"component": "duimanager",// the overwritten dui manager from the iwc.Proxy should have the _componentName set to "duimanager"
|
||||
"data":"",
|
||||
"dataType":"",
|
||||
"extras":{"states": states}
|
||||
};
|
||||
_iwcClient.publish(intent);
|
||||
};
|
||||
|
||||
/**
|
||||
* Ask the dui manager for the app state.
|
||||
*/
|
||||
this.getAppState = function(){
|
||||
var intent = {
|
||||
"action": "DUI_GET_AS",
|
||||
"categories": ["DUI"],
|
||||
"component": "duimanager",// the overwritten dui manager from the iwc.Proxy should have the _componentName set to "duimanager"
|
||||
"data":"",
|
||||
"dataType":"",
|
||||
};
|
||||
_iwcClient.publish(intent);
|
||||
};
|
||||
|
||||
/**
|
||||
* Override this function to do something when the requested app state comes.
|
||||
* @param appStates the json format of the app state:{"name1": value1, "name2": value2};
|
||||
*/
|
||||
this.onAppState = function(appStates){};
|
||||
|
||||
/**
|
||||
* call this function to register the duiclient to duimanager after all things are OK
|
||||
*/
|
||||
this.initOK = function(){
|
||||
var okIntent = {
|
||||
"action": "DUI_CLIENT_OK",
|
||||
"categories": ["DUI"],
|
||||
"component": "duimanager",// the overwritten dui manager from the iwc.Proxy should have the _componentName set to "duimanager"
|
||||
"data":"",
|
||||
"dataType":"",
|
||||
"extras":{"widgetId": _widgetId}
|
||||
};
|
||||
|
||||
_iwcClient.publish(okIntent);
|
||||
};
|
||||
|
||||
/**
|
||||
* publish the intent in the domain of the user only
|
||||
*/
|
||||
this.publishToUser = function(intent){
|
||||
var wrap = {
|
||||
"action": "DUI_PUB_USER",
|
||||
"categories": ["DUI"],
|
||||
"component": "duimanager",
|
||||
"data": JSON.stringify(intent),
|
||||
"dataType": "application/json",
|
||||
"extras": {}
|
||||
};
|
||||
_iwcClient.publish(intent);
|
||||
_iwcClient.publish(wrap);
|
||||
};
|
||||
|
||||
/**
|
||||
* register the call back function of the widget to the DUI client.
|
||||
*/
|
||||
this.connect = function(callback){
|
||||
this.externalCallback = callback;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// reminder to myself:.... the callback funcs injected into this DUIClient need to bind()
|
||||
2
dest/browser/Widgets/libs/DUIClient.min.js
vendored
2
dest/browser/Widgets/libs/DUIClient.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,119 +0,0 @@
|
||||
var createIwcConnector;
|
||||
|
||||
createIwcConnector = function(callback) {
|
||||
var IwcConnector, duiClient, get_HB_intent, init, iwcHandler, received_HB;
|
||||
iwcHandler = {};
|
||||
duiClient = new DUIClient();
|
||||
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();
|
||||
received_HB = null;
|
||||
IwcConnector = (function() {
|
||||
function IwcConnector(engine, HB, execution_listener, yatta) {
|
||||
var receive_, sendHistoryBuffer, 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 (received_HB != null) {
|
||||
this.engine.applyOpsCheckDouble(received_HB);
|
||||
}
|
||||
sendHistoryBuffer = (function(_this) {
|
||||
return function() {
|
||||
var json;
|
||||
json = {
|
||||
HB: _this.yatta.getHistoryBuffer()._encode()
|
||||
};
|
||||
return _this.sendIwcIntent("Yatta_push_HB_element", json);
|
||||
};
|
||||
})(this);
|
||||
this.iwcHandler["Yatta_get_HB_element"] = [sendHistoryBuffer];
|
||||
}
|
||||
|
||||
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_HB_intent = {
|
||||
action: "Yatta_get_HB_element",
|
||||
component: "",
|
||||
data: "",
|
||||
dataType: "",
|
||||
extras: {}
|
||||
};
|
||||
init = function() {
|
||||
var is_initialized, receiveHB;
|
||||
duiClient.sendIntent(get_HB_intent);
|
||||
is_initialized = false;
|
||||
receiveHB = function(json) {
|
||||
var proposed_user_id;
|
||||
proposed_user_id = duiClient.getIwcClient()._componentName;
|
||||
received_HB = json != null ? json.extras.HB : void 0;
|
||||
if (!is_initialized) {
|
||||
is_initialized = true;
|
||||
return callback(IwcConnector, proposed_user_id);
|
||||
}
|
||||
};
|
||||
iwcHandler["Yatta_push_HB_element"] = [receiveHB];
|
||||
return setTimeout(receiveHB, 0);
|
||||
};
|
||||
setTimeout(init, Math.random() * 0);
|
||||
return void 0;
|
||||
};
|
||||
|
||||
module.exports = createIwcConnector;
|
||||
|
||||
if (typeof window !== "undefined" && window !== null) {
|
||||
window.createConnector = createIwcConnector;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=IwcConnector.js.map
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "IwcConnector.js",
|
||||
"sourceRoot":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HZ,CAAA;AAAA,IASA,UAAW,CAAA,uBAAA,CAAX,GAAsC,CAAC,SAAD,CATtC,CAAA;WAUA,UAAA,CAAW,SAAX,EAAsB,CAAtB,EAXK;EAAA,CAxEP,CAAA;AAAA,EAqFA,UAAA,CAAW,IAAX,EAAkB,IAAI,CAAC,MAAL,CAAA,CAAA,GAAc,CAAhC,CArFA,CAAA;SAuFA,OAxFmB;AAAA,CAArB,CAAA;;AAAA,MAyFM,CAAC,OAAP,GAAiB,kBAzFjB,CAAA;;;EA0FA,MAAM,CAAE,eAAR,GAA0B;CA1F1B"
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
var _;
|
||||
|
||||
_ = require("underscore");
|
||||
|
||||
module.exports = function(user_list) {
|
||||
var TestConnector;
|
||||
return TestConnector = (function() {
|
||||
function TestConnector(engine, HB, execution_listener) {
|
||||
var appliedOperationsListener, send_;
|
||||
this.engine = engine;
|
||||
this.HB = HB;
|
||||
this.execution_listener = execution_listener;
|
||||
send_ = (function(_this) {
|
||||
return function(o) {
|
||||
return _this.send(o);
|
||||
};
|
||||
})(this);
|
||||
this.execution_listener.push(send_);
|
||||
this.applied_operations = [];
|
||||
appliedOperationsListener = (function(_this) {
|
||||
return function(o) {
|
||||
return _this.applied_operations.push(o);
|
||||
};
|
||||
})(this);
|
||||
this.execution_listener.push(appliedOperationsListener);
|
||||
if (!((user_list != null ? user_list.length : void 0) === 0)) {
|
||||
this.engine.applyOps(user_list[0].getHistoryBuffer()._encode());
|
||||
}
|
||||
this.unexecuted = {};
|
||||
}
|
||||
|
||||
TestConnector.prototype.getOpsInExecutionOrder = function() {
|
||||
return this.applied_operations;
|
||||
};
|
||||
|
||||
TestConnector.prototype.send = function(o) {
|
||||
var user, _i, _len, _results;
|
||||
if ((o.uid.creator === this.HB.getUserId()) && (typeof o.uid.op_number !== "string")) {
|
||||
_results = [];
|
||||
for (_i = 0, _len = user_list.length; _i < _len; _i++) {
|
||||
user = user_list[_i];
|
||||
if (user.getUserId() !== this.HB.getUserId()) {
|
||||
_results.push(user.getConnector().receive(o));
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
|
||||
TestConnector.prototype.receive = function(o) {
|
||||
var _base, _name;
|
||||
if ((_base = this.unexecuted)[_name = o.uid.creator] == null) {
|
||||
_base[_name] = [];
|
||||
}
|
||||
return this.unexecuted[o.uid.creator].push(o);
|
||||
};
|
||||
|
||||
TestConnector.prototype.flushOne = function(user) {
|
||||
var _ref;
|
||||
if (((_ref = this.unexecuted[user]) != null ? _ref.length : void 0) > 0) {
|
||||
return this.engine.applyOp(this.unexecuted[user].shift());
|
||||
}
|
||||
};
|
||||
|
||||
TestConnector.prototype.flushOneRandom = function() {
|
||||
return this.flushOne(_.random(0, user_list.length - 1));
|
||||
};
|
||||
|
||||
TestConnector.prototype.flushAll = function() {
|
||||
var n, ops, _ref;
|
||||
_ref = this.unexecuted;
|
||||
for (n in _ref) {
|
||||
ops = _ref[n];
|
||||
this.engine.applyOps(ops);
|
||||
}
|
||||
return this.unexecuted = {};
|
||||
};
|
||||
|
||||
TestConnector.prototype.sync = function() {
|
||||
throw new Error("Can't use this a.t.m.");
|
||||
};
|
||||
|
||||
return TestConnector;
|
||||
|
||||
})();
|
||||
};
|
||||
|
||||
//# sourceMappingURL=TestConnector.js.map
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "TestConnector.js",
|
||||
"sourceRoot": "../../../lib/Connectors/",
|
||||
"sources": [
|
||||
"TestConnector.coffee"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "AACA,IAAA,CAAA;;AAAA,CAAA,GAAI,OAAA,CAAQ,YAAR,CAAJ,CAAA;;AAAA,MAEM,CAAC,OAAP,GAAiB,SAAC,SAAD,GAAA;AAKf,MAAA,aAAA;SAAM;AACS,IAAA,uBAAE,MAAF,EAAW,EAAX,EAAgB,kBAAhB,GAAA;AACX,UAAA,gCAA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AAV,CADI;IAAA,CAtCN,CAAA;;yBAAA;;OANa;AAAA,CAFjB,CAAA"
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
var Engine;
|
||||
|
||||
Engine = (function() {
|
||||
function Engine(HB, parser) {
|
||||
this.HB = HB;
|
||||
this.parser = parser;
|
||||
this.unprocessed_ops = [];
|
||||
}
|
||||
|
||||
Engine.prototype.parseOperation = function(json) {
|
||||
var typeParser;
|
||||
typeParser = this.parser[json.type];
|
||||
if (typeParser != null) {
|
||||
return typeParser(json);
|
||||
} else {
|
||||
throw new Error("You forgot to specify a parser for type " + json.type + ". The message is " + (JSON.stringify(json)) + ".");
|
||||
}
|
||||
};
|
||||
|
||||
Engine.prototype.applyOpsBundle = function(ops_json) {
|
||||
var o, ops, _i, _j, _k, _len, _len1, _len2;
|
||||
ops = [];
|
||||
for (_i = 0, _len = ops_json.length; _i < _len; _i++) {
|
||||
o = ops_json[_i];
|
||||
ops.push(this.parseOperation(o));
|
||||
}
|
||||
for (_j = 0, _len1 = ops.length; _j < _len1; _j++) {
|
||||
o = ops[_j];
|
||||
this.HB.addOperation(o);
|
||||
}
|
||||
for (_k = 0, _len2 = ops.length; _k < _len2; _k++) {
|
||||
o = ops[_k];
|
||||
if (!o.execute()) {
|
||||
this.unprocessed_ops.push(o);
|
||||
}
|
||||
}
|
||||
return this.tryUnprocessed();
|
||||
};
|
||||
|
||||
Engine.prototype.applyOpsCheckDouble = function(ops_json) {
|
||||
var o, _i, _len, _results;
|
||||
_results = [];
|
||||
for (_i = 0, _len = ops_json.length; _i < _len; _i++) {
|
||||
o = ops_json[_i];
|
||||
if (this.HB.getOperation(o.uid) != null) {
|
||||
_results.push(this.applyOp(o));
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Engine.prototype.applyOps = function(ops_json) {
|
||||
var o, _i, _len, _results;
|
||||
_results = [];
|
||||
for (_i = 0, _len = ops_json.length; _i < _len; _i++) {
|
||||
o = ops_json[_i];
|
||||
_results.push(this.applyOp(o));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Engine.prototype.applyOp = function(op_json) {
|
||||
var o;
|
||||
o = this.parseOperation(op_json);
|
||||
if (!o.execute()) {
|
||||
this.unprocessed_ops.push(o);
|
||||
} else {
|
||||
this.HB.addOperation(o);
|
||||
}
|
||||
return this.tryUnprocessed();
|
||||
};
|
||||
|
||||
Engine.prototype.tryUnprocessed = function() {
|
||||
var old_length, op, unprocessed, _i, _len, _ref, _results;
|
||||
_results = [];
|
||||
while (true) {
|
||||
old_length = this.unprocessed_ops.length;
|
||||
unprocessed = [];
|
||||
_ref = this.unprocessed_ops;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
op = _ref[_i];
|
||||
if (!op.execute()) {
|
||||
unprocessed.push(op);
|
||||
} else {
|
||||
this.HB.addOperation(op);
|
||||
}
|
||||
}
|
||||
this.unprocessed_ops = unprocessed;
|
||||
if (this.unprocessed_ops.length === old_length) {
|
||||
break;
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
return Engine;
|
||||
|
||||
})();
|
||||
|
||||
module.exports = Engine;
|
||||
|
||||
//# sourceMappingURL=Engine.js.map
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "Engine.js",
|
||||
"sourceRoot": "../../lib/",
|
||||
"sources": [
|
||||
"Engine.coffee"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "AAIA,IAAA,MAAA;;AAAA;AACe,EAAA,gBAAE,EAAF,EAAO,MAAP,GAAA;AACX,IADY,IAAC,CAAA,KAAA,EACb,CAAA;AAAA,IADiB,IAAC,CAAA,SAAA,MAClB,CAAA;AAAA,IAAA,IAAC,CAAA,eAAD,GAAmB,EAAnB,CADW;EAAA,CAAb;;AAAA,mBAMA,cAAA,GAAgB,SAAC,IAAD,GAAA;AACd,QA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ee");
|
||||
|
||||
HistoryBuffer = require("../HistoryBuffer.coffee");
|
||||
|
||||
Engine = require("../Engine.coffee");
|
||||
|
||||
JsonYatta = (function() {
|
||||
function JsonYatta(user_id, Connector) {
|
||||
var first_word, json_types;
|
||||
this.HB = new HistoryBuffer(user_id);
|
||||
json_types = json_types_uninitialized(this.HB);
|
||||
this.engine = new Engine(this.HB, json_types.parser);
|
||||
this.connector = new Connector(this.engine, this.HB, json_types.execution_listener, this);
|
||||
first_word = new json_types.types.JsonType(this.HB.getReservedUniqueIdentifier());
|
||||
this.HB.addOperation(first_word).execute();
|
||||
this.root_element = first_word;
|
||||
}
|
||||
|
||||
JsonYatta.prototype.getRootElement = function() {
|
||||
return this.root_element;
|
||||
};
|
||||
|
||||
JsonYatta.prototype.getEngine = function() {
|
||||
return this.engine;
|
||||
};
|
||||
|
||||
JsonYatta.prototype.getConnector = function() {
|
||||
return this.connector;
|
||||
};
|
||||
|
||||
JsonYatta.prototype.getHistoryBuffer = function() {
|
||||
return this.HB;
|
||||
};
|
||||
|
||||
JsonYatta.prototype.setMutableDefault = function(mutable) {
|
||||
return this.root_element.setMutableDefault(mutable);
|
||||
};
|
||||
|
||||
JsonYatta.prototype.getUserId = function() {
|
||||
return this.HB.getUserId();
|
||||
};
|
||||
|
||||
JsonYatta.prototype.val = function(name, content, mutable) {
|
||||
return this.root_element.val(name, content, mutable);
|
||||
};
|
||||
|
||||
Object.defineProperty(JsonYatta.prototype, 'value', {
|
||||
get: function() {
|
||||
return this.root_element.value;
|
||||
},
|
||||
set: function(o) {
|
||||
var o_name, o_obj, _results;
|
||||
if (o.constructor === {}.constructor) {
|
||||
_results = [];
|
||||
for (o_name in o) {
|
||||
o_obj = o[o_name];
|
||||
_results.push(this.val(o_name, o_obj, 'immutable'));
|
||||
}
|
||||
return _results;
|
||||
} else {
|
||||
throw new Error("You must only set Object values!");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return JsonYatta;
|
||||
|
||||
})();
|
||||
|
||||
if (typeof window !== "undefined" && window !== null) {
|
||||
window.JsonYatta = JsonYatta;
|
||||
}
|
||||
|
||||
module.exports = JsonYatta;
|
||||
|
||||
//# sourceMappingURL=JsonYatta.js.map
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "JsonYatta.js",
|
||||
"sourceRoot": "../../../lib/Frameworks/",
|
||||
"sources": [
|
||||
"JsonYatta.coffee"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "AACA,IAAA,0DAAA;;AAAA,wBAAA,GAA2B,OAAA,CAAQ,2BAAR,CAA3B,CAAA;;AAAA,aACA,GAAgB,OAAA,CAAQ,yBAAR,CADhB,CAAA;;AAAA,MAEA,GAAS,OAAA,CAAQ,kBAAR,CAFT,CAAA;;AAAA;AAYe,EAAA,mBAAC,OAAD,EAAU,SAAV,GAAA;AACX,QAAA,sBAAA;AAAA,IAAA,IAAC,CAAA,EAAD,GAAU,IAAA,aAAA,CAAc,OAAd,CAAV,CAAA;AAAA,IACA,UAAA,GAAa,wBAAA,CAAyB,IAAC,CAAA,EAA1B,CADb,CAAA;AAAA,IAEA,IAAC,CAAA,MAAD,GAAc,IAAA,MAAA,CAAO,IAAC,CAAA,EAAR,EAAY,UAAU,CAAC,MAAvB,CAFd,CAAA;AAAA,IAGA,IAAC,CAAA,SAAD,GAAiB,IAAA,SAAA,CAAU,IAAC,CAAA,MAAX,EAAmB,IAAC,CAAA,EAApB,EAAwB,UAAU,CAAC,kBAAnC,EAAuD,IAAvD,CAHjB,CAAA;AAAA,IAKA,UAAA,GAAiB,IAAA,UAAU,CAAC,KAAK,CAAC,QAAjB,CAA0B,IAAC,CAAA,EAAE,CAAC,2BAAJ,CAAA,CAA1B,CALjB,CAAA;AAAA,IAMA,IAAC,CAAA,EAAE,CAAC,YAAJ,CAAiB,UAAjB,CAA4B,CAAC,OAA7B,CAAA,CANA,CAAA;AAAA,IAOA,IAAC,CAAA,YAAD,GAAgB,UAPhB,CADW;EAAA,CA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A;;mBAAA;;IAZF,CAAA;;;EA8EA,MAAM,CAAE,SAAR,GAAoB;CA9EpB;;AAAA,MA+EM,CAAC,OAAP,GAAiB,SA/EjB,CAAA"
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
var Engine, HistoryBuffer, TextYatta, text_types_uninitialized;
|
||||
|
||||
text_types_uninitialized = require("../Types/TextTypes.coffee");
|
||||
|
||||
HistoryBuffer = require("../HistoryBuffer.coffee");
|
||||
|
||||
Engine = require("../Engine.coffee");
|
||||
|
||||
TextYatta = (function() {
|
||||
function TextYatta(user_id, Connector) {
|
||||
var first_word, root_elem, text_types;
|
||||
this.HB = new HistoryBuffer(user_id);
|
||||
text_types = text_types_uninitialized(this.HB);
|
||||
this.engine = new Engine(this.HB, text_types.parser);
|
||||
this.connector = new Connector(this.engine, this.HB, text_types.execution_listener);
|
||||
root_elem = this.connector.getRootElement();
|
||||
if (root_elem == null) {
|
||||
first_word = new text_types.types.Word(this.HB.getNextOperationIdentifier());
|
||||
this.HB.addOperation(first_word);
|
||||
first_word.execute();
|
||||
this.root_element = this.HB.addOperation(new text_types.types.ReplaceManager(first_word, this.HB.getNextOperationIdentifier())).execute();
|
||||
} else {
|
||||
this.root_element = this.HB.getOperation(root_elem);
|
||||
}
|
||||
}
|
||||
|
||||
TextYatta.prototype.getRootElement = function() {
|
||||
return this.root_element;
|
||||
};
|
||||
|
||||
TextYatta.prototype.getEngine = function() {
|
||||
return this.engine;
|
||||
};
|
||||
|
||||
TextYatta.prototype.getConnector = function() {
|
||||
return this.connector;
|
||||
};
|
||||
|
||||
TextYatta.prototype.getHistoryBuffer = function() {
|
||||
return this.HB;
|
||||
};
|
||||
|
||||
TextYatta.prototype.getUserId = function() {
|
||||
return this.HB.getUserId();
|
||||
};
|
||||
|
||||
TextYatta.prototype.val = function() {
|
||||
return this.root_element.val().val();
|
||||
};
|
||||
|
||||
TextYatta.prototype.insertText = function(pos, content) {
|
||||
return this.root_element.val().insertText(pos, content);
|
||||
};
|
||||
|
||||
TextYatta.prototype.deleteText = function(pos, length) {
|
||||
return this.root_element.val().deleteText(pos, length);
|
||||
};
|
||||
|
||||
TextYatta.prototype.replaceText = function(text) {
|
||||
return this.root_element.val().replaceText(text);
|
||||
};
|
||||
|
||||
return TextYatta;
|
||||
|
||||
})();
|
||||
|
||||
module.exports = TextYatta;
|
||||
|
||||
//# sourceMappingURL=TextYatta.js.map
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "TextYatta.js",
|
||||
"sourceRoot": "../../../lib/Frameworks/",
|
||||
"sources": [
|
||||
"TextYatta.coffee"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "AACA,IAAA,0DAAA;;AAAA,wBAAA,GAA2B,OAAA,CAAQ,2BAAR,CAA3B,CAAA;;AAAA,aACA,GAAgB,OAAA,CAAQ,yBAAR,CADhB,CAAA;;AAAA,MAEA,GAAS,OAAA,CAAQ,kBAAR,CAFT,CAAA;;AAAA;AAQe,EAAA,mBAAC,OAAD,EAAU,SAAV,GAAA;AACX,QAAA,iCAAA;AAAA,IAAA,IAAC,CAAA,EAAD,GAAU,IAAA,aAAA,CAAc,OAAd,CAAV,CAAA;AAAA,IACA,UAAA,GAAa,wBAAA,CAAyB,IAAC,CAAA,EAA1B,CADb,CAAA;AAAA,IAEA,IAAC,CAAA,MAAD,GAAc,IAAA,MAAA,CAAO,IAAC,CAAA,EAAR,EAAY,UAAU,CAAC,MAAvB,CAFd,CAAA;AAAA,IAGA,IAAC,CAAA,SAAD,GAAiB,IAAA,SAAA,CAAU,IAAC,CAAA,MAAX,EAAmB,IAAC,CAAA,EAApB,EAAwB,UAAU,CAAC,kBAAnC,CAHjB,CAAA;AAAA,IAIA,SAAA,GAAY,IAAC,CAAA,SAAS,CAAC,cAAX,CAAA,CAJZ,CAAA;AAKA,IAAA,IAAO,iBAAP;AACE,MAAA,UAAA,GAAiB,IAAA,UAAU,CAAC,KAAK,CAAC,IAAjB,CAAsB,IAAC,C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AA,CAhCZ,CAAA;;AAAA,sBAmCA,UAAA,GAAY,SAAC,GAAD,EAAM,MAAN,GAAA;WACV,IAAC,CAAA,YAAY,CAAC,GAAd,CAAA,CAAmB,CAAC,UAApB,CAA+B,GAA/B,EAAoC,MAApC,EADU;EAAA,CAnCZ,CAAA;;AAAA,sBAsCA,WAAA,GAAa,SAAC,IAAD,GAAA;WACX,IAAC,CAAA,YAAY,CAAC,GAAd,CAAA,CAAmB,CAAC,WAApB,CAAgC,IAAhC,EADW;EAAA,CAtCb,CAAA;;mBAAA;;IARF,CAAA;;AAAA,MAkDM,CAAC,OAAP,GAAiB,SAlDjB,CAAA"
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
var HistoryBuffer;
|
||||
|
||||
HistoryBuffer = (function() {
|
||||
function HistoryBuffer(user_id) {
|
||||
this.user_id = user_id;
|
||||
this.operation_counter = {};
|
||||
this.buffer = {};
|
||||
this.change_listeners = [];
|
||||
}
|
||||
|
||||
HistoryBuffer.prototype.getUserId = function() {
|
||||
return this.user_id;
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.getReservedUniqueIdentifier = function() {
|
||||
return {
|
||||
creator: '_',
|
||||
op_number: '_'
|
||||
};
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.getOperationCounter = function() {
|
||||
var ctn, res, user, _ref;
|
||||
res = {};
|
||||
_ref = this.operation_counter;
|
||||
for (user in _ref) {
|
||||
ctn = _ref[user];
|
||||
res[user] = ctn;
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype._encode = function(state_vector) {
|
||||
var json, o, o_json, o_next, o_number, o_prev, u_name, unknown, user, _ref;
|
||||
if (state_vector == null) {
|
||||
state_vector = {};
|
||||
}
|
||||
json = [];
|
||||
unknown = function(user, o_number) {
|
||||
if ((user == null) || (o_number == null)) {
|
||||
throw new Error("dah!");
|
||||
}
|
||||
return (state_vector[user] == null) || state_vector[user] <= o_number;
|
||||
};
|
||||
_ref = this.buffer;
|
||||
for (u_name in _ref) {
|
||||
user = _ref[u_name];
|
||||
for (o_number in user) {
|
||||
o = user[o_number];
|
||||
if (!isNaN(parseInt(o_number)) && unknown(u_name, o_number)) {
|
||||
o_json = o._encode();
|
||||
if (o.next_cl != null) {
|
||||
o_next = o.next_cl;
|
||||
while ((o_next.next_cl != null) && unknown(o_next.creator, o_next.op_number)) {
|
||||
o_next = o_next.next_cl;
|
||||
}
|
||||
o_json.next = o_next.getUid();
|
||||
} else if (o.prev_cl != null) {
|
||||
o_prev = o.prev_cl;
|
||||
while ((o_prev.prev_cl != null) && unknown(o_next.creator, o_next.op_number)) {
|
||||
o_prev = o_prev.prev_cl;
|
||||
}
|
||||
o_json.prev = o_prev.getUid();
|
||||
}
|
||||
json.push(o_json);
|
||||
}
|
||||
}
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.getNextOperationIdentifier = function(user_id) {
|
||||
var uid;
|
||||
if (user_id == null) {
|
||||
user_id = this.user_id;
|
||||
}
|
||||
if (this.operation_counter[user_id] == null) {
|
||||
this.operation_counter[user_id] = 0;
|
||||
}
|
||||
uid = {
|
||||
'creator': user_id,
|
||||
'op_number': this.operation_counter[user_id]
|
||||
};
|
||||
this.operation_counter[user_id]++;
|
||||
return uid;
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.getOperation = function(uid) {
|
||||
var _ref;
|
||||
if (uid instanceof Object) {
|
||||
return (_ref = this.buffer[uid.creator]) != null ? _ref[uid.op_number] : void 0;
|
||||
} else if (uid == null) {
|
||||
|
||||
} else {
|
||||
throw new Error("This type of uid is not defined!");
|
||||
}
|
||||
};
|
||||
|
||||
HistoryBuffer.prototype.addOperation = function(o) {
|
||||
if (this.buffer[o.creator] == null) {
|
||||
this.buffer[o.creator] = {};
|
||||
}
|
||||
if (this.operation_counter[o.creator] == null) {
|
||||
this.operation_counter[o.creator] = 0;
|
||||
}
|
||||
if (this.buffer[o.creator][o.op_number] != null) {
|
||||
throw new Error("You must not overwrite operations!");
|
||||
}
|
||||
this.buffer[o.creator][o.op_number] = o;
|
||||
if (typeof o.op_number === 'number' && o.creator !== this.getUserId()) {
|
||||
this.operation_counter[o.creator]++;
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
return HistoryBuffer;
|
||||
|
||||
})();
|
||||
|
||||
module.exports = HistoryBuffer;
|
||||
|
||||
//# sourceMappingURL=HistoryBuffer.js.map
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "HistoryBuffer.js",
|
||||
"sourceRoot": "../../lib/",
|
||||
"sources": [
|
||||
"HistoryBuffer.coffee"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "AAMA,IAAA,aAAA;;AAAA;AAMe,EAAA,uBAAE,OAAF,GAAA;AACX,IADY,IAAC,CAAA,UAAA,OACb,CAAA;AAAA,IAAA,IAAC,CAAA,iBAAD,GAAqB,EAArB,CAAA;AAAA,IACA,IAAC,CAAA,MAAD,GAAU,EADV,CAAA;AAAA,IAEA,IAAC,CAAA,gBAAD,GAAoB,EAFpB,CADW;EAAA,CAAb;;AAAA,0BAQA,SAAA,GAAW,SAAA,GAAA;WACT,IAAC,CAAA,QADQ;EAAA,CARX,CAAA;;AAAA,0BAiBA,2BAAA,GAA6B,SAAA,GAAA;WAC3B;AAAA,MACE,OAAA,EAAU,GADZ;AAAA,MAEE,SAAA,EAAY,GAFd;MAD2B;EAAA,CAjB7B,CAAA;;AAAA,0BA0BA,mBAAA,GAAqB,SAAA,GAAA;AACnB,QAAA,oBAAA;AAAA,IAAA,GAAA,GAAM,EAAN,CAAA;AACA;AAAA,SAAA,YAAA;uBAAA;AACE,MAAA,GAAI,CAAA,IAAA,CAAJ,GAAY,GAAZ,CADF;AAAA,KADA;WAGA,IAJmB;EAAA,CA1BrB,CAAA;;AAAA,0BAgCA,OAAA,GAAS,SAAC,YAAD,GAAA;AACP,QAAA,sEAAA;;MADQ,eAAa;KACrB;AAAA,IAAA,IAAA,G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AAF,KAAe,IAAC,CAAA,SAAD,CAAA,CAArD;AACE,MAAA,IAAC,CAAA,iBAAkB,CAAA,CAAC,CAAC,OAAF,CAAnB,EAAA,CADF;KATA;WAWA,EAZY;EAAA,CApFd,CAAA;;uBAAA;;IANF,CAAA;;AAAA,MAwGM,CAAC,OAAP,GAAiB,aAxGjB,CAAA"
|
||||
}
|
||||
@@ -1,330 +0,0 @@
|
||||
var __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; };
|
||||
|
||||
module.exports = function(HB) {
|
||||
var Delete, Delimiter, ImmutableObject, Insert, Operation, execution_listener, parser;
|
||||
parser = {};
|
||||
execution_listener = [];
|
||||
Operation = (function() {
|
||||
function Operation(uid) {
|
||||
if (uid == null) {
|
||||
uid = HB.getNextOperationIdentifier();
|
||||
}
|
||||
this.creator = uid['creator'], this.op_number = uid['op_number'];
|
||||
}
|
||||
|
||||
Operation.prototype.getUid = function() {
|
||||
return {
|
||||
'creator': this.creator,
|
||||
'op_number': this.op_number
|
||||
};
|
||||
};
|
||||
|
||||
Operation.prototype.execute = function() {
|
||||
var l, _i, _len;
|
||||
this.is_executed = true;
|
||||
for (_i = 0, _len = execution_listener.length; _i < _len; _i++) {
|
||||
l = execution_listener[_i];
|
||||
l(this._encode());
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
Operation.prototype.saveOperation = function(name, op) {
|
||||
if ((op != null ? op.execute : void 0) != null) {
|
||||
return this[name] = op;
|
||||
} else if (op != null) {
|
||||
if (this.unchecked == null) {
|
||||
this.unchecked = {};
|
||||
}
|
||||
return this.unchecked[name] = op;
|
||||
}
|
||||
};
|
||||
|
||||
Operation.prototype.validateSavedOperations = function() {
|
||||
var name, op, op_uid, success, uninstantiated, _ref;
|
||||
uninstantiated = {};
|
||||
success = this;
|
||||
_ref = this.unchecked;
|
||||
for (name in _ref) {
|
||||
op_uid = _ref[name];
|
||||
op = HB.getOperation(op_uid);
|
||||
if (op) {
|
||||
this[name] = op;
|
||||
} else {
|
||||
uninstantiated[name] = op_uid;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
delete this.unchecked;
|
||||
if (!success) {
|
||||
this.unchecked = uninstantiated;
|
||||
}
|
||||
return success;
|
||||
};
|
||||
|
||||
return Operation;
|
||||
|
||||
})();
|
||||
Delete = (function(_super) {
|
||||
__extends(Delete, _super);
|
||||
|
||||
function Delete(uid, deletes) {
|
||||
this.saveOperation('deletes', deletes);
|
||||
Delete.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
Delete.prototype._encode = function() {
|
||||
return {
|
||||
'type': "Delete",
|
||||
'uid': this.getUid(),
|
||||
'deletes': this.deletes.getUid()
|
||||
};
|
||||
};
|
||||
|
||||
Delete.prototype.execute = function() {
|
||||
if (this.validateSavedOperations()) {
|
||||
this.deletes.applyDelete(this);
|
||||
Delete.__super__.execute.apply(this, arguments);
|
||||
return this;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
return Delete;
|
||||
|
||||
})(Operation);
|
||||
parser['Delete'] = function(o) {
|
||||
var deletes_uid, uid;
|
||||
uid = o['uid'], deletes_uid = o['deletes'];
|
||||
return new Delete(uid, deletes_uid);
|
||||
};
|
||||
Insert = (function(_super) {
|
||||
__extends(Insert, _super);
|
||||
|
||||
function Insert(uid, prev_cl, next_cl, origin) {
|
||||
this.saveOperation('prev_cl', prev_cl);
|
||||
this.saveOperation('next_cl', next_cl);
|
||||
if (origin != null) {
|
||||
this.saveOperation('origin', origin);
|
||||
} else {
|
||||
this.saveOperation('origin', prev_cl);
|
||||
}
|
||||
Insert.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
Insert.prototype.applyDelete = function(o) {
|
||||
if (this.deleted_by == null) {
|
||||
this.deleted_by = [];
|
||||
}
|
||||
return this.deleted_by.push(o);
|
||||
};
|
||||
|
||||
Insert.prototype.isDeleted = function() {
|
||||
var _ref;
|
||||
return ((_ref = this.deleted_by) != null ? _ref.length : void 0) > 0;
|
||||
};
|
||||
|
||||
Insert.prototype.getDistanceToOrigin = function() {
|
||||
var d, o;
|
||||
d = 0;
|
||||
o = this.prev_cl;
|
||||
while (true) {
|
||||
if (this.origin === o) {
|
||||
break;
|
||||
}
|
||||
d++;
|
||||
if (this === this.prev_cl) {
|
||||
throw new Error("this should not happen ;) ");
|
||||
}
|
||||
o = o.prev_cl;
|
||||
}
|
||||
return d;
|
||||
};
|
||||
|
||||
Insert.prototype.update_sl = function() {
|
||||
var o;
|
||||
o = this.prev_cl;
|
||||
({
|
||||
update: function(dest_cl, dest_sl) {
|
||||
var _results;
|
||||
_results = [];
|
||||
while (true) {
|
||||
if (o.isDeleted()) {
|
||||
_results.push(o = o[dest_cl]);
|
||||
} else {
|
||||
this[dest_sl] = o;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
});
|
||||
update("prev_cl", "prev_sl");
|
||||
return update("next_cl", "prev_sl");
|
||||
};
|
||||
|
||||
Insert.prototype.execute = function() {
|
||||
var distance_to_origin, i, o, _ref, _ref1;
|
||||
if (this.is_executed != null) {
|
||||
return this;
|
||||
}
|
||||
if (!this.validateSavedOperations()) {
|
||||
return false;
|
||||
} else {
|
||||
if (((_ref = this.prev_cl) != null ? _ref.validateSavedOperations() : void 0) && ((_ref1 = this.next_cl) != null ? _ref1.validateSavedOperations() : void 0) && this.prev_cl.next_cl !== this) {
|
||||
distance_to_origin = 0;
|
||||
o = this.prev_cl.next_cl;
|
||||
i = 0;
|
||||
while (true) {
|
||||
if (o == null) {
|
||||
console.log(JSON.stringify(this.prev_cl.getUid()));
|
||||
console.log(JSON.stringify(this.next_cl.getUid()));
|
||||
}
|
||||
if (o !== this.next_cl) {
|
||||
if (o.getDistanceToOrigin() === i) {
|
||||
if (o.creator < this.creator) {
|
||||
this.prev_cl = o;
|
||||
distance_to_origin = i + 1;
|
||||
} else {
|
||||
|
||||
}
|
||||
} else if (o.getDistanceToOrigin() < i) {
|
||||
if (i - distance_to_origin <= o.getDistanceToOrigin()) {
|
||||
this.prev_cl = o;
|
||||
distance_to_origin = i + 1;
|
||||
} else {
|
||||
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
o = o.next_cl;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.next_cl = this.prev_cl.next_cl;
|
||||
this.prev_cl.next_cl = this;
|
||||
this.next_cl.prev_cl = this;
|
||||
}
|
||||
Insert.__super__.execute.apply(this, arguments);
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
return Insert;
|
||||
|
||||
})(Operation);
|
||||
ImmutableObject = (function(_super) {
|
||||
__extends(ImmutableObject, _super);
|
||||
|
||||
function ImmutableObject(uid, content, prev, next, origin) {
|
||||
this.content = content;
|
||||
ImmutableObject.__super__.constructor.call(this, uid, prev, next, origin);
|
||||
}
|
||||
|
||||
ImmutableObject.prototype.val = function() {
|
||||
return this.content;
|
||||
};
|
||||
|
||||
ImmutableObject.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "ImmutableObject",
|
||||
'uid': this.getUid(),
|
||||
'content': this.content
|
||||
};
|
||||
if (this.prev_cl != null) {
|
||||
json['prev'] = this.prev_cl.getUid();
|
||||
}
|
||||
if (this.next_cl != null) {
|
||||
json['next'] = this.next_cl.getUid();
|
||||
}
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return ImmutableObject;
|
||||
|
||||
})(Insert);
|
||||
parser['ImmutableObject'] = function(json) {
|
||||
var content, next, origin, prev, uid;
|
||||
uid = json['uid'], content = json['content'], prev = json['prev'], next = json['next'], origin = json['origin'];
|
||||
return new ImmutableObject(uid, content, prev, next, origin);
|
||||
};
|
||||
Delimiter = (function(_super) {
|
||||
__extends(Delimiter, _super);
|
||||
|
||||
function Delimiter(uid, prev_cl, next_cl, origin) {
|
||||
this.saveOperation('prev_cl', prev_cl);
|
||||
this.saveOperation('next_cl', next_cl);
|
||||
this.saveOperation('origin', prev_cl);
|
||||
Delimiter.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
Delimiter.prototype.isDeleted = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
Delimiter.prototype.execute = function() {
|
||||
var _ref, _ref1;
|
||||
if (((_ref = this.unchecked) != null ? _ref['next_cl'] : void 0) != null) {
|
||||
return Delimiter.__super__.execute.apply(this, arguments);
|
||||
} else if ((_ref1 = this.unchecked) != null ? _ref1['prev_cl'] : void 0) {
|
||||
if (this.validateSavedOperations()) {
|
||||
if (this.prev_cl.next_cl != null) {
|
||||
throw new Error("Probably duplicated operations");
|
||||
}
|
||||
this.prev_cl.next_cl = this;
|
||||
delete this.prev_cl.unchecked.next_cl;
|
||||
return Delimiter.__super__.execute.apply(this, arguments);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if ((this.prev_cl != null) && (this.prev_cl.next_cl == null)) {
|
||||
delete this.prev_cl.unchecked.next_cl;
|
||||
return this.prev_cl.next_cl = this;
|
||||
} else if ((this.prev_cl != null) || (this.next_cl != null)) {
|
||||
return Delimiter.__super__.execute.apply(this, arguments);
|
||||
} else {
|
||||
throw new Error("Delimiter is unsufficient defined!");
|
||||
}
|
||||
};
|
||||
|
||||
Delimiter.prototype._encode = function() {
|
||||
var _ref, _ref1;
|
||||
return {
|
||||
'type': "Delimiter",
|
||||
'uid': this.getUid(),
|
||||
'prev': (_ref = this.prev_cl) != null ? _ref.getUid() : void 0,
|
||||
'next': (_ref1 = this.next_cl) != null ? _ref1.getUid() : void 0
|
||||
};
|
||||
};
|
||||
|
||||
return Delimiter;
|
||||
|
||||
})(Operation);
|
||||
parser['Delimiter'] = function(json) {
|
||||
var next, prev, uid;
|
||||
uid = json['uid'], prev = json['prev'], next = json['next'];
|
||||
return new Delimiter(uid, prev, next);
|
||||
};
|
||||
return {
|
||||
'types': {
|
||||
'Delete': Delete,
|
||||
'Insert': Insert,
|
||||
'Delimiter': Delimiter,
|
||||
'Operation': Operation,
|
||||
'ImmutableObject': ImmutableObject
|
||||
},
|
||||
'parser': parser,
|
||||
'execution_listener': execution_listener
|
||||
};
|
||||
};
|
||||
|
||||
//# sourceMappingURL=BasicTypes.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,168 +0,0 @@
|
||||
var text_types_uninitialized,
|
||||
__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; };
|
||||
|
||||
text_types_uninitialized = require("./TextTypes.coffee");
|
||||
|
||||
module.exports = function(HB) {
|
||||
var JsonType, createJsonWrapper, parser, text_types, types;
|
||||
text_types = text_types_uninitialized(HB);
|
||||
types = text_types.types;
|
||||
parser = text_types.parser;
|
||||
createJsonWrapper = function(_jsonType) {
|
||||
var JsonWrapper;
|
||||
JsonWrapper = (function() {
|
||||
function JsonWrapper(jsonType) {
|
||||
var name, obj, _fn, _ref;
|
||||
_ref = jsonType.map;
|
||||
_fn = function(name, obj) {
|
||||
return Object.defineProperty(JsonWrapper.prototype, name, {
|
||||
get: function() {
|
||||
var x;
|
||||
x = obj.val();
|
||||
if (x instanceof JsonType) {
|
||||
return createJsonWrapper(x);
|
||||
} else if (x instanceof types.ImmutableObject) {
|
||||
return x.val();
|
||||
} else {
|
||||
return x;
|
||||
}
|
||||
},
|
||||
set: function(o) {
|
||||
var o_name, o_obj, overwrite, _results;
|
||||
if (o.constructor === {}.constructor) {
|
||||
overwrite = jsonType.val(name);
|
||||
_results = [];
|
||||
for (o_name in o) {
|
||||
o_obj = o[o_name];
|
||||
_results.push(overwrite.val(o_name, o_obj, 'immutable'));
|
||||
}
|
||||
return _results;
|
||||
} else {
|
||||
return jsonType.val(name, o, 'immutable');
|
||||
}
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: false
|
||||
});
|
||||
};
|
||||
for (name in _ref) {
|
||||
obj = _ref[name];
|
||||
_fn(name, obj);
|
||||
}
|
||||
}
|
||||
|
||||
return JsonWrapper;
|
||||
|
||||
})();
|
||||
return new JsonWrapper(_jsonType);
|
||||
};
|
||||
JsonType = (function(_super) {
|
||||
__extends(JsonType, _super);
|
||||
|
||||
function JsonType(uid, initial_value, mutable) {
|
||||
var name, o;
|
||||
JsonType.__super__.constructor.call(this, uid);
|
||||
if (initial_value != null) {
|
||||
if (typeof initial_value !== "object") {
|
||||
throw new Error("The initial value of JsonTypes must be of type Object! (current type: " + (typeof initial_value) + ")");
|
||||
}
|
||||
for (name in initial_value) {
|
||||
o = initial_value[name];
|
||||
this.val(name, o, mutable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JsonType.prototype.mutable_default = true;
|
||||
|
||||
JsonType.prototype.setMutableDefault = function(mutable) {
|
||||
if (mutable === true || mutable === 'mutable') {
|
||||
JsonType.prototype.mutable_default = true;
|
||||
} else if (mutable === false || mutable === 'immutable') {
|
||||
JsonType.prototype.mutable_default = false;
|
||||
} else {
|
||||
throw new Error('Set mutable either "mutable" or "immutable"!');
|
||||
}
|
||||
return 'OK';
|
||||
};
|
||||
|
||||
JsonType.prototype.val = function(name, content, mutable) {
|
||||
var json, o, o_name, obj, word;
|
||||
if (typeof name === 'object') {
|
||||
for (o_name in name) {
|
||||
o = name[o_name];
|
||||
this.val(o_name, o, content);
|
||||
}
|
||||
return this;
|
||||
} else if ((name != null) && (content != null)) {
|
||||
if (mutable != null) {
|
||||
if (mutable === true || mutable === 'mutable') {
|
||||
mutable = true;
|
||||
} else {
|
||||
mutable = false;
|
||||
}
|
||||
} else {
|
||||
mutable = this.mutable_default;
|
||||
}
|
||||
if (typeof content === 'function') {
|
||||
return this;
|
||||
} else if (((!mutable) || typeof content === 'number') && content.constructor !== Object) {
|
||||
obj = HB.addOperation(new types.ImmutableObject(void 0, content)).execute();
|
||||
return JsonType.__super__.val.call(this, name, obj);
|
||||
} else {
|
||||
if (typeof content === 'string') {
|
||||
word = HB.addOperation(new types.Word(void 0)).execute();
|
||||
word.insertText(0, content);
|
||||
return JsonType.__super__.val.call(this, name, word);
|
||||
} else if (content.constructor === Object) {
|
||||
json = HB.addOperation(new JsonType(void 0, content, mutable)).execute();
|
||||
return JsonType.__super__.val.call(this, name, json);
|
||||
} else {
|
||||
throw new Error("You must not set " + (typeof content) + "-types in collaborative Json-objects!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return JsonType.__super__.val.call(this, name, content);
|
||||
}
|
||||
};
|
||||
|
||||
Object.defineProperty(JsonType.prototype, 'value', {
|
||||
get: function() {
|
||||
return createJsonWrapper(this);
|
||||
},
|
||||
set: function(o) {
|
||||
var o_name, o_obj, _results;
|
||||
if (o.constructor === {}.constructor) {
|
||||
_results = [];
|
||||
for (o_name in o) {
|
||||
o_obj = o[o_name];
|
||||
_results.push(this.val(o_name, o_obj, 'immutable'));
|
||||
}
|
||||
return _results;
|
||||
} else {
|
||||
throw new Error("You must only set Object values!");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
JsonType.prototype._encode = function() {
|
||||
return {
|
||||
'type': "JsonType",
|
||||
'uid': this.getUid()
|
||||
};
|
||||
};
|
||||
|
||||
return JsonType;
|
||||
|
||||
})(types.MapManager);
|
||||
parser['JsonType'] = function(json) {
|
||||
var uid;
|
||||
uid = json['uid'];
|
||||
return new JsonType(uid);
|
||||
};
|
||||
types['JsonType'] = JsonType;
|
||||
return text_types;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=JsonTypes.js.map
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "JsonTypes.js",
|
||||
"sourceRoot": "../../../lib/Types/",
|
||||
"sources": [
|
||||
"JsonTypes.coffee"
|
||||
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,CAvLrB,CAAA;AAAA,EAgMA,KAAM,CAAA,UAAA,CAAN,GAAoB,QAhMpB,CAAA;SAkMA,WAnMe;AAAA,CAFjB,CAAA"
|
||||
}
|
||||
@@ -1,274 +0,0 @@
|
||||
var basic_types_uninitialized,
|
||||
__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; };
|
||||
|
||||
basic_types_uninitialized = require("./BasicTypes.coffee");
|
||||
|
||||
module.exports = function(HB) {
|
||||
var AddName, ListManager, MapManager, ReplaceManager, Replaceable, basic_types, parser, types;
|
||||
basic_types = basic_types_uninitialized(HB);
|
||||
types = basic_types.types;
|
||||
parser = basic_types.parser;
|
||||
MapManager = (function(_super) {
|
||||
__extends(MapManager, _super);
|
||||
|
||||
function MapManager(uid) {
|
||||
this.map = {};
|
||||
MapManager.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
MapManager.prototype.val = function(name, content) {
|
||||
var o, obj, result, _ref, _ref1;
|
||||
if (content != null) {
|
||||
if (this.map[name] == null) {
|
||||
HB.addOperation(new AddName(void 0, this, name)).execute();
|
||||
}
|
||||
this.map[name].replace(content);
|
||||
return this;
|
||||
} else if (name != null) {
|
||||
obj = (_ref = this.map[name]) != null ? _ref.val() : void 0;
|
||||
if (obj instanceof types.ImmutableObject) {
|
||||
return obj.val();
|
||||
} else {
|
||||
return obj;
|
||||
}
|
||||
} else {
|
||||
result = {};
|
||||
_ref1 = this.map;
|
||||
for (name in _ref1) {
|
||||
o = _ref1[name];
|
||||
obj = o.val();
|
||||
if (obj instanceof types.ImmutableObject || obj instanceof MapManager) {
|
||||
obj = obj.val();
|
||||
}
|
||||
result[name] = obj;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
return MapManager;
|
||||
|
||||
})(types.Operation);
|
||||
AddName = (function(_super) {
|
||||
__extends(AddName, _super);
|
||||
|
||||
function AddName(uid, map_manager, name) {
|
||||
this.name = name;
|
||||
this.saveOperation('map_manager', map_manager);
|
||||
AddName.__super__.constructor.call(this, uid);
|
||||
}
|
||||
|
||||
AddName.prototype.execute = function() {
|
||||
var beg, end, uid_beg, uid_end, uid_r;
|
||||
if (!this.validateSavedOperations()) {
|
||||
return false;
|
||||
} else {
|
||||
uid_r = this.map_manager.getUid();
|
||||
uid_r.op_number = "_" + uid_r.op_number + "_RM_" + this.name;
|
||||
if (HB.getOperation(uid_r) == null) {
|
||||
uid_beg = this.map_manager.getUid();
|
||||
uid_beg.op_number = "_" + uid_beg.op_number + "_RM_" + this.name + "_beginning";
|
||||
uid_end = this.map_manager.getUid();
|
||||
uid_end.op_number = "_" + uid_end.op_number + "_RM_" + this.name + "_end";
|
||||
beg = HB.addOperation(new types.Delimiter(uid_beg, void 0, uid_end)).execute();
|
||||
end = HB.addOperation(new types.Delimiter(uid_end, beg, void 0)).execute();
|
||||
this.map_manager.map[this.name] = HB.addOperation(new ReplaceManager(void 0, uid_r, beg, end)).execute();
|
||||
}
|
||||
return AddName.__super__.execute.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
AddName.prototype._encode = function() {
|
||||
return {
|
||||
'type': "AddName",
|
||||
'uid': this.getUid(),
|
||||
'map_manager': this.map_manager.getUid(),
|
||||
'name': this.name
|
||||
};
|
||||
};
|
||||
|
||||
return AddName;
|
||||
|
||||
})(types.Operation);
|
||||
parser['AddName'] = function(json) {
|
||||
var map_manager, name, uid;
|
||||
map_manager = json['map_manager'], uid = json['uid'], name = json['name'];
|
||||
return new AddName(uid, map_manager, name);
|
||||
};
|
||||
ListManager = (function(_super) {
|
||||
__extends(ListManager, _super);
|
||||
|
||||
function ListManager(uid, beginning, end, prev, next, origin) {
|
||||
if ((beginning != null) && (end != null)) {
|
||||
this.saveOperation('beginning', beginning);
|
||||
this.saveOperation('end', end);
|
||||
} else {
|
||||
this.beginning = HB.addOperation(new types.Delimiter(void 0, void 0, void 0));
|
||||
this.end = HB.addOperation(new types.Delimiter(void 0, this.beginning, void 0));
|
||||
this.beginning.next_cl = this.end;
|
||||
this.beginning.execute();
|
||||
this.end.execute();
|
||||
}
|
||||
ListManager.__super__.constructor.call(this, uid, prev, next, origin);
|
||||
}
|
||||
|
||||
ListManager.prototype.getLastOperation = function() {
|
||||
return this.end.prev_cl;
|
||||
};
|
||||
|
||||
ListManager.prototype.getFirstOperation = function() {
|
||||
return this.beginning.next_cl;
|
||||
};
|
||||
|
||||
ListManager.prototype.toArray = function() {
|
||||
var o, result;
|
||||
o = this.beginning.next_cl;
|
||||
result = [];
|
||||
while (o !== this.end) {
|
||||
result.push(o);
|
||||
o = o.next_cl;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
ListManager.prototype.getOperationByPosition = function(position) {
|
||||
var o;
|
||||
o = this.beginning.next_cl;
|
||||
if (position > 0) {
|
||||
while (true) {
|
||||
o = o.next_cl;
|
||||
if (!o.isDeleted()) {
|
||||
position -= 1;
|
||||
}
|
||||
if (position === 0) {
|
||||
break;
|
||||
}
|
||||
if (o instanceof types.Delimiter) {
|
||||
throw new Error("position parameter exceeded the length of the document!");
|
||||
}
|
||||
}
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
return ListManager;
|
||||
|
||||
})(types.Insert);
|
||||
ReplaceManager = (function(_super) {
|
||||
__extends(ReplaceManager, _super);
|
||||
|
||||
function ReplaceManager(initial_content, uid, beginning, end, prev, next, origin) {
|
||||
ReplaceManager.__super__.constructor.call(this, uid, beginning, end, prev, next, origin);
|
||||
if (initial_content != null) {
|
||||
this.replace(initial_content);
|
||||
}
|
||||
}
|
||||
|
||||
ReplaceManager.prototype.replace = function(content) {
|
||||
var o, op;
|
||||
o = this.getLastOperation();
|
||||
op = new Replaceable(content, this, void 0, o, o.next_cl);
|
||||
return HB.addOperation(op).execute();
|
||||
};
|
||||
|
||||
ReplaceManager.prototype.val = function() {
|
||||
var o;
|
||||
o = this.getLastOperation();
|
||||
if (o instanceof types.Delimiter) {
|
||||
throw new Error("dtrn");
|
||||
}
|
||||
return o.val();
|
||||
};
|
||||
|
||||
ReplaceManager.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "ReplaceManager",
|
||||
'uid': this.getUid(),
|
||||
'beginning': this.beginning.getUid(),
|
||||
'end': this.end.getUid()
|
||||
};
|
||||
if ((this.prev_cl != null) && (this.next_cl != null)) {
|
||||
json['prev'] = this.prev_cl.getUid();
|
||||
json['next'] = this.next_cl.getUid();
|
||||
}
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return ReplaceManager;
|
||||
|
||||
})(ListManager);
|
||||
parser["ReplaceManager"] = function(json) {
|
||||
var beginning, content, end, next, origin, prev, uid;
|
||||
content = json['content'], uid = json['uid'], prev = json['prev'], next = json['next'], origin = json['origin'], beginning = json['beginning'], end = json['end'];
|
||||
return new ReplaceManager(content, uid, beginning, end, prev, next, origin);
|
||||
};
|
||||
Replaceable = (function(_super) {
|
||||
__extends(Replaceable, _super);
|
||||
|
||||
function Replaceable(content, parent, uid, prev, next, origin) {
|
||||
this.saveOperation('content', content);
|
||||
this.saveOperation('parent', parent);
|
||||
if (!((prev != null) && (next != null) && (content != null))) {
|
||||
throw new Error("You must define content, prev, and next for Replaceable-types!");
|
||||
}
|
||||
Replaceable.__super__.constructor.call(this, uid, prev, next, origin);
|
||||
}
|
||||
|
||||
Replaceable.prototype.val = function() {
|
||||
return this.content;
|
||||
};
|
||||
|
||||
Replaceable.prototype.replace = function(content) {
|
||||
return this.parent.replace(content);
|
||||
};
|
||||
|
||||
Replaceable.prototype.execute = function() {
|
||||
var _base;
|
||||
if (!this.validateSavedOperations()) {
|
||||
return false;
|
||||
} else {
|
||||
if (typeof (_base = this.content).setReplaceManager === "function") {
|
||||
_base.setReplaceManager(this.parent);
|
||||
}
|
||||
Replaceable.__super__.execute.apply(this, arguments);
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
Replaceable.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "Replaceable",
|
||||
'content': this.content.getUid(),
|
||||
'ReplaceManager': this.parent.getUid(),
|
||||
'prev': this.prev_cl.getUid(),
|
||||
'next': this.next_cl.getUid(),
|
||||
'uid': this.getUid()
|
||||
};
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return Replaceable;
|
||||
|
||||
})(types.Insert);
|
||||
parser["Replaceable"] = function(json) {
|
||||
var content, next, origin, parent, prev, uid;
|
||||
content = json['content'], parent = json['ReplaceManager'], uid = json['uid'], prev = json['prev'], next = json['next'], origin = json['origin'];
|
||||
return new Replaceable(content, parent, uid, prev, next, origin);
|
||||
};
|
||||
types['ListManager'] = ListManager;
|
||||
types['MapManager'] = MapManager;
|
||||
types['ReplaceManager'] = ReplaceManager;
|
||||
types['Replaceable'] = Replaceable;
|
||||
return basic_types;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=StructuredTypes.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,179 +0,0 @@
|
||||
var structured_types_uninitialized,
|
||||
__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; };
|
||||
|
||||
structured_types_uninitialized = require("./StructuredTypes.coffee");
|
||||
|
||||
module.exports = function(HB) {
|
||||
var TextDelete, TextInsert, Word, parser, structured_types, types;
|
||||
structured_types = structured_types_uninitialized(HB);
|
||||
types = structured_types.types;
|
||||
parser = structured_types.parser;
|
||||
TextDelete = (function(_super) {
|
||||
__extends(TextDelete, _super);
|
||||
|
||||
function TextDelete() {
|
||||
return TextDelete.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
return TextDelete;
|
||||
|
||||
})(types.Delete);
|
||||
parser["TextDelete"] = parser["Delete"];
|
||||
TextInsert = (function(_super) {
|
||||
__extends(TextInsert, _super);
|
||||
|
||||
function TextInsert(content, uid, prev, next, origin) {
|
||||
this.content = content;
|
||||
if (!((prev != null) && (next != null))) {
|
||||
throw new Error("You must define prev, and next for TextInsert-types!");
|
||||
}
|
||||
TextInsert.__super__.constructor.call(this, uid, prev, next, origin);
|
||||
}
|
||||
|
||||
TextInsert.prototype.getLength = function() {
|
||||
if (this.isDeleted()) {
|
||||
return 0;
|
||||
} else {
|
||||
return this.content.length;
|
||||
}
|
||||
};
|
||||
|
||||
TextInsert.prototype.val = function(current_position) {
|
||||
if (this.isDeleted()) {
|
||||
return "";
|
||||
} else {
|
||||
return this.content;
|
||||
}
|
||||
};
|
||||
|
||||
TextInsert.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "TextInsert",
|
||||
'content': this.content,
|
||||
'uid': this.getUid(),
|
||||
'prev': this.prev_cl.getUid(),
|
||||
'next': this.next_cl.getUid()
|
||||
};
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return TextInsert;
|
||||
|
||||
})(types.Insert);
|
||||
parser["TextInsert"] = function(json) {
|
||||
var content, next, origin, prev, uid;
|
||||
content = json['content'], uid = json['uid'], prev = json['prev'], next = json['next'], origin = json['origin'];
|
||||
return new TextInsert(content, uid, prev, next, origin);
|
||||
};
|
||||
Word = (function(_super) {
|
||||
__extends(Word, _super);
|
||||
|
||||
function Word(uid, beginning, end, prev, next, origin) {
|
||||
Word.__super__.constructor.call(this, uid, beginning, end, prev, next, origin);
|
||||
}
|
||||
|
||||
Word.prototype.insertText = function(position, content) {
|
||||
var c, o, op, _i, _len, _results;
|
||||
o = this.getOperationByPosition(position);
|
||||
_results = [];
|
||||
for (_i = 0, _len = content.length; _i < _len; _i++) {
|
||||
c = content[_i];
|
||||
op = new TextInsert(c, void 0, o.prev_cl, o);
|
||||
_results.push(HB.addOperation(op).execute());
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Word.prototype.deleteText = function(position, length) {
|
||||
var d, i, o, _i, _results;
|
||||
o = this.getOperationByPosition(position);
|
||||
_results = [];
|
||||
for (i = _i = 0; 0 <= length ? _i < length : _i > length; i = 0 <= length ? ++_i : --_i) {
|
||||
d = HB.addOperation(new TextDelete(void 0, o)).execute();
|
||||
o = o.next_cl;
|
||||
while (o.isDeleted()) {
|
||||
if (o instanceof types.Delimiter) {
|
||||
throw new Error("You can't delete more than there is..");
|
||||
}
|
||||
o = o.next_cl;
|
||||
}
|
||||
_results.push(d._encode());
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Word.prototype.replaceText = function(text) {
|
||||
var word;
|
||||
if (this.replace_manager != null) {
|
||||
word = HB.addOperation(new Word(void 0)).execute();
|
||||
word.insertText(0, text);
|
||||
return this.replace_manager.replace(word);
|
||||
} else {
|
||||
throw new Error("This type is currently not maintained by a ReplaceManager!");
|
||||
}
|
||||
};
|
||||
|
||||
Word.prototype.val = function() {
|
||||
var c, o;
|
||||
c = (function() {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = this.toArray();
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
o = _ref[_i];
|
||||
if (o.val != null) {
|
||||
_results.push(o.val());
|
||||
} else {
|
||||
_results.push("");
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
return c.join('');
|
||||
};
|
||||
|
||||
Word.prototype.setReplaceManager = function(op) {
|
||||
this.saveOperation('replace_manager', op);
|
||||
return this.validateSavedOperations;
|
||||
};
|
||||
|
||||
Word.prototype._encode = function() {
|
||||
var json;
|
||||
json = {
|
||||
'type': "Word",
|
||||
'uid': this.getUid(),
|
||||
'beginning': this.beginning.getUid(),
|
||||
'end': this.end.getUid()
|
||||
};
|
||||
if (this.prev_cl != null) {
|
||||
json['prev'] = this.prev_cl.getUid();
|
||||
}
|
||||
if (this.next_cl != null) {
|
||||
json['next'] = this.next_cl.getUid();
|
||||
}
|
||||
if ((this.origin != null) && this.origin !== this.prev_cl) {
|
||||
json["origin"] = this.origin.getUid();
|
||||
}
|
||||
return json;
|
||||
};
|
||||
|
||||
return Word;
|
||||
|
||||
})(types.ListManager);
|
||||
parser['Word'] = function(json) {
|
||||
var beginning, end, next, origin, prev, uid;
|
||||
uid = json['uid'], beginning = json['beginning'], end = json['end'], prev = json['prev'], next = json['next'], origin = json['origin'];
|
||||
return new Word(uid, beginning, end, prev, next, origin);
|
||||
};
|
||||
types['TextInsert'] = TextInsert;
|
||||
types['TextDelete'] = TextDelete;
|
||||
types['Word'] = Word;
|
||||
return structured_types;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=TextTypes.js.map
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "TextTypes.js",
|
||||
"sourceRoot": "../../../lib/Types/",
|
||||
"sources": [
|
||||
"TextTypes.coffee"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "AAAA,IAAA,8BAAA;EAAA;iSAAA;;AAAA,8BAAA,GAAiC,OAAA,CAAQ,0BAAR,CAAjC,CAAA;;AAAA,MAEM,CAAC,OAAP,GAAiB,SAAC,EAAD,GAAA;AACf,MAAA,6DAAA;AAAA,EAAA,gBAAA,GAAmB,8BAAA,CAA+B,EAA/B,CAAnB,CAAA;AAAA,EACA,KAAA,GAAQ,gBAAgB,CAAC,KADzB,CAAA;AAAA,EAEA,MAAA,GAAS,gBAAgB,CAAC,MAF1B,CAAA;AAAA,EAQM;AAAN,iCAAA,CAAA;;;;KAAA;;sBAAA;;KAAyB,KAAK,CAAC,OAR/B,CAAA;AAAA,EASA,MAAO,CAAA,YAAA,CAAP,GAAuB,MAAO,C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AAA,CAAN,GAAsB,UAtKtB,CAAA;AAAA,EAuKA,KAAM,CAAA,MAAA,CAAN,GAAgB,IAvKhB,CAAA;SAwKA,iBAzKe;AAAA,CAFjB,CAAA"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
|
||||
|
||||
//# sourceMappingURL=XmlTypes.js.map
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"file": "XmlTypes.js",
|
||||
"sourceRoot": "../../../lib/Types/",
|
||||
"sources": [
|
||||
"XmlTypes.coffee"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": "AA2KkB"
|
||||
}
|
||||
@@ -1,442 +0,0 @@
|
||||
(function() {
|
||||
var Connector_uninitialized, Test, Yatta, chai, expect, should, sinon, sinonChai, _,
|
||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
||||
|
||||
chai = require('chai');
|
||||
|
||||
expect = chai.expect;
|
||||
|
||||
should = chai.should();
|
||||
|
||||
sinon = require('sinon');
|
||||
|
||||
sinonChai = require('sinon-chai');
|
||||
|
||||
_ = require("underscore");
|
||||
|
||||
chai.use(sinonChai);
|
||||
|
||||
Yatta = require("../lib/Frameworks/JsonYatta.coffee");
|
||||
|
||||
Connector_uninitialized = require("../lib/Connectors/TestConnector.coffee");
|
||||
|
||||
Test = (function() {
|
||||
function Test(name_suffix) {
|
||||
this.name_suffix = name_suffix != null ? name_suffix : "";
|
||||
this.applyRandomOp = __bind(this.applyRandomOp, this);
|
||||
this.generateRandomOp = __bind(this.generateRandomOp, this);
|
||||
this.generateDeleteOp = __bind(this.generateDeleteOp, this);
|
||||
this.generateReplaceOp = __bind(this.generateReplaceOp, this);
|
||||
this.generateInsertOp = __bind(this.generateInsertOp, this);
|
||||
this.number_of_test_cases_multiplier = 1;
|
||||
this.repeat_this = 5 * this.number_of_test_cases_multiplier;
|
||||
this.doSomething_amount = 1000 * 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;
|
||||
this.debug = true;
|
||||
this.reinitialize();
|
||||
}
|
||||
|
||||
Test.prototype.reinitialize = function() {
|
||||
var i, _i, _ref;
|
||||
this.users = [];
|
||||
this.Connector = Connector_uninitialized(this.users);
|
||||
for (i = _i = 0, _ref = this.number_of_engines; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
|
||||
this.users.push(new Yatta(i + this.name_suffix, this.Connector));
|
||||
}
|
||||
this.users[0].val('name', "i");
|
||||
return this.flushAll();
|
||||
};
|
||||
|
||||
Test.prototype.getSomeUser = function() {
|
||||
var i;
|
||||
i = _.random(0, this.users.length - 1);
|
||||
return this.users[i];
|
||||
};
|
||||
|
||||
Test.prototype.getRandomText = function() {
|
||||
var chars, length, nextchar, text;
|
||||
chars = "abcdefghijklmnopqrstuvwxyz";
|
||||
length = _.random(0, 10);
|
||||
nextchar = chars[_.random(0, chars.length - 1)];
|
||||
text = "";
|
||||
_(length).times(function() {
|
||||
return text += nextchar;
|
||||
});
|
||||
return text;
|
||||
};
|
||||
|
||||
Test.prototype.generateInsertOp = function(user_num) {
|
||||
var pos;
|
||||
pos = _.random(0, this.users[user_num].val('name').val().length - 1);
|
||||
this.users[user_num].val('name').insertText(pos, this.getRandomText());
|
||||
return null;
|
||||
};
|
||||
|
||||
Test.prototype.generateReplaceOp = function(user_num) {
|
||||
this.users[user_num].val('name').replaceText(this.getRandomText());
|
||||
return null;
|
||||
};
|
||||
|
||||
Test.prototype.generateDeleteOp = function(user_num) {
|
||||
var length, ops1, pos;
|
||||
if (this.users[user_num].val('name').val().length > 0) {
|
||||
pos = _.random(0, this.users[user_num].val('name').val().length - 1);
|
||||
length = _.random(0, this.users[user_num].val('name').val().length - pos);
|
||||
ops1 = this.users[user_num].val('name').deleteText(pos, length);
|
||||
}
|
||||
return void 0;
|
||||
};
|
||||
|
||||
Test.prototype.generateRandomOp = function(user_num) {
|
||||
var i, op, op_gen;
|
||||
op_gen = [this.generateInsertOp, this.generateDeleteOp, this.generateReplaceOp];
|
||||
i = _.random(op_gen.length - 1);
|
||||
return op = op_gen[i](user_num);
|
||||
};
|
||||
|
||||
Test.prototype.applyRandomOp = function(user_num) {
|
||||
var user;
|
||||
user = this.users[user_num];
|
||||
return user.getConnector().flushOneRandom();
|
||||
};
|
||||
|
||||
Test.prototype.doSomething = function() {
|
||||
var choice, choices, user_num;
|
||||
user_num = _.random(this.number_of_engines - 1);
|
||||
choices = [this.applyRandomOp, this.generateRandomOp];
|
||||
choice = _.random(choices.length - 1);
|
||||
return choices[choice](user_num);
|
||||
};
|
||||
|
||||
Test.prototype.flushAll = function() {
|
||||
var user, user_number, _i, _len, _ref, _results;
|
||||
_ref = this.users;
|
||||
_results = [];
|
||||
for (user_number = _i = 0, _len = _ref.length; _i < _len; user_number = ++_i) {
|
||||
user = _ref[user_number];
|
||||
_results.push(user.getConnector().flushAll());
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Test.prototype.compareAll = function(test_number) {
|
||||
var i, j, number_of_created_operations, ops, ops_per_msek, printOpsInExecutionOrder, u, _i, _j, _k, _len, _ref, _ref1, _ref2, _results;
|
||||
this.flushAll();
|
||||
this.time += (new Date()).getTime() - this.time_now;
|
||||
number_of_created_operations = 0;
|
||||
for (i = _i = 0, _ref = this.users.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
|
||||
number_of_created_operations += this.users[i].getConnector().getOpsInExecutionOrder().length;
|
||||
}
|
||||
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 " + 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) {
|
||||
if (this.debug) {
|
||||
if (this.users[i].val('name').val() !== this.users[i + 1].val('name').val()) {
|
||||
printOpsInExecutionOrder = (function(_this) {
|
||||
return function(otnumber, otherotnumber) {
|
||||
var j, o, ops, s, _k, _l, _len, _len1;
|
||||
ops = _.filter(_this.users[otnumber].getConnector().getOpsInExecutionOrder(), function(o) {
|
||||
return typeof o.uid.op_name !== 'string' && o.uid.creator !== '_';
|
||||
});
|
||||
for (j = _k = 0, _len = ops.length; _k < _len; j = ++_k) {
|
||||
s = ops[j];
|
||||
console.log(("op" + j + " = ") + (JSON.stringify(s)));
|
||||
}
|
||||
console.log("");
|
||||
s = "ops = [";
|
||||
for (j = _l = 0, _len1 = ops.length; _l < _len1; j = ++_l) {
|
||||
o = ops[j];
|
||||
if (j !== 0) {
|
||||
s += ", ";
|
||||
}
|
||||
s += "op" + j;
|
||||
}
|
||||
s += "]";
|
||||
console.log(s);
|
||||
console.log("@test_user.engine.applyOps ops");
|
||||
console.log("expect(@test_user.val('name').val()).to.equal(\"" + (_this.users[otherotnumber].val('name').val()) + "\")");
|
||||
return ops;
|
||||
};
|
||||
})(this);
|
||||
console.log("");
|
||||
console.log("Found an OT Puzzle!");
|
||||
console.log("OT states:");
|
||||
_ref2 = this.users;
|
||||
for (j = _k = 0, _len = _ref2.length; _k < _len; j = ++_k) {
|
||||
u = _ref2[j];
|
||||
console.log(("OT" + j + ": ") + u.val('name').val());
|
||||
}
|
||||
console.log("\nOT execution order (" + i + "," + (i + 1) + "):");
|
||||
printOpsInExecutionOrder(i, i + 1);
|
||||
console.log("");
|
||||
ops = printOpsInExecutionOrder(i + 1, i);
|
||||
console.log("");
|
||||
}
|
||||
}
|
||||
if (this.users[i].val('name').val() !== this.users[i + 1].val('name').val()) {
|
||||
console.log("found error");
|
||||
}
|
||||
_results.push(expect(this.users[i].val('name').val()).to.equal(this.users[i + 1].val('name').val()));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Test.prototype.run = function() {
|
||||
var i, times, _i, _j, _ref, _ref1, _results;
|
||||
console.log('');
|
||||
_results = [];
|
||||
for (times = _i = 1, _ref = this.repeat_this; 1 <= _ref ? _i <= _ref : _i >= _ref; times = 1 <= _ref ? ++_i : --_i) {
|
||||
this.time_now = (new Date).getTime();
|
||||
for (i = _j = 1, _ref1 = this.doSomething_amount; 1 <= _ref1 ? _j <= _ref1 : _j >= _ref1; i = 1 <= _ref1 ? ++_j : --_j) {
|
||||
this.doSomething();
|
||||
}
|
||||
this.compareAll(times);
|
||||
this.testHBencoding();
|
||||
if (times !== this.repeat_this) {
|
||||
_results.push(this.reinitialize());
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
Test.prototype.testHBencoding = function() {
|
||||
var user;
|
||||
user = new Yatta('testuser', Connector_uninitialized([]));
|
||||
user.engine.applyOps(this.users[0].HB._encode());
|
||||
return expect(user.value.name.val()).to.equal(this.users[0].value.name.val());
|
||||
};
|
||||
|
||||
return Test;
|
||||
|
||||
})();
|
||||
|
||||
describe("JsonYatta", function() {
|
||||
beforeEach(function(done) {
|
||||
this.timeout(50000);
|
||||
this.yTest = new Test();
|
||||
this.users = this.yTest.users;
|
||||
this.test_user = new Yatta(0, Connector_uninitialized([]));
|
||||
return done();
|
||||
});
|
||||
it("has a JsonWrapper", function() {
|
||||
var w, y;
|
||||
y = this.yTest.getSomeUser().root_element;
|
||||
y.val('x', "dtrn", 'immutable');
|
||||
y.val('set', {
|
||||
x: "x"
|
||||
}, 'immutable');
|
||||
w = y.value;
|
||||
w.x;
|
||||
w.set = {
|
||||
y: ""
|
||||
};
|
||||
w.x;
|
||||
w.set;
|
||||
w.set.x;
|
||||
expect(w.x).to.equal("dtrn");
|
||||
return expect(w.set.x).to.equal("x");
|
||||
});
|
||||
it("handles double-late-join", function() {
|
||||
var ops1, ops2, test, u1, u2;
|
||||
test = new Test("doubble");
|
||||
test.run();
|
||||
this.yTest.run();
|
||||
u1 = test.users[0];
|
||||
u2 = this.yTest.users[1];
|
||||
ops1 = u1.HB._encode();
|
||||
ops2 = u2.HB._encode();
|
||||
u1.engine.applyOps(ops2);
|
||||
u2.engine.applyOps(ops1);
|
||||
return expect(u2.value.name.val()).to.equal(u2.value.name.val());
|
||||
});
|
||||
it("can handle creaton of complex json", function() {
|
||||
this.yTest.getSomeUser().val('x', {
|
||||
'a': 'b'
|
||||
});
|
||||
this.yTest.getSomeUser().val('a', {
|
||||
'a': {
|
||||
q: "dtrndtrtdrntdrnrtdnrtdnrtdnrtdnrdnrdt"
|
||||
}
|
||||
});
|
||||
this.yTest.getSomeUser().val('b', {
|
||||
'a': {}
|
||||
});
|
||||
this.yTest.getSomeUser().val('c', {
|
||||
'a': 'c'
|
||||
});
|
||||
this.yTest.getSomeUser().val('c', {
|
||||
'a': 'b'
|
||||
});
|
||||
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");
|
||||
this.yTest.getSomeUser().val('number', 4, "immutable");
|
||||
this.yTest.getSomeUser().val('object', {
|
||||
q: "rr"
|
||||
}, "immutable");
|
||||
this.yTest.compareAll();
|
||||
expect(this.yTest.getSomeUser().val('string')).to.equal("text");
|
||||
expect(this.yTest.getSomeUser().val('number')).to.equal(4);
|
||||
return expect(this.yTest.getSomeUser().val('object').val('q')).to.equal("rr");
|
||||
});
|
||||
it("can handle many engines, many operations, concurrently (random)", function() {
|
||||
return this.yTest.run();
|
||||
});
|
||||
return it("converges t1", function() {
|
||||
var op0, op1, op2, op3, op4, op5, op6, op7, op8, ops;
|
||||
op0 = {
|
||||
"type": "Delimiter",
|
||||
"uid": {
|
||||
"creator": 0,
|
||||
"op_number": 0
|
||||
},
|
||||
"next": {
|
||||
"creator": 0,
|
||||
"op_number": 1
|
||||
}
|
||||
};
|
||||
op1 = {
|
||||
"type": "Delimiter",
|
||||
"uid": {
|
||||
"creator": 0,
|
||||
"op_number": 1
|
||||
},
|
||||
"prev": {
|
||||
"creator": 0,
|
||||
"op_number": 0
|
||||
}
|
||||
};
|
||||
op2 = {
|
||||
"type": "Word",
|
||||
"uid": {
|
||||
"creator": 0,
|
||||
"op_number": 2
|
||||
},
|
||||
"beginning": {
|
||||
"creator": 0,
|
||||
"op_number": 0
|
||||
},
|
||||
"end": {
|
||||
"creator": 0,
|
||||
"op_number": 1
|
||||
}
|
||||
};
|
||||
op3 = {
|
||||
"type": "AddName",
|
||||
"uid": {
|
||||
"creator": 0,
|
||||
"op_number": 3
|
||||
},
|
||||
"map_manager": {
|
||||
"creator": "_",
|
||||
"op_number": "_"
|
||||
},
|
||||
"name": "name"
|
||||
};
|
||||
op4 = {
|
||||
"type": "Replaceable",
|
||||
"content": {
|
||||
"creator": 0,
|
||||
"op_number": 2
|
||||
},
|
||||
"ReplaceManager": {
|
||||
"creator": "_",
|
||||
"op_number": "___RM_name"
|
||||
},
|
||||
"prev": {
|
||||
"creator": "_",
|
||||
"op_number": "___RM_name_beginning"
|
||||
},
|
||||
"next": {
|
||||
"creator": "_",
|
||||
"op_number": "___RM_name_end"
|
||||
},
|
||||
"uid": {
|
||||
"creator": 0,
|
||||
"op_number": 4
|
||||
}
|
||||
};
|
||||
op5 = {
|
||||
"type": "TextInsert",
|
||||
"content": "u",
|
||||
"uid": {
|
||||
"creator": 1,
|
||||
"op_number": 2
|
||||
},
|
||||
"prev": {
|
||||
"creator": 1,
|
||||
"op_number": 0
|
||||
},
|
||||
"next": {
|
||||
"creator": 1,
|
||||
"op_number": 1
|
||||
}
|
||||
};
|
||||
op6 = {
|
||||
"type": "TextInsert",
|
||||
"content": "w",
|
||||
"uid": {
|
||||
"creator": 2,
|
||||
"op_number": 0
|
||||
},
|
||||
"prev": {
|
||||
"creator": 0,
|
||||
"op_number": 0
|
||||
},
|
||||
"next": {
|
||||
"creator": 0,
|
||||
"op_number": 1
|
||||
}
|
||||
};
|
||||
op7 = {
|
||||
"type": "TextInsert",
|
||||
"content": "d",
|
||||
"uid": {
|
||||
"creator": 1,
|
||||
"op_number": 0
|
||||
},
|
||||
"prev": {
|
||||
"creator": 0,
|
||||
"op_number": 0
|
||||
},
|
||||
"next": {
|
||||
"creator": 2,
|
||||
"op_number": 0
|
||||
}
|
||||
};
|
||||
op8 = {
|
||||
"type": "TextInsert",
|
||||
"content": "a",
|
||||
"uid": {
|
||||
"creator": 1,
|
||||
"op_number": 1
|
||||
},
|
||||
"prev": {
|
||||
"creator": 1,
|
||||
"op_number": 0
|
||||
},
|
||||
"next": {
|
||||
"creator": 2,
|
||||
"op_number": 0
|
||||
}
|
||||
};
|
||||
ops = [op0, op1, op2, op3, op4, op5, op6, op7, op8];
|
||||
this.test_user.engine.applyOps(ops);
|
||||
return expect(this.test_user.val('name').val()).to.equal("duaw");
|
||||
});
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! Documentation</title>
|
||||
<title>Yatta! API</title>
|
||||
<script src='javascript/application.js'></script>
|
||||
<script src='javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='stylesheets/application.css' type='text/css'>
|
||||
@@ -29,64 +29,9 @@
|
||||
LICENSE.txt
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='extra/examples/README.md.html' title='examples/README.md'>
|
||||
examples/README.md
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='extra/examples/IwcJson.md.html' title='examples/IwcJson.md'>
|
||||
examples/IwcJson.md
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Class Listing A-Z</h2>
|
||||
<div class='index'>
|
||||
<ul>
|
||||
<li class='letter'>a</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/AddName.html'>
|
||||
AddName
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>d</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/Delete.html'>
|
||||
Delete
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/Delimiter.html'>
|
||||
Delimiter
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>e</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/Engine.html'>
|
||||
Engine
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>h</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/HistoryBuffer.html'>
|
||||
HistoryBuffer
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>i</li>
|
||||
<ul>
|
||||
@@ -95,29 +40,19 @@
|
||||
IwcConnector
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/Insert.html'>
|
||||
Insert
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/ImmutableObject.html'>
|
||||
ImmutableObject
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>j</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/JsonYatta.html'>
|
||||
JsonYatta
|
||||
<a href='class/JsonFramework.html'>
|
||||
JsonFramework
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/JsonWrapper.html'>
|
||||
JsonWrapper
|
||||
<a href='class/JsonTypeWrapper.html'>
|
||||
JsonTypeWrapper
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
@@ -128,46 +63,11 @@
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>l</li>
|
||||
<li class='letter'>p</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/ListManager.html'>
|
||||
ListManager
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>m</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/MapManager.html'>
|
||||
MapManager
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>o</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/Operation.html'>
|
||||
Operation
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>r</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/ReplaceManager.html'>
|
||||
ReplaceManager
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/Replaceable.html'>
|
||||
Replaceable
|
||||
<a href='class/PeerJsConnector.html'>
|
||||
PeerJsConnector
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -176,23 +76,8 @@
|
||||
<li class='letter'>t</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/TestConnector.html'>
|
||||
TestConnector
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/TextYatta.html'>
|
||||
TextYatta
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/TextDelete.html'>
|
||||
TextDelete
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='class/TextInsert.html'>
|
||||
TextInsert
|
||||
<a href='class/TextFramework.html'>
|
||||
TextFramework
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -201,8 +86,8 @@
|
||||
<li class='letter'>w</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='class/Word.html'>
|
||||
Word
|
||||
<a href='class/WordType.html'>
|
||||
WordType
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -260,14 +145,22 @@
|
||||
(lib/Connectors)
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href='file/lib/index.coffee.html'>
|
||||
index.coffee
|
||||
</a>
|
||||
<small>
|
||||
(lib)
|
||||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>j</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='file/lib/Frameworks/JsonYatta.coffee.html'>
|
||||
JsonYatta.coffee
|
||||
<a href='file/lib/Frameworks/JsonFramework.coffee.html'>
|
||||
JsonFramework.coffee
|
||||
</a>
|
||||
<small>
|
||||
(lib/Frameworks)
|
||||
@@ -283,6 +176,19 @@
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>p</li>
|
||||
<ul>
|
||||
<li>
|
||||
<a href='file/lib/Connectors/PeerJsConnector.coffee.html'>
|
||||
PeerJsConnector.coffee
|
||||
</a>
|
||||
<small>
|
||||
(lib/Connectors)
|
||||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class='letter'>s</li>
|
||||
<ul>
|
||||
@@ -308,8 +214,8 @@
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a href='file/lib/Frameworks/TextYatta.coffee.html'>
|
||||
TextYatta.coffee
|
||||
<a href='file/lib/Frameworks/TextFramework.coffee.html'>
|
||||
TextFramework.coffee
|
||||
</a>
|
||||
<small>
|
||||
(lib/Frameworks)
|
||||
@@ -342,7 +248,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
August 24, 14 01:51:08 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -1,216 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>AddName</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
AddName
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/StructuredTypes.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
types.Operation
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>When a new property in a map manager is created, then the uids of the inserted Operations
|
||||
must be unique (think about concurrent operations). Therefore only an AddName operation is allowed to
|
||||
add a property in a MapManager. If two AddName operations on the same MapManager name happen concurrently
|
||||
only one will AddName operation will be executed.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(uid, map_manager, name)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>map_manager</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Uid or reference to the MapManager. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>name</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Name of the property that will be added. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
196
doc/class/D.html
196
doc/class/D.html
@@ -1,196 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>D</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
D
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Engine.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>A simple delete-type operation.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#toJson-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>toJson</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Convert all relevant information of this operation into the json-format.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#IT-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>IT</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Operation.html#getUid-dynamic'>#getUid</a>
|
||||
<a href='../class/Operation.html#execute-dynamic'>#execute</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(creator, op_number, delete_op)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='toJson-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>toJson</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Convert all relevant information of this operation into the json-format.
|
||||
This result can be send to other clients.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='IT-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>IT</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
July 18, 14 02:21:01 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -1,160 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>DUC</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
DUC
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Engine.coffee</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>The Document Under Collaboration (abbrev. DUC) is an interface from the
|
||||
abstract data structure that the engine maintains to an actual data structure.
|
||||
TODO</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getLength-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getLength</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
get the length of the content.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(content)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getLength-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getLength</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>get the length of the content.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
July 18, 14 01:28:06 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -1,231 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>Delete</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
Delete
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/BasicTypes.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>A simple Delete-type operation that deletes an Insert-type operation.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
Convert all relevant information of this operation to the json-format.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
Apply the deletion.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Operation.html#getUid-dynamic'>#getUid</a>
|
||||
<a href='../class/Operation.html#execute-dynamic'>#execute</a>
|
||||
<a href='../class/Operation.html#saveOperation-dynamic'>#saveOperation</a>
|
||||
<a href='../class/Operation.html#validateSavedOperations-dynamic'>#validateSavedOperations</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(uid, deletes)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>deletes</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>UID or reference of the operation that this to be deleted. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Convert all relevant information of this operation to the json-format.
|
||||
This result can be sent to other clients.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Apply the deletion.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -1,265 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>Delimiter</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
Delimiter
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/BasicTypes.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>A delimiter is placed at the end and at the beginning of the associative lists.
|
||||
This is necessary in order to have a beginning and an end even if the content
|
||||
of the Engine is empty.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#isDeleted-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>isDeleted</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
If isDeleted() is true this operation won't be maintained in the sl
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Operation.html#getUid-dynamic'>#getUid</a>
|
||||
<a href='../class/Operation.html#execute-dynamic'>#execute</a>
|
||||
<a href='../class/Operation.html#saveOperation-dynamic'>#saveOperation</a>
|
||||
<a href='../class/Operation.html#validateSavedOperations-dynamic'>#validateSavedOperations</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(uid, prev_cl, next_cl, origin)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>prev_cl</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The predecessor of this operation in the complete-list (cl) </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>next_cl</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The successor of this operation in the complete-list (cl) </span>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='HistoryBuffer.getNextOperationIdentifier'>HistoryBuffer.getNextOperationIdentifier</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='isDeleted-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>isDeleted</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>If isDeleted() is true this operation won't be maintained in the sl</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -1,289 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>Engine</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
Engine
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Engine.coffee</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>The Engine handles how and in which order to execute operations and add operations to the HistoryBuffer.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#parseOperation-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>parseOperation</b><span>(json)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Parses an operatio from the json format.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#applyOpsBundle-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOpsBundle</b><span>(ops_json)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Apply a set of operations.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#applyOpsCheckDouble-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOpsCheckDouble</b><span>(ops_json)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#applyOps-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOps</b><span>(ops_json)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Apply a set of operations.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#applyOp-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOp</b><span>(op_json)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Apply an operation that you received from another peer.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#tryUnprocessed-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>tryUnprocessed</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Call this method when you applied a new operation.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(HB, parser)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='parseOperation-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>parseOperation</b><span>(json)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Parses an operatio from the json format. It uses the specified parser in your OperationType module.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='applyOpsBundle-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOpsBundle</b><span>(ops_json)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<div class='note'>
|
||||
<strong>Note:</strong>
|
||||
You must not use this method when you already have ops in your HB!
|
||||
</div>
|
||||
<p>Apply a set of operations. E.g. the operations you received from another users HB.toJson().</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='applyOpsCheckDouble-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOpsCheckDouble</b><span>(ops_json)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='applyOps-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOps</b><span>(ops_json)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Apply a set of operations. (Helper for using applyOp on Arrays)</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='Engine.applyOp'>Engine.applyOp</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='applyOp-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyOp</b><span>(op_json)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Apply an operation that you received from another peer.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='tryUnprocessed-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>tryUnprocessed</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Call this method when you applied a new operation.
|
||||
It checks if operations that were previously not executable are now executable.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
402
doc/class/I.html
402
doc/class/I.html
@@ -1,402 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>I</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
I
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Engine.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>A simple insert-type operation.</p><p>An insert operation is always positioned between two other insert operations.
|
||||
Internally this is realized as associative lists, whereby each insert operation has a predecessor and a successor.
|
||||
For the sake of efficiency we maintain two lists: - The short-list (abbrev. sl) maintains only the operations that are not deleted - The complete-list (abbrev. cl) maintains all operations</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class='children'>
|
||||
<a href='../class/Delimiter.html'>Delimiter</a>
|
||||
</p>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getLength-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getLength</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Retrieve the effective length of the $content of this operation.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#isDeleted-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>isDeleted</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
If isDeleted() is true this operation won't be maintained in the sl
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getDistanceToOrigin-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getDistanceToOrigin</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
The amount of positions that this operation was moved to the right.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#update_sl-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>update_sl</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Update the short list TODO
|
||||
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#toJson-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>toJson</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Convert all relevant information of this operation into the json-format.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>(current_position)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
The result will be concatenated with the results from the other insert operations in order to retrieve the content of the engine.
|
||||
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#IT-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>IT</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Include this operation in the associative lists.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Operation.html#getUid-dynamic'>#getUid</a>
|
||||
<a href='../class/Operation.html#execute-dynamic'>#execute</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(content, creator, op_number, prev_cl, next_cl)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>content</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Value</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The value of the insert operation. E.g. for strings content is a char. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>creator</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique user identifier </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>op_number</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Integer</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>This Number was assigned via getOperationCounter(). </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>prev_cl</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The predecessor of this operation in the complete-list (cl) </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>next_cl</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The successor of this operation in the complete-list (cl) </span>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='HistoryBuffer.getOperationCounter'>HistoryBuffer.getOperationCounter</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getLength-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getLength</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Retrieve the effective length of the $content of this operation.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='isDeleted-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>isDeleted</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>If isDeleted() is true this operation won't be maintained in the sl</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getDistanceToOrigin-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getDistanceToOrigin</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>The amount of positions that this operation was moved to the right.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='update_sl-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>update_sl</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Update the short list
|
||||
TODO</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='toJson-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>toJson</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Convert all relevant information of this operation into the json-format.
|
||||
This result can be send to other clients.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>(current_position)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>The result will be concatenated with the results from the other insert operations
|
||||
in order to retrieve the content of the engine.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='HistoryBuffer.toExecutedArray'>HistoryBuffer.toExecutedArray</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='IT-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>IT</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Include this operation in the associative lists. (For historical reasons IT - Inclusion Transformation)</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
July 18, 14 02:21:01 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -1,230 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>ImmutableObject</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
ImmutableObject
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/BasicTypes.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Insert.html'>Insert</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>Defines an object that is cannot be changed. You can use this to set an immutable string, or a number.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#val-dynamic'>
|
||||
#
|
||||
(String)
|
||||
<b>val</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Insert.html'>Insert</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Insert.html#applyDelete-dynamic'>#applyDelete</a>
|
||||
<a href='../class/Insert.html#isDeleted-dynamic'>#isDeleted</a>
|
||||
<a href='../class/Insert.html#getDistanceToOrigin-dynamic'>#getDistanceToOrigin</a>
|
||||
<a href='../class/Insert.html#update_sl-dynamic'>#update_sl</a>
|
||||
<a href='../class/Insert.html#execute-dynamic'>#execute</a>
|
||||
<a href='../class/Operation.html#getUid-dynamic'>#getUid</a>
|
||||
<a href='../class/Operation.html#saveOperation-dynamic'>#saveOperation</a>
|
||||
<a href='../class/Operation.html#validateSavedOperations-dynamic'>#validateSavedOperations</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(uid, content, prev, next, origin)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>content</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='val-dynamic'>
|
||||
#
|
||||
(String)
|
||||
<b>val</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Returns:</h3>
|
||||
<ul class='return'>
|
||||
<li>
|
||||
<span class='type'></span>
|
||||
(
|
||||
<tt>String</tt>
|
||||
)
|
||||
—
|
||||
<span class='desc'>The content of this operation. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -1,329 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>Insert</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
Insert
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/BasicTypes.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>A simple insert-type operation.</p><p>An insert operation is always positioned between two other insert operations.
|
||||
Internally this is realized as associative lists, whereby each insert operation has a predecessor and a successor.
|
||||
For the sake of efficiency we maintain two lists: - The short-list (abbrev. sl) maintains only the operations that are not deleted - The complete-list (abbrev. cl) maintains all operations</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class='children'>
|
||||
<a href='../class/ImmutableObject.html'>ImmutableObject</a>
|
||||
</p>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#applyDelete-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyDelete</b><span>(o)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#isDeleted-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>isDeleted</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
If isDeleted() is true this operation won't be maintained in the sl
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getDistanceToOrigin-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getDistanceToOrigin</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
The amount of positions that $this operation was moved to the right.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#update_sl-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>update_sl</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
Update the short list TODO (Unused)
|
||||
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
Include this operation in the associative lists.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Operation.html#getUid-dynamic'>#getUid</a>
|
||||
<a href='../class/Operation.html#execute-dynamic'>#execute</a>
|
||||
<a href='../class/Operation.html#saveOperation-dynamic'>#saveOperation</a>
|
||||
<a href='../class/Operation.html#validateSavedOperations-dynamic'>#validateSavedOperations</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(uid, prev_cl, next_cl, origin)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>prev_cl</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The predecessor of this operation in the complete-list (cl) </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>next_cl</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The successor of this operation in the complete-list (cl) </span>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='HistoryBuffer.getNextOperationIdentifier'>HistoryBuffer.getNextOperationIdentifier</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='applyDelete-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>applyDelete</b><span>(o)</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='isDeleted-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>isDeleted</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>If isDeleted() is true this operation won't be maintained in the sl</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getDistanceToOrigin-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getDistanceToOrigin</b><span>()</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>The amount of positions that $this operation was moved to the right.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='update_sl-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>update_sl</b><span>()</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Update the short list
|
||||
TODO (Unused)</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Include this operation in the associative lists.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! Documentation</title>
|
||||
<title>Yatta! API</title>
|
||||
<script src='../javascript/application.js'></script>
|
||||
<script src='../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
|
||||
@@ -35,7 +35,7 @@
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>The Iwc Connector adds support for the Inter-Widget-Communication protocol that is used in the Role-SDK.</p>
|
||||
<p>The Iwc Connector adds support for the Inter-Widget-Communication protocol that is used in the Role-SDK.</p><p>You must not use your own IWC client when using this connector!!</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
@@ -50,6 +50,30 @@
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#setIwcHandler-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>setIwcHandler</b><span>(f)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Set your own IWC handler.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#sendIwcIntent-dynamic'>
|
||||
~
|
||||
(void)
|
||||
<b>sendIwcIntent intent</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Helper for sending iwc intents.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#send-dynamic'>
|
||||
@@ -58,7 +82,9 @@
|
||||
<b>send</b><span>(o)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
This function is called whenever an operation was executed.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
@@ -69,29 +95,9 @@
|
||||
<b>receive</b><span>(o)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#sendIwcIntent-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>sendIwcIntent</b><span>(action_name, content)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#sync-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>sync</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
This function is called whenever an operation was received from another peer.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -104,51 +110,199 @@
|
||||
<b>constructor</b><span>(engine, HB, execution_listener, yatta)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>engine</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Engine</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The transformation engine </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>HB</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>HistoryBuffer</tt>
|
||||
)
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>execution_listener</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Array<Function></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>You must ensure that whenever an operation is executed, every function in this Array is called. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>yatta</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>YattaFramework</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The Yatta framework. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='setIwcHandler-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>setIwcHandler</b><span>(f)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Set your own IWC handler. It will be called after Yatta consumed the
|
||||
data from the received intent.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='sendIwcIntent-dynamic'>
|
||||
~
|
||||
(void)
|
||||
<b>sendIwcIntent intent</b><span>()</span>
|
||||
<br>
|
||||
~
|
||||
(void)
|
||||
<b>sendIwcIntent action_name, content</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Helper for sending iwc intents.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<div class='overloads'>
|
||||
<h3>Overloads:</h3>
|
||||
<div class='overload'>
|
||||
<p class='signature'>
|
||||
~
|
||||
(void)
|
||||
<b>sendIwcIntent intent</b><span>()</span>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>intent</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The intent object. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='overload'>
|
||||
<p class='signature'>
|
||||
~
|
||||
(void)
|
||||
<b>sendIwcIntent action_name, content</b><span>()</span>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>action_name</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The name of the action that is going to be send. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>content</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The content that is atteched to the intent. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='send-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>send</b><span>(o)</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='docstring'>
|
||||
<p>This function is called whenever an operation was executed.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>o</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Operation</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The operation that was executed. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='receive-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>receive</b><span>(o)</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='sendIwcIntent-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>sendIwcIntent</b><span>(action_name, content)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='sync-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>sync</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='docstring'>
|
||||
<p>This function is called whenever an operation was received from another peer.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>o</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Operation</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The operation that was received. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
August 24, 14 01:51:08 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! Documentation</title>
|
||||
<title>Yatta! API</title>
|
||||
<script src='../javascript/application.js'></script>
|
||||
<script src='../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
|
||||
@@ -19,32 +19,79 @@
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>HistoryBuffer</span>
|
||||
<span class='title'>JsonFramework</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
HistoryBuffer
|
||||
JsonFramework
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/HistoryBuffer.coffee</td>
|
||||
<td>lib/Frameworks/JsonFramework.coffee</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<div class='note'>
|
||||
<strong>Note:</strong>
|
||||
The HistoryBuffer is commonly abbreviated to HB.
|
||||
</div>
|
||||
<p>An object that holds all applied operations.</p>
|
||||
<p>Framework for Json data-structures.
|
||||
Known values that are supported:</p><ul>
|
||||
<li>String</li>
|
||||
<li>Integer</li>
|
||||
<li>Array</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getSharedObject-dynamic'>
|
||||
#
|
||||
(?)
|
||||
<b>getSharedObject</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getConnector-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getConnector</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Get the initialized connector.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getHistoryBuffer-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getHistoryBuffer</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#setMutableDefault-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>setMutableDefault</b><span>(mutable)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getUserId-dynamic'>
|
||||
@@ -54,39 +101,15 @@
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Get the user id with wich the History Buffer was initialized.
|
||||
Get the UserId from the HistoryBuffer object.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getReservedUniqueIdentifier-dynamic'>
|
||||
<a href='#toJson-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getReservedUniqueIdentifier</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
There is only one reserved unique identifier (uid), so use it wisely.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getOperationCounter-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getOperationCounter</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Get the operation counter that describes the current state of the document.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>(state_vector = {})</span>
|
||||
<b>toJson</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
@@ -94,38 +117,35 @@
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getNextOperationIdentifier-dynamic'>
|
||||
<a href='#val-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getNextOperationIdentifier</b><span>(user_id)</span>
|
||||
<b>val</b><span>(name, content, mutable)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Get the number of operations that were created by a user.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getOperation-dynamic'>
|
||||
<a href='#on-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getOperation</b><span>(uid)</span>
|
||||
<b>on</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Retrieve an operation from a unique id.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#addOperation-dynamic'>
|
||||
<a href='#deleteListener-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>addOperation</b><span>(o)</span>
|
||||
<b>deleteListener</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Add an operation to the HB.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -135,24 +155,31 @@
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(user_id)</span>
|
||||
<b>constructor</b><span>(user_id, Connector)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Creates an empty HB.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>user_id</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
<tt>String</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Creator of the HB. </span>
|
||||
<span class='desc'>Unique id of the peer. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>Connector</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Connector</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>the connector class. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -160,6 +187,72 @@
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getSharedObject-dynamic'>
|
||||
#
|
||||
(?)
|
||||
<b>getSharedObject</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Returns:</h3>
|
||||
<ul class='return'>
|
||||
<li>
|
||||
<span class='type'></span>
|
||||
(
|
||||
<tt>?</tt>
|
||||
)
|
||||
—
|
||||
<span class='desc'>JsonType </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getConnector-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getConnector</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Get the initialized connector.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getHistoryBuffer-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getHistoryBuffer</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='HistoryBuffer'>HistoryBuffer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='setMutableDefault-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>setMutableDefault</b><span>(mutable)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='JsonType.setMutableDefault'>JsonType.setMutableDefault</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getUserId-dynamic'>
|
||||
#
|
||||
@@ -168,95 +261,81 @@
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Get the user id with wich the History Buffer was initialized.</p>
|
||||
<p>Get the UserId from the HistoryBuffer object.
|
||||
In most cases this will be the same as the user_id value with which
|
||||
JsonFramework was initialized (Depending on the HistoryBuffer implementation).</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getReservedUniqueIdentifier-dynamic'>
|
||||
<p class='signature' id='toJson-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getReservedUniqueIdentifier</b><span>()</span>
|
||||
<b>toJson</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>There is only one reserved unique identifier (uid), so use it wisely.
|
||||
I propose to use it in your Framework, to create something like a root element.
|
||||
An operation with this identifier is not propagated to other clients.
|
||||
This is why everybode must create the same operation with this uid.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='JsonType.toJson'>JsonType.toJson</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getOperationCounter-dynamic'>
|
||||
<p class='signature' id='val-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getOperationCounter</b><span>()</span>
|
||||
<b>val</b><span>(name, content, mutable)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Get the operation counter that describes the current state of the document.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='JsonType.val'>JsonType.val</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='_encode-dynamic'>
|
||||
<p class='signature' id='on-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>(state_vector = {})</span>
|
||||
<b>on</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getNextOperationIdentifier-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getNextOperationIdentifier</b><span>(user_id)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Get the number of operations that were created by a user.
|
||||
Accordingly you will get the next operation number that is expected from that user.
|
||||
This will increment the operation counter.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='Operation.on'>Operation.on</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getOperation-dynamic'>
|
||||
<p class='signature' id='deleteListener-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getOperation</b><span>(uid)</span>
|
||||
<b>deleteListener</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Retrieve an operation from a unique id.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='addOperation-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>addOperation</b><span>(o)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Add an operation to the HB. Note that this will not link it against
|
||||
other operations (it wont executed)</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='Operation.deleteListener'>Operation.deleteListener</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
August 24, 14 01:51:08 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! Documentation</title>
|
||||
<title>Yatta! API</title>
|
||||
<script src='../javascript/application.js'></script>
|
||||
<script src='../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
|
||||
@@ -47,17 +47,80 @@
|
||||
</div>
|
||||
<h2>Variables Summary</h2>
|
||||
<dl class='constants'>
|
||||
<dt id='type-variable'>
|
||||
type
|
||||
=
|
||||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>"JsonType"</code></pre>
|
||||
<div class='docstring'>
|
||||
<p>Identifies this class.
|
||||
Use it to check whether this is a json-type or something else.</p>
|
||||
<div class='examples'>
|
||||
<h3>Examples:</h3>
|
||||
<h4>
|
||||
|
||||
</h4>
|
||||
<pre><code class='coffeescript'>var x = yatta.val('unknown')
|
||||
if (x.type === "JsonType") {
|
||||
console.log JSON.stringify(x.toJson())
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</dd>
|
||||
<dt id='mutable_default-variable'>
|
||||
mutable_default
|
||||
=
|
||||
</dt>
|
||||
<dd>
|
||||
<pre><code class='coffeescript'>true</code></pre>
|
||||
|
||||
<div class='docstring'>
|
||||
<p>Whether the default is 'mutable' (true) or 'immutable' (false)</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#toJson-dynamic'>
|
||||
#
|
||||
(Json)
|
||||
<b>toJson</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Transform this to a Json and loose all the sharing-abilities (the new object will be a deep clone)!
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#setReplaceManager-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>setReplaceManager</b><span>(rm)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Sets the parent of this JsonType object.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getParent-dynamic'>
|
||||
#
|
||||
(JsonType)
|
||||
<b>getParent</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Get the parent of this JsonType.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#setMutableDefault-dynamic'>
|
||||
@@ -67,6 +130,7 @@
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Set if the default is 'mutable' or 'immutable'
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
@@ -141,6 +205,65 @@
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='toJson-dynamic'>
|
||||
#
|
||||
(Json)
|
||||
<b>toJson</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Transform this to a Json and loose all the sharing-abilities (the new object will be a deep clone)!</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>Returns:</h3>
|
||||
<ul class='return'>
|
||||
<li>
|
||||
<span class='type'></span>
|
||||
<tt>Json</tt>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='setReplaceManager-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>setReplaceManager</b><span>(rm)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Sets the parent of this JsonType object.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='WordType.setReplaceManager'>WordType.setReplaceManager</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getParent-dynamic'>
|
||||
#
|
||||
(JsonType)
|
||||
<b>getParent</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Get the parent of this JsonType.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>Returns:</h3>
|
||||
<ul class='return'>
|
||||
<li>
|
||||
<span class='type'></span>
|
||||
<tt><a href='../class/JsonType.html'>JsonType</a></tt>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='setMutableDefault-dynamic'>
|
||||
#
|
||||
@@ -148,7 +271,24 @@
|
||||
<b>setMutableDefault</b><span>(mutable)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='docstring'>
|
||||
<p>Set if the default is 'mutable' or 'immutable'</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>mutable</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String|Boolean</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Set either 'mutable' / true or 'immutable' / false </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='val-dynamic'>
|
||||
@@ -157,7 +297,7 @@
|
||||
<b>val</b><span>()</span>
|
||||
<br>
|
||||
~
|
||||
(JsonType|Word|String|Object)
|
||||
(JsonType|WordType|String|Object)
|
||||
<b>val</b><span>(name)</span>
|
||||
<br>
|
||||
~
|
||||
@@ -190,7 +330,7 @@
|
||||
<div class='overload'>
|
||||
<p class='signature'>
|
||||
~
|
||||
(JsonType|Word|String|Object)
|
||||
(JsonType|WordType|String|Object)
|
||||
<b>val</b><span>(name)</span>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
@@ -215,7 +355,7 @@
|
||||
<li>
|
||||
<span class='type'></span>
|
||||
(
|
||||
<tt>JsonType|Word|String|Object</tt>
|
||||
<tt>JsonType|WordType|String|Object</tt>
|
||||
)
|
||||
—
|
||||
<span class='desc'>Depending on the value of the property. If mutable it will return a Operation-type object, if immutable it will return String/Object. </span>
|
||||
@@ -286,7 +426,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
August 24, 14 01:51:08 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
213
doc/class/JsonTypeWrapper.html
Normal file
213
doc/class/JsonTypeWrapper.html
Normal file
@@ -0,0 +1,213 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! API</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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>JsonTypeWrapper</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
JsonTypeWrapper
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/JsonTypes.coffee</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<div class='note'>
|
||||
<strong>Note:</strong>
|
||||
EXPERIMENTAL
|
||||
</div>
|
||||
<div class='note'>
|
||||
<strong>Note:</strong>
|
||||
You can only overwrite existing values! Setting a new property won't have any effect!
|
||||
</div>
|
||||
<p>A JsonTypeWrapper was intended to be a convenient wrapper for the JsonType.
|
||||
But it can make things more difficult than they are.</p><p>It creates Javascripts -getter and -setter methods for each property that JsonType maintains.</p><p>In order to set a new property you have to overwrite an existing property.
|
||||
Therefore the JsonTypeWrapper supports a special feature that should make things more convenient
|
||||
(we can argue about that, use the JsonType if you don't like it ;).
|
||||
If you overwrite an object property of the JsonTypeWrapper with a new object, it will result in a merged version of the objects.
|
||||
Let <code>yatta.value.p</code> the property that is to be overwritten and o the new value. E.g. <code>yatta.value.p = o</code></p><ul>
|
||||
<li>The result has all properties of o</li>
|
||||
<li>The result has all properties of w.p if they don't occur under the same property-name in o.</li>
|
||||
</ul>
|
||||
|
||||
<div class='examples'>
|
||||
<h3>Examples:</h3>
|
||||
<h4>
|
||||
create a JsonTypeWrapper
|
||||
</h4>
|
||||
<pre><code class='coffeescript'># You get a JsonTypeWrapper from a JsonType by calling
|
||||
w = yatta.value</code></pre>
|
||||
<h4>
|
||||
Getter Example
|
||||
</h4>
|
||||
<pre><code class='coffeescript'># you can access the x property of yatta by calling
|
||||
w.x
|
||||
# instead of
|
||||
yatta.val('x')</code></pre>
|
||||
<h4>
|
||||
Setter Example
|
||||
</h4>
|
||||
<pre><code class='coffeescript'># you can set an existing x property of yatta by calling
|
||||
w.x = "text"
|
||||
# instead of
|
||||
yatta.val('x', "text")</code></pre>
|
||||
<h4>
|
||||
Conflict Example
|
||||
</h4>
|
||||
<pre><code class='coffeescript'>yatta.value = {a : "string"}
|
||||
w = yatta.value
|
||||
console.log(w) # {a : "string"}
|
||||
w.a = {a : {b : "string"}}
|
||||
console.log(w) # {a : {b : "String"}}
|
||||
w.a = {a : {c : 4}}
|
||||
console.log(w) # {a : {b : "String", c : 4}}</code></pre>
|
||||
<h4>
|
||||
Common Pitfalls
|
||||
</h4>
|
||||
<pre><code class='coffeescript'>w = yatta.value
|
||||
# Setting a new property
|
||||
w.newProperty = "Awesome"
|
||||
console.log(w.newProperty == "Awesome") # false, w.newProperty is undefined
|
||||
# overwrite the w object
|
||||
w = {newProperty : "Awesome"}
|
||||
console.log(w.newProperty == "Awesome") # true!, but ..
|
||||
console.log(yatta.value.newProperty == "Awesome") # false, you are only allowed to set properties!
|
||||
# The solution
|
||||
yatta.value = {newProperty : "Awesome"}
|
||||
console.log(w.newProperty == "Awesome") # true!</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='../class/JsonType.html'>JsonType</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty'>https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(jsonType)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>jsonType</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/JsonType.html'>JsonType</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Instance of the JsonType that this class wrappes. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 24, 14 01:51:08 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! Documentation</title>
|
||||
<title>Yatta! API</title>
|
||||
<script src='../javascript/application.js'></script>
|
||||
<script src='../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
|
||||
@@ -35,6 +35,10 @@
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<div class='note'>
|
||||
<strong>Note:</strong>
|
||||
EXPERIMENTAL
|
||||
</div>
|
||||
<div class='note'>
|
||||
<strong>Note:</strong>
|
||||
You can only overwrite existing values! Setting a new property won't have any effect!
|
||||
@@ -44,7 +48,7 @@ But it can make things more difficult than they are.</p><p>It creates Javascript
|
||||
Therefore the JsonWrapper supports a special feature that should make things more convenient
|
||||
(we can argue about that, use the JsonType if you don't like it ;).
|
||||
If you overwrite an object property of the JsonWrapper with a new object, it will result in a merged version of the objects.
|
||||
Let w.p the property that is to be overwritten and o the new value. E.g. w.p = o</p><ul>
|
||||
Let <code>yatta.value.p</code> the property that is to be overwritten and o the new value. E.g. <code>yatta.value.p = o</code></p><ul>
|
||||
<li>The result has all properties of o</li>
|
||||
<li>The result has all properties of w.p if they don't occur under the same property-name in o.</li>
|
||||
</ul>
|
||||
@@ -116,12 +120,26 @@ console.log(w.newProperty == "Awesome") # true!</code></pre>
|
||||
<b>constructor</b><span>(jsonType)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>jsonType</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/JsonType.html'>JsonType</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Instance of the JsonType that this class wrappes. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
August 23, 14 21:38:13 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! Documentation</title>
|
||||
<title>Yatta! API</title>
|
||||
<script src='../javascript/application.js'></script>
|
||||
<script src='../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
|
||||
@@ -49,22 +49,10 @@ Known values that are supported:</p><ul>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getRootElement-dynamic'>
|
||||
<a href='#getSharedObject-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getRootElement</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
@result JsonType
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getEngine-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getEngine</b><span>()</span>
|
||||
(?)
|
||||
<b>getSharedObject</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
@@ -116,6 +104,17 @@ Known values that are supported:</p><ul>
|
||||
Get the UserId from the HistoryBuffer object.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#toJson-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>toJson</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#val-dynamic'>
|
||||
@@ -127,6 +126,28 @@ Known values that are supported:</p><ul>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#on-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>on</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#deleteListener-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>deleteListener</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
@@ -137,36 +158,52 @@ Known values that are supported:</p><ul>
|
||||
<b>constructor</b><span>(user_id, Connector)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>user_id</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Unique id of the peer. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>Connector</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Connector</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>the connector class. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getRootElement-dynamic'>
|
||||
<p class='signature' id='getSharedObject-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getRootElement</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>@result JsonType</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getEngine-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getEngine</b><span>()</span>
|
||||
(?)
|
||||
<b>getSharedObject</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<h3>Returns:</h3>
|
||||
<ul class='return'>
|
||||
<li>
|
||||
<a href='../class/Engine.html'>Engine</a>
|
||||
<span class='type'></span>
|
||||
(
|
||||
<tt>?</tt>
|
||||
)
|
||||
—
|
||||
<span class='desc'>JsonType </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -195,7 +232,7 @@ Known values that are supported:</p><ul>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='../class/HistoryBuffer.html'>HistoryBuffer</a>
|
||||
<a href='HistoryBuffer'>HistoryBuffer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -229,6 +266,22 @@ In most cases this will be the same as the user_id value with which
|
||||
JsonYatta was initialized (Depending on the HistoryBuffer implementation).</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='toJson-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>toJson</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='JsonType.toJson'>JsonType.toJson</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
@@ -245,12 +298,44 @@ JsonYatta was initialized (Depending on the HistoryBuffer implementation).</p>
|
||||
<a href='JsonType.val'>JsonType.val</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='on-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>on</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='Operation.on'>Operation.on</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='deleteListener-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>deleteListener</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='Operation.deleteListener'>Operation.deleteListener</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
August 23, 14 21:18:25 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -1,282 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>ListManager</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
ListManager
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/StructuredTypes.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
types.Insert
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>Manages a list of Insert-type operations.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class='children'>
|
||||
<a href='../class/ReplaceManager.html'>ReplaceManager</a>
|
||||
</p>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getLastOperation-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getLastOperation</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Get the element previous to the delemiter at the end
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getFirstOperation-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getFirstOperation</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
similar to the above
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#toArray-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>toArray</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Transforms the the list to an array Doesn't return left-right delimiter.
|
||||
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getOperationByPosition-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getOperationByPosition</b><span>(position)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Retrieves the x-th not deleted element.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(uid, beginning, end, prev, next, origin)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>A ListManager maintains a non-empty list that has a beginning and an end (both Delimiters!)</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>beginning</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Delimiter.html'>Delimiter</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Reference or Object. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>end</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Delimiter.html'>Delimiter</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Reference or Object. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getLastOperation-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getLastOperation</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Get the element previous to the delemiter at the end</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getFirstOperation-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getFirstOperation</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>similar to the above</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='toArray-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>toArray</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Transforms the the list to an array
|
||||
Doesn't return left-right delimiter.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getOperationByPosition-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getOperationByPosition</b><span>(position)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Retrieves the x-th not deleted element.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -1,359 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>Operation</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
Operation
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/BasicTypes.coffee</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>A generic interface to operations.</p><p>An operation has the following methods:
|
||||
_encode: encodes an operation (needed only if instance of this operation is sent).
|
||||
execute: execute the effects of this operations. Good examples are Insert-type and AddName-type
|
||||
val: in the case that the operation holds a value</p><p>Furthermore an encodable operation has a parser.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<p class='children'>
|
||||
<a href='../class/Delete.html'>Delete</a>
|
||||
<a href='../class/Insert.html'>Insert</a>
|
||||
<a href='../class/Delimiter.html'>Delimiter</a>
|
||||
</p>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getUid-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getUid</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Computes a unique identifier (uid) that identifies this operation.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
Notify the all the listeners.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#saveOperation-dynamic'>
|
||||
~
|
||||
(void)
|
||||
<b>saveOperation</b><span>(name, op_uid)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
Operations may depend on other operations (linked lists, etc.).
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#validateSavedOperations-dynamic'>
|
||||
#
|
||||
(Boolean)
|
||||
<b>validateSavedOperations</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='note private title'>Private</span>
|
||||
<span class='desc'>
|
||||
After calling this function all not instantiated operations will be accessible.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(uid)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='HistoryBuffer.getNextOperationIdentifier'>HistoryBuffer.getNextOperationIdentifier</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getUid-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getUid</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Computes a unique identifier (uid) that identifies this operation.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Notify the all the listeners.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='saveOperation-dynamic'>
|
||||
~
|
||||
(void)
|
||||
<b>saveOperation</b><span>(name, op_uid)</span>
|
||||
<br>
|
||||
~
|
||||
(void)
|
||||
<b>saveOperation</b><span>(name, op)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Operations may depend on other operations (linked lists, etc.).
|
||||
The saveOperation and validateSavedOperations methods provide
|
||||
an easy way to refer to these operations via an uid or object reference.</p><p>For example: We can create a new Delete operation that deletes the operation $o like this</p><pre><code>- var d = new Delete(uid, $o); or
|
||||
- var d = new Delete(uid, $o.getUid());
|
||||
</code></pre><p>Either way we want to access $o via d.deletes. In the second case validateSavedOperations must be called first.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<div class='overloads'>
|
||||
<h3>Overloads:</h3>
|
||||
<div class='overload'>
|
||||
<p class='signature'>
|
||||
~
|
||||
(void)
|
||||
<b>saveOperation</b><span>(name, op_uid)</span>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>name</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The name of the operation. After validating (with validateSavedOperations) the instantiated operation will be accessible via this[name]. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>op_uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A uid that refers to an operation </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='overload'>
|
||||
<p class='signature'>
|
||||
~
|
||||
(void)
|
||||
<b>saveOperation</b><span>(name, op)</span>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>name</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The name of the operation. After calling this function op is accessible via this[name]. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>op</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>An Operation object </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='validateSavedOperations-dynamic'>
|
||||
#
|
||||
(Boolean)
|
||||
<b>validateSavedOperations</b><span>()</span>
|
||||
<span class='note private'>Private</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>After calling this function all not instantiated operations will be accessible.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>Returns:</h3>
|
||||
<ul class='return'>
|
||||
<li>
|
||||
<span class='type'></span>
|
||||
(
|
||||
<tt>Boolean</tt>
|
||||
)
|
||||
—
|
||||
<span class='desc'>Whether it was possible to instantiate all operations. </span>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='Operation.saveOperation'>Operation.saveOperation</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! Documentation</title>
|
||||
<title>Yatta! API</title>
|
||||
<script src='../javascript/application.js'></script>
|
||||
<script src='../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
|
||||
@@ -19,69 +19,69 @@
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>TextInsert</span>
|
||||
<span class='title'>PeerJsConnector</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
TextInsert
|
||||
PeerJsConnector
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/TextTypes.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
types.Insert
|
||||
</td>
|
||||
<td>lib/Connectors/PeerJsConnector.coffee</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>Extends the basic Insert type to an operation that holds a text value</p>
|
||||
<p>PeerJs is a Framework that enables you to connect to other peers. You just need the
|
||||
user-id of the peer (browser/client). And then you can connect to it.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='http://peerjs.com'>http://peerjs.com</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getLength-dynamic'>
|
||||
<a href='#connectToPeer-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getLength</b><span>()</span>
|
||||
<b>connectToPeer</b><span>(id)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Retrieve the effective length of the $content of this operation.
|
||||
Connect the Framework to another peer.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#val-dynamic'>
|
||||
<a href='#getAllConnectionIds-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>val</b><span>(current_position)</span>
|
||||
(Array<String>)
|
||||
<b>getAllConnectionIds</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
The result will be concatenated with the results from the other insert operations in order to retrieve the content of the engine.
|
||||
|
||||
Receive the id of every connected peer.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#_encode-dynamic'>
|
||||
<a href='#addConnection-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
<b>addConnection</b><span>(conn)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Convert all relevant information of this operation to the json-format.
|
||||
Adds an existing connection to this connector.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -91,31 +91,49 @@
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(content, uid, prev, next, origin)</span>
|
||||
<b>constructor</b><span>(engine, HB, execution_listener, yatta)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>content</span>
|
||||
<span class='name'>engine</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String</tt>
|
||||
<tt>Engine</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The content of this Insert-type Operation. Usually you restrict the length of content to size 1 </span>
|
||||
<span class='desc'>The transformation engine </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='name'>HB</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
<tt>HistoryBuffer</tt>
|
||||
)
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>execution_listener</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Array<Function></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
<span class='desc'>You must ensure that whenever an operation is executed, every function in this Array is called. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>yatta</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Yatta</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The Yatta framework. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -124,56 +142,87 @@
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getLength-dynamic'>
|
||||
<p class='signature' id='connectToPeer-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getLength</b><span>()</span>
|
||||
<b>connectToPeer</b><span>(id)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Retrieve the effective length of the $content of this operation.</p>
|
||||
<p>Connect the Framework to another peer. Therefore you have to receive his
|
||||
user_id. If the other peer is connected to other peers, the PeerJsConnector
|
||||
will automatically connect to them too.</p><p>Transmitting the user_id is your job.
|
||||
See <a href="../../examples/TextEditing/">TextEditing</a> for a nice example
|
||||
on how to do that with urls.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='val-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>val</b><span>(current_position)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>The result will be concatenated with the results from the other insert operations
|
||||
in order to retrieve the content of the engine.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<a href='HistoryBuffer.toExecutedArray'>HistoryBuffer.toExecutedArray</a>
|
||||
<span class='name'>id</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Connection id </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='_encode-dynamic'>
|
||||
<p class='signature' id='getAllConnectionIds-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
(Array<String>)
|
||||
<b>getAllConnectionIds</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Convert all relevant information of this operation to the json-format.
|
||||
This result can be send to other clients.</p>
|
||||
<p>Receive the id of every connected peer.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>Returns:</h3>
|
||||
<ul class='return'>
|
||||
<li>
|
||||
<span class='type'></span>
|
||||
(
|
||||
<tt>Array<String></tt>
|
||||
)
|
||||
—
|
||||
<span class='desc'>A list of Peer-Ids </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='addConnection-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>addConnection</b><span>(conn)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Adds an existing connection to this connector.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>conn</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>PeerJsConnection</tt>
|
||||
)
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
August 24, 14 01:51:08 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
@@ -1,164 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>Replacable</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
Replacable
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Engine.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Operation.html#getUid-dynamic'>#getUid</a>
|
||||
<a href='../class/Operation.html#execute-dynamic'>#execute</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(content, creator, op_number, previous)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
July 18, 14 01:28:06 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -1,263 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>ReplaceManager</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
ReplaceManager
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Types/StructuredTypes.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/ListManager.html'>ListManager</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>Adds support for replace. The ReplaceManager manages Replaceable operations.
|
||||
Each Replaceable holds a value that is now replaceable.</p><p>The Word-type has implemented support for replace</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='../class/Word.html'>Word</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#replace-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>replace</b><span>(content)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#val-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>val</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/ListManager.html'>ListManager</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/ListManager.html#getLastOperation-dynamic'>#getLastOperation</a>
|
||||
<a href='../class/ListManager.html#getFirstOperation-dynamic'>#getFirstOperation</a>
|
||||
<a href='../class/ListManager.html#toArray-dynamic'>#toArray</a>
|
||||
<a href='../class/ListManager.html#getOperationByPosition-dynamic'>#getOperationByPosition</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(initial_content, uid, beginning, end, prev, next, origin)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>initial_content</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Initialize this with a Replaceable that holds the initial_content. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>uid</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Object</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>A unique identifier. If uid is undefined, a new uid will be created. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>beginning</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Delimiter.html'>Delimiter</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Reference or Object. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>end</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Delimiter.html'>Delimiter</a></tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Reference or Object. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='replace-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>replace</b><span>(content)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='val-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>val</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='_encode-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>_encode</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -1,204 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>ReplaceType</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
ReplaceType
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Engine.coffee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inherits:</td>
|
||||
<td>
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#replace-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>replace</b><span>(content, creator, op_number)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#replaceBy-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>replaceBy</b><span>(op)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>
|
||||
<small>Inherited Method Summary</small>
|
||||
<h3 class='inherited'>
|
||||
Methods inherited from
|
||||
<a href='../class/Operation.html'>Operation</a>
|
||||
</h3>
|
||||
<p class='inherited'>
|
||||
<a href='../class/Operation.html#getUid-dynamic'>#getUid</a>
|
||||
<a href='../class/Operation.html#execute-dynamic'>#execute</a>
|
||||
</p>
|
||||
</h2>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(content, creator, op_number)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='replace-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>replace</b><span>(content, creator, op_number)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='replaceBy-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>replaceBy</b><span>(op)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>execute</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
July 18, 14 01:28:06 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! Documentation</title>
|
||||
<title>Yatta! API</title>
|
||||
<script src='../javascript/application.js'></script>
|
||||
<script src='../javascript/search.js'></script>
|
||||
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
|
||||
@@ -47,7 +47,7 @@
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='../class/ReplaceManager.html'>ReplaceManager</a>
|
||||
<a href='ReplaceManager'>ReplaceManager</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -62,6 +62,7 @@
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Return the content that this operation holds.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
@@ -73,6 +74,7 @@
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Replace the content of this replaceable with new content.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
@@ -84,6 +86,7 @@
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
If possible set the replace manager in the content.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
@@ -95,7 +98,7 @@
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Convert all relevant information of this operation to the json-format.
|
||||
Encode this operation in such a way that it can be parsed by remote peers.
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -115,7 +118,7 @@
|
||||
<span class='name'>content</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/Operation.html'>Operation</a></tt>
|
||||
<tt>Operation</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
@@ -125,7 +128,7 @@
|
||||
<span class='name'>parent</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt><a href='../class/ReplaceManager.html'>ReplaceManager</a></tt>
|
||||
<tt>ReplaceManager</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
@@ -154,7 +157,11 @@
|
||||
<b>val</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='docstring'>
|
||||
<p>Return the content that this operation holds.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='replace-dynamic'>
|
||||
@@ -163,7 +170,11 @@
|
||||
<b>replace</b><span>(content)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='docstring'>
|
||||
<p>Replace the content of this replaceable with new content.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='execute-dynamic'>
|
||||
@@ -172,7 +183,17 @@
|
||||
<b>execute</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
<div class='docstring'>
|
||||
<p>If possible set the replace manager in the content.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='Word.setReplaceManager'>Word.setReplaceManager</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='_encode-dynamic'>
|
||||
@@ -182,8 +203,7 @@
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Convert all relevant information of this operation to the json-format.
|
||||
This result can be send to other clients.</p>
|
||||
<p>Encode this operation in such a way that it can be parsed by remote peers.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
@@ -191,7 +211,7 @@ This result can be send to other clients.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
August 23, 14 17:02:46 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
|
||||
@@ -1,273 +0,0 @@
|
||||
<!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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>TestConnector</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
TestConnector
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Connectors/TestConnector.coffee</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>A trivial Connector that simulates network delay.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getOpsInExecutionOrder-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getOpsInExecutionOrder</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#send-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>send</b><span>(o)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#receive-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>receive</b><span>(o)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#flushOne-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>flushOne</b><span>(user)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#flushOneRandom-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>flushOneRandom</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#flushAll-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>flushAll</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#sync-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>sync</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(engine, HB, execution_listener)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getOpsInExecutionOrder-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getOpsInExecutionOrder</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='send-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>send</b><span>(o)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='receive-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>receive</b><span>(o)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='flushOne-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>flushOne</b><span>(user)</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='flushOneRandom-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>flushOneRandom</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='flushAll-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>flushAll</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='sync-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>sync</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 08, 14 04:37:31 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
430
doc/class/TextFramework.html
Normal file
430
doc/class/TextFramework.html
Normal file
@@ -0,0 +1,430 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='UTF-8'>
|
||||
<title>Yatta! API</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>
|
||||
»
|
||||
<a href='../alphabetical_index.html' title='Index'>
|
||||
Index
|
||||
</a>
|
||||
»
|
||||
<span class='title'>TextFramework</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='content'>
|
||||
<h1>
|
||||
Class:
|
||||
TextFramework
|
||||
</h1>
|
||||
<table class='box'>
|
||||
<tr>
|
||||
<td>Defined in:</td>
|
||||
<td>lib/Frameworks/TextFramework.coffee</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Overview</h2>
|
||||
<div class='docstring'>
|
||||
<p>Framework for Text Datastructures.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class='summary'>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getSharedObject-dynamic'>
|
||||
#
|
||||
(?)
|
||||
<b>getSharedObject</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getConnector-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getConnector</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Get the initialized connector.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getHistoryBuffer-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getHistoryBuffer</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#getUserId-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getUserId</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
Get the UserId from the HistoryBuffer object.
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#val-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>val</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#insertText-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>insertText</b><span>(pos, content)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#deleteText-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>deleteText</b><span>(pos, length)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#bind-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>bind</b><span>(textarea)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#replaceText-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>replaceText</b><span>(text)</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='signature'>
|
||||
<a href='#on-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>on</b><span>()</span>
|
||||
</a>
|
||||
</span>
|
||||
<span class='desc'>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Constructor Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='constructor-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>constructor</b><span>(user_id, Connector)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Parameters:</h3>
|
||||
<ul class='param'>
|
||||
<li>
|
||||
<span class='name'>user_id</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>String</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>Uniqe user id that defines this peer. </span>
|
||||
</li>
|
||||
<li>
|
||||
<span class='name'>Connector</span>
|
||||
<span class='type'>
|
||||
(
|
||||
<tt>Connector</tt>
|
||||
)
|
||||
</span>
|
||||
—
|
||||
<span class='desc'>The connector defines how you connect to the other peers. </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Instance Method Details</h2>
|
||||
<div class='methods'>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getSharedObject-dynamic'>
|
||||
#
|
||||
(?)
|
||||
<b>getSharedObject</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>Returns:</h3>
|
||||
<ul class='return'>
|
||||
<li>
|
||||
<span class='type'></span>
|
||||
(
|
||||
<tt>?</tt>
|
||||
)
|
||||
—
|
||||
<span class='desc'>WordType </span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getConnector-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getConnector</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Get the initialized connector.</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getHistoryBuffer-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getHistoryBuffer</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='HistoryBuffer'>HistoryBuffer</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='getUserId-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>getUserId</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='docstring'>
|
||||
<p>Get the UserId from the HistoryBuffer object.
|
||||
In most cases this will be the same as the user_id value with which
|
||||
JsonFramework was initialized (Depending on the HistoryBuffer implementation).</p>
|
||||
</div>
|
||||
<div class='tags'>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='val-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>val</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='JsonType.val'>JsonType.val</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='insertText-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>insertText</b><span>(pos, content)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='WordType.insertText'>WordType.insertText</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='deleteText-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>deleteText</b><span>(pos, length)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='WordType.deleteText'>WordType.deleteText</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='bind-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>bind</b><span>(textarea)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='WordType.bind'>WordType.bind</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='replaceText-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>replaceText</b><span>(text)</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='WordType.replaceText'>WordType.replaceText</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class='method_details'>
|
||||
<p class='signature' id='on-dynamic'>
|
||||
#
|
||||
(void)
|
||||
<b>on</b><span>()</span>
|
||||
<br>
|
||||
</p>
|
||||
<div class='tags'>
|
||||
<h3>See also:</h3>
|
||||
<ul class='see'>
|
||||
<li>
|
||||
<a href='Operation.on'>Operation.on</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
August 24, 14 01:51:08 by
|
||||
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
|
||||
Codo
|
||||
</a>
|
||||
2.0.9
|
||||
✲
|
||||
Press H to see the keyboard shortcuts
|
||||
✲
|
||||
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
|
||||
✲
|
||||
<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>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user