Adding content, first pass at first part
This commit is contained in:
parent
6fa1144ed9
commit
f4d8fb6b33
@ -41,6 +41,7 @@
|
|||||||
"it": true,
|
"it": true,
|
||||||
"jasmine": true,
|
"jasmine": true,
|
||||||
"module": true,
|
"module": true,
|
||||||
|
"phantom": true,
|
||||||
"process": true,
|
"process": true,
|
||||||
"require": true,
|
"require": true,
|
||||||
"requirejs": true,
|
"requirejs": true,
|
||||||
|
|||||||
@ -63,11 +63,19 @@ module.exports = function (grunt) {
|
|||||||
dest: '<%= clean.app %>',
|
dest: '<%= clean.app %>',
|
||||||
cwd: './assets/app',
|
cwd: './assets/app',
|
||||||
expand: true
|
expand: true
|
||||||
|
},
|
||||||
|
|
||||||
|
img: {
|
||||||
|
src: '**/*.png',
|
||||||
|
dest: '<%= clean.img %>',
|
||||||
|
cwd: './assets/images',
|
||||||
|
expand: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
clean: {
|
clean: {
|
||||||
app: './static/app',
|
app: './static/app',
|
||||||
|
img: './static/images',
|
||||||
compass: './sass-cache',
|
compass: './sass-cache',
|
||||||
karma: './karma-*',
|
karma: './karma-*',
|
||||||
tmp: './tmp-*.tmp'
|
tmp: './tmp-*.tmp'
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
<div class="slide slide-{{id}}">
|
<div class="slide slide-{{id}}">
|
||||||
<div class="copy"></div>
|
<div class="copy"></div>
|
||||||
{{#code}}
|
{{#code}}
|
||||||
|
<section class="code-layout">
|
||||||
<pre><code class="language-javascript"></code></pre>
|
<pre><code class="language-javascript"></code></pre>
|
||||||
<button class="request" data-env="phantomjs-1.9.8">phantomjs-1.9.8</button>
|
<button class="request" data-env="phantomjs-1.9.8">PhantomJS v1.9.8</button>
|
||||||
<button class="request" data-env="phantomjs-2.0.0">phantomjs-2.0.0</button>
|
<button class="request" data-env="phantomjs-2.0.0">PhantomJS v2.0.0</button>
|
||||||
<button class="request" data-env="node">node</button>
|
<button class="request" data-env="node">Node v0.10.36</button>
|
||||||
<pre><code class="stdout"></code></pre>
|
<button class="request" data-env="clear">Code</button>
|
||||||
<pre><code class="stderr"></code></pre>
|
</section>
|
||||||
{{/code}}
|
{{/code}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -23,9 +23,7 @@ define([
|
|||||||
ui: {
|
ui: {
|
||||||
copy: '.copy',
|
copy: '.copy',
|
||||||
code: '.language-javascript',
|
code: '.language-javascript',
|
||||||
button: '.request',
|
button: '.request'
|
||||||
stdout: '.stdout',
|
|
||||||
stderr: '.stderr'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
@ -50,16 +48,18 @@ define([
|
|||||||
onRequestResult: function onRequestResult(event) {
|
onRequestResult: function onRequestResult(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var env = $(event.target).data('env');
|
var env = $(event.target).data('env');
|
||||||
|
if (env === 'clear') {
|
||||||
|
this.render();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var results = new ResultsModel({id: this.model.get('id'), env: env});
|
var results = new ResultsModel({id: this.model.get('id'), env: env});
|
||||||
var $stdout = this.ui.stdout;
|
var $code = this.ui.code;
|
||||||
var $stderr = this.ui.stderr;
|
|
||||||
results.fetch({
|
results.fetch({
|
||||||
success: function () {
|
success: function () {
|
||||||
$stdout.text(results.get('stdout'));
|
$code.text(results.get('stdout') + results.get('stderr'));
|
||||||
$stderr.text(results.get('stderr'));
|
|
||||||
},
|
},
|
||||||
error: function () {
|
error: function () {
|
||||||
$stdout.text('error');
|
$code.text('error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
assets/images/phantomjs.png
Normal file
BIN
assets/images/phantomjs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
@ -1,21 +1,49 @@
|
|||||||
@import "_normalize";
|
@import "_normalize";
|
||||||
|
@import "compass";
|
||||||
|
|
||||||
html, body {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
$slide-width: 1280px;
|
$slide-width: 1280px;
|
||||||
$slide-height: 720px;
|
$slide-height: 720px;
|
||||||
|
|
||||||
|
$main-text: #4a2c0a;
|
||||||
|
$base-font-size: 36px;
|
||||||
|
$mega-font-size: 80px;
|
||||||
|
$strong-color: #566b15;
|
||||||
|
$background-color: #ffdfdf;
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
height: 100%;
|
||||||
|
@include background-image(linear-gradient(to bottom, $background-color, white));
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: $mega-font-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: $mega-font-size / 12 * 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
strong {
|
||||||
|
color: $strong-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
line-height: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
.deck {
|
.deck {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slide {
|
.slide {
|
||||||
width: $slide-width;
|
width: $slide-width;
|
||||||
|
height: $slide-height;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
color: $main-text;
|
||||||
|
font-size: $base-font-size;
|
||||||
|
|
||||||
.page-2 {
|
pre, code {
|
||||||
background-color: #bada55;
|
overflow: visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
bin/deck
11
bin/deck
@ -24,9 +24,9 @@ app.use((function log() {
|
|||||||
}()));
|
}()));
|
||||||
|
|
||||||
function renderError(res, err) {
|
function renderError(res, err) {
|
||||||
console.error(err);
|
console.error(err.toString());
|
||||||
res.writeHead(500, {'Content-Type': 'text/plain'});
|
res.writeHead(500, {'Content-Type': 'text/plain'});
|
||||||
res.write(err);
|
res.send(err.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
function pathToFile() {
|
function pathToFile() {
|
||||||
@ -127,8 +127,11 @@ app.get(/slide\/(\d+)/, function showHandler(req, res, next) {
|
|||||||
app.get(/results\/([^\/]+)\/(\d\d)$/, function resultsHandler(req, res, next) {
|
app.get(/results\/([^\/]+)\/(\d\d)$/, function resultsHandler(req, res, next) {
|
||||||
var app = req.params[0];
|
var app = req.params[0];
|
||||||
var slideId = req.params[1];
|
var slideId = req.params[1];
|
||||||
|
var validApps = [
|
||||||
|
'node', 'phantomjs-1.9.8', 'phantomjs-2.0.0'
|
||||||
|
];
|
||||||
|
|
||||||
if (!_.contains(['node', 'phantomjs-1.9.8', 'phantomjs-2.0.0'], app)) {
|
if (!_.contains(validApps, app)) {
|
||||||
next();
|
next();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -177,7 +180,7 @@ app.get(/results\/([^\/]+)\/(\d\d)$/, function resultsHandler(req, res, next) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
renderError(res, err);
|
res.send({stdout: '', stderr: err.toString()});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res.send({stdout: stdout, stderr: stderr});
|
res.send({stdout: stdout, stderr: stderr});
|
||||||
|
|||||||
10
data/code/phantom-webpage-screenshot.js
Normal file
10
data/code/phantom-webpage-screenshot.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
var webpage = require('webpage');
|
||||||
|
var page = webpage.create();
|
||||||
|
|
||||||
|
page.viewportSize = {width: 1280, height: 720};
|
||||||
|
|
||||||
|
page.open('http://phantomjs.org', function() {
|
||||||
|
page.render('phantomjs.png');
|
||||||
|
console.log('created phantomjs.png');
|
||||||
|
phantom.exit();
|
||||||
|
});
|
||||||
8
data/code/prototypes.js
vendored
8
data/code/prototypes.js
vendored
@ -1,5 +1,11 @@
|
|||||||
(function (phantom) {
|
(function (phantom) {
|
||||||
console.log(Function.prototype.bind);
|
console.log('bind:', typeof Function.prototype.bind);
|
||||||
|
console.log('9 === parseInt("09"):', 9 === parseInt('09'));
|
||||||
|
|
||||||
|
console.log('map:', typeof Array.prototype.map);
|
||||||
|
console.log('reduce:', typeof Array.prototype.reduce);
|
||||||
|
console.log('filter:', typeof Array.prototype.filter);
|
||||||
|
console.log('Object.create:', typeof Object.create);
|
||||||
|
|
||||||
if (phantom) {
|
if (phantom) {
|
||||||
phantom.exit();
|
phantom.exit();
|
||||||
|
|||||||
7
data/copy/about.md
Normal file
7
data/copy/about.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# About Me
|
||||||
|
|
||||||
|
- Hi, I'm Buddy ☺
|
||||||
|
- Not affiliated with PhantomJS in any way
|
||||||
|
- Principal Software Engineer at Convertro/AOL (we're hiring)
|
||||||
|
- Full Stack engineer (JavaScript, Go, Python, etc)
|
||||||
|
- Like motorcycles, math, science and obnoxious 80's punk
|
||||||
3
data/copy/define-developer.md
Normal file
3
data/copy/define-developer.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Developer Definition:
|
||||||
|
|
||||||
|
## PhantomJS is a **JavaScript runtime** that gives access to native **Qt/WebKit** objects.
|
||||||
3
data/copy/define-simple.md
Normal file
3
data/copy/define-simple.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Simple Definition:
|
||||||
|
|
||||||
|
## Headless Web Browser
|
||||||
1
data/copy/js-runtime.md
Normal file
1
data/copy/js-runtime.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# JavaScript Runtime
|
||||||
1
data/copy/only-title.md
Normal file
1
data/copy/only-title.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# PhantomJS
|
||||||
3
data/copy/screen-shot.md
Normal file
3
data/copy/screen-shot.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# PhantomJS
|
||||||
|
|
||||||
|

|
||||||
@ -1,3 +1,7 @@
|
|||||||
# PhantomJS Under the Hood
|
# PhantomJS Under the Hood
|
||||||
|
|
||||||
- Buddy Sandidge
|
## Buddy Sandidge
|
||||||
|
|
||||||
|
- [github.com/xbudex/phantom-talk](https://github.com/xbudex/phantom-talk)
|
||||||
|
|
||||||
|
- buddy.sandidge@gmail.com
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
{
|
{
|
||||||
"copy": "title",
|
"copy": "title"
|
||||||
"code": "prototypes"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"copy": "define"
|
"copy": "about"
|
||||||
}
|
}
|
||||||
|
|||||||
3
data/slide/03.json
Normal file
3
data/slide/03.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"copy": "screen-shot"
|
||||||
|
}
|
||||||
4
data/slide/04.json
Normal file
4
data/slide/04.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"copy": "only-title",
|
||||||
|
"code": "phantom-webpage-screenshot"
|
||||||
|
}
|
||||||
3
data/slide/05.json
Normal file
3
data/slide/05.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"copy": "define-developer"
|
||||||
|
}
|
||||||
4
data/slide/06.json
Normal file
4
data/slide/06.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"copy": "js-runtime",
|
||||||
|
"code": "prototypes"
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user