Helios-KeyBindings.deploy.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  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. fn: function (aKeyBinder){
  8. var self=this;
  9. smalltalk.send(self,"_subclassResponsibility",[]);
  10. return self}
  11. }),
  12. smalltalk.HLBinding);
  13. smalltalk.addMethod(
  14. "_isBindingAction",
  15. smalltalk.method({
  16. selector: "isBindingAction",
  17. fn: function (){
  18. var self=this;
  19. return false;
  20. }
  21. }),
  22. smalltalk.HLBinding);
  23. smalltalk.addMethod(
  24. "_isBindingGroup",
  25. smalltalk.method({
  26. selector: "isBindingGroup",
  27. fn: function (){
  28. var self=this;
  29. return false;
  30. }
  31. }),
  32. smalltalk.HLBinding);
  33. smalltalk.addMethod(
  34. "_key",
  35. smalltalk.method({
  36. selector: "key",
  37. fn: function (){
  38. var self=this;
  39. return self["@key"];
  40. }
  41. }),
  42. smalltalk.HLBinding);
  43. smalltalk.addMethod(
  44. "_key_",
  45. smalltalk.method({
  46. selector: "key:",
  47. fn: function (anInteger){
  48. var self=this;
  49. self["@key"]=anInteger;
  50. return self}
  51. }),
  52. smalltalk.HLBinding);
  53. smalltalk.addMethod(
  54. "_label",
  55. smalltalk.method({
  56. selector: "label",
  57. fn: function (){
  58. var self=this;
  59. return self["@label"];
  60. }
  61. }),
  62. smalltalk.HLBinding);
  63. smalltalk.addMethod(
  64. "_label_",
  65. smalltalk.method({
  66. selector: "label:",
  67. fn: function (aString){
  68. var self=this;
  69. self["@label"]=aString;
  70. return self}
  71. }),
  72. smalltalk.HLBinding);
  73. smalltalk.addMethod(
  74. "_renderOn_html_",
  75. smalltalk.method({
  76. selector: "renderOn:html:",
  77. fn: function (aBindingHelper,html){
  78. var self=this;
  79. return self}
  80. }),
  81. smalltalk.HLBinding);
  82. smalltalk.addMethod(
  83. "_shortcut",
  84. smalltalk.method({
  85. selector: "shortcut",
  86. fn: function (){
  87. var self=this;
  88. var $1;
  89. $1=smalltalk.send((smalltalk.String || String),"_fromCharCode_",[smalltalk.send(self,"_key",[])]);
  90. return $1;
  91. }
  92. }),
  93. smalltalk.HLBinding);
  94. smalltalk.addMethod(
  95. "_on_labelled_",
  96. smalltalk.method({
  97. selector: "on:labelled:",
  98. fn: function (anInteger,aString){
  99. var self=this;
  100. var $2,$3,$1;
  101. $2=smalltalk.send(self,"_new",[]);
  102. smalltalk.send($2,"_key_",[anInteger]);
  103. smalltalk.send($2,"_label_",[aString]);
  104. $3=smalltalk.send($2,"_yourself",[]);
  105. $1=$3;
  106. return $1;
  107. }
  108. }),
  109. smalltalk.HLBinding.klass);
  110. smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['callback'], 'Helios-KeyBindings');
  111. smalltalk.addMethod(
  112. "_applyOn_",
  113. smalltalk.method({
  114. selector: "applyOn:",
  115. fn: function (aKeyBinder){
  116. var self=this;
  117. smalltalk.send(aKeyBinder,"_applyBindingAction_",[self]);
  118. return self}
  119. }),
  120. smalltalk.HLBindingAction);
  121. smalltalk.addMethod(
  122. "_callback",
  123. smalltalk.method({
  124. selector: "callback",
  125. fn: function (){
  126. var self=this;
  127. return self["@callback"];
  128. }
  129. }),
  130. smalltalk.HLBindingAction);
  131. smalltalk.addMethod(
  132. "_callback_",
  133. smalltalk.method({
  134. selector: "callback:",
  135. fn: function (aBlock){
  136. var self=this;
  137. self["@callback"]=aBlock;
  138. return self}
  139. }),
  140. smalltalk.HLBindingAction);
  141. smalltalk.addMethod(
  142. "_isBindingAction",
  143. smalltalk.method({
  144. selector: "isBindingAction",
  145. fn: function (){
  146. var self=this;
  147. return true;
  148. }
  149. }),
  150. smalltalk.HLBindingAction);
  151. smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
  152. smalltalk.addMethod(
  153. "_add_",
  154. smalltalk.method({
  155. selector: "add:",
  156. fn: function (aBinding){
  157. var self=this;
  158. var $1;
  159. $1=smalltalk.send(smalltalk.send(self,"_bindings",[]),"_add_",[aBinding]);
  160. return $1;
  161. }
  162. }),
  163. smalltalk.HLBindingGroup);
  164. smalltalk.addMethod(
  165. "_addActionKey_labelled_callback_",
  166. smalltalk.method({
  167. selector: "addActionKey:labelled:callback:",
  168. fn: function (anInteger,aString,aBlock){
  169. var self=this;
  170. var $1,$2;
  171. $1=smalltalk.send((smalltalk.HLBindingAction || HLBindingAction),"_on_labelled_",[anInteger,aString]);
  172. smalltalk.send($1,"_callback_",[aBlock]);
  173. $2=smalltalk.send($1,"_yourself",[]);
  174. smalltalk.send(self,"_add_",[$2]);
  175. return self}
  176. }),
  177. smalltalk.HLBindingGroup);
  178. smalltalk.addMethod(
  179. "_addGroupKey_labelled_",
  180. smalltalk.method({
  181. selector: "addGroupKey:labelled:",
  182. fn: function (anInteger,aString){
  183. var self=this;
  184. smalltalk.send(self,"_add_",[smalltalk.send((smalltalk.HLBindingGroup || HLBindingGroup),"_on_labelled_",[anInteger,aString])]);
  185. return self}
  186. }),
  187. smalltalk.HLBindingGroup);
  188. smalltalk.addMethod(
  189. "_applyOn_",
  190. smalltalk.method({
  191. selector: "applyOn:",
  192. fn: function (aKeyBinder){
  193. var self=this;
  194. smalltalk.send(aKeyBinder,"_applyBindingGroup_",[self]);
  195. return self}
  196. }),
  197. smalltalk.HLBindingGroup);
  198. smalltalk.addMethod(
  199. "_at_",
  200. smalltalk.method({
  201. selector: "at:",
  202. fn: function (aString){
  203. var self=this;
  204. var $1;
  205. $1=smalltalk.send(smalltalk.send(self,"_bindings",[]),"_detect_ifNone_",[(function(each){
  206. return smalltalk.send(smalltalk.send(each,"_label",[]),"__eq",[aString]);
  207. }),(function(){
  208. return nil;
  209. })]);
  210. return $1;
  211. }
  212. }),
  213. smalltalk.HLBindingGroup);
  214. smalltalk.addMethod(
  215. "_atKey_",
  216. smalltalk.method({
  217. selector: "atKey:",
  218. fn: function (anInteger){
  219. var self=this;
  220. var $1;
  221. $1=smalltalk.send(smalltalk.send(self,"_bindings",[]),"_detect_ifNone_",[(function(each){
  222. return smalltalk.send(smalltalk.send(each,"_key",[]),"__eq",[anInteger]);
  223. }),(function(){
  224. return nil;
  225. })]);
  226. return $1;
  227. }
  228. }),
  229. smalltalk.HLBindingGroup);
  230. smalltalk.addMethod(
  231. "_bindings",
  232. smalltalk.method({
  233. selector: "bindings",
  234. fn: function (){
  235. var self=this;
  236. var $1;
  237. if(($receiver = self["@bindings"]) == nil || $receiver == undefined){
  238. self["@bindings"]=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection),"_new",[]);
  239. $1=self["@bindings"];
  240. } else {
  241. $1=self["@bindings"];
  242. };
  243. return $1;
  244. }
  245. }),
  246. smalltalk.HLBindingGroup);
  247. smalltalk.addMethod(
  248. "_isBindingGroup",
  249. smalltalk.method({
  250. selector: "isBindingGroup",
  251. fn: function (){
  252. var self=this;
  253. return true;
  254. }
  255. }),
  256. smalltalk.HLBindingGroup);
  257. smalltalk.addMethod(
  258. "_renderOn_html_",
  259. smalltalk.method({
  260. selector: "renderOn:html:",
  261. fn: function (aBindingHelper,html){
  262. var self=this;
  263. smalltalk.send(aBindingHelper,"_renderBindingGroup_on_",[self,html]);
  264. return self}
  265. }),
  266. smalltalk.HLBindingGroup);
  267. smalltalk.addClass('HLKeyBinder', smalltalk.Object, ['modifierKey', 'active', 'helper', 'bindings', 'selectedBinding'], 'Helios-KeyBindings');
  268. smalltalk.addMethod(
  269. "_activate",
  270. smalltalk.method({
  271. selector: "activate",
  272. fn: function (){
  273. var self=this;
  274. self["@active"]=true;
  275. smalltalk.send(smalltalk.send(self,"_helper",[]),"_show",[]);
  276. return self}
  277. }),
  278. smalltalk.HLKeyBinder);
  279. smalltalk.addMethod(
  280. "_activationKey",
  281. smalltalk.method({
  282. selector: "activationKey",
  283. fn: function (){
  284. var self=this;
  285. return (32);
  286. }
  287. }),
  288. smalltalk.HLKeyBinder);
  289. smalltalk.addMethod(
  290. "_applyBinding_",
  291. smalltalk.method({
  292. selector: "applyBinding:",
  293. fn: function (aBinding){
  294. var self=this;
  295. smalltalk.send(aBinding,"_applyOn_",[self]);
  296. return self}
  297. }),
  298. smalltalk.HLKeyBinder);
  299. smalltalk.addMethod(
  300. "_applyBindingAction_",
  301. smalltalk.method({
  302. selector: "applyBindingAction:",
  303. fn: function (aBinding){
  304. var self=this;
  305. smalltalk.send(smalltalk.send(aBinding,"_callback",[]),"_value",[]);
  306. smalltalk.send(self,"_deactivate",[]);
  307. return self}
  308. }),
  309. smalltalk.HLKeyBinder);
  310. smalltalk.addMethod(
  311. "_applyBindingGroup_",
  312. smalltalk.method({
  313. selector: "applyBindingGroup:",
  314. fn: function (aBinding){
  315. var self=this;
  316. self["@selectedBinding"]=aBinding;
  317. smalltalk.send(smalltalk.send(self,"_helper",[]),"_refresh",[]);
  318. return self}
  319. }),
  320. smalltalk.HLKeyBinder);
  321. smalltalk.addMethod(
  322. "_bindings",
  323. smalltalk.method({
  324. selector: "bindings",
  325. fn: function (){
  326. var self=this;
  327. var $1;
  328. if(($receiver = self["@bindings"]) == nil || $receiver == undefined){
  329. self["@bindings"]=smalltalk.send((smalltalk.HLBindingGroup || HLBindingGroup),"_new",[]);
  330. $1=self["@bindings"];
  331. } else {
  332. $1=self["@bindings"];
  333. };
  334. return $1;
  335. }
  336. }),
  337. smalltalk.HLKeyBinder);
  338. smalltalk.addMethod(
  339. "_deactivate",
  340. smalltalk.method({
  341. selector: "deactivate",
  342. fn: function (){
  343. var self=this;
  344. self["@active"]=false;
  345. self["@selectedBinding"]=nil;
  346. smalltalk.send(smalltalk.send(self,"_helper",[]),"_hide",[]);
  347. return self}
  348. }),
  349. smalltalk.HLKeyBinder);
  350. smalltalk.addMethod(
  351. "_escapeKey",
  352. smalltalk.method({
  353. selector: "escapeKey",
  354. fn: function (){
  355. var self=this;
  356. return (27);
  357. }
  358. }),
  359. smalltalk.HLKeyBinder);
  360. smalltalk.addMethod(
  361. "_flushBindings",
  362. smalltalk.method({
  363. selector: "flushBindings",
  364. fn: function (){
  365. var self=this;
  366. self["@bindings"]=nil;
  367. self["@helper"]=nil;
  368. return self}
  369. }),
  370. smalltalk.HLKeyBinder);
  371. smalltalk.addMethod(
  372. "_handleActiveKeyDown_",
  373. smalltalk.method({
  374. selector: "handleActiveKeyDown:",
  375. fn: function (event){
  376. var self=this;
  377. var $1,$2;
  378. $1=smalltalk.send(smalltalk.send(smalltalk.send(event,"_which",[]),"__eq",[smalltalk.send(self,"_escapeKey",[])]),"_or_",[(function(){
  379. return smalltalk.send(smalltalk.send(smalltalk.send(event,"_which",[]),"__eq",[(71)]),"_and_",[(function(){
  380. return smalltalk.send(event,"_ctrlKey",[]);
  381. })]);
  382. })]);
  383. if(smalltalk.assert($1)){
  384. smalltalk.send(self,"_deactivate",[]);
  385. smalltalk.send(event,"_preventDefault",[]);
  386. return false;
  387. };
  388. $2=smalltalk.send(self,"_handleBindingFor_",[event]);
  389. return $2;
  390. }
  391. }),
  392. smalltalk.HLKeyBinder);
  393. smalltalk.addMethod(
  394. "_handleBindingFor_",
  395. smalltalk.method({
  396. selector: "handleBindingFor:",
  397. fn: function (anEvent){
  398. var self=this;
  399. var binding;
  400. binding=smalltalk.send(smalltalk.send(self,"_selectedBinding",[]),"_atKey_",[smalltalk.send(anEvent,"_which",[])]);
  401. if(($receiver = binding) == nil || $receiver == undefined){
  402. binding;
  403. } else {
  404. smalltalk.send(self,"_applyBinding_",[binding]);
  405. smalltalk.send(anEvent,"_preventDefault",[]);
  406. return false;
  407. };
  408. return self}
  409. }),
  410. smalltalk.HLKeyBinder);
  411. smalltalk.addMethod(
  412. "_handleInactiveKeyDown_",
  413. smalltalk.method({
  414. selector: "handleInactiveKeyDown:",
  415. fn: function (event){
  416. var self=this;
  417. var $1,$3,$2;
  418. $1=smalltalk.send(smalltalk.send(event,"_which",[]),"__eq",[smalltalk.send(self,"_activationKey",[])]);
  419. if(smalltalk.assert($1)){
  420. $3=smalltalk.send(self,"_systemIsMac",[]);
  421. if(smalltalk.assert($3)){
  422. $2=smalltalk.send(event,"_metaKey",[]);
  423. } else {
  424. $2=smalltalk.send(event,"_ctrlKey",[]);
  425. };
  426. if(smalltalk.assert($2)){
  427. smalltalk.send(self,"_activate",[]);
  428. smalltalk.send(event,"_preventDefault",[]);
  429. return false;
  430. };
  431. };
  432. return self}
  433. }),
  434. smalltalk.HLKeyBinder);
  435. smalltalk.addMethod(
  436. "_handleKeyDown_",
  437. smalltalk.method({
  438. selector: "handleKeyDown:",
  439. fn: function (event){
  440. var self=this;
  441. var $2,$1;
  442. $2=smalltalk.send(self,"_isActive",[]);
  443. if(smalltalk.assert($2)){
  444. $1=smalltalk.send(self,"_handleActiveKeyDown_",[event]);
  445. } else {
  446. $1=smalltalk.send(self,"_handleInactiveKeyDown_",[event]);
  447. };
  448. return $1;
  449. }
  450. }),
  451. smalltalk.HLKeyBinder);
  452. smalltalk.addMethod(
  453. "_helper",
  454. smalltalk.method({
  455. selector: "helper",
  456. fn: function (){
  457. var self=this;
  458. var $1;
  459. if(($receiver = self["@helper"]) == nil || $receiver == undefined){
  460. self["@helper"]=smalltalk.send((smalltalk.HLKeyBinderHelper || HLKeyBinderHelper),"_on_",[self]);
  461. $1=self["@helper"];
  462. } else {
  463. $1=self["@helper"];
  464. };
  465. return $1;
  466. }
  467. }),
  468. smalltalk.HLKeyBinder);
  469. smalltalk.addMethod(
  470. "_initialize",
  471. smalltalk.method({
  472. selector: "initialize",
  473. fn: function (){
  474. var self=this;
  475. smalltalk.send(self,"_initialize",[],smalltalk.Object);
  476. self["@active"]=false;
  477. return self}
  478. }),
  479. smalltalk.HLKeyBinder);
  480. smalltalk.addMethod(
  481. "_isActive",
  482. smalltalk.method({
  483. selector: "isActive",
  484. fn: function (){
  485. var self=this;
  486. var $1;
  487. if(($receiver = self["@active"]) == nil || $receiver == undefined){
  488. $1=false;
  489. } else {
  490. $1=self["@active"];
  491. };
  492. return $1;
  493. }
  494. }),
  495. smalltalk.HLKeyBinder);
  496. smalltalk.addMethod(
  497. "_selectedBinding",
  498. smalltalk.method({
  499. selector: "selectedBinding",
  500. fn: function (){
  501. var self=this;
  502. var $1;
  503. if(($receiver = self["@selectedBinding"]) == nil || $receiver == undefined){
  504. $1=smalltalk.send(self,"_bindings",[]);
  505. } else {
  506. $1=self["@selectedBinding"];
  507. };
  508. return $1;
  509. }
  510. }),
  511. smalltalk.HLKeyBinder);
  512. smalltalk.addMethod(
  513. "_setupEvents",
  514. smalltalk.method({
  515. selector: "setupEvents",
  516. fn: function (){
  517. var self=this;
  518. smalltalk.send(smalltalk.send(window,"_jQuery_",["body"]),"_keydown_",[(function(event){
  519. return smalltalk.send(self,"_handleKeyDown_",[event]);
  520. })]);
  521. return self}
  522. }),
  523. smalltalk.HLKeyBinder);
  524. smalltalk.addMethod(
  525. "_systemIsMac",
  526. smalltalk.method({
  527. selector: "systemIsMac",
  528. fn: function (){
  529. var self=this;
  530. var $1;
  531. $1=smalltalk.send(smalltalk.send(navigator,"_platform",[]),"_match_",["Mac"]);
  532. return $1;
  533. }
  534. }),
  535. smalltalk.HLKeyBinder);
  536. smalltalk.addClass('HLKeyBinderHelper', smalltalk.HLWidget, ['keyBinder'], 'Helios-KeyBindings');
  537. smalltalk.addMethod(
  538. "_hide",
  539. smalltalk.method({
  540. selector: "hide",
  541. fn: function (){
  542. var self=this;
  543. smalltalk.send(smalltalk.send(self["@rootDiv"],"_asJQuery",[]),"_remove",[]);
  544. return self}
  545. }),
  546. smalltalk.HLKeyBinderHelper);
  547. smalltalk.addMethod(
  548. "_keyBinder",
  549. smalltalk.method({
  550. selector: "keyBinder",
  551. fn: function (){
  552. var self=this;
  553. return self["@keyBinder"];
  554. }
  555. }),
  556. smalltalk.HLKeyBinderHelper);
  557. smalltalk.addMethod(
  558. "_keyBinder_",
  559. smalltalk.method({
  560. selector: "keyBinder:",
  561. fn: function (aKeyBinder){
  562. var self=this;
  563. self["@keyBinder"]=aKeyBinder;
  564. return self}
  565. }),
  566. smalltalk.HLKeyBinderHelper);
  567. smalltalk.addMethod(
  568. "_registerBindings",
  569. smalltalk.method({
  570. selector: "registerBindings",
  571. fn: function (){
  572. var self=this;
  573. return self}
  574. }),
  575. smalltalk.HLKeyBinderHelper);
  576. smalltalk.addMethod(
  577. "_renderBindingGroup_on_",
  578. smalltalk.method({
  579. selector: "renderBindingGroup:on:",
  580. fn: function (aBindingGroup,html){
  581. var self=this;
  582. var $1,$3,$4,$5,$6,$2;
  583. smalltalk.send(smalltalk.send(smalltalk.send(aBindingGroup,"_bindings",[]),"_sorted_",[(function(a,b){
  584. return smalltalk.send(smalltalk.send(a,"_key",[]),"__lt",[smalltalk.send(b,"_key",[])]);
  585. })]),"_do_",[(function(each){
  586. $1=smalltalk.send(html,"_span",[]);
  587. smalltalk.send($1,"_class_",["command"]);
  588. $2=smalltalk.send($1,"_with_",[(function(){
  589. $3=smalltalk.send(html,"_span",[]);
  590. smalltalk.send($3,"_class_",["label"]);
  591. $4=smalltalk.send($3,"_with_",[smalltalk.send(smalltalk.send(each,"_shortcut",[]),"_asLowercase",[])]);
  592. $4;
  593. $5=smalltalk.send(html,"_a",[]);
  594. smalltalk.send($5,"_class_",["action"]);
  595. smalltalk.send($5,"_with_",[smalltalk.send(each,"_label",[])]);
  596. $6=smalltalk.send($5,"_onClick_",[(function(){
  597. return smalltalk.send(smalltalk.send(self,"_keyBinder",[]),"_applyBinding_",[each]);
  598. })]);
  599. return $6;
  600. })]);
  601. return $2;
  602. })]);
  603. return self}
  604. }),
  605. smalltalk.HLKeyBinderHelper);
  606. smalltalk.addMethod(
  607. "_renderBindingOn_",
  608. smalltalk.method({
  609. selector: "renderBindingOn:",
  610. fn: function (html){
  611. var self=this;
  612. smalltalk.send(smalltalk.send(self,"_selectedBinding",[]),"_renderOn_html_",[self,html]);
  613. return self}
  614. }),
  615. smalltalk.HLKeyBinderHelper);
  616. smalltalk.addMethod(
  617. "_renderContentOn_",
  618. smalltalk.method({
  619. selector: "renderContentOn:",
  620. fn: function (html){
  621. var self=this;
  622. var $1,$3,$2;
  623. $1=smalltalk.send(html,"_div",[]);
  624. smalltalk.send($1,"_class_",["key_helper"]);
  625. $2=smalltalk.send($1,"_with_",[(function(){
  626. smalltalk.send(self,"_renderSelectionOn_",[html]);
  627. $3=smalltalk.send(self,"_renderBindingOn_",[html]);
  628. return $3;
  629. })]);
  630. return self}
  631. }),
  632. smalltalk.HLKeyBinderHelper);
  633. smalltalk.addMethod(
  634. "_renderSelectionOn_",
  635. smalltalk.method({
  636. selector: "renderSelectionOn:",
  637. fn: function (html){
  638. var self=this;
  639. var $1,$4,$3,$2;
  640. $1=smalltalk.send(html,"_span",[]);
  641. smalltalk.send($1,"_class_",["selected"]);
  642. $4=smalltalk.send(smalltalk.send(self,"_selectedBinding",[]),"_label",[]);
  643. if(($receiver = $4) == nil || $receiver == undefined){
  644. $3="Action";
  645. } else {
  646. $3=$4;
  647. };
  648. $2=smalltalk.send($1,"_with_",[$3]);
  649. return self}
  650. }),
  651. smalltalk.HLKeyBinderHelper);
  652. smalltalk.addMethod(
  653. "_selectedBinding",
  654. smalltalk.method({
  655. selector: "selectedBinding",
  656. fn: function (){
  657. var self=this;
  658. var $1;
  659. $1=smalltalk.send(smalltalk.send(self,"_keyBinder",[]),"_selectedBinding",[]);
  660. return $1;
  661. }
  662. }),
  663. smalltalk.HLKeyBinderHelper);
  664. smalltalk.addMethod(
  665. "_show",
  666. smalltalk.method({
  667. selector: "show",
  668. fn: function (){
  669. var self=this;
  670. smalltalk.send(self,"_appendToJQuery_",[smalltalk.send("body","_asJQuery",[])]);
  671. return self}
  672. }),
  673. smalltalk.HLKeyBinderHelper);
  674. smalltalk.addMethod(
  675. "_on_",
  676. smalltalk.method({
  677. selector: "on:",
  678. fn: function (aKeyBinder){
  679. var self=this;
  680. var $2,$3,$1;
  681. $2=smalltalk.send(self,"_new",[]);
  682. smalltalk.send($2,"_keyBinder_",[aKeyBinder]);
  683. $3=smalltalk.send($2,"_yourself",[]);
  684. $1=$3;
  685. return $1;
  686. }
  687. }),
  688. smalltalk.HLKeyBinderHelper.klass);