12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606 |
- define("amber_core/Moka-Views", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Moka-Core"], function(smalltalk,nil,_st){
- smalltalk.addPackage('Moka-Views');
- smalltalk.packages["Moka-Views"].transport = {"type":"amd","amdNamespace":"amber_core"};
- smalltalk.addClass('MKButtonView', smalltalk.MKSingleAspectView, ['default', 'label'], 'Moka-Views');
- smalltalk.MKButtonView.comment="I am a push button view. My default controller is `MKButtonController`.\x0a\x0aMy controller must answer to `#onPressed`.\x0a\x0a## API\x0a\x0a- Instances can be set a `default` button\x0a- Use `#label:` to set the label string";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $1=_st($String())._streamContents_((function(stream){
- return smalltalk.withContext(function($ctx2) {
- $2=_st(stream).__lt_lt(smalltalk.MKButtonView.superclass.fn.prototype._cssClass.apply(_st(self), []));
- $ctx2.sendIdx["<<"]=2;
- _st($2).__lt_lt(" mk_button");
- $ctx2.sendIdx["<<"]=1;
- $3=self._isDefault();
- if(smalltalk.assert($3)){
- return _st(stream).__lt_lt(" default");
- };
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKButtonView)})},
- args: [],
- source: "cssClass\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream << super cssClass << ' mk_button'.\x0a\x09\x09self isDefault \x0a\x09\x09\x09ifTrue: [ stream << ' default' ] ]",
- messageSends: ["streamContents:", "<<", "cssClass", "ifTrue:", "isDefault"],
- referencedClasses: ["String"]
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "default",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@default"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.MKButtonView)})},
- args: [],
- source: "default\x0a\x09^ default",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "default:",
- category: 'accessing',
- fn: function (aBoolean){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@default"]=aBoolean;
- return self}, function($ctx1) {$ctx1.fill(self,"default:",{aBoolean:aBoolean},smalltalk.MKButtonView)})},
- args: ["aBoolean"],
- source: "default: aBoolean\x0a\x09default := aBoolean",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKButtonController(){return smalltalk.MKButtonController||(typeof MKButtonController=="undefined"?nil:MKButtonController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKButtonController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKButtonView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKButtonController",
- messageSends: [],
- referencedClasses: ["MKButtonController"]
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultLabel",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "OK";
- }, function($ctx1) {$ctx1.fill(self,"defaultLabel",{},smalltalk.MKButtonView)})},
- args: [],
- source: "defaultLabel\x0a\x09^ 'OK'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultLayout",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=smalltalk.MKButtonView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
- _st($2)._width_((80));
- _st($2)._height_((24));
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKButtonView)})},
- args: [],
- source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 80;\x0a\x09\x09height: 24;\x0a\x09\x09yourself",
- messageSends: ["width:", "defaultLayout", "height:", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "isDefault",
- category: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self._default();
- if(($receiver = $2) == nil || $receiver == null){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"isDefault",{},smalltalk.MKButtonView)})},
- args: [],
- source: "isDefault\x0a\x09^ self default ifNil: [ false ]",
- messageSends: ["ifNil:", "default"],
- referencedClasses: []
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "label",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@label"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=self._defaultLabel();
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.MKButtonView)})},
- args: [],
- source: "label\x0a\x09^ label ifNil: [ self defaultLabel ]",
- messageSends: ["ifNil:", "defaultLabel"],
- referencedClasses: []
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "label:",
- category: 'accessing',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@label"]=aString;
- return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.MKButtonView)})},
- args: ["aString"],
- source: "label: aString\x0a\x09label := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(html)._with_(self._label());
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKButtonView)})},
- args: ["html"],
- source: "renderContentOn: html\x0a\x09html with: self label",
- messageSends: ["with:", "label"],
- referencedClasses: []
- }),
- smalltalk.MKButtonView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "tag",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "button";
- }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKButtonView)})},
- args: [],
- source: "tag\x0a\x09^ 'button'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKButtonView);
- smalltalk.addClass('MKCheckboxView', smalltalk.MKSingleAspectView, ['id'], 'Moka-Views');
- smalltalk.MKCheckboxView.comment="I am a checkbox view. My default controller is `MKCheckboxController`.\x0a\x0aMy controller must answer to `#onToggled:`.\x0a\x0a##API\x0a\x0a- If no `aspect` is provided, the ckeckbox state will always be off.\x0a- use `#label:` to set the label string.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "checked",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self._aspectValue();
- if(($receiver = $2) == nil || $receiver == null){
- $1=false;
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"checked",{},smalltalk.MKCheckboxView)})},
- args: [],
- source: "checked\x0a\x09^ self aspectValue ifNil: [ false ]",
- messageSends: ["ifNil:", "aspectValue"],
- referencedClasses: []
- }),
- smalltalk.MKCheckboxView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKCheckboxView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_checkbox");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKCheckboxView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_checkbox'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKCheckboxView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKCheckboxController(){return smalltalk.MKCheckboxController||(typeof MKCheckboxController=="undefined"?nil:MKCheckboxController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKCheckboxController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKCheckboxView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKCheckboxController",
- messageSends: [],
- referencedClasses: ["MKCheckboxController"]
- }),
- smalltalk.MKCheckboxView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultLayout",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=smalltalk.MKCheckboxView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
- _st($2)._width_((16));
- _st($2)._height_((16));
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKCheckboxView)})},
- args: [],
- source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 16;\x0a\x09\x09height: 16;\x0a\x09\x09yourself",
- messageSends: ["width:", "defaultLayout", "height:", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKCheckboxView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "id",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@id"];
- if(($receiver = $2) == nil || $receiver == null){
- self["@id"]=_st((1000000)._atRandom())._asString();
- $1=self["@id"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"id",{},smalltalk.MKCheckboxView)})},
- args: [],
- source: "id\x0a\x09^ id ifNil: [ id := 1000000 atRandom asString ]",
- messageSends: ["ifNil:", "asString", "atRandom"],
- referencedClasses: []
- }),
- smalltalk.MKCheckboxView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._checked();
- if(smalltalk.assert($1)){
- _st(_st(self["@root"])._asJQuery())._addClass_("checked");
- };
- _st(self["@root"])._at_put_("tabindex","0");
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKCheckboxView)})},
- args: ["html"],
- source: "renderContentOn: html\x09\x0a\x09self checked ifTrue: [ \x0a\x09\x09root asJQuery addClass: 'checked' ].\x0a\x09\x0a\x09root at: 'tabindex' put: '0'",
- messageSends: ["ifTrue:", "checked", "addClass:", "asJQuery", "at:put:"],
- referencedClasses: []
- }),
- smalltalk.MKCheckboxView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "update",
- category: 'events',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=self._checked();
- if(smalltalk.assert($1)){
- $2=_st(self["@root"])._asJQuery();
- $ctx1.sendIdx["asJQuery"]=1;
- _st($2)._addClass_("checked");
- } else {
- _st(_st(self["@root"])._asJQuery())._removeClass_("checked");
- };
- return self}, function($ctx1) {$ctx1.fill(self,"update",{},smalltalk.MKCheckboxView)})},
- args: [],
- source: "update\x0a\x09self checked\x0a\x09\x09ifTrue: [ root asJQuery addClass: 'checked' ]\x0a\x09\x09ifFalse: [ root asJQuery removeClass: 'checked' ]",
- messageSends: ["ifTrue:ifFalse:", "checked", "addClass:", "asJQuery", "removeClass:"],
- referencedClasses: []
- }),
- smalltalk.MKCheckboxView);
- smalltalk.addClass('MKSwitchView', smalltalk.MKCheckboxView, [], 'Moka-Views');
- smalltalk.MKSwitchView.comment="I am a switch view, similar to a `MKCheckboxView` but displayed as a switch. \x0aMy default controller is `MKCheckboxController`.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "checkboxCssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "mk_switch";
- }, function($ctx1) {$ctx1.fill(self,"checkboxCssClass",{},smalltalk.MKSwitchView)})},
- args: [],
- source: "checkboxCssClass\x0a\x09^ 'mk_switch'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSwitchView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKSwitchView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_switch");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKSwitchView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_switch'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKSwitchView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultLayout",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=smalltalk.MKSwitchView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
- _st($2)._width_((48));
- _st($2)._height_((20));
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKSwitchView)})},
- args: [],
- source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 48;\x0a\x09\x09height: 20;\x0a\x09\x09yourself",
- messageSends: ["width:", "defaultLayout", "height:", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKSwitchView);
- smalltalk.addClass('MKLabelView', smalltalk.MKSingleAspectView, [], 'Moka-Views');
- smalltalk.MKLabelView.comment="I am an label view. I display a `String`.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKLabelView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_label");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKLabelView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_label'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKLabelView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=smalltalk.MKLabelView.superclass.fn.prototype._defaultControllerClass.apply(_st(self), []);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKLabelView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ super defaultControllerClass",
- messageSends: ["defaultControllerClass"],
- referencedClasses: []
- }),
- smalltalk.MKLabelView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultLayout",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKLabelLayout(){return smalltalk.MKLabelLayout||(typeof MKLabelLayout=="undefined"?nil:MKLabelLayout)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st($MKLabelLayout())._new();
- _st($2)._height_((24));
- _st($2)._top_((0));
- _st($2)._left_((0));
- _st($2)._right_((0));
- _st($2)._textAlign_("left");
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKLabelView)})},
- args: [],
- 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",
- messageSends: ["height:", "new", "top:", "left:", "right:", "textAlign:", "yourself"],
- referencedClasses: ["MKLabelLayout"]
- }),
- smalltalk.MKLabelView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(html)._with_(self._aspectValue());
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKLabelView)})},
- args: ["html"],
- source: "renderContentOn: html\x0a\x09html with: self aspectValue",
- messageSends: ["with:", "aspectValue"],
- referencedClasses: []
- }),
- smalltalk.MKLabelView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "textAlign:",
- category: 'layout',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._layout())._textAlign_(aString);
- return self}, function($ctx1) {$ctx1.fill(self,"textAlign:",{aString:aString},smalltalk.MKLabelView)})},
- args: ["aString"],
- source: "textAlign: aString\x0a\x09self layout textAlign: aString",
- messageSends: ["textAlign:", "layout"],
- referencedClasses: []
- }),
- smalltalk.MKLabelView);
- smalltalk.addClass('MKHeadingView', smalltalk.MKLabelView, ['level'], 'Moka-Views');
- smalltalk.MKHeadingView.comment="I display a heading, with a `level` from 1 to 6.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $1=_st($String())._streamContents_((function(stream){
- return smalltalk.withContext(function($ctx2) {
- $2=_st(_st(stream).__lt_lt(smalltalk.MKHeadingView.superclass.fn.prototype._cssClass.apply(_st(self), []))).__lt_lt(" mk_heading level");
- $ctx2.sendIdx["<<"]=2;
- return _st($2).__lt_lt(_st(self._level())._asString());
- $ctx2.sendIdx["<<"]=1;
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKHeadingView)})},
- args: [],
- 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 ]",
- messageSends: ["streamContents:", "<<", "cssClass", "asString", "level"],
- referencedClasses: ["String"]
- }),
- smalltalk.MKHeadingView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "level",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@level"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=(1);
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"level",{},smalltalk.MKHeadingView)})},
- args: [],
- source: "level\x0a\x09^ level ifNil: [ 1 ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.MKHeadingView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "level:",
- category: 'accessing',
- fn: function (aNumber){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@level"]=aNumber;
- return self}, function($ctx1) {$ctx1.fill(self,"level:",{aNumber:aNumber},smalltalk.MKHeadingView)})},
- args: ["aNumber"],
- source: "level: aNumber\x0a\x09level := aNumber",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKHeadingView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "tag",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1="h".__comma(_st(self._level())._asString());
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKHeadingView)})},
- args: [],
- source: "tag\x0a\x09^ 'h', self level asString",
- messageSends: [",", "asString", "level"],
- referencedClasses: []
- }),
- smalltalk.MKHeadingView);
- smalltalk.addClass('MKOverlayView', smalltalk.MKLayoutView, ['childView'], 'Moka-Views');
- smalltalk.MKOverlayView.comment="I display an transparent overlay, typically over other views, except my `childView`.\x0a\x0a## API\x0a\x0aCreate instances using the class-side `childView:` method.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "childView",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@childView"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"childView",{},smalltalk.MKOverlayView)})},
- args: [],
- source: "childView\x0a\x09^ childView",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKOverlayView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "childView:",
- category: 'accessing',
- fn: function (aView){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@childView"]=aView;
- return self}, function($ctx1) {$ctx1.fill(self,"childView:",{aView:aView},smalltalk.MKOverlayView)})},
- args: ["aView"],
- source: "childView: aView\x0a\x09childView := aView",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKOverlayView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "children",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=[self._childView()];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"children",{},smalltalk.MKOverlayView)})},
- args: [],
- source: "children\x0a\x09^ { self childView }",
- messageSends: ["childView"],
- referencedClasses: []
- }),
- smalltalk.MKOverlayView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKOverlayView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_overlay");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKOverlayView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_overlay'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKOverlayView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKOverlayController(){return smalltalk.MKOverlayController||(typeof MKOverlayController=="undefined"?nil:MKOverlayController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKOverlayController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKOverlayView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKOverlayController",
- messageSends: [],
- referencedClasses: ["MKOverlayController"]
- }),
- smalltalk.MKOverlayView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "remove",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- smalltalk.MKOverlayView.superclass.fn.prototype._remove.apply(_st(self), []);
- $ctx1.sendIdx["remove"]=1;
- _st(self._childView())._remove();
- return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.MKOverlayView)})},
- args: [],
- source: "remove\x0a\x09super remove.\x0a\x09self childView remove",
- messageSends: ["remove", "childView"],
- referencedClasses: []
- }),
- smalltalk.MKOverlayView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'defaults',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKOverlayView)})},
- args: ["html"],
- source: "renderContentOn: html\x0a\x09\x22Left empty on purpose. \x0a\x09No Content is rendered, as the childView is actually displayed separately\x22",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKOverlayView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "childView:",
- category: 'instance creation',
- fn: function (aView){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=self._new();
- _st($2)._childView_(aView);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"childView:",{aView:aView},smalltalk.MKOverlayView.klass)})},
- args: ["aView"],
- source: "childView: aView\x0a\x09^ self new\x0a\x09\x09childView: aView;\x0a\x09\x09yourself",
- messageSends: ["childView:", "new", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKOverlayView.klass);
- smalltalk.addClass('MKPaneView', smalltalk.MKLayoutView, ['views'], 'Moka-Views');
- smalltalk.MKPaneView.comment="I am a view containing other views.\x0a\x0a## API\x0a\x0aUse `#addView:` to add a view to the pane.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "addView:",
- category: 'adding',
- fn: function (aView){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._views())._add_(aView);
- return self}, function($ctx1) {$ctx1.fill(self,"addView:",{aView:aView},smalltalk.MKPaneView)})},
- args: ["aView"],
- source: "addView: aView\x0a\x09self views add: aView",
- messageSends: ["add:", "views"],
- referencedClasses: []
- }),
- smalltalk.MKPaneView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "borderBottom:",
- category: 'layout',
- fn: function (aNumber){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._layout())._borderBottom_(aNumber);
- return self}, function($ctx1) {$ctx1.fill(self,"borderBottom:",{aNumber:aNumber},smalltalk.MKPaneView)})},
- args: ["aNumber"],
- source: "borderBottom: aNumber\x0a\x09self layout borderBottom: aNumber",
- messageSends: ["borderBottom:", "layout"],
- referencedClasses: []
- }),
- smalltalk.MKPaneView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "borderLeft:",
- category: 'layout',
- fn: function (aNumber){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._layout())._borderLeft_(aNumber);
- return self}, function($ctx1) {$ctx1.fill(self,"borderLeft:",{aNumber:aNumber},smalltalk.MKPaneView)})},
- args: ["aNumber"],
- source: "borderLeft: aNumber\x0a\x09self layout borderLeft: aNumber",
- messageSends: ["borderLeft:", "layout"],
- referencedClasses: []
- }),
- smalltalk.MKPaneView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "borderRight:",
- category: 'layout',
- fn: function (aNumber){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._layout())._borderRight_(aNumber);
- return self}, function($ctx1) {$ctx1.fill(self,"borderRight:",{aNumber:aNumber},smalltalk.MKPaneView)})},
- args: ["aNumber"],
- source: "borderRight: aNumber\x0a\x09self layout borderRight: aNumber",
- messageSends: ["borderRight:", "layout"],
- referencedClasses: []
- }),
- smalltalk.MKPaneView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "borderTop:",
- category: 'layout',
- fn: function (aNumber){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._layout())._borderTop_(aNumber);
- return self}, function($ctx1) {$ctx1.fill(self,"borderTop:",{aNumber:aNumber},smalltalk.MKPaneView)})},
- args: ["aNumber"],
- source: "borderTop: aNumber\x0a\x09self layout borderTop: aNumber",
- messageSends: ["borderTop:", "layout"],
- referencedClasses: []
- }),
- smalltalk.MKPaneView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "children",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._views();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"children",{},smalltalk.MKPaneView)})},
- args: [],
- source: "children\x0a\x09^ self views",
- messageSends: ["views"],
- referencedClasses: []
- }),
- smalltalk.MKPaneView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKPaneView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_pane");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKPaneView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_pane'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKPaneView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultLayout",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKPaneLayout(){return smalltalk.MKPaneLayout||(typeof MKPaneLayout=="undefined"?nil:MKPaneLayout)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st($MKPaneLayout())._new();
- _st($2)._left_((0));
- _st($2)._top_((0));
- _st($2)._right_((0));
- _st($2)._bottom_((0));
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKPaneView)})},
- args: [],
- 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",
- messageSends: ["left:", "new", "top:", "right:", "bottom:", "yourself"],
- referencedClasses: ["MKPaneLayout"]
- }),
- smalltalk.MKPaneView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._views())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(html)._with_(each);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKPaneView)})},
- args: ["html"],
- source: "renderContentOn: html\x0a\x09self views do: [ :each | \x0a\x09\x09html with: each ]",
- messageSends: ["do:", "views", "with:"],
- referencedClasses: []
- }),
- smalltalk.MKPaneView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "views",
- category: 'accessing',
- fn: function (){
- var self=this;
- function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@views"];
- if(($receiver = $2) == nil || $receiver == null){
- self["@views"]=_st($OrderedCollection())._new();
- $1=self["@views"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"views",{},smalltalk.MKPaneView)})},
- args: [],
- source: "views\x0a\x09^ views ifNil: [ views := OrderedCollection new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["OrderedCollection"]
- }),
- smalltalk.MKPaneView);
- smalltalk.addClass('MKPanelView', smalltalk.MKPaneView, [], 'Moka-Views');
- smalltalk.MKPanelView.comment="I am similar to a `MKPaneView` but I am scrollable and display a light background.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKPanelView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_panel");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKPanelView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_panel'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKPanelView);
- smalltalk.addClass('MKSelectionView', smalltalk.MKAspectsView, ['selectionAspect', 'collectionAspect', 'displayBlock'], 'Moka-Views');
- smalltalk.MKSelectionView.comment="I an abstract selection view of a list of elements.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "collection",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._valueForAspect_(self._collectionAspect());
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.MKSelectionView)})},
- args: [],
- source: "collection\x0a\x09^ self valueForAspect: self collectionAspect",
- messageSends: ["valueForAspect:", "collectionAspect"],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "collectionAspect",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@collectionAspect"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"collectionAspect",{},smalltalk.MKSelectionView)})},
- args: [],
- source: "collectionAspect\x0a\x09^ collectionAspect",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "collectionAspect:",
- category: 'accessing',
- fn: function (aSelector){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@collectionAspect"]=aSelector;
- return self}, function($ctx1) {$ctx1.fill(self,"collectionAspect:",{aSelector:aSelector},smalltalk.MKSelectionView)})},
- args: ["aSelector"],
- source: "collectionAspect: aSelector\x0a\x09collectionAspect := aSelector",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultDisplayBlock",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=(function(item){
- return smalltalk.withContext(function($ctx2) {
- return _st(item)._asString();
- }, function($ctx2) {$ctx2.fillBlock({item:item},$ctx1,1)})});
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultDisplayBlock",{},smalltalk.MKSelectionView)})},
- args: [],
- source: "defaultDisplayBlock\x0a\x09^ [ :item | item asString ]",
- messageSends: ["asString"],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "displayBlock",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@displayBlock"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=self._defaultDisplayBlock();
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"displayBlock",{},smalltalk.MKSelectionView)})},
- args: [],
- source: "displayBlock\x0a\x09^ displayBlock ifNil: [ self defaultDisplayBlock ]",
- messageSends: ["ifNil:", "defaultDisplayBlock"],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "displayBlock:",
- category: 'accessing',
- fn: function (aBlock){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@displayBlock"]=aBlock;
- return self}, function($ctx1) {$ctx1.fill(self,"displayBlock:",{aBlock:aBlock},smalltalk.MKSelectionView)})},
- args: ["aBlock"],
- source: "displayBlock: aBlock\x0a\x09displayBlock := aBlock",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selectedItem",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._valueForAspect_(self._selectionAspect());
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.MKSelectionView)})},
- args: [],
- source: "selectedItem\x0a\x09^ self valueForAspect: self selectionAspect",
- messageSends: ["valueForAspect:", "selectionAspect"],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selectionAspect",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@selectionAspect"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"selectionAspect",{},smalltalk.MKSelectionView)})},
- args: [],
- source: "selectionAspect\x0a\x09^ selectionAspect",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selectionAspect:",
- category: 'accessing',
- fn: function (aSelector){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@selectionAspect"]=aSelector;
- return self}, function($ctx1) {$ctx1.fill(self,"selectionAspect:",{aSelector:aSelector},smalltalk.MKSelectionView)})},
- args: ["aSelector"],
- source: "selectionAspect: aSelector\x0a\x09selectionAspect := aSelector",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "model:collectionAspect:selectionAspect:",
- category: 'instance creation',
- fn: function (aModel,collectionSelector,selectionSelector){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=self._model_(aModel);
- _st($2)._collectionAspect_(collectionSelector);
- _st($2)._selectionAspect_(selectionSelector);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"model:collectionAspect:selectionAspect:",{aModel:aModel,collectionSelector:collectionSelector,selectionSelector:selectionSelector},smalltalk.MKSelectionView.klass)})},
- args: ["aModel", "collectionSelector", "selectionSelector"],
- source: "model: aModel collectionAspect: collectionSelector selectionAspect: selectionSelector\x0a\x09^ (self model: aModel)\x0a\x09\x09collectionAspect: collectionSelector;\x0a\x09\x09selectionAspect: selectionSelector;\x0a\x09\x09yourself",
- messageSends: ["collectionAspect:", "model:", "selectionAspect:", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKSelectionView.klass);
- smalltalk.addClass('MKDropdownView', smalltalk.MKSelectionView, ['modalPaneView', 'listView'], 'Moka-Views');
- smalltalk.MKDropdownView.comment="I am a push button view. My default controller is `MKButtonController`.\x0a\x0aMy controller must answer to `#onPressed`.\x0a\x0a## API\x0a\x0a- Instances can be set a `default` button\x0a- Use `#label:` to set the label string";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKDropdownView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_dropdown");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKDropdownView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_dropdown'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKDropdownView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKDropdownController(){return smalltalk.MKDropdownController||(typeof MKDropdownController=="undefined"?nil:MKDropdownController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKDropdownController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKDropdownView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKDropdownController",
- messageSends: [],
- referencedClasses: ["MKDropdownController"]
- }),
- smalltalk.MKDropdownView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultLayout",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=smalltalk.MKDropdownView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
- _st($2)._width_((120));
- _st($2)._height_((24));
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKDropdownView)})},
- args: [],
- source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 120;\x0a\x09\x09height: 24;\x0a\x09\x09yourself",
- messageSends: ["width:", "defaultLayout", "height:", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKDropdownView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "listView",
- category: 'views',
- fn: function (){
- var self=this;
- function $MKDropdownListView(){return smalltalk.MKDropdownListView||(typeof MKDropdownListView=="undefined"?nil:MKDropdownListView)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$4,$1;
- $2=self["@listView"];
- if(($receiver = $2) == nil || $receiver == null){
- $3=_st($MKDropdownListView())._model_collectionAspect_selectionAspect_(self._model(),self._collectionAspect(),self._selectionAspect());
- _st($3)._width_(self._width());
- _st($3)._height_("auto");
- $4=_st($3)._yourself();
- self["@listView"]=$4;
- $1=self["@listView"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"listView",{},smalltalk.MKDropdownView)})},
- args: [],
- source: "listView\x0a\x09^ listView ifNil: [\x0a\x09\x09listView := (MKDropdownListView \x09\x0a\x09\x09\x09model: self model\x0a\x09\x09\x09collectionAspect: self collectionAspect\x0a\x09\x09\x09selectionAspect: self selectionAspect)\x0a\x09\x09\x09\x09width: self width;\x0a\x09\x09\x09\x09height: 'auto';\x0a\x09\x09\x09\x09yourself ]",
- messageSends: ["ifNil:", "width:", "model:collectionAspect:selectionAspect:", "model", "collectionAspect", "selectionAspect", "width", "height:", "yourself"],
- referencedClasses: ["MKDropdownListView"]
- }),
- smalltalk.MKDropdownView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "modalPaneView",
- category: 'views',
- fn: function (){
- var self=this;
- function $MKModalDecorator(){return smalltalk.MKModalDecorator||(typeof MKModalDecorator=="undefined"?nil:MKModalDecorator)}
- function $MKViewRemoved(){return smalltalk.MKViewRemoved||(typeof MKViewRemoved=="undefined"?nil:MKViewRemoved)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$4,$1;
- $2=self["@modalPaneView"];
- if(($receiver = $2) == nil || $receiver == null){
- $3=_st($MKModalDecorator())._decorate_(self._listView());
- _st($3)._extraCssClass_("mk_dropdown_pane");
- _st($3)._closeOnEnter_(true);
- _st($3)._closeOnClick_(true);
- $4=_st($3)._yourself();
- self["@modalPaneView"]=$4;
- self["@modalPaneView"];
- _st(self["@modalPaneView"])._on_send_to_($MKViewRemoved(),"focus",self);
- $1=self["@modalPaneView"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"modalPaneView",{},smalltalk.MKDropdownView)})},
- args: [],
- 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 ]",
- messageSends: ["ifNil:", "extraCssClass:", "decorate:", "listView", "closeOnEnter:", "closeOnClick:", "yourself", "on:send:to:"],
- referencedClasses: ["MKModalDecorator", "MKViewRemoved"]
- }),
- smalltalk.MKDropdownView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "popupList",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$4,$3,$5;
- $1=self._modalPaneView();
- $2=$1;
- $4=self._domPosition();
- $ctx1.sendIdx["domPosition"]=1;
- $3=_st($4)._x();
- _st($2)._left_($3);
- _st($1)._top_(_st(self._domPosition())._y());
- $5=_st($1)._render();
- _st(self._listView())._focus();
- return self}, function($ctx1) {$ctx1.fill(self,"popupList",{},smalltalk.MKDropdownView)})},
- args: [],
- 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",
- messageSends: ["left:", "modalPaneView", "x", "domPosition", "top:", "y", "render", "focus", "listView"],
- referencedClasses: []
- }),
- smalltalk.MKDropdownView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(_st(html)._div())._class_("mk_dropdown_arrows");
- _st(html)._with_(_st(self._displayBlock())._value_(self._selectedItem()));
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKDropdownView)})},
- args: ["html"],
- source: "renderContentOn: html\x0a\x09html div class: 'mk_dropdown_arrows'.\x0a\x09html with: (self displayBlock value: self selectedItem)",
- messageSends: ["class:", "div", "with:", "value:", "displayBlock", "selectedItem"],
- referencedClasses: []
- }),
- smalltalk.MKDropdownView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selectedListItem",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(_st(self["@root"])._asJQuery())._find_(":selected"))._text();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"selectedListItem",{},smalltalk.MKDropdownView)})},
- args: [],
- source: "selectedListItem\x0a\x09^ (root asJQuery find: ':selected') text",
- messageSends: ["text", "find:", "asJQuery"],
- referencedClasses: []
- }),
- smalltalk.MKDropdownView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "tag",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "button";
- }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKDropdownView)})},
- args: [],
- source: "tag\x0a\x09^ 'button'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKDropdownView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "update:",
- category: 'accessing',
- fn: function (anAnnouncement){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st([self._selectionAspect(),self._collectionAspect()])._includes_(_st(anAnnouncement)._aspect());
- if(smalltalk.assert($1)){
- self._update();
- };
- return self}, function($ctx1) {$ctx1.fill(self,"update:",{anAnnouncement:anAnnouncement},smalltalk.MKDropdownView)})},
- args: ["anAnnouncement"],
- source: "update: anAnnouncement\x0a\x09({self selectionAspect. self collectionAspect} \x0a\x09\x09includes: anAnnouncement aspect) ifTrue: [\x0a\x09\x09\x09self update ]",
- messageSends: ["ifTrue:", "includes:", "selectionAspect", "collectionAspect", "aspect", "update"],
- referencedClasses: []
- }),
- smalltalk.MKDropdownView);
- smalltalk.addClass('MKListView', smalltalk.MKSelectionView, [], 'Moka-Views');
- smalltalk.MKListView.comment="I display a list of elements in a list control field.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "activateItem:",
- category: 'actions',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._activateListItem_(self._findListItemFor_(anObject));
- return self}, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.MKListView)})},
- args: ["anObject"],
- source: "activateItem: anObject\x0a\x09self activateListItem: (self findListItemFor: anObject)",
- messageSends: ["activateListItem:", "findListItemFor:"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "activateListItem:",
- category: 'actions',
- fn: function (aListItem){
- var self=this;
- var item;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3;
- $1=_st(aListItem)._get_((0));
- if(($receiver = $1) == nil || $receiver == null){
- return self;
- } else {
- $1;
- };
- $2=_st(_st(aListItem)._parent())._children();
- $3=self._selectedCssClass();
- $ctx1.sendIdx["selectedCssClass"]=1;
- _st($2)._removeClass_($3);
- _st(aListItem)._addClass_(self._selectedCssClass());
- self._ensureVisible_(aListItem);
- return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.MKListView)})},
- args: ["aListItem"],
- 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",
- messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "selectedCssClass", "addClass:", "ensureVisible:"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "activeItem",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self._findItemFor_(_st(_st(self["@root"])._asJQuery())._find_(".".__comma(self._selectedCssClass())));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"activeItem",{},smalltalk.MKListView)})},
- args: [],
- source: "activeItem\x0a\x09^ self findItemFor: (root asJQuery find: '.', self selectedCssClass)",
- messageSends: ["findItemFor:", "find:", "asJQuery", ",", "selectedCssClass"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKListView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_list");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKListView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_list'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKListController(){return smalltalk.MKListController||(typeof MKListController=="undefined"?nil:MKListController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKListController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKListView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKListController",
- messageSends: [],
- referencedClasses: ["MKListController"]
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "ensureVisible:",
- category: 'private',
- fn: function (aListItem){
- var self=this;
- var parent,position;
- function $MKViewScroll(){return smalltalk.MKViewScroll||(typeof MKViewScroll=="undefined"?nil:MKViewScroll)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$4,$3,$2,$5,$9,$8,$11,$10,$7,$6,$15,$14,$16,$13,$17,$12,$18,$22,$23,$21,$20,$19;
- $1=_st(aListItem)._get_((0));
- $ctx1.sendIdx["get:"]=1;
- if(($receiver = $1) == nil || $receiver == null){
- return self;
- } else {
- $1;
- };
- position=self._positionOf_(aListItem);
- parent=_st(aListItem)._parent();
- $4=_st(aListItem)._position();
- $ctx1.sendIdx["position"]=1;
- $3=_st($4)._top();
- $ctx1.sendIdx["top"]=1;
- $2=_st($3).__lt((0));
- if(smalltalk.assert($2)){
- $5=_st(parent)._get_((0));
- $ctx1.sendIdx["get:"]=2;
- $9=_st(parent)._get_((0));
- $ctx1.sendIdx["get:"]=3;
- $8=_st($9)._scrollTop();
- $ctx1.sendIdx["scrollTop"]=1;
- $11=_st(aListItem)._position();
- $ctx1.sendIdx["position"]=2;
- $10=_st($11)._top();
- $ctx1.sendIdx["top"]=2;
- $7=_st($8).__plus($10);
- $ctx1.sendIdx["+"]=1;
- $6=_st($7).__minus((10));
- $ctx1.sendIdx["-"]=1;
- _st($5)._scrollTop_($6);
- $ctx1.sendIdx["scrollTop:"]=1;
- };
- $15=_st(aListItem)._position();
- $ctx1.sendIdx["position"]=3;
- $14=_st($15)._top();
- $ctx1.sendIdx["top"]=3;
- $16=_st(aListItem)._height();
- $ctx1.sendIdx["height"]=1;
- $13=_st($14).__plus($16);
- $ctx1.sendIdx["+"]=2;
- $17=_st(parent)._height();
- $ctx1.sendIdx["height"]=2;
- $12=_st($13).__gt($17);
- if(smalltalk.assert($12)){
- $18=_st(parent)._get_((0));
- $ctx1.sendIdx["get:"]=4;
- $22=_st(_st(parent)._get_((0)))._scrollTop();
- $23=_st(aListItem)._height();
- $ctx1.sendIdx["height"]=3;
- $21=_st($22).__plus($23);
- $20=_st($21).__minus(_st(_st(parent)._height()).__minus(_st(_st(aListItem)._position())._top()));
- $ctx1.sendIdx["-"]=2;
- $19=_st($20).__plus((10));
- $ctx1.sendIdx["+"]=3;
- _st($18)._scrollTop_($19);
- };
- self._announce_(_st($MKViewScroll())._view_(self));
- return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,parent:parent,position:position},smalltalk.MKListView)})},
- args: ["aListItem"],
- 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)",
- messageSends: ["ifNil:", "get:", "positionOf:", "parent", "ifTrue:", "<", "top", "position", "scrollTop:", "-", "+", "scrollTop", ">", "height", "announce:", "view:"],
- referencedClasses: ["MKViewScroll"]
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "findItemFor:",
- category: 'accessing',
- fn: function (aListItem){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(_st(aListItem)._asJQuery())._data())._at_("item");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"findItemFor:",{aListItem:aListItem},smalltalk.MKListView)})},
- args: ["aListItem"],
- source: "findItemFor: aListItem\x0a\x09^ aListItem asJQuery data at: 'item'",
- messageSends: ["at:", "data", "asJQuery"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "findListItemFor:",
- category: 'accessing',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $4,$3,$2,$1;
- $4=_st(self["@root"])._asJQuery();
- $ctx1.sendIdx["asJQuery"]=1;
- $3=_st($4)._find_("li");
- $2=_st($3)._filter_(_st((function(thisArg){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(_st(thisArg)._asJQuery())._data_("item")).__eq(anObject);
- }, function($ctx2) {$ctx2.fillBlock({thisArg:thisArg},$ctx1,1)})}))._currySelf());
- $1=_st($2)._eq_((0));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"findListItemFor:",{anObject:anObject},smalltalk.MKListView)})},
- args: ["anObject"],
- source: "findListItemFor: anObject\x0a\x09^ (((root asJQuery find: 'li') \x0a\x09\x09filter: [ :thisArg | (thisArg asJQuery data: 'item') = anObject ] currySelf) eq: 0)",
- messageSends: ["eq:", "filter:", "find:", "asJQuery", "currySelf", "=", "data:"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "positionOf:",
- category: 'private',
- fn: function (aListItem){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1;
- return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.MKListView)})},
- args: ["aListItem"],
- source: "positionOf: aListItem\x0a\x09\x22TODO: rewrite in smalltalk\x22\x0a\x09<return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1>",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self._collection())._do_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return self._renderItem_on_(each,html);
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
- _st(self["@root"])._at_put_("tabindex","0");
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKListView)})},
- args: ["html"],
- 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'",
- messageSends: ["do:", "collection", "renderItem:on:", "at:put:"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderItem:on:",
- category: 'rendering',
- fn: function (anObject,html){
- var self=this;
- var li;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- li=_st(html)._li();
- _st(_st(li)._asJQuery())._data_put_("item",anObject);
- $1=_st(self._selectedItem()).__eq(anObject);
- if(smalltalk.assert($1)){
- _st(li)._class_(self._selectedCssClass());
- };
- _st(li)._with_(_st(self._displayBlock())._value_(anObject));
- return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.MKListView)})},
- args: ["anObject", "html"],
- source: "renderItem: anObject on: html\x0a\x09| li |\x0a\x09\x0a\x09li := html li.\x0a\x09li asJQuery data: 'item' put: anObject.\x0a\x09\x0a\x09self selectedItem = anObject ifTrue: [\x0a\x09\x09li class: self selectedCssClass ].\x09\x0a\x09li with: (self displayBlock value: anObject)",
- messageSends: ["li", "data:put:", "asJQuery", "ifTrue:", "=", "selectedItem", "class:", "selectedCssClass", "with:", "value:", "displayBlock"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selectedCssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "selected";
- }, function($ctx1) {$ctx1.fill(self,"selectedCssClass",{},smalltalk.MKListView)})},
- args: [],
- source: "selectedCssClass\x0a\x09^ 'selected'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "tag",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "ul";
- }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKListView)})},
- args: [],
- source: "tag\x0a\x09^ 'ul'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "update:",
- category: 'updating',
- fn: function (anAnnouncement){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1,$3;
- $2=_st(anAnnouncement)._aspect();
- $ctx1.sendIdx["aspect"]=1;
- $1=_st($2).__eq(self._selectionAspect());
- $ctx1.sendIdx["="]=1;
- if(smalltalk.assert($1)){
- self._updateSelectedItem();
- };
- $3=_st(_st(anAnnouncement)._aspect()).__eq(self._collectionAspect());
- if(smalltalk.assert($3)){
- self._update();
- };
- return self}, function($ctx1) {$ctx1.fill(self,"update:",{anAnnouncement:anAnnouncement},smalltalk.MKListView)})},
- args: ["anAnnouncement"],
- 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 ]",
- messageSends: ["ifTrue:", "=", "aspect", "selectionAspect", "updateSelectedItem", "collectionAspect", "update"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "updateSelectedItem",
- category: 'updating',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self._activateItem_(self._selectedItem());
- return self}, function($ctx1) {$ctx1.fill(self,"updateSelectedItem",{},smalltalk.MKListView)})},
- args: [],
- source: "updateSelectedItem\x0a\x09self activateItem: self selectedItem",
- messageSends: ["activateItem:", "selectedItem"],
- referencedClasses: []
- }),
- smalltalk.MKListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "model:collectionAspect:selectionAspect:",
- category: 'instance creation',
- fn: function (aModel,collectionSelector,selectionSelector){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=self._model_(aModel);
- _st($2)._collectionAspect_(collectionSelector);
- _st($2)._selectionAspect_(selectionSelector);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"model:collectionAspect:selectionAspect:",{aModel:aModel,collectionSelector:collectionSelector,selectionSelector:selectionSelector},smalltalk.MKListView.klass)})},
- args: ["aModel", "collectionSelector", "selectionSelector"],
- source: "model: aModel collectionAspect: collectionSelector selectionAspect: selectionSelector\x0a\x09^ (self model: aModel)\x0a\x09\x09collectionAspect: collectionSelector;\x0a\x09\x09selectionAspect: selectionSelector;\x0a\x09\x09yourself",
- messageSends: ["collectionAspect:", "model:", "selectionAspect:", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKListView.klass);
- smalltalk.addClass('MKDropdownListView', smalltalk.MKListView, [], 'Moka-Views');
- smalltalk.MKDropdownListView.comment="I am similar to a `MKListView`, but inside a `MKDropdownView`.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKDropdownListView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_dropdown_list");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKDropdownListView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_dropdown_list'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKDropdownListView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- function $MKDropdownListController(){return smalltalk.MKDropdownListController||(typeof MKDropdownListController=="undefined"?nil:MKDropdownListController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKDropdownListController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKDropdownListView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKDropdownListController",
- messageSends: [],
- referencedClasses: ["MKDropdownListController"]
- }),
- smalltalk.MKDropdownListView);
- smalltalk.addClass('MKSourceListView', smalltalk.MKListView, [], 'Moka-Views');
- smalltalk.MKSourceListView.comment="I am similar to a `MKListView`, but displayed slightly differently, in a similar way as in the left-side the of Finder in OSX.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKSourceListView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_sourcelist");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKSourceListView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_sourcelist'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKSourceListView);
- smalltalk.addClass('MKSplitView', smalltalk.MKLayoutView, ['firstView', 'secondView', 'splitter', 'thickness'], 'Moka-Views');
- smalltalk.MKSplitView.comment="I am the superclass of all split views. I arrange two child view with a splitter between them.\x0a\x0a## API\x0a\x0aCreate instances using the class-side method `firstView:secondView:`.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "children",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=[self._firstView(),self._secondView()];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"children",{},smalltalk.MKSplitView)})},
- args: [],
- source: "children\x0a\x09^ { self firstView. self secondView }",
- messageSends: ["firstView", "secondView"],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKSplitView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_split_view");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKSplitView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_split_view'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultThickness",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return (300);
- }, function($ctx1) {$ctx1.fill(self,"defaultThickness",{},smalltalk.MKSplitView)})},
- args: [],
- source: "defaultThickness\x0a\x09^ 300",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "firstView",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@firstView"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"firstView",{},smalltalk.MKSplitView)})},
- args: [],
- source: "firstView\x0a\x09^ firstView",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "firstView:",
- category: 'accessing',
- fn: function (aView){
- var self=this;
- function $MKDecorator(){return smalltalk.MKDecorator||(typeof MKDecorator=="undefined"?nil:MKDecorator)}
- return smalltalk.withContext(function($ctx1) {
- self["@firstView"]=_st($MKDecorator())._decorate_(aView);
- return self}, function($ctx1) {$ctx1.fill(self,"firstView:",{aView:aView},smalltalk.MKSplitView)})},
- args: ["aView"],
- source: "firstView: aView\x0a\x09firstView := MKDecorator decorate: aView",
- messageSends: ["decorate:"],
- referencedClasses: ["MKDecorator"]
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(html)._with_(self._firstView());
- $ctx1.sendIdx["with:"]=1;
- self["@splitter"]=_st(_st(html)._div())._class_(self._splitterCssClass());
- _st(html)._with_(self._secondView());
- _st(self._controller())._placeSplitter_(self._thickness());
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKSplitView)})},
- args: ["html"],
- 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",
- messageSends: ["with:", "firstView", "class:", "div", "splitterCssClass", "secondView", "placeSplitter:", "controller", "thickness"],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "secondView",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@secondView"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"secondView",{},smalltalk.MKSplitView)})},
- args: [],
- source: "secondView\x0a\x09^ secondView",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "secondView:",
- category: 'accessing',
- fn: function (aView){
- var self=this;
- function $MKDecorator(){return smalltalk.MKDecorator||(typeof MKDecorator=="undefined"?nil:MKDecorator)}
- return smalltalk.withContext(function($ctx1) {
- self["@secondView"]=_st($MKDecorator())._decorate_(aView);
- return self}, function($ctx1) {$ctx1.fill(self,"secondView:",{aView:aView},smalltalk.MKSplitView)})},
- args: ["aView"],
- source: "secondView: aView\x0a\x09secondView := MKDecorator decorate: aView",
- messageSends: ["decorate:"],
- referencedClasses: ["MKDecorator"]
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "splitter",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@splitter"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"splitter",{},smalltalk.MKSplitView)})},
- args: [],
- source: "splitter\x0a\x09\x22Answer the `splitter` TagBrush\x22\x0a\x09\x0a\x09^ splitter",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "splitterCssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "mk_splitter";
- }, function($ctx1) {$ctx1.fill(self,"splitterCssClass",{},smalltalk.MKSplitView)})},
- args: [],
- source: "splitterCssClass\x0a\x09^ 'mk_splitter'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "thickness",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@thickness"];
- if(($receiver = $2) == nil || $receiver == null){
- $1=self._defaultThickness();
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"thickness",{},smalltalk.MKSplitView)})},
- args: [],
- source: "thickness\x0a\x09^ thickness ifNil: [ self defaultThickness ]",
- messageSends: ["ifNil:", "defaultThickness"],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "thickness:",
- category: 'accessing',
- fn: function (aNumber){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@thickness"]=aNumber;
- return self}, function($ctx1) {$ctx1.fill(self,"thickness:",{aNumber:aNumber},smalltalk.MKSplitView)})},
- args: ["aNumber"],
- source: "thickness: aNumber\x0a\x09thickness := aNumber",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "firstView:secondView:",
- category: 'instance creation',
- fn: function (aView,anotherView){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=self._new();
- _st($2)._firstView_(aView);
- _st($2)._secondView_(anotherView);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"firstView:secondView:",{aView:aView,anotherView:anotherView},smalltalk.MKSplitView.klass)})},
- args: ["aView", "anotherView"],
- source: "firstView: aView secondView: anotherView\x0a\x09^ self new\x0a\x09\x09firstView: aView;\x0a\x09\x09secondView: anotherView;\x0a\x09\x09yourself",
- messageSends: ["firstView:", "new", "secondView:", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKSplitView.klass);
- smalltalk.addClass('MKHorizontalSplitView', smalltalk.MKSplitView, [], 'Moka-Views');
- smalltalk.MKHorizontalSplitView.comment="I split my child views vertically.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKHorizontalSplitView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" horizontal");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKHorizontalSplitView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' horizontal'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKHorizontalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKLeftFixedHorizontalSplitController(){return smalltalk.MKLeftFixedHorizontalSplitController||(typeof MKLeftFixedHorizontalSplitController=="undefined"?nil:MKLeftFixedHorizontalSplitController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKLeftFixedHorizontalSplitController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKHorizontalSplitView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKLeftFixedHorizontalSplitController",
- messageSends: [],
- referencedClasses: ["MKLeftFixedHorizontalSplitController"]
- }),
- smalltalk.MKHorizontalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "leftThickness:",
- category: 'accessing',
- fn: function (aNumber){
- var self=this;
- function $MKLeftFixedHorizontalSplitController(){return smalltalk.MKLeftFixedHorizontalSplitController||(typeof MKLeftFixedHorizontalSplitController=="undefined"?nil:MKLeftFixedHorizontalSplitController)}
- return smalltalk.withContext(function($ctx1) {
- self._thickness_(aNumber);
- self._controller_(_st($MKLeftFixedHorizontalSplitController())._new());
- return self}, function($ctx1) {$ctx1.fill(self,"leftThickness:",{aNumber:aNumber},smalltalk.MKHorizontalSplitView)})},
- args: ["aNumber"],
- source: "leftThickness: aNumber\x0a\x09self thickness: aNumber.\x0a\x09self controller: MKLeftFixedHorizontalSplitController new",
- messageSends: ["thickness:", "controller:", "new"],
- referencedClasses: ["MKLeftFixedHorizontalSplitController"]
- }),
- smalltalk.MKHorizontalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "rightThickness:",
- category: 'accessing',
- fn: function (aNumber){
- var self=this;
- function $MKRightFixedHorizontalSplitController(){return smalltalk.MKRightFixedHorizontalSplitController||(typeof MKRightFixedHorizontalSplitController=="undefined"?nil:MKRightFixedHorizontalSplitController)}
- return smalltalk.withContext(function($ctx1) {
- self._thickness_(aNumber);
- self._controller_(_st($MKRightFixedHorizontalSplitController())._new());
- return self}, function($ctx1) {$ctx1.fill(self,"rightThickness:",{aNumber:aNumber},smalltalk.MKHorizontalSplitView)})},
- args: ["aNumber"],
- source: "rightThickness: aNumber\x0a\x09self thickness: aNumber.\x0a\x09self controller: MKRightFixedHorizontalSplitController new",
- messageSends: ["thickness:", "controller:", "new"],
- referencedClasses: ["MKRightFixedHorizontalSplitController"]
- }),
- smalltalk.MKHorizontalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "secondView:",
- category: 'accessing',
- fn: function (aView){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- smalltalk.MKHorizontalSplitView.superclass.fn.prototype._secondView_.apply(_st(self), [aView]);
- $1=self._secondView();
- _st($1)._right_((0));
- $2=_st($1)._left_("auto");
- return self}, function($ctx1) {$ctx1.fill(self,"secondView:",{aView:aView},smalltalk.MKHorizontalSplitView)})},
- args: ["aView"],
- source: "secondView: aView\x0a\x09super secondView: aView.\x0a\x09self secondView \x0a\x09\x09right: 0;\x0a\x09\x09left: 'auto'",
- messageSends: ["secondView:", "right:", "secondView", "left:"],
- referencedClasses: []
- }),
- smalltalk.MKHorizontalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "setupEventHandlers",
- category: 'private',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$3,$4,$5,$6,$2;
- $1=_st(self["@splitter"])._asJQuery();
- $ctx1.sendIdx["asJQuery"]=1;
- $3="axis".__minus_gt("x");
- $ctx1.sendIdx["->"]=1;
- $4="containment".__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent());
- $ctx1.sendIdx["->"]=2;
- $5="cursor".__minus_gt("ew-resize");
- $ctx1.sendIdx["->"]=3;
- $6="stop".__minus_gt((function(){
- return smalltalk.withContext(function($ctx2) {
- return self._resized();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- $ctx1.sendIdx["->"]=4;
- $2=smalltalk.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(event){
- return smalltalk.withContext(function($ctx2) {
- return _st(self._controller())._onResize_(event);
- }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,2)})}))]);
- _st($1)._draggable_($2);
- return self}, function($ctx1) {$ctx1.fill(self,"setupEventHandlers",{},smalltalk.MKHorizontalSplitView)})},
- args: [],
- source: "setupEventHandlers\x0a\x09splitter asJQuery draggable: #{ \x0a \x09'axis' -> 'x'. \x0a 'containment' -> splitter asJQuery parent.\x0a\x09\x09'cursor' -> 'ew-resize'.\x0a\x09\x09'stop' -> [ self resized ].\x0a 'drag' -> [ :event | self controller onResize: event ] }",
- messageSends: ["draggable:", "asJQuery", "->", "parent", "resized", "onResize:", "controller"],
- referencedClasses: []
- }),
- smalltalk.MKHorizontalSplitView);
- smalltalk.addClass('MKVerticalSplitView', smalltalk.MKSplitView, [], 'Moka-Views');
- smalltalk.MKVerticalSplitView.comment="I split my child views horizontally.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "bottomThickness:",
- category: 'accessing',
- fn: function (aNumber){
- var self=this;
- function $MKBottomFixedVerticalSplitController(){return smalltalk.MKBottomFixedVerticalSplitController||(typeof MKBottomFixedVerticalSplitController=="undefined"?nil:MKBottomFixedVerticalSplitController)}
- return smalltalk.withContext(function($ctx1) {
- self._thickness_(aNumber);
- self._controller_(_st($MKBottomFixedVerticalSplitController())._new());
- return self}, function($ctx1) {$ctx1.fill(self,"bottomThickness:",{aNumber:aNumber},smalltalk.MKVerticalSplitView)})},
- args: ["aNumber"],
- source: "bottomThickness: aNumber\x0a\x09self thickness: aNumber.\x0a\x09self controller: MKBottomFixedVerticalSplitController new",
- messageSends: ["thickness:", "controller:", "new"],
- referencedClasses: ["MKBottomFixedVerticalSplitController"]
- }),
- smalltalk.MKVerticalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKVerticalSplitView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" vertical");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKVerticalSplitView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' vertical'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKVerticalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKTopFixedVerticalSplitController(){return smalltalk.MKTopFixedVerticalSplitController||(typeof MKTopFixedVerticalSplitController=="undefined"?nil:MKTopFixedVerticalSplitController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKTopFixedVerticalSplitController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKVerticalSplitView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKTopFixedVerticalSplitController",
- messageSends: [],
- referencedClasses: ["MKTopFixedVerticalSplitController"]
- }),
- smalltalk.MKVerticalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "resize:",
- category: 'actions',
- fn: function (aNumber){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3,$4;
- $1=_st(self._firstView())._asJQuery();
- $ctx1.sendIdx["asJQuery"]=1;
- $2=_st(aNumber)._asMokaCssString();
- $ctx1.sendIdx["asMokaCssString"]=1;
- _st($1)._css_put_("right",$2);
- $ctx1.sendIdx["css:put:"]=1;
- $3=_st(self["@splitter"])._asJQuery();
- $ctx1.sendIdx["asJQuery"]=2;
- $4=_st(aNumber)._asMokaCssString();
- $ctx1.sendIdx["asMokaCssString"]=2;
- _st($3)._css_put_("left",$4);
- $ctx1.sendIdx["css:put:"]=2;
- _st(_st(self._secondView())._asJQuery())._css_put_("left",_st(aNumber)._asMokaCssString());
- return self}, function($ctx1) {$ctx1.fill(self,"resize:",{aNumber:aNumber},smalltalk.MKVerticalSplitView)})},
- args: ["aNumber"],
- source: "resize: aNumber\x0a self firstView asJQuery css: 'right' put: aNumber asMokaCssString.\x0a\x09splitter asJQuery css: 'left' put: aNumber asMokaCssString.\x0a\x09self secondView asJQuery css: 'left' put: aNumber asMokaCssString",
- messageSends: ["css:put:", "asJQuery", "firstView", "asMokaCssString", "secondView"],
- referencedClasses: []
- }),
- smalltalk.MKVerticalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "secondView:",
- category: 'accessing',
- fn: function (aView){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- smalltalk.MKVerticalSplitView.superclass.fn.prototype._secondView_.apply(_st(self), [aView]);
- $1=self._secondView();
- _st($1)._bottom_((0));
- $2=_st($1)._top_("auto");
- return self}, function($ctx1) {$ctx1.fill(self,"secondView:",{aView:aView},smalltalk.MKVerticalSplitView)})},
- args: ["aView"],
- source: "secondView: aView\x0a\x09super secondView: aView.\x0a\x09self secondView \x0a\x09\x09bottom: 0;\x0a\x09\x09top: 'auto'",
- messageSends: ["secondView:", "bottom:", "secondView", "top:"],
- referencedClasses: []
- }),
- smalltalk.MKVerticalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "setupEventHandlers",
- category: 'private',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$3,$4,$5,$6,$2;
- $1=_st(self["@splitter"])._asJQuery();
- $ctx1.sendIdx["asJQuery"]=1;
- $3="axis".__minus_gt("y");
- $ctx1.sendIdx["->"]=1;
- $4="containment".__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent());
- $ctx1.sendIdx["->"]=2;
- $5="cursor".__minus_gt("ns-resize");
- $ctx1.sendIdx["->"]=3;
- $6="stop".__minus_gt((function(){
- return smalltalk.withContext(function($ctx2) {
- return self._resized();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
- $ctx1.sendIdx["->"]=4;
- $2=smalltalk.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(event){
- return smalltalk.withContext(function($ctx2) {
- return _st(self._controller())._onResize_(event);
- }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,2)})}))]);
- _st($1)._draggable_($2);
- return self}, function($ctx1) {$ctx1.fill(self,"setupEventHandlers",{},smalltalk.MKVerticalSplitView)})},
- args: [],
- source: "setupEventHandlers\x0a\x09splitter asJQuery draggable: #{ \x0a \x09'axis' -> 'y'. \x0a 'containment' -> splitter asJQuery parent.\x0a\x09\x09'cursor' -> 'ns-resize'.\x0a\x09\x09'stop' -> [ self resized ].\x0a 'drag' -> [ :event | self controller onResize: event ] }",
- messageSends: ["draggable:", "asJQuery", "->", "parent", "resized", "onResize:", "controller"],
- referencedClasses: []
- }),
- smalltalk.MKVerticalSplitView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "topThickness:",
- category: 'accessing',
- fn: function (aNumber){
- var self=this;
- function $MKTopFixedVerticalSplitController(){return smalltalk.MKTopFixedVerticalSplitController||(typeof MKTopFixedVerticalSplitController=="undefined"?nil:MKTopFixedVerticalSplitController)}
- return smalltalk.withContext(function($ctx1) {
- self._thickness_(aNumber);
- self._controller_(_st($MKTopFixedVerticalSplitController())._new());
- return self}, function($ctx1) {$ctx1.fill(self,"topThickness:",{aNumber:aNumber},smalltalk.MKVerticalSplitView)})},
- args: ["aNumber"],
- source: "topThickness: aNumber\x0a\x09self thickness: aNumber.\x0a\x09self controller: MKTopFixedVerticalSplitController new",
- messageSends: ["thickness:", "controller:", "new"],
- referencedClasses: ["MKTopFixedVerticalSplitController"]
- }),
- smalltalk.MKVerticalSplitView);
- smalltalk.addClass('MKTextAreaView', smalltalk.MKSingleAspectView, [], 'Moka-Views');
- smalltalk.MKTextAreaView.comment="I am an text area view. My default controller is `MKAnyKeyInputController`.\x0a\x0aMy controller must answer to `#onKeyPressed:`.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(smalltalk.MKTextAreaView.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" mk_textarea");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKTextAreaView)})},
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' mk_textarea'",
- messageSends: [",", "cssClass"],
- referencedClasses: []
- }),
- smalltalk.MKTextAreaView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKAnyKeyInputController(){return smalltalk.MKAnyKeyInputController||(typeof MKAnyKeyInputController=="undefined"?nil:MKAnyKeyInputController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKAnyKeyInputController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKTextAreaView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKAnyKeyInputController",
- messageSends: [],
- referencedClasses: ["MKAnyKeyInputController"]
- }),
- smalltalk.MKTextAreaView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultLayout",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=smalltalk.MKTextAreaView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
- _st($2)._width_((160));
- _st($2)._height_((80));
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKTextAreaView)})},
- args: [],
- source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 160;\x0a\x09\x09height: 80;\x0a\x09\x09yourself",
- messageSends: ["width:", "defaultLayout", "height:", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKTextAreaView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self["@root"])._with_(self._aspectValue());
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKTextAreaView)})},
- args: ["html"],
- source: "renderContentOn: html\x0a\x09root with: self aspectValue",
- messageSends: ["with:", "aspectValue"],
- referencedClasses: []
- }),
- smalltalk.MKTextAreaView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "tag",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "textarea";
- }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKTextAreaView)})},
- args: [],
- source: "tag\x0a\x09^ 'textarea'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKTextAreaView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "update",
- category: 'updating',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@root"];
- if(($receiver = $1) == nil || $receiver == null){
- $1;
- } else {
- _st(_st(self["@root"])._asJQuery())._val_(self._aspectValue());
- };
- return self}, function($ctx1) {$ctx1.fill(self,"update",{},smalltalk.MKTextAreaView)})},
- args: [],
- source: "update\x0a\x09root ifNotNil: [ root asJQuery val: self aspectValue ]",
- messageSends: ["ifNotNil:", "val:", "asJQuery", "aspectValue"],
- referencedClasses: []
- }),
- smalltalk.MKTextAreaView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "value",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self["@root"])._asJQuery())._val();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.MKTextAreaView)})},
- args: [],
- source: "value\x0a\x09^ root asJQuery val",
- messageSends: ["val", "asJQuery"],
- referencedClasses: []
- }),
- smalltalk.MKTextAreaView);
- smalltalk.addClass('MKInputView', smalltalk.MKTextAreaView, [], 'Moka-Views');
- smalltalk.MKInputView.comment="I am an input view. My default controller is `MKEnterInputController`.\x0a\x0aMy controller must answer to `#onKeyPressed:`.";
- smalltalk.addMethod(
- smalltalk.method({
- selector: "cssClass",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "moka_view mk_input";
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.MKInputView)})},
- args: [],
- source: "cssClass\x0a\x09^ 'moka_view mk_input'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKInputView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultControllerClass",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $MKEnterInputController(){return smalltalk.MKEnterInputController||(typeof MKEnterInputController=="undefined"?nil:MKEnterInputController)}
- return smalltalk.withContext(function($ctx1) {
- return $MKEnterInputController();
- }, function($ctx1) {$ctx1.fill(self,"defaultControllerClass",{},smalltalk.MKInputView)})},
- args: [],
- source: "defaultControllerClass\x0a\x09^ MKEnterInputController",
- messageSends: [],
- referencedClasses: ["MKEnterInputController"]
- }),
- smalltalk.MKInputView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultLayout",
- category: 'defaults',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=smalltalk.MKInputView.superclass.fn.prototype._defaultLayout.apply(_st(self), []);
- _st($2)._width_((160));
- _st($2)._height_((24));
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultLayout",{},smalltalk.MKInputView)})},
- args: [],
- source: "defaultLayout\x0a\x09^ super defaultLayout\x0a\x09\x09width: 160;\x0a\x09\x09height: 24;\x0a\x09\x09yourself",
- messageSends: ["width:", "defaultLayout", "height:", "yourself"],
- referencedClasses: []
- }),
- smalltalk.MKInputView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self["@root"])._value_(self._aspectValue());
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.MKInputView)})},
- args: ["html"],
- source: "renderContentOn: html\x0a\x09root value: self aspectValue",
- messageSends: ["value:", "aspectValue"],
- referencedClasses: []
- }),
- smalltalk.MKInputView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "tag",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "input";
- }, function($ctx1) {$ctx1.fill(self,"tag",{},smalltalk.MKInputView)})},
- args: [],
- source: "tag\x0a\x09^ 'input'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.MKInputView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "triggerChangeOnAnyKey",
- category: 'settings',
- fn: function (){
- var self=this;
- function $MKAnyKeyInputController(){return smalltalk.MKAnyKeyInputController||(typeof MKAnyKeyInputController=="undefined"?nil:MKAnyKeyInputController)}
- return smalltalk.withContext(function($ctx1) {
- self._controller_(_st($MKAnyKeyInputController())._new());
- return self}, function($ctx1) {$ctx1.fill(self,"triggerChangeOnAnyKey",{},smalltalk.MKInputView)})},
- args: [],
- source: "triggerChangeOnAnyKey\x0a\x09self controller: MKAnyKeyInputController new",
- messageSends: ["controller:", "new"],
- referencedClasses: ["MKAnyKeyInputController"]
- }),
- smalltalk.MKInputView);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "triggerChangeOnEnter",
- category: 'settings',
- fn: function (){
- var self=this;
- function $MKEnterInputController(){return smalltalk.MKEnterInputController||(typeof MKEnterInputController=="undefined"?nil:MKEnterInputController)}
- return smalltalk.withContext(function($ctx1) {
- self._controller_(_st($MKEnterInputController())._new());
- return self}, function($ctx1) {$ctx1.fill(self,"triggerChangeOnEnter",{},smalltalk.MKInputView)})},
- args: [],
- source: "triggerChangeOnEnter\x0a\x09self controller: MKEnterInputController new",
- messageSends: ["controller:", "new"],
- referencedClasses: ["MKEnterInputController"]
- }),
- smalltalk.MKInputView);
- });
|