API: JS: Override

ebollens edited this page Oct 3, 2011 · 1 revision
Clone this wiki locally

Description

This functionality allows the client to override their device classification with any classification equal to or lesser than their actual classification. To invoke this functionality, all the client must do is define a GET parameter "override"={"basic","standard","full"} in their request string to a page powered by the MWF. To return to their actual classification, they should include the GET parameter "override"="no" in their request string to a page powered by the MWF.

The mwf.override object does not itself provide any new methods. However, it does add several methods to mwf.classification.

This functionality is defined in assets/js/core/override.js and is automatically loaded by the JS handler.

Current (MWF 1.2)

The following functions is always added to mwf.classification by mwf.override:

  • mwf.classiciation.isOverride()

If the client has overridden the default classification, then the following functions are defined/redefined within mwf.classification by mwf.override:

  • mwf.classiciation.wasFull() If the device's actual classification is full.

  • mwf.classiciation.wasStandard() If the device's actual classification is at least standard.

  • mwf.classiciation.wasBasic() Always true as all device were at least basic.

  • mwf.classiciation.isFull() If "override"="full" and mwf.classification.wasFull() is true.

  • mwf.classiciation.isStandard() If "override"={"standard","full"} and mwf.classificiation.wasStandard() is true.

  • mwf.classiciation.isBasic() Always true as an override cannot be to less than basic.

Previous (MWF 1.0-1.1)

This functionality was not necessary before MWF 1.2, as MWF 1.0-1.1 performed override logic server-side and then pushed the data client-side.