1
0

Presentation.st 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791
  1. Smalltalk current createPackage: 'Presentation' properties: #{}!
  2. Widget subclass: #Slide
  3. instanceVariableNames: 'presentation'
  4. category: 'Presentation'!
  5. !Slide methodsFor: 'accessing'!
  6. presentation
  7. ^presentation
  8. !
  9. presentation: aPresentation
  10. presentation := aPresentation
  11. !
  12. id
  13. ^ self class name
  14. !
  15. cssClass
  16. ^'slide'
  17. !
  18. backgroundColor
  19. ^'#555'
  20. !
  21. title
  22. ^ self id
  23. ! !
  24. !Slide methodsFor: 'actions'!
  25. show
  26. self backgroundColor ifNotNil: [
  27. (window jQuery: '#slides') css: 'background' color: self backgroundColor].
  28. (window jQuery: '.slide') hide: self presentation slideTransition options: #() duration: 300.
  29. (window jQuery: '#', self id) show: self presentation slideTransition options: #() duration: 300.
  30. ! !
  31. !Slide methodsFor: 'rendering'!
  32. renderOn: html
  33. html div class: self cssClass; id: self id; with: [
  34. self renderSlideOn: html.
  35. self renderMetaOn: html]
  36. !
  37. renderSlideOn: html
  38. !
  39. renderMetaOn: html
  40. html div
  41. id: 'meta';
  42. with: [
  43. html p class: 'title'; with: self presentation title.
  44. html p class: 'description'; with: self presentation description.
  45. html a class: 'author'; with: self presentation author; href: 'mailto:', self presentation email.
  46. html a class: 'url'; with: self presentation url; href: self presentation url]
  47. ! !
  48. !Slide class methodsFor: 'instance creation'!
  49. on: aPresentation
  50. ^self new
  51. presentation: aPresentation;
  52. yourself
  53. ! !
  54. Widget subclass: #Presentation
  55. instanceVariableNames: 'currentSlide slides'
  56. category: 'Presentation'!
  57. !Presentation methodsFor: 'accessing'!
  58. title
  59. ^ self class title.
  60. !
  61. author
  62. ^'John Smith'
  63. !
  64. url
  65. ^'http://jtalk-project.org'
  66. !
  67. description
  68. ^'A presentation written in Jtalk'
  69. !
  70. email
  71. ^'john@smith.com'
  72. !
  73. slides
  74. slides ifNil: [self initSlides].
  75. ^slides
  76. !
  77. slideClasses
  78. ^self subclassResponsibility
  79. !
  80. currentSlide
  81. ^currentSlide
  82. !
  83. currentSlide: aSlide
  84. currentSlide := aSlide
  85. !
  86. slideTransition
  87. ^'fade'
  88. !
  89. style
  90. "Should return a CSS style"
  91. ^ ''
  92. ! !
  93. !Presentation methodsFor: 'actions'!
  94. nextSlide
  95. | next |
  96. self currentSlide ifNotNil: [
  97. next := self slides
  98. at: (self currentSlideIndex) + 1
  99. ifAbsent: [nil].
  100. next ifNotNil: [currentSlide := next. next show]]
  101. !
  102. showCurrentSlide
  103. self currentSlide ifNotNil: [
  104. '.slide' asJQuery hide.
  105. ('#', self currentSlide id) asJQuery show.
  106. 'title' asJQuery text: self title, ' - ', self currentSlide id.
  107. ]
  108. !
  109. previousSlide
  110. | next |
  111. self currentSlide ifNotNil: [
  112. next := self slides
  113. at: (self currentSlideIndex) - 1
  114. ifAbsent: [nil].
  115. next ifNotNil: [currentSlide := next. next show]]
  116. !
  117. moveAt: anInteger
  118. | next |
  119. next := self slides
  120. at: anInteger
  121. ifAbsent: [nil].
  122. next ifNotNil: [currentSlide := next. next show]
  123. !
  124. currentSlideIndex
  125. ^ self slides indexOf: self currentSlide ifAbsent: [1]
  126. ! !
  127. !Presentation methodsFor: 'enumerating'!
  128. slidesDo: aBlockWithArg
  129. self slides do: [:aSlide| aBlockWithArg value: aSlide].
  130. ! !
  131. !Presentation methodsFor: 'initialization'!
  132. initSlides
  133. slides := self slideClasses collect: [:each | each on: self]
  134. ! !
  135. !Presentation methodsFor: 'rendering'!
  136. renderOn: html
  137. html style
  138. type: 'text/css';
  139. with: self style.
  140. html div
  141. id: 'slides';
  142. with: [self renderSlidesOn: html]
  143. !
  144. renderSlidesOn: html
  145. self slides do: [:each |
  146. each renderOn: html].
  147. currentSlide ifNil: [currentSlide := self slides first].
  148. self showCurrentSlide
  149. ! !
  150. Presentation class instanceVariableNames: 'current'!
  151. !Presentation class methodsFor: 'accessing'!
  152. concretePresentations
  153. ^ self allSubclasses select: [:aPresentationClass| aPresentationClass isConcrete]
  154. !
  155. title
  156. ^ 'Slides'
  157. ! !
  158. !Presentation class methodsFor: 'enumerating'!
  159. concretePresentationsDo: aBlockWithArg
  160. self concretePresentations do: aBlockWithArg.
  161. ! !
  162. !Presentation class methodsFor: 'testing'!
  163. isConcrete
  164. ^false
  165. ! !
  166. Widget subclass: #PresentationNavigator
  167. instanceVariableNames: 'presentationBrush currentPresentation slideSelect'
  168. category: 'Presentation'!
  169. !PresentationNavigator methodsFor: 'accessing'!
  170. currentPresentation: aPresentation
  171. currentPresentation := aPresentation.
  172. !
  173. currentPresentation
  174. ^ currentPresentation ifNil: [currentPresentation := Presentation concretePresentations first new].
  175. !
  176. style
  177. ^ '
  178. #navigator {
  179. z-index: 1;
  180. position: fixed;
  181. top: 0;
  182. left: 50%;
  183. margin-left: -150px;
  184. padding: 5px;
  185. border-radius: 5px;
  186. -moz-border-radius: 5px;
  187. -webkit-border-radius: 5px;
  188. background: #333;
  189. opacity: 0.3;
  190. color: #eee;
  191. }
  192. #navigator a {
  193. font-weight: bold;
  194. color: #eee;
  195. text-decoration: none;
  196. cursor: pointer;
  197. padding: 0 2px;
  198. font-size: 14px;
  199. }
  200. #navigator:hover {
  201. opacity: 0.8;
  202. }
  203. '
  204. ! !
  205. !PresentationNavigator methodsFor: 'callbacks'!
  206. selectPresentation: aPresentationClass
  207. self currentPresentation: aPresentationClass new.
  208. self renderCurrentPresentation.
  209. !
  210. selectPresentationNamed: aString
  211. |presentationClass|
  212. presentationClass := (Smalltalk current at: aString).
  213. presentationClass ifNotNil: [ self selectPresentation: presentationClass ].
  214. !
  215. previousSlide
  216. self currentPresentation previousSlide.
  217. self updateHash.
  218. !
  219. nextSlide
  220. self currentPresentation nextSlide.
  221. self updateHash.
  222. !
  223. reload
  224. |slideIndex|
  225. slideIndex := self currentPresentation currentSlideIndex.
  226. self currentPresentation: self currentPresentation class new.
  227. self renderCurrentPresentation.
  228. self selectSlideAt: slideIndex.
  229. !
  230. selectSlideAt: anInteger
  231. self currentPresentation moveAt: anInteger.
  232. self updateHash.
  233. !
  234. updateHash
  235. document location hash: self currentPresentation class name, '-', self currentPresentation currentSlideIndex.
  236. ! !
  237. !PresentationNavigator methodsFor: 'hash'!
  238. checkHash
  239. | hash presentation |
  240. hash := (document location hash replace: '^#' with: '') tokenize: '-'.
  241. presentation := Presentation concretePresentations
  242. detect: [:aPresentationClass | aPresentationClass name == hash first]
  243. ifNone: [^ self].
  244. presentation == self currentPresentation class ifFalse: [
  245. self selectPresentationNamed: presentation.
  246. self selectSlideAt: hash last
  247. ].
  248. !
  249. checkHashChange
  250. (window jQuery: window) bind: 'hashchange' do: [self checkHash]
  251. ! !
  252. !PresentationNavigator methodsFor: 'keybindings'!
  253. setKeybindings
  254. (window jQuery: document) keyup: [:e || node |
  255. node := e target nodeName asLowercase.
  256. (node = 'textarea' or: [node = 'input']) ifFalse: [
  257. e keyCode = 39 ifTrue: [self nextSlide].
  258. e keyCode = 37 ifTrue: [self previousSlide]]]
  259. ! !
  260. !PresentationNavigator methodsFor: 'rendering'!
  261. renderToolsOn: html
  262. html a
  263. with: 'IDE';
  264. onClick: [TabManager current open].
  265. html a
  266. with: 'Reload';
  267. onClick: [self reload].
  268. html a
  269. with: '←';
  270. onClick: [self previousSlide].
  271. html a
  272. with: '→';
  273. onClick: [self nextSlide].
  274. !
  275. renderPresentationSelectOn: html
  276. |presentationSelect|
  277. presentationSelect := html select.
  278. presentationSelect
  279. onChange: [self selectPresentationNamed: presentationSelect asJQuery val];
  280. with: [ Presentation concretePresentationsDo: [:aPresentationClass |
  281. html option
  282. value: aPresentationClass name;
  283. with: aPresentationClass title ] ].
  284. !
  285. open
  286. (window jQuery: document) ready: [
  287. self
  288. appendToJQuery: 'body' asJQuery;
  289. setKeybindings;
  290. checkHashChange.
  291. ].
  292. !
  293. renderOn: html
  294. html style
  295. type: 'text/css';
  296. with: self style.
  297. html div
  298. id: 'navigator';
  299. with: [ self
  300. renderToolsOn: html;
  301. renderPresentationSelectOn: html;
  302. renderSlideSelectOn: html].
  303. presentationBrush := html div
  304. id: 'presentation';
  305. yourself.
  306. self checkHash.
  307. self renderCurrentPresentation.
  308. !
  309. renderCurrentPresentation
  310. presentationBrush contents: [:html |
  311. self currentPresentation renderOn: html.
  312. ].
  313. self updateSlideSelect.
  314. !
  315. renderSlideSelectOn: html
  316. slideSelect := html select.
  317. slideSelect onChange: [ self selectSlideAt: slideSelect asJQuery val ].
  318. self updateSlideSelect.
  319. !
  320. updateSlideSelect
  321. slideSelect contents: [:html| |index|
  322. index := 0.
  323. self currentPresentation slidesDo: [ :aSlide|
  324. index := index + 1.
  325. html option
  326. value: index;
  327. with: aSlide title ] ].
  328. ! !
  329. !PresentationNavigator class methodsFor: 'initialize'!
  330. initialize
  331. ^ self open
  332. !
  333. open
  334. ^ self new open
  335. ! !
  336. Presentation subclass: #ESUG2011Presentation
  337. instanceVariableNames: ''
  338. category: 'Presentation'!
  339. !ESUG2011Presentation methodsFor: 'accessing'!
  340. description
  341. ^'ESUG 2011, Edinburgh'
  342. !
  343. author
  344. ^'Nicolas Petton'
  345. !
  346. email
  347. ^'nico@objectfusion.fr'
  348. !
  349. url
  350. ^'http://jtalk-project.org'
  351. !
  352. slideClasses
  353. ^Array new
  354. add: IntroSlide;
  355. add: AboutSlide;
  356. add: WhatIsJtalkSlide;
  357. add: JtalkFeaturesSlide;
  358. add: WorkspaceSlide;
  359. add: IDESlide;
  360. add: CountersSlide;
  361. add: JtalkAndJavascriptSlide;
  362. add: JtalkAndJavascriptSlide2;
  363. add: JtalkAndJavascriptSlide3;
  364. add: JtalkAndJavascriptSlide4;
  365. add: JtalkAndCLI;
  366. add: JtalkAndNode;
  367. add: JtalkAndNode2;
  368. add: JtalkAndNode3;
  369. add: JtalkAndWebOS;
  370. add: JtalkAndEnyo;
  371. add: ContributionsSlide;
  372. yourself
  373. !
  374. style
  375. ^'
  376. body {
  377. font-family: Helvetica,Arial,sans;
  378. }
  379. #slides {
  380. width: 100%;
  381. height: 100%;
  382. overflow: hidden;
  383. position: absolute;
  384. top: 0;
  385. bottom: 0;
  386. left: 0;
  387. right: 0;
  388. background: #555;
  389. }
  390. .slide {
  391. background: #fff;
  392. color: #444;
  393. text-align: left;
  394. font-size: 20px;
  395. line-height: 1.8em;
  396. height: 500px;
  397. width: 700px;
  398. padding: 60px;
  399. position: absolute;
  400. left: 50%;
  401. top: 50%;
  402. margin-left: -420px;
  403. margin-top: -320px;
  404. box-shadow: 0 0 20px #111;
  405. -moz-box-shadow: 0 0 20px #111;
  406. -webkit-box-shadow: 0 0 20px #111;
  407. }
  408. .slide.transparent {
  409. background: transparent;
  410. box-shadow: 0 0 0 none;
  411. -moz-box-shadow: 0 0 0 transparent;
  412. -webkit-box-shadow: 0 0 0 transparent;
  413. color: #fff !!important;
  414. }
  415. .slide.black {
  416. background: black;
  417. background-image: -webkit-gradient(
  418. linear,
  419. left bottom,
  420. left top,
  421. color-stop(0.38, rgb(79,79,79)),
  422. color-stop(0.69, rgb(33,33,33)),
  423. color-stop(0.86, rgb(4,4,4))
  424. );
  425. background-image: -moz-linear-gradient(
  426. center bottom,
  427. rgb(79,79,79) 38%,
  428. rgb(33,33,33) 69%,
  429. rgb(4,4,4) 86%
  430. );
  431. color: #fff !!important;
  432. }
  433. .slide.black h1, .slide.black h2, .slide.black h3,
  434. .slide.transparent h1, .slide.transparent h2, .slide.transparent h3 {
  435. color: #fff;
  436. text-shadow: 0 1px 4px #aaa;
  437. }
  438. .slide.black a, .slide.transparent a {
  439. color: #ccc;
  440. }
  441. .slide.white {
  442. color: #333 !!important;
  443. }
  444. .slide.white h1, .slide.white h2, .slide.white h3 {
  445. color: #333;
  446. }
  447. .slide.white a {
  448. color: #333;
  449. }
  450. .slide h1, .slide h2, .slide h3 {
  451. color: #333;
  452. /* text-align: center; */
  453. }
  454. .slide h1 {
  455. font-family: "Droid Sans";
  456. font-size: 36px;
  457. text-shadow: 0 1px 4px #aaa;
  458. margin-top: 30px;
  459. margin-bottom: 50px;
  460. }
  461. /* .slide ul, .slide li { */
  462. /* padding: 0; */
  463. /* margin: 0; */
  464. /* } */
  465. .slide button {
  466. font-size: 18px;
  467. }
  468. .slide a {
  469. color: #555;
  470. text-decoration: none;
  471. cursor: pointer;
  472. }
  473. .slide a:hover {
  474. color: #fff;
  475. background: #555;
  476. }
  477. .slide .right {
  478. text-align: right;
  479. }
  480. .slide .section.center {
  481. text-align: center;
  482. display: table-cell;
  483. vertical-align: middle;
  484. width: 700px;
  485. height: 500px;
  486. }
  487. .slide code {
  488. font-family: "Droid Sans Mono";
  489. color: #444;
  490. border: 1px solid #ddd;
  491. background: #eee;
  492. border-radius: 4px;
  493. padding: 2px;
  494. font-size: 16px;
  495. }
  496. .slide .code2 {
  497. font-family: "Droid Sans Mono";
  498. line-height: 1.2em;
  499. color: #444;
  500. padding: 2px;
  501. font-size: 16px;
  502. }
  503. .slide .CodeMirror {
  504. width: 500px;
  505. height: 300px;
  506. text-align: left;
  507. }
  508. .slide .CodeMirror-scroll {
  509. text-align: left;
  510. }
  511. .slide .fancy {
  512. margin-top: 30px;
  513. -webkit-transform: rotate(-10deg);
  514. -moz-transform: rotate(-10deg);
  515. transform: rotate(-10deg);
  516. color: red;
  517. }
  518. .slide .comment {
  519. opacity: 0.6;
  520. font-weight: normal;
  521. }
  522. .slide .red {
  523. color: red;
  524. }
  525. .slide .blue {
  526. color: blue;
  527. }
  528. .slide#WhatIsJtalk {
  529. background: white url("esug2011/images/balloon.jpg") 650px 50px no-repeat;
  530. }
  531. .slide#ide {
  532. background: black url("esug2011/images/ide_star_wars.png") center center no-repeat;
  533. }
  534. .slide#JtalkAndCLI {
  535. background: white url("esug2011/images/terminal.png") 620px 20px no-repeat;
  536. }
  537. .slide#JtalkAndNode {
  538. background: white url("esug2011/images/nodejs.png") 580px 40px no-repeat;
  539. }
  540. .slide#JtalkAndNode2 {
  541. background: white url("esug2011/images/nodejs.png") 580px 40px no-repeat;
  542. }
  543. .slide#JtalkAndNode3 {
  544. background: white url("esug2011/images/nodejs.png") 580px 40px no-repeat;
  545. }
  546. .slide#JtalkAndWebOS {
  547. background: white url("esug2011/images/devices.jpg") 380px 280px no-repeat;
  548. }
  549. .slide#JtalkAndEnyo {
  550. background: white url("esug2011/images/enyo.png") 130px 150px no-repeat;
  551. }
  552. .slide#links {
  553. background: white url("esug2011/images/asterix.png") 30px 130px no-repeat;
  554. }
  555. .slide#links .section {
  556. margin-left: 250px;
  557. margin-top: 200px;
  558. font-family: "Droid Sans";
  559. font-size: 26px;
  560. font-weight: bold;
  561. }
  562. #meta {
  563. position: absolute;
  564. font-size: 12px;
  565. opacity: 0.6;
  566. bottom: 0;
  567. right: 0;
  568. z-index: 2;
  569. background: #333;
  570. text-align: right;
  571. padding: 0 10px;
  572. line-height: 1.8em;
  573. color: #eee;
  574. border-top-left-radius: 5px;
  575. }
  576. #meta:hover {
  577. opacity: 0.8;
  578. }
  579. #meta p {
  580. display: inline;
  581. padding: 0 5px;
  582. }
  583. #meta a {
  584. //background: #ccc;
  585. color: #ccc;
  586. text-decoration: none;
  587. padding: 0 5px;
  588. }
  589. .slide {
  590. }
  591. '
  592. ! !
  593. ESUG2011Presentation class instanceVariableNames: 'current'!
  594. !ESUG2011Presentation class methodsFor: 'accessing'!
  595. title
  596. ^'Jtalk'
  597. ! !
  598. !ESUG2011Presentation class methodsFor: 'testing'!
  599. isConcrete
  600. ^true
  601. ! !
  602. Slide subclass: #IntroSlide
  603. instanceVariableNames: ''
  604. category: 'Presentation'!
  605. !IntroSlide methodsFor: 'accessing'!
  606. id
  607. ^'intro'
  608. !
  609. cssClass
  610. ^'slide black'
  611. ! !
  612. !IntroSlide methodsFor: 'rendering'!
  613. renderSlideOn: html
  614. html div class: 'section center'; with: [
  615. html h1 with: 'Jtalk, the Smalltalk for Web developers'.
  616. html p with: self presentation author, ' & Göran Krampe - ', self presentation description.
  617. html p with: [
  618. html a
  619. with: self presentation email;
  620. href: 'mailto:', self presentation email].
  621. html p with: [
  622. html a
  623. with: 'goran@krampe.se';
  624. href: 'mailto:goran@krampe.se'].
  625. html p with: [
  626. html a
  627. with: 'objectfusion.fr';
  628. href: 'http://www.objectfusion.fr']]
  629. ! !
  630. Slide subclass: #WhatIsJtalkSlide
  631. instanceVariableNames: ''
  632. category: 'Presentation'!
  633. !WhatIsJtalkSlide methodsFor: 'accessing'!
  634. id
  635. ^'WhatIsJtalk'
  636. ! !
  637. !WhatIsJtalkSlide methodsFor: 'rendering'!
  638. renderSlideOn: html
  639. html div class: 'section center'; with: [
  640. html h1 with: 'Jtalk in a nutshell'.
  641. html h2 with: 'Jtalk is an implementation of Smalltalk'.
  642. html h2 with: 'Jtalk runs on top of the JavaScript runtime'.
  643. html h2 with: 'Jtalk is an opensource project (MIT)'.
  644. html h2 class: 'fancy'; with: 'Jtalk is cool!!']
  645. ! !
  646. Slide subclass: #JtalkFeaturesSlide
  647. instanceVariableNames: ''
  648. category: 'Presentation'!
  649. !JtalkFeaturesSlide methodsFor: 'accessing'!
  650. id
  651. ^'features'
  652. ! !
  653. !JtalkFeaturesSlide methodsFor: 'rendering'!
  654. renderSlideOn: html
  655. html h1 with: 'Jtalk features'.
  656. html ul with: [
  657. html li with: 'Jtalk is (mostly) written in itself, including the parser & compiler'.
  658. html li with: 'Full Smalltalk object system, including classes & metaclasses, etc'.
  659. html li with: 'Core libraries (streams, collections, RegExp, etc)'.
  660. html li with: 'Web related libraries: HTML Canvas, DOM manipulation'.
  661. html li with: 'Full featured IDE'.
  662. html li with: [
  663. html with:'Advanced Smalltalk features, including '.
  664. html code with: '#doesNotUnderstand:'.
  665. html with: ' support and '.
  666. html code with: 'thisContext']]
  667. ! !
  668. Slide subclass: #AboutSlide
  669. instanceVariableNames: ''
  670. category: 'Presentation'!
  671. !AboutSlide methodsFor: 'accessing'!
  672. id
  673. ^'about'
  674. !
  675. cssClass
  676. ^'slide transparent white'
  677. !
  678. backgroundColor
  679. ^'white'
  680. ! !
  681. !AboutSlide methodsFor: 'rendering'!
  682. renderSlideOn: html
  683. html div class: 'section center'; with: [
  684. html h1 with: 'About this presentation'.
  685. html p with: 'This presentation is entirely written in Jtalk and is licensed under CC BY-SA.'.
  686. html p with: [
  687. html with: 'Press '.
  688. html code with: '←'.
  689. html with: ' to move backward and '.
  690. html code with: ' →'.
  691. html with: ' to move forward.'].
  692. html p with: [
  693. html with: 'Open a '.
  694. html button
  695. with: 'browser';
  696. onClick: [Browser openOn: Presentation].
  697. html with: ' to edit the source code.']]
  698. ! !
  699. Slide subclass: #JtalkAndJavascriptSlide3
  700. instanceVariableNames: ''
  701. category: 'Presentation'!
  702. !JtalkAndJavascriptSlide3 methodsFor: 'accessing'!
  703. id
  704. ^'jtalkAndJs3'
  705. !
  706. backgroundColor
  707. ^'#08C'
  708. ! !
  709. !JtalkAndJavascriptSlide3 methodsFor: 'rendering'!
  710. renderSlideOn: html
  711. html h1 with: [
  712. html with: 'Smalltalk '.
  713. html span class: 'red'; with: '♥'.
  714. html with: ' JavaScript'].
  715. html h2 with: 'Smalltalk ⇒ JavaScript'.
  716. html ol with: [
  717. html li
  718. with: 'Unary messages begin with an underscore: ';
  719. with: [html code with: 'yourself'];
  720. with: ' becomes ';
  721. with: [html code with: '_yourself()'].
  722. html li
  723. with: 'Binary messages are prefixed with 2 underscores: ';
  724. with: [html code with: '3@4'];
  725. with: ' becomes ';
  726. with: [html code with: '(3).__at(4)'].
  727. html li
  728. with: 'Keyword message follow the same rules as unary messages, with a final underscore: ';
  729. with: [html code with: 'aDictionary at: 3 put: 4'];
  730. with: ' becomes ';
  731. with: [html code with: 'aDictionary._at_put_(3, 4)']]
  732. ! !
  733. Slide subclass: #JtalkAndJavascriptSlide2
  734. instanceVariableNames: ''
  735. category: 'Presentation'!
  736. !JtalkAndJavascriptSlide2 methodsFor: 'accessing'!
  737. id
  738. ^'jtalkAndJs2'
  739. !
  740. backgroundColor
  741. ^'#08C'
  742. ! !
  743. !JtalkAndJavascriptSlide2 methodsFor: 'rendering'!
  744. renderSlideOn: html
  745. html h1 with: [
  746. html with: 'Smalltalk '.
  747. html span class: 'red'; with: '♥'.
  748. html with: ' JavaScript'].
  749. html h2 with: 'Jtalk maps one to one with the JavaScript equivalent:'.
  750. html ul with: [
  751. html li with: 'String ⇔ String'.
  752. html li with: 'Number ⇔ Number'.
  753. html li with: 'BlockClosure ⇔ function'.
  754. html li with: 'Dictionary ⇔ Object'.
  755. html li with: 'Error ⇔ Error'.
  756. html li with: 'etc.']
  757. ! !
  758. Slide subclass: #JtalkAndJavascriptSlide
  759. instanceVariableNames: ''
  760. category: 'Presentation'!
  761. !JtalkAndJavascriptSlide methodsFor: 'accessing'!
  762. id
  763. ^'jtalkAndJs'
  764. !
  765. cssClass
  766. ^'slide transparent'
  767. !
  768. backgroundColor
  769. ^'#08C'
  770. ! !
  771. !JtalkAndJavascriptSlide methodsFor: 'rendering'!
  772. renderSlideOn: html
  773. html div class: 'section center'; with: [
  774. html h1 with: [
  775. html with: 'Smalltalk '.
  776. html span class: 'red'; with: '♥'.
  777. html with: ' JavaScript']]
  778. ! !
  779. Slide subclass: #WorkspaceSlide
  780. instanceVariableNames: ''
  781. category: 'Presentation'!
  782. !WorkspaceSlide methodsFor: 'accessing'!
  783. id
  784. ^'workspace'
  785. !
  786. backgroundColor
  787. ^'#18bd7d'
  788. !
  789. renderSlideOn: html
  790. | workspace |
  791. workspace := SourceArea new.
  792. html div class: 'section center'; with: [
  793. html h1 with: 'Give Jtalk a try!!'.
  794. workspace renderOn: html.
  795. html div with: [
  796. html button
  797. with: 'DoIt';
  798. onClick: [workspace doIt].
  799. html button
  800. with: 'PrintIt';
  801. onClick: [workspace printIt].
  802. html button
  803. with: 'InspectIt';
  804. onClick: [workspace inspectIt]]]
  805. ! !
  806. Slide subclass: #CountersSlide
  807. instanceVariableNames: ''
  808. category: 'Presentation'!
  809. !CountersSlide methodsFor: 'accessing'!
  810. id
  811. ^'counters'
  812. !
  813. backgroundColor
  814. ^'#18bd7d'
  815. ! !
  816. !CountersSlide methodsFor: 'rendering'!
  817. renderSlideOn: html
  818. html div class: 'section center'; with: [
  819. html h1 with: 'The counter example'.
  820. html div with: [
  821. 2 timesRepeat: [Counter new renderOn: html]]]
  822. ! !
  823. Slide subclass: #JtalkAndJavascriptSlide4
  824. instanceVariableNames: ''
  825. category: 'Presentation'!
  826. !JtalkAndJavascriptSlide4 methodsFor: 'accessing'!
  827. id
  828. ^'jtalkAndJs4'
  829. !
  830. backgroundColor
  831. ^'#08C'
  832. ! !
  833. !JtalkAndJavascriptSlide4 methodsFor: 'rendering'!
  834. renderSlideOn: html
  835. html h1 with: [
  836. html with: 'JavaScript '.
  837. html span class: 'red'; with: '♥'.
  838. html with: ' Smalltalk too!! ';
  839. with: [html span class: 'comment'; with: '(how cute)']].
  840. html h2 with: 'JavaScript ⇒ Smalltalk'.
  841. html ol with: [
  842. html li
  843. with: [html code with: 'someUser.name'];
  844. with: ' becomes ';
  845. with: [html code with: 'someUser name'].
  846. html li
  847. with: [html code with: 'someUser name = "John"'];
  848. with: ' becomes ';
  849. with: [html code with: 'someUser name: ''John'''].
  850. html li
  851. with: [html code with: 'console.log(''hello world'')'];
  852. with: ' becomes ';
  853. with: [html code with: 'console log: ''hello world'''].
  854. html li
  855. with: [html code with: 'window.jQuery(''foo'').css(''background'', ''red'')'];
  856. with: ' becomes ';
  857. with: [html br];
  858. with: [html code with: '(window jQuery: ''foo'') css: ''background'' color: ''red''']]
  859. ! !
  860. Slide subclass: #IDESlide
  861. instanceVariableNames: ''
  862. category: 'Presentation'!
  863. !IDESlide methodsFor: 'accessing'!
  864. id
  865. ^'ide'
  866. !
  867. backgroundColor
  868. ^'black'
  869. !
  870. cssClass
  871. ^'slide transparent'
  872. ! !
  873. !IDESlide methodsFor: 'rendering'!
  874. renderSlideOn: html
  875. " html div class: 'section center'; with: [
  876. html h1
  877. with: 'The wonderful Jtalk ';
  878. with: [
  879. html a
  880. with: 'development tools';
  881. onClick: [TabManager current open]];
  882. with: '.']
  883. "
  884. ! !
  885. Slide subclass: #ContributionsSlide
  886. instanceVariableNames: ''
  887. category: 'Presentation'!
  888. !ContributionsSlide methodsFor: 'accessing'!
  889. id
  890. ^'links'
  891. ! !
  892. !ContributionsSlide methodsFor: 'rendering'!
  893. renderSlideOn: html
  894. html div class: 'section'; with: [
  895. html p with: [
  896. html a href: 'http://jtalk-project.org'; with: 'jtalk-project.org'].
  897. html p with: [
  898. html a href: 'https://github.com/NicolasPetton/jtalk'; with: 'github.com/NicolasPetton/jtalk'].
  899. html p with: [
  900. html a href: 'http://http://groups.google.com/group/jtalk-project'; with: 'groups.google.com/group/jtalk-project']]
  901. ! !
  902. Slide subclass: #JtalkAndCLI
  903. instanceVariableNames: ''
  904. category: 'Presentation'!
  905. !JtalkAndCLI methodsFor: 'not yet classified'!
  906. backgroundColor
  907. ^'#0A1'
  908. !
  909. id
  910. ^'JtalkAndCLI'
  911. !
  912. renderSlideOn: html
  913. html h1 with: [
  914. html with: 'Jtalk and '.
  915. html span class: 'blue'; with: 'the command line'].
  916. html h2 with: 'jtalkc - a fairly elaborate bash script that:'.
  917. html ul with: [
  918. html li with: 'Uses Node.js to run the Jtalk Compiler'.
  919. html li with: 'Compiles .st files to .js'.
  920. html li with: 'Links .js files into a single one'.
  921. html li with: 'Adds class initilization and/or call to main'.
  922. html li with: 'Optionally runs Google Closure compiler']
  923. ! !
  924. Slide subclass: #JtalkAndNode
  925. instanceVariableNames: ''
  926. category: 'Presentation'!
  927. !JtalkAndNode methodsFor: 'not yet classified'!
  928. backgroundColor
  929. ^'#0A1'
  930. !
  931. id
  932. ^'JtalkAndNode'
  933. !
  934. renderSlideOn: html
  935. html h1 with: [
  936. html with: 'Jtalk and '.
  937. html span class: 'blue'; with: 'Node.js'].
  938. html h2 with: 'Hello.st:'.
  939. html pre with: [
  940. html div class: 'code2'; with: 'Object subclass: #Hello
  941. instanceVariableNames: ''''
  942. category: ''Hello''!!
  943. !!Hello class methodsFor: ''main''!!
  944. main
  945. console log: ''Hello world from JTalk in Node.js''
  946. !! !!']
  947. ! !
  948. Slide subclass: #JtalkAndNode2
  949. instanceVariableNames: ''
  950. category: 'Presentation'!
  951. !JtalkAndNode2 methodsFor: 'not yet classified'!
  952. backgroundColor
  953. ^'#0A1'
  954. !
  955. id
  956. ^'JtalkAndNode2'
  957. !
  958. renderSlideOn: html
  959. html h1 with: [
  960. html with: 'Jtalk and '.
  961. html span class: 'blue'; with: 'Node.js'].
  962. html h2 with: 'Makefile:'.
  963. html pre with: [
  964. html div class: 'code2'; with: 'Program.js: Hello.st
  965. ../../bin/jtalkc -N -m Hello Hello.st Program
  966. run: Program.js
  967. ./hello
  968. clean:
  969. rm -f Program.js Hello.js
  970. '].
  971. html h2 with: 'hello:'.
  972. html pre with: [
  973. html div class: 'code2'; with: 'node Program.js $@']
  974. ! !
  975. Slide subclass: #JtalkAndNode3
  976. instanceVariableNames: ''
  977. category: 'Presentation'!
  978. !JtalkAndNode3 methodsFor: 'not yet classified'!
  979. backgroundColor
  980. ^'#0A1'
  981. !
  982. id
  983. ^'JtalkAndNode3'
  984. !
  985. renderSlideOn: html
  986. html h1 with: [
  987. html with: 'Jtalk and '.
  988. html span class: 'blue'; with: 'Node.js'].
  989. html h2 with: 'make clean && make run:'.
  990. html pre with: [
  991. html div class: 'code2'; with: 'rm -f Program.js Hello.js
  992. ../../bin/jtalkc -N -m Hello Hello.st Program
  993. Loading libraries /home/gokr/jtalk/js/boot.js /home/gokr/jtalk/js/Kernel.js
  994. /home/gokr/jtalk/js/Parser.js /home/gokr/jtalk/js/Compiler.js
  995. /home/gokr/jtalk/js/init.js /home/gokr/jtalk/nodejs/nodecompile.js
  996. and compiling ...
  997. Compiling in debugMode: false
  998. Reading file Hello.st
  999. Exporting category Hello as Hello.js
  1000. Adding libraries /home/gokr/jtalk/js/boot.js /home/gokr/jtalk/js/Kernel.js ...
  1001. Adding Jtalk code Hello.js ...
  1002. Adding initializer /home/gokr/jtalk/js/init.js ...
  1003. Adding call to Hello class >> main ...
  1004. Writing Program.js ...
  1005. Done.
  1006. ./hello'.
  1007. html span class: 'blue'; with:'Hello world from JTalk in Node.js']
  1008. ! !
  1009. Slide subclass: #JtalkAndWebOS
  1010. instanceVariableNames: ''
  1011. category: 'Presentation'!
  1012. !JtalkAndWebOS methodsFor: 'not yet classified'!
  1013. backgroundColor
  1014. ^'#0A1'
  1015. !
  1016. id
  1017. ^'JtalkAndWebOS'
  1018. !
  1019. renderSlideOn: html
  1020. html h1 with: [
  1021. html with: 'Jtalk and '.
  1022. html span class: 'blue'; with: 'webOS'].
  1023. html h2 with: 'A really cool mobile OS based on Linux:'.
  1024. html ul with: [
  1025. html li with: 'The primary language in webOS is Javascript'.
  1026. html li with: 'The new UI framework for webOS 3.0 is called Enyo'.
  1027. html li with: 'Regular apps run in V8 + Webkit'.
  1028. html li with: 'Background services run in Node.js']
  1029. ! !
  1030. Slide subclass: #JtalkAndEnyo
  1031. instanceVariableNames: ''
  1032. category: 'Presentation'!
  1033. !JtalkAndEnyo methodsFor: 'not yet classified'!
  1034. id
  1035. ^'JtalkAndEnyo'
  1036. !
  1037. backgroundColor
  1038. ^'#0A1'
  1039. !
  1040. renderSlideOn: html
  1041. html h1 with: [
  1042. html with: 'Jtalk and '.
  1043. html span class: 'blue'; with: 'Enyo'].
  1044. ! !
  1045. Presentation subclass: #FOSDEM2012Presentation
  1046. instanceVariableNames: ''
  1047. category: 'Presentation'!
  1048. !FOSDEM2012Presentation methodsFor: 'accessing'!
  1049. description
  1050. ^'FOSDEM 2012, Brussels'
  1051. !
  1052. author
  1053. ^'Laurent Laffont, Johnny Thornton'
  1054. !
  1055. email
  1056. ^'laurent.laffont@gmail.com, johnnyt@xan.do'
  1057. !
  1058. url
  1059. ^'http://amber-lang.net'
  1060. !
  1061. style
  1062. ^'
  1063. body {
  1064. font-family: Helvetica,Arial,sans;
  1065. }
  1066. #slides {
  1067. width: 100%;
  1068. height: 100%;
  1069. overflow: hidden;
  1070. position: absolute;
  1071. top: 0;
  1072. bottom: 0;
  1073. left: 0;
  1074. right: 0;
  1075. background: #555;
  1076. }
  1077. .slide {
  1078. background: #fff;
  1079. color: #444;
  1080. text-align: left;
  1081. font-size: 20px;
  1082. line-height: 1.8em;
  1083. height: 500px;
  1084. width: 700px;
  1085. padding: 60px;
  1086. position: absolute;
  1087. left: 50%;
  1088. top: 50%;
  1089. margin-left: -420px;
  1090. margin-top: -320px;
  1091. box-shadow: 0 0 20px #111;
  1092. -moz-box-shadow: 0 0 20px #111;
  1093. -webkit-box-shadow: 0 0 20px #111;
  1094. }
  1095. .slide.transparent {
  1096. background: transparent;
  1097. box-shadow: 0 0 0 none;
  1098. -moz-box-shadow: 0 0 0 transparent;
  1099. -webkit-box-shadow: 0 0 0 transparent;
  1100. color: #fff !!important;
  1101. }
  1102. .slide.black {
  1103. background: black;
  1104. background-image: -webkit-gradient(
  1105. linear,
  1106. left bottom,
  1107. left top,
  1108. color-stop(0.38, rgb(79,79,79)),
  1109. color-stop(0.69, rgb(33,33,33)),
  1110. color-stop(0.86, rgb(4,4,4))
  1111. );
  1112. background-image: -moz-linear-gradient(
  1113. center bottom,
  1114. rgb(79,79,79) 38%,
  1115. rgb(33,33,33) 69%,
  1116. rgb(4,4,4) 86%
  1117. );
  1118. color: #fff !!important;
  1119. }
  1120. .slide.black h1, .slide.black h2, .slide.black h3,
  1121. .slide.transparent h1, .slide.transparent h2, .slide.transparent h3 {
  1122. color: #fff;
  1123. text-shadow: 0 1px 4px #aaa;
  1124. }
  1125. .slide.black a, .slide.transparent a {
  1126. color: #ccc;
  1127. }
  1128. .slide.white {
  1129. color: #333 !!important;
  1130. }
  1131. .slide.white h1, .slide.white h2, .slide.white h3 {
  1132. color: #333;
  1133. }
  1134. .slide.white a {
  1135. color: #333;
  1136. }
  1137. .slide h1, .slide h2, .slide h3 {
  1138. color: #333;
  1139. /* text-align: center; */
  1140. }
  1141. .slide h1 {
  1142. font-family: "Droid Sans";
  1143. font-size: 36px;
  1144. text-shadow: 0 1px 4px #aaa;
  1145. margin-top: 30px;
  1146. margin-bottom: 50px;
  1147. }
  1148. .slide button {
  1149. font-size: 18px;
  1150. }
  1151. .slide a {
  1152. color: #555;
  1153. text-decoration: none;
  1154. cursor: pointer;
  1155. }
  1156. .slide a:hover {
  1157. color: #fff;
  1158. background: #555;
  1159. }
  1160. .slide .right {
  1161. text-align: right;
  1162. }
  1163. .slide .section.center {
  1164. text-align: center;
  1165. display: table-cell;
  1166. vertical-align: middle;
  1167. width: 700px;
  1168. height: 500px;
  1169. }
  1170. .slide code {
  1171. font-family: "Droid Sans Mono";
  1172. color: #444;
  1173. border: 1px solid #ddd;
  1174. background: #eee;
  1175. border-radius: 4px;
  1176. padding: 2px;
  1177. font-size: 16px;
  1178. }
  1179. .slide .code2 {
  1180. font-family: "Droid Sans Mono";
  1181. line-height: 1.2em;
  1182. color: #444;
  1183. padding: 2px;
  1184. font-size: 16px;
  1185. }
  1186. .slide .CodeMirror {
  1187. width: 500px;
  1188. height: 300px;
  1189. text-align: left;
  1190. }
  1191. .slide .CodeMirror-scroll {
  1192. text-align: left;
  1193. }
  1194. .slide .fancy {
  1195. margin-top: 30px;
  1196. -webkit-transform: rotate(-10deg);
  1197. -moz-transform: rotate(-10deg);
  1198. transform: rotate(-10deg);
  1199. color: red;
  1200. }
  1201. .slide .comment {
  1202. opacity: 0.6;
  1203. font-weight: normal;
  1204. }
  1205. .slide .red {
  1206. color: red;
  1207. }
  1208. .slide .blue {
  1209. color: blue;
  1210. }
  1211. #meta {
  1212. position: absolute;
  1213. font-size: 12px;
  1214. opacity: 0.6;
  1215. bottom: 0;
  1216. right: 0;
  1217. z-index: 2;
  1218. background: #333;
  1219. text-align: right;
  1220. padding: 0 10px;
  1221. line-height: 1.8em;
  1222. color: #eee;
  1223. border-top-left-radius: 5px;
  1224. }
  1225. #meta:hover {
  1226. opacity: 0.8;
  1227. }
  1228. #meta p {
  1229. display: inline;
  1230. padding: 0 5px;
  1231. }
  1232. #meta a {
  1233. //background: #ccc;
  1234. color: #ccc;
  1235. text-decoration: none;
  1236. padding: 0 5px;
  1237. }
  1238. .slide {
  1239. }
  1240. .slide.blue3d {
  1241. background: #feffff;
  1242. background: -moz-linear-gradient(top, #feffff 0%, #d2ebf9 100%);
  1243. background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#feffff), color-stop(100%,#d2ebf9));
  1244. background: -webkit-linear-gradient(top, #feffff 0%,#d2ebf9 100%);
  1245. background: -o-linear-gradient(top, #feffff 0%,#d2ebf9 100%);
  1246. background: -ms-linear-gradient(top, #feffff 0%,#d2ebf9 100%);
  1247. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#feffff", endColorstr="#d2ebf9",GradientType=0 );
  1248. background: linear-gradient(top, #feffff 0%,#d2ebf9 100%);
  1249. }
  1250. .slide.red3d {
  1251. background: #febbbb;
  1252. background: -moz-linear-gradient(top, #febbbb 0%, #fe9090 71%, #ff5c5c 95%);
  1253. background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#febbbb), color-stop(71%,#fe9090), color-stop(95%,#ff5c5c));
  1254. background: -webkit-linear-gradient(top, #febbbb 0%,#fe9090 71%,#ff5c5c 95%);
  1255. background: -o-linear-gradient(top, #febbbb 0%,#fe9090 71%,#ff5c5c 95%);
  1256. background: -ms-linear-gradient(top, #febbbb 0%,#fe9090 71%,#ff5c5c 95%);
  1257. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#febbbb", endColorstr="#ff5c5c",GradientType=0 );
  1258. background: linear-gradient(top, #febbbb 0%,#fe9090 71%,#ff5c5c 95%);
  1259. }
  1260. .slide.green3d {
  1261. background: #cdeb8e;
  1262. background: -moz-linear-gradient(top, #cdeb8e 0%, #a5c956 100%);
  1263. background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cdeb8e), color-stop(100%,#a5c956));
  1264. background: -webkit-linear-gradient(top, #cdeb8e 0%,#a5c956 100%);
  1265. background: -o-linear-gradient(top, #cdeb8e 0%,#a5c956 100%);
  1266. background: -ms-linear-gradient(top, #cdeb8e 0%,#a5c956 100%);
  1267. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#cdeb8e", endColorstr="#a5c956",GradientType=0 );
  1268. background: linear-gradient(top, #cdeb8e 0%,#a5c956 100%);
  1269. }
  1270. @-webkit-keyframes rotate-horizontal {
  1271. 0% { -webkit-transform: perspective(1000px) rotateY(-10deg);}
  1272. 100% { -webkit-transform: perspective(1000px) rotateY(10deg);}
  1273. }
  1274. .animate p{
  1275. -webkit-animation: rotate-horizontal 2s infinite alternate ease-in-out;
  1276. }
  1277. #FOSDEMAmberBackend img {
  1278. margin: 5px;
  1279. -webkit-animation: rotate-horizontal 2s infinite alternate ease-in-out;
  1280. }
  1281. '
  1282. !
  1283. slideClasses
  1284. ^ {
  1285. FOSDEMIntroSlide.
  1286. CountersSlide.
  1287. JtalkAndJavascriptSlide.
  1288. FOSDEMJSPlayGroundSlide.
  1289. FOSDEMBookletSlide.
  1290. FOSDEMCanvasSlide.
  1291. FOSDEMAmberBackend
  1292. }
  1293. ! !
  1294. !FOSDEM2012Presentation class methodsFor: 'testing'!
  1295. isConcrete
  1296. ^true
  1297. !
  1298. title
  1299. ^'Amber'
  1300. ! !
  1301. Slide subclass: #FOSDEMIntroSlide
  1302. instanceVariableNames: ''
  1303. category: 'Presentation'!
  1304. !FOSDEMIntroSlide methodsFor: 'not yet classified'!
  1305. renderSlideOn: html
  1306. html div class: 'section center animate'; with: [
  1307. html img src: 'fosdem2012/images/amber.png'.
  1308. html p: self presentation author.
  1309. html p: self presentation description.
  1310. html p: [
  1311. html with: self presentation email]].
  1312. ! !
  1313. Slide subclass: #FOSDEMBookletSlide
  1314. instanceVariableNames: ''
  1315. category: 'Presentation'!
  1316. !FOSDEMBookletSlide methodsFor: 'accessing'!
  1317. cssClass
  1318. ^ 'slide blue3d'
  1319. ! !
  1320. !FOSDEMBookletSlide methodsFor: 'css'!
  1321. style
  1322. ^ '
  1323. #book { font-size: 1.4em; }
  1324. #book .b-load .b-wrap { background-color: #DEC3A9;}
  1325. #book .b-load .b-wrap-left { background-color: #DDD;} }
  1326. '
  1327. ! !
  1328. !FOSDEMBookletSlide methodsFor: 'rendering'!
  1329. renderSlideOn: html
  1330. self renderBookOn: html.
  1331. html link
  1332. rel:'stylesheet';
  1333. href: 'fosdem2012/lib/booklet/jquery.booklet.1.2.0.css'.
  1334. html style: self style.
  1335. jQuery
  1336. getScript: 'fosdem2012/lib/booklet/jquery.booklet.1.2.0.min.js'
  1337. do: ['#book' asJQuery booklet: self bookletOptions].
  1338. !
  1339. renderBookOn: html
  1340. html div
  1341. id: 'book';
  1342. with: [ html div
  1343. class: 'b-load';
  1344. with: [ html
  1345. div: 'Amber makes it easy to plug existing javascript libraires';
  1346. div: 'Here is an example with the jQuery Booklet plugin';
  1347. div: 'Want to see how ?';
  1348. div: [ html button
  1349. onClick: [Browser openOn: FOSDEMBookletSlide ];
  1350. with: 'Just browse the code :)'. ]
  1351. ]
  1352. ].
  1353. !
  1354. bookletOptions
  1355. ^ #{
  1356. 'arrows' -> true.
  1357. 'keyboard' -> false.
  1358. 'pageNumbers' -> false.
  1359. 'closed' -> true
  1360. }
  1361. ! !
  1362. Slide subclass: #FOSDEMAmberBackend
  1363. instanceVariableNames: ''
  1364. category: 'Presentation'!
  1365. !FOSDEMAmberBackend methodsFor: 'accessing'!
  1366. cssClass
  1367. ^ 'slide green3d'
  1368. ! !
  1369. !FOSDEMAmberBackend methodsFor: 'rendering'!
  1370. renderSlideOn: html
  1371. html div
  1372. class: 'section center';
  1373. with: [ html h1: 'Need a backend ?'.
  1374. {'nodejs.png'. 'php.gif'. 'rails.png'. 'pharo.png'. 'ambrhino.jpg'} do: [:aString |
  1375. html img: 'fosdem2012/images/', aString.
  1376. ]
  1377. ]
  1378. ! !
  1379. Slide subclass: #FOSDEMJSPlayGroundSlide
  1380. instanceVariableNames: ''
  1381. category: 'Presentation'!
  1382. !FOSDEMJSPlayGroundSlide methodsFor: 'accessing'!
  1383. codeSnippet
  1384. ^'|logo|
  1385. logo:=''img#amberlogo'' asJQuery.
  1386. logo
  1387. css: ''-webkit-transition''
  1388. apply: ''all 10s ease-in-out''.
  1389. <logo.css(
  1390. ''-webkit-transform'',
  1391. ''rotateZ(360deg)'');>.
  1392. logo click: [
  1393. window alert: ''This is cool !!''].
  1394. logo inspect'.
  1395. ! !
  1396. !FOSDEMJSPlayGroundSlide methodsFor: 'rendering'!
  1397. renderSlideOn: html
  1398. html div
  1399. class: 'section center';
  1400. with: [
  1401. self renderSnippet: self codeSnippet on: html.
  1402. html img
  1403. id: 'amberlogo';
  1404. src: 'fosdem2012/images/amber.png' ]
  1405. !
  1406. renderSnippet: aString on: html
  1407. (SourceArea new
  1408. renderOn: html;
  1409. editor) setValue: aString.
  1410. ! !
  1411. Slide subclass: #FOSDEMCanvasSlide
  1412. instanceVariableNames: 'c2d canvas'
  1413. category: 'Presentation'!
  1414. !FOSDEMCanvasSlide methodsFor: 'accessing'!
  1415. cssClass
  1416. ^ 'slide red3d'
  1417. ! !
  1418. !FOSDEMCanvasSlide methodsFor: 'drawing'!
  1419. drawOnCanvas
  1420. |c2d|
  1421. c2d := canvas element getContext: '2d'.
  1422. c2d
  1423. clearRect: 0
  1424. y: 0
  1425. width: canvas element width
  1426. height: canvas element height.
  1427. 40 atRandom timesRepeat: [ |rgba|
  1428. rgba := ',' join: {255 atRandom. 255 atRandom. 255 atRandom. 10 atRandom / 10}.
  1429. c2d at: 'fillStyle' put: 'rgba(', rgba, ')'.
  1430. c2d
  1431. fillRect: 600 atRandom
  1432. y: 300 atRandom
  1433. width: 200 atRandom
  1434. height: 200 atRandom ]
  1435. ! !
  1436. !FOSDEMCanvasSlide methodsFor: 'rendering'!
  1437. renderSlideOn: html
  1438. html h1: 'Playing with canvas'.
  1439. canvas := html canvas
  1440. width: 700;
  1441. height: 400.
  1442. self updateCanvas.
  1443. ! !
  1444. !FOSDEMCanvasSlide methodsFor: 'updating'!
  1445. updateCanvas
  1446. self drawOnCanvas.
  1447. window setTimeout: [self updateCanvas] delay: 500.
  1448. ! !