1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-11 17:50:57 +00:00

moved octokat to import(), removed unused lib/ files

This commit is contained in:
Steven Hugg 2021-08-04 20:27:48 -05:00
parent 91d0031366
commit dd57c65897
13 changed files with 33 additions and 2533 deletions

3
.gitmodules vendored
View File

@ -16,6 +16,3 @@
[submodule "nanoasm"]
path = nanoasm
url = https://github.com/sehugg/nanoasm
[submodule "unicorn.js"]
path = unicorn.js
url = https://github.com/AlexAltea/unicorn.js

View File

@ -555,13 +555,10 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
<link rel="stylesheet" href="codemirror/addon/dialog/dialog.css">
<script src="javatari.js/release/javatari/javatari.js"></script>
<script src="src/common/cpu/6809.js"></script>
<script src="lib/mousetrap.min.js"></script>
<script src="lib/mousetrap-global-bind.min.js"></script>
<!-- UI-only stuff -->
<link rel="stylesheet" href="lib/bootstrap-tourist.css">
<script src="lib/bootstrap-tourist.js"></script>
<script src="lib/octokat.js"></script>
<script src="tss/js/tss/PsgDeviceChannel.js"></script>
<script src="tss/js/tss/MasterChannel.js"></script>
<script src="tss/js/tss/AudioLooper.js"></script>

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
(function(a){var c={},d=a.prototype.stopCallback;a.prototype.stopCallback=function(e,b,a,f){return this.paused?!0:c[a]||c[f]?!1:d.call(this,e,b,a)};a.prototype.bindGlobal=function(a,b,d){this.bind(a,b,d);if(a instanceof Array)for(b=0;b<a.length;b++)c[a[b]]=!0;else c[a]=!0};a.init()})(Mousetrap);

11
lib/mousetrap.min.js vendored
View File

@ -1,11 +0,0 @@
/* mousetrap v1.6.5 craig.is/killing/mice */
(function(q,u,c){function v(a,b,g){a.addEventListener?a.addEventListener(b,g,!1):a.attachEvent("on"+b,g)}function z(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return n[a.which]?n[a.which]:r[a.which]?r[a.which]:String.fromCharCode(a.which).toLowerCase()}function F(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function w(a){return"shift"==a||"ctrl"==a||"alt"==a||
"meta"==a}function A(a,b){var g,d=[];var e=a;"+"===e?e=["+"]:(e=e.replace(/\+{2}/g,"+plus"),e=e.split("+"));for(g=0;g<e.length;++g){var m=e[g];B[m]&&(m=B[m]);b&&"keypress"!=b&&C[m]&&(m=C[m],d.push("shift"));w(m)&&d.push(m)}e=m;g=b;if(!g){if(!p){p={};for(var c in n)95<c&&112>c||n.hasOwnProperty(c)&&(p[n[c]]=c)}g=p[e]?"keydown":"keypress"}"keypress"==g&&d.length&&(g="keydown");return{key:m,modifiers:d,action:g}}function D(a,b){return null===a||a===u?!1:a===b?!0:D(a.parentNode,b)}function d(a){function b(a){a=
a||{};var b=!1,l;for(l in p)a[l]?b=!0:p[l]=0;b||(x=!1)}function g(a,b,t,f,g,d){var l,E=[],h=t.type;if(!k._callbacks[a])return[];"keyup"==h&&w(a)&&(b=[a]);for(l=0;l<k._callbacks[a].length;++l){var c=k._callbacks[a][l];if((f||!c.seq||p[c.seq]==c.level)&&h==c.action){var e;(e="keypress"==h&&!t.metaKey&&!t.ctrlKey)||(e=c.modifiers,e=b.sort().join(",")===e.sort().join(","));e&&(e=f&&c.seq==f&&c.level==d,(!f&&c.combo==g||e)&&k._callbacks[a].splice(l,1),E.push(c))}}return E}function c(a,b,c,f){k.stopCallback(b,
b.target||b.srcElement,c,f)||!1!==a(b,c)||(b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation?b.stopPropagation():b.cancelBubble=!0)}function e(a){"number"!==typeof a.which&&(a.which=a.keyCode);var b=z(a);b&&("keyup"==a.type&&y===b?y=!1:k.handleKey(b,F(a),a))}function m(a,g,t,f){function h(c){return function(){x=c;++p[a];clearTimeout(q);q=setTimeout(b,1E3)}}function l(g){c(t,g,a);"keyup"!==f&&(y=z(g));setTimeout(b,10)}for(var d=p[a]=0;d<g.length;++d){var e=d+1===g.length?l:h(f||
A(g[d+1]).action);n(g[d],e,f,a,d)}}function n(a,b,c,f,d){k._directMap[a+":"+c]=b;a=a.replace(/\s+/g," ");var e=a.split(" ");1<e.length?m(a,e,b,c):(c=A(a,c),k._callbacks[c.key]=k._callbacks[c.key]||[],g(c.key,c.modifiers,{type:c.action},f,a,d),k._callbacks[c.key][f?"unshift":"push"]({callback:b,modifiers:c.modifiers,action:c.action,seq:f,level:d,combo:a}))}var k=this;a=a||u;if(!(k instanceof d))return new d(a);k.target=a;k._callbacks={};k._directMap={};var p={},q,y=!1,r=!1,x=!1;k._handleKey=function(a,
d,e){var f=g(a,d,e),h;d={};var k=0,l=!1;for(h=0;h<f.length;++h)f[h].seq&&(k=Math.max(k,f[h].level));for(h=0;h<f.length;++h)f[h].seq?f[h].level==k&&(l=!0,d[f[h].seq]=1,c(f[h].callback,e,f[h].combo,f[h].seq)):l||c(f[h].callback,e,f[h].combo);f="keypress"==e.type&&r;e.type!=x||w(a)||f||b(d);r=l&&"keydown"==e.type};k._bindMultiple=function(a,b,c){for(var d=0;d<a.length;++d)n(a[d],b,c)};v(a,"keypress",e);v(a,"keydown",e);v(a,"keyup",e)}if(q){var n={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",
18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},r={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},C={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},B={option:"alt",command:"meta","return":"enter",
escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p;for(c=1;20>c;++c)n[111+c]="f"+c;for(c=0;9>=c;++c)n[c+96]=c.toString();d.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};d.prototype.unbind=function(a,b){return this.bind.call(this,a,function(){},b)};d.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};d.prototype.reset=function(){this._callbacks={};
this._directMap={};return this};d.prototype.stopCallback=function(a,b){if(-1<(" "+b.className+" ").indexOf(" mousetrap ")||D(b,this.target))return!1;if("composedPath"in a&&"function"===typeof a.composedPath){var c=a.composedPath()[0];c!==a.target&&(b=c)}return"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};d.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};d.addKeycodes=function(a){for(var b in a)a.hasOwnProperty(b)&&(n[b]=a[b]);p=null};
d.init=function(){var a=d(u),b;for(b in a)"_"!==b.charAt(0)&&(d[b]=function(b){return function(){return a[b].apply(a,arguments)}}(b))};d.init();q.Mousetrap=d;"undefined"!==typeof module&&module.exports&&(module.exports=d);"function"===typeof define&&define.amd&&define(function(){return d})}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null);

File diff suppressed because it is too large Load Diff

3
lib/split.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -21,6 +21,7 @@
"jszip": "^3.7.0",
"localforage": "^1.9.0",
"mousetrap": "^1.6.5",
"octokat": "^0.10.0",
"reflect-metadata": "^0.1.13",
"split.js": "^1.6.2",
"update-electron-app": "^2.0.1"
@ -49,7 +50,6 @@
"mocha": "^7.2.0",
"mocha-simple-html-reporter": "^2.0.0",
"nightwatch": "^1.6.4",
"octokat": "^0.10.0",
"pngjs": "^3.4.0",
"rgbquant": "^1.1.2",
"typedoc": "^0.21.0",

View File

@ -618,12 +618,13 @@ function getCookie(name) : string {
return null;
}
function getGithubService() {
async function getGithubService() {
if (!githubService) {
var Octokat = (await import('octokat')).default;
// get github API key from cookie
// TODO: move to service?
var ghkey = getCookie('__github_key');
githubService = new GithubService(exports['Octokat'], ghkey, store, current_project);
githubService = new GithubService(Octokat, ghkey, store, current_project);
console.log("loaded github service");
}
return githubService;
@ -638,7 +639,7 @@ function getBoundGithubURL() : string {
return 'https://github.com/' + toks[0] + '/' + toks[1];
}
function importProjectFromGithub(githuburl:string, replaceURL:boolean) {
async function importProjectFromGithub(githuburl:string, replaceURL:boolean) {
var sess : GHSession;
var urlparse = parseGithubURL(githuburl);
if (!urlparse) {
@ -655,10 +656,11 @@ function importProjectFromGithub(githuburl:string, replaceURL:boolean) {
var newstore = createNewPersistentStore(urlparse.repopath);
// import into new store
setWaitProgress(0.25);
return getGithubService().import(githuburl).then( (sess1:GHSession) => {
var gh = await getGithubService();
return gh.import(githuburl).then( (sess1:GHSession) => {
sess = sess1;
setWaitProgress(0.75);
return getGithubService().pull(githuburl, newstore);
return gh.pull(githuburl, newstore);
}).then( (sess2:GHSession) => {
// TODO: only first session has mainPath?
// reload repo
@ -673,16 +675,18 @@ function importProjectFromGithub(githuburl:string, replaceURL:boolean) {
});
}
function _loginToGithub(e) {
getGithubService().login().then(() => {
async function _loginToGithub(e) {
var gh = await getGithubService();
gh.login().then(() => {
alertInfo("You are signed in to Github.");
}).catch( (e) => {
alertError("<p>Could not sign in.</p>" + e);
});
}
function _logoutOfGithub(e) {
getGithubService().logout().then(() => {
async function _logoutOfGithub(e) {
var gh = await getGithubService();
gh.logout().then(() => {
alertInfo("You are logged out of Github.");
});
}
@ -707,7 +711,7 @@ function _publishProjectToGithub(e) {
var btn = $("#publishGithubButton");
$("#githubRepoName").val(getFilenamePrefix(getFilenameForPath(current_project.mainPath)));
modal.modal('show');
btn.off('click').on('click', () => {
btn.off('click').on('click', async () => {
var name = $("#githubRepoName").val()+"";
var desc = $("#githubRepoDesc").val()+"";
var priv = $("#githubRepoPrivate").val() == 'private';
@ -719,9 +723,10 @@ function _publishProjectToGithub(e) {
}
modal.modal('hide');
setWaitDialog(true);
getGithubService().login().then( () => {
var gh = await getGithubService();
gh.login().then( () => {
setWaitProgress(0.25);
return getGithubService().publish(name, desc, license, priv);
return gh.publish(name, desc, license, priv);
}).then( (_sess) => {
sess = _sess;
setWaitProgress(0.5);
@ -754,10 +759,12 @@ function _pushProjectToGithub(e) {
function _pullProjectFromGithub(e) {
var ghurl = getBoundGithubURL();
if (!ghurl) return;
bootbox.confirm("Pull from repository and replace all local files? Any changes you've made will be overwritten.", (ok) => {
bootbox.confirm("Pull from repository and replace all local files? Any changes you've made will be overwritten.",
async (ok) => {
if (ok) {
setWaitDialog(true);
getGithubService().pull(ghurl).then( (sess:GHSession) => {
var gh = await getGithubService();
gh.pull(ghurl).then( (sess:GHSession) => {
setWaitDialog(false);
projectWindows.updateAllOpenWindows(store);
});
@ -795,7 +802,7 @@ function confirmCommit(sess) : Promise<GHSession> {
});
}
function pushChangesToGithub(message:string) {
async function pushChangesToGithub(message:string) {
var ghurl = getBoundGithubURL();
if (!ghurl) return;
// build file list for push
@ -814,13 +821,14 @@ function pushChangesToGithub(message:string) {
}
// push files
setWaitDialog(true);
return getGithubService().login().then( () => {
var gh = await getGithubService();
return gh.login().then( () => {
setWaitProgress(0.5);
return getGithubService().commit(ghurl, message, files);
return gh.commit(ghurl, message, files);
}).then( (sess) => {
return confirmCommit(sess);
}).then( (sess) => {
return getGithubService().push(sess);
return gh.push(sess);
}).then( (sess) => {
setWaitDialog(false);
alertInfo("Pushed files to " + ghurl);

View File

@ -24,6 +24,12 @@ exports['test embed iframe'] = function(browser) {
browser.url(IDEURL + "?embed=1")
.waitForElementVisible('.bootbox-alert')
browser.url(IDEURL + "?embed=1&platform=nes&githubURL=https://github.com/sehugg/NES-ca65-example")
.waitForElementNotVisible('#compile_spinner', time=10000)
.waitForElementNotVisible('#error_alert')
.waitForElementVisible('#emuscreen')
.waitForElementVisible('.emuvideo')
}
exports['test embed.html'] = function(browser) {

View File

@ -1,70 +0,0 @@
<html>
<head>
<meta charset="utf-8">
<!-- encoding must be set for mocha's special characters to render properly -->
<link rel="stylesheet" href="node_modules/mocha/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<div id="notebook">
<div id="editor_window">
<div id="disassembly" class="editor">
</div>
<div id="editor" class="editor">
</div>
</div>
<div class="emulator" id="emulator">
<div id="javatari-screen" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div>
<div id="javatari-console-panel" style="margin: 0 auto; box-shadow: 2px 2px 10px rgb(60, 60, 60);"></div>
<div id="mem_info" class="mem_info" style="display:none">
</div>
</div>
</div>
<script src="node_modules/mocha/mocha.js"></script>
<script>
mocha.ui('bdd')
</script>
<script src="jquery/jquery.min.js"></script>
<script src="javatari.js/release/javatari/javatari.js"></script>
<script src="src/cpu/z80.js"></script>
<script src="jsnes/jsnes.min.js"></script>
<script src="localForage/dist/localforage.nopromises.js"></script>
<script>
var exports = {};
function require(modname) {
if (modname == 'jquery') return $;
else if (modname.startsWith('.')) return exports;
else { console.log("Unknown require()", modname); return exports; }
}
</script>
<script src="tss/js/tss/PsgDeviceChannel.js"></script>
<script src="tss/js/tss/MasterChannel.js"></script>
<script src="tss/js/tss/AudioLooper.js"></script>
<script src="tss/js/Log.js"></script>
<script src="gen/store.js"></script>
<script src="src/vlist.js"></script>
<script src="gen/emu.js"></script>
<script src="gen/baseplatform.js"></script>
<script src="gen/audio.js"></script>
<script src="gen/util.js"></script>
<script src="gen/cpu/disasm6502.js"></script>
<script src="gen/workertypes.js"></script>
<script src="gen/project.js"></script>
<script src="gen/windows.js"></script>
<script src="gen/views.js"></script>
<script src="gen/ui.js"></script>
<script src="test/ui/testemus.js"></script>
<script>
mocha.run()
</script>
</body>
</html>

View File

@ -1,150 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>8bitworkshop IDE</title>
<style type="text/css" media="screen">
body {
overflow: hidden !important;
font-size: 11px;
}
.waverow {
background: #000;
color: #99ff99;
}
</style>
<link rel="stylesheet" href="css/ui.css">
</head>
<body>
<div id="controls_top">
<span class="dropdown">
<a class="btn btn-secondary dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Menu">
<span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"></span></button>
<span class="caret"></span>
</a>
</span>
<select id="preset_select" name="" title="Project Select">
</select>
<span class="dropdown">
<a class="btn btn-secondary dropdown-toggle" id="windowMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Window Select">
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span></button>
<span class="caret"></span>
</a>
<ul class="dropdown-menu" aria-labelledby="windowMenuButton" id="windowMenuList">
</ul>
</span>
<img id="compile_spinner" src="images/spinner.gif" height="20em" style="visibility:hidden;margin-left:8px;margin-right:8px">
<span class="dropdown" style="float:right">
<a class="btn btn-secondary dropdown-toggle" id="booksMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
GET BOOKS <span class="caret"></span>
</a>
</span>
</div>
<div id="notebook">
<div id="workspace">
</div>
<div class="emulator" id="emulator" style="width:100%">
<div class="emuoverlay" id="emuoverlay">
<span class="btn-group" role="group">
<button type="button" class="btn btn-xs" onclick="this.blur();" title="Go to start of trace"><span class="glyphicon glyphicon-fast-backward" aria-hidden="true"></span></button>
<button type="button" class="btn btn-xs" onclick="this.blur();" title="Go backward"><span class="glyphicon glyphicon-backward" aria-hidden="true"></span></button>
<button type="button" class="btn btn-xs" onclick="this.blur();" title="Go forward"><span class="glyphicon glyphicon-forward" aria-hidden="true"></span></button>
<button type="button" class="btn btn-xs" onclick="this.blur();" title="Go to end of trace"><span class="glyphicon glyphicon-fast-forward" aria-hidden="true"></span></button>
<button type="button" class="btn btn-xs" onclick="this.blur();" title="Zoom out"><span class="glyphicon glyphicon-zoom-out" aria-hidden="true"></span></button>
<button type="button" class="btn btn-xs" onclick="this.blur();" title="Zoom in"><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span></button>
</span>
<div id="scope" class="emuscope">
</div>
<div id="scope2" class="emuscope">
</div>
</div>
</div>
<div id="error_alert" class="alert alert-danger alert-dismissable" style="position:absolute;right:0;top:0;display:none">
<!--<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>-->
<div id="error_alert_msg"></div>
</div>
</div>
<script src="jquery/jquery.min.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="lib/mousetrap.min.js"></script>
<script src="lib/split.min.js"></script>
<script>
var exports = {};
function require(modname) {
if (modname == 'jquery') return $;
else if (modname.startsWith('.')) return exports;
else { console.log("Unknown require()", modname); return exports; }
}
</script>
<script src="tss/js/tss/PsgDeviceChannel.js"></script>
<script src="tss/js/tss/MasterChannel.js"></script>
<script src="tss/js/tss/AudioLooper.js"></script>
<script src="tss/js/Log.js"></script>
<script src="gen/util.js"></script>
<script src="src/vlist.js"></script>
<script src="gen/emu.js"></script>
<script src="gen/baseplatform.js"></script>
<script src="gen/waveform.js"></script>
<script>
var wfp = {
getSignalMetadata: function() {
return [
{label:'clk', len:1},
{label:'big_signal_name__DOT__which_is_big', len:2},
{label:'sig3', len:3},
{label:'sig4', len:4},
{label:'sig5', len:5},
{label:'sig6', len:6},
{label:'sig7', len:7},
{label:'sig8', len:8},
{label:'sig9', len:9},
{label:'sig', len:1},{label:'sig', len:1},{label:'sig', len:1},{label:'sig', len:1},{label:'sig', len:1},{label:'sig', len:1},{label:'sig', len:1},
];
},
getSignalData: function(i,s,l) {
l += s;
var arr = [];
while (s++<l) {
arr.push(s & (1<<(this.getSignalMetadata()[i].len)-1));
}
return arr;
},
};
var wfv = new WaveformView($('#scope')[0], wfp);
var wfv2 = new WaveformView($('#scope2')[0], wfp);
Split(['#scope', '#scope2'], {
minSize: [50, 50],
direction: 'vertical',
onDrag: function() {
wfv.recreate();
wfv2.recreate();
},
});
/*
function update() {
wfv.setOrgTime(wfv.t0+1);
setTimeout(update, 1000/10);
}
update();
*/
</script>
</body>
</html>

@ -1 +0,0 @@
Subproject commit a872af72bc1c538a1f9ab73a030192f366a0912e