Commit Graph

689 Commits (53fe002d3ba492fd58fef00e294f4f5ebd7d6604)

Author SHA1 Message Date
ansuz 85dbd5cb6e pass in websocketURL from main
ansuz d9a4f2f22c missed one
ansuz cf2866baa7 use json-ot from bower for tests
ansuz 5bb77bd50c add UI.add and UI.remove methods.
also use json-ot from bower
ansuz ff0f7d15dc use json-ot from bower
ansuz dccf5e8dcf use listmap api from common/
ansuz 58633af943 listmap can be reused. put it in common/
ansuz f80e9772a8 merge api.js and deep-proxy.js into one file
ansuz dbf1e2b870 support reusing the netflux network
export more internals from realtime input
ansuz 6f7543e9cc demonstrate chaining of 'on' directives
ansuz e44446f71e proper recursive proxy initialization
ansuz 68cec2348a don't prompt the user with a crypto hash for their name
ansuz 83696495a8 use chainpad from bower, not local
ansuz 2b9ac14cb1 restructure main to take advantage of new callback infrastructure
ansuz fea74782a2 remove a little more dead code that I missed
ansuz a58d6c745a implement remaining listeners and factor
* 'isProxyable' helper
* 'find' helper
* 'lengthDescending' helper (for sorting change/remove events by path length)
* implement recursive proxy creation
* implement recursive proxy removal
* implement 'bubbling' prevention (via return false)
* implement create, ready, and disconnect event handlers
* return 'this' from 'on'
* trim dead code
ansuz 4222c0b516 simplify api
* refactor conditional with DeepProxy helpers
* don't call 'onRemote' until fully initialized
* use disconnect, ready, and create handlers on proxy object
ansuz 954ee26f4d fix undefined disconnect reason
ansuz a0ec5eada8 better fix for magicline filter
ansuz 9336c4de5c import latest chainpad
ansuz d0b553d198 port Yann's multiple-select implementation to cryptpad
ansuz e3b8a10959 fix magicline filter
ansuz 058548b95a revert my reversion
Revert "Revert "Added checkpoints with the new code from ChainPad""

