 DAEMON_TIMEOUT_IN_MILLISECONDS = 10*1000
 DEFAULT_DAEMON_HOST = "localhost"
 DEFAULT_DAEMON_PORT = 3017
+DEFAULT_MIN_SYNC_INTERVAL = 250
+DEFAULT_MAX_SYNC_INTERVAL = 1250
+
+MOBWRITE_DEBUG_JAVASCRIPT = """
+    ;(function(){
+      #{fs.readFileSync(path.resolve(MOBWRITE_PATH, "html/diff_match_patch_uncompressed.js"))};
+      #{fs.readFileSync(path.resolve(MOBWRITE_PATH, "html/mobwrite_core.js"))};
+      #{fs.readFileSync(path.resolve(MOBWRITE_PATH, "html/mobwrite_form.js"))};
+    }).call(this);
+    """
+
+MOBWRITE_MINIFIED_JAVASCRIPT = """
+    ;(function(){
+      #{fs.readFileSync(path.resolve(MOBWRITE_PATH, "html/compressed_form.js"))};
+    }).call(this);
+    """
 
 serve = (options) ->
   port = options?.port or DEFAULT_DAEMON_PORT

  return (req, res, next) ->
    bodyParser req, res, ->

      # Respond to any requests to the sample q.py/q.php/q.jsp endpoints
      # by grabbing the "q" or "p" parameters and interacting with the Daemon.
      # TODO: implement as "special" URLs, and offer JS from here
      # /__mobwrite__/sync (POST)
      # /__mobwrite__/client.js (GET)
      # /__mobwrite__/forms.js (GET)
      if MOBWRITE_SAMPLE_ENDPOINT_PATTERN.test(req.url) or rootPattern.test(req.url)
        clientNeedsJsonp = req.query.p?
        daemonRequest = req.body?.q or req.query.p or "\n"
        daemonResponse = ""

              font-family: sans-serif;
          }
      </style>
      <script src="/mobwrite/mobwrite.js"></script>
      </head>
      <body>
          <form id="mobwrite-form" action="" method="post" accept-charset="utf-8">
