Moka-Views.js 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333
  1. define("amber_core/Moka-Views", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Moka-Core"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Moka-Views');
  3. smalltalk.packages["Moka-Views"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('MKButtonView', smalltalk.MKSingleAspectView, ['default', 'label'], 'Moka-Views');
  5. smalltalk.MKButtonView.comment="I am a push button view. My default controller is `MKButtonController`.\x0a\x0aMy controller must answer to `#onPressed`.\x0a\x0a## API\x0a\x0a- Instances can be set a `default` button\x0a- Use `#label:` to set the label string";
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "cssClass",
  9. category: 'accessing',
  10. fn: function (){
  11. var self=this;
  12. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  13. return smalltalk.withContext(function($ctx1) {
  14. var $2,$3,$1;
  15. $1=_st($String())._streamContents_((function(stream){
  16. return smalltalk.withContext(function($ctx2) {
  17. $2=_st(stream).__lt_lt(smalltalk.MKButtonView.superclass.fn.prototype._cssClass.apply(_st(self), []));
  18. $ctx2.sendIdx["<<"]=2;
  19. _st($2).__lt_lt(" mk_button");
  20. $ctx2.sendIdx["<<"]=1;
  21. $3=self._isDefault();
  22. if(smalltalk.assert($3)){
  23. return _st(stream).__lt_lt(" default");
  24. };
  25. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})}));
  26. return $1;
  27. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKButtonView)})},
  28. args: [],
  29. source: "cssClass\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream << super cssClass << ' mk_button'.\x0a\x09\x09self isDefault \x0a\x09\x09\x09ifTrue: [ stream << ' default' ] ]",
  30. messageSends: ["streamContents:", "<<", "cssClass", "ifTrue:", "isDefault"],
  31. referencedClasses: ["String"]
  32. }),
  33. smalltalk.MKButtonView);
  34. smalltalk.addMethod(
  35. smalltalk.method({
  36. selector: "default",
  37. category: 'accessing',
  38. fn: function (){
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) {
  41. var $1;
  42. $1=self["@default"];
  43. return $1;
  44. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.MKButtonView)})},
  45. args: [],
  46. source: "default\x0a\x09^ default",
  47. messageSends: [],
  48. referencedClasses: []
  49. }),
  50. smalltalk.MKButtonView);
  51. smalltalk.addMethod(
  52. smalltalk.method({
  53. selector: "default:",
  54. category: 'accessing',
  55. fn: function (aBoolean){
  56. var self=this;
  57. return smalltalk.withContext(function($ctx1) {
  58. self["@default"]=aBoolean;
  59. return self}, function($ctx1) {$ctx1.fill(self,"default:",{aBoolean:aBoolean},smalltalk.MKButtonView)})},
  60. args: ["aBoolean"],
  61. source: "default: aBoolean\x0a\x09default := aBoolean",
  62. messageSends: [],
  63. referencedClasses: []
  64. }),
  65. smalltalk.MKButtonView);
  66. smalltalk.addMethod(
  67. smalltalk.method({
  68. selector: "defaultControllerClass",
  69. category: 'defaults',
  70. fn: function (){
  71. var self=this;
  72. function $MKButtonController(){return smalltalk.MKButtonController||(typeof MKButtonController=="undefined"?nil:MKButtonController)}
  73. return smalltalk.withContext(function($ctx1) {
  74. return $MKButtonController();
  75. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKButtonView)})},
  76. args: [],
  77. source: "defaultControllerClass\x0a\x09^ MKButtonController",
  78. messageSends: [],
  79. referencedClasses: ["MKButtonController"]
  80. }),
  81. smalltalk.MKButtonView);
  82. smalltalk.addMethod(
  83. smalltalk.method({
  84. selector: "defaultLabel",
  85. category: 'defaults',
  86. fn: function (){
  87. var self=this;
  88. return smalltalk.withContext(function($ctx1) {
  89. return "OK";
  90. }, function($ctx1) {$ctx1.fill(self,"defaultLabel",{},smalltalk.MKButtonView)})},
  91. args: [],
  92. source: "defaultLabel\x0a\x09^ 'OK'",
  93. messageSends: [],
  94. referencedClasses: []
  95. }),
  96. smalltalk.MKButtonView);
  97. smalltalk.addMethod(
  98. smalltalk.method({
  99. selector: "defaultLayout",
  100. category: 'defaults',
  101. fn: function (){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) {
  104. var $2,$3,$1;
  105. $2=smalltalk.MKButtonView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  106. _st($2)._width_((80));
  107. _st($2)._height_((24));
  108. $3=_st($2)._yourself();
  109. $1=$3;
  110. return $1;
  111. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKButtonView)})},
  112. args: [],
  113. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 80;\x0a\x09\x09height: 24;\x0a\x09\x09yourself",
  114. messageSends: ["width:", "defaultLayout", "height:", "yourself"],
  115. referencedClasses: []
  116. }),
  117. smalltalk.MKButtonView);
  118. smalltalk.addMethod(
  119. smalltalk.method({
  120. selector: "isDefault",
  121. category: 'testing',
  122. fn: function (){
  123. var self=this;
  124. return smalltalk.withContext(function($ctx1) {
  125. var $2,$1;
  126. $2=self._default();
  127. if(($receiver = $2) == nil || $receiver == null){
  128. $1=false;
  129. } else {
  130. $1=$2;
  131. };
  132. return $1;
  133. }, function($ctx1) {$ctx1.fill(self,"isDefault",{},smalltalk.MKButtonView)})},
  134. args: [],
  135. source: "isDefault\x0a\x09^ self default ifNil: [ false ]",
  136. messageSends: ["ifNil:", "default"],
  137. referencedClasses: []
  138. }),
  139. smalltalk.MKButtonView);
  140. smalltalk.addMethod(
  141. smalltalk.method({
  142. selector: "label",
  143. category: 'accessing',
  144. fn: function (){
  145. var self=this;
  146. return smalltalk.withContext(function($ctx1) {
  147. var $2,$1;
  148. $2=self["@label"];
  149. if(($receiver = $2) == nil || $receiver == null){
  150. $1=self._defaultLabel();
  151. } else {
  152. $1=$2;
  153. };
  154. return $1;
  155. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.MKButtonView)})},
  156. args: [],
  157. source: "label\x0a\x09^ label ifNil: [ self defaultLabel ]",
  158. messageSends: ["ifNil:", "defaultLabel"],
  159. referencedClasses: []
  160. }),
  161. smalltalk.MKButtonView);
  162. smalltalk.addMethod(
  163. smalltalk.method({
  164. selector: "label:",
  165. category: 'accessing',
  166. fn: function (aString){
  167. var self=this;
  168. return smalltalk.withContext(function($ctx1) {
  169. self["@label"]=aString;
  170. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.MKButtonView)})},
  171. args: ["aString"],
  172. source: "label: aString\x0a\x09label := aString",
  173. messageSends: [],
  174. referencedClasses: []
  175. }),
  176. smalltalk.MKButtonView);
  177. smalltalk.addMethod(
  178. smalltalk.method({
  179. selector: "renderContentOn:",
  180. category: 'rendering',
  181. fn: function (html){
  182. var self=this;
  183. return smalltalk.withContext(function($ctx1) {
  184. _st(html)._with_(self._label());
  185. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKButtonView)})},
  186. args: ["html"],
  187. source: "renderContentOn: html\x0a\x09html with: self label",
  188. messageSends: ["with:", "label"],
  189. referencedClasses: []
  190. }),
  191. smalltalk.MKButtonView);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "tag",
  195. category: 'accessing',
  196. fn: function (){
  197. var self=this;
  198. return smalltalk.withContext(function($ctx1) {
  199. return "button";
  200. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKButtonView)})},
  201. args: [],
  202. source: "tag\x0a\x09^ 'button'",
  203. messageSends: [],
  204. referencedClasses: []
  205. }),
  206. smalltalk.MKButtonView);
  207. smalltalk.addClass('MKCheckboxView', smalltalk.MKSingleAspectView, ['id'], 'Moka-Views');
  208. smalltalk.MKCheckboxView.comment="I am a checkbox view. My default controller is `MKCheckboxController`.\x0a\x0aMy controller must answer to `#onToggled:`.\x0a\x0a##API\x0a\x0a- If no `aspect` is provided, the ckeckbox state will always be off.\x0a- use `#label:` to set the label string.";
  209. smalltalk.addMethod(
  210. smalltalk.method({
  211. selector: "checked",
  212. category: 'accessing',
  213. fn: function (){
  214. var self=this;
  215. return smalltalk.withContext(function($ctx1) {
  216. var $2,$1;
  217. $2=self._aspectValue();
  218. if(($receiver = $2) == nil || $receiver == null){
  219. $1=false;
  220. } else {
  221. $1=$2;
  222. };
  223. return $1;
  224. }, function($ctx1) {$ctx1.fill(self,"checked",{},smalltalk.MKCheckboxView)})},
  225. args: [],
  226. source: "checked\x0a\x09^ self aspectValue ifNil: [ false ]",
  227. messageSends: ["ifNil:", "aspectValue"],
  228. referencedClasses: []
  229. }),
  230. smalltalk.MKCheckboxView);
  231. smalltalk.addMethod(
  232. smalltalk.method({
  233. selector: "cssClass",
  234. category: 'accessing',
  235. fn: function (){
  236. var self=this;
  237. return smalltalk.withContext(function($ctx1) {
  238. var $1;
  239. $1=_st(smalltalk.MKCheckboxView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_checkbox");
  240. return $1;
  241. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKCheckboxView)})},
  242. args: [],
  243. source: "cssClass\x0a\x09^ super cssClass, ' mk_checkbox'",
  244. messageSends: [",", "cssClass"],
  245. referencedClasses: []
  246. }),
  247. smalltalk.MKCheckboxView);
  248. smalltalk.addMethod(
  249. smalltalk.method({
  250. selector: "defaultControllerClass",
  251. category: 'defaults',
  252. fn: function (){
  253. var self=this;
  254. function $MKCheckboxController(){return smalltalk.MKCheckboxController||(typeof MKCheckboxController=="undefined"?nil:MKCheckboxController)}
  255. return smalltalk.withContext(function($ctx1) {
  256. return $MKCheckboxController();
  257. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKCheckboxView)})},
  258. args: [],
  259. source: "defaultControllerClass\x0a\x09^ MKCheckboxController",
  260. messageSends: [],
  261. referencedClasses: ["MKCheckboxController"]
  262. }),
  263. smalltalk.MKCheckboxView);
  264. smalltalk.addMethod(
  265. smalltalk.method({
  266. selector: "defaultLayout",
  267. category: 'defaults',
  268. fn: function (){
  269. var self=this;
  270. return smalltalk.withContext(function($ctx1) {
  271. var $2,$3,$1;
  272. $2=smalltalk.MKCheckboxView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  273. _st($2)._width_((16));
  274. _st($2)._height_((16));
  275. $3=_st($2)._yourself();
  276. $1=$3;
  277. return $1;
  278. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKCheckboxView)})},
  279. args: [],
  280. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 16;\x0a\x09\x09height: 16;\x0a\x09\x09yourself",
  281. messageSends: ["width:", "defaultLayout", "height:", "yourself"],
  282. referencedClasses: []
  283. }),
  284. smalltalk.MKCheckboxView);
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "id",
  288. category: 'accessing',
  289. fn: function (){
  290. var self=this;
  291. return smalltalk.withContext(function($ctx1) {
  292. var $2,$1;
  293. $2=self["@id"];
  294. if(($receiver = $2) == nil || $receiver == null){
  295. self["@id"]=_st((1000000)._atRandom())._asString();
  296. $1=self["@id"];
  297. } else {
  298. $1=$2;
  299. };
  300. return $1;
  301. }, function($ctx1) {$ctx1.fill(self,"id",{},smalltalk.MKCheckboxView)})},
  302. args: [],
  303. source: "id\x0a\x09^ id ifNil: [ id := 1000000 atRandom asString ]",
  304. messageSends: ["ifNil:", "asString", "atRandom"],
  305. referencedClasses: []
  306. }),
  307. smalltalk.MKCheckboxView);
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "renderContentOn:",
  311. category: 'rendering',
  312. fn: function (html){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) {
  315. var $1;
  316. $1=self._checked();
  317. if(smalltalk.assert($1)){
  318. _st(_st(self["@root"])._asJQuery())._addClass_("checked");
  319. };
  320. _st(self["@root"])._at_put_("tabindex","0");
  321. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKCheckboxView)})},
  322. args: ["html"],
  323. source: "renderContentOn: html\x09\x0a\x09self checked ifTrue: [ \x0a\x09\x09root asJQuery addClass: 'checked' ].\x0a\x09\x0a\x09root at: 'tabindex' put: '0'",
  324. messageSends: ["ifTrue:", "checked", "addClass:", "asJQuery", "at:put:"],
  325. referencedClasses: []
  326. }),
  327. smalltalk.MKCheckboxView);
  328. smalltalk.addMethod(
  329. smalltalk.method({
  330. selector: "update",
  331. category: 'events',
  332. fn: function (){
  333. var self=this;
  334. return smalltalk.withContext(function($ctx1) {
  335. var $1,$2;
  336. $1=self._checked();
  337. if(smalltalk.assert($1)){
  338. $2=_st(self["@root"])._asJQuery();
  339. $ctx1.sendIdx["asJQuery"]=1;
  340. _st($2)._addClass_("checked");
  341. } else {
  342. _st(_st(self["@root"])._asJQuery())._removeClass_("checked");
  343. };
  344. return self}, function($ctx1) {$ctx1.fill(self,"update",{},smalltalk.MKCheckboxView)})},
  345. args: [],
  346. source: "update\x0a\x09self checked\x0a\x09\x09ifTrue: [ root asJQuery addClass: 'checked' ]\x0a\x09\x09ifFalse: [ root asJQuery removeClass: 'checked' ]",
  347. messageSends: ["ifTrue:ifFalse:", "checked", "addClass:", "asJQuery", "removeClass:"],
  348. referencedClasses: []
  349. }),
  350. smalltalk.MKCheckboxView);
  351. smalltalk.addClass('MKSwitchView', smalltalk.MKCheckboxView, [], 'Moka-Views');
  352. smalltalk.MKSwitchView.comment="I am a switch view, similar to a `MKCheckboxView` but displayed as a switch. \x0aMy default controller is `MKCheckboxController`.";
  353. smalltalk.addMethod(
  354. smalltalk.method({
  355. selector: "checkboxCssClass",
  356. category: 'accessing',
  357. fn: function (){
  358. var self=this;
  359. return smalltalk.withContext(function($ctx1) {
  360. return "mk_switch";
  361. }, function($ctx1) {$ctx1.fill(self,"checkboxCssClass",{},smalltalk.MKSwitchView)})},
  362. args: [],
  363. source: "checkboxCssClass\x0a\x09^ 'mk_switch'",
  364. messageSends: [],
  365. referencedClasses: []
  366. }),
  367. smalltalk.MKSwitchView);
  368. smalltalk.addMethod(
  369. smalltalk.method({
  370. selector: "cssClass",
  371. category: 'accessing',
  372. fn: function (){
  373. var self=this;
  374. return smalltalk.withContext(function($ctx1) {
  375. var $1;
  376. $1=_st(smalltalk.MKSwitchView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_switch");
  377. return $1;
  378. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKSwitchView)})},
  379. args: [],
  380. source: "cssClass\x0a\x09^ super cssClass, ' mk_switch'",
  381. messageSends: [",", "cssClass"],
  382. referencedClasses: []
  383. }),
  384. smalltalk.MKSwitchView);
  385. smalltalk.addMethod(
  386. smalltalk.method({
  387. selector: "defaultLayout",
  388. category: 'defaults',
  389. fn: function (){
  390. var self=this;
  391. return smalltalk.withContext(function($ctx1) {
  392. var $2,$3,$1;
  393. $2=smalltalk.MKSwitchView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  394. _st($2)._width_((48));
  395. _st($2)._height_((20));
  396. $3=_st($2)._yourself();
  397. $1=$3;
  398. return $1;
  399. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKSwitchView)})},
  400. args: [],
  401. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 48;\x0a\x09\x09height: 20;\x0a\x09\x09yourself",
  402. messageSends: ["width:", "defaultLayout", "height:", "yourself"],
  403. referencedClasses: []
  404. }),
  405. smalltalk.MKSwitchView);
  406. smalltalk.addClass('MKContainerView', smalltalk.MKView, ['childView'], 'Moka-Views');
  407. smalltalk.MKContainerView.comment="I display my single `childView`. \x0a\x0aI am used to switch between views.";
  408. smalltalk.addMethod(
  409. smalltalk.method({
  410. selector: "childView",
  411. category: 'accessing',
  412. fn: function (){
  413. var self=this;
  414. return smalltalk.withContext(function($ctx1) {
  415. var $1;
  416. $1=self["@childView"];
  417. return $1;
  418. }, function($ctx1) {$ctx1.fill(self,"childView",{},smalltalk.MKContainerView)})},
  419. args: [],
  420. source: "childView\x0a\x09^ childView",
  421. messageSends: [],
  422. referencedClasses: []
  423. }),
  424. smalltalk.MKContainerView);
  425. smalltalk.addMethod(
  426. smalltalk.method({
  427. selector: "childView:",
  428. category: 'accessing',
  429. fn: function (aView){
  430. var self=this;
  431. return smalltalk.withContext(function($ctx1) {
  432. self["@childView"]=aView;
  433. self._update();
  434. return self}, function($ctx1) {$ctx1.fill(self,"childView:",{aView:aView},smalltalk.MKContainerView)})},
  435. args: ["aView"],
  436. source: "childView: aView\x0a\x09childView := aView.\x0a\x09self update",
  437. messageSends: ["update"],
  438. referencedClasses: []
  439. }),
  440. smalltalk.MKContainerView);
  441. smalltalk.addMethod(
  442. smalltalk.method({
  443. selector: "renderContentOn:",
  444. category: 'rendering',
  445. fn: function (html){
  446. var self=this;
  447. return smalltalk.withContext(function($ctx1) {
  448. _st(html)._with_(self._childView());
  449. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKContainerView)})},
  450. args: ["html"],
  451. source: "renderContentOn: html\x0a\x09html with: self childView",
  452. messageSends: ["with:", "childView"],
  453. referencedClasses: []
  454. }),
  455. smalltalk.MKContainerView);
  456. smalltalk.addMethod(
  457. smalltalk.method({
  458. selector: "childView:",
  459. category: 'instance creation',
  460. fn: function (aView){
  461. var self=this;
  462. return smalltalk.withContext(function($ctx1) {
  463. var $2,$3,$1;
  464. $2=self._new();
  465. _st($2)._childView_(aView);
  466. $3=_st($2)._yourself();
  467. $1=$3;
  468. return $1;
  469. }, function($ctx1) {$ctx1.fill(self,"childView:",{aView:aView},smalltalk.MKContainerView.klass)})},
  470. args: ["aView"],
  471. source: "childView: aView\x0a\x09^ self new \x0a\x09\x09childView: aView;\x0a\x09\x09yourself",
  472. messageSends: ["childView:", "new", "yourself"],
  473. referencedClasses: []
  474. }),
  475. smalltalk.MKContainerView.klass);
  476. smalltalk.addClass('MKLabelView', smalltalk.MKSingleAspectView, [], 'Moka-Views');
  477. smalltalk.MKLabelView.comment="I am an label view. I display a `String`.";
  478. smalltalk.addMethod(
  479. smalltalk.method({
  480. selector: "cssClass",
  481. category: 'accessing',
  482. fn: function (){
  483. var self=this;
  484. return smalltalk.withContext(function($ctx1) {
  485. var $1;
  486. $1=_st(smalltalk.MKLabelView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_label");
  487. return $1;
  488. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKLabelView)})},
  489. args: [],
  490. source: "cssClass\x0a\x09^ super cssClass, ' mk_label'",
  491. messageSends: [",", "cssClass"],
  492. referencedClasses: []
  493. }),
  494. smalltalk.MKLabelView);
  495. smalltalk.addMethod(
  496. smalltalk.method({
  497. selector: "defaultControllerClass",
  498. category: 'defaults',
  499. fn: function (){
  500. var self=this;
  501. return smalltalk.withContext(function($ctx1) {
  502. var $1;
  503. $1=smalltalk.MKLabelView.superclass.fn.prototype._defaultControllerClass.apply(_st(self), []);
  504. return $1;
  505. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKLabelView)})},
  506. args: [],
  507. source: "defaultControllerClass\x0a\x09^ super defaultControllerClass",
  508. messageSends: ["defaultControllerClass"],
  509. referencedClasses: []
  510. }),
  511. smalltalk.MKLabelView);
  512. smalltalk.addMethod(
  513. smalltalk.method({
  514. selector: "defaultLayout",
  515. category: 'defaults',
  516. fn: function (){
  517. var self=this;
  518. function $MKLabelLayout(){return smalltalk.MKLabelLayout||(typeof MKLabelLayout=="undefined"?nil:MKLabelLayout)}
  519. return smalltalk.withContext(function($ctx1) {
  520. var $2,$3,$1;
  521. $2=_st($MKLabelLayout())._new();
  522. _st($2)._height_((24));
  523. _st($2)._top_((0));
  524. _st($2)._left_((0));
  525. _st($2)._right_((0));
  526. _st($2)._textAlign_("left");
  527. $3=_st($2)._yourself();
  528. $1=$3;
  529. return $1;
  530. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKLabelView)})},
  531. args: [],
  532. source: "defaultLayout\x0a\x09^ MKLabelLayout new\x0a\x09\x09height: 24;\x0a\x09\x09top: 0;\x0a\x09\x09left:0;\x0a\x09\x09right: 0;\x0a\x09\x09textAlign: 'left';\x0a\x09\x09yourself",
  533. messageSends: ["height:", "new", "top:", "left:", "right:", "textAlign:", "yourself"],
  534. referencedClasses: ["MKLabelLayout"]
  535. }),
  536. smalltalk.MKLabelView);
  537. smalltalk.addMethod(
  538. smalltalk.method({
  539. selector: "renderContentOn:",
  540. category: 'rendering',
  541. fn: function (html){
  542. var self=this;
  543. return smalltalk.withContext(function($ctx1) {
  544. _st(html)._with_(self._aspectValue());
  545. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKLabelView)})},
  546. args: ["html"],
  547. source: "renderContentOn: html\x0a\x09html with: self aspectValue",
  548. messageSends: ["with:", "aspectValue"],
  549. referencedClasses: []
  550. }),
  551. smalltalk.MKLabelView);
  552. smalltalk.addMethod(
  553. smalltalk.method({
  554. selector: "textAlign:",
  555. category: 'layout',
  556. fn: function (aString){
  557. var self=this;
  558. return smalltalk.withContext(function($ctx1) {
  559. _st(self._layout())._textAlign_(aString);
  560. return self}, function($ctx1) {$ctx1.fill(self,"textAlign:",{aString:aString},smalltalk.MKLabelView)})},
  561. args: ["aString"],
  562. source: "textAlign: aString\x0a\x09self layout textAlign: aString",
  563. messageSends: ["textAlign:", "layout"],
  564. referencedClasses: []
  565. }),
  566. smalltalk.MKLabelView);
  567. smalltalk.addClass('MKHeadingView', smalltalk.MKLabelView, ['level'], 'Moka-Views');
  568. smalltalk.MKHeadingView.comment="I display a heading, with a `level` from 1 to 6.";
  569. smalltalk.addMethod(
  570. smalltalk.method({
  571. selector: "cssClass",
  572. category: 'accessing',
  573. fn: function (){
  574. var self=this;
  575. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  576. return smalltalk.withContext(function($ctx1) {
  577. var $2,$1;
  578. $1=_st($String())._streamContents_((function(stream){
  579. return smalltalk.withContext(function($ctx2) {
  580. $2=_st(_st(stream).__lt_lt(smalltalk.MKHeadingView.superclass.fn.prototype._cssClass.apply(_st(self), []))).__lt_lt(" mk_heading level");
  581. $ctx2.sendIdx["<<"]=2;
  582. return _st($2).__lt_lt(_st(self._level())._asString());
  583. $ctx2.sendIdx["<<"]=1;
  584. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})}));
  585. return $1;
  586. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKHeadingView)})},
  587. args: [],
  588. source: "cssClass\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09\x09\x09<< super cssClass \x09\x0a\x09\x09\x09<< ' mk_heading level'\x0a\x09\x09\x09<< self level asString ]",
  589. messageSends: ["streamContents:", "<<", "cssClass", "asString", "level"],
  590. referencedClasses: ["String"]
  591. }),
  592. smalltalk.MKHeadingView);
  593. smalltalk.addMethod(
  594. smalltalk.method({
  595. selector: "level",
  596. category: 'accessing',
  597. fn: function (){
  598. var self=this;
  599. return smalltalk.withContext(function($ctx1) {
  600. var $2,$1;
  601. $2=self["@level"];
  602. if(($receiver = $2) == nil || $receiver == null){
  603. $1=(1);
  604. } else {
  605. $1=$2;
  606. };
  607. return $1;
  608. }, function($ctx1) {$ctx1.fill(self,"level",{},smalltalk.MKHeadingView)})},
  609. args: [],
  610. source: "level\x0a\x09^ level ifNil: [ 1 ]",
  611. messageSends: ["ifNil:"],
  612. referencedClasses: []
  613. }),
  614. smalltalk.MKHeadingView);
  615. smalltalk.addMethod(
  616. smalltalk.method({
  617. selector: "level:",
  618. category: 'accessing',
  619. fn: function (aNumber){
  620. var self=this;
  621. return smalltalk.withContext(function($ctx1) {
  622. self["@level"]=aNumber;
  623. return self}, function($ctx1) {$ctx1.fill(self,"level:",{aNumber:aNumber},smalltalk.MKHeadingView)})},
  624. args: ["aNumber"],
  625. source: "level: aNumber\x0a\x09level := aNumber",
  626. messageSends: [],
  627. referencedClasses: []
  628. }),
  629. smalltalk.MKHeadingView);
  630. smalltalk.addMethod(
  631. smalltalk.method({
  632. selector: "tag",
  633. category: 'accessing',
  634. fn: function (){
  635. var self=this;
  636. return smalltalk.withContext(function($ctx1) {
  637. var $1;
  638. $1="h".__comma(_st(self._level())._asString());
  639. return $1;
  640. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKHeadingView)})},
  641. args: [],
  642. source: "tag\x0a\x09^ 'h', self level asString",
  643. messageSends: [",", "asString", "level"],
  644. referencedClasses: []
  645. }),
  646. smalltalk.MKHeadingView);
  647. smalltalk.addClass('MKOverlayView', smalltalk.MKView, ['childView'], 'Moka-Views');
  648. smalltalk.addMethod(
  649. smalltalk.method({
  650. selector: "childView",
  651. category: 'accessing',
  652. fn: function (){
  653. var self=this;
  654. return smalltalk.withContext(function($ctx1) {
  655. var $1;
  656. $1=self["@childView"];
  657. return $1;
  658. }, function($ctx1) {$ctx1.fill(self,"childView",{},smalltalk.MKOverlayView)})},
  659. args: [],
  660. source: "childView\x0a\x09^ childView",
  661. messageSends: [],
  662. referencedClasses: []
  663. }),
  664. smalltalk.MKOverlayView);
  665. smalltalk.addMethod(
  666. smalltalk.method({
  667. selector: "childView:",
  668. category: 'accessing',
  669. fn: function (aView){
  670. var self=this;
  671. return smalltalk.withContext(function($ctx1) {
  672. self["@childView"]=aView;
  673. return self}, function($ctx1) {$ctx1.fill(self,"childView:",{aView:aView},smalltalk.MKOverlayView)})},
  674. args: ["aView"],
  675. source: "childView: aView\x0a\x09childView := aView",
  676. messageSends: [],
  677. referencedClasses: []
  678. }),
  679. smalltalk.MKOverlayView);
  680. smalltalk.addMethod(
  681. smalltalk.method({
  682. selector: "cssClass",
  683. category: 'accessing',
  684. fn: function (){
  685. var self=this;
  686. return smalltalk.withContext(function($ctx1) {
  687. var $1;
  688. $1=_st(smalltalk.MKOverlayView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_overlay");
  689. return $1;
  690. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKOverlayView)})},
  691. args: [],
  692. source: "cssClass\x0a\x09^ super cssClass, ' mk_overlay'",
  693. messageSends: [",", "cssClass"],
  694. referencedClasses: []
  695. }),
  696. smalltalk.MKOverlayView);
  697. smalltalk.addMethod(
  698. smalltalk.method({
  699. selector: "defaultControllerClass",
  700. category: 'defaults',
  701. fn: function (){
  702. var self=this;
  703. function $MKOverlayController(){return smalltalk.MKOverlayController||(typeof MKOverlayController=="undefined"?nil:MKOverlayController)}
  704. return smalltalk.withContext(function($ctx1) {
  705. return $MKOverlayController();
  706. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKOverlayView)})},
  707. args: [],
  708. source: "defaultControllerClass\x0a\x09^ MKOverlayController",
  709. messageSends: [],
  710. referencedClasses: ["MKOverlayController"]
  711. }),
  712. smalltalk.MKOverlayView);
  713. smalltalk.addMethod(
  714. smalltalk.method({
  715. selector: "remove",
  716. category: 'actions',
  717. fn: function (){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx1) {
  720. smalltalk.MKOverlayView.superclass.fn.prototype._remove.apply(_st(self), []);
  721. $ctx1.sendIdx["remove"]=1;
  722. _st(self._childView())._remove();
  723. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.MKOverlayView)})},
  724. args: [],
  725. source: "remove\x0a\x09super remove.\x0a\x09self childView remove",
  726. messageSends: ["remove", "childView"],
  727. referencedClasses: []
  728. }),
  729. smalltalk.MKOverlayView);
  730. smalltalk.addMethod(
  731. smalltalk.method({
  732. selector: "renderContentOn:",
  733. category: 'defaults',
  734. fn: function (html){
  735. var self=this;
  736. return smalltalk.withContext(function($ctx1) {
  737. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKOverlayView)})},
  738. args: ["html"],
  739. source: "renderContentOn: html\x0a\x09\x22Left empty on purpose. \x0a\x09No Content is rendered, as the childView is actually displayed separately\x22",
  740. messageSends: [],
  741. referencedClasses: []
  742. }),
  743. smalltalk.MKOverlayView);
  744. smalltalk.addMethod(
  745. smalltalk.method({
  746. selector: "childView:",
  747. category: 'instance creation',
  748. fn: function (aView){
  749. var self=this;
  750. return smalltalk.withContext(function($ctx1) {
  751. var $2,$3,$1;
  752. $2=self._new();
  753. _st($2)._childView_(aView);
  754. $3=_st($2)._yourself();
  755. $1=$3;
  756. return $1;
  757. }, function($ctx1) {$ctx1.fill(self,"childView:",{aView:aView},smalltalk.MKOverlayView.klass)})},
  758. args: ["aView"],
  759. source: "childView: aView\x0a\x09^ self new\x0a\x09\x09childView: aView;\x0a\x09\x09yourself",
  760. messageSends: ["childView:", "new", "yourself"],
  761. referencedClasses: []
  762. }),
  763. smalltalk.MKOverlayView.klass);
  764. smalltalk.addClass('MKPaneView', smalltalk.MKView, ['views'], 'Moka-Views');
  765. smalltalk.MKPaneView.comment="I am a view containing other views.\x0a\x0a## API\x0a\x0aUse `#addView:` to add a view to the pane.";
  766. smalltalk.addMethod(
  767. smalltalk.method({
  768. selector: "addView:",
  769. category: 'adding',
  770. fn: function (aView){
  771. var self=this;
  772. return smalltalk.withContext(function($ctx1) {
  773. _st(self._views())._add_(aView);
  774. return self}, function($ctx1) {$ctx1.fill(self,"addView:",{aView:aView},smalltalk.MKPaneView)})},
  775. args: ["aView"],
  776. source: "addView: aView\x0a\x09self views add: aView",
  777. messageSends: ["add:", "views"],
  778. referencedClasses: []
  779. }),
  780. smalltalk.MKPaneView);
  781. smalltalk.addMethod(
  782. smalltalk.method({
  783. selector: "borderBottom:",
  784. category: 'layout',
  785. fn: function (aNumber){
  786. var self=this;
  787. return smalltalk.withContext(function($ctx1) {
  788. _st(self._layout())._borderBottom_(aNumber);
  789. return self}, function($ctx1) {$ctx1.fill(self,"borderBottom:",{aNumber:aNumber},smalltalk.MKPaneView)})},
  790. args: ["aNumber"],
  791. source: "borderBottom: aNumber\x0a\x09self layout borderBottom: aNumber",
  792. messageSends: ["borderBottom:", "layout"],
  793. referencedClasses: []
  794. }),
  795. smalltalk.MKPaneView);
  796. smalltalk.addMethod(
  797. smalltalk.method({
  798. selector: "borderLeft:",
  799. category: 'layout',
  800. fn: function (aNumber){
  801. var self=this;
  802. return smalltalk.withContext(function($ctx1) {
  803. _st(self._layout())._borderLeft_(aNumber);
  804. return self}, function($ctx1) {$ctx1.fill(self,"borderLeft:",{aNumber:aNumber},smalltalk.MKPaneView)})},
  805. args: ["aNumber"],
  806. source: "borderLeft: aNumber\x0a\x09self layout borderLeft: aNumber",
  807. messageSends: ["borderLeft:", "layout"],
  808. referencedClasses: []
  809. }),
  810. smalltalk.MKPaneView);
  811. smalltalk.addMethod(
  812. smalltalk.method({
  813. selector: "borderRight:",
  814. category: 'layout',
  815. fn: function (aNumber){
  816. var self=this;
  817. return smalltalk.withContext(function($ctx1) {
  818. _st(self._layout())._borderRight_(aNumber);
  819. return self}, function($ctx1) {$ctx1.fill(self,"borderRight:",{aNumber:aNumber},smalltalk.MKPaneView)})},
  820. args: ["aNumber"],
  821. source: "borderRight: aNumber\x0a\x09self layout borderRight: aNumber",
  822. messageSends: ["borderRight:", "layout"],
  823. referencedClasses: []
  824. }),
  825. smalltalk.MKPaneView);
  826. smalltalk.addMethod(
  827. smalltalk.method({
  828. selector: "borderTop:",
  829. category: 'layout',
  830. fn: function (aNumber){
  831. var self=this;
  832. return smalltalk.withContext(function($ctx1) {
  833. _st(self._layout())._borderTop_(aNumber);
  834. return self}, function($ctx1) {$ctx1.fill(self,"borderTop:",{aNumber:aNumber},smalltalk.MKPaneView)})},
  835. args: ["aNumber"],
  836. source: "borderTop: aNumber\x0a\x09self layout borderTop: aNumber",
  837. messageSends: ["borderTop:", "layout"],
  838. referencedClasses: []
  839. }),
  840. smalltalk.MKPaneView);
  841. smalltalk.addMethod(
  842. smalltalk.method({
  843. selector: "cssClass",
  844. category: 'accessing',
  845. fn: function (){
  846. var self=this;
  847. return smalltalk.withContext(function($ctx1) {
  848. var $1;
  849. $1=_st(smalltalk.MKPaneView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_pane");
  850. return $1;
  851. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKPaneView)})},
  852. args: [],
  853. source: "cssClass\x0a\x09^ super cssClass, ' mk_pane'",
  854. messageSends: [",", "cssClass"],
  855. referencedClasses: []
  856. }),
  857. smalltalk.MKPaneView);
  858. smalltalk.addMethod(
  859. smalltalk.method({
  860. selector: "defaultLayout",
  861. category: 'defaults',
  862. fn: function (){
  863. var self=this;
  864. function $MKPaneLayout(){return smalltalk.MKPaneLayout||(typeof MKPaneLayout=="undefined"?nil:MKPaneLayout)}
  865. return smalltalk.withContext(function($ctx1) {
  866. var $2,$3,$1;
  867. $2=_st($MKPaneLayout())._new();
  868. _st($2)._left_((0));
  869. _st($2)._top_((0));
  870. _st($2)._right_((0));
  871. _st($2)._bottom_((0));
  872. $3=_st($2)._yourself();
  873. $1=$3;
  874. return $1;
  875. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKPaneView)})},
  876. args: [],
  877. source: "defaultLayout\x0a\x09^ MKPaneLayout new\x0a\x09\x09left: 0;\x0a\x09\x09top: 0;\x0a\x09\x09right: 0;\x0a\x09\x09bottom: 0;\x0a\x09\x09yourself",
  878. messageSends: ["left:", "new", "top:", "right:", "bottom:", "yourself"],
  879. referencedClasses: ["MKPaneLayout"]
  880. }),
  881. smalltalk.MKPaneView);
  882. smalltalk.addMethod(
  883. smalltalk.method({
  884. selector: "renderContentOn:",
  885. category: 'rendering',
  886. fn: function (html){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx1) {
  889. _st(self._views())._do_((function(each){
  890. return smalltalk.withContext(function($ctx2) {
  891. return _st(html)._with_(each);
  892. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  893. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKPaneView)})},
  894. args: ["html"],
  895. source: "renderContentOn: html\x0a\x09self views do: [ :each | \x0a\x09\x09html with: each ]",
  896. messageSends: ["do:", "views", "with:"],
  897. referencedClasses: []
  898. }),
  899. smalltalk.MKPaneView);
  900. smalltalk.addMethod(
  901. smalltalk.method({
  902. selector: "views",
  903. category: 'accessing',
  904. fn: function (){
  905. var self=this;
  906. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  907. return smalltalk.withContext(function($ctx1) {
  908. var $2,$1;
  909. $2=self["@views"];
  910. if(($receiver = $2) == nil || $receiver == null){
  911. self["@views"]=_st($OrderedCollection())._new();
  912. $1=self["@views"];
  913. } else {
  914. $1=$2;
  915. };
  916. return $1;
  917. }, function($ctx1) {$ctx1.fill(self,"views",{},smalltalk.MKPaneView)})},
  918. args: [],
  919. source: "views\x0a\x09^ views ifNil: [ views := OrderedCollection new ]",
  920. messageSends: ["ifNil:", "new"],
  921. referencedClasses: ["OrderedCollection"]
  922. }),
  923. smalltalk.MKPaneView);
  924. smalltalk.addClass('MKModalPaneView', smalltalk.MKPaneView, ['overlay', 'closeOnEnter', 'closeOnClick'], 'Moka-Views');
  925. smalltalk.addMethod(
  926. smalltalk.method({
  927. selector: "closeOnClick",
  928. category: 'accessing',
  929. fn: function (){
  930. var self=this;
  931. return smalltalk.withContext(function($ctx1) {
  932. var $2,$1;
  933. $2=self["@closeOnClick"];
  934. if(($receiver = $2) == nil || $receiver == null){
  935. $1=false;
  936. } else {
  937. $1=$2;
  938. };
  939. return $1;
  940. }, function($ctx1) {$ctx1.fill(self,"closeOnClick",{},smalltalk.MKModalPaneView)})},
  941. args: [],
  942. source: "closeOnClick\x0a\x09^ closeOnClick ifNil: [ false ]",
  943. messageSends: ["ifNil:"],
  944. referencedClasses: []
  945. }),
  946. smalltalk.MKModalPaneView);
  947. smalltalk.addMethod(
  948. smalltalk.method({
  949. selector: "closeOnClick:",
  950. category: 'accessing',
  951. fn: function (aBoolean){
  952. var self=this;
  953. return smalltalk.withContext(function($ctx1) {
  954. self["@closeOnClick"]=aBoolean;
  955. return self}, function($ctx1) {$ctx1.fill(self,"closeOnClick:",{aBoolean:aBoolean},smalltalk.MKModalPaneView)})},
  956. args: ["aBoolean"],
  957. source: "closeOnClick: aBoolean\x0a\x09closeOnClick := aBoolean",
  958. messageSends: [],
  959. referencedClasses: []
  960. }),
  961. smalltalk.MKModalPaneView);
  962. smalltalk.addMethod(
  963. smalltalk.method({
  964. selector: "closeOnEnter",
  965. category: 'accessing',
  966. fn: function (){
  967. var self=this;
  968. return smalltalk.withContext(function($ctx1) {
  969. var $2,$1;
  970. $2=self["@closeOnEnter"];
  971. if(($receiver = $2) == nil || $receiver == null){
  972. $1=false;
  973. } else {
  974. $1=$2;
  975. };
  976. return $1;
  977. }, function($ctx1) {$ctx1.fill(self,"closeOnEnter",{},smalltalk.MKModalPaneView)})},
  978. args: [],
  979. source: "closeOnEnter\x0a\x09^ closeOnEnter ifNil: [ false ]",
  980. messageSends: ["ifNil:"],
  981. referencedClasses: []
  982. }),
  983. smalltalk.MKModalPaneView);
  984. smalltalk.addMethod(
  985. smalltalk.method({
  986. selector: "closeOnEnter:",
  987. category: 'accessing',
  988. fn: function (aBoolean){
  989. var self=this;
  990. return smalltalk.withContext(function($ctx1) {
  991. self["@closeOnEnter"]=aBoolean;
  992. return self}, function($ctx1) {$ctx1.fill(self,"closeOnEnter:",{aBoolean:aBoolean},smalltalk.MKModalPaneView)})},
  993. args: ["aBoolean"],
  994. source: "closeOnEnter: aBoolean\x0a\x09closeOnEnter := aBoolean",
  995. messageSends: [],
  996. referencedClasses: []
  997. }),
  998. smalltalk.MKModalPaneView);
  999. smalltalk.addMethod(
  1000. smalltalk.method({
  1001. selector: "cssClass",
  1002. category: 'accessing',
  1003. fn: function (){
  1004. var self=this;
  1005. return smalltalk.withContext(function($ctx1) {
  1006. var $1;
  1007. $1=_st(smalltalk.MKModalPaneView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_modal");
  1008. return $1;
  1009. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKModalPaneView)})},
  1010. args: [],
  1011. source: "cssClass\x0a\x09^ super cssClass, ' mk_modal'",
  1012. messageSends: [",", "cssClass"],
  1013. referencedClasses: []
  1014. }),
  1015. smalltalk.MKModalPaneView);
  1016. smalltalk.addMethod(
  1017. smalltalk.method({
  1018. selector: "defaultControllerClass",
  1019. category: 'defaults',
  1020. fn: function (){
  1021. var self=this;
  1022. function $MKModalPaneController(){return smalltalk.MKModalPaneController||(typeof MKModalPaneController=="undefined"?nil:MKModalPaneController)}
  1023. return smalltalk.withContext(function($ctx1) {
  1024. return $MKModalPaneController();
  1025. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKModalPaneView)})},
  1026. args: [],
  1027. source: "defaultControllerClass\x0a\x09^ MKModalPaneController",
  1028. messageSends: [],
  1029. referencedClasses: ["MKModalPaneController"]
  1030. }),
  1031. smalltalk.MKModalPaneView);
  1032. smalltalk.addMethod(
  1033. smalltalk.method({
  1034. selector: "defaultLayout",
  1035. category: 'defaults',
  1036. fn: function (){
  1037. var self=this;
  1038. return smalltalk.withContext(function($ctx1) {
  1039. var $2,$3,$1;
  1040. $2=smalltalk.MKModalPaneView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  1041. _st($2)._centerY_((0));
  1042. _st($2)._centerX_((0));
  1043. _st($2)._width_((300));
  1044. _st($2)._height_((200));
  1045. $3=_st($2)._yourself();
  1046. $1=$3;
  1047. return $1;
  1048. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKModalPaneView)})},
  1049. args: [],
  1050. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09centerY: 0;\x0a\x09\x09centerX: 0;\x0a\x09\x09width: 300;\x0a\x09\x09height: 200;\x0a\x09\x09yourself",
  1051. messageSends: ["centerY:", "defaultLayout", "centerX:", "width:", "height:", "yourself"],
  1052. referencedClasses: []
  1053. }),
  1054. smalltalk.MKModalPaneView);
  1055. smalltalk.addMethod(
  1056. smalltalk.method({
  1057. selector: "overlay",
  1058. category: 'accessing',
  1059. fn: function (){
  1060. var self=this;
  1061. function $MKOverlayView(){return smalltalk.MKOverlayView||(typeof MKOverlayView=="undefined"?nil:MKOverlayView)}
  1062. return smalltalk.withContext(function($ctx1) {
  1063. var $2,$1;
  1064. $2=self["@overlay"];
  1065. if(($receiver = $2) == nil || $receiver == null){
  1066. self["@overlay"]=_st($MKOverlayView())._childView_(self);
  1067. $1=self["@overlay"];
  1068. } else {
  1069. $1=$2;
  1070. };
  1071. return $1;
  1072. }, function($ctx1) {$ctx1.fill(self,"overlay",{},smalltalk.MKModalPaneView)})},
  1073. args: [],
  1074. source: "overlay\x0a\x09^ overlay ifNil: [ overlay := MKOverlayView childView: self ]",
  1075. messageSends: ["ifNil:", "childView:"],
  1076. referencedClasses: ["MKOverlayView"]
  1077. }),
  1078. smalltalk.MKModalPaneView);
  1079. smalltalk.addMethod(
  1080. smalltalk.method({
  1081. selector: "renderOn:",
  1082. category: 'rendering',
  1083. fn: function (html){
  1084. var self=this;
  1085. return smalltalk.withContext(function($ctx1) {
  1086. smalltalk.MKModalPaneView.superclass.fn.prototype._renderOn_.apply(_st(self), [html]);
  1087. _st(self["@root"])._at_put_("tabindex","0");
  1088. _st(_st(self["@root"])._asJQuery())._focus();
  1089. _st(html)._with_(self._overlay());
  1090. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.MKModalPaneView)})},
  1091. args: ["html"],
  1092. source: "renderOn: html\x0a\x09super renderOn: html.\x0a\x09root at: 'tabindex' put: '0'.\x0a\x09root asJQuery focus.\x0a\x09html with: self overlay",
  1093. messageSends: ["renderOn:", "at:put:", "focus", "asJQuery", "with:", "overlay"],
  1094. referencedClasses: []
  1095. }),
  1096. smalltalk.MKModalPaneView);
  1097. smalltalk.addMethod(
  1098. smalltalk.method({
  1099. selector: "zindex",
  1100. category: 'accessing',
  1101. fn: function (){
  1102. var self=this;
  1103. return smalltalk.withContext(function($ctx1) {
  1104. return (1001);
  1105. }, function($ctx1) {$ctx1.fill(self,"zindex",{},smalltalk.MKModalPaneView)})},
  1106. args: [],
  1107. source: "zindex\x0a\x09^ 1001",
  1108. messageSends: [],
  1109. referencedClasses: []
  1110. }),
  1111. smalltalk.MKModalPaneView);
  1112. smalltalk.addClass('MKPanelView', smalltalk.MKPaneView, [], 'Moka-Views');
  1113. smalltalk.MKPanelView.comment="I am similar to a `MKPaneView` but I am scrollable and display a light background.";
  1114. smalltalk.addMethod(
  1115. smalltalk.method({
  1116. selector: "cssClass",
  1117. category: 'accessing',
  1118. fn: function (){
  1119. var self=this;
  1120. return smalltalk.withContext(function($ctx1) {
  1121. var $1;
  1122. $1=_st(smalltalk.MKPanelView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_panel");
  1123. return $1;
  1124. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKPanelView)})},
  1125. args: [],
  1126. source: "cssClass\x0a\x09^ super cssClass, ' mk_panel'",
  1127. messageSends: [",", "cssClass"],
  1128. referencedClasses: []
  1129. }),
  1130. smalltalk.MKPanelView);
  1131. smalltalk.addClass('MKSelectionView', smalltalk.MKAspectsView, ['selectionAspect', 'collectionAspect'], 'Moka-Views');
  1132. smalltalk.MKSelectionView.comment="I an abstract selection view of a list of elements.";
  1133. smalltalk.addMethod(
  1134. smalltalk.method({
  1135. selector: "collection",
  1136. category: 'accessing',
  1137. fn: function (){
  1138. var self=this;
  1139. return smalltalk.withContext(function($ctx1) {
  1140. var $1;
  1141. $1=self._valueForAspect_(self._collectionAspect());
  1142. return $1;
  1143. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.MKSelectionView)})},
  1144. args: [],
  1145. source: "collection\x0a\x09^ self valueForAspect: self collectionAspect",
  1146. messageSends: ["valueForAspect:", "collectionAspect"],
  1147. referencedClasses: []
  1148. }),
  1149. smalltalk.MKSelectionView);
  1150. smalltalk.addMethod(
  1151. smalltalk.method({
  1152. selector: "collectionAspect",
  1153. category: 'accessing',
  1154. fn: function (){
  1155. var self=this;
  1156. return smalltalk.withContext(function($ctx1) {
  1157. var $1;
  1158. $1=self["@collectionAspect"];
  1159. return $1;
  1160. }, function($ctx1) {$ctx1.fill(self,"collectionAspect",{},smalltalk.MKSelectionView)})},
  1161. args: [],
  1162. source: "collectionAspect\x0a\x09^ collectionAspect",
  1163. messageSends: [],
  1164. referencedClasses: []
  1165. }),
  1166. smalltalk.MKSelectionView);
  1167. smalltalk.addMethod(
  1168. smalltalk.method({
  1169. selector: "collectionAspect:",
  1170. category: 'accessing',
  1171. fn: function (aSelector){
  1172. var self=this;
  1173. return smalltalk.withContext(function($ctx1) {
  1174. self["@collectionAspect"]=aSelector;
  1175. return self}, function($ctx1) {$ctx1.fill(self,"collectionAspect:",{aSelector:aSelector},smalltalk.MKSelectionView)})},
  1176. args: ["aSelector"],
  1177. source: "collectionAspect: aSelector\x0a\x09collectionAspect := aSelector",
  1178. messageSends: [],
  1179. referencedClasses: []
  1180. }),
  1181. smalltalk.MKSelectionView);
  1182. smalltalk.addMethod(
  1183. smalltalk.method({
  1184. selector: "defaultDisplayBlock",
  1185. category: 'defaults',
  1186. fn: function (){
  1187. var self=this;
  1188. return smalltalk.withContext(function($ctx1) {
  1189. var $1;
  1190. $1=(function(item){
  1191. return smalltalk.withContext(function($ctx2) {
  1192. return _st(item)._asString();
  1193. }, function($ctx2) {$ctx2.fillBlock({item:item},$ctx1,1)})});
  1194. return $1;
  1195. }, function($ctx1) {$ctx1.fill(self,"defaultDisplayBlock",{},smalltalk.MKSelectionView)})},
  1196. args: [],
  1197. source: "defaultDisplayBlock\x0a\x09^ [ :item | item asString ]",
  1198. messageSends: ["asString"],
  1199. referencedClasses: []
  1200. }),
  1201. smalltalk.MKSelectionView);
  1202. smalltalk.addMethod(
  1203. smalltalk.method({
  1204. selector: "selectedItem",
  1205. category: 'accessing',
  1206. fn: function (){
  1207. var self=this;
  1208. return smalltalk.withContext(function($ctx1) {
  1209. var $1;
  1210. $1=self._valueForAspect_(self._selectionAspect());
  1211. return $1;
  1212. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.MKSelectionView)})},
  1213. args: [],
  1214. source: "selectedItem\x0a\x09^ self valueForAspect: self selectionAspect",
  1215. messageSends: ["valueForAspect:", "selectionAspect"],
  1216. referencedClasses: []
  1217. }),
  1218. smalltalk.MKSelectionView);
  1219. smalltalk.addMethod(
  1220. smalltalk.method({
  1221. selector: "selectionAspect",
  1222. category: 'accessing',
  1223. fn: function (){
  1224. var self=this;
  1225. return smalltalk.withContext(function($ctx1) {
  1226. var $1;
  1227. $1=self["@selectionAspect"];
  1228. return $1;
  1229. }, function($ctx1) {$ctx1.fill(self,"selectionAspect",{},smalltalk.MKSelectionView)})},
  1230. args: [],
  1231. source: "selectionAspect\x0a\x09^ selectionAspect",
  1232. messageSends: [],
  1233. referencedClasses: []
  1234. }),
  1235. smalltalk.MKSelectionView);
  1236. smalltalk.addMethod(
  1237. smalltalk.method({
  1238. selector: "selectionAspect:",
  1239. category: 'accessing',
  1240. fn: function (aSelector){
  1241. var self=this;
  1242. return smalltalk.withContext(function($ctx1) {
  1243. self["@selectionAspect"]=aSelector;
  1244. return self}, function($ctx1) {$ctx1.fill(self,"selectionAspect:",{aSelector:aSelector},smalltalk.MKSelectionView)})},
  1245. args: ["aSelector"],
  1246. source: "selectionAspect: aSelector\x0a\x09selectionAspect := aSelector",
  1247. messageSends: [],
  1248. referencedClasses: []
  1249. }),
  1250. smalltalk.MKSelectionView);
  1251. smalltalk.addMethod(
  1252. smalltalk.method({
  1253. selector: "model:collectionAspect:selectionAspect:",
  1254. category: 'instance creation',
  1255. fn: function (aModel,collectionSelector,selectionSelector){
  1256. var self=this;
  1257. return smalltalk.withContext(function($ctx1) {
  1258. var $2,$3,$1;
  1259. $2=self._model_(aModel);
  1260. _st($2)._collectionAspect_(collectionSelector);
  1261. _st($2)._selectionAspect_(selectionSelector);
  1262. $3=_st($2)._yourself();
  1263. $1=$3;
  1264. return $1;
  1265. }, function($ctx1) {$ctx1.fill(self,"model:collectionAspect:selectionAspect:",{aModel:aModel,collectionSelector:collectionSelector,selectionSelector:selectionSelector},smalltalk.MKSelectionView.klass)})},
  1266. args: ["aModel", "collectionSelector", "selectionSelector"],
  1267. source: "model: aModel collectionAspect: collectionSelector selectionAspect: selectionSelector\x0a\x09^ (self model: aModel)\x0a\x09\x09collectionAspect: collectionSelector;\x0a\x09\x09selectionAspect: selectionSelector;\x0a\x09\x09yourself",
  1268. messageSends: ["collectionAspect:", "model:", "selectionAspect:", "yourself"],
  1269. referencedClasses: []
  1270. }),
  1271. smalltalk.MKSelectionView.klass);
  1272. smalltalk.addClass('MKDropdownView', smalltalk.MKSelectionView, ['modalPaneView', 'listView'], 'Moka-Views');
  1273. smalltalk.MKDropdownView.comment="I am a push button view. My default controller is `MKButtonController`.\x0a\x0aMy controller must answer to `#onPressed`.\x0a\x0a## API\x0a\x0a- Instances can be set a `default` button\x0a- Use `#label:` to set the label string";
  1274. smalltalk.addMethod(
  1275. smalltalk.method({
  1276. selector: "cssClass",
  1277. category: 'accessing',
  1278. fn: function (){
  1279. var self=this;
  1280. return smalltalk.withContext(function($ctx1) {
  1281. var $1;
  1282. $1=_st(smalltalk.MKDropdownView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_dropdown");
  1283. return $1;
  1284. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKDropdownView)})},
  1285. args: [],
  1286. source: "cssClass\x0a\x09^ super cssClass, ' mk_dropdown'",
  1287. messageSends: [",", "cssClass"],
  1288. referencedClasses: []
  1289. }),
  1290. smalltalk.MKDropdownView);
  1291. smalltalk.addMethod(
  1292. smalltalk.method({
  1293. selector: "defaultControllerClass",
  1294. category: 'defaults',
  1295. fn: function (){
  1296. var self=this;
  1297. function $MKDropdownController(){return smalltalk.MKDropdownController||(typeof MKDropdownController=="undefined"?nil:MKDropdownController)}
  1298. return smalltalk.withContext(function($ctx1) {
  1299. return $MKDropdownController();
  1300. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKDropdownView)})},
  1301. args: [],
  1302. source: "defaultControllerClass\x0a\x09^ MKDropdownController",
  1303. messageSends: [],
  1304. referencedClasses: ["MKDropdownController"]
  1305. }),
  1306. smalltalk.MKDropdownView);
  1307. smalltalk.addMethod(
  1308. smalltalk.method({
  1309. selector: "defaultLayout",
  1310. category: 'defaults',
  1311. fn: function (){
  1312. var self=this;
  1313. return smalltalk.withContext(function($ctx1) {
  1314. var $2,$3,$1;
  1315. $2=smalltalk.MKDropdownView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  1316. _st($2)._width_((120));
  1317. _st($2)._height_((24));
  1318. $3=_st($2)._yourself();
  1319. $1=$3;
  1320. return $1;
  1321. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKDropdownView)})},
  1322. args: [],
  1323. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 120;\x0a\x09\x09height: 24;\x0a\x09\x09yourself",
  1324. messageSends: ["width:", "defaultLayout", "height:", "yourself"],
  1325. referencedClasses: []
  1326. }),
  1327. smalltalk.MKDropdownView);
  1328. smalltalk.addMethod(
  1329. smalltalk.method({
  1330. selector: "listView",
  1331. category: 'views',
  1332. fn: function (){
  1333. var self=this;
  1334. function $MKDropdownListView(){return smalltalk.MKDropdownListView||(typeof MKDropdownListView=="undefined"?nil:MKDropdownListView)}
  1335. return smalltalk.withContext(function($ctx1) {
  1336. var $2,$3,$4,$1;
  1337. $2=self["@listView"];
  1338. if(($receiver = $2) == nil || $receiver == null){
  1339. $3=_st($MKDropdownListView())._model_collectionAspect_selectionAspect_(self._model(),self._collectionAspect(),self._selectionAspect());
  1340. _st($3)._width_(self._width());
  1341. _st($3)._height_("auto");
  1342. $4=_st($3)._yourself();
  1343. self["@listView"]=$4;
  1344. $1=self["@listView"];
  1345. } else {
  1346. $1=$2;
  1347. };
  1348. return $1;
  1349. }, function($ctx1) {$ctx1.fill(self,"listView",{},smalltalk.MKDropdownView)})},
  1350. args: [],
  1351. source: "listView\x0a\x09^ listView ifNil: [\x0a\x09\x09listView := (MKDropdownListView \x09\x0a\x09\x09\x09model: self model\x0a\x09\x09\x09collectionAspect: self collectionAspect\x0a\x09\x09\x09selectionAspect: self selectionAspect)\x0a\x09\x09\x09\x09width: self width;\x0a\x09\x09\x09\x09height: 'auto';\x0a\x09\x09\x09\x09yourself ]",
  1352. messageSends: ["ifNil:", "width:", "model:collectionAspect:selectionAspect:", "model", "collectionAspect", "selectionAspect", "width", "height:", "yourself"],
  1353. referencedClasses: ["MKDropdownListView"]
  1354. }),
  1355. smalltalk.MKDropdownView);
  1356. smalltalk.addMethod(
  1357. smalltalk.method({
  1358. selector: "modalPaneView",
  1359. category: 'views',
  1360. fn: function (){
  1361. var self=this;
  1362. function $MKModalPaneView(){return smalltalk.MKModalPaneView||(typeof MKModalPaneView=="undefined"?nil:MKModalPaneView)}
  1363. return smalltalk.withContext(function($ctx1) {
  1364. var $2,$3,$4,$6,$5,$7,$1;
  1365. $2=self["@modalPaneView"];
  1366. if(($receiver = $2) == nil || $receiver == null){
  1367. $3=_st($MKModalPaneView())._new();
  1368. _st($3)._extraCssClass_("mk_dropdown_pane");
  1369. _st($3)._closeOnEnter_(true);
  1370. _st($3)._closeOnClick_(true);
  1371. _st($3)._addView_(self._listView());
  1372. $4=$3;
  1373. $6=self._domPosition();
  1374. $ctx1.sendIdx["domPosition"]=1;
  1375. $5=_st($6)._x();
  1376. _st($4)._left_($5);
  1377. _st($3)._top_(_st(self._domPosition())._y());
  1378. _st($3)._height_((400));
  1379. $7=_st($3)._yourself();
  1380. self["@modalPaneView"]=$7;
  1381. $1=self["@modalPaneView"];
  1382. } else {
  1383. $1=$2;
  1384. };
  1385. return $1;
  1386. }, function($ctx1) {$ctx1.fill(self,"modalPaneView",{},smalltalk.MKDropdownView)})},
  1387. args: [],
  1388. source: "modalPaneView\x0a\x09^ modalPaneView ifNil: [\x0a\x09\x09modalPaneView := MKModalPaneView new\x0a\x09\x09\x09extraCssClass: 'mk_dropdown_pane';\x0a\x09\x09\x09closeOnEnter: true;\x0a\x09\x09\x09closeOnClick: true;\x0a\x09\x09\x09addView: self listView;\x0a\x09\x09\x09left: self domPosition x;\x0a\x09\x09\x09top: self domPosition y;\x0a\x09\x09\x09\x22Max height of the list\x22\x0a\x09\x09\x09height: 400;\x0a\x09\x09\x09yourself ]",
  1389. messageSends: ["ifNil:", "extraCssClass:", "new", "closeOnEnter:", "closeOnClick:", "addView:", "listView", "left:", "x", "domPosition", "top:", "y", "height:", "yourself"],
  1390. referencedClasses: ["MKModalPaneView"]
  1391. }),
  1392. smalltalk.MKDropdownView);
  1393. smalltalk.addMethod(
  1394. smalltalk.method({
  1395. selector: "popupList",
  1396. category: 'actions',
  1397. fn: function (){
  1398. var self=this;
  1399. return smalltalk.withContext(function($ctx1) {
  1400. _st(self._modalPaneView())._render();
  1401. _st(self._listView())._focus();
  1402. return self}, function($ctx1) {$ctx1.fill(self,"popupList",{},smalltalk.MKDropdownView)})},
  1403. args: [],
  1404. source: "popupList\x0a\x09\x22Show a new list view inside a modal pane\x22\x0a\x09self modalPaneView render.\x0a\x09self listView focus",
  1405. messageSends: ["render", "modalPaneView", "focus", "listView"],
  1406. referencedClasses: []
  1407. }),
  1408. smalltalk.MKDropdownView);
  1409. smalltalk.addMethod(
  1410. smalltalk.method({
  1411. selector: "renderContentOn:",
  1412. category: 'rendering',
  1413. fn: function (html){
  1414. var self=this;
  1415. return smalltalk.withContext(function($ctx1) {
  1416. _st(_st(html)._div())._class_("mk_dropdown_arrows");
  1417. _st(html)._with_(self._selectedItem());
  1418. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKDropdownView)})},
  1419. args: ["html"],
  1420. source: "renderContentOn: html\x0a\x09html div class: 'mk_dropdown_arrows'.\x0a\x09html with: self selectedItem",
  1421. messageSends: ["class:", "div", "with:", "selectedItem"],
  1422. referencedClasses: []
  1423. }),
  1424. smalltalk.MKDropdownView);
  1425. smalltalk.addMethod(
  1426. smalltalk.method({
  1427. selector: "selectedListItem",
  1428. category: 'accessing',
  1429. fn: function (){
  1430. var self=this;
  1431. return smalltalk.withContext(function($ctx1) {
  1432. var $1;
  1433. $1=_st(_st(_st(self["@root"])._asJQuery())._find_(":selected"))._text();
  1434. return $1;
  1435. }, function($ctx1) {$ctx1.fill(self,"selectedListItem",{},smalltalk.MKDropdownView)})},
  1436. args: [],
  1437. source: "selectedListItem\x0a\x09^ (root asJQuery find: ':selected') text",
  1438. messageSends: ["text", "find:", "asJQuery"],
  1439. referencedClasses: []
  1440. }),
  1441. smalltalk.MKDropdownView);
  1442. smalltalk.addMethod(
  1443. smalltalk.method({
  1444. selector: "tag",
  1445. category: 'accessing',
  1446. fn: function (){
  1447. var self=this;
  1448. return smalltalk.withContext(function($ctx1) {
  1449. return "button";
  1450. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKDropdownView)})},
  1451. args: [],
  1452. source: "tag\x0a\x09^ 'button'",
  1453. messageSends: [],
  1454. referencedClasses: []
  1455. }),
  1456. smalltalk.MKDropdownView);
  1457. smalltalk.addMethod(
  1458. smalltalk.method({
  1459. selector: "update:",
  1460. category: 'accessing',
  1461. fn: function (anAnnouncement){
  1462. var self=this;
  1463. return smalltalk.withContext(function($ctx1) {
  1464. var $1;
  1465. $1=_st([self._selectionAspect(),self._collectionAspect()])._includes_(_st(anAnnouncement)._aspect());
  1466. if(smalltalk.assert($1)){
  1467. self._update();
  1468. };
  1469. return self}, function($ctx1) {$ctx1.fill(self,"update:",{anAnnouncement:anAnnouncement},smalltalk.MKDropdownView)})},
  1470. args: ["anAnnouncement"],
  1471. source: "update: anAnnouncement\x0a\x09({self selectionAspect. self collectionAspect} \x0a\x09\x09includes: anAnnouncement aspect) ifTrue: [\x0a\x09\x09\x09self update ]",
  1472. messageSends: ["ifTrue:", "includes:", "selectionAspect", "collectionAspect", "aspect", "update"],
  1473. referencedClasses: []
  1474. }),
  1475. smalltalk.MKDropdownView);
  1476. smalltalk.addClass('MKListView', smalltalk.MKSelectionView, ['displayBlock'], 'Moka-Views');
  1477. smalltalk.MKListView.comment="I display a list of elements in a list control field.";
  1478. smalltalk.addMethod(
  1479. smalltalk.method({
  1480. selector: "activateItem:",
  1481. category: 'actions',
  1482. fn: function (anObject){
  1483. var self=this;
  1484. return smalltalk.withContext(function($ctx1) {
  1485. self._activateListItem_(self._findListItemFor_(anObject));
  1486. return self}, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.MKListView)})},
  1487. args: ["anObject"],
  1488. source: "activateItem: anObject\x0a\x09self activateListItem: (self findListItemFor: anObject)",
  1489. messageSends: ["activateListItem:", "findListItemFor:"],
  1490. referencedClasses: []
  1491. }),
  1492. smalltalk.MKListView);
  1493. smalltalk.addMethod(
  1494. smalltalk.method({
  1495. selector: "activateListItem:",
  1496. category: 'actions',
  1497. fn: function (aListItem){
  1498. var self=this;
  1499. var item;
  1500. return smalltalk.withContext(function($ctx1) {
  1501. var $1,$2,$3;
  1502. $1=_st(aListItem)._get_((0));
  1503. if(($receiver = $1) == nil || $receiver == null){
  1504. return self;
  1505. } else {
  1506. $1;
  1507. };
  1508. $2=_st(_st(aListItem)._parent())._children();
  1509. $3=self._selectedCssClass();
  1510. $ctx1.sendIdx["selectedCssClass"]=1;
  1511. _st($2)._removeClass_($3);
  1512. _st(aListItem)._addClass_(self._selectedCssClass());
  1513. self._ensureVisible_(aListItem);
  1514. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.MKListView)})},
  1515. args: ["aListItem"],
  1516. source: "activateListItem: aListItem\x0a\x09| item |\x0a\x09\x0a\x09(aListItem get: 0) ifNil: [ ^ self ].\x0a\x09aListItem parent children removeClass: self selectedCssClass.\x0a\x09aListItem addClass: self selectedCssClass.\x0a \x0a\x09self ensureVisible: aListItem",
  1517. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "selectedCssClass", "addClass:", "ensureVisible:"],
  1518. referencedClasses: []
  1519. }),
  1520. smalltalk.MKListView);
  1521. smalltalk.addMethod(
  1522. smalltalk.method({
  1523. selector: "activeItem",
  1524. category: 'accessing',
  1525. fn: function (){
  1526. var self=this;
  1527. return smalltalk.withContext(function($ctx1) {
  1528. var $1;
  1529. $1=self._findItemFor_(_st(_st(self["@root"])._asJQuery())._find_(".".__comma(self._selectedCssClass())));
  1530. return $1;
  1531. }, function($ctx1) {$ctx1.fill(self,"activeItem",{},smalltalk.MKListView)})},
  1532. args: [],
  1533. source: "activeItem\x0a\x09^ self findItemFor: (root asJQuery find: '.', self selectedCssClass)",
  1534. messageSends: ["findItemFor:", "find:", "asJQuery", ",", "selectedCssClass"],
  1535. referencedClasses: []
  1536. }),
  1537. smalltalk.MKListView);
  1538. smalltalk.addMethod(
  1539. smalltalk.method({
  1540. selector: "cssClass",
  1541. category: 'accessing',
  1542. fn: function (){
  1543. var self=this;
  1544. return smalltalk.withContext(function($ctx1) {
  1545. var $1;
  1546. $1=_st(smalltalk.MKListView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_list");
  1547. return $1;
  1548. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKListView)})},
  1549. args: [],
  1550. source: "cssClass\x0a\x09^ super cssClass, ' mk_list'",
  1551. messageSends: [",", "cssClass"],
  1552. referencedClasses: []
  1553. }),
  1554. smalltalk.MKListView);
  1555. smalltalk.addMethod(
  1556. smalltalk.method({
  1557. selector: "defaultControllerClass",
  1558. category: 'defaults',
  1559. fn: function (){
  1560. var self=this;
  1561. function $MKListController(){return smalltalk.MKListController||(typeof MKListController=="undefined"?nil:MKListController)}
  1562. return smalltalk.withContext(function($ctx1) {
  1563. return $MKListController();
  1564. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKListView)})},
  1565. args: [],
  1566. source: "defaultControllerClass\x0a\x09^ MKListController",
  1567. messageSends: [],
  1568. referencedClasses: ["MKListController"]
  1569. }),
  1570. smalltalk.MKListView);
  1571. smalltalk.addMethod(
  1572. smalltalk.method({
  1573. selector: "defaultDisplayBlock",
  1574. category: 'defaults',
  1575. fn: function (){
  1576. var self=this;
  1577. return smalltalk.withContext(function($ctx1) {
  1578. var $1;
  1579. $1=(function(item){
  1580. return smalltalk.withContext(function($ctx2) {
  1581. return _st(item)._asString();
  1582. }, function($ctx2) {$ctx2.fillBlock({item:item},$ctx1,1)})});
  1583. return $1;
  1584. }, function($ctx1) {$ctx1.fill(self,"defaultDisplayBlock",{},smalltalk.MKListView)})},
  1585. args: [],
  1586. source: "defaultDisplayBlock\x0a\x09^ [ :item | item asString ]",
  1587. messageSends: ["asString"],
  1588. referencedClasses: []
  1589. }),
  1590. smalltalk.MKListView);
  1591. smalltalk.addMethod(
  1592. smalltalk.method({
  1593. selector: "displayBlock",
  1594. category: 'accessing',
  1595. fn: function (){
  1596. var self=this;
  1597. return smalltalk.withContext(function($ctx1) {
  1598. var $2,$1;
  1599. $2=self["@displayBlock"];
  1600. if(($receiver = $2) == nil || $receiver == null){
  1601. $1=self._defaultDisplayBlock();
  1602. } else {
  1603. $1=$2;
  1604. };
  1605. return $1;
  1606. }, function($ctx1) {$ctx1.fill(self,"displayBlock",{},smalltalk.MKListView)})},
  1607. args: [],
  1608. source: "displayBlock\x0a\x09^ displayBlock ifNil: [ self defaultDisplayBlock ]",
  1609. messageSends: ["ifNil:", "defaultDisplayBlock"],
  1610. referencedClasses: []
  1611. }),
  1612. smalltalk.MKListView);
  1613. smalltalk.addMethod(
  1614. smalltalk.method({
  1615. selector: "displayBlock:",
  1616. category: 'accessing',
  1617. fn: function (aBlock){
  1618. var self=this;
  1619. return smalltalk.withContext(function($ctx1) {
  1620. self["@displayBlock"]=aBlock;
  1621. return self}, function($ctx1) {$ctx1.fill(self,"displayBlock:",{aBlock:aBlock},smalltalk.MKListView)})},
  1622. args: ["aBlock"],
  1623. source: "displayBlock: aBlock\x0a\x09displayBlock := aBlock",
  1624. messageSends: [],
  1625. referencedClasses: []
  1626. }),
  1627. smalltalk.MKListView);
  1628. smalltalk.addMethod(
  1629. smalltalk.method({
  1630. selector: "ensureVisible:",
  1631. category: 'private',
  1632. fn: function (aListItem){
  1633. var self=this;
  1634. var parent,position;
  1635. return smalltalk.withContext(function($ctx1) {
  1636. var $1,$4,$3,$2,$5,$9,$8,$11,$10,$7,$6,$15,$14,$16,$13,$17,$12,$18,$22,$23,$21,$20,$19;
  1637. $1=_st(aListItem)._get_((0));
  1638. $ctx1.sendIdx["get:"]=1;
  1639. if(($receiver = $1) == nil || $receiver == null){
  1640. return self;
  1641. } else {
  1642. $1;
  1643. };
  1644. position=self._positionOf_(aListItem);
  1645. parent=_st(aListItem)._parent();
  1646. $4=_st(aListItem)._position();
  1647. $ctx1.sendIdx["position"]=1;
  1648. $3=_st($4)._top();
  1649. $ctx1.sendIdx["top"]=1;
  1650. $2=_st($3).__lt((0));
  1651. if(smalltalk.assert($2)){
  1652. $5=_st(parent)._get_((0));
  1653. $ctx1.sendIdx["get:"]=2;
  1654. $9=_st(parent)._get_((0));
  1655. $ctx1.sendIdx["get:"]=3;
  1656. $8=_st($9)._scrollTop();
  1657. $ctx1.sendIdx["scrollTop"]=1;
  1658. $11=_st(aListItem)._position();
  1659. $ctx1.sendIdx["position"]=2;
  1660. $10=_st($11)._top();
  1661. $ctx1.sendIdx["top"]=2;
  1662. $7=_st($8).__plus($10);
  1663. $ctx1.sendIdx["+"]=1;
  1664. $6=_st($7).__minus((10));
  1665. $ctx1.sendIdx["-"]=1;
  1666. _st($5)._scrollTop_($6);
  1667. $ctx1.sendIdx["scrollTop:"]=1;
  1668. };
  1669. $15=_st(aListItem)._position();
  1670. $ctx1.sendIdx["position"]=3;
  1671. $14=_st($15)._top();
  1672. $ctx1.sendIdx["top"]=3;
  1673. $16=_st(aListItem)._height();
  1674. $ctx1.sendIdx["height"]=1;
  1675. $13=_st($14).__plus($16);
  1676. $ctx1.sendIdx["+"]=2;
  1677. $17=_st(parent)._height();
  1678. $ctx1.sendIdx["height"]=2;
  1679. $12=_st($13).__gt($17);
  1680. if(smalltalk.assert($12)){
  1681. $18=_st(parent)._get_((0));
  1682. $ctx1.sendIdx["get:"]=4;
  1683. $22=_st(_st(parent)._get_((0)))._scrollTop();
  1684. $23=_st(aListItem)._height();
  1685. $ctx1.sendIdx["height"]=3;
  1686. $21=_st($22).__plus($23);
  1687. $20=_st($21).__minus(_st(_st(parent)._height()).__minus(_st(_st(aListItem)._position())._top()));
  1688. $ctx1.sendIdx["-"]=2;
  1689. $19=_st($20).__plus((10));
  1690. $ctx1.sendIdx["+"]=3;
  1691. _st($18)._scrollTop_($19);
  1692. };
  1693. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,parent:parent,position:position},smalltalk.MKListView)})},
  1694. args: ["aListItem"],
  1695. source: "ensureVisible: aListItem\x09\x0a\x09\x22Move the scrollbar to show the active element\x22\x0a\x09\x0a\x09| parent position |\x0a\x09(aListItem get: 0) ifNil: [ ^ self ].\x0a\x09position := self positionOf: aListItem.\x0a\x09parent := aListItem parent.\x0a\x09\x0a aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ]",
  1696. messageSends: ["ifNil:", "get:", "positionOf:", "parent", "ifTrue:", "<", "top", "position", "scrollTop:", "-", "+", "scrollTop", ">", "height"],
  1697. referencedClasses: []
  1698. }),
  1699. smalltalk.MKListView);
  1700. smalltalk.addMethod(
  1701. smalltalk.method({
  1702. selector: "findItemFor:",
  1703. category: 'accessing',
  1704. fn: function (aListItem){
  1705. var self=this;
  1706. return smalltalk.withContext(function($ctx1) {
  1707. var $1;
  1708. $1=_st(_st(_st(aListItem)._asJQuery())._data())._at_("item");
  1709. return $1;
  1710. }, function($ctx1) {$ctx1.fill(self,"findItemFor:",{aListItem:aListItem},smalltalk.MKListView)})},
  1711. args: ["aListItem"],
  1712. source: "findItemFor: aListItem\x0a\x09^ aListItem asJQuery data at: 'item'",
  1713. messageSends: ["at:", "data", "asJQuery"],
  1714. referencedClasses: []
  1715. }),
  1716. smalltalk.MKListView);
  1717. smalltalk.addMethod(
  1718. smalltalk.method({
  1719. selector: "findListItemFor:",
  1720. category: 'accessing',
  1721. fn: function (anObject){
  1722. var self=this;
  1723. return smalltalk.withContext(function($ctx1) {
  1724. var $4,$3,$2,$1;
  1725. $4=_st(self["@root"])._asJQuery();
  1726. $ctx1.sendIdx["asJQuery"]=1;
  1727. $3=_st($4)._find_("li");
  1728. $2=_st($3)._filter_(_st((function(thisArg){
  1729. return smalltalk.withContext(function($ctx2) {
  1730. return _st(_st(_st(thisArg)._asJQuery())._data_("item")).__eq(anObject);
  1731. }, function($ctx2) {$ctx2.fillBlock({thisArg:thisArg},$ctx1,1)})}))._currySelf());
  1732. $1=_st($2)._eq_((0));
  1733. return $1;
  1734. }, function($ctx1) {$ctx1.fill(self,"findListItemFor:",{anObject:anObject},smalltalk.MKListView)})},
  1735. args: ["anObject"],
  1736. source: "findListItemFor: anObject\x0a\x09^ (((root asJQuery find: 'li') \x0a\x09\x09filter: [ :thisArg | (thisArg asJQuery data: 'item') = anObject ] currySelf) eq: 0)",
  1737. messageSends: ["eq:", "filter:", "find:", "asJQuery", "currySelf", "=", "data:"],
  1738. referencedClasses: []
  1739. }),
  1740. smalltalk.MKListView);
  1741. smalltalk.addMethod(
  1742. smalltalk.method({
  1743. selector: "positionOf:",
  1744. category: 'private',
  1745. fn: function (aListItem){
  1746. var self=this;
  1747. return smalltalk.withContext(function($ctx1) {
  1748. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1;
  1749. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.MKListView)})},
  1750. args: ["aListItem"],
  1751. source: "positionOf: aListItem\x0a\x09\x22TODO: rewrite in smalltalk\x22\x0a\x09<return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1>",
  1752. messageSends: [],
  1753. referencedClasses: []
  1754. }),
  1755. smalltalk.MKListView);
  1756. smalltalk.addMethod(
  1757. smalltalk.method({
  1758. selector: "renderContentOn:",
  1759. category: 'rendering',
  1760. fn: function (html){
  1761. var self=this;
  1762. return smalltalk.withContext(function($ctx1) {
  1763. _st(self._collection())._do_((function(each){
  1764. return smalltalk.withContext(function($ctx2) {
  1765. return self._renderItem_on_(each,html);
  1766. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1767. _st(self["@root"])._at_put_("tabindex","0");
  1768. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKListView)})},
  1769. args: ["html"],
  1770. source: "renderContentOn: html\x0a\x09self collection do: [ :each | \x0a \x09self renderItem: each on: html ].\x0a\x09\x0a\x09\x22make the list focusable\x22\x0a\x09root at: 'tabindex' put: '0'",
  1771. messageSends: ["do:", "collection", "renderItem:on:", "at:put:"],
  1772. referencedClasses: []
  1773. }),
  1774. smalltalk.MKListView);
  1775. smalltalk.addMethod(
  1776. smalltalk.method({
  1777. selector: "renderItem:on:",
  1778. category: 'rendering',
  1779. fn: function (anObject,html){
  1780. var self=this;
  1781. var li;
  1782. return smalltalk.withContext(function($ctx1) {
  1783. var $1;
  1784. li=_st(html)._li();
  1785. _st(_st(li)._asJQuery())._data_put_("item",anObject);
  1786. $1=_st(self._selectedItem()).__eq(anObject);
  1787. if(smalltalk.assert($1)){
  1788. _st(li)._class_(self._selectedCssClass());
  1789. };
  1790. _st(li)._with_(_st(self._displayBlock())._value_(anObject));
  1791. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.MKListView)})},
  1792. args: ["anObject", "html"],
  1793. source: "renderItem: anObject on: html\x0a\x09| li |\x0a\x09\x0a\x09li := html li.\x0a\x09li asJQuery data: 'item' put: anObject.\x0a\x09\x0a\x09self selectedItem = anObject ifTrue: [\x0a\x09\x09li class: self selectedCssClass ].\x09\x0a\x09li with: (self displayBlock value: anObject)",
  1794. messageSends: ["li", "data:put:", "asJQuery", "ifTrue:", "=", "selectedItem", "class:", "selectedCssClass", "with:", "value:", "displayBlock"],
  1795. referencedClasses: []
  1796. }),
  1797. smalltalk.MKListView);
  1798. smalltalk.addMethod(
  1799. smalltalk.method({
  1800. selector: "selectedCssClass",
  1801. category: 'accessing',
  1802. fn: function (){
  1803. var self=this;
  1804. return smalltalk.withContext(function($ctx1) {
  1805. return "selected";
  1806. }, function($ctx1) {$ctx1.fill(self,"selectedCssClass",{},smalltalk.MKListView)})},
  1807. args: [],
  1808. source: "selectedCssClass\x0a\x09^ 'selected'",
  1809. messageSends: [],
  1810. referencedClasses: []
  1811. }),
  1812. smalltalk.MKListView);
  1813. smalltalk.addMethod(
  1814. smalltalk.method({
  1815. selector: "tag",
  1816. category: 'accessing',
  1817. fn: function (){
  1818. var self=this;
  1819. return smalltalk.withContext(function($ctx1) {
  1820. return "ul";
  1821. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKListView)})},
  1822. args: [],
  1823. source: "tag\x0a\x09^ 'ul'",
  1824. messageSends: [],
  1825. referencedClasses: []
  1826. }),
  1827. smalltalk.MKListView);
  1828. smalltalk.addMethod(
  1829. smalltalk.method({
  1830. selector: "update:",
  1831. category: 'updating',
  1832. fn: function (anAnnouncement){
  1833. var self=this;
  1834. return smalltalk.withContext(function($ctx1) {
  1835. var $2,$1,$3;
  1836. $2=_st(anAnnouncement)._aspect();
  1837. $ctx1.sendIdx["aspect"]=1;
  1838. $1=_st($2).__eq(self._selectionAspect());
  1839. $ctx1.sendIdx["="]=1;
  1840. if(smalltalk.assert($1)){
  1841. self._updateSelectedItem();
  1842. };
  1843. $3=_st(_st(anAnnouncement)._aspect()).__eq(self._collectionAspect());
  1844. if(smalltalk.assert($3)){
  1845. self._update();
  1846. };
  1847. return self}, function($ctx1) {$ctx1.fill(self,"update:",{anAnnouncement:anAnnouncement},smalltalk.MKListView)})},
  1848. args: ["anAnnouncement"],
  1849. source: "update: anAnnouncement\x0a\x09anAnnouncement aspect = self selectionAspect ifTrue: [\x0a\x09\x09self updateSelectedItem ].\x0a\x09\x09\x0a\x09anAnnouncement aspect = self collectionAspect ifTrue: [\x0a\x09\x09self update ]",
  1850. messageSends: ["ifTrue:", "=", "aspect", "selectionAspect", "updateSelectedItem", "collectionAspect", "update"],
  1851. referencedClasses: []
  1852. }),
  1853. smalltalk.MKListView);
  1854. smalltalk.addMethod(
  1855. smalltalk.method({
  1856. selector: "updateSelectedItem",
  1857. category: 'updating',
  1858. fn: function (){
  1859. var self=this;
  1860. return smalltalk.withContext(function($ctx1) {
  1861. self._activateItem_(self._selectedItem());
  1862. return self}, function($ctx1) {$ctx1.fill(self,"updateSelectedItem",{},smalltalk.MKListView)})},
  1863. args: [],
  1864. source: "updateSelectedItem\x0a\x09self activateItem: self selectedItem",
  1865. messageSends: ["activateItem:", "selectedItem"],
  1866. referencedClasses: []
  1867. }),
  1868. smalltalk.MKListView);
  1869. smalltalk.addMethod(
  1870. smalltalk.method({
  1871. selector: "model:collectionAspect:selectionAspect:",
  1872. category: 'instance creation',
  1873. fn: function (aModel,collectionSelector,selectionSelector){
  1874. var self=this;
  1875. return smalltalk.withContext(function($ctx1) {
  1876. var $2,$3,$1;
  1877. $2=self._model_(aModel);
  1878. _st($2)._collectionAspect_(collectionSelector);
  1879. _st($2)._selectionAspect_(selectionSelector);
  1880. $3=_st($2)._yourself();
  1881. $1=$3;
  1882. return $1;
  1883. }, function($ctx1) {$ctx1.fill(self,"model:collectionAspect:selectionAspect:",{aModel:aModel,collectionSelector:collectionSelector,selectionSelector:selectionSelector},smalltalk.MKListView.klass)})},
  1884. args: ["aModel", "collectionSelector", "selectionSelector"],
  1885. source: "model: aModel collectionAspect: collectionSelector selectionAspect: selectionSelector\x0a\x09^ (self model: aModel)\x0a\x09\x09collectionAspect: collectionSelector;\x0a\x09\x09selectionAspect: selectionSelector;\x0a\x09\x09yourself",
  1886. messageSends: ["collectionAspect:", "model:", "selectionAspect:", "yourself"],
  1887. referencedClasses: []
  1888. }),
  1889. smalltalk.MKListView.klass);
  1890. smalltalk.addClass('MKDropdownListView', smalltalk.MKListView, [], 'Moka-Views');
  1891. smalltalk.MKDropdownListView.comment="I am similar to a `MKListView`, but inside a `MKDropdownView`.";
  1892. smalltalk.addMethod(
  1893. smalltalk.method({
  1894. selector: "cssClass",
  1895. category: 'accessing',
  1896. fn: function (){
  1897. var self=this;
  1898. return smalltalk.withContext(function($ctx1) {
  1899. var $1;
  1900. $1=_st(smalltalk.MKDropdownListView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_dropdown_list");
  1901. return $1;
  1902. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKDropdownListView)})},
  1903. args: [],
  1904. source: "cssClass\x0a\x09^ super cssClass, ' mk_dropdown_list'",
  1905. messageSends: [",", "cssClass"],
  1906. referencedClasses: []
  1907. }),
  1908. smalltalk.MKDropdownListView);
  1909. smalltalk.addMethod(
  1910. smalltalk.method({
  1911. selector: "defaultControllerClass",
  1912. category: 'accessing',
  1913. fn: function (){
  1914. var self=this;
  1915. function $MKDropdownListController(){return smalltalk.MKDropdownListController||(typeof MKDropdownListController=="undefined"?nil:MKDropdownListController)}
  1916. return smalltalk.withContext(function($ctx1) {
  1917. return $MKDropdownListController();
  1918. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKDropdownListView)})},
  1919. args: [],
  1920. source: "defaultControllerClass\x0a\x09^ MKDropdownListController",
  1921. messageSends: [],
  1922. referencedClasses: ["MKDropdownListController"]
  1923. }),
  1924. smalltalk.MKDropdownListView);
  1925. smalltalk.addClass('MKSourceListView', smalltalk.MKListView, [], 'Moka-Views');
  1926. smalltalk.MKSourceListView.comment="I am similar to a `MKListView`, but displayed slightly differently, in a similar way as in the left-side the of Finder in OSX.";
  1927. smalltalk.addMethod(
  1928. smalltalk.method({
  1929. selector: "cssClass",
  1930. category: 'accessing',
  1931. fn: function (){
  1932. var self=this;
  1933. return smalltalk.withContext(function($ctx1) {
  1934. var $1;
  1935. $1=_st(smalltalk.MKSourceListView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_sourcelist");
  1936. return $1;
  1937. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKSourceListView)})},
  1938. args: [],
  1939. source: "cssClass\x0a\x09^ super cssClass, ' mk_sourcelist'",
  1940. messageSends: [",", "cssClass"],
  1941. referencedClasses: []
  1942. }),
  1943. smalltalk.MKSourceListView);
  1944. smalltalk.addClass('MKTextAreaView', smalltalk.MKSingleAspectView, [], 'Moka-Views');
  1945. smalltalk.MKTextAreaView.comment="I am an text area view. My default controller is `MKAnyKeyInputController`.\x0a\x0aMy controller must answer to `#onKeyPressed:`.";
  1946. smalltalk.addMethod(
  1947. smalltalk.method({
  1948. selector: "cssClass",
  1949. category: 'accessing',
  1950. fn: function (){
  1951. var self=this;
  1952. return smalltalk.withContext(function($ctx1) {
  1953. var $1;
  1954. $1=_st(smalltalk.MKTextAreaView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_textarea");
  1955. return $1;
  1956. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKTextAreaView)})},
  1957. args: [],
  1958. source: "cssClass\x0a\x09^ super cssClass, ' mk_textarea'",
  1959. messageSends: [",", "cssClass"],
  1960. referencedClasses: []
  1961. }),
  1962. smalltalk.MKTextAreaView);
  1963. smalltalk.addMethod(
  1964. smalltalk.method({
  1965. selector: "defaultControllerClass",
  1966. category: 'defaults',
  1967. fn: function (){
  1968. var self=this;
  1969. function $MKAnyKeyInputController(){return smalltalk.MKAnyKeyInputController||(typeof MKAnyKeyInputController=="undefined"?nil:MKAnyKeyInputController)}
  1970. return smalltalk.withContext(function($ctx1) {
  1971. return $MKAnyKeyInputController();
  1972. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKTextAreaView)})},
  1973. args: [],
  1974. source: "defaultControllerClass\x0a\x09^ MKAnyKeyInputController",
  1975. messageSends: [],
  1976. referencedClasses: ["MKAnyKeyInputController"]
  1977. }),
  1978. smalltalk.MKTextAreaView);
  1979. smalltalk.addMethod(
  1980. smalltalk.method({
  1981. selector: "defaultLayout",
  1982. category: 'defaults',
  1983. fn: function (){
  1984. var self=this;
  1985. return smalltalk.withContext(function($ctx1) {
  1986. var $2,$3,$1;
  1987. $2=smalltalk.MKTextAreaView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  1988. _st($2)._width_((160));
  1989. _st($2)._height_((80));
  1990. $3=_st($2)._yourself();
  1991. $1=$3;
  1992. return $1;
  1993. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKTextAreaView)})},
  1994. args: [],
  1995. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 160;\x0a\x09\x09height: 80;\x0a\x09\x09yourself",
  1996. messageSends: ["width:", "defaultLayout", "height:", "yourself"],
  1997. referencedClasses: []
  1998. }),
  1999. smalltalk.MKTextAreaView);
  2000. smalltalk.addMethod(
  2001. smalltalk.method({
  2002. selector: "renderContentOn:",
  2003. category: 'rendering',
  2004. fn: function (html){
  2005. var self=this;
  2006. return smalltalk.withContext(function($ctx1) {
  2007. _st(self["@root"])._with_(self._aspectValue());
  2008. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKTextAreaView)})},
  2009. args: ["html"],
  2010. source: "renderContentOn: html\x0a\x09root with: self aspectValue",
  2011. messageSends: ["with:", "aspectValue"],
  2012. referencedClasses: []
  2013. }),
  2014. smalltalk.MKTextAreaView);
  2015. smalltalk.addMethod(
  2016. smalltalk.method({
  2017. selector: "tag",
  2018. category: 'accessing',
  2019. fn: function (){
  2020. var self=this;
  2021. return smalltalk.withContext(function($ctx1) {
  2022. return "textarea";
  2023. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKTextAreaView)})},
  2024. args: [],
  2025. source: "tag\x0a\x09^ 'textarea'",
  2026. messageSends: [],
  2027. referencedClasses: []
  2028. }),
  2029. smalltalk.MKTextAreaView);
  2030. smalltalk.addMethod(
  2031. smalltalk.method({
  2032. selector: "update",
  2033. category: 'updating',
  2034. fn: function (){
  2035. var self=this;
  2036. return smalltalk.withContext(function($ctx1) {
  2037. var $1;
  2038. $1=self["@root"];
  2039. if(($receiver = $1) == nil || $receiver == null){
  2040. $1;
  2041. } else {
  2042. _st(_st(self["@root"])._asJQuery())._val_(self._aspectValue());
  2043. };
  2044. return self}, function($ctx1) {$ctx1.fill(self,"update",{},smalltalk.MKTextAreaView)})},
  2045. args: [],
  2046. source: "update\x0a\x09root ifNotNil: [ root asJQuery val: self aspectValue ]",
  2047. messageSends: ["ifNotNil:", "val:", "asJQuery", "aspectValue"],
  2048. referencedClasses: []
  2049. }),
  2050. smalltalk.MKTextAreaView);
  2051. smalltalk.addMethod(
  2052. smalltalk.method({
  2053. selector: "value",
  2054. category: 'accessing',
  2055. fn: function (){
  2056. var self=this;
  2057. return smalltalk.withContext(function($ctx1) {
  2058. var $1;
  2059. $1=_st(_st(self["@root"])._asJQuery())._val();
  2060. return $1;
  2061. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.MKTextAreaView)})},
  2062. args: [],
  2063. source: "value\x0a\x09^ root asJQuery val",
  2064. messageSends: ["val", "asJQuery"],
  2065. referencedClasses: []
  2066. }),
  2067. smalltalk.MKTextAreaView);
  2068. smalltalk.addClass('MKInputView', smalltalk.MKTextAreaView, [], 'Moka-Views');
  2069. smalltalk.MKInputView.comment="I am an input view. My default controller is `MKEnterInputController`.\x0a\x0aMy controller must answer to `#onKeyPressed:`.";
  2070. smalltalk.addMethod(
  2071. smalltalk.method({
  2072. selector: "cssClass",
  2073. category: 'accessing',
  2074. fn: function (){
  2075. var self=this;
  2076. return smalltalk.withContext(function($ctx1) {
  2077. return "moka_view mk_input";
  2078. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKInputView)})},
  2079. args: [],
  2080. source: "cssClass\x0a\x09^ 'moka_view mk_input'",
  2081. messageSends: [],
  2082. referencedClasses: []
  2083. }),
  2084. smalltalk.MKInputView);
  2085. smalltalk.addMethod(
  2086. smalltalk.method({
  2087. selector: "defaultControllerClass",
  2088. category: 'defaults',
  2089. fn: function (){
  2090. var self=this;
  2091. function $MKEnterInputController(){return smalltalk.MKEnterInputController||(typeof MKEnterInputController=="undefined"?nil:MKEnterInputController)}
  2092. return smalltalk.withContext(function($ctx1) {
  2093. return $MKEnterInputController();
  2094. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKInputView)})},
  2095. args: [],
  2096. source: "defaultControllerClass\x0a\x09^ MKEnterInputController",
  2097. messageSends: [],
  2098. referencedClasses: ["MKEnterInputController"]
  2099. }),
  2100. smalltalk.MKInputView);
  2101. smalltalk.addMethod(
  2102. smalltalk.method({
  2103. selector: "defaultLayout",
  2104. category: 'defaults',
  2105. fn: function (){
  2106. var self=this;
  2107. return smalltalk.withContext(function($ctx1) {
  2108. var $2,$3,$1;
  2109. $2=smalltalk.MKInputView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  2110. _st($2)._width_((160));
  2111. _st($2)._height_((24));
  2112. $3=_st($2)._yourself();
  2113. $1=$3;
  2114. return $1;
  2115. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKInputView)})},
  2116. args: [],
  2117. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 160;\x0a\x09\x09height: 24;\x0a\x09\x09yourself",
  2118. messageSends: ["width:", "defaultLayout", "height:", "yourself"],
  2119. referencedClasses: []
  2120. }),
  2121. smalltalk.MKInputView);
  2122. smalltalk.addMethod(
  2123. smalltalk.method({
  2124. selector: "renderContentOn:",
  2125. category: 'rendering',
  2126. fn: function (html){
  2127. var self=this;
  2128. return smalltalk.withContext(function($ctx1) {
  2129. _st(self["@root"])._value_(self._aspectValue());
  2130. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKInputView)})},
  2131. args: ["html"],
  2132. source: "renderContentOn: html\x0a\x09root value: self aspectValue",
  2133. messageSends: ["value:", "aspectValue"],
  2134. referencedClasses: []
  2135. }),
  2136. smalltalk.MKInputView);
  2137. smalltalk.addMethod(
  2138. smalltalk.method({
  2139. selector: "tag",
  2140. category: 'accessing',
  2141. fn: function (){
  2142. var self=this;
  2143. return smalltalk.withContext(function($ctx1) {
  2144. return "input";
  2145. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKInputView)})},
  2146. args: [],
  2147. source: "tag\x0a\x09^ 'input'",
  2148. messageSends: [],
  2149. referencedClasses: []
  2150. }),
  2151. smalltalk.MKInputView);
  2152. smalltalk.addMethod(
  2153. smalltalk.method({
  2154. selector: "triggerChangeOnAnyKey",
  2155. category: 'settings',
  2156. fn: function (){
  2157. var self=this;
  2158. function $MKAnyKeyInputController(){return smalltalk.MKAnyKeyInputController||(typeof MKAnyKeyInputController=="undefined"?nil:MKAnyKeyInputController)}
  2159. return smalltalk.withContext(function($ctx1) {
  2160. self._controller_(_st($MKAnyKeyInputController())._new());
  2161. return self}, function($ctx1) {$ctx1.fill(self,"triggerChangeOnAnyKey",{},smalltalk.MKInputView)})},
  2162. args: [],
  2163. source: "triggerChangeOnAnyKey\x0a\x09self controller: MKAnyKeyInputController new",
  2164. messageSends: ["controller:", "new"],
  2165. referencedClasses: ["MKAnyKeyInputController"]
  2166. }),
  2167. smalltalk.MKInputView);
  2168. smalltalk.addMethod(
  2169. smalltalk.method({
  2170. selector: "triggerChangeOnEnter",
  2171. category: 'settings',
  2172. fn: function (){
  2173. var self=this;
  2174. function $MKEnterInputController(){return smalltalk.MKEnterInputController||(typeof MKEnterInputController=="undefined"?nil:MKEnterInputController)}
  2175. return smalltalk.withContext(function($ctx1) {
  2176. self._controller_(_st($MKEnterInputController())._new());
  2177. return self}, function($ctx1) {$ctx1.fill(self,"triggerChangeOnEnter",{},smalltalk.MKInputView)})},
  2178. args: [],
  2179. source: "triggerChangeOnEnter\x0a\x09self controller: MKEnterInputController new",
  2180. messageSends: ["controller:", "new"],
  2181. referencedClasses: ["MKEnterInputController"]
  2182. }),
  2183. smalltalk.MKInputView);
  2184. });