Jump to content

Help:Extension:ProofreadPage/Pagelist widget

From mediawiki.org

ProofreadPage has a user-friendly widget for editing pagelists , that is used within the Index editing form. It is not available by default, but can be enabled by wiki administrators with a small change to on-wiki configuration.

To use the widget, first open an Index page for editing. Under the 'Pages' field there is a 'Preview pagelist' button along with a checkbox with which to enable the visual mode (explained below).

Click the preview button, and the grid of the pagelist is loaded below. To enter the widget (in either mode), click one of the page numbers. This will open a full-sized dialog window. Note that you should not click the back button to close the dialog, but rather use either the 'X' (close) or 'Insert Changes' buttons.

To switch between visual and wikitext mode, close the dialog and change the checkbox (the currently-selected mode will be remembered for next time you edit an Index page).

There are five parts to the dialog window:

  1. Top bar: close/cancel button; Index page title; and submit button.
  2. Top of left pane: details of the currently-selected page.
  3. Bottom of the left pane: The current page's scan image.
  4. Top of the right pane: the data entry form (either a wikitext text field, or a set of fields when in the visual mode).
  5. Bottom of the right pane: The pagelist preview, showing the currently-configured numbering that will be inserted back into the Index form when the dialog is closed.

Visual mode

[edit]
The visual mode dialog window.
  1. Click on the first page to open the pagelist dialog to that page.
    • You can start on any page you like, but it is recommended to start and the beginning and progress through in order.
  2. Examine the image and check whether the numbering displayed in the top left info bar is the same as what’s on the original printed page.
    • You might need to scroll down to see the page number.
    • Some pages may not have a printed number, but still exist in the work’s pagination. Navigate to previous and following pages to check what the number should be.
  3. If it is, go to the next page.
  4. If it is not, change the number and its type in the form, and click ‘Update pagelist’.
    • The pagelist will now show the new numbering for the whole work.
    • If you select a non-numbering type such as ‘Cover’, the whole work will display as Cover; this is fine, and will be corrected in the next step.
  5. Go to the next page, and repeat from step 2 above.
    • Often, you will be able to skip ahead if you know the numbering is going to be correct for a section of pages. For example, if you set the first page of an introduction to ‘roman’ and 1, then you might click on the tenth page after the current one, to see if it’s still part of the introduction.

Wikitext mode

[edit]

The wikitext mode of the Pagelist widget is the same as editing the pagelist field in the Index editing form. See the Pagelist tag documentation for full details of the syntax.

Configuration (for wiki admins)

[edit]

To enable the pagelist widget, two changes are required to on-wiki configuration.

Firstly, "data": "pagelist" should be added to the relevant field of MediaWiki:Proofreadpage_index_data_config. For example:

    "Pages": {
        "type": "string/line",
        "size": 15,
        "default": "\u003Cpagelist /\u003E",
        "label": "Pages",
        "header": false,
        "help": "",
        "data": "pagelist"
    },

And secondly, the list of page labels should be defined in MediaWiki:Proofreadpage_pagelist_dropdown_values.json. Both the label and data parts of each option should be in the wiki's content language (except for Number, roman, and highroman). For example:

[
    {
        "label": "highroman",
        "data": "highroman"
    },
    {
        "label": "roman",
        "data": "roman"
    },
    {
        "label": "number",
        "data": "Number"
    },
    {
        "label": "Cover",
        "data": "Cover"
    },
    {
        "label": "– (empty)",
        "data": "-"
    },
    {
        "label": "Table of Contents",
        "data": "ToC"
    },
    {
        "label": "Image",
        "data": "img"
    },
    {
        "label": "Add your parameter here",
        "data": "Add your parameter here"
    },
    {
        "label": "Add your parameter here",
        "data": "Add your parameter here"
    }
]

You may also want to translate the messages related to the widget over at translatewiki.net if they already haven't been translated to the language of the wiki.

Debugging (technical users and/or developers)

[edit]

The Pagelist Widget visual mode contains a debugging module that pretty prints the internally stored markup each and every time a user clicks "Update Pagelist". This can help in debugging complex bugs that require multiple interactions as well as provide some insight into how the visual mode constructs the pagelist based on the data the user provides.

The debugging module can be enabled by running mw.storage.set( 'proofreadpage-pagelist-widget-visual-mode-debug', true ); in the browser javascript developer console.