couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nsla...@apache.org
Subject svn commit: r1615267 - in /couchdb/site: image/logo.png script/doc.js style/doc.css
Date Fri, 01 Aug 2014 23:12:49 GMT
Author: nslater
Date: Fri Aug  1 23:12:48 2014
New Revision: 1615267

URL: http://svn.apache.org/r1615267
Log:
Adding resources

A portion of this code has been taken from code I originally wrote for the
CouchDB: The Definitive Guide[1], available under a Creative Commons
Attribution license. I am relicensing that to the Apache CouchDB project
under the terms of the Apache License 2.0.

[1] http://guide.couchdb.org/


Added:
    couchdb/site/image/logo.png   (with props)
    couchdb/site/script/doc.js
    couchdb/site/style/doc.css

Added: couchdb/site/image/logo.png
URL: http://svn.apache.org/viewvc/couchdb/site/image/logo.png?rev=1615267&view=auto
==============================================================================
Binary file - no diff available.

Propchange: couchdb/site/image/logo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: couchdb/site/script/doc.js
URL: http://svn.apache.org/viewvc/couchdb/site/script/doc.js?rev=1615267&view=auto
==============================================================================
--- couchdb/site/script/doc.js (added)
+++ couchdb/site/script/doc.js Fri Aug  1 23:12:48 2014
@@ -0,0 +1,51 @@
+var scripts = [
+    "http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js",
+];
+
+for(i = 0; i < scripts.length; i++) {
+    document.write("<script src='" + scripts[i] + "'></script>");
+}
+
+function check_flag() {
+    if ($("body").hasClass("complete")) {
+        throw "Document processing is already complete.";
+    }
+}
+
+function raise_flag() {
+    $("body").addClass("complete");
+}
+function add_toc() {
+    var old_depth = 0;
+    var html = "";
+    $("*/[id!='']").each(function(index) {
+        var id = $(this).attr("id");
+        var name = $(this)[0].nodeName;
+        var text = $(this).text();
+        if (name.length != 2 || name.slice(0, 1) != "H") {
+            return;
+        }
+        var new_depth = name.slice(1,2);
+        if (new_depth > old_depth) {
+            html += "<ul>";
+        } else if (new_depth < old_depth) {
+            html += "</li></ul></li>";
+        } else {
+            html += "</li>";
+        }
+        html += "<li><a href='#" + id + "'>" + text + "</a>";
+        old_depth = new_depth;
+    });
+    html += "</li></ul>";
+    $(".toc").append(html);
+}
+
+document.onready = function() {
+    try {
+	check_flag();
+	raise_flag();
+        add_toc();
+    } catch (error) {
+        // uh oh
+    }
+}

Added: couchdb/site/style/doc.css
URL: http://svn.apache.org/viewvc/couchdb/site/style/doc.css?rev=1615267&view=auto
==============================================================================
--- couchdb/site/style/doc.css (added)
+++ couchdb/site/style/doc.css Fri Aug  1 23:12:48 2014
@@ -0,0 +1,25 @@
+html {
+    margin: 0;
+    padding: 0;
+    background-color: #FFF;
+}
+
+body {
+    margin: 20px;
+    padding: 0;
+    background-color: #FFF;
+    background-image: url(../image/logo.png);
+    background-repeat: no-repeat;
+    background-position: top right;
+}
+
+
+table {
+    border-spacing: 0px;
+    border-collapse: collapse;
+}
+
+th, td {
+    border: 1px solid #EEE;
+    padding: 10px;
+}
\ No newline at end of file



Mime
View raw message