mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 11:40:43 +00:00
ada6498b81
Change-Id: I46c3dceaddae84b279625caec3349aa10d931048
62 lines
1 KiB
JavaScript
62 lines
1 KiB
JavaScript
( function ( mw, $ ) {
|
|
/**
|
|
* Module containing logic for the revision pointers
|
|
*
|
|
* @param {string} name
|
|
* @constructor
|
|
*/
|
|
var Pointer = function ( name ) {
|
|
this.view = new mw.libs.revisionSlider.PointerView( this, name );
|
|
this.line = new mw.libs.revisionSlider.PointerLine( this, name );
|
|
};
|
|
|
|
$.extend( Pointer.prototype, {
|
|
/**
|
|
* @type {number}
|
|
*/
|
|
position: 0,
|
|
|
|
/**
|
|
* @type {PointerView}
|
|
*/
|
|
view: null,
|
|
|
|
/**
|
|
* @type {PointerLine}
|
|
*/
|
|
line: null,
|
|
|
|
/**
|
|
* @param {number} p
|
|
*/
|
|
setPosition: function ( p ) {
|
|
this.position = p;
|
|
this.getView().setDataPositionAttribute( p );
|
|
},
|
|
|
|
/**
|
|
* @return {number}
|
|
*/
|
|
getPosition: function () {
|
|
return this.position;
|
|
},
|
|
|
|
/**
|
|
* @return {PointerView}
|
|
*/
|
|
getView: function () {
|
|
return this.view;
|
|
},
|
|
|
|
/**
|
|
* @return {PointerLine}
|
|
*/
|
|
getLine: function () {
|
|
return this.line;
|
|
}
|
|
} );
|
|
|
|
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
|
|
mw.libs.revisionSlider.Pointer = Pointer;
|
|
}( mediaWiki, jQuery ) );
|