Helios-Core.deploy.js 42 KB

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