Full Code of mbostock/bl.ocks.org for AI

master 0526df138b4e cached
12 files
7.4 KB
2.4k tokens
2 symbols
1 requests
Download .txt
Repository: mbostock/bl.ocks.org
Branch: master
Commit: 0526df138b4e
Files: 12
Total size: 7.4 KB

Directory structure:
gitextract_h59rf4u7/

├── .gitignore
├── LICENSE
├── README.md
├── chrome/
│   ├── bl.ocks.chrome/
│   │   ├── blocks.js
│   │   └── manifest.json
│   └── bl.ocks.chrome.crx
└── firefox/
    ├── bl.ocks.firefox.xpi
    ├── build.sh
    ├── chrome.manifest
    ├── content/
    │   ├── blocks.js
    │   └── blocks.xul
    └── install.rdf

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
*.pyc
heroku/secret.js


================================================
FILE: LICENSE
================================================
Copyright (c) 2010, Michael Bostock
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* The name Michael Bostock may not be used to endorse or promote products
  derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: README.md
================================================
# bl.ocks.org Browser Extensions

<http://bl.ocks.org> is a simple Gist viewer for HTML/JavaScript examples.

To install the **Chrome** extension, visit the [Chrome Web Store](https://chrome.google.com/webstore/detail/blocksorg/phjkbonaifennbfpmieeipknnkhaoiaf) and click *Add to Chrome*.

To install the **Firefox** extension, visit the [Mozilla Add-ons](https://addons.mozilla.org/en-US/firefox/addon/blocksorg/). Then click *Add to Firefox*.

A **Safari** extension is no longer supported because Apple requires a $99 per year fee to obtain a developer certificate. Please don’t use Safari.


================================================
FILE: chrome/bl.ocks.chrome/blocks.js
================================================
var observer = new MutationObserver(redraw);

observer.observe(document.documentElement, {childList: true, subtree: true});

redraw();

function redraw() {
  var container = document.querySelector(".file-navigation-options");
  if (!container) return;

  var parts = location.pathname.substring(1).split("/"),
      user = parts[0],
      id = parts[1],
      sha = parts[2];
  if (!user || user.length > 39 || !/^[a-z0-9](?:-?[a-z0-9])*$/i.test(user)) return;
  if (!/^([0-9]+|[0-9a-f]{20,})$/.test(id)) id = null;
  if (!/^[0-9a-f]{40}$/.test(sha)) sha = null;

  var anchor = container.querySelector(".bl-ocks-button"),
      href = "http://bl.ocks.org/" + user + (id ? "/" + id + (sha ? "/" + sha : "") : "");

  if (!anchor) {
    var div = document.createElement("div");
    div.className = "file-navigation-option";
    anchor = div.appendChild(document.createElement("a"));
    anchor.className = "btn btn-sm bl-ocks-button";
    var svg = anchor.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
    svg.setAttribute("class", "octicon octicon-link-external");
    svg.setAttribute("height", 16);
    svg.setAttribute("width", 12);
    var path = svg.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "path"));
    path.setAttribute("d", "M11 10h1v3c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V3c0-0.55 0.45-1 1-1h3v1H1v10h10V10zM6 2l2.25 2.25-3.25 3.25 1.5 1.5 3.25-3.25 2.25 2.25V2H6z");
    anchor.appendChild(document.createTextNode(" bl.ocks"));

    // Disconnect to avoid observing our own mutations.
    observer.disconnect();
    container.appendChild(div);
    observer.observe(document.documentElement, {childList: true, subtree: true});
  }

  if (anchor.href !== href) {
    anchor.href = href;
  }
}


================================================
FILE: chrome/bl.ocks.chrome/manifest.json
================================================
{
  "manifest_version": 2,
  "name": "bl.ocks.org",
  "version": "1.3.10",
  "short_name": "bl.ocks",
  "description": "View any gist on bl.ocks.org.",
  "icons": {"128": "icon-128.png"},
  "content_scripts": [
    {
      "matches": ["https://gist.github.com/*"],
      "js": ["blocks.js"],
      "run_at": "document_end"
    }
  ]
}


================================================
FILE: firefox/build.sh
================================================
#/bin/bash

rm -f bl.ocks.firefox.xpi
zip bl.ocks.firefox.xpi chrome.manifest content/blocks.js content/blocks.xul install.rdf


================================================
FILE: firefox/chrome.manifest
================================================
content	bl.ocks.org	content/
content	bl.ocks.org	content/ contentaccessible=yes
overlay chrome://browser/content/browser.xul chrome://bl.ocks.org/content/blocks.xul


