With Méthode Swing it’s possible to add manipulation to version compare.

Registration of a custom version compare handling

To register a custom version compare manipulation, use the following namespace

eidosmedia.webclient.extensions.versionCompare

and its function

register( options )
Table 1. Method information

Method

register

Parameter

Required {object} options - An object containing one function that will be invoked to perform the version compare manipulation.

Supported functions:

  • "selectVersion": Select a version number among the avilable ones

Returns

{undefined} undefined

The following is a very simple registration for a version compare manipulation.

(function(){

    eidosmedia.webclient.extensions.versionCompare.register({'selectVersion': ( versions ) => {

            let versionNumber;

            try {

                /**
                 * Select the version number to compare
                 */
                versionNumber = versions[1].version_number;

            } catch (ex) {
                console.log("custom select version exception caught", ex);
            }

            return {versionNumber};
    }});
})();
  • "selectVersion" Must have one parameters. The parameter is mandatory and contains the available versions.

Wrap all the custom manipulation with a try…​catch block to allow Swing to work correctly if something goes wrong.