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
|
|
|
|
*
|
|
|
|
* @param {string} id
|
|
|
|
* @constructor
|
|
|
|
*/
|
2016-05-26 10:30:12 +00:00
|
|
|
var Pointer = function ( id ) {
|
|
|
|
this.view = new mw.libs.revisionSlider.PointerView( this, id );
|
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 ) );
|