================================================
FILE: firefox/content/blocks.js
================================================
window.addEventListener("load", function load() {
  window.removeEventListener("load", load, false);
  gBrowser.addEventListener("DOMContentLoaded", function(e) {
    var document = e.originalTarget;
    if (document.location.hostname !== "gist.github.com") return;
    var observer = new MutationObserver(redraw);

    observer.observe(document.documentElement, {childList: true, subtree: true});

    redraw();

    function redraw() {
      var container = document.querySelector(".file-navigation-options");
      if (!container) return;

      var parts = document.location.pathname.substring(1).split("/"),
          user = parts[0],
          id = parts[1],
          sha = parts[2];
      if (!user || user.length > 39 || !/^[a-z0-9](?:-?[a-z0-9])*$/i.test(user)) return;
      if (!/^([0-9]+|[0-9a-f]{20,})$/.test(id)) id = null;
      if (!/^[0-9a-f]{40}$/.test(sha)) sha = null;

      var anchor = container.querySelector(".bl-ocks-button"),
          href = "http://bl.ocks.org/" + user + (id ? "/" + id + (sha ? "/" + sha : "") : "");

      if (!anchor) {
        var div = document.createElement("div");
        div.className = "file-navigation-option";
        anchor = div.appendChild(document.createElement("a"));
        anchor.className = "btn btn-sm bl-ocks-button";
        var svg = anchor.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
        svg.setAttribute("class", "octicon octicon-link-external");
        svg.setAttribute("height", 16);
        svg.setAttribute("width", 12);
        var path = svg.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "path"));
        path.setAttribute("d", "M11 10h1v3c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V3c0-0.55 0.45-1 1-1h3v1H1v10h10V10zM6 2l2.25 2.25-3.25 3.25 1.5 1.5 3.25-3.25 2.25 2.25V2H6z");
        anchor.appendChild(document.createTextNode(" bl.ocks"));

        // Disconnect to avoid observing our own mutations.
        observer.disconnect();
        container.appendChild(div);
        observer.observe(document.documentElement, {childList: true, subtree: true});
      }

      if (anchor.href !== href) {
        anchor.href = href;
      }
    }
  }, false);
}, false);


================================================
FILE: firefox/content/blocks.xul
================================================
<?xml version="1.0"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <script type="application/x-javascript" src="chrome://bl.ocks.org/content/blocks.js"/>
</overlay>


================================================
FILE: firefox/install.rdf
================================================
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
  <Description about="urn:mozilla:install-manifest">
    <em:id>extension@bl.ocks.org</em:id>
    <em:name>bl.ocks.org</em:name>
    <em:version>1.3.10</em:version>
    <em:type>2</em:type>
    <em:description>View any gist on bl.ocks.org.</em:description>
    <em:creator>Mike Bostock</em:creator>
    <em:homepageURL>http://bl.ocks.org/</em:homepageURL>
    <em:targetApplication>
      <Description>
        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
        <em:minVersion>3.0</em:minVersion>
        <em:maxVersion>42.*</em:maxVersion>
      </Description>
    </em:targetApplication>
  </Description>
</RDF>
Download .txt
gitextract_h59rf4u7/

├── .gitignore
├── LICENSE
├── README.md
├── chrome/
│   ├── bl.ocks.chrome/
│   │   ├── blocks.js
│   │   └── manifest.json
│   └── bl.ocks.chrome.crx
└── firefox/
    ├── bl.ocks.firefox.xpi
    ├── build.sh
    ├── chrome.manifest
    ├── content/
    │   ├── blocks.js
    │   └── blocks.xul
    └── install.rdf
Download .txt
SYMBOL INDEX (2 symbols across 2 files)

FILE: chrome/bl.ocks.chrome/blocks.js
  function redraw (line 7) | function redraw() {

FILE: firefox/content/blocks.js
  function redraw (line 12) | function redraw() {
Condensed preview — 12 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (8K chars).
[
  {
    "path": ".gitignore",
    "chars": 23,
    "preview": "*.pyc\nheroku/secret.js\n"
  },
  {
    "path": "LICENSE",
    "chars": 1424,
    "preview": "Copyright (c) 2010, Michael Bostock\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or wit"
  },
  {
    "path": "README.md",
    "chars": 594,
    "preview": "# bl.ocks.org Browser Extensions\n\n<http://bl.ocks.org> is a simple Gist viewer for HTML/JavaScript examples.\n\nTo install"
  },
  {
    "path": "chrome/bl.ocks.chrome/blocks.js",
    "chars": 1760,
    "preview": "var observer = new MutationObserver(redraw);\n\nobserver.observe(document.documentElement, {childList: true, subtree: true"
  },
  {
    "path": "chrome/bl.ocks.chrome/manifest.json",
    "chars": 335,
    "preview": "{\n  \"manifest_version\": 2,\n  \"name\": \"bl.ocks.org\",\n  \"version\": \"1.3.10\",\n  \"short_name\": \"bl.ocks\",\n  \"description\": \""
  },
  {
    "path": "firefox/build.sh",
    "chars": 127,
    "preview": "#/bin/bash\n\nrm -f bl.ocks.firefox.xpi\nzip bl.ocks.firefox.xpi chrome.manifest content/blocks.js content/blocks.xul insta"
  },
  {
    "path": "firefox/chrome.manifest",
    "chars": 165,
    "preview": "content\tbl.ocks.org\tcontent/\ncontent\tbl.ocks.org\tcontent/ contentaccessible=yes\noverlay chrome://browser/content/browser"
  },
  {
    "path": "firefox/content/blocks.js",
    "chars": 2203,
    "preview": "window.addEventListener(\"load\", function load() {\n  window.removeEventListener(\"load\", load, false);\n  gBrowser.addEvent"
  },
  {
    "path": "firefox/content/blocks.xul",
    "chars": 202,
    "preview": "<?xml version=\"1.0\"?>\n<overlay xmlns=\"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul\">\n  <script type=\"ap"
  },
  {
    "path": "firefox/install.rdf",
    "chars": 757,
    "preview": "<?xml version=\"1.0\"?>\n<RDF xmlns=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n     xmlns:em=\"http://www.mozilla.org/200"
  }
]

// ... and 2 more files (download for full content)

About this extraction

This page contains the full source code of the mbostock/bl.ocks.org GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 12 files (7.4 KB), approximately 2.4k tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!