Moka-Announcements.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. define("amber_core/Moka-Announcements", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
  2. smalltalk.addPackage('Moka-Announcements');
  3. smalltalk.packages["Moka-Announcements"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('MKAnnouncement', globals.Object, [], 'Moka-Announcements');
  5. globals.MKAnnouncement.comment="I am the root class of all announcements sent in Moka.";
  6. smalltalk.addClass('MKAspectChanged', globals.MKAnnouncement, ['aspect'], 'Moka-Announcements');
  7. globals.MKAspectChanged.comment="I am announced whenever an `aspect` is changed.\x0a\x0a## API\x0a\x0aCreate instances using the class-side method `#aspect:`";
  8. smalltalk.addMethod(
  9. smalltalk.method({
  10. selector: "aspect",
  11. protocol: 'accessing',
  12. fn: function (){
  13. var self=this;
  14. var $1;
  15. $1=self["@aspect"];
  16. return $1;
  17. },
  18. args: [],
  19. source: "aspect\x0a\x09^ aspect",
  20. messageSends: [],
  21. referencedClasses: []
  22. }),
  23. globals.MKAspectChanged);
  24. smalltalk.addMethod(
  25. smalltalk.method({
  26. selector: "aspect:",
  27. protocol: 'accessing',
  28. fn: function (aSelector){
  29. var self=this;
  30. self["@aspect"]=aSelector;
  31. return self},
  32. args: ["aSelector"],
  33. source: "aspect: aSelector\x0a\x09aspect := aSelector",
  34. messageSends: [],
  35. referencedClasses: []
  36. }),
  37. globals.MKAspectChanged);
  38. smalltalk.addMethod(
  39. smalltalk.method({
  40. selector: "aspect:",
  41. protocol: 'instance creation',
  42. fn: function (aSelector){
  43. var self=this;
  44. return smalltalk.withContext(function($ctx1) {
  45. var $2,$3,$1;
  46. $2=self._new();
  47. _st($2)._aspect_(aSelector);
  48. $3=_st($2)._yourself();
  49. $1=$3;
  50. return $1;
  51. }, function($ctx1) {$ctx1.fill(self,"aspect:",{aSelector:aSelector},globals.MKAspectChanged.klass)})},
  52. args: ["aSelector"],
  53. source: "aspect: aSelector\x0a\x09^ self new\x0a\x09\x09aspect: aSelector;\x0a\x09\x09yourself",
  54. messageSends: ["aspect:", "new", "yourself"],
  55. referencedClasses: []
  56. }),
  57. globals.MKAspectChanged.klass);
  58. smalltalk.addClass('MKViewAnnouncement', globals.MKAnnouncement, ['view'], 'Moka-Announcements');
  59. globals.MKViewAnnouncement.comment="I am the root class of all viewn announcements. I hold a `view` object.\x0a\x0a## API\x0a\x0aCreate instance with the class-side method `#view:`";
  60. smalltalk.addMethod(
  61. smalltalk.method({
  62. selector: "view",
  63. protocol: 'accessing',
  64. fn: function (){
  65. var self=this;
  66. var $1;
  67. $1=self["@view"];
  68. return $1;
  69. },
  70. args: [],
  71. source: "view\x0a\x09^ view",
  72. messageSends: [],
  73. referencedClasses: []
  74. }),
  75. globals.MKViewAnnouncement);
  76. smalltalk.addMethod(
  77. smalltalk.method({
  78. selector: "view:",
  79. protocol: 'accessing',
  80. fn: function (aView){
  81. var self=this;
  82. self["@view"]=aView;
  83. return self},
  84. args: ["aView"],
  85. source: "view: aView\x0a\x09view := aView",
  86. messageSends: [],
  87. referencedClasses: []
  88. }),
  89. globals.MKViewAnnouncement);
  90. smalltalk.addMethod(
  91. smalltalk.method({
  92. selector: "view:",
  93. protocol: 'instance creation',
  94. fn: function (aView){
  95. var self=this;
  96. return smalltalk.withContext(function($ctx1) {
  97. var $2,$3,$1;
  98. $2=self._new();
  99. _st($2)._view_(aView);
  100. $3=_st($2)._yourself();
  101. $1=$3;
  102. return $1;
  103. }, function($ctx1) {$ctx1.fill(self,"view:",{aView:aView},globals.MKViewAnnouncement.klass)})},
  104. args: ["aView"],
  105. source: "view: aView\x0a\x09^ self new\x0a\x09\x09view: aView;\x0a\x09\x09yourself",
  106. messageSends: ["view:", "new", "yourself"],
  107. referencedClasses: []
  108. }),
  109. globals.MKViewAnnouncement.klass);
  110. smalltalk.addClass('MKViewRemoved', globals.MKViewAnnouncement, [], 'Moka-Announcements');
  111. globals.MKViewRemoved.comment="I am announced when a view gets removed from the DOM.";
  112. smalltalk.addClass('MKViewScroll', globals.MKViewAnnouncement, [], 'Moka-Announcements');
  113. globals.MKViewScroll.comment="I am often used in conjunction with `MKScrollDecorator`.\x0a\x0aI am announced when a view's scroll changed programatically";
  114. });