2
0

Helios-Transcript.deploy.js 6.1 KB

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