This reverts commit 6e2e8bf21f.
ansuz 6e2e8bf21f Revert "Added checkpoints with the new code from ChainPad"
This reverts commit da2bfe2de9.
ansuz 599f5aeec8 add sample listeners for debugging
ansuz 3afd144562 don't make noise when adding a listener
ansuz e86a3567be more minor bugfixes and general improvements
off by one error in deletion loop (and undefined references)
sort listeners by pattern specificity
deletions are changes (for now)
ansuz ce99bd9ba3 Merge branch 'two' of github.com:xwiki-labs/cryptpad into two
ansuz 7c63219add fix some minor bugs
ansuz a0c73c95d8 do away with a bit of boilerplate
ansuz e189092ba8 document/spec the listmap api in its current/intended form
ansuz 55846044e1 rewrite underlying API. implement listeners
Caleb James DeLisle da2bfe2de9 Added checkpoints with the new code from ChainPad
ansuz 014dce272b working on better abstractions. still held together with duct tape
ansuz c1bca09cce move list/map functionality into wrapper file
ansuz f61d06fa18 first commit for listmap prototype
ansuz 774d349ec3 ignore hidden elements and submit buttons
ansuz cf85de6113 remove old bencoding code
ansuz d99bb8ff84 WIP : fallback to old parsing doesn't work
ansuz f04be53d11 fall back to old parsing if the message is bencoded?
ansuz 976a08cc7a move to chainpad version 2
ansuz 297d8c2d44 reformat code for jshint compliance
ansuz baf523e9a5 add new functionality from xwiki development
ansuz 0c89443c1b fix typo
ansuz 39fcd7dc4c more specific filtering for magicline plugin
to avoid false positives for other things which are non-contenteditable spans
ansuz cae750cd75 update padrtc for to use bower libraries
ansuz ad3c53c344 use textpatcher from bower for all pads
ansuz 0cd4f85ff0 remove migration notes
ansuz a7cbd8c470 we're pushing json over the wire, so let's use json-ot.validate
ansuz 3ea270acb9 fix cursors in form prototype
ansuz d2c8fbf1f8 use hyperjson.amd.js, not hyperjson.js
ansuz 663c157e2a expose text patcher to the window via APP
ansuz 1769ca16dc add example for configuring the logLevel in /pad/
ansuz 7faf57602b implement log level settings from application layer
ansuz 523aff3067 use upstream chainpad.js
ansuz dcd130cd9d use hyperjson from bower in padrtc
ansuz c752e4a6e5 remove sharejs
ansuz 6b2e986789 remove deprecated textsocket library
ansuz d2fa5e8f70 start using hyperjson from bower.io
ansuz 150ebaba7b add ability to force text diffing
ansuz aef6f3a85b lock codemirror editor until chain has synced
ansuz 6736335db2 add 'made with <3' toolbar to code
ansuz 506a703b7d turn off TextPatcher logging on /pad/
ansuz ba17b78f7a restyle name change button
ansuz d79b3616c9 remove unused files
ansuz 4c84758265 disable textpatcher logging
ansuz 46b009d20f remove last non-netflux pad
ansuz 18e0131d6e Merge branch 'migrate' of github.com:xwiki-labs/cryptpad into beta
ansuz 32d1807350 import unused functions from /p/, to be integrated later
Yann Flory 492054a938 Fix the cursor position when a remote patch is applied
ansuz 626ecaffcd log browser fights in /pad/
Yann Flory 5bb2e12db2 Merge branch 'beta' into migrate
ansuz afe78dad56 Merge branch 'netflux' into beta
Yann Flory cc51e6d6ed Update CodeMirror pad to work with Netflux
ansuz a735d63306 migrate markdown rendering 'pad' to netflux
Yann Flory f5f8f6e1eb Remove the delay between a change and its propagation to chainpad
ansuz fa6914037c start rewriting codepad to use realtime-input
ansuz 2852c8f594 Merge branch 'netflux' of github.com:xwiki-labs/cryptpad into beta
Yann Flory fe3bb4da27 Merge branch 'netflux' of github.com:xwiki-labs/cryptpad into netflux
Yann Flory 53b2644b64 Fix a issue with fights over usernames
Caleb James DeLisle 3b6fe44378 Merge branch 'beta' of github.com:xwiki-labs/cryptpad into beta
ansuz 255dc17a5d Merge branch 'beta' into netflux
ansuz f9de1c9e1f Merge branch 'beta' of github.com:xwiki-labs/cryptpad into beta
ansuz c14b86d84a add missing semicolon
ansuz b3ef2abb84 fix jshint complain
Yann Flory 85d5f5c47f Convert netflux to es5
Yann Flory c0b8aac792 Fix an issue where metadata could be duplicated in the realtime userdoc
ansuz 22cf18f78c Merge branch 'beta' of github.com:xwiki-labs/cryptpad into beta
ansuz c509c28c18 realtime form prototype, almost in good condition
ansuz 1a9e7299fc working state
ansuz 69e8f54e8f pass in Crypto to realtime-input
Caleb James DeLisle 5f16ad4a58 Update to most recent chainpad
ansuz aa07dd31ee have json-ot initialize its own debug module, instead of relying on a window variable's existence
Yann Flory d3203d1c2a Remove Crypto from the modules loaded with RequireJS in realtime-input
It now has to be passed in the config in the main JS file
Yann Flory 8ac69ca262 Add a missing "time" property in the netflux client causing incorrect
timeout errors
ansuz be1ef7abe3 migrate canvas to netflux
ansuz d4943511fe move text/ and hack/ to Netflux
ansuz 4c95602347 remove a little bit more dead code
ansuz b140b6429d remove a little bit of dead code
ansuz 2c6cf9883b stop using deleted file
ansuz bbdc9da853 delete duplicated file
ansuz cce50390a0 don't depend on library to set hash
ansuz 5f4825f3a0 don't change the hash from realtime input
let applications handle that logic
ansuz 80fb5e1e21 don't rely on RealtimeSocket exporting textPatcher
ansuz 4f426651ad remove TextPatcher from RealtimeTextSocket
ansuz a527024a8c start on realtime form prototype
ansuz 02ff1a63a4 Merge branch 'netflux' into beta
Conflicts:
	www/assert/main.js
