1
0

Helios-Transcript.deploy.js 6.0 KB

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