Fixed an issue with registry scan, minor UI changes.

The registry scan function exited early if no Java Development Key was found. This has been corrected by redoing the exit checks.
Social media buttons now lose focus after they are clicked to prevent a sticky appearance.
Changed the load spinner to have the text rotate within the center image.
This commit is contained in:
Daniel Scalzi 2018-05-10 04:36:52 -04:00
parent f0b21330a0
commit 848440ed1c
No known key found for this signature in database
GPG Key ID: 5CA2F145B63535F9
3 changed files with 51 additions and 16 deletions

View File

@ -2122,7 +2122,7 @@ p {
/* Stationary image for the spinner. */ /* Stationary image for the spinner. */
#loadCenterImage { #loadCenterImage {
position: absolute; position: absolute;
width: 200px; width: 277px;
height: auto; height: auto;
} }
@ -2130,6 +2130,7 @@ p {
#loadSpinnerImage { #loadSpinnerImage {
width: 280px; width: 280px;
height: auto; height: auto;
z-index: 400;
} }
/* Rotating animation for the spinner. */ /* Rotating animation for the spinner. */

View File

@ -854,15 +854,14 @@ class AssetGuard extends EventEmitter {
// 'SOFTWARE\\JavaSoft\\JDK' // 'SOFTWARE\\JavaSoft\\JDK'
// Forge does not yet support Java 9, therefore we do not. // Forge does not yet support Java 9, therefore we do not.
let cbTracker = 0
let cbAcc = 0
// Keys for Java 1.8 and prior: // Keys for Java 1.8 and prior:
const regKeys = [ const regKeys = [
'\\SOFTWARE\\JavaSoft\\Java Runtime Environment', '\\SOFTWARE\\JavaSoft\\Java Runtime Environment',
'\\SOFTWARE\\JavaSoft\\Java Development Kit' '\\SOFTWARE\\JavaSoft\\Java Development Kit'
] ]
let keysDone = 0
const candidates = new Set() const candidates = new Set()
for(let i=0; i<regKeys.length; i++){ for(let i=0; i<regKeys.length; i++){
@ -875,15 +874,26 @@ class AssetGuard extends EventEmitter {
if(exists) { if(exists) {
key.keys((err, javaVers) => { key.keys((err, javaVers) => {
if(err){ if(err){
keysDone++
console.error(err) console.error(err)
if(i === regKeys.length-1 && cbAcc === cbTracker){
// REG KEY DONE
// DUE TO ERROR
if(keysDone === regKeys.length){
resolve(candidates) resolve(candidates)
} }
} else { } else {
cbTracker += javaVers.length if(javaVers.length === 0){
if(i === regKeys.length-1 && cbTracker === cbAcc){ // REG KEY DONE
resolve(candidates) // NO SUBKEYS
keysDone++
if(keysDone === regKeys.length){
resolve(candidates)
}
} else { } else {
let numDone = 0
for(let j=0; j<javaVers.length; j++){ for(let j=0; j<javaVers.length; j++){
const javaVer = javaVers[j] const javaVer = javaVers[j]
const vKey = javaVer.key.substring(javaVer.key.lastIndexOf('\\')+1) const vKey = javaVer.key.substring(javaVer.key.lastIndexOf('\\')+1)
@ -893,17 +903,29 @@ class AssetGuard extends EventEmitter {
const jHome = res.value const jHome = res.value
if(jHome.indexOf('(x86)') === -1){ if(jHome.indexOf('(x86)') === -1){
candidates.add(jHome) candidates.add(jHome)
} }
cbAcc++
if(i === regKeys.length-1 && cbAcc === cbTracker){ // SUBKEY DONE
resolve(candidates)
numDone++
if(numDone === javaVers.length){
keysDone++
if(keysDone === regKeys.length){
resolve(candidates)
}
} }
}) })
} else { } else {
cbAcc++
if(i === regKeys.length-1 && cbAcc === cbTracker){ // SUBKEY DONE
resolve(candidates) // NOT JAVA 8
numDone++
if(numDone === javaVers.length){
keysDone++
if(keysDone === regKeys.length){
resolve(candidates)
}
} }
} }
} }
@ -911,7 +933,12 @@ class AssetGuard extends EventEmitter {
} }
}) })
} else { } else {
if(i === regKeys.length-1 && cbAcc === cbTracker){
// REG KEY DONE
// DUE TO NON-EXISTANCE
keysDone++
if(keysDone === regKeys.length){
resolve(candidates) resolve(candidates)
} }
} }

View File

@ -130,6 +130,13 @@ document.addEventListener('readystatechange', function () {
}) })
}) })
// Remove focus from social media buttons once they're clicked.
Array.from(document.getElementsByClassName('mediaURL')).map(val => {
val.addEventListener('click', e => {
document.activeElement.blur()
})
})
} else if(document.readyState === 'complete'){ } else if(document.readyState === 'complete'){
//266.01 //266.01