Patch WebserverFlokuepDevelopTest
This commit is contained in:
1 parent
42b82f5b29
commit
0c807862a8
8 files changed
+270
-60
No files matched your search
@@ -6,7 +6,7 @@ namespace ServerLib
|
|||||||
internal static class CUserRoleControl
|
internal static class CUserRoleControl
|
||||||
{
|
{
|
||||||
private static readonly Dictionary<EUserRoles, EUserRights> _RoleRightsMapping = new Dictionary<EUserRoles, EUserRights> {
|
private static readonly Dictionary<EUserRoles, EUserRights> _RoleRightsMapping = new Dictionary<EUserRoles, EUserRights> {
|
||||||
{EUserRoles.Administrator,
|
{EUserRoles.TR_USERROLE_ADMIN,
|
||||||
(EUserRights.EditAllProfiles|
|
(EUserRights.EditAllProfiles|
|
||||||
EUserRights.UploadPhotos|
|
EUserRights.UploadPhotos|
|
||||||
EUserRights.ViewOtherProfiles|
|
EUserRights.ViewOtherProfiles|
|
||||||
@@ -16,10 +16,23 @@ namespace ServerLib
|
|||||||
EUserRights.CreatePlaylists|
|
EUserRights.CreatePlaylists|
|
||||||
EUserRights.DeletePlaylists|
|
EUserRights.DeletePlaylists|
|
||||||
EUserRights.RemoveSongsFromPlaylists)},
|
EUserRights.RemoveSongsFromPlaylists)},
|
||||||
{EUserRoles.AuthenticatedUser,
|
{EUserRoles.TR_USERROLE_GUEST,
|
||||||
|
EUserRights.None},
|
||||||
|
{EUserRoles.TR_USERROLE_NORMAL,
|
||||||
(EUserRights.UploadPhotos|
|
(EUserRights.UploadPhotos|
|
||||||
EUserRights.ViewOtherProfiles|
|
EUserRights.ViewOtherProfiles)},
|
||||||
EUserRights.UseKeyboard)}
|
{EUserRoles.TR_USERROLE_KEYBOARDUSER,
|
||||||
|
EUserRights.UseKeyboard},
|
||||||
|
{EUserRoles.TR_USERROLE_ADDSONGSUSER,
|
||||||
|
EUserRights.AddSongToPlaylist},
|
||||||
|
{EUserRoles.TR_USERROLE_PLAYLISTEDITOR,
|
||||||
|
(EUserRights.AddSongToPlaylist|
|
||||||
|
EUserRights.ReorderPlaylists|
|
||||||
|
EUserRights.CreatePlaylists|
|
||||||
|
EUserRights.DeletePlaylists|
|
||||||
|
EUserRights.RemoveSongsFromPlaylists)},
|
||||||
|
{EUserRoles.TR_USERROLE_PROFILEEDITOR,
|
||||||
|
EUserRights.EditAllProfiles}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,12 @@ namespace ServerLib
|
|||||||
[Flags]
|
[Flags]
|
||||||
internal enum EUserRoles
|
internal enum EUserRoles
|
||||||
{
|
{
|
||||||
GuestUser = 0,
|
TR_USERROLE_GUEST = 0,
|
||||||
AuthenticatedUser = 1,
|
TR_USERROLE_NORMAL = 1,
|
||||||
Administrator = 2
|
TR_USERROLE_ADMIN = 2,
|
||||||
|
TR_USERROLE_KEYBOARDUSER = 4,
|
||||||
|
TR_USERROLE_ADDSONGSUSER = 8,
|
||||||
|
TR_USERROLE_PLAYLISTEDITOR = 16,
|
||||||
|
TR_USERROLE_PROFILEEDITOR = 32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+12
-10
@@ -212,7 +212,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void LoadProfiles()
|
public static void LoadProfiles()
|
||||||
{
|
{
|
||||||
var change = new SChange {Action = EAction.LoadProfiles};
|
var change = new SChange { Action = EAction.LoadProfiles };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -222,7 +222,7 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public static void LoadAvatars()
|
public static void LoadAvatars()
|
||||||
{
|
{
|
||||||
var change = new SChange {Action = EAction.LoadAvatars};
|
var change = new SChange { Action = EAction.LoadAvatars };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -235,7 +235,7 @@ namespace Vocaluxe.Base
|
|||||||
if (newProfile == null)
|
if (newProfile == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.AddProfile, Profile = newProfile};
|
var change = new SChange { Action = EAction.AddProfile, Profile = newProfile };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -248,7 +248,7 @@ namespace Vocaluxe.Base
|
|||||||
if (editProfile == null)
|
if (editProfile == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.EditProfile, Profile = editProfile};
|
var change = new SChange { Action = EAction.EditProfile, Profile = editProfile };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -261,7 +261,7 @@ namespace Vocaluxe.Base
|
|||||||
if (!IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.DeleteProfile, ProfileID = profileID};
|
var change = new SChange { Action = EAction.DeleteProfile, ProfileID = profileID };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -274,7 +274,7 @@ namespace Vocaluxe.Base
|
|||||||
if (newAvatar == null)
|
if (newAvatar == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.AddAvatar, Avatar = newAvatar};
|
var change = new SChange { Action = EAction.AddAvatar, Avatar = newAvatar };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -287,7 +287,7 @@ namespace Vocaluxe.Base
|
|||||||
if (editAvatar == null)
|
if (editAvatar == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var change = new SChange {Action = EAction.EditAvatar, Avatar = editAvatar};
|
var change = new SChange { Action = EAction.EditAvatar, Avatar = editAvatar };
|
||||||
|
|
||||||
lock (_QueueMutex)
|
lock (_QueueMutex)
|
||||||
{
|
{
|
||||||
@@ -442,8 +442,10 @@ namespace Vocaluxe.Base
|
|||||||
{
|
{
|
||||||
if (!IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return;
|
return;
|
||||||
|
//Only allow the change of TR_USERROLE_GUEST, TR_USERROLE_NORMAL and TR_USERROLE_ADMIN
|
||||||
_Profiles[profileID].UserRole = option;
|
const EUserRole mask = (EUserRole.TR_USERROLE_GUEST | EUserRole.TR_USERROLE_NORMAL | EUserRole.TR_USERROLE_ADMIN);
|
||||||
|
option &= mask;
|
||||||
|
_Profiles[profileID].UserRole = (_Profiles[profileID].UserRole & ~mask) | option;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EOffOn GetActive(int profileID)
|
public static EOffOn GetActive(int profileID)
|
||||||
@@ -464,7 +466,7 @@ namespace Vocaluxe.Base
|
|||||||
if (!IsProfileIDValid(profileID))
|
if (!IsProfileIDValid(profileID))
|
||||||
return true; // this will prevent from saving dummy profiles to highscore db
|
return true; // this will prevent from saving dummy profiles to highscore db
|
||||||
|
|
||||||
return _Profiles[profileID].UserRole == EUserRole.TR_USERROLE_GUEST;
|
return _Profiles[profileID].UserRole.HasFlag(EUserRole.TR_USERROLE_GUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsActive(int profileID)
|
public static bool IsActive(int profileID)
|
||||||
|
|||||||
@@ -228,7 +228,10 @@ namespace Vocaluxe.Base.Server
|
|||||||
|
|
||||||
if (profile.Type >= 0 && profile.Type <= 1)
|
if (profile.Type >= 0 && profile.Type <= 1)
|
||||||
{
|
{
|
||||||
newProfile.UserRole = (EUserRole)profile.Type;
|
var option = profile.Type == 0 ? EUserRole.TR_USERROLE_GUEST : EUserRole.TR_USERROLE_NORMAL;
|
||||||
|
//Only allow the change of TR_USERROLE_GUEST and TR_USERROLE_NORMAL
|
||||||
|
const EUserRole mask = EUserRole.TR_USERROLE_NORMAL;
|
||||||
|
newProfile.UserRole = (newProfile.UserRole & mask) | option;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(profile.Password))
|
if (!string.IsNullOrEmpty(profile.Password))
|
||||||
@@ -281,7 +284,8 @@ namespace Vocaluxe.Base.Server
|
|||||||
IsEditable = !isReadonly,
|
IsEditable = !isReadonly,
|
||||||
ProfileId = profile.ID,
|
ProfileId = profile.ID,
|
||||||
PlayerName = profile.PlayerName,
|
PlayerName = profile.PlayerName,
|
||||||
Type = (int)profile.UserRole,
|
//Is TR_USERROLE_GUEST or TR_USERROLE_NORMAL?
|
||||||
|
Type = (profile.UserRole.HasFlag(EUserRole.TR_USERROLE_NORMAL)?1:0),
|
||||||
Difficulty = (int)profile.Difficulty
|
Difficulty = (int)profile.Difficulty
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -673,7 +677,10 @@ namespace Vocaluxe.Base.Server
|
|||||||
throw new ArgumentException("Invalid profileId");
|
throw new ArgumentException("Invalid profileId");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int)profile.UserRole;
|
//Hide TR_USERROLE_GUEST and TR_USERROLE_NORMAL
|
||||||
|
const EUserRole mask = (EUserRole.TR_USERROLE_GUEST | EUserRole.TR_USERROLE_NORMAL);
|
||||||
|
|
||||||
|
return (int)(profile.UserRole & ~mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void _SetUserRole(int profileId, int userRole)
|
private static void _SetUserRole(int profileId, int userRole)
|
||||||
@@ -684,7 +691,13 @@ namespace Vocaluxe.Base.Server
|
|||||||
throw new ArgumentException("Invalid profileId");
|
throw new ArgumentException("Invalid profileId");
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.UserRole = (EUserRole)userRole;
|
var option = (EUserRole)userRole;
|
||||||
|
|
||||||
|
//Only allow the change of all options exept TR_USERROLE_GUEST and TR_USERROLE_NORMAL
|
||||||
|
const EUserRole mask = (EUserRole.TR_USERROLE_GUEST | EUserRole.TR_USERROLE_NORMAL);
|
||||||
|
option &= ~mask;
|
||||||
|
|
||||||
|
profile.UserRole = (profile.UserRole & mask) | option;
|
||||||
|
|
||||||
CProfiles.EditProfile(profile);
|
CProfiles.EditProfile(profile);
|
||||||
CProfiles.Update();
|
CProfiles.Update();
|
||||||
|
|||||||
@@ -329,10 +329,16 @@
|
|||||||
<div id="displayUserAdminContent" data-role="content">
|
<div id="displayUserAdminContent" data-role="content">
|
||||||
<fieldset data-role="controlgroup">
|
<fieldset data-role="controlgroup">
|
||||||
<legend></legend>
|
<legend></legend>
|
||||||
<input type="checkbox" id="roleAuthenticatedUser" checked="checked" disabled="disabled">
|
<input type="checkbox" id="TR_USERROLE_ADMIN">
|
||||||
<label for="roleAuthenticatedUser">AuthenticatedUser</label>
|
<label for="TR_USERROLE_ADMIN">Administrator</label>
|
||||||
<input type="checkbox" id="roleAdministrator">
|
<input type="checkbox" id="TR_USERROLE_KEYBOARDUSER">
|
||||||
<label for="roleAdministrator">Administrator</label>
|
<label for="TR_USERROLE_KEYBOARDUSER">Keyboard</label>
|
||||||
|
<input type="checkbox" id="TR_USERROLE_ADDSONGSUSER">
|
||||||
|
<label for="TR_USERROLE_ADDSONGSUSER">AddSongs</label>
|
||||||
|
<input type="checkbox" id="TR_USERROLE_PLAYLISTEDITOR">
|
||||||
|
<label for="TR_USERROLE_PLAYLISTEDITOR">PlaylistEditor</label>
|
||||||
|
<input type="checkbox" id="TR_USERROLE_PROFILEEDITOR">
|
||||||
|
<label for="TR_USERROLE_PROFILEEDITOR">ProfileEditor</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<a data-role="button" id="btnRoleSave" data-transition="slidefade" data-i18n="displayUserAdminContentSaveButton"></a>
|
<a data-role="button" id="btnRoleSave" data-transition="slidefade" data-i18n="displayUserAdminContentSaveButton"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+195
-29
@@ -7,34 +7,24 @@ var playlistRequestName = "";
|
|||||||
var customSelectPlaylistSongCallback = null;
|
var customSelectPlaylistSongCallback = null;
|
||||||
var sessionId = "";
|
var sessionId = "";
|
||||||
var serverBaseAddress = "";
|
var serverBaseAddress = "";
|
||||||
var tranlationLoaded;
|
|
||||||
|
|
||||||
if (document.location.protocol == "file:") {
|
if (document.location.protocol == "file:") {
|
||||||
if (typeof (window.deviceAndJqmLoaded) == "undefined") {
|
if (typeof (window.deviceAndJqmLoaded) == "undefined") {
|
||||||
window.deviceAndJqmLoaded = $.Deferred();
|
window.deviceAndJqmLoaded = $.Deferred();
|
||||||
}
|
}
|
||||||
window.deviceAndJqmLoaded.done(function () {
|
window.deviceAndJqmLoaded.done(function () {
|
||||||
preStart();
|
start();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
preStart();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function preStart() {
|
|
||||||
tranlationLoaded = $.Deferred();
|
|
||||||
|
|
||||||
initTranslation();
|
|
||||||
|
|
||||||
tranlationLoaded.done(function () {
|
|
||||||
translate();
|
|
||||||
start();
|
start();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
replaceTransitionHandler();
|
replaceTransitionHandler();
|
||||||
|
initTranslation();
|
||||||
initPageLoadHandler();
|
initPageLoadHandler();
|
||||||
initKeyboardPageHandler();
|
initKeyboardPageHandler();
|
||||||
initMainPageHandler();
|
initMainPageHandler();
|
||||||
@@ -410,13 +400,28 @@ function initPageLoadHandler() {
|
|||||||
var promise = request({
|
var promise = request({
|
||||||
url: "getUserRole?profileId=" + profileIdRequest
|
url: "getUserRole?profileId=" + profileIdRequest
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
$('#roleAdministrator').prop("checked", ((result & 0x01) != 0)).checkboxradio("refresh");
|
var userRoles = {
|
||||||
|
TR_USERROLE_ADMIN: 2,
|
||||||
|
TR_USERROLE_KEYBOARDUSER: 4,
|
||||||
|
TR_USERROLE_ADDSONGSUSER: 8,
|
||||||
|
TR_USERROLE_PLAYLISTEDITOR: 16,
|
||||||
|
TR_USERROLE_PROFILEEDITOR: 32
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var roleName in userRoles) {
|
||||||
|
$('#' + 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;
|
||||||
if ($('#roleAdministrator').prop("checked")) {
|
|
||||||
role = (role | 0x01);
|
for (var roleName2 in userRoles) {
|
||||||
|
if ($('#' + roleName2).prop("checked")) {
|
||||||
|
role = (role | userRoles[roleName2]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
request({
|
request({
|
||||||
url: "setUserRole?profileId=" + profileIdRequest + "&userRole=" + role,
|
url: "setUserRole?profileId=" + profileIdRequest + "&userRole=" + role,
|
||||||
headers: { "session": sessionId }
|
headers: { "session": sessionId }
|
||||||
@@ -1239,24 +1244,185 @@ function showWikipedia(artist) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function initTranslation() {
|
function initTranslation() {
|
||||||
$.i18n.init({
|
var translations = {
|
||||||
resGetPath: 'locales/__lng__.json',
|
"en": {
|
||||||
supportedLngs: ['en', 'de'],
|
translation: {
|
||||||
fallbackLng: 'en',
|
'loginName': 'User:',
|
||||||
keyseparator: '::',
|
'loginPassword': 'Password:',
|
||||||
nsseparator: ':::'
|
'loginButton': 'Login',
|
||||||
}).done(function () {
|
'registerButton': 'Create Profile',
|
||||||
tranlationLoaded.resolve();
|
'discoverReadQrButton': 'Scan QRCode',
|
||||||
});
|
'mainPageYourProfileLink': 'Your Profile',
|
||||||
}
|
'mainPageYourProfileLinkDesc': 'Edit your profile',
|
||||||
|
'mainPageCurrentSongLink': 'Current Song',
|
||||||
|
'mainPageCurrentSongLinkDesc': 'Display informations about the current song',
|
||||||
|
'mainPageSelectSong': 'All songs',
|
||||||
|
'mainPageSelectSongDesc': 'Lists all available songs',
|
||||||
|
'mainPageSelectPlaylist': 'All playlists',
|
||||||
|
'mainPageSelectPlaylistDesc': 'Lists all playlists',
|
||||||
|
'mainPageSelectProfile': 'Profiles',
|
||||||
|
'mainPageSelectProfileDesc': 'Shows all profiles',
|
||||||
|
'mainPageTakePhotoLink': 'Take Photo',
|
||||||
|
'mainPageTakePhotoLinkDesc': 'Takes a photo and displays it at the end of the current round',
|
||||||
|
'mainPageKeyboard': 'Keyboard',
|
||||||
|
'mainPageKeyboardDesc': 'Send keys',
|
||||||
|
'mainPageSelectUserAdmin': 'Administration',
|
||||||
|
'mainPageSelectUserAdminDesc': 'Configure user rights',
|
||||||
|
'mainPageLogoutLink': 'Logout',
|
||||||
|
'mainPageLogoutLinkDesc': 'Closes the session',
|
||||||
|
'selectProfileHeader': 'All profiles',
|
||||||
|
'displayProfileHeader': 'Profile',
|
||||||
|
'displayProfileName': 'Name:',
|
||||||
|
'displayProfilePlayerType': 'Player Type:',
|
||||||
|
'displayProfilePlayerTypeNormal': 'Normal',
|
||||||
|
'displayProfilePlayerTypeGuest': 'Guest',
|
||||||
|
'displayProfilePlayerDifficulty': 'Difficulty:',
|
||||||
|
'displayProfilePlayerDifficultyEasy': 'Easy',
|
||||||
|
'displayProfilePlayerDifficultyNormal': 'Normal',
|
||||||
|
'displayProfilePlayerDifficultyHard': 'Hard',
|
||||||
|
'displayProfilePlayerPassword': 'New Password:',
|
||||||
|
'displayProfilePlayerSaveButton': 'Save and upload',
|
||||||
|
'displaySongHeader': 'No current song',
|
||||||
|
'displaySongArtist': 'Artist:',
|
||||||
|
'displaySongGenre': 'Genre:',
|
||||||
|
'displaySongYear': 'Year:',
|
||||||
|
'displaySongLanguage': 'Language:',
|
||||||
|
'displaySongIsDuet': 'Duet:',
|
||||||
|
'popupVideoClose': 'Close',
|
||||||
|
'selectSongHeader': 'All songs',
|
||||||
|
'keyboardHeader': 'Keyboard',
|
||||||
|
'keyboardButtonUp': 'up',
|
||||||
|
'keyboardButtonLeft': 'left',
|
||||||
|
'keyboardButtonRight': 'right',
|
||||||
|
'keyboardButtonDown': 'down',
|
||||||
|
'keyboardButtonEscape': 'escape',
|
||||||
|
'keyboardButtonTab': 'tab',
|
||||||
|
'keyboardButtonReturn': 'return',
|
||||||
|
'keyboardButtonKeys': 'To send other keys type here:',
|
||||||
|
'selectUserAdminHeader': 'All profiles',
|
||||||
|
'displayUserAdminHeader': 'Profile',
|
||||||
|
'displayUserAdminContentSaveButton': 'Save',
|
||||||
|
'selectPlaylistHeader': 'Select a playlist',
|
||||||
|
'displayPlaylistHeader': 'Playlist',
|
||||||
|
'displayPlaylistSaveButton': 'Save',
|
||||||
|
'selectPlaylistAddPlaylistButton': 'Add',
|
||||||
|
'Loading (external)...': 'Loading (external)...',
|
||||||
|
'Loading...': 'Loading...',
|
||||||
|
'Error...': 'Error...',
|
||||||
|
'No connection': 'No connection',
|
||||||
|
'No session': 'No session',
|
||||||
|
'Uploading photo...': 'Uploading photo...',
|
||||||
|
'Getting current song...': 'Getting current song...',
|
||||||
|
'Login...': 'Login...',
|
||||||
|
'Creating profile...': 'Creating profile...',
|
||||||
|
'This is not a valid name.': 'This is not a valid name.',
|
||||||
|
'Uploading profile...': 'Uploading profile...',
|
||||||
|
'songs': 'songs',
|
||||||
|
'YourName': 'YourName',
|
||||||
|
'discoverConnectHeader': 'Connect to server',
|
||||||
|
'discoverConnectServerAddress': 'Serveraddress:',
|
||||||
|
'discoverConnectButton': 'Connect',
|
||||||
|
'Checking...': 'Checking...',
|
||||||
|
'timeout': 'Timeout'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"de": {
|
||||||
|
translation: {
|
||||||
|
'loginName': 'Benutzer:',
|
||||||
|
'loginPassword': 'Passwort:',
|
||||||
|
'loginButton': 'Einloggen',
|
||||||
|
'registerButton': 'Erstelle Profil',
|
||||||
|
'discoverReadQrButton': 'Fotografiere QRCode',
|
||||||
|
'mainPageYourProfileLink': 'Dein Profil',
|
||||||
|
'mainPageYourProfileLinkDesc': 'Bearbeite dein Profil',
|
||||||
|
'mainPageCurrentSongLink': 'Aktuelles Lied',
|
||||||
|
'mainPageCurrentSongLinkDesc': 'Zeigt Informationen über das aktuelle Lied an',
|
||||||
|
'mainPageSelectSong': 'Alle Lieder',
|
||||||
|
'mainPageSelectSongDesc': 'Listet alle verfügbaren Lieder auf',
|
||||||
|
'mainPageSelectPlaylist': 'Alle Playlisten',
|
||||||
|
'mainPageSelectPlaylistDesc': 'Listet alle verfügbaren Playlisten auf',
|
||||||
|
'mainPageSelectProfile': 'Profile',
|
||||||
|
'mainPageSelectProfileDesc': 'Listet alle Profile auf',
|
||||||
|
'mainPageTakePhotoLink': 'Nehme Foto auf',
|
||||||
|
'mainPageTakePhotoLinkDesc': 'Nimmt ein Foto auf und zeigt es am ende der Runde an',
|
||||||
|
'mainPageKeyboard': 'Tastatur',
|
||||||
|
'mainPageKeyboardDesc': 'Sende Tastatureingaben',
|
||||||
|
'mainPageSelectUserAdmin': 'Administration',
|
||||||
|
'mainPageSelectUserAdminDesc': 'Konfiguriere die Benutzerrechte',
|
||||||
|
'mainPageLogoutLink': 'Abmelden',
|
||||||
|
'mainPageLogoutLinkDesc': 'Beendet diese Sitzung',
|
||||||
|
'selectProfileHeader': 'Alle Profile',
|
||||||
|
'displayProfileHeader': 'Profile',
|
||||||
|
'displayProfileName': 'Name:',
|
||||||
|
'displayProfilePlayerType': 'Player Typ:',
|
||||||
|
'displayProfilePlayerTypeNormal': 'Normal',
|
||||||
|
'displayProfilePlayerTypeGuest': 'Gast',
|
||||||
|
'displayProfilePlayerDifficulty': 'Schwierigkeit:',
|
||||||
|
'displayProfilePlayerDifficultyEasy': 'Einfach',
|
||||||
|
'displayProfilePlayerDifficultyNormal': 'Normal',
|
||||||
|
'displayProfilePlayerDifficultyHard': 'Schwer',
|
||||||
|
'displayProfilePlayerPassword': 'Neues Passwort:',
|
||||||
|
'displayProfilePlayerSaveButton': 'Speichern und hochladen',
|
||||||
|
'displaySongHeader': 'Kein aktuelles Lied',
|
||||||
|
'displaySongArtist': 'Künstler:',
|
||||||
|
'displaySongGenre': 'Genre:',
|
||||||
|
'displaySongYear': 'Jahr:',
|
||||||
|
'displaySongLanguage': 'Sprache:',
|
||||||
|
'displaySongIsDuet': 'Duet:',
|
||||||
|
'popupVideoClose': 'Schließen',
|
||||||
|
'selectSongHeader': 'Alle Lieder',
|
||||||
|
'keyboardHeader': 'Tastatur',
|
||||||
|
'keyboardButtonUp': 'hoch',
|
||||||
|
'keyboardButtonLeft': 'links',
|
||||||
|
'keyboardButtonRight': 'rechts',
|
||||||
|
'keyboardButtonDown': 'runter',
|
||||||
|
'keyboardButtonEscape': 'Escape',
|
||||||
|
'keyboardButtonTab': 'Tab',
|
||||||
|
'keyboardButtonReturn': 'Enter',
|
||||||
|
'keyboardButtonKeys': 'Um andere Zeichen zu senden, hier tippen:',
|
||||||
|
'selectUserAdminHeader': 'Alle Profile',
|
||||||
|
'displayUserAdminHeader': 'Profile',
|
||||||
|
'displayUserAdminContentSaveButton': 'Speichern',
|
||||||
|
'selectPlaylistHeader': 'Wähle eine Playlist',
|
||||||
|
'displayPlaylistHeader': 'Playlist',
|
||||||
|
'displayPlaylistSaveButton': 'Speichern',
|
||||||
|
'selectPlaylistAddPlaylistButton': 'Hinzufügen',
|
||||||
|
'Loading (external)...': 'Laden (extern)...',
|
||||||
|
'Loading...': 'Laden...',
|
||||||
|
'Error...': 'Fehler...',
|
||||||
|
'No connection': 'Keine Verbindung',
|
||||||
|
'No session': 'Keine Sitzung',
|
||||||
|
'Uploading photo...': 'Foto hochladen...',
|
||||||
|
'Getting current song...': 'Lade aktuelles Lied...',
|
||||||
|
'Login...': 'Einloggen...',
|
||||||
|
'Creating profile...': 'Erstelle Profil...',
|
||||||
|
'This is not a valid name.': 'Dies ist kein gültiger Name.',
|
||||||
|
'Uploading profile...': 'Profil hochladen...',
|
||||||
|
'songs': 'Lieder',
|
||||||
|
'YourName': 'DeinName',
|
||||||
|
'discoverConnectHeader': 'Verbinde zum Server',
|
||||||
|
'discoverConnectServerAddress': 'Serveradresse:',
|
||||||
|
'discoverConnectButton': 'Verbinden',
|
||||||
|
'Checking...': 'Prüfen...',
|
||||||
|
'timeout': 'Zeitüberschreitung'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function translate() {
|
|
||||||
//repair broken buttons on the first page (get broken while translating)
|
//repair broken buttons on the first page (get broken while translating)
|
||||||
var repairButtons = function () {
|
var repairButtons = function () {
|
||||||
$($('#discoverConnect')[0].childNodes).wrap('<span class="ui-btn-inner"><span class="ui-btn-text"> </span></span>');
|
$($('#discoverConnect')[0].childNodes).wrap('<span class="ui-btn-inner"><span class="ui-btn-text"> </span></span>');
|
||||||
$($('#discoverReadQr')[0].childNodes).wrap('<span class="ui-btn-inner"><span class="ui-btn-text"> </span></span>');
|
$($('#discoverReadQr')[0].childNodes).wrap('<span class="ui-btn-inner"><span class="ui-btn-text"> </span></span>');
|
||||||
};
|
};
|
||||||
|
|
||||||
$('body').i18n();
|
$.i18n.init({
|
||||||
repairButtons();
|
resStore: translations,
|
||||||
|
supportedLngs: ['en', 'de'],
|
||||||
|
fallbackLng: 'en',
|
||||||
|
keyseparator: '::',
|
||||||
|
nsseparator: ':::'
|
||||||
|
}).done(function () {
|
||||||
|
$('body').i18n();
|
||||||
|
repairButtons();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -350,10 +350,15 @@ namespace VocaluxeLib
|
|||||||
NoPopup = -1
|
NoPopup = -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Flags]
|
||||||
public enum EUserRole
|
public enum EUserRole
|
||||||
{
|
{
|
||||||
TR_USERROLE_GUEST = 0,
|
TR_USERROLE_GUEST = 0,
|
||||||
TR_USERROLE_NORMAL = 1,
|
TR_USERROLE_NORMAL = 1,
|
||||||
TR_USERROLE_ADMIN = 2
|
TR_USERROLE_ADMIN = 2,
|
||||||
|
TR_USERROLE_KEYBOARDUSER = 4,
|
||||||
|
TR_USERROLE_ADDSONGSUSER = 8,
|
||||||
|
TR_USERROLE_PLAYLISTEDITOR = 16,
|
||||||
|
TR_USERROLE_PROFILEEDITOR = 32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -370,7 +370,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_Player = player;
|
_Player = player;
|
||||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||||
}
|
}
|
||||||
//Normal activation
|
//Normal activation
|
||||||
else if (active)
|
else if (active)
|
||||||
{
|
{
|
||||||
Selection = 0;
|
Selection = 0;
|
||||||
@@ -379,7 +379,7 @@ namespace VocaluxeLib.Menu
|
|||||||
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
_PlayerSelector.Color = CBase.Theme.GetPlayerColor(player);
|
||||||
_PlayerSelector.Visible = true;
|
_PlayerSelector.Visible = true;
|
||||||
}
|
}
|
||||||
//Deactivate
|
//Deactivate
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Selection = -1;
|
Selection = -1;
|
||||||
@@ -456,7 +456,7 @@ namespace VocaluxeLib.Menu
|
|||||||
return new CStatic(_PartyModeID);
|
return new CStatic(_PartyModeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnloadTextures() {}
|
public void UnloadTextures() { }
|
||||||
|
|
||||||
public void LoadTextures()
|
public void LoadTextures()
|
||||||
{
|
{
|
||||||
@@ -486,7 +486,7 @@ namespace VocaluxeLib.Menu
|
|||||||
for (int j = 0; j < _NumW; j++)
|
for (int j = 0; j < _NumW; j++)
|
||||||
{
|
{
|
||||||
var rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
|
var rect = new SRectF(Rect.X + j * (_TileW + _SpaceW), Rect.Y + i * (_TileH + _SpaceH), _TileW, _TileH, Rect.Z);
|
||||||
var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) {Aspect = EAspect.Crop};
|
var tileStatic = new CStatic(_PartyModeID, _TextureEmptyTile, ColorEmptyTile, rect) { Aspect = EAspect.Crop };
|
||||||
var tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle,
|
var tileText = new CText(rect.X + rect.W / 2, rect.Y + rect.H + _Theme.NameSpace, rect.Z, _Theme.NameHeight, rect.W, EAlignment.Center, _Theme.NameStyle,
|
||||||
_Theme.NameFont, _Theme.NameColor, "");
|
_Theme.NameFont, _Theme.NameColor, "");
|
||||||
_Tiles.Add(new CTile(tileStatic, tileText, -1));
|
_Tiles.Add(new CTile(tileStatic, tileText, -1));
|
||||||
@@ -508,7 +508,8 @@ namespace VocaluxeLib.Menu
|
|||||||
for (int p = 0; p < CBase.Game.GetNumPlayer(); p++)
|
for (int p = 0; p < CBase.Game.GetNumPlayer(); p++)
|
||||||
{
|
{
|
||||||
//Don't show profile if is selected, but if selected and guest
|
//Don't show profile if is selected, but if selected and guest
|
||||||
if (CBase.Game.GetPlayers()[p].ProfileID == profile.ID && profile.UserRole == EUserRole.TR_USERROLE_GUEST)
|
if (CBase.Game.GetPlayers()[p].ProfileID == profile.ID
|
||||||
|
&& profile.UserRole.HasFlag(EUserRole.TR_USERROLE_GUEST))
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user