forked from hakimel/reveal.js
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.craftsmanship.html
920 lines (719 loc) · 40.1 KB
/
index.craftsmanship.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Software Craftsmanship with JavaScript</title>
<meta name="description" content="A collection of tools, patterns and conventions I recommend for professional JS development.">
<meta name="author" content="Johannes Hoppe">
<link rel="shortcut icon" href="images/favicon.ico" >
<meta property="og:image" content="images/logo.png" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/yellowJS.css" id="theme">
<link rel="stylesheet" href="css/custom.css">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!--<link href="lib/css/default.css" rel="stylesheet" />-->
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<img src="images/logo_big.png" width="75%" />
<h1 class="nowrap hidePrint" style="font-size: 2.5em;">Software Craftsmanship </h1>
<h1 class="nowrap showPrint" style="font-size: 1.8em;">Software Craftsmanship</h1>
<br class="hidePrint" />
<br class="hidePrint" />
<small class="hidePrint">Navigate with <span class="key">Esc</span>, <span class="key">→</span> and <span class="key">↓</span></small>
<h4 class="showPrint"><a style="color:brown" href="http://johanneshoppe.github.com/JsBestPractices/index.craftsmanship.html">bit.ly/jsCraftsmanship<br />Interaktive Version der Präsentation!</a></h4>
</section>
<section data-markdown>
![tools](images/johannes.png)
### [JohannesHoppe.de](http://www.johanneshoppe.de/)
<h4 class="showPrint"><a style="color:brown" href="http://johanneshoppe.github.com/JsBestPractices/index.craftsmanship.html">bit.ly/jsCraftsmanship<br />Interaktive Version der Präsentation!</a></h4>
</section>
<section data-markdown>
# Prinzipien
Wissen
Werkzeuge
Wiederholung
</section>
<section>
<section data-markdown>
# Wissen
<small>Know the pitfalls</small>
![pitfalls](images/banana_peel.png)
</section>
<section data-markdown>
## Implied globals
<small>Forgetting var</small>
```javascript contenteditable
var foo = function() {
bar = 1;
};
```
</section>
<section data-markdown>
## Boolean type conversion
<small>To Truthy or to Falsy. That is the *only* question!</small>
```javascript contenteditable
var el = document.getElementById('does_not_exist');
if(el == false) {
alert("shouldn't we see this message?!");
}
```
</section>
<section data-markdown>
## Trailing comma
<small>works on my machine!</small>
```javascript contenteditable
var foo = {
bar: "bar",
baz: "baz",
};
```
</section>
<section data-markdown>
## Return undefined
<small>señor developers wear mustaches</small>
<mustache>{</mustache>
```javascript contenteditable
var foo = function() {
return
{
x : "looks like C# now!"
};
}
```
</section>
<section data-markdown>
## Associative arrays
<small>they don't exist</small>
```javascript contenteditable
var x = [];
x['foo'] = "bar";
```
</section>
<section data-markdown>
## try .. catch .. finally
<small>who cares about the reason?</small>
```javascript contenteditable
var foo = function() {
try {
doCrazyStuff;
} catch (e) {
return false;
}
return true;
};
```
</section>
<!--
<section data-markdown>
## for .. in
<small>use a framework</small>
```javascript contenteditable
var data = {
foo: "oh",
bar: "my"
}
for (var d in data) {
console.log(data[d]);
}
```
</section>
<section data-markdown>
## for .. in
<small>& never touch Object.prototype</small>
```javascript contenteditable
Object.prototype.yetAnotherToString = function() {
return "god";
}
```
</section>
-->
<section data-markdown>
## Hoisting
<small>declare upfront all variables</small>
```javascript contenteditable
var foo = "global";
var bar = function() {
alert(foo);
var foo = "local";
alert(foo);
};
```
</section>
<section data-markdown>
## Eval
<small>... and the job is done</small>
```javascript contenteditable
function poorMansJsonParser(text) {
return eval("(" + text + ")");
}
var text = ' { "hello" : "world" } ';
var json = poorMansJsonParser(text);
```
</section>
<section data-markdown data-state="alert">
## Eval is evil!
<small>Never ever!</small>
```javascript contenteditable
var text = ' function() { alert("hacked!"); })( ';
```
</section>
<section data-markdown>
## Globals
<small>the mother of all antipatterns</small>
```javascript contenteditable
function foo() {
return "bar";
}
console.log(this['foo']());
```
</section>
<section data-markdown>
![kitteh](images/kitteh.jpg)
<small>Every time you clutter the global namespace,
somewhere in the world a helpless kitten dies!</small>
</section>
<!--- *********************************** -->
<section data-markdown>
# Wissen
<small>Pretty Code</small>
![tools](images/mustache.png)
</section>
<!--
<section data-markdown>
## Coding conventions
<ol>
<li class="fragment">indentation (4 spaces!)</li>
<li class="fragment">curly braces everywhere</li>
<li class="fragment">semicolons everywhere</li>
<li class="fragment">constructor functions: UpperCamelCase</li>
<li class="fragment">all other: lowerCamelCase</li>
</ol>
</section>
-->
<section data-markdown>
## Globals
<small>reduce, minimize, delete or kill them</small>
```javascript contenteditable
(function() { "wtf?" })();
```
</section>
<section data-markdown>
## The switch-case syndrome
<small>a functional language wants functions!</small>
```javascript contenteditable
switch (something) {
case 1:
doFirst();
break;
case 2:
doSecond();
break;
case 3:
doThird();
break;
}
```
</section>
<section data-markdown>
## Lookup tables
<small>avoid the switch-case syndrome</small>
```javascript contenteditable
var methods = {
1: doFirst,
2: doSecond,
3: doThird
};
if (methods[something]) {
methods[something]();
}
```
</section>
<!--
<section data-markdown>
## Inheritance
<small>favour composition over inheritance (FCoI)</small>
<blockquote>
Because inheritance exposes a subclass to details of its parent's implementation,
it's often said that 'inheritance breaks encapsulation'.
</blockquote>
<small class="miniR">(Gang of Four 1995:19)</small>
</section>
-->
<section data-markdown>
## Revealing Module Pattern
```javascript contenteditable fragment
var myRevealingModule = function () {
var _name = "Johannes";
function greetings() {
console.log("Hello " + _name);
}
function setName(name) {
_name = name;
}
return {
setName: setName,
greetings: greetings
};
}();
```
<small class="mini">[» Documentation](http://addyosmani.com/resources/essentialjsdesignpatterns/book/#revealingmodulepatternjavascript)</small>
</section>
<section data-markdown>
## Modul loaders
<small>use AMD (require.js)</small>
```javascript contenteditable fragment
define('test', ['jquery'], function() {
return {
saySomething : function() { alert("hello!"); }
}
});
require(['test'], function(t) {
t.saySomething();
});
```
</section>
<section data-markdown>
## Events
<small>Publish/Subscribe Pattern</small>
```javascript contenteditable
var $events = $({});
$events.bind('somethingHappens', function() {
alert("Something happened!");
});
$events.trigger('somethingHappens');
```
</section>
</section>
<section>
<section data-markdown>
# Werkzeuge
![tools](images/tool.png)
</section>
<section data-markdown>
* Visual Studio 2010/2012
* [JScript Editor Extensions](http://visualstudiogallery.msdn.microsoft.com/872d27ee-38c7-4a97-98dc-0d8a431cc2ed)
* [Resharper 7.1](http://www.jetbrains.com/resharper/whatsnew/#javascript)
* [JSHint](http://www.jshint.com/platforms/)
* [Chutzpah](http://chutzpah.codeplex.com/)
* [Firebug](https://getfirebug.com/) / F12
</section>
<section data-markdown data-state="jasmine">
![Jasmine](images/jasmine_logo.png")
_TDD with [Jasmine](http://pivotal.github.com/jasmine/)_
</section>
<section data-markdown data-state="jasmine">
## Why Jasmine?
<ul class="model jasmine">
<li class="fragment">
<span> BDD-style </span>
<small>similar to JSpec or RSpec,<br>created by authors of jsUnit and Screw.Unit</small>
</li>
<li class="fragment">
<span> independent </span>
<small>from any browser, DOM,<br>framework or host language</small>
</li>
<li class="fragment">
<span> integrates </span>
<small>into continuous build systems</small>
</li>
</ul>
</section>
<section data-markdown data-state="jasmine">
## Jasmine Bootstrap
```html contenteditable small
_LT_!DOCTYPE html_GT_
_LT_html_GT_
_LT_head_GT_
_LT_title_GT_Jasmine Spec Runner_LT_/title_GT_
_LT_link rel=_QUOT_stylesheet_QUOT_ href=_QUOT_lib/jasmine-1.3.1/jasmine.css_QUOT_ /_GT_
_LT_script src=_QUOT_lib/jasmine-1.3.1/jasmine.js_QUOT__GT__LT_/script_GT_
_LT_script src=_QUOT_lib/jasmine-1.3.1/jasmine-html.js_QUOT__GT__LT_/script_GT_
_LT_!-- include source files here... --_GT_
_LT_script src=_QUOT_src/Player.js_QUOT__GT__LT_/script_GT_
_LT_script src=_QUOT_src/Song.js_QUOT__GT__LT_/script_GT_
_LT_!-- include spec files here... --_GT_
_LT_script src=_QUOT_spec/SpecHelper.js_QUOT__GT__LT_/script_GT_
_LT_script src=_QUOT_spec/PlayerSpec.js_QUOT__GT__LT_/script_GT_
_LT_script_GT_
(function () {
var htmlReporter = new jasmine.HtmlReporter();
var jasmineEnv = jasmine.getEnv();
jasmineEnv.addReporter(htmlReporter);
jasmineEnv.specFilter = function (spec) {
return htmlReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function () {
if (currentWindowOnload) { currentWindowOnload(); }
jasmineEnv.execute();
};
})();
_LT_/script_GT_
_LT_/head_GT_
_LT_body_GT_
_LT_/body_GT_
_LT_/html_GT_
```
</section>
<section data-markdown data-state="jasmine">
## Output
<iframe src="js/jasmine/SpecRunner.html" class="spec" scrolling="no"></iframe>
</section>
<section data-markdown data-state="jasmine">
## Hello World
```javascript contenteditable
var helloWorld = function() {
return "Hello World!";
};
describe('helloWorld', function() {
it('says hello', function() {
expect(helloWorld()).toEqual("Hello World!");
});
});
jasmine.getEnv().execute();
```
<small class="miniR">hint: press F12 and paste this code!</small>
</section>
<!--
<section data-markdown>
## Matchers
```javascript contenteditable
expect(x).toEqual(y);
expect(x).toBe(y);
expect(x).toMatch(pattern);
expect(x).toBeDefined();
expect(x).toBeUndefined();
expect(x).toBeNull();
expect(x).toBeTruthy();
expect(x).toBeFalsy();
expect(x).toContain(y);
expect(x).toBeLessThan(y);
expect(x).toBeGreaterThan(y);
expect(function(){fn();}).toThrow(e);
```
</section>
<section data-markdown>
## Own matchers
```javascript contenteditable
beforeEach(function () {
this.addMatchers({
isACat: function () {
return this.actual.isFluffy() _AMP__AMP_ this.actual.isLazy();
}
});
});
describe('Garfield', function () {
it('is a cat', function () {
expect(new Garfield()).isACat();
});
});
```
<small class="mini">[» Documentation](https://github.com/pivotal/jasmine/wiki/Matchers)</small>
</section>
/////////////////// - TDD example moved to KATA
<section data-markdown>
## Testing HTML
Jasmine is DOM agnostic
comes without tools to set up HTML fixtures
<br><br>
<small class="miniR">Definition:
A test fixture is a fixed state of a set of
objects used as a baseline for running tests.</small>
</section>
<section data-markdown>
## First Solution
<small>in memory fixture with jQuery</small>
```javascript contenteditable
describe('trivial jQuery plugin', function () {
var fixture;
beforeEach(function () {
fixture = $('_LT_div_GT_some HTML code here_LT_/div_GT_');
});
it('should do something', function () {
fixture.myPlugin();
expect(fixture).toHaveClass("newClass");
});
});
jasmine.getEnv().execute();
```
<small>... only works for trivial plugins!</small>
</section>
<section data-markdown>
## Clumsy Solution
<small>directly append to/remove from DOM</small>
```javascript contenteditable
describe('my jQuery plugin', function () {
beforeEach(function () {
$('#fixture').remove();
$('body').append('_LT_div id=_QUOT_fixture_QUOT__GT_HTML_LT_/div_GT_');
});
it('should do something', function () {
$('#fixture').myPlugin();
expect($('#fixture')).toHaveClass("newClass");
});
});
jasmine.getEnv().execute();
```
</section>
<section data-markdown>
## jasmine-jquery
<small>[custom matchers](https://github.com/velesin/jasmine-jquery#jquery-matchers), HTML/style/JSON fixtures, event spies</small>
```javascript contenteditable
describe('my jQuery plugin', function () {
beforeEach(function() {
jasmine.getFixtures().fixturesPath='js/5_jasmine-demo_jquery';
jasmine.getFixtures().load('jquery.myPlugin.spec.html');
});
it('should do something', function() {
var $div = $('#helloWorld').myPlugin();
expect($div).toHaveClass("newClass");
});
});
jasmine.getEnv().execute();
```
<small class="mini"><a href="js/5_jasmine-demo_jquery/SpecRunner.html" target="blank">Demo</a></small>
</section>
<section data-markdown>
## TDD ? BDD
</section>
<section data-markdown>
## Spies
<small>test behaviour</small>
```javascript contenteditable small
describe('Garfield', function () {
describe('when told to be nice', function() {
var garfield;
beforeEach(function() {
garfield = new Garfield();
spyOn(garfield, 'goToFridgeAndEatPizza').andCallThrough();
});
it('should answer with ok', function() {
var answer = garfield.beNice();
expect(answer).toEqual("ok");
});
it('should steal pizza', function () {
garfield.beNice();
expect(garfield.goToFridgeAndEatPizza).toHaveBeenCalled();
});
});
});
jasmine.getEnv().execute();
```
<small class="miniR">A spy can stub any function and tracks calls to it and all arguments.</small>
<small class="mini"><a href="js/6_jasmine-demo_spies/SpecRunner.html" target="blank">Demo</a></small>
</section>
-->
</section>
<section>
<section data-markdown>
# Wiederholung
<br />
# <span title="Kata (Karate)" style="color:#2e2e2c;text-shadow: -1px -1px 0px #101010, 1px 1px 0px #505050;">形</span>
</section>
<section data-markdown>
<blockquote style="width: 500px">
If I would have had time...
</blockquote>
</section>
<section data-markdown>
## You will never have time!
</section>
<section data-markdown>
* __Learn__ TDD
* __Improve__ by self reflection
* __Improve__ by feedback of others
* __Help__ others to improve
* __Teach__ TDD
* __Learn__ a new language
</section>
<section data-markdown>
## Test-Driven Development
1. Write your tests
1. Watch them fail
1. Make them pass
1. Refactor
1. Repeat
<br><br>
<small class="mini">
see [Growing Object-Oriented Software, Guided by Tests](http://www.amazon.de/dp/0321503627), page 6<br>
see [Working Effectively with Legacy Code](http://www.amazon.de/dp/0131177052), page 62 or many other</small>
</section>
<section data-markdown>
## 1. Write your test
```javascript contenteditable
describe("saveFormat", function () {
var original = '{0} - {1} - {2}';
it("should replace placeholders", function () {
var expected = 'A - B - C';
var formated = saveFormat(original, 'A', 'B', 'C');
expect(formated).toEqual(expected);
});
it("should encode injected content", function () {
var expected = 'A - _AMP_lt;b_AMP_gt;TEST_AMP_lt;/b_AMP_gt; - C';
var formated = saveFormat(original, 'A', '_LT_b_GT_TEST_LT_/b_GT_', 'C');
expect(formated).toEqual(expected);
});
});
```
</section>
<section data-markdown>
## 2. Watch them fail
```javascript contenteditable
var saveFormat = function() {
return "boo!";
};
jasmine.getEnv().execute();
```
<small class="mini"><a href="js/1_jasmine-demo_fail/SpecRunner.html" target="blank">Demo</a></small>
</section>
<section data-markdown>
## 3. Make them pass
```javascript contenteditable
var saveFormat = function(txt) {
$(arguments).each(function (i, item) {
if (i _GT_ 0) {
item = ($('_LT_div/_GT_').text(item).html());
txt = txt.replace("{" + (i - 1) + "}", item);
}
});
return txt;
};
jasmine.getEnv().execute();
```
<small class="mini"><a href="js/2_jasmine-demo_pass/SpecRunner.html" target="blank">Demo</a></small>
</section>
<section data-markdown>
## 4. Refactor
```javascript contenteditable
function htmlEncode(input) {
return ($('_LT_div/_GT_').text(input).html());
}
var saveFormat = function(txt) {
$.each(arguments, function (i, item) {
if (i _GT_ 0) {
item = htmlEncode(item);
txt = txt.replace("{" + (i - 1) + "}", item);
}
});
return txt;
};
jasmine.getEnv().execute();
```
<small class="mini"><a href="js/3_jasmine-demo_refactor/SpecRunner.html" target="blank">Demo</a></small>
</section>
<section data-markdown>
## 5. Repeat
```javascript contenteditable
function htmlEncode(input) {
return ($('_LT_div/_GT_').text(input).html());
}
var saveFormat = function() {
var args = Array.prototype.slice.call(arguments);
var txt = args.shift();
$.each(args, function (i, item) {
item = htmlEncode(item);
txt = txt.replace("{" + i + "}", item);
});
return txt;
};
jasmine.getEnv().execute();
```
<small class="mini"><a href="js/4_jasmine-demo_repeat/SpecRunner.html" target="blank">Demo</a></small>
</section>
<section data-markdown>
## Deep practice
<br />
<small>
[codekata.pragprog.com](http://codekata.pragprog.com)
[katas.softwarecraftsmanship.org](http://katas.softwarecraftsmanship.org/)
</small>
</section>
</section>
<section data-markdown>
# Danke!
![QR-Code http://bit.ly/slides_dwx](images/bit.ly__slides_dwx.png)
[blog.johanneshoppe.de](http://blog.johanneshoppe.de/2013/06/dwx-developer-week/)
</section>
</div>
</div>
<div class="pesentation-details">
<p>
Created by <a href="http://johanneshoppe.de" target="_blank">Johannes Hoppe</a>
<span class="hidePrint">| <a href="?print-pdf" tooltip="activates PDF print stylesheet" target="_blank">Print PDF</a></span>
<span class="hidePrint">| <a href="https://github.com/JohannesHoppe/JsBestPractices" target="_blank">GitHub</a></span>
</p>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<!-- delicious libs for some live hacking -->
<script src="js/require.js"></script>
<script src="js/jquery.js"></script>
<script src="js/jasmine/lib/jasmine-1.3.1/jasmine.js"></script>
<script src="js/jasmine/lib/jasmine-1.3.1/jasmine.console_reporter.js"></script>
<script src="js/jasmine/lib/jasmine-jquery.js"></script>
<!--<script src="js/5_jasmine-demo_jquery/jquery.myPlugin.js"></script>
<script src="js/6_jasmine-demo_spies/garfield.js"></script>-->
<script src="js/2_jasmine-demo_pass/saveFormat.spec.js"></script>
<script>
require(['jquery'], function ($) {
// tasty hack to get back the old global $
window.$ = window.jquery = $;
// start print page if print-pdf link was clicked
$(function () {
if (window.location.search.match(/print-pdf/gi)) {
window.print();
}
});
// setup jasmine for console demos
var consoleReporter = new jasmine.ConsoleReporter();
jasmine.getEnv().addReporter(consoleReporter);
// start with:
// jasmine.getEnv().execute();
});
</script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
//minScale: 0.2,
//maxScale: 1.0,
controls: true,
progress: true,
history: true,
keyboard: true,
overview: true,
center: true,
rollingLinks: false,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function () { return !!document.body.classList; } },
{ src: 'plugin/showSource/showSource.js' }
// { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>