diff --git a/public/index.js b/public/index.js index c28f6f11..62c5054b 100644 --- a/public/index.js +++ b/public/index.js @@ -1,8 +1,7 @@ /* eslint-disable no-unused-vars */ -const WS_URI = `${window?.location?.protocol === 'https:' ? 'wss' : 'ws'}://${ - window?.location?.host ?? 'localhost:8080' -}`; +const WS_URI = `${window?.location?.protocol === 'https:' ? 'wss' : 'ws'}://${window?.location?.host ?? 'localhost:8080' + }`; const ws = new WebSocket(WS_URI); let currentFile; @@ -159,10 +158,9 @@ function getAppVersions(isRooted) { document.getElementsByTagName('header')[0].innerHTML = `

Select the version you want to download

Versions marked as beta might have bugs or can be unstable, unless marked as recommended - ${ - isRooted - ? 'You are building rooted ReVanced, ReVanced Builder will automatically download the correct version for you.
If you didn\'t intend on doing a rooted build, include all "Root required to exclude" patches' - : '' + ${isRooted + ? 'You are building rooted ReVanced, ReVanced Builder will automatically download the correct version for you.
If you didn\'t intend on doing a rooted build, include all "Root required to exclude" patches' + : '' } `; @@ -263,20 +261,31 @@ ws.onmessage = (msg) => { const patch = message.patchList[i]; patchListElement.innerHTML += `
  • - +
  • `; } + document.getElementById('search').addEventListener('keyup', () => { + const searchBox = document.getElementById('search'); + const searchText = searchBox.value.toLowerCase(); + if (searchText.lenght === 0) return; + + for (const e of document.getElementsByTagName('li')) + e.style.display = 'none' + + for (const e of document.getElementsByClassName('patchName')) { + if (e.innerText.toLowerCase().startsWith(searchText)) { + e.parentNode.parentNode.parentNode.style.display = 'flex'; + } + } + }); for (const patch of document.getElementsByClassName('select')) if ( @@ -332,16 +341,12 @@ ws.onmessage = (msg) => { versionsElement.innerHTML += `
  • - -
  • `; + + `; } if (message.selectedApp === 'music' && !message.foundDevice) @@ -379,8 +384,8 @@ ws.onmessage = (msg) => { const logLevel = message.log.includes('WARNING') ? 'warn' : message.log.includes('SEVERE') - ? 'error' - : 'info'; + ? 'error' + : 'info'; document.getElementsByClassName( 'log' @@ -395,13 +400,11 @@ ws.onmessage = (msg) => { // TODO: on a root install, if the file already exists and the user selects yes it skips checking if a device is plugged in document.getElementsByTagName('header')[0].innerHTML = `

    Use already downloaded APK?

    - The APK already exists in the revanced folder.${ - message.isRooted ? ' ' : '
    ' - }Do you want to use it?${ - message.isRooted + The APK already exists in the revanced folder.${message.isRooted ? ' ' : '
    ' + }Do you want to use it?${message.isRooted ? '
    (Saying no is recommended for rooted building)
    If you didn\'t intend on doing a rooted build, include all "Root required to exclude" patches' : '' - }
    `; + }
    `; const continueButton = document.getElementById('continue'); const backButton = document.getElementById('back'); diff --git a/public/patches/index.html b/public/patches/index.html index bbdf2783..a071e556 100644 --- a/public/patches/index.html +++ b/public/patches/index.html @@ -21,6 +21,9 @@

    Select patches to include

    +
    + +