Presentation.st 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  1. Widget subclass: #Slide
  2. instanceVariableNames: 'presentation'
  3. category: 'Presentation'!
  4. !Slide methodsFor: 'accessing'!
  5. presentation
  6. ^presentation
  7. !
  8. presentation: aPresentation
  9. presentation := aPresentation
  10. !
  11. id
  12. self subclassResponsibility
  13. !
  14. cssClass
  15. ^'slide'
  16. !
  17. backgroundColor
  18. ^'#555'
  19. ! !
  20. !Slide methodsFor: 'actions'!
  21. show
  22. document location hash: self id.
  23. self backgroundColor ifNotNil: [
  24. (window jQuery: '#slides') css: 'background' color: self backgroundColor].
  25. (window jQuery: '.slide') hide: self presentation slideTransition options: #() duration: 300.
  26. (window jQuery: '#', self id) show: self presentation slideTransition options: #() duration: 300.
  27. ! !
  28. !Slide methodsFor: 'rendering'!
  29. renderOn: html
  30. html div class: self cssClass; id: self id; with: [
  31. self renderSlideOn: html.
  32. self renderMetaOn: html]
  33. !
  34. renderSlideOn: html
  35. !
  36. renderMetaOn: html
  37. html div
  38. id: 'meta';
  39. with: [
  40. html p class: 'title'; with: self presentation title.
  41. html p class: 'description'; with: self presentation description.
  42. html a class: 'author'; with: self presentation author; href: 'mailto:', self presentation email.
  43. html a class: 'url'; with: self presentation url; href: self presentation url]
  44. ! !
  45. !Slide class methodsFor: 'instance creation'!
  46. on: aPresentation
  47. ^self new
  48. presentation: aPresentation;
  49. yourself
  50. ! !
  51. Widget subclass: #Presentation
  52. instanceVariableNames: 'currentSlide slides'
  53. category: 'Presentation'!
  54. !Presentation methodsFor: 'accessing'!
  55. title
  56. ^'Slides'
  57. !
  58. author
  59. ^'John Smith'
  60. !
  61. url
  62. ^'http://jtalk-project.org'
  63. !
  64. description
  65. ^'A presentation written in Jtalk'
  66. !
  67. email
  68. ^'john@smith.com'
  69. !
  70. slides
  71. slides ifNil: [self initSlides].
  72. ^slides
  73. !
  74. slideClasses
  75. ^self subclassResponsibility
  76. !
  77. currentSlide
  78. ^currentSlide
  79. !
  80. currentSlide: aSlide
  81. currentSlide := aSlide
  82. !
  83. slideTransition
  84. ^'fade'
  85. !
  86. style
  87. "Should return a CSS style"
  88. ^ ''
  89. ! !
  90. !Presentation methodsFor: 'actions'!
  91. reload
  92. '#slides' asJQuery remove.
  93. '#tools' asJQuery remove.
  94. self initSlides.
  95. self appendToJQuery: 'body' asJQuery.
  96. self checkHash
  97. !
  98. setup
  99. Presentation setCurrent: self.
  100. (window jQuery: document) ready: [
  101. self appendToJQuery: 'body' asJQuery.
  102. self
  103. setKeybindings;
  104. checkHashChange;
  105. checkHash].
  106. !
  107. nextSlide
  108. | next |
  109. self currentSlide ifNotNil: [
  110. next := self slides
  111. at: (self slides indexOf: self currentSlide) + 1
  112. ifAbsent: [nil].
  113. next ifNotNil: [currentSlide := next. next show]]
  114. !
  115. showCurrentSlide
  116. self currentSlide ifNotNil: [
  117. '.slide' asJQuery hide.
  118. ('#', self currentSlide id) asJQuery show.
  119. 'title' asJQuery text: self title, ' - ', self currentSlide id.
  120. ]
  121. !
  122. previousSlide
  123. | next |
  124. self currentSlide ifNotNil: [
  125. next := self slides
  126. at: (self slides indexOf: self currentSlide) - 1
  127. ifAbsent: [nil].
  128. next ifNotNil: [currentSlide := next. next show]]
  129. !
  130. setKeybindings
  131. (window jQuery: document) keyup: [:e || node |
  132. node := e target nodeName asLowercase.
  133. (node = 'textarea' or: [node = 'input']) ifFalse: [
  134. e keyCode = 39 ifTrue: [self nextSlide].
  135. e keyCode = 37 ifTrue: [self previousSlide]]]
  136. !
  137. checkHashChange
  138. (window jQuery: window) bind: 'hashchange' do: [self checkHash]
  139. !
  140. checkHash
  141. | hash slide |
  142. hash := document location hash replace: '^#' with: ''.
  143. slide := self slides detect: [:each | each id = hash] ifNone: [nil].
  144. slide ifNotNil: [
  145. self currentSlide = slide ifFalse: [
  146. self currentSlide: slide.
  147. slide show]]
  148. ! !
  149. !Presentation methodsFor: 'initialization'!
  150. initSlides
  151. slides := self slideClasses collect: [:each | each on: self]
  152. ! !
  153. !Presentation methodsFor: 'rendering'!
  154. renderOn: html
  155. html style
  156. type: 'text/css';
  157. with: self style.
  158. html div
  159. id: 'tools';
  160. with: [self renderToolsOn: html].
  161. html div
  162. id: 'slides';
  163. with: [self renderSlidesOn: html]
  164. !
  165. renderSlidesOn: html
  166. self slides do: [:each |
  167. each renderOn: html].
  168. currentSlide ifNil: [currentSlide := self slides first].
  169. self showCurrentSlide
  170. !
  171. renderToolsOn: html
  172. html a
  173. with: 'IDE';
  174. onClick: [TabManager current open].
  175. html a
  176. with: 'Reload';
  177. onClick: [self reload].
  178. html a
  179. with: '←';
  180. onClick: [self previousSlide].
  181. html a
  182. with: '→';
  183. onClick: [self nextSlide]
  184. ! !
  185. Presentation class instanceVariableNames: 'current'!
  186. !Presentation class methodsFor: 'initialization'!
  187. initialize
  188. self isConcrete ifTrue: [self setup]
  189. !
  190. setup
  191. self new setup
  192. !
  193. setCurrent: aSlides
  194. current := aSlides
  195. !
  196. current
  197. ^current
  198. ! !
  199. !Presentation class methodsFor: 'testing'!
  200. isConcrete
  201. ^false
  202. ! !
  203. Presentation subclass: #ESUG2011Presentation
  204. instanceVariableNames: ''
  205. category: 'Presentation'!
  206. !ESUG2011Presentation methodsFor: 'accessing'!
  207. title
  208. ^'Jtalk'
  209. !
  210. description
  211. ^'ESUG 2011, Edinburgh'
  212. !
  213. author
  214. ^'Nicolas Petton'
  215. !
  216. email
  217. ^'nico@objectfusion.fr'
  218. !
  219. url
  220. ^'http://jtalk-project.org'
  221. !
  222. slideClasses
  223. ^Array new
  224. add: IntroSlide;
  225. add: AboutSlide;
  226. add: WhatIsJtalkSlide;
  227. add: JtalkFeaturesSlide;
  228. add: WorkspaceSlide;
  229. add: IDESlide;
  230. add: CountersSlide;
  231. add: JtalkAndJavascriptSlide;
  232. add: JtalkAndJavascriptSlide2;
  233. add: JtalkAndJavascriptSlide3;
  234. add: JtalkAndJavascriptSlide4;
  235. add: JtalkAndCLI;
  236. add: JtalkAndNode;
  237. add: JtalkAndNode2;
  238. add: JtalkAndNode3;
  239. add: JtalkAndWebOS;
  240. add: JtalkAndEnyo;
  241. add: ContributionsSlide;
  242. yourself
  243. !
  244. style
  245. ^'
  246. body {
  247. font-family: Helvetica,Arial,sans;
  248. }
  249. #slides {
  250. width: 100%;
  251. height: 100%;
  252. overflow: hidden;
  253. position: absolute;
  254. top: 0;
  255. bottom: 0;
  256. left: 0;
  257. right: 0;
  258. background: #555;
  259. }
  260. .slide {
  261. background: #fff;
  262. color: #444;
  263. text-align: left;
  264. font-size: 20px;
  265. line-height: 1.8em;
  266. height: 500px;
  267. width: 700px;
  268. padding: 60px;
  269. position: absolute;
  270. left: 50%;
  271. top: 50%;
  272. margin-left: -420px;
  273. margin-top: -320px;
  274. box-shadow: 0 0 20px #111;
  275. -moz-box-shadow: 0 0 20px #111;
  276. -webkit-box-shadow: 0 0 20px #111;
  277. }
  278. .slide.transparent {
  279. background: transparent;
  280. box-shadow: 0 0 0 none;
  281. -moz-box-shadow: 0 0 0 transparent;
  282. -webkit-box-shadow: 0 0 0 transparent;
  283. color: #fff !!important;
  284. }
  285. .slide.black {
  286. background: black;
  287. background-image: -webkit-gradient(
  288. linear,
  289. left bottom,
  290. left top,
  291. color-stop(0.38, rgb(79,79,79)),
  292. color-stop(0.69, rgb(33,33,33)),
  293. color-stop(0.86, rgb(4,4,4))
  294. );
  295. background-image: -moz-linear-gradient(
  296. center bottom,
  297. rgb(79,79,79) 38%,
  298. rgb(33,33,33) 69%,
  299. rgb(4,4,4) 86%
  300. );
  301. color: #fff !!important;
  302. }
  303. .slide.black h1, .slide.black h2, .slide.black h3,
  304. .slide.transparent h1, .slide.transparent h2, .slide.transparent h3 {
  305. color: #fff;
  306. text-shadow: 0 1px 4px #aaa;
  307. }
  308. .slide.black a, .slide.transparent a {
  309. color: #ccc;
  310. }
  311. .slide.white {
  312. color: #333 !!important;
  313. }
  314. .slide.white h1, .slide.white h2, .slide.white h3 {
  315. color: #333;
  316. }
  317. .slide.white a {
  318. color: #333;
  319. }
  320. .slide h1, .slide h2, .slide h3 {
  321. color: #333;
  322. /* text-align: center; */
  323. }
  324. .slide h1 {
  325. font-family: "Droid Sans";
  326. font-size: 36px;
  327. text-shadow: 0 1px 4px #aaa;
  328. margin-top: 30px;
  329. margin-bottom: 50px;
  330. }
  331. /* .slide ul, .slide li { */
  332. /* padding: 0; */
  333. /* margin: 0; */
  334. /* } */
  335. .slide button {
  336. font-size: 18px;
  337. }
  338. .slide a {
  339. color: #555;
  340. text-decoration: none;
  341. cursor: pointer;
  342. }
  343. .slide a:hover {
  344. color: #fff;
  345. background: #555;
  346. }
  347. .slide .right {
  348. text-align: right;
  349. }
  350. .slide .section.center {
  351. text-align: center;
  352. display: table-cell;
  353. vertical-align: middle;
  354. width: 700px;
  355. height: 500px;
  356. }
  357. .slide code {
  358. font-family: "Droid Sans Mono";
  359. color: #444;
  360. border: 1px solid #ddd;
  361. background: #eee;
  362. border-radius: 4px;
  363. padding: 2px;
  364. font-size: 16px;
  365. }
  366. .slide .code2 {
  367. font-family: "Droid Sans Mono";
  368. line-height: 1.2em;
  369. color: #444;
  370. padding: 2px;
  371. font-size: 16px;
  372. }
  373. .slide .CodeMirror {
  374. width: 500px;
  375. height: 300px;
  376. text-align: left;
  377. }
  378. .slide .CodeMirror-scroll {
  379. text-align: left;
  380. }
  381. .slide .fancy {
  382. margin-top: 30px;
  383. -webkit-transform: rotate(-10deg);
  384. -moz-transform: rotate(-10deg);
  385. transform: rotate(-10deg);
  386. color: red;
  387. }
  388. .slide .comment {
  389. opacity: 0.6;
  390. font-weight: normal;
  391. }
  392. .slide .red {
  393. color: red;
  394. }
  395. .slide .blue {
  396. color: blue;
  397. }
  398. .slide#WhatIsJtalk {
  399. background: white url("esug2011/images/balloon.jpg") 650px 50px no-repeat;
  400. }
  401. .slide#ide {
  402. background: black url("esug2011/images/ide_star_wars.png") center center no-repeat;
  403. }
  404. .slide#JtalkAndCLI {
  405. background: white url("esug2011/images/terminal.png") 620px 20px no-repeat;
  406. }
  407. .slide#JtalkAndNode {
  408. background: white url("esug2011/images/nodejs.png") 580px 40px no-repeat;
  409. }
  410. .slide#JtalkAndNode2 {
  411. background: white url("esug2011/images/nodejs.png") 580px 40px no-repeat;
  412. }
  413. .slide#JtalkAndNode3 {
  414. background: white url("esug2011/images/nodejs.png") 580px 40px no-repeat;
  415. }
  416. .slide#JtalkAndWebOS {
  417. background: white url("esug2011/images/devices.jpg") 380px 280px no-repeat;
  418. }
  419. .slide#JtalkAndEnyo {
  420. background: white url("esug2011/images/enyo.png") 130px 150px no-repeat;
  421. }
  422. .slide#links {
  423. background: white url("esug2011/images/asterix.png") 30px 130px no-repeat;
  424. }
  425. .slide#links .section {
  426. margin-left: 250px;
  427. margin-top: 200px;
  428. font-family: "Droid Sans";
  429. font-size: 26px;
  430. font-weight: bold;
  431. }
  432. #meta {
  433. position: absolute;
  434. font-size: 12px;
  435. opacity: 0.6;
  436. bottom: 0;
  437. right: 0;
  438. z-index: 2;
  439. background: #333;
  440. text-align: right;
  441. padding: 0 10px;
  442. line-height: 1.8em;
  443. color: #eee;
  444. border-top-left-radius: 5px;
  445. }
  446. #meta:hover {
  447. opacity: 0.8;
  448. }
  449. #meta p {
  450. display: inline;
  451. padding: 0 5px;
  452. }
  453. #meta a {
  454. //background: #ccc;
  455. color: #ccc;
  456. text-decoration: none;
  457. padding: 0 5px;
  458. }
  459. #tools {
  460. z-index: 1;
  461. position: fixed;
  462. top: 0;
  463. left: 50%;
  464. margin-left: -150px;
  465. width: 300px;
  466. padding: 5px;
  467. border-radius: 5px;
  468. -moz-border-radius: 5px;
  469. -webkit-border-radius: 5px;
  470. background: #333;
  471. opacity: 0.3;
  472. color: #eee;
  473. }
  474. #tools a {
  475. font-weight: bold;
  476. color: #eee;
  477. text-decoration: none;
  478. cursor: pointer;
  479. padding: 0 2px;
  480. font-size: 14px;
  481. }
  482. #tools:hover {
  483. opacity: 0.8;
  484. }
  485. .slide {
  486. }
  487. '
  488. ! !
  489. ESUG2011Presentation class instanceVariableNames: 'current'!
  490. !ESUG2011Presentation class methodsFor: 'testing'!
  491. isConcrete
  492. ^true
  493. ! !
  494. Slide subclass: #IntroSlide
  495. instanceVariableNames: ''
  496. category: 'Presentation'!
  497. !IntroSlide methodsFor: 'accessing'!
  498. id
  499. ^'intro'
  500. !
  501. cssClass
  502. ^'slide black'
  503. ! !
  504. !IntroSlide methodsFor: 'rendering'!
  505. renderSlideOn: html
  506. html div class: 'section center'; with: [
  507. html h1 with: 'Jtalk, the Smalltalk for Web developers'.
  508. html p with: self presentation author, ' & Göran Krampe - ', self presentation description.
  509. html p with: [
  510. html a
  511. with: self presentation email;
  512. href: 'mailto:', self presentation email].
  513. html p with: [
  514. html a
  515. with: 'goran@krampe.se';
  516. href: 'mailto:goran@krampe.se'].
  517. html p with: [
  518. html a
  519. with: 'objectfusion.fr';
  520. href: 'http://www.objectfusion.fr']]
  521. ! !
  522. Slide subclass: #WhatIsJtalkSlide
  523. instanceVariableNames: ''
  524. category: 'Presentation'!
  525. !WhatIsJtalkSlide methodsFor: 'accessing'!
  526. id
  527. ^'WhatIsJtalk'
  528. ! !
  529. !WhatIsJtalkSlide methodsFor: 'rendering'!
  530. renderSlideOn: html
  531. html div class: 'section center'; with: [
  532. html h1 with: 'Jtalk in a nutshell'.
  533. html h2 with: 'Jtalk is an implementation of Smalltalk'.
  534. html h2 with: 'Jtalk runs on top of the JavaScript runtime'.
  535. html h2 with: 'Jtalk is an opensource project (MIT)'.
  536. html h2 class: 'fancy'; with: 'Jtalk is cool!!']
  537. ! !
  538. Slide subclass: #JtalkFeaturesSlide
  539. instanceVariableNames: ''
  540. category: 'Presentation'!
  541. !JtalkFeaturesSlide methodsFor: 'accessing'!
  542. id
  543. ^'features'
  544. ! !
  545. !JtalkFeaturesSlide methodsFor: 'rendering'!
  546. renderSlideOn: html
  547. html h1 with: 'Jtalk features'.
  548. html ul with: [
  549. html li with: 'Jtalk is (mostly) written in itself, including the parser & compiler'.
  550. html li with: 'Full Smalltalk object system, including classes & metaclasses, etc'.
  551. html li with: 'Core libraries (streams, collections, RegExp, etc)'.
  552. html li with: 'Web related libraries: HTML Canvas, DOM manipulation'.
  553. html li with: 'Full featured IDE'.
  554. html li with: [
  555. html with:'Advanced Smalltalk features, including '.
  556. html code with: '#doesNotUnderstand:'.
  557. html with: ' support and '.
  558. html code with: 'thisContext']]
  559. ! !
  560. Slide subclass: #AboutSlide
  561. instanceVariableNames: ''
  562. category: 'Presentation'!
  563. !AboutSlide methodsFor: 'accessing'!
  564. id
  565. ^'about'
  566. !
  567. cssClass
  568. ^'slide transparent white'
  569. !
  570. backgroundColor
  571. ^'white'
  572. ! !
  573. !AboutSlide methodsFor: 'rendering'!
  574. renderSlideOn: html
  575. html div class: 'section center'; with: [
  576. html h1 with: 'About this presentation'.
  577. html p with: 'This presentation is entirely written in Jtalk and is licensed under CC BY-SA.'.
  578. html p with: [
  579. html with: 'Press '.
  580. html code with: '←'.
  581. html with: ' to move backward and '.
  582. html code with: ' →'.
  583. html with: ' to move forward.'].
  584. html p with: [
  585. html with: 'Open a '.
  586. html button
  587. with: 'browser';
  588. onClick: [Browser openOn: Presentation].
  589. html with: ' to edit the source code.']]
  590. ! !
  591. Slide subclass: #JtalkAndJavascriptSlide3
  592. instanceVariableNames: ''
  593. category: 'Presentation'!
  594. !JtalkAndJavascriptSlide3 methodsFor: 'accessing'!
  595. id
  596. ^'jtalkAndJs3'
  597. !
  598. backgroundColor
  599. ^'#08C'
  600. ! !
  601. !JtalkAndJavascriptSlide3 methodsFor: 'rendering'!
  602. renderSlideOn: html
  603. html h1 with: [
  604. html with: 'Smalltalk '.
  605. html span class: 'red'; with: '♥'.
  606. html with: ' JavaScript'].
  607. html h2 with: 'Smalltalk ⇒ JavaScript'.
  608. html ol with: [
  609. html li
  610. with: 'Unary messages begin with an underscore: ';
  611. with: [html code with: 'yourself'];
  612. with: ' becomes ';
  613. with: [html code with: '_yourself()'].
  614. html li
  615. with: 'Binary messages are prefixed with 2 underscores: ';
  616. with: [html code with: '3@4'];
  617. with: ' becomes ';
  618. with: [html code with: '(3).__at(4)'].
  619. html li
  620. with: 'Keyword message follow the same rules as unary messages, with a final underscore: ';
  621. with: [html code with: 'aDictionary at: 3 put: 4'];
  622. with: ' becomes ';
  623. with: [html code with: 'aDictionary._at_put_(3, 4)']]
  624. ! !
  625. Slide subclass: #JtalkAndJavascriptSlide2
  626. instanceVariableNames: ''
  627. category: 'Presentation'!
  628. !JtalkAndJavascriptSlide2 methodsFor: 'accessing'!
  629. id
  630. ^'jtalkAndJs2'
  631. !
  632. backgroundColor
  633. ^'#08C'
  634. ! !
  635. !JtalkAndJavascriptSlide2 methodsFor: 'rendering'!
  636. renderSlideOn: html
  637. html h1 with: [
  638. html with: 'Smalltalk '.
  639. html span class: 'red'; with: '♥'.
  640. html with: ' JavaScript'].
  641. html h2 with: 'Jtalk maps one to one with the JavaScript equivalent:'.
  642. html ul with: [
  643. html li with: 'String ⇔ String'.
  644. html li with: 'Number ⇔ Number'.
  645. html li with: 'BlockClosure ⇔ function'.
  646. html li with: 'Dictionary ⇔ Object'.
  647. html li with: 'Error ⇔ Error'.
  648. html li with: 'etc.']
  649. ! !
  650. Slide subclass: #JtalkAndJavascriptSlide
  651. instanceVariableNames: ''
  652. category: 'Presentation'!
  653. !JtalkAndJavascriptSlide methodsFor: 'accessing'!
  654. id
  655. ^'jtalkAndJs'
  656. !
  657. cssClass
  658. ^'slide transparent'
  659. !
  660. backgroundColor
  661. ^'#08C'
  662. ! !
  663. !JtalkAndJavascriptSlide methodsFor: 'rendering'!
  664. renderSlideOn: html
  665. html div class: 'section center'; with: [
  666. html h1 with: [
  667. html with: 'Smalltalk '.
  668. html span class: 'red'; with: '♥'.
  669. html with: ' JavaScript']]
  670. ! !
  671. Slide subclass: #WorkspaceSlide
  672. instanceVariableNames: ''
  673. category: 'Presentation'!
  674. !WorkspaceSlide methodsFor: 'accessing'!
  675. id
  676. ^'workspace'
  677. !
  678. backgroundColor
  679. ^'#18bd7d'
  680. !
  681. renderSlideOn: html
  682. | workspace |
  683. workspace := SourceArea new.
  684. html div class: 'section center'; with: [
  685. html h1 with: 'Give Jtalk a try!!'.
  686. workspace renderOn: html.
  687. html div with: [
  688. html button
  689. with: 'DoIt';
  690. onClick: [workspace doIt].
  691. html button
  692. with: 'PrintIt';
  693. onClick: [workspace printIt].
  694. html button
  695. with: 'InspectIt';
  696. onClick: [workspace inspectIt]]]
  697. ! !
  698. Slide subclass: #CountersSlide
  699. instanceVariableNames: ''
  700. category: 'Presentation'!
  701. !CountersSlide methodsFor: 'accessing'!
  702. id
  703. ^'counters'
  704. !
  705. backgroundColor
  706. ^'#18bd7d'
  707. ! !
  708. !CountersSlide methodsFor: 'rendering'!
  709. renderSlideOn: html
  710. html div class: 'section center'; with: [
  711. html h1 with: 'The counter example'.
  712. html div with: [
  713. 2 timesRepeat: [Counter new renderOn: html]]]
  714. ! !
  715. Slide subclass: #JtalkAndJavascriptSlide4
  716. instanceVariableNames: ''
  717. category: 'Presentation'!
  718. !JtalkAndJavascriptSlide4 methodsFor: 'accessing'!
  719. id
  720. ^'jtalkAndJs4'
  721. !
  722. backgroundColor
  723. ^'#08C'
  724. ! !
  725. !JtalkAndJavascriptSlide4 methodsFor: 'rendering'!
  726. renderSlideOn: html
  727. html h1 with: [
  728. html with: 'JavaScript '.
  729. html span class: 'red'; with: '♥'.
  730. html with: ' Smalltalk too!! ';
  731. with: [html span class: 'comment'; with: '(how cute)']].
  732. html h2 with: 'JavaScript ⇒ Smalltalk'.
  733. html ol with: [
  734. html li
  735. with: [html code with: 'someUser.name'];
  736. with: ' becomes ';
  737. with: [html code with: 'someUser name'].
  738. html li
  739. with: [html code with: 'someUser name = "John"'];
  740. with: ' becomes ';
  741. with: [html code with: 'someUser name: ''John'''].
  742. html li
  743. with: [html code with: 'console.log(''hello world'')'];
  744. with: ' becomes ';
  745. with: [html code with: 'console log: ''hello world'''].
  746. html li
  747. with: [html code with: 'window.jQuery(''foo'').css(''background'', ''red'')'];
  748. with: ' becomes ';
  749. with: [html br];
  750. with: [html code with: '(window jQuery: ''foo'') css: ''background'' color: ''red''']]
  751. ! !
  752. Slide subclass: #IDESlide
  753. instanceVariableNames: ''
  754. category: 'Presentation'!
  755. !IDESlide methodsFor: 'accessing'!
  756. id
  757. ^'ide'
  758. !
  759. backgroundColor
  760. ^'black'
  761. !
  762. cssClass
  763. ^'slide transparent'
  764. ! !
  765. !IDESlide methodsFor: 'rendering'!
  766. renderSlideOn: html
  767. " html div class: 'section center'; with: [
  768. html h1
  769. with: 'The wonderful Jtalk ';
  770. with: [
  771. html a
  772. with: 'development tools';
  773. onClick: [TabManager current open]];
  774. with: '.']
  775. "
  776. ! !
  777. Slide subclass: #ContributionsSlide
  778. instanceVariableNames: ''
  779. category: 'Presentation'!
  780. !ContributionsSlide methodsFor: 'accessing'!
  781. id
  782. ^'links'
  783. ! !
  784. !ContributionsSlide methodsFor: 'rendering'!
  785. renderSlideOn: html
  786. html div class: 'section'; with: [
  787. html p with: [
  788. html a href: 'http://jtalk-project.org'; with: 'jtalk-project.org'].
  789. html p with: [
  790. html a href: 'https://github.com/NicolasPetton/jtalk'; with: 'github.com/NicolasPetton/jtalk'].
  791. html p with: [
  792. html a href: 'http://http://groups.google.com/group/jtalk-project'; with: 'groups.google.com/group/jtalk-project']]
  793. ! !
  794. Slide subclass: #JtalkAndCLI
  795. instanceVariableNames: ''
  796. category: 'Presentation'!
  797. !JtalkAndCLI methodsFor: 'not yet classified'!
  798. backgroundColor
  799. ^'#0A1'
  800. !
  801. id
  802. ^'JtalkAndCLI'
  803. !
  804. renderSlideOn: html
  805. html h1 with: [
  806. html with: 'Jtalk and '.
  807. html span class: 'blue'; with: 'the command line'].
  808. html h2 with: 'jtalkc - a fairly elaborate bash script that:'.
  809. html ul with: [
  810. html li with: 'Uses Node.js to run the Jtalk Compiler'.
  811. html li with: 'Compiles .st files to .js'.
  812. html li with: 'Links .js files into a single one'.
  813. html li with: 'Adds class initilization and/or call to main'.
  814. html li with: 'Optionally runs Google Closure compiler']
  815. ! !
  816. Slide subclass: #JtalkAndNode
  817. instanceVariableNames: ''
  818. category: 'Presentation'!
  819. !JtalkAndNode methodsFor: 'not yet classified'!
  820. backgroundColor
  821. ^'#0A1'
  822. !
  823. id
  824. ^'JtalkAndNode'
  825. !
  826. renderSlideOn: html
  827. html h1 with: [
  828. html with: 'Jtalk and '.
  829. html span class: 'blue'; with: 'Node.js'].
  830. html h2 with: 'Hello.st:'.
  831. html pre with: [
  832. html div class: 'code2'; with: 'Object subclass: #Hello
  833. instanceVariableNames: ''''
  834. category: ''Hello''!!
  835. !!Hello class methodsFor: ''main''!!
  836. main
  837. console log: ''Hello world from JTalk in Node.js''
  838. !! !!']
  839. ! !
  840. Slide subclass: #JtalkAndNode2
  841. instanceVariableNames: ''
  842. category: 'Presentation'!
  843. !JtalkAndNode2 methodsFor: 'not yet classified'!
  844. backgroundColor
  845. ^'#0A1'
  846. !
  847. id
  848. ^'JtalkAndNode2'
  849. !
  850. renderSlideOn: html
  851. html h1 with: [
  852. html with: 'Jtalk and '.
  853. html span class: 'blue'; with: 'Node.js'].
  854. html h2 with: 'Makefile:'.
  855. html pre with: [
  856. html div class: 'code2'; with: 'Program.js: Hello.st
  857. ../../bin/jtalkc -N -m Hello Hello.st Program
  858. run: Program.js
  859. ./hello
  860. clean:
  861. rm -f Program.js Hello.js
  862. '].
  863. html h2 with: 'hello:'.
  864. html pre with: [
  865. html div class: 'code2'; with: 'node Program.js $@']
  866. ! !
  867. Slide subclass: #JtalkAndNode3
  868. instanceVariableNames: ''
  869. category: 'Presentation'!
  870. !JtalkAndNode3 methodsFor: 'not yet classified'!
  871. backgroundColor
  872. ^'#0A1'
  873. !
  874. id
  875. ^'JtalkAndNode3'
  876. !
  877. renderSlideOn: html
  878. html h1 with: [
  879. html with: 'Jtalk and '.
  880. html span class: 'blue'; with: 'Node.js'].
  881. html h2 with: 'make clean && make run:'.
  882. html pre with: [
  883. html div class: 'code2'; with: 'rm -f Program.js Hello.js
  884. ../../bin/jtalkc -N -m Hello Hello.st Program
  885. Loading libraries /home/gokr/jtalk/js/boot.js /home/gokr/jtalk/js/Kernel.js
  886. /home/gokr/jtalk/js/Parser.js /home/gokr/jtalk/js/Compiler.js
  887. /home/gokr/jtalk/js/init.js /home/gokr/jtalk/nodejs/nodecompile.js
  888. and compiling ...
  889. Compiling in debugMode: false
  890. Reading file Hello.st
  891. Exporting category Hello as Hello.js
  892. Adding libraries /home/gokr/jtalk/js/boot.js /home/gokr/jtalk/js/Kernel.js ...
  893. Adding Jtalk code Hello.js ...
  894. Adding initializer /home/gokr/jtalk/js/init.js ...
  895. Adding call to Hello class >> main ...
  896. Writing Program.js ...
  897. Done.
  898. ./hello'.
  899. html span class: 'blue'; with:'Hello world from JTalk in Node.js']
  900. ! !
  901. Slide subclass: #JtalkAndWebOS
  902. instanceVariableNames: ''
  903. category: 'Presentation'!
  904. !JtalkAndWebOS methodsFor: 'not yet classified'!
  905. backgroundColor
  906. ^'#0A1'
  907. !
  908. id
  909. ^'JtalkAndWebOS'
  910. !
  911. renderSlideOn: html
  912. html h1 with: [
  913. html with: 'Jtalk and '.
  914. html span class: 'blue'; with: 'webOS'].
  915. html h2 with: 'A really cool mobile OS based on Linux:'.
  916. html ul with: [
  917. html li with: 'The primary language in webOS is Javascript'.
  918. html li with: 'The new UI framework for webOS 3.0 is called Enyo'.
  919. html li with: 'Regular apps run in V8 + Webkit'.
  920. html li with: 'Background services run in Node.js']
  921. ! !
  922. Slide subclass: #JtalkAndEnyo
  923. instanceVariableNames: ''
  924. category: 'Presentation'!
  925. !JtalkAndEnyo methodsFor: 'not yet classified'!
  926. id
  927. ^'JtalkAndEnyo'
  928. !
  929. backgroundColor
  930. ^'#0A1'
  931. !
  932. renderSlideOn: html
  933. html h1 with: [
  934. html with: 'Jtalk and '.
  935. html span class: 'blue'; with: 'Enyo'].
  936. ! !