Presentation.st 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817
  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. .slide#ide {
  1282. background: black url("esug2011/images/ide_star_wars.png") center center no-repeat;
  1283. }
  1284. '
  1285. !
  1286. slideClasses
  1287. ^ {
  1288. FOSDEMIntroSlide.
  1289. CountersSlide.
  1290. IDESlide.
  1291. JtalkAndJavascriptSlide.
  1292. FOSDEMJSPlayGroundSlide.
  1293. FOSDEMJSToSmalltalk.
  1294. FOSDEMBookletSlide.
  1295. FOSDEMCanvasSlide.
  1296. FOSDEMAmberBackend
  1297. }
  1298. ! !
  1299. !FOSDEM2012Presentation class methodsFor: 'testing'!
  1300. isConcrete
  1301. ^true
  1302. !
  1303. title
  1304. ^'Amber'
  1305. ! !
  1306. Slide subclass: #FOSDEMIntroSlide
  1307. instanceVariableNames: ''
  1308. category: 'Presentation'!
  1309. !FOSDEMIntroSlide methodsFor: 'not yet classified'!
  1310. renderSlideOn: html
  1311. html div class: 'section center animate'; with: [
  1312. html img src: 'fosdem2012/images/amber.png'.
  1313. html p: self presentation author.
  1314. html p: self presentation description.
  1315. html p: [
  1316. html with: self presentation email]].
  1317. ! !
  1318. Slide subclass: #FOSDEMBookletSlide
  1319. instanceVariableNames: ''
  1320. category: 'Presentation'!
  1321. !FOSDEMBookletSlide methodsFor: 'accessing'!
  1322. cssClass
  1323. ^ 'slide blue3d'
  1324. ! !
  1325. !FOSDEMBookletSlide methodsFor: 'css'!
  1326. style
  1327. ^ '
  1328. #book { font-size: 1.4em; }
  1329. #book .b-load .b-wrap-right { background-color: #DEC3A9;}
  1330. #book .b-load .b-wrap-left { background-color: #DDD;}
  1331. '
  1332. ! !
  1333. !FOSDEMBookletSlide methodsFor: 'rendering'!
  1334. renderSlideOn: html
  1335. self renderBookOn: html.
  1336. html link
  1337. rel:'stylesheet';
  1338. href: 'fosdem2012/lib/booklet/jquery.booklet.1.2.0.css'.
  1339. html style: self style.
  1340. jQuery
  1341. getScript: 'fosdem2012/lib/booklet/jquery.booklet.1.2.0.min.js'
  1342. do: ['#book' asJQuery booklet: self bookletOptions].
  1343. !
  1344. renderBookOn: html
  1345. html div
  1346. id: 'book';
  1347. with: [ html div
  1348. class: 'b-load';
  1349. with: [ html
  1350. div: 'Amber makes it easy to plug existing javascript libraires';
  1351. div: 'Here is an example with the jQuery Booklet plugin';
  1352. div: 'Want to see how ?';
  1353. div: [ html button
  1354. onClick: [Browser openOn: FOSDEMBookletSlide ];
  1355. with: 'Just browse the code :)'. ]
  1356. ]
  1357. ].
  1358. !
  1359. bookletOptions
  1360. ^ #{
  1361. 'arrows' -> true.
  1362. 'keyboard' -> false.
  1363. 'pageNumbers' -> false.
  1364. 'closed' -> true
  1365. }
  1366. ! !
  1367. Slide subclass: #FOSDEMAmberBackend
  1368. instanceVariableNames: ''
  1369. category: 'Presentation'!
  1370. !FOSDEMAmberBackend methodsFor: 'accessing'!
  1371. cssClass
  1372. ^ 'slide green3d'
  1373. ! !
  1374. !FOSDEMAmberBackend methodsFor: 'rendering'!
  1375. renderSlideOn: html
  1376. html div
  1377. class: 'section center';
  1378. with: [ html h1: 'Need a backend ?'.
  1379. {'nodejs.png'. 'php.gif'. 'rails.png'. 'pharo.png'. 'ambrhino.jpg'} do: [:aString |
  1380. html img: 'fosdem2012/images/', aString.
  1381. ]
  1382. ]
  1383. ! !
  1384. Slide subclass: #FOSDEMJSPlayGroundSlide
  1385. instanceVariableNames: ''
  1386. category: 'Presentation'!
  1387. !FOSDEMJSPlayGroundSlide methodsFor: 'accessing'!
  1388. codeSnippet
  1389. ^'|logo|
  1390. logo:=''img#amberlogo'' asJQuery.
  1391. logo
  1392. css: ''-webkit-transition''
  1393. apply: ''all 10s ease-in-out''.
  1394. <logo.css(
  1395. ''-webkit-transform'',
  1396. ''rotateY(360deg)'');>.
  1397. logo click: [
  1398. window alert: ''This is cool !!''].
  1399. logo inspect'.
  1400. ! !
  1401. !FOSDEMJSPlayGroundSlide methodsFor: 'rendering'!
  1402. renderSlideOn: html
  1403. html div
  1404. class: 'section center';
  1405. with: [
  1406. self renderSnippet: self codeSnippet on: html.
  1407. html img
  1408. id: 'amberlogo';
  1409. src: 'fosdem2012/images/amber.png' ]
  1410. !
  1411. renderSnippet: aString on: html
  1412. (SourceArea new
  1413. renderOn: html;
  1414. editor) setValue: aString.
  1415. ! !
  1416. Slide subclass: #FOSDEMCanvasSlide
  1417. instanceVariableNames: 'c2d canvas'
  1418. category: 'Presentation'!
  1419. !FOSDEMCanvasSlide methodsFor: 'accessing'!
  1420. cssClass
  1421. ^ 'slide red3d'
  1422. ! !
  1423. !FOSDEMCanvasSlide methodsFor: 'drawing'!
  1424. drawOnCanvas
  1425. |c2d|
  1426. c2d := canvas element getContext: '2d'.
  1427. c2d
  1428. clearRect: 0
  1429. y: 0
  1430. width: canvas element width
  1431. height: canvas element height.
  1432. 40 atRandom timesRepeat: [ |rgba|
  1433. rgba := ',' join: {255 atRandom. 255 atRandom. 255 atRandom. 10 atRandom / 10}.
  1434. c2d at: 'fillStyle' put: 'rgba(', rgba, ')'.
  1435. c2d
  1436. fillRect: 600 atRandom
  1437. y: 300 atRandom
  1438. width: 200 atRandom
  1439. height: 200 atRandom ]
  1440. ! !
  1441. !FOSDEMCanvasSlide methodsFor: 'rendering'!
  1442. renderSlideOn: html
  1443. html h1: 'Playing with canvas'.
  1444. canvas := html canvas
  1445. width: 700;
  1446. height: 400.
  1447. self updateCanvas.
  1448. ! !
  1449. !FOSDEMCanvasSlide methodsFor: 'updating'!
  1450. updateCanvas
  1451. self drawOnCanvas.
  1452. window setTimeout: [self updateCanvas] delay: 500.
  1453. ! !
  1454. Slide subclass: #FOSDEMJSToSmalltalk
  1455. instanceVariableNames: ''
  1456. category: 'Presentation'!
  1457. !FOSDEMJSToSmalltalk methodsFor: 'accessing'!
  1458. cssClass
  1459. ^ 'slide blue3d'
  1460. ! !
  1461. !FOSDEMJSToSmalltalk methodsFor: 'rendering'!
  1462. renderSlideOn: html
  1463. html h1: 'Call Smalltalk from Javascript'.
  1464. html pre with:
  1465. 'var counter = window.smalltalk.Counter._new();
  1466. counter._appendToJQuery_($(''#jsToSmalltalk''));'.
  1467. html div id: 'jsToSmalltalk'
  1468. ! !