ansuz 04f6299938 reconcile differences with netflux
ansuz 565fb1d186 include small snippets for preventing browser fights
ansuz ffbd428b87 better logging of browser fights
ansuz 4d44661f3b more correct tests
ansuz a18c793f98 use latest hyperjson
ansuz 980ff8a0ca Fix a test that was failing on chrome
it failed for reasons which are irrelevant to our application
ansuz 9efcc443cd add 'format' to TextPatcher's API
ansuz 0769e50414 move TextPatcher to highest application layer
ansuz 1d70335228 provide all callbacks before starting
ansuz 9498937b43 add a FIXME to the assert page
tests were failing (unnecessarily) on Chrome
ansuz a3787ee4dc Merge branch 'netflux' into beta
ansuz 06b464c524 move sheet/ to .git
ansuz cdf02ac725 remove input pad
ansuz 11961b4f1d export stringifyDOM to REALTIME_MODULE
ansuz 5db487db3f remove old pad entirely
hyperjson version is considered a strict improvement
ansuz 010566d3c3 pushDelta was mistakenly deprecated. restored.
ansuz 1639c5b099 use hyperscript and hyperjson from common
ansuz 3598c93098 move new hyperjson into common
ansuz 103bb69daa move custom hyperscript into common
ansuz e357549eda push browser fights into an array for inspection
ansuz b83fb7b823 improve brFix logic
stop exporting functions which we wish to deprecate
ansuz 1c7954ed51 Grab Fabric off of the window
ansuz 06786b6e02 Remove redundant declaration
ansuz df22c246c4 serialize text nodes correctly
ansuz 7ca5f47d02 remove multitest pad since it offers no significant benefit
ansuz bafdd588dd fix /hack/ to not require sharejs textarea
ansuz f2db6b83eb better sizing for palette options
ansuz 5ce158d2e2 add more colors
ansuz 7c4b334ad3 here's a canvas app!
ansuz 41276fffb5 repair /text/ application, conform to new API
ansuz cb979844f6 implement text patching at application layer
ansuz 4a41575e6d accept onLocal in config
ansuz d3c2c901b6 implement cursor transformation in a common library
ansuz 92d89f6cac start to factor sharejs into two modules
ansuz 13dc77b7f6 remove commented line
ansuz 41e635b2e5 realtime-input.js : turn on logging
Yann Flory 69e8e18283 Remove the pipe character in the hash
ansuz d62e9fc1c9 add a missing semicolon
ansuz 4095201d15 Merge branch 'netflux' of github.com:xwiki-labs/cryptpad into integrate
Yann Flory c32045d7d0 Fix an issue with missing characters when several users were typing at the same time
ansuz 822b2bd2b9 Merge branch 'netflux' of github.com:xwiki-labs/cryptpad into integrate
Yann Flory be09a1808d Remove old code from realtime-input
ansuz 5a5b9ad718 Merge branch 'netflux' into beta
ansuz 4af987a2a2 point to correct toolbar.js
ansuz 3ade46adc7 Merge branch 'newtests' into beta
Yann Flory 6884b0890a Fix the typong tests not working properly
ansuz b12a01e08f report test results on the page, not in the console
ansuz feaae609ad fix broken path for padrtc
Yann Flory ecc41d14af Use canonical serializer for json serialization
ansuz fc77ef66b3 Merge remote-tracking branch 'origin/sortify' into HEAD
utilize canonical stringify function

Conflicts:
	www/_socket/main.js
