Helios-Core.deploy.js 43 KB

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