1
0

Helios-KeyBindings.js 52 KB

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