home · contact · privacy
To avoid login/logout race conditions, move login into Game.run_tick.
[plomrogue2] / rogue_chat.html
index c685581b91969031a0f217feca967bc9c4464aac..212a1d637680f0d5753f81d863b55e6535e04871 100644 (file)
@@ -16,7 +16,7 @@ terminal rows: <input id="n_rows" type="number" step=4 min=24 value=24 />
 </div>
 <div style="position: relative; display: inline-block;">
 <pre id="terminal"></pre>
-<textarea id="input" style="position: absolute; left: 0; height: 100%; width: 100%; opacity: 0"></textarea>
+<textarea id="input" style="position: absolute; left: 0; height: 100%; width: 100%; opacity: 0; z-index: -1;"></textarea>
 </div>
 <h3>button controls for hard-to-remember keybindings</h3>
 <table id="move_table" style="float: left">
@@ -986,10 +986,11 @@ let tui = {
           };
           inner_links[y].push([url_start_x, end_x, url]);
       };
-      const matches = msg.matchAll(/https?:\/\/[^\s]+/g)
       let link_data = {};
       let url_ends = [];
-      for (const match of matches) {
+      const regexp = RegExp('https?://[^\\s]+', 'g');
+      let match;
+      while ((match = regexp.exec(msg)) !== null) {
           const url = match[0];
           const url_start = match.index;
           const url_end = match.index + match[0].length;