Helios-Core.deploy.js 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346
  1. smalltalk.addPackage('Helios-Core');
  2. smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], 'Helios-Core');
  3. smalltalk.addMethod(
  4. "_activate",
  5. smalltalk.method({
  6. selector: "activate",
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx1) { _st(_st(self)._manager())._activate_(self);
  10. return self}, function($ctx1) {$ctx1.fill(self,"activate",{}, smalltalk.HLTab)})},
  11. messageSends: ["activate:", "manager"]}),
  12. smalltalk.HLTab);
  13. smalltalk.addMethod(
  14. "_add",
  15. smalltalk.method({
  16. selector: "add",
  17. fn: function (){
  18. var self=this;
  19. return smalltalk.withContext(function($ctx1) { _st(_st(self)._manager())._addTab_(self);
  20. return self}, function($ctx1) {$ctx1.fill(self,"add",{}, smalltalk.HLTab)})},
  21. messageSends: ["addTab:", "manager"]}),
  22. smalltalk.HLTab);
  23. smalltalk.addMethod(
  24. "_displayLabel",
  25. smalltalk.method({
  26. selector: "displayLabel",
  27. fn: function (){
  28. var self=this;
  29. return smalltalk.withContext(function($ctx1) { var $2,$1;
  30. $2=_st(_st(_st(self)._label())._size()).__gt((20));
  31. if(smalltalk.assert($2)){
  32. $1=_st(_st(_st(self)._label())._first_((20))).__comma("...");
  33. } else {
  34. $1=_st(self)._label();
  35. };
  36. return $1;
  37. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLTab)})},
  38. messageSends: ["ifTrue:ifFalse:", ",", "first:", "label", ">", "size"]}),
  39. smalltalk.HLTab);
  40. smalltalk.addMethod(
  41. "_focus",
  42. smalltalk.method({
  43. selector: "focus",
  44. fn: function (){
  45. var self=this;
  46. return smalltalk.withContext(function($ctx1) { var $1;
  47. $1=_st(_st(self)._widget())._canHaveFocus();
  48. if(smalltalk.assert($1)){
  49. _st(_st(self)._widget())._focus();
  50. };
  51. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLTab)})},
  52. messageSends: ["ifTrue:", "focus", "widget", "canHaveFocus"]}),
  53. smalltalk.HLTab);
  54. smalltalk.addMethod(
  55. "_isActive",
  56. smalltalk.method({
  57. selector: "isActive",
  58. fn: function (){
  59. var self=this;
  60. return smalltalk.withContext(function($ctx1) { var $1;
  61. $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
  62. return $1;
  63. }, function($ctx1) {$ctx1.fill(self,"isActive",{}, smalltalk.HLTab)})},
  64. messageSends: ["=", "activeTab", "manager"]}),
  65. smalltalk.HLTab);
  66. smalltalk.addMethod(
  67. "_label",
  68. smalltalk.method({
  69. selector: "label",
  70. fn: function (){
  71. var self=this;
  72. return smalltalk.withContext(function($ctx1) { var $2,$1;
  73. $2=self["@label"];
  74. if(($receiver = $2) == nil || $receiver == undefined){
  75. $1="";
  76. } else {
  77. $1=$2;
  78. };
  79. return $1;
  80. }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLTab)})},
  81. messageSends: ["ifNil:"]}),
  82. smalltalk.HLTab);
  83. smalltalk.addMethod(
  84. "_label_",
  85. smalltalk.method({
  86. selector: "label:",
  87. fn: function (aString){
  88. var self=this;
  89. return smalltalk.withContext(function($ctx1) { self["@label"]=aString;
  90. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString}, smalltalk.HLTab)})},
  91. messageSends: []}),
  92. smalltalk.HLTab);
  93. smalltalk.addMethod(
  94. "_manager",
  95. smalltalk.method({
  96. selector: "manager",
  97. fn: function (){
  98. var self=this;
  99. return smalltalk.withContext(function($ctx1) { var $1;
  100. $1=_st((smalltalk.HLManager || HLManager))._current();
  101. return $1;
  102. }, function($ctx1) {$ctx1.fill(self,"manager",{}, smalltalk.HLTab)})},
  103. messageSends: ["current"]}),
  104. smalltalk.HLTab);
  105. smalltalk.addMethod(
  106. "_widget",
  107. smalltalk.method({
  108. selector: "widget",
  109. fn: function (){
  110. var self=this;
  111. return smalltalk.withContext(function($ctx1) { var $1;
  112. $1=self["@widget"];
  113. return $1;
  114. }, function($ctx1) {$ctx1.fill(self,"widget",{}, smalltalk.HLTab)})},
  115. messageSends: []}),
  116. smalltalk.HLTab);
  117. smalltalk.addMethod(
  118. "_widget_",
  119. smalltalk.method({
  120. selector: "widget:",
  121. fn: function (aWidget){
  122. var self=this;
  123. return smalltalk.withContext(function($ctx1) { self["@widget"]=aWidget;
  124. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget}, smalltalk.HLTab)})},
  125. messageSends: []}),
  126. smalltalk.HLTab);
  127. smalltalk.addMethod(
  128. "_on_labelled_",
  129. smalltalk.method({
  130. selector: "on:labelled:",
  131. fn: function (aWidget,aString){
  132. var self=this;
  133. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  134. $2=_st(self)._new();
  135. _st($2)._widget_(aWidget);
  136. _st($2)._label_(aString);
  137. $3=_st($2)._yourself();
  138. $1=$3;
  139. return $1;
  140. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString}, smalltalk.HLTab.klass)})},
  141. messageSends: ["widget:", "new", "label:", "yourself"]}),
  142. smalltalk.HLTab.klass);
  143. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  144. smalltalk.addMethod(
  145. "_alert_",
  146. smalltalk.method({
  147. selector: "alert:",
  148. fn: function (aString){
  149. var self=this;
  150. return smalltalk.withContext(function($ctx1) { _st(window)._alert_(aString);
  151. return self}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString}, smalltalk.HLWidget)})},
  152. messageSends: ["alert:"]}),
  153. smalltalk.HLWidget);
  154. smalltalk.addMethod(
  155. "_canHaveFocus",
  156. smalltalk.method({
  157. selector: "canHaveFocus",
  158. fn: function (){
  159. var self=this;
  160. return smalltalk.withContext(function($ctx1) { return false;
  161. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWidget)})},
  162. messageSends: []}),
  163. smalltalk.HLWidget);
  164. smalltalk.addMethod(
  165. "_confirm_",
  166. smalltalk.method({
  167. selector: "confirm:",
  168. fn: function (aString){
  169. var self=this;
  170. return smalltalk.withContext(function($ctx1) { var $1;
  171. $1=_st(window)._confirm_(aString);
  172. return $1;
  173. }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString}, smalltalk.HLWidget)})},
  174. messageSends: ["confirm:"]}),
  175. smalltalk.HLWidget);
  176. smalltalk.addMethod(
  177. "_manager",
  178. smalltalk.method({
  179. selector: "manager",
  180. fn: function (){
  181. var self=this;
  182. return smalltalk.withContext(function($ctx1) { var $1;
  183. $1=_st((smalltalk.HLManager || HLManager))._current();
  184. return $1;
  185. }, function($ctx1) {$ctx1.fill(self,"manager",{}, smalltalk.HLWidget)})},
  186. messageSends: ["current"]}),
  187. smalltalk.HLWidget);
  188. smalltalk.addMethod(
  189. "_refresh",
  190. smalltalk.method({
  191. selector: "refresh",
  192. fn: function (){
  193. var self=this;
  194. return smalltalk.withContext(function($ctx1) { var $1,$2;
  195. $1=_st(self)._wrapper();
  196. if(($receiver = $1) == nil || $receiver == undefined){
  197. $2=self;
  198. return $2;
  199. } else {
  200. $1;
  201. };
  202. _st(_st(_st(self)._wrapper())._asJQuery())._empty();
  203. _st((function(html){
  204. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(html);
  205. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(self)._wrapper())._asJQuery());
  206. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLWidget)})},
  207. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"]}),
  208. smalltalk.HLWidget);
  209. smalltalk.addMethod(
  210. "_registerBindings",
  211. smalltalk.method({
  212. selector: "registerBindings",
  213. fn: function (){
  214. var self=this;
  215. return smalltalk.withContext(function($ctx1) { _st(self)._registerBindingsOn_(_st(_st(_st(self)._manager())._keyBinder())._bindings());
  216. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{}, smalltalk.HLWidget)})},
  217. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"]}),
  218. smalltalk.HLWidget);
  219. smalltalk.addMethod(
  220. "_registerBindingsOn_",
  221. smalltalk.method({
  222. selector: "registerBindingsOn:",
  223. fn: function (aBindingGroup){
  224. var self=this;
  225. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup}, smalltalk.HLWidget)})},
  226. messageSends: []}),
  227. smalltalk.HLWidget);
  228. smalltalk.addMethod(
  229. "_renderContentOn_",
  230. smalltalk.method({
  231. selector: "renderContentOn:",
  232. fn: function (html){
  233. var self=this;
  234. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLWidget)})},
  235. messageSends: []}),
  236. smalltalk.HLWidget);
  237. smalltalk.addMethod(
  238. "_renderOn_",
  239. smalltalk.method({
  240. selector: "renderOn:",
  241. fn: function (html){
  242. var self=this;
  243. return smalltalk.withContext(function($ctx1) { _st(self)._registerBindings();
  244. self["@wrapper"]=_st(html)._div();
  245. _st((function(renderer){
  246. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(renderer);
  247. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  248. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLWidget)})},
  249. messageSends: ["registerBindings", "div", "appendToJQuery:", "asJQuery", "renderContentOn:"]}),
  250. smalltalk.HLWidget);
  251. smalltalk.addMethod(
  252. "_wrapper",
  253. smalltalk.method({
  254. selector: "wrapper",
  255. fn: function (){
  256. var self=this;
  257. return smalltalk.withContext(function($ctx1) { var $1;
  258. $1=self["@wrapper"];
  259. return $1;
  260. }, function($ctx1) {$ctx1.fill(self,"wrapper",{}, smalltalk.HLWidget)})},
  261. messageSends: []}),
  262. smalltalk.HLWidget);
  263. smalltalk.addMethod(
  264. "_canBeOpenAsTab",
  265. smalltalk.method({
  266. selector: "canBeOpenAsTab",
  267. fn: function (){
  268. var self=this;
  269. return smalltalk.withContext(function($ctx1) { return false;
  270. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLWidget.klass)})},
  271. messageSends: []}),
  272. smalltalk.HLWidget.klass);
  273. smalltalk.addMethod(
  274. "_openAsTab",
  275. smalltalk.method({
  276. selector: "openAsTab",
  277. fn: function (){
  278. var self=this;
  279. return smalltalk.withContext(function($ctx1) { var $1,$2;
  280. $1=_st(self)._canBeOpenAsTab();
  281. if(! smalltalk.assert($1)){
  282. $2=self;
  283. return $2;
  284. };
  285. _st(_st((smalltalk.HLManager || HLManager))._current())._addTab_(_st((smalltalk.HLTab || HLTab))._on_labelled_(_st(self)._new(),_st(self)._tabLabel()));
  286. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{}, smalltalk.HLWidget.klass)})},
  287. messageSends: ["ifFalse:", "canBeOpenAsTab", "addTab:", "on:labelled:", "new", "tabLabel", "current"]}),
  288. smalltalk.HLWidget.klass);
  289. smalltalk.addMethod(
  290. "_tabLabel",
  291. smalltalk.method({
  292. selector: "tabLabel",
  293. fn: function (){
  294. var self=this;
  295. return smalltalk.withContext(function($ctx1) { return "Tab";
  296. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLWidget.klass)})},
  297. messageSends: []}),
  298. smalltalk.HLWidget.klass);
  299. smalltalk.addMethod(
  300. "_tabPriority",
  301. smalltalk.method({
  302. selector: "tabPriority",
  303. fn: function (){
  304. var self=this;
  305. return smalltalk.withContext(function($ctx1) { return (500);
  306. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLWidget.klass)})},
  307. messageSends: []}),
  308. smalltalk.HLWidget.klass);
  309. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  310. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, ['hiddenInput'], 'Helios-Core');
  311. smalltalk.addMethod(
  312. "_blur",
  313. smalltalk.method({
  314. selector: "blur",
  315. fn: function (){
  316. var self=this;
  317. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._blur();
  318. return self}, function($ctx1) {$ctx1.fill(self,"blur",{}, smalltalk.HLFocusableWidget)})},
  319. messageSends: ["blur", "asJQuery"]}),
  320. smalltalk.HLFocusableWidget);
  321. smalltalk.addMethod(
  322. "_canHaveFocus",
  323. smalltalk.method({
  324. selector: "canHaveFocus",
  325. fn: function (){
  326. var self=this;
  327. return smalltalk.withContext(function($ctx1) { return true;
  328. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLFocusableWidget)})},
  329. messageSends: []}),
  330. smalltalk.HLFocusableWidget);
  331. smalltalk.addMethod(
  332. "_focus",
  333. smalltalk.method({
  334. selector: "focus",
  335. fn: function (){
  336. var self=this;
  337. return smalltalk.withContext(function($ctx1) { _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  338. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLFocusableWidget)})},
  339. messageSends: ["focus", "asJQuery"]}),
  340. smalltalk.HLFocusableWidget);
  341. smalltalk.addMethod(
  342. "_focusClass",
  343. smalltalk.method({
  344. selector: "focusClass",
  345. fn: function (){
  346. var self=this;
  347. return smalltalk.withContext(function($ctx1) { return "focused";
  348. }, function($ctx1) {$ctx1.fill(self,"focusClass",{}, smalltalk.HLFocusableWidget)})},
  349. messageSends: []}),
  350. smalltalk.HLFocusableWidget);
  351. smalltalk.addMethod(
  352. "_hasFocus",
  353. smalltalk.method({
  354. selector: "hasFocus",
  355. fn: function (){
  356. var self=this;
  357. return smalltalk.withContext(function($ctx1) { var $1;
  358. $1=_st(_st(_st(self)._wrapper())._notNil())._and_((function(){
  359. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  360. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  361. return $1;
  362. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{}, smalltalk.HLFocusableWidget)})},
  363. messageSends: ["and:", "hasClass:", "focusClass", "asJQuery", "wrapper", "notNil"]}),
  364. smalltalk.HLFocusableWidget);
  365. smalltalk.addMethod(
  366. "_renderContentOn_",
  367. smalltalk.method({
  368. selector: "renderContentOn:",
  369. fn: function (html){
  370. var self=this;
  371. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  372. messageSends: []}),
  373. smalltalk.HLFocusableWidget);
  374. smalltalk.addMethod(
  375. "_renderHiddenInputOn_",
  376. smalltalk.method({
  377. selector: "renderHiddenInputOn:",
  378. fn: function (html){
  379. var self=this;
  380. return smalltalk.withContext(function($ctx1) { var $1,$2;
  381. $1=_st(html)._input();
  382. _st($1)._style_("position: absolute; left: -100000px;");
  383. _st($1)._onBlur_((function(){
  384. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._removeClass_(_st(self)._focusClass());
  385. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  386. $2=_st($1)._onFocus_((function(){
  387. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._wrapper())._asJQuery())._addClass_(_st(self)._focusClass());
  388. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  389. self["@hiddenInput"]=$2;
  390. return self}, function($ctx1) {$ctx1.fill(self,"renderHiddenInputOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  391. messageSends: ["style:", "input", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"]}),
  392. smalltalk.HLFocusableWidget);
  393. smalltalk.addMethod(
  394. "_renderOn_",
  395. smalltalk.method({
  396. selector: "renderOn:",
  397. fn: function (html){
  398. var self=this;
  399. return smalltalk.withContext(function($ctx1) { var $1,$2;
  400. _st(self)._registerBindings();
  401. _st(self)._renderHiddenInputOn_(html);
  402. $1=_st(html)._div();
  403. _st($1)._class_("hl_widget");
  404. _st($1)._onClick_((function(){
  405. return smalltalk.withContext(function($ctx2) { return _st(_st(self["@hiddenInput"])._asJQuery())._focus();
  406. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  407. $2=_st($1)._with_((function(){
  408. return smalltalk.withContext(function($ctx2) { return _st(self)._renderContentOn_(html);
  409. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  410. self["@wrapper"]=$2;
  411. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.HLFocusableWidget)})},
  412. messageSends: ["registerBindings", "renderHiddenInputOn:", "class:", "div", "onClick:", "focus", "asJQuery", "with:", "renderContentOn:"]}),
  413. smalltalk.HLFocusableWidget);
  414. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem'], 'Helios-Core');
  415. smalltalk.addMethod(
  416. "_activateFirstListItem",
  417. smalltalk.method({
  418. selector: "activateFirstListItem",
  419. fn: function (){
  420. var self=this;
  421. return smalltalk.withContext(function($ctx1) { _st(self)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li"))._get_((0))));
  422. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{}, smalltalk.HLListWidget)})},
  423. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"]}),
  424. smalltalk.HLListWidget);
  425. smalltalk.addMethod(
  426. "_activateListItem_",
  427. smalltalk.method({
  428. selector: "activateListItem:",
  429. fn: function (aListItem){
  430. var self=this;
  431. var parent,position;
  432. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  433. $1=_st(aListItem)._get_((0));
  434. if(($receiver = $1) == nil || $receiver == undefined){
  435. $2=self;
  436. return $2;
  437. } else {
  438. $1;
  439. };
  440. position=_st(self)._positionOf_(aListItem);
  441. parent=_st(aListItem)._parent();
  442. _st(_st(parent)._children())._removeClass_("active");
  443. _st(aListItem)._addClass_("active");
  444. $3=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  445. if(smalltalk.assert($3)){
  446. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  447. };
  448. $4=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  449. if(smalltalk.assert($4)){
  450. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(aListItem)._height())).__minus(_st(_st(parent)._height()).__minus(_st(_st(aListItem)._position())._top()))).__plus((10)));
  451. };
  452. _st(self)._selectItem_(_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber()));
  453. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,parent:parent,position:position}, smalltalk.HLListWidget)})},
  454. messageSends: ["ifNil:", "get:", "positionOf:", "parent", "removeClass:", "children", "addClass:", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "<", "height", ">", "selectItem:", "at:", "asNumber", "attr:", "items"]}),
  455. smalltalk.HLListWidget);
  456. smalltalk.addMethod(
  457. "_cssClassForItem_",
  458. smalltalk.method({
  459. selector: "cssClassForItem:",
  460. fn: function (anObject){
  461. var self=this;
  462. return smalltalk.withContext(function($ctx1) { var $2,$1;
  463. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  464. if(smalltalk.assert($2)){
  465. $1="active";
  466. } else {
  467. $1="inactive";
  468. };
  469. return $1;
  470. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  471. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"]}),
  472. smalltalk.HLListWidget);
  473. smalltalk.addMethod(
  474. "_defaultItems",
  475. smalltalk.method({
  476. selector: "defaultItems",
  477. fn: function (){
  478. var self=this;
  479. return smalltalk.withContext(function($ctx1) { return [];
  480. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{}, smalltalk.HLListWidget)})},
  481. messageSends: []}),
  482. smalltalk.HLListWidget);
  483. smalltalk.addMethod(
  484. "_focus",
  485. smalltalk.method({
  486. selector: "focus",
  487. fn: function (){
  488. var self=this;
  489. return smalltalk.withContext(function($ctx1) { var $1,$2;
  490. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  491. $1=_st(_st(self)._items())._isEmpty();
  492. if(! smalltalk.assert($1)){
  493. $2=_st(self)._selectedItem();
  494. if(($receiver = $2) == nil || $receiver == undefined){
  495. _st(self)._activateFirstListItem();
  496. } else {
  497. $2;
  498. };
  499. };
  500. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLListWidget)})},
  501. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"]}),
  502. smalltalk.HLListWidget);
  503. smalltalk.addMethod(
  504. "_iconForItem_",
  505. smalltalk.method({
  506. selector: "iconForItem:",
  507. fn: function (anObject){
  508. var self=this;
  509. return smalltalk.withContext(function($ctx1) { return "";
  510. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  511. messageSends: []}),
  512. smalltalk.HLListWidget);
  513. smalltalk.addMethod(
  514. "_items",
  515. smalltalk.method({
  516. selector: "items",
  517. fn: function (){
  518. var self=this;
  519. return smalltalk.withContext(function($ctx1) { var $2,$1;
  520. $2=self["@items"];
  521. if(($receiver = $2) == nil || $receiver == undefined){
  522. self["@items"]=_st(self)._defaultItems();
  523. $1=self["@items"];
  524. } else {
  525. $1=$2;
  526. };
  527. return $1;
  528. }, function($ctx1) {$ctx1.fill(self,"items",{}, smalltalk.HLListWidget)})},
  529. messageSends: ["ifNil:", "defaultItems"]}),
  530. smalltalk.HLListWidget);
  531. smalltalk.addMethod(
  532. "_items_",
  533. smalltalk.method({
  534. selector: "items:",
  535. fn: function (aCollection){
  536. var self=this;
  537. return smalltalk.withContext(function($ctx1) { self["@items"]=aCollection;
  538. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection}, smalltalk.HLListWidget)})},
  539. messageSends: []}),
  540. smalltalk.HLListWidget);
  541. smalltalk.addMethod(
  542. "_positionOf_",
  543. smalltalk.method({
  544. selector: "positionOf:",
  545. fn: function (aListItem){
  546. var self=this;
  547. return smalltalk.withContext(function($ctx1) {
  548. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  549. ;
  550. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem}, smalltalk.HLListWidget)})},
  551. messageSends: []}),
  552. smalltalk.HLListWidget);
  553. smalltalk.addMethod(
  554. "_renderButtonsOn_",
  555. smalltalk.method({
  556. selector: "renderButtonsOn:",
  557. fn: function (html){
  558. var self=this;
  559. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html}, smalltalk.HLListWidget)})},
  560. messageSends: []}),
  561. smalltalk.HLListWidget);
  562. smalltalk.addMethod(
  563. "_renderContentOn_",
  564. smalltalk.method({
  565. selector: "renderContentOn:",
  566. fn: function (html){
  567. var self=this;
  568. return smalltalk.withContext(function($ctx1) { var $1,$2,$3,$4;
  569. $1=_st(html)._ul();
  570. _st($1)._class_("nav nav-pills nav-stacked");
  571. $2=_st($1)._with_((function(){
  572. return smalltalk.withContext(function($ctx2) { return _st(self)._renderListOn_(html);
  573. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  574. $3=_st(html)._div();
  575. _st($3)._class_("pane_actions form-actions");
  576. $4=_st($3)._with_((function(){
  577. return smalltalk.withContext(function($ctx2) { return _st(self)._renderButtonsOn_(html);
  578. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  579. _st(self)._setupKeyBindings();
  580. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLListWidget)})},
  581. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"]}),
  582. smalltalk.HLListWidget);
  583. smalltalk.addMethod(
  584. "_renderItem_on_",
  585. smalltalk.method({
  586. selector: "renderItem:on:",
  587. fn: function (anObject,html){
  588. var self=this;
  589. var li;
  590. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  591. li=_st(html)._li();
  592. $1=li;
  593. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  594. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  595. $2=_st($1)._with_((function(){
  596. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  597. _st($3)._with_((function(){
  598. return smalltalk.withContext(function($ctx3) { _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  599. return _st(self)._renderItemLabel_on_(anObject,html);
  600. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  601. $4=_st($3)._onClick_((function(){
  602. return smalltalk.withContext(function($ctx3) { return _st(self)._activateListItem_(_st(li)._asJQuery());
  603. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  604. return $4;
  605. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  606. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li}, smalltalk.HLListWidget)})},
  607. messageSends: ["li", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"]}),
  608. smalltalk.HLListWidget);
  609. smalltalk.addMethod(
  610. "_renderItemLabel_on_",
  611. smalltalk.method({
  612. selector: "renderItemLabel:on:",
  613. fn: function (anObject,html){
  614. var self=this;
  615. return smalltalk.withContext(function($ctx1) { _st(html)._with_(_st(anObject)._asString());
  616. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html}, smalltalk.HLListWidget)})},
  617. messageSends: ["with:", "asString"]}),
  618. smalltalk.HLListWidget);
  619. smalltalk.addMethod(
  620. "_renderListOn_",
  621. smalltalk.method({
  622. selector: "renderListOn:",
  623. fn: function (html){
  624. var self=this;
  625. return smalltalk.withContext(function($ctx1) { _st(_st(self)._items())._do_((function(each){
  626. return smalltalk.withContext(function($ctx2) { return _st(self)._renderItem_on_(each,html);
  627. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  628. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html}, smalltalk.HLListWidget)})},
  629. messageSends: ["do:", "renderItem:on:", "items"]}),
  630. smalltalk.HLListWidget);
  631. smalltalk.addMethod(
  632. "_selectItem_",
  633. smalltalk.method({
  634. selector: "selectItem:",
  635. fn: function (anObject){
  636. var self=this;
  637. return smalltalk.withContext(function($ctx1) { _st(self)._selectedItem_(anObject);
  638. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  639. messageSends: ["selectedItem:"]}),
  640. smalltalk.HLListWidget);
  641. smalltalk.addMethod(
  642. "_selectedItem",
  643. smalltalk.method({
  644. selector: "selectedItem",
  645. fn: function (){
  646. var self=this;
  647. return smalltalk.withContext(function($ctx1) { var $1;
  648. $1=self["@selectedItem"];
  649. return $1;
  650. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{}, smalltalk.HLListWidget)})},
  651. messageSends: []}),
  652. smalltalk.HLListWidget);
  653. smalltalk.addMethod(
  654. "_selectedItem_",
  655. smalltalk.method({
  656. selector: "selectedItem:",
  657. fn: function (anObject){
  658. var self=this;
  659. return smalltalk.withContext(function($ctx1) { self["@selectedItem"]=anObject;
  660. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject}, smalltalk.HLListWidget)})},
  661. messageSends: []}),
  662. smalltalk.HLListWidget);
  663. smalltalk.addMethod(
  664. "_setupKeyBindings",
  665. smalltalk.method({
  666. selector: "setupKeyBindings",
  667. fn: function (){
  668. var self=this;
  669. var next;
  670. return smalltalk.withContext(function($ctx1) { var $1,$2,$3;
  671. _st(_st(self["@hiddenInput"])._asJQuery())._unbind_("keydown");
  672. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  673. var selected;
  674. return smalltalk.withContext(function($ctx2) { selected=_st(window)._jQuery_(".focused .nav-pills .active");
  675. selected;
  676. $1=_st(_st(e)._which()).__eq((38));
  677. if(smalltalk.assert($1)){
  678. _st(self)._activateListItem_(_st(selected)._prev());
  679. };
  680. $2=_st(_st(e)._which()).__eq((40));
  681. if(smalltalk.assert($2)){
  682. next=_st(selected)._next();
  683. next;
  684. $3=_st(next)._get_((0));
  685. if(($receiver = $3) == nil || $receiver == undefined){
  686. next=_st(window)._jQuery_(".focused .nav-pills li:first-child");
  687. next;
  688. } else {
  689. $3;
  690. };
  691. return _st(self)._activateListItem_(next);
  692. };
  693. }, function($ctx2) {$ctx2.fillBlock({e:e,selected:selected},$ctx1)})}));
  694. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{next:next}, smalltalk.HLListWidget)})},
  695. messageSends: ["unbind:", "asJQuery", "keydown:", "jQuery:", "ifTrue:", "activateListItem:", "prev", "=", "which", "next", "ifNil:", "get:"]}),
  696. smalltalk.HLListWidget);
  697. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  698. smalltalk.addMethod(
  699. "_next",
  700. smalltalk.method({
  701. selector: "next",
  702. fn: function (){
  703. var self=this;
  704. return smalltalk.withContext(function($ctx1) { var $1;
  705. $1=self["@next"];
  706. return $1;
  707. }, function($ctx1) {$ctx1.fill(self,"next",{}, smalltalk.HLNavigationListWidget)})},
  708. messageSends: []}),
  709. smalltalk.HLNavigationListWidget);
  710. smalltalk.addMethod(
  711. "_next_",
  712. smalltalk.method({
  713. selector: "next:",
  714. fn: function (aWidget){
  715. var self=this;
  716. return smalltalk.withContext(function($ctx1) { var $1;
  717. self["@next"]=aWidget;
  718. $1=_st(_st(aWidget)._previous()).__eq(self);
  719. if(! smalltalk.assert($1)){
  720. _st(aWidget)._previous_(self);
  721. };
  722. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  723. messageSends: ["ifFalse:", "previous:", "=", "previous"]}),
  724. smalltalk.HLNavigationListWidget);
  725. smalltalk.addMethod(
  726. "_nextFocus",
  727. smalltalk.method({
  728. selector: "nextFocus",
  729. fn: function (){
  730. var self=this;
  731. return smalltalk.withContext(function($ctx1) { var $1;
  732. $1=_st(self)._next();
  733. if(($receiver = $1) == nil || $receiver == undefined){
  734. $1;
  735. } else {
  736. _st(_st(self)._next())._focus();
  737. };
  738. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{}, smalltalk.HLNavigationListWidget)})},
  739. messageSends: ["ifNotNil:", "focus", "next"]}),
  740. smalltalk.HLNavigationListWidget);
  741. smalltalk.addMethod(
  742. "_previous",
  743. smalltalk.method({
  744. selector: "previous",
  745. fn: function (){
  746. var self=this;
  747. return smalltalk.withContext(function($ctx1) { var $1;
  748. $1=self["@previous"];
  749. return $1;
  750. }, function($ctx1) {$ctx1.fill(self,"previous",{}, smalltalk.HLNavigationListWidget)})},
  751. messageSends: []}),
  752. smalltalk.HLNavigationListWidget);
  753. smalltalk.addMethod(
  754. "_previous_",
  755. smalltalk.method({
  756. selector: "previous:",
  757. fn: function (aWidget){
  758. var self=this;
  759. return smalltalk.withContext(function($ctx1) { var $1;
  760. self["@previous"]=aWidget;
  761. $1=_st(_st(aWidget)._next()).__eq(self);
  762. if(! smalltalk.assert($1)){
  763. _st(aWidget)._next_(self);
  764. };
  765. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget}, smalltalk.HLNavigationListWidget)})},
  766. messageSends: ["ifFalse:", "next:", "=", "next"]}),
  767. smalltalk.HLNavigationListWidget);
  768. smalltalk.addMethod(
  769. "_previousFocus",
  770. smalltalk.method({
  771. selector: "previousFocus",
  772. fn: function (){
  773. var self=this;
  774. return smalltalk.withContext(function($ctx1) { var $1;
  775. $1=_st(self)._previous();
  776. if(($receiver = $1) == nil || $receiver == undefined){
  777. $1;
  778. } else {
  779. _st(_st(self)._previous())._focus();
  780. };
  781. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{}, smalltalk.HLNavigationListWidget)})},
  782. messageSends: ["ifNotNil:", "focus", "previous"]}),
  783. smalltalk.HLNavigationListWidget);
  784. smalltalk.addMethod(
  785. "_setupKeyBindings",
  786. smalltalk.method({
  787. selector: "setupKeyBindings",
  788. fn: function (){
  789. var self=this;
  790. return smalltalk.withContext(function($ctx1) { var $1,$2;
  791. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  792. _st(_st(self["@hiddenInput"])._asJQuery())._keydown_((function(e){
  793. return smalltalk.withContext(function($ctx2) { $1=_st(_st(e)._which()).__eq((39));
  794. if(smalltalk.assert($1)){
  795. _st(self)._nextFocus();
  796. };
  797. $2=_st(_st(e)._which()).__eq((37));
  798. if(smalltalk.assert($2)){
  799. return _st(self)._previousFocus();
  800. };
  801. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  802. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{}, smalltalk.HLNavigationListWidget)})},
  803. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery"]}),
  804. smalltalk.HLNavigationListWidget);
  805. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  806. smalltalk.addMethod(
  807. "_activate_",
  808. smalltalk.method({
  809. selector: "activate:",
  810. fn: function (aTab){
  811. var self=this;
  812. return smalltalk.withContext(function($ctx1) { var $1,$2;
  813. _st(_st(self)._keyBinder())._flushBindings();
  814. self["@activeTab"]=aTab;
  815. $1=self;
  816. _st($1)._refresh();
  817. _st($1)._addToHistory_(aTab);
  818. $2=_st($1)._show_(aTab);
  819. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab}, smalltalk.HLManager)})},
  820. messageSends: ["flushBindings", "keyBinder", "refresh", "addToHistory:", "show:"]}),
  821. smalltalk.HLManager);
  822. smalltalk.addMethod(
  823. "_activeTab",
  824. smalltalk.method({
  825. selector: "activeTab",
  826. fn: function (){
  827. var self=this;
  828. return smalltalk.withContext(function($ctx1) { var $1;
  829. $1=self["@activeTab"];
  830. return $1;
  831. }, function($ctx1) {$ctx1.fill(self,"activeTab",{}, smalltalk.HLManager)})},
  832. messageSends: []}),
  833. smalltalk.HLManager);
  834. smalltalk.addMethod(
  835. "_addTab_",
  836. smalltalk.method({
  837. selector: "addTab:",
  838. fn: function (aTab){
  839. var self=this;
  840. return smalltalk.withContext(function($ctx1) { _st(_st(self)._tabs())._add_(aTab);
  841. _st(self)._activate_(aTab);
  842. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab}, smalltalk.HLManager)})},
  843. messageSends: ["add:", "tabs", "activate:"]}),
  844. smalltalk.HLManager);
  845. smalltalk.addMethod(
  846. "_addToHistory_",
  847. smalltalk.method({
  848. selector: "addToHistory:",
  849. fn: function (aTab){
  850. var self=this;
  851. return smalltalk.withContext(function($ctx1) { _st(self)._removeFromHistory_(aTab);
  852. _st(_st(self)._history())._add_(aTab);
  853. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab}, smalltalk.HLManager)})},
  854. messageSends: ["removeFromHistory:", "add:", "history"]}),
  855. smalltalk.HLManager);
  856. smalltalk.addMethod(
  857. "_defaultEnvironment",
  858. smalltalk.method({
  859. selector: "defaultEnvironment",
  860. fn: function (){
  861. var self=this;
  862. return smalltalk.withContext(function($ctx1) { var $1;
  863. $1=_st((smalltalk.HLLocalEnvironment || HLLocalEnvironment))._new();
  864. return $1;
  865. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{}, smalltalk.HLManager)})},
  866. messageSends: ["new"]}),
  867. smalltalk.HLManager);
  868. smalltalk.addMethod(
  869. "_environment",
  870. smalltalk.method({
  871. selector: "environment",
  872. fn: function (){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx1) { var $2,$1;
  875. $2=self["@environment"];
  876. if(($receiver = $2) == nil || $receiver == undefined){
  877. self["@environment"]=_st(self)._defaultEnvironment();
  878. $1=self["@environment"];
  879. } else {
  880. $1=$2;
  881. };
  882. return $1;
  883. }, function($ctx1) {$ctx1.fill(self,"environment",{}, smalltalk.HLManager)})},
  884. messageSends: ["ifNil:", "defaultEnvironment"]}),
  885. smalltalk.HLManager);
  886. smalltalk.addMethod(
  887. "_environment_",
  888. smalltalk.method({
  889. selector: "environment:",
  890. fn: function (anEnvironment){
  891. var self=this;
  892. return smalltalk.withContext(function($ctx1) { self["@environment"]=anEnvironment;
  893. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment}, smalltalk.HLManager)})},
  894. messageSends: []}),
  895. smalltalk.HLManager);
  896. smalltalk.addMethod(
  897. "_history",
  898. smalltalk.method({
  899. selector: "history",
  900. fn: function (){
  901. var self=this;
  902. return smalltalk.withContext(function($ctx1) { var $2,$1;
  903. $2=self["@history"];
  904. if(($receiver = $2) == nil || $receiver == undefined){
  905. self["@history"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  906. $1=self["@history"];
  907. } else {
  908. $1=$2;
  909. };
  910. return $1;
  911. }, function($ctx1) {$ctx1.fill(self,"history",{}, smalltalk.HLManager)})},
  912. messageSends: ["ifNil:", "new"]}),
  913. smalltalk.HLManager);
  914. smalltalk.addMethod(
  915. "_history_",
  916. smalltalk.method({
  917. selector: "history:",
  918. fn: function (aCollection){
  919. var self=this;
  920. return smalltalk.withContext(function($ctx1) { self["@history"]=aCollection;
  921. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection}, smalltalk.HLManager)})},
  922. messageSends: []}),
  923. smalltalk.HLManager);
  924. smalltalk.addMethod(
  925. "_initialize",
  926. smalltalk.method({
  927. selector: "initialize",
  928. fn: function (){
  929. var self=this;
  930. return smalltalk.withContext(function($ctx1) { smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  931. _st(_st(self)._keyBinder())._setupEvents();
  932. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager)})},
  933. messageSends: ["initialize", "setupEvents", "keyBinder"]}),
  934. smalltalk.HLManager);
  935. smalltalk.addMethod(
  936. "_keyBinder",
  937. smalltalk.method({
  938. selector: "keyBinder",
  939. fn: function (){
  940. var self=this;
  941. return smalltalk.withContext(function($ctx1) { var $2,$1;
  942. $2=self["@keyBinder"];
  943. if(($receiver = $2) == nil || $receiver == undefined){
  944. self["@keyBinder"]=_st((smalltalk.HLKeyBinder || HLKeyBinder))._new();
  945. $1=self["@keyBinder"];
  946. } else {
  947. $1=$2;
  948. };
  949. return $1;
  950. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{}, smalltalk.HLManager)})},
  951. messageSends: ["ifNil:", "new"]}),
  952. smalltalk.HLManager);
  953. smalltalk.addMethod(
  954. "_refresh",
  955. smalltalk.method({
  956. selector: "refresh",
  957. fn: function (){
  958. var self=this;
  959. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_(".navbar"))._remove();
  960. _st(_st(window)._jQuery_("#container"))._remove();
  961. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  962. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{}, smalltalk.HLManager)})},
  963. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"]}),
  964. smalltalk.HLManager);
  965. smalltalk.addMethod(
  966. "_removeActiveTab",
  967. smalltalk.method({
  968. selector: "removeActiveTab",
  969. fn: function (){
  970. var self=this;
  971. return smalltalk.withContext(function($ctx1) { _st(self)._removeTab_(_st(self)._activeTab());
  972. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{}, smalltalk.HLManager)})},
  973. messageSends: ["removeTab:", "activeTab"]}),
  974. smalltalk.HLManager);
  975. smalltalk.addMethod(
  976. "_removeFromHistory_",
  977. smalltalk.method({
  978. selector: "removeFromHistory:",
  979. fn: function (aTab){
  980. var self=this;
  981. return smalltalk.withContext(function($ctx1) { _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  982. return smalltalk.withContext(function($ctx2) { return _st(each).__eq_eq(aTab);
  983. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  984. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab}, smalltalk.HLManager)})},
  985. messageSends: ["history:", "reject:", "==", "history"]}),
  986. smalltalk.HLManager);
  987. smalltalk.addMethod(
  988. "_removeTab_",
  989. smalltalk.method({
  990. selector: "removeTab:",
  991. fn: function (aTab){
  992. var self=this;
  993. return smalltalk.withContext(function($ctx1) { var $1,$2;
  994. $1=_st(_st(self)._tabs())._includes_(aTab);
  995. if(! smalltalk.assert($1)){
  996. $2=self;
  997. return $2;
  998. };
  999. _st(self)._removeFromHistory_(aTab);
  1000. _st(_st(self)._tabs())._remove_(aTab);
  1001. _st(_st(self)._keyBinder())._flushBindings();
  1002. _st(self)._refresh();
  1003. _st(_st(self)._history())._ifNotEmpty_((function(){
  1004. return smalltalk.withContext(function($ctx2) { return _st(_st(_st(self)._history())._last())._activate();
  1005. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1006. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  1007. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "refresh", "ifNotEmpty:", "activate", "last", "history"]}),
  1008. smalltalk.HLManager);
  1009. smalltalk.addMethod(
  1010. "_renderAddOn_",
  1011. smalltalk.method({
  1012. selector: "renderAddOn:",
  1013. fn: function (html){
  1014. var self=this;
  1015. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$5,$7,$8,$6,$2;
  1016. $1=_st(html)._li();
  1017. _st($1)._class_("dropdown");
  1018. $2=_st($1)._with_((function(){
  1019. return smalltalk.withContext(function($ctx2) { $3=_st(html)._a();
  1020. _st($3)._class_("dropdown-toggle");
  1021. _st($3)._at_put_("data-toggle","dropdown");
  1022. $4=_st($3)._with_((function(){
  1023. return smalltalk.withContext(function($ctx3) { _st(html)._with_("Open...");
  1024. return _st(_st(html)._tag_("b"))._class_("caret");
  1025. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1026. $4;
  1027. $5=_st(html)._ul();
  1028. _st($5)._class_("dropdown-menu");
  1029. $6=_st($5)._with_((function(){
  1030. return smalltalk.withContext(function($ctx3) { return _st(_st(_st(_st((smalltalk.HLWidget || HLWidget))._withAllSubclasses())._select_((function(each){
  1031. return smalltalk.withContext(function($ctx4) { return _st(each)._canBeOpenAsTab();
  1032. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  1033. return smalltalk.withContext(function($ctx4) { return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  1034. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  1035. return smalltalk.withContext(function($ctx4) { return _st(_st(html)._li())._with_((function(){
  1036. return smalltalk.withContext(function($ctx5) { $7=_st(html)._a();
  1037. _st($7)._with_(_st(each)._tabLabel());
  1038. $8=_st($7)._onClick_((function(){
  1039. return smalltalk.withContext(function($ctx6) { return _st(each)._openAsTab();
  1040. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1041. return $8;
  1042. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1043. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  1044. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1045. return $6;
  1046. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1047. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html}, smalltalk.HLManager)})},
  1048. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"]}),
  1049. smalltalk.HLManager);
  1050. smalltalk.addMethod(
  1051. "_renderContentOn_",
  1052. smalltalk.method({
  1053. selector: "renderContentOn:",
  1054. fn: function (html){
  1055. var self=this;
  1056. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$2;
  1057. $1=_st(html)._div();
  1058. _st($1)._class_("navbar navbar-fixed-top");
  1059. $2=_st($1)._with_((function(){
  1060. return smalltalk.withContext(function($ctx2) { $3=_st(html)._div();
  1061. _st($3)._class_("navbar-inner");
  1062. $4=_st($3)._with_((function(){
  1063. return smalltalk.withContext(function($ctx3) { return _st(self)._renderTabsOn_(html);
  1064. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1065. return $4;
  1066. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1067. _st(_st(html)._div())._id_("container");
  1068. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLManager)})},
  1069. messageSends: ["class:", "div", "with:", "renderTabsOn:", "id:"]}),
  1070. smalltalk.HLManager);
  1071. smalltalk.addMethod(
  1072. "_renderTabsOn_",
  1073. smalltalk.method({
  1074. selector: "renderTabsOn:",
  1075. fn: function (html){
  1076. var self=this;
  1077. return smalltalk.withContext(function($ctx1) { var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  1078. $1=_st(html)._ul();
  1079. _st($1)._class_("nav");
  1080. $2=_st($1)._with_((function(){
  1081. return smalltalk.withContext(function($ctx2) { _st(_st(self)._tabs())._do_((function(each){
  1082. return smalltalk.withContext(function($ctx3) { $3=_st(html)._li();
  1083. $4=$3;
  1084. $6=_st(each)._isActive();
  1085. if(smalltalk.assert($6)){
  1086. $5="active";
  1087. } else {
  1088. $5="inactive";
  1089. };
  1090. _st($4)._class_($5);
  1091. $7=_st($3)._with_((function(){
  1092. return smalltalk.withContext(function($ctx4) { $8=_st(html)._a();
  1093. _st($8)._with_((function(){
  1094. return smalltalk.withContext(function($ctx5) { _st(_st(_st(html)._tag_("i"))._class_("icon-remove"))._onClick_((function(){
  1095. return smalltalk.withContext(function($ctx6) { return _st(self)._removeTab_(each);
  1096. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1097. return _st(html)._with_(_st(each)._displayLabel());
  1098. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1099. $9=_st($8)._onClick_((function(){
  1100. return smalltalk.withContext(function($ctx5) { return _st(each)._activate();
  1101. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1102. return $9;
  1103. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1104. return $7;
  1105. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1106. return _st(self)._renderAddOn_(html);
  1107. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1108. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  1109. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "displayLabel", "a", "activate", "tabs", "renderAddOn:"]}),
  1110. smalltalk.HLManager);
  1111. smalltalk.addMethod(
  1112. "_show_",
  1113. smalltalk.method({
  1114. selector: "show:",
  1115. fn: function (aTab){
  1116. var self=this;
  1117. return smalltalk.withContext(function($ctx1) { _st(_st(window)._jQuery_("#container"))._empty();
  1118. _st(_st(aTab)._widget())._appendToJQuery_(_st("#container")._asJQuery());
  1119. _st(aTab)._focus();
  1120. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  1121. messageSends: ["empty", "jQuery:", "appendToJQuery:", "asJQuery", "widget", "focus"]}),
  1122. smalltalk.HLManager);
  1123. smalltalk.addMethod(
  1124. "_tabs",
  1125. smalltalk.method({
  1126. selector: "tabs",
  1127. fn: function (){
  1128. var self=this;
  1129. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1130. $2=self["@tabs"];
  1131. if(($receiver = $2) == nil || $receiver == undefined){
  1132. self["@tabs"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
  1133. $1=self["@tabs"];
  1134. } else {
  1135. $1=$2;
  1136. };
  1137. return $1;
  1138. }, function($ctx1) {$ctx1.fill(self,"tabs",{}, smalltalk.HLManager)})},
  1139. messageSends: ["ifNil:", "new"]}),
  1140. smalltalk.HLManager);
  1141. smalltalk.HLManager.klass.iVarNames = ['current'];
  1142. smalltalk.addMethod(
  1143. "_current",
  1144. smalltalk.method({
  1145. selector: "current",
  1146. fn: function (){
  1147. var self=this;
  1148. return smalltalk.withContext(function($ctx1) { var $2,$1;
  1149. $2=self["@current"];
  1150. if(($receiver = $2) == nil || $receiver == undefined){
  1151. self["@current"]=_st(_st(self)._basicNew())._initialize();
  1152. $1=self["@current"];
  1153. } else {
  1154. $1=$2;
  1155. };
  1156. return $1;
  1157. }, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.HLManager.klass)})},
  1158. messageSends: ["ifNil:", "initialize", "basicNew"]}),
  1159. smalltalk.HLManager.klass);
  1160. smalltalk.addMethod(
  1161. "_initialize",
  1162. smalltalk.method({
  1163. selector: "initialize",
  1164. fn: function (){
  1165. var self=this;
  1166. return smalltalk.withContext(function($ctx1) { _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  1167. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLManager.klass)})},
  1168. messageSends: ["appendToJQuery:", "asJQuery", "current"]}),
  1169. smalltalk.HLManager.klass);
  1170. smalltalk.addMethod(
  1171. "_new",
  1172. smalltalk.method({
  1173. selector: "new",
  1174. fn: function (){
  1175. var self=this;
  1176. return smalltalk.withContext(function($ctx1) { _st(self)._shouldNotImplement();
  1177. return self}, function($ctx1) {$ctx1.fill(self,"new",{}, smalltalk.HLManager.klass)})},
  1178. messageSends: ["shouldNotImplement"]}),
  1179. smalltalk.HLManager.klass);
  1180. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1181. smalltalk.addMethod(
  1182. "_canBeOpenAsTab",
  1183. smalltalk.method({
  1184. selector: "canBeOpenAsTab",
  1185. fn: function (){
  1186. var self=this;
  1187. return smalltalk.withContext(function($ctx1) { return true;
  1188. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLSUnit.klass)})},
  1189. messageSends: []}),
  1190. smalltalk.HLSUnit.klass);
  1191. smalltalk.addMethod(
  1192. "_tabLabel",
  1193. smalltalk.method({
  1194. selector: "tabLabel",
  1195. fn: function (){
  1196. var self=this;
  1197. return smalltalk.withContext(function($ctx1) { return "SUnit";
  1198. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLSUnit.klass)})},
  1199. messageSends: []}),
  1200. smalltalk.HLSUnit.klass);
  1201. smalltalk.addMethod(
  1202. "_tabPriority",
  1203. smalltalk.method({
  1204. selector: "tabPriority",
  1205. fn: function (){
  1206. var self=this;
  1207. return smalltalk.withContext(function($ctx1) { return (1000);
  1208. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLSUnit.klass)})},
  1209. messageSends: []}),
  1210. smalltalk.HLSUnit.klass);
  1211. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1212. smalltalk.addMethod(
  1213. "_canBeOpenAsTab",
  1214. smalltalk.method({
  1215. selector: "canBeOpenAsTab",
  1216. fn: function (){
  1217. var self=this;
  1218. return smalltalk.withContext(function($ctx1) { return true;
  1219. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLTranscript.klass)})},
  1220. messageSends: []}),
  1221. smalltalk.HLTranscript.klass);
  1222. smalltalk.addMethod(
  1223. "_tabLabel",
  1224. smalltalk.method({
  1225. selector: "tabLabel",
  1226. fn: function (){
  1227. var self=this;
  1228. return smalltalk.withContext(function($ctx1) { return "Transcript";
  1229. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLTranscript.klass)})},
  1230. messageSends: []}),
  1231. smalltalk.HLTranscript.klass);
  1232. smalltalk.addMethod(
  1233. "_tabPriority",
  1234. smalltalk.method({
  1235. selector: "tabPriority",
  1236. fn: function (){
  1237. var self=this;
  1238. return smalltalk.withContext(function($ctx1) { return (600);
  1239. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLTranscript.klass)})},
  1240. messageSends: []}),
  1241. smalltalk.HLTranscript.klass);