Merge pull request #94 from lukeIam/develop

Added a "p"-button to the apps keyboard (required for selecting player)
This commit is contained in:
Stephan Sundermann committed 2014-01-14 11:35:58 -08:00
commit bf97a60327
2 files changed
+23 -14

No files matched your search

+3
View File
@@ -297,6 +297,9 @@
<div class="ui-block-c"> <div class="ui-block-c">
<a data-role="button" id="keyboardButtonReturn" data-i18n="keyboardButtonReturn"></a> <a data-role="button" id="keyboardButtonReturn" data-i18n="keyboardButtonReturn"></a>
</div> </div>
<div class="ui-block-c">
<a data-role="button" id="keyboardButtonP">P</a>
</div>
</div> </div>
<!-- <div style> <!-- <div style>
<label for="keyboardButtonKeys" data-i18n="keyboardButtonKeys"></label> <label for="keyboardButtonKeys" data-i18n="keyboardButtonKeys"></label>
+20 -14
View File
@@ -22,14 +22,14 @@ if (document.location.protocol == "file:") {
}); });
} }
function preStart(){ function preStart() {
translationLoaded = $.Deferred(); translationLoaded = $.Deferred();
initTranslation(); initTranslation();
translationLoaded.done(function () { translationLoaded.done(function () {
translate(); translate();
start(); start();
}); });
} }
function start() { function start() {
@@ -413,24 +413,24 @@ function initPageLoadHandler() {
TR_USERROLE_ADMIN: 2, TR_USERROLE_ADMIN: 2,
TR_USERROLE_KEYBOARDUSER: 4, TR_USERROLE_KEYBOARDUSER: 4,
TR_USERROLE_ADDSONGSUSER: 8, TR_USERROLE_ADDSONGSUSER: 8,
TR_USERROLE_PLAYLISTEDITOR: 16, TR_USERROLE_PLAYLISTEDITOR: 16,
TR_USERROLE_PROFILEEDITOR: 32 TR_USERROLE_PROFILEEDITOR: 32
}; };
for (var roleName in userRoles) { for (var roleName in userRoles) {
$('#' + roleName).prop("checked", ((result & userRoles[roleName]) != 0)).checkboxradio("refresh"); $('#' + roleName).prop("checked", ((result & userRoles[roleName]) != 0)).checkboxradio("refresh");
} }
$('#btnRoleSave').unbind('click').click(function () { $('#btnRoleSave').unbind('click').click(function () {
var role = 0; var role = 0;
for (var roleName2 in userRoles) { for (var roleName2 in userRoles) {
if ($('#' + roleName2).prop("checked")) { if ($('#' + roleName2).prop("checked")) {
role = (role | userRoles[roleName2]); role = (role | userRoles[roleName2]);
} }
} }
request({ request({
url: "setUserRole?profileId=" + profileIdRequest + "&userRole=" + role, url: "setUserRole?profileId=" + profileIdRequest + "&userRole=" + role,
headers: { "session": sessionId } headers: { "session": sessionId }
@@ -926,6 +926,12 @@ function initKeyboardPageHandler() {
}); });
}); });
$('#keyboardButtonP').click(function () {
request({
url: "sendKeyEvent?key=p"
});
});
$('#keyboardButtonKeys').keyup(function (e) { $('#keyboardButtonKeys').keyup(function (e) {
var c = String.fromCharCode(e.keyCode); var c = String.fromCharCode(e.keyCode);
if (c.match(/\w/)) { if (c.match(/\w/)) {
@@ -1279,4 +1285,4 @@ function translate() {
}; };
$('body').i18n(); $('body').i18n();
repairButtons(); repairButtons();
} }