dweb-mirror icon indicating copy to clipboard operation
dweb-mirror copied to clipboard

Mediawiki - image browser - long term duplicate "stream" urls

Open mitra42 opened this issue 6 years ago • 3 comments

There are links such as ... $wgArchiveLeafBaseURL.'/stream/'.$id.'/'.$subPrefix.'#page/n'.$imageNum.'/mode/1up' which brings up an image browser such as: https://archive.org/stream/bdrc-W1FPL497/bdrc-W1FPL497#page/n2/mode/1up

In the code its at ArchiveLeaf.class.php > $leafBrowseUrl >ImageBrowse= in template EntryImage > sources/template_entryimage.txt > loaded into EntryImage template (in DB I think)

It is displayed as a link in the template

SHORT TERM:

  • [x] Replace with a link to details,
    • [x] Will need to trigger this off a new variable $wgArchiveLeafMirror
    • [x] OR forward on DM

MEDIUM TERM

  • [ ] Copy the 'stream' and handle it like an alternative to archive.html or some similar solution

Note also dev artifact in -transcriber/build/index.html:|ImageBrowse=https://archive.org/stream/tutur-smara-bhuwana/tutur-smara-bhuwana-300ppi#page/n2/mode/1up which is not significant

mitra42 avatar Dec 14 '19 08:12 mitra42

On archive.org, clicking a page goes to https://archive.org/details/bdrc-W1FPL497/page/n29 This doesnt happen on dweb-mirror For now ....

  • [x] dweb-mirror should handle /page/n29
    • [x] mirrorHttp needs to spot the URL
    • [x] bookreader needs to handle a page parameter
      • detective work in bookreader repo suggests pages can be leafXX or nXX
  • [x] stream/IDENTIFIER/ANY#page/n29 should forward to details/IDENTIFIER/page/n29
  • [x] bookreader should rewrite urls to /page/n29 (I thought it did ?)

mitra42 avatar Dec 15 '19 23:12 mitra42

Passing to bookreader ...

  • [x] need to set enableUrlPlugin=true

Examples http://localhost:4244/details/ArtOfCommunitySecondEdition/page/n10/mode/2up pr http://localhost:4244/details/ArtOfCommunitySecondEdition/page/leaf2/mode/2up or http://localhost:4244/details/ArtOfCommunitySecondEdition#page/n10/mode/2up

  • breakpoints in BookReader.js L460 "extendParams"

  • at L475 initParams - a bit below this checks enableUrlPlugin

  • at BookReader.init L550 calls initParams

  • /page/20 FAILS becase parsePageString doesnt like "20" wants "n20" or "leaf20". this is probably OK - its not clear what generates URLs of form /page/20

  • /page/n20

  • [x] test first with just /page/n20

    • writes history ok
    • rewrites url to page/n20
  • [x] test with page/n20/mode/2up

    • [x] mirrorHttp needs to add 'mode' - or extend to capture page=n20/mode/2up
  • [x] http://localhost:4244/details/ArtOfCommunitySecondEdition/page/leaf20/mode/2up

  • For #page/20/mode/2up

  • [x] Needs options.urlMode != "history"

  • [x] forwards to home ?

    • calls to Nav.factory with identifier = home
    • Nav.window.onpopstate
    • Bookreader.plugin.url.js urlUpdateFragment - replace('#' newFragment)
    • [x] Saved example in Evernote - compare with "back" button, does that have state, and what about back before first (should go to non dweb place)

CLEANUP

  • [x] TEST http://localhost:4244/details/home not working !
    • cors/advancedsearch -> archive.org/advancedsearch -> 404 cos its advancedsearch.php
    • fixed in DTS.Naming.js
  • [x] TEST http://localhost:4244/details/software - 'some' error in ArchiveItem.js
    • fixed sort order
  • [x] click on software icon ends up at archive.org - fixed ev.preventdefault on anchors

mitra42 avatar Dec 16 '19 02:12 mitra42

  • [x] https://localhost:4244/stream/bdrc-W1FPL497/bdrc-W1FPL497#page/n2/mode/1up
  • [x] Redirects to http://localhost:4244/details/bdrc-W1FPL497# which is wrong Failing as https://ia802800.us.archive.org/BookReader/BookReaderImages.php?zip=/29/items/bdrc-W1FPL497/bdrc-W1FPL497_jp2.zip&file=bdrc-W1FPL497_jp2/bdrc-W1FPL497_0003.jp2&scale=1.1408163265306122&rotate=0 BUT http://localhost:4244/details/bdrc-W1FPL497#page/n2/mode/1up also fails

CLEANUP

  • [x] why the non-integer scale, see recent work on that

mitra42 avatar Dec 17 '19 01:12 mitra42