resin 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +52 -0
- data/amber/css/amber.css +519 -0
- data/amber/css/documentation.css +84 -0
- data/amber/css/profstef.css +75 -0
- data/amber/css/style.css +313 -0
- data/amber/images/amber.png +0 -0
- data/amber/images/amber_small.png +0 -0
- data/amber/images/off.png +0 -0
- data/amber/images/offHover.png +0 -0
- data/amber/images/presentation.png +0 -0
- data/amber/images/profstef.png +0 -0
- data/amber/images/sprite.png +0 -0
- data/amber/images/tinylogo.png +0 -0
- data/amber/images/twitterwall.png +0 -0
- data/amber/js/Additional-Examples.deploy.js +15 -0
- data/amber/js/Additional-Examples.js +21 -0
- data/amber/js/Benchfib.deploy.js +132 -0
- data/amber/js/Benchfib.js +167 -0
- data/amber/js/Canvas.deploy.js +1304 -0
- data/amber/js/Canvas.js +1885 -0
- data/amber/js/Compiler.deploy.js +1871 -0
- data/amber/js/Compiler.js +2616 -0
- data/amber/js/Documentation.deploy.js +961 -0
- data/amber/js/Documentation.js +1376 -0
- data/amber/js/Examples.deploy.js +53 -0
- data/amber/js/Examples.js +73 -0
- data/amber/js/IDE.deploy.js +3468 -0
- data/amber/js/IDE.js +4883 -0
- data/amber/js/Kernel-Announcements.deploy.js +107 -0
- data/amber/js/Kernel-Announcements.js +152 -0
- data/amber/js/Kernel-Classes.deploy.js +675 -0
- data/amber/js/Kernel-Classes.js +956 -0
- data/amber/js/Kernel-Collections.deploy.js +3273 -0
- data/amber/js/Kernel-Collections.js +4644 -0
- data/amber/js/Kernel-Exceptions.deploy.js +244 -0
- data/amber/js/Kernel-Exceptions.js +349 -0
- data/amber/js/Kernel-Methods.deploy.js +510 -0
- data/amber/js/Kernel-Methods.js +739 -0
- data/amber/js/Kernel-Objects.deploy.js +2698 -0
- data/amber/js/Kernel-Objects.js +3858 -0
- data/amber/js/Kernel-Tests.deploy.js +1419 -0
- data/amber/js/Kernel-Tests.js +1929 -0
- data/amber/js/Kernel-Transcript.deploy.js +142 -0
- data/amber/js/Kernel-Transcript.js +202 -0
- data/amber/js/SUnit.deploy.js +351 -0
- data/amber/js/SUnit.js +501 -0
- data/amber/js/amber.js +250 -0
- data/amber/js/boot.js +587 -0
- data/amber/js/compat.js +22 -0
- data/amber/js/init.js +8 -0
- data/amber/js/lib/CodeMirror/LICENSE +19 -0
- data/amber/js/lib/CodeMirror/amber.css +21 -0
- data/amber/js/lib/CodeMirror/codemirror.css +67 -0
- data/amber/js/lib/CodeMirror/codemirror.js +2144 -0
- data/amber/js/lib/CodeMirror/smalltalk.js +134 -0
- data/amber/js/lib/jQuery/jquery-1.4.4.min.js +167 -0
- data/amber/js/lib/jQuery/jquery-1.6.4.min.js +4 -0
- data/amber/js/lib/jQuery/jquery-ui-1.8.16.custom.min.js +791 -0
- data/amber/js/lib/jQuery/jquery.textarea.js +267 -0
- data/amber/js/lib/peg-0.6.2.min.js +2 -0
- data/amber/js/lib/showdown.js +419 -0
- data/amber/js/parser.js +4005 -0
- data/amber/js/parser.pegjs +220 -0
- data/amber/st/Benchfib.st +124 -0
- data/amber/st/Canvas.st +556 -0
- data/amber/st/Compiler.st +1425 -0
- data/amber/st/Documentation.st +758 -0
- data/amber/st/Examples.st +38 -0
- data/amber/st/IDE.st +2336 -0
- data/amber/st/Kernel-Announcements.st +61 -0
- data/amber/st/Kernel-Classes.st +403 -0
- data/amber/st/Kernel-Collections.st +1673 -0
- data/amber/st/Kernel-Exceptions.st +124 -0
- data/amber/st/Kernel-Methods.st +287 -0
- data/amber/st/Kernel-Objects.st +1489 -0
- data/amber/st/Kernel-Tests.st +892 -0
- data/amber/st/Kernel-Transcript.st +70 -0
- data/amber/st/SUnit.st +172 -0
- data/bin/runresin +12 -0
- data/lib/resin.rb +0 -0
- data/lib/resin/app/app.rb +121 -0
- data/lib/resin/app/views/index.haml +10 -0
- metadata +216 -0
@@ -0,0 +1,961 @@
|
|
1
|
+
smalltalk.addPackage('Documentation', {});
|
2
|
+
smalltalk.addClass('DocumentationBuilder', smalltalk.Object, ['chapters', 'announcer', 'widget'], 'Documentation');
|
3
|
+
smalltalk.addMethod(
|
4
|
+
unescape('_chapters'),
|
5
|
+
smalltalk.method({
|
6
|
+
selector: unescape('chapters'),
|
7
|
+
fn: function (){
|
8
|
+
var self=this;
|
9
|
+
return (($receiver = self['@chapters']) == nil || $receiver == undefined) ? (function(){return (self['@chapters']=smalltalk.send(self, "_buildChapters", []));})() : $receiver;
|
10
|
+
return self;}
|
11
|
+
}),
|
12
|
+
smalltalk.DocumentationBuilder);
|
13
|
+
|
14
|
+
smalltalk.addMethod(
|
15
|
+
unescape('_announcer'),
|
16
|
+
smalltalk.method({
|
17
|
+
selector: unescape('announcer'),
|
18
|
+
fn: function (){
|
19
|
+
var self=this;
|
20
|
+
return (($receiver = self['@announcer']) == nil || $receiver == undefined) ? (function(){return (self['@announcer']=smalltalk.send((smalltalk.Announcer || Announcer), "_new", []));})() : $receiver;
|
21
|
+
return self;}
|
22
|
+
}),
|
23
|
+
smalltalk.DocumentationBuilder);
|
24
|
+
|
25
|
+
smalltalk.addMethod(
|
26
|
+
unescape('_widget'),
|
27
|
+
smalltalk.method({
|
28
|
+
selector: unescape('widget'),
|
29
|
+
fn: function (){
|
30
|
+
var self=this;
|
31
|
+
return (($receiver = self['@widget']) == nil || $receiver == undefined) ? (function(){return (self['@widget']=smalltalk.send((smalltalk.DocumentationWidget || DocumentationWidget), "_on_", [self]));})() : $receiver;
|
32
|
+
return self;}
|
33
|
+
}),
|
34
|
+
smalltalk.DocumentationBuilder);
|
35
|
+
|
36
|
+
smalltalk.addMethod(
|
37
|
+
unescape('_buildChapters'),
|
38
|
+
smalltalk.method({
|
39
|
+
selector: unescape('buildChapters'),
|
40
|
+
fn: function (){
|
41
|
+
var self=this;
|
42
|
+
return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_class", []), "_methodDictionary", []), "_values", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_selector", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(b, "_selector", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(b, "_selector", [])]));})]), "_select_", [(function(each){return smalltalk.send(smalltalk.send(each, "_category", []), "__eq", ["chapters"]);})]), "_collect_", [(function(each){return smalltalk.send(self, "_perform_", [smalltalk.send(each, "_selector", [])]);})]);
|
43
|
+
return self;}
|
44
|
+
}),
|
45
|
+
smalltalk.DocumentationBuilder);
|
46
|
+
|
47
|
+
smalltalk.addMethod(
|
48
|
+
unescape('_buildOn_'),
|
49
|
+
smalltalk.method({
|
50
|
+
selector: unescape('buildOn%3A'),
|
51
|
+
fn: function (aCanvas){
|
52
|
+
var self=this;
|
53
|
+
smalltalk.send(aCanvas, "_with_", [smalltalk.send(self, "_widget", [])]);
|
54
|
+
(function($rec){smalltalk.send($rec, "_checkHashChange", []);return smalltalk.send($rec, "_checkHash", []);})(self);
|
55
|
+
return self;}
|
56
|
+
}),
|
57
|
+
smalltalk.DocumentationBuilder);
|
58
|
+
|
59
|
+
smalltalk.addMethod(
|
60
|
+
unescape('_buildOnJQuery_'),
|
61
|
+
smalltalk.method({
|
62
|
+
selector: unescape('buildOnJQuery%3A'),
|
63
|
+
fn: function (aJQuery){
|
64
|
+
var self=this;
|
65
|
+
smalltalk.send(self, "_buildOn_", [smalltalk.send((smalltalk.HTMLCanvas || HTMLCanvas), "_onJQuery_", [aJQuery])]);
|
66
|
+
return self;}
|
67
|
+
}),
|
68
|
+
smalltalk.DocumentationBuilder);
|
69
|
+
|
70
|
+
smalltalk.addMethod(
|
71
|
+
unescape('_build'),
|
72
|
+
smalltalk.method({
|
73
|
+
selector: unescape('build'),
|
74
|
+
fn: function (){
|
75
|
+
var self=this;
|
76
|
+
smalltalk.send(self, "_buildOnJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
|
77
|
+
return self;}
|
78
|
+
}),
|
79
|
+
smalltalk.DocumentationBuilder);
|
80
|
+
|
81
|
+
smalltalk.addMethod(
|
82
|
+
unescape('_ch1introduction'),
|
83
|
+
smalltalk.method({
|
84
|
+
selector: unescape('ch1introduction'),
|
85
|
+
fn: function (){
|
86
|
+
var self=this;
|
87
|
+
return (function($rec){smalltalk.send($rec, "_title_", ["Introduction"]);return smalltalk.send($rec, "_contents_", [unescape("%0A%0A%23%23Amber%20Smalltalk%20in%20a%20nutshell%0A%0AAmber%20is%20an%20implementation%20of%20the%20Smalltalk-80%20language.%20It%20is%20designed%20to%20make%20client-side%20web%20development%20**faster%2C%20easier%20and%20more%20fun**%20as%20it%20allows%20developers%20to%20write%20HTML5%20applications%20in%20a%20live%20Smalltalk%20environment%21%0A%0AAmber%20is%20written%20in%20itself%2C%20including%20the%20IDE%20and%20the%20compiler%20and%20it%20runs%20**directly%20inside%20your%20browser**.%20The%20IDE%20is%20fairly%20complete%20with%20a%20class%20browser%2C%20workspace%2C%20transcript%2C%20unit%20test%20runner%2C%20object%20inspectors%2C%20cross%20reference%20tools%20and%20even%20a%20debugger.%0A%0ANoteworthy%20features%3A%0A%0A-%20Amber%20is%20semantically%20and%20syntactically%20very%20close%20to%20%5BPharo%20Smalltalk%5D%28http%3A//www.pharo-project.org%29.%20Pharo%20is%20considered%20the%20reference%20implementation.%0A-%20Amber%20**seamlessly%20interacts%20with%20JavaScript**%20and%20can%20use%20its%20full%20eco%20system%20of%20libraries%20without%20any%20glue%20code%20needed.%0A-%20Amber%20**has%20no%20dependencies**%20and%20can%20be%20used%20in%20any%20JavaScript%20runtime%2C%20not%20only%20inside%20browsers.%20An%20important%20example%20is%20%5BNode.js%5D%28http%3A//nodejs.org%29.%0A-%20Amber%20is%20a%20live%20Smalltalk%20that%20**compiles%20incrementally%20into%20efficient%20JavaScript**%20often%20mapping%20one-to-one%20with%20JavaScript%20equivalents.%0A-%20Amber%20has%20a%20**Seaside%20influenced%20canvas%20library**%20to%20dynamically%20generate%20HTML.%0A%0A%23%23%20Arguments%20for%20using%20Amber%0AIn%20our%20humble%20opinion%20the%20main%20arguments%20for%20using%20Amber%20are%3A%0A%0A-%20JavaScript%20is%20quite%20a%20broken%20language%20with%20lots%20of%20traps%20and%20odd%20quirks.%20It%20is%20the%20assembler%20of%20the%20Internet%20which%20is%20cool%2C%20but%20we%20don%27t%20want%20to%20write%20in%20it.%0A-%20Smalltalk%20as%20a%20language%20is%20immensely%20cleaner%20and%20more%20mature%2C%20both%20syntactically%20and%20semantically.%0A-%20Smalltalk%20has%20a%20simple%20class%20model%20with%20a%20lightweight%20syntax%20for%20closures%2C%20it%20is%20in%20many%20ways%20a%20perfect%20match%20for%20the%20Good%20Parts%20of%20JavaScript.%0A-%20Having%20a%20true%20live%20interactive%20incremental%20development%20environment%20where%20you%20can%20build%20your%20application%20directly%20in%20the%20browser%20is%20unbeatable.%0A%0A%23%23%20Disclaimer%0A%0AThis%20documentation%20doesn%27t%20aim%20to%20teach%20Smalltalk.%20%0AKnowledge%20of%20Smalltalk%20is%20needed%20to%20understand%20the%20topics%20covered%20in%20this%20documentation.%20%0AIf%20you%20want%20to%20learn%20the%20Smalltalk%20language%2C%20you%20can%20read%20the%20excellent%20%5BPharo%20By%20Example%5D%28http%3A//www.pharobyexample.org%29%20book.%0A")]);})(smalltalk.send((smalltalk.DocChapter || DocChapter), "_new", []));
|
88
|
+
return self;}
|
89
|
+
}),
|
90
|
+
smalltalk.DocumentationBuilder);
|
91
|
+
|
92
|
+
smalltalk.addMethod(
|
93
|
+
unescape('_ch2differencesWithOtherSmalltalks'),
|
94
|
+
smalltalk.method({
|
95
|
+
selector: unescape('ch2differencesWithOtherSmalltalks'),
|
96
|
+
fn: function (){
|
97
|
+
var self=this;
|
98
|
+
return (function($rec){smalltalk.send($rec, "_title_", ["Differences with other Smalltalks"]);return smalltalk.send($rec, "_contents_", [unescape("%0AAmber%20has%20some%20differences%20with%20other%20Smalltalk%20implementations.%20This%20makes%20porting%20code%20a%20non-trivial%20thing%2C%20but%20still%20quite%20manageable.%0ABecause%20it%20maps%20Smalltalk%20constructs%20one-to-one%20with%20the%20JavaScript%20equivalent%2C%20including%20Smalltalk%20classes%20to%20JavaScript%20constructors%2C%20the%20core%20class%20library%20is%20simplified%20compared%20to%20Pharo%20Smalltalk.%0AAnd%20since%20we%20want%20Amber%20to%20be%20useful%20in%20building%20lean%20browser%20apps%20we%20can%27t%20let%20it%20bloat%20too%20much.%0A%0ABut%20apart%20from%20missing%20things%20other%20Smalltalks%20may%20have%2C%20there%20are%20also%20things%20that%20are%20plain%20different%3A%0A%0A-%20The%20collection%20class%20hierarchy%20is%20much%20simpler%20compared%20to%20most%20Smalltalk%20implementations.%20In%20part%20this%20is%20because%20we%20want%20to%20map%20reasonably%20well%20with%20JavaScript%20counter%20parts.%0A-%20As%20of%20today%2C%20there%20is%20no%20SortedCollection.%20The%20size%20of%20arrays%20is%20dynamic%2C%20and%20they%20behave%20like%20an%20ordered%20collection.%20They%20can%20also%20be%20sorted%20with%20the%20%60%23sort*%60%20methods.%0A-%20The%20%60Date%60%20class%20behaves%20like%20the%20%60Date%60%20and%20%60TimeStamp%60%20classes%20in%20Pharo%20Smalltalk.%20Therefore%20both%20%60Date%20today%60%20and%20%60Date%20now%60%20are%20valid%20in%20Amber.%0A-%20Amber%20does%20not%20have%20class%20Character%2C%20but%20%60String%60%20does%20implement%20some%20of%20Character%20behavior%20so%20a%20single%20character%20String%20can%20work%20as%20a%20Character.%0A-%20Amber%20does%20support%20**class%20instance%20variables**%2C%20but%20not%20class%20variables.%0A-%20Amber%20only%20has%20global%20classes%20and%20packages%2C%20but%20not%20arbitrary%20objects.%20Use%20classes%20instead%20like%20%60Smalltalk%20current%60%20instead%20of%20%60Smalltalk%60%20etc.%0A-%20Amber%20does%20not%20support%20pool%20dictionaries.%0A-%20Amber%20uses%20**%3C%20...javascript%20code...%20%3E**%20to%20inline%20JavaScript%20code%20and%20does%20not%20have%20pragmas.%0A-%20Amber%20does%20not%20have%20class%20categories.%20The%20left%20side%20in%20the%20browser%20lists%20real%20Packages%2C%20but%20they%20feel%20much%20the%20same.%0A")]);})(smalltalk.send((smalltalk.DocChapter || DocChapter), "_new", []));
|
99
|
+
return self;}
|
100
|
+
}),
|
101
|
+
smalltalk.DocumentationBuilder);
|
102
|
+
|
103
|
+
smalltalk.addMethod(
|
104
|
+
unescape('_ch3GettingStarted'),
|
105
|
+
smalltalk.method({
|
106
|
+
selector: unescape('ch3GettingStarted'),
|
107
|
+
fn: function (){
|
108
|
+
var self=this;
|
109
|
+
return (function($rec){smalltalk.send($rec, "_title_", ["Getting started"]);return smalltalk.send($rec, "_contents_", [unescape("%0ATo%20get%20started%20hacking%20in%20Amber%20you%20can%20basically%20take%20three%20routes%2C%20independent%20of%20your%20platform%3A%0A%0A1.%20Just%20**try%20it%20out%20directly**%20at%20%5Bwww.amber-lang.net%5D%28http%3A//www.amber-lang.net%29%20-%20click%20the%20**Class%20browser**%20button%20there.%20But%20you%20will%20**not%20be%20able%20to%20save%20any%20code%20you%20write**%21%20%0A%20%20%20%20Still%2C%20it%20works%20fine%20for%20looking%20at%20the%20IDE%20and%20playing%20around.%20Just%20**don%27t%20press%20F5/reload**%20-%20it%20will%20lose%20any%20code%20you%20have%20written.%0A2.%20Download%20an%20Amber%20zip-ball%2C%20install%20%5BNodejs%5D%28http%3A//www.nodejs.org%29%2C%20fire%20up%20the%20Amber%20server%20and%20then%20open%20Amber%20from%20localhost%20-%20then%20you%20**can%20save%20code**.%20Detailed%20instructions%20are%20below%21%0A3.%20Same%20as%20above%20but%20install%20git%20first%20and%20get%20a%20proper%20clone%20from%20%5Bhttp%3A//github.com/NicolasPetton/amber%5D%28http%3A//github.com/NicolasPetton/amber%29%20instead%20of%20a%20zip/tar-ball.%20%0A%20%20%20%20If%20you%20want%20to%20**contribute%20to%20Amber%20itself**%20this%20is%20really%20what%20you%20want%20to%20do.%20In%20fact%2C%20in%20most%20cases%20this%20is%20what%20you%20want%20to%20do.%20It%20requires%20installing%20git%20first%2C%20but%20it%20is%20quite%20simple%20-%20although%20we%20leave%20this%20bit%20as%20an%20%22exercise%20to%20the%20reader%22%20%3A%29%0A%0A**PLEASE%20NOTE%3A**%20Amber%20core%20developers%20use%20Linux.%20%0AWe%20do%20not%20want%20to%20introduce%20dependencies%20that%20aren%27t%20cross%20platform%20-%20but%20currently%20amberc%20%28the%20command%20line%20compiler%29%20is%20a%20bash%20script%20and%20we%20also%20use%20Makefiles%20%0A%28for%20building%20Amber%20itself%20and%20server%20side%20examples%29%20written%20on%20Linux/Unix.%20So%20using%20Windows%20is%20currently%20a%20bit%20limited%20-%20you%20can%27t%20run%20%22make%22%20in%20the%20.st%20directory%20to%20rebuild%20whole%20of%20Amber%20for%20example.%0A%20BUT...%20if%20you%20only%20want%20to%20use%20Amber%20to%20build%20web%20client%20apps%20and%20not%20really%20get%20involved%20in%20hacking%20Amber%20itself%20-%20then%20you%20should%20be%20fine%21%0A%0A%23%23%20Downloading%20Amber%0ACurrently%20you%20can%20download%20in%20zip%20or%20tar-ball%20format%2C%20either%20cutting%20edge%20or%20a%20release.%20%5BDownloads%20are%20available%20here%5D%28https%3A//github.com/NicolasPetton/amber/archives/amber%29.%20%0A%0AUnpack%20wherever%20you%20like%2C%20but%20I%20would%20rename%20the%20directory%20that%20is%20unpacked%20to%20something%20slightly%20shorter%20-%20like%20say%20%22amber%22.%20%3A%29%0AAnd%20yes%2C%20at%20this%20point%20you%20can%20double%20click%20the%20index.html%20file%20in%20the%20amber%20directory%20to%20get%20the%20IDE%20up%2C%20but%20again%2C%20**you%20will%20not%20be%20able%20to%20save%20code**.%20So%20please%20continue%20below%20%3A%29%0A%0A%23%23%20Installing%20Node.js%0A%5BNode%5D%28http%3A//www.nodejs.org%29%20%28for%20short%29%20is%20simply%20the%20V8%20Javascript%20VM%20from%20Google%20%28used%20in%20Chrome%29%20hooked%20together%20with%20some%20hard%20core%20C-libraries%20for%20doing%20%22evented%20I/O%22.%0ABasically%20it%27s%20JavaScript%20for%20the%20server%20-%20on%20asynch%20steroids.%20Amber%20runs%20fine%20in%20Node%20and%20we%20use%20it%20for%20several%20Amber%20tools%2C%20like%20amberc%20%28the%20command%20line%20Amber%20compiler%29%20or%20the%20Amber%20server%20%28see%20below%29.%20%0AThere%20are%20also%20several%20Amber-Node%20examples%20to%20look%20at%20if%20you%20want%20to%20play%20with%20running%20Amber%20programs%20server%20side.%20**In%20short%20-%20you%20really%20want%20to%20install%20Nodejs.%20%3A%29**%0A%0A-%20Installing%20Node%20on%20Linux%20can%20be%20done%20using%20your%20package%20tool%20of%20choice%20%28%60apt-get%20install%20nodejs%60%20for%20example%29%20or%20any%20other%20way%20described%20at%20%5Bthe%20download%20page%5D%28http%3A//nodejs.org/%23download%29.%0A-%20Installing%20Node%20on%20MacOS%20or%20Windows%20is%20probably%20done%20best%20by%20using%20the%20%5Binstallers%20available%20at%20Nodejs.org%5D%28http%3A//nodejs.org/%23download%29.%0A%0A%23%23%20Starting%20Amber%20server%0ANicolas%20has%20written%20a%20minimal%20webDAV%20server%20that%20is%20the%20easiest%20way%20to%20get%20up%20and%20running%20Amber%20with%20the%20ability%20to%20save%20code.%20This%20little%20server%20is%20written%20in...%20Amber%21%20%0AAnd%20it%20runs%20on%20top%20of%20Node.%20So%20to%20start%20it%20up%20serving%20your%20brand%20new%20directory%20tree%20of%20sweet%20Amber%20you%20do%3A%0A%0A%09cd%20amber%09%28or%20whatever%20you%20called%20the%20directory%20you%20unpackaged%29%0A%09./bin/server%09%28in%20windows%20you%20type%20%60node%20server%5Cserver.js%60%20instead%29%0A%0AIt%20should%20say%20it%20is%20listening%20on%20port%204000.%20If%20it%20does%2C%20hooray%21%20That%20means%20both%20Node%20and%20Amber%20are%20good.%20In%20Windows%20you%20might%20get%20a%20question%20about%20opening%20that%20port%20in%20the%20local%20firewall%20-%20yep%2C%20do%20it%21%0A%0A%23%23%20Firing%20up%20Amber%0AThe%20Amber%20IDE%20is%20written%20in...%20Amber.%20It%20uses%20%5BjQuery%5D%28http%3A//jquery.com%29%20and%20runs%20right%20in%20your%20browser%20as%20a%20...%20well%2C%20a%20web%20page.%20%0AWe%20could%20open%20it%20up%20just%20using%20a%20file%20url%20-%20but%20the%20reason%20we%20performed%20the%20previous%20steps%20is%20so%20that%20we%20can%20load%20the%20IDE%20web%20page%20from%20a%20server%20that%20can%20handle%20PUTs%20%28webDAV%29%20of%20source%20code.%20%0AAccording%20to%20web%20security%20Amber%20can%20only%20do%20PUT%20back%20to%20the%20same%20server%20it%20was%20loaded%20from.%20Thus%20we%20instead%20want%20to%20open%20it%20%5Bthrough%20our%20little%20server%20now%20listening%20on%20port%204000%5D%28http%3A//localhost%3A4000/index.html%29.%0AClicking%20that%20link%20and%20then%20pressing%20the%20**Class%20browser**%20should%20get%20your%20Amber%20IDE%20running%20with%20the%20ability%20to%20commit%20modified%20packages%20locally.%0A%0ATo%20verify%20that%20you%20can%20indeed%20commit%20now%20-%20just%20select%20a%20Package%20in%20the%20browser%2C%20like%20say%20%22Examples%22%20and%20press%20the%20**Commit**%20button%20below.%20**If%20all%20goes%20well%20nothing%20happens%20%3A%29**.%20%0ASo%20in%20order%20to%20really%20know%20if%20it%20worked%20we%20can%20check%20the%20modified%20date%20on%20the%20files%20**amber/st/Examples.st**%2C%20**amber/js/Examples.js**%20and%20**amber/js/Examples.deploy.js**%20-%20they%20should%20be%20brand%20new.%0A%0ANOTE%3A%20We%20can%20use%20any%20webDAV%20server%20and%20Apache2%20has%20been%20used%20earlier%20and%20works%20fine.%20But%20the%20Amber%20server%20is%20smaller%20and%20simpler%20to%20start.%0A")]);})(smalltalk.send((smalltalk.DocChapter || DocChapter), "_new", []));
|
110
|
+
return self;}
|
111
|
+
}),
|
112
|
+
smalltalk.DocumentationBuilder);
|
113
|
+
|
114
|
+
smalltalk.addMethod(
|
115
|
+
unescape('_ch5Index'),
|
116
|
+
smalltalk.method({
|
117
|
+
selector: unescape('ch5Index'),
|
118
|
+
fn: function (){
|
119
|
+
var self=this;
|
120
|
+
return smalltalk.send((smalltalk.ClassesIndexChapter || ClassesIndexChapter), "_new", []);
|
121
|
+
return self;}
|
122
|
+
}),
|
123
|
+
smalltalk.DocumentationBuilder);
|
124
|
+
|
125
|
+
smalltalk.addMethod(
|
126
|
+
unescape('_ch6KernelObjects'),
|
127
|
+
smalltalk.method({
|
128
|
+
selector: unescape('ch6KernelObjects'),
|
129
|
+
fn: function (){
|
130
|
+
var self=this;
|
131
|
+
return smalltalk.send((smalltalk.PackageDocChapter || PackageDocChapter), "_on_", [smalltalk.send((smalltalk.Package || Package), "_named_", [unescape("Kernel-Objects")])]);
|
132
|
+
return self;}
|
133
|
+
}),
|
134
|
+
smalltalk.DocumentationBuilder);
|
135
|
+
|
136
|
+
smalltalk.addMethod(
|
137
|
+
unescape('_ch7KernelClasses'),
|
138
|
+
smalltalk.method({
|
139
|
+
selector: unescape('ch7KernelClasses'),
|
140
|
+
fn: function (){
|
141
|
+
var self=this;
|
142
|
+
return smalltalk.send((smalltalk.PackageDocChapter || PackageDocChapter), "_on_", [smalltalk.send((smalltalk.Package || Package), "_named_", [unescape("Kernel-Classes")])]);
|
143
|
+
return self;}
|
144
|
+
}),
|
145
|
+
smalltalk.DocumentationBuilder);
|
146
|
+
|
147
|
+
smalltalk.addMethod(
|
148
|
+
unescape('_ch4Tutorials'),
|
149
|
+
smalltalk.method({
|
150
|
+
selector: unescape('ch4Tutorials'),
|
151
|
+
fn: function (){
|
152
|
+
var self=this;
|
153
|
+
return smalltalk.send((smalltalk.TutorialsChapter || TutorialsChapter), "_new", []);
|
154
|
+
return self;}
|
155
|
+
}),
|
156
|
+
smalltalk.DocumentationBuilder);
|
157
|
+
|
158
|
+
smalltalk.addMethod(
|
159
|
+
unescape('_checkHashChange'),
|
160
|
+
smalltalk.method({
|
161
|
+
selector: unescape('checkHashChange'),
|
162
|
+
fn: function (){
|
163
|
+
var self=this;
|
164
|
+
smalltalk.send(smalltalk.send((typeof window == 'undefined' ? nil : window), "_jQuery_", [(typeof window == 'undefined' ? nil : window)]), "_bind_do_", ["hashchange", (function(){return smalltalk.send(self, "_checkHash", []);})]);
|
165
|
+
return self;}
|
166
|
+
}),
|
167
|
+
smalltalk.DocumentationBuilder);
|
168
|
+
|
169
|
+
smalltalk.addMethod(
|
170
|
+
unescape('_checkHash'),
|
171
|
+
smalltalk.method({
|
172
|
+
selector: unescape('checkHash'),
|
173
|
+
fn: function (){
|
174
|
+
var self=this;
|
175
|
+
var hash=nil;
|
176
|
+
var presentation=nil;
|
177
|
+
(hash=smalltalk.send(smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash", []), "_replace_with_", [unescape("%5E%23"), ""]));
|
178
|
+
smalltalk.send(smalltalk.send(self, "_announcer", []), "_announce_", [(function($rec){smalltalk.send($rec, "_id_", [hash]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ChapterSelectionAnnouncement || ChapterSelectionAnnouncement), "_new", []))]);
|
179
|
+
return self;}
|
180
|
+
}),
|
181
|
+
smalltalk.DocumentationBuilder);
|
182
|
+
|
183
|
+
smalltalk.addMethod(
|
184
|
+
unescape('_update'),
|
185
|
+
smalltalk.method({
|
186
|
+
selector: unescape('update'),
|
187
|
+
fn: function (){
|
188
|
+
var self=this;
|
189
|
+
(self['@chapters']=nil);
|
190
|
+
(self['@announcer']=nil);
|
191
|
+
(self['@widget']=nil);
|
192
|
+
smalltalk.send(smalltalk.send((typeof window == 'undefined' ? nil : window), "_jQuery_", [".documentation"]), "_remove", []);
|
193
|
+
smalltalk.send(self, "_build", []);
|
194
|
+
return self;}
|
195
|
+
}),
|
196
|
+
smalltalk.DocumentationBuilder);
|
197
|
+
|
198
|
+
smalltalk.addMethod(
|
199
|
+
unescape('_ch8KernelCollection'),
|
200
|
+
smalltalk.method({
|
201
|
+
selector: unescape('ch8KernelCollection'),
|
202
|
+
fn: function (){
|
203
|
+
var self=this;
|
204
|
+
return smalltalk.send((smalltalk.PackageDocChapter || PackageDocChapter), "_on_", [smalltalk.send((smalltalk.Package || Package), "_named_", [unescape("Kernel-Collections")])]);
|
205
|
+
return self;}
|
206
|
+
}),
|
207
|
+
smalltalk.DocumentationBuilder);
|
208
|
+
|
209
|
+
smalltalk.addMethod(
|
210
|
+
unescape('_ch9KernelMethods'),
|
211
|
+
smalltalk.method({
|
212
|
+
selector: unescape('ch9KernelMethods'),
|
213
|
+
fn: function (){
|
214
|
+
var self=this;
|
215
|
+
return smalltalk.send((smalltalk.PackageDocChapter || PackageDocChapter), "_on_", [smalltalk.send((smalltalk.Package || Package), "_named_", [unescape("Kernel-Methods")])]);
|
216
|
+
return self;}
|
217
|
+
}),
|
218
|
+
smalltalk.DocumentationBuilder);
|
219
|
+
|
220
|
+
|
221
|
+
smalltalk.DocumentationBuilder.klass.iVarNames = ['current'];
|
222
|
+
smalltalk.addMethod(
|
223
|
+
unescape('_current'),
|
224
|
+
smalltalk.method({
|
225
|
+
selector: unescape('current'),
|
226
|
+
fn: function (){
|
227
|
+
var self=this;
|
228
|
+
return (($receiver = self['@current']) == nil || $receiver == undefined) ? (function(){return (self['@current']=smalltalk.send(self, "_new", []));})() : $receiver;
|
229
|
+
return self;}
|
230
|
+
}),
|
231
|
+
smalltalk.DocumentationBuilder.klass);
|
232
|
+
|
233
|
+
smalltalk.addMethod(
|
234
|
+
unescape('_initialize'),
|
235
|
+
smalltalk.method({
|
236
|
+
selector: unescape('initialize'),
|
237
|
+
fn: function (){
|
238
|
+
var self=this;
|
239
|
+
smalltalk.send(smalltalk.send(self, "_current", []), "_build", []);
|
240
|
+
return self;}
|
241
|
+
}),
|
242
|
+
smalltalk.DocumentationBuilder.klass);
|
243
|
+
|
244
|
+
|
245
|
+
smalltalk.addClass('DocChapter', smalltalk.Widget, ['title', 'contents', 'parent'], 'Documentation');
|
246
|
+
smalltalk.addMethod(
|
247
|
+
unescape('_title'),
|
248
|
+
smalltalk.method({
|
249
|
+
selector: unescape('title'),
|
250
|
+
fn: function (){
|
251
|
+
var self=this;
|
252
|
+
return (($receiver = self['@title']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
|
253
|
+
return self;}
|
254
|
+
}),
|
255
|
+
smalltalk.DocChapter);
|
256
|
+
|
257
|
+
smalltalk.addMethod(
|
258
|
+
unescape('_title_'),
|
259
|
+
smalltalk.method({
|
260
|
+
selector: unescape('title%3A'),
|
261
|
+
fn: function (aString){
|
262
|
+
var self=this;
|
263
|
+
(self['@title']=aString);
|
264
|
+
return self;}
|
265
|
+
}),
|
266
|
+
smalltalk.DocChapter);
|
267
|
+
|
268
|
+
smalltalk.addMethod(
|
269
|
+
unescape('_contents'),
|
270
|
+
smalltalk.method({
|
271
|
+
selector: unescape('contents'),
|
272
|
+
fn: function (){
|
273
|
+
var self=this;
|
274
|
+
return (($receiver = self['@contents']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
|
275
|
+
return self;}
|
276
|
+
}),
|
277
|
+
smalltalk.DocChapter);
|
278
|
+
|
279
|
+
smalltalk.addMethod(
|
280
|
+
unescape('_contents_'),
|
281
|
+
smalltalk.method({
|
282
|
+
selector: unescape('contents%3A'),
|
283
|
+
fn: function (aString){
|
284
|
+
var self=this;
|
285
|
+
(self['@contents']=aString);
|
286
|
+
return self;}
|
287
|
+
}),
|
288
|
+
smalltalk.DocChapter);
|
289
|
+
|
290
|
+
smalltalk.addMethod(
|
291
|
+
unescape('_htmlContents'),
|
292
|
+
smalltalk.method({
|
293
|
+
selector: unescape('htmlContents'),
|
294
|
+
fn: function (){
|
295
|
+
var self=this;
|
296
|
+
return smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Showdown || Showdown), "_at_", [smalltalk.symbolFor("converter")]), "_new", []), "_makeHtml_", [smalltalk.send(self, "_contents", [])]);
|
297
|
+
return self;}
|
298
|
+
}),
|
299
|
+
smalltalk.DocChapter);
|
300
|
+
|
301
|
+
smalltalk.addMethod(
|
302
|
+
unescape('_chapters'),
|
303
|
+
smalltalk.method({
|
304
|
+
selector: unescape('chapters'),
|
305
|
+
fn: function (){
|
306
|
+
var self=this;
|
307
|
+
return [];
|
308
|
+
return self;}
|
309
|
+
}),
|
310
|
+
smalltalk.DocChapter);
|
311
|
+
|
312
|
+
smalltalk.addMethod(
|
313
|
+
unescape('_cssClass'),
|
314
|
+
smalltalk.method({
|
315
|
+
selector: unescape('cssClass'),
|
316
|
+
fn: function (){
|
317
|
+
var self=this;
|
318
|
+
return "doc_chapter";
|
319
|
+
return self;}
|
320
|
+
}),
|
321
|
+
smalltalk.DocChapter);
|
322
|
+
|
323
|
+
smalltalk.addMethod(
|
324
|
+
unescape('_level'),
|
325
|
+
smalltalk.method({
|
326
|
+
selector: unescape('level'),
|
327
|
+
fn: function (){
|
328
|
+
var self=this;
|
329
|
+
return (($receiver = smalltalk.send(self, "_parent", [])) == nil || $receiver == undefined) ? (function(){return (1);})() : (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_parent", []), "_level", [])).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)]));})();
|
330
|
+
return self;}
|
331
|
+
}),
|
332
|
+
smalltalk.DocChapter);
|
333
|
+
|
334
|
+
smalltalk.addMethod(
|
335
|
+
unescape('_level_'),
|
336
|
+
smalltalk.method({
|
337
|
+
selector: unescape('level%3A'),
|
338
|
+
fn: function (anInteger){
|
339
|
+
var self=this;
|
340
|
+
(level=anInteger);
|
341
|
+
return self;}
|
342
|
+
}),
|
343
|
+
smalltalk.DocChapter);
|
344
|
+
|
345
|
+
smalltalk.addMethod(
|
346
|
+
unescape('_parent'),
|
347
|
+
smalltalk.method({
|
348
|
+
selector: unescape('parent'),
|
349
|
+
fn: function (){
|
350
|
+
var self=this;
|
351
|
+
return self['@parent'];
|
352
|
+
return self;}
|
353
|
+
}),
|
354
|
+
smalltalk.DocChapter);
|
355
|
+
|
356
|
+
smalltalk.addMethod(
|
357
|
+
unescape('_parent_'),
|
358
|
+
smalltalk.method({
|
359
|
+
selector: unescape('parent%3A'),
|
360
|
+
fn: function (aChapter){
|
361
|
+
var self=this;
|
362
|
+
(self['@parent']=aChapter);
|
363
|
+
return self;}
|
364
|
+
}),
|
365
|
+
smalltalk.DocChapter);
|
366
|
+
|
367
|
+
smalltalk.addMethod(
|
368
|
+
unescape('_id'),
|
369
|
+
smalltalk.method({
|
370
|
+
selector: unescape('id'),
|
371
|
+
fn: function (){
|
372
|
+
var self=this;
|
373
|
+
return smalltalk.send(smalltalk.send(self, "_title", []), "_replace_with_", [" ", unescape("-")]);
|
374
|
+
return self;}
|
375
|
+
}),
|
376
|
+
smalltalk.DocChapter);
|
377
|
+
|
378
|
+
smalltalk.addMethod(
|
379
|
+
unescape('_announcer'),
|
380
|
+
smalltalk.method({
|
381
|
+
selector: unescape('announcer'),
|
382
|
+
fn: function (){
|
383
|
+
var self=this;
|
384
|
+
return smalltalk.send(smalltalk.send((smalltalk.DocumentationBuilder || DocumentationBuilder), "_current", []), "_announcer", []);
|
385
|
+
return self;}
|
386
|
+
}),
|
387
|
+
smalltalk.DocChapter);
|
388
|
+
|
389
|
+
smalltalk.addMethod(
|
390
|
+
unescape('_selectClass_'),
|
391
|
+
smalltalk.method({
|
392
|
+
selector: unescape('selectClass%3A'),
|
393
|
+
fn: function (aClass){
|
394
|
+
var self=this;
|
395
|
+
smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.DocumentationBuilder || DocumentationBuilder), "_current", []), "_announcer", []), "_announce_", [smalltalk.send((smalltalk.ClassSelectionAnnouncement || ClassSelectionAnnouncement), "_on_", [aClass])]);
|
396
|
+
return self;}
|
397
|
+
}),
|
398
|
+
smalltalk.DocChapter);
|
399
|
+
|
400
|
+
smalltalk.addMethod(
|
401
|
+
unescape('_selectChapter_'),
|
402
|
+
smalltalk.method({
|
403
|
+
selector: unescape('selectChapter%3A'),
|
404
|
+
fn: function (aChapter){
|
405
|
+
var self=this;
|
406
|
+
smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", [smalltalk.send(aChapter, "_id", [])]);
|
407
|
+
return self;}
|
408
|
+
}),
|
409
|
+
smalltalk.DocChapter);
|
410
|
+
|
411
|
+
smalltalk.addMethod(
|
412
|
+
unescape('_displayChapter_'),
|
413
|
+
smalltalk.method({
|
414
|
+
selector: unescape('displayChapter%3A'),
|
415
|
+
fn: function (aChapter){
|
416
|
+
var self=this;
|
417
|
+
smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.DocumentationBuilder || DocumentationBuilder), "_current", []), "_widget", []), "_displayChapter_", [aChapter]);
|
418
|
+
return self;}
|
419
|
+
}),
|
420
|
+
smalltalk.DocChapter);
|
421
|
+
|
422
|
+
smalltalk.addMethod(
|
423
|
+
unescape('_initialize'),
|
424
|
+
smalltalk.method({
|
425
|
+
selector: unescape('initialize'),
|
426
|
+
fn: function (){
|
427
|
+
var self=this;
|
428
|
+
smalltalk.send(self, "_initialize", [], smalltalk.Widget);
|
429
|
+
smalltalk.send(self, "_subscribe", []);
|
430
|
+
return self;}
|
431
|
+
}),
|
432
|
+
smalltalk.DocChapter);
|
433
|
+
|
434
|
+
smalltalk.addMethod(
|
435
|
+
unescape('_renderOn_'),
|
436
|
+
smalltalk.method({
|
437
|
+
selector: unescape('renderOn%3A'),
|
438
|
+
fn: function (html){
|
439
|
+
var self=this;
|
440
|
+
(function($rec){smalltalk.send($rec, "_class_", [smalltalk.send(self, "_cssClass", [])]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(self, "_renderDocOn_", [html]);return smalltalk.send(self, "_renderLinksOn_", [html]);})]);})(smalltalk.send(html, "_div", []));
|
441
|
+
return self;}
|
442
|
+
}),
|
443
|
+
smalltalk.DocChapter);
|
444
|
+
|
445
|
+
smalltalk.addMethod(
|
446
|
+
unescape('_renderDocOn_'),
|
447
|
+
smalltalk.method({
|
448
|
+
selector: unescape('renderDocOn%3A'),
|
449
|
+
fn: function (html){
|
450
|
+
var self=this;
|
451
|
+
var div=nil;
|
452
|
+
smalltalk.send(smalltalk.send(html, "_h1", []), "_with_", [smalltalk.send(self, "_title", [])]);
|
453
|
+
smalltalk.send(self, "_renderNavigationOn_", [html]);
|
454
|
+
(div=smalltalk.send(smalltalk.send(html, "_div", []), "_class_", ["contents"]));
|
455
|
+
smalltalk.send(smalltalk.send(div, "_asJQuery", []), "_html_", [smalltalk.send(self, "_htmlContents", [])]);
|
456
|
+
return self;}
|
457
|
+
}),
|
458
|
+
smalltalk.DocChapter);
|
459
|
+
|
460
|
+
smalltalk.addMethod(
|
461
|
+
unescape('_renderNavigationOn_'),
|
462
|
+
smalltalk.method({
|
463
|
+
selector: unescape('renderNavigationOn%3A'),
|
464
|
+
fn: function (html){
|
465
|
+
var self=this;
|
466
|
+
(($receiver = smalltalk.send(self, "_parent", [])) != nil && $receiver != undefined) ? (function(){return (function($rec){smalltalk.send($rec, "_class_", ["navigation"]);return smalltalk.send($rec, "_with_", [(function(){return (function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(unescape("%u2190%20back%20to%20"), "__comma", [smalltalk.send(smalltalk.send(self, "_parent", []), "_title", [])])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectChapter_", [smalltalk.send(self, "_parent", [])]);})]);})(smalltalk.send(html, "_a", []));})]);})(smalltalk.send(html, "_div", []));})() : nil;
|
467
|
+
return self;}
|
468
|
+
}),
|
469
|
+
smalltalk.DocChapter);
|
470
|
+
|
471
|
+
smalltalk.addMethod(
|
472
|
+
unescape('_renderLinksOn_'),
|
473
|
+
smalltalk.method({
|
474
|
+
selector: unescape('renderLinksOn%3A'),
|
475
|
+
fn: function (html){
|
476
|
+
var self=this;
|
477
|
+
(function($rec){smalltalk.send($rec, "_class_", ["links"]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(smalltalk.send(self, "_chapters", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(html, "_li", []), "_with_", [(function(){return (function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(each, "_title", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectChapter_", [each]);})]);})(smalltalk.send(html, "_a", []));})]);})]);})]);})(smalltalk.send(html, "_ul", []));
|
478
|
+
return self;}
|
479
|
+
}),
|
480
|
+
smalltalk.DocChapter);
|
481
|
+
|
482
|
+
smalltalk.addMethod(
|
483
|
+
unescape('_subscribe'),
|
484
|
+
smalltalk.method({
|
485
|
+
selector: unescape('subscribe'),
|
486
|
+
fn: function (){
|
487
|
+
var self=this;
|
488
|
+
smalltalk.send(smalltalk.send(self, "_announcer", []), "_on_do_", [(smalltalk.ChapterSelectionAnnouncement || ChapterSelectionAnnouncement), (function(ann){return ((($receiver = smalltalk.send(smalltalk.send(ann, "_id", []), "__eq", [smalltalk.send(self, "_id", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_displayChapter_", [self]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_displayChapter_", [self]);})]));})]);
|
489
|
+
return self;}
|
490
|
+
}),
|
491
|
+
smalltalk.DocChapter);
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
smalltalk.addClass('PackageDocChapter', smalltalk.DocChapter, ['package', 'chapters'], 'Documentation');
|
496
|
+
smalltalk.addMethod(
|
497
|
+
unescape('_package'),
|
498
|
+
smalltalk.method({
|
499
|
+
selector: unescape('package'),
|
500
|
+
fn: function (){
|
501
|
+
var self=this;
|
502
|
+
return self['@package'];
|
503
|
+
return self;}
|
504
|
+
}),
|
505
|
+
smalltalk.PackageDocChapter);
|
506
|
+
|
507
|
+
smalltalk.addMethod(
|
508
|
+
unescape('_title'),
|
509
|
+
smalltalk.method({
|
510
|
+
selector: unescape('title'),
|
511
|
+
fn: function (){
|
512
|
+
var self=this;
|
513
|
+
return smalltalk.send("Package ", "__comma", [smalltalk.send(smalltalk.send(self, "_package", []), "_name", [])]);
|
514
|
+
return self;}
|
515
|
+
}),
|
516
|
+
smalltalk.PackageDocChapter);
|
517
|
+
|
518
|
+
smalltalk.addMethod(
|
519
|
+
unescape('_chapters'),
|
520
|
+
smalltalk.method({
|
521
|
+
selector: unescape('chapters'),
|
522
|
+
fn: function (){
|
523
|
+
var self=this;
|
524
|
+
return self['@chapters'];
|
525
|
+
return self;}
|
526
|
+
}),
|
527
|
+
smalltalk.PackageDocChapter);
|
528
|
+
|
529
|
+
smalltalk.addMethod(
|
530
|
+
unescape('_contents'),
|
531
|
+
smalltalk.method({
|
532
|
+
selector: unescape('contents'),
|
533
|
+
fn: function (){
|
534
|
+
var self=this;
|
535
|
+
return smalltalk.send(smalltalk.send("Classes in package ", "__comma", [smalltalk.send(smalltalk.send(self, "_package", []), "_name", [])]), "__comma", [":"]);
|
536
|
+
return self;}
|
537
|
+
}),
|
538
|
+
smalltalk.PackageDocChapter);
|
539
|
+
|
540
|
+
smalltalk.addMethod(
|
541
|
+
unescape('_initializeWithPackage_'),
|
542
|
+
smalltalk.method({
|
543
|
+
selector: unescape('initializeWithPackage%3A'),
|
544
|
+
fn: function (aPackage){
|
545
|
+
var self=this;
|
546
|
+
(self['@package']=aPackage);
|
547
|
+
(self['@chapters']=smalltalk.send(smalltalk.send(smalltalk.send(aPackage, "_classes", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_name", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(b, "_name", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(b, "_name", [])]));})]), "_collect_", [(function(each){return (function($rec){smalltalk.send($rec, "_parent_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassDocChapter || ClassDocChapter), "_on_", [each]));})]));
|
548
|
+
return self;}
|
549
|
+
}),
|
550
|
+
smalltalk.PackageDocChapter);
|
551
|
+
|
552
|
+
|
553
|
+
smalltalk.addMethod(
|
554
|
+
unescape('_on_'),
|
555
|
+
smalltalk.method({
|
556
|
+
selector: unescape('on%3A'),
|
557
|
+
fn: function (aPackage){
|
558
|
+
var self=this;
|
559
|
+
return (function($rec){smalltalk.send($rec, "_initializeWithPackage_", [aPackage]);smalltalk.send($rec, "_initialize", []);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_basicNew", []));
|
560
|
+
return self;}
|
561
|
+
}),
|
562
|
+
smalltalk.PackageDocChapter.klass);
|
563
|
+
|
564
|
+
|
565
|
+
smalltalk.addClass('ClassDocChapter', smalltalk.DocChapter, ['theClass'], 'Documentation');
|
566
|
+
smalltalk.addMethod(
|
567
|
+
unescape('_theClass'),
|
568
|
+
smalltalk.method({
|
569
|
+
selector: unescape('theClass'),
|
570
|
+
fn: function (){
|
571
|
+
var self=this;
|
572
|
+
return self['@theClass'];
|
573
|
+
return self;}
|
574
|
+
}),
|
575
|
+
smalltalk.ClassDocChapter);
|
576
|
+
|
577
|
+
smalltalk.addMethod(
|
578
|
+
unescape('_contents'),
|
579
|
+
smalltalk.method({
|
580
|
+
selector: unescape('contents'),
|
581
|
+
fn: function (){
|
582
|
+
var self=this;
|
583
|
+
return ((($receiver = smalltalk.send(smalltalk.send(smalltalk.send(self, "_theClass", []), "_comment", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_theClass", []), "_name", []), "__comma", [" is not documented yet."]);})() : (function(){return smalltalk.send(smalltalk.send(self, "_theClass", []), "_comment", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_theClass", []), "_name", []), "__comma", [" is not documented yet."]);}), (function(){return smalltalk.send(smalltalk.send(self, "_theClass", []), "_comment", []);})]));
|
584
|
+
return self;}
|
585
|
+
}),
|
586
|
+
smalltalk.ClassDocChapter);
|
587
|
+
|
588
|
+
smalltalk.addMethod(
|
589
|
+
unescape('_cssClass'),
|
590
|
+
smalltalk.method({
|
591
|
+
selector: unescape('cssClass'),
|
592
|
+
fn: function (){
|
593
|
+
var self=this;
|
594
|
+
return smalltalk.send("doc_class ", "__comma", [smalltalk.send(self, "_cssClass", [], smalltalk.DocChapter)]);
|
595
|
+
return self;}
|
596
|
+
}),
|
597
|
+
smalltalk.ClassDocChapter);
|
598
|
+
|
599
|
+
smalltalk.addMethod(
|
600
|
+
unescape('_title'),
|
601
|
+
smalltalk.method({
|
602
|
+
selector: unescape('title'),
|
603
|
+
fn: function (){
|
604
|
+
var self=this;
|
605
|
+
return smalltalk.send(smalltalk.send(self, "_theClass", []), "_name", []);
|
606
|
+
return self;}
|
607
|
+
}),
|
608
|
+
smalltalk.ClassDocChapter);
|
609
|
+
|
610
|
+
smalltalk.addMethod(
|
611
|
+
unescape('_initializeWithClass_'),
|
612
|
+
smalltalk.method({
|
613
|
+
selector: unescape('initializeWithClass%3A'),
|
614
|
+
fn: function (aClass){
|
615
|
+
var self=this;
|
616
|
+
(self['@theClass']=aClass);
|
617
|
+
return self;}
|
618
|
+
}),
|
619
|
+
smalltalk.ClassDocChapter);
|
620
|
+
|
621
|
+
smalltalk.addMethod(
|
622
|
+
unescape('_renderLinksOn_'),
|
623
|
+
smalltalk.method({
|
624
|
+
selector: unescape('renderLinksOn%3A'),
|
625
|
+
fn: function (html){
|
626
|
+
var self=this;
|
627
|
+
(function($rec){smalltalk.send($rec, "_class_", ["links"]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(smalltalk.send(html, "_li", []), "_with_", [(function(){return (function($rec){smalltalk.send($rec, "_with_", ["Browse this class"]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send((smalltalk.Browser || Browser), "_openOn_", [smalltalk.send(self, "_theClass", [])]);})]);})(smalltalk.send(html, "_a", []));})]);})]);})(smalltalk.send(html, "_ul", []));
|
628
|
+
return self;}
|
629
|
+
}),
|
630
|
+
smalltalk.ClassDocChapter);
|
631
|
+
|
632
|
+
smalltalk.addMethod(
|
633
|
+
unescape('_subscribe'),
|
634
|
+
smalltalk.method({
|
635
|
+
selector: unescape('subscribe'),
|
636
|
+
fn: function (){
|
637
|
+
var self=this;
|
638
|
+
smalltalk.send(self, "_subscribe", [], smalltalk.DocChapter);
|
639
|
+
smalltalk.send(smalltalk.send(self, "_announcer", []), "_on_do_", [(smalltalk.ClassSelectionAnnouncement || ClassSelectionAnnouncement), (function(ann){return ((($receiver = smalltalk.send(smalltalk.send(ann, "_theClass", []), "__eq", [smalltalk.send(self, "_theClass", [])])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(self, "_selectChapter_", [self]);})() : nil) : smalltalk.send($receiver, "_ifTrue_", [(function(){return smalltalk.send(self, "_selectChapter_", [self]);})]));})]);
|
640
|
+
return self;}
|
641
|
+
}),
|
642
|
+
smalltalk.ClassDocChapter);
|
643
|
+
|
644
|
+
|
645
|
+
smalltalk.addMethod(
|
646
|
+
unescape('_on_'),
|
647
|
+
smalltalk.method({
|
648
|
+
selector: unescape('on%3A'),
|
649
|
+
fn: function (aClass){
|
650
|
+
var self=this;
|
651
|
+
return (function($rec){smalltalk.send($rec, "_initializeWithClass_", [aClass]);smalltalk.send($rec, "_initialize", []);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_basicNew", []));
|
652
|
+
return self;}
|
653
|
+
}),
|
654
|
+
smalltalk.ClassDocChapter.klass);
|
655
|
+
|
656
|
+
|
657
|
+
smalltalk.addClass('DocumentationWidget', smalltalk.Widget, ['builder', 'selectedChapter', 'chapterDiv'], 'Documentation');
|
658
|
+
smalltalk.addMethod(
|
659
|
+
unescape('_builder'),
|
660
|
+
smalltalk.method({
|
661
|
+
selector: unescape('builder'),
|
662
|
+
fn: function (){
|
663
|
+
var self=this;
|
664
|
+
return self['@builder'];
|
665
|
+
return self;}
|
666
|
+
}),
|
667
|
+
smalltalk.DocumentationWidget);
|
668
|
+
|
669
|
+
smalltalk.addMethod(
|
670
|
+
unescape('_builder_'),
|
671
|
+
smalltalk.method({
|
672
|
+
selector: unescape('builder%3A'),
|
673
|
+
fn: function (aDocumentationBuilder){
|
674
|
+
var self=this;
|
675
|
+
(self['@builder']=aDocumentationBuilder);
|
676
|
+
return self;}
|
677
|
+
}),
|
678
|
+
smalltalk.DocumentationWidget);
|
679
|
+
|
680
|
+
smalltalk.addMethod(
|
681
|
+
unescape('_chapters'),
|
682
|
+
smalltalk.method({
|
683
|
+
selector: unescape('chapters'),
|
684
|
+
fn: function (){
|
685
|
+
var self=this;
|
686
|
+
return smalltalk.send(smalltalk.send(self, "_builder", []), "_chapters", []);
|
687
|
+
return self;}
|
688
|
+
}),
|
689
|
+
smalltalk.DocumentationWidget);
|
690
|
+
|
691
|
+
smalltalk.addMethod(
|
692
|
+
unescape('_selectedChapter'),
|
693
|
+
smalltalk.method({
|
694
|
+
selector: unescape('selectedChapter'),
|
695
|
+
fn: function (){
|
696
|
+
var self=this;
|
697
|
+
return (($receiver = self['@selectedChapter']) == nil || $receiver == undefined) ? (function(){return (self['@selectedChapter']=smalltalk.send(smalltalk.send(self, "_chapters", []), "_first", []));})() : $receiver;
|
698
|
+
return self;}
|
699
|
+
}),
|
700
|
+
smalltalk.DocumentationWidget);
|
701
|
+
|
702
|
+
smalltalk.addMethod(
|
703
|
+
unescape('_selectedChapter_'),
|
704
|
+
smalltalk.method({
|
705
|
+
selector: unescape('selectedChapter%3A'),
|
706
|
+
fn: function (aChapter){
|
707
|
+
var self=this;
|
708
|
+
return (self['@selectedChapter']=aChapter);
|
709
|
+
return self;}
|
710
|
+
}),
|
711
|
+
smalltalk.DocumentationWidget);
|
712
|
+
|
713
|
+
smalltalk.addMethod(
|
714
|
+
unescape('_displayChapter_'),
|
715
|
+
smalltalk.method({
|
716
|
+
selector: unescape('displayChapter%3A'),
|
717
|
+
fn: function (aChapter){
|
718
|
+
var self=this;
|
719
|
+
smalltalk.send(self, "_selectedChapter_", [aChapter]);
|
720
|
+
smalltalk.send(self, "_updateChapterDiv", []);
|
721
|
+
return self;}
|
722
|
+
}),
|
723
|
+
smalltalk.DocumentationWidget);
|
724
|
+
|
725
|
+
smalltalk.addMethod(
|
726
|
+
unescape('_selectChapter_'),
|
727
|
+
smalltalk.method({
|
728
|
+
selector: unescape('selectChapter%3A'),
|
729
|
+
fn: function (aChapter){
|
730
|
+
var self=this;
|
731
|
+
smalltalk.send(smalltalk.send((typeof document == 'undefined' ? nil : document), "_location", []), "_hash_", [smalltalk.send(aChapter, "_id", [])]);
|
732
|
+
return self;}
|
733
|
+
}),
|
734
|
+
smalltalk.DocumentationWidget);
|
735
|
+
|
736
|
+
smalltalk.addMethod(
|
737
|
+
unescape('_renderOn_'),
|
738
|
+
smalltalk.method({
|
739
|
+
selector: unescape('renderOn%3A'),
|
740
|
+
fn: function (html){
|
741
|
+
var self=this;
|
742
|
+
(function($rec){smalltalk.send($rec, "_class_", ["documentation"]);return smalltalk.send($rec, "_with_", [(function(){smalltalk.send(self, "_renderMenuOn_", [html]);(self['@chapterDiv']=smalltalk.send(html, "_div", []));return smalltalk.send(self, "_updateChapterDiv", []);})]);})(smalltalk.send(html, "_div", []));
|
743
|
+
return self;}
|
744
|
+
}),
|
745
|
+
smalltalk.DocumentationWidget);
|
746
|
+
|
747
|
+
smalltalk.addMethod(
|
748
|
+
unescape('_renderMenuOn_'),
|
749
|
+
smalltalk.method({
|
750
|
+
selector: unescape('renderMenuOn%3A'),
|
751
|
+
fn: function (html){
|
752
|
+
var self=this;
|
753
|
+
(function($rec){smalltalk.send($rec, "_class_", ["menu"]);return smalltalk.send($rec, "_with_", [(function(){return smalltalk.send(smalltalk.send(html, "_ol", []), "_with_", [(function(){return smalltalk.send(smalltalk.send(self, "_chapters", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(html, "_li", []), "_with_", [(function(){return smalltalk.send(self, "_renderChapterMenu_on_", [each, html]);})]);})]);})]);})]);})(smalltalk.send(html, "_div", []));
|
754
|
+
return self;}
|
755
|
+
}),
|
756
|
+
smalltalk.DocumentationWidget);
|
757
|
+
|
758
|
+
smalltalk.addMethod(
|
759
|
+
unescape('_renderChapterMenu_on_'),
|
760
|
+
smalltalk.method({
|
761
|
+
selector: unescape('renderChapterMenu%3Aon%3A'),
|
762
|
+
fn: function (aChapter, html){
|
763
|
+
var self=this;
|
764
|
+
(function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(aChapter, "_title", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectChapter_", [aChapter]);})]);})(smalltalk.send(html, "_a", []));
|
765
|
+
smalltalk.send(smalltalk.send(html, "_ol", []), "_with_", [(function(){return smalltalk.send(smalltalk.send(aChapter, "_chapters", []), "_do_", [(function(each){return smalltalk.send(smalltalk.send(html, "_li", []), "_with_", [(function(){return smalltalk.send(self, "_renderChapterMenu_on_", [each, html]);})]);})]);})]);
|
766
|
+
return self;}
|
767
|
+
}),
|
768
|
+
smalltalk.DocumentationWidget);
|
769
|
+
|
770
|
+
smalltalk.addMethod(
|
771
|
+
unescape('_updateChapterDiv'),
|
772
|
+
smalltalk.method({
|
773
|
+
selector: unescape('updateChapterDiv'),
|
774
|
+
fn: function (){
|
775
|
+
var self=this;
|
776
|
+
smalltalk.send(self['@chapterDiv'], "_contents_", [(function(html){return smalltalk.send(html, "_with_", [smalltalk.send(self, "_selectedChapter", [])]);})]);
|
777
|
+
return self;}
|
778
|
+
}),
|
779
|
+
smalltalk.DocumentationWidget);
|
780
|
+
|
781
|
+
|
782
|
+
smalltalk.addMethod(
|
783
|
+
unescape('_on_'),
|
784
|
+
smalltalk.method({
|
785
|
+
selector: unescape('on%3A'),
|
786
|
+
fn: function (aBuilder){
|
787
|
+
var self=this;
|
788
|
+
return (function($rec){smalltalk.send($rec, "_builder_", [aBuilder]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
789
|
+
return self;}
|
790
|
+
}),
|
791
|
+
smalltalk.DocumentationWidget.klass);
|
792
|
+
|
793
|
+
|
794
|
+
smalltalk.addClass('ClassesIndexChapter', smalltalk.DocChapter, [], 'Documentation');
|
795
|
+
smalltalk.addMethod(
|
796
|
+
unescape('_cssClass'),
|
797
|
+
smalltalk.method({
|
798
|
+
selector: unescape('cssClass'),
|
799
|
+
fn: function (){
|
800
|
+
var self=this;
|
801
|
+
return smalltalk.send("index_doc ", "__comma", [smalltalk.send(self, "_cssClass", [], smalltalk.DocChapter)]);
|
802
|
+
return self;}
|
803
|
+
}),
|
804
|
+
smalltalk.ClassesIndexChapter);
|
805
|
+
|
806
|
+
smalltalk.addMethod(
|
807
|
+
unescape('_title'),
|
808
|
+
smalltalk.method({
|
809
|
+
selector: unescape('title'),
|
810
|
+
fn: function (){
|
811
|
+
var self=this;
|
812
|
+
return "Smalltalk classes by index";
|
813
|
+
return self;}
|
814
|
+
}),
|
815
|
+
smalltalk.ClassesIndexChapter);
|
816
|
+
|
817
|
+
smalltalk.addMethod(
|
818
|
+
unescape('_alphabet'),
|
819
|
+
smalltalk.method({
|
820
|
+
selector: unescape('alphabet'),
|
821
|
+
fn: function (){
|
822
|
+
var self=this;
|
823
|
+
return "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
824
|
+
return self;}
|
825
|
+
}),
|
826
|
+
smalltalk.ClassesIndexChapter);
|
827
|
+
|
828
|
+
smalltalk.addMethod(
|
829
|
+
unescape('_renderDocOn_'),
|
830
|
+
smalltalk.method({
|
831
|
+
selector: unescape('renderDocOn%3A'),
|
832
|
+
fn: function (html){
|
833
|
+
var self=this;
|
834
|
+
smalltalk.send(smalltalk.send(html, "_h1", []), "_with_", [smalltalk.send(self, "_title", [])]);
|
835
|
+
smalltalk.send(smalltalk.send(self, "_alphabet", []), "_do_", [(function(letter){var classes=nil;
|
836
|
+
(classes=smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_select_", [(function(each){return smalltalk.send(smalltalk.send(smalltalk.send(each, "_name", []), "_first", []), "__eq", [letter]);})]));smalltalk.send(classes, "_ifNotEmpty_", [(function(){return smalltalk.send(smalltalk.send(html, "_h2", []), "_with_", [letter]);})]);return smalltalk.send(smalltalk.send(html, "_ul", []), "_with_", [(function(){return smalltalk.send(smalltalk.send(classes, "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(a, "_name", [])).klass === smalltalk.Number) ? $receiver <smalltalk.send(b, "_name", []) : smalltalk.send($receiver, "__lt", [smalltalk.send(b, "_name", [])]));})]), "_do_", [(function(each){return smalltalk.send(smalltalk.send(html, "_li", []), "_with_", [(function(){return (function($rec){smalltalk.send($rec, "_with_", [smalltalk.send(each, "_name", [])]);return smalltalk.send($rec, "_onClick_", [(function(){return smalltalk.send(self, "_selectClass_", [each]);})]);})(smalltalk.send(html, "_a", []));})]);})]);})]);})]);
|
837
|
+
return self;}
|
838
|
+
}),
|
839
|
+
smalltalk.ClassesIndexChapter);
|
840
|
+
|
841
|
+
|
842
|
+
|
843
|
+
smalltalk.addClass('ClassSelectionAnnouncement', smalltalk.Object, ['theClass'], 'Documentation');
|
844
|
+
smalltalk.addMethod(
|
845
|
+
unescape('_theClass'),
|
846
|
+
smalltalk.method({
|
847
|
+
selector: unescape('theClass'),
|
848
|
+
fn: function (){
|
849
|
+
var self=this;
|
850
|
+
return self['@theClass'];
|
851
|
+
return self;}
|
852
|
+
}),
|
853
|
+
smalltalk.ClassSelectionAnnouncement);
|
854
|
+
|
855
|
+
smalltalk.addMethod(
|
856
|
+
unescape('_theClass_'),
|
857
|
+
smalltalk.method({
|
858
|
+
selector: unescape('theClass%3A'),
|
859
|
+
fn: function (aClass){
|
860
|
+
var self=this;
|
861
|
+
(self['@theClass']=aClass);
|
862
|
+
return self;}
|
863
|
+
}),
|
864
|
+
smalltalk.ClassSelectionAnnouncement);
|
865
|
+
|
866
|
+
|
867
|
+
smalltalk.addMethod(
|
868
|
+
unescape('_on_'),
|
869
|
+
smalltalk.method({
|
870
|
+
selector: unescape('on%3A'),
|
871
|
+
fn: function (aClass){
|
872
|
+
var self=this;
|
873
|
+
return (function($rec){smalltalk.send($rec, "_theClass_", [aClass]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
|
874
|
+
return self;}
|
875
|
+
}),
|
876
|
+
smalltalk.ClassSelectionAnnouncement.klass);
|
877
|
+
|
878
|
+
|
879
|
+
smalltalk.addClass('ChapterSelectionAnnouncement', smalltalk.Object, ['id'], 'Documentation');
|
880
|
+
smalltalk.addMethod(
|
881
|
+
unescape('_id'),
|
882
|
+
smalltalk.method({
|
883
|
+
selector: unescape('id'),
|
884
|
+
fn: function (){
|
885
|
+
var self=this;
|
886
|
+
return self['@id'];
|
887
|
+
return self;}
|
888
|
+
}),
|
889
|
+
smalltalk.ChapterSelectionAnnouncement);
|
890
|
+
|
891
|
+
smalltalk.addMethod(
|
892
|
+
unescape('_id_'),
|
893
|
+
smalltalk.method({
|
894
|
+
selector: unescape('id%3A'),
|
895
|
+
fn: function (aString){
|
896
|
+
var self=this;
|
897
|
+
(self['@id']=aString);
|
898
|
+
return self;}
|
899
|
+
}),
|
900
|
+
smalltalk.ChapterSelectionAnnouncement);
|
901
|
+
|
902
|
+
|
903
|
+
|
904
|
+
smalltalk.addClass('TutorialsChapter', smalltalk.DocChapter, [], 'Documentation');
|
905
|
+
smalltalk.addMethod(
|
906
|
+
unescape('_title'),
|
907
|
+
smalltalk.method({
|
908
|
+
selector: unescape('title'),
|
909
|
+
fn: function (){
|
910
|
+
var self=this;
|
911
|
+
return "Tutorials";
|
912
|
+
return self;}
|
913
|
+
}),
|
914
|
+
smalltalk.TutorialsChapter);
|
915
|
+
|
916
|
+
smalltalk.addMethod(
|
917
|
+
unescape('_contents'),
|
918
|
+
smalltalk.method({
|
919
|
+
selector: unescape('contents'),
|
920
|
+
fn: function (){
|
921
|
+
var self=this;
|
922
|
+
return unescape("Here%27s%20a%20serie%20of%20tutorials.%20If%20you%20are%20new%20to%20Smalltalk%2C%20you%20can%20also%20learn%20Amber%20online%20with%20%5BProfStef%5D%28http%3A//www.amber-lang.net/learn.html%29");
|
923
|
+
return self;}
|
924
|
+
}),
|
925
|
+
smalltalk.TutorialsChapter);
|
926
|
+
|
927
|
+
smalltalk.addMethod(
|
928
|
+
unescape('_chapters'),
|
929
|
+
smalltalk.method({
|
930
|
+
selector: unescape('chapters'),
|
931
|
+
fn: function (){
|
932
|
+
var self=this;
|
933
|
+
return [smalltalk.send(self, "_firstAppChapter", []),smalltalk.send(self, "_counterChapter", [])];
|
934
|
+
return self;}
|
935
|
+
}),
|
936
|
+
smalltalk.TutorialsChapter);
|
937
|
+
|
938
|
+
smalltalk.addMethod(
|
939
|
+
unescape('_firstAppChapter'),
|
940
|
+
smalltalk.method({
|
941
|
+
selector: unescape('firstAppChapter'),
|
942
|
+
fn: function (){
|
943
|
+
var self=this;
|
944
|
+
return (function($rec){smalltalk.send($rec, "_title_", ["A first application"]);return smalltalk.send($rec, "_contents_", [unescape("%0A%0ALet%27s%20make%20Hello%20World%20in%20Amber.%0A%0AFirst%2C%20you%20need%20a%20place%20for%20your%20new%20project.%20I%20made%20a%20new%20directory%20under%20amber%3A%0A%0A%20%20%20%20amber/projects/hello%0A%0AThis%20will%20store%20your%20project%20files.%20To%20get%20started%2C%20add%20a%20new%20index.html%20file%20to%20this%20folder%2C%20as%20well%20as%20empty%20js%20and%20st%20folders.%0A%0AYour%20index.html%20can%20be%20really%20basic.%20The%20most%20important%20thing%20it%20does%20is%20include%20amber.js%20and%20run%20loadAmber.%20Here%20is%20a%20basic%20index.html%20you%20can%20use%3A%0A%0A%0A%20%20%20%20%3C%21DOCTYPE%20html%3E%0A%20%20%20%20%3Chtml%3E%0A%20%20%20%20%20%20%3Chead%3E%0A%20%20%20%20%20%20%20%20%3Ctitle%3EMy%20First%20Amber%20Project%3C/title%3E%0A%20%20%20%20%20%20%20%20%3Cscript%20src%3D%22../../js/amber.js%22%20type%3D%22text/javascript%22%3E%3C/script%3E%0A%20%20%20%20%20%20%20%20%3Cscript%20type%3D%22text/javascript%22%3E%0A%20%20%20%20%20%20%20%20%20%20loadAmber%28%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20files%3A%20%5B%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20prefix%3A%20%27projects/hello/js%27%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20ready%3A%20function%28%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%7D%29%3B%20%0A%20%20%20%20%20%20%20%20%3C/script%3E%0A%20%20%20%20%20%20%3C/head%3E%0A%20%20%20%20%20%20%3Cbody%3E%0A%20%20%20%20%20%20%20%20%3Carticle%3E%0A%20%20%20%20%20%20%20%20%20%20%3Ch1%3EMy%20First%20Amber%20Project%3C/h1%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cbutton%20onclick%3D%22smalltalk.Browser._open%28%29%22%3Eclass%20browser%3C/button%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cbutton%20id%3D%22sayHello%22%3Esay%20hello%3C/button%3E%0A%20%20%20%20%20%20%20%20%3C/article%3E%0A%20%20%20%20%20%20%3C/body%3E%0A%20%20%20%20%3C/html%3E%0A%0ANow%20start%20up%20amber%20with%20node.js%20and%20navigate%20to%20%20http%3A//localhost%3A4000/projects/hello/index.html%0A%0AIt%27s%20boring%20so%20far%2C%20so%20lets%20write%20some%20code.%20Click%20the%20button%20to%20open%20the%20class%20browser.%20Find%20an%20existing%20class%20and%20change%20its%20name%20to%20Hello%20and%20its%20package%20to%20HelloApp.%20%0AThen%20click%20save.%20This%20creates%20a%20new%20class%20and%20leaves%20the%20old%20one%20intact%2C%20it%20doesn%27t%20overwrite%20it.%20Your%20class%20will%20look%20like%20this%3A%0A%0A%20%20%20%20Object%20subclass%3A%20%23Hello%0A%20%20%20%20%20%20%20%20instanceVariableNames%3A%20%27%27%0A%20%20%20%20%20%20%20%20package%3A%20%27HelloApp%27%0A%0ANow%20click%20save%20and%20navigate%20to%20your%20new%20class%20in%20its%20new%20package.%0A%20Then%20click%20%27commit%20package%27.%20You%20just%20created%20a%20new%20class%20and%20saved%20your%20work.%20%0AOn%20your%20file%20system%20check%20out%20your%20js%20and%20st%20folders.%20Your%20new%20class%20is%20now%20saved%20in%20both%20JavaScript%20and%20Smalltalk.%0A%0ANow%2C%20refresh%20your%20browser%20page%20and%20reopen%20the%20class%20browser.%20Oh%20no%2C%20your%20new%20class%20is%20gone%21%20To%20load%20your%20new%20class%20automatically%2C%20you%20have%20to%20add%20it%20in%20index.html.%20Make%20your%20JavaScript%20look%20like%20this%3A%0A%0A%0A%20%20%20%20loadAmber%28%7B%0A%20%20%20%20%20%20%20%20files%3A%20%5B%27HelloApp.js%27%5D%2C%0A%20%20%20%20%20%20%20%20prefix%3A%20%27projects/hello/js%27%2C%0A%20%20%20%20%20%20%20%20ready%3A%20function%28%29%20%7B%20%20%20%20%20%20%0A%20%20%20%20%7D%7D%29%3B%20%0A%0ASave%20and%20refresh%20again.%20Now%20your%20class%20is%20loaded%20and%20shows%20up%20in%20the%20class%20browser.%0A%0ANow%2C%20let%27s%20make%20this%20class%20do%20something.%20Create%20a%20new%20message%20in%20the%20class%20browser%20by%20navigating%20to%20your%20class%2C%20then%20clicking%20%27not%20yet%20classified%27%20and%20fill%20in%20a%20simple%20message.%20Try%20this%20for%20example%3A%0A%0A%20%20%20%20begin%0A%09%22Makes%20me%20say%20hello%20to%20the%20user.%22%0A%0A%09%7C%20msg%20button%20%7C%0A%09msg%20%3A%3D%20%27Hello%20world%21%27.%0A%09button%20%3A%3D%20%27%23sayHello%27%20asJQuery.%0A%09button%20click%3A%20%5Bbutton%20after%3A%20%27%3Cp%3E%27%20%2C%20msg%20%2C%20%27%3C/p%3E%27%5D.%0A%0AYour%20message%20isn%27t%20too%20helpful%20if%20it%20doesn%27t%20get%20called.%20Save%20it%2C%20commit%20the%20package%2C%20then%20edit%20index.html%20again.%20You%20can%20write%20JavaScript%20code%20that%20sends%20a%20message%20to%20Smalltalk%3A%0A%0A%20%20%20%20loadAmber%28%7B%0A%20%20%20%20%20%20%20%20files%3A%20%5B%27HelloApp.js%27%5D%2C%0A%20%20%20%20%20%20%20%20prefix%3A%20%27projects/hello/js%27%2C%20//%20path%20for%20js%20files%20i%20think%0A%20%20%20%20%20%20%20%20ready%3A%20function%28%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%24%28function%28%29%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20smalltalk.Hello._new%28%29._begin%28%29%3B%0A%20%20%20%20%20%20%20%20%20%20%7D%29%3B%0A%20%20%20%20%7D%7D%29%3B%20%0A%0AFrom%20there%2C%20you%20can%20create%20new%20Smalltalk%20classes%20and%20messages%20to%20build%20up%20your%20app.%20Enjoy%21%0A")]);})(smalltalk.send((smalltalk.DocChapter || DocChapter), "_new", []));
|
945
|
+
return self;}
|
946
|
+
}),
|
947
|
+
smalltalk.TutorialsChapter);
|
948
|
+
|
949
|
+
smalltalk.addMethod(
|
950
|
+
unescape('_counterChapter'),
|
951
|
+
smalltalk.method({
|
952
|
+
selector: unescape('counterChapter'),
|
953
|
+
fn: function (){
|
954
|
+
var self=this;
|
955
|
+
return (function($rec){smalltalk.send($rec, "_title_", ["The counter application"]);return smalltalk.send($rec, "_contents_", [unescape("%0A%0AThis%20tutorial%20will%20teach%20you%20how%20to%20build%20HTML%20with%20Amber%20using%20jQuery%20and%20the%20HTMLCanvas%20API.%20It%20is%20freely%20adapted%20from%20%0Athe%20%5BSeaside%20counter%20example%5D%28http%3A//www.seaside.st/about/examples/counter%29%0A%0A%23%23The%20counter%20widget%0A%0AThe%20counter%20is%20the%20most%20basic%20example%20of%20a%20widget.%20It%20allows%20to%20increment%20and%20decrement%20a%20number%20by%20clicking%20a%20button.%0A%0AAmber%20already%20comes%20with%20a%20counter%20example%20in%20the%20%60Examples%60%20package.%20To%20avoid%20class%20name%20conflict%2C%20we%27ll%20name%20our%20counter%20class%20%60TCounter%60.%0A%0A%20%20%20%20Widget%20subclass%3A%20%23TCounter%0A%20%20%20%20%20%20%20%20instanceVariableNames%3A%20%27count%20header%27%0A%20%20%20%20%20%20%20%20package%3A%20%27Tutorials%27%0A%0AThe%20first%20method%20is%20used%20to%20initialize%20the%20component%20with%20the%20default%20state%2C%20in%20this%20case%20we%20set%20the%20counter%20to%200%3A%0A%0A%20%20%20%20initialize%0A%20%20%20%20%20%20%20%20super%20initialize.%0A%20%20%20%20%20%20%20%20count%20%3A%3D%200%0A%0AThe%20method%20used%20for%20rendering%20a%20widget%20is%20%60%23renderOn%3A%60.%20It%20takes%20an%20instance%20of%20HTMLCanvas%20as%20parameter.%20%0AThe%20%60header%60%20h1%20kept%20as%20an%20instance%20variable%2C%20so%20when%20the%20count%20value%20change%2C%20we%20can%20update%20it%27s%20contents%20accordingly.%0A%0A%20%20%20%20renderOn%3A%20html%0A%20%20%20%20%20%20%20%20header%20%3A%3D%20html%20h1%20%0A%20%20%20%20%20%20%20%20%20%20%20%20with%3A%20count%20asString%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20yourself.%0A%20%20%20%20%20%20%20%20html%20button%0A%20%20%20%20%20%20%20%20%20%20%20%20with%3A%20%27++%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20onClick%3A%20%5Bself%20increase%5D.%0A%20%20%20%20%20%20%20%20html%20button%0A%20%20%20%20%20%20%20%20%20%20%20%20with%3A%20%27--%27%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20onClick%3A%20%5Bself%20decrease%5D%0A%0AThe%20counter%20is%20almost%20ready.%20All%20we%20need%20now%20is%20to%20implement%20the%20two%20action%20methods%20%60%23increase%60%20and%20%60%23decrease%60%20to%20change%20the%20state%20%0Aof%20our%20counter%20and%20update%20its%20header.%0A%0A%20%20%20%20increase%0A%20%20%20%20%20%20%20%20count%20%3A%3D%20count%20+%201.%0A%20%20%20%20%20%20%20%20header%20contents%3A%20%5B%3Ahtml%20%7C%20html%20with%3A%20count%20asString%5D%0A%0A%20%20%20%20decrease%0A%20%20%20%20%20%20%20%20count%20%3A%3D%20count%20-%201.%0A%20%20%20%20%20%20%20%20header%20contents%3A%20%5B%3Ahtml%20%7C%20html%20with%3A%20count%20asString%5D%0A%0A%0AThat%27s%20it%21%20We%20can%20now%20display%20an%20instance%20of%20TCounter%20by%20rendering%20it%20on%20the%20page%20using%20jQuery%3A%0A%0A%20%20%20%20TCounter%20new%20appendToJQuery%3A%20%27body%27%20asJQuery%0A%0A")]);})(smalltalk.send((smalltalk.DocChapter || DocChapter), "_new", []));
|
956
|
+
return self;}
|
957
|
+
}),
|
958
|
+
smalltalk.TutorialsChapter);
|
959
|
+
|
960
|
+
|
961
|
+
|