1
0

Helios-KeyBindings.js 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499
  1. smalltalk.addPackage('Helios-KeyBindings');
  2. smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label', 'each'], 'Helios-KeyBindings');
  3. smalltalk.addMethod(
  4. "_applyOn_",
  5. smalltalk.method({
  6. selector: "applyOn:",
  7. category: 'actions',
  8. fn: function (aKeyBinder){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBinding)})},
  11. args: ["aKeyBinder"],
  12. source: "applyOn: aKeyBinder",
  13. messageSends: [],
  14. referencedClasses: []
  15. }),
  16. smalltalk.HLBinding);
  17. smalltalk.addMethod(
  18. "_applyOn_then_",
  19. smalltalk.method({
  20. selector: "applyOn:then:",
  21. category: 'actions',
  22. fn: function (aKeyBinder,aBlock){
  23. var self=this;
  24. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"applyOn:then:",{aKeyBinder:aKeyBinder,aBlock:aBlock},smalltalk.HLBinding)})},
  25. args: ["aKeyBinder", "aBlock"],
  26. source: "applyOn: aKeyBinder then: aBlock",
  27. messageSends: [],
  28. referencedClasses: []
  29. }),
  30. smalltalk.HLBinding);
  31. smalltalk.addMethod(
  32. "_atKey_",
  33. smalltalk.method({
  34. selector: "atKey:",
  35. category: 'accessing',
  36. fn: function (aKey){
  37. var self=this;
  38. return smalltalk.withContext(function($ctx1) { return nil;
  39. }, function($ctx1) {$ctx1.fill(self,"atKey:",{aKey:aKey},smalltalk.HLBinding)})},
  40. args: ["aKey"],
  41. source: "atKey: aKey\x0a\x09^ nil",
  42. messageSends: [],
  43. referencedClasses: []
  44. }),
  45. smalltalk.HLBinding);
  46. smalltalk.addMethod(
  47. "_displayLabel",
  48. smalltalk.method({
  49. selector: "displayLabel",
  50. category: 'accessing',
  51. fn: function (){
  52. var self=this;
  53. return smalltalk.withContext(function($ctx1) { var $1;
  54. $1=_st(self)._label();
  55. return $1;
  56. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{}, smalltalk.HLBinding)})},
  57. args: [],
  58. source: "displayLabel\x0a\x09^ self label",
  59. messageSends: ["label"],
  60. referencedClasses: []
  61. }),
  62. smalltalk.HLBinding);
  63. smalltalk.addMethod(
  64. "_isActive",
  65. smalltalk.method({
  66. selector: "isActive",
  67. category: 'testing',
  68. fn: function (){
  69. var self=this;
  70. return smalltalk.withContext(function($ctx1) { var $1;
  71. $1=_st(self)._subclassResponsibility();
  72. return $1;
  73. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBinding)})},
  74. args: [],
  75. source: "isActive\x0a\x09^ self subclassResponsibility",
  76. messageSends: ["subclassResponsibility"],
  77. referencedClasses: []
  78. }),
  79. smalltalk.HLBinding);
  80. smalltalk.addMethod(
  81. "_isFinal",
  82. smalltalk.method({
  83. selector: "isFinal",
  84. category: 'testing',
  85. fn: function (){
  86. var self=this;
  87. return smalltalk.withContext(function($ctx1) { return false;
  88. }, function($ctx1) {$ctx1.fill(self,"isFinal",{},smalltalk.HLBinding)})},
  89. args: [],
  90. source: "isFinal\x0a\x09\x22 Answer true if the receiver is the final binding of a sequence \x22\x0a\x09\x0a\x09^ false",
  91. messageSends: [],
  92. referencedClasses: []
  93. }),
  94. smalltalk.HLBinding);
  95. smalltalk.addMethod(
  96. "_key",
  97. smalltalk.method({
  98. selector: "key",
  99. category: 'accessing',
  100. fn: function (){
  101. var self=this;
  102. return smalltalk.withContext(function($ctx1) { var $1;
  103. $1=self["@key"];
  104. return $1;
  105. }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLBinding)})},
  106. args: [],
  107. source: "key\x0a\x09^ key",
  108. messageSends: [],
  109. referencedClasses: []
  110. }),
  111. smalltalk.HLBinding);
  112. smalltalk.addMethod(
  113. "_key_",
  114. smalltalk.method({
  115. selector: "key:",
  116. category: 'accessing',
  117. fn: function (anInteger){
  118. var self=this;
  119. return smalltalk.withContext(function($ctx1) { self["@key"]=anInteger;
  120. return self}, function($ctx1) {$ctx1.fill(self,"key:",{anInteger:anInteger}, smalltalk.HLBinding)})},
  121. args: ["anInteger"],
  122. source: "key: anInteger\x0a\x09key := anInteger",
  123. messageSends: [],
  124. referencedClasses: []
  125. }),
  126. smalltalk.HLBinding);
  127. smalltalk.addMethod(
  128. "_label",
  129. smalltalk.method({
  130. selector: "label",
  131. category: 'accessing',
  132. fn: function (){
  133. var self=this;
  134. return smalltalk.withContext(function($ctx1) { var $1;
  135. $1=self["@label"];
  136. return $1;
  137. }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLBinding)})},
  138. args: [],
  139. source: "label\x0a\x09^ label",
  140. messageSends: [],
  141. referencedClasses: []
  142. }),
  143. smalltalk.HLBinding);
  144. smalltalk.addMethod(
  145. "_label_",
  146. smalltalk.method({
  147. selector: "label:",
  148. category: 'accessing',
  149. fn: function (aString){
  150. var self=this;
  151. return smalltalk.withContext(function($ctx1) { self["@label"]=aString;
  152. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString}, smalltalk.HLBinding)})},
  153. args: ["aString"],
  154. source: "label: aString\x0a\x09label := aString",
  155. messageSends: [],
  156. referencedClasses: []
  157. }),
  158. smalltalk.HLBinding);
  159. smalltalk.addMethod(
  160. "_renderActionFor_html_",
  161. smalltalk.method({
  162. selector: "renderActionFor:html:",
  163. category: 'rendering',
  164. fn: function (aBinder,html){
  165. var self=this;
  166. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$6,$2;
  167. $1=_st(html)._span();
  168. _st($1)._class_("command");
  169. $2=_st($1)._with_((function(){
  170. return smalltalk.withContext(function($ctx2) { $3=_st(html)._span();
  171. _st($3)._class_("label");
  172. $4=_st($3)._with_(_st(_st(self)._shortcut())._asLowercase());
  173. $4;
  174. $5=_st(html)._a();
  175. _st($5)._class_("action");
  176. _st($5)._with_(_st(self)._displayLabel());
  177. $6=_st($5)._onClick_((function(){
  178. return smalltalk.withContext(function($ctx3) { return _st(aBinder)._applyBinding_(self);
  179. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  180. return $6;
  181. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  182. return self}, function($ctx1) {$ctx1.fill(self,"renderActionFor:html:",{aBinder:aBinder,html:html},smalltalk.HLBinding)})},
  183. args: ["aBinder", "html"],
  184. source: "renderActionFor: aBinder html: html\x0a\x09html span class: 'command'; with: [\x0a\x09\x09html span \x0a\x09\x09\x09class: 'label'; \x0a\x09\x09\x09with: self shortcut asLowercase.\x0a \x09\x09html a \x0a \x09class: 'action'; \x0a with: self displayLabel;\x0a \x09\x09\x09onClick: [ aBinder applyBinding: self ] ]",
  185. messageSends: ["class:", "span", "with:", "asLowercase", "shortcut", "a", "displayLabel", "onClick:", "applyBinding:"],
  186. referencedClasses: []
  187. }),
  188. smalltalk.HLBinding);
  189. smalltalk.addMethod(
  190. "_renderOn_html_",
  191. smalltalk.method({
  192. selector: "renderOn:html:",
  193. category: 'rendering',
  194. fn: function (aBindingHelper,html){
  195. var self=this;
  196. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html}, smalltalk.HLBinding)})},
  197. args: ["aBindingHelper", "html"],
  198. source: "renderOn: aBindingHelper html: html",
  199. messageSends: [],
  200. referencedClasses: []
  201. }),
  202. smalltalk.HLBinding);
  203. smalltalk.addMethod(
  204. "_shortcut",
  205. smalltalk.method({
  206. selector: "shortcut",
  207. category: 'accessing',
  208. fn: function (){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) { var $1;
  211. $1=_st((smalltalk.String || String))._fromCharCode_(_st(self)._key());
  212. return $1;
  213. }, function($ctx1) {$ctx1.fill(self,"shortcut",{}, smalltalk.HLBinding)})},
  214. args: [],
  215. source: "shortcut\x0a\x09^ String fromCharCode: self key",
  216. messageSends: ["fromCharCode:", "key"],
  217. referencedClasses: ["String"]
  218. }),
  219. smalltalk.HLBinding);
  220. smalltalk.addMethod(
  221. "_on_labelled_",
  222. smalltalk.method({
  223. selector: "on:labelled:",
  224. category: 'instance creation',
  225. fn: function (anInteger,aString){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  228. $2=_st(self)._new();
  229. _st($2)._key_(anInteger);
  230. _st($2)._label_(aString);
  231. $3=_st($2)._yourself();
  232. $1=$3;
  233. return $1;
  234. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{anInteger:anInteger,aString:aString}, smalltalk.HLBinding.klass)})},
  235. args: ["anInteger", "aString"],
  236. source: "on: anInteger labelled: aString\x0a\x09^ self new\x0a \x09key: anInteger;\x0a label: aString;\x0a yourself",
  237. messageSends: ["key:", "new", "label:", "yourself"],
  238. referencedClasses: []
  239. }),
  240. smalltalk.HLBinding.klass);
  241. smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['command'], 'Helios-KeyBindings');
  242. smalltalk.addMethod(
  243. "_applyOn_",
  244. smalltalk.method({
  245. selector: "applyOn:",
  246. category: 'actions',
  247. fn: function (aKeyBinder){
  248. var self=this;
  249. return smalltalk.withContext(function($ctx1) { var $1;
  250. $1=_st(_st(self)._command())._isInputRequired();
  251. if(smalltalk.assert($1)){
  252. _st(aKeyBinder)._selectBinding_(_st(self)._inputBinding());
  253. } else {
  254. _st(_st(self)._command())._execute();
  255. };
  256. return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingAction)})},
  257. args: ["aKeyBinder"],
  258. source: "applyOn: aKeyBinder\x0a\x09self command isInputRequired\x0a\x09\x09ifTrue: [ aKeyBinder selectBinding: self inputBinding ]\x0a\x09\x09ifFalse: [ self command execute ]",
  259. messageSends: ["ifTrue:ifFalse:", "selectBinding:", "inputBinding", "execute", "command", "isInputRequired"],
  260. referencedClasses: []
  261. }),
  262. smalltalk.HLBindingAction);
  263. smalltalk.addMethod(
  264. "_command",
  265. smalltalk.method({
  266. selector: "command",
  267. category: 'accessing',
  268. fn: function (){
  269. var self=this;
  270. return smalltalk.withContext(function($ctx1) { var $1;
  271. $1=self["@command"];
  272. return $1;
  273. }, function($ctx1) {$ctx1.fill(self,"command",{},smalltalk.HLBindingAction)})},
  274. args: [],
  275. source: "command\x0a\x09^ command",
  276. messageSends: [],
  277. referencedClasses: []
  278. }),
  279. smalltalk.HLBindingAction);
  280. smalltalk.addMethod(
  281. "_command_",
  282. smalltalk.method({
  283. selector: "command:",
  284. category: 'accessing',
  285. fn: function (aCommand){
  286. var self=this;
  287. return smalltalk.withContext(function($ctx1) { self["@command"]=aCommand;
  288. return self}, function($ctx1) {$ctx1.fill(self,"command:",{aCommand:aCommand},smalltalk.HLBindingAction)})},
  289. args: ["aCommand"],
  290. source: "command: aCommand\x0a\x09command := aCommand",
  291. messageSends: [],
  292. referencedClasses: []
  293. }),
  294. smalltalk.HLBindingAction);
  295. smalltalk.addMethod(
  296. "_inputBinding",
  297. smalltalk.method({
  298. selector: "inputBinding",
  299. category: 'accessing',
  300. fn: function (){
  301. var self=this;
  302. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$5,$1;
  303. $2=_st((smalltalk.HLBindingInput || HLBindingInput))._new();
  304. _st($2)._label_(_st(_st(self)._command())._inputLabel());
  305. _st($2)._callback_((function(val){
  306. return smalltalk.withContext(function($ctx2) { $3=_st(self)._command();
  307. _st($3)._input_(val);
  308. $4=_st($3)._execute();
  309. return $4;
  310. }, function($ctx2) {$ctx2.fillBlock({val:val},$ctx1)})}));
  311. $5=_st($2)._yourself();
  312. $1=$5;
  313. return $1;
  314. }, function($ctx1) {$ctx1.fill(self,"inputBinding",{},smalltalk.HLBindingAction)})},
  315. args: [],
  316. source: "inputBinding\x0a\x09^ HLBindingInput new\x0a\x09\x09label: self command inputLabel;\x0a\x09\x09callback: [ :val | \x0a\x09\x09\x09self command \x0a\x09\x09\x09\x09input: val;\x0a\x09\x09\x09\x09execute ];\x0a\x09\x09yourself",
  317. messageSends: ["label:", "inputLabel", "command", "new", "callback:", "input:", "execute", "yourself"],
  318. referencedClasses: ["HLBindingInput"]
  319. }),
  320. smalltalk.HLBindingAction);
  321. smalltalk.addMethod(
  322. "_isActive",
  323. smalltalk.method({
  324. selector: "isActive",
  325. category: 'testing',
  326. fn: function (){
  327. var self=this;
  328. return smalltalk.withContext(function($ctx1) { var $1;
  329. $1=_st(_st(self)._command())._isActive();
  330. return $1;
  331. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBindingAction)})},
  332. args: [],
  333. source: "isActive\x0a\x09^ self command isActive",
  334. messageSends: ["isActive", "command"],
  335. referencedClasses: []
  336. }),
  337. smalltalk.HLBindingAction);
  338. smalltalk.addMethod(
  339. "_isFinal",
  340. smalltalk.method({
  341. selector: "isFinal",
  342. category: 'testing',
  343. fn: function (){
  344. var self=this;
  345. return smalltalk.withContext(function($ctx1) { var $1;
  346. $1=_st(_st(_st(self)._command())._isInputRequired())._not();
  347. return $1;
  348. }, function($ctx1) {$ctx1.fill(self,"isFinal",{},smalltalk.HLBindingAction)})},
  349. args: [],
  350. source: "isFinal\x0a\x09^ self command isInputRequired not",
  351. messageSends: ["not", "isInputRequired", "command"],
  352. referencedClasses: []
  353. }),
  354. smalltalk.HLBindingAction);
  355. smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
  356. smalltalk.addMethod(
  357. "_activeBindings",
  358. smalltalk.method({
  359. selector: "activeBindings",
  360. category: 'accessing',
  361. fn: function (){
  362. var self=this;
  363. return smalltalk.withContext(function($ctx1) { var $1;
  364. $1=_st(_st(self)._bindings())._select_((function(each){
  365. return smalltalk.withContext(function($ctx2) { return _st(each)._isActive();
  366. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  367. return $1;
  368. }, function($ctx1) {$ctx1.fill(self,"activeBindings",{},smalltalk.HLBindingGroup)})},
  369. args: [],
  370. source: "activeBindings\x0a\x09^ self bindings select: [ :each | each isActive ]",
  371. messageSends: ["select:", "isActive", "bindings"],
  372. referencedClasses: []
  373. }),
  374. smalltalk.HLBindingGroup);
  375. smalltalk.addMethod(
  376. "_add_",
  377. smalltalk.method({
  378. selector: "add:",
  379. category: 'accessing',
  380. fn: function (aBinding){
  381. var self=this;
  382. return smalltalk.withContext(function($ctx1) { var $1;
  383. $1=_st(_st(self)._bindings())._add_(aBinding);
  384. return $1;
  385. }, function($ctx1) {$ctx1.fill(self,"add:",{aBinding:aBinding}, smalltalk.HLBindingGroup)})},
  386. args: ["aBinding"],
  387. source: "add: aBinding\x0a\x09^ self bindings add: aBinding",
  388. messageSends: ["add:", "bindings"],
  389. referencedClasses: []
  390. }),
  391. smalltalk.HLBindingGroup);
  392. smalltalk.addMethod(
  393. "_addActionKey_labelled_callback_",
  394. smalltalk.method({
  395. selector: "addActionKey:labelled:callback:",
  396. category: 'accessing',
  397. fn: function (anInteger,aString,aBlock){
  398. var self=this;
  399. return smalltalk.withContext(function($ctx1) { var $1,$2;
  400. $1=_st((smalltalk.HLBindingAction || HLBindingAction))._on_labelled_(anInteger,aString);
  401. _st($1)._callback_(aBlock);
  402. $2=_st($1)._yourself();
  403. _st(self)._add_($2);
  404. return self}, function($ctx1) {$ctx1.fill(self,"addActionKey:labelled:callback:",{anInteger:anInteger,aString:aString,aBlock:aBlock}, smalltalk.HLBindingGroup)})},
  405. args: ["anInteger", "aString", "aBlock"],
  406. source: "addActionKey: anInteger labelled: aString callback: aBlock\x0a\x09self add: ((HLBindingAction on: anInteger labelled: aString)\x0a \x09callback: aBlock;\x0a yourself)",
  407. messageSends: ["add:", "callback:", "on:labelled:", "yourself"],
  408. referencedClasses: ["HLBindingAction"]
  409. }),
  410. smalltalk.HLBindingGroup);
  411. smalltalk.addMethod(
  412. "_addGroupKey_labelled_",
  413. smalltalk.method({
  414. selector: "addGroupKey:labelled:",
  415. category: 'accessing',
  416. fn: function (anInteger,aString){
  417. var self=this;
  418. return smalltalk.withContext(function($ctx1) { _st(self)._add_(_st((smalltalk.HLBindingGroup || HLBindingGroup))._on_labelled_(anInteger,aString));
  419. return self}, function($ctx1) {$ctx1.fill(self,"addGroupKey:labelled:",{anInteger:anInteger,aString:aString}, smalltalk.HLBindingGroup)})},
  420. args: ["anInteger", "aString"],
  421. source: "addGroupKey: anInteger labelled: aString\x0a\x09self add: (HLBindingGroup on: anInteger labelled: aString)",
  422. messageSends: ["add:", "on:labelled:"],
  423. referencedClasses: ["HLBindingGroup"]
  424. }),
  425. smalltalk.HLBindingGroup);
  426. smalltalk.addMethod(
  427. "_at_",
  428. smalltalk.method({
  429. selector: "at:",
  430. category: 'accessing',
  431. fn: function (aString){
  432. var self=this;
  433. return smalltalk.withContext(function($ctx1) { var $1;
  434. $1=_st(_st(self)._bindings())._detect_ifNone_((function(each){
  435. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._label()).__eq(aString);
  436. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  437. return smalltalk.withContext(function($ctx2) { return nil;
  438. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  439. return $1;
  440. }, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString}, smalltalk.HLBindingGroup)})},
  441. args: ["aString"],
  442. source: "at: aString\x0a\x09^ self bindings \x0a \x09detect: [ :each | each label = aString ]\x0a \x09ifNone: [ nil ]",
  443. messageSends: ["detect:ifNone:", "=", "label", "bindings"],
  444. referencedClasses: []
  445. }),
  446. smalltalk.HLBindingGroup);
  447. smalltalk.addMethod(
  448. "_at_add_",
  449. smalltalk.method({
  450. selector: "at:add:",
  451. category: 'accessing',
  452. fn: function (aString,aBinding){
  453. var self=this;
  454. var binding;
  455. return smalltalk.withContext(function($ctx1) { var $1,$2;
  456. binding=_st(self)._at_(aString);
  457. $1=binding;
  458. if(($receiver = $1) == nil || $receiver == undefined){
  459. $2=self;
  460. return $2;
  461. } else {
  462. $1;
  463. };
  464. _st(binding)._add_(aBinding);
  465. return self}, function($ctx1) {$ctx1.fill(self,"at:add:",{aString:aString,aBinding:aBinding,binding:binding},smalltalk.HLBindingGroup)})},
  466. args: ["aString", "aBinding"],
  467. source: "at: aString add: aBinding\x0a\x09| binding |\x0a\x09\x0a\x09binding := self at: aString.\x0a\x09binding ifNil: [ ^ self ].\x0a\x09\x09\x0a\x09binding add: aBinding",
  468. messageSends: ["at:", "ifNil:", "add:"],
  469. referencedClasses: []
  470. }),
  471. smalltalk.HLBindingGroup);
  472. smalltalk.addMethod(
  473. "_atKey_",
  474. smalltalk.method({
  475. selector: "atKey:",
  476. category: 'accessing',
  477. fn: function (anInteger){
  478. var self=this;
  479. return smalltalk.withContext(function($ctx1) { var $1;
  480. $1=_st(_st(self)._bindings())._detect_ifNone_((function(each){
  481. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._key()).__eq(anInteger);
  482. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  483. return smalltalk.withContext(function($ctx2) { return nil;
  484. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  485. return $1;
  486. }, function($ctx1) {$ctx1.fill(self,"atKey:",{anInteger:anInteger}, smalltalk.HLBindingGroup)})},
  487. args: ["anInteger"],
  488. source: "atKey: anInteger\x0a\x09^ self bindings \x0a \x09detect: [ :each | each key = anInteger ]\x0a \x09ifNone: [ nil ]",
  489. messageSends: ["detect:ifNone:", "=", "key", "bindings"],
  490. referencedClasses: []
  491. }),
  492. smalltalk.HLBindingGroup);
  493. smalltalk.addMethod(
  494. "_bindings",
  495. smalltalk.method({
  496. selector: "bindings",
  497. category: 'accessing',
  498. fn: function (){
  499. var self=this;
  500. return smalltalk.withContext(function($ctx1) { var $2,$1;
  501. $2=self["@bindings"];
  502. if(($receiver = $2) == nil || $receiver == undefined){
  503. self["@bindings"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  504. $1=self["@bindings"];
  505. } else {
  506. $1=$2;
  507. };
  508. return $1;
  509. }, function($ctx1) {$ctx1.fill(self,"bindings",{}, smalltalk.HLBindingGroup)})},
  510. args: [],
  511. source: "bindings\x0a\x09^ bindings ifNil: [ bindings := OrderedCollection new ]",
  512. messageSends: ["ifNil:", "new"],
  513. referencedClasses: ["OrderedCollection"]
  514. }),
  515. smalltalk.HLBindingGroup);
  516. smalltalk.addMethod(
  517. "_displayLabel",
  518. smalltalk.method({
  519. selector: "displayLabel",
  520. category: 'accessing',
  521. fn: function (){
  522. var self=this;
  523. return smalltalk.withContext(function($ctx1) { var $1;
  524. $1=_st(smalltalk.HLBinding.fn.prototype._displayLabel.apply(_st(self), [])).__comma("...");
  525. return $1;
  526. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{}, smalltalk.HLBindingGroup)})},
  527. args: [],
  528. source: "displayLabel\x0a\x09^ super displayLabel, '...'",
  529. messageSends: [",", "displayLabel"],
  530. referencedClasses: []
  531. }),
  532. smalltalk.HLBindingGroup);
  533. smalltalk.addMethod(
  534. "_isActive",
  535. smalltalk.method({
  536. selector: "isActive",
  537. category: 'testing',
  538. fn: function (){
  539. var self=this;
  540. return smalltalk.withContext(function($ctx1) { var $1;
  541. $1=_st(_st(self)._activeBindings())._notEmpty();
  542. return $1;
  543. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBindingGroup)})},
  544. args: [],
  545. source: "isActive\x0a\x09^ self activeBindings notEmpty",
  546. messageSends: ["notEmpty", "activeBindings"],
  547. referencedClasses: []
  548. }),
  549. smalltalk.HLBindingGroup);
  550. smalltalk.addMethod(
  551. "_renderOn_html_",
  552. smalltalk.method({
  553. selector: "renderOn:html:",
  554. category: 'rendering',
  555. fn: function (aBindingHelper,html){
  556. var self=this;
  557. return smalltalk.withContext(function($ctx1) { var $1;
  558. $1=_st(self)._isActive();
  559. if(smalltalk.assert($1)){
  560. _st(aBindingHelper)._renderBindingGroup_on_(self,html);
  561. };
  562. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html},smalltalk.HLBindingGroup)})},
  563. args: ["aBindingHelper", "html"],
  564. source: "renderOn: aBindingHelper html: html\x0a\x09self isActive ifTrue: [\x0a\x09\x09aBindingHelper renderBindingGroup: self on: html ]",
  565. messageSends: ["ifTrue:", "renderBindingGroup:on:", "isActive"],
  566. referencedClasses: []
  567. }),
  568. smalltalk.HLBindingGroup);
  569. smalltalk.addClass('HLBindingInput', smalltalk.HLBinding, ['input', 'callback'], 'Helios-KeyBindings');
  570. smalltalk.addMethod(
  571. "_applyOn_",
  572. smalltalk.method({
  573. selector: "applyOn:",
  574. category: 'actions',
  575. fn: function (aKeyBinder){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) { _st(self)._evaluate_(_st(self)._input());
  578. return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder},smalltalk.HLBindingInput)})},
  579. args: ["aKeyBinder"],
  580. source: "applyOn: aKeyBinder\x0a\x09self evaluate: self input",
  581. messageSends: ["evaluate:", "input"],
  582. referencedClasses: []
  583. }),
  584. smalltalk.HLBindingInput);
  585. smalltalk.addMethod(
  586. "_callback",
  587. smalltalk.method({
  588. selector: "callback",
  589. category: 'accessing',
  590. fn: function (){
  591. var self=this;
  592. return smalltalk.withContext(function($ctx1) { var $2,$1;
  593. $2=self["@callback"];
  594. if(($receiver = $2) == nil || $receiver == undefined){
  595. self["@callback"]=(function(value){
  596. return smalltalk.withContext(function($ctx2) { }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1)})});
  597. $1=self["@callback"];
  598. } else {
  599. $1=$2;
  600. };
  601. return $1;
  602. }, function($ctx1) {$ctx1.fill(self,"callback",{},smalltalk.HLInputBinding)})},
  603. args: [],
  604. source: "callback\x0a\x09^ callback ifNil: [ callback := [ :value | ] ]",
  605. messageSends: ["ifNil:"],
  606. referencedClasses: []
  607. }),
  608. smalltalk.HLBindingInput);
  609. smalltalk.addMethod(
  610. "_callback_",
  611. smalltalk.method({
  612. selector: "callback:",
  613. category: 'accessing',
  614. fn: function (aBlock){
  615. var self=this;
  616. return smalltalk.withContext(function($ctx1) { self["@callback"]=aBlock;
  617. return self}, function($ctx1) {$ctx1.fill(self,"callback:",{aBlock:aBlock},smalltalk.HLInputBinding)})},
  618. args: ["aBlock"],
  619. source: "callback: aBlock\x0a\x09callback := aBlock",
  620. messageSends: [],
  621. referencedClasses: []
  622. }),
  623. smalltalk.HLBindingInput);
  624. smalltalk.addMethod(
  625. "_evaluate_",
  626. smalltalk.method({
  627. selector: "evaluate:",
  628. category: 'actions',
  629. fn: function (aString){
  630. var self=this;
  631. return smalltalk.withContext(function($ctx1) { _st(_st(self)._callback())._value_(aString);
  632. return self}, function($ctx1) {$ctx1.fill(self,"evaluate:",{aString:aString},smalltalk.HLBindingInput)})},
  633. args: ["aString"],
  634. source: "evaluate: aString\x0a\x09self callback value: aString",
  635. messageSends: ["value:", "callback"],
  636. referencedClasses: []
  637. }),
  638. smalltalk.HLBindingInput);
  639. smalltalk.addMethod(
  640. "_input",
  641. smalltalk.method({
  642. selector: "input",
  643. category: 'accessing',
  644. fn: function (){
  645. var self=this;
  646. return smalltalk.withContext(function($ctx1) { var $1;
  647. $1=_st(_st(self["@input"])._asJQuery())._val();
  648. return $1;
  649. }, function($ctx1) {$ctx1.fill(self,"input",{},smalltalk.HLBindingInput)})},
  650. args: [],
  651. source: "input\x0a\x09^ input asJQuery val",
  652. messageSends: ["val", "asJQuery"],
  653. referencedClasses: []
  654. }),
  655. smalltalk.HLBindingInput);
  656. smalltalk.addMethod(
  657. "_isActive",
  658. smalltalk.method({
  659. selector: "isActive",
  660. category: 'testing',
  661. fn: function (){
  662. var self=this;
  663. return smalltalk.withContext(function($ctx1) { return true;
  664. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBindingInput)})},
  665. args: [],
  666. source: "isActive\x0a\x09^ true",
  667. messageSends: [],
  668. referencedClasses: []
  669. }),
  670. smalltalk.HLBindingInput);
  671. smalltalk.addMethod(
  672. "_renderOn_html_",
  673. smalltalk.method({
  674. selector: "renderOn:html:",
  675. category: 'accessing',
  676. fn: function (aBinder,html){
  677. var self=this;
  678. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2,$5;
  679. $1=_st(html)._span();
  680. _st($1)._class_("command");
  681. $2=_st($1)._with_((function(){
  682. return smalltalk.withContext(function($ctx2) { $3=_st(html)._input();
  683. _st($3)._class_("search-query");
  684. $4=_st($3)._placeholder_(_st(self)._displayLabel());
  685. self["@input"]=$4;
  686. return self["@input"];
  687. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  688. _st(self["@input"])._onKeyPress_((function(event){
  689. return smalltalk.withContext(function($ctx2) { $5=_st(_st(event)._keyCode()).__eq((13));
  690. if(smalltalk.assert($5)){
  691. return _st(self)._applyOn_(aBinder);
  692. };
  693. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1)})}));
  694. _st(_st(self["@input"])._asJQuery())._focus();
  695. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBinder:aBinder,html:html},smalltalk.HLBindingInput)})},
  696. args: ["aBinder", "html"],
  697. source: "renderOn: aBinder html: html\x0a\x09html span \x0a\x09\x09class: 'command'; \x0a\x09\x09with: [\x0a\x09\x09\x09input := html input\x0a\x09\x09\x09\x09class: 'search-query';\x0a\x09\x09\x09\x09placeholder: self displayLabel ].\x0a\x09\x09\x09\x09\x0a\x09input onKeyPress: [:event |\x0a\x09\x09event keyCode = 13 ifTrue: [\x0a\x09\x09\x09self applyOn: aBinder ] ].\x0a\x09\x09\x09\x09\x0a\x09input asJQuery focus",
  698. messageSends: ["class:", "span", "with:", "input", "placeholder:", "displayLabel", "onKeyPress:", "ifTrue:", "applyOn:", "=", "keyCode", "focus", "asJQuery"],
  699. referencedClasses: []
  700. }),
  701. smalltalk.HLBindingInput);
  702. smalltalk.addClass('HLKeyBinder', smalltalk.Object, ['modifierKey', 'helper', 'bindings', 'selectedBinding'], 'Helios-KeyBindings');
  703. smalltalk.addMethod(
  704. "_activate",
  705. smalltalk.method({
  706. selector: "activate",
  707. category: 'actions',
  708. fn: function (){
  709. var self=this;
  710. return smalltalk.withContext(function($ctx1) { _st(_st(self)._helper())._show();
  711. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLKeyBinder)})},
  712. args: [],
  713. source: "activate\x0a\x09self helper show",
  714. messageSends: ["show", "helper"],
  715. referencedClasses: []
  716. }),
  717. smalltalk.HLKeyBinder);
  718. smalltalk.addMethod(
  719. "_activationKey",
  720. smalltalk.method({
  721. selector: "activationKey",
  722. category: 'accessing',
  723. fn: function (){
  724. var self=this;
  725. return smalltalk.withContext(function($ctx1) { return (32);
  726. }, function($ctx1) {$ctx1.fill(self,"activationKey",{}, smalltalk.HLKeyBinder)})},
  727. args: [],
  728. source: "activationKey\x0a\x09\x22SPACE\x22\x0a\x09^ 32",
  729. messageSends: [],
  730. referencedClasses: []
  731. }),
  732. smalltalk.HLKeyBinder);
  733. smalltalk.addMethod(
  734. "_activationKeyLabel",
  735. smalltalk.method({
  736. selector: "activationKeyLabel",
  737. category: 'accessing',
  738. fn: function (){
  739. var self=this;
  740. return smalltalk.withContext(function($ctx1) { return "ctrl + space";
  741. }, function($ctx1) {$ctx1.fill(self,"activationKeyLabel",{}, smalltalk.HLKeyBinder)})},
  742. args: [],
  743. source: "activationKeyLabel\x0a\x09^ 'ctrl + space'",
  744. messageSends: [],
  745. referencedClasses: []
  746. }),
  747. smalltalk.HLKeyBinder);
  748. smalltalk.addMethod(
  749. "_applyBinding_",
  750. smalltalk.method({
  751. selector: "applyBinding:",
  752. category: 'actions',
  753. fn: function (aBinding){
  754. var self=this;
  755. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  756. $1=_st(aBinding)._isActive();
  757. if(! smalltalk.assert($1)){
  758. $2=self;
  759. return $2;
  760. };
  761. _st(self)._selectBinding_(aBinding);
  762. _st(aBinding)._applyOn_(self);
  763. $3=_st(aBinding)._isFinal();
  764. if(smalltalk.assert($3)){
  765. _st(self)._deactivate();
  766. };
  767. return self}, function($ctx1) {$ctx1.fill(self,"applyBinding:",{aBinding:aBinding},smalltalk.HLKeyBinder)})},
  768. args: ["aBinding"],
  769. source: "applyBinding: aBinding\x0a\x09aBinding isActive ifFalse: [ ^ self ].\x0a\x09\x0a\x09self selectBinding: aBinding.\x0a aBinding applyOn: self.\x0a\x09\x0a\x09aBinding isFinal ifTrue: [ self deactivate ]",
  770. messageSends: ["ifFalse:", "isActive", "selectBinding:", "applyOn:", "ifTrue:", "deactivate", "isFinal"],
  771. referencedClasses: []
  772. }),
  773. smalltalk.HLKeyBinder);
  774. smalltalk.addMethod(
  775. "_bindings",
  776. smalltalk.method({
  777. selector: "bindings",
  778. category: 'accessing',
  779. fn: function (){
  780. var self=this;
  781. return smalltalk.withContext(function($ctx1) { var $2,$1;
  782. $2=self["@bindings"];
  783. if(($receiver = $2) == nil || $receiver == undefined){
  784. self["@bindings"]=_st(self)._defaultBindings();
  785. $1=self["@bindings"];
  786. } else {
  787. $1=$2;
  788. };
  789. return $1;
  790. }, function($ctx1) {$ctx1.fill(self,"bindings",{},smalltalk.HLKeyBinder)})},
  791. args: [],
  792. source: "bindings\x0a\x09^ bindings ifNil: [ bindings := self defaultBindings ]",
  793. messageSends: ["ifNil:", "defaultBindings"],
  794. referencedClasses: []
  795. }),
  796. smalltalk.HLKeyBinder);
  797. smalltalk.addMethod(
  798. "_deactivate",
  799. smalltalk.method({
  800. selector: "deactivate",
  801. category: 'actions',
  802. fn: function (){
  803. var self=this;
  804. return smalltalk.withContext(function($ctx1) { self["@selectedBinding"]=nil;
  805. _st(_st(self)._helper())._hide();
  806. return self}, function($ctx1) {$ctx1.fill(self,"deactivate",{},smalltalk.HLKeyBinder)})},
  807. args: [],
  808. source: "deactivate\x0a selectedBinding := nil.\x0a\x09self helper hide",
  809. messageSends: ["hide", "helper"],
  810. referencedClasses: []
  811. }),
  812. smalltalk.HLKeyBinder);
  813. smalltalk.addMethod(
  814. "_defaultBindings",
  815. smalltalk.method({
  816. selector: "defaultBindings",
  817. category: 'defaults',
  818. fn: function (){
  819. var self=this;
  820. var group;
  821. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  822. $1=_st((smalltalk.HLBindingGroup || HLBindingGroup))._new();
  823. _st($1)._addGroupKey_labelled_((86),"View");
  824. _st($1)._add_(_st(_st((smalltalk.HLCloseTabCommand || HLCloseTabCommand))._new())._asBinding());
  825. $2=_st($1)._yourself();
  826. group=$2;
  827. _st((smalltalk.HLOpenCommand || HLOpenCommand))._registerConcreteClassesOn_(group);
  828. $3=group;
  829. return $3;
  830. }, function($ctx1) {$ctx1.fill(self,"defaultBindings",{group:group},smalltalk.HLKeyBinder)})},
  831. args: [],
  832. source: "defaultBindings\x0a\x09| group |\x0a\x09\x0a\x09group := HLBindingGroup new\x0a\x09\x09addGroupKey: 86 labelled: 'View';\x0a\x09\x09add: HLCloseTabCommand new asBinding;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09HLOpenCommand registerConcreteClassesOn: group.\x0a\x09\x09\x09\x09\x0a\x09^ group",
  833. messageSends: ["addGroupKey:labelled:", "new", "add:", "asBinding", "yourself", "registerConcreteClassesOn:"],
  834. referencedClasses: ["HLBindingGroup", "HLCloseTabCommand", "HLOpenCommand"]
  835. }),
  836. smalltalk.HLKeyBinder);
  837. smalltalk.addMethod(
  838. "_escapeKey",
  839. smalltalk.method({
  840. selector: "escapeKey",
  841. category: 'accessing',
  842. fn: function (){
  843. var self=this;
  844. return smalltalk.withContext(function($ctx1) { return (27);
  845. }, function($ctx1) {$ctx1.fill(self,"escapeKey",{}, smalltalk.HLKeyBinder)})},
  846. args: [],
  847. source: "escapeKey\x0a\x09\x22ESC\x22\x0a\x09^ 27",
  848. messageSends: [],
  849. referencedClasses: []
  850. }),
  851. smalltalk.HLKeyBinder);
  852. smalltalk.addMethod(
  853. "_flushBindings",
  854. smalltalk.method({
  855. selector: "flushBindings",
  856. category: 'actions',
  857. fn: function (){
  858. var self=this;
  859. return smalltalk.withContext(function($ctx1) { self["@bindings"]=nil;
  860. return self}, function($ctx1) {$ctx1.fill(self,"flushBindings",{}, smalltalk.HLKeyBinder)})},
  861. args: [],
  862. source: "flushBindings\x0a\x09bindings := nil",
  863. messageSends: [],
  864. referencedClasses: []
  865. }),
  866. smalltalk.HLKeyBinder);
  867. smalltalk.addMethod(
  868. "_handleActiveKeyDown_",
  869. smalltalk.method({
  870. selector: "handleActiveKeyDown:",
  871. category: 'events',
  872. fn: function (event){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx1) { var $1,$2;
  875. $1=_st(_st(_st(event)._which()).__eq(_st(self)._escapeKey()))._or_((function(){
  876. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(event)._which()).__eq((71)))._and_((function(){
  877. return smalltalk.withContext(function($ctx3) { return _st(event)._ctrlKey();
  878. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  879. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  880. if(smalltalk.assert($1)){
  881. _st(self)._deactivate();
  882. _st(event)._preventDefault();
  883. return false;
  884. };
  885. $2=_st(self)._handleBindingFor_(event);
  886. return $2;
  887. }, function($ctx1) {$ctx1.fill(self,"handleActiveKeyDown:",{event:event}, smalltalk.HLKeyBinder)})},
  888. args: ["event"],
  889. source: "handleActiveKeyDown: event\x0a\x0a\x09\x22ESC or ctrl+g deactivate the keyBinder\x22\x0a\x09(event which = self escapeKey or: [\x0a\x09\x09event which = 71 and: [ event ctrlKey ] ])\x0a \x09ifTrue: [ \x0a \x09self deactivate.\x0a\x09\x09\x09\x09event preventDefault.\x0a\x09\x09\x09\x09^ false ].\x0a \x0a \x22Handle the keybinding\x22\x0a ^ self handleBindingFor: event",
  890. messageSends: ["ifTrue:", "deactivate", "preventDefault", "or:", "and:", "ctrlKey", "=", "which", "escapeKey", "handleBindingFor:"],
  891. referencedClasses: []
  892. }),
  893. smalltalk.HLKeyBinder);
  894. smalltalk.addMethod(
  895. "_handleBindingFor_",
  896. smalltalk.method({
  897. selector: "handleBindingFor:",
  898. category: 'events',
  899. fn: function (anEvent){
  900. var self=this;
  901. var binding;
  902. return smalltalk.withContext(function($ctx1) { var $1;
  903. binding=_st(_st(self)._selectedBinding())._atKey_(_st(anEvent)._which());
  904. $1=binding;
  905. if(($receiver = $1) == nil || $receiver == undefined){
  906. $1;
  907. } else {
  908. _st(self)._applyBinding_(binding);
  909. _st(anEvent)._preventDefault();
  910. return false;
  911. };
  912. return self}, function($ctx1) {$ctx1.fill(self,"handleBindingFor:",{anEvent:anEvent,binding:binding}, smalltalk.HLKeyBinder)})},
  913. args: ["anEvent"],
  914. source: "handleBindingFor: anEvent\x0a\x09| binding |\x0a binding := self selectedBinding atKey: anEvent which.\x0a \x0a binding ifNotNil: [ \x0a \x09self applyBinding: binding.\x0a\x09\x09anEvent preventDefault.\x0a\x09\x09^ false ]",
  915. messageSends: ["atKey:", "which", "selectedBinding", "ifNotNil:", "applyBinding:", "preventDefault"],
  916. referencedClasses: []
  917. }),
  918. smalltalk.HLKeyBinder);
  919. smalltalk.addMethod(
  920. "_handleInactiveKeyDown_",
  921. smalltalk.method({
  922. selector: "handleInactiveKeyDown:",
  923. category: 'events',
  924. fn: function (event){
  925. var self=this;
  926. return smalltalk.withContext(function($ctx1) { var $1,$2;
  927. $1=_st(_st(event)._which()).__eq(_st(self)._activationKey());
  928. if(smalltalk.assert($1)){
  929. $2=_st(event)._ctrlKey();
  930. if(smalltalk.assert($2)){
  931. _st(self)._activate();
  932. _st(event)._preventDefault();
  933. return false;
  934. };
  935. };
  936. return self}, function($ctx1) {$ctx1.fill(self,"handleInactiveKeyDown:",{event:event}, smalltalk.HLKeyBinder)})},
  937. args: ["event"],
  938. source: "handleInactiveKeyDown: event\x0a event which = self activationKey ifTrue: [\x0a \x09\x09event ctrlKey ifTrue: [\x0a\x09\x09\x09\x09\x09self activate. \x0a \x09\x09 event preventDefault. \x0a \x09^ false ] ]",
  939. messageSends: ["ifTrue:", "activate", "preventDefault", "ctrlKey", "=", "activationKey", "which"],
  940. referencedClasses: []
  941. }),
  942. smalltalk.HLKeyBinder);
  943. smalltalk.addMethod(
  944. "_handleKeyDown_",
  945. smalltalk.method({
  946. selector: "handleKeyDown:",
  947. category: 'events',
  948. fn: function (event){
  949. var self=this;
  950. return smalltalk.withContext(function($ctx1) { var $2,$1;
  951. $2=_st(self)._isActive();
  952. if(smalltalk.assert($2)){
  953. $1=_st(self)._handleActiveKeyDown_(event);
  954. } else {
  955. $1=_st(self)._handleInactiveKeyDown_(event);
  956. };
  957. return $1;
  958. }, function($ctx1) {$ctx1.fill(self,"handleKeyDown:",{event:event}, smalltalk.HLKeyBinder)})},
  959. args: ["event"],
  960. source: "handleKeyDown: event\x0a\x09^ self isActive\x0a \x09ifTrue: [ self handleActiveKeyDown: event ]\x0a \x09ifFalse: [ self handleInactiveKeyDown: event ]",
  961. messageSends: ["ifTrue:ifFalse:", "handleActiveKeyDown:", "handleInactiveKeyDown:", "isActive"],
  962. referencedClasses: []
  963. }),
  964. smalltalk.HLKeyBinder);
  965. smalltalk.addMethod(
  966. "_helper",
  967. smalltalk.method({
  968. selector: "helper",
  969. category: 'accessing',
  970. fn: function (){
  971. var self=this;
  972. return smalltalk.withContext(function($ctx1) { var $1;
  973. $1=self["@helper"];
  974. return $1;
  975. }, function($ctx1) {$ctx1.fill(self,"helper",{}, smalltalk.HLKeyBinder)})},
  976. args: [],
  977. source: "helper\x0a\x09^ helper",
  978. messageSends: [],
  979. referencedClasses: []
  980. }),
  981. smalltalk.HLKeyBinder);
  982. smalltalk.addMethod(
  983. "_initialize",
  984. smalltalk.method({
  985. selector: "initialize",
  986. category: 'initialization',
  987. fn: function (){
  988. var self=this;
  989. return smalltalk.withContext(function($ctx1) { var $1,$2;
  990. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  991. self["@helper"]=_st((smalltalk.HLKeyBinderHelper || HLKeyBinderHelper))._on_(self);
  992. $1=self["@helper"];
  993. _st($1)._renderStart();
  994. $2=_st($1)._renderCog();
  995. self["@active"]=false;
  996. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLKeyBinder)})},
  997. args: [],
  998. source: "initialize\x0a\x09super initialize.\x0a\x09helper := HLKeyBinderHelper on: self.\x0a\x09helper \x09\x0a\x09\x09renderStart;\x0a\x09\x09renderCog.\x0a active := false",
  999. messageSends: ["initialize", "on:", "renderStart", "renderCog"],
  1000. referencedClasses: ["HLKeyBinderHelper"]
  1001. }),
  1002. smalltalk.HLKeyBinder);
  1003. smalltalk.addMethod(
  1004. "_isActive",
  1005. smalltalk.method({
  1006. selector: "isActive",
  1007. category: 'testing',
  1008. fn: function (){
  1009. var self=this;
  1010. return smalltalk.withContext(function($ctx1) { var $1;
  1011. $1=_st(_st(_st(".").__comma(_st(_st(self)._helper())._cssClass()))._asJQuery())._is_(":visible");
  1012. return $1;
  1013. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLKeyBinder)})},
  1014. args: [],
  1015. source: "isActive\x0a\x09^ ('.', self helper cssClass) asJQuery is: ':visible'",
  1016. messageSends: ["is:", "asJQuery", ",", "cssClass", "helper"],
  1017. referencedClasses: []
  1018. }),
  1019. smalltalk.HLKeyBinder);
  1020. smalltalk.addMethod(
  1021. "_selectBinding_",
  1022. smalltalk.method({
  1023. selector: "selectBinding:",
  1024. category: 'actions',
  1025. fn: function (aBinding){
  1026. var self=this;
  1027. return smalltalk.withContext(function($ctx1) { self["@selectedBinding"]=aBinding;
  1028. _st(_st(self)._helper())._refresh();
  1029. return self}, function($ctx1) {$ctx1.fill(self,"selectBinding:",{aBinding:aBinding},smalltalk.HLKeyBinder)})},
  1030. args: ["aBinding"],
  1031. source: "selectBinding: aBinding\x09\x0a\x09selectedBinding := aBinding.\x0a\x09self helper refresh",
  1032. messageSends: ["refresh", "helper"],
  1033. referencedClasses: []
  1034. }),
  1035. smalltalk.HLKeyBinder);
  1036. smalltalk.addMethod(
  1037. "_selectedBinding",
  1038. smalltalk.method({
  1039. selector: "selectedBinding",
  1040. category: 'accessing',
  1041. fn: function (){
  1042. var self=this;
  1043. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1044. $2=self["@selectedBinding"];
  1045. if(($receiver = $2) == nil || $receiver == undefined){
  1046. $1=_st(self)._bindings();
  1047. } else {
  1048. $1=$2;
  1049. };
  1050. return $1;
  1051. }, function($ctx1) {$ctx1.fill(self,"selectedBinding",{}, smalltalk.HLKeyBinder)})},
  1052. args: [],
  1053. source: "selectedBinding\x0a\x09^ selectedBinding ifNil: [ self bindings ]",
  1054. messageSends: ["ifNil:", "bindings"],
  1055. referencedClasses: []
  1056. }),
  1057. smalltalk.HLKeyBinder);
  1058. smalltalk.addMethod(
  1059. "_setupEvents",
  1060. smalltalk.method({
  1061. selector: "setupEvents",
  1062. category: 'events',
  1063. fn: function (){
  1064. var self=this;
  1065. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_("body"))._keydown_((function(event){
  1066. return smalltalk.withContext(function($ctx2) { return _st(self)._handleKeyDown_(event);
  1067. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1)})}));
  1068. return self}, function($ctx1) {$ctx1.fill(self,"setupEvents",{}, smalltalk.HLKeyBinder)})},
  1069. args: [],
  1070. source: "setupEvents\x0a\x09(window jQuery: 'body') keydown: [ :event | self handleKeyDown: event ]",
  1071. messageSends: ["keydown:", "handleKeyDown:", "jQuery:"],
  1072. referencedClasses: []
  1073. }),
  1074. smalltalk.HLKeyBinder);
  1075. smalltalk.addMethod(
  1076. "_systemIsMac",
  1077. smalltalk.method({
  1078. selector: "systemIsMac",
  1079. category: 'testing',
  1080. fn: function (){
  1081. var self=this;
  1082. return smalltalk.withContext(function($ctx1) { var $1;
  1083. $1=_st(_st(navigator)._platform())._match_("Mac");
  1084. return $1;
  1085. }, function($ctx1) {$ctx1.fill(self,"systemIsMac",{}, smalltalk.HLKeyBinder)})},
  1086. args: [],
  1087. source: "systemIsMac\x0a\x09^ navigator platform match: 'Mac'",
  1088. messageSends: ["match:", "platform"],
  1089. referencedClasses: []
  1090. }),
  1091. smalltalk.HLKeyBinder);
  1092. smalltalk.addClass('HLKeyBinderHelper', smalltalk.HLWidget, ['keyBinder'], 'Helios-KeyBindings');
  1093. smalltalk.addMethod(
  1094. "_cssClass",
  1095. smalltalk.method({
  1096. selector: "cssClass",
  1097. category: 'accessing',
  1098. fn: function (){
  1099. var self=this;
  1100. return smalltalk.withContext(function($ctx1) { return "key_helper";
  1101. }, function($ctx1) {$ctx1.fill(self,"cssClass",{}, smalltalk.HLKeyBinderHelper)})},
  1102. args: [],
  1103. source: "cssClass\x0a\x09^ 'key_helper'",
  1104. messageSends: [],
  1105. referencedClasses: []
  1106. }),
  1107. smalltalk.HLKeyBinderHelper);
  1108. smalltalk.addMethod(
  1109. "_hide",
  1110. smalltalk.method({
  1111. selector: "hide",
  1112. category: 'actions',
  1113. fn: function (){
  1114. var self=this;
  1115. return smalltalk.withContext(function($ctx1) { _st(_st(_st(".").__comma(_st(self)._cssClass()))._asJQuery())._remove();
  1116. _st(self)._showCog();
  1117. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLKeyBinderHelper)})},
  1118. args: [],
  1119. source: "hide\x0a\x09('.', self cssClass) asJQuery remove.\x0a\x09self showCog",
  1120. messageSends: ["remove", "asJQuery", ",", "cssClass", "showCog"],
  1121. referencedClasses: []
  1122. }),
  1123. smalltalk.HLKeyBinderHelper);
  1124. smalltalk.addMethod(
  1125. "_hideCog",
  1126. smalltalk.method({
  1127. selector: "hideCog",
  1128. category: 'actions',
  1129. fn: function (){
  1130. var self=this;
  1131. return smalltalk.withContext(function($ctx1) { _st(_st("#cog-helper")._asJQuery())._hide();
  1132. return self}, function($ctx1) {$ctx1.fill(self,"hideCog",{},smalltalk.HLKeyBinderHelper)})},
  1133. args: [],
  1134. source: "hideCog\x0a\x09'#cog-helper' asJQuery hide",
  1135. messageSends: ["hide", "asJQuery"],
  1136. referencedClasses: []
  1137. }),
  1138. smalltalk.HLKeyBinderHelper);
  1139. smalltalk.addMethod(
  1140. "_keyBinder",
  1141. smalltalk.method({
  1142. selector: "keyBinder",
  1143. category: 'accessing',
  1144. fn: function (){
  1145. var self=this;
  1146. return smalltalk.withContext(function($ctx1) { var $1;
  1147. $1=self["@keyBinder"];
  1148. return $1;
  1149. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{}, smalltalk.HLKeyBinderHelper)})},
  1150. args: [],
  1151. source: "keyBinder\x0a\x09^ keyBinder",
  1152. messageSends: [],
  1153. referencedClasses: []
  1154. }),
  1155. smalltalk.HLKeyBinderHelper);
  1156. smalltalk.addMethod(
  1157. "_keyBinder_",
  1158. smalltalk.method({
  1159. selector: "keyBinder:",
  1160. category: 'accessing',
  1161. fn: function (aKeyBinder){
  1162. var self=this;
  1163. return smalltalk.withContext(function($ctx1) { self["@keyBinder"]=aKeyBinder;
  1164. return self}, function($ctx1) {$ctx1.fill(self,"keyBinder:",{aKeyBinder:aKeyBinder}, smalltalk.HLKeyBinderHelper)})},
  1165. args: ["aKeyBinder"],
  1166. source: "keyBinder: aKeyBinder\x0a\x09keyBinder := aKeyBinder",
  1167. messageSends: [],
  1168. referencedClasses: []
  1169. }),
  1170. smalltalk.HLKeyBinderHelper);
  1171. smalltalk.addMethod(
  1172. "_registerBindings",
  1173. smalltalk.method({
  1174. selector: "registerBindings",
  1175. category: 'keyBindings',
  1176. fn: function (){
  1177. var self=this;
  1178. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{}, smalltalk.HLKeyBinderHelper)})},
  1179. args: [],
  1180. source: "registerBindings\x0a\x09\x22Do nothing\x22",
  1181. messageSends: [],
  1182. referencedClasses: []
  1183. }),
  1184. smalltalk.HLKeyBinderHelper);
  1185. smalltalk.addMethod(
  1186. "_renderBindingGroup_on_",
  1187. smalltalk.method({
  1188. selector: "renderBindingGroup:on:",
  1189. category: 'rendering',
  1190. fn: function (aBindingGroup,html){
  1191. var self=this;
  1192. return smalltalk.withContext(function($ctx1) { _st(_st(_st(aBindingGroup)._activeBindings())._sorted_((function(a,b){
  1193. return smalltalk.withContext(function($ctx2) { return _st(_st(a)._key()).__lt(_st(b)._key());
  1194. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  1195. return smalltalk.withContext(function($ctx2) { return _st(each)._renderActionFor_html_(_st(self)._keyBinder(),html);
  1196. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1197. return self}, function($ctx1) {$ctx1.fill(self,"renderBindingGroup:on:",{aBindingGroup:aBindingGroup,html:html},smalltalk.HLKeyBinderHelper)})},
  1198. args: ["aBindingGroup", "html"],
  1199. source: "renderBindingGroup: aBindingGroup on: html\x0a\x09(aBindingGroup activeBindings \x0a \x09sorted: [ :a :b | a key < b key ])\x0a do: [ :each | each renderActionFor: self keyBinder html: html ]",
  1200. messageSends: ["do:", "renderActionFor:html:", "keyBinder", "sorted:", "<", "key", "activeBindings"],
  1201. referencedClasses: []
  1202. }),
  1203. smalltalk.HLKeyBinderHelper);
  1204. smalltalk.addMethod(
  1205. "_renderBindingOn_",
  1206. smalltalk.method({
  1207. selector: "renderBindingOn:",
  1208. category: 'rendering',
  1209. fn: function (html){
  1210. var self=this;
  1211. return smalltalk.withContext(function($ctx1) { _st(_st(self)._selectedBinding())._renderOn_html_(self,html);
  1212. return self}, function($ctx1) {$ctx1.fill(self,"renderBindingOn:",{html:html}, smalltalk.HLKeyBinderHelper)})},
  1213. args: ["html"],
  1214. source: "renderBindingOn: html\x0a\x09self selectedBinding renderOn: self html: html",
  1215. messageSends: ["renderOn:html:", "selectedBinding"],
  1216. referencedClasses: []
  1217. }),
  1218. smalltalk.HLKeyBinderHelper);
  1219. smalltalk.addMethod(
  1220. "_renderCloseOn_",
  1221. smalltalk.method({
  1222. selector: "renderCloseOn:",
  1223. category: 'rendering',
  1224. fn: function (html){
  1225. var self=this;
  1226. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1227. $1=_st(html)._a();
  1228. _st($1)._class_("close");
  1229. _st($1)._with_((function(){
  1230. return smalltalk.withContext(function($ctx2) { return _st(_st(html)._tag_("i"))._class_("icon-remove");
  1231. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1232. $2=_st($1)._onClick_((function(){
  1233. return smalltalk.withContext(function($ctx2) { return _st(_st(self)._keyBinder())._deactivate();
  1234. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1235. return self}, function($ctx1) {$ctx1.fill(self,"renderCloseOn:",{html:html},smalltalk.HLKeyBinderHelper)})},
  1236. args: ["html"],
  1237. source: "renderCloseOn: html\x0a\x09html a\x0a\x09\x09class: 'close';\x0a\x09\x09with: [ (html tag: 'i') class: 'icon-remove' ];\x0a\x09\x09onClick: [ self keyBinder deactivate ]",
  1238. messageSends: ["class:", "a", "with:", "tag:", "onClick:", "deactivate", "keyBinder"],
  1239. referencedClasses: []
  1240. }),
  1241. smalltalk.HLKeyBinderHelper);
  1242. smalltalk.addMethod(
  1243. "_renderCog",
  1244. smalltalk.method({
  1245. selector: "renderCog",
  1246. category: 'rendering',
  1247. fn: function (){
  1248. var self=this;
  1249. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  1250. _st((function(html){
  1251. return smalltalk.withContext(function($ctx2) { $1=_st(html)._div();
  1252. _st($1)._id_("cog-helper");
  1253. $2=_st($1)._with_((function(){
  1254. return smalltalk.withContext(function($ctx3) { $3=_st(html)._a();
  1255. _st($3)._with_((function(){
  1256. return smalltalk.withContext(function($ctx4) { return _st(_st(html)._tag_("i"))._class_("icon-cog");
  1257. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1258. $4=_st($3)._onClick_((function(){
  1259. return smalltalk.withContext(function($ctx4) { return _st(_st(self)._keyBinder())._activate();
  1260. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1261. return $4;
  1262. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1263. return $2;
  1264. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st("body")._asJQuery());
  1265. return self}, function($ctx1) {$ctx1.fill(self,"renderCog",{},smalltalk.HLKeyBinderHelper)})},
  1266. args: [],
  1267. source: "renderCog\x0a\x09[ :html |\x0a\x09\x09html \x0a\x09\x09\x09div id: 'cog-helper'; \x0a\x09\x09\x09with: [\x0a\x09\x09\x09\x09html a \x0a\x09\x09\x09\x09\x09with: [ (html tag: 'i') class: 'icon-cog' ];\x0a\x09\x09\x09\x09\x09onClick: [ self keyBinder activate ] ] ]\x0a\x09\x09appendToJQuery: 'body' asJQuery",
  1268. messageSends: ["appendToJQuery:", "asJQuery", "id:", "div", "with:", "class:", "tag:", "a", "onClick:", "activate", "keyBinder"],
  1269. referencedClasses: []
  1270. }),
  1271. smalltalk.HLKeyBinderHelper);
  1272. smalltalk.addMethod(
  1273. "_renderContentOn_",
  1274. smalltalk.method({
  1275. selector: "renderContentOn:",
  1276. category: 'rendering',
  1277. fn: function (html){
  1278. var self=this;
  1279. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  1280. $1=_st(html)._div();
  1281. _st($1)._class_(_st(self)._cssClass());
  1282. $2=_st($1)._with_((function(){
  1283. return smalltalk.withContext(function($ctx2) { $3=self;
  1284. _st($3)._renderSelectionOn_(html);
  1285. _st($3)._renderBindingOn_(html);
  1286. $4=_st($3)._renderCloseOn_(html);
  1287. return $4;
  1288. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1289. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLKeyBinderHelper)})},
  1290. args: ["html"],
  1291. source: "renderContentOn: html\x0a\x09html div class: self cssClass; with: [\x0a \x09self \x0a \x09renderSelectionOn:html;\x0a \x09renderBindingOn: html;\x0a\x09\x09\x09renderCloseOn: html ]",
  1292. messageSends: ["class:", "cssClass", "div", "with:", "renderSelectionOn:", "renderBindingOn:", "renderCloseOn:"],
  1293. referencedClasses: []
  1294. }),
  1295. smalltalk.HLKeyBinderHelper);
  1296. smalltalk.addMethod(
  1297. "_renderSelectionOn_",
  1298. smalltalk.method({
  1299. selector: "renderSelectionOn:",
  1300. category: 'rendering',
  1301. fn: function (html){
  1302. var self=this;
  1303. return smalltalk.withContext(function($ctx1) { var $1,$3,$5,$4,$2;
  1304. $1=_st(html)._span();
  1305. _st($1)._class_("selected");
  1306. $3=$1;
  1307. $5=_st(_st(self)._selectedBinding())._label();
  1308. if(($receiver = $5) == nil || $receiver == undefined){
  1309. $4="Action";
  1310. } else {
  1311. $4=$5;
  1312. };
  1313. $2=_st($3)._with_($4);
  1314. return self}, function($ctx1) {$ctx1.fill(self,"renderSelectionOn:",{html:html}, smalltalk.HLKeyBinderHelper)})},
  1315. args: ["html"],
  1316. source: "renderSelectionOn: html\x0a\x09\x09html span \x0a \x09class: 'selected'; \x0a with: (self selectedBinding label ifNil: [ 'Action' ])",
  1317. messageSends: ["class:", "span", "with:", "ifNil:", "label", "selectedBinding"],
  1318. referencedClasses: []
  1319. }),
  1320. smalltalk.HLKeyBinderHelper);
  1321. smalltalk.addMethod(
  1322. "_renderStart",
  1323. smalltalk.method({
  1324. selector: "renderStart",
  1325. category: 'rendering',
  1326. fn: function (){
  1327. var self=this;
  1328. return smalltalk.withContext(function($ctx1) { var $1,$2;
  1329. _st((function(html){
  1330. return smalltalk.withContext(function($ctx2) { $1=_st(html)._div();
  1331. _st($1)._id_("keybinding-start-helper");
  1332. $2=_st($1)._with_(_st(_st("Press ").__comma(_st(_st(self)._keyBinder())._activationKeyLabel())).__comma(" to start"));
  1333. return $2;
  1334. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st("body")._asJQuery());
  1335. _st((function(){
  1336. return smalltalk.withContext(function($ctx2) { return _st(_st(window)._jQuery_("#keybinding-start-helper"))._fadeOut_((1000));
  1337. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((2000));
  1338. return self}, function($ctx1) {$ctx1.fill(self,"renderStart",{}, smalltalk.HLKeyBinderHelper)})},
  1339. args: [],
  1340. source: "renderStart\x0a\x09[ :html |\x0a\x09\x09html div \x0a\x09\x09\x09id: 'keybinding-start-helper';\x0a\x09\x09\x09with: 'Press ', self keyBinder activationKeyLabel, ' to start' ] appendToJQuery: 'body' asJQuery.\x0a\x09\x0a\x09[ (window jQuery: '#keybinding-start-helper') fadeOut: 1000 ] \x0a\x09\x09valueWithTimeout: 2000",
  1341. messageSends: ["appendToJQuery:", "asJQuery", "id:", "div", "with:", ",", "activationKeyLabel", "keyBinder", "valueWithTimeout:", "fadeOut:", "jQuery:"],
  1342. referencedClasses: []
  1343. }),
  1344. smalltalk.HLKeyBinderHelper);
  1345. smalltalk.addMethod(
  1346. "_selectedBinding",
  1347. smalltalk.method({
  1348. selector: "selectedBinding",
  1349. category: 'accessing',
  1350. fn: function (){
  1351. var self=this;
  1352. return smalltalk.withContext(function($ctx1) { var $1;
  1353. $1=_st(_st(self)._keyBinder())._selectedBinding();
  1354. return $1;
  1355. }, function($ctx1) {$ctx1.fill(self,"selectedBinding",{}, smalltalk.HLKeyBinderHelper)})},
  1356. args: [],
  1357. source: "selectedBinding\x0a\x09^ self keyBinder selectedBinding",
  1358. messageSends: ["selectedBinding", "keyBinder"],
  1359. referencedClasses: []
  1360. }),
  1361. smalltalk.HLKeyBinderHelper);
  1362. smalltalk.addMethod(
  1363. "_show",
  1364. smalltalk.method({
  1365. selector: "show",
  1366. category: 'actions',
  1367. fn: function (){
  1368. var self=this;
  1369. return smalltalk.withContext(function($ctx1) { _st(self)._hideCog();
  1370. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  1371. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLKeyBinderHelper)})},
  1372. args: [],
  1373. source: "show\x0a\x09self hideCog.\x0a\x09self appendToJQuery: 'body' asJQuery",
  1374. messageSends: ["hideCog", "appendToJQuery:", "asJQuery"],
  1375. referencedClasses: []
  1376. }),
  1377. smalltalk.HLKeyBinderHelper);
  1378. smalltalk.addMethod(
  1379. "_showCog",
  1380. smalltalk.method({
  1381. selector: "showCog",
  1382. category: 'actions',
  1383. fn: function (){
  1384. var self=this;
  1385. return smalltalk.withContext(function($ctx1) { _st(_st("#cog-helper")._asJQuery())._show();
  1386. return self}, function($ctx1) {$ctx1.fill(self,"showCog",{},smalltalk.HLKeyBinderHelper)})},
  1387. args: [],
  1388. source: "showCog\x0a\x09'#cog-helper' asJQuery show",
  1389. messageSends: ["show", "asJQuery"],
  1390. referencedClasses: []
  1391. }),
  1392. smalltalk.HLKeyBinderHelper);
  1393. smalltalk.addMethod(
  1394. "_on_",
  1395. smalltalk.method({
  1396. selector: "on:",
  1397. category: 'instance creation',
  1398. fn: function (aKeyBinder){
  1399. var self=this;
  1400. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  1401. $2=_st(self)._new();
  1402. _st($2)._keyBinder_(aKeyBinder);
  1403. $3=_st($2)._yourself();
  1404. $1=$3;
  1405. return $1;
  1406. }, function($ctx1) {$ctx1.fill(self,"on:",{aKeyBinder:aKeyBinder}, smalltalk.HLKeyBinderHelper.klass)})},
  1407. args: ["aKeyBinder"],
  1408. source: "on: aKeyBinder\x0a\x09^ self new\x0a \x09keyBinder: aKeyBinder;\x0a yourself",
  1409. messageSends: ["keyBinder:", "new", "yourself"],
  1410. referencedClasses: []
  1411. }),
  1412. smalltalk.HLKeyBinderHelper.klass);