Moka-Views.js 85 KB

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