├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── examples ├── clock.coffee ├── public │ ├── create.html │ ├── img │ │ └── jsoneditor-icons.png │ ├── index.html │ ├── json.html │ ├── json_list.html │ ├── jsoneditor-min.css │ ├── jsoneditor-min.js │ ├── jsoneditor.js │ ├── jsoneditor.min.css │ ├── list.html │ ├── multi.html │ ├── react.html │ └── ws.html ├── server.coffee └── ws.coffee ├── lib ├── client │ ├── connection.js │ ├── doc.js │ ├── emitter.js │ ├── index.js │ ├── query.js │ └── textarea.js ├── index.js ├── server │ ├── index.js │ ├── rest.js │ ├── session.js │ └── useragent.js └── types │ ├── README.md │ ├── index.js │ ├── json-api.js │ ├── text-api.js │ └── text-tp2-api.js ├── metadata.md ├── package.json └── test ├── browser ├── connection.coffee ├── doc.coffee ├── queries.coffee └── subscribed.coffee ├── helpers ├── fixtures.coffee ├── index.coffee ├── mersenne.js ├── ot_number.js ├── phantom.coffee ├── server.coffee ├── socket.coffee └── webclient.coffee ├── mocha.opts └── server ├── connection.coffee ├── doc.coffee ├── integration.coffee ├── json-api.coffee ├── middleware.coffee ├── query.coffee ├── rest.coffee ├── session.coffee ├── testhelpers.coffee ├── text-api.coffee └── useragent.coffee /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .DS_Store 3 | node_modules 4 | dist/* 5 | coverage 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .DS_Store 3 | node_modules 4 | coverage 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - 0.10 5 | 6 | services: 7 | - redis-server 8 | 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Licensed under the standard MIT license: 2 | 3 | Copyright 2011-2014 Joseph Gentle. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all test clean webclient 2 | 3 | UGLIFY = node_modules/.bin/uglifyjs -d WEB=true 4 | BROWSERIFY = node_modules/.bin/browserify 5 | 6 | all: build minify 7 | 8 | build: 9 | mkdir -p dist 10 | $(BROWSERIFY) -s sharejs lib/client/index.js -o dist/share.js 11 | 12 | minify: 13 | $(UGLIFY) -cm --lint dist/share.js > dist/share.min.js 14 | 15 | clean: 16 | rm -rf dist/* 17 | -------------------------------------------------------------------------------- /examples/clock.coffee: -------------------------------------------------------------------------------- 1 | 2 | module.exports = (args...) -> 3 | # Make SOLR thing. 4 | 5 | name: 'solr' 6 | 7 | submit: (cName, docName, opData, snapshot, callback) -> 8 | console.log "set snapshot for #{cName} to ", snapshot 9 | callback() 10 | 11 | query: (cName, query, callback) -> 12 | console.log 'running query' 13 | callback null, results:[], extra:(new Date()).getSeconds() 14 | -------------------------------------------------------------------------------- /examples/public/create.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 47 | -------------------------------------------------------------------------------- /examples/public/img/jsoneditor-icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/josephg/ShareJS/414e1d6a4e0d3f06a83bfe001bc81f2cd6891475/examples/public/img/jsoneditor-icons.png -------------------------------------------------------------------------------- /examples/public/index.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 33 | -------------------------------------------------------------------------------- /examples/public/json.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 83 | 84 |

JSON Client API example (check it out in source, and on the wiki)

85 | -------------------------------------------------------------------------------- /examples/public/json_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 101 | 102 |

Reorder the trains

103 |