mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 16:39:43 +00:00
(emscripten) use localstorage variables instead of passing the parameters in a URL
This commit is contained in:
parent
82d82110ae
commit
18527d2fef
@ -13,13 +13,13 @@
|
||||
<a class="navbar-brand" href="#">RetroArch</a>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item gambatte">
|
||||
<a class="nav-link" href="./?core=gambatte">Gambatte</a>
|
||||
<a class="nav-link" href="." onclick=switchCore("gambatte")>Gambatte</a>
|
||||
</li>
|
||||
<li class="nav-item snes9x2010">
|
||||
<a class="nav-link" href="./?core=snes9x2010">Snex9x 2010</a>
|
||||
<a class="nav-link" href="." onclick=switchCore("snes9x2010")>Snes9X 2010</a>
|
||||
</li>
|
||||
<li class="nav-item vba_next">
|
||||
<a class="nav-link vba_next" href="./?core=vba_next">VBA Next</a>
|
||||
<a class="nav-link" href="." onclick=switchCore("vba_next")>VBA Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -215,14 +215,17 @@ var Module =
|
||||
}
|
||||
};
|
||||
|
||||
function switchCore(corename) {
|
||||
localStorage.setItem("core", corename);
|
||||
}
|
||||
|
||||
// When the browser has loaded everything.
|
||||
$(function() {
|
||||
// Find which core to load.
|
||||
var core = getParam('core');
|
||||
var core = localStorage.getItem("core", core);
|
||||
if (!core) {
|
||||
core = 'gambatte';
|
||||
}
|
||||
|
||||
// Show the current core as the active core.
|
||||
$('.nav-item.' + core).addClass('active');
|
||||
|
||||
@ -234,6 +237,7 @@ $(function() {
|
||||
/**
|
||||
* Attempt to disable some default browser keys.
|
||||
*/
|
||||
|
||||
window.addEventListener('keydown', function(e) {
|
||||
// Space key, arrows, and F1.
|
||||
if([32, 37, 38, 39, 40, 112].indexOf(e.keyCode) > -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user