How hard is this: Author's current text coloring and blocking

12 views
Skip to first unread message

Emre Sevinc

unread,
Nov 18, 2009, 9:06:27 AM11/18/09
to MobWrite
Hello,

I'm very excited to have discovered MobWrite. I'm evaluating the
system to see if I can integrate it into one of my projects.

What I need to know is if it is possible (in the sense that either
through setting some parameters in a few mintes or doing JS+Python
programming for a few days)

- To colorize every author's text with different colors, e.g. as
simple as wrapping text with font color=authorsSpecialColor tags, etc

- Lock the current paragraph that author's cursor is in, e.g. I'm in
paragraph p1 and as long as my cursor is in the region of p1 some
other users cannot edit that part.

From the previous messages (especially this message:
http://groups.google.com/group/mobwrite/msg/73a9f7e9b389debc) I
started to think that it's not very easy but then again I wanted to
ask the developers.

Mikey

unread,
Nov 20, 2009, 9:06:20 PM11/20/09
to MobWrite
Heya!

As for locking. Are you sure you want to do that? What if u only have
one paragraph? Or someone walks away from their computer locking
everyone else out? It kinda defeats the point of mobwrite. Would it
not be better to have a blinking cursor or box that shows other users
where they are?

And colour highlighting, No, its not very easy im afraid. There is no
current way of doing this in mobwrite.

Its also not a very simple thing to do either. In order to highlight
it, You must keep a record of who edited it. How much of a record and
how are the questions depending on application and feature. Due to
mobwrites nature of being a real-time collaborative editor, in my
opinion a history of more than 1 is not needed. So a simple bitmap
file could be made which says who changed which byte. =] But rather
than send the whole bitmap file each time, you could either "patch it"
like any other bit of data, or attach the data to the patch
information itself (as when a patch happens, the bitmap changes). And
it only changes on a "+" action too. Adding a userID with a comma
might be a solution.

"hello world" bitmap = [00000000000]

=2
-3
+1,Y
=1
-5
+2,WORLD

Result
"heY WORLD" bitmap = [001022222] (note a "-" also shrinks the bitmap)

Not only does this separate the two bits of information and possibly
mean they could become out of sync, an increase memory usage (double
in fact), and changes to the client to support it, it also breaks
backward compatibility.

There are other solutions, all of which are being looked into. So its
prolly best to sit tight!

Good luck if u try tho. Love to know how u get on =]
Mike

Emre Sevinc

unread,
Nov 24, 2009, 11:07:38 AM11/24/09
to MobWrite
On 21 nov, 03:06, Mikey <mikey...@gmail.com> wrote:
> Heya!
>
> As for locking. Are you sure you want to do that? What if u only have
> one paragraph? Or someone walks away from their computer locking
> everyone else out? It kinda defeats the point of mobwrite. Would it
> not be better to have a blinking cursor or box that shows other users
> where they are?

What I wish is this:

IF

- I'm online
- AND
- my cursor is within the region
- that I defined previously

THEN

- Lock my region

IF

- I'm not in that region
- OR
- I'm offline (session timeout, responsibility of another system of
course)

THEN

- UNLOCK the region

> And colour highlighting, No, its not very easy im afraid. There is no
> current way of doing this in mobwrite.

That's what I guessed. However it is a very important feature for some
applications that I may consider.


> There are other solutions, all of which are being looked into. So its
> prolly best to sit tight!
>
> Good luck if u try tho. Love to know how u get on =]

Thank you very much for info. I'd only tackle this project by myself
if I can find some funding (e.g. as a EU project).

Otherwise, I bet on Google ;-)


--
Emre

Neil Fraser

unread,
Dec 1, 2009, 9:21:50 PM12/1/09
to MobWrite
On Nov 18, 6:06 am, Emre Sevinc <emre.sev...@gmail.com> wrote:
> What I need to know is if it is possible (in the sense that either
> through setting some parameters in a few mintes or doing JS+Python
> programming for a few days)
>
> - To colorize every author's text with different colors, e.g. as
> simple as wrapping text with font color=authorsSpecialColor tags, etc

The trickiest issue here is to find a display surface which supports
colours. Currently the most common use of MobWrite is to share a
textarea. HTML textareas have no ability to colour selected text. In
order to do this you'd need to switch to a different editing surface.
Technically this is easy, you just need a get, set and patch method
for your surface and suddenly it's MobWrite compatible. But if you
are doing this on the web your options are limited. Using an editable
iframe may be your best bet, but I spent a month working on Internet
Explorer edge-cases before throwing in the towel (that's what the
branch in Subversion contains). Mozilla have done this using Canvas,
but it's not IE compatible.

