FlominatorTM / wikiblame

http://wikipedia.ramselehof.de/wikiblame.php
GNU General Public License v3.0
54 stars 13 forks source link

"was already present in the oldest revision searched dating from xx:xx, x xxxx xxxx." - Missing button: "start search from here" #11

Closed zulu55github closed 6 years ago

zulu55github commented 7 years ago

When a search results in "was already present in the oldest revision searched dating from xx:xx, x xxxx xxxx." i am missing a button "start (new) search from here"

waldyrious commented 7 years ago

Yeah, I would have found such a feature quite convenient, especially in linear search where you can only search 50 revisions at a time. By the way, didn't this feature exist previously? I seem to recall using it in the past...

In the meantime, it might help to know that the limit for binary search (which IIRC used to be 500 versions?) is now higher -- I think it accepted 5000 revisions last time I tried it. So that should normally be enough to cover the entire range of revisions for most pages.

FlominatorTM commented 7 years ago

"was already present in the oldest revision searched dating from xx:xx, x xxxx xxxx." currently only is available when not searching for wiki text since the feature currently parses the date directly from the wikipedia page of the old revision (see https://github.com/FlominatorTM/wikiblame/blob/master/wikiblame.php#L742 - yes, it's ugly and unprofessional, but I was younger ... ). When searching for wiki text it downloads the raw text of that revision which doesn't contain a date.

I would need to add some api calls or parse the revision history page in order to make that work. Currently I don't know how to pull it without much effort and without doing a separate additional api request for every revision searched.

If you have any ideas, please hit me.

FlominatorTM commented 6 years ago

With 2a4487831a83476fbadf31afd120996576017f87 I finally managed to fix this issue. With 47bb254a8eb17c7a91d8477901fb5ae0aade915a I changed the behavior in binary search in order to simply retrieve the next batch of revisions. I hope you like it.

FlominatorTM commented 6 years ago

Was a cool approach, the only flaw is, that it only works with English UI since else I would have to parse localized date strings :(

Therefore I had to revert with 86bf5cb9bdba8e760e759d450595546a1c637bcc

FlominatorTM commented 6 years ago

Now I changed the whole interface between retrieval of revision history and searching it by introducing an array with additional information. This leads to a better separation between data and display.

The downside of this is, that I'm no longer able to use the date/time format of the wiki I search and that I had to introduce a new text $messages['revision_date_format']containing the date format of the UI language. In case it gets screwed up in one language, the English default "%H:%M, %d %B %Y"; (hour:minute, day month name year is used)