Webserver: -add: localisation
This commit is contained in:
1 parent
ea90d09dc3
commit
6bcd849967
4 files changed
+252
-73
No files matched your search
@@ -393,6 +393,9 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CustomToolNamespace>img</CustomToolNamespace>
|
||||
</Content>
|
||||
<Content Include="Website\js\i18next-1.7.1.min.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Website\js\jquery-1.9.1.min.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CustomToolNamespace>js</CustomToolNamespace>
|
||||
|
||||
+60
-59
@@ -9,26 +9,27 @@
|
||||
<script src="js/jquery.mobile-1.3.2.min.js"></script>
|
||||
<script src="js/jquery-ui-1.10.3.custom.min.js"></script>
|
||||
<script src="js/jquery.ui.touch-punch.min.js"></script>
|
||||
<script src="js/i18next-1.7.1.min.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="login" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div data-role="header">
|
||||
<h1>Login</h1>
|
||||
<h1 data-i18n="">Login</h1>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
<div id="loginContent" data-role="content">
|
||||
<label for="loginName" class="input">User:</label>
|
||||
<label for="loginName" class="input" data-i18n="loginName"></label>
|
||||
<input type="text" id="loginName" name="loginName" data-mini="true">
|
||||
<label for="loginPassword" class="input">Password:</label>
|
||||
<label for="loginPassword" class="input" data-i18n="loginPassword"></label>
|
||||
<input type="password" id="loginPassword" name="loginPassword" data-mini="true">
|
||||
<br />
|
||||
<a data-role="button" id="loginButton">Login</a>
|
||||
<a data-role="button" id="loginButton" data-i18n="loginButton"></a>
|
||||
<br />
|
||||
<hr />
|
||||
<br />
|
||||
<a data-role="button" id="registerButton">Create Profile</a>
|
||||
<a data-role="button" id="registerButton" data-i18n="registerButton"></a>
|
||||
</div>
|
||||
<!-- /content -->
|
||||
</div>
|
||||
@@ -45,64 +46,64 @@
|
||||
<li>
|
||||
<a id="yourProfileLink" href="#" data-transition="slidefade">
|
||||
<img src="img/profile.png">
|
||||
<h2>Your Profile</h2>
|
||||
<p>Edit your profile</p>
|
||||
<h2 data-i18n="mainPageYourProfileLink"></h2>
|
||||
<p data-i18n="mainPageYourProfileLinkDesc"></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="currentSongLink" href="#" data-transition="slidefade">
|
||||
<img src="img/music.png">
|
||||
<h2>Current Song</h2>
|
||||
<p>Display informations about the current song</p>
|
||||
<h2 data-i18n="mainPageCurrentSongLink"></h2>
|
||||
<p data-i18n="mainPageCurrentSongLinkDesc"></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#selectSong" data-transition="slidefade">
|
||||
<img src="img/playlist.png">
|
||||
<h2>All songs</h2>
|
||||
<p>Lists all available songs</p>
|
||||
<h2 data-i18n="mainPageSelectSong"></h2>
|
||||
<p data-i18n="mainPageSelectSongDesc"></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#selectPlaylist" data-transition="slidefade">
|
||||
<img src="img/playlists.png">
|
||||
<h2>All playlists</h2>
|
||||
<p>Lists all playlists</p>
|
||||
<h2 data-i18n="mainPageSelectPlaylist"></h2>
|
||||
<p data-i18n="mainPageSelectPlaylistDesc"></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="mainPageSelectProfile" href="#selectProfile" data-transition="slidefade">
|
||||
<img src="img/profiles.png">
|
||||
<h2>Profiles</h2>
|
||||
<p>Shows all profiles</p>
|
||||
<h2 data-i18n="mainPageSelectProfile"></h2>
|
||||
<p data-i18n="mainPageSelectProfileDesc"></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="mainPageTakePhotoLink" href="#" data-transition="slidefade">
|
||||
<img src="img/photo.png">
|
||||
<h2>Take Photo</h2>
|
||||
<p>Takes a photo and displays it at the end of the current round</p>
|
||||
<h2 data-i18n="mainPageTakePhotoLink"></h2>
|
||||
<p data-i18n="mainPageTakePhotoLinkDesc"></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="mainPageKeyboard" href="#keyboard" data-transition="slidefade">
|
||||
<img src="img/keyboard.png">
|
||||
<h2>Keyboard</h2>
|
||||
<p>Send keys</p>
|
||||
<h2 data-i18n="mainPageKeyboard"></h2>
|
||||
<p data-i18n="mainPageKeyboardDesc"></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#selectUserAdmin" data-transition="slidefade">
|
||||
<img src="img/admin.png">
|
||||
<h2>Administration</h2>
|
||||
<p>Configure user rights</p>
|
||||
<h2 data-i18n="mainPageSelectUserAdmin"></h2>
|
||||
<p data-i18n="mainPageSelectUserAdminDesc"></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id="mainPageLogoutLink" href="#" data-transition="slidefade">
|
||||
<img src="img/logout.png">
|
||||
<h2>Logout</h2>
|
||||
<p>Closes the session</p>
|
||||
<h2 data-i18n="mainPageLogoutLink"></h2>
|
||||
<p data-i18n="mainPageLogoutLinkDesc"></p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -113,7 +114,7 @@
|
||||
|
||||
<div id="selectProfile" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div data-role="header">
|
||||
<h1>All profiles</h1>
|
||||
<h1 data-i18n="selectProfileHeader"></h1>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
@@ -126,32 +127,32 @@
|
||||
|
||||
<div id="displayProfile" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div data-role="header">
|
||||
<h1>Profile</h1>
|
||||
<h1 data-i18n="displayProfileHeader">Profile</h1>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
<div id="displayProfileContent" data-role="content">
|
||||
<img id="playerAvatar" src="img/profile.png" alt="Avatar">
|
||||
<label for="playerName" class="input">Name:</label>
|
||||
<label for="playerName" class="input" data-i18n="displayProfileName"></label>
|
||||
<input type="text" id="playerName" name="playerName" data-mini="true" value="Your Name">
|
||||
|
||||
<label for="playerType" class="select">Player Type:</label>
|
||||
<label for="playerType" class="select" data-i18n="displayProfilePlayerType"></label>
|
||||
<select name="playerType" id="playerType">
|
||||
<option value="0">Normal</option>
|
||||
<option value="1">Guest</option>
|
||||
<option value="0" data-i18n="displayProfilePlayerTypeNormal"></option>
|
||||
<option value="1" data-i18n="displayProfilePlayerTypeGuest"></option>
|
||||
</select>
|
||||
<label for="playerDifficulty" class="select">Difficulty:</label>
|
||||
<label for="playerDifficulty" class="select" data-i18n="displayProfilePlayerDifficulty"></label>
|
||||
<select name="playerDifficulty" id="playerDifficulty">
|
||||
<option value="0">Easy</option>
|
||||
<option value="1">Normal</option>
|
||||
<option value="2">Hard</option>
|
||||
<option value="0" data-i18n="displayProfilePlayerDifficultyEasy"></option>
|
||||
<option value="1" data-i18n="displayProfilePlayerDifficultyNormal"></option>
|
||||
<option value="2" data-i18n="displayProfilePlayerDifficultyHard"></option>
|
||||
</select>
|
||||
|
||||
<label id="playerPasswordLabel" for="playerPassword" class="input">New Password:</label>
|
||||
<label id="playerPasswordLabel" for="playerPassword" class="input" data-i18n="displayProfilePlayerPassword"></label>
|
||||
<input type="password" id="playerPassword" name="playerPassword" data-mini="true" value="**oldPassword**">
|
||||
|
||||
<br />
|
||||
<a data-role="button" id="playerSaveButton">Save and upload</a>
|
||||
<a data-role="button" id="playerSaveButton" data-i18n="displayProfilePlayerSaveButton"></a>
|
||||
</div>
|
||||
<!-- /content -->
|
||||
</div>
|
||||
@@ -159,7 +160,7 @@
|
||||
|
||||
<div id="displaySong" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div data-role="header">
|
||||
<h1 id="displaySongTitle">No current song</h1>
|
||||
<h1 id="displaySongTitle" data-i18n="displaySongHeader"></h1>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
@@ -168,19 +169,19 @@
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<label for="displaySongArtist" class="input">Artist:</label>
|
||||
<label for="displaySongArtist" class="input" data-i18n="displaySongArtist"></label>
|
||||
<span id="displaySongArtist" data-mini="true">-</span>
|
||||
<br />
|
||||
<label for="displaySongGenre" class="input">Genre:</label>
|
||||
<label for="displaySongGenre" class="input" data-i18n="displaySongGenre"></label>
|
||||
<span id="displaySongGenre" data-mini="true">-</span>
|
||||
<br />
|
||||
<label for="displaySongYear" class="input">Year:</label>
|
||||
<label for="displaySongYear" class="input" data-i18n="displaySongYear"></label>
|
||||
<span id="displaySongYear" data-mini="true">-</span>
|
||||
<br />
|
||||
<label for="displaySongLanguage" class="input">Language:</label>
|
||||
<label for="displaySongLanguage" class="input" data-i18n="displaySongLanguage"></label>
|
||||
<span id="displaySongLanguage" data-mini="true">-</span>
|
||||
<br />
|
||||
<label for="displaySongIsDuet" class="input">Duet:</label>
|
||||
<label for="displaySongIsDuet" class="input" data-i18n="displaySongIsDuet"></label>
|
||||
<span id="displaySongIsDuet" data-mini="true">-</span>
|
||||
<br />
|
||||
<br />
|
||||
@@ -196,7 +197,7 @@
|
||||
</div>
|
||||
<!-- /content -->
|
||||
<div data-role="popup" id="popupVideo" data-overlay-theme="a" data-theme="a" data-corners="false" data-tolerance="15,15">
|
||||
<a href="#" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
|
||||
<a href="#" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right" data-i18n="popupVideoClose"></a>
|
||||
<iframe width="480" height="320" seamless></iframe>
|
||||
</div>
|
||||
<!-- /popup -->
|
||||
@@ -205,7 +206,7 @@
|
||||
|
||||
<div id="selectSong" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div data-role="header">
|
||||
<h1>All songs</h1>
|
||||
<h1 data-i18n="selectSongHeader"></h1>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
@@ -218,7 +219,7 @@
|
||||
|
||||
<div id="keyboard" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div data-role="header">
|
||||
<h1>Keyboard</h1>
|
||||
<h1 data-i18n="keyboardHeader"></h1>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
@@ -226,36 +227,36 @@
|
||||
<div class="ui-grid-b">
|
||||
<div class="ui-block-a"></div>
|
||||
<div class="ui-block-b">
|
||||
<a data-role="button" id="keyboardButtonUp">up</a>
|
||||
<a data-role="button" id="keyboardButtonUp" data-i18n="keyboardButtonUp"></a>
|
||||
</div>
|
||||
<div class="ui-block-c"></div>
|
||||
<div class="ui-block-a">
|
||||
<a data-role="button" id="keyboardButtonLeft">left</a>
|
||||
<a data-role="button" id="keyboardButtonLeft" data-i18n="keyboardButtonLeft"></a>
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
</div>
|
||||
<div class="ui-block-c">
|
||||
<a data-role="button" id="keyboardButtonRight">right</a>
|
||||
<a data-role="button" id="keyboardButtonRight" data-i18n="keyboardButtonRight"></a>
|
||||
</div>
|
||||
<div class="ui-block-a"></div>
|
||||
<div class="ui-block-b">
|
||||
<a data-role="button" id="keyboardButtonDown">down</a>
|
||||
<a data-role="button" id="keyboardButtonDown" data-i18n="keyboardButtonDown"></a>
|
||||
</div>
|
||||
<div class="ui-block-c"></div>
|
||||
</div>
|
||||
<div class="ui-grid-b">
|
||||
<div class="ui-block-a">
|
||||
<a data-role="button" id="keyboardButtonEscape">escape</a>
|
||||
<a data-role="button" id="keyboardButtonEscape" data-i18n="keyboardButtonEscape"></a>
|
||||
</div>
|
||||
<div class="ui-block-b">
|
||||
<a data-role="button" id="keyboardButtonTab">tab</a>
|
||||
<a data-role="button" id="keyboardButtonTab" data-i18n="keyboardButtonTab"></a>
|
||||
</div>
|
||||
<div class="ui-block-c">
|
||||
<a data-role="button" id="keyboardButtonReturn">return</a>
|
||||
<a data-role="button" id="keyboardButtonReturn" data-i18n="keyboardButtonReturn"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="keyboardButtonKeys">To send other keys type here:</label>
|
||||
<label for="keyboardButtonKeys" data-i18n="keyboardButtonKeys"></label>
|
||||
<input type="text" id="keyboardButtonKeys" data-mini="true">
|
||||
</div>
|
||||
</div>
|
||||
@@ -265,7 +266,7 @@
|
||||
|
||||
<div id="selectUserAdmin" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div data-role="header">
|
||||
<h1>All profiles</h1>
|
||||
<h1 data-i18n="selectUserAdminHeader"></h1>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
@@ -278,7 +279,7 @@
|
||||
|
||||
<div id="displayUserAdmin" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div data-role="header">
|
||||
<h1>Profile</h1>
|
||||
<h1 data-i18n="displayUserAdminHeader"></h1>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
@@ -290,7 +291,7 @@
|
||||
<input type="checkbox" id="roleAdministrator">
|
||||
<label for="roleAdministrator">Administrator</label>
|
||||
</fieldset>
|
||||
<a data-role="button" id="btnRoleSave" data-transition="slidefade">Save</a>
|
||||
<a data-role="button" id="btnRoleSave" data-transition="slidefade" data-i18n="displayUserAdminContentSaveButton"></a>
|
||||
</div>
|
||||
<!-- /content -->
|
||||
</div>
|
||||
@@ -298,8 +299,8 @@
|
||||
|
||||
<div id="selectPlaylist" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div data-role="header">
|
||||
<h1>Select a playlist</h1>
|
||||
<a id="selectPlaylistAddPlaylistButton" href="#" class="ui-btn-right" data-icon="add">Add</a>
|
||||
<h1 data-i18n="selectPlaylistHeader"></h1>
|
||||
<a id="selectPlaylistAddPlaylistButton" href="#" class="ui-btn-right" data-icon="add" data-i18n="selectPlaylistAddPlaylistButton"></a>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
@@ -312,8 +313,8 @@
|
||||
|
||||
<div id="displayPlaylist" data-content-theme="a" data-role="page" data-add-back-btn="true">
|
||||
<div id="displayPlaylistHeader" data-role="header">
|
||||
<h1>Playlist</h1>
|
||||
<a id="displayPlaylistSaveButton" class="ui-btn-right" href="#" data-icon="add">Save</a>
|
||||
<h1 data-i18n="displayPlaylistHeader"></h1>
|
||||
<a id="displayPlaylistSaveButton" class="ui-btn-right" href="#" data-icon="add" data-i18n="displayPlaylistSaveButton"></a>
|
||||
</div>
|
||||
<!-- /header -->
|
||||
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// i18next, v1.7.1
|
||||
// Copyright (c)2013 Jan Mühlemann (jamuhl).
|
||||
// Distributed under MIT license
|
||||
// http://i18next.com
|
||||
!function(){function a(a,b){if(!b||"function"==typeof b)return a;for(var c in b)a[c]=b[c];return a}function b(a,b,c){var d,e=0,f=a.length,g=void 0===f||"function"==typeof a;if(c)if(g){for(d in a)if(b.apply(a[d],c)===!1)break}else for(;f>e&&b.apply(a[e++],c)!==!1;);else if(g){for(d in a)if(b.call(a[d],d,a[d])===!1)break}else for(;f>e&&b.call(a[e],e,a[e++])!==!1;);return a}function c(a){return"string"==typeof a?a.replace(/[&<>"'\/]/g,function(a){return H[a]}):a}function d(a){var b=function(a){if(window.XMLHttpRequest)return a(null,new XMLHttpRequest);if(window.ActiveXObject)try{return a(null,new ActiveXObject("Msxml2.XMLHTTP"))}catch(b){return a(null,new ActiveXObject("Microsoft.XMLHTTP"))}return a(new Error)},c=function(a){if("string"==typeof a)return a;var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")},d=function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(192|d>>6),b+=String.fromCharCode(128|63&d)):(b+=String.fromCharCode(224|d>>12),b+=String.fromCharCode(128|63&d>>6),b+=String.fromCharCode(128|63&d))}return b},e=function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a=d(a);var c,e,f,g,h,i,j,k="",l=0;do c=a.charCodeAt(l++),e=a.charCodeAt(l++),f=a.charCodeAt(l++),g=c>>2,h=(3&c)<<4|e>>4,i=(15&e)<<2|f>>6,j=63&f,isNaN(e)?i=j=64:isNaN(f)&&(j=64),k+=b.charAt(g)+b.charAt(h)+b.charAt(i)+b.charAt(j),c=e=f="",g=h=i=j="";while(l<a.length);return k},f=function(){for(var a=arguments[0],b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}return a},g=function(a,d,e,h){"function"==typeof e&&(h=e,e={}),e.cache=e.cache||!1,e.data=e.data||{},e.headers=e.headers||{},e.jsonp=e.jsonp||!1,e.async=void 0===e.async?!0:e.async;var i,j=f({accept:"*/*","content-type":"application/x-www-form-urlencoded;charset=UTF-8"},g.headers,e.headers);if(i="application/json"===j["content-type"]?JSON.stringify(e.data):c(e.data),"GET"===a){var k=[];if(i&&(k.push(i),i=null),e.cache||k.push("_="+(new Date).getTime()),e.jsonp&&(k.push("callback="+e.jsonp),k.push("jsonp="+e.jsonp)),k=k.join("&"),k.length>1&&(d+=d.indexOf("?")>-1?"&"+k:"?"+k),e.jsonp){var l=document.getElementsByTagName("head")[0],m=document.createElement("script");return m.type="text/javascript",m.src=d,l.appendChild(m),void 0}}b(function(b,c){if(b)return h(b);c.open(a,d,e.async);for(var f in j)j.hasOwnProperty(f)&&c.setRequestHeader(f,j[f]);c.onreadystatechange=function(){if(4===c.readyState){var a=c.responseText||"";if(!h)return;h(c.status,{text:function(){return a},json:function(){return JSON.parse(a)}})}},c.send(i)})},h={authBasic:function(a,b){g.headers.Authorization="Basic "+e(a+":"+b)},connect:function(a,b,c){return g("CONNECT",a,b,c)},del:function(a,b,c){return g("DELETE",a,b,c)},get:function(a,b,c){return g("GET",a,b,c)},head:function(a,b,c){return g("HEAD",a,b,c)},headers:function(a){g.headers=a||{}},isAllowed:function(a,b,c){this.options(a,function(a,d){c(-1!==d.text().indexOf(b))})},options:function(a,b,c){return g("OPTIONS",a,b,c)},patch:function(a,b,c){return g("PATCH",a,b,c)},post:function(a,b,c){return g("POST",a,b,c)},put:function(a,b,c){return g("PUT",a,b,c)},trace:function(a,b,c){return g("TRACE",a,b,c)}},i=a.type?a.type.toLowerCase():"get";h[i](a.url,a,function(b,c){200===b?a.success(c.json(),b,null):a.error(c.text(),b,null)})}function e(a,b){"function"==typeof a&&(b=a,a={}),a=a||{},K.extend(G,a),delete G.fixLng,"string"==typeof G.ns&&(G.ns={namespaces:[G.ns],defaultNs:G.ns}),"string"==typeof G.fallbackNS&&(G.fallbackNS=[G.fallbackNS]),G.interpolationPrefixEscaped=K.regexEscape(G.interpolationPrefix),G.interpolationSuffixEscaped=K.regexEscape(G.interpolationSuffix),G.lng||(G.lng=K.detectLanguage()),G.lng?G.useCookie&&K.cookie.create(G.cookieName,G.lng,G.cookieExpirationTime,G.cookieDomain):(G.lng=G.fallbackLng,G.useCookie&&K.cookie.remove(G.cookieName)),E=K.toLanguages(G.lng),y=E[0],K.log("currentLng set to: "+y);var c=s;a.fixLng&&(c=function(a,b){return b=b||{},b.lng=b.lng||c.lng,s(a,b)},c.lng=y),M.setCurrentLng(y),A&&G.setJqueryExt&&m();var d;if(A&&A.Deferred&&(d=A.Deferred()),!G.resStore){var e=K.toLanguages(G.lng);"string"==typeof G.preload&&(G.preload=[G.preload]);for(var f=0,g=G.preload.length;g>f;f++)for(var h=K.toLanguages(G.preload[f]),i=0,j=h.length;j>i;i++)e.indexOf(h[i])<0&&e.push(h[i]);return B.sync.load(e,G,function(a,e){C=e,F=!0,b&&b(c),d&&d.resolve(c)}),d?d.promise():void 0}return C=G.resStore,F=!0,b&&b(c),d&&d.resolve(c),d?d.promise():void 0}function f(a,b){"string"==typeof a&&(a=[a]);for(var c=0,d=a.length;d>c;c++)G.preload.indexOf(a[c])<0&&G.preload.push(a[c]);return e(b)}function g(a,b,c){"string"!=typeof b?(c=b,b=G.ns.defaultNs):G.ns.namespaces.indexOf(b)<0&&G.ns.namespaces.push(b),C[a]=C[a]||{},C[a][b]=C[a][b]||{},K.extend(C[a][b],c)}function h(a){G.ns.defaultNs=a}function i(a,b){j([a],b)}funLine truncated
|
||||
+184
-14
@@ -1,4 +1,4 @@
|
||||
var ownProfileId = -1;
|
||||
var ownProfileId = -1;
|
||||
var profileIdRequest = -1;
|
||||
var songIdRequest = -1;
|
||||
var allSongsCache = null;
|
||||
@@ -15,6 +15,7 @@ $(document).ready(function () {
|
||||
initLoginPageHandler();
|
||||
initHeartbeat();
|
||||
initVideoPopup();
|
||||
initTranslation();
|
||||
});
|
||||
|
||||
function replaceTransitionHandler() {
|
||||
@@ -68,7 +69,7 @@ function initPageLoadHandler() {
|
||||
} else {
|
||||
dataToUpload["Password"] = null;
|
||||
}
|
||||
|
||||
|
||||
request({
|
||||
url: "sendProfile",
|
||||
contentType: "application/json;charset=utf-8",
|
||||
@@ -90,7 +91,7 @@ function initPageLoadHandler() {
|
||||
"Avatar": { "base64Data": null },
|
||||
"Difficulty": 0,
|
||||
"IsEditable": true,
|
||||
"PlayerName": "YourName",
|
||||
"PlayerName": i18n.t("YourName") || "YourName",
|
||||
"ProfileId": -1,
|
||||
"Type": 1
|
||||
});
|
||||
@@ -116,7 +117,7 @@ function initPageLoadHandler() {
|
||||
} else {
|
||||
dataToUpload["Password"] = null;
|
||||
}
|
||||
|
||||
|
||||
request({
|
||||
url: "sendProfile",
|
||||
contentType: "application/json;charset=utf-8",
|
||||
@@ -184,8 +185,7 @@ function initPageLoadHandler() {
|
||||
//pageLoadHandler for selectProfile
|
||||
$(document).on('pagebeforeshow', '#selectProfile', function () {
|
||||
var promise = request({
|
||||
url: "getProfileList",
|
||||
headers: { "session": sessionId }
|
||||
url: "getProfileList"
|
||||
}).done(function (data) {
|
||||
$('#selectProfileList').children().remove();
|
||||
|
||||
@@ -213,8 +213,7 @@ function initPageLoadHandler() {
|
||||
//pageLoadHandler for displaySong
|
||||
$(document).on('pagebeforeshow', '#displaySong', function () {
|
||||
var promise = request({
|
||||
url: "getSong?songId=" + songIdRequest,
|
||||
headers: { "session": sessionId }
|
||||
url: "getSong?songId=" + songIdRequest
|
||||
}).done(function (result) {
|
||||
$('#displaySongAddPlaylist').hide();
|
||||
|
||||
@@ -336,8 +335,7 @@ function initPageLoadHandler() {
|
||||
//pageLoadHandler for selectUserAdmin
|
||||
$(document).on('pagebeforeshow', '#selectUserAdmin', function () {
|
||||
var promise = request({
|
||||
url: "getProfileList",
|
||||
headers: { "session": sessionId }
|
||||
url: "getProfileList"
|
||||
}).done(function (data) {
|
||||
$('#selectUserAdminList').children().remove();
|
||||
|
||||
@@ -362,8 +360,7 @@ function initPageLoadHandler() {
|
||||
//pageLoadHandler for displayUserAdmin
|
||||
$(document).on('pagebeforeshow', '#displayUserAdmin', function () {
|
||||
var promise = request({
|
||||
url: "getUserRole?profileId=" + profileIdRequest,
|
||||
headers: { "session": sessionId }
|
||||
url: "getUserRole?profileId=" + profileIdRequest
|
||||
}).done(function (result) {
|
||||
$('#roleAdministrator').prop("checked", ((result & 0x01) != 0)).checkboxradio("refresh");
|
||||
|
||||
@@ -459,7 +456,7 @@ function initPageLoadHandler() {
|
||||
+ '"> <a href="#"> '/*+'<img src="' + ((data[profile].Avatar && data[profile].Avatar.base64Data) ? data[id].Avatar.base64Data : "img/profile.png") + '"> '*/
|
||||
+ ' <h2>' + data[id].PlaylistName + '</h2> <p>'
|
||||
+ data[id].SongCount
|
||||
+ ' songs</p> </a> <a href="#" class="delete" data-icon="delete">Delete</a> </li>')
|
||||
+ ' ' + i18n.t('songs') + '</p> </a> <a href="#" class="delete" data-icon="delete">Delete</a> </li>')
|
||||
.appendTo('#selectPlaylistContentList');
|
||||
line.find('a:not(.delete)').click(handleSelectSongLineClick);
|
||||
line.find('a.delete').click(handleSelectSongLineDeleteClick);
|
||||
@@ -492,7 +489,7 @@ function initPageLoadHandler() {
|
||||
});
|
||||
});
|
||||
} else {
|
||||
alert("This is not a name.");
|
||||
alert(i18n.t("This is not a valid name."));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -907,6 +904,9 @@ function request(data, message) {
|
||||
}
|
||||
|
||||
if (message != "noOverlay") {
|
||||
if (i18n.t) {
|
||||
message = i18n.t(message) || message;
|
||||
}
|
||||
$('div[data-role="content"]').wrap('<div class="overlay" />');
|
||||
$.mobile.loading('show', {
|
||||
text: message,
|
||||
@@ -920,6 +920,9 @@ function request(data, message) {
|
||||
|
||||
if (message == "external") {
|
||||
message = "Loading (external)...";
|
||||
if (i18n.t) {
|
||||
message = i18n.t(message) || message;
|
||||
}
|
||||
} else {
|
||||
data["headers"]["session"] = sessionId;
|
||||
}
|
||||
@@ -949,6 +952,10 @@ function showError(message) {
|
||||
message = "Error...";
|
||||
}
|
||||
|
||||
if (i18n.t) {
|
||||
message = i18n.t(message) || message;
|
||||
}
|
||||
|
||||
$('div[data-role="content"]').wrap('<div class="overlay" />');
|
||||
$.mobile.loading('show', {
|
||||
text: message,
|
||||
@@ -1059,4 +1066,167 @@ function showWikipedia(artist) {
|
||||
|
||||
$("#popupVideo iframe").attr("src", "http://m.wikipedia.org/wiki/Special:Search/" + artist);
|
||||
$("#popupVideo").popup("open");
|
||||
}
|
||||
|
||||
function initTranslation() {
|
||||
var translations = {
|
||||
"en": {
|
||||
translation: {
|
||||
'loginName': 'User:',
|
||||
'loginPassword': 'Password:',
|
||||
'loginButton': 'Login',
|
||||
'registerButton': 'Create Profile',
|
||||
'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'
|
||||
}
|
||||
},
|
||||
"de": {
|
||||
translation: {
|
||||
'loginName': 'Benutzer:',
|
||||
'loginPassword': 'Passwort:',
|
||||
'loginButton': 'Einloggen',
|
||||
'registerButton': 'Erstelle Profil',
|
||||
'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'
|
||||
}
|
||||
}
|
||||
};
|
||||
$.i18n.init({
|
||||
resStore: translations,
|
||||
lng: "de",
|
||||
fallbackLng: 'en',
|
||||
debug: true
|
||||
}).done(function () {
|
||||
$('body').i18n();
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user