2
0

Presentation.st 38 KB

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