Collision detection

Events happening in the community are now at Drupal community events on www.drupal.org.
ernestd's picture

There are two possible cases of collision:

Let's take the follosing parameters:
insert_A: where the user A inserts content
length_A: the content length inserted by user A
insert_B: where the user B inserts content
length_B: the content length inserted by user B

Important: this is only processed in case of replacement or deletion. Not in normal inserts

if (insert_B <= insert_A) {
  // This is true if caret of user A is in between replacements or deletions done by user B
  if ((insert_B + length_B) > insert_A) {
}
// the other way around
// This is true if caret of user B is between replacements or deletetions done by user A
elseif ((insert_A + length_A) > insert_B) {

Add any other case that cross your mind :)

SoC 2006: Collaborative Editor

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: