1
0
Fork 0
mirror of https://github.com/marcrobledo/RomPatcher.js.git synced 2025-06-27 16:25:54 +00:00

sort zipped files by name and folder

This commit is contained in:
Marc 2024-07-21 12:52:54 +02:00
parent 85f06ca770
commit 41174df6c5
3 changed files with 13 additions and 3 deletions

View file

@ -14,7 +14,7 @@
*/ */
var PRECACHE_ID='rom-patcher-js'; var PRECACHE_ID='rom-patcher-js';
var PRECACHE_VERSION='v29'; var PRECACHE_VERSION='v291';
var PRECACHE_URLS=[ var PRECACHE_URLS=[
'/RomPatcher.js/','/RomPatcher.js/index.html', '/RomPatcher.js/','/RomPatcher.js/index.html',
'/RomPatcher.js/manifest.json', '/RomPatcher.js/manifest.json',

View file

@ -181,7 +181,7 @@
<button id="button-settings" class="button-outer"><img src="style/icon_settings.svg" class="icon settings" /> <span data-localize="settings">Settings</span></button> <button id="button-settings" class="button-outer"><img src="style/icon_settings.svg" class="icon settings" /> <span data-localize="settings">Settings</span></button>
</div> </div>
Rom Patcher JS <small>v2.9</small> by <a href="/">Marc Robledo</a> Rom Patcher JS <small>v2.9.1</small> by <a href="/">Marc Robledo</a>
<br /> <br />
<img src="style/icon_github.svg" class="icon github" /> <a href="https://github.com/marcrobledo/RomPatcher.js/" target="_blank">See on GitHub</a> <img src="style/icon_github.svg" class="icon github" /> <a href="https://github.com/marcrobledo/RomPatcher.js/" target="_blank">See on GitHub</a>
<img src="style/icon_heart.svg" class="icon heart" /> <a href="https://www.paypal.me/marcrobledo/5" target="_blank" rel="nofollow">Donate</a> <img src="style/icon_heart.svg" class="icon heart" /> <a href="https://www.paypal.me/marcrobledo/5" target="_blank" rel="nofollow">Donate</a>

View file

@ -1,4 +1,4 @@
/* ZIP module for Rom Patcher JS v20220319 - Marc Robledo 2016-2022 - http://www.marcrobledo.com/license */ /* ZIP module for Rom Patcher JS v20230721 - Marc Robledo 2016-2024 - http://www.marcrobledo.com/license */
const ZIP_MAGIC='\x50\x4b\x03\x04'; const ZIP_MAGIC='\x50\x4b\x03\x04';
@ -51,6 +51,16 @@ var ZIPManager=(function(){
filteredEntries.push(zipEntries[i]); filteredEntries.push(zipEntries[i]);
} }
} }
/* sort patch files by name and folder */
filteredEntries
.sort(function(file1, file2){
return file1.filename.toLowerCase().localeCompare(file2.filename.toLowerCase());
})
.sort(function(file1, file2){
var file1Folder=file1.filename.indexOf('/')===-1? 0 : 1;
var file2Folder=file2.filename.indexOf('/')===-1? 0 : 1;
return file1Folder - file2Folder;
});