Extension:ValueView

This library and its documentation can be found on GitHub.

ValueView introduces the jQuery.ui.widget based front-end component jquery.valueview which allows to display and edit data values defined by the DataValues extension.

Components
When loading the jquery.valueview resource loader definition, the following components introduced by this extension will be available:


 * jquery.valueview: Widget for displaying and editing data values.
 * mediaWiki.ext.valueView: Object representing the "ValueView" MediaWiki extension. When loaded, this will hook jQuery.valueview up to some of its basic formatters by overwriting

jquery.valueview
jquery.valueview introduces a jQuery widget for displaying and editing data values, open for extension to support custom data value implementations. It consists out of the following parts:


 * jQuery.valueview.valueview : Widget definition for displaying and editing data values. Each data value which should be supported by the valueview widget has to be implemented as a.
 * jQuery.fn.valueview : jQuery widget bridge to instantiate a  widget in the DOM.
 * jQuery.valueview.Expert : Base for strategies defining how to handle (edit/display) data values of a specific data value type or data values suitable for a certain data type.
 * jQuery.valueview.ExpertFactory : Factory for creating jQuery.valueview.Expert instances.
 * jQuery.valueview.ViewState : Link between experts and valueview widget in form of a facade that allows experts to observe certain aspects of a valueview.
 * jQuery.valueview.experts : Expert definitions for some basic data value types.

Usage
When using the jQuery valueview widget for handling a data value of some sort, an ExpertFactory with knowledge about an Expert dedicated to the used data value type is required and can be set up as follows:

The ExpertFactory  can now be injected into a new jQuery.valueview which will then be able to present string data values.

Creates a jQuery.valueview displaying text. or alternatively  will now allow to invoke member functions. For example:


 * Emptying the view:
 * Allowing the user to edit the value:
 * Stopping the user from editing the value any further:
 * Returning the current value:

Setting the view to a data value it can not handle because of lack of a suitable expert will result into a proper notification being displayed. Calling  will still return the value but the user can neither see nor edit the value.

Adding support for custom data value types
Supporting a new data value type will require implementation of a suitable jQuery.valueview.Expert as well as its registration to the jQuery.valueview.ExpertFactory instance used in the actual valueview widget.

Dependencies
See  for dependencies of this library. These dependencies are shipped as part of the MediaWiki extension while the core jQuery.valueview component can be found under.

Requirements

 * DataValues extension must be installed
 * DataTypes extension must be installed

Installation
Once you have downloaded the code, place the DataValues directory within your MediaWiki 'extensions' directory. Then add the following code to your LocalSettings.php file: