updated promo & moved to node-websocket-server
This commit is contained in:
parent
1d3d90364f
commit
1e9460f2d5
38
index.php
38
index.php
|
@ -19,7 +19,7 @@ function support($support) {
|
||||||
$class .= ' none';
|
$class .= ' none';
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= '<span title="' . trim($class) . '" class="' . $browser . $class . '">' . $browser . ':' . $class . '</span> ';
|
$html .= '<span title="' . trim($class) . '" class="tag ' . $browser . $class . '">' . $browser . ':' . $class . '</span> ';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
@ -29,7 +29,7 @@ function spans($list) {
|
||||||
$items = split(' ', $list);
|
$items = split(' ', $list);
|
||||||
$html = '';
|
$html = '';
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
$html .= '<span>' . $item . '</span> ';
|
$html .= '<span class="tag">' . $item . '</span> ';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
@ -52,17 +52,20 @@ function spans($list) {
|
||||||
<article>
|
<article>
|
||||||
<p><abbr>HTML</abbr> 5 experimentation and demos I've hacked together. Click on the browser support icon or the technology tag to filter the demos (the filter is an <code>OR</code> filter).</p>
|
<p><abbr>HTML</abbr> 5 experimentation and demos I've hacked together. Click on the browser support icon or the technology tag to filter the demos (the filter is an <code>OR</code> filter).</p>
|
||||||
<section>
|
<section>
|
||||||
<a href="http://full-frontal.org" id="ffad" title="JavaScript Conference: Full Frontal, 12th November">
|
<a href="http://introducinghtml5.com" id="ih5">
|
||||||
<img src="http://2010.full-frontal.org/images/ff2010.png" alt="Full Frontal Logo" />
|
<p><strong>Introducing HTML5</strong> by Bruce Laweson & Remy Sharp is the first full length book dedicated to HTML5.</p><p>Get it now and kick some HTML5 ass!</p>
|
||||||
<p><strong>Learn more HTML5 & JavaScript:</strong> Full Frontal is a conference, <em>run by</em> front end developers <em>for</em> front end developers, held in the UK on 12th November.</p>
|
|
||||||
<p>Early bird tickets start at £100. Find out more: <em class="url">http://full-frontal.org</em></p>
|
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
|
<p id="tags" class="tags">
|
||||||
|
|
||||||
|
</p>
|
||||||
<table id="demos">
|
<table id="demos">
|
||||||
<thead>
|
<thead>
|
||||||
<th>Demo</th>
|
<tr>
|
||||||
<th>Support</th>
|
<th>Demo</th>
|
||||||
<th>Technology</th>
|
<th>Support</th>
|
||||||
|
<th>Technology</th>
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($demos as $demo) :?>
|
<?php foreach ($demos as $demo) :?>
|
||||||
|
@ -82,8 +85,9 @@ function spans($list) {
|
||||||
|
|
||||||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
|
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$('tbody tr span').click(function () {
|
$(document).delegate('span.tag', 'click', function () {
|
||||||
var $tag = $(this), tag = $tag.text(), type = $tag.closest('td').attr('class');
|
var $tag = $(this), tag = $tag.text(), type = $tag.closest('td').attr('class') || 'tags';
|
||||||
|
|
||||||
if ($tag.is('.selected')) {
|
if ($tag.is('.selected')) {
|
||||||
$('.' + type + ' span:contains(' + tag + ')').removeClass('selected');
|
$('.' + type + ' span:contains(' + tag + ')').removeClass('selected');
|
||||||
} else {
|
} else {
|
||||||
|
@ -97,9 +101,21 @@ $('tbody tr span').click(function () {
|
||||||
$trs.show();
|
$trs.show();
|
||||||
} else {
|
} else {
|
||||||
$('tbody tr').show();
|
$('tbody tr').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var html = [];
|
||||||
|
$('.tags span.tag').each(function () {
|
||||||
|
var $tag = $(this), tag = $tag.text();
|
||||||
|
|
||||||
|
if (!tags[tag]) {
|
||||||
|
tags[tag] = true;
|
||||||
|
html.push('<span class="tag">' + tag + '</span> ');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#tags').append('<strong>Filter demos:</strong> ' + html.sort().join(''));
|
||||||
|
|
||||||
// $('tr td.demo').click(function () {
|
// $('tr td.demo').click(function () {
|
||||||
// window.location = $(this).find('a').attr('href');
|
// window.location = $(this).find('a').attr('href');
|
||||||
// });
|
// });
|
||||||
|
|
|
@ -35,8 +35,21 @@ addEvent(window, 'click', function (event) {
|
||||||
if (event.target.hash == '#view-source') {
|
if (event.target.hash == '#view-source') {
|
||||||
// event.preventDefault();
|
// event.preventDefault();
|
||||||
if (!document.getElementById('view-source')) {
|
if (!document.getElementById('view-source')) {
|
||||||
pre.innerHTML = ('<!DOCTYPE html>\n<html>\n' + document.documentElement.innerHTML + '\n</html>').replace(/[<>]/g, function (m) { return {'<':'<','>':'>'}[m]});
|
// pre.innerHTML = ('<!DOCTYPE html>\n<html>\n' + document.documentElement.innerHTML + '\n</html>').replace(/[<>]/g, function (m) { return {'<':'<','>':'>'}[m]});
|
||||||
document.body.appendChild(pre);
|
var xhr = new XMLHttpRequest();
|
||||||
|
|
||||||
|
// original source - rather than rendered source
|
||||||
|
xhr.onreadystatechange = function () {
|
||||||
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
|
pre.innerHTML = this.responseText.replace(/[<>]/g, function (m) { return {'<':'<','>':'>'}[m]});
|
||||||
|
prettyPrint();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.body.appendChild(pre);
|
||||||
|
// really need to be sync? - I like to think so
|
||||||
|
xhr.open("GET", window.location, true);
|
||||||
|
xhr.send();
|
||||||
}
|
}
|
||||||
document.body.className = 'view-source';
|
document.body.className = 'view-source';
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ var sys = require("sys")
|
||||||
, fs = require("fs")
|
, fs = require("fs")
|
||||||
, path = require("path")
|
, path = require("path")
|
||||||
, http = require("http")
|
, http = require("http")
|
||||||
, ws = require('../lib/ws');
|
, ws = require(__dirname + '/node-websocket-server/lib/ws');
|
||||||
|
|
||||||
/*-----------------------------------------------
|
/*-----------------------------------------------
|
||||||
logging:
|
logging:
|
||||||
|
|
Loading…
Reference in New Issue