Update slides
This commit is contained in:
parent
41788bbd59
commit
ca14db930d
14
data/code/backbone-umd.js
Normal file
14
data/code/backbone-umd.js
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
(function(root, factory) {
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define(['underscore', 'jquery', 'exports'], function(_, $, exports) {
|
||||||
|
root.Backbone = factory(root, exports, _, $);
|
||||||
|
});
|
||||||
|
} else if (typeof exports !== 'undefined') {
|
||||||
|
var _ = require('underscore');
|
||||||
|
factory(root, exports, _);
|
||||||
|
} else {
|
||||||
|
root.Backbone = factory(root, {}, root._, root.$);
|
||||||
|
}
|
||||||
|
}(this, function(root, Backbone, _, $) {
|
||||||
|
// Backbone…
|
||||||
|
}));
|
||||||
7
data/code/backbone.js
Normal file
7
data/code/backbone.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
var phantom = phantom || {exit: function () {}};
|
||||||
|
var _ = require('../../vendor/underscore/underscore');
|
||||||
|
phantom.injectJs('../../vendor/backbone/backbone.js');
|
||||||
|
console.log(_.toString());
|
||||||
|
console.log(Backbone.View.toString());
|
||||||
|
phantom.exit();
|
||||||
|
//module.exports = Backbone;
|
||||||
@ -1,8 +1,8 @@
|
|||||||
function onLoad() {
|
var phantom = this.phantom || {exit: function () {}};
|
||||||
console.log(this.responseText);
|
var page = require('webpage').create();
|
||||||
}
|
// code, code, code…
|
||||||
|
page.open('about:blank', function () {
|
||||||
var request = new XMLHttpRequest();
|
page.close();
|
||||||
request.onload = onLoad;
|
console.log('☮ out!');
|
||||||
request.open('get', 'http://localhost:8000/', true);
|
phantom.exit();
|
||||||
request.send();
|
});
|
||||||
|
|||||||
5
data/code/prototypes.js
vendored
5
data/code/prototypes.js
vendored
@ -1,4 +1,4 @@
|
|||||||
(function (phantom) {
|
var phantom = this.phantom || {exit: function () {}};
|
||||||
console.log('bind:', typeof Function.prototype.bind);
|
console.log('bind:', typeof Function.prototype.bind);
|
||||||
console.log('9 === parseInt("09"):', 9 === parseInt('09'));
|
console.log('9 === parseInt("09"):', 9 === parseInt('09'));
|
||||||
|
|
||||||
@ -7,7 +7,4 @@
|
|||||||
console.log('filter:', typeof Array.prototype.filter);
|
console.log('filter:', typeof Array.prototype.filter);
|
||||||
console.log('Object.create:', typeof Object.create);
|
console.log('Object.create:', typeof Object.create);
|
||||||
|
|
||||||
if (phantom) {
|
|
||||||
phantom.exit();
|
phantom.exit();
|
||||||
}
|
|
||||||
}(this.phantom));
|
|
||||||
|
|||||||
5
data/code/some-test.js
Normal file
5
data/code/some-test.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
describe('some test', function () {
|
||||||
|
it('→ some test case', function () {
|
||||||
|
expect(1 + 1).toBe(2);
|
||||||
|
});
|
||||||
|
});
|
||||||
15
data/code/test.js
Normal file
15
data/code/test.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
phantom.injectJs('../../vendor/jasmine/lib/jasmine-core/jasmine.js');
|
||||||
|
var consoleFns = require('../../vendor/jasmine/lib/console/console.js');
|
||||||
|
var jasmine = jasmineRequire.core(jasmineRequire);
|
||||||
|
consoleFns.console(consoleFns, jasmine);
|
||||||
|
|
||||||
|
var globals = jasmineRequire.interface(jasmine, jasmine.getEnv());
|
||||||
|
for (var property in globals) this[property] = globals[property];
|
||||||
|
|
||||||
|
jasmine.getEnv().addReporter(new jasmine.ConsoleReporter({
|
||||||
|
print: function print(msg) { console.log(msg); },
|
||||||
|
onComplete: function exit(success) { phantom.exit(success ? 0 : 1); }
|
||||||
|
}));
|
||||||
|
|
||||||
|
phantom.injectJs('./some-test.js');
|
||||||
|
jasmine.getEnv().execute();
|
||||||
@ -1,10 +1,9 @@
|
|||||||
(function (phantom) {
|
var phantom = this.phantom || {exit: function () {}};
|
||||||
var foo = {bar: {baz: 123}};
|
var foo = {bar: {baz: 123}};
|
||||||
delete foo.bar;
|
delete foo.bar;
|
||||||
try {
|
try {
|
||||||
console.log(foo.bar.baz);
|
console.log(foo.bar.baz);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
phantom && phantom.exit();
|
phantom.exit();
|
||||||
}
|
}
|
||||||
}(this.phantom));
|
|
||||||
|
|||||||
6
data/copy/code-share.md
Normal file
6
data/copy/code-share.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Sharing is Caring
|
||||||
|
|
||||||
|
- Global variables
|
||||||
|
- CommonJS
|
||||||
|
- AMD
|
||||||
|
- ES6 modules
|
||||||
5
data/copy/crash-explain.md
Normal file
5
data/copy/crash-explain.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Use After Free
|
||||||
|
|
||||||
|
- Create webpage object in JavaScript
|
||||||
|
- Close webpage in JavaScript
|
||||||
|
- Do something with webpage in JavaScript
|
||||||
2
data/copy/fin.md
Normal file
2
data/copy/fin.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Thanks!
|
||||||
|
## Q&A
|
||||||
6
data/copy/other-awesome.md
Normal file
6
data/copy/other-awesome.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# More goodies
|
||||||
|
|
||||||
|
- The `--remote-debugger-port [debug-port]` flag
|
||||||
|
- Web server module
|
||||||
|
- Use a WebSocket in a webpage
|
||||||
|
- So much awesomeness
|
||||||
1
data/copy/testing.md
Normal file
1
data/copy/testing.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# Testing
|
||||||
1
data/copy/umd.md
Normal file
1
data/copy/umd.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# Backbone's UMD
|
||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"copy": "only-title",
|
"copy": "crash-explain",
|
||||||
"code": "crash"
|
"code": "crash"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"copy": "js-runtime",
|
"copy": "js-runtime",
|
||||||
"code": "html5"
|
"code": "prototypes"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
{
|
{
|
||||||
"copy": "js-runtime",
|
"copy": "code-share"
|
||||||
"code": "prototypes"
|
|
||||||
}
|
}
|
||||||
|
|||||||
4
data/slide/12.json
Normal file
4
data/slide/12.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"copy": "umd",
|
||||||
|
"code": "backbone-umd"
|
||||||
|
}
|
||||||
4
data/slide/13.json
Normal file
4
data/slide/13.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"copy": "only-title",
|
||||||
|
"code": "backbone"
|
||||||
|
}
|
||||||
4
data/slide/14.json
Normal file
4
data/slide/14.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"copy": "testing",
|
||||||
|
"code": "some-test"
|
||||||
|
}
|
||||||
4
data/slide/15.json
Normal file
4
data/slide/15.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"copy": "testing",
|
||||||
|
"code": "test"
|
||||||
|
}
|
||||||
3
data/slide/16.json
Normal file
3
data/slide/16.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"copy": "other-awesome"
|
||||||
|
}
|
||||||
3
data/slide/17.json
Normal file
3
data/slide/17.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"copy": "fin"
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user