Helios-Layout.js 19 KB

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