Ace editor - Real Time Changes between two clients (socket.io / mongodb

124 views
Skip to first unread message

Andrew Oneill

unread,
Feb 21, 2016, 6:26:36 PM2/21/16
to Ace Internals Dev
I'm trying to create a real time text editor with ace but I'm trying print to send data or receive data with the editor from Mongodb via socket.io.
I know with a normal textarea I can addEventListener but with this I cant, what do I use?

files attached of what I done so far
editor.html
server.js

Harutyun Amirjanyan

unread,
Feb 29, 2016, 4:46:33 PM2/29/16
to ace-in...@googlegroups.com
there are multiple ways to get change notifications

editor.on("input", function() {}) // fires async similar to textarea input event
editor.on("change", function() {})  or editor.session.on("change" // fires synchronously during change event, there can be multiple change events for one keypress
editor.textInput.getElement() // the focused textarea
or editor.container.addEventListent("keypress", fn, true)

Reply all
Reply to author
Forward
0 new messages