@@ -46,7 +46,7 @@ const loggerLanding = LoggerUtil.getLogger('Landing')
46
46
47
47
/**
48
48
* Show/hide the loading area.
49
- *
49
+ *
50
50
* @param {boolean } loading True if the loading area should be shown, otherwise false.
51
51
*/
52
52
function toggleLaunchArea ( loading ) {
@@ -61,7 +61,7 @@ function toggleLaunchArea(loading){
61
61
62
62
/**
63
63
* Set the details text of the loading area.
64
- *
64
+ *
65
65
* @param {string } details The new text for the loading details.
66
66
*/
67
67
function setLaunchDetails ( details ) {
@@ -70,7 +70,7 @@ function setLaunchDetails(details){
70
70
71
71
/**
72
72
* Set the value of the loading progress bar and display that value.
73
- *
73
+ *
74
74
* @param {number } percent Percentage (0-100)
75
75
*/
76
76
function setLaunchPercentage ( percent ) {
@@ -81,7 +81,7 @@ function setLaunchPercentage(percent){
81
81
82
82
/**
83
83
* Set the value of the OS progress bar and display that on the UI.
84
- *
84
+ *
85
85
* @param {number } percent Percentage (0-100)
86
86
*/
87
87
function setDownloadPercentage ( percent ) {
@@ -91,7 +91,7 @@ function setDownloadPercentage(percent){
91
91
92
92
/**
93
93
* Enable or disable the launch button.
94
- *
94
+ *
95
95
* @param {boolean } val True to enable, false to disable.
96
96
*/
97
97
function setLaunchEnabled ( val ) {
@@ -135,10 +135,8 @@ document.getElementById('settingsMediaButton').onclick = async e => {
135
135
136
136
// Bind avatar overlay button.
137
137
document . getElementById ( 'avatarOverlay' ) . onclick = async e => {
138
- await prepareSettings ( )
139
- switchView ( getCurrentView ( ) , VIEWS . settings , 500 , 500 , ( ) => {
140
- settingsNavItemListener ( document . getElementById ( 'settingsNavAccount' ) , false )
141
- } )
138
+ e . target . blur ( )
139
+ await toggleAccountSelection ( true , true )
142
140
}
143
141
144
142
// Bind selected account
@@ -192,7 +190,7 @@ const refreshMojangStatuses = async function(){
192
190
loggerLanding . warn ( 'Unable to refresh Mojang service status.' )
193
191
statuses = MojangRestAPI . getDefaultStatuses ( )
194
192
}
195
-
193
+
196
194
greenCount = 0
197
195
greyCount = 0
198
196
@@ -229,7 +227,7 @@ const refreshMojangStatuses = async function(){
229
227
status = 'green'
230
228
}
231
229
}
232
-
230
+
233
231
document . getElementById ( 'mojangStatusEssentialContainer' ) . innerHTML = tooltipEssentialHTML
234
232
document . getElementById ( 'mojangStatusNonEssentialContainer' ) . innerHTML = tooltipNonEssentialHTML
235
233
document . getElementById ( 'mojang_status_icon' ) . style . color = MojangRestAPI . statusToHex ( status )
@@ -263,7 +261,7 @@ const refreshServerStatus = async (fade = false) => {
263
261
document . getElementById ( 'landingPlayerLabel' ) . innerHTML = pLabel
264
262
document . getElementById ( 'player_count' ) . innerHTML = pVal
265
263
}
266
-
264
+
267
265
}
268
266
269
267
refreshMojangStatuses ( )
@@ -276,7 +274,7 @@ let serverStatusListener = setInterval(() => refreshServerStatus(true), 300000)
276
274
277
275
/**
278
276
* Shows an error overlay, toggles off the launch area.
279
- *
277
+ *
280
278
* @param {string } title The overlay title.
281
279
* @param {string } desc The overlay description.
282
280
*/
@@ -295,8 +293,8 @@ function showLaunchFailure(title, desc){
295
293
296
294
/**
297
295
* Asynchronously scan the system for valid Java installations.
298
- *
299
- * @param {boolean } launchAfter Whether we should begin to launch after scanning.
296
+ *
297
+ * @param {boolean } launchAfter Whether we should begin to launch after scanning.
300
298
*/
301
299
async function asyncSystemScan ( effectiveJavaOptions , launchAfter = true ) {
302
300
@@ -321,7 +319,7 @@ async function asyncSystemScan(effectiveJavaOptions, launchAfter = true){
321
319
setOverlayHandler ( ( ) => {
322
320
setLaunchDetails ( Lang . queryJS ( 'landing.systemScan.javaDownloadPrepare' ) )
323
321
toggleOverlay ( false )
324
-
322
+
325
323
try {
326
324
downloadJava ( effectiveJavaOptions , launchAfter )
327
325
} catch ( err ) {
@@ -512,7 +510,7 @@ async function dlAsync(login = true) {
512
510
showLaunchFailure ( Lang . queryJS ( 'landing.dlAsync.errorDuringFileVerificationTitle' ) , err . displayable || Lang . queryJS ( 'landing.dlAsync.seeConsoleForDetails' ) )
513
511
return
514
512
}
515
-
513
+
516
514
517
515
if ( invalidFileCount > 0 ) {
518
516
loggerLaunchSuite . info ( 'Downloading files.' )
@@ -656,8 +654,8 @@ let newsGlideCount = 0
656
654
657
655
/**
658
656
* Show the news UI via a slide animation.
659
- *
660
- * @param {boolean } up True to slide up, otherwise false.
657
+ *
658
+ * @param {boolean } up True to slide up, otherwise false.
661
659
*/
662
660
function slide_ ( up ) {
663
661
const lCUpper = document . querySelector ( '#landingContainer > #upper' )
@@ -731,7 +729,7 @@ let newsLoadingListener = null
731
729
732
730
/**
733
731
* Set the news loading animation.
734
- *
732
+ *
735
733
* @param {boolean } val True to set loading animation, otherwise false.
736
734
*/
737
735
function setNewsLoading ( val ) {
@@ -773,7 +771,7 @@ newsArticleContentScrollable.onscroll = (e) => {
773
771
774
772
/**
775
773
* Reload the news without restarting.
776
- *
774
+ *
777
775
* @returns {Promise.<void> } A promise which resolves when the news
778
776
* content has finished loading and transitioning.
779
777
*/
@@ -811,7 +809,7 @@ async function digestMessage(str) {
811
809
/**
812
810
* Initialize News UI. This will load the news and prepare
813
811
* the UI accordingly.
814
- *
812
+ *
815
813
* @returns {Promise.<void> } A promise which resolves when the news
816
814
* content has finished loading and transitioning.
817
815
*/
@@ -890,7 +888,7 @@ async function initNews(){
890
888
const switchHandler = ( forward ) => {
891
889
let cArt = parseInt ( newsContent . getAttribute ( 'article' ) )
892
890
let nxtArt = forward ? ( cArt >= newsArr . length - 1 ? 0 : cArt + 1 ) : ( cArt <= 0 ? newsArr . length - 1 : cArt - 1 )
893
-
891
+
894
892
displayArticle ( newsArr [ nxtArt ] , nxtArt + 1 )
895
893
}
896
894
@@ -930,7 +928,7 @@ document.addEventListener('keydown', (e) => {
930
928
931
929
/**
932
930
* Display a news article on the UI.
933
- *
931
+ *
934
932
* @param {Object } articleObject The article meta object.
935
933
* @param {number } index The article index.
936
934
*/
@@ -965,7 +963,7 @@ async function loadNews(){
965
963
}
966
964
967
965
const promise = new Promise ( ( resolve , reject ) => {
968
-
966
+
969
967
const newsFeed = distroData . rawDistribution . rss
970
968
const newsHost = new URL ( newsFeed ) . origin + '/'
971
969
$ . ajax ( {
0 commit comments