Helios.deploy.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. smalltalk.addPackage('Helios', {});
  2. smalltalk.addClass('HLBrowser', smalltalk.Widget, [], 'Helios');
  3. smalltalk.addClass('HLDebugger', smalltalk.Widget, [], 'Helios');
  4. smalltalk.addClass('HLInspector', smalltalk.Widget, [], 'Helios');
  5. smalltalk.addClass('HLSUnit', smalltalk.Widget, [], 'Helios');
  6. smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], 'Helios');
  7. smalltalk.addMethod(
  8. "_activate",
  9. smalltalk.method({
  10. selector: "activate",
  11. fn: function (){
  12. var self=this;
  13. smalltalk.send(smalltalk.send(self,"_manager",[]),"_activate_",[self]);
  14. return self}
  15. }),
  16. smalltalk.HLTab);
  17. smalltalk.addMethod(
  18. "_add",
  19. smalltalk.method({
  20. selector: "add",
  21. fn: function (){
  22. var self=this;
  23. smalltalk.send(smalltalk.send(self,"_manager",[]),"_addTab_",[self]);
  24. return self}
  25. }),
  26. smalltalk.HLTab);
  27. smalltalk.addMethod(
  28. "_isActive",
  29. smalltalk.method({
  30. selector: "isActive",
  31. fn: function (){
  32. var self=this;
  33. var $1;
  34. $1=smalltalk.send(smalltalk.send(smalltalk.send(self,"_manager",[]),"_activeTab",[]),"__eq",[self]);
  35. return $1;
  36. }
  37. }),
  38. smalltalk.HLTab);
  39. smalltalk.addMethod(
  40. "_label",
  41. smalltalk.method({
  42. selector: "label",
  43. fn: function (){
  44. var self=this;
  45. var $1;
  46. if(($receiver = self["@label"]) == nil || $receiver == undefined){
  47. $1="";
  48. } else {
  49. $1=self["@label"];
  50. };
  51. return $1;
  52. }
  53. }),
  54. smalltalk.HLTab);
  55. smalltalk.addMethod(
  56. "_label_",
  57. smalltalk.method({
  58. selector: "label:",
  59. fn: function (aString){
  60. var self=this;
  61. self["@label"]=aString;
  62. return self}
  63. }),
  64. smalltalk.HLTab);
  65. smalltalk.addMethod(
  66. "_manager",
  67. smalltalk.method({
  68. selector: "manager",
  69. fn: function (){
  70. var self=this;
  71. var $1;
  72. $1=smalltalk.send((smalltalk.HLTabManager || HLTabManager),"_current",[]);
  73. return $1;
  74. }
  75. }),
  76. smalltalk.HLTab);
  77. smalltalk.addMethod(
  78. "_widget",
  79. smalltalk.method({
  80. selector: "widget",
  81. fn: function (){
  82. var self=this;
  83. return self["@widget"];
  84. }
  85. }),
  86. smalltalk.HLTab);
  87. smalltalk.addMethod(
  88. "_widget_",
  89. smalltalk.method({
  90. selector: "widget:",
  91. fn: function (aWidget){
  92. var self=this;
  93. self["@widget"]=aWidget;
  94. return self}
  95. }),
  96. smalltalk.HLTab);
  97. smalltalk.addMethod(
  98. "_on_labelled_",
  99. smalltalk.method({
  100. selector: "on:labelled:",
  101. fn: function (aWidget,aString){
  102. var self=this;
  103. var $2,$3,$1;
  104. $2=smalltalk.send(self,"_new",[]);
  105. smalltalk.send($2,"_widget_",[aWidget]);
  106. smalltalk.send($2,"_label_",[aString]);
  107. $3=smalltalk.send($2,"_yourself",[]);
  108. $1=$3;
  109. return $1;
  110. }
  111. }),
  112. smalltalk.HLTab.klass);
  113. smalltalk.addClass('HLTabManager', smalltalk.Widget, ['tabs', 'activeTab'], 'Helios');
  114. smalltalk.addMethod(
  115. "_activate_",
  116. smalltalk.method({
  117. selector: "activate:",
  118. fn: function (aTab){
  119. var self=this;
  120. var $1;
  121. self["@activeTab"]=aTab;
  122. smalltalk.send(self,"_refresh",[]);
  123. $1=smalltalk.send(self,"_show_",[aTab]);
  124. return self}
  125. }),
  126. smalltalk.HLTabManager);
  127. smalltalk.addMethod(
  128. "_activeTab",
  129. smalltalk.method({
  130. selector: "activeTab",
  131. fn: function (){
  132. var self=this;
  133. return self["@activeTab"];
  134. }
  135. }),
  136. smalltalk.HLTabManager);
  137. smalltalk.addMethod(
  138. "_addTab_",
  139. smalltalk.method({
  140. selector: "addTab:",
  141. fn: function (aTab){
  142. var self=this;
  143. smalltalk.send(smalltalk.send(self,"_tabs",[]),"_add_",[aTab]);
  144. smalltalk.send(self,"_refresh",[]);
  145. return self}
  146. }),
  147. smalltalk.HLTabManager);
  148. smalltalk.addMethod(
  149. "_refresh",
  150. smalltalk.method({
  151. selector: "refresh",
  152. fn: function (){
  153. var self=this;
  154. smalltalk.send(smalltalk.send(window,"_jQuery_",[".navbar"]),"_remove",[]);
  155. smalltalk.send(smalltalk.send(window,"_jQuery_",["#container"]),"_remove",[]);
  156. smalltalk.send(self,"_appendToJQuery_",[smalltalk.send("body","_asJQuery",[])]);
  157. return self}
  158. }),
  159. smalltalk.HLTabManager);
  160. smalltalk.addMethod(
  161. "_removeTab_",
  162. smalltalk.method({
  163. selector: "removeTab:",
  164. fn: function (aTab){
  165. var self=this;
  166. var $1;
  167. $1=smalltalk.send(smalltalk.send(self,"_tabs",[]),"_includes_",[aTab]);
  168. if(! smalltalk.assert($1)){
  169. return self;
  170. };
  171. smalltalk.send(smalltalk.send(self,"_tabs",[]),"_remove_",[aTab]);
  172. smalltalk.send(self,"_refresh",[]);
  173. return self}
  174. }),
  175. smalltalk.HLTabManager);
  176. smalltalk.addMethod(
  177. "_renderOn_",
  178. smalltalk.method({
  179. selector: "renderOn:",
  180. fn: function (html){
  181. var self=this;
  182. var $1,$3,$4,$2;
  183. $1=smalltalk.send(html,"_div",[]);
  184. smalltalk.send($1,"_class_",["navbar navbar-fixed-top"]);
  185. $2=smalltalk.send($1,"_with_",[(function(){
  186. $3=smalltalk.send(html,"_div",[]);
  187. smalltalk.send($3,"_class_",["navbar-inner"]);
  188. $4=smalltalk.send($3,"_with_",[(function(){
  189. return smalltalk.send(self,"_renderTabsOn_",[html]);
  190. })]);
  191. return $4;
  192. })]);
  193. smalltalk.send(smalltalk.send(html,"_div",[]),"_id_",["container"]);
  194. return self}
  195. }),
  196. smalltalk.HLTabManager);
  197. smalltalk.addMethod(
  198. "_renderTabsOn_",
  199. smalltalk.method({
  200. selector: "renderTabsOn:",
  201. fn: function (html){
  202. var self=this;
  203. var $1,$3,$5,$4,$7,$8,$6,$2;
  204. $1=smalltalk.send(html,"_ul",[]);
  205. smalltalk.send($1,"_class_",["nav"]);
  206. $2=smalltalk.send($1,"_with_",[(function(){
  207. return smalltalk.send(smalltalk.send(self,"_tabs",[]),"_do_",[(function(each){
  208. $3=smalltalk.send(html,"_li",[]);
  209. $5=smalltalk.send(each,"_isActive",[]);
  210. if(smalltalk.assert($5)){
  211. $4="active";
  212. } else {
  213. $4="inactive";
  214. };
  215. smalltalk.send($3,"_class_",[$4]);
  216. $6=smalltalk.send($3,"_with_",[(function(){
  217. $7=smalltalk.send(html,"_a",[]);
  218. smalltalk.send($7,"_with_",[smalltalk.send(each,"_label",[])]);
  219. $8=smalltalk.send($7,"_onClick_",[(function(){
  220. return smalltalk.send(each,"_activate",[]);
  221. })]);
  222. return $8;
  223. })]);
  224. return $6;
  225. })]);
  226. })]);
  227. return self}
  228. }),
  229. smalltalk.HLTabManager);
  230. smalltalk.addMethod(
  231. "_show_",
  232. smalltalk.method({
  233. selector: "show:",
  234. fn: function (aTab){
  235. var self=this;
  236. smalltalk.send(smalltalk.send(window,"_jQuery_",["#container"]),"_empty",[]);
  237. smalltalk.send(smalltalk.send(aTab,"_widget",[]),"_appendToJQuery_",[smalltalk.send("#container","_asJQuery",[])]);
  238. return self}
  239. }),
  240. smalltalk.HLTabManager);
  241. smalltalk.addMethod(
  242. "_tabs",
  243. smalltalk.method({
  244. selector: "tabs",
  245. fn: function (){
  246. var self=this;
  247. var $1;
  248. if(($receiver = self["@tabs"]) == nil || $receiver == undefined){
  249. self["@tabs"]=smalltalk.send((smalltalk.OrderedCollection || OrderedCollection),"_new",[]);
  250. $1=self["@tabs"];
  251. } else {
  252. $1=self["@tabs"];
  253. };
  254. return $1;
  255. }
  256. }),
  257. smalltalk.HLTabManager);
  258. smalltalk.HLTabManager.klass.iVarNames = ['current'];
  259. smalltalk.addMethod(
  260. "_current",
  261. smalltalk.method({
  262. selector: "current",
  263. fn: function (){
  264. var self=this;
  265. var $1;
  266. if(($receiver = self["@current"]) == nil || $receiver == undefined){
  267. self["@current"]=smalltalk.send(smalltalk.send(self,"_basicNew",[]),"_initialize",[]);
  268. $1=self["@current"];
  269. } else {
  270. $1=self["@current"];
  271. };
  272. return $1;
  273. }
  274. }),
  275. smalltalk.HLTabManager.klass);
  276. smalltalk.addMethod(
  277. "_initialize",
  278. smalltalk.method({
  279. selector: "initialize",
  280. fn: function (){
  281. var self=this;
  282. smalltalk.send(smalltalk.send(self,"_current",[]),"_appendToJQuery_",[smalltalk.send("body","_asJQuery",[])]);
  283. return self}
  284. }),
  285. smalltalk.HLTabManager.klass);
  286. smalltalk.addMethod(
  287. "_new",
  288. smalltalk.method({
  289. selector: "new",
  290. fn: function (){
  291. var self=this;
  292. smalltalk.send(self,"_shouldNotImplement",[]);
  293. return self}
  294. }),
  295. smalltalk.HLTabManager.klass);
  296. smalltalk.addClass('HLTranscript', smalltalk.Widget, [], 'Helios');
  297. smalltalk.addClass('HLWorkspace', smalltalk.Widget, [], 'Helios');