<table>
<tr style='whitespace:collapse'>
<td>
- <input type='button' id='previous' value='⇦'><input type='button' id='play' value='▷'><input type='button' id='pause' value='◫'><input type='button' id='stop' value='◻'><input type='button' id='next' value='⇨'>
+ <input type='button' id='previous' value='⇦' accesskey='a'><input type='button' id='play' value='▷' accesskey='s'><input type='button' id='pause' value='◫' accesskey='d'><input type='button' id='stop' value='◻' accesskey='f'><input type='button' id='next' value='⇨' accesskey='g'>
</td>
<td>
<input type='button' id='repeat' value='∞'><input type='button' id='random' value='®'><input type='button' id='single' value='§'><input type='button' id='consume' value='©'>
});
};
+window.onkeypress = function(e) {
+ switch (e.keyCode) {
+ case 49: // 1
+ show_page('controls');
+ break;
+ case 50: // 1
+ show_page('metadata');
+ break;
+ case 51: // 1
+ show_page('playlist');
+ break;
+ case 52: // 1
+ show_page('options');
+ break;
+ }
+};
+
function mpc_refresh() {
mpc.status();
}
}
function init_ui(local_keys, sync_keys, options) {
+ var ele, i;
+
/* Setup footer */
+ i = 1;
[
- 'controls', 'metadata', 'options', 'playlist',
+ 'controls', 'metadata', 'playlist', 'options',
].forEach(function(id) {
- document.getElementById('tab.' + id).onclick = show_page;
+ var ele = document.getElementById('tab.' + id);
+ ele.onclick = show_page;
+ ele.title = id + ' [' + i + ']';
+ ++i;
});
/* Setup control tab */
var ele = window['ui_mpc_' + id] = document.getElementById(id);
ele.onchange = ele.onclick = window['tramp_mpc_' + id];
ele.title = id;
+ if (ele.accessKey)
+ ele.title += ' [' + ele.accessKey + ']'
});
window['ui_mpc_currtime'] = document.getElementById('currtime');