Caleb James DeLisle 319f5b95f7 Use canonical serializer for json serialization
Yann Flory 9683fd9aec Always serialize the DOM in one way.
Caleb James DeLisle 698338b49a Use canonical serializer for json serialization
Yann Flory e207d8b579 Merge branch 'diffdom' into netflux
ansuz 468827dadd newest tests
ansuz c867ab04ab rename /_socket/ app to /p/
ansuz a1fe941f69 Always serialize the DOM in one way.
ansuz f4c5b2a996 Add sane defaults to TextPatcher diffs
ansuz 259772dd62 Turn on TextPatcher logging for _socket
ansuz 0537c28919 Add switchable logging to TextPatcher.js
Caleb James DeLisle 8a36963582 Enable ChainPad PARANOIA mode but remove the part which causes most slowness
ansuz 284da6a4e9 minor improvements I made to the /hack/ pad last night
ansuz 9f0cc4ed64 update hack with a slightly better UI
ansuz 71c0a06c3b Merge branch 'hack' into diffdom
ansuz 19cd991dba trim dead code, comment, very minor optimizations
ansuz f75c246029 remove dead code from pad/main.js
ansuz 9f45ccb2d9 use console.error for stack traces
ansuz d705b947ab Merge branch 'diffdom' into netflux
basic cleanup while performing a larger merge between two prototypes
ansuz 2ffa69dc15 remove checks for a non-existent race condition
ansuz 368d72b337 add missing semicolons to TextPatcher.js
ansuz 851ccfbdb6 detect falsey operations in OT and ignore them
ansuz 400f6efde1 json-ot.js : jshint compliance
ansuz a0999d1d2b add a comment about why hashes are being stubbed
ansuz ca94d30386 detect falsey operations in OT and ignore them
ansuz 9f9cd8d8cd realtime-input.js : fixes for jshint compliance
ansuz 793149a608 json-ot.js : jshint compliance
ansuz 06a3b63923 jshint compliance for toolbar.js
ansuz 3b8238ef3b add missing semicolons to pad/main.js
jshint compliance
ansuz 5cead3fad3 add missing semicolons to TextPatcher.js
ansuz e6ab03164c import TypingTests.js and expose at the console
RTWYSIWYG-54
> implement tests for components of the WYSIWYG editor
ansuz 94e57e4a26 update location of text-patcher.js
ansuz b37dab1f49 Merge branch 'diffdom' into netflux
Simple cleanup and unit tests
ansuz a07774e81a Implement tests for serialization
ensure that complex DOM elements can serialize and deserialize without modifications

RTWYSIWYG-54
> implement tests for components of the WYSIWYG editor
ansuz 6bb37aed44 main.js : support tab insertion in /hack/ pad
ansuz 6b9d982d40 stabilize _socket/realtime-input.js
...as common/RealtimeTextSocket.js
ansuz 1a22592afa remove unused modules from realtime-input.js
ansuz 39071021eb stabilize typingTest.js as /common/TypingTests.js
ansuz 9805958ad7 stabilize text-patcher.js into /common/TextPatcher.js
ansuz 2c34833d2c break text-patcher's functionality into components
text-patcher.js now exports diff, patch, log, and apply change
in addition to the previous 'create' method.
ansuz 7782069dbd Merge pull request from xwiki-labs/diffdom
merge diffdom into netflux
ansuz a1f9b10175 remove offending line from chainpad entirely
RTCHAINPAD-3
ansuz 4071a3aa25 revert to using the chainpad in /common/
now that we have found the problem that caused the backspace bug
we don't need a special chainpad for testing.
ansuz 4ba68eb2bf fix leaky variable in chainpad
Patch.transform declared a 'toTransform' variable without using 'var'
this caused it to leak onto the window during operational transformations
ansuz 05108efdfa correct chainpad's transformation function
addresses RTCHAINPAD-3

Pending further testing, this change will still need
to be corrected in https://github.com/xwiki-contrib/chainpad/
Yann Flory 360fee9feb Fix a new cursor error with Codepad
Yann Flory c2e0dded3a Fix an issue with the cursor sometimes disappearing when a patch was received
Update CodeMirror to the latest version (5.13.2)
Yann Flory 713c90242b Hide the usernames when they have not been changed
Yann Flory c53baab99d Update Codepad with the latest improvements
Yann Flory 0b3d6e15b8 Replace the Netflux old client (netflux.js) by the Netflux2 client.
Move the WebRTC peer-to-peer use case in /padrtc, which still uses the old
Netflux client
Use es6-promises.min.js to solve a issue with some browser and the new
Netflux client
ansuz cd357a9136 turn an alert into a console.error
ansuz ec64e0d381 use getAttribute to inspect document elements
el.getAttribute('attr') is more reliable than el[attr].
ansuz f5b0e1a5df Add comments, debug variables. initialize better
Expose Hyperscript via window.REALTIME_MODULE

Make sure to pass in a JSON.parse'able initial state.

