mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-26 20:55:39 +00:00
(ems) override F1 and other keys, use paths relative to the base url
This commit is contained in:
parent
934bd2d018
commit
8b2434a408
@ -9,7 +9,7 @@
|
|||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css">
|
||||||
<!-- Material Design Bootstrap -->
|
<!-- Material Design Bootstrap -->
|
||||||
<link href="https://bot.libretro.com/web/mdb/css/mdb.min.css" rel="stylesheet">
|
<link href="mdb/css/mdb.min.css" rel="stylesheet">
|
||||||
|
|
||||||
<link href="proto.css" rel="stylesheet" type="text/css">
|
<link href="proto.css" rel="stylesheet" type="text/css">
|
||||||
<link rel="shortcut icon" href="media/icon_dark.ico" />
|
<link rel="shortcut icon" href="media/icon_dark.ico" />
|
||||||
@ -150,10 +150,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="//code.jquery.com/jquery-3.1.0.min.js"></script>
|
<script src="//code.jquery.com/jquery-3.1.0.min.js"></script>
|
||||||
|
<script src="//rawgit.com/jeresig/jquery.hotkeys/master/jquery.hotkeys.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/tether/1.3.4/js/tether.min.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/tether/1.3.4/js/tether.min.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.3/js/bootstrap.min.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.3/js/bootstrap.min.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js"></script>
|
||||||
<script src="https://use.fontawesome.com/bb20806e1e.js"></script>
|
<script src="https://use.fontawesome.com/bb20806e1e.js"></script>
|
||||||
|
<script src="analytics.js"></script>
|
||||||
<script src="browserfs.js"></script>
|
<script src="browserfs.js"></script>
|
||||||
<script src="proto.js"></script>
|
<script src="proto.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
@ -103,9 +103,9 @@ function setupFileSystem(backend)
|
|||||||
var lsfs = new BrowserFS.FileSystem.LocalStorage();
|
var lsfs = new BrowserFS.FileSystem.LocalStorage();
|
||||||
/* create an XmlHttpRequest filesystem for assets */
|
/* create an XmlHttpRequest filesystem for assets */
|
||||||
var xfs1 = new BrowserFS.FileSystem.XmlHttpRequest
|
var xfs1 = new BrowserFS.FileSystem.XmlHttpRequest
|
||||||
(".index-xhr", "https://bot.libretro.com/web/assets/");
|
(".index-xhr", "/web/assets/");
|
||||||
var xfs2 = new BrowserFS.FileSystem.XmlHttpRequest
|
var xfs2 = new BrowserFS.FileSystem.XmlHttpRequest
|
||||||
(".index-xhr", "https://bot.libretro.com/assets/cores/");
|
(".index-xhr", "/assets/cores/");
|
||||||
|
|
||||||
/* mount the local filesystem at the root of mfs*/
|
/* mount the local filesystem at the root of mfs*/
|
||||||
mfs.mount('/home/web_user/userdata', lsfs);
|
mfs.mount('/home/web_user/userdata', lsfs);
|
||||||
@ -124,9 +124,9 @@ function setupFileSystem(backend)
|
|||||||
var mfs = new BrowserFS.FileSystem.MountableFileSystem();
|
var mfs = new BrowserFS.FileSystem.MountableFileSystem();
|
||||||
/* create an XmlHttpRequest filesystem for assets */
|
/* create an XmlHttpRequest filesystem for assets */
|
||||||
var xfs1 = new BrowserFS.FileSystem.XmlHttpRequest
|
var xfs1 = new BrowserFS.FileSystem.XmlHttpRequest
|
||||||
(".index-xhr", "https://bot.libretro.com/web/assets/");
|
(".index-xhr", "/web/assets/");
|
||||||
var xfs2 = new BrowserFS.FileSystem.XmlHttpRequest
|
var xfs2 = new BrowserFS.FileSystem.XmlHttpRequest
|
||||||
(".index-xhr", "https://bot.libretro.com/assets/cores/");
|
(".index-xhr", "/assets/cores/");
|
||||||
|
|
||||||
/* mount the local filesystem at the root of mfs*/
|
/* mount the local filesystem at the root of mfs*/
|
||||||
mfs.mount('/home/web_user/userdata', afs);
|
mfs.mount('/home/web_user/userdata', afs);
|
||||||
@ -265,16 +265,17 @@ function switchStorage(backend) {
|
|||||||
|
|
||||||
// When the browser has loaded everything.
|
// When the browser has loaded everything.
|
||||||
$(function() {
|
$(function() {
|
||||||
// Find which core to load.
|
// Find which core to load.
|
||||||
var core = localStorage.getItem("core", core);
|
var core = localStorage.getItem("core", core);
|
||||||
if (!core) {
|
if (!core) {
|
||||||
core = 'gambatte';
|
core = 'gambatte';
|
||||||
}
|
}
|
||||||
// Show the current core as the active core.
|
// Show the current core as the active core.
|
||||||
$('.nav-item.' + core).addClass('active');
|
$('.nav-item.' + core).addClass('active');
|
||||||
|
|
||||||
// Load the Core's related JavaScript.
|
// Load the Core's related JavaScript.
|
||||||
$.getScript(core + '_libretro.js', function () {
|
$.getScript(core + '_libretro.js', function ()
|
||||||
|
{
|
||||||
// Activate the Start RetroArch button.
|
// Activate the Start RetroArch button.
|
||||||
$('#btnRun').removeClass('disabled');
|
$('#btnRun').removeClass('disabled');
|
||||||
$('#icnRun').removeClass('fa-spinner spinning');
|
$('#icnRun').removeClass('fa-spinner spinning');
|
||||||
@ -297,11 +298,44 @@ $(function() {
|
|||||||
* Attempt to disable some default browser keys.
|
* Attempt to disable some default browser keys.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
window.addEventListener('keydown', function(e) {
|
var util = { };
|
||||||
// Space key, arrows, and F1.
|
|
||||||
if([32, 37, 38, 39, 40, 112].indexOf(e.keyCode) > -1) {
|
document.addEventListener('keydown', function(e)
|
||||||
e.preventDefault();
|
{
|
||||||
|
var key = util.key[e.which];
|
||||||
|
if( key )
|
||||||
|
{
|
||||||
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}, false);
|
})
|
||||||
});
|
|
||||||
});
|
util.key = {
|
||||||
|
9: "tab",
|
||||||
|
13: "enter",
|
||||||
|
16: "shift",
|
||||||
|
18: "alt",
|
||||||
|
27: "esc",
|
||||||
|
33: "rePag",
|
||||||
|
34: "avPag",
|
||||||
|
35: "end",
|
||||||
|
36: "home",
|
||||||
|
37: "left",
|
||||||
|
38: "up",
|
||||||
|
39: "right",
|
||||||
|
40: "down",
|
||||||
|
112: "F1",
|
||||||
|
113: "F2",
|
||||||
|
114: "F3",
|
||||||
|
115: "F4",
|
||||||
|
116: "F5",
|
||||||
|
117: "F6",
|
||||||
|
118: "F7",
|
||||||
|
119: "F8",
|
||||||
|
120: "F9",
|
||||||
|
121: "F10",
|
||||||
|
122: "F11",
|
||||||
|
123: "F12"
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user