Edit History

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Edit History
« on February 22nd, 12:22 AM »
Been thinking about this one for a while, and finally started working on it today. So far I've got it able to store the edits as they're made (which is by far the easiest bit of the code) and added an item to the menu to view the edits.

It's also, interestingly, exposing a weakness in the post display, in that there's no way to alter the items (other than those in the menu) by way of a hook - nor is it possible to do what Niko's mod did and have the 'last edited' text be a suitable link. Not yet sure how I want to deal with that.

As far as the menu goes, the real struggle - such as it was a 'struggle', depending on your definition - was making the text be different between menu instances, to include the number.[1]

But here's what I have so far. It's not very exciting, because I haven't gotten onto the real meat of the display yet, but that's OK, I haven't spent that long on it yet.
 1. Nao wrote that code and it is very, very efficient, but doing something like this is atypical - and as a result, a little bit tricky, but nothing that can't be solved relatively easily, all that happens is we create placeholders for each of the counts and use those, e.g. if a post has 1 edit and another has 2 edits, we create dynamic $txt entries to cope with it so they each get a 'unique' identifier. If you're not planning on touching that menu it really doesn't matter to you, other than the fact it works.

 edithistory_1.png (20.28 kB, 640x107 - viewed 95 times.)
   computer-aided
   community building
             

Other stuff:

Online Nao

  • Wedgeward
  • Posts: 10,277
  • Reality check: I just discovered that Wedge already has a 'Mark unread' button for PMs, a feature in my to-do. Uh. It just isn't in the 'right' place...
    • View profile
    • Cynacittà @ noisen
Re: Edit History
« Reply #1 on February 22nd, 12:36 AM »
Isn't it a usercentric menu rather than post centric?

Yeah it's only semantics....
  I say Wedge Wedge (in the butt)
« Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Edit History
« Reply #2 on February 22nd, 12:44 AM »
The history of a post is pretty post centric?
   computer-aided
   community building
             

Other stuff:

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Edit History
« Reply #3 on February 22nd, 03:15 AM »
Anyway, I got quite a bit sidetracked this evening on other matters, but I've got the next stage implemented.

 edithistory_2.png (47.19 kB, 640x434 - viewed 90 times.)
   computer-aided
   community building
             

Other stuff:

Offline live627

  • Consultants
  • Posts: 1,014
  • Took me forever to restyle a menu. And now, it loooks wonderful.
    • View profile
Re: Edit History
« Reply #4 on February 22nd, 05:29 AM »
Sweet!

Online Nao

  • Wedgeward
  • Posts: 10,277
  • Reality check: I just discovered that Wedge already has a 'Mark unread' button for PMs, a feature in my to-do. Uh. It just isn't in the 'right' place...
    • View profile
    • Cynacittà @ noisen
Re: Edit History
« Reply #5 on February 22nd, 07:17 AM »
Quote from Arantor on February 22nd, 12:44 AM
The history of a post is pretty post centric?
So you're not using the user menu then? So. Action menu maybe?
  I say Wedge Wedge (in the butt)
« Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Edit History
« Reply #6 on February 22nd, 10:00 AM »
Quote from Nao on February 22nd, 07:17 AM
Quote from Arantor on February 22nd, 12:44 AM
The history of a post is pretty post centric?
So you're not using the user menu then? So. Action menu maybe?
Yup, just like my screenshot shows ;)
   computer-aided
   community building
             

Other stuff:

Online Nao

  • Wedgeward
  • Posts: 10,277
  • Reality check: I just discovered that Wedge already has a 'Mark unread' button for PMs, a feature in my to-do. Uh. It just isn't in the 'right' place...
    • View profile
    • Cynacittà @ noisen
Re: Edit History
« Reply #7 on February 22nd, 10:18 AM »
Oh I get it now! IPod -> no visible right side of the pic. So I missed that.
  I say Wedge Wedge (in the butt)
« Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Offline Dr. Deejay

  • Junior Member
  • Posts: 85
  • I'm addicted to the "Go up/Go down" feature
    • View profile
Re: Edit History
« Reply #8 on February 22nd, 12:49 PM »
Nice work! :)

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Edit History
« Reply #9 on February 22nd, 01:49 PM »
Thanks :)

Haven't yet decided what I want to do with permissions on it yet, though, and I'm currently trying to decide how thorough to make it handle comparisons between versions and stuff like that but it's coming along nicely enough :)
   computer-aided
   community building
             

Other stuff:

Offline Farjo

  • "genuinely interested"
  • Friends
  • Posts: 153
    • View profile
    • Fazer Owners Club - Unofficial
Re: Edit History
« Reply #10 on February 23rd, 11:01 AM »
Excellent - don't really understand the codey bits but really glad this will be available. Looking good so far :)
Now is the winter of our SMF drama made glorious summer by this development of Wedge.

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Edit History
« Reply #11 on February 23rd, 11:02 AM »
Yeah, don't worry too much about the code stuff, that was more a passing comment for anyone who is interested in extending that menu in a specific way ;)

I did start, briefly, on making it able to show two edits side by side and show the changes, but I got sidetracked with personal stuff and haven't gotten that far with it. (Sadly, MediaWiki has a rather nice piece of code derived from GNU diff, but it's GPL and thus not suitable licence-wise)
   computer-aided
   community building
             

Other stuff:

Online Nao

  • Wedgeward
  • Posts: 10,277
  • Reality check: I just discovered that Wedge already has a 'Mark unread' button for PMs, a feature in my to-do. Uh. It just isn't in the 'right' place...
    • View profile
    • Cynacittà @ noisen
Re: Edit History
« Reply #12 on February 23rd, 11:21 AM »
Pete, do you think I should give up on the 'optimizations' of the action/user menus and instead use full URLs and full strings for all occurrences...? These would tend to gzip well, so it wouldn't eat too much bandwidth. Originally the optimization was meant to make Wedge load faster and better (on mobile or desktop), but maybe you think it's not worth the trade-off in terms of extensibility?
Posted: February 23rd, 11:20 AM

As for MediaWiki, the code is GPL but the concept/implementation algorithm isn't. Surely you can get inspired by it?
  I say Wedge Wedge (in the butt)
« Everyone knows rock attained perfection in 1974. It's a scientific fact. » (Homer Simpson)

Online Arantor

  • Wedgeward
  • Posts: 10,364
  • The Twelve Tasks of Asterix is awesome.
    • View profile
    • Innovate, not Imitate
Re: Edit History
« Reply #13 on February 23rd, 11:24 AM »
I really wouldn't worry about changing it. I don't see many people changing it, and those that do... they're going to change it in a less dramatic way than I have (i.e. the same string each time)

Honestly, I'm more bothered by the fact that quote/modify aren't directly extensible than I am about trying to extend the menus.

Quote
As for MediaWiki, the code is GPL but the concept/implementation algorithm isn't. Surely you can get inspired by it?
The algorithm is extremely complex. I narrowed down the segment of code I want, but it's about 20K of code that's complicated to unravel, especially when one loop, for example is set up as such:

Code: [Select]
for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) {

Don't worry about what all the variables are, just consider how complex that piece of code is for what it's actually doing. (It's used to go from the end of the before/after pages, from whichever's shortest and traverse back up towards the $skip point, which is the location of the earliest line of difference)
   computer-aided
   community building
             

Other stuff:

Offline MultiformeIngegno

  • Friends
  • Posts: 804
  • I have the tickets for the Coldplay live in Turin!!!!! :D
    • View profile
    • multiformeingegno
Re: Edit History
« Reply #14 on February 23rd, 11:35 AM »
Yeah! Brilliant! :)
RockCiclopedia (wiki - forum - extra)
Tutta la storia del rock, scritta da voi ...