Helios-Transcript.deploy.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. _st(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. _st(_st(self["@textarea"])._asJQuery())._append_(_st(aString)._asString());
  59. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},smalltalk.HLTranscript)})},
  60. messageSends: ["append:", "asString", "asJQuery"]}),
  61. smalltalk.HLTranscript);
  62. smalltalk.addMethod(
  63. smalltalk.method({
  64. selector: "unregister",
  65. fn: function (){
  66. var self=this;
  67. function $HLTranscriptHandler(){return smalltalk.HLTranscriptHandler||(typeof HLTranscriptHandler=="undefined"?nil:HLTranscriptHandler)}
  68. return smalltalk.withContext(function($ctx1) {
  69. smalltalk.HLWidget.fn.prototype._unregister.apply(_st(self), []);
  70. _st($HLTranscriptHandler())._unregister_(self);
  71. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLTranscript)})},
  72. messageSends: ["unregister", "unregister:"]}),
  73. smalltalk.HLTranscript);
  74. smalltalk.addClass('HLTranscriptHandler', smalltalk.Object, [], 'Helios-Transcript');
  75. smalltalk.HLTranscriptHandler.klass.iVarNames = ['transcripts'];
  76. smalltalk.addMethod(
  77. smalltalk.method({
  78. selector: "clear",
  79. fn: function (){
  80. var self=this;
  81. return smalltalk.withContext(function($ctx1) {
  82. _st(_st(self)._transcripts())._do_((function(each){
  83. return smalltalk.withContext(function($ctx2) {
  84. return _st(each)._clear();
  85. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  86. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLTranscriptHandler.klass)})},
  87. messageSends: ["do:", "clear", "transcripts"]}),
  88. smalltalk.HLTranscriptHandler.klass);
  89. smalltalk.addMethod(
  90. smalltalk.method({
  91. selector: "initialize",
  92. fn: function (){
  93. var self=this;
  94. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  95. return smalltalk.withContext(function($ctx1) {
  96. _st($Transcript())._register_(self);
  97. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLTranscriptHandler.klass)})},
  98. messageSends: ["register:"]}),
  99. smalltalk.HLTranscriptHandler.klass);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "register:",
  103. fn: function (aTranscript){
  104. var self=this;
  105. return smalltalk.withContext(function($ctx1) {
  106. _st(_st(self)._transcripts())._add_(aTranscript);
  107. return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript},smalltalk.HLTranscriptHandler.klass)})},
  108. messageSends: ["add:", "transcripts"]}),
  109. smalltalk.HLTranscriptHandler.klass);
  110. smalltalk.addMethod(
  111. smalltalk.method({
  112. selector: "show:",
  113. fn: function (aString){
  114. var self=this;
  115. return smalltalk.withContext(function($ctx1) {
  116. _st(_st(self)._transcripts())._do_((function(each){
  117. return smalltalk.withContext(function($ctx2) {
  118. return _st(each)._show_(aString);
  119. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  120. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},smalltalk.HLTranscriptHandler.klass)})},
  121. messageSends: ["do:", "show:", "transcripts"]}),
  122. smalltalk.HLTranscriptHandler.klass);
  123. smalltalk.addMethod(
  124. smalltalk.method({
  125. selector: "transcripts",
  126. fn: function (){
  127. var self=this;
  128. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  129. return smalltalk.withContext(function($ctx1) {
  130. var $2,$1;
  131. $2=self["@transcripts"];
  132. if(($receiver = $2) == nil || $receiver == undefined){
  133. self["@transcripts"]=_st($OrderedCollection())._new();
  134. $1=self["@transcripts"];
  135. } else {
  136. $1=$2;
  137. };
  138. return $1;
  139. }, function($ctx1) {$ctx1.fill(self,"transcripts",{},smalltalk.HLTranscriptHandler.klass)})},
  140. messageSends: ["ifNil:", "new"]}),
  141. smalltalk.HLTranscriptHandler.klass);
  142. smalltalk.addMethod(
  143. smalltalk.method({
  144. selector: "unregister:",
  145. fn: function (aTranscript){
  146. var self=this;
  147. return smalltalk.withContext(function($ctx1) {
  148. _st(_st(self)._transcripts())._remove_(aTranscript);
  149. return self}, function($ctx1) {$ctx1.fill(self,"unregister:",{aTranscript:aTranscript},smalltalk.HLTranscriptHandler.klass)})},
  150. messageSends: ["remove:", "transcripts"]}),
  151. smalltalk.HLTranscriptHandler.klass);