User:PerfektesChaos/js/isbnLib

JavaScript function library of utilities to analyze and format ISBN.

Libraries of ../WikiSyntaxTextMod/ (WSTM) are shared and made available internally.

Installation
Gadget programmers need to wait for correct installation of this script before any function can be used. This requires two steps, loading and executing. Loading again would not be meaningful if already done. Therefore the state of this script is checked first. Another gadget which also uses this script library might have loaded already.

When loading of all components has been completed, the  hook will be fired.

Here is  a callback function with the actual functionality of the user application.

may use one parameter. That is the application object for the library. It is supposed to be mapped into  also.

API
All API functions are components of the  parameter in the hook function, which is mapped to the   application object.

.factory
Create a RegExp string for ISBN detection, to find even faulty formatted ISBN.

.finder
Retrieve set of library catalog URLs for a particular language.

.flip
Retrieve corresponding ISBN-10 for ISBN-13, or ISBN-13 for ISBN-10.

.focus
Guess language(s) from ISBN.

.format
Format an ISBN.

.furnish
Add resolvers to default catalogs.

Internals
The library is utilising components of WikiSyntaxTextMod (currently S and U).

A /qunit/ test is available.

Codes
de:User:PerfektesChaos/js/isbnLib