Moka-Views.js 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606
  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('MKLabelView', smalltalk.MKSingleAspectView, [], 'Moka-Views');
  407. smalltalk.MKLabelView.comment="I am an label view. I display a `String`.";
  408. smalltalk.addMethod(
  409. smalltalk.method({
  410. selector: "cssClass",
  411. category: 'accessing',
  412. fn: function (){
  413. var self=this;
  414. return smalltalk.withContext(function($ctx1) {
  415. var $1;
  416. $1=_st(smalltalk.MKLabelView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_label");
  417. return $1;
  418. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKLabelView)})},
  419. args: [],
  420. source: "cssClass\x0a\x09^ super cssClass, ' mk_label'",
  421. messageSends: [",", "cssClass"],
  422. referencedClasses: []
  423. }),
  424. smalltalk.MKLabelView);
  425. smalltalk.addMethod(
  426. smalltalk.method({
  427. selector: "defaultControllerClass",
  428. category: 'defaults',
  429. fn: function (){
  430. var self=this;
  431. return smalltalk.withContext(function($ctx1) {
  432. var $1;
  433. $1=smalltalk.MKLabelView.superclass.fn.prototype._defaultControllerClass.apply(_st(self), []);
  434. return $1;
  435. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKLabelView)})},
  436. args: [],
  437. source: "defaultControllerClass\x0a\x09^ super defaultControllerClass",
  438. messageSends: ["defaultControllerClass"],
  439. referencedClasses: []
  440. }),
  441. smalltalk.MKLabelView);
  442. smalltalk.addMethod(
  443. smalltalk.method({
  444. selector: "defaultLayout",
  445. category: 'defaults',
  446. fn: function (){
  447. var self=this;
  448. function $MKLabelLayout(){return smalltalk.MKLabelLayout||(typeof MKLabelLayout=="undefined"?nil:MKLabelLayout)}
  449. return smalltalk.withContext(function($ctx1) {
  450. var $2,$3,$1;
  451. $2=_st($MKLabelLayout())._new();
  452. _st($2)._height_((24));
  453. _st($2)._top_((0));
  454. _st($2)._left_((0));
  455. _st($2)._right_((0));
  456. _st($2)._textAlign_("left");
  457. $3=_st($2)._yourself();
  458. $1=$3;
  459. return $1;
  460. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKLabelView)})},
  461. args: [],
  462. 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",
  463. messageSends: ["height:", "new", "top:", "left:", "right:", "textAlign:", "yourself"],
  464. referencedClasses: ["MKLabelLayout"]
  465. }),
  466. smalltalk.MKLabelView);
  467. smalltalk.addMethod(
  468. smalltalk.method({
  469. selector: "renderContentOn:",
  470. category: 'rendering',
  471. fn: function (html){
  472. var self=this;
  473. return smalltalk.withContext(function($ctx1) {
  474. _st(html)._with_(self._aspectValue());
  475. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKLabelView)})},
  476. args: ["html"],
  477. source: "renderContentOn: html\x0a\x09html with: self aspectValue",
  478. messageSends: ["with:", "aspectValue"],
  479. referencedClasses: []
  480. }),
  481. smalltalk.MKLabelView);
  482. smalltalk.addMethod(
  483. smalltalk.method({
  484. selector: "textAlign:",
  485. category: 'layout',
  486. fn: function (aString){
  487. var self=this;
  488. return smalltalk.withContext(function($ctx1) {
  489. _st(self._layout())._textAlign_(aString);
  490. return self}, function($ctx1) {$ctx1.fill(self,"textAlign:",{aString:aString},smalltalk.MKLabelView)})},
  491. args: ["aString"],
  492. source: "textAlign: aString\x0a\x09self layout textAlign: aString",
  493. messageSends: ["textAlign:", "layout"],
  494. referencedClasses: []
  495. }),
  496. smalltalk.MKLabelView);
  497. smalltalk.addClass('MKHeadingView', smalltalk.MKLabelView, ['level'], 'Moka-Views');
  498. smalltalk.MKHeadingView.comment="I display a heading, with a `level` from 1 to 6.";
  499. smalltalk.addMethod(
  500. smalltalk.method({
  501. selector: "cssClass",
  502. category: 'accessing',
  503. fn: function (){
  504. var self=this;
  505. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  506. return smalltalk.withContext(function($ctx1) {
  507. var $2,$1;
  508. $1=_st($String())._streamContents_((function(stream){
  509. return smalltalk.withContext(function($ctx2) {
  510. $2=_st(_st(stream).__lt_lt(smalltalk.MKHeadingView.superclass.fn.prototype._cssClass.apply(_st(self), []))).__lt_lt(" mk_heading level");
  511. $ctx2.sendIdx["<<"]=2;
  512. return _st($2).__lt_lt(_st(self._level())._asString());
  513. $ctx2.sendIdx["<<"]=1;
  514. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})}));
  515. return $1;
  516. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKHeadingView)})},
  517. args: [],
  518. 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 ]",
  519. messageSends: ["streamContents:", "<<", "cssClass", "asString", "level"],
  520. referencedClasses: ["String"]
  521. }),
  522. smalltalk.MKHeadingView);
  523. smalltalk.addMethod(
  524. smalltalk.method({
  525. selector: "level",
  526. category: 'accessing',
  527. fn: function (){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx1) {
  530. var $2,$1;
  531. $2=self["@level"];
  532. if(($receiver = $2) == nil || $receiver == null){
  533. $1=(1);
  534. } else {
  535. $1=$2;
  536. };
  537. return $1;
  538. }, function($ctx1) {$ctx1.fill(self,"level",{},smalltalk.MKHeadingView)})},
  539. args: [],
  540. source: "level\x0a\x09^ level ifNil: [ 1 ]",
  541. messageSends: ["ifNil:"],
  542. referencedClasses: []
  543. }),
  544. smalltalk.MKHeadingView);
  545. smalltalk.addMethod(
  546. smalltalk.method({
  547. selector: "level:",
  548. category: 'accessing',
  549. fn: function (aNumber){
  550. var self=this;
  551. return smalltalk.withContext(function($ctx1) {
  552. self["@level"]=aNumber;
  553. return self}, function($ctx1) {$ctx1.fill(self,"level:",{aNumber:aNumber},smalltalk.MKHeadingView)})},
  554. args: ["aNumber"],
  555. source: "level: aNumber\x0a\x09level := aNumber",
  556. messageSends: [],
  557. referencedClasses: []
  558. }),
  559. smalltalk.MKHeadingView);
  560. smalltalk.addMethod(
  561. smalltalk.method({
  562. selector: "tag",
  563. category: 'accessing',
  564. fn: function (){
  565. var self=this;
  566. return smalltalk.withContext(function($ctx1) {
  567. var $1;
  568. $1="h".__comma(_st(self._level())._asString());
  569. return $1;
  570. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKHeadingView)})},
  571. args: [],
  572. source: "tag\x0a\x09^ 'h', self level asString",
  573. messageSends: [",", "asString", "level"],
  574. referencedClasses: []
  575. }),
  576. smalltalk.MKHeadingView);
  577. smalltalk.addClass('MKOverlayView', smalltalk.MKLayoutView, ['childView'], 'Moka-Views');
  578. smalltalk.MKOverlayView.comment="I display an transparent overlay, typically over other views, except my `childView`.\x0a\x0a## API\x0a\x0aCreate instances using the class-side `childView:` method.";
  579. smalltalk.addMethod(
  580. smalltalk.method({
  581. selector: "childView",
  582. category: 'accessing',
  583. fn: function (){
  584. var self=this;
  585. return smalltalk.withContext(function($ctx1) {
  586. var $1;
  587. $1=self["@childView"];
  588. return $1;
  589. }, function($ctx1) {$ctx1.fill(self,"childView",{},smalltalk.MKOverlayView)})},
  590. args: [],
  591. source: "childView\x0a\x09^ childView",
  592. messageSends: [],
  593. referencedClasses: []
  594. }),
  595. smalltalk.MKOverlayView);
  596. smalltalk.addMethod(
  597. smalltalk.method({
  598. selector: "childView:",
  599. category: 'accessing',
  600. fn: function (aView){
  601. var self=this;
  602. return smalltalk.withContext(function($ctx1) {
  603. self["@childView"]=aView;
  604. return self}, function($ctx1) {$ctx1.fill(self,"childView:",{aView:aView},smalltalk.MKOverlayView)})},
  605. args: ["aView"],
  606. source: "childView: aView\x0a\x09childView := aView",
  607. messageSends: [],
  608. referencedClasses: []
  609. }),
  610. smalltalk.MKOverlayView);
  611. smalltalk.addMethod(
  612. smalltalk.method({
  613. selector: "children",
  614. category: 'accessing',
  615. fn: function (){
  616. var self=this;
  617. return smalltalk.withContext(function($ctx1) {
  618. var $1;
  619. $1=[self._childView()];
  620. return $1;
  621. }, function($ctx1) {$ctx1.fill(self,"children",{},smalltalk.MKOverlayView)})},
  622. args: [],
  623. source: "children\x0a\x09^ { self childView }",
  624. messageSends: ["childView"],
  625. referencedClasses: []
  626. }),
  627. smalltalk.MKOverlayView);
  628. smalltalk.addMethod(
  629. smalltalk.method({
  630. selector: "cssClass",
  631. category: 'accessing',
  632. fn: function (){
  633. var self=this;
  634. return smalltalk.withContext(function($ctx1) {
  635. var $1;
  636. $1=_st(smalltalk.MKOverlayView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_overlay");
  637. return $1;
  638. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKOverlayView)})},
  639. args: [],
  640. source: "cssClass\x0a\x09^ super cssClass, ' mk_overlay'",
  641. messageSends: [",", "cssClass"],
  642. referencedClasses: []
  643. }),
  644. smalltalk.MKOverlayView);
  645. smalltalk.addMethod(
  646. smalltalk.method({
  647. selector: "defaultControllerClass",
  648. category: 'defaults',
  649. fn: function (){
  650. var self=this;
  651. function $MKOverlayController(){return smalltalk.MKOverlayController||(typeof MKOverlayController=="undefined"?nil:MKOverlayController)}
  652. return smalltalk.withContext(function($ctx1) {
  653. return $MKOverlayController();
  654. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKOverlayView)})},
  655. args: [],
  656. source: "defaultControllerClass\x0a\x09^ MKOverlayController",
  657. messageSends: [],
  658. referencedClasses: ["MKOverlayController"]
  659. }),
  660. smalltalk.MKOverlayView);
  661. smalltalk.addMethod(
  662. smalltalk.method({
  663. selector: "remove",
  664. category: 'actions',
  665. fn: function (){
  666. var self=this;
  667. return smalltalk.withContext(function($ctx1) {
  668. smalltalk.MKOverlayView.superclass.fn.prototype._remove.apply(_st(self), []);
  669. $ctx1.sendIdx["remove"]=1;
  670. _st(self._childView())._remove();
  671. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.MKOverlayView)})},
  672. args: [],
  673. source: "remove\x0a\x09super remove.\x0a\x09self childView remove",
  674. messageSends: ["remove", "childView"],
  675. referencedClasses: []
  676. }),
  677. smalltalk.MKOverlayView);
  678. smalltalk.addMethod(
  679. smalltalk.method({
  680. selector: "renderContentOn:",
  681. category: 'defaults',
  682. fn: function (html){
  683. var self=this;
  684. return smalltalk.withContext(function($ctx1) {
  685. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKOverlayView)})},
  686. args: ["html"],
  687. source: "renderContentOn: html\x0a\x09\x22Left empty on purpose. \x0a\x09No Content is rendered, as the childView is actually displayed separately\x22",
  688. messageSends: [],
  689. referencedClasses: []
  690. }),
  691. smalltalk.MKOverlayView);
  692. smalltalk.addMethod(
  693. smalltalk.method({
  694. selector: "childView:",
  695. category: 'instance creation',
  696. fn: function (aView){
  697. var self=this;
  698. return smalltalk.withContext(function($ctx1) {
  699. var $2,$3,$1;
  700. $2=self._new();
  701. _st($2)._childView_(aView);
  702. $3=_st($2)._yourself();
  703. $1=$3;
  704. return $1;
  705. }, function($ctx1) {$ctx1.fill(self,"childView:",{aView:aView},smalltalk.MKOverlayView.klass)})},
  706. args: ["aView"],
  707. source: "childView: aView\x0a\x09^ self new\x0a\x09\x09childView: aView;\x0a\x09\x09yourself",
  708. messageSends: ["childView:", "new", "yourself"],
  709. referencedClasses: []
  710. }),
  711. smalltalk.MKOverlayView.klass);
  712. smalltalk.addClass('MKPaneView', smalltalk.MKLayoutView, ['views'], 'Moka-Views');
  713. smalltalk.MKPaneView.comment="I am a view containing other views.\x0a\x0a## API\x0a\x0aUse `#addView:` to add a view to the pane.";
  714. smalltalk.addMethod(
  715. smalltalk.method({
  716. selector: "addView:",
  717. category: 'adding',
  718. fn: function (aView){
  719. var self=this;
  720. return smalltalk.withContext(function($ctx1) {
  721. _st(self._views())._add_(aView);
  722. return self}, function($ctx1) {$ctx1.fill(self,"addView:",{aView:aView},smalltalk.MKPaneView)})},
  723. args: ["aView"],
  724. source: "addView: aView\x0a\x09self views add: aView",
  725. messageSends: ["add:", "views"],
  726. referencedClasses: []
  727. }),
  728. smalltalk.MKPaneView);
  729. smalltalk.addMethod(
  730. smalltalk.method({
  731. selector: "borderBottom:",
  732. category: 'layout',
  733. fn: function (aNumber){
  734. var self=this;
  735. return smalltalk.withContext(function($ctx1) {
  736. _st(self._layout())._borderBottom_(aNumber);
  737. return self}, function($ctx1) {$ctx1.fill(self,"borderBottom:",{aNumber:aNumber},smalltalk.MKPaneView)})},
  738. args: ["aNumber"],
  739. source: "borderBottom: aNumber\x0a\x09self layout borderBottom: aNumber",
  740. messageSends: ["borderBottom:", "layout"],
  741. referencedClasses: []
  742. }),
  743. smalltalk.MKPaneView);
  744. smalltalk.addMethod(
  745. smalltalk.method({
  746. selector: "borderLeft:",
  747. category: 'layout',
  748. fn: function (aNumber){
  749. var self=this;
  750. return smalltalk.withContext(function($ctx1) {
  751. _st(self._layout())._borderLeft_(aNumber);
  752. return self}, function($ctx1) {$ctx1.fill(self,"borderLeft:",{aNumber:aNumber},smalltalk.MKPaneView)})},
  753. args: ["aNumber"],
  754. source: "borderLeft: aNumber\x0a\x09self layout borderLeft: aNumber",
  755. messageSends: ["borderLeft:", "layout"],
  756. referencedClasses: []
  757. }),
  758. smalltalk.MKPaneView);
  759. smalltalk.addMethod(
  760. smalltalk.method({
  761. selector: "borderRight:",
  762. category: 'layout',
  763. fn: function (aNumber){
  764. var self=this;
  765. return smalltalk.withContext(function($ctx1) {
  766. _st(self._layout())._borderRight_(aNumber);
  767. return self}, function($ctx1) {$ctx1.fill(self,"borderRight:",{aNumber:aNumber},smalltalk.MKPaneView)})},
  768. args: ["aNumber"],
  769. source: "borderRight: aNumber\x0a\x09self layout borderRight: aNumber",
  770. messageSends: ["borderRight:", "layout"],
  771. referencedClasses: []
  772. }),
  773. smalltalk.MKPaneView);
  774. smalltalk.addMethod(
  775. smalltalk.method({
  776. selector: "borderTop:",
  777. category: 'layout',
  778. fn: function (aNumber){
  779. var self=this;
  780. return smalltalk.withContext(function($ctx1) {
  781. _st(self._layout())._borderTop_(aNumber);
  782. return self}, function($ctx1) {$ctx1.fill(self,"borderTop:",{aNumber:aNumber},smalltalk.MKPaneView)})},
  783. args: ["aNumber"],
  784. source: "borderTop: aNumber\x0a\x09self layout borderTop: aNumber",
  785. messageSends: ["borderTop:", "layout"],
  786. referencedClasses: []
  787. }),
  788. smalltalk.MKPaneView);
  789. smalltalk.addMethod(
  790. smalltalk.method({
  791. selector: "children",
  792. category: 'accessing',
  793. fn: function (){
  794. var self=this;
  795. return smalltalk.withContext(function($ctx1) {
  796. var $1;
  797. $1=self._views();
  798. return $1;
  799. }, function($ctx1) {$ctx1.fill(self,"children",{},smalltalk.MKPaneView)})},
  800. args: [],
  801. source: "children\x0a\x09^ self views",
  802. messageSends: ["views"],
  803. referencedClasses: []
  804. }),
  805. smalltalk.MKPaneView);
  806. smalltalk.addMethod(
  807. smalltalk.method({
  808. selector: "cssClass",
  809. category: 'accessing',
  810. fn: function (){
  811. var self=this;
  812. return smalltalk.withContext(function($ctx1) {
  813. var $1;
  814. $1=_st(smalltalk.MKPaneView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_pane");
  815. return $1;
  816. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKPaneView)})},
  817. args: [],
  818. source: "cssClass\x0a\x09^ super cssClass, ' mk_pane'",
  819. messageSends: [",", "cssClass"],
  820. referencedClasses: []
  821. }),
  822. smalltalk.MKPaneView);
  823. smalltalk.addMethod(
  824. smalltalk.method({
  825. selector: "defaultLayout",
  826. category: 'defaults',
  827. fn: function (){
  828. var self=this;
  829. function $MKPaneLayout(){return smalltalk.MKPaneLayout||(typeof MKPaneLayout=="undefined"?nil:MKPaneLayout)}
  830. return smalltalk.withContext(function($ctx1) {
  831. var $2,$3,$1;
  832. $2=_st($MKPaneLayout())._new();
  833. _st($2)._left_((0));
  834. _st($2)._top_((0));
  835. _st($2)._right_((0));
  836. _st($2)._bottom_((0));
  837. $3=_st($2)._yourself();
  838. $1=$3;
  839. return $1;
  840. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKPaneView)})},
  841. args: [],
  842. 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",
  843. messageSends: ["left:", "new", "top:", "right:", "bottom:", "yourself"],
  844. referencedClasses: ["MKPaneLayout"]
  845. }),
  846. smalltalk.MKPaneView);
  847. smalltalk.addMethod(
  848. smalltalk.method({
  849. selector: "renderContentOn:",
  850. category: 'rendering',
  851. fn: function (html){
  852. var self=this;
  853. return smalltalk.withContext(function($ctx1) {
  854. _st(self._views())._do_((function(each){
  855. return smalltalk.withContext(function($ctx2) {
  856. return _st(html)._with_(each);
  857. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  858. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKPaneView)})},
  859. args: ["html"],
  860. source: "renderContentOn: html\x0a\x09self views do: [ :each | \x0a\x09\x09html with: each ]",
  861. messageSends: ["do:", "views", "with:"],
  862. referencedClasses: []
  863. }),
  864. smalltalk.MKPaneView);
  865. smalltalk.addMethod(
  866. smalltalk.method({
  867. selector: "views",
  868. category: 'accessing',
  869. fn: function (){
  870. var self=this;
  871. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  872. return smalltalk.withContext(function($ctx1) {
  873. var $2,$1;
  874. $2=self["@views"];
  875. if(($receiver = $2) == nil || $receiver == null){
  876. self["@views"]=_st($OrderedCollection())._new();
  877. $1=self["@views"];
  878. } else {
  879. $1=$2;
  880. };
  881. return $1;
  882. }, function($ctx1) {$ctx1.fill(self,"views",{},smalltalk.MKPaneView)})},
  883. args: [],
  884. source: "views\x0a\x09^ views ifNil: [ views := OrderedCollection new ]",
  885. messageSends: ["ifNil:", "new"],
  886. referencedClasses: ["OrderedCollection"]
  887. }),
  888. smalltalk.MKPaneView);
  889. smalltalk.addClass('MKPanelView', smalltalk.MKPaneView, [], 'Moka-Views');
  890. smalltalk.MKPanelView.comment="I am similar to a `MKPaneView` but I am scrollable and display a light background.";
  891. smalltalk.addMethod(
  892. smalltalk.method({
  893. selector: "cssClass",
  894. category: 'accessing',
  895. fn: function (){
  896. var self=this;
  897. return smalltalk.withContext(function($ctx1) {
  898. var $1;
  899. $1=_st(smalltalk.MKPanelView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_panel");
  900. return $1;
  901. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKPanelView)})},
  902. args: [],
  903. source: "cssClass\x0a\x09^ super cssClass, ' mk_panel'",
  904. messageSends: [",", "cssClass"],
  905. referencedClasses: []
  906. }),
  907. smalltalk.MKPanelView);
  908. smalltalk.addClass('MKSelectionView', smalltalk.MKAspectsView, ['selectionAspect', 'collectionAspect', 'displayBlock'], 'Moka-Views');
  909. smalltalk.MKSelectionView.comment="I an abstract selection view of a list of elements.";
  910. smalltalk.addMethod(
  911. smalltalk.method({
  912. selector: "collection",
  913. category: 'accessing',
  914. fn: function (){
  915. var self=this;
  916. return smalltalk.withContext(function($ctx1) {
  917. var $1;
  918. $1=self._valueForAspect_(self._collectionAspect());
  919. return $1;
  920. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.MKSelectionView)})},
  921. args: [],
  922. source: "collection\x0a\x09^ self valueForAspect: self collectionAspect",
  923. messageSends: ["valueForAspect:", "collectionAspect"],
  924. referencedClasses: []
  925. }),
  926. smalltalk.MKSelectionView);
  927. smalltalk.addMethod(
  928. smalltalk.method({
  929. selector: "collectionAspect",
  930. category: 'accessing',
  931. fn: function (){
  932. var self=this;
  933. return smalltalk.withContext(function($ctx1) {
  934. var $1;
  935. $1=self["@collectionAspect"];
  936. return $1;
  937. }, function($ctx1) {$ctx1.fill(self,"collectionAspect",{},smalltalk.MKSelectionView)})},
  938. args: [],
  939. source: "collectionAspect\x0a\x09^ collectionAspect",
  940. messageSends: [],
  941. referencedClasses: []
  942. }),
  943. smalltalk.MKSelectionView);
  944. smalltalk.addMethod(
  945. smalltalk.method({
  946. selector: "collectionAspect:",
  947. category: 'accessing',
  948. fn: function (aSelector){
  949. var self=this;
  950. return smalltalk.withContext(function($ctx1) {
  951. self["@collectionAspect"]=aSelector;
  952. return self}, function($ctx1) {$ctx1.fill(self,"collectionAspect:",{aSelector:aSelector},smalltalk.MKSelectionView)})},
  953. args: ["aSelector"],
  954. source: "collectionAspect: aSelector\x0a\x09collectionAspect := aSelector",
  955. messageSends: [],
  956. referencedClasses: []
  957. }),
  958. smalltalk.MKSelectionView);
  959. smalltalk.addMethod(
  960. smalltalk.method({
  961. selector: "defaultDisplayBlock",
  962. category: 'defaults',
  963. fn: function (){
  964. var self=this;
  965. return smalltalk.withContext(function($ctx1) {
  966. var $1;
  967. $1=(function(item){
  968. return smalltalk.withContext(function($ctx2) {
  969. return _st(item)._asString();
  970. }, function($ctx2) {$ctx2.fillBlock({item:item},$ctx1,1)})});
  971. return $1;
  972. }, function($ctx1) {$ctx1.fill(self,"defaultDisplayBlock",{},smalltalk.MKSelectionView)})},
  973. args: [],
  974. source: "defaultDisplayBlock\x0a\x09^ [ :item | item asString ]",
  975. messageSends: ["asString"],
  976. referencedClasses: []
  977. }),
  978. smalltalk.MKSelectionView);
  979. smalltalk.addMethod(
  980. smalltalk.method({
  981. selector: "displayBlock",
  982. category: 'accessing',
  983. fn: function (){
  984. var self=this;
  985. return smalltalk.withContext(function($ctx1) {
  986. var $2,$1;
  987. $2=self["@displayBlock"];
  988. if(($receiver = $2) == nil || $receiver == null){
  989. $1=self._defaultDisplayBlock();
  990. } else {
  991. $1=$2;
  992. };
  993. return $1;
  994. }, function($ctx1) {$ctx1.fill(self,"displayBlock",{},smalltalk.MKSelectionView)})},
  995. args: [],
  996. source: "displayBlock\x0a\x09^ displayBlock ifNil: [ self defaultDisplayBlock ]",
  997. messageSends: ["ifNil:", "defaultDisplayBlock"],
  998. referencedClasses: []
  999. }),
  1000. smalltalk.MKSelectionView);
  1001. smalltalk.addMethod(
  1002. smalltalk.method({
  1003. selector: "displayBlock:",
  1004. category: 'accessing',
  1005. fn: function (aBlock){
  1006. var self=this;
  1007. return smalltalk.withContext(function($ctx1) {
  1008. self["@displayBlock"]=aBlock;
  1009. return self}, function($ctx1) {$ctx1.fill(self,"displayBlock:",{aBlock:aBlock},smalltalk.MKSelectionView)})},
  1010. args: ["aBlock"],
  1011. source: "displayBlock: aBlock\x0a\x09displayBlock := aBlock",
  1012. messageSends: [],
  1013. referencedClasses: []
  1014. }),
  1015. smalltalk.MKSelectionView);
  1016. smalltalk.addMethod(
  1017. smalltalk.method({
  1018. selector: "selectedItem",
  1019. category: 'accessing',
  1020. fn: function (){
  1021. var self=this;
  1022. return smalltalk.withContext(function($ctx1) {
  1023. var $1;
  1024. $1=self._valueForAspect_(self._selectionAspect());
  1025. return $1;
  1026. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.MKSelectionView)})},
  1027. args: [],
  1028. source: "selectedItem\x0a\x09^ self valueForAspect: self selectionAspect",
  1029. messageSends: ["valueForAspect:", "selectionAspect"],
  1030. referencedClasses: []
  1031. }),
  1032. smalltalk.MKSelectionView);
  1033. smalltalk.addMethod(
  1034. smalltalk.method({
  1035. selector: "selectionAspect",
  1036. category: 'accessing',
  1037. fn: function (){
  1038. var self=this;
  1039. return smalltalk.withContext(function($ctx1) {
  1040. var $1;
  1041. $1=self["@selectionAspect"];
  1042. return $1;
  1043. }, function($ctx1) {$ctx1.fill(self,"selectionAspect",{},smalltalk.MKSelectionView)})},
  1044. args: [],
  1045. source: "selectionAspect\x0a\x09^ selectionAspect",
  1046. messageSends: [],
  1047. referencedClasses: []
  1048. }),
  1049. smalltalk.MKSelectionView);
  1050. smalltalk.addMethod(
  1051. smalltalk.method({
  1052. selector: "selectionAspect:",
  1053. category: 'accessing',
  1054. fn: function (aSelector){
  1055. var self=this;
  1056. return smalltalk.withContext(function($ctx1) {
  1057. self["@selectionAspect"]=aSelector;
  1058. return self}, function($ctx1) {$ctx1.fill(self,"selectionAspect:",{aSelector:aSelector},smalltalk.MKSelectionView)})},
  1059. args: ["aSelector"],
  1060. source: "selectionAspect: aSelector\x0a\x09selectionAspect := aSelector",
  1061. messageSends: [],
  1062. referencedClasses: []
  1063. }),
  1064. smalltalk.MKSelectionView);
  1065. smalltalk.addMethod(
  1066. smalltalk.method({
  1067. selector: "model:collectionAspect:selectionAspect:",
  1068. category: 'instance creation',
  1069. fn: function (aModel,collectionSelector,selectionSelector){
  1070. var self=this;
  1071. return smalltalk.withContext(function($ctx1) {
  1072. var $2,$3,$1;
  1073. $2=self._model_(aModel);
  1074. _st($2)._collectionAspect_(collectionSelector);
  1075. _st($2)._selectionAspect_(selectionSelector);
  1076. $3=_st($2)._yourself();
  1077. $1=$3;
  1078. return $1;
  1079. }, function($ctx1) {$ctx1.fill(self,"model:collectionAspect:selectionAspect:",{aModel:aModel,collectionSelector:collectionSelector,selectionSelector:selectionSelector},smalltalk.MKSelectionView.klass)})},
  1080. args: ["aModel", "collectionSelector", "selectionSelector"],
  1081. source: "model: aModel collectionAspect: collectionSelector selectionAspect: selectionSelector\x0a\x09^ (self model: aModel)\x0a\x09\x09collectionAspect: collectionSelector;\x0a\x09\x09selectionAspect: selectionSelector;\x0a\x09\x09yourself",
  1082. messageSends: ["collectionAspect:", "model:", "selectionAspect:", "yourself"],
  1083. referencedClasses: []
  1084. }),
  1085. smalltalk.MKSelectionView.klass);
  1086. smalltalk.addClass('MKDropdownView', smalltalk.MKSelectionView, ['modalPaneView', 'listView'], 'Moka-Views');
  1087. 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";
  1088. smalltalk.addMethod(
  1089. smalltalk.method({
  1090. selector: "cssClass",
  1091. category: 'accessing',
  1092. fn: function (){
  1093. var self=this;
  1094. return smalltalk.withContext(function($ctx1) {
  1095. var $1;
  1096. $1=_st(smalltalk.MKDropdownView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_dropdown");
  1097. return $1;
  1098. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKDropdownView)})},
  1099. args: [],
  1100. source: "cssClass\x0a\x09^ super cssClass, ' mk_dropdown'",
  1101. messageSends: [",", "cssClass"],
  1102. referencedClasses: []
  1103. }),
  1104. smalltalk.MKDropdownView);
  1105. smalltalk.addMethod(
  1106. smalltalk.method({
  1107. selector: "defaultControllerClass",
  1108. category: 'defaults',
  1109. fn: function (){
  1110. var self=this;
  1111. function $MKDropdownController(){return smalltalk.MKDropdownController||(typeof MKDropdownController=="undefined"?nil:MKDropdownController)}
  1112. return smalltalk.withContext(function($ctx1) {
  1113. return $MKDropdownController();
  1114. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKDropdownView)})},
  1115. args: [],
  1116. source: "defaultControllerClass\x0a\x09^ MKDropdownController",
  1117. messageSends: [],
  1118. referencedClasses: ["MKDropdownController"]
  1119. }),
  1120. smalltalk.MKDropdownView);
  1121. smalltalk.addMethod(
  1122. smalltalk.method({
  1123. selector: "defaultLayout",
  1124. category: 'defaults',
  1125. fn: function (){
  1126. var self=this;
  1127. return smalltalk.withContext(function($ctx1) {
  1128. var $2,$3,$1;
  1129. $2=smalltalk.MKDropdownView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  1130. _st($2)._width_((120));
  1131. _st($2)._height_((24));
  1132. $3=_st($2)._yourself();
  1133. $1=$3;
  1134. return $1;
  1135. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKDropdownView)})},
  1136. args: [],
  1137. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 120;\x0a\x09\x09height: 24;\x0a\x09\x09yourself",
  1138. messageSends: ["width:", "defaultLayout", "height:", "yourself"],
  1139. referencedClasses: []
  1140. }),
  1141. smalltalk.MKDropdownView);
  1142. smalltalk.addMethod(
  1143. smalltalk.method({
  1144. selector: "listView",
  1145. category: 'views',
  1146. fn: function (){
  1147. var self=this;
  1148. function $MKDropdownListView(){return smalltalk.MKDropdownListView||(typeof MKDropdownListView=="undefined"?nil:MKDropdownListView)}
  1149. return smalltalk.withContext(function($ctx1) {
  1150. var $2,$3,$4,$1;
  1151. $2=self["@listView"];
  1152. if(($receiver = $2) == nil || $receiver == null){
  1153. $3=_st($MKDropdownListView())._model_collectionAspect_selectionAspect_(self._model(),self._collectionAspect(),self._selectionAspect());
  1154. _st($3)._width_(self._width());
  1155. _st($3)._height_("auto");
  1156. $4=_st($3)._yourself();
  1157. self["@listView"]=$4;
  1158. $1=self["@listView"];
  1159. } else {
  1160. $1=$2;
  1161. };
  1162. return $1;
  1163. }, function($ctx1) {$ctx1.fill(self,"listView",{},smalltalk.MKDropdownView)})},
  1164. args: [],
  1165. 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 ]",
  1166. messageSends: ["ifNil:", "width:", "model:collectionAspect:selectionAspect:", "model", "collectionAspect", "selectionAspect", "width", "height:", "yourself"],
  1167. referencedClasses: ["MKDropdownListView"]
  1168. }),
  1169. smalltalk.MKDropdownView);
  1170. smalltalk.addMethod(
  1171. smalltalk.method({
  1172. selector: "modalPaneView",
  1173. category: 'views',
  1174. fn: function (){
  1175. var self=this;
  1176. function $MKModalDecorator(){return smalltalk.MKModalDecorator||(typeof MKModalDecorator=="undefined"?nil:MKModalDecorator)}
  1177. function $MKViewRemoved(){return smalltalk.MKViewRemoved||(typeof MKViewRemoved=="undefined"?nil:MKViewRemoved)}
  1178. return smalltalk.withContext(function($ctx1) {
  1179. var $2,$3,$4,$1;
  1180. $2=self["@modalPaneView"];
  1181. if(($receiver = $2) == nil || $receiver == null){
  1182. $3=_st($MKModalDecorator())._decorate_(self._listView());
  1183. _st($3)._extraCssClass_("mk_dropdown_pane");
  1184. _st($3)._closeOnEnter_(true);
  1185. _st($3)._closeOnClick_(true);
  1186. $4=_st($3)._yourself();
  1187. self["@modalPaneView"]=$4;
  1188. self["@modalPaneView"];
  1189. _st(self["@modalPaneView"])._on_send_to_($MKViewRemoved(),"focus",self);
  1190. $1=self["@modalPaneView"];
  1191. } else {
  1192. $1=$2;
  1193. };
  1194. return $1;
  1195. }, function($ctx1) {$ctx1.fill(self,"modalPaneView",{},smalltalk.MKDropdownView)})},
  1196. args: [],
  1197. source: "modalPaneView\x0a\x09^ modalPaneView ifNil: [\x0a\x09\x09modalPaneView := (MKModalDecorator decorate: self listView)\x0a\x09\x09\x09extraCssClass: 'mk_dropdown_pane';\x0a\x09\x09\x09closeOnEnter: true;\x0a\x09\x09\x09closeOnClick: true;\x0a\x09\x09\x09yourself.\x0a\x09\x09modalPaneView \x0a\x09\x09\x09on: MKViewRemoved\x0a\x09\x09\x09send: #focus\x0a\x09\x09\x09to: self.\x0a\x09\x09modalPaneView ]",
  1198. messageSends: ["ifNil:", "extraCssClass:", "decorate:", "listView", "closeOnEnter:", "closeOnClick:", "yourself", "on:send:to:"],
  1199. referencedClasses: ["MKModalDecorator", "MKViewRemoved"]
  1200. }),
  1201. smalltalk.MKDropdownView);
  1202. smalltalk.addMethod(
  1203. smalltalk.method({
  1204. selector: "popupList",
  1205. category: 'actions',
  1206. fn: function (){
  1207. var self=this;
  1208. return smalltalk.withContext(function($ctx1) {
  1209. var $1,$2,$4,$3,$5;
  1210. $1=self._modalPaneView();
  1211. $2=$1;
  1212. $4=self._domPosition();
  1213. $ctx1.sendIdx["domPosition"]=1;
  1214. $3=_st($4)._x();
  1215. _st($2)._left_($3);
  1216. _st($1)._top_(_st(self._domPosition())._y());
  1217. $5=_st($1)._render();
  1218. _st(self._listView())._focus();
  1219. return self}, function($ctx1) {$ctx1.fill(self,"popupList",{},smalltalk.MKDropdownView)})},
  1220. args: [],
  1221. source: "popupList\x0a\x09\x22Show a new list view inside a modal pane\x22\x0a\x09self modalPaneView \x0a\x09\x09left: self domPosition x;\x0a\x09\x09top: self domPosition y;\x0a\x09\x09render.\x0a\x09self listView focus",
  1222. messageSends: ["left:", "modalPaneView", "x", "domPosition", "top:", "y", "render", "focus", "listView"],
  1223. referencedClasses: []
  1224. }),
  1225. smalltalk.MKDropdownView);
  1226. smalltalk.addMethod(
  1227. smalltalk.method({
  1228. selector: "renderContentOn:",
  1229. category: 'rendering',
  1230. fn: function (html){
  1231. var self=this;
  1232. return smalltalk.withContext(function($ctx1) {
  1233. _st(_st(html)._div())._class_("mk_dropdown_arrows");
  1234. _st(html)._with_(_st(self._displayBlock())._value_(self._selectedItem()));
  1235. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKDropdownView)})},
  1236. args: ["html"],
  1237. source: "renderContentOn: html\x0a\x09html div class: 'mk_dropdown_arrows'.\x0a\x09html with: (self displayBlock value: self selectedItem)",
  1238. messageSends: ["class:", "div", "with:", "value:", "displayBlock", "selectedItem"],
  1239. referencedClasses: []
  1240. }),
  1241. smalltalk.MKDropdownView);
  1242. smalltalk.addMethod(
  1243. smalltalk.method({
  1244. selector: "selectedListItem",
  1245. category: 'accessing',
  1246. fn: function (){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) {
  1249. var $1;
  1250. $1=_st(_st(_st(self["@root"])._asJQuery())._find_(":selected"))._text();
  1251. return $1;
  1252. }, function($ctx1) {$ctx1.fill(self,"selectedListItem",{},smalltalk.MKDropdownView)})},
  1253. args: [],
  1254. source: "selectedListItem\x0a\x09^ (root asJQuery find: ':selected') text",
  1255. messageSends: ["text", "find:", "asJQuery"],
  1256. referencedClasses: []
  1257. }),
  1258. smalltalk.MKDropdownView);
  1259. smalltalk.addMethod(
  1260. smalltalk.method({
  1261. selector: "tag",
  1262. category: 'accessing',
  1263. fn: function (){
  1264. var self=this;
  1265. return smalltalk.withContext(function($ctx1) {
  1266. return "button";
  1267. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKDropdownView)})},
  1268. args: [],
  1269. source: "tag\x0a\x09^ 'button'",
  1270. messageSends: [],
  1271. referencedClasses: []
  1272. }),
  1273. smalltalk.MKDropdownView);
  1274. smalltalk.addMethod(
  1275. smalltalk.method({
  1276. selector: "update:",
  1277. category: 'accessing',
  1278. fn: function (anAnnouncement){
  1279. var self=this;
  1280. return smalltalk.withContext(function($ctx1) {
  1281. var $1;
  1282. $1=_st([self._selectionAspect(),self._collectionAspect()])._includes_(_st(anAnnouncement)._aspect());
  1283. if(smalltalk.assert($1)){
  1284. self._update();
  1285. };
  1286. return self}, function($ctx1) {$ctx1.fill(self,"update:",{anAnnouncement:anAnnouncement},smalltalk.MKDropdownView)})},
  1287. args: ["anAnnouncement"],
  1288. source: "update: anAnnouncement\x0a\x09({self selectionAspect. self collectionAspect} \x0a\x09\x09includes: anAnnouncement aspect) ifTrue: [\x0a\x09\x09\x09self update ]",
  1289. messageSends: ["ifTrue:", "includes:", "selectionAspect", "collectionAspect", "aspect", "update"],
  1290. referencedClasses: []
  1291. }),
  1292. smalltalk.MKDropdownView);
  1293. smalltalk.addClass('MKListView', smalltalk.MKSelectionView, [], 'Moka-Views');
  1294. smalltalk.MKListView.comment="I display a list of elements in a list control field.";
  1295. smalltalk.addMethod(
  1296. smalltalk.method({
  1297. selector: "activateItem:",
  1298. category: 'actions',
  1299. fn: function (anObject){
  1300. var self=this;
  1301. return smalltalk.withContext(function($ctx1) {
  1302. self._activateListItem_(self._findListItemFor_(anObject));
  1303. return self}, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.MKListView)})},
  1304. args: ["anObject"],
  1305. source: "activateItem: anObject\x0a\x09self activateListItem: (self findListItemFor: anObject)",
  1306. messageSends: ["activateListItem:", "findListItemFor:"],
  1307. referencedClasses: []
  1308. }),
  1309. smalltalk.MKListView);
  1310. smalltalk.addMethod(
  1311. smalltalk.method({
  1312. selector: "activateListItem:",
  1313. category: 'actions',
  1314. fn: function (aListItem){
  1315. var self=this;
  1316. var item;
  1317. return smalltalk.withContext(function($ctx1) {
  1318. var $1,$2,$3;
  1319. $1=_st(aListItem)._get_((0));
  1320. if(($receiver = $1) == nil || $receiver == null){
  1321. return self;
  1322. } else {
  1323. $1;
  1324. };
  1325. $2=_st(_st(aListItem)._parent())._children();
  1326. $3=self._selectedCssClass();
  1327. $ctx1.sendIdx["selectedCssClass"]=1;
  1328. _st($2)._removeClass_($3);
  1329. _st(aListItem)._addClass_(self._selectedCssClass());
  1330. self._ensureVisible_(aListItem);
  1331. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.MKListView)})},
  1332. args: ["aListItem"],
  1333. 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",
  1334. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "selectedCssClass", "addClass:", "ensureVisible:"],
  1335. referencedClasses: []
  1336. }),
  1337. smalltalk.MKListView);
  1338. smalltalk.addMethod(
  1339. smalltalk.method({
  1340. selector: "activeItem",
  1341. category: 'accessing',
  1342. fn: function (){
  1343. var self=this;
  1344. return smalltalk.withContext(function($ctx1) {
  1345. var $1;
  1346. $1=self._findItemFor_(_st(_st(self["@root"])._asJQuery())._find_(".".__comma(self._selectedCssClass())));
  1347. return $1;
  1348. }, function($ctx1) {$ctx1.fill(self,"activeItem",{},smalltalk.MKListView)})},
  1349. args: [],
  1350. source: "activeItem\x0a\x09^ self findItemFor: (root asJQuery find: '.', self selectedCssClass)",
  1351. messageSends: ["findItemFor:", "find:", "asJQuery", ",", "selectedCssClass"],
  1352. referencedClasses: []
  1353. }),
  1354. smalltalk.MKListView);
  1355. smalltalk.addMethod(
  1356. smalltalk.method({
  1357. selector: "cssClass",
  1358. category: 'accessing',
  1359. fn: function (){
  1360. var self=this;
  1361. return smalltalk.withContext(function($ctx1) {
  1362. var $1;
  1363. $1=_st(smalltalk.MKListView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_list");
  1364. return $1;
  1365. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKListView)})},
  1366. args: [],
  1367. source: "cssClass\x0a\x09^ super cssClass, ' mk_list'",
  1368. messageSends: [",", "cssClass"],
  1369. referencedClasses: []
  1370. }),
  1371. smalltalk.MKListView);
  1372. smalltalk.addMethod(
  1373. smalltalk.method({
  1374. selector: "defaultControllerClass",
  1375. category: 'defaults',
  1376. fn: function (){
  1377. var self=this;
  1378. function $MKListController(){return smalltalk.MKListController||(typeof MKListController=="undefined"?nil:MKListController)}
  1379. return smalltalk.withContext(function($ctx1) {
  1380. return $MKListController();
  1381. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKListView)})},
  1382. args: [],
  1383. source: "defaultControllerClass\x0a\x09^ MKListController",
  1384. messageSends: [],
  1385. referencedClasses: ["MKListController"]
  1386. }),
  1387. smalltalk.MKListView);
  1388. smalltalk.addMethod(
  1389. smalltalk.method({
  1390. selector: "ensureVisible:",
  1391. category: 'private',
  1392. fn: function (aListItem){
  1393. var self=this;
  1394. var parent,position;
  1395. function $MKViewScroll(){return smalltalk.MKViewScroll||(typeof MKViewScroll=="undefined"?nil:MKViewScroll)}
  1396. return smalltalk.withContext(function($ctx1) {
  1397. var $1,$4,$3,$2,$5,$9,$8,$11,$10,$7,$6,$15,$14,$16,$13,$17,$12,$18,$22,$23,$21,$20,$19;
  1398. $1=_st(aListItem)._get_((0));
  1399. $ctx1.sendIdx["get:"]=1;
  1400. if(($receiver = $1) == nil || $receiver == null){
  1401. return self;
  1402. } else {
  1403. $1;
  1404. };
  1405. position=self._positionOf_(aListItem);
  1406. parent=_st(aListItem)._parent();
  1407. $4=_st(aListItem)._position();
  1408. $ctx1.sendIdx["position"]=1;
  1409. $3=_st($4)._top();
  1410. $ctx1.sendIdx["top"]=1;
  1411. $2=_st($3).__lt((0));
  1412. if(smalltalk.assert($2)){
  1413. $5=_st(parent)._get_((0));
  1414. $ctx1.sendIdx["get:"]=2;
  1415. $9=_st(parent)._get_((0));
  1416. $ctx1.sendIdx["get:"]=3;
  1417. $8=_st($9)._scrollTop();
  1418. $ctx1.sendIdx["scrollTop"]=1;
  1419. $11=_st(aListItem)._position();
  1420. $ctx1.sendIdx["position"]=2;
  1421. $10=_st($11)._top();
  1422. $ctx1.sendIdx["top"]=2;
  1423. $7=_st($8).__plus($10);
  1424. $ctx1.sendIdx["+"]=1;
  1425. $6=_st($7).__minus((10));
  1426. $ctx1.sendIdx["-"]=1;
  1427. _st($5)._scrollTop_($6);
  1428. $ctx1.sendIdx["scrollTop:"]=1;
  1429. };
  1430. $15=_st(aListItem)._position();
  1431. $ctx1.sendIdx["position"]=3;
  1432. $14=_st($15)._top();
  1433. $ctx1.sendIdx["top"]=3;
  1434. $16=_st(aListItem)._height();
  1435. $ctx1.sendIdx["height"]=1;
  1436. $13=_st($14).__plus($16);
  1437. $ctx1.sendIdx["+"]=2;
  1438. $17=_st(parent)._height();
  1439. $ctx1.sendIdx["height"]=2;
  1440. $12=_st($13).__gt($17);
  1441. if(smalltalk.assert($12)){
  1442. $18=_st(parent)._get_((0));
  1443. $ctx1.sendIdx["get:"]=4;
  1444. $22=_st(_st(parent)._get_((0)))._scrollTop();
  1445. $23=_st(aListItem)._height();
  1446. $ctx1.sendIdx["height"]=3;
  1447. $21=_st($22).__plus($23);
  1448. $20=_st($21).__minus(_st(_st(parent)._height()).__minus(_st(_st(aListItem)._position())._top()));
  1449. $ctx1.sendIdx["-"]=2;
  1450. $19=_st($20).__plus((10));
  1451. $ctx1.sendIdx["+"]=3;
  1452. _st($18)._scrollTop_($19);
  1453. };
  1454. self._announce_(_st($MKViewScroll())._view_(self));
  1455. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,parent:parent,position:position},smalltalk.MKListView)})},
  1456. args: ["aListItem"],
  1457. 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 ].\x0a\x09\x0a\x09self announce: (MKViewScroll view: self)",
  1458. messageSends: ["ifNil:", "get:", "positionOf:", "parent", "ifTrue:", "<", "top", "position", "scrollTop:", "-", "+", "scrollTop", ">", "height", "announce:", "view:"],
  1459. referencedClasses: ["MKViewScroll"]
  1460. }),
  1461. smalltalk.MKListView);
  1462. smalltalk.addMethod(
  1463. smalltalk.method({
  1464. selector: "findItemFor:",
  1465. category: 'accessing',
  1466. fn: function (aListItem){
  1467. var self=this;
  1468. return smalltalk.withContext(function($ctx1) {
  1469. var $1;
  1470. $1=_st(_st(_st(aListItem)._asJQuery())._data())._at_("item");
  1471. return $1;
  1472. }, function($ctx1) {$ctx1.fill(self,"findItemFor:",{aListItem:aListItem},smalltalk.MKListView)})},
  1473. args: ["aListItem"],
  1474. source: "findItemFor: aListItem\x0a\x09^ aListItem asJQuery data at: 'item'",
  1475. messageSends: ["at:", "data", "asJQuery"],
  1476. referencedClasses: []
  1477. }),
  1478. smalltalk.MKListView);
  1479. smalltalk.addMethod(
  1480. smalltalk.method({
  1481. selector: "findListItemFor:",
  1482. category: 'accessing',
  1483. fn: function (anObject){
  1484. var self=this;
  1485. return smalltalk.withContext(function($ctx1) {
  1486. var $4,$3,$2,$1;
  1487. $4=_st(self["@root"])._asJQuery();
  1488. $ctx1.sendIdx["asJQuery"]=1;
  1489. $3=_st($4)._find_("li");
  1490. $2=_st($3)._filter_(_st((function(thisArg){
  1491. return smalltalk.withContext(function($ctx2) {
  1492. return _st(_st(_st(thisArg)._asJQuery())._data_("item")).__eq(anObject);
  1493. }, function($ctx2) {$ctx2.fillBlock({thisArg:thisArg},$ctx1,1)})}))._currySelf());
  1494. $1=_st($2)._eq_((0));
  1495. return $1;
  1496. }, function($ctx1) {$ctx1.fill(self,"findListItemFor:",{anObject:anObject},smalltalk.MKListView)})},
  1497. args: ["anObject"],
  1498. source: "findListItemFor: anObject\x0a\x09^ (((root asJQuery find: 'li') \x0a\x09\x09filter: [ :thisArg | (thisArg asJQuery data: 'item') = anObject ] currySelf) eq: 0)",
  1499. messageSends: ["eq:", "filter:", "find:", "asJQuery", "currySelf", "=", "data:"],
  1500. referencedClasses: []
  1501. }),
  1502. smalltalk.MKListView);
  1503. smalltalk.addMethod(
  1504. smalltalk.method({
  1505. selector: "positionOf:",
  1506. category: 'private',
  1507. fn: function (aListItem){
  1508. var self=this;
  1509. return smalltalk.withContext(function($ctx1) {
  1510. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1;
  1511. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.MKListView)})},
  1512. args: ["aListItem"],
  1513. source: "positionOf: aListItem\x0a\x09\x22TODO: rewrite in smalltalk\x22\x0a\x09<return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1>",
  1514. messageSends: [],
  1515. referencedClasses: []
  1516. }),
  1517. smalltalk.MKListView);
  1518. smalltalk.addMethod(
  1519. smalltalk.method({
  1520. selector: "renderContentOn:",
  1521. category: 'rendering',
  1522. fn: function (html){
  1523. var self=this;
  1524. return smalltalk.withContext(function($ctx1) {
  1525. _st(self._collection())._do_((function(each){
  1526. return smalltalk.withContext(function($ctx2) {
  1527. return self._renderItem_on_(each,html);
  1528. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1529. _st(self["@root"])._at_put_("tabindex","0");
  1530. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKListView)})},
  1531. args: ["html"],
  1532. 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'",
  1533. messageSends: ["do:", "collection", "renderItem:on:", "at:put:"],
  1534. referencedClasses: []
  1535. }),
  1536. smalltalk.MKListView);
  1537. smalltalk.addMethod(
  1538. smalltalk.method({
  1539. selector: "renderItem:on:",
  1540. category: 'rendering',
  1541. fn: function (anObject,html){
  1542. var self=this;
  1543. var li;
  1544. return smalltalk.withContext(function($ctx1) {
  1545. var $1;
  1546. li=_st(html)._li();
  1547. _st(_st(li)._asJQuery())._data_put_("item",anObject);
  1548. $1=_st(self._selectedItem()).__eq(anObject);
  1549. if(smalltalk.assert($1)){
  1550. _st(li)._class_(self._selectedCssClass());
  1551. };
  1552. _st(li)._with_(_st(self._displayBlock())._value_(anObject));
  1553. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.MKListView)})},
  1554. args: ["anObject", "html"],
  1555. 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)",
  1556. messageSends: ["li", "data:put:", "asJQuery", "ifTrue:", "=", "selectedItem", "class:", "selectedCssClass", "with:", "value:", "displayBlock"],
  1557. referencedClasses: []
  1558. }),
  1559. smalltalk.MKListView);
  1560. smalltalk.addMethod(
  1561. smalltalk.method({
  1562. selector: "selectedCssClass",
  1563. category: 'accessing',
  1564. fn: function (){
  1565. var self=this;
  1566. return smalltalk.withContext(function($ctx1) {
  1567. return "selected";
  1568. }, function($ctx1) {$ctx1.fill(self,"selectedCssClass",{},smalltalk.MKListView)})},
  1569. args: [],
  1570. source: "selectedCssClass\x0a\x09^ 'selected'",
  1571. messageSends: [],
  1572. referencedClasses: []
  1573. }),
  1574. smalltalk.MKListView);
  1575. smalltalk.addMethod(
  1576. smalltalk.method({
  1577. selector: "tag",
  1578. category: 'accessing',
  1579. fn: function (){
  1580. var self=this;
  1581. return smalltalk.withContext(function($ctx1) {
  1582. return "ul";
  1583. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKListView)})},
  1584. args: [],
  1585. source: "tag\x0a\x09^ 'ul'",
  1586. messageSends: [],
  1587. referencedClasses: []
  1588. }),
  1589. smalltalk.MKListView);
  1590. smalltalk.addMethod(
  1591. smalltalk.method({
  1592. selector: "update:",
  1593. category: 'updating',
  1594. fn: function (anAnnouncement){
  1595. var self=this;
  1596. return smalltalk.withContext(function($ctx1) {
  1597. var $2,$1,$3;
  1598. $2=_st(anAnnouncement)._aspect();
  1599. $ctx1.sendIdx["aspect"]=1;
  1600. $1=_st($2).__eq(self._selectionAspect());
  1601. $ctx1.sendIdx["="]=1;
  1602. if(smalltalk.assert($1)){
  1603. self._updateSelectedItem();
  1604. };
  1605. $3=_st(_st(anAnnouncement)._aspect()).__eq(self._collectionAspect());
  1606. if(smalltalk.assert($3)){
  1607. self._update();
  1608. };
  1609. return self}, function($ctx1) {$ctx1.fill(self,"update:",{anAnnouncement:anAnnouncement},smalltalk.MKListView)})},
  1610. args: ["anAnnouncement"],
  1611. 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 ]",
  1612. messageSends: ["ifTrue:", "=", "aspect", "selectionAspect", "updateSelectedItem", "collectionAspect", "update"],
  1613. referencedClasses: []
  1614. }),
  1615. smalltalk.MKListView);
  1616. smalltalk.addMethod(
  1617. smalltalk.method({
  1618. selector: "updateSelectedItem",
  1619. category: 'updating',
  1620. fn: function (){
  1621. var self=this;
  1622. return smalltalk.withContext(function($ctx1) {
  1623. self._activateItem_(self._selectedItem());
  1624. return self}, function($ctx1) {$ctx1.fill(self,"updateSelectedItem",{},smalltalk.MKListView)})},
  1625. args: [],
  1626. source: "updateSelectedItem\x0a\x09self activateItem: self selectedItem",
  1627. messageSends: ["activateItem:", "selectedItem"],
  1628. referencedClasses: []
  1629. }),
  1630. smalltalk.MKListView);
  1631. smalltalk.addMethod(
  1632. smalltalk.method({
  1633. selector: "model:collectionAspect:selectionAspect:",
  1634. category: 'instance creation',
  1635. fn: function (aModel,collectionSelector,selectionSelector){
  1636. var self=this;
  1637. return smalltalk.withContext(function($ctx1) {
  1638. var $2,$3,$1;
  1639. $2=self._model_(aModel);
  1640. _st($2)._collectionAspect_(collectionSelector);
  1641. _st($2)._selectionAspect_(selectionSelector);
  1642. $3=_st($2)._yourself();
  1643. $1=$3;
  1644. return $1;
  1645. }, function($ctx1) {$ctx1.fill(self,"model:collectionAspect:selectionAspect:",{aModel:aModel,collectionSelector:collectionSelector,selectionSelector:selectionSelector},smalltalk.MKListView.klass)})},
  1646. args: ["aModel", "collectionSelector", "selectionSelector"],
  1647. source: "model: aModel collectionAspect: collectionSelector selectionAspect: selectionSelector\x0a\x09^ (self model: aModel)\x0a\x09\x09collectionAspect: collectionSelector;\x0a\x09\x09selectionAspect: selectionSelector;\x0a\x09\x09yourself",
  1648. messageSends: ["collectionAspect:", "model:", "selectionAspect:", "yourself"],
  1649. referencedClasses: []
  1650. }),
  1651. smalltalk.MKListView.klass);
  1652. smalltalk.addClass('MKDropdownListView', smalltalk.MKListView, [], 'Moka-Views');
  1653. smalltalk.MKDropdownListView.comment="I am similar to a `MKListView`, but inside a `MKDropdownView`.";
  1654. smalltalk.addMethod(
  1655. smalltalk.method({
  1656. selector: "cssClass",
  1657. category: 'accessing',
  1658. fn: function (){
  1659. var self=this;
  1660. return smalltalk.withContext(function($ctx1) {
  1661. var $1;
  1662. $1=_st(smalltalk.MKDropdownListView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_dropdown_list");
  1663. return $1;
  1664. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKDropdownListView)})},
  1665. args: [],
  1666. source: "cssClass\x0a\x09^ super cssClass, ' mk_dropdown_list'",
  1667. messageSends: [",", "cssClass"],
  1668. referencedClasses: []
  1669. }),
  1670. smalltalk.MKDropdownListView);
  1671. smalltalk.addMethod(
  1672. smalltalk.method({
  1673. selector: "defaultControllerClass",
  1674. category: 'accessing',
  1675. fn: function (){
  1676. var self=this;
  1677. function $MKDropdownListController(){return smalltalk.MKDropdownListController||(typeof MKDropdownListController=="undefined"?nil:MKDropdownListController)}
  1678. return smalltalk.withContext(function($ctx1) {
  1679. return $MKDropdownListController();
  1680. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKDropdownListView)})},
  1681. args: [],
  1682. source: "defaultControllerClass\x0a\x09^ MKDropdownListController",
  1683. messageSends: [],
  1684. referencedClasses: ["MKDropdownListController"]
  1685. }),
  1686. smalltalk.MKDropdownListView);
  1687. smalltalk.addClass('MKSourceListView', smalltalk.MKListView, [], 'Moka-Views');
  1688. 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.";
  1689. smalltalk.addMethod(
  1690. smalltalk.method({
  1691. selector: "cssClass",
  1692. category: 'accessing',
  1693. fn: function (){
  1694. var self=this;
  1695. return smalltalk.withContext(function($ctx1) {
  1696. var $1;
  1697. $1=_st(smalltalk.MKSourceListView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_sourcelist");
  1698. return $1;
  1699. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKSourceListView)})},
  1700. args: [],
  1701. source: "cssClass\x0a\x09^ super cssClass, ' mk_sourcelist'",
  1702. messageSends: [",", "cssClass"],
  1703. referencedClasses: []
  1704. }),
  1705. smalltalk.MKSourceListView);
  1706. smalltalk.addClass('MKSplitView', smalltalk.MKLayoutView, ['firstView', 'secondView', 'splitter', 'thickness'], 'Moka-Views');
  1707. smalltalk.MKSplitView.comment="I am the superclass of all split views. I arrange two child view with a splitter between them.\x0a\x0a## API\x0a\x0aCreate instances using the class-side method `firstView:secondView:`.";
  1708. smalltalk.addMethod(
  1709. smalltalk.method({
  1710. selector: "children",
  1711. category: 'accessing',
  1712. fn: function (){
  1713. var self=this;
  1714. return smalltalk.withContext(function($ctx1) {
  1715. var $1;
  1716. $1=[self._firstView(),self._secondView()];
  1717. return $1;
  1718. }, function($ctx1) {$ctx1.fill(self,"children",{},smalltalk.MKSplitView)})},
  1719. args: [],
  1720. source: "children\x0a\x09^ { self firstView. self secondView }",
  1721. messageSends: ["firstView", "secondView"],
  1722. referencedClasses: []
  1723. }),
  1724. smalltalk.MKSplitView);
  1725. smalltalk.addMethod(
  1726. smalltalk.method({
  1727. selector: "cssClass",
  1728. category: 'accessing',
  1729. fn: function (){
  1730. var self=this;
  1731. return smalltalk.withContext(function($ctx1) {
  1732. var $1;
  1733. $1=_st(smalltalk.MKSplitView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_split_view");
  1734. return $1;
  1735. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKSplitView)})},
  1736. args: [],
  1737. source: "cssClass\x0a\x09^ super cssClass, ' mk_split_view'",
  1738. messageSends: [",", "cssClass"],
  1739. referencedClasses: []
  1740. }),
  1741. smalltalk.MKSplitView);
  1742. smalltalk.addMethod(
  1743. smalltalk.method({
  1744. selector: "defaultThickness",
  1745. category: 'defaults',
  1746. fn: function (){
  1747. var self=this;
  1748. return smalltalk.withContext(function($ctx1) {
  1749. return (300);
  1750. }, function($ctx1) {$ctx1.fill(self,"defaultThickness",{},smalltalk.MKSplitView)})},
  1751. args: [],
  1752. source: "defaultThickness\x0a\x09^ 300",
  1753. messageSends: [],
  1754. referencedClasses: []
  1755. }),
  1756. smalltalk.MKSplitView);
  1757. smalltalk.addMethod(
  1758. smalltalk.method({
  1759. selector: "firstView",
  1760. category: 'accessing',
  1761. fn: function (){
  1762. var self=this;
  1763. return smalltalk.withContext(function($ctx1) {
  1764. var $1;
  1765. $1=self["@firstView"];
  1766. return $1;
  1767. }, function($ctx1) {$ctx1.fill(self,"firstView",{},smalltalk.MKSplitView)})},
  1768. args: [],
  1769. source: "firstView\x0a\x09^ firstView",
  1770. messageSends: [],
  1771. referencedClasses: []
  1772. }),
  1773. smalltalk.MKSplitView);
  1774. smalltalk.addMethod(
  1775. smalltalk.method({
  1776. selector: "firstView:",
  1777. category: 'accessing',
  1778. fn: function (aView){
  1779. var self=this;
  1780. function $MKDecorator(){return smalltalk.MKDecorator||(typeof MKDecorator=="undefined"?nil:MKDecorator)}
  1781. return smalltalk.withContext(function($ctx1) {
  1782. self["@firstView"]=_st($MKDecorator())._decorate_(aView);
  1783. return self}, function($ctx1) {$ctx1.fill(self,"firstView:",{aView:aView},smalltalk.MKSplitView)})},
  1784. args: ["aView"],
  1785. source: "firstView: aView\x0a\x09firstView := MKDecorator decorate: aView",
  1786. messageSends: ["decorate:"],
  1787. referencedClasses: ["MKDecorator"]
  1788. }),
  1789. smalltalk.MKSplitView);
  1790. smalltalk.addMethod(
  1791. smalltalk.method({
  1792. selector: "renderContentOn:",
  1793. category: 'rendering',
  1794. fn: function (html){
  1795. var self=this;
  1796. return smalltalk.withContext(function($ctx1) {
  1797. _st(html)._with_(self._firstView());
  1798. $ctx1.sendIdx["with:"]=1;
  1799. self["@splitter"]=_st(_st(html)._div())._class_(self._splitterCssClass());
  1800. _st(html)._with_(self._secondView());
  1801. _st(self._controller())._placeSplitter_(self._thickness());
  1802. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKSplitView)})},
  1803. args: ["html"],
  1804. source: "renderContentOn: html\x0a\x09html with: self firstView.\x0a\x09splitter := html div class: self splitterCssClass.\x0a\x09html with: self secondView.\x0a\x09\x0a\x09self controller placeSplitter: self thickness",
  1805. messageSends: ["with:", "firstView", "class:", "div", "splitterCssClass", "secondView", "placeSplitter:", "controller", "thickness"],
  1806. referencedClasses: []
  1807. }),
  1808. smalltalk.MKSplitView);
  1809. smalltalk.addMethod(
  1810. smalltalk.method({
  1811. selector: "secondView",
  1812. category: 'accessing',
  1813. fn: function (){
  1814. var self=this;
  1815. return smalltalk.withContext(function($ctx1) {
  1816. var $1;
  1817. $1=self["@secondView"];
  1818. return $1;
  1819. }, function($ctx1) {$ctx1.fill(self,"secondView",{},smalltalk.MKSplitView)})},
  1820. args: [],
  1821. source: "secondView\x0a\x09^ secondView",
  1822. messageSends: [],
  1823. referencedClasses: []
  1824. }),
  1825. smalltalk.MKSplitView);
  1826. smalltalk.addMethod(
  1827. smalltalk.method({
  1828. selector: "secondView:",
  1829. category: 'accessing',
  1830. fn: function (aView){
  1831. var self=this;
  1832. function $MKDecorator(){return smalltalk.MKDecorator||(typeof MKDecorator=="undefined"?nil:MKDecorator)}
  1833. return smalltalk.withContext(function($ctx1) {
  1834. self["@secondView"]=_st($MKDecorator())._decorate_(aView);
  1835. return self}, function($ctx1) {$ctx1.fill(self,"secondView:",{aView:aView},smalltalk.MKSplitView)})},
  1836. args: ["aView"],
  1837. source: "secondView: aView\x0a\x09secondView := MKDecorator decorate: aView",
  1838. messageSends: ["decorate:"],
  1839. referencedClasses: ["MKDecorator"]
  1840. }),
  1841. smalltalk.MKSplitView);
  1842. smalltalk.addMethod(
  1843. smalltalk.method({
  1844. selector: "splitter",
  1845. category: 'accessing',
  1846. fn: function (){
  1847. var self=this;
  1848. return smalltalk.withContext(function($ctx1) {
  1849. var $1;
  1850. $1=self["@splitter"];
  1851. return $1;
  1852. }, function($ctx1) {$ctx1.fill(self,"splitter",{},smalltalk.MKSplitView)})},
  1853. args: [],
  1854. source: "splitter\x0a\x09\x22Answer the `splitter` TagBrush\x22\x0a\x09\x0a\x09^ splitter",
  1855. messageSends: [],
  1856. referencedClasses: []
  1857. }),
  1858. smalltalk.MKSplitView);
  1859. smalltalk.addMethod(
  1860. smalltalk.method({
  1861. selector: "splitterCssClass",
  1862. category: 'accessing',
  1863. fn: function (){
  1864. var self=this;
  1865. return smalltalk.withContext(function($ctx1) {
  1866. return "mk_splitter";
  1867. }, function($ctx1) {$ctx1.fill(self,"splitterCssClass",{},smalltalk.MKSplitView)})},
  1868. args: [],
  1869. source: "splitterCssClass\x0a\x09^ 'mk_splitter'",
  1870. messageSends: [],
  1871. referencedClasses: []
  1872. }),
  1873. smalltalk.MKSplitView);
  1874. smalltalk.addMethod(
  1875. smalltalk.method({
  1876. selector: "thickness",
  1877. category: 'accessing',
  1878. fn: function (){
  1879. var self=this;
  1880. return smalltalk.withContext(function($ctx1) {
  1881. var $2,$1;
  1882. $2=self["@thickness"];
  1883. if(($receiver = $2) == nil || $receiver == null){
  1884. $1=self._defaultThickness();
  1885. } else {
  1886. $1=$2;
  1887. };
  1888. return $1;
  1889. }, function($ctx1) {$ctx1.fill(self,"thickness",{},smalltalk.MKSplitView)})},
  1890. args: [],
  1891. source: "thickness\x0a\x09^ thickness ifNil: [ self defaultThickness ]",
  1892. messageSends: ["ifNil:", "defaultThickness"],
  1893. referencedClasses: []
  1894. }),
  1895. smalltalk.MKSplitView);
  1896. smalltalk.addMethod(
  1897. smalltalk.method({
  1898. selector: "thickness:",
  1899. category: 'accessing',
  1900. fn: function (aNumber){
  1901. var self=this;
  1902. return smalltalk.withContext(function($ctx1) {
  1903. self["@thickness"]=aNumber;
  1904. return self}, function($ctx1) {$ctx1.fill(self,"thickness:",{aNumber:aNumber},smalltalk.MKSplitView)})},
  1905. args: ["aNumber"],
  1906. source: "thickness: aNumber\x0a\x09thickness := aNumber",
  1907. messageSends: [],
  1908. referencedClasses: []
  1909. }),
  1910. smalltalk.MKSplitView);
  1911. smalltalk.addMethod(
  1912. smalltalk.method({
  1913. selector: "firstView:secondView:",
  1914. category: 'instance creation',
  1915. fn: function (aView,anotherView){
  1916. var self=this;
  1917. return smalltalk.withContext(function($ctx1) {
  1918. var $2,$3,$1;
  1919. $2=self._new();
  1920. _st($2)._firstView_(aView);
  1921. _st($2)._secondView_(anotherView);
  1922. $3=_st($2)._yourself();
  1923. $1=$3;
  1924. return $1;
  1925. }, function($ctx1) {$ctx1.fill(self,"firstView:secondView:",{aView:aView,anotherView:anotherView},smalltalk.MKSplitView.klass)})},
  1926. args: ["aView", "anotherView"],
  1927. source: "firstView: aView secondView: anotherView\x0a\x09^ self new\x0a\x09\x09firstView: aView;\x0a\x09\x09secondView: anotherView;\x0a\x09\x09yourself",
  1928. messageSends: ["firstView:", "new", "secondView:", "yourself"],
  1929. referencedClasses: []
  1930. }),
  1931. smalltalk.MKSplitView.klass);
  1932. smalltalk.addClass('MKHorizontalSplitView', smalltalk.MKSplitView, [], 'Moka-Views');
  1933. smalltalk.MKHorizontalSplitView.comment="I split my child views vertically.";
  1934. smalltalk.addMethod(
  1935. smalltalk.method({
  1936. selector: "cssClass",
  1937. category: 'accessing',
  1938. fn: function (){
  1939. var self=this;
  1940. return smalltalk.withContext(function($ctx1) {
  1941. var $1;
  1942. $1=_st(smalltalk.MKHorizontalSplitView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" horizontal");
  1943. return $1;
  1944. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKHorizontalSplitView)})},
  1945. args: [],
  1946. source: "cssClass\x0a\x09^ super cssClass, ' horizontal'",
  1947. messageSends: [",", "cssClass"],
  1948. referencedClasses: []
  1949. }),
  1950. smalltalk.MKHorizontalSplitView);
  1951. smalltalk.addMethod(
  1952. smalltalk.method({
  1953. selector: "defaultControllerClass",
  1954. category: 'defaults',
  1955. fn: function (){
  1956. var self=this;
  1957. function $MKLeftFixedHorizontalSplitController(){return smalltalk.MKLeftFixedHorizontalSplitController||(typeof MKLeftFixedHorizontalSplitController=="undefined"?nil:MKLeftFixedHorizontalSplitController)}
  1958. return smalltalk.withContext(function($ctx1) {
  1959. return $MKLeftFixedHorizontalSplitController();
  1960. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKHorizontalSplitView)})},
  1961. args: [],
  1962. source: "defaultControllerClass\x0a\x09^ MKLeftFixedHorizontalSplitController",
  1963. messageSends: [],
  1964. referencedClasses: ["MKLeftFixedHorizontalSplitController"]
  1965. }),
  1966. smalltalk.MKHorizontalSplitView);
  1967. smalltalk.addMethod(
  1968. smalltalk.method({
  1969. selector: "leftThickness:",
  1970. category: 'accessing',
  1971. fn: function (aNumber){
  1972. var self=this;
  1973. function $MKLeftFixedHorizontalSplitController(){return smalltalk.MKLeftFixedHorizontalSplitController||(typeof MKLeftFixedHorizontalSplitController=="undefined"?nil:MKLeftFixedHorizontalSplitController)}
  1974. return smalltalk.withContext(function($ctx1) {
  1975. self._thickness_(aNumber);
  1976. self._controller_(_st($MKLeftFixedHorizontalSplitController())._new());
  1977. return self}, function($ctx1) {$ctx1.fill(self,"leftThickness:",{aNumber:aNumber},smalltalk.MKHorizontalSplitView)})},
  1978. args: ["aNumber"],
  1979. source: "leftThickness: aNumber\x0a\x09self thickness: aNumber.\x0a\x09self controller: MKLeftFixedHorizontalSplitController new",
  1980. messageSends: ["thickness:", "controller:", "new"],
  1981. referencedClasses: ["MKLeftFixedHorizontalSplitController"]
  1982. }),
  1983. smalltalk.MKHorizontalSplitView);
  1984. smalltalk.addMethod(
  1985. smalltalk.method({
  1986. selector: "rightThickness:",
  1987. category: 'accessing',
  1988. fn: function (aNumber){
  1989. var self=this;
  1990. function $MKRightFixedHorizontalSplitController(){return smalltalk.MKRightFixedHorizontalSplitController||(typeof MKRightFixedHorizontalSplitController=="undefined"?nil:MKRightFixedHorizontalSplitController)}
  1991. return smalltalk.withContext(function($ctx1) {
  1992. self._thickness_(aNumber);
  1993. self._controller_(_st($MKRightFixedHorizontalSplitController())._new());
  1994. return self}, function($ctx1) {$ctx1.fill(self,"rightThickness:",{aNumber:aNumber},smalltalk.MKHorizontalSplitView)})},
  1995. args: ["aNumber"],
  1996. source: "rightThickness: aNumber\x0a\x09self thickness: aNumber.\x0a\x09self controller: MKRightFixedHorizontalSplitController new",
  1997. messageSends: ["thickness:", "controller:", "new"],
  1998. referencedClasses: ["MKRightFixedHorizontalSplitController"]
  1999. }),
  2000. smalltalk.MKHorizontalSplitView);
  2001. smalltalk.addMethod(
  2002. smalltalk.method({
  2003. selector: "secondView:",
  2004. category: 'accessing',
  2005. fn: function (aView){
  2006. var self=this;
  2007. return smalltalk.withContext(function($ctx1) {
  2008. var $1,$2;
  2009. smalltalk.MKHorizontalSplitView.superclass.fn.prototype._secondView_.apply(_st(self), [aView]);
  2010. $1=self._secondView();
  2011. _st($1)._right_((0));
  2012. $2=_st($1)._left_("auto");
  2013. return self}, function($ctx1) {$ctx1.fill(self,"secondView:",{aView:aView},smalltalk.MKHorizontalSplitView)})},
  2014. args: ["aView"],
  2015. source: "secondView: aView\x0a\x09super secondView: aView.\x0a\x09self secondView \x0a\x09\x09right: 0;\x0a\x09\x09left: 'auto'",
  2016. messageSends: ["secondView:", "right:", "secondView", "left:"],
  2017. referencedClasses: []
  2018. }),
  2019. smalltalk.MKHorizontalSplitView);
  2020. smalltalk.addMethod(
  2021. smalltalk.method({
  2022. selector: "setupEventHandlers",
  2023. category: 'private',
  2024. fn: function (){
  2025. var self=this;
  2026. return smalltalk.withContext(function($ctx1) {
  2027. var $1,$3,$4,$5,$6,$2;
  2028. $1=_st(self["@splitter"])._asJQuery();
  2029. $ctx1.sendIdx["asJQuery"]=1;
  2030. $3="axis".__minus_gt("x");
  2031. $ctx1.sendIdx["->"]=1;
  2032. $4="containment".__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent());
  2033. $ctx1.sendIdx["->"]=2;
  2034. $5="cursor".__minus_gt("ew-resize");
  2035. $ctx1.sendIdx["->"]=3;
  2036. $6="stop".__minus_gt((function(){
  2037. return smalltalk.withContext(function($ctx2) {
  2038. return self._resized();
  2039. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2040. $ctx1.sendIdx["->"]=4;
  2041. $2=smalltalk.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(event){
  2042. return smalltalk.withContext(function($ctx2) {
  2043. return _st(self._controller())._onResize_(event);
  2044. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,2)})}))]);
  2045. _st($1)._draggable_($2);
  2046. return self}, function($ctx1) {$ctx1.fill(self,"setupEventHandlers",{},smalltalk.MKHorizontalSplitView)})},
  2047. args: [],
  2048. source: "setupEventHandlers\x0a\x09splitter asJQuery draggable: #{ \x0a \x09'axis' -> 'x'. \x0a 'containment' -> splitter asJQuery parent.\x0a\x09\x09'cursor' -> 'ew-resize'.\x0a\x09\x09'stop' -> [ self resized ].\x0a 'drag' -> [ :event | self controller onResize: event ] }",
  2049. messageSends: ["draggable:", "asJQuery", "->", "parent", "resized", "onResize:", "controller"],
  2050. referencedClasses: []
  2051. }),
  2052. smalltalk.MKHorizontalSplitView);
  2053. smalltalk.addClass('MKVerticalSplitView', smalltalk.MKSplitView, [], 'Moka-Views');
  2054. smalltalk.MKVerticalSplitView.comment="I split my child views horizontally.";
  2055. smalltalk.addMethod(
  2056. smalltalk.method({
  2057. selector: "bottomThickness:",
  2058. category: 'accessing',
  2059. fn: function (aNumber){
  2060. var self=this;
  2061. function $MKBottomFixedVerticalSplitController(){return smalltalk.MKBottomFixedVerticalSplitController||(typeof MKBottomFixedVerticalSplitController=="undefined"?nil:MKBottomFixedVerticalSplitController)}
  2062. return smalltalk.withContext(function($ctx1) {
  2063. self._thickness_(aNumber);
  2064. self._controller_(_st($MKBottomFixedVerticalSplitController())._new());
  2065. return self}, function($ctx1) {$ctx1.fill(self,"bottomThickness:",{aNumber:aNumber},smalltalk.MKVerticalSplitView)})},
  2066. args: ["aNumber"],
  2067. source: "bottomThickness: aNumber\x0a\x09self thickness: aNumber.\x0a\x09self controller: MKBottomFixedVerticalSplitController new",
  2068. messageSends: ["thickness:", "controller:", "new"],
  2069. referencedClasses: ["MKBottomFixedVerticalSplitController"]
  2070. }),
  2071. smalltalk.MKVerticalSplitView);
  2072. smalltalk.addMethod(
  2073. smalltalk.method({
  2074. selector: "cssClass",
  2075. category: 'accessing',
  2076. fn: function (){
  2077. var self=this;
  2078. return smalltalk.withContext(function($ctx1) {
  2079. var $1;
  2080. $1=_st(smalltalk.MKVerticalSplitView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" vertical");
  2081. return $1;
  2082. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKVerticalSplitView)})},
  2083. args: [],
  2084. source: "cssClass\x0a\x09^ super cssClass, ' vertical'",
  2085. messageSends: [",", "cssClass"],
  2086. referencedClasses: []
  2087. }),
  2088. smalltalk.MKVerticalSplitView);
  2089. smalltalk.addMethod(
  2090. smalltalk.method({
  2091. selector: "defaultControllerClass",
  2092. category: 'defaults',
  2093. fn: function (){
  2094. var self=this;
  2095. function $MKTopFixedVerticalSplitController(){return smalltalk.MKTopFixedVerticalSplitController||(typeof MKTopFixedVerticalSplitController=="undefined"?nil:MKTopFixedVerticalSplitController)}
  2096. return smalltalk.withContext(function($ctx1) {
  2097. return $MKTopFixedVerticalSplitController();
  2098. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKVerticalSplitView)})},
  2099. args: [],
  2100. source: "defaultControllerClass\x0a\x09^ MKTopFixedVerticalSplitController",
  2101. messageSends: [],
  2102. referencedClasses: ["MKTopFixedVerticalSplitController"]
  2103. }),
  2104. smalltalk.MKVerticalSplitView);
  2105. smalltalk.addMethod(
  2106. smalltalk.method({
  2107. selector: "resize:",
  2108. category: 'actions',
  2109. fn: function (aNumber){
  2110. var self=this;
  2111. return smalltalk.withContext(function($ctx1) {
  2112. var $1,$2,$3,$4;
  2113. $1=_st(self._firstView())._asJQuery();
  2114. $ctx1.sendIdx["asJQuery"]=1;
  2115. $2=_st(aNumber)._asMokaCssString();
  2116. $ctx1.sendIdx["asMokaCssString"]=1;
  2117. _st($1)._css_put_("right",$2);
  2118. $ctx1.sendIdx["css:put:"]=1;
  2119. $3=_st(self["@splitter"])._asJQuery();
  2120. $ctx1.sendIdx["asJQuery"]=2;
  2121. $4=_st(aNumber)._asMokaCssString();
  2122. $ctx1.sendIdx["asMokaCssString"]=2;
  2123. _st($3)._css_put_("left",$4);
  2124. $ctx1.sendIdx["css:put:"]=2;
  2125. _st(_st(self._secondView())._asJQuery())._css_put_("left",_st(aNumber)._asMokaCssString());
  2126. return self}, function($ctx1) {$ctx1.fill(self,"resize:",{aNumber:aNumber},smalltalk.MKVerticalSplitView)})},
  2127. args: ["aNumber"],
  2128. source: "resize: aNumber\x0a self firstView asJQuery css: 'right' put: aNumber asMokaCssString.\x0a\x09splitter asJQuery css: 'left' put: aNumber asMokaCssString.\x0a\x09self secondView asJQuery css: 'left' put: aNumber asMokaCssString",
  2129. messageSends: ["css:put:", "asJQuery", "firstView", "asMokaCssString", "secondView"],
  2130. referencedClasses: []
  2131. }),
  2132. smalltalk.MKVerticalSplitView);
  2133. smalltalk.addMethod(
  2134. smalltalk.method({
  2135. selector: "secondView:",
  2136. category: 'accessing',
  2137. fn: function (aView){
  2138. var self=this;
  2139. return smalltalk.withContext(function($ctx1) {
  2140. var $1,$2;
  2141. smalltalk.MKVerticalSplitView.superclass.fn.prototype._secondView_.apply(_st(self), [aView]);
  2142. $1=self._secondView();
  2143. _st($1)._bottom_((0));
  2144. $2=_st($1)._top_("auto");
  2145. return self}, function($ctx1) {$ctx1.fill(self,"secondView:",{aView:aView},smalltalk.MKVerticalSplitView)})},
  2146. args: ["aView"],
  2147. source: "secondView: aView\x0a\x09super secondView: aView.\x0a\x09self secondView \x0a\x09\x09bottom: 0;\x0a\x09\x09top: 'auto'",
  2148. messageSends: ["secondView:", "bottom:", "secondView", "top:"],
  2149. referencedClasses: []
  2150. }),
  2151. smalltalk.MKVerticalSplitView);
  2152. smalltalk.addMethod(
  2153. smalltalk.method({
  2154. selector: "setupEventHandlers",
  2155. category: 'private',
  2156. fn: function (){
  2157. var self=this;
  2158. return smalltalk.withContext(function($ctx1) {
  2159. var $1,$3,$4,$5,$6,$2;
  2160. $1=_st(self["@splitter"])._asJQuery();
  2161. $ctx1.sendIdx["asJQuery"]=1;
  2162. $3="axis".__minus_gt("y");
  2163. $ctx1.sendIdx["->"]=1;
  2164. $4="containment".__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent());
  2165. $ctx1.sendIdx["->"]=2;
  2166. $5="cursor".__minus_gt("ns-resize");
  2167. $ctx1.sendIdx["->"]=3;
  2168. $6="stop".__minus_gt((function(){
  2169. return smalltalk.withContext(function($ctx2) {
  2170. return self._resized();
  2171. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2172. $ctx1.sendIdx["->"]=4;
  2173. $2=smalltalk.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(event){
  2174. return smalltalk.withContext(function($ctx2) {
  2175. return _st(self._controller())._onResize_(event);
  2176. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,2)})}))]);
  2177. _st($1)._draggable_($2);
  2178. return self}, function($ctx1) {$ctx1.fill(self,"setupEventHandlers",{},smalltalk.MKVerticalSplitView)})},
  2179. args: [],
  2180. source: "setupEventHandlers\x0a\x09splitter asJQuery draggable: #{ \x0a \x09'axis' -> 'y'. \x0a 'containment' -> splitter asJQuery parent.\x0a\x09\x09'cursor' -> 'ns-resize'.\x0a\x09\x09'stop' -> [ self resized ].\x0a 'drag' -> [ :event | self controller onResize: event ] }",
  2181. messageSends: ["draggable:", "asJQuery", "->", "parent", "resized", "onResize:", "controller"],
  2182. referencedClasses: []
  2183. }),
  2184. smalltalk.MKVerticalSplitView);
  2185. smalltalk.addMethod(
  2186. smalltalk.method({
  2187. selector: "topThickness:",
  2188. category: 'accessing',
  2189. fn: function (aNumber){
  2190. var self=this;
  2191. function $MKTopFixedVerticalSplitController(){return smalltalk.MKTopFixedVerticalSplitController||(typeof MKTopFixedVerticalSplitController=="undefined"?nil:MKTopFixedVerticalSplitController)}
  2192. return smalltalk.withContext(function($ctx1) {
  2193. self._thickness_(aNumber);
  2194. self._controller_(_st($MKTopFixedVerticalSplitController())._new());
  2195. return self}, function($ctx1) {$ctx1.fill(self,"topThickness:",{aNumber:aNumber},smalltalk.MKVerticalSplitView)})},
  2196. args: ["aNumber"],
  2197. source: "topThickness: aNumber\x0a\x09self thickness: aNumber.\x0a\x09self controller: MKTopFixedVerticalSplitController new",
  2198. messageSends: ["thickness:", "controller:", "new"],
  2199. referencedClasses: ["MKTopFixedVerticalSplitController"]
  2200. }),
  2201. smalltalk.MKVerticalSplitView);
  2202. smalltalk.addClass('MKTextAreaView', smalltalk.MKSingleAspectView, [], 'Moka-Views');
  2203. smalltalk.MKTextAreaView.comment="I am an text area view. My default controller is `MKAnyKeyInputController`.\x0a\x0aMy controller must answer to `#onKeyPressed:`.";
  2204. smalltalk.addMethod(
  2205. smalltalk.method({
  2206. selector: "cssClass",
  2207. category: 'accessing',
  2208. fn: function (){
  2209. var self=this;
  2210. return smalltalk.withContext(function($ctx1) {
  2211. var $1;
  2212. $1=_st(smalltalk.MKTextAreaView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_textarea");
  2213. return $1;
  2214. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKTextAreaView)})},
  2215. args: [],
  2216. source: "cssClass\x0a\x09^ super cssClass, ' mk_textarea'",
  2217. messageSends: [",", "cssClass"],
  2218. referencedClasses: []
  2219. }),
  2220. smalltalk.MKTextAreaView);
  2221. smalltalk.addMethod(
  2222. smalltalk.method({
  2223. selector: "defaultControllerClass",
  2224. category: 'defaults',
  2225. fn: function (){
  2226. var self=this;
  2227. function $MKAnyKeyInputController(){return smalltalk.MKAnyKeyInputController||(typeof MKAnyKeyInputController=="undefined"?nil:MKAnyKeyInputController)}
  2228. return smalltalk.withContext(function($ctx1) {
  2229. return $MKAnyKeyInputController();
  2230. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKTextAreaView)})},
  2231. args: [],
  2232. source: "defaultControllerClass\x0a\x09^ MKAnyKeyInputController",
  2233. messageSends: [],
  2234. referencedClasses: ["MKAnyKeyInputController"]
  2235. }),
  2236. smalltalk.MKTextAreaView);
  2237. smalltalk.addMethod(
  2238. smalltalk.method({
  2239. selector: "defaultLayout",
  2240. category: 'defaults',
  2241. fn: function (){
  2242. var self=this;
  2243. return smalltalk.withContext(function($ctx1) {
  2244. var $2,$3,$1;
  2245. $2=smalltalk.MKTextAreaView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  2246. _st($2)._width_((160));
  2247. _st($2)._height_((80));
  2248. $3=_st($2)._yourself();
  2249. $1=$3;
  2250. return $1;
  2251. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKTextAreaView)})},
  2252. args: [],
  2253. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 160;\x0a\x09\x09height: 80;\x0a\x09\x09yourself",
  2254. messageSends: ["width:", "defaultLayout", "height:", "yourself"],
  2255. referencedClasses: []
  2256. }),
  2257. smalltalk.MKTextAreaView);
  2258. smalltalk.addMethod(
  2259. smalltalk.method({
  2260. selector: "renderContentOn:",
  2261. category: 'rendering',
  2262. fn: function (html){
  2263. var self=this;
  2264. return smalltalk.withContext(function($ctx1) {
  2265. _st(self["@root"])._with_(self._aspectValue());
  2266. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKTextAreaView)})},
  2267. args: ["html"],
  2268. source: "renderContentOn: html\x0a\x09root with: self aspectValue",
  2269. messageSends: ["with:", "aspectValue"],
  2270. referencedClasses: []
  2271. }),
  2272. smalltalk.MKTextAreaView);
  2273. smalltalk.addMethod(
  2274. smalltalk.method({
  2275. selector: "tag",
  2276. category: 'accessing',
  2277. fn: function (){
  2278. var self=this;
  2279. return smalltalk.withContext(function($ctx1) {
  2280. return "textarea";
  2281. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKTextAreaView)})},
  2282. args: [],
  2283. source: "tag\x0a\x09^ 'textarea'",
  2284. messageSends: [],
  2285. referencedClasses: []
  2286. }),
  2287. smalltalk.MKTextAreaView);
  2288. smalltalk.addMethod(
  2289. smalltalk.method({
  2290. selector: "update",
  2291. category: 'updating',
  2292. fn: function (){
  2293. var self=this;
  2294. return smalltalk.withContext(function($ctx1) {
  2295. var $1;
  2296. $1=self["@root"];
  2297. if(($receiver = $1) == nil || $receiver == null){
  2298. $1;
  2299. } else {
  2300. _st(_st(self["@root"])._asJQuery())._val_(self._aspectValue());
  2301. };
  2302. return self}, function($ctx1) {$ctx1.fill(self,"update",{},smalltalk.MKTextAreaView)})},
  2303. args: [],
  2304. source: "update\x0a\x09root ifNotNil: [ root asJQuery val: self aspectValue ]",
  2305. messageSends: ["ifNotNil:", "val:", "asJQuery", "aspectValue"],
  2306. referencedClasses: []
  2307. }),
  2308. smalltalk.MKTextAreaView);
  2309. smalltalk.addMethod(
  2310. smalltalk.method({
  2311. selector: "value",
  2312. category: 'accessing',
  2313. fn: function (){
  2314. var self=this;
  2315. return smalltalk.withContext(function($ctx1) {
  2316. var $1;
  2317. $1=_st(_st(self["@root"])._asJQuery())._val();
  2318. return $1;
  2319. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.MKTextAreaView)})},
  2320. args: [],
  2321. source: "value\x0a\x09^ root asJQuery val",
  2322. messageSends: ["val", "asJQuery"],
  2323. referencedClasses: []
  2324. }),
  2325. smalltalk.MKTextAreaView);
  2326. smalltalk.addClass('MKInputView', smalltalk.MKTextAreaView, [], 'Moka-Views');
  2327. smalltalk.MKInputView.comment="I am an input view. My default controller is `MKEnterInputController`.\x0a\x0aMy controller must answer to `#onKeyPressed:`.";
  2328. smalltalk.addMethod(
  2329. smalltalk.method({
  2330. selector: "cssClass",
  2331. category: 'accessing',
  2332. fn: function (){
  2333. var self=this;
  2334. return smalltalk.withContext(function($ctx1) {
  2335. return "moka_view mk_input";
  2336. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKInputView)})},
  2337. args: [],
  2338. source: "cssClass\x0a\x09^ 'moka_view mk_input'",
  2339. messageSends: [],
  2340. referencedClasses: []
  2341. }),
  2342. smalltalk.MKInputView);
  2343. smalltalk.addMethod(
  2344. smalltalk.method({
  2345. selector: "defaultControllerClass",
  2346. category: 'defaults',
  2347. fn: function (){
  2348. var self=this;
  2349. function $MKEnterInputController(){return smalltalk.MKEnterInputController||(typeof MKEnterInputController=="undefined"?nil:MKEnterInputController)}
  2350. return smalltalk.withContext(function($ctx1) {
  2351. return $MKEnterInputController();
  2352. }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKInputView)})},
  2353. args: [],
  2354. source: "defaultControllerClass\x0a\x09^ MKEnterInputController",
  2355. messageSends: [],
  2356. referencedClasses: ["MKEnterInputController"]
  2357. }),
  2358. smalltalk.MKInputView);
  2359. smalltalk.addMethod(
  2360. smalltalk.method({
  2361. selector: "defaultLayout",
  2362. category: 'defaults',
  2363. fn: function (){
  2364. var self=this;
  2365. return smalltalk.withContext(function($ctx1) {
  2366. var $2,$3,$1;
  2367. $2=smalltalk.MKInputView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
  2368. _st($2)._width_((160));
  2369. _st($2)._height_((24));
  2370. $3=_st($2)._yourself();
  2371. $1=$3;
  2372. return $1;
  2373. }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKInputView)})},
  2374. args: [],
  2375. source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 160;\x0a\x09\x09height: 24;\x0a\x09\x09yourself",
  2376. messageSends: ["width:", "defaultLayout", "height:", "yourself"],
  2377. referencedClasses: []
  2378. }),
  2379. smalltalk.MKInputView);
  2380. smalltalk.addMethod(
  2381. smalltalk.method({
  2382. selector: "renderContentOn:",
  2383. category: 'rendering',
  2384. fn: function (html){
  2385. var self=this;
  2386. return smalltalk.withContext(function($ctx1) {
  2387. _st(self["@root"])._value_(self._aspectValue());
  2388. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKInputView)})},
  2389. args: ["html"],
  2390. source: "renderContentOn: html\x0a\x09root value: self aspectValue",
  2391. messageSends: ["value:", "aspectValue"],
  2392. referencedClasses: []
  2393. }),
  2394. smalltalk.MKInputView);
  2395. smalltalk.addMethod(
  2396. smalltalk.method({
  2397. selector: "tag",
  2398. category: 'accessing',
  2399. fn: function (){
  2400. var self=this;
  2401. return smalltalk.withContext(function($ctx1) {
  2402. return "input";
  2403. }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKInputView)})},
  2404. args: [],
  2405. source: "tag\x0a\x09^ 'input'",
  2406. messageSends: [],
  2407. referencedClasses: []
  2408. }),
  2409. smalltalk.MKInputView);
  2410. smalltalk.addMethod(
  2411. smalltalk.method({
  2412. selector: "triggerChangeOnAnyKey",
  2413. category: 'settings',
  2414. fn: function (){
  2415. var self=this;
  2416. function $MKAnyKeyInputController(){return smalltalk.MKAnyKeyInputController||(typeof MKAnyKeyInputController=="undefined"?nil:MKAnyKeyInputController)}
  2417. return smalltalk.withContext(function($ctx1) {
  2418. self._controller_(_st($MKAnyKeyInputController())._new());
  2419. return self}, function($ctx1) {$ctx1.fill(self,"triggerChangeOnAnyKey",{},smalltalk.MKInputView)})},
  2420. args: [],
  2421. source: "triggerChangeOnAnyKey\x0a\x09self controller: MKAnyKeyInputController new",
  2422. messageSends: ["controller:", "new"],
  2423. referencedClasses: ["MKAnyKeyInputController"]
  2424. }),
  2425. smalltalk.MKInputView);
  2426. smalltalk.addMethod(
  2427. smalltalk.method({
  2428. selector: "triggerChangeOnEnter",
  2429. category: 'settings',
  2430. fn: function (){
  2431. var self=this;
  2432. function $MKEnterInputController(){return smalltalk.MKEnterInputController||(typeof MKEnterInputController=="undefined"?nil:MKEnterInputController)}
  2433. return smalltalk.withContext(function($ctx1) {
  2434. self._controller_(_st($MKEnterInputController())._new());
  2435. return self}, function($ctx1) {$ctx1.fill(self,"triggerChangeOnEnter",{},smalltalk.MKInputView)})},
  2436. args: [],
  2437. source: "triggerChangeOnEnter\x0a\x09self controller: MKEnterInputController new",
  2438. messageSends: ["controller:", "new"],
  2439. referencedClasses: ["MKEnterInputController"]
  2440. }),
  2441. smalltalk.MKInputView);
  2442. });