Once you have a working rich-text editing surface, then we can talk
about attribution.

> - Lock the current paragraph that author's cursor is in, e.g. I'm in
> paragraph p1 and as long as my cursor is in the region of p1 some
> other users cannot edit that part.

Hmm, that's really not what MobWrite is about. MobWrite is designed
for free-flowing collaboration. It goes to great lengths to avoid
locking users into a cubicle. This sounds more like the Mjølner
Project. (http://www.cs.lth.se/Research/ProgEnv/Papers/LU-CS-TR:
93-109.ps)

Emre Sevinc

unread,
Dec 2, 2009, 8:48:33 AM12/2/09
to MobWrite
> order to do this you'd need to switch to a different editing surface.
> Technically this is easy, you just need a get, set and patch method
> for your surface and suddenly it's MobWrite compatible.  But if you
> are doing this on the web your options are limited.  Using an editable
> iframe may be your best bet, but I spent a month working on Internet
> Explorer edge-cases before throwing in the towel (that's what the
> branch in Subversion contains).  Mozilla have done this using Canvas,
> but it's not IE compatible.

Thanks a lot for your comments. Now I understand it is not inherently
limited to plaintext textboxes but can be used with other editable
HTML controls easily. The issue of supporting every major browser may
not be an issue for me and for some projects. I'm in the process of
evaluating MobWrite and Bespin to see of they can be used for e-
learning/language learning/etc. purposes, I mean creating a
pedagogical system for collaborative learning.


> > - Lock the current paragraph that author's cursor is in, e.g. I'm in
> > paragraph p1 and as long as my cursor is in the region of p1 some
> > other users cannot edit that part.
>
> Hmm, that's really not what MobWrite is about.  MobWrite is designed
> for free-flowing collaboration.  It goes to great lengths to avoid
> locking users into a cubicle.  This sounds more like the Mjølner
> Project.  (http://www.cs.lth.se/Research/ProgEnv/Papers/LU-CS-TR:
> 93-109.ps)

Thank you very much for the article link.

The concerns for locking users is just for preventing accidents and
confusions. Of course, in the system that I'm dreaming of, users will
also be able to chat with each other, they will be a part of closely
related group and naturally they will be expected not to mess with
each other's parapgraphs while they are being edited. Once there is no
cursor in a paragraph then any other user will be allowed to go there
and start editing it (and of course there will be some kind of
periodical snapshots in the background to show the previous versions
of the document). So just imagine we are physically in the same room,
sitting at the same table, using a big piece of paper and writing
something on the paper, I just say to you "please don't touch my
paragraph as long as I'm moving my pen over it, once I left it you are
free to do whatever you want with that paragraph and I yours".

Best regards,

--
Emre

Paul Stone

unread,
Dec 2, 2009, 9:11:26 AM12/2/09
to mobw...@googlegroups.com
> are doing this on the web your options are limited.  Using an editable
> iframe may be your best bet, but I spent a month working on Internet
> Explorer edge-cases before throwing in the towel (that's what the
> branch in Subversion contains).  Mozilla have done this using Canvas,
> but it's not IE compatible.
>
> Once you have a working rich-text editing surface, then we can talk
> about attribution.

Surely doing attribution doesn't imply using a rich text *editor*, all
that is needed is a plain text editor with some sort of overlay (or
underlay) to display colours. I've not tested this, but I imagine you
could use a transparent textarea element overlaying a div containing
identical content, but with the relevant sections highlighted in
different colours.

Paul Stone

unread,
Dec 2, 2009, 9:45:44 AM12/2/09
to mobw...@googlegroups.com
> underlay) to display colours. I've not tested this, but I imagine you
> could use a transparent textarea element overlaying a div containing
> identical content, but with the relevant sections highlighted in
> different colours.

I just tried this, and it does work in both IE8 and Firefox. In
Firefox, you can use colour: transparent to hide the underlay text,
but still allow highlighted spans to show through, IE doesn't support
color: transparent, but you can set the text color the same as the
background or highlight color, and that works.

It involves a bit of trickery, but this method could work out a lot
easier than getting IE's rich editor to behave.
Reply all
Reply to author
Forward
0 new messages