2
0

Helios-Transcript.deploy.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. define("amber_core/Helios-Transcript", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Helios-Core", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Helios-Transcript');
  3. smalltalk.packages["Helios-Transcript"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, ['textarea'], 'Helios-Transcript');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "clear",
  8. fn: function (){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) {
  11. _st(_st(self["@textarea"])._asJQuery())._text_("");
  12. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLTranscript)})},
  13. messageSends: ["text:", "asJQuery"]}),
  14. smalltalk.HLTranscript);
  15. smalltalk.addMethod(
  16. smalltalk.method({
  17. selector: "initialize",
  18. fn: function (){
  19. var self=this;
  20. return smalltalk.withContext(function($ctx1) {
  21. smalltalk.HLTranscript.superclass.fn.prototype._initialize.apply(_st(self), []);
  22. self._register();
  23. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLTranscript)})},
  24. messageSends: ["initialize", "register"]}),
  25. smalltalk.HLTranscript);
  26. smalltalk.addMethod(
  27. smalltalk.method({
  28. selector: "register",
  29. fn: function (){
  30. var self=this;
  31. function $HLTranscriptHandler(){return smalltalk.HLTranscriptHandler||(typeof HLTranscriptHandler=="undefined"?nil:HLTranscriptHandler)}
  32. return smalltalk.withContext(function($ctx1) {
  33. _st($HLTranscriptHandler())._register_(self);
  34. return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.HLTranscript)})},
  35. messageSends: ["register:"]}),
  36. smalltalk.HLTranscript);
  37. smalltalk.addMethod(
  38. smalltalk.method({
  39. selector: "renderOn:",
  40. fn: function (html){
  41. var self=this;
  42. return smalltalk.withContext(function($ctx1) {
  43. var $1,$2;
  44. $1=_st(html)._div();
  45. _st($1)._class_("transcript");
  46. $2=_st($1)._with_((function(){
  47. return smalltalk.withContext(function($ctx2) {
  48. self["@textarea"]=_st(html)._textarea();
  49. return self["@textarea"];
  50. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  51. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTranscript)})},
  52. messageSends: ["class:", "div", "with:", "textarea"]}),
  53. smalltalk.HLTranscript);
  54. smalltalk.addMethod(
  55. smalltalk.method({
  56. selector: "show:",
  57. fn: function (aString){
  58. var self=this;
  59. return smalltalk.withContext(function($ctx1) {
  60. var $1;
  61. $1=self["@textarea"];
  62. if(($receiver = $1) == nil || $receiver == undefined){
  63. $1;
  64. } else {
  65. _st(_st(self["@textarea"])._asJQuery())._append_(_st(aString)._asString());
  66. };
  67. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},smalltalk.HLTranscript)})},
  68. messageSends: ["ifNotNil:", "append:", "asString", "asJQuery"]}),
  69. smalltalk.HLTranscript);
  70. smalltalk.addMethod(
  71. smalltalk.method({
  72. selector: "unregister",
  73. fn: function (){
  74. var self=this;
  75. function $HLTranscriptHandler(){return smalltalk.HLTranscriptHandler||(typeof HLTranscriptHandler=="undefined"?nil:HLTranscriptHandler)}
  76. return smalltalk.withContext(function($ctx1) {
  77. smalltalk.HLTranscript.superclass.fn.prototype._unregister.apply(_st(self), []);
  78. _st($HLTranscriptHandler())._unregister_(self);
  79. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLTranscript)})},
  80. messageSends: ["unregister", "unregister:"]}),
  81. smalltalk.HLTranscript);
  82. smalltalk.addClass('HLTranscriptHandler', smalltalk.Object, [], 'Helios-Transcript');
  83. smalltalk.HLTranscriptHandler.klass.iVarNames = ['transcripts'];
  84. smalltalk.addMethod(
  85. smalltalk.method({
  86. selector: "clear",
  87. fn: function (){
  88. var self=this;
  89. return smalltalk.withContext(function($ctx1) {
  90. _st(self._transcripts())._do_((function(each){
  91. return smalltalk.withContext(function($ctx2) {
  92. return _st(each)._clear();
  93. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  94. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLTranscriptHandler.klass)})},
  95. messageSends: ["do:", "clear", "transcripts"]}),
  96. smalltalk.HLTranscriptHandler.klass);
  97. smalltalk.addMethod(
  98. smalltalk.method({
  99. selector: "initialize",
  100. fn: function (){
  101. var self=this;
  102. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  103. return smalltalk.withContext(function($ctx1) {
  104. _st($Transcript())._register_(self);
  105. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLTranscriptHandler.klass)})},
  106. messageSends: ["register:"]}),
  107. smalltalk.HLTranscriptHandler.klass);
  108. smalltalk.addMethod(
  109. smalltalk.method({
  110. selector: "register:",
  111. fn: function (aTranscript){
  112. var self=this;
  113. return smalltalk.withContext(function($ctx1) {
  114. _st(self._transcripts())._add_(aTranscript);
  115. return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript},smalltalk.HLTranscriptHandler.klass)})},
  116. messageSends: ["add:", "transcripts"]}),
  117. smalltalk.HLTranscriptHandler.klass);
  118. smalltalk.addMethod(
  119. smalltalk.method({
  120. selector: "show:",
  121. fn: function (aString){
  122. var self=this;
  123. return smalltalk.withContext(function($ctx1) {
  124. _st(self._transcripts())._do_((function(each){
  125. return smalltalk.withContext(function($ctx2) {
  126. return _st(each)._show_(aString);
  127. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  128. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},smalltalk.HLTranscriptHandler.klass)})},
  129. messageSends: ["do:", "show:", "transcripts"]}),
  130. smalltalk.HLTranscriptHandler.klass);
  131. smalltalk.addMethod(
  132. smalltalk.method({
  133. selector: "transcripts",
  134. fn: function (){
  135. var self=this;
  136. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  137. return smalltalk.withContext(function($ctx1) {
  138. var $2,$1;
  139. $2=self["@transcripts"];
  140. if(($receiver = $2) == nil || $receiver == undefined){
  141. self["@transcripts"]=_st($OrderedCollection())._new();
  142. $1=self["@transcripts"];
  143. } else {
  144. $1=$2;
  145. };
  146. return $1;
  147. }, function($ctx1) {$ctx1.fill(self,"transcripts",{},smalltalk.HLTranscriptHandler.klass)})},
  148. messageSends: ["ifNil:", "new"]}),
  149. smalltalk.HLTranscriptHandler.klass);
  150. smalltalk.addMethod(
  151. smalltalk.method({
  152. selector: "unregister:",
  153. fn: function (aTranscript){
  154. var self=this;
  155. return smalltalk.withContext(function($ctx1) {
  156. _st(self._transcripts())._remove_(aTranscript);
  157. return self}, function($ctx1) {$ctx1.fill(self,"unregister:",{aTranscript:aTranscript},smalltalk.HLTranscriptHandler.klass)})},
  158. messageSends: ["remove:", "transcripts"]}),
  159. smalltalk.HLTranscriptHandler.klass);
  160. });