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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
/*
* jason - Javascript based skin for xxv
* Copyright(c) 2008-2012, anbr
*
* http://projects.vdr-developer.org/projects/xxv
*
*/
Ext.xxv.RemoteWindow = function() {
Ext.xxv.RemoteWindow.superclass.constructor.call(this, {
title: this.szTitle
,iconCls: 'remote-icon'
,id: 'Remote-win'
,width: 225
,height: 265
,resizable: false
,plain: false
,modal: false
,autoScroll: false
,closeAction: 'hide'
,collapsible: false
,maximizable: false
,items: [
new Ext.form.FormPanel({
id: 'form-panel'
,stateful: false
,forceLayout: true
,baseCls: 'x-plain'
,cls: 'btn-panel'
,items: [
{
xtype: 'buttongroup'
,baseCls: 'x-btn-group'
,items: [
{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-logout-icon', handler: function() { this.onRemote('Power'); } }
]
},{
xtype: 'buttongroup'
,baseCls: 'x-btn-group'
,items: [
{ scale: 'medium', scope: this, width: 32, text: '1', handler: function() { this.onRemote('1'); } }
,{ scale: 'medium', scope: this, width: 32, text: '2', handler: function() { this.onRemote('2'); } }
,{ scale: 'medium', scope: this, width: 32, text: '3', handler: function() { this.onRemote('3'); } }
,{ xtype: 'spacer', width: 12 }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-menu-icon', handler: function() { this.onRemote('Menu'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-up-icon', handler: function() { this.onRemote('Up'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-back-icon', handler: function() { this.onRemote('Back'); } }
]
},{
xtype: 'buttongroup'
,baseCls: 'x-btn-group'
,items: [
{ scale: 'medium', scope: this, width: 32, text: '4', handler: function() { this.onRemote('4'); } }
,{ scale: 'medium', scope: this, width: 32, text: '5', handler: function() { this.onRemote('5'); } }
,{ scale: 'medium', scope: this, width: 32, text: '6', handler: function() { this.onRemote('6'); } }
,{ xtype: 'spacer', width: 12 }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-left-icon', handler: function() { this.onRemote('Left'); } }
,{ scale: 'medium', scope: this, width: 32, text: 'Ok', handler: function() { this.onRemote('Ok'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-right-icon', handler: function() { this.onRemote('Right'); } }
]
},{
xtype: 'buttongroup'
,baseCls: 'x-btn-group'
,items: [
{ scale: 'medium', scope: this, width: 32, text: '7', handler: function() { this.onRemote('7'); } }
,{ scale: 'medium', scope: this, width: 32, text: '8', handler: function() { this.onRemote('8'); } }
,{ scale: 'medium', scope: this, width: 32, text: '9', handler: function() { this.onRemote('9'); } }
,{ scale: 'medium', scope: this, width: 32, text: '0', handler: function() { this.onRemote('Null'); } }
,{ xtype: 'spacer', width: 12 }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-down-icon', handler: function() { this.onRemote('Down'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-back-icon', handler: function() { this.onRemote('Back'); } }
]
},{
xtype: 'buttongroup'
,baseCls: 'x-btn-group'
,items: [
{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-red-icon', handler: function() { this.onRemote('Red'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-green-icon', handler: function() { this.onRemote('Green'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-yellow-icon', handler: function() { this.onRemote('Yellow'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-blue-icon', handler: function() { this.onRemote('Blue'); } }
,{ xtype: 'spacer', width: 12 }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-quiet-icon', handler: function() { this.onRemote('VolumeMinus'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-loud-icon', handler: function() { this.onRemote('VolumePlus'); } }
]
},{
xtype: 'buttongroup'
,baseCls: 'x-btn-group'
,items: [
{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-backward-icon', handler: function() { this.onRemote('FastRew'); } }
,{ xtype: 'spacer', width: 6 }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-record-icon', handler: function() { this.onRemote('Record'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-playback-icon', handler: function() { this.onRemote('Play'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-pause-icon', handler: function() { this.onRemote('Pause'); } }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-stop-icon', handler: function() { this.onRemote('Stop'); } }
,{ xtype: 'spacer', width: 6 }
,{ scale: 'medium', scope: this, width: 32, iconCls: 'remote-forward-icon', handler: function() { this.onRemote('FastFwd'); } }
]
}
]
})
]
});
Ext.xxv.RemoteWindow.superclass.show.apply(this, arguments);
};
Ext.extend(Ext.xxv.RemoteWindow, Ext.Window, {
szTitle : "Remote control"
//,szRemoteSuccess : "Successful transmit remote control data.\r\n{0}"
,szRemoteFailure : "Couldn't transmit remote control data!\r\n{0}"
,hide : function(){
if(this.task) {
Ext.TaskMgr.stop(this.task);
delete this.task;
}
Ext.xxv.RemoteWindow.superclass.hide.apply(this, arguments);
}
,show : function(){
Ext.xxv.RemoteWindow.superclass.show.apply(this, arguments);
}
/******************************************************************************/
,onRemoteSuccess : function( response,options )
{
var json = response.responseText;
var o = eval("("+json+")");
if(!o || !o.data || typeof(o.data) != 'string') {
throw {message: "Ajax.read: Json message not found"};
}
if(!o.success) {
new Ext.xxv.MessageBox().msgFailure(this.szRemoteFailure, o.data);
}
}
,onRemoteFailure : function( response,options )
{
new Ext.xxv.MessageBox().msgFailure(this.szRemoteFailure, response.statusText);
}
,onRemote : function( rc ) {
if(this.Remotetid) Ext.Ajax.abort(this.Remotetid);
this.Remotetid = Ext.Ajax.request({
url: XXV.help.cmdAJAX('r',{ 'data': rc, '__vdr': XXV.menu.host })
,success: this.onRemoteSuccess
,failure: this.onRemoteFailure
,scope: this
});
}
});
Ext.xxv.RemoteWindowOpen = function(){
var viewer = Ext.getCmp('main-tabs');
if(!viewer.Remote){
viewer.Remote = new Ext.xxv.RemoteWindow();
} else {
viewer.Remote.show();
}
};
|