Moka-Views.js 86 KB

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