Skip to content

Commit

Permalink
add proof-of-concept support for more easily embedding EDSY code into…
Browse files Browse the repository at this point in the history
… other apps
  • Loading branch information
taleden committed Oct 13, 2020
1 parent 4bc4636 commit faa6f97
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
9 changes: 9 additions & 0 deletions api.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="application/javascript" src="eddb.js"></script>
<script type="application/javascript" src="edsy.js"></script>
</head>
<body></body>
</html>
26 changes: 25 additions & 1 deletion edsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10485,6 +10485,24 @@ if (attrroll && abs(attrroll - bproll) > 0.0001) console.log(json.Ship+' '+modul
}; // verifyVersionSync()


var onCodeOnlyLoaded = function() {
// sniff locale
current.locale = ((window.navigator.languages || EMPTY_ARR)[0] || window.navigator.userLanguage || window.navigator.language || window.navigator.browserLanguage || window.navigator.systemLanguage || undefined);

// disable browser features
cache.feature.history = false;
cache.feature.file = false;
cache.feature.storage = false;
cache.feature.requestFullscreen = false;
cache.feature.cancelFullscreen = false;

// initialize cache
current.dev = (window.location.protocol === 'file:') || (window.location.pathname.indexOf('/dev/') >= 0);
current.beta = current.dev || (window.location.pathname.indexOf('/beta/') >= 0);
initCache();
}; // onCodeOnlyLoaded()


var onDOMContentLoaded = function(e) {
// sniff locale
current.locale = ((window.navigator.languages || EMPTY_ARR)[0] || window.navigator.userLanguage || window.navigator.language || window.navigator.browserLanguage || window.navigator.systemLanguage || undefined);
Expand Down Expand Up @@ -10645,5 +10663,11 @@ if (attrroll && abs(attrroll - bproll) > 0.0001) console.log(json.Ship+' '+modul
setTimeout(updateUIStatsPanels, 2);
}; // onDOMContentLoaded()

window.addEventListener('DOMContentLoaded', onDOMContentLoaded);

if (document.title === 'EDSY') {
window.addEventListener('DOMContentLoaded', onDOMContentLoaded);
} else {
onCodeOnlyLoaded();
this.decodeJournalBuild = decodeJournalBuild; // window.edsy.decodeJournalBuild(jsonstring, []).exportText()
}
})();

0 comments on commit faa6f97

Please sign in to comment.