User:Whiteknight/Categorization Gadget

Categorization Gadget (Version 2.06)
To properly categorize your new book, enter the title of your book below and click "Categorize". Once you have categorized your book, you can click "Display" to see the appropriate wiki code. Click "Edit" to open an edit window containing the categorization templates.
You can install this gadget by following the instructions below.

How to Install edit

This script is a Gadget. You can install this script by going to Special:Preferences, going to the "Gadgets" tab, and checking the box labeled Whiteknight's Visual Book Designer.

Once you save your javascript, you may need to clear your cache, typically by pressing + , or some other key combination, depending on your browser.

IE7 IE6 FF2 FF3 Safari Chrome Opera9
Works Works Works Works Works Works Works
Browser Test Codes
Broken: The script does not work in this browser.
Partial: Some (but not all) features of the script work in this browser. Problems may be minor and will probably be listed.
Works: The script works as expected in this browser, and no obvious bugs or errors are present.
Not Tested: I have not tested this script on this browser. It might work, it might not. If you test it, let me know the results.
Browsers not listed here have not been tested or are known not to work

Known Issues edit

None.

About this Gadget edit

This gadget is used to apply categories to a book, and comes in two different parts. This gadget is the first, and the User:Whiteknight/Categorization Links template is the second. This page will only talk about the first part.

Selecting a Category edit

Enter the title of the book in the textbox and click the down-arrow to select a subject. Subjects are arranged by Wikibooks Department, although they do not necessarily line up with the available bookshelves. Once you have picked the appropriate category, click on the "Categorize" button. This will start the categorization process, but will not display any results.

Displaying the Wikitext edit

Once you have pressed the "Categorize" button, you may click the "Display" button. This will show the created wikitext code from the categorization process, as well as some helpful notes for applying these categories to your book.

You may select the "Display" option if you have not entered the Book's title in the textbox. However, the {{Alphabetical}} template will not be properly categorized.

Editing and Saving edit

After you press the "Categorize" button, you can click "Edit" to display a standard edit window that is preloaded with the page text and the generated categorization templates. Check and edit the text to ensure that it is correct, and then press the "Save page" button. This will save the page with the new categorization templates added.

You may not click the "Edit" button unless you have entered a bookname. If the page does not currently exist, the edit window will be blank except for the categorization templates. Do not save a page with just templates.

To Do edit

  • Fix handling of {{Subject}} template.
  • Add an ability to get the text of an existing page, and check if it's already categorized or not.
  • Add multi-select to this gadget

Version History edit

  • 2.06 Small fix to handling of embedded edit windows in chrome/safari
  • 2.05 Added interfaces for multi-select usage in other gadgets.
  • 2.01 Minor fixes, added partial IE support
  • 2.00 Complete rewrite to use the new gadgetscore version. no changed functionality.
  • 1.32 Categorization gadget 2 is not displayed by default, only appears when the javascript is active.
  • 1.31 Fixed XML translation thing
  • 1.30 Changed categorization algorithm, updated some status messages
  • 1.23 Updated to include new core framework, fixed summary message, changed regex to remove cleanup-nc tag
  • 1.22 Refactored form code.
  • 1.21 Added "Loading..." message on Ajax requests.
  • 1.20 Added additional categories, allowed to ignore subjects without proper cats, allowed for subjects without an associated default bookshelf. Changed to "addOnloadHook".
  • 1.11 Added lock to prevent "Edit" on pages that do not exist or are not proper TOCs.
  • 1.10 Added better notes for "Display", added a status message mechanism
  • 1.00 Added all major categories
  • 0.10 Added "edit" function, minor refactor
  • 0.04 Added better support for conditional data elements
  • 0.03 Minor changes in style and wording
  • 0.02 Code refactor
  • 0.01 First uploaded version