mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-23 20:23:05 +00:00
f6a44f43fe
Makes for more modular code. Change-Id: Ic71d7421aea548e5b4a9c4841cd4af49a3d385a5
48 lines
783 B
JavaScript
48 lines
783 B
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 );
|
|
};
|
|
|
|
$.extend( Pointer.prototype, {
|
|
/**
|
|
* @type {number}
|
|
*/
|
|
position: 0,
|
|
|
|
/**
|
|
* @type {PointerView}
|
|
*/
|
|
view: null,
|
|
|
|
/**
|
|
* @param {number} p
|
|
*/
|
|
setPosition: function ( p ) {
|
|
this.position = p;
|
|
},
|
|
|
|
/**
|
|
* @return {number}
|
|
*/
|
|
getPosition: function () {
|
|
return this.position;
|
|
},
|
|
|
|
/**
|
|
* @return {PointerView}
|
|
*/
|
|
getView: function () {
|
|
return this.view;
|
|
}
|
|
} );
|
|
|
|
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
|
|
mw.libs.revisionSlider.Pointer = Pointer;
|
|
}( mediaWiki, jQuery ) );
|