2
0

Helios-Layout.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. define("amber_core/Helios-Layout", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Helios-Core", "amber_core/Canvas", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Helios-Layout');
  3. smalltalk.packages["Helios-Layout"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLContainer', smalltalk.HLWidget, ['splitter'], 'Helios-Layout');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "renderOn:",
  8. protocol: 'rendering',
  9. fn: function (html){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) {
  12. var $1,$2;
  13. $1=_st(html)._div();
  14. _st($1)._class_("tool_container");
  15. $2=_st($1)._with_(self._splitter());
  16. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLContainer)})},
  17. args: ["html"],
  18. source: "renderOn: html\x0a\x09html div \x0a \x09class: 'tool_container'; \x0a with: self splitter",
  19. messageSends: ["class:", "div", "with:", "splitter"],
  20. referencedClasses: []
  21. }),
  22. smalltalk.HLContainer);
  23. smalltalk.addMethod(
  24. smalltalk.method({
  25. selector: "splitter",
  26. protocol: 'accessing',
  27. fn: function (){
  28. var self=this;
  29. var $1;
  30. $1=self["@splitter"];
  31. return $1;
  32. },
  33. args: [],
  34. source: "splitter\x0a\x09^ splitter",
  35. messageSends: [],
  36. referencedClasses: []
  37. }),
  38. smalltalk.HLContainer);
  39. smalltalk.addMethod(
  40. smalltalk.method({
  41. selector: "splitter:",
  42. protocol: 'accessing',
  43. fn: function (aSplitter){
  44. var self=this;
  45. self["@splitter"]=aSplitter;
  46. return self},
  47. args: ["aSplitter"],
  48. source: "splitter: aSplitter\x0a\x09splitter := aSplitter",
  49. messageSends: [],
  50. referencedClasses: []
  51. }),
  52. smalltalk.HLContainer);
  53. smalltalk.addMethod(
  54. smalltalk.method({
  55. selector: "with:",
  56. protocol: 'instance creation',
  57. fn: function (aSplitter){
  58. var self=this;
  59. return smalltalk.withContext(function($ctx1) {
  60. var $2,$3,$1;
  61. $2=self._new();
  62. _st($2)._splitter_(aSplitter);
  63. $3=_st($2)._yourself();
  64. $1=$3;
  65. return $1;
  66. }, function($ctx1) {$ctx1.fill(self,"with:",{aSplitter:aSplitter},smalltalk.HLContainer.klass)})},
  67. args: ["aSplitter"],
  68. source: "with: aSplitter\x0a\x09^ self new \x0a \x09splitter: aSplitter; \x0a yourself",
  69. messageSends: ["splitter:", "new", "yourself"],
  70. referencedClasses: []
  71. }),
  72. smalltalk.HLContainer.klass);
  73. smalltalk.addClass('HLSplitter', smalltalk.Widget, ['firstWidget', 'secondWidget', 'firstPane', 'secondPane', 'splitter'], 'Helios-Layout');
  74. smalltalk.addMethod(
  75. smalltalk.method({
  76. selector: "cssClass",
  77. protocol: 'accessing',
  78. fn: function (){
  79. var self=this;
  80. return "splitter";
  81. },
  82. args: [],
  83. source: "cssClass\x0a\x09^ 'splitter'",
  84. messageSends: [],
  85. referencedClasses: []
  86. }),
  87. smalltalk.HLSplitter);
  88. smalltalk.addMethod(
  89. smalltalk.method({
  90. selector: "firstWidget",
  91. protocol: 'accessing',
  92. fn: function (){
  93. var self=this;
  94. var $1;
  95. $1=self["@firstWidget"];
  96. return $1;
  97. },
  98. args: [],
  99. source: "firstWidget\x0a\x09^ firstWidget",
  100. messageSends: [],
  101. referencedClasses: []
  102. }),
  103. smalltalk.HLSplitter);
  104. smalltalk.addMethod(
  105. smalltalk.method({
  106. selector: "firstWidget:",
  107. protocol: 'accessing',
  108. fn: function (aWidget){
  109. var self=this;
  110. self["@firstWidget"]=aWidget;
  111. return self},
  112. args: ["aWidget"],
  113. source: "firstWidget: aWidget\x0a\x09firstWidget := aWidget",
  114. messageSends: [],
  115. referencedClasses: []
  116. }),
  117. smalltalk.HLSplitter);
  118. smalltalk.addMethod(
  119. smalltalk.method({
  120. selector: "isHeliosSplitter",
  121. protocol: 'testing',
  122. fn: function (){
  123. var self=this;
  124. return true;
  125. },
  126. args: [],
  127. source: "isHeliosSplitter\x0a\x09^ true",
  128. messageSends: [],
  129. referencedClasses: []
  130. }),
  131. smalltalk.HLSplitter);
  132. smalltalk.addMethod(
  133. smalltalk.method({
  134. selector: "panesCssClass",
  135. protocol: 'rendering',
  136. fn: function (){
  137. var self=this;
  138. return "panes";
  139. },
  140. args: [],
  141. source: "panesCssClass\x0a\x09^ 'panes'",
  142. messageSends: [],
  143. referencedClasses: []
  144. }),
  145. smalltalk.HLSplitter);
  146. smalltalk.addMethod(
  147. smalltalk.method({
  148. selector: "renderOn:",
  149. protocol: 'rendering',
  150. fn: function (html){
  151. var self=this;
  152. return smalltalk.withContext(function($ctx1) {
  153. var $1,$3,$4,$5,$6,$7,$2;
  154. $1=_st(html)._div();
  155. $ctx1.sendIdx["div"]=1;
  156. _st($1)._class_(self._panesCssClass());
  157. $ctx1.sendIdx["class:"]=1;
  158. $2=_st($1)._with_((function(){
  159. return smalltalk.withContext(function($ctx2) {
  160. $3=_st(html)._div();
  161. $ctx2.sendIdx["div"]=2;
  162. _st($3)._class_("pane");
  163. $ctx2.sendIdx["class:"]=2;
  164. $4=_st($3)._with_(self._firstWidget());
  165. $ctx2.sendIdx["with:"]=2;
  166. self["@firstPane"]=$4;
  167. self["@firstPane"];
  168. $5=_st(html)._div();
  169. $ctx2.sendIdx["div"]=3;
  170. self["@splitter"]=_st($5)._class_(self._cssClass());
  171. $ctx2.sendIdx["class:"]=3;
  172. self["@splitter"];
  173. $6=_st(html)._div();
  174. _st($6)._class_("pane");
  175. $7=_st($6)._with_(self._secondWidget());
  176. self["@secondPane"]=$7;
  177. return self["@secondPane"];
  178. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  179. $ctx1.sendIdx["with:"]=1;
  180. self._setupSplitter();
  181. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLSplitter)})},
  182. args: ["html"],
  183. source: "renderOn: html\x0a\x09html div class: self panesCssClass; with: [\x0a\x09\x09firstPane := html div class: 'pane'; with: self firstWidget.\x0a \x09splitter := html div class: self cssClass.\x0a \x09secondPane := html div class: 'pane'; with: self secondWidget ].\x0a \x0a\x09self setupSplitter",
  184. messageSends: ["class:", "div", "panesCssClass", "with:", "firstWidget", "cssClass", "secondWidget", "setupSplitter"],
  185. referencedClasses: []
  186. }),
  187. smalltalk.HLSplitter);
  188. smalltalk.addMethod(
  189. smalltalk.method({
  190. selector: "resize",
  191. protocol: 'rendering',
  192. fn: function (){
  193. var self=this;
  194. return self},
  195. args: [],
  196. source: "resize",
  197. messageSends: [],
  198. referencedClasses: []
  199. }),
  200. smalltalk.HLSplitter);
  201. smalltalk.addMethod(
  202. smalltalk.method({
  203. selector: "secondWidget",
  204. protocol: 'accessing',
  205. fn: function (){
  206. var self=this;
  207. var $1;
  208. $1=self["@secondWidget"];
  209. return $1;
  210. },
  211. args: [],
  212. source: "secondWidget\x0a\x09^ secondWidget",
  213. messageSends: [],
  214. referencedClasses: []
  215. }),
  216. smalltalk.HLSplitter);
  217. smalltalk.addMethod(
  218. smalltalk.method({
  219. selector: "secondWidget:",
  220. protocol: 'accessing',
  221. fn: function (aWidget){
  222. var self=this;
  223. self["@secondWidget"]=aWidget;
  224. return self},
  225. args: ["aWidget"],
  226. source: "secondWidget: aWidget\x0a\x09secondWidget := aWidget",
  227. messageSends: [],
  228. referencedClasses: []
  229. }),
  230. smalltalk.HLSplitter);
  231. smalltalk.addMethod(
  232. smalltalk.method({
  233. selector: "setupSplitter",
  234. protocol: 'rendering',
  235. fn: function (){
  236. var self=this;
  237. return self},
  238. args: [],
  239. source: "setupSplitter",
  240. messageSends: [],
  241. referencedClasses: []
  242. }),
  243. smalltalk.HLSplitter);
  244. smalltalk.addMethod(
  245. smalltalk.method({
  246. selector: "with:with:",
  247. protocol: 'instance creation',
  248. fn: function (aWidget,anotherWidget){
  249. var self=this;
  250. return smalltalk.withContext(function($ctx1) {
  251. var $2,$3,$1;
  252. $2=self._new();
  253. _st($2)._firstWidget_(aWidget);
  254. _st($2)._secondWidget_(anotherWidget);
  255. $3=_st($2)._yourself();
  256. $1=$3;
  257. return $1;
  258. }, function($ctx1) {$ctx1.fill(self,"with:with:",{aWidget:aWidget,anotherWidget:anotherWidget},smalltalk.HLSplitter.klass)})},
  259. args: ["aWidget", "anotherWidget"],
  260. source: "with: aWidget with: anotherWidget\x0a\x09^ self new\x0a \x09\x09firstWidget: aWidget;\x0a secondWidget: anotherWidget;\x0a yourself",
  261. messageSends: ["firstWidget:", "new", "secondWidget:", "yourself"],
  262. referencedClasses: []
  263. }),
  264. smalltalk.HLSplitter.klass);
  265. smalltalk.addClass('HLHorizontalSplitter', smalltalk.HLSplitter, [], 'Helios-Layout');
  266. smalltalk.addMethod(
  267. smalltalk.method({
  268. selector: "cssClass",
  269. protocol: 'accessing',
  270. fn: function (){
  271. var self=this;
  272. return smalltalk.withContext(function($ctx1) {
  273. var $1;
  274. $1=_st(smalltalk.HLHorizontalSplitter.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" horizontal");
  275. return $1;
  276. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLHorizontalSplitter)})},
  277. args: [],
  278. source: "cssClass\x0a\x09^ super cssClass, ' horizontal'",
  279. messageSends: [",", "cssClass"],
  280. referencedClasses: []
  281. }),
  282. smalltalk.HLHorizontalSplitter);
  283. smalltalk.addMethod(
  284. smalltalk.method({
  285. selector: "panesCssClass",
  286. protocol: 'accessing',
  287. fn: function (){
  288. var self=this;
  289. return smalltalk.withContext(function($ctx1) {
  290. var $1;
  291. $1=_st(smalltalk.HLHorizontalSplitter.superclass.fn.prototype._panesCssClass.apply(_st(self), [])).__comma(" horizontal");
  292. return $1;
  293. }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},smalltalk.HLHorizontalSplitter)})},
  294. args: [],
  295. source: "panesCssClass\x0a\x09^ super panesCssClass, ' horizontal'",
  296. messageSends: [",", "panesCssClass"],
  297. referencedClasses: []
  298. }),
  299. smalltalk.HLHorizontalSplitter);
  300. smalltalk.addMethod(
  301. smalltalk.method({
  302. selector: "resize",
  303. protocol: 'actions',
  304. fn: function (){
  305. var self=this;
  306. return smalltalk.withContext(function($ctx1) {
  307. self._resize_(_st(_st(self["@splitter"])._asJQuery())._css_("top"));
  308. return self}, function($ctx1) {$ctx1.fill(self,"resize",{},smalltalk.HLHorizontalSplitter)})},
  309. args: [],
  310. source: "resize\x0a\x09self resize: (splitter asJQuery css: 'top')",
  311. messageSends: ["resize:", "css:", "asJQuery"],
  312. referencedClasses: []
  313. }),
  314. smalltalk.HLHorizontalSplitter);
  315. smalltalk.addMethod(
  316. smalltalk.method({
  317. selector: "resize:",
  318. protocol: 'actions',
  319. fn: function (anInteger){
  320. var self=this;
  321. var container,size,offset,percentage;
  322. return smalltalk.withContext(function($ctx1) {
  323. var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
  324. $1=_st(self["@firstPane"])._asJQuery();
  325. $ctx1.sendIdx["asJQuery"]=1;
  326. container=_st($1)._parent();
  327. $3=_st(self["@firstPane"])._asJQuery();
  328. $ctx1.sendIdx["asJQuery"]=2;
  329. $2=_st($3)._offset();
  330. offset=_st($2)._top();
  331. size=_st(container)._height();
  332. $6=size;
  333. $7=_st(anInteger).__minus(offset);
  334. $ctx1.sendIdx["-"]=2;
  335. $5=_st($6).__minus($7);
  336. $ctx1.sendIdx["-"]=1;
  337. $4=_st($5).__slash(size);
  338. percentage=_st($4).__star((100));
  339. percentage=(80)._min_(_st(percentage)._max_((20)));
  340. $8=_st(self["@firstPane"])._asJQuery();
  341. $ctx1.sendIdx["asJQuery"]=3;
  342. $10=_st(percentage)._asString();
  343. $ctx1.sendIdx["asString"]=1;
  344. $9=_st($10).__comma("%");
  345. $ctx1.sendIdx[","]=1;
  346. _st($8)._css_put_("bottom",$9);
  347. $ctx1.sendIdx["css:put:"]=1;
  348. $11=_st(self["@splitter"])._asJQuery();
  349. $ctx1.sendIdx["asJQuery"]=4;
  350. $14=(100).__minus(percentage);
  351. $ctx1.sendIdx["-"]=3;
  352. $13=_st($14)._asString();
  353. $ctx1.sendIdx["asString"]=2;
  354. $12=_st($13).__comma("%");
  355. $ctx1.sendIdx[","]=2;
  356. _st($11)._css_put_("top",$12);
  357. $ctx1.sendIdx["css:put:"]=2;
  358. _st(_st(self["@secondPane"])._asJQuery())._css_put_("top",_st(_st((100).__minus(percentage))._asString()).__comma("%"));
  359. return self}, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},smalltalk.HLHorizontalSplitter)})},
  360. args: ["anInteger"],
  361. source: "resize: anInteger\x0a\x09| container size offset percentage |\x0a \x0a container := firstPane asJQuery parent.\x0a\x09offset := firstPane asJQuery offset top.\x0a size := container height.\x0a\x09\x0a\x09percentage := (size - (anInteger - offset)) / size * 100.\x0a\x09percentage := 80 min: (percentage max: 20).\x0a\x09\x0a firstPane asJQuery css: 'bottom' put: percentage asString, '%'.\x0a\x09\x0a\x09splitter asJQuery css: 'top' put: (100 - percentage) asString, '%'.\x0a\x09secondPane asJQuery css: 'top' put: (100 - percentage) asString, '%'",
  362. messageSends: ["parent", "asJQuery", "top", "offset", "height", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"],
  363. referencedClasses: []
  364. }),
  365. smalltalk.HLHorizontalSplitter);
  366. smalltalk.addMethod(
  367. smalltalk.method({
  368. selector: "setupSplitter",
  369. protocol: 'rendering',
  370. fn: function (){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) {
  373. var $1,$3,$4,$5,$6,$2;
  374. $1=_st(self["@splitter"])._asJQuery();
  375. $ctx1.sendIdx["asJQuery"]=1;
  376. $3="axis".__minus_gt("y");
  377. $ctx1.sendIdx["->"]=1;
  378. $4="containment".__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent());
  379. $ctx1.sendIdx["->"]=2;
  380. $5="helper".__minus_gt("clone");
  381. $ctx1.sendIdx["->"]=3;
  382. $6="start".__minus_gt((function(e,ui){
  383. return smalltalk.withContext(function($ctx2) {
  384. return self._startResizing_(_st(ui)._helper());
  385. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)})}));
  386. $ctx1.sendIdx["->"]=4;
  387. $2=smalltalk.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(e,ui){
  388. return smalltalk.withContext(function($ctx2) {
  389. return self._resize_(_st(_st(ui)._offset())._top());
  390. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)})}))]);
  391. _st($1)._draggable_($2);
  392. return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},smalltalk.HLHorizontalSplitter)})},
  393. args: [],
  394. source: "setupSplitter\x0a\x09splitter asJQuery draggable: #{ \x0a \x09'axis' -> 'y'. \x0a 'containment' -> splitter asJQuery parent.\x0a 'helper' -> 'clone'.\x0a 'start' -> [ :e :ui | self startResizing: ui helper ].\x0a 'drag' -> [ :e :ui | self resize: ui offset top ] }",
  395. messageSends: ["draggable:", "asJQuery", "->", "parent", "startResizing:", "helper", "resize:", "top", "offset"],
  396. referencedClasses: []
  397. }),
  398. smalltalk.HLHorizontalSplitter);
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "startResizing:",
  402. protocol: 'actions',
  403. fn: function (aSplitter){
  404. var self=this;
  405. return smalltalk.withContext(function($ctx1) {
  406. _st(aSplitter)._width_(_st(_st(self["@splitter"])._asJQuery())._width());
  407. return self}, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},smalltalk.HLHorizontalSplitter)})},
  408. args: ["aSplitter"],
  409. source: "startResizing: aSplitter\x0a\x09aSplitter width: splitter asJQuery width",
  410. messageSends: ["width:", "width", "asJQuery"],
  411. referencedClasses: []
  412. }),
  413. smalltalk.HLHorizontalSplitter);
  414. smalltalk.addClass('HLVerticalSplitter', smalltalk.HLSplitter, [], 'Helios-Layout');
  415. smalltalk.addMethod(
  416. smalltalk.method({
  417. selector: "cssClass",
  418. protocol: 'accessing',
  419. fn: function (){
  420. var self=this;
  421. return smalltalk.withContext(function($ctx1) {
  422. var $1;
  423. $1=_st(smalltalk.HLVerticalSplitter.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" vertical");
  424. return $1;
  425. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLVerticalSplitter)})},
  426. args: [],
  427. source: "cssClass\x0a\x09^ super cssClass, ' vertical'",
  428. messageSends: [",", "cssClass"],
  429. referencedClasses: []
  430. }),
  431. smalltalk.HLVerticalSplitter);
  432. smalltalk.addMethod(
  433. smalltalk.method({
  434. selector: "panesCssClass",
  435. protocol: 'accessing',
  436. fn: function (){
  437. var self=this;
  438. return smalltalk.withContext(function($ctx1) {
  439. var $1;
  440. $1=_st(smalltalk.HLVerticalSplitter.superclass.fn.prototype._panesCssClass.apply(_st(self), [])).__comma(" vertical");
  441. return $1;
  442. }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},smalltalk.HLVerticalSplitter)})},
  443. args: [],
  444. source: "panesCssClass\x0a\x09^ super panesCssClass, ' vertical'",
  445. messageSends: [",", "panesCssClass"],
  446. referencedClasses: []
  447. }),
  448. smalltalk.HLVerticalSplitter);
  449. smalltalk.addMethod(
  450. smalltalk.method({
  451. selector: "resize",
  452. protocol: 'actions',
  453. fn: function (){
  454. var self=this;
  455. return smalltalk.withContext(function($ctx1) {
  456. self._resize_(_st(_st(self["@splitter"])._asJQuery())._css_("left"));
  457. return self}, function($ctx1) {$ctx1.fill(self,"resize",{},smalltalk.HLVerticalSplitter)})},
  458. args: [],
  459. source: "resize\x0a\x09self resize: (splitter asJQuery css: 'left')",
  460. messageSends: ["resize:", "css:", "asJQuery"],
  461. referencedClasses: []
  462. }),
  463. smalltalk.HLVerticalSplitter);
  464. smalltalk.addMethod(
  465. smalltalk.method({
  466. selector: "resize:",
  467. protocol: 'actions',
  468. fn: function (anInteger){
  469. var self=this;
  470. var container,size,offset,percentage;
  471. return smalltalk.withContext(function($ctx1) {
  472. var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
  473. $1=_st(self["@firstPane"])._asJQuery();
  474. $ctx1.sendIdx["asJQuery"]=1;
  475. container=_st($1)._parent();
  476. $3=_st(self["@firstPane"])._asJQuery();
  477. $ctx1.sendIdx["asJQuery"]=2;
  478. $2=_st($3)._offset();
  479. offset=_st($2)._left();
  480. size=_st(container)._width();
  481. $6=size;
  482. $7=_st(anInteger).__minus(offset);
  483. $ctx1.sendIdx["-"]=2;
  484. $5=_st($6).__minus($7);
  485. $ctx1.sendIdx["-"]=1;
  486. $4=_st($5).__slash(size);
  487. percentage=_st($4).__star((100));
  488. percentage=(80)._min_(_st(percentage)._max_((20)));
  489. $8=_st(self["@firstPane"])._asJQuery();
  490. $ctx1.sendIdx["asJQuery"]=3;
  491. $10=_st(percentage)._asString();
  492. $ctx1.sendIdx["asString"]=1;
  493. $9=_st($10).__comma("%");
  494. $ctx1.sendIdx[","]=1;
  495. _st($8)._css_put_("right",$9);
  496. $ctx1.sendIdx["css:put:"]=1;
  497. $11=_st(self["@splitter"])._asJQuery();
  498. $ctx1.sendIdx["asJQuery"]=4;
  499. $14=(100).__minus(percentage);
  500. $ctx1.sendIdx["-"]=3;
  501. $13=_st($14)._asString();
  502. $ctx1.sendIdx["asString"]=2;
  503. $12=_st($13).__comma("%");
  504. $ctx1.sendIdx[","]=2;
  505. _st($11)._css_put_("left",$12);
  506. $ctx1.sendIdx["css:put:"]=2;
  507. _st(_st(self["@secondPane"])._asJQuery())._css_put_("left",_st(_st((100).__minus(percentage))._asString()).__comma("%"));
  508. return self}, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},smalltalk.HLVerticalSplitter)})},
  509. args: ["anInteger"],
  510. source: "resize: anInteger\x0a\x09| container size offset percentage |\x0a \x0a container := firstPane asJQuery parent.\x0a\x09offset := firstPane asJQuery offset left.\x0a size := container width.\x0a\x09\x0a\x09percentage := (size - (anInteger - offset)) / size * 100.\x0a\x09percentage := 80 min: (percentage max: 20).\x0a\x09\x0a firstPane asJQuery css: 'right' put: percentage asString, '%'.\x0a\x09\x0a\x09splitter asJQuery css: 'left' put: (100 - percentage) asString, '%'.\x0a\x09secondPane asJQuery css: 'left' put: (100 - percentage) asString, '%'",
  511. messageSends: ["parent", "asJQuery", "left", "offset", "width", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"],
  512. referencedClasses: []
  513. }),
  514. smalltalk.HLVerticalSplitter);
  515. smalltalk.addMethod(
  516. smalltalk.method({
  517. selector: "setupSplitter",
  518. protocol: 'rendering',
  519. fn: function (){
  520. var self=this;
  521. return smalltalk.withContext(function($ctx1) {
  522. var $1,$3,$4,$5,$6,$2;
  523. $1=_st(self["@splitter"])._asJQuery();
  524. $ctx1.sendIdx["asJQuery"]=1;
  525. $3="axis".__minus_gt("x");
  526. $ctx1.sendIdx["->"]=1;
  527. $4="containment".__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent());
  528. $ctx1.sendIdx["->"]=2;
  529. $5="helper".__minus_gt("clone");
  530. $ctx1.sendIdx["->"]=3;
  531. $6="start".__minus_gt((function(e,ui){
  532. return smalltalk.withContext(function($ctx2) {
  533. return self._startResizing_(_st(ui)._helper());
  534. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)})}));
  535. $ctx1.sendIdx["->"]=4;
  536. $2=smalltalk.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(e,ui){
  537. return smalltalk.withContext(function($ctx2) {
  538. return self._resize_(_st(_st(ui)._offset())._left());
  539. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)})}))]);
  540. _st($1)._draggable_($2);
  541. return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},smalltalk.HLVerticalSplitter)})},
  542. args: [],
  543. source: "setupSplitter\x0a\x09splitter asJQuery draggable: #{ \x0a \x09'axis' -> 'x'. \x0a 'containment' -> splitter asJQuery parent.\x0a 'helper' -> 'clone'.\x0a 'start' -> [ :e :ui | self startResizing: ui helper ].\x0a 'drag' -> [ :e :ui | self resize: (ui offset left) ] }",
  544. messageSends: ["draggable:", "asJQuery", "->", "parent", "startResizing:", "helper", "resize:", "left", "offset"],
  545. referencedClasses: []
  546. }),
  547. smalltalk.HLVerticalSplitter);
  548. smalltalk.addMethod(
  549. smalltalk.method({
  550. selector: "startResizing:",
  551. protocol: 'actions',
  552. fn: function (aSplitter){
  553. var self=this;
  554. return smalltalk.withContext(function($ctx1) {
  555. _st(aSplitter)._height_(_st(_st(self["@splitter"])._asJQuery())._height());
  556. return self}, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},smalltalk.HLVerticalSplitter)})},
  557. args: ["aSplitter"],
  558. source: "startResizing: aSplitter\x0a\x09aSplitter height: splitter asJQuery height",
  559. messageSends: ["height:", "height", "asJQuery"],
  560. referencedClasses: []
  561. }),
  562. smalltalk.HLVerticalSplitter);
  563. smalltalk.addMethod(
  564. smalltalk.method({
  565. selector: "isHeliosSplitter",
  566. protocol: '*Helios-Layout',
  567. fn: function (){
  568. var self=this;
  569. return false;
  570. },
  571. args: [],
  572. source: "isHeliosSplitter\x0a\x09^ false",
  573. messageSends: [],
  574. referencedClasses: []
  575. }),
  576. smalltalk.Object);
  577. });