CloudEditor
Code editor embedded in an iframe with multiple cursors, find, diff tracking and optional real-time collaboration
- it works in the iframe
- supports multiple cursors (
shift + cmd + arrow-down/up) - supports finding selected text (
cmd + d) - supports custom scrollbars
- supports diff tracker
- supports a simple emmet plugin
- supports real-time collaboration
- source-code: https://github.com/totaljs/editor
- it uses editor: CodeMirror
- very small code
Configuration:
parent {String}a selector for the main container (default:auto)autosave {Boolean}auto rebinds value from the editor to the component's path (default:true)event {String}a path to thefunction(name, value)clickerrorsshortcutcursorcontains cursor positionchangecontains partial changes for real-time collaboration (config.realtimemust betrue)
contextmenu {String}a path to thefunction(opt)realtime {Boolean}enables realtime sending changes to theeventmethod (event name ischange)keywords {String}custom keywords in the form e.g.ID,PATHminheight {Number}optional, a minimal height (default:0)margin {Number}optional, a vertical margin (default:0)- NEW:
url {String}optional, a link to the editor (default://cdn.componentator.com/editor/1.min.html)
Method:
component.insert('some text')component.replace('text', 'newvalue')component.search('text', callback(output))component.select(from, [to])component.goto(pos)component.focus()component.save(callback(value))component.marker(name, [from], [to], [color])adds + modifies (withfrom) and removes (withoutfromargument) markercomponent.change(changes)for the real-time collaboration (changescan be generated in theconfig.eventfunction)component.clear()clears all changescomponent.replaceselections(selections)component.replaceselection(selection)component.replacerange(value, from, [to])component.command(cmd)executescodemirror.execCommand()methodcomponent.exec(a, [b], [c])executesdocument.execCommand(a, b, c)method
IMPORTANT:
from, to, pos arguments must be in the form: { line: Number, ch: Number }.




