<commit_before><div id="debug-box" style="position: fixed; bottom: 0px; max-height: 50%; background-color: #000; display: none;"></div>
<div id="debug2" style="position: fixed; bottom: 100px; background-color: #000;"></div>

<!-- The z-index should be on top of all notes.  -->
<div id="post-browser" class="post-browser">
  <div class="browser-top-bar">
    <form action="#" class="tags-form" method="get" style="display: inline;">
      <input class="post-browser-tags-form" name="tags" size="20" type="text">
      <input style="display: none;" type="submit">
    </form>
  </div>
  <ul class="post-browser-posts"></ul>
</div>

<div id="post-content" style="width: 100%; text-align: center;">
  <img class="image">
</div>

<script type="text/javascript">
  var debug = new DebugWindow($("debug-box"));

document.observe("dom:loaded", function()
{
  var normalize_hash = function(h)
  {
    // Normalize:
    // post_id/search
    var path = h.get("");
    if(path != null)
    {
      var post_id = path.split("/", 1)[0];
      h.set("", null);
      if(post_id != "")
        h.set("post-id", post_id);
      if(path.substr(post_id.length, 1) == "/")
        h.set("tags", path.substr(post_id.length + 1));
    }

    // Validate parameters.
    var post_id = h.get("post-id");
    if(post_id != null && isNaN(parseInt(post_id)))
      h.set("post-id", null);
    return h;
  }

  var denormalize_hash = function(h)
  {
    // Denormalize; the input will always be normalized.
    var str = "";

    var post_id = h.get("post-id");
    if(post_id != null)
    {
      str += post_id;
      h.set("post-id", null);
    }
    var tags = h.get("tags");
    if(tags != null)
    {
      str += "/" + tags;
      h.set("tags", null);
    }

    h.set("", str);
    return h;
  }

  UrlHash.set_normalize(normalize_hash, denormalize_hash);
  var view = new BrowserView($("post-content"));
  var thumbnail_view = new ThumbnailView($("post-browser"), view);
  new WindowTitleHandler();
  new PostLoader();

  new InputHandler();

  var container = $("post-browser");
  var update = function()
  {
    container.down(".tags-form").tags.value = UrlHash.get("tags") || "";
  }

  update();

  container.down(".tags-form").observe("submit", function(e)
  {
    e.stop();

    var tags_element = container.down(".tags-form").tags;
    tags_element.blur();

    var tags = tags_element.value;
    UrlHash.set({tags: tags});
  });

  UrlHash.observe("tags", function() {
    update();
  });
  document.observe("viewer:focus-tag-box", function(e) {
    container.down(".tags-form").tags.focus();
    container.down(".tags-form").tags.select();
    return true;
  });

  new WindowDragElement($("post-main-content").down(".image"));

});
</script><commit_msg>fix drag scrolling<commit_after><div id="debug-box" style="position: fixed; bottom: 0px; max-height: 50%; background-color: #000; display: none;"></div>
<div id="debug2" style="position: fixed; bottom: 100px; background-color: #000;"></div>

<!-- The z-index should be on top of all notes.  -->
<div id="post-browser" class="post-browser">
  <div class="browser-top-bar">
    <form action="#" class="tags-form" method="get" style="display: inline;">
      <input class="post-browser-tags-form" name="tags" size="20" type="text">
      <input style="display: none;" type="submit">
    </form>
  </div>
  <ul class="post-browser-posts"></ul>
</div>

<div id="post-content" style="width: 100%; text-align: center;">
  <img class="image">
</div>

<script type="text/javascript">
  var debug = new DebugWindow($("debug-box"));

document.observe("dom:loaded", function()
{
  var normalize_hash = function(h)
  {
    // Normalize:
    // post_id/search
    var path = h.get("");
    if(path != null)
    {
      var post_id = path.split("/", 1)[0];
      h.set("", null);
      if(post_id != "")
        h.set("post-id", post_id);
      if(path.substr(post_id.length, 1) == "/")
        h.set("tags", path.substr(post_id.length + 1));
    }

    // Validate parameters.
    var post_id = h.get("post-id");
    if(post_id != null && isNaN(parseInt(post_id)))
      h.set("post-id", null);
    return h;
  }

  var denormalize_hash = function(h)
  {
    // Denormalize; the input will always be normalized.
    var str = "";

    var post_id = h.get("post-id");
    if(post_id != null)
    {
      str += post_id;
      h.set("post-id", null);
    }
    var tags = h.get("tags");
    if(tags != null)
    {
      str += "/" + tags;
      h.set("tags", null);
    }

    h.set("", str);
    return h;
  }

  UrlHash.set_normalize(normalize_hash, denormalize_hash);
  var view = new BrowserView($("post-content"));
  var thumbnail_view = new ThumbnailView($("post-browser"), view);
  new WindowTitleHandler();
  new PostLoader();

  new InputHandler();

  var container = $("post-browser");
  var update = function()
  {
    container.down(".tags-form").tags.value = UrlHash.get("tags") || "";
  }

  update();

  container.down(".tags-form").observe("submit", function(e)
  {
    e.stop();

    var tags_element = container.down(".tags-form").tags;
    tags_element.blur();

    var tags = tags_element.value;
    UrlHash.set({tags: tags});
  });

  UrlHash.observe("tags", function() {
    update();
  });
  document.observe("viewer:focus-tag-box", function(e) {
    container.down(".tags-form").tags.focus();
    container.down(".tags-form").tags.select();
    return true;
  });

  new WindowDragElement($("post-content").down(".image"));
});
</script>
{'fraction_non_alphanumeric': 0.2041522491349481, 'fraction_numerical': 0.00801311236568931, 'mean_word_length': 3.195569136745607, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3284704', 'n_tokens_mistral': 1948, 'n_tokens_neox': 1876, 'n_words': 383}