mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-16 12:00:12 +00:00
7f38c9c579
In my PHPStorm IDE, this makes it possible to follow all methods and properties in these classes, even these that are later defined. Otherwise only the empty stub of each class is found. This might be different in other IDEs. Basically: PHPStorm does not understand the meaning of the $.extend() syntax from jQuery without these hints. Change-Id: I4aa76db183122f6669dc72561441f46f0056d793
65 lines
1 KiB
JavaScript
65 lines
1 KiB
JavaScript
( function () {
|
|
/**
|
|
* 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 );
|
|
};
|
|
|
|
/**
|
|
* @class mw.libs.revisionSlider.Pointer
|
|
*/
|
|
$.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;
|
|
}() );
|