Jump to content

User talk:Dr pda/editrefs.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

The purpose of this script is to allow the editing of the References section produced by the <references/> or {{reflist}} tags, without having to hunt through the whole article to find the appropriate <ref></ref> tags.

Warning: this script will not work as expected if you are using wikEd (changes to references are lost on clicking Apply changes and preview). As a workaround, toggle to classic text view, use edit refs, then toggle back to wikEd text view.

Installation

[edit]

Add {{subst:js|User:Dr_pda/editrefs.js}} to your monobook.js, and save it.

After saving, you have to bypass your browser's cache to see the changes. Mozilla/Safari: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Internet Explorer: press Ctrl-F5, Opera/Konqueror: press F5.

Usage

[edit]

In edit mode, click the Edit references link in the toolbox (below What links here). This will search the text in the edit box, find all the <ref></ref> tags and display each in a text box for easy editing. Note that the script does not bother to show second and subsequent uses of a named reference, i.e. it will show <ref name="refname">Text goes here</ref>, but not <ref name="refname"/>, since there is nothing to edit in the latter. The numbers of the text boxes should correspond to the numbers of the references in the article, unless there are syntax errors in some of the references, e.g. a named reference without the closing /, e.g. <ref name="refname">.

Once you have made the desired changes, click Apply changes and preview. This does as it says, making the changes to the text in the edit box, then previewing the page. Note that if you only edited a section then the references will not show up in the preview.

If you decide that you don't want to change the references, click Cancel and return to edit. However if you have previously clicked Apply changes and preview, clicking cancel will not undo the changes which have been applied. If you want to get rid of these, just navigate away from the page.

If you have edited the text in any of the textboxes, but want to change it back, and you have not yet clicked Apply changes, then clicking Reset fields will return the text in the textboxes to what it was when you entered "edit references mode"

Tip: for best results enter edit mode for the whole page, then preview the page, before starting to edit references. This way you'll be able to see the references as they currently are while you are editing them.