Helios-KeyBindings.js 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  1. smalltalk.addPackage('Helios-KeyBindings');
  2. smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], '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) { _st(self)._subclassResponsibility();
  11. return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder}, smalltalk.HLBinding)})},
  12. args: ["aKeyBinder"],
  13. source: "applyOn: aKeyBinder\x0a\x09self subclassResponsibility",
  14. messageSends: ["subclassResponsibility"],
  15. referencedClasses: []
  16. }),
  17. smalltalk.HLBinding);
  18. smalltalk.addMethod(
  19. "_isBindingAction",
  20. smalltalk.method({
  21. selector: "isBindingAction",
  22. category: 'testing',
  23. fn: function (){
  24. var self=this;
  25. return smalltalk.withContext(function($ctx1) { return false;
  26. }, function($ctx1) {$ctx1.fill(self,"isBindingAction",{}, smalltalk.HLBinding)})},
  27. args: [],
  28. source: "isBindingAction\x0a\x09^ false",
  29. messageSends: [],
  30. referencedClasses: []
  31. }),
  32. smalltalk.HLBinding);
  33. smalltalk.addMethod(
  34. "_isBindingGroup",
  35. smalltalk.method({
  36. selector: "isBindingGroup",
  37. category: 'testing',
  38. fn: function (){
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) { return false;
  41. }, function($ctx1) {$ctx1.fill(self,"isBindingGroup",{}, smalltalk.HLBinding)})},
  42. args: [],
  43. source: "isBindingGroup\x0a\x09^ false",
  44. messageSends: [],
  45. referencedClasses: []
  46. }),
  47. smalltalk.HLBinding);
  48. smalltalk.addMethod(
  49. "_key",
  50. smalltalk.method({
  51. selector: "key",
  52. category: 'accessing',
  53. fn: function (){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) { var $1;
  56. $1=self["@key"];
  57. return $1;
  58. }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLBinding)})},
  59. args: [],
  60. source: "key\x0a\x09^ key",
  61. messageSends: [],
  62. referencedClasses: []
  63. }),
  64. smalltalk.HLBinding);
  65. smalltalk.addMethod(
  66. "_key_",
  67. smalltalk.method({
  68. selector: "key:",
  69. category: 'accessing',
  70. fn: function (anInteger){
  71. var self=this;
  72. return smalltalk.withContext(function($ctx1) { self["@key"]=anInteger;
  73. return self}, function($ctx1) {$ctx1.fill(self,"key:",{anInteger:anInteger}, smalltalk.HLBinding)})},
  74. args: ["anInteger"],
  75. source: "key: anInteger\x0a\x09key := anInteger",
  76. messageSends: [],
  77. referencedClasses: []
  78. }),
  79. smalltalk.HLBinding);
  80. smalltalk.addMethod(
  81. "_label",
  82. smalltalk.method({
  83. selector: "label",
  84. category: 'accessing',
  85. fn: function (){
  86. var self=this;
  87. return smalltalk.withContext(function($ctx1) { var $1;
  88. $1=self["@label"];
  89. return $1;
  90. }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLBinding)})},
  91. args: [],
  92. source: "label\x0a\x09^ label",
  93. messageSends: [],
  94. referencedClasses: []
  95. }),
  96. smalltalk.HLBinding);
  97. smalltalk.addMethod(
  98. "_label_",
  99. smalltalk.method({
  100. selector: "label:",
  101. category: 'accessing',
  102. fn: function (aString){
  103. var self=this;
  104. return smalltalk.withContext(function($ctx1) { self["@label"]=aString;
  105. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString}, smalltalk.HLBinding)})},
  106. args: ["aString"],
  107. source: "label: aString\x0a\x09label := aString",
  108. messageSends: [],
  109. referencedClasses: []
  110. }),
  111. smalltalk.HLBinding);
  112. smalltalk.addMethod(
  113. "_renderOn_html_",
  114. smalltalk.method({
  115. selector: "renderOn:html:",
  116. category: 'rendering',
  117. fn: function (aBindingHelper,html){
  118. var self=this;
  119. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html}, smalltalk.HLBinding)})},
  120. args: ["aBindingHelper", "html"],
  121. source: "renderOn: aBindingHelper html: html",
  122. messageSends: [],
  123. referencedClasses: []
  124. }),
  125. smalltalk.HLBinding);
  126. smalltalk.addMethod(
  127. "_shortcut",
  128. smalltalk.method({
  129. selector: "shortcut",
  130. category: 'accessing',
  131. fn: function (){
  132. var self=this;
  133. return smalltalk.withContext(function($ctx1) { var $1;
  134. $1=_st((smalltalk.String || String))._fromCharCode_(_st(self)._key());
  135. return $1;
  136. }, function($ctx1) {$ctx1.fill(self,"shortcut",{}, smalltalk.HLBinding)})},
  137. args: [],
  138. source: "shortcut\x0a\x09^ String fromCharCode: self key",
  139. messageSends: ["fromCharCode:", "key"],
  140. referencedClasses: ["String"]
  141. }),
  142. smalltalk.HLBinding);
  143. smalltalk.addMethod(
  144. "_on_labelled_",
  145. smalltalk.method({
  146. selector: "on:labelled:",
  147. category: 'instance creation',
  148. fn: function (anInteger,aString){
  149. var self=this;
  150. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  151. $2=_st(self)._new();
  152. _st($2)._key_(anInteger);
  153. _st($2)._label_(aString);
  154. $3=_st($2)._yourself();
  155. $1=$3;
  156. return $1;
  157. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{anInteger:anInteger,aString:aString}, smalltalk.HLBinding.klass)})},
  158. args: ["anInteger", "aString"],
  159. source: "on: anInteger labelled: aString\x0a\x09^ self new\x0a \x09key: anInteger;\x0a label: aString;\x0a yourself",
  160. messageSends: ["key:", "new", "label:", "yourself"],
  161. referencedClasses: []
  162. }),
  163. smalltalk.HLBinding.klass);
  164. smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['callback'], 'Helios-KeyBindings');
  165. smalltalk.addMethod(
  166. "_applyOn_",
  167. smalltalk.method({
  168. selector: "applyOn:",
  169. category: 'actions',
  170. fn: function (aKeyBinder){
  171. var self=this;
  172. return smalltalk.withContext(function($ctx1) { _st(aKeyBinder)._applyBindingAction_(self);
  173. return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder}, smalltalk.HLBindingAction)})},
  174. args: ["aKeyBinder"],
  175. source: "applyOn: aKeyBinder\x0a\x09aKeyBinder applyBindingAction: self",
  176. messageSends: ["applyBindingAction:"],
  177. referencedClasses: []
  178. }),
  179. smalltalk.HLBindingAction);
  180. smalltalk.addMethod(
  181. "_callback",
  182. smalltalk.method({
  183. selector: "callback",
  184. category: 'accessing',
  185. fn: function (){
  186. var self=this;
  187. return smalltalk.withContext(function($ctx1) { var $1;
  188. $1=self["@callback"];
  189. return $1;
  190. }, function($ctx1) {$ctx1.fill(self,"callback",{}, smalltalk.HLBindingAction)})},
  191. args: [],
  192. source: "callback\x0a\x09^ callback",
  193. messageSends: [],
  194. referencedClasses: []
  195. }),
  196. smalltalk.HLBindingAction);
  197. smalltalk.addMethod(
  198. "_callback_",
  199. smalltalk.method({
  200. selector: "callback:",
  201. category: 'accessing',
  202. fn: function (aBlock){
  203. var self=this;
  204. return smalltalk.withContext(function($ctx1) { self["@callback"]=aBlock;
  205. return self}, function($ctx1) {$ctx1.fill(self,"callback:",{aBlock:aBlock}, smalltalk.HLBindingAction)})},
  206. args: ["aBlock"],
  207. source: "callback: aBlock\x0a\x09callback := aBlock",
  208. messageSends: [],
  209. referencedClasses: []
  210. }),
  211. smalltalk.HLBindingAction);
  212. smalltalk.addMethod(
  213. "_isBindingAction",
  214. smalltalk.method({
  215. selector: "isBindingAction",
  216. category: 'testing',
  217. fn: function (){
  218. var self=this;
  219. return smalltalk.withContext(function($ctx1) { return true;
  220. }, function($ctx1) {$ctx1.fill(self,"isBindingAction",{}, smalltalk.HLBindingAction)})},
  221. args: [],
  222. source: "isBindingAction\x0a\x09^ true",
  223. messageSends: [],
  224. referencedClasses: []
  225. }),
  226. smalltalk.HLBindingAction);
  227. smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
  228. smalltalk.addMethod(
  229. "_add_",
  230. smalltalk.method({
  231. selector: "add:",
  232. category: 'accessing',
  233. fn: function (aBinding){
  234. var self=this;
  235. return smalltalk.withContext(function($ctx1) { var $1;
  236. $1=_st(_st(self)._bindings())._add_(aBinding);
  237. return $1;
  238. }, function($ctx1) {$ctx1.fill(self,"add:",{aBinding:aBinding}, smalltalk.HLBindingGroup)})},
  239. args: ["aBinding"],
  240. source: "add: aBinding\x0a\x09^ self bindings add: aBinding",
  241. messageSends: ["add:", "bindings"],
  242. referencedClasses: []
  243. }),
  244. smalltalk.HLBindingGroup);
  245. smalltalk.addMethod(
  246. "_addActionKey_labelled_callback_",
  247. smalltalk.method({
  248. selector: "addActionKey:labelled:callback:",
  249. category: 'accessing',
  250. fn: function (anInteger,aString,aBlock){
  251. var self=this;
  252. return smalltalk.withContext(function($ctx1) { var $1,$2;
  253. $1=_st((smalltalk.HLBindingAction || HLBindingAction))._on_labelled_(anInteger,aString);
  254. _st($1)._callback_(aBlock);
  255. $2=_st($1)._yourself();
  256. _st(self)._add_($2);
  257. return self}, function($ctx1) {$ctx1.fill(self,"addActionKey:labelled:callback:",{anInteger:anInteger,aString:aString,aBlock:aBlock}, smalltalk.HLBindingGroup)})},
  258. args: ["anInteger", "aString", "aBlock"],
  259. source: "addActionKey: anInteger labelled: aString callback: aBlock\x0a\x09self add: ((HLBindingAction on: anInteger labelled: aString)\x0a \x09callback: aBlock;\x0a yourself)",
  260. messageSends: ["add:", "callback:", "on:labelled:", "yourself"],
  261. referencedClasses: ["HLBindingAction"]
  262. }),
  263. smalltalk.HLBindingGroup);
  264. smalltalk.addMethod(
  265. "_addActionKey_labelled_command_",
  266. smalltalk.method({
  267. selector: "addActionKey:labelled:command:",
  268. category: 'accessing',
  269. fn: function (anInteger,aString,aCommand){
  270. var self=this;
  271. return smalltalk.withContext(function($ctx1) { var $1,$2;
  272. $1=_st((smalltalk.HLBindingAction || HLBindingAction))._on_labelled_(anInteger,aString);
  273. _st($1)._command_(aCommand);
  274. $2=_st($1)._yourself();
  275. _st(self)._add_($2);
  276. return self}, function($ctx1) {$ctx1.fill(self,"addActionKey:labelled:command:",{anInteger:anInteger,aString:aString,aCommand:aCommand}, smalltalk.HLBindingGroup)})},
  277. args: ["anInteger", "aString", "aCommand"],
  278. source: "addActionKey: anInteger labelled: aString command: aCommand\x0a\x09self add: ((HLBindingAction on: anInteger labelled: aString)\x0a \x09command: aCommand;\x0a yourself)",
  279. messageSends: ["add:", "command:", "on:labelled:", "yourself"],
  280. referencedClasses: ["HLBindingAction"]
  281. }),
  282. smalltalk.HLBindingGroup);
  283. smalltalk.addMethod(
  284. "_addGroupKey_labelled_",
  285. smalltalk.method({
  286. selector: "addGroupKey:labelled:",
  287. category: 'accessing',
  288. fn: function (anInteger,aString){
  289. var self=this;
  290. return smalltalk.withContext(function($ctx1) { _st(self)._add_(_st((smalltalk.HLBindingGroup || HLBindingGroup))._on_labelled_(anInteger,aString));
  291. return self}, function($ctx1) {$ctx1.fill(self,"addGroupKey:labelled:",{anInteger:anInteger,aString:aString}, smalltalk.HLBindingGroup)})},
  292. args: ["anInteger", "aString"],
  293. source: "addGroupKey: anInteger labelled: aString\x0a\x09self add: (HLBindingGroup on: anInteger labelled: aString)",
  294. messageSends: ["add:", "on:labelled:"],
  295. referencedClasses: ["HLBindingGroup"]
  296. }),
  297. smalltalk.HLBindingGroup);
  298. smalltalk.addMethod(
  299. "_applyOn_",
  300. smalltalk.method({
  301. selector: "applyOn:",
  302. category: 'actions',
  303. fn: function (aKeyBinder){
  304. var self=this;
  305. return smalltalk.withContext(function($ctx1) { _st(aKeyBinder)._applyBindingGroup_(self);
  306. return self}, function($ctx1) {$ctx1.fill(self,"applyOn:",{aKeyBinder:aKeyBinder}, smalltalk.HLBindingGroup)})},
  307. args: ["aKeyBinder"],
  308. source: "applyOn: aKeyBinder\x0a\x09aKeyBinder applyBindingGroup: self",
  309. messageSends: ["applyBindingGroup:"],
  310. referencedClasses: []
  311. }),
  312. smalltalk.HLBindingGroup);
  313. smalltalk.addMethod(
  314. "_at_",
  315. smalltalk.method({
  316. selector: "at:",
  317. category: 'accessing',
  318. fn: function (aString){
  319. var self=this;
  320. return smalltalk.withContext(function($ctx1) { var $1;
  321. $1=_st(_st(self)._bindings())._detect_ifNone_((function(each){
  322. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._label()).__eq(aString);
  323. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  324. return smalltalk.withContext(function($ctx2) { return nil;
  325. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  326. return $1;
  327. }, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString}, smalltalk.HLBindingGroup)})},
  328. args: ["aString"],
  329. source: "at: aString\x0a\x09^ self bindings \x0a \x09detect: [ :each | each label = aString ]\x0a \x09ifNone: [ nil ]",
  330. messageSends: ["detect:ifNone:", "=", "label", "bindings"],
  331. referencedClasses: []
  332. }),
  333. smalltalk.HLBindingGroup);
  334. smalltalk.addMethod(
  335. "_atKey_",
  336. smalltalk.method({
  337. selector: "atKey:",
  338. category: 'accessing',
  339. fn: function (anInteger){
  340. var self=this;
  341. return smalltalk.withContext(function($ctx1) { var $1;
  342. $1=_st(_st(self)._bindings())._detect_ifNone_((function(each){
  343. return smalltalk.withContext(function($ctx2) { return _st(_st(each)._key()).__eq(anInteger);
  344. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
  345. return smalltalk.withContext(function($ctx2) { return nil;
  346. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  347. return $1;
  348. }, function($ctx1) {$ctx1.fill(self,"atKey:",{anInteger:anInteger}, smalltalk.HLBindingGroup)})},
  349. args: ["anInteger"],
  350. source: "atKey: anInteger\x0a\x09^ self bindings \x0a \x09detect: [ :each | each key = anInteger ]\x0a \x09ifNone: [ nil ]",
  351. messageSends: ["detect:ifNone:", "=", "key", "bindings"],
  352. referencedClasses: []
  353. }),
  354. smalltalk.HLBindingGroup);
  355. smalltalk.addMethod(
  356. "_bindings",
  357. smalltalk.method({
  358. selector: "bindings",
  359. category: 'accessing',
  360. fn: function (){
  361. var self=this;
  362. return smalltalk.withContext(function($ctx1) { var $2,$1;
  363. $2=self["@bindings"];
  364. if(($receiver = $2) == nil || $receiver == undefined){
  365. self["@bindings"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  366. $1=self["@bindings"];
  367. } else {
  368. $1=$2;
  369. };
  370. return $1;
  371. }, function($ctx1) {$ctx1.fill(self,"bindings",{}, smalltalk.HLBindingGroup)})},
  372. args: [],
  373. source: "bindings\x0a\x09^ bindings ifNil: [ bindings := OrderedCollection new ]",
  374. messageSends: ["ifNil:", "new"],
  375. referencedClasses: ["OrderedCollection"]
  376. }),
  377. smalltalk.HLBindingGroup);
  378. smalltalk.addMethod(
  379. "_isBindingGroup",
  380. smalltalk.method({
  381. selector: "isBindingGroup",
  382. category: 'testing',
  383. fn: function (){
  384. var self=this;
  385. return smalltalk.withContext(function($ctx1) { return true;
  386. }, function($ctx1) {$ctx1.fill(self,"isBindingGroup",{}, smalltalk.HLBindingGroup)})},
  387. args: [],
  388. source: "isBindingGroup\x0a\x09^ true",
  389. messageSends: [],
  390. referencedClasses: []
  391. }),
  392. smalltalk.HLBindingGroup);
  393. smalltalk.addMethod(
  394. "_renderOn_html_",
  395. smalltalk.method({
  396. selector: "renderOn:html:",
  397. category: 'rendering',
  398. fn: function (aBindingHelper,html){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx1) { _st(aBindingHelper)._renderBindingGroup_on_(self,html);
  401. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html}, smalltalk.HLBindingGroup)})},
  402. args: ["aBindingHelper", "html"],
  403. source: "renderOn: aBindingHelper html: html\x0a\x09aBindingHelper renderBindingGroup: self on: html",
  404. messageSends: ["renderBindingGroup:on:"],
  405. referencedClasses: []
  406. }),
  407. smalltalk.HLBindingGroup);
  408. smalltalk.addClass('HLKeyBinder', smalltalk.Object, ['modifierKey', 'active', 'helper', 'bindings', 'selectedBinding'], 'Helios-KeyBindings');
  409. smalltalk.addMethod(
  410. "_activate",
  411. smalltalk.method({
  412. selector: "activate",
  413. category: 'actions',
  414. fn: function (){
  415. var self=this;
  416. return smalltalk.withContext(function($ctx1) { self["@active"]=true;
  417. _st(_st(self)._helper())._show();
  418. return self}, function($ctx1) {$ctx1.fill(self,"activate",{}, smalltalk.HLKeyBinder)})},
  419. args: [],
  420. source: "activate\x0a\x09active := true.\x0a\x09self helper show",
  421. messageSends: ["show", "helper"],
  422. referencedClasses: []
  423. }),
  424. smalltalk.HLKeyBinder);
  425. smalltalk.addMethod(
  426. "_activationKey",
  427. smalltalk.method({
  428. selector: "activationKey",
  429. category: 'accessing',
  430. fn: function (){
  431. var self=this;
  432. return smalltalk.withContext(function($ctx1) { return (32);
  433. }, function($ctx1) {$ctx1.fill(self,"activationKey",{}, smalltalk.HLKeyBinder)})},
  434. args: [],
  435. source: "activationKey\x0a\x09\x22SPACE\x22\x0a\x09^ 32",
  436. messageSends: [],
  437. referencedClasses: []
  438. }),
  439. smalltalk.HLKeyBinder);
  440. smalltalk.addMethod(
  441. "_applyBinding_",
  442. smalltalk.method({
  443. selector: "applyBinding:",
  444. category: 'actions',
  445. fn: function (aBinding){
  446. var self=this;
  447. return smalltalk.withContext(function($ctx1) { _st(aBinding)._applyOn_(self);
  448. return self}, function($ctx1) {$ctx1.fill(self,"applyBinding:",{aBinding:aBinding}, smalltalk.HLKeyBinder)})},
  449. args: ["aBinding"],
  450. source: "applyBinding: aBinding\x0a aBinding applyOn: self",
  451. messageSends: ["applyOn:"],
  452. referencedClasses: []
  453. }),
  454. smalltalk.HLKeyBinder);
  455. smalltalk.addMethod(
  456. "_applyBindingAction_",
  457. smalltalk.method({
  458. selector: "applyBindingAction:",
  459. category: 'actions',
  460. fn: function (aBinding){
  461. var self=this;
  462. return smalltalk.withContext(function($ctx1) { _st(_st(aBinding)._callback())._value();
  463. _st(self)._deactivate();
  464. return self}, function($ctx1) {$ctx1.fill(self,"applyBindingAction:",{aBinding:aBinding}, smalltalk.HLKeyBinder)})},
  465. args: ["aBinding"],
  466. source: "applyBindingAction: aBinding\x0a aBinding callback value.\x0a\x09self deactivate",
  467. messageSends: ["value", "callback", "deactivate"],
  468. referencedClasses: []
  469. }),
  470. smalltalk.HLKeyBinder);
  471. smalltalk.addMethod(
  472. "_applyBindingGroup_",
  473. smalltalk.method({
  474. selector: "applyBindingGroup:",
  475. category: 'actions',
  476. fn: function (aBinding){
  477. var self=this;
  478. return smalltalk.withContext(function($ctx1) { self["@selectedBinding"]=aBinding;
  479. _st(_st(self)._helper())._refresh();
  480. return self}, function($ctx1) {$ctx1.fill(self,"applyBindingGroup:",{aBinding:aBinding}, smalltalk.HLKeyBinder)})},
  481. args: ["aBinding"],
  482. source: "applyBindingGroup: aBinding\x0a selectedBinding := aBinding.\x0a self helper refresh",
  483. messageSends: ["refresh", "helper"],
  484. referencedClasses: []
  485. }),
  486. smalltalk.HLKeyBinder);
  487. smalltalk.addMethod(
  488. "_bindings",
  489. smalltalk.method({
  490. selector: "bindings",
  491. category: 'accessing',
  492. fn: function (){
  493. var self=this;
  494. return smalltalk.withContext(function($ctx1) { var $2,$1;
  495. $2=self["@bindings"];
  496. if(($receiver = $2) == nil || $receiver == undefined){
  497. self["@bindings"]=_st((smalltalk.HLBindingGroup || HLBindingGroup))._new();
  498. $1=self["@bindings"];
  499. } else {
  500. $1=$2;
  501. };
  502. return $1;
  503. }, function($ctx1) {$ctx1.fill(self,"bindings",{}, smalltalk.HLKeyBinder)})},
  504. args: [],
  505. source: "bindings\x0a\x09^ bindings ifNil: [ bindings := HLBindingGroup new ]",
  506. messageSends: ["ifNil:", "new"],
  507. referencedClasses: ["HLBindingGroup"]
  508. }),
  509. smalltalk.HLKeyBinder);
  510. smalltalk.addMethod(
  511. "_deactivate",
  512. smalltalk.method({
  513. selector: "deactivate",
  514. category: 'actions',
  515. fn: function (){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx1) { self["@active"]=false;
  518. self["@selectedBinding"]=nil;
  519. _st(_st(self)._helper())._hide();
  520. return self}, function($ctx1) {$ctx1.fill(self,"deactivate",{}, smalltalk.HLKeyBinder)})},
  521. args: [],
  522. source: "deactivate\x0a\x09active := false.\x0a selectedBinding := nil.\x0a\x09self helper hide",
  523. messageSends: ["hide", "helper"],
  524. referencedClasses: []
  525. }),
  526. smalltalk.HLKeyBinder);
  527. smalltalk.addMethod(
  528. "_escapeKey",
  529. smalltalk.method({
  530. selector: "escapeKey",
  531. category: 'accessing',
  532. fn: function (){
  533. var self=this;
  534. return smalltalk.withContext(function($ctx1) { return (27);
  535. }, function($ctx1) {$ctx1.fill(self,"escapeKey",{}, smalltalk.HLKeyBinder)})},
  536. args: [],
  537. source: "escapeKey\x0a\x09\x22ESC\x22\x0a\x09^ 27",
  538. messageSends: [],
  539. referencedClasses: []
  540. }),
  541. smalltalk.HLKeyBinder);
  542. smalltalk.addMethod(
  543. "_flushBindings",
  544. smalltalk.method({
  545. selector: "flushBindings",
  546. category: 'actions',
  547. fn: function (){
  548. var self=this;
  549. return smalltalk.withContext(function($ctx1) { self["@bindings"]=nil;
  550. self["@helper"]=nil;
  551. return self}, function($ctx1) {$ctx1.fill(self,"flushBindings",{}, smalltalk.HLKeyBinder)})},
  552. args: [],
  553. source: "flushBindings\x0a\x09bindings := nil.\x0a helper := nil",
  554. messageSends: [],
  555. referencedClasses: []
  556. }),
  557. smalltalk.HLKeyBinder);
  558. smalltalk.addMethod(
  559. "_handleActiveKeyDown_",
  560. smalltalk.method({
  561. selector: "handleActiveKeyDown:",
  562. category: 'events',
  563. fn: function (event){
  564. var self=this;
  565. return smalltalk.withContext(function($ctx1) { var $1,$2;
  566. $1=_st(_st(_st(event)._which()).__eq(_st(self)._escapeKey()))._or_((function(){
  567. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(event)._which()).__eq((71)))._and_((function(){
  568. return smalltalk.withContext(function($ctx3) { return _st(event)._ctrlKey();
  569. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  570. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  571. if(smalltalk.assert($1)){
  572. _st(self)._deactivate();
  573. _st(event)._preventDefault();
  574. return false;
  575. };
  576. $2=_st(self)._handleBindingFor_(event);
  577. return $2;
  578. }, function($ctx1) {$ctx1.fill(self,"handleActiveKeyDown:",{event:event}, smalltalk.HLKeyBinder)})},
  579. args: ["event"],
  580. 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",
  581. messageSends: ["ifTrue:", "deactivate", "preventDefault", "or:", "and:", "ctrlKey", "=", "which", "escapeKey", "handleBindingFor:"],
  582. referencedClasses: []
  583. }),
  584. smalltalk.HLKeyBinder);
  585. smalltalk.addMethod(
  586. "_handleBindingFor_",
  587. smalltalk.method({
  588. selector: "handleBindingFor:",
  589. category: 'events',
  590. fn: function (anEvent){
  591. var self=this;
  592. var binding;
  593. return smalltalk.withContext(function($ctx1) { var $1;
  594. binding=_st(_st(self)._selectedBinding())._atKey_(_st(anEvent)._which());
  595. $1=binding;
  596. if(($receiver = $1) == nil || $receiver == undefined){
  597. $1;
  598. } else {
  599. _st(self)._applyBinding_(binding);
  600. _st(anEvent)._preventDefault();
  601. return false;
  602. };
  603. return self}, function($ctx1) {$ctx1.fill(self,"handleBindingFor:",{anEvent:anEvent,binding:binding}, smalltalk.HLKeyBinder)})},
  604. args: ["anEvent"],
  605. 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 ]",
  606. messageSends: ["atKey:", "which", "selectedBinding", "ifNotNil:", "applyBinding:", "preventDefault"],
  607. referencedClasses: []
  608. }),
  609. smalltalk.HLKeyBinder);
  610. smalltalk.addMethod(
  611. "_handleInactiveKeyDown_",
  612. smalltalk.method({
  613. selector: "handleInactiveKeyDown:",
  614. category: 'events',
  615. fn: function (event){
  616. var self=this;
  617. return smalltalk.withContext(function($ctx1) { var $1,$2;
  618. $1=_st(_st(event)._which()).__eq(_st(self)._activationKey());
  619. if(smalltalk.assert($1)){
  620. $2=_st(event)._ctrlKey();
  621. if(smalltalk.assert($2)){
  622. _st(self)._activate();
  623. _st(event)._preventDefault();
  624. return false;
  625. };
  626. };
  627. return self}, function($ctx1) {$ctx1.fill(self,"handleInactiveKeyDown:",{event:event}, smalltalk.HLKeyBinder)})},
  628. args: ["event"],
  629. 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 ] ]",
  630. messageSends: ["ifTrue:", "activate", "preventDefault", "ctrlKey", "=", "activationKey", "which"],
  631. referencedClasses: []
  632. }),
  633. smalltalk.HLKeyBinder);
  634. smalltalk.addMethod(
  635. "_handleKeyDown_",
  636. smalltalk.method({
  637. selector: "handleKeyDown:",
  638. category: 'events',
  639. fn: function (event){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) { var $2,$1;
  642. $2=_st(self)._isActive();
  643. if(smalltalk.assert($2)){
  644. $1=_st(self)._handleActiveKeyDown_(event);
  645. } else {
  646. $1=_st(self)._handleInactiveKeyDown_(event);
  647. };
  648. return $1;
  649. }, function($ctx1) {$ctx1.fill(self,"handleKeyDown:",{event:event}, smalltalk.HLKeyBinder)})},
  650. args: ["event"],
  651. source: "handleKeyDown: event\x0a\x09^ self isActive\x0a \x09ifTrue: [ self handleActiveKeyDown: event ]\x0a \x09ifFalse: [ self handleInactiveKeyDown: event ]",
  652. messageSends: ["ifTrue:ifFalse:", "handleActiveKeyDown:", "handleInactiveKeyDown:", "isActive"],
  653. referencedClasses: []
  654. }),
  655. smalltalk.HLKeyBinder);
  656. smalltalk.addMethod(
  657. "_helper",
  658. smalltalk.method({
  659. selector: "helper",
  660. category: 'accessing',
  661. fn: function (){
  662. var self=this;
  663. return smalltalk.withContext(function($ctx1) { var $2,$1;
  664. $2=self["@helper"];
  665. if(($receiver = $2) == nil || $receiver == undefined){
  666. self["@helper"]=_st((smalltalk.HLKeyBinderHelper || HLKeyBinderHelper))._on_(self);
  667. $1=self["@helper"];
  668. } else {
  669. $1=$2;
  670. };
  671. return $1;
  672. }, function($ctx1) {$ctx1.fill(self,"helper",{}, smalltalk.HLKeyBinder)})},
  673. args: [],
  674. source: "helper\x0a\x09^ helper ifNil: [ helper := HLKeyBinderHelper on: self ]",
  675. messageSends: ["ifNil:", "on:"],
  676. referencedClasses: ["HLKeyBinderHelper"]
  677. }),
  678. smalltalk.HLKeyBinder);
  679. smalltalk.addMethod(
  680. "_initialize",
  681. smalltalk.method({
  682. selector: "initialize",
  683. category: 'initialization',
  684. fn: function (){
  685. var self=this;
  686. return smalltalk.withContext(function($ctx1) { smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  687. self["@active"]=false;
  688. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLKeyBinder)})},
  689. args: [],
  690. source: "initialize\x0a\x09super initialize.\x0a active := false",
  691. messageSends: ["initialize"],
  692. referencedClasses: []
  693. }),
  694. smalltalk.HLKeyBinder);
  695. smalltalk.addMethod(
  696. "_isActive",
  697. smalltalk.method({
  698. selector: "isActive",
  699. category: 'testing',
  700. fn: function (){
  701. var self=this;
  702. return smalltalk.withContext(function($ctx1) { var $2,$1;
  703. $2=self["@active"];
  704. if(($receiver = $2) == nil || $receiver == undefined){
  705. $1=false;
  706. } else {
  707. $1=$2;
  708. };
  709. return $1;
  710. }, function($ctx1) {$ctx1.fill(self,"isActive",{}, smalltalk.HLKeyBinder)})},
  711. args: [],
  712. source: "isActive\x0a\x09^ active ifNil: [ false ]",
  713. messageSends: ["ifNil:"],
  714. referencedClasses: []
  715. }),
  716. smalltalk.HLKeyBinder);
  717. smalltalk.addMethod(
  718. "_selectedBinding",
  719. smalltalk.method({
  720. selector: "selectedBinding",
  721. category: 'accessing',
  722. fn: function (){
  723. var self=this;
  724. return smalltalk.withContext(function($ctx1) { var $2,$1;
  725. $2=self["@selectedBinding"];
  726. if(($receiver = $2) == nil || $receiver == undefined){
  727. $1=_st(self)._bindings();
  728. } else {
  729. $1=$2;
  730. };
  731. return $1;
  732. }, function($ctx1) {$ctx1.fill(self,"selectedBinding",{}, smalltalk.HLKeyBinder)})},
  733. args: [],
  734. source: "selectedBinding\x0a\x09^ selectedBinding ifNil: [ self bindings ]",
  735. messageSends: ["ifNil:", "bindings"],
  736. referencedClasses: []
  737. }),
  738. smalltalk.HLKeyBinder);
  739. smalltalk.addMethod(
  740. "_setupEvents",
  741. smalltalk.method({
  742. selector: "setupEvents",
  743. category: 'events',
  744. fn: function (){
  745. var self=this;
  746. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_("body"))._keydown_((function(event){
  747. return smalltalk.withContext(function($ctx2) { return _st(self)._handleKeyDown_(event);
  748. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1)})}));
  749. return self}, function($ctx1) {$ctx1.fill(self,"setupEvents",{}, smalltalk.HLKeyBinder)})},
  750. args: [],
  751. source: "setupEvents\x0a\x09(window jQuery: 'body') keydown: [ :event | self handleKeyDown: event ]",
  752. messageSends: ["keydown:", "handleKeyDown:", "jQuery:"],
  753. referencedClasses: []
  754. }),
  755. smalltalk.HLKeyBinder);
  756. smalltalk.addMethod(
  757. "_systemIsMac",
  758. smalltalk.method({
  759. selector: "systemIsMac",
  760. category: 'testing',
  761. fn: function (){
  762. var self=this;
  763. return smalltalk.withContext(function($ctx1) { var $1;
  764. $1=_st(_st(navigator)._platform())._match_("Mac");
  765. return $1;
  766. }, function($ctx1) {$ctx1.fill(self,"systemIsMac",{}, smalltalk.HLKeyBinder)})},
  767. args: [],
  768. source: "systemIsMac\x0a\x09^ navigator platform match: 'Mac'",
  769. messageSends: ["match:", "platform"],
  770. referencedClasses: []
  771. }),
  772. smalltalk.HLKeyBinder);
  773. smalltalk.addClass('HLKeyBinderHelper', smalltalk.HLWidget, ['keyBinder'], 'Helios-KeyBindings');
  774. smalltalk.addMethod(
  775. "_cssClass",
  776. smalltalk.method({
  777. selector: "cssClass",
  778. category: 'accessing',
  779. fn: function (){
  780. var self=this;
  781. return smalltalk.withContext(function($ctx1) { return "key_helper";
  782. }, function($ctx1) {$ctx1.fill(self,"cssClass",{}, smalltalk.HLKeyBinderHelper)})},
  783. args: [],
  784. source: "cssClass\x0a\x09^ 'key_helper'",
  785. messageSends: [],
  786. referencedClasses: []
  787. }),
  788. smalltalk.HLKeyBinderHelper);
  789. smalltalk.addMethod(
  790. "_hide",
  791. smalltalk.method({
  792. selector: "hide",
  793. category: 'actions',
  794. fn: function (){
  795. var self=this;
  796. return smalltalk.withContext(function($ctx1) { _st(_st(_st(".").__comma(_st(self)._cssClass()))._asJQuery())._remove();
  797. return self}, function($ctx1) {$ctx1.fill(self,"hide",{}, smalltalk.HLKeyBinderHelper)})},
  798. args: [],
  799. source: "hide\x0a\x09('.', self cssClass) asJQuery remove",
  800. messageSends: ["remove", "asJQuery", ",", "cssClass"],
  801. referencedClasses: []
  802. }),
  803. smalltalk.HLKeyBinderHelper);
  804. smalltalk.addMethod(
  805. "_keyBinder",
  806. smalltalk.method({
  807. selector: "keyBinder",
  808. category: 'accessing',
  809. fn: function (){
  810. var self=this;
  811. return smalltalk.withContext(function($ctx1) { var $1;
  812. $1=self["@keyBinder"];
  813. return $1;
  814. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{}, smalltalk.HLKeyBinderHelper)})},
  815. args: [],
  816. source: "keyBinder\x0a\x09^ keyBinder",
  817. messageSends: [],
  818. referencedClasses: []
  819. }),
  820. smalltalk.HLKeyBinderHelper);
  821. smalltalk.addMethod(
  822. "_keyBinder_",
  823. smalltalk.method({
  824. selector: "keyBinder:",
  825. category: 'accessing',
  826. fn: function (aKeyBinder){
  827. var self=this;
  828. return smalltalk.withContext(function($ctx1) { self["@keyBinder"]=aKeyBinder;
  829. return self}, function($ctx1) {$ctx1.fill(self,"keyBinder:",{aKeyBinder:aKeyBinder}, smalltalk.HLKeyBinderHelper)})},
  830. args: ["aKeyBinder"],
  831. source: "keyBinder: aKeyBinder\x0a\x09keyBinder := aKeyBinder",
  832. messageSends: [],
  833. referencedClasses: []
  834. }),
  835. smalltalk.HLKeyBinderHelper);
  836. smalltalk.addMethod(
  837. "_registerBindings",
  838. smalltalk.method({
  839. selector: "registerBindings",
  840. category: 'keyBindings',
  841. fn: function (){
  842. var self=this;
  843. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{}, smalltalk.HLKeyBinderHelper)})},
  844. args: [],
  845. source: "registerBindings\x0a\x09\x22Do nothing\x22",
  846. messageSends: [],
  847. referencedClasses: []
  848. }),
  849. smalltalk.HLKeyBinderHelper);
  850. smalltalk.addMethod(
  851. "_renderBindingGroup_on_",
  852. smalltalk.method({
  853. selector: "renderBindingGroup:on:",
  854. category: 'rendering',
  855. fn: function (aBindingGroup,html){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$6,$2;
  858. _st(_st(_st(aBindingGroup)._bindings())._sorted_((function(a,b){
  859. return smalltalk.withContext(function($ctx2) { return _st(_st(a)._key()).__lt(_st(b)._key());
  860. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  861. return smalltalk.withContext(function($ctx2) { $1=_st(html)._span();
  862. _st($1)._class_("command");
  863. $2=_st($1)._with_((function(){
  864. return smalltalk.withContext(function($ctx3) { $3=_st(html)._span();
  865. _st($3)._class_("label");
  866. $4=_st($3)._with_(_st(_st(each)._shortcut())._asLowercase());
  867. $4;
  868. $5=_st(html)._a();
  869. _st($5)._class_("action");
  870. _st($5)._with_(_st(each)._label());
  871. $6=_st($5)._onClick_((function(){
  872. return smalltalk.withContext(function($ctx4) { return _st(_st(self)._keyBinder())._applyBinding_(each);
  873. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  874. return $6;
  875. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  876. return $2;
  877. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  878. return self}, function($ctx1) {$ctx1.fill(self,"renderBindingGroup:on:",{aBindingGroup:aBindingGroup,html:html}, smalltalk.HLKeyBinderHelper)})},
  879. args: ["aBindingGroup", "html"],
  880. source: "renderBindingGroup: aBindingGroup on: html\x0a\x09(aBindingGroup bindings \x0a \x09sorted: [ :a :b | a key < b key ])\x0a do: [ :each |\x0a\x09\x09\x09html span class: 'command'; with: [\x0a\x09\x09\x09\x09html span class: 'label'; with: each shortcut asLowercase.\x0a \x09\x09\x09\x09html a \x0a \x09class: 'action'; \x0a with: each label;\x0a \x09\x09\x09\x09\x09onClick: [ self keyBinder applyBinding: each ] ] ]",
  881. messageSends: ["do:", "class:", "span", "with:", "asLowercase", "shortcut", "a", "label", "onClick:", "applyBinding:", "keyBinder", "sorted:", "<", "key", "bindings"],
  882. referencedClasses: []
  883. }),
  884. smalltalk.HLKeyBinderHelper);
  885. smalltalk.addMethod(
  886. "_renderBindingOn_",
  887. smalltalk.method({
  888. selector: "renderBindingOn:",
  889. category: 'rendering',
  890. fn: function (html){
  891. var self=this;
  892. return smalltalk.withContext(function($ctx1) { _st(_st(self)._selectedBinding())._renderOn_html_(self,html);
  893. return self}, function($ctx1) {$ctx1.fill(self,"renderBindingOn:",{html:html}, smalltalk.HLKeyBinderHelper)})},
  894. args: ["html"],
  895. source: "renderBindingOn: html\x0a\x09self selectedBinding renderOn: self html: html",
  896. messageSends: ["renderOn:html:", "selectedBinding"],
  897. referencedClasses: []
  898. }),
  899. smalltalk.HLKeyBinderHelper);
  900. smalltalk.addMethod(
  901. "_renderContentOn_",
  902. smalltalk.method({
  903. selector: "renderContentOn:",
  904. category: 'rendering',
  905. fn: function (html){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  908. $1=_st(html)._div();
  909. _st($1)._class_(_st(self)._cssClass());
  910. $2=_st($1)._with_((function(){
  911. return smalltalk.withContext(function($ctx2) { $3=self;
  912. _st($3)._renderSelectionOn_(html);
  913. $4=_st($3)._renderBindingOn_(html);
  914. return $4;
  915. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  916. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLKeyBinderHelper)})},
  917. args: ["html"],
  918. source: "renderContentOn: html\x0a\x09html div class: self cssClass; with: [\x0a \x09self \x0a \x09renderSelectionOn:html;\x0a \x09renderBindingOn: html ]",
  919. messageSends: ["class:", "cssClass", "div", "with:", "renderSelectionOn:", "renderBindingOn:"],
  920. referencedClasses: []
  921. }),
  922. smalltalk.HLKeyBinderHelper);
  923. smalltalk.addMethod(
  924. "_renderSelectionOn_",
  925. smalltalk.method({
  926. selector: "renderSelectionOn:",
  927. category: 'rendering',
  928. fn: function (html){
  929. var self=this;
  930. return smalltalk.withContext(function($ctx1) { var $1,$3,$5,$4,$2;
  931. $1=_st(html)._span();
  932. _st($1)._class_("selected");
  933. $3=$1;
  934. $5=_st(_st(self)._selectedBinding())._label();
  935. if(($receiver = $5) == nil || $receiver == undefined){
  936. $4="Action";
  937. } else {
  938. $4=$5;
  939. };
  940. $2=_st($3)._with_($4);
  941. return self}, function($ctx1) {$ctx1.fill(self,"renderSelectionOn:",{html:html}, smalltalk.HLKeyBinderHelper)})},
  942. args: ["html"],
  943. source: "renderSelectionOn: html\x0a\x09\x09html span \x0a \x09class: 'selected'; \x0a with: (self selectedBinding label ifNil: [ 'Action' ])",
  944. messageSends: ["class:", "span", "with:", "ifNil:", "label", "selectedBinding"],
  945. referencedClasses: []
  946. }),
  947. smalltalk.HLKeyBinderHelper);
  948. smalltalk.addMethod(
  949. "_selectedBinding",
  950. smalltalk.method({
  951. selector: "selectedBinding",
  952. category: 'accessing',
  953. fn: function (){
  954. var self=this;
  955. return smalltalk.withContext(function($ctx1) { var $1;
  956. $1=_st(_st(self)._keyBinder())._selectedBinding();
  957. return $1;
  958. }, function($ctx1) {$ctx1.fill(self,"selectedBinding",{}, smalltalk.HLKeyBinderHelper)})},
  959. args: [],
  960. source: "selectedBinding\x0a\x09^ self keyBinder selectedBinding",
  961. messageSends: ["selectedBinding", "keyBinder"],
  962. referencedClasses: []
  963. }),
  964. smalltalk.HLKeyBinderHelper);
  965. smalltalk.addMethod(
  966. "_show",
  967. smalltalk.method({
  968. selector: "show",
  969. category: 'actions',
  970. fn: function (){
  971. var self=this;
  972. return smalltalk.withContext(function($ctx1) { _st(self)._appendToJQuery_(_st("body")._asJQuery());
  973. return self}, function($ctx1) {$ctx1.fill(self,"show",{}, smalltalk.HLKeyBinderHelper)})},
  974. args: [],
  975. source: "show\x0a\x09self appendToJQuery: 'body' asJQuery",
  976. messageSends: ["appendToJQuery:", "asJQuery"],
  977. referencedClasses: []
  978. }),
  979. smalltalk.HLKeyBinderHelper);
  980. smalltalk.addMethod(
  981. "_on_",
  982. smalltalk.method({
  983. selector: "on:",
  984. category: 'instance creation',
  985. fn: function (aKeyBinder){
  986. var self=this;
  987. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  988. $2=_st(self)._new();
  989. _st($2)._keyBinder_(aKeyBinder);
  990. $3=_st($2)._yourself();
  991. $1=$3;
  992. return $1;
  993. }, function($ctx1) {$ctx1.fill(self,"on:",{aKeyBinder:aKeyBinder}, smalltalk.HLKeyBinderHelper.klass)})},
  994. args: ["aKeyBinder"],
  995. source: "on: aKeyBinder\x0a\x09^ self new\x0a \x09keyBinder: aKeyBinder;\x0a yourself",
  996. messageSends: ["keyBinder:", "new", "yourself"],
  997. referencedClasses: []
  998. }),
  999. smalltalk.HLKeyBinderHelper.klass);