2016-05-03 11:26:42 +00:00
|
|
|
( function ( mw, $ ) {
|
2016-06-17 13:06:12 +00:00
|
|
|
/**
|
|
|
|
* Module containing logic for the revision pointers
|
|
|
|
*
|
2016-07-02 20:14:00 +00:00
|
|
|
* @param {string} name
|
2016-06-17 13:06:12 +00:00
|
|
|
* @constructor
|
|
|
|
*/
|
2016-07-02 20:14:00 +00:00
|
|
|
var Pointer = function ( name ) {
|
|
|
|
this.view = new mw.libs.revisionSlider.PointerView( this, name );
|
2016-05-03 11:26:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
$.extend( Pointer.prototype, {
|
|
|
|
/**
|
2016-06-17 13:06:12 +00:00
|
|
|
* @type {number}
|
2016-05-03 11:26:42 +00:00
|
|
|
*/
|
|
|
|
position: 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @type {PointerView}
|
|
|
|
*/
|
|
|
|
view: null,
|
|
|
|
|
2016-06-17 13:06:12 +00:00
|
|
|
/**
|
|
|
|
* @param {number} p
|
|
|
|
*/
|
2016-05-03 11:26:42 +00:00
|
|
|
setPosition: function ( p ) {
|
|
|
|
this.position = p;
|
|
|
|
},
|
|
|
|
|
2016-06-17 13:06:12 +00:00
|
|
|
/**
|
|
|
|
* @return {number}
|
|
|
|
*/
|
2016-05-03 11:26:42 +00:00
|
|
|
getPosition: function () {
|
|
|
|
return this.position;
|
|
|
|
},
|
|
|
|
|
2016-06-17 13:06:12 +00:00
|
|
|
/**
|
|
|
|
* @return {PointerView}
|
|
|
|
*/
|
2016-05-03 11:26:42 +00:00
|
|
|
getView: function () {
|
|
|
|
return this.view;
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
|
|
|
mw.libs.revisionSlider = mw.libs.revisionSlider || {};
|
|
|
|
mw.libs.revisionSlider.Pointer = Pointer;
|
|
|
|
}( mediaWiki, jQuery ) );
|