Permalink
Browse files

it's alive

  • Loading branch information...
0 parents commit 24756666ca98f50111fbcc7d19621bc137341025 Mark Pilgrim committed Jul 20, 2009
@@ -0,0 +1,3 @@
+FileETag MTime Size
+
+SetEnv dont-vary
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<head>
+<meta charset=utf-8>
+<title>About the book - Dive Into HTML 5</title>
+<link rel=stylesheet href=screen.css>
+<style>
+h1:before{content:''}
+#belong{margin:0 auto;width:558px;height:738px;background:#fff url(i/openclipart.org_media_files_Selanit_8331.png) no-repeat;border:1px solid white}
+#belong div{margin:375px 30px 0 40px}
+div p{font-size:small}
+abbr{font-variant:none;text-transform:none;letter-spacing:0}
+</style>
+<meta name=viewport content='initial-scale=1.0'>
+</head>
+<form action=http://www.google.com/cse><div><input type=hidden name=cx value=014021643941856155761:6jgee_nxreo><input type=hidden name=ie value=UTF-8><input name=q size=25>&nbsp;<input type=submit name=sa value=Search></div></form>
+<p>You are here: <a href=index.html>Home</a> <span class=u>&#8227;</span> <!--<a href=table-of-contents.html>-->Dive Into HTML 5<!--</a>--> <span class=u>&#8227;</span>
+<h1>About The Book</h1>
+<div id=belong>
+<div>
+<p><cite>Dive Into HTML 5</cite> comprises original prose and graphics licensed under the <a href=http://creativecommons.org/licenses/by/3.0/ rel=license title='Creative Commons Attribution 3.0 Unported'>CC-BY-3.0</a> license. Illustrations from the <a href=http://openclipart.org/>Open Clip Art Library</a> are public domain.
+<p>The online edition uses <a href=http://jquery.com>jQuery</a>, released under the <abbr>MIT</abbr> and <abbr title="GNU General Public License">GPL</abbr> licenses. <span style="color:red">C</span><span style="color:aqua">o</span><span style="color:plum">l</span><span style="color:gold">o</span><span style="color:blue">r</span> syntax highlighting is provided by <a href=http://code.google.com/p/google-code-prettify/>prettify.js</a>, other parsing code is adapted from <a href=http://code.google.com/p/javascript-search-term-highlighter/>highlighter.js</a>; both are released under the Apache License 2.0.
+<p>Corrections and feedback to <a href=mailto:mark@diveintomark.org>mark@diveintomark.org</a>
+</div>
+</div>
+<p class=c>&copy; 2009 O&#8217;Reilly Media &bull; written by <!--<a href=colophon.html>-->Mark Pilgrim<!--</a>-->
@@ -0,0 +1,2 @@
+ExpiresActive On
+ExpiresDefault "access plus 1 day"
No changes.
@@ -0,0 +1,2 @@
+ExpiresActive On
+ExpiresDefault "access plus 1 year"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<head>
+<meta charset=utf-8>
+<title>Dive Into HTML 5</title>
+<link rel=stylesheet href=screen.css>
+<style>
+h1:before{content:''}
+</style>
+<meta name=viewport content='initial-scale=1.0'>
+</head>
+<form action=http://www.google.com/cse><div><input type=hidden name=cx value=014021643941856155761:6jgee_nxreo><input type=hidden name=ie value=UTF-8><input name=q size=25>&nbsp;<input type=submit name=sa value=Search></div></form>
+<p>You are here:&nbsp;&nbsp;<span title="Ce n'est pas un point" style='cursor:default'>&bull;</span>
+
+<h1>Dive Into HTML 5</h1>
+
+<p><cite>Dive Into HTML 5</cite> covers <a href=http://www.whatwg.org/html5>HTML 5</a> and other emerging web standards. I am publishing drafts online as I go. <a href=about.html>Please send feedback</a>. The final version will be published on paper by O&#8217;Reilly, under a different (to-be-determined) name. The book will remain online under the <a rel=license href=http://creativecommons.org/licenses/by/3.0/>CC-BY-3.0</a> license.
+
+<p>This is the current table of contents:
+
+<ol>
+<li>A Brief but Insanely Biased History of HTML 5
+<li>Installing an HTML 5-capable Browser (or Two, or Three)
+<li>Stop Littering (&hellip;Your Markup With <code>div</code>s and <code>span</code>s)
+<li>Let&#8217;s Call It a Draw(ing Surface)
+<li>Multimedia in a Flash (Without That Other Thing)
+<li><code>SELECT * FROM BROWSER WHERE 5 > 2</code>
+<li>Thread The Needle, Thread The Script
+<li>Let&#8217;s Take This Offline
+<li>You Are Here (And So Is Everybody Else)
+<li>Web Forms, Reinvented
+<li>Distributed Extensibility
+</ol>
+
+<p class=c>&#8220;If you&#8217;re good at something, never do it for free.&#8221; &mdash; <cite>The Joker</cite><br>(but that doesn&#8217;t mean you have to keep it to yourself)
+<p class=c>&copy; 2009 O&#8217;Reilly Media &bull; written by <a href=about.html>Mark Pilgrim</a>
@@ -0,0 +1,2 @@
+ExpiresActive On
+ExpiresDefault "access plus 1 year"
212 j/dih5.js
@@ -0,0 +1,212 @@
+/*
+ The following three functions are taken from
+ http://code.google.com/p/javascript-search-term-highlighter/
+ Copyright 2004 Dave Lemen
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+function getSearchTerms() {
+ var highlighterParameters = 'q as_q as_epq as_oq query search';
+ var a = new Array();
+ var params = getParamValues(document.referrer/*document.location.href*/, highlighterParameters);
+ var terms;
+ for (i = 0; i < params.length; i++) {
+ terms = parseTerms(params[i]);
+ for (j = 0; j < terms.length; j++) {
+ if (terms[j] != '') {
+ a.push(terms[j].toLowerCase());
+ }
+ }
+ }
+ return a;
+}
+
+function parseTerms(query) {
+ var s = query + '';
+ s = s.replace(/(^|\s)(site|related|link|info|cache):[^\s]*(\s|$)/ig, ' ');
+ s = s.replace(/[^a-z0-9_-]/ig, ' '); // word chars only.
+ s = s.replace(/(^|\s)-/g, ' '); // +required -excluded ~synonyms
+ s = s.replace(/\b(and|not|or)\b/ig, ' ');
+ s = s.replace(/\b[a-z0-9]\b/ig, ' '); // one char terms
+ return s.split(/\s+/);
+}
+
+function getParamValues(url, parameters) {
+ var params = new Array();
+ var p = parameters.replace(/,/, ' ').split(/\s+/);
+ if (url.indexOf('?') > 0) {
+ var qs = url.substr(url.indexOf('?') + 1);
+ var qsa = qs.split('&');
+ for (i = 0; i < qsa.length; i++) {
+ nameValue = qsa[i].split('=');
+ if (nameValue.length != 2) continue;
+ for (j = 0; j < p.length; j++) {
+ if (nameValue[0] == p[j]) {
+ params.push(unescape(nameValue[1]).toLowerCase().replace(/\+/g, ' '));
+ }
+ }
+ }
+ }
+ return params;
+}
+
+/*
+
+The rest of this script is
+Copyright (c) 2009, Mark Pilgrim, 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.
+
+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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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.
+*/
+
+var HS = {'visible': 'hide', 'hidden': 'show'};
+$(document).ready(function() {
+ hideTOC();
+ prettyPrint();
+
+ /* "hide", "open in new window", and (optionally) "download" widgets on code & screen blocks */
+ $("pre > code").each(function(i) {
+ var pre = $(this.parentNode);
+ if (pre.parents("table").length == 0) {
+ pre.addClass("code");
+ }
+ });
+ $("pre.code:not(.nd), pre.screen:not(.nd)").each(function(i) {
+ /* give each code block a unique ID */
+ this.id = "autopre" + i;
+
+ /* wrap code block in a div and insert widget block */
+ $(this).wrapInner('<div class=b></div>');
+ $(this).prepend('<div class=w>[<a class=toggle href="javascript:toggleCodeBlock(\'' + this.id + '\')">' + HS['visible'] + '</a>] [<a href="javascript:plainTextOnClick(\'' + this.id + '\')">open in new window</a>]</div>');
+
+ /* move download link into widget block */
+ $(this).prev("p.d").each(function(i) {
+ $(this).next("pre").find("div.w").append(" " + $(this).html());
+ this.parentNode.removeChild(this);
+ });
+
+ /* create skip links */
+ var postelm = $(this).next().get(0);
+ var postid = postelm.id || ("postautopre" + i);
+ postelm.id = postid;
+ $(this).before('<p class=skip><a href=#' + postid + '>skip over this code listing</a>');
+ });
+
+ /* make skip links disappear until you tab to them */
+ $(".skip a").blur(function() {
+ $(this).css({'position':'absolute','left':'0px','top':'-500px','width':'1px','height':'1px','overflow':'hidden'});
+ });
+ $(".skip a").blur();
+ $(".skip a").focus(function() {
+ $(this).css({'position':'static','width':'auto','height':'auto'});
+ });
+
+ /* synchronized highlighting on callouts and their associated lines within code & screen blocks */
+ var hip = {'background-color':'#eee','cursor':'default'};
+ var unhip = {'background-color':'inherit','cursor':'inherit'};
+ $("pre.code, pre.screen").each(function() {
+ $(this).find("a:not([href])").each(function(i) {
+ var a = $(this);
+ var li = a.parents("pre").next("ol").find("li:nth-child(" + (i+1) + ")");
+ li.add(a).hover(function() { a.css(hip); li.css(hip); },
+ function() { a.css(unhip); li.css(unhip); });
+ });
+ });
+
+ /* synchronized highlighting on callouts and their associated table rows */
+ $("table").each(function() {
+ $(this).find("tr:gt(0)").each(function(i) {
+ var tr = $(this);
+ var li = tr.parents("table").next("ol").find("li:nth-child(" + (i+1) + ")");
+ if (li.length > 0) {
+ li.add(tr).hover(function() { tr.css(hip); li.css(hip); },
+ function() { tr.css(unhip); li.css(unhip); });
+ }
+ });
+ });
+
+ /* match <dfn> terms with incoming search keywords and jump to the containing section */
+ var searchTerms = getSearchTerms();
+ $("dfn").each(function() {
+ var dfn = $(this);
+ var dfnTerm = dfn.text().toLowerCase();
+ if ($.inArray(dfnTerm, searchTerms) != -1) {
+ var section = dfn.parents("p,table,ul,ol,blockquote").prevAll("*:header").get(0);
+ if (section) {
+ window.setTimeout(function() {document.location.hash = section.id;}, 0);
+ return false;
+ }
+ }
+ });
+
+ }); /* document.ready */
+
+function toggleCodeBlock(id) {
+ $("#" + id).find("div.b").toggle();
+ var a = $("#" + id).find("a.toggle");
+ a.text(a.text() == HS['visible'] ? HS['hidden'] : HS['visible']);
+}
+
+function plainTextOnClick(id) {
+ var clone = $("#" + id).clone();
+ clone.find("div.w, span.u").remove();
+ var win = window.open("about:blank", "plaintext", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=400,left=35,top=75");
+ win.document.open();
+ win.document.write('<pre>' + clone.html());
+ win.document.close();
+}
+
+function hideTOC() {
+ var toc = '<span class="nm u">&#8227;</span> <a href="javascript:showTOC()">show table of contents</a>';
+ $("#toc").html(toc);
+}
+
+function showTOC() {
+ var toc = '';
+ var old_level = 1;
+ $('h2,h3').each(function(i, h) {
+ level = parseInt(h.tagName.substring(1));
+ if (level < old_level) {
+ toc += '</ol>';
+ } else if (level > old_level) {
+ toc += '<ol>';
+ }
+ toc += '<li><a href=#' + h.id + '>' + h.innerHTML + '</a>';
+ old_level = level;
+ });
+ while (level > 1) {
+ toc += '</ol>';
+ level -= 1;
+ }
+ toc = '<span class="nm u">&#9662;</span> <a href="javascript:hideTOC()">hide table of contents</a><ol start=0><li><a href=table-of-contents.html><span class=u>&uarr;</span> Full table of contents</a></li>' + toc.substring(4);
+ $("#toc").html(toc);
+}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 2475666

Please sign in to comment.