User:Inductiveload/jump to file

From Wikisource
Jump to navigation Jump to search
Jump To File user script

This is a user script to add some functions to do with locating files at external sources from the Page namespace.

Installation[edit]

Install using the loader below. This will only load the main JS when appropriate:

mw.loader.load('//en.wikisource.org/w/index.php?title=User:Inductiveload/jump to file/load.js&action=raw&ctype=text/javascript');

What you get[edit]

The links list for a file with an Internet Archive source
  • A list of pages that transclude the current Page namespace page.
  • A link to the file at Commons
  • A link to the file at an external source, if listed in the file information
  • A direct link to the high-resolution original image at the external source
  • Optional direct loading of the high-res images into the image viewer at Wikisource

Supported external sources: see below.

What you need[edit]

For external links[edit]

The file's information page should have a link to the work at the external site. For example, an Internet Archive link looks like this: https://archive.org/details/franklesliesilluv1718lesl. This link is present on File:Frank Leslie's Illustrated Newspaper Vol. 18.pdf, so this script works.

Loading high-res images[edit]

You can allow the script to load a high-res image (if found) from the the external source by clicking "High-res options" and checking the checkbox.

Wikisource jump to file script - options dialog.png

The image will be loaded from the external source and will replace the image in the Page editor panel. This only works when editing.

The offset is provided to adjust for files that have had pages inserted or removed, or have been split:

  • If the file at the external source is identical, set "0"
  • If a cover page (e.g. a Google page) has been removed, set "1"

Any other number can be set. For example Index:Frank Leslie's Illustrated Newspaper Vol. 18.pdf has an offset of "192", because it's the second half of a file that was split (it was v. 17–18).

Privacy[edit]

Some parts of this script make requests to third parties, which can leak your personal information, such as IP and user-agent, as well as the work/page you are looking at:

  • Links are gathered by a server-side program at Toolforge on your behalf - your personal information will not be shared at this point
  • High-res images and IIIF data files are loaded directly from third-parties (e.g. the IA, Hathi, etc.) - if you do not agree to this, do not enable hi-res mode.

Requests to WMF wikis (e.g. Wikisource, Commons and Wikidata) are, as always, covered by the WMF Privacy Policy. The Toolforge Pagelist server doesn't collect any personal information.

Technical[edit]

Libraries:

Server backend:

Source list[edit]

Source Example Notes
Internet Archive edit Hi-res, IIIF
Google Books edit No hi-res
Hathi Trust edit Hi-res
BnF Gallica (French national library) edit Hi-res, IIIF
Open ONI newspapers IIIF, JP2, PDF
Digital NC newspapers edit
Historic Oregon Newspapers edit
Pennsylvania Newspaper Archive
Nebraska Newspapers
National Library of Scotland edit Hi-res, IIIF
Modernist Journals edit Hi-res, IIIF
Universität Bielefeld edit (Goobi viewer) Hi-res, IIIF
Library of Congress edit Hi-res JPEG, JP2/TIFF, IIIF
Digital Bodleian edit IIIF, Mirador link