Is there any plans for inline diff?
(similar to livewire diff module - except that is only supported for D5).

Or anyone know of approaches to do this?

thanks.

Comments

yhahn’s picture

Status: Active » Needs review
StatusFileSize
new64.72 KB
new7.06 KB

Here is a first stab at an inline diff patch -- it is against the DRUPAL-6--2 branch of CVS. Here is a quick overview of what it adds and some of the assumptions it makes:

  • Checkbox setting on each content type page to enable inline diff display to users with "view revisions" perm
  • Simple form at the top of node content to select a revision to view. Inline diff highlighting is displayed against the immediately previous revision
  • Inline diff hilighting assumes that your target output is HTML. I would love to generalize this (or make this optional) but I would love to hear other user stories for how this might be used
  • Simple CSS styling to make the inline diff markup reasonably unobtrusive

Patch is attached and can be applied from your diff module's directory.

I've also attached a screenshot of the inline diff patch in action on a post of our intranet.

jaclayton’s picture

This is excellent - just the functionality I'm looking for. But I can't get it to work. "Show Inline Diff" is checked for the content type "Page" but there's no dropdown at the top of the page to show the versions to diff against as there is in the screenshot. What am I missing?

Ignore me. The patch hadn't applied properly. This is genius and works beautifully.

ilfelice’s picture

FWIW, this works fine here.

Chairman13’s picture

Hi guys!

I love this module, love it! It has revolutionalized the way we're able to do our collaborative fiction pieces on our site. Previously we would use color codes to show new text, with each author getting their own color. It was very primitive and required a lot of going in behind the users, after I was sure everyone had seen the new and clean up of font color tags, and what not.

So thank you!

I have both a future request and a problem that I'd like to bounce off of you.

First, my problem.

Currently, whenever someone is viewing an older revision using inline diff, it locks the file from editing. We need our locks in order to keep multiple editors from posting at once, so disabling them for the site isn't an option. Is there any way that I can get the file NOT to lock, when a user is flipping through the older revisions? A game/story file at our site can be super duper active, and might be touched 25+ times an hour, for viewing. There is much less edit traffic, but if the file is locked for viewing the older versions, it also locks the edit so our authors/users can't add new stuffs.

Future Requests.

In my perfect silly little world, I have this pipe dream that would allow me to use this tool, but where it shows ALL new since the users last visit to a book page. Currently, it shows highlighted text since the last edit, but I was wondering if there was a way, to set it so that the default differential was based on 'the last time the authenticated user visited a file' AND 'the newest edit'. This would make reading the stories that are run on our site, even more amazing, cuz at anytime they could catch up without needing to cycle through all the revisions. And then having the ability to cycle through each edit if there was a need to find out exactly who posted what (which already exists).

Another thought, probably more doable than the first thought. *grin* Would be to have a previous/next button, so that we could cycle through them a bit easier. And maybe a box at the bottom as well as the top, so that...on the longer stories, it would be a bit quicker to cycle through, saving the steps of scrolling back up to the top each time.

Anyways. This is amazing. Seriously, when I go to the other site that I use that doesn't have this...I feel like I'm blind trying to find the new stuffs. :) So I really do appreciate what you've done here. Don't let my requests diminish that this is made of awesome!

China

Chairman13’s picture

Category: feature » bug

It's me again...I had some time to further troubleshoot and experiment with the locking issue that I'm having. ...and I think it's more likely a Revisions or even a locking module issue.

Here's what I'm seeing.

When I go into a previous revision using inline diff, I definitely get a 'lock notice'. It informs me that the document is locked.
However, this appears to be a false lock, because we can still view and edit using other accounts, even though it says it's locked. (This is good for us that it isn't REALLY locked, but it would be nice not to see this 'lock notice' if it isn't truly locking the document.)

Where there is an issue is that if someone is in the EDIT tab of a document, at that point the revisions lock, so that people reading the story, can't access the older revisions. This is a much less invasive issue now that I know that they're only locked during edits. (or think I know)

The reason that I believe it might not be an issue with inline diff, is because the same kind of locking, seems to happen when a user is in the Revisions or Outline tab.

Sorry if I'm barking up the wrong tree with this issue. :) Thanks for any help or direction you can give me with the matter.

China

yhahn’s picture

StatusFileSize
new7.83 KB

I've attached the latest version of this patch -- it makes some UI cleanups to streamline the options for users.

As for the locking issue... I haven't tried testing this out but I can imagine this is a core problem. We should look into it for sure.

Chairman13’s picture

Thank you SO much for the patch.

Please let me know if we can help with your testing. Huge huge fan of this module. :)

I'll give you some feedback on the patch as soon as we have an opportunity to test her out!

China

philbar’s picture

subscribe

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

This patch looks committable to me. I have just given yhahn maintainership of diff module, so he will make decisions about its future.

Chairman13’s picture

We haven't installed the patch yet. We're working on getting our test site back up on the new server.

Since upgrading to 6.10 Drupal (w/o the patch), our locking issues with inline diff are acting up again. And what I thought were false locks when people are reading the revisions, seem to be real. AND...if they leave the site before navigating away and releasing the lock, the lock stays until it expires or I release it.

Chairman13’s picture

I noticed something very little today with Inline Diff and wanted to share. It doesn't inconvenience me in the least, but I thought you might want to know.

It seems, that it doesn't highlight words that are italicized. At lease when using a WYSIWYG editor. ...whether it does, when using plain code, I dunno. :)

Just wanted to pass it on. (It does highlight bold text and the other special formatting that I use, just not the Italics.)

Chairman13’s picture

I noticed something very little today with Inline Diff and wanted to share. It doesn't inconvenience me in the least, but I thought you might want to know.

It seems, that it doesn't highlight words that are italicized. At lease when using a WYSIWYG editor. ...whether it does, when using plain code, I dunno. :)

Just wanted to pass it on. (It does highlight bold text and the other special formatting that I use, just not the Italics.)

EDIT: Sorry for the double post, my browser hung up on me, and I can't delete it.

yhahn’s picture

Status: Reviewed & tested by the community » Fixed

Committed: http://drupal.org/cvs?commit=197114

Please file subsequent bugs/requests related to this feature as new issues. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.