(ems) add to the other templates too

This commit is contained in:
radius 2016-09-17 12:37:35 -05:00
parent 356c17678e
commit 64b802b47a
5 changed files with 23 additions and 9 deletions

View File

@ -3,6 +3,8 @@
* *
* This provides the basic JavaScript for the RetroArch web player. * This provides the basic JavaScript for the RetroArch web player.
*/ */
/* setup your key for dropbox support */
var client = new Dropbox.Client({ key: "--your-api-key--" }); var client = new Dropbox.Client({ key: "--your-api-key--" });
var BrowserFS = browserfs; var BrowserFS = browserfs;
var afs; var afs;
@ -45,6 +47,12 @@ var showError = function(error) {
} }
}; };
function cleanupStorage()
{
localStorage.clear();
document.getElementById('btnClean').disabled = true;
}
function dropboxInit() function dropboxInit()
{ {
document.getElementById('btnRun').disabled = true; document.getElementById('btnRun').disabled = true;
@ -106,6 +114,9 @@ function setupFileSystem(backend)
mountpoint for browserfs */ mountpoint for browserfs */
var mfs = new BrowserFS.FileSystem.MountableFileSystem(); var mfs = new BrowserFS.FileSystem.MountableFileSystem();
/* setup this if you setup your server to serve assets or core assets,
you can find more information in the included README */
/* create an XmlHttpRequest filesystem for the bundled data /* create an XmlHttpRequest filesystem for the bundled data
uncomment this section if you want XMB assets, Overlays, Shaders, etc. uncomment this section if you want XMB assets, Overlays, Shaders, etc.
var xfs1 = new BrowserFS.FileSystem.XmlHttpRequest var xfs1 = new BrowserFS.FileSystem.XmlHttpRequest
@ -126,11 +137,6 @@ function setupFileSystem(backend)
/* mount the filesystems onto mfs */ /* mount the filesystems onto mfs */
mfs.mount('/home/web_user/retroarch/userdata', lsfs); mfs.mount('/home/web_user/retroarch/userdata', lsfs);
/* create a memory filesystem for content only
var imfs = new BrowserFS.FileSystem.InMemory();*/
/* mount the filesystems onto mfs
mfs.mount('/home/web_user/retroarch/userdata/content/', imfs);*/
} }
else else
{ {
@ -138,6 +144,8 @@ function setupFileSystem(backend)
mfs.mount('/home/web_user/retroarch/userdata', afs); mfs.mount('/home/web_user/retroarch/userdata', afs);
} }
/* setup this if you setup your server to serve assets or core assets,
you can find more information in the included README */
/* /*
mfs.mount('/home/web_user/retroarch/bundle', xfs1); mfs.mount('/home/web_user/retroarch/bundle', xfs1);
mfs.mount('/home/web_user/retroarch/userdata/content/', xfs2); mfs.mount('/home/web_user/retroarch/userdata/content/', xfs2);

View File

@ -89,6 +89,9 @@
<button class="btn btn-warning disabled" id="btnAdd" onclick="document.getElementById('btnRom').click()" disabled> <button class="btn btn-warning disabled" id="btnAdd" onclick="document.getElementById('btnRom').click()" disabled>
<span class="fa fa-plus" id="icnAdd"></span> Add Content <span class="fa fa-plus" id="icnAdd"></span> Add Content
</button> </button>
<button class="btn btn-primary enabled" id="btnClean" onclick="cleanupStorage();" title="Cleanup" disabled>
<span class="fa fa-trash-o" id="icnClean"></span> <span class="sr-only">Cleanup</span>
</button>
<input class="btn btn-warning disabled" style="display: none" type="file" id="btnRom" name="upload" onclick="document.getElementById('btnAdd').click();" onchange="selectFiles(event.target.files)" multiple /> <input class="btn btn-warning disabled" style="display: none" type="file" id="btnRom" name="upload" onclick="document.getElementById('btnAdd').click();" onchange="selectFiles(event.target.files)" multiple />
<button class="btn btn-warning disabled" id="btnFullscreen" onclick="Module.requestFullScreen()" title="Fullscreen" disabled> <button class="btn btn-warning disabled" id="btnFullscreen" onclick="Module.requestFullScreen()" title="Fullscreen" disabled>
<span class="fa fa-desktop" id="icnAdd"></span> <span class="sr-only">Fullscreen</span> <span class="fa fa-desktop" id="icnAdd"></span> <span class="sr-only">Fullscreen</span>
@ -120,11 +123,12 @@
<span class="fa fa-chrome" id="icnLocal"></span> Browser <span class="fa fa-chrome" id="icnLocal"></span> Browser
</input> </input>
</label> </label>
<!--uncomment for dropbox support
<label class="btn btn-warning" id="lblDrop" onclick=switchStorage("dropbox")> <label class="btn btn-warning" id="lblDrop" onclick=switchStorage("dropbox")>
<input type="radio" name="options" id="btnDrop" autocomplete="off"> <input type="radio" name="options" id="btnDrop" autocomplete="off">
<span class="fa fa-dropbox" id="icnDrop"></span> Dropbox <span class="fa fa-dropbox" id="icnDrop"></span> Dropbox
</input> </input>
</label> </label>-->
</div> </div>
</div> </div>
</div> </div>
@ -148,7 +152,7 @@
<script src="//rawgit.com/jeresig/jquery.hotkeys/master/jquery.hotkeys.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> <!--uncomment for dropbox support<script src="//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.10.2/dropbox.min.js"></script>-->
<script src="//wzrd.in/standalone/browserfs@0.6.1"></script> <script src="//wzrd.in/standalone/browserfs@0.6.1"></script>
<script src="embed.js"></script> <script src="embed.js"></script>
</body> </body>

View File

@ -89,7 +89,7 @@
<span class="fa fa-plus" id="icnAdd"></span> </span> <span class="sr-only"></span> <span class="fa fa-plus" id="icnAdd"></span> </span> <span class="sr-only"></span>
</button> </button>
<button class="btn btn-primary enabled" id="btnClean" onclick="cleanupStorage();" title="Cleanup" disabled> <button class="btn btn-primary enabled" id="btnClean" onclick="cleanupStorage();" title="Cleanup" disabled>
<span class="fa fa-trash-o" id="btnCleanup"></span> <span class="sr-only">Cleanup</span> <span class="fa fa-trash-o" id="icnClean"></span> <span class="sr-only">Cleanup</span>
</button> </button>
<input class="btn btn-danger disabled" style="display: none" type="file" id="btnRom" name="upload" onclick="document.getElementById('btnAdd').click();" onchange="selectFiles(event.target.files)" multiple /> <input class="btn btn-danger disabled" style="display: none" type="file" id="btnRom" name="upload" onclick="document.getElementById('btnAdd').click();" onchange="selectFiles(event.target.files)" multiple />
<button class="btn btn-danger disabled" id="btnFullscreen" onclick="Module.requestFullScreen()" title="Fullscreen" disabled> <button class="btn btn-danger disabled" id="btnFullscreen" onclick="Module.requestFullScreen()" title="Fullscreen" disabled>

View File

@ -48,11 +48,13 @@ var showError = function(error) {
function reload() function reload()
{ {
window.top.location.reload(); window.top.location.reload();
document.getElementById('btnClean').disabled = true;
} }
function cleanupStorage() function cleanupStorage()
{ {
localStorage.clear(); localStorage.clear();
document.getElementById('btnClean').disabled = true;
} }
function dropboxInit() function dropboxInit()

View File

@ -88,7 +88,7 @@
<span class="fa fa-plus" id="icnAdd"></span> Add Content <span class="fa fa-plus" id="icnAdd"></span> Add Content
</button> </button>
<button class="btn btn-primary enabled" id="btnClean" onclick="cleanupStorage();" title="Cleanup" disabled> <button class="btn btn-primary enabled" id="btnClean" onclick="cleanupStorage();" title="Cleanup" disabled>
<span class="fa fa-trash-o" id="btnCleanup"></span> <span class="sr-only">Cleanup</span> <span class="fa fa-trash-o" id="icnClean"></span> <span class="sr-only">Cleanup</span>
</button> </button>
<input class="btn btn-primary disabled" style="display: none" type="file" id="btnRom" name="upload" onclick="document.getElementById('btnAdd').click();" onchange="selectFiles(event.target.files)" multiple /> <input class="btn btn-primary disabled" style="display: none" type="file" id="btnRom" name="upload" onclick="document.getElementById('btnAdd').click();" onchange="selectFiles(event.target.files)" multiple />
<button class="btn btn-primary disabled" id="btnMenu" onclick="keyPress(112);" title="Menu toggle" disabled> <button class="btn btn-primary disabled" id="btnMenu" onclick="keyPress(112);" title="Menu toggle" disabled>