Add comments detailing the problems with not using setAttribute
ansuz 842b9d4243 Generalize _socket/realtime-input.js a little more
Anything JSON related should be at the application layer
Yann Flory cf9f60bd57 The server don't send back anymore messages to their sender
Yann Flory eb4ea7a6b0 Remove the content from the ACK messages sent by the server
Yann Flory ba4faea939 Update the pads to run with the latest improvements to the websocket server
Yann Flory 5ef7e29a9b Add the latest changes from _socket into the netflux pad
ansuz b59a14c5ac merge hyperjson changes from realtime xwiki
more resilient class serialization.
comments
ansuz 2691d85582 use forked chainpad with assertions for _socket
Yann Flory b41f0e8c50 Merge branch 'cjd-fixed-it-with-hax' into netflux2
ansuz c50690349b comments describing the role of each argument
ansuz df78d284c4 initial state should be valid JSON so JSON parse doesn't fail
ansuz 96e03fcfa4 Use latest chainpad without mutations
ansuz d5772c6315 when json-ot produces json that fails to parse...
export the relevant data to a window variable so we can inspect it better
ansuz aaf7c777cc add debugging info to the textPatcher
* kill dead code
* add assertions
* better logging for insertions and removals
ansuz 523df40d09 Debugging concurrent typing:
track whether there are local operations in progress, such that we can tell
whether a remote change is interrupting the DOM's conversion to hjson.
ansuz e446a3645c don't send funny BR attributes over the wire. Properly initialize the typing test
ansuz 22290590cb don't rely on window scope in typingTest.js
ansuz 772ca5d30e comment out debugging line
ansuz 6c340a6527 chainpad testing = true, reject non-compliant messages
ansuz afa1104d85 Pull the cursor out of bogus BR tarpits when it gets stuck
ansuz bac0e0ff88 implement hyperjson filtering
ansuz e51635c4bb fix index error
ansuz 3aebf7d2c2 minor changes to pass linting
ansuz 29e24f556c kill another window variable
ansuz e699073d45 attempt to preserve the magic line plugin while someone else is typing
ansuz 941f5361ea forgot to add 'typingTest', which main depends on
ansuz d852c578d8 removed dead code
ansuz 5591aae8fa Clean up main file
* convert.js includes the vdom library, which we aren't using anymore
  - removed, and replaced with the simple functions from Hyperjson and Hyperscript
* removed several variables that had been exported to 'window'
* moved the testing functions out into their own file for easier reuse
* restructured realtime initialization to be more compact
ansuz 478ccbf984 revert changes to chainpad
ansuz e3b78e20de Merge branch 'cjd-fixed-it-with-hax' of github.com:xwiki-labs/cryptpad into cjd-fixed-it-with-hax
ansuz e26246178f start to clean up and give things more sensible names.
get rid of the textarea entirely
Caleb James DeLisle b372b0b77c small change to chainpad in order to make it more likely to fail if the authDoc goes into the wrong state
Caleb James DeLisle f3fb674504 Merge branch 'cjd-fixed-it-with-hax' of github.com:xwiki-labs/cryptpad into cjd-fixed-it-with-hax
Caleb James DeLisle 98c85cef8b xxx
ansuz 12dcbc9121 fix quick red fox and make test.cancel work again
Caleb James DeLisle 62eabbc7ae If a message does not match parent hash, don't delete it from storage
Caleb James DeLisle dbf31798d5 json-ot triggering PARANOIA errors in ChainPad
Caleb James DeLisle 03932d0169 small changes to chainpad for testing
Caleb James DeLisle 669bcc1935 If there is a difference in the hjson then send a message back
Caleb James DeLisle f62ec85a4c Shuffled around some assertions and logs
Caleb James DeLisle 420a7098a6 more testing and crap
ansuz 4b35a145e3 Push WIP
ansuz 42c972116b leave TODO re: diffDOM and magicline
Hyperjson guarantees that magicline elements are not sent across the wire.
DiffDOM must guarantee that magicline elements will not be removed on remote edits.
ansuz e066730b68 add notes about how hyperjson is to be used
ansuz cd462ed872 Merge legacy websocket version
ansuz c047d5310f implement optional filtering in hyperjson
Implemented via callback, return falsey if you want to filter an element
and all of its children from the serialized result.

Conflicts:
	www/common/convert.js
ansuz 0d33af773f implement optional filtering in hyperjson
Implemented via callback, return falsey if you want to filter an element
and all of its children from the serialized result.
ansuz 475ca9bea8 hyperjson.js : used split instead of filter... oops
ansuz 1bd5cb9e27 hyperjson.js : used split instead of filter... oops
ansuz b2753ef7b7 fix string manipulation off-by-one
ansuz f98fda7604 fix string manipulation off-by-one
ansuz 4f3fcb08a4 better error reporting when the operational transform fails to parse JSON
ansuz 0ff4906f0e implement better serialization of class names
RTWYSIWYG-27 : poorly formed yet valid HTML caused hyperjson to produce element
               selectors which hyperscript could not parse.
ansuz fbe6225681 Don't attempt to use the cursor selection when it has length 0
RTWYSIWYG-20
RTWYSIWYG-24
ansuz 0c6222b5f9 better error reporting when the operational transform fails to parse JSON
ansuz 79a9998b13 implement better serialization of class names
RTWYSIWYG-27 : poorly formed yet valid HTML caused hyperjson to produce element
               selectors which hyperscript could not parse.
ansuz bd24821c6c Don't attempt to use the cursor selection when it has length 0
RTWYSIWYG-20
RTWYSIWYG-24
Yann Flory de6db0285c Limit the size of the usernames to 32 chars
Yann Flory 38d797a4f1 Fix issue with Chrome and WebRTC
Yann Flory 7237c751d5 Move 'vdom' to the main 'pad'.
Hide the right-hand panel (can de bisplayed with a 'debug' button)
Hide the IDs of users if they don't change their name
Yann Flory e77d85bc82 Trigger an onReady() method when the user's pad is fully synced (the history is loaded)
Yann Flory eca4ec699c Ability to change the username (the user ID is displayed by default)
Yann Flory 6e50ae94dd Remove unused code
Yann Flory 5da8560e22 Fix the user list in the toolbar keeping old data with the WebSocket server
Chainpad is no longer responsible for the userlist or the ping
Yann Flory 3a188625e0 Improve the detection of a disconnected peer to update the user list with the WebRTC service
Yann Flory 77e7fb5724 Fix an issue with the WebRTC service where it was impossible to join a channel once someone had left this channel
Yann Flory 06e5c84702 Clean some code
Yann Flory 29033f344c Merge branch 'netflux' of github.com:xwiki-labs/cryptpad into netflux
Yann Flory b1e8bcddef Fix the user list not working with the WebRTC service and causing major issues
Yann Flory c576241104 Add a Chainpad adapter to make Chainpad know the userList
ansuz fb0e82931d correct malformed json
Yann Flory ae8f6f7f2c Ability to choose which protocol to use (Websocket or WebRTC) with Netflux
ansuz 3a7af63c54 correct malformed json
Yann Flory b7885eb539 Fix channel history
ansuz 136e2d8cf2 pass in missing textarea argument so textpad starts working again
ansuz 8258018c1d Revert "fix undefined reference"
This reverts commit 7d65540123.

To restore functionality in convert.js
ansuz c67451bc1a Revert "remove broken functions from convert module"
Because I forgot that the /render/ page was still using vdom

This reverts commit 93fb944e1f.
Yann Flory c536ecbc1c Temp commit
Yann Flory 870b2dbb7e Add the WebRTC server in Cryptpad
Yann Flory c4f62fb812 First try with WebRTC
Yann Flory 09a06a8bc5 Replace the chainpad server by the netflux server
Yann Flory 60c3aceb0d Add chatflux server
Yann Flory deb2084fc5 Add the socket connection checker
ansuz d3e2a2f52e make verbose logging switchable via a conditional
ansuz 1c54af69a1 update minor editors to use new realtime-input api
ansuz 9b228eea6b modify vdom main.js to adhere to new realtime-input api
ansuz fefb904261 realtime input changes
ansuz fd99dba4a3 modify realtime-input api to take a single object as configuration. merge netflux API
Yann Flory 62ba579d4a Add Netflux API with WebSocket service V1
ansuz 53d3e475f7 ui hints for hackpad
ansuz d2f4fbcee9 fail the toolbar from the application layer
ansuz d7b34cf6be don't call toolbar from within realtime-input.js