2017 © Pedro Peláez
 

mediawiki-extension value-view

Provides JS widgets to edit values defined by the DataValues library

image

data-values/value-view

Provides JS widgets to edit values defined by the DataValues library

  • JavaScript
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 71 Versions
  • 0 % Grown

The README.md

ValueView

ValueView introduces the jQuery.valueview widget which may be used to display and edit data values (DataValue objects defined in the DataValues library and supported via the DataValues JavaScript package). The jQuery.valueview widget and its resources may be extended to support custom DataValue implementations., (*1)

Recent changes can be found in the release notes., (*2)

Components

jQuery.valueview

jQuery.valueview may be used to display and edit data values. While the widget's original constructor is located at jQuery.valueview.valueview, the widget should be instantiated via its bridge jQuery.valueview., (*3)

jQuery.valueview.Expert

jQuery.valueview.Experts are widgets that deal with editing DataValues. An Expert provides the functionality to edit a specific DataValue (e.g. StringValue) or a DataValue suitable for a certain DataType (e.g. the url DataType which uses the StringValue for representation; see also DataTypes library). jQuery.valueview.Expert is the base constructor for such Experts., (*4)

jQuery.valueview.ExpertExtender

jQuery.valueview.ExpertExtender may be used to provide additional information and/or input elements while interacting with the Expert. The ExpertExtender may, for example, be used to provide a preview of how the parsed value will be displayed after saving (see jQuery.ExpertExtender.Preview). Options provided by the ValueParser corresponding to the DataValue being edited may be set using jQuery.valueview.ExpertExtender.* input elements added to the ExpertExtender instance., (*5)

jQuery.valueview.ExpertStore

Experts are managed by jQuery.valueview.ExpertStore instance which provides its Experts to jQuery.valueview., (*6)

ViewState

ViewState acts as a Facade linking Experts and jQuery.valueview. ViewState allows Experts to observe certain aspects of jQuery.valueview and enables Experts to update the linked jQuery.valueview instance., (*7)

Usage

For the usage examples, it is assumed the following packages are installed: * DataValues * DataValues JavaScript * DataTypes, (*8)

When using jQuery.valueview for handling a DataValue, a jQuery.valueview.ExpertStore with knowledge about an Expert dedicated to the DataValue's type is required and can be set up as follows:, (*9)

var dv = dataValues,
    vv = jQuery.valueview,
    dt = dataTypes,
    experts = new vv.ExpertStore();

var stringValue = new dv.StringValue( 'foo' );

// Consider this a DataType using the StringValue DataValue internally:
var urlDataType = new dt.DataType( 'url', dv.StringValue.TYPE );

experts.registerDataValueExpert( vv.experts.StringValue, dv.StringValue.TYPE );

console.log(
    experts.getExpert( stringValue.getType() )
        === experts.getExpert( urlDataType.getDataValueType(), urlDataType.getId() )
);
// true because "url" DataType's DataValue type is "string"; The "string" DataValue's Expert will be
// used as fall-back.

Now, the jQuery.valueview.ExpertStore can be injected into a new jQuery.valueview instance enabling it to edit "string" DataValues., (*10)

var $subject = $( '

' ).appendTo( $( 'body' ).empty() ); // In addition to the Expert store, a ValueParser store and two ValueFormatters need to be provided. The parser store // features the same mechanisms as the Expert store. For this example, we just initialize the parser store with // the "string" parser as default. The formatters will format a string as it is. var parsers = new valueParsers.ValueParserStore( valueParsers.StringParser ); $subject.valueview( { expertStore: experts, parserStore: parsers, plaintextFormatter: new valueFormatters.StringFormatter(), htmlFormatter: new valueFormatters.StringFormatter(), language: 'en', // language code transmitted to Parser value: new dv.StringValue( 'text' ) } ); var valueView = $subject.data( 'valueview' );

Having created a jQuery.valueview displaying text, the widget's member functions may be used for interaction, for example: * Emptying the view: valueView.value( null ); * Allowing the user to edit the value: valueView.startEditing(); * Stopping the user from editing the value: valueView.stopEditing(); * Returning the current value: valueView.value();, (*11)

Setting a jQuery.valueview instance's value to a DataValue it cannot handle because no suitable Expert can be determined from the ExpertStore will result in an error notification being displayed. Calling .value() will still return the value but the user can neither see nor edit the value., (*12)

Architecture

jQuery.valueview heavily depends on ValueFormatters and ValueParsers defined via the DataValues JavaScript library. ValueFormatters are used to convert DataValue instances to DOM elements, and ValueParsers are used to convert plain strings (which may be accompanied by some options) to DataValue instances. Since Experts only are used for editing values, they are constructed when starting edit mode and destroyed after leaving edit mode. Experts have the following lifecycle: * _init(): Load parsed, formatted and raw (text) values from the jQuery.valueview instance linked via ViewState and initialize DOM. * Edit loop * (User edits) * Expert calls viewNotifier.notify( 'change' ) and triggers parsing and formatting. * rawValue(): Return the current raw (text) value. * (optional) preview.showSpinner(): Replace preview with a loading spinner. * draw(): (Re-)draw non-editable parts of the Expert using the (new) parsed and formatted value from the jQuery.valueview instance (via ViewState) * destroy(): Destroy DOM., (*13)

Other methods an Expert needs to provide: * valueCharacteristics() * focus() * blur(), (*14)

Bugs on Phabricator

https://phabricator.wikimedia.org/project/view/918/, (*15)

The Versions

12/10 2017

0.21.0

0.21.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

25/09 2017

dev-master

9999999-dev https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

03/08 2017

0.20.1

0.20.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

02/08 2017

0.20.0

0.20.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

28/06 2017

0.19.2

0.19.2.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

18/04 2017

0.19.1

0.19.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

14/03 2017

0.19.0

0.19.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

01/02 2017

0.18.2

0.18.2.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

01/02 2017

0.18.1

0.18.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

14/10 2016

0.18.0

0.18.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

05/10 2016

0.17.4

0.17.4.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

01/08 2016

0.17.3

0.17.3.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

28/07 2016

0.17.2

0.17.2.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

13/04 2016

0.17.1

0.17.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

12/04 2016

0.17.0

0.17.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

22/02 2016

0.16.1

0.16.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

10/02 2016

0.16.0

0.16.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

03/02 2016

0.15.11

0.15.11.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

27/01 2016

0.15.10

0.15.10.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

27/01 2016

0.15.8

0.15.8.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

27/01 2016

0.15.9

0.15.9.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

15/01 2016

0.15.7

0.15.7.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

04/11 2015

0.15.6

0.15.6.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

09/09 2015

0.15.5

0.15.5.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

09/09 2015

0.15.4

0.15.4.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

27/08 2015

0.15.3

0.15.3.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

27/08 2015

0.15.2

0.15.2.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

20/08 2015

0.15.1

0.15.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

19/08 2015

0.15.0

0.15.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

11/06 2015

0.14.5

0.14.5.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

10/06 2015

0.14.4

0.14.4.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

02/04 2015

0.14.3

0.14.3.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

31/03 2015

0.14.2

0.14.2.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

16/03 2015

0.14.1

0.14.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

12/03 2015

0.14.0

0.14.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

05/02 2015

0.13.0

0.13.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

28/01 2015

0.12.0

0.12.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

21/01 2015

0.11.0

0.11.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

06/01 2015

0.10.0

0.10.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

17/12 2014

0.9.1

0.9.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

05/12 2014

0.9.0

0.9.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

07/11 2014

0.8.1

0.8.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

03/11 2014

0.8.0

0.8.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

10/09 2014

0.7.0

0.7.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

03/09 2014

0.6.11

0.6.11.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

14/08 2014

0.6.10

0.6.10.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

13/08 2014

0.6.9

0.6.9.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

29/07 2014

0.6.8

0.6.8.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

23/07 2014

0.6.7

0.6.7.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

18/07 2014

0.6.6

0.6.6.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

17/07 2014

0.6.5

0.6.5.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

02/07 2014

0.6.4

0.6.4.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

25/06 2014

0.6.3

0.6.3.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

25/06 2014

0.6.2.1

0.6.2.1 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

16/06 2014

0.6.2

0.6.2.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

09/06 2014

0.6.1

0.6.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

04/06 2014

0.6

0.6.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

01/04 2014

0.5.1

0.5.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

28/03 2014

0.5

0.5.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

27/03 2014

0.4.2

0.4.2.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

26/03 2014

0.4.1

0.4.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

26/03 2014

0.4

0.4.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

24/02 2014

0.3.3

0.3.3.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

24/02 2014

0.3.2

0.3.2.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

12/02 2014

0.3.1

0.3.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

04/02 2014

0.3

0.3.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

30/01 2014

0.2.1

0.2.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

29/01 2014

0.2

0.2.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

28/01 2014

0.2.0-alpha

0.2.0.0-alpha https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

08/01 2014

0.1.1

0.1.1.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires

 

23/12 2013

0.1

0.1.0.0 https://www.mediawiki.org/wiki/Extension:ValueView

Provides JS widgets to edit values defined by the DataValues library

  Sources   Download

GPL-2.0+

The Requires