move micron parser to main js folder
This commit is contained in:
@@ -123,6 +123,7 @@ pre a:hover {
|
||||
|
||||
<script>
|
||||
|
||||
import MicronParser from "../../js/MicronParser";
|
||||
import DialogUtils from "../../js/DialogUtils";
|
||||
import WebSocketConnection from "../../js/WebSocketConnection";
|
||||
import NomadNetworkSidebar from "./NomadNetworkSidebar.vue";
|
||||
@@ -331,7 +332,7 @@ export default {
|
||||
|
||||
this.downloadNomadNetPage(destinationHash, pagePath, fieldData, (pageContent) => {
|
||||
|
||||
const muParser = new MicronParser;
|
||||
const muParser = new MicronParser();
|
||||
|
||||
// do nothing if callback is for a previous request
|
||||
if(seq !== this.nodePageRequestSequence){
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<title>Reticulum MeshChat</title>
|
||||
|
||||
<!-- scripts -->
|
||||
<script src="assets/js/micron-parser.js"></script>
|
||||
|
||||
<!-- codec2 -->
|
||||
<script src="assets/js/codec2-emscripten/c2enc.js"></script>
|
||||
<script src="assets/js/codec2-emscripten/c2dec.js"></script>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* https://raw.githubusercontent.com/markqvist/NomadNet/refs/heads/master/nomadnet/ui/textui/Guide.py
|
||||
*/
|
||||
class MicronParser {
|
||||
|
||||
constructor(darkTheme = true) {
|
||||
this.darkTheme = darkTheme;
|
||||
this.DEFAULT_FG_DARK = "ddd";
|
||||
@@ -36,10 +37,11 @@ class MicronParser {
|
||||
this.SELECTED_STYLES = this.STYLES_LIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
static formatNomadnetworkUrl(url) {
|
||||
return `nomadnetwork://${url}`;
|
||||
}
|
||||
/// String
|
||||
|
||||
convertMicronToHtml(markup) {
|
||||
let html = "";
|
||||
|
||||
@@ -74,7 +76,7 @@ class MicronParser {
|
||||
|
||||
return html;
|
||||
}
|
||||
/// DOM Fragment
|
||||
|
||||
parseToHtml(markup) {
|
||||
// Create a fragment to hold all the Micron output
|
||||
const fragment = document.createDocumentFragment();
|
||||
@@ -662,9 +664,6 @@ class MicronParser {
|
||||
return { obj: obj, skip: skip };
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
parseLink(line, startIndex, state) {
|
||||
let endpos = line.indexOf(']', startIndex);
|
||||
if (endpos === -1) return null;
|
||||
@@ -711,7 +710,6 @@ class MicronParser {
|
||||
return { obj: obj, skip: skip };
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
export default MicronParser;
|
||||
Reference in New Issue
Block a user