Type registerNamespace CustomControls CustomControls MediaPlayerButton

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Type.registerNamespace('CustomControls');
CustomControls.MediaPlayerButton = function (element)
{
CustomControls.MediaPlayerButton.initializeBase(this, [element]);
this._playImageUrl = null;
this._pauseImageUrl = null;
}
CustomControls.MediaPlayerButton.prototype =
{
initialize : function ()
{
CustomControls.MediaPlayerButton.callBaseMethod(this, 'initialize');
this._onclickHandler = Function.createDelegate(this, this._onClick);
$addHandlers
(
this.get_element(),{'click' : this._onClick}, this
);
this.get_element().src=this._playImageUrl;
},
dispose: function()
{
$clearHandlers(this.get_element());
CustomControls.MediaPlayerButton.callBaseMethod(this, 'dispose');
},
_onClick : function(e)
{
if(this.get_element() && (this.get_element().src.indexOf(this._playImageUrl)==-1))
{
this.get_element().src=this._playImageUrl;
}
else
{
this.get_element().src=this._pauseImageUrl;
}
},
get_playImageUrl : function()
{
return this._playImageUrl;
},
set_playImageUrl : function(value)
{
if(this._playImageUrl !== value)
{
this._playImageUrl = value;
this.raisePropertyChanged('playImageUrl');
}
},
get_pauseImageUrl : function()
{
return this._pauseImageUrl;
},
set_pauseImageUrl : function(value)
{
if(this._pauseImageUrl !== value)
{
this._pauseImageUrl = value;
this.raisePropertyChanged('pauseImageUrl');
}
}
}
CustomControls.MediaPlayerButton.registerClass('CustomControls.MediaPlayerButton',Sys.UI.Control);
if(typeof(Sys) !== 'undefined')
{
Sys.Application.notifyScriptLoaded();
}