Documentation.deploy.js 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219
  1. smalltalk.addPackage('Documentation', {});
  2. smalltalk.addClass('ChapterSelectionAnnouncement', smalltalk.Object, ['id'], 'Documentation');
  3. smalltalk.addMethod(
  4. "_id",
  5. smalltalk.method({
  6. selector: "id",
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { var $1;
  10. $1=self["@id"];
  11. return $1;
  12. }, function($ctx1) {$ctx1.fill(self,"id",{}, smalltalk.ChapterSelectionAnnouncement)})},
  13. messageSends: []}),
  14. smalltalk.ChapterSelectionAnnouncement);
  15. smalltalk.addMethod(
  16. "_id_",
  17. smalltalk.method({
  18. selector: "id:",
  19. fn: function (aString){
  20. var self=this;
  21. return smalltalk.withContext(function($ctx1) { self["@id"]=aString;
  22. return self}, function($ctx1) {$ctx1.fill(self,"id:",{aString:aString}, smalltalk.ChapterSelectionAnnouncement)})},
  23. messageSends: []}),
  24. smalltalk.ChapterSelectionAnnouncement);
  25. smalltalk.addClass('ClassSelectionAnnouncement', smalltalk.Object, ['theClass'], 'Documentation');
  26. smalltalk.addMethod(
  27. "_theClass",
  28. smalltalk.method({
  29. selector: "theClass",
  30. fn: function (){
  31. var self=this;
  32. return smalltalk.withContext(function($ctx1) { var $1;
  33. $1=self["@theClass"];
  34. return $1;
  35. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.ClassSelectionAnnouncement)})},
  36. messageSends: []}),
  37. smalltalk.ClassSelectionAnnouncement);
  38. smalltalk.addMethod(
  39. "_theClass_",
  40. smalltalk.method({
  41. selector: "theClass:",
  42. fn: function (aClass){
  43. var self=this;
  44. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  45. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass}, smalltalk.ClassSelectionAnnouncement)})},
  46. messageSends: []}),
  47. smalltalk.ClassSelectionAnnouncement);
  48. smalltalk.addMethod(
  49. "_on_",
  50. smalltalk.method({
  51. selector: "on:",
  52. fn: function (aClass){
  53. var self=this;
  54. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  55. $2=_st(self)._new();
  56. _st($2)._theClass_(aClass);
  57. $3=_st($2)._yourself();
  58. $1=$3;
  59. return $1;
  60. }, function($ctx1) {$ctx1.fill(self,"on:",{aClass:aClass}, smalltalk.ClassSelectionAnnouncement.klass)})},
  61. messageSends: ["theClass:", "new", "yourself"]}),
  62. smalltalk.ClassSelectionAnnouncement.klass);
  63. smalltalk.addClass('DocChapter', smalltalk.Widget, ['title', 'contents', 'parent', 'level'], 'Documentation');
  64. smalltalk.addMethod(
  65. "_announcer",
  66. smalltalk.method({
  67. selector: "announcer",
  68. fn: function (){
  69. var self=this;
  70. return smalltalk.withContext(function($ctx1) { var $1;
  71. $1=_st(_st((smalltalk.DocumentationBuilder || DocumentationBuilder))._current())._announcer();
  72. return $1;
  73. }, function($ctx1) {$ctx1.fill(self,"announcer",{}, smalltalk.DocChapter)})},
  74. messageSends: ["announcer", "current"]}),
  75. smalltalk.DocChapter);
  76. smalltalk.addMethod(
  77. "_chapters",
  78. smalltalk.method({
  79. selector: "chapters",
  80. fn: function (){
  81. var self=this;
  82. return smalltalk.withContext(function($ctx1) { return [];
  83. }, function($ctx1) {$ctx1.fill(self,"chapters",{}, smalltalk.DocChapter)})},
  84. messageSends: []}),
  85. smalltalk.DocChapter);
  86. smalltalk.addMethod(
  87. "_contents",
  88. smalltalk.method({
  89. selector: "contents",
  90. fn: function (){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) { var $2,$1;
  93. $2=self["@contents"];
  94. if(($receiver = $2) == nil || $receiver == undefined){
  95. $1="";
  96. } else {
  97. $1=$2;
  98. };
  99. return $1;
  100. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.DocChapter)})},
  101. messageSends: ["ifNil:"]}),
  102. smalltalk.DocChapter);
  103. smalltalk.addMethod(
  104. "_contents_",
  105. smalltalk.method({
  106. selector: "contents:",
  107. fn: function (aString){
  108. var self=this;
  109. return smalltalk.withContext(function($ctx1) { self["@contents"]=aString;
  110. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString}, smalltalk.DocChapter)})},
  111. messageSends: []}),
  112. smalltalk.DocChapter);
  113. smalltalk.addMethod(
  114. "_cssClass",
  115. smalltalk.method({
  116. selector: "cssClass",
  117. fn: function (){
  118. var self=this;
  119. return smalltalk.withContext(function($ctx1) { return "doc_chapter";
  120. }, function($ctx1) {$ctx1.fill(self,"cssClass",{}, smalltalk.DocChapter)})},
  121. messageSends: []}),
  122. smalltalk.DocChapter);
  123. smalltalk.addMethod(
  124. "_displayChapter_",
  125. smalltalk.method({
  126. selector: "displayChapter:",
  127. fn: function (aChapter){
  128. var self=this;
  129. return smalltalk.withContext(function($ctx1) { _st(_st(_st((smalltalk.DocumentationBuilder || DocumentationBuilder))._current())._widget())._displayChapter_(aChapter);
  130. return self}, function($ctx1) {$ctx1.fill(self,"displayChapter:",{aChapter:aChapter}, smalltalk.DocChapter)})},
  131. messageSends: ["displayChapter:", "widget", "current"]}),
  132. smalltalk.DocChapter);
  133. smalltalk.addMethod(
  134. "_htmlContents",
  135. smalltalk.method({
  136. selector: "htmlContents",
  137. fn: function (){
  138. var self=this;
  139. return smalltalk.withContext(function($ctx1) { var $1;
  140. $1=_st(_st(_st((smalltalk.Showdown || Showdown))._at_(smalltalk.symbolFor("converter")))._new())._makeHtml_(_st(self)._contents());
  141. return $1;
  142. }, function($ctx1) {$ctx1.fill(self,"htmlContents",{}, smalltalk.DocChapter)})},
  143. messageSends: ["makeHtml:", "contents", "new", "at:"]}),
  144. smalltalk.DocChapter);
  145. smalltalk.addMethod(
  146. "_id",
  147. smalltalk.method({
  148. selector: "id",
  149. fn: function (){
  150. var self=this;
  151. return smalltalk.withContext(function($ctx1) { var $1;
  152. $1=_st(_st(self)._title())._replace_with_(" ","-");
  153. return $1;
  154. }, function($ctx1) {$ctx1.fill(self,"id",{}, smalltalk.DocChapter)})},
  155. messageSends: ["replace:with:", "title"]}),
  156. smalltalk.DocChapter);
  157. smalltalk.addMethod(
  158. "_initialize",
  159. smalltalk.method({
  160. selector: "initialize",
  161. fn: function (){
  162. var self=this;
  163. return smalltalk.withContext(function($ctx1) { smalltalk.Widget.fn.prototype._initialize.apply(_st(self), []);
  164. _st(self)._subscribe();
  165. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.DocChapter)})},
  166. messageSends: ["initialize", "subscribe"]}),
  167. smalltalk.DocChapter);
  168. smalltalk.addMethod(
  169. "_level",
  170. smalltalk.method({
  171. selector: "level",
  172. fn: function (){
  173. var self=this;
  174. return smalltalk.withContext(function($ctx1) { var $2,$1;
  175. $2=_st(self)._parent();
  176. if(($receiver = $2) == nil || $receiver == undefined){
  177. $1=(1);
  178. } else {
  179. $1=_st(_st(_st(self)._parent())._level()).__plus((1));
  180. };
  181. return $1;
  182. }, function($ctx1) {$ctx1.fill(self,"level",{}, smalltalk.DocChapter)})},
  183. messageSends: ["ifNil:ifNotNil:", "+", "level", "parent"]}),
  184. smalltalk.DocChapter);
  185. smalltalk.addMethod(
  186. "_level_",
  187. smalltalk.method({
  188. selector: "level:",
  189. fn: function (anInteger){
  190. var self=this;
  191. return smalltalk.withContext(function($ctx1) { self["@level"]=anInteger;
  192. return self}, function($ctx1) {$ctx1.fill(self,"level:",{anInteger:anInteger}, smalltalk.DocChapter)})},
  193. messageSends: []}),
  194. smalltalk.DocChapter);
  195. smalltalk.addMethod(
  196. "_parent",
  197. smalltalk.method({
  198. selector: "parent",
  199. fn: function (){
  200. var self=this;
  201. return smalltalk.withContext(function($ctx1) { var $1;
  202. $1=self["@parent"];
  203. return $1;
  204. }, function($ctx1) {$ctx1.fill(self,"parent",{}, smalltalk.DocChapter)})},
  205. messageSends: []}),
  206. smalltalk.DocChapter);
  207. smalltalk.addMethod(
  208. "_parent_",
  209. smalltalk.method({
  210. selector: "parent:",
  211. fn: function (aChapter){
  212. var self=this;
  213. return smalltalk.withContext(function($ctx1) { self["@parent"]=aChapter;
  214. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{aChapter:aChapter}, smalltalk.DocChapter)})},
  215. messageSends: []}),
  216. smalltalk.DocChapter);
  217. smalltalk.addMethod(
  218. "_renderDocOn_",
  219. smalltalk.method({
  220. selector: "renderDocOn:",
  221. fn: function (html){
  222. var self=this;
  223. var div;
  224. return smalltalk.withContext(function($ctx1) { _st(_st(html)._h1())._with_(_st(self)._title());
  225. _st(self)._renderNavigationOn_(html);
  226. div=_st(_st(html)._div())._class_("contents");
  227. _st(_st(div)._asJQuery())._html_(_st(self)._htmlContents());
  228. return self}, function($ctx1) {$ctx1.fill(self,"renderDocOn:",{html:html,div:div}, smalltalk.DocChapter)})},
  229. messageSends: ["with:", "title", "h1", "renderNavigationOn:", "class:", "div", "html:", "htmlContents", "asJQuery"]}),
  230. smalltalk.DocChapter);
  231. smalltalk.addMethod(
  232. "_renderLinksOn_",
  233. smalltalk.method({
  234. selector: "renderLinksOn:",
  235. fn: function (html){
  236. var self=this;
  237. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  238. $1=_st(html)._ul();
  239. _st($1)._class_("links");
  240. $2=_st($1)._with_((function(){
  241. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._chapters())._do_((function(each){
  242. return smalltalk.withContext(function($ctx3) { return _st(_st(html)._li())._with_((function(){
  243. return smalltalk.withContext(function($ctx4) { $3=_st(html)._a();
  244. _st($3)._with_(_st(each)._title());
  245. $4=_st($3)._onClick_((function(){
  246. return smalltalk.withContext(function($ctx5) { return _st(self)._selectChapter_(each);
  247. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  248. return $4;
  249. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  250. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  251. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  252. return self}, function($ctx1) {$ctx1.fill(self,"renderLinksOn:",{html:html}, smalltalk.DocChapter)})},
  253. messageSends: ["class:", "ul", "with:", "do:", "title", "a", "onClick:", "selectChapter:", "li", "chapters"]}),
  254. smalltalk.DocChapter);
  255. smalltalk.addMethod(
  256. "_renderNavigationOn_",
  257. smalltalk.method({
  258. selector: "renderNavigationOn:",
  259. fn: function (html){
  260. var self=this;
  261. return smalltalk.withContext(function($ctx1) { var $1,$2,$4,$5,$3;
  262. $1=_st(self)._parent();
  263. if(($receiver = $1) == nil || $receiver == undefined){
  264. $1;
  265. } else {
  266. $2=_st(html)._div();
  267. _st($2)._class_("navigation");
  268. $3=_st($2)._with_((function(){
  269. return smalltalk.withContext(function($ctx2) { $4=_st(html)._a();
  270. _st($4)._with_(_st("← back to ").__comma(_st(_st(self)._parent())._title()));
  271. $5=_st($4)._onClick_((function(){
  272. return smalltalk.withContext(function($ctx3) { return _st(self)._selectChapter_(_st(self)._parent());
  273. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  274. return $5;
  275. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  276. $3;
  277. };
  278. return self}, function($ctx1) {$ctx1.fill(self,"renderNavigationOn:",{html:html}, smalltalk.DocChapter)})},
  279. messageSends: ["ifNotNil:", "class:", "div", "with:", ",", "title", "parent", "a", "onClick:", "selectChapter:"]}),
  280. smalltalk.DocChapter);
  281. smalltalk.addMethod(
  282. "_renderOn_",
  283. smalltalk.method({
  284. selector: "renderOn:",
  285. fn: function (html){
  286. var self=this;
  287. return smalltalk.withContext(function($ctx1) { var $1,$2;
  288. $1=_st(html)._div();
  289. _st($1)._class_(_st(self)._cssClass());
  290. $2=_st($1)._with_((function(){
  291. return smalltalk.withContext(function($ctx2) { _st(self)._renderDocOn_(html);
  292. return _st(self)._renderLinksOn_(html);
  293. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  294. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.DocChapter)})},
  295. messageSends: ["class:", "cssClass", "div", "with:", "renderDocOn:", "renderLinksOn:"]}),
  296. smalltalk.DocChapter);
  297. smalltalk.addMethod(
  298. "_selectChapter_",
  299. smalltalk.method({
  300. selector: "selectChapter:",
  301. fn: function (aChapter){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx1) { _st(_st(document)._location())._hash_(_st(aChapter)._id());
  304. return self}, function($ctx1) {$ctx1.fill(self,"selectChapter:",{aChapter:aChapter}, smalltalk.DocChapter)})},
  305. messageSends: ["hash:", "id", "location"]}),
  306. smalltalk.DocChapter);
  307. smalltalk.addMethod(
  308. "_selectClass_",
  309. smalltalk.method({
  310. selector: "selectClass:",
  311. fn: function (aClass){
  312. var self=this;
  313. return smalltalk.withContext(function($ctx1) { _st(_st(_st((smalltalk.DocumentationBuilder || DocumentationBuilder))._current())._announcer())._announce_(_st((smalltalk.ClassSelectionAnnouncement || ClassSelectionAnnouncement))._on_(aClass));
  314. return self}, function($ctx1) {$ctx1.fill(self,"selectClass:",{aClass:aClass}, smalltalk.DocChapter)})},
  315. messageSends: ["announce:", "on:", "announcer", "current"]}),
  316. smalltalk.DocChapter);
  317. smalltalk.addMethod(
  318. "_subscribe",
  319. smalltalk.method({
  320. selector: "subscribe",
  321. fn: function (){
  322. var self=this;
  323. return smalltalk.withContext(function($ctx1) { var $1;
  324. _st(_st(self)._announcer())._on_do_((smalltalk.ChapterSelectionAnnouncement || ChapterSelectionAnnouncement),(function(ann){
  325. return smalltalk.withContext(function($ctx2) { $1=_st(_st(ann)._id()).__eq(_st(self)._id());
  326. if(smalltalk.assert($1)){
  327. return _st(self)._displayChapter_(self);
  328. };
  329. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  330. return self}, function($ctx1) {$ctx1.fill(self,"subscribe",{}, smalltalk.DocChapter)})},
  331. messageSends: ["on:do:", "ifTrue:", "displayChapter:", "=", "id", "announcer"]}),
  332. smalltalk.DocChapter);
  333. smalltalk.addMethod(
  334. "_title",
  335. smalltalk.method({
  336. selector: "title",
  337. fn: function (){
  338. var self=this;
  339. return smalltalk.withContext(function($ctx1) { var $2,$1;
  340. $2=self["@title"];
  341. if(($receiver = $2) == nil || $receiver == undefined){
  342. $1="";
  343. } else {
  344. $1=$2;
  345. };
  346. return $1;
  347. }, function($ctx1) {$ctx1.fill(self,"title",{}, smalltalk.DocChapter)})},
  348. messageSends: ["ifNil:"]}),
  349. smalltalk.DocChapter);
  350. smalltalk.addMethod(
  351. "_title_",
  352. smalltalk.method({
  353. selector: "title:",
  354. fn: function (aString){
  355. var self=this;
  356. return smalltalk.withContext(function($ctx1) { self["@title"]=aString;
  357. return self}, function($ctx1) {$ctx1.fill(self,"title:",{aString:aString}, smalltalk.DocChapter)})},
  358. messageSends: []}),
  359. smalltalk.DocChapter);
  360. smalltalk.addClass('ClassDocChapter', smalltalk.DocChapter, ['theClass'], 'Documentation');
  361. smalltalk.addMethod(
  362. "_contents",
  363. smalltalk.method({
  364. selector: "contents",
  365. fn: function (){
  366. var self=this;
  367. return smalltalk.withContext(function($ctx1) { var $2,$1;
  368. $2=_st(_st(_st(self)._theClass())._comment())._isEmpty();
  369. if(smalltalk.assert($2)){
  370. $1=_st(_st(_st(self)._theClass())._name()).__comma(" is not documented yet.");
  371. } else {
  372. $1=_st(_st(self)._theClass())._comment();
  373. };
  374. return $1;
  375. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.ClassDocChapter)})},
  376. messageSends: ["ifTrue:ifFalse:", ",", "name", "theClass", "comment", "isEmpty"]}),
  377. smalltalk.ClassDocChapter);
  378. smalltalk.addMethod(
  379. "_cssClass",
  380. smalltalk.method({
  381. selector: "cssClass",
  382. fn: function (){
  383. var self=this;
  384. return smalltalk.withContext(function($ctx1) { var $1;
  385. $1=_st("doc_class ").__comma(smalltalk.DocChapter.fn.prototype._cssClass.apply(_st(self), []));
  386. return $1;
  387. }, function($ctx1) {$ctx1.fill(self,"cssClass",{}, smalltalk.ClassDocChapter)})},
  388. messageSends: [",", "cssClass"]}),
  389. smalltalk.ClassDocChapter);
  390. smalltalk.addMethod(
  391. "_initializeWithClass_",
  392. smalltalk.method({
  393. selector: "initializeWithClass:",
  394. fn: function (aClass){
  395. var self=this;
  396. return smalltalk.withContext(function($ctx1) { self["@theClass"]=aClass;
  397. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithClass:",{aClass:aClass}, smalltalk.ClassDocChapter)})},
  398. messageSends: []}),
  399. smalltalk.ClassDocChapter);
  400. smalltalk.addMethod(
  401. "_renderLinksOn_",
  402. smalltalk.method({
  403. selector: "renderLinksOn:",
  404. fn: function (html){
  405. var self=this;
  406. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  407. $1=_st(html)._ul();
  408. _st($1)._class_("links");
  409. $2=_st($1)._with_((function(){
  410. return smalltalk.withContext(function($ctx2) { return _st(_st(html)._li())._with_((function(){
  411. return smalltalk.withContext(function($ctx3) { $3=_st(html)._a();
  412. _st($3)._with_("Browse this class");
  413. $4=_st($3)._onClick_((function(){
  414. return smalltalk.withContext(function($ctx4) { return _st((smalltalk.Browser || Browser))._openOn_(_st(self)._theClass());
  415. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  416. return $4;
  417. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  418. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  419. return self}, function($ctx1) {$ctx1.fill(self,"renderLinksOn:",{html:html}, smalltalk.ClassDocChapter)})},
  420. messageSends: ["class:", "ul", "with:", "a", "onClick:", "openOn:", "theClass", "li"]}),
  421. smalltalk.ClassDocChapter);
  422. smalltalk.addMethod(
  423. "_subscribe",
  424. smalltalk.method({
  425. selector: "subscribe",
  426. fn: function (){
  427. var self=this;
  428. return smalltalk.withContext(function($ctx1) { var $1;
  429. smalltalk.DocChapter.fn.prototype._subscribe.apply(_st(self), []);
  430. _st(_st(self)._announcer())._on_do_((smalltalk.ClassSelectionAnnouncement || ClassSelectionAnnouncement),(function(ann){
  431. return smalltalk.withContext(function($ctx2) { $1=_st(_st(ann)._theClass()).__eq(_st(self)._theClass());
  432. if(smalltalk.assert($1)){
  433. return _st(self)._selectChapter_(self);
  434. };
  435. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  436. return self}, function($ctx1) {$ctx1.fill(self,"subscribe",{}, smalltalk.ClassDocChapter)})},
  437. messageSends: ["subscribe", "on:do:", "ifTrue:", "selectChapter:", "=", "theClass", "announcer"]}),
  438. smalltalk.ClassDocChapter);
  439. smalltalk.addMethod(
  440. "_theClass",
  441. smalltalk.method({
  442. selector: "theClass",
  443. fn: function (){
  444. var self=this;
  445. return smalltalk.withContext(function($ctx1) { var $1;
  446. $1=self["@theClass"];
  447. return $1;
  448. }, function($ctx1) {$ctx1.fill(self,"theClass",{}, smalltalk.ClassDocChapter)})},
  449. messageSends: []}),
  450. smalltalk.ClassDocChapter);
  451. smalltalk.addMethod(
  452. "_title",
  453. smalltalk.method({
  454. selector: "title",
  455. fn: function (){
  456. var self=this;
  457. return smalltalk.withContext(function($ctx1) { var $1;
  458. $1=_st(_st(self)._theClass())._name();
  459. return $1;
  460. }, function($ctx1) {$ctx1.fill(self,"title",{}, smalltalk.ClassDocChapter)})},
  461. messageSends: ["name", "theClass"]}),
  462. smalltalk.ClassDocChapter);
  463. smalltalk.addMethod(
  464. "_on_",
  465. smalltalk.method({
  466. selector: "on:",
  467. fn: function (aClass){
  468. var self=this;
  469. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  470. $2=_st(self)._basicNew();
  471. _st($2)._initializeWithClass_(aClass);
  472. _st($2)._initialize();
  473. $3=_st($2)._yourself();
  474. $1=$3;
  475. return $1;
  476. }, function($ctx1) {$ctx1.fill(self,"on:",{aClass:aClass}, smalltalk.ClassDocChapter.klass)})},
  477. messageSends: ["initializeWithClass:", "basicNew", "initialize", "yourself"]}),
  478. smalltalk.ClassDocChapter.klass);
  479. smalltalk.addClass('ClassesIndexChapter', smalltalk.DocChapter, [], 'Documentation');
  480. smalltalk.addMethod(
  481. "_alphabet",
  482. smalltalk.method({
  483. selector: "alphabet",
  484. fn: function (){
  485. var self=this;
  486. return smalltalk.withContext(function($ctx1) { return "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  487. }, function($ctx1) {$ctx1.fill(self,"alphabet",{}, smalltalk.ClassesIndexChapter)})},
  488. messageSends: []}),
  489. smalltalk.ClassesIndexChapter);
  490. smalltalk.addMethod(
  491. "_cssClass",
  492. smalltalk.method({
  493. selector: "cssClass",
  494. fn: function (){
  495. var self=this;
  496. return smalltalk.withContext(function($ctx1) { var $1;
  497. $1=_st("index_doc ").__comma(smalltalk.DocChapter.fn.prototype._cssClass.apply(_st(self), []));
  498. return $1;
  499. }, function($ctx1) {$ctx1.fill(self,"cssClass",{}, smalltalk.ClassesIndexChapter)})},
  500. messageSends: [",", "cssClass"]}),
  501. smalltalk.ClassesIndexChapter);
  502. smalltalk.addMethod(
  503. "_renderDocOn_",
  504. smalltalk.method({
  505. selector: "renderDocOn:",
  506. fn: function (html){
  507. var self=this;
  508. return smalltalk.withContext(function($ctx1) { var $1,$2;
  509. _st(_st(html)._h1())._with_(_st(self)._title());
  510. _st(_st(self)._alphabet())._do_((function(letter){
  511. var classes;
  512. return smalltalk.withContext(function($ctx2) { classes=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._select_((function(each){
  513. return smalltalk.withContext(function($ctx3) { return _st(_st(_st(each)._name())._first()).__eq(letter);
  514. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  515. classes;
  516. _st(classes)._ifNotEmpty_((function(){
  517. return smalltalk.withContext(function($ctx3) { return _st(_st(html)._h2())._with_(letter);
  518. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  519. return _st(_st(html)._ul())._with_((function(){
  520. return smalltalk.withContext(function($ctx3) { return _st(_st(classes)._sorted_((function(a,b){
  521. return smalltalk.withContext(function($ctx4) { return _st(_st(a)._name()).__lt(_st(b)._name());
  522. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  523. return smalltalk.withContext(function($ctx4) { return _st(_st(html)._li())._with_((function(){
  524. return smalltalk.withContext(function($ctx5) { $1=_st(html)._a();
  525. _st($1)._with_(_st(each)._name());
  526. $2=_st($1)._onClick_((function(){
  527. return smalltalk.withContext(function($ctx6) { return _st(self)._selectClass_(each);
  528. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  529. return $2;
  530. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  531. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  532. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  533. }, function($ctx2) {$ctx2.fillBlock({letter:letter,classes:classes},$ctx1)})}));
  534. return self}, function($ctx1) {$ctx1.fill(self,"renderDocOn:",{html:html}, smalltalk.ClassesIndexChapter)})},
  535. messageSends: ["with:", "title", "h1", "do:", "select:", "=", "first", "name", "classes", "current", "ifNotEmpty:", "h2", "a", "onClick:", "selectClass:", "li", "sorted:", "<", "ul", "alphabet"]}),
  536. smalltalk.ClassesIndexChapter);
  537. smalltalk.addMethod(
  538. "_title",
  539. smalltalk.method({
  540. selector: "title",
  541. fn: function (){
  542. var self=this;
  543. return smalltalk.withContext(function($ctx1) { return "Smalltalk classes by index";
  544. }, function($ctx1) {$ctx1.fill(self,"title",{}, smalltalk.ClassesIndexChapter)})},
  545. messageSends: []}),
  546. smalltalk.ClassesIndexChapter);
  547. smalltalk.addClass('PackageDocChapter', smalltalk.DocChapter, ['package', 'chapters'], 'Documentation');
  548. smalltalk.addMethod(
  549. "_chapters",
  550. smalltalk.method({
  551. selector: "chapters",
  552. fn: function (){
  553. var self=this;
  554. return smalltalk.withContext(function($ctx1) { var $1;
  555. $1=self["@chapters"];
  556. return $1;
  557. }, function($ctx1) {$ctx1.fill(self,"chapters",{}, smalltalk.PackageDocChapter)})},
  558. messageSends: []}),
  559. smalltalk.PackageDocChapter);
  560. smalltalk.addMethod(
  561. "_contents",
  562. smalltalk.method({
  563. selector: "contents",
  564. fn: function (){
  565. var self=this;
  566. return smalltalk.withContext(function($ctx1) { var $1;
  567. $1=_st(_st("Classes in package ").__comma(_st(_st(self)._package())._name())).__comma(":");
  568. return $1;
  569. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.PackageDocChapter)})},
  570. messageSends: [",", "name", "package"]}),
  571. smalltalk.PackageDocChapter);
  572. smalltalk.addMethod(
  573. "_initializeWithPackage_",
  574. smalltalk.method({
  575. selector: "initializeWithPackage:",
  576. fn: function (aPackage){
  577. var self=this;
  578. return smalltalk.withContext(function($ctx1) { var $1,$2;
  579. self["@package"]=aPackage;
  580. self["@chapters"]=_st(_st(_st(aPackage)._classes())._sorted_((function(a,b){
  581. return smalltalk.withContext(function($ctx2) { return _st(_st(a)._name()).__lt(_st(b)._name());
  582. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._collect_((function(each){
  583. return smalltalk.withContext(function($ctx2) { $1=_st((smalltalk.ClassDocChapter || ClassDocChapter))._on_(each);
  584. _st($1)._parent_(self);
  585. $2=_st($1)._yourself();
  586. return $2;
  587. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  588. return self}, function($ctx1) {$ctx1.fill(self,"initializeWithPackage:",{aPackage:aPackage}, smalltalk.PackageDocChapter)})},
  589. messageSends: ["collect:", "parent:", "on:", "yourself", "sorted:", "<", "name", "classes"]}),
  590. smalltalk.PackageDocChapter);
  591. smalltalk.addMethod(
  592. "_package",
  593. smalltalk.method({
  594. selector: "package",
  595. fn: function (){
  596. var self=this;
  597. return smalltalk.withContext(function($ctx1) { var $1;
  598. $1=self["@package"];
  599. return $1;
  600. }, function($ctx1) {$ctx1.fill(self,"package",{}, smalltalk.PackageDocChapter)})},
  601. messageSends: []}),
  602. smalltalk.PackageDocChapter);
  603. smalltalk.addMethod(
  604. "_title",
  605. smalltalk.method({
  606. selector: "title",
  607. fn: function (){
  608. var self=this;
  609. return smalltalk.withContext(function($ctx1) { var $1;
  610. $1=_st("Package ").__comma(_st(_st(self)._package())._name());
  611. return $1;
  612. }, function($ctx1) {$ctx1.fill(self,"title",{}, smalltalk.PackageDocChapter)})},
  613. messageSends: [",", "name", "package"]}),
  614. smalltalk.PackageDocChapter);
  615. smalltalk.addMethod(
  616. "_on_",
  617. smalltalk.method({
  618. selector: "on:",
  619. fn: function (aPackage){
  620. var self=this;
  621. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  622. $2=_st(self)._basicNew();
  623. _st($2)._initializeWithPackage_(aPackage);
  624. _st($2)._initialize();
  625. $3=_st($2)._yourself();
  626. $1=$3;
  627. return $1;
  628. }, function($ctx1) {$ctx1.fill(self,"on:",{aPackage:aPackage}, smalltalk.PackageDocChapter.klass)})},
  629. messageSends: ["initializeWithPackage:", "basicNew", "initialize", "yourself"]}),
  630. smalltalk.PackageDocChapter.klass);
  631. smalltalk.addClass('TutorialsChapter', smalltalk.DocChapter, [], 'Documentation');
  632. smalltalk.addMethod(
  633. "_contents",
  634. smalltalk.method({
  635. selector: "contents",
  636. fn: function (){
  637. var self=this;
  638. return smalltalk.withContext(function($ctx1) { return "You can find a list of [Tutorials](https://github.com/amber-smalltalk/amber/wiki/Tutorials) on the [Github wiki](https://github.com/amber-smalltalk/amber/wiki). If you are new to Smalltalk, you can also learn Amber online with [ProfStef](http://www.amber-lang.net/learn.html).";
  639. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.TutorialsChapter)})},
  640. messageSends: []}),
  641. smalltalk.TutorialsChapter);
  642. smalltalk.addMethod(
  643. "_title",
  644. smalltalk.method({
  645. selector: "title",
  646. fn: function (){
  647. var self=this;
  648. return smalltalk.withContext(function($ctx1) { return "Tutorials";
  649. }, function($ctx1) {$ctx1.fill(self,"title",{}, smalltalk.TutorialsChapter)})},
  650. messageSends: []}),
  651. smalltalk.TutorialsChapter);
  652. smalltalk.addClass('DocumentationBuilder', smalltalk.Object, ['chapters', 'announcer', 'widget'], 'Documentation');
  653. smalltalk.addMethod(
  654. "_announcer",
  655. smalltalk.method({
  656. selector: "announcer",
  657. fn: function (){
  658. var self=this;
  659. return smalltalk.withContext(function($ctx1) { var $2,$1;
  660. $2=self["@announcer"];
  661. if(($receiver = $2) == nil || $receiver == undefined){
  662. self["@announcer"]=_st((smalltalk.Announcer || Announcer))._new();
  663. $1=self["@announcer"];
  664. } else {
  665. $1=$2;
  666. };
  667. return $1;
  668. }, function($ctx1) {$ctx1.fill(self,"announcer",{}, smalltalk.DocumentationBuilder)})},
  669. messageSends: ["ifNil:", "new"]}),
  670. smalltalk.DocumentationBuilder);
  671. smalltalk.addMethod(
  672. "_build",
  673. smalltalk.method({
  674. selector: "build",
  675. fn: function (){
  676. var self=this;
  677. return smalltalk.withContext(function($ctx1) { _st(self)._buildOnJQuery_(_st("body")._asJQuery());
  678. return self}, function($ctx1) {$ctx1.fill(self,"build",{}, smalltalk.DocumentationBuilder)})},
  679. messageSends: ["buildOnJQuery:", "asJQuery"]}),
  680. smalltalk.DocumentationBuilder);
  681. smalltalk.addMethod(
  682. "_buildChapters",
  683. smalltalk.method({
  684. selector: "buildChapters",
  685. fn: function (){
  686. var self=this;
  687. return smalltalk.withContext(function($ctx1) { var $1;
  688. $1=_st(_st(_st(_st(_st(_st(self)._class())._methodDictionary())._values())._sorted_((function(a,b){
  689. return smalltalk.withContext(function($ctx2) { return _st(_st(a)._selector()).__lt(_st(b)._selector());
  690. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._select_((function(each){
  691. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._category()).__eq("chapters");
  692. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
  693. return smalltalk.withContext(function($ctx2) { return _st(self)._perform_(_st(each)._selector());
  694. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  695. return $1;
  696. }, function($ctx1) {$ctx1.fill(self,"buildChapters",{}, smalltalk.DocumentationBuilder)})},
  697. messageSends: ["collect:", "perform:", "selector", "select:", "=", "category", "sorted:", "<", "values", "methodDictionary", "class"]}),
  698. smalltalk.DocumentationBuilder);
  699. smalltalk.addMethod(
  700. "_buildOn_",
  701. smalltalk.method({
  702. selector: "buildOn:",
  703. fn: function (aCanvas){
  704. var self=this;
  705. return smalltalk.withContext(function($ctx1) { var $1,$2;
  706. _st(aCanvas)._with_(_st(self)._widget());
  707. $1=self;
  708. _st($1)._checkHashChange();
  709. $2=_st($1)._checkHash();
  710. return self}, function($ctx1) {$ctx1.fill(self,"buildOn:",{aCanvas:aCanvas}, smalltalk.DocumentationBuilder)})},
  711. messageSends: ["with:", "widget", "checkHashChange", "checkHash"]}),
  712. smalltalk.DocumentationBuilder);
  713. smalltalk.addMethod(
  714. "_buildOnJQuery_",
  715. smalltalk.method({
  716. selector: "buildOnJQuery:",
  717. fn: function (aJQuery){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx1) { _st(self)._buildOn_(_st((smalltalk.HTMLCanvas || HTMLCanvas))._onJQuery_(aJQuery));
  720. return self}, function($ctx1) {$ctx1.fill(self,"buildOnJQuery:",{aJQuery:aJQuery}, smalltalk.DocumentationBuilder)})},
  721. messageSends: ["buildOn:", "onJQuery:"]}),
  722. smalltalk.DocumentationBuilder);
  723. smalltalk.addMethod(
  724. "_ch1introduction",
  725. smalltalk.method({
  726. selector: "ch1introduction",
  727. fn: function (){
  728. var self=this;
  729. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  730. $2=_st((smalltalk.DocChapter || DocChapter))._new();
  731. _st($2)._title_("Introduction");
  732. $3=_st($2)._contents_("\x0a\x0a##Amber Smalltalk in a nutshell\x0a\x0aAmber is an implementation of the Smalltalk-80 language. It is designed to make client-side web development **faster, easier and more fun** as it allows developers to write HTML5 applications in a live Smalltalk environment!\x0a\x0aAmber is written in itself, including the IDE and the compiler and it runs **directly inside your browser**. The IDE is fairly complete with a class browser, workspace, transcript, unit test runner, object inspectors, cross reference tools and even a debugger.\x0a\x0aNoteworthy features:\x0a\x0a- Amber is semantically and syntactically very close to [Pharo Smalltalk](http://www.pharo-project.org). Pharo is considered the reference implementation.\x0a- Amber **seamlessly interacts with JavaScript** and can use its full eco system of libraries without any glue code needed.\x0a- Amber **has no dependencies** and can be used in any JavaScript runtime, not only inside browsers. An important example is [Node.js](http://nodejs.org).\x0a- Amber is a live Smalltalk that **compiles incrementally into efficient JavaScript** often mapping one-to-one with JavaScript equivalents.\x0a- Amber has a **Seaside influenced canvas library** to dynamically generate HTML.\x0a\x0a## Why Amber?\x0a\x0a- JavaScript is quite a broken language with lots of traps and odd quirks. It is the assembler of the Internet which is cool, but we don't want to write in it.\x0a- Amber is a language and environment built for the web. With Amber, client-side web development finally gets the power and productivity that exists in other Smalltalk dialects.\x0a- Smalltalk has a simple class model with a lightweight syntax for closures, it is in many ways a perfect match for the Good Parts of JavaScript. \x0a Smalltalk stands head and shoulders above most other languages for clarity, conciseness, and human-friendliness.\x0a As a language, it is immensely clean and mature, both syntactically and semantically. It is a pure OO language, with objects all the way down.\x0a- Having a true live & incremental development environment where you can build your application interactively in the browser is unbeatable.\x0a\x0a## Disclaimer\x0a\x0aThis documentation doesn't aim to teach Smalltalk. \x0aKnowledge of Smalltalk is needed to understand the topics covered in this documentation. \x0aIf you want to learn the Smalltalk language, you can read the excellent [Pharo By Example](http://www.pharobyexample.org) book.\x0a");
  733. $1=$3;
  734. return $1;
  735. }, function($ctx1) {$ctx1.fill(self,"ch1introduction",{}, smalltalk.DocumentationBuilder)})},
  736. messageSends: ["title:", "new", "contents:"]}),
  737. smalltalk.DocumentationBuilder);
  738. smalltalk.addMethod(
  739. "_ch2differencesWithOtherSmalltalks",
  740. smalltalk.method({
  741. selector: "ch2differencesWithOtherSmalltalks",
  742. fn: function (){
  743. var self=this;
  744. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  745. $2=_st((smalltalk.DocChapter || DocChapter))._new();
  746. _st($2)._title_("Differences with other Smalltalks");
  747. $3=_st($2)._contents_("\x0aAmber has some differences with other Smalltalk implementations. This makes porting code a non-trivial thing, but still quite manageable.\x0aBecause it maps Smalltalk constructs one-to-one with the JavaScript equivalent, including Smalltalk classes to JavaScript constructors, the core class library is simplified compared to Pharo Smalltalk.\x0aAnd since we want Amber to be useful in building lean browser apps we can't let it bloat too much.\x0a\x0aBut apart from missing things other Smalltalks may have, there are also things that are plain different:\x0a\x0a- The collection class hierarchy is much simpler compared to most Smalltalk implementations. In part this is because we want to map reasonably well with JavaScript counter parts.\x0a- As of today, there is no SortedCollection. The size of arrays is dynamic, and they behave like an ordered collection. They can also be sorted with the `#sort*` methods.\x0a- The `Date` class behaves like the `Date` and `TimeStamp` classes in Pharo Smalltalk. Therefore both `Date today` and `Date now` are valid in Amber.\x0a- Amber does not have class Character, but `String` does implement some of Character behavior so a single character String can work as a Character.\x0a- Amber does support **class instance variables**, but not class variables.\x0a- Amber only has global classes and packages, but not arbitrary objects. Use classes instead like `Smalltalk current` instead of `Smalltalk` etc.\x0a- Amber does not support pool dictionaries.\x0a- Amber uses **< ...javascript code... >** to inline JavaScript code and does not have pragmas.\x0a- Amber does not have class categories. The left side in the browser lists real Packages, but they feel much the same.\x0a");
  748. $1=$3;
  749. return $1;
  750. }, function($ctx1) {$ctx1.fill(self,"ch2differencesWithOtherSmalltalks",{}, smalltalk.DocumentationBuilder)})},
  751. messageSends: ["title:", "new", "contents:"]}),
  752. smalltalk.DocumentationBuilder);
  753. smalltalk.addMethod(
  754. "_ch3GettingStarted",
  755. smalltalk.method({
  756. selector: "ch3GettingStarted",
  757. fn: function (){
  758. var self=this;
  759. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  760. $2=_st((smalltalk.DocChapter || DocChapter))._new();
  761. _st($2)._title_("Getting started");
  762. $3=_st($2)._contents_("\x0aTo get started hacking in Amber you can basically take three routes, independent of your platform:\x0a\x0a1. Just **try it out directly** at [www.amber-lang.net](http://www.amber-lang.net) - click the **Class browser** button there. But you will **not be able to save any code you write**! \x0a Still, it works fine for looking at the IDE and playing around. Just **don't press F5/reload** - it will lose any code you have written.\x0a2. Download an Amber zip-ball, install [Nodejs](http://www.nodejs.org), fire up the Amber server and then open Amber from localhost - then you **can save code**. Detailed instructions are below!\x0a3. Same as above but install git first and get a proper clone from [http://github.com/NicolasPetton/amber](http://github.com/NicolasPetton/amber) instead of a zip/tar-ball. \x0a If you want to **contribute to Amber itself** this is really what you want to do. In fact, in most cases this is what you want to do. It requires installing git first, but it is quite simple - although we leave this bit as an \x22exercise to the reader\x22 :)\x0a\x0a\x0a## Downloading Amber\x0aCurrently you can download in zip or tar-ball format, either cutting edge or a release. [Downloads are available here](https://github.com/NicolasPetton/amber/archives/amber). \x0a\x0aUnpack wherever you like, but I would rename the directory that is unpacked to something slightly shorter - like say \x22amber\x22. :)\x0aAnd yes, at this point you can double click the index.html file in the amber directory to get the IDE up, but again, **you will not be able to save code**. So please continue below :)\x0a\x0a## Installing Node.js\x0a[Node](http://www.nodejs.org) (for short) is simply the V8 Javascript VM from Google (used in Chrome) hooked together with some hard core C-libraries for doing \x22evented I/O\x22.\x0aBasically it's JavaScript for the server - on asynch steroids. Amber runs fine in Node and we use it for several Amber tools, like amberc (the command line Amber compiler) or the Amber server (see below). \x0aThere are also several Amber-Node examples to look at if you want to play with running Amber programs server side. **In short - you really want to install Nodejs. :)**\x0a\x0a- Installing Node on Linux can be done using your package tool of choice (`apt-get install nodejs` for example) or any other way described at [the download page](http://nodejs.org/#download).\x0a- Installing Node on MacOS or Windows is probably done best by using the [installers available at Nodejs.org](http://nodejs.org/#download).\x0a\x0a## Starting Amber server\x0aNicolas has written a minimal webDAV server that is the easiest way to get up and running Amber with the ability to save code. This little server is written in... Amber! \x0aAnd it runs on top of Node. So to start it up serving your brand new directory tree of sweet Amber you do:\x0a\x0a\x09cd amber\x09(or whatever you called the directory you unpackaged)\x0a\x09./bin/server\x09(in windows you type `node server\x5cserver.js` instead)\x0a\x0aIt should say it is listening on port 4000. If it does, hooray! That means both Node and Amber are good. In Windows you might get a question about opening that port in the local firewall - yep, do it!\x0a\x0a## Firing up Amber\x0aThe Amber IDE is written in... Amber. It uses [jQuery](http://jquery.com) and runs right in your browser as a ... well, a web page. \x0aWe could open it up just using a file url - but the reason we performed the previous steps is so that we can load the IDE web page from a server that can handle PUTs (webDAV) of source code. \x0aAccording to web security Amber can only do PUT back to the same server it was loaded from. Thus we instead want to open it [through our little server now listening on port 4000](http://localhost:4000/index.html).\x0aClicking that link and then pressing the **Class browser** should get your Amber IDE running with the ability to commit modified packages locally.\x0a\x0aTo verify that you can indeed commit now - just select a Package in the browser, like say \x22Examples\x22 and press the **Commit** button below. **If all goes well nothing happens :)**. \x0aSo in order to really know if it worked we can check the modified date on the files **amber/st/Examples.st**, **amber/js/Examples.js** and **amber/js/Examples.deploy.js** - they should be brand new.\x0a\x0aNOTE: We can use any webDAV server and Apache2 has been used earlier and works fine. But the Amber server is smaller and simpler to start.\x0a");
  763. $1=$3;
  764. return $1;
  765. }, function($ctx1) {$ctx1.fill(self,"ch3GettingStarted",{}, smalltalk.DocumentationBuilder)})},
  766. messageSends: ["title:", "new", "contents:"]}),
  767. smalltalk.DocumentationBuilder);
  768. smalltalk.addMethod(
  769. "_ch4Tutorials",
  770. smalltalk.method({
  771. selector: "ch4Tutorials",
  772. fn: function (){
  773. var self=this;
  774. return smalltalk.withContext(function($ctx1) { var $1;
  775. $1=_st((smalltalk.TutorialsChapter || TutorialsChapter))._new();
  776. return $1;
  777. }, function($ctx1) {$ctx1.fill(self,"ch4Tutorials",{}, smalltalk.DocumentationBuilder)})},
  778. messageSends: ["new"]}),
  779. smalltalk.DocumentationBuilder);
  780. smalltalk.addMethod(
  781. "_ch5Index",
  782. smalltalk.method({
  783. selector: "ch5Index",
  784. fn: function (){
  785. var self=this;
  786. return smalltalk.withContext(function($ctx1) { var $1;
  787. $1=_st((smalltalk.ClassesIndexChapter || ClassesIndexChapter))._new();
  788. return $1;
  789. }, function($ctx1) {$ctx1.fill(self,"ch5Index",{}, smalltalk.DocumentationBuilder)})},
  790. messageSends: ["new"]}),
  791. smalltalk.DocumentationBuilder);
  792. smalltalk.addMethod(
  793. "_ch6KernelObjects",
  794. smalltalk.method({
  795. selector: "ch6KernelObjects",
  796. fn: function (){
  797. var self=this;
  798. return smalltalk.withContext(function($ctx1) { var $1;
  799. $1=_st((smalltalk.PackageDocChapter || PackageDocChapter))._on_(_st((smalltalk.Package || Package))._named_("Kernel-Objects"));
  800. return $1;
  801. }, function($ctx1) {$ctx1.fill(self,"ch6KernelObjects",{}, smalltalk.DocumentationBuilder)})},
  802. messageSends: ["on:", "named:"]}),
  803. smalltalk.DocumentationBuilder);
  804. smalltalk.addMethod(
  805. "_ch7KernelClasses",
  806. smalltalk.method({
  807. selector: "ch7KernelClasses",
  808. fn: function (){
  809. var self=this;
  810. return smalltalk.withContext(function($ctx1) { var $1;
  811. $1=_st((smalltalk.PackageDocChapter || PackageDocChapter))._on_(_st((smalltalk.Package || Package))._named_("Kernel-Classes"));
  812. return $1;
  813. }, function($ctx1) {$ctx1.fill(self,"ch7KernelClasses",{}, smalltalk.DocumentationBuilder)})},
  814. messageSends: ["on:", "named:"]}),
  815. smalltalk.DocumentationBuilder);
  816. smalltalk.addMethod(
  817. "_ch8KernelCollection",
  818. smalltalk.method({
  819. selector: "ch8KernelCollection",
  820. fn: function (){
  821. var self=this;
  822. return smalltalk.withContext(function($ctx1) { var $1;
  823. $1=_st((smalltalk.PackageDocChapter || PackageDocChapter))._on_(_st((smalltalk.Package || Package))._named_("Kernel-Collections"));
  824. return $1;
  825. }, function($ctx1) {$ctx1.fill(self,"ch8KernelCollection",{}, smalltalk.DocumentationBuilder)})},
  826. messageSends: ["on:", "named:"]}),
  827. smalltalk.DocumentationBuilder);
  828. smalltalk.addMethod(
  829. "_ch9KernelMethods",
  830. smalltalk.method({
  831. selector: "ch9KernelMethods",
  832. fn: function (){
  833. var self=this;
  834. return smalltalk.withContext(function($ctx1) { var $1;
  835. $1=_st((smalltalk.PackageDocChapter || PackageDocChapter))._on_(_st((smalltalk.Package || Package))._named_("Kernel-Methods"));
  836. return $1;
  837. }, function($ctx1) {$ctx1.fill(self,"ch9KernelMethods",{}, smalltalk.DocumentationBuilder)})},
  838. messageSends: ["on:", "named:"]}),
  839. smalltalk.DocumentationBuilder);
  840. smalltalk.addMethod(
  841. "_chapters",
  842. smalltalk.method({
  843. selector: "chapters",
  844. fn: function (){
  845. var self=this;
  846. return smalltalk.withContext(function($ctx1) { var $2,$1;
  847. $2=self["@chapters"];
  848. if(($receiver = $2) == nil || $receiver == undefined){
  849. self["@chapters"]=_st(self)._buildChapters();
  850. $1=self["@chapters"];
  851. } else {
  852. $1=$2;
  853. };
  854. return $1;
  855. }, function($ctx1) {$ctx1.fill(self,"chapters",{}, smalltalk.DocumentationBuilder)})},
  856. messageSends: ["ifNil:", "buildChapters"]}),
  857. smalltalk.DocumentationBuilder);
  858. smalltalk.addMethod(
  859. "_checkHash",
  860. smalltalk.method({
  861. selector: "checkHash",
  862. fn: function (){
  863. var self=this;
  864. var hash,presentation;
  865. return smalltalk.withContext(function($ctx1) { var $1,$2;
  866. hash=_st(_st(_st(document)._location())._hash())._replace_with_("^#","");
  867. $1=_st((smalltalk.ChapterSelectionAnnouncement || ChapterSelectionAnnouncement))._new();
  868. _st($1)._id_(hash);
  869. $2=_st($1)._yourself();
  870. _st(_st(self)._announcer())._announce_($2);
  871. return self}, function($ctx1) {$ctx1.fill(self,"checkHash",{hash:hash,presentation:presentation}, smalltalk.DocumentationBuilder)})},
  872. messageSends: ["replace:with:", "hash", "location", "announce:", "id:", "new", "yourself", "announcer"]}),
  873. smalltalk.DocumentationBuilder);
  874. smalltalk.addMethod(
  875. "_checkHashChange",
  876. smalltalk.method({
  877. selector: "checkHashChange",
  878. fn: function (){
  879. var self=this;
  880. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_(window))._bind_do_("hashchange",(function(){
  881. return smalltalk.withContext(function($ctx2) { return _st(self)._checkHash();
  882. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  883. return self}, function($ctx1) {$ctx1.fill(self,"checkHashChange",{}, smalltalk.DocumentationBuilder)})},
  884. messageSends: ["bind:do:", "checkHash", "jQuery:"]}),
  885. smalltalk.DocumentationBuilder);
  886. smalltalk.addMethod(
  887. "_update",
  888. smalltalk.method({
  889. selector: "update",
  890. fn: function (){
  891. var self=this;
  892. return smalltalk.withContext(function($ctx1) { self["@chapters"]=nil;
  893. self["@announcer"]=nil;
  894. self["@widget"]=nil;
  895. _st(_st(window)._jQuery_(".documentation"))._remove();
  896. _st(self)._build();
  897. return self}, function($ctx1) {$ctx1.fill(self,"update",{}, smalltalk.DocumentationBuilder)})},
  898. messageSends: ["remove", "jQuery:", "build"]}),
  899. smalltalk.DocumentationBuilder);
  900. smalltalk.addMethod(
  901. "_widget",
  902. smalltalk.method({
  903. selector: "widget",
  904. fn: function (){
  905. var self=this;
  906. return smalltalk.withContext(function($ctx1) { var $2,$1;
  907. $2=self["@widget"];
  908. if(($receiver = $2) == nil || $receiver == undefined){
  909. self["@widget"]=_st((smalltalk.DocumentationWidget || DocumentationWidget))._on_(self);
  910. $1=self["@widget"];
  911. } else {
  912. $1=$2;
  913. };
  914. return $1;
  915. }, function($ctx1) {$ctx1.fill(self,"widget",{}, smalltalk.DocumentationBuilder)})},
  916. messageSends: ["ifNil:", "on:"]}),
  917. smalltalk.DocumentationBuilder);
  918. smalltalk.DocumentationBuilder.klass.iVarNames = ['current'];
  919. smalltalk.addMethod(
  920. "_current",
  921. smalltalk.method({
  922. selector: "current",
  923. fn: function (){
  924. var self=this;
  925. return smalltalk.withContext(function($ctx1) { var $2,$1;
  926. $2=self["@current"];
  927. if(($receiver = $2) == nil || $receiver == undefined){
  928. self["@current"]=_st(self)._new();
  929. $1=self["@current"];
  930. } else {
  931. $1=$2;
  932. };
  933. return $1;
  934. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.DocumentationBuilder.klass)})},
  935. messageSends: ["ifNil:", "new"]}),
  936. smalltalk.DocumentationBuilder.klass);
  937. smalltalk.addMethod(
  938. "_initialize",
  939. smalltalk.method({
  940. selector: "initialize",
  941. fn: function (){
  942. var self=this;
  943. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._build();
  944. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.DocumentationBuilder.klass)})},
  945. messageSends: ["build", "current"]}),
  946. smalltalk.DocumentationBuilder.klass);
  947. smalltalk.addClass('DocumentationWidget', smalltalk.Widget, ['builder', 'selectedChapter', 'chapterDiv'], 'Documentation');
  948. smalltalk.addMethod(
  949. "_builder",
  950. smalltalk.method({
  951. selector: "builder",
  952. fn: function (){
  953. var self=this;
  954. return smalltalk.withContext(function($ctx1) { var $1;
  955. $1=self["@builder"];
  956. return $1;
  957. }, function($ctx1) {$ctx1.fill(self,"builder",{}, smalltalk.DocumentationWidget)})},
  958. messageSends: []}),
  959. smalltalk.DocumentationWidget);
  960. smalltalk.addMethod(
  961. "_builder_",
  962. smalltalk.method({
  963. selector: "builder:",
  964. fn: function (aDocumentationBuilder){
  965. var self=this;
  966. return smalltalk.withContext(function($ctx1) { self["@builder"]=aDocumentationBuilder;
  967. return self}, function($ctx1) {$ctx1.fill(self,"builder:",{aDocumentationBuilder:aDocumentationBuilder}, smalltalk.DocumentationWidget)})},
  968. messageSends: []}),
  969. smalltalk.DocumentationWidget);
  970. smalltalk.addMethod(
  971. "_chapters",
  972. smalltalk.method({
  973. selector: "chapters",
  974. fn: function (){
  975. var self=this;
  976. return smalltalk.withContext(function($ctx1) { var $1;
  977. $1=_st(_st(self)._builder())._chapters();
  978. return $1;
  979. }, function($ctx1) {$ctx1.fill(self,"chapters",{}, smalltalk.DocumentationWidget)})},
  980. messageSends: ["chapters", "builder"]}),
  981. smalltalk.DocumentationWidget);
  982. smalltalk.addMethod(
  983. "_displayChapter_",
  984. smalltalk.method({
  985. selector: "displayChapter:",
  986. fn: function (aChapter){
  987. var self=this;
  988. return smalltalk.withContext(function($ctx1) { _st(self)._selectedChapter_(aChapter);
  989. _st(self)._updateChapterDiv();
  990. return self}, function($ctx1) {$ctx1.fill(self,"displayChapter:",{aChapter:aChapter}, smalltalk.DocumentationWidget)})},
  991. messageSends: ["selectedChapter:", "updateChapterDiv"]}),
  992. smalltalk.DocumentationWidget);
  993. smalltalk.addMethod(
  994. "_renderChapterMenu_on_",
  995. smalltalk.method({
  996. selector: "renderChapterMenu:on:",
  997. fn: function (aChapter,html){
  998. var self=this;
  999. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1000. $1=_st(html)._a();
  1001. _st($1)._with_(_st(aChapter)._title());
  1002. $2=_st($1)._onClick_((function(){
  1003. return smalltalk.withContext(function($ctx2) { return _st(self)._selectChapter_(aChapter);
  1004. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1005. _st(_st(html)._ol())._with_((function(){
  1006. return smalltalk.withContext(function($ctx2) { return _st(_st(aChapter)._chapters())._do_((function(each){
  1007. return smalltalk.withContext(function($ctx3) { return _st(_st(html)._li())._with_((function(){
  1008. return smalltalk.withContext(function($ctx4) { return _st(self)._renderChapterMenu_on_(each,html);
  1009. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1010. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1011. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1012. return self}, function($ctx1) {$ctx1.fill(self,"renderChapterMenu:on:",{aChapter:aChapter,html:html}, smalltalk.DocumentationWidget)})},
  1013. messageSends: ["with:", "title", "a", "onClick:", "selectChapter:", "do:", "renderChapterMenu:on:", "li", "chapters", "ol"]}),
  1014. smalltalk.DocumentationWidget);
  1015. smalltalk.addMethod(
  1016. "_renderMenuOn_",
  1017. smalltalk.method({
  1018. selector: "renderMenuOn:",
  1019. fn: function (html){
  1020. var self=this;
  1021. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1022. $1=_st(html)._div();
  1023. _st($1)._class_("menu");
  1024. $2=_st($1)._with_((function(){
  1025. return smalltalk.withContext(function($ctx2) { return _st(_st(html)._ol())._with_((function(){
  1026. return smalltalk.withContext(function($ctx3) { return _st(_st(self)._chapters())._do_((function(each){
  1027. return smalltalk.withContext(function($ctx4) { return _st(_st(html)._li())._with_((function(){
  1028. return smalltalk.withContext(function($ctx5) { return _st(self)._renderChapterMenu_on_(each,html);
  1029. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1030. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  1031. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1032. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1033. return self}, function($ctx1) {$ctx1.fill(self,"renderMenuOn:",{html:html}, smalltalk.DocumentationWidget)})},
  1034. messageSends: ["class:", "div", "with:", "do:", "renderChapterMenu:on:", "li", "chapters", "ol"]}),
  1035. smalltalk.DocumentationWidget);
  1036. smalltalk.addMethod(
  1037. "_renderOn_",
  1038. smalltalk.method({
  1039. selector: "renderOn:",
  1040. fn: function (html){
  1041. var self=this;
  1042. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1043. $1=_st(html)._div();
  1044. _st($1)._class_("documentation");
  1045. $2=_st($1)._with_((function(){
  1046. return smalltalk.withContext(function($ctx2) { _st(self)._renderMenuOn_(html);
  1047. self["@chapterDiv"]=_st(html)._div();
  1048. self["@chapterDiv"];
  1049. return _st(self)._updateChapterDiv();
  1050. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1051. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.DocumentationWidget)})},
  1052. messageSends: ["class:", "div", "with:", "renderMenuOn:", "updateChapterDiv"]}),
  1053. smalltalk.DocumentationWidget);
  1054. smalltalk.addMethod(
  1055. "_selectChapter_",
  1056. smalltalk.method({
  1057. selector: "selectChapter:",
  1058. fn: function (aChapter){
  1059. var self=this;
  1060. return smalltalk.withContext(function($ctx1) { _st(_st(document)._location())._hash_(_st(aChapter)._id());
  1061. return self}, function($ctx1) {$ctx1.fill(self,"selectChapter:",{aChapter:aChapter}, smalltalk.DocumentationWidget)})},
  1062. messageSends: ["hash:", "id", "location"]}),
  1063. smalltalk.DocumentationWidget);
  1064. smalltalk.addMethod(
  1065. "_selectedChapter",
  1066. smalltalk.method({
  1067. selector: "selectedChapter",
  1068. fn: function (){
  1069. var self=this;
  1070. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1071. $2=self["@selectedChapter"];
  1072. if(($receiver = $2) == nil || $receiver == undefined){
  1073. self["@selectedChapter"]=_st(_st(self)._chapters())._first();
  1074. $1=self["@selectedChapter"];
  1075. } else {
  1076. $1=$2;
  1077. };
  1078. return $1;
  1079. }, function($ctx1) {$ctx1.fill(self,"selectedChapter",{}, smalltalk.DocumentationWidget)})},
  1080. messageSends: ["ifNil:", "first", "chapters"]}),
  1081. smalltalk.DocumentationWidget);
  1082. smalltalk.addMethod(
  1083. "_selectedChapter_",
  1084. smalltalk.method({
  1085. selector: "selectedChapter:",
  1086. fn: function (aChapter){
  1087. var self=this;
  1088. return smalltalk.withContext(function($ctx1) { var $1;
  1089. self["@selectedChapter"]=aChapter;
  1090. $1=self["@selectedChapter"];
  1091. return $1;
  1092. }, function($ctx1) {$ctx1.fill(self,"selectedChapter:",{aChapter:aChapter}, smalltalk.DocumentationWidget)})},
  1093. messageSends: []}),
  1094. smalltalk.DocumentationWidget);
  1095. smalltalk.addMethod(
  1096. "_updateChapterDiv",
  1097. smalltalk.method({
  1098. selector: "updateChapterDiv",
  1099. fn: function (){
  1100. var self=this;
  1101. return smalltalk.withContext(function($ctx1) { _st(self["@chapterDiv"])._contents_((function(html){
  1102. return smalltalk.withContext(function($ctx2) { return _st(html)._with_(_st(self)._selectedChapter());
  1103. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  1104. return self}, function($ctx1) {$ctx1.fill(self,"updateChapterDiv",{}, smalltalk.DocumentationWidget)})},
  1105. messageSends: ["contents:", "with:", "selectedChapter"]}),
  1106. smalltalk.DocumentationWidget);
  1107. smalltalk.addMethod(
  1108. "_on_",
  1109. smalltalk.method({
  1110. selector: "on:",
  1111. fn: function (aBuilder){
  1112. var self=this;
  1113. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1114. $2=_st(self)._new();
  1115. _st($2)._builder_(aBuilder);
  1116. $3=_st($2)._yourself();
  1117. $1=$3;
  1118. return $1;
  1119. }, function($ctx1) {$ctx1.fill(self,"on:",{aBuilder:aBuilder}, smalltalk.DocumentationWidget.klass)})},
  1120. messageSends: ["builder:", "new", "yourself"]}),
  1121. smalltalk.DocumentationWidget.klass);