Helios-Core.deploy.js 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962
  1. smalltalk.addPackage('Helios-Core');
  2. smalltalk.addClass('HLModel', smalltalk.Object, ['announcer', 'environment'], 'Helios-Core');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "announcer",
  6. fn: function (){
  7. var self=this;
  8. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  9. return smalltalk.withContext(function($ctx1) {
  10. var $2,$1;
  11. $2=self["@announcer"];
  12. if(($receiver = $2) == nil || $receiver == undefined){
  13. self["@announcer"]=_st($Announcer())._new();
  14. $1=self["@announcer"];
  15. } else {
  16. $1=$2;
  17. };
  18. return $1;
  19. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLModel)})},
  20. messageSends: ["ifNil:", "new"]}),
  21. smalltalk.HLModel);
  22. smalltalk.addMethod(
  23. smalltalk.method({
  24. selector: "environment",
  25. fn: function (){
  26. var self=this;
  27. return smalltalk.withContext(function($ctx1) {
  28. var $2,$1;
  29. $2=self["@environment"];
  30. if(($receiver = $2) == nil || $receiver == undefined){
  31. $1=_st(_st(self)._manager())._environment();
  32. } else {
  33. $1=$2;
  34. };
  35. return $1;
  36. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLModel)})},
  37. messageSends: ["ifNil:", "environment", "manager"]}),
  38. smalltalk.HLModel);
  39. smalltalk.addMethod(
  40. smalltalk.method({
  41. selector: "environment:",
  42. fn: function (anEnvironment){
  43. var self=this;
  44. return smalltalk.withContext(function($ctx1) {
  45. self["@environment"]=anEnvironment;
  46. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLModel)})},
  47. messageSends: []}),
  48. smalltalk.HLModel);
  49. smalltalk.addMethod(
  50. smalltalk.method({
  51. selector: "manager",
  52. fn: function (){
  53. var self=this;
  54. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  55. return smalltalk.withContext(function($ctx1) {
  56. var $1;
  57. $1=_st($HLManager())._current();
  58. return $1;
  59. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLModel)})},
  60. messageSends: ["current"]}),
  61. smalltalk.HLModel);
  62. smalltalk.addMethod(
  63. smalltalk.method({
  64. selector: "systemAnnouncer",
  65. fn: function (){
  66. var self=this;
  67. return smalltalk.withContext(function($ctx1) {
  68. var $1;
  69. $1=_st(_st(self)._environment())._systemAnnouncer();
  70. return $1;
  71. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLModel)})},
  72. messageSends: ["systemAnnouncer", "environment"]}),
  73. smalltalk.HLModel);
  74. smalltalk.addClass('HLTab', smalltalk.Widget, ['widget', 'label', 'root'], 'Helios-Core');
  75. smalltalk.addMethod(
  76. smalltalk.method({
  77. selector: "activate",
  78. fn: function (){
  79. var self=this;
  80. return smalltalk.withContext(function($ctx1) {
  81. _st(_st(self)._manager())._activate_(self);
  82. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLTab)})},
  83. messageSends: ["activate:", "manager"]}),
  84. smalltalk.HLTab);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "add",
  88. fn: function (){
  89. var self=this;
  90. return smalltalk.withContext(function($ctx1) {
  91. _st(_st(self)._manager())._addTab_(self);
  92. return self}, function($ctx1) {$ctx1.fill(self,"add",{},smalltalk.HLTab)})},
  93. messageSends: ["addTab:", "manager"]}),
  94. smalltalk.HLTab);
  95. smalltalk.addMethod(
  96. smalltalk.method({
  97. selector: "displayLabel",
  98. fn: function (){
  99. var self=this;
  100. return smalltalk.withContext(function($ctx1) {
  101. var $2,$1;
  102. $2=_st(_st(_st(self)._label())._size()).__gt((20));
  103. if(smalltalk.assert($2)){
  104. $1=_st(_st(_st(self)._label())._first_((20))).__comma("...");
  105. } else {
  106. $1=_st(self)._label();
  107. };
  108. return $1;
  109. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLTab)})},
  110. messageSends: ["ifTrue:ifFalse:", ",", "first:", "label", ">", "size"]}),
  111. smalltalk.HLTab);
  112. smalltalk.addMethod(
  113. smalltalk.method({
  114. selector: "focus",
  115. fn: function (){
  116. var self=this;
  117. return smalltalk.withContext(function($ctx1) {
  118. var $1;
  119. $1=_st(_st(self)._widget())._canHaveFocus();
  120. if(smalltalk.assert($1)){
  121. _st(_st(self)._widget())._focus();
  122. };
  123. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLTab)})},
  124. messageSends: ["ifTrue:", "focus", "widget", "canHaveFocus"]}),
  125. smalltalk.HLTab);
  126. smalltalk.addMethod(
  127. smalltalk.method({
  128. selector: "hide",
  129. fn: function (){
  130. var self=this;
  131. return smalltalk.withContext(function($ctx1) {
  132. var $1;
  133. $1=self["@root"];
  134. if(($receiver = $1) == nil || $receiver == undefined){
  135. $1;
  136. } else {
  137. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","hidden");
  138. };
  139. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLTab)})},
  140. messageSends: ["ifNotNil:", "css:put:", "asJQuery"]}),
  141. smalltalk.HLTab);
  142. smalltalk.addMethod(
  143. smalltalk.method({
  144. selector: "isActive",
  145. fn: function (){
  146. var self=this;
  147. return smalltalk.withContext(function($ctx1) {
  148. var $1;
  149. $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
  150. return $1;
  151. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLTab)})},
  152. messageSends: ["=", "activeTab", "manager"]}),
  153. smalltalk.HLTab);
  154. smalltalk.addMethod(
  155. smalltalk.method({
  156. selector: "label",
  157. fn: function (){
  158. var self=this;
  159. return smalltalk.withContext(function($ctx1) {
  160. var $2,$1;
  161. $2=self["@label"];
  162. if(($receiver = $2) == nil || $receiver == undefined){
  163. $1="";
  164. } else {
  165. $1=$2;
  166. };
  167. return $1;
  168. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLTab)})},
  169. messageSends: ["ifNil:"]}),
  170. smalltalk.HLTab);
  171. smalltalk.addMethod(
  172. smalltalk.method({
  173. selector: "label:",
  174. fn: function (aString){
  175. var self=this;
  176. return smalltalk.withContext(function($ctx1) {
  177. self["@label"]=aString;
  178. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLTab)})},
  179. messageSends: []}),
  180. smalltalk.HLTab);
  181. smalltalk.addMethod(
  182. smalltalk.method({
  183. selector: "manager",
  184. fn: function (){
  185. var self=this;
  186. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  187. return smalltalk.withContext(function($ctx1) {
  188. var $1;
  189. $1=_st($HLManager())._current();
  190. return $1;
  191. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLTab)})},
  192. messageSends: ["current"]}),
  193. smalltalk.HLTab);
  194. smalltalk.addMethod(
  195. smalltalk.method({
  196. selector: "registerBindings",
  197. fn: function (){
  198. var self=this;
  199. return smalltalk.withContext(function($ctx1) {
  200. _st(_st(self)._widget())._registerBindings();
  201. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLTab)})},
  202. messageSends: ["registerBindings", "widget"]}),
  203. smalltalk.HLTab);
  204. smalltalk.addMethod(
  205. smalltalk.method({
  206. selector: "remove",
  207. fn: function (){
  208. var self=this;
  209. return smalltalk.withContext(function($ctx1) {
  210. var $1;
  211. $1=self["@root"];
  212. if(($receiver = $1) == nil || $receiver == undefined){
  213. $1;
  214. } else {
  215. _st(_st(self["@root"])._asJQuery())._remove();
  216. };
  217. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTab)})},
  218. messageSends: ["ifNotNil:", "remove", "asJQuery"]}),
  219. smalltalk.HLTab);
  220. smalltalk.addMethod(
  221. smalltalk.method({
  222. selector: "renderOn:",
  223. fn: function (html){
  224. var self=this;
  225. return smalltalk.withContext(function($ctx1) {
  226. var $1,$2;
  227. $1=_st(html)._div();
  228. _st($1)._class_("tab");
  229. $2=_st($1)._yourself();
  230. self["@root"]=$2;
  231. _st(self)._renderTab();
  232. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTab)})},
  233. messageSends: ["class:", "div", "yourself", "renderTab"]}),
  234. smalltalk.HLTab);
  235. smalltalk.addMethod(
  236. smalltalk.method({
  237. selector: "renderTab",
  238. fn: function (){
  239. var self=this;
  240. return smalltalk.withContext(function($ctx1) {
  241. var $1,$2;
  242. _st(self["@root"])._contents_((function(html){
  243. return smalltalk.withContext(function($ctx2) {
  244. $1=_st(html)._div();
  245. _st($1)._class_("amber_box");
  246. $2=_st($1)._with_((function(){
  247. return smalltalk.withContext(function($ctx3) {
  248. return _st(_st(self)._widget())._renderOn_(html);
  249. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  250. return $2;
  251. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  252. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.HLTab)})},
  253. messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"]}),
  254. smalltalk.HLTab);
  255. smalltalk.addMethod(
  256. smalltalk.method({
  257. selector: "show",
  258. fn: function (){
  259. var self=this;
  260. return smalltalk.withContext(function($ctx1) {
  261. var $1;
  262. $1=self["@root"];
  263. if(($receiver = $1) == nil || $receiver == undefined){
  264. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  265. } else {
  266. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","visible");
  267. };
  268. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLTab)})},
  269. messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "css:put:"]}),
  270. smalltalk.HLTab);
  271. smalltalk.addMethod(
  272. smalltalk.method({
  273. selector: "widget",
  274. fn: function (){
  275. var self=this;
  276. return smalltalk.withContext(function($ctx1) {
  277. var $1;
  278. $1=self["@widget"];
  279. return $1;
  280. }, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLTab)})},
  281. messageSends: []}),
  282. smalltalk.HLTab);
  283. smalltalk.addMethod(
  284. smalltalk.method({
  285. selector: "widget:",
  286. fn: function (aWidget){
  287. var self=this;
  288. return smalltalk.withContext(function($ctx1) {
  289. self["@widget"]=aWidget;
  290. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLTab)})},
  291. messageSends: []}),
  292. smalltalk.HLTab);
  293. smalltalk.addMethod(
  294. smalltalk.method({
  295. selector: "on:labelled:",
  296. fn: function (aWidget,aString){
  297. var self=this;
  298. return smalltalk.withContext(function($ctx1) {
  299. var $2,$3,$1;
  300. $2=_st(self)._new();
  301. _st($2)._widget_(aWidget);
  302. _st($2)._label_(aString);
  303. $3=_st($2)._yourself();
  304. $1=$3;
  305. return $1;
  306. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},smalltalk.HLTab.klass)})},
  307. messageSends: ["widget:", "new", "label:", "yourself"]}),
  308. smalltalk.HLTab.klass);
  309. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  310. smalltalk.addMethod(
  311. smalltalk.method({
  312. selector: "alert:",
  313. fn: function (aString){
  314. var self=this;
  315. return smalltalk.withContext(function($ctx1) {
  316. _st(window)._alert_(aString);
  317. return self}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.HLWidget)})},
  318. messageSends: ["alert:"]}),
  319. smalltalk.HLWidget);
  320. smalltalk.addMethod(
  321. smalltalk.method({
  322. selector: "canHaveFocus",
  323. fn: function (){
  324. var self=this;
  325. return smalltalk.withContext(function($ctx1) {
  326. return false;
  327. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWidget)})},
  328. messageSends: []}),
  329. smalltalk.HLWidget);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "confirm:ifTrue:",
  333. fn: function (aString,aBlock){
  334. var self=this;
  335. return smalltalk.withContext(function($ctx1) {
  336. _st(_st(self)._manager())._confirm_ifTrue_(aString,aBlock);
  337. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLWidget)})},
  338. messageSends: ["confirm:ifTrue:", "manager"]}),
  339. smalltalk.HLWidget);
  340. smalltalk.addMethod(
  341. smalltalk.method({
  342. selector: "execute:",
  343. fn: function (aCommand){
  344. var self=this;
  345. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  346. return smalltalk.withContext(function($ctx1) {
  347. var $1,$2;
  348. $1=_st(_st($HLManager())._current())._keyBinder();
  349. _st($1)._activate();
  350. $2=_st($1)._applyBinding_(_st(aCommand)._asBinding());
  351. return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aCommand:aCommand},smalltalk.HLWidget)})},
  352. messageSends: ["activate", "keyBinder", "current", "applyBinding:", "asBinding"]}),
  353. smalltalk.HLWidget);
  354. smalltalk.addMethod(
  355. smalltalk.method({
  356. selector: "manager",
  357. fn: function (){
  358. var self=this;
  359. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  360. return smalltalk.withContext(function($ctx1) {
  361. var $1;
  362. $1=_st($HLManager())._current();
  363. return $1;
  364. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLWidget)})},
  365. messageSends: ["current"]}),
  366. smalltalk.HLWidget);
  367. smalltalk.addMethod(
  368. smalltalk.method({
  369. selector: "refresh",
  370. fn: function (){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) {
  373. var $1,$2;
  374. $1=_st(self)._wrapper();
  375. if(($receiver = $1) == nil || $receiver == undefined){
  376. $2=self;
  377. return $2;
  378. } else {
  379. $1;
  380. };
  381. _st(_st(_st(self)._wrapper())._asJQuery())._empty();
  382. _st((function(html){
  383. return smalltalk.withContext(function($ctx2) {
  384. return _st(self)._renderContentOn_(html);
  385. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(self)._wrapper())._asJQuery());
  386. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLWidget)})},
  387. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"]}),
  388. smalltalk.HLWidget);
  389. smalltalk.addMethod(
  390. smalltalk.method({
  391. selector: "registerBindings",
  392. fn: function (){
  393. var self=this;
  394. return smalltalk.withContext(function($ctx1) {
  395. _st(self)._registerBindingsOn_(_st(_st(_st(self)._manager())._keyBinder())._bindings());
  396. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLWidget)})},
  397. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"]}),
  398. smalltalk.HLWidget);
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "registerBindingsOn:",
  402. fn: function (aBindingGroup){
  403. var self=this;
  404. return smalltalk.withContext(function($ctx1) {
  405. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLWidget)})},
  406. messageSends: []}),
  407. smalltalk.HLWidget);
  408. smalltalk.addMethod(
  409. smalltalk.method({
  410. selector: "renderContentOn:",
  411. fn: function (html){
  412. var self=this;
  413. return smalltalk.withContext(function($ctx1) {
  414. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWidget)})},
  415. messageSends: []}),
  416. smalltalk.HLWidget);
  417. smalltalk.addMethod(
  418. smalltalk.method({
  419. selector: "renderOn:",
  420. fn: function (html){
  421. var self=this;
  422. return smalltalk.withContext(function($ctx1) {
  423. self["@wrapper"]=_st(html)._div();
  424. _st((function(renderer){
  425. return smalltalk.withContext(function($ctx2) {
  426. return _st(self)._renderContentOn_(renderer);
  427. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  428. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLWidget)})},
  429. messageSends: ["div", "appendToJQuery:", "asJQuery", "renderContentOn:"]}),
  430. smalltalk.HLWidget);
  431. smalltalk.addMethod(
  432. smalltalk.method({
  433. selector: "wrapper",
  434. fn: function (){
  435. var self=this;
  436. return smalltalk.withContext(function($ctx1) {
  437. var $1;
  438. $1=self["@wrapper"];
  439. return $1;
  440. }, function($ctx1) {$ctx1.fill(self,"wrapper",{},smalltalk.HLWidget)})},
  441. messageSends: []}),
  442. smalltalk.HLWidget);
  443. smalltalk.addMethod(
  444. smalltalk.method({
  445. selector: "canBeOpenAsTab",
  446. fn: function (){
  447. var self=this;
  448. return smalltalk.withContext(function($ctx1) {
  449. return false;
  450. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWidget.klass)})},
  451. messageSends: []}),
  452. smalltalk.HLWidget.klass);
  453. smalltalk.addMethod(
  454. smalltalk.method({
  455. selector: "openAsTab",
  456. fn: function (){
  457. var self=this;
  458. function $HLTab(){return smalltalk.HLTab||(typeof HLTab=="undefined"?nil:HLTab)}
  459. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  460. return smalltalk.withContext(function($ctx1) {
  461. var $1,$2;
  462. $1=_st(self)._canBeOpenAsTab();
  463. if(! smalltalk.assert($1)){
  464. $2=self;
  465. return $2;
  466. };
  467. _st(_st($HLManager())._current())._addTab_(_st($HLTab())._on_labelled_(_st(self)._new(),_st(self)._tabLabel()));
  468. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{},smalltalk.HLWidget.klass)})},
  469. messageSends: ["ifFalse:", "canBeOpenAsTab", "addTab:", "on:labelled:", "new", "tabLabel", "current"]}),
  470. smalltalk.HLWidget.klass);
  471. smalltalk.addMethod(
  472. smalltalk.method({
  473. selector: "tabLabel",
  474. fn: function (){
  475. var self=this;
  476. return smalltalk.withContext(function($ctx1) {
  477. return "Tab";
  478. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWidget.klass)})},
  479. messageSends: []}),
  480. smalltalk.HLWidget.klass);
  481. smalltalk.addMethod(
  482. smalltalk.method({
  483. selector: "tabPriority",
  484. fn: function (){
  485. var self=this;
  486. return smalltalk.withContext(function($ctx1) {
  487. var $1;
  488. $1=(500);
  489. return $1;
  490. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWidget.klass)})},
  491. messageSends: []}),
  492. smalltalk.HLWidget.klass);
  493. smalltalk.addClass('HLConfirmation', smalltalk.HLWidget, ['confirmationString', 'actionBlock', 'cancelBlock'], 'Helios-Core');
  494. smalltalk.addMethod(
  495. smalltalk.method({
  496. selector: "actionBlock",
  497. fn: function (){
  498. var self=this;
  499. return smalltalk.withContext(function($ctx1) {
  500. var $2,$1;
  501. $2=self["@actionBlock"];
  502. if(($receiver = $2) == nil || $receiver == undefined){
  503. $1=(function(){
  504. return smalltalk.withContext(function($ctx2) {
  505. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  506. } else {
  507. $1=$2;
  508. };
  509. return $1;
  510. }, function($ctx1) {$ctx1.fill(self,"actionBlock",{},smalltalk.HLConfirmation)})},
  511. messageSends: ["ifNil:"]}),
  512. smalltalk.HLConfirmation);
  513. smalltalk.addMethod(
  514. smalltalk.method({
  515. selector: "actionBlock:",
  516. fn: function (aBlock){
  517. var self=this;
  518. return smalltalk.withContext(function($ctx1) {
  519. self["@actionBlock"]=aBlock;
  520. return self}, function($ctx1) {$ctx1.fill(self,"actionBlock:",{aBlock:aBlock},smalltalk.HLConfirmation)})},
  521. messageSends: []}),
  522. smalltalk.HLConfirmation);
  523. smalltalk.addMethod(
  524. smalltalk.method({
  525. selector: "cancel",
  526. fn: function (){
  527. var self=this;
  528. return smalltalk.withContext(function($ctx1) {
  529. _st(_st(self)._cancelBlock())._value();
  530. _st(self)._remove();
  531. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},smalltalk.HLConfirmation)})},
  532. messageSends: ["value", "cancelBlock", "remove"]}),
  533. smalltalk.HLConfirmation);
  534. smalltalk.addMethod(
  535. smalltalk.method({
  536. selector: "cancelBlock",
  537. fn: function (){
  538. var self=this;
  539. return smalltalk.withContext(function($ctx1) {
  540. var $2,$1;
  541. $2=self["@cancelBlock"];
  542. if(($receiver = $2) == nil || $receiver == undefined){
  543. $1=(function(){
  544. return smalltalk.withContext(function($ctx2) {
  545. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  546. } else {
  547. $1=$2;
  548. };
  549. return $1;
  550. }, function($ctx1) {$ctx1.fill(self,"cancelBlock",{},smalltalk.HLConfirmation)})},
  551. messageSends: ["ifNil:"]}),
  552. smalltalk.HLConfirmation);
  553. smalltalk.addMethod(
  554. smalltalk.method({
  555. selector: "cancelBlock:",
  556. fn: function (aBlock){
  557. var self=this;
  558. return smalltalk.withContext(function($ctx1) {
  559. self["@cancelBlock"]=aBlock;
  560. return self}, function($ctx1) {$ctx1.fill(self,"cancelBlock:",{aBlock:aBlock},smalltalk.HLConfirmation)})},
  561. messageSends: []}),
  562. smalltalk.HLConfirmation);
  563. smalltalk.addMethod(
  564. smalltalk.method({
  565. selector: "confirm",
  566. fn: function (){
  567. var self=this;
  568. return smalltalk.withContext(function($ctx1) {
  569. _st(_st(self)._actionBlock())._value();
  570. _st(self)._remove();
  571. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLConfirmation)})},
  572. messageSends: ["value", "actionBlock", "remove"]}),
  573. smalltalk.HLConfirmation);
  574. smalltalk.addMethod(
  575. smalltalk.method({
  576. selector: "confirmationString",
  577. fn: function (){
  578. var self=this;
  579. return smalltalk.withContext(function($ctx1) {
  580. var $2,$1;
  581. $2=self["@confirmationString"];
  582. if(($receiver = $2) == nil || $receiver == undefined){
  583. $1="Confirm";
  584. } else {
  585. $1=$2;
  586. };
  587. return $1;
  588. }, function($ctx1) {$ctx1.fill(self,"confirmationString",{},smalltalk.HLConfirmation)})},
  589. messageSends: ["ifNil:"]}),
  590. smalltalk.HLConfirmation);
  591. smalltalk.addMethod(
  592. smalltalk.method({
  593. selector: "confirmationString:",
  594. fn: function (aString){
  595. var self=this;
  596. return smalltalk.withContext(function($ctx1) {
  597. self["@confirmationString"]=aString;
  598. return self}, function($ctx1) {$ctx1.fill(self,"confirmationString:",{aString:aString},smalltalk.HLConfirmation)})},
  599. messageSends: []}),
  600. smalltalk.HLConfirmation);
  601. smalltalk.addMethod(
  602. smalltalk.method({
  603. selector: "remove",
  604. fn: function (){
  605. var self=this;
  606. return smalltalk.withContext(function($ctx1) {
  607. _st(_st(window)._jQuery_(".confirmation"))._removeClass_("active");
  608. _st((function(){
  609. return smalltalk.withContext(function($ctx2) {
  610. _st(_st(window)._jQuery_("#overlay"))._remove();
  611. return _st(_st(window)._jQuery_(".confirmation"))._remove();
  612. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  613. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLConfirmation)})},
  614. messageSends: ["removeClass:", "jQuery:", "valueWithTimeout:", "remove"]}),
  615. smalltalk.HLConfirmation);
  616. smalltalk.addMethod(
  617. smalltalk.method({
  618. selector: "renderContentOn:",
  619. fn: function (html){
  620. var self=this;
  621. var confirmButton;
  622. return smalltalk.withContext(function($ctx1) {
  623. var $1,$3,$5,$6,$7,$8,$4,$2;
  624. _st(_st(html)._div())._id_("overlay");
  625. $1=_st(html)._div();
  626. _st($1)._class_("confirmation");
  627. $2=_st($1)._with_((function(){
  628. return smalltalk.withContext(function($ctx2) {
  629. _st(_st(html)._span())._with_(_st(self)._confirmationString());
  630. $3=_st(html)._div();
  631. _st($3)._class_("buttons");
  632. $4=_st($3)._with_((function(){
  633. return smalltalk.withContext(function($ctx3) {
  634. $5=_st(html)._button();
  635. _st($5)._class_("button");
  636. _st($5)._with_("Cancel");
  637. $6=_st($5)._onClick_((function(){
  638. return smalltalk.withContext(function($ctx4) {
  639. return _st(self)._cancel();
  640. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  641. $6;
  642. $7=_st(html)._button();
  643. _st($7)._class_("button default");
  644. _st($7)._with_("Confirm");
  645. $8=_st($7)._onClick_((function(){
  646. return smalltalk.withContext(function($ctx4) {
  647. return _st(self)._confirm();
  648. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  649. confirmButton=$8;
  650. return confirmButton;
  651. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  652. return $4;
  653. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  654. _st(_st(confirmButton)._asJQuery())._focus();
  655. _st(_st(window)._jQuery_(".confirmation"))._addClass_("active");
  656. _st(self)._setupKeyBindings();
  657. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html,confirmButton:confirmButton},smalltalk.HLConfirmation)})},
  658. messageSends: ["id:", "div", "class:", "with:", "confirmationString", "span", "button", "onClick:", "cancel", "confirm", "focus", "asJQuery", "addClass:", "jQuery:", "setupKeyBindings"]}),
  659. smalltalk.HLConfirmation);
  660. smalltalk.addMethod(
  661. smalltalk.method({
  662. selector: "setupKeyBindings",
  663. fn: function (){
  664. var self=this;
  665. return smalltalk.withContext(function($ctx1) {
  666. var $1;
  667. _st(_st(window)._jQuery_(".confirmation"))._keyup_((function(e){
  668. return smalltalk.withContext(function($ctx2) {
  669. $1=_st(_st(e)._keyCode()).__eq((27));
  670. if(smalltalk.assert($1)){
  671. return _st(self)._cancel();
  672. };
  673. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  674. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLConfirmation)})},
  675. messageSends: ["keyup:", "ifTrue:", "cancel", "=", "keyCode", "jQuery:"]}),
  676. smalltalk.HLConfirmation);
  677. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  678. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, [], 'Helios-Core');
  679. smalltalk.addMethod(
  680. smalltalk.method({
  681. selector: "blur",
  682. fn: function (){
  683. var self=this;
  684. return smalltalk.withContext(function($ctx1) {
  685. _st(_st(_st(self)._wrapper())._asJQuery())._blur();
  686. return self}, function($ctx1) {$ctx1.fill(self,"blur",{},smalltalk.HLFocusableWidget)})},
  687. messageSends: ["blur", "asJQuery", "wrapper"]}),
  688. smalltalk.HLFocusableWidget);
  689. smalltalk.addMethod(
  690. smalltalk.method({
  691. selector: "canHaveFocus",
  692. fn: function (){
  693. var self=this;
  694. return smalltalk.withContext(function($ctx1) {
  695. return true;
  696. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLFocusableWidget)})},
  697. messageSends: []}),
  698. smalltalk.HLFocusableWidget);
  699. smalltalk.addMethod(
  700. smalltalk.method({
  701. selector: "focus",
  702. fn: function (){
  703. var self=this;
  704. return smalltalk.withContext(function($ctx1) {
  705. _st(_st(_st(self)._wrapper())._asJQuery())._focus();
  706. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLFocusableWidget)})},
  707. messageSends: ["focus", "asJQuery", "wrapper"]}),
  708. smalltalk.HLFocusableWidget);
  709. smalltalk.addMethod(
  710. smalltalk.method({
  711. selector: "focusClass",
  712. fn: function (){
  713. var self=this;
  714. return smalltalk.withContext(function($ctx1) {
  715. return "focused";
  716. }, function($ctx1) {$ctx1.fill(self,"focusClass",{},smalltalk.HLFocusableWidget)})},
  717. messageSends: []}),
  718. smalltalk.HLFocusableWidget);
  719. smalltalk.addMethod(
  720. smalltalk.method({
  721. selector: "hasFocus",
  722. fn: function (){
  723. var self=this;
  724. return smalltalk.withContext(function($ctx1) {
  725. var $1;
  726. $1=_st(_st(_st(self)._wrapper())._notNil())._and_((function(){
  727. return smalltalk.withContext(function($ctx2) {
  728. return _st(_st(_st(self)._wrapper())._asJQuery())._is_(":focus");
  729. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  730. return $1;
  731. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLFocusableWidget)})},
  732. messageSends: ["and:", "is:", "asJQuery", "wrapper", "notNil"]}),
  733. smalltalk.HLFocusableWidget);
  734. smalltalk.addMethod(
  735. smalltalk.method({
  736. selector: "renderContentOn:",
  737. fn: function (html){
  738. var self=this;
  739. return smalltalk.withContext(function($ctx1) {
  740. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLFocusableWidget)})},
  741. messageSends: []}),
  742. smalltalk.HLFocusableWidget);
  743. smalltalk.addMethod(
  744. smalltalk.method({
  745. selector: "renderOn:",
  746. fn: function (html){
  747. var self=this;
  748. return smalltalk.withContext(function($ctx1) {
  749. var $1,$2,$3,$4;
  750. _st(self)._registerBindings();
  751. $1=_st(html)._div();
  752. _st($1)._class_("hl_widget");
  753. $2=_st($1)._yourself();
  754. self["@wrapper"]=$2;
  755. _st(self["@wrapper"])._with_((function(){
  756. return smalltalk.withContext(function($ctx2) {
  757. return _st(self)._renderContentOn_(html);
  758. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  759. $3=self["@wrapper"];
  760. _st($3)._at_put_("tabindex","0");
  761. _st($3)._onBlur_((function(){
  762. return smalltalk.withContext(function($ctx2) {
  763. return _st(_st(_st(self)._wrapper())._asJQuery())._removeClass_(_st(self)._focusClass());
  764. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  765. $4=_st($3)._onFocus_((function(){
  766. return smalltalk.withContext(function($ctx2) {
  767. return _st(_st(_st(self)._wrapper())._asJQuery())._addClass_(_st(self)._focusClass());
  768. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  769. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLFocusableWidget)})},
  770. messageSends: ["registerBindings", "class:", "div", "yourself", "with:", "renderContentOn:", "at:put:", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"]}),
  771. smalltalk.HLFocusableWidget);
  772. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem', 'mapping'], 'Helios-Core');
  773. smalltalk.addMethod(
  774. smalltalk.method({
  775. selector: "activateFirstListItem",
  776. fn: function (){
  777. var self=this;
  778. return smalltalk.withContext(function($ctx1) {
  779. _st(self)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li.inactive"))._get_((0))));
  780. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{},smalltalk.HLListWidget)})},
  781. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"]}),
  782. smalltalk.HLListWidget);
  783. smalltalk.addMethod(
  784. smalltalk.method({
  785. selector: "activateItem:",
  786. fn: function (anObject){
  787. var self=this;
  788. return smalltalk.withContext(function($ctx1) {
  789. var $1;
  790. var $early={};
  791. try {
  792. _st(self)._activateListItem_(_st(_st(self["@mapping"])._at_ifAbsent_(anObject,(function(){
  793. return smalltalk.withContext(function($ctx2) {
  794. $1=self;
  795. throw $early=[$1];
  796. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  797. return self}
  798. catch(e) {if(e===$early)return e[0]; throw e}
  799. }, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  800. messageSends: ["activateListItem:", "asJQuery", "at:ifAbsent:"]}),
  801. smalltalk.HLListWidget);
  802. smalltalk.addMethod(
  803. smalltalk.method({
  804. selector: "activateListItem:",
  805. fn: function (aListItem){
  806. var self=this;
  807. var item;
  808. return smalltalk.withContext(function($ctx1) {
  809. var $1,$2,$3;
  810. $1=_st(aListItem)._get_((0));
  811. if(($receiver = $1) == nil || $receiver == undefined){
  812. $2=self;
  813. return $2;
  814. } else {
  815. $1;
  816. };
  817. _st(_st(_st(aListItem)._parent())._children())._removeClass_("active");
  818. _st(aListItem)._addClass_("active");
  819. _st(self)._ensureVisible_(aListItem);
  820. item=_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber());
  821. $3=_st(_st(self)._selectedItem()).__eq_eq(item);
  822. if(! smalltalk.assert($3)){
  823. _st(self)._selectItem_(item);
  824. };
  825. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.HLListWidget)})},
  826. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "addClass:", "ensureVisible:", "at:", "asNumber", "attr:", "items", "ifFalse:", "selectItem:", "==", "selectedItem"]}),
  827. smalltalk.HLListWidget);
  828. smalltalk.addMethod(
  829. smalltalk.method({
  830. selector: "activateNextListItem",
  831. fn: function (){
  832. var self=this;
  833. return smalltalk.withContext(function($ctx1) {
  834. _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._next());
  835. _st(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._get())._ifEmpty_((function(){
  836. return smalltalk.withContext(function($ctx2) {
  837. return _st(self)._activateFirstListItem();
  838. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  839. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLListWidget)})},
  840. messageSends: ["activateListItem:", "next", "jQuery:", "ifEmpty:", "activateFirstListItem", "get"]}),
  841. smalltalk.HLListWidget);
  842. smalltalk.addMethod(
  843. smalltalk.method({
  844. selector: "activatePreviousListItem",
  845. fn: function (){
  846. var self=this;
  847. return smalltalk.withContext(function($ctx1) {
  848. _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._prev());
  849. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLListWidget)})},
  850. messageSends: ["activateListItem:", "prev", "jQuery:"]}),
  851. smalltalk.HLListWidget);
  852. smalltalk.addMethod(
  853. smalltalk.method({
  854. selector: "cssClassForItem:",
  855. fn: function (anObject){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) {
  858. var $2,$1;
  859. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  860. if(smalltalk.assert($2)){
  861. $1="active";
  862. } else {
  863. $1="inactive";
  864. };
  865. return $1;
  866. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  867. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"]}),
  868. smalltalk.HLListWidget);
  869. smalltalk.addMethod(
  870. smalltalk.method({
  871. selector: "defaultItems",
  872. fn: function (){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx1) {
  875. var $1;
  876. $1=[];
  877. return $1;
  878. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLListWidget)})},
  879. messageSends: []}),
  880. smalltalk.HLListWidget);
  881. smalltalk.addMethod(
  882. smalltalk.method({
  883. selector: "ensureVisible:",
  884. fn: function (aListItem){
  885. var self=this;
  886. var perent,position;
  887. return smalltalk.withContext(function($ctx1) {
  888. var $1,$2;
  889. position=_st(self)._positionOf_(aListItem);
  890. parent=_st(aListItem)._parent();
  891. $1=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  892. if(smalltalk.assert($1)){
  893. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  894. };
  895. $2=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  896. if(smalltalk.assert($2)){
  897. _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)));
  898. };
  899. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,perent:perent,position:position},smalltalk.HLListWidget)})},
  900. messageSends: ["positionOf:", "parent", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "get:", "<", "height", ">"]}),
  901. smalltalk.HLListWidget);
  902. smalltalk.addMethod(
  903. smalltalk.method({
  904. selector: "focus",
  905. fn: function (){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) {
  908. var $1,$2;
  909. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  910. $1=_st(_st(self)._items())._isEmpty();
  911. if(! smalltalk.assert($1)){
  912. $2=_st(self)._selectedItem();
  913. if(($receiver = $2) == nil || $receiver == undefined){
  914. _st(self)._activateFirstListItem();
  915. } else {
  916. $2;
  917. };
  918. };
  919. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLListWidget)})},
  920. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"]}),
  921. smalltalk.HLListWidget);
  922. smalltalk.addMethod(
  923. smalltalk.method({
  924. selector: "iconForItem:",
  925. fn: function (anObject){
  926. var self=this;
  927. return smalltalk.withContext(function($ctx1) {
  928. return "";
  929. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  930. messageSends: []}),
  931. smalltalk.HLListWidget);
  932. smalltalk.addMethod(
  933. smalltalk.method({
  934. selector: "initialize",
  935. fn: function (){
  936. var self=this;
  937. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  938. return smalltalk.withContext(function($ctx1) {
  939. smalltalk.HLFocusableWidget.fn.prototype._initialize.apply(_st(self), []);
  940. self["@mapping"]=_st($Dictionary())._new();
  941. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLListWidget)})},
  942. messageSends: ["initialize", "new"]}),
  943. smalltalk.HLListWidget);
  944. smalltalk.addMethod(
  945. smalltalk.method({
  946. selector: "items",
  947. fn: function (){
  948. var self=this;
  949. return smalltalk.withContext(function($ctx1) {
  950. var $2,$1;
  951. $2=self["@items"];
  952. if(($receiver = $2) == nil || $receiver == undefined){
  953. self["@items"]=_st(self)._defaultItems();
  954. $1=self["@items"];
  955. } else {
  956. $1=$2;
  957. };
  958. return $1;
  959. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLListWidget)})},
  960. messageSends: ["ifNil:", "defaultItems"]}),
  961. smalltalk.HLListWidget);
  962. smalltalk.addMethod(
  963. smalltalk.method({
  964. selector: "items:",
  965. fn: function (aCollection){
  966. var self=this;
  967. return smalltalk.withContext(function($ctx1) {
  968. self["@items"]=aCollection;
  969. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection},smalltalk.HLListWidget)})},
  970. messageSends: []}),
  971. smalltalk.HLListWidget);
  972. smalltalk.addMethod(
  973. smalltalk.method({
  974. selector: "positionOf:",
  975. fn: function (aListItem){
  976. var self=this;
  977. return smalltalk.withContext(function($ctx1) {
  978. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  979. ;
  980. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.HLListWidget)})},
  981. messageSends: []}),
  982. smalltalk.HLListWidget);
  983. smalltalk.addMethod(
  984. smalltalk.method({
  985. selector: "refresh",
  986. fn: function (){
  987. var self=this;
  988. return smalltalk.withContext(function($ctx1) {
  989. var $1;
  990. var $early={};
  991. try {
  992. smalltalk.HLFocusableWidget.fn.prototype._refresh.apply(_st(self), []);
  993. _st(self)._ensureVisible_(_st(_st(self["@mapping"])._at_ifAbsent_(_st(self)._selectedItem(),(function(){
  994. return smalltalk.withContext(function($ctx2) {
  995. $1=self;
  996. throw $early=[$1];
  997. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  998. return self}
  999. catch(e) {if(e===$early)return e[0]; throw e}
  1000. }, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLListWidget)})},
  1001. messageSends: ["refresh", "ensureVisible:", "asJQuery", "at:ifAbsent:", "selectedItem"]}),
  1002. smalltalk.HLListWidget);
  1003. smalltalk.addMethod(
  1004. smalltalk.method({
  1005. selector: "registerMappingFrom:to:",
  1006. fn: function (anObject,aTag){
  1007. var self=this;
  1008. return smalltalk.withContext(function($ctx1) {
  1009. _st(self["@mapping"])._at_put_(anObject,aTag);
  1010. return self}, function($ctx1) {$ctx1.fill(self,"registerMappingFrom:to:",{anObject:anObject,aTag:aTag},smalltalk.HLListWidget)})},
  1011. messageSends: ["at:put:"]}),
  1012. smalltalk.HLListWidget);
  1013. smalltalk.addMethod(
  1014. smalltalk.method({
  1015. selector: "renderButtonsOn:",
  1016. fn: function (html){
  1017. var self=this;
  1018. return smalltalk.withContext(function($ctx1) {
  1019. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLListWidget)})},
  1020. messageSends: []}),
  1021. smalltalk.HLListWidget);
  1022. smalltalk.addMethod(
  1023. smalltalk.method({
  1024. selector: "renderContentOn:",
  1025. fn: function (html){
  1026. var self=this;
  1027. return smalltalk.withContext(function($ctx1) {
  1028. var $1,$2,$3,$4;
  1029. $1=_st(html)._ul();
  1030. _st($1)._class_("nav nav-pills nav-stacked");
  1031. $2=_st($1)._with_((function(){
  1032. return smalltalk.withContext(function($ctx2) {
  1033. return _st(self)._renderListOn_(html);
  1034. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1035. $3=_st(html)._div();
  1036. _st($3)._class_("pane_actions form-actions");
  1037. $4=_st($3)._with_((function(){
  1038. return smalltalk.withContext(function($ctx2) {
  1039. return _st(self)._renderButtonsOn_(html);
  1040. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1041. _st(self)._setupKeyBindings();
  1042. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLListWidget)})},
  1043. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"]}),
  1044. smalltalk.HLListWidget);
  1045. smalltalk.addMethod(
  1046. smalltalk.method({
  1047. selector: "renderItem:on:",
  1048. fn: function (anObject,html){
  1049. var self=this;
  1050. var li;
  1051. return smalltalk.withContext(function($ctx1) {
  1052. var $1,$3,$4,$2;
  1053. li=_st(html)._li();
  1054. _st(self)._registerMappingFrom_to_(anObject,li);
  1055. $1=li;
  1056. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  1057. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  1058. $2=_st($1)._with_((function(){
  1059. return smalltalk.withContext(function($ctx2) {
  1060. $3=_st(html)._a();
  1061. _st($3)._with_((function(){
  1062. return smalltalk.withContext(function($ctx3) {
  1063. _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  1064. return _st(self)._renderItemLabel_on_(anObject,html);
  1065. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1066. $4=_st($3)._onClick_((function(){
  1067. return smalltalk.withContext(function($ctx3) {
  1068. return _st(self)._activateListItem_(_st(li)._asJQuery());
  1069. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1070. return $4;
  1071. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1072. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.HLListWidget)})},
  1073. messageSends: ["li", "registerMappingFrom:to:", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"]}),
  1074. smalltalk.HLListWidget);
  1075. smalltalk.addMethod(
  1076. smalltalk.method({
  1077. selector: "renderItemLabel:on:",
  1078. fn: function (anObject,html){
  1079. var self=this;
  1080. return smalltalk.withContext(function($ctx1) {
  1081. _st(html)._with_(_st(anObject)._asString());
  1082. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},smalltalk.HLListWidget)})},
  1083. messageSends: ["with:", "asString"]}),
  1084. smalltalk.HLListWidget);
  1085. smalltalk.addMethod(
  1086. smalltalk.method({
  1087. selector: "renderListOn:",
  1088. fn: function (html){
  1089. var self=this;
  1090. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  1091. return smalltalk.withContext(function($ctx1) {
  1092. self["@mapping"]=_st($Dictionary())._new();
  1093. _st(_st(self)._items())._do_((function(each){
  1094. return smalltalk.withContext(function($ctx2) {
  1095. return _st(self)._renderItem_on_(each,html);
  1096. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1097. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},smalltalk.HLListWidget)})},
  1098. messageSends: ["new", "do:", "renderItem:on:", "items"]}),
  1099. smalltalk.HLListWidget);
  1100. smalltalk.addMethod(
  1101. smalltalk.method({
  1102. selector: "selectItem:",
  1103. fn: function (anObject){
  1104. var self=this;
  1105. return smalltalk.withContext(function($ctx1) {
  1106. _st(self)._selectedItem_(anObject);
  1107. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1108. messageSends: ["selectedItem:"]}),
  1109. smalltalk.HLListWidget);
  1110. smalltalk.addMethod(
  1111. smalltalk.method({
  1112. selector: "selectedItem",
  1113. fn: function (){
  1114. var self=this;
  1115. return smalltalk.withContext(function($ctx1) {
  1116. var $1;
  1117. $1=self["@selectedItem"];
  1118. return $1;
  1119. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLListWidget)})},
  1120. messageSends: []}),
  1121. smalltalk.HLListWidget);
  1122. smalltalk.addMethod(
  1123. smalltalk.method({
  1124. selector: "selectedItem:",
  1125. fn: function (anObject){
  1126. var self=this;
  1127. return smalltalk.withContext(function($ctx1) {
  1128. self["@selectedItem"]=anObject;
  1129. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1130. messageSends: []}),
  1131. smalltalk.HLListWidget);
  1132. smalltalk.addMethod(
  1133. smalltalk.method({
  1134. selector: "setupKeyBindings",
  1135. fn: function (){
  1136. var self=this;
  1137. var active,interval,delay,repeatInterval;
  1138. return smalltalk.withContext(function($ctx1) {
  1139. var $1,$2,$3,$4,$5;
  1140. active=false;
  1141. repeatInterval=(70);
  1142. _st(_st(_st(self)._wrapper())._asJQuery())._unbind_("keydown");
  1143. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  1144. return smalltalk.withContext(function($ctx2) {
  1145. $1=_st(_st(_st(e)._which()).__eq((38)))._and_((function(){
  1146. return smalltalk.withContext(function($ctx3) {
  1147. return _st(active).__eq(false);
  1148. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1149. if(smalltalk.assert($1)){
  1150. active=true;
  1151. active;
  1152. _st(self)._activatePreviousListItem();
  1153. delay=_st((function(){
  1154. return smalltalk.withContext(function($ctx3) {
  1155. interval=_st((function(){
  1156. return smalltalk.withContext(function($ctx4) {
  1157. return _st(self)._activatePreviousListItem();
  1158. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1159. return interval;
  1160. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1161. delay;
  1162. };
  1163. $2=_st(_st(_st(e)._which()).__eq((40)))._and_((function(){
  1164. return smalltalk.withContext(function($ctx3) {
  1165. return _st(active).__eq(false);
  1166. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1167. if(smalltalk.assert($2)){
  1168. active=true;
  1169. active;
  1170. _st(self)._activateNextListItem();
  1171. delay=_st((function(){
  1172. return smalltalk.withContext(function($ctx3) {
  1173. interval=_st((function(){
  1174. return smalltalk.withContext(function($ctx4) {
  1175. return _st(self)._activateNextListItem();
  1176. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  1177. return interval;
  1178. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1179. return delay;
  1180. };
  1181. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1182. _st(_st(_st(self)._wrapper())._asJQuery())._keyup_((function(e){
  1183. return smalltalk.withContext(function($ctx2) {
  1184. $3=active;
  1185. if(smalltalk.assert($3)){
  1186. active=false;
  1187. active;
  1188. $4=interval;
  1189. if(($receiver = $4) == nil || $receiver == undefined){
  1190. $4;
  1191. } else {
  1192. _st(interval)._clearInterval();
  1193. };
  1194. $5=delay;
  1195. if(($receiver = $5) == nil || $receiver == undefined){
  1196. return $5;
  1197. } else {
  1198. return _st(delay)._clearTimeout();
  1199. };
  1200. };
  1201. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1202. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{active:active,interval:interval,delay:delay,repeatInterval:repeatInterval},smalltalk.HLListWidget)})},
  1203. messageSends: ["unbind:", "asJQuery", "wrapper", "keydown:", "ifTrue:", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "and:", "=", "which", "activateNextListItem", "keyup:", "ifNotNil:", "clearInterval", "clearTimeout"]}),
  1204. smalltalk.HLListWidget);
  1205. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  1206. smalltalk.addMethod(
  1207. smalltalk.method({
  1208. selector: "next",
  1209. fn: function (){
  1210. var self=this;
  1211. return smalltalk.withContext(function($ctx1) {
  1212. var $1;
  1213. $1=self["@next"];
  1214. return $1;
  1215. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.HLNavigationListWidget)})},
  1216. messageSends: []}),
  1217. smalltalk.HLNavigationListWidget);
  1218. smalltalk.addMethod(
  1219. smalltalk.method({
  1220. selector: "next:",
  1221. fn: function (aWidget){
  1222. var self=this;
  1223. return smalltalk.withContext(function($ctx1) {
  1224. var $1;
  1225. self["@next"]=aWidget;
  1226. $1=_st(_st(aWidget)._previous()).__eq(self);
  1227. if(! smalltalk.assert($1)){
  1228. _st(aWidget)._previous_(self);
  1229. };
  1230. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  1231. messageSends: ["ifFalse:", "previous:", "=", "previous"]}),
  1232. smalltalk.HLNavigationListWidget);
  1233. smalltalk.addMethod(
  1234. smalltalk.method({
  1235. selector: "nextFocus",
  1236. fn: function (){
  1237. var self=this;
  1238. return smalltalk.withContext(function($ctx1) {
  1239. var $1;
  1240. $1=_st(self)._next();
  1241. if(($receiver = $1) == nil || $receiver == undefined){
  1242. $1;
  1243. } else {
  1244. _st(_st(self)._next())._focus();
  1245. };
  1246. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{},smalltalk.HLNavigationListWidget)})},
  1247. messageSends: ["ifNotNil:", "focus", "next"]}),
  1248. smalltalk.HLNavigationListWidget);
  1249. smalltalk.addMethod(
  1250. smalltalk.method({
  1251. selector: "previous",
  1252. fn: function (){
  1253. var self=this;
  1254. return smalltalk.withContext(function($ctx1) {
  1255. var $1;
  1256. $1=self["@previous"];
  1257. return $1;
  1258. }, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationListWidget)})},
  1259. messageSends: []}),
  1260. smalltalk.HLNavigationListWidget);
  1261. smalltalk.addMethod(
  1262. smalltalk.method({
  1263. selector: "previous:",
  1264. fn: function (aWidget){
  1265. var self=this;
  1266. return smalltalk.withContext(function($ctx1) {
  1267. var $1;
  1268. self["@previous"]=aWidget;
  1269. $1=_st(_st(aWidget)._next()).__eq(self);
  1270. if(! smalltalk.assert($1)){
  1271. _st(aWidget)._next_(self);
  1272. };
  1273. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  1274. messageSends: ["ifFalse:", "next:", "=", "next"]}),
  1275. smalltalk.HLNavigationListWidget);
  1276. smalltalk.addMethod(
  1277. smalltalk.method({
  1278. selector: "previousFocus",
  1279. fn: function (){
  1280. var self=this;
  1281. return smalltalk.withContext(function($ctx1) {
  1282. var $1;
  1283. $1=_st(self)._previous();
  1284. if(($receiver = $1) == nil || $receiver == undefined){
  1285. $1;
  1286. } else {
  1287. _st(_st(self)._previous())._focus();
  1288. };
  1289. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{},smalltalk.HLNavigationListWidget)})},
  1290. messageSends: ["ifNotNil:", "focus", "previous"]}),
  1291. smalltalk.HLNavigationListWidget);
  1292. smalltalk.addMethod(
  1293. smalltalk.method({
  1294. selector: "setupKeyBindings",
  1295. fn: function (){
  1296. var self=this;
  1297. return smalltalk.withContext(function($ctx1) {
  1298. var $1,$2;
  1299. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  1300. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  1301. return smalltalk.withContext(function($ctx2) {
  1302. $1=_st(_st(e)._which()).__eq((39));
  1303. if(smalltalk.assert($1)){
  1304. _st(self)._nextFocus();
  1305. };
  1306. $2=_st(_st(e)._which()).__eq((37));
  1307. if(smalltalk.assert($2)){
  1308. return _st(self)._previousFocus();
  1309. };
  1310. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1311. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLNavigationListWidget)})},
  1312. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery", "wrapper"]}),
  1313. smalltalk.HLNavigationListWidget);
  1314. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  1315. smalltalk.addMethod(
  1316. smalltalk.method({
  1317. selector: "activate:",
  1318. fn: function (aTab){
  1319. var self=this;
  1320. return smalltalk.withContext(function($ctx1) {
  1321. var $1,$2;
  1322. _st(_st(self)._keyBinder())._flushBindings();
  1323. _st(aTab)._registerBindings();
  1324. self["@activeTab"]=aTab;
  1325. $1=self;
  1326. _st($1)._refresh();
  1327. _st($1)._addToHistory_(aTab);
  1328. $2=_st($1)._show_(aTab);
  1329. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
  1330. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"]}),
  1331. smalltalk.HLManager);
  1332. smalltalk.addMethod(
  1333. smalltalk.method({
  1334. selector: "activeTab",
  1335. fn: function (){
  1336. var self=this;
  1337. return smalltalk.withContext(function($ctx1) {
  1338. var $1;
  1339. $1=self["@activeTab"];
  1340. return $1;
  1341. }, function($ctx1) {$ctx1.fill(self,"activeTab",{},smalltalk.HLManager)})},
  1342. messageSends: []}),
  1343. smalltalk.HLManager);
  1344. smalltalk.addMethod(
  1345. smalltalk.method({
  1346. selector: "addTab:",
  1347. fn: function (aTab){
  1348. var self=this;
  1349. return smalltalk.withContext(function($ctx1) {
  1350. _st(_st(self)._tabs())._add_(aTab);
  1351. _st(self)._activate_(aTab);
  1352. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},smalltalk.HLManager)})},
  1353. messageSends: ["add:", "tabs", "activate:"]}),
  1354. smalltalk.HLManager);
  1355. smalltalk.addMethod(
  1356. smalltalk.method({
  1357. selector: "addToHistory:",
  1358. fn: function (aTab){
  1359. var self=this;
  1360. return smalltalk.withContext(function($ctx1) {
  1361. _st(self)._removeFromHistory_(aTab);
  1362. _st(_st(self)._history())._add_(aTab);
  1363. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab},smalltalk.HLManager)})},
  1364. messageSends: ["removeFromHistory:", "add:", "history"]}),
  1365. smalltalk.HLManager);
  1366. smalltalk.addMethod(
  1367. smalltalk.method({
  1368. selector: "confirm:ifFalse:",
  1369. fn: function (aString,aBlock){
  1370. var self=this;
  1371. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  1372. return smalltalk.withContext(function($ctx1) {
  1373. var $1,$2;
  1374. $1=_st($HLConfirmation())._new();
  1375. _st($1)._confirmationString_(aString);
  1376. _st($1)._cancelBlock_(aBlock);
  1377. $2=_st($1)._yourself();
  1378. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  1379. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  1380. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "cancelBlock:", "yourself"]}),
  1381. smalltalk.HLManager);
  1382. smalltalk.addMethod(
  1383. smalltalk.method({
  1384. selector: "confirm:ifTrue:",
  1385. fn: function (aString,aBlock){
  1386. var self=this;
  1387. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  1388. return smalltalk.withContext(function($ctx1) {
  1389. var $1,$2;
  1390. $1=_st($HLConfirmation())._new();
  1391. _st($1)._confirmationString_(aString);
  1392. _st($1)._actionBlock_(aBlock);
  1393. $2=_st($1)._yourself();
  1394. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  1395. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  1396. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "yourself"]}),
  1397. smalltalk.HLManager);
  1398. smalltalk.addMethod(
  1399. smalltalk.method({
  1400. selector: "defaultEnvironment",
  1401. fn: function (){
  1402. var self=this;
  1403. function $Environment(){return smalltalk.Environment||(typeof Environment=="undefined"?nil:Environment)}
  1404. return smalltalk.withContext(function($ctx1) {
  1405. var $1,$2,$3;
  1406. $1=_st(window)._parent();
  1407. if(($receiver = $1) == nil || $receiver == undefined){
  1408. $2=_st($Environment())._new();
  1409. return $2;
  1410. } else {
  1411. $1;
  1412. };
  1413. $3=_st(_st(_st(_st(window)._parent())._at_("smalltalk"))._at_("Environment"))._new();
  1414. return $3;
  1415. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{},smalltalk.HLManager)})},
  1416. messageSends: ["ifNil:", "new", "parent", "at:"]}),
  1417. smalltalk.HLManager);
  1418. smalltalk.addMethod(
  1419. smalltalk.method({
  1420. selector: "environment",
  1421. fn: function (){
  1422. var self=this;
  1423. return smalltalk.withContext(function($ctx1) {
  1424. var $2,$1;
  1425. $2=self["@environment"];
  1426. if(($receiver = $2) == nil || $receiver == undefined){
  1427. self["@environment"]=_st(self)._defaultEnvironment();
  1428. $1=self["@environment"];
  1429. } else {
  1430. $1=$2;
  1431. };
  1432. return $1;
  1433. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLManager)})},
  1434. messageSends: ["ifNil:", "defaultEnvironment"]}),
  1435. smalltalk.HLManager);
  1436. smalltalk.addMethod(
  1437. smalltalk.method({
  1438. selector: "environment:",
  1439. fn: function (anEnvironment){
  1440. var self=this;
  1441. return smalltalk.withContext(function($ctx1) {
  1442. self["@environment"]=anEnvironment;
  1443. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLManager)})},
  1444. messageSends: []}),
  1445. smalltalk.HLManager);
  1446. smalltalk.addMethod(
  1447. smalltalk.method({
  1448. selector: "history",
  1449. fn: function (){
  1450. var self=this;
  1451. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1452. return smalltalk.withContext(function($ctx1) {
  1453. var $2,$1;
  1454. $2=self["@history"];
  1455. if(($receiver = $2) == nil || $receiver == undefined){
  1456. self["@history"]=_st($OrderedCollection())._new();
  1457. $1=self["@history"];
  1458. } else {
  1459. $1=$2;
  1460. };
  1461. return $1;
  1462. }, function($ctx1) {$ctx1.fill(self,"history",{},smalltalk.HLManager)})},
  1463. messageSends: ["ifNil:", "new"]}),
  1464. smalltalk.HLManager);
  1465. smalltalk.addMethod(
  1466. smalltalk.method({
  1467. selector: "history:",
  1468. fn: function (aCollection){
  1469. var self=this;
  1470. return smalltalk.withContext(function($ctx1) {
  1471. self["@history"]=aCollection;
  1472. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection},smalltalk.HLManager)})},
  1473. messageSends: []}),
  1474. smalltalk.HLManager);
  1475. smalltalk.addMethod(
  1476. smalltalk.method({
  1477. selector: "initialize",
  1478. fn: function (){
  1479. var self=this;
  1480. return smalltalk.withContext(function($ctx1) {
  1481. smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  1482. _st(_st(self)._keyBinder())._setupEvents();
  1483. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager)})},
  1484. messageSends: ["initialize", "setupEvents", "keyBinder"]}),
  1485. smalltalk.HLManager);
  1486. smalltalk.addMethod(
  1487. smalltalk.method({
  1488. selector: "keyBinder",
  1489. fn: function (){
  1490. var self=this;
  1491. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  1492. return smalltalk.withContext(function($ctx1) {
  1493. var $2,$1;
  1494. $2=self["@keyBinder"];
  1495. if(($receiver = $2) == nil || $receiver == undefined){
  1496. self["@keyBinder"]=_st($HLKeyBinder())._new();
  1497. $1=self["@keyBinder"];
  1498. } else {
  1499. $1=$2;
  1500. };
  1501. return $1;
  1502. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},smalltalk.HLManager)})},
  1503. messageSends: ["ifNil:", "new"]}),
  1504. smalltalk.HLManager);
  1505. smalltalk.addMethod(
  1506. smalltalk.method({
  1507. selector: "refresh",
  1508. fn: function (){
  1509. var self=this;
  1510. return smalltalk.withContext(function($ctx1) {
  1511. _st(_st(window)._jQuery_(".navbar"))._remove();
  1512. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  1513. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
  1514. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"]}),
  1515. smalltalk.HLManager);
  1516. smalltalk.addMethod(
  1517. smalltalk.method({
  1518. selector: "removeActiveTab",
  1519. fn: function (){
  1520. var self=this;
  1521. return smalltalk.withContext(function($ctx1) {
  1522. _st(self)._removeTab_(_st(self)._activeTab());
  1523. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},smalltalk.HLManager)})},
  1524. messageSends: ["removeTab:", "activeTab"]}),
  1525. smalltalk.HLManager);
  1526. smalltalk.addMethod(
  1527. smalltalk.method({
  1528. selector: "removeFromHistory:",
  1529. fn: function (aTab){
  1530. var self=this;
  1531. return smalltalk.withContext(function($ctx1) {
  1532. _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  1533. return smalltalk.withContext(function($ctx2) {
  1534. return _st(each).__eq_eq(aTab);
  1535. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  1536. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab},smalltalk.HLManager)})},
  1537. messageSends: ["history:", "reject:", "==", "history"]}),
  1538. smalltalk.HLManager);
  1539. smalltalk.addMethod(
  1540. smalltalk.method({
  1541. selector: "removeTab:",
  1542. fn: function (aTab){
  1543. var self=this;
  1544. return smalltalk.withContext(function($ctx1) {
  1545. var $1,$2;
  1546. $1=_st(_st(self)._tabs())._includes_(aTab);
  1547. if(! smalltalk.assert($1)){
  1548. $2=self;
  1549. return $2;
  1550. };
  1551. _st(self)._removeFromHistory_(aTab);
  1552. _st(_st(self)._tabs())._remove_(aTab);
  1553. _st(_st(self)._keyBinder())._flushBindings();
  1554. _st(aTab)._remove();
  1555. _st(self)._refresh();
  1556. _st(_st(self)._history())._ifNotEmpty_((function(){
  1557. return smalltalk.withContext(function($ctx2) {
  1558. return _st(_st(_st(self)._history())._last())._activate();
  1559. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1560. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  1561. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"]}),
  1562. smalltalk.HLManager);
  1563. smalltalk.addMethod(
  1564. smalltalk.method({
  1565. selector: "renderAddOn:",
  1566. fn: function (html){
  1567. var self=this;
  1568. function $HLWidget(){return smalltalk.HLWidget||(typeof HLWidget=="undefined"?nil:HLWidget)}
  1569. return smalltalk.withContext(function($ctx1) {
  1570. var $1,$3,$4,$5,$7,$8,$6,$2;
  1571. $1=_st(html)._li();
  1572. _st($1)._class_("dropdown");
  1573. $2=_st($1)._with_((function(){
  1574. return smalltalk.withContext(function($ctx2) {
  1575. $3=_st(html)._a();
  1576. _st($3)._class_("dropdown-toggle");
  1577. _st($3)._at_put_("data-toggle","dropdown");
  1578. $4=_st($3)._with_((function(){
  1579. return smalltalk.withContext(function($ctx3) {
  1580. _st(html)._with_("Open...");
  1581. return _st(_st(html)._tag_("b"))._class_("caret");
  1582. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1583. $4;
  1584. $5=_st(html)._ul();
  1585. _st($5)._class_("dropdown-menu");
  1586. $6=_st($5)._with_((function(){
  1587. return smalltalk.withContext(function($ctx3) {
  1588. return _st(_st(_st(_st($HLWidget())._withAllSubclasses())._select_((function(each){
  1589. return smalltalk.withContext(function($ctx4) {
  1590. return _st(each)._canBeOpenAsTab();
  1591. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  1592. return smalltalk.withContext(function($ctx4) {
  1593. return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  1594. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  1595. return smalltalk.withContext(function($ctx4) {
  1596. return _st(_st(html)._li())._with_((function(){
  1597. return smalltalk.withContext(function($ctx5) {
  1598. $7=_st(html)._a();
  1599. _st($7)._with_(_st(each)._tabLabel());
  1600. $8=_st($7)._onClick_((function(){
  1601. return smalltalk.withContext(function($ctx6) {
  1602. return _st(each)._openAsTab();
  1603. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1604. return $8;
  1605. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1606. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  1607. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1608. return $6;
  1609. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1610. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html},smalltalk.HLManager)})},
  1611. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"]}),
  1612. smalltalk.HLManager);
  1613. smalltalk.addMethod(
  1614. smalltalk.method({
  1615. selector: "renderContentOn:",
  1616. fn: function (html){
  1617. var self=this;
  1618. return smalltalk.withContext(function($ctx1) {
  1619. var $1,$3,$4,$2;
  1620. $1=_st(html)._div();
  1621. _st($1)._class_("navbar navbar-fixed-top");
  1622. $2=_st($1)._with_((function(){
  1623. return smalltalk.withContext(function($ctx2) {
  1624. $3=_st(html)._div();
  1625. _st($3)._class_("navbar-inner");
  1626. $4=_st($3)._with_((function(){
  1627. return smalltalk.withContext(function($ctx3) {
  1628. return _st(self)._renderTabsOn_(html);
  1629. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1630. return $4;
  1631. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1632. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
  1633. messageSends: ["class:", "div", "with:", "renderTabsOn:"]}),
  1634. smalltalk.HLManager);
  1635. smalltalk.addMethod(
  1636. smalltalk.method({
  1637. selector: "renderTabsOn:",
  1638. fn: function (html){
  1639. var self=this;
  1640. return smalltalk.withContext(function($ctx1) {
  1641. var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  1642. $1=_st(html)._ul();
  1643. _st($1)._class_("nav");
  1644. $2=_st($1)._with_((function(){
  1645. return smalltalk.withContext(function($ctx2) {
  1646. _st(_st(self)._tabs())._do_((function(each){
  1647. return smalltalk.withContext(function($ctx3) {
  1648. $3=_st(html)._li();
  1649. $4=$3;
  1650. $6=_st(each)._isActive();
  1651. if(smalltalk.assert($6)){
  1652. $5="active";
  1653. } else {
  1654. $5="inactive";
  1655. };
  1656. _st($4)._class_($5);
  1657. $7=_st($3)._with_((function(){
  1658. return smalltalk.withContext(function($ctx4) {
  1659. $8=_st(html)._a();
  1660. _st($8)._with_((function(){
  1661. return smalltalk.withContext(function($ctx5) {
  1662. _st(_st(_st(html)._tag_("i"))._class_("icon-remove"))._onClick_((function(){
  1663. return smalltalk.withContext(function($ctx6) {
  1664. return _st(self)._removeTab_(each);
  1665. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  1666. return _st(html)._with_(_st(each)._displayLabel());
  1667. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1668. $9=_st($8)._onClick_((function(){
  1669. return smalltalk.withContext(function($ctx5) {
  1670. return _st(each)._activate();
  1671. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  1672. return $9;
  1673. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1674. return $7;
  1675. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1676. return _st(self)._renderAddOn_(html);
  1677. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1678. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  1679. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "displayLabel", "a", "activate", "tabs", "renderAddOn:"]}),
  1680. smalltalk.HLManager);
  1681. smalltalk.addMethod(
  1682. smalltalk.method({
  1683. selector: "show:",
  1684. fn: function (aTab){
  1685. var self=this;
  1686. return smalltalk.withContext(function($ctx1) {
  1687. var $1,$2;
  1688. _st(_st(self)._tabs())._do_((function(each){
  1689. return smalltalk.withContext(function($ctx2) {
  1690. return _st(each)._hide();
  1691. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  1692. $1=aTab;
  1693. _st($1)._show();
  1694. $2=_st($1)._focus();
  1695. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  1696. messageSends: ["do:", "hide", "tabs", "show", "focus"]}),
  1697. smalltalk.HLManager);
  1698. smalltalk.addMethod(
  1699. smalltalk.method({
  1700. selector: "tabs",
  1701. fn: function (){
  1702. var self=this;
  1703. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  1704. return smalltalk.withContext(function($ctx1) {
  1705. var $2,$1;
  1706. $2=self["@tabs"];
  1707. if(($receiver = $2) == nil || $receiver == undefined){
  1708. self["@tabs"]=_st($OrderedCollection())._new();
  1709. $1=self["@tabs"];
  1710. } else {
  1711. $1=$2;
  1712. };
  1713. return $1;
  1714. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLManager)})},
  1715. messageSends: ["ifNil:", "new"]}),
  1716. smalltalk.HLManager);
  1717. smalltalk.HLManager.klass.iVarNames = ['current'];
  1718. smalltalk.addMethod(
  1719. smalltalk.method({
  1720. selector: "current",
  1721. fn: function (){
  1722. var self=this;
  1723. return smalltalk.withContext(function($ctx1) {
  1724. var $2,$1;
  1725. $2=self["@current"];
  1726. if(($receiver = $2) == nil || $receiver == undefined){
  1727. self["@current"]=_st(_st(self)._basicNew())._initialize();
  1728. $1=self["@current"];
  1729. } else {
  1730. $1=$2;
  1731. };
  1732. return $1;
  1733. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.HLManager.klass)})},
  1734. messageSends: ["ifNil:", "initialize", "basicNew"]}),
  1735. smalltalk.HLManager.klass);
  1736. smalltalk.addMethod(
  1737. smalltalk.method({
  1738. selector: "initialize",
  1739. fn: function (){
  1740. var self=this;
  1741. return smalltalk.withContext(function($ctx1) {
  1742. _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  1743. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager.klass)})},
  1744. messageSends: ["appendToJQuery:", "asJQuery", "current"]}),
  1745. smalltalk.HLManager.klass);
  1746. smalltalk.addMethod(
  1747. smalltalk.method({
  1748. selector: "new",
  1749. fn: function (){
  1750. var self=this;
  1751. return smalltalk.withContext(function($ctx1) {
  1752. _st(self)._shouldNotImplement();
  1753. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.HLManager.klass)})},
  1754. messageSends: ["shouldNotImplement"]}),
  1755. smalltalk.HLManager.klass);
  1756. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  1757. smalltalk.addMethod(
  1758. smalltalk.method({
  1759. selector: "canBeOpenAsTab",
  1760. fn: function (){
  1761. var self=this;
  1762. return smalltalk.withContext(function($ctx1) {
  1763. return true;
  1764. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSUnit.klass)})},
  1765. messageSends: []}),
  1766. smalltalk.HLSUnit.klass);
  1767. smalltalk.addMethod(
  1768. smalltalk.method({
  1769. selector: "tabLabel",
  1770. fn: function (){
  1771. var self=this;
  1772. return smalltalk.withContext(function($ctx1) {
  1773. return "SUnit";
  1774. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLSUnit.klass)})},
  1775. messageSends: []}),
  1776. smalltalk.HLSUnit.klass);
  1777. smalltalk.addMethod(
  1778. smalltalk.method({
  1779. selector: "tabPriority",
  1780. fn: function (){
  1781. var self=this;
  1782. return smalltalk.withContext(function($ctx1) {
  1783. var $1;
  1784. $1=(1000);
  1785. return $1;
  1786. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLSUnit.klass)})},
  1787. messageSends: []}),
  1788. smalltalk.HLSUnit.klass);
  1789. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  1790. smalltalk.addMethod(
  1791. smalltalk.method({
  1792. selector: "canBeOpenAsTab",
  1793. fn: function (){
  1794. var self=this;
  1795. return smalltalk.withContext(function($ctx1) {
  1796. return true;
  1797. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLTranscript.klass)})},
  1798. messageSends: []}),
  1799. smalltalk.HLTranscript.klass);
  1800. smalltalk.addMethod(
  1801. smalltalk.method({
  1802. selector: "tabLabel",
  1803. fn: function (){
  1804. var self=this;
  1805. return smalltalk.withContext(function($ctx1) {
  1806. return "Transcript";
  1807. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLTranscript.klass)})},
  1808. messageSends: []}),
  1809. smalltalk.HLTranscript.klass);
  1810. smalltalk.addMethod(
  1811. smalltalk.method({
  1812. selector: "tabPriority",
  1813. fn: function (){
  1814. var self=this;
  1815. return smalltalk.withContext(function($ctx1) {
  1816. var $1;
  1817. $1=(600);
  1818. return $1;
  1819. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLTranscript.klass)})},
  1820. messageSends: []}),
  1821. smalltalk.HLTranscript.klass);