anchor.diff:      this.socket.onclose = function(event) {
         const NGINX_TIMEOUT_CODE = 1006;
         if (event.code === NGINX_TIMEOUT_CODE) {
  -        // silently restart
           that.terminal.greenWriteLn('WebSocket timed out');
  -        that.start();
  +        that.start(); // silently restart
         }
       };
       this.socket.onerror = function(event) {
  
positive.code:   const closeReplPage = () => {
      replPage.fadeOut('slow', () => {
        kataPage.fadeIn('slow', () => {
          replFini();
        });
      });
    };
  
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  
    const replInit = () => {
      // Trying to put Terminal inside a jQuery dialog is, empirically,
      // very tricksy (because of CSS z-Index issues I think).
      cd.saveCodeFromSyntaxHighlightEditors();
      setSessionId();
      const element = document.getElementById('repl-terminal');
      const terminal = createTerminalIn(element);
      const repl = new Repl(terminal);
      repl.create().then(() => {
        const socket = new WebSocketMonitor(terminal);
        socket.open();
        resumeButton.unbind().click(() => {
          socket.close();
          repl.delete();
          closeReplPage();
        });
      });
    };
  
    const replFini = () => {
      // Empty the dom element so next [repl] click is clean.
      $('#repl-terminal').empty();
    };
  
    const setSessionId = () => {
      // If the repl docker container's id was based *only* on the kata-id,
      // then creating a new repl could  fail if there was a very recent
      // [resume], which caused a repl DELETE request, but the docker daemon
      // had not yet actually deleted the repl container.
      // So the repl and socket Urls for a repl session have a random suffix.
      sessionId = Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0,6);
    };
  
    //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  
    function WebSocketMonitor(terminal) {
      this.url = `ws://${replUrl()}`;
      this.terminal = terminal;
    };
  
    WebSocketMonitor.prototype.open = function() { //url, terminal) {
      const that = this;
      this.socket = new WebSocket(this.url);
      this.socket.onopen = function(_event) {
  
negative.code: 'use strict';
  $(() => {
  
    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    // Notes
    // 1. If the repl docker container's id was based *only* on the kata-id,
    // then creating a new repl could  fail if there was a very recent
    // [resume], which caused a repl DELETE request, but the docker daemon
    // had not yet actually deleted the repl container.
    // So the repl and socket Urls for a repl session have a random suffix.
    // 2. Trying to put Terminal inside a jQuery dialog is, empirically,
    // very tricksy (because of CSS z-Index issues I think).
  
    const kataPage = $('#kata-page');
    const replPage = $('#repl-page');
    const resumeButton = $('.resume-button', replPage);
    const kataId = "<%= @kata.id %>";
    const replUrl = (sessionId) => `${location.hostname}/repler/${kataId}-${sessionId}`;
    const sessionId = () => Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0,6);
  
    cd.openReplPage = () => {
      kataPage.fadeOut('slow', () => {
        replPage.fadeIn('slow', () => {
          const element = document.getElementById('repl-terminal');
          const terminal = createTerminalIn(element);
          cd.saveCodeFromSyntaxHighlightEditors();
          replInit(terminal,sessionId());
        });
      });
    };
  