Moka-Views.js 89 KB

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