index.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Jtalk Smalltalk</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <link rel="stylesheet" type="text/css" href='css/style.css' />
  7. <script type='text/javascript' src='js/jquery-1.4.4.min.js'></script>
  8. <script type='text/javascript' src='js/jquery-ui-1.8.9.custom.min.js'></script>
  9. <script type='text/javascript' src='js/jquery.textarea.js'></script>
  10. <script type='text/javascript' src='js/jtalk.js'></script>
  11. <link rel="stylesheet" type="text/css" href="css/jtalk.css"/>
  12. <script type="text/javascript">
  13. var _gaq = _gaq || [];
  14. _gaq.push(['_setAccount', 'UA-2246313-6']);
  15. _gaq.push(['_trackPageview']);
  16. (function() {
  17. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  18. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  19. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  20. })();
  21. </script>
  22. </head>
  23. <body>
  24. <script type="text/javascript">
  25. jQuery(window).scroll(function() {
  26. if(jQuery(window).scrollTop() > 210) {
  27. jQuery('#menu')
  28. .css('position', 'fixed')
  29. .css('top', '0px')
  30. } else {
  31. jQuery('#menu')
  32. .css('position', 'absolute')
  33. .css('top', '210px')
  34. }
  35. });
  36. </script>
  37. <a href="http://github.com/NicolasPetton/jtalk"><img style="position: absolute; top: 0; lef
  38. t: 0; border: 0;" src="https://assets.github.com/img/bec6c51521dcc8148146135149fe06a9cc737577?repo=&url=http%3A%2F%2Fs3.amazonaws.com%2Fgithub%2Fribbons%2Fforkme_left_darkblue_121621.png&path=" alt="Fork me on GitHub"></a>
  39. <div id="wrapper">
  40. <div id="header">
  41. <div class="main">
  42. <img alt="Jtalk, the Smalltalk for web developers" src="images/text_header.png"/>
  43. </div>
  44. </div>
  45. <div id="menu">
  46. <ul>
  47. <li><a href="#header">Overview</a></li> ·
  48. <li><a href="#download">Download</a></li> ·
  49. <li><a href="#documentation">Documentation</a></li>
  50. </ul>
  51. </div>
  52. <div id="content">
  53. <div class="main">
  54. <div class="box first">
  55. <div class="content">
  56. <h1><img alt="Jtalk is an implementation of the Smalltalk language that runs on the JavaScript runtime." src="images/title_container1.png"/></h1>
  57. <div class="left">
  58. <p>Jtalk is an implementation of the <a href="http://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> language that runs on top of the <a href="http://en.wikipedia.org/wiki/Javascript">JavaScript</a> runtime. It is designed to make client-side development faster and easier.</p>
  59. <p>Jtalk is written in itself, including the parser and compiler. Jtalk compiles into efficient JavaScript, mapping one-to-one with the equivalent JavaScript. There is no interpretation at runtime.</p>
  60. <p>Try a <button onClick="smalltalk.Browser._open()"> Class browser</button> right now!</p>
  61. </div>
  62. <div class="right"><img src="images/screen2.png"/></div>
  63. <div class="clear"></div>
  64. </div>
  65. </div>
  66. <div class="box">
  67. <h2>Client-side usage</h2>
  68. <div class="content">
  69. <p>Load the full Jtalk Smalltalk environment with the IDE in your page:</p>
  70. <pre>&lt;script src="js/jtalk.js" type="text/javascript"&gt;&lt;/script&gt;
  71. &lt;link rel="stylesheet" type="text/css" href="css/jtalk.css"/&gt;</pre>
  72. <p>Or the deployment JavaScript file only (without the Smalltalk parser or compiler):</p>
  73. <pre>&lt;script src="js/jtalk.deploy.js" type="text/javascript"&gt;&lt;/script&gt;</pre>
  74. <p>Read the <a href="#documentation">documentation</a> to learn more about writing applications in Jtalk.</p>
  75. </div>
  76. </div>
  77. <div class="box">
  78. <h2 id="download">Download</h2>
  79. <div class="content">
  80. <p>You can get a copy of Jtalk from github or clone the <a href="http://github.com/NicolasPetton/jtalk">git repository</a>.</p>
  81. <a href="http://github.com/NicolasPetton/jtalk/zipball/master">
  82. <img border="0" width="90" src="http://github.com/images/modules/download/zip.png"></a>
  83. <a href="http://github.com/NicolasPetton/jtalk/tarball/master">
  84. <img border="0" width="90" src="http://github.com/images/modules/download/tar.png"></a>
  85. </div>
  86. </div>
  87. <div class="box last doc" id="documentation">
  88. <h2>Documentation</h2>
  89. <div class="content">
  90. <h3 id="intro">1. Introduction <a href="#intro">&para;</a></h3>
  91. <p class="warning">This documentation is a work in progress.</p>
  92. <p class="information">Jtalk is a young piece of code and evolves quickly. Some features are still incomplete and you may very well encounter bugs.</p>
  93. <p>Jtalk is an implementation of the Smalltalk-80 language. It allows developers to write client-side heavy web applications in Smalltalk. Jtalk includes an integrated development environment with a class browser, workspace and transcript.</p>
  94. <p>Jtalk includes the following features:</p>
  95. <ol>
  96. <li>It is semantically and syntaxically equivalent to <a href="http://www.pharo-project.org">Pharo Smalltalk</a> (the implementation considered as the reference)</li>
  97. <li>It is written in itself and compiles into efficient JavaScript</li>
  98. <li>A canvas API similar to <a href="http://www.seaside.st">Seaside</a> to generate HTML</li>
  99. <li>A <a href="http://www.jquery.com">jQuery</a> binding</li>
  100. </ol>
  101. <h3 id="differences-other-smalltalks">2. Differences with other Smalltalk implementations <a href="#differences-other-smalltalks">&para;</a></h3>
  102. <h3 id="committing">3. Committing changes to disk with the web-based IDE <a href="#committing">&para;</a></h3>
  103. <p>The class browser is able to commit changes to disk. The <code>commit category</code> button will send a PUT request with the compiled JavaScript code of all classes in the selected class category in a file named <code>js/CATEGORY.js</code>.</p>
  104. <p>The easiest way to enable committing is probably to setup a webdav with Apache.</p>
  105. <p class="information">The following steps explain how to setup a webdav for Jtalk with Debian, but the setup on OSX and other Linux distros should be similar.</p>
  106. <h4>Installing Apache and enabling the dav module</h4>
  107. <p>Evaluate the following as root:</p>
  108. <pre>~# apt-get install apache2
  109. ~# a2enmod dav
  110. ~# a2enmod dav_fs</pre>
  111. <h4>Creating a password for the webdav</h4>
  112. <pre>htpasswd -c /etc/apache2/htpasswd-webdav USERNAME</pre>
  113. <h4>Setting up the webdav directory</h4>
  114. <p>Add the following lines to the default vhost (in /etc/apache2/sites-available/default):</p>
  115. <pre>Alias /jtalk/ "/path/to/jtalk/"
  116. &lt;Directory "/path/to/jtalk/"&gt;
  117. Options Indexes MultiViews FollowSymLinks
  118. DirectoryIndex index.html
  119. AllowOverride None
  120. Order allow,deny
  121. allow from all
  122. Dav on
  123. AuthType Basic
  124. AuthName "jtalk"
  125. AuthUserFile /etc/apache2/htpasswd-webdav
  126. &lt;LimitExcept GET OPTIONS&gt;
  127. Require valid-user
  128. &lt;/LimitExcept&gt;
  129. &lt;/Directory&gt;</pre>
  130. <p>Make sure the group www-data has required rights to modify files in the webdav directory.</p>
  131. <h4>Restarting Apache</h4>
  132. <p>To restart Apache, evaluate the following: <pre>~# /etc/init.d/apache2 restart</pre> and go to <code>http://localhost/jtalk/</code>.</p>
  133. <p>The class browser should now be able to commit changes to disk.</p>
  134. <h3 id="counter-example">4. The counter example <a href="#counter-example">&para;</a></h3>
  135. <p>The following example is the traditional Seaside-like multi-counter application. The buttons at the bottom of each counter increase or decrease the counter.</p>
  136. <div id="counters"></div>
  137. <script type="text/javascript">
  138. jQuery(document).ready(function() {'#counters'._asJQuery()._append_(smalltalk.Counter._new())._append_(smalltalk.Counter._new())});
  139. </script>
  140. <p>Open a <button onclick="smalltalk.Browser._openOn_(smalltalk.Counter);">browser</button> on the <code>Counter</code> class in the <code>Canvas</code> class category.
  141. <p>Each Jtalk widget is a subclass of <code>Widget</code>. A widget is a graphical component. The <code>#renderOn:</code> method is used to generate HTML using the HTML canvas.</p>
  142. <h3 id="html-canvas">5. The HTML canvas <a href="#html-canvas">&para;</a></h3>
  143. <h3 id="widgets">6. Widgets <a href="#widgets">&para;</a></h3>
  144. <h3 id="jquery">7. jQuery <a href="#jquery">&para;</a></h3>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. <div id="footer">
  151. <div class="main">
  152. <p>Copyright © 2011 <a href="mailto:petton.nicolas@gmail.com">Nicolas Petton</a>.</p>
  153. <p>Jtalk is an opensource project sponsored by <a href="http://www.objectfusion.fr">objectfusion</a>.</p>
  154. <p>The design of this website was kindly provided by <a href="mailto:neomie.thirion@gmail.com">Noémie Thirion</a>.</p>
  155. </div>
  156. </div>
  157. </body>
  158. </html>