I love the inline diff's ability to highlight the new text in a collaborative document. It's incredible.

At my site, we create collaborative stories, and for our purposes, it would be extremely helpful to have an option that would allow the default revision to be set as the User's last visit to the file. So that the two files that were compared, were the newest revision and the revision the last time the user visited the file.

The ability to cycle through revisions is really nice, and I totally see the need for it, especially when there is need to see who contributed what. ...but if the additional ability existed, to default to where it highlighted everything since the user last visited the file, that would be an incredible feature.

Of course...this may be something that few others would find useful. I dunno. But, if it was an easy addition, that would be awesome.

Comments

Chairman13’s picture

I can tell this isn't something that would be useful to the massess. Drat. :)

Would anyone be willing to work on this feature for a contribution to the project, or give me a quote to let me know how much it would be to develop this feature?

Again, it would be to have the option to view the Diff between the current version, and the users last visit to the document.

Thanks so much. :)

peterpoe’s picture

I could do a small custom module that does this in a couple of hours for a small donation :)
If I understand, you just need that the radio buttons in node/[NID]/revisions are set by default:
- The first, on "current revision".
- The second, on the first revision before the last time the user viewed the node.

Chairman13’s picture

Yes! I think. ...but, in inline diff.

So that the highlighted output shows on the view tab...rather than on the revisions tab.

Is it still a fairly minor obstacle?

...and if so, what would be a reasonable donation and where do I make the contribution to ensure that it goes to your project efforts?

Thanks for your reply! :)

mitchell’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev

Bumping to latest dev branch.

Perhaps this can be done with Rules.

alan d.’s picture

Status: Active » Closed (won't fix)

This is a bit specific for the module.

A menu alter could intercept the page request, and a form alter could target the selection. Something like:

function MODULE_menu_alter(&$callbacks) {
  $items['node/%node/revisions/view']['page callback'] = 'MODULE_diff_diffs_show';
}

function MODULE_diff_diffs_show($node, $old_vid, $new_vid, $state = NULL) {
  // record ID here. Assuming min # users / nodes or this may clog up the config table.
  global $user;
  $ids = variable_get('MODULE_DIFF_LAST_SEEN_' . $user->uid, array());
  $ids[$node->nid] = $new_vid;
  variable_set('MODULE_DIFF_LAST_SEEN_' . $user->uid, $ids);
  return diff_diffs_show($node, $old_vid, $new_vid, $state);
}

function MODULE_form_diff_node_revisions_alter() {
  // retrive IDs and see if user has seen this node
  // if so update with last seen ID
}