Helios-Layout.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  1. define("helios/Helios-Layout", ["amber/boot", "helios/Helios-Core", "amber/web/Web", "amber_core/Kernel-Objects"], function($boot){"use strict";
  2. var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. $core.addPackage('Helios-Layout');
  4. $core.packages["Helios-Layout"].innerEval = function (expr) { return eval(expr); };
  5. $core.packages["Helios-Layout"].transport = {"type":"amd","amdNamespace":"helios"};
  6. $core.addClass('HLContainer', $globals.HLWidget, ['splitter'], 'Helios-Layout');
  7. $core.addMethod(
  8. $core.method({
  9. selector: "renderOn:",
  10. protocol: 'rendering',
  11. fn: function (html){
  12. var self=this;
  13. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  14. return $core.withContext(function($ctx1) {
  15. //>>excludeEnd("ctx");
  16. var $1;
  17. $1=$recv(html)._div();
  18. $recv($1)._class_("tool_container");
  19. $recv($1)._with_(self._splitter());
  20. return self;
  21. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  22. }, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},$globals.HLContainer)});
  23. //>>excludeEnd("ctx");
  24. },
  25. //>>excludeStart("ide", pragmas.excludeIdeData);
  26. args: ["html"],
  27. source: "renderOn: html\x0a\x09html div \x0a \x09class: 'tool_container'; \x0a with: self splitter",
  28. referencedClasses: [],
  29. //>>excludeEnd("ide");
  30. messageSends: ["class:", "div", "with:", "splitter"]
  31. }),
  32. $globals.HLContainer);
  33. $core.addMethod(
  34. $core.method({
  35. selector: "splitter",
  36. protocol: 'accessing',
  37. fn: function (){
  38. var self=this;
  39. return self["@splitter"];
  40. },
  41. //>>excludeStart("ide", pragmas.excludeIdeData);
  42. args: [],
  43. source: "splitter\x0a\x09^ splitter",
  44. referencedClasses: [],
  45. //>>excludeEnd("ide");
  46. messageSends: []
  47. }),
  48. $globals.HLContainer);
  49. $core.addMethod(
  50. $core.method({
  51. selector: "splitter:",
  52. protocol: 'accessing',
  53. fn: function (aSplitter){
  54. var self=this;
  55. self["@splitter"]=aSplitter;
  56. return self;
  57. },
  58. //>>excludeStart("ide", pragmas.excludeIdeData);
  59. args: ["aSplitter"],
  60. source: "splitter: aSplitter\x0a\x09splitter := aSplitter",
  61. referencedClasses: [],
  62. //>>excludeEnd("ide");
  63. messageSends: []
  64. }),
  65. $globals.HLContainer);
  66. $core.addMethod(
  67. $core.method({
  68. selector: "with:",
  69. protocol: 'instance creation',
  70. fn: function (aSplitter){
  71. var self=this;
  72. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  73. return $core.withContext(function($ctx1) {
  74. //>>excludeEnd("ctx");
  75. var $1;
  76. $1=self._new();
  77. $recv($1)._splitter_(aSplitter);
  78. return $recv($1)._yourself();
  79. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  80. }, function($ctx1) {$ctx1.fill(self,"with:",{aSplitter:aSplitter},$globals.HLContainer.klass)});
  81. //>>excludeEnd("ctx");
  82. },
  83. //>>excludeStart("ide", pragmas.excludeIdeData);
  84. args: ["aSplitter"],
  85. source: "with: aSplitter\x0a\x09^ self new \x0a \x09splitter: aSplitter; \x0a yourself",
  86. referencedClasses: [],
  87. //>>excludeEnd("ide");
  88. messageSends: ["splitter:", "new", "yourself"]
  89. }),
  90. $globals.HLContainer.klass);
  91. $core.addClass('HLSplitter', $globals.Widget, ['firstWidget', 'secondWidget', 'firstPane', 'secondPane', 'splitter'], 'Helios-Layout');
  92. $core.addMethod(
  93. $core.method({
  94. selector: "cssClass",
  95. protocol: 'accessing',
  96. fn: function (){
  97. var self=this;
  98. return "splitter";
  99. },
  100. //>>excludeStart("ide", pragmas.excludeIdeData);
  101. args: [],
  102. source: "cssClass\x0a\x09^ 'splitter'",
  103. referencedClasses: [],
  104. //>>excludeEnd("ide");
  105. messageSends: []
  106. }),
  107. $globals.HLSplitter);
  108. $core.addMethod(
  109. $core.method({
  110. selector: "firstWidget",
  111. protocol: 'accessing',
  112. fn: function (){
  113. var self=this;
  114. return self["@firstWidget"];
  115. },
  116. //>>excludeStart("ide", pragmas.excludeIdeData);
  117. args: [],
  118. source: "firstWidget\x0a\x09^ firstWidget",
  119. referencedClasses: [],
  120. //>>excludeEnd("ide");
  121. messageSends: []
  122. }),
  123. $globals.HLSplitter);
  124. $core.addMethod(
  125. $core.method({
  126. selector: "firstWidget:",
  127. protocol: 'accessing',
  128. fn: function (aWidget){
  129. var self=this;
  130. self["@firstWidget"]=aWidget;
  131. return self;
  132. },
  133. //>>excludeStart("ide", pragmas.excludeIdeData);
  134. args: ["aWidget"],
  135. source: "firstWidget: aWidget\x0a\x09firstWidget := aWidget",
  136. referencedClasses: [],
  137. //>>excludeEnd("ide");
  138. messageSends: []
  139. }),
  140. $globals.HLSplitter);
  141. $core.addMethod(
  142. $core.method({
  143. selector: "isHeliosSplitter",
  144. protocol: 'testing',
  145. fn: function (){
  146. var self=this;
  147. return true;
  148. },
  149. //>>excludeStart("ide", pragmas.excludeIdeData);
  150. args: [],
  151. source: "isHeliosSplitter\x0a\x09^ true",
  152. referencedClasses: [],
  153. //>>excludeEnd("ide");
  154. messageSends: []
  155. }),
  156. $globals.HLSplitter);
  157. $core.addMethod(
  158. $core.method({
  159. selector: "panesCssClass",
  160. protocol: 'rendering',
  161. fn: function (){
  162. var self=this;
  163. return "panes";
  164. },
  165. //>>excludeStart("ide", pragmas.excludeIdeData);
  166. args: [],
  167. source: "panesCssClass\x0a\x09^ 'panes'",
  168. referencedClasses: [],
  169. //>>excludeEnd("ide");
  170. messageSends: []
  171. }),
  172. $globals.HLSplitter);
  173. $core.addMethod(
  174. $core.method({
  175. selector: "renderOn:",
  176. protocol: 'rendering',
  177. fn: function (html){
  178. var self=this;
  179. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  180. return $core.withContext(function($ctx1) {
  181. //>>excludeEnd("ctx");
  182. var $1,$3,$4,$5,$6,$2;
  183. $1=$recv(html)._div();
  184. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  185. $ctx1.sendIdx["div"]=1;
  186. //>>excludeEnd("ctx");
  187. $recv($1)._class_(self._panesCssClass());
  188. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  189. $ctx1.sendIdx["class:"]=1;
  190. //>>excludeEnd("ctx");
  191. $2=$recv($1)._with_((function(){
  192. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  193. return $core.withContext(function($ctx2) {
  194. //>>excludeEnd("ctx");
  195. $3=$recv(html)._div();
  196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  197. $ctx2.sendIdx["div"]=2;
  198. //>>excludeEnd("ctx");
  199. $recv($3)._class_("pane");
  200. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  201. $ctx2.sendIdx["class:"]=2;
  202. //>>excludeEnd("ctx");
  203. $4=$recv($3)._with_(self._firstWidget());
  204. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  205. $ctx2.sendIdx["with:"]=2;
  206. //>>excludeEnd("ctx");
  207. self["@firstPane"]=$4;
  208. self["@firstPane"];
  209. $5=$recv(html)._div();
  210. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  211. $ctx2.sendIdx["div"]=3;
  212. //>>excludeEnd("ctx");
  213. self["@splitter"]=$recv($5)._class_(self._cssClass());
  214. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  215. $ctx2.sendIdx["class:"]=3;
  216. //>>excludeEnd("ctx");
  217. self["@splitter"];
  218. $6=$recv(html)._div();
  219. $recv($6)._class_("pane");
  220. self["@secondPane"]=$recv($6)._with_(self._secondWidget());
  221. return self["@secondPane"];
  222. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  223. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  224. //>>excludeEnd("ctx");
  225. }));
  226. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  227. $ctx1.sendIdx["with:"]=1;
  228. //>>excludeEnd("ctx");
  229. self._setupSplitter();
  230. return self;
  231. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  232. }, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},$globals.HLSplitter)});
  233. //>>excludeEnd("ctx");
  234. },
  235. //>>excludeStart("ide", pragmas.excludeIdeData);
  236. args: ["html"],
  237. 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",
  238. referencedClasses: [],
  239. //>>excludeEnd("ide");
  240. messageSends: ["class:", "div", "panesCssClass", "with:", "firstWidget", "cssClass", "secondWidget", "setupSplitter"]
  241. }),
  242. $globals.HLSplitter);
  243. $core.addMethod(
  244. $core.method({
  245. selector: "resize",
  246. protocol: 'rendering',
  247. fn: function (){
  248. var self=this;
  249. return self;
  250. },
  251. //>>excludeStart("ide", pragmas.excludeIdeData);
  252. args: [],
  253. source: "resize",
  254. referencedClasses: [],
  255. //>>excludeEnd("ide");
  256. messageSends: []
  257. }),
  258. $globals.HLSplitter);
  259. $core.addMethod(
  260. $core.method({
  261. selector: "secondWidget",
  262. protocol: 'accessing',
  263. fn: function (){
  264. var self=this;
  265. return self["@secondWidget"];
  266. },
  267. //>>excludeStart("ide", pragmas.excludeIdeData);
  268. args: [],
  269. source: "secondWidget\x0a\x09^ secondWidget",
  270. referencedClasses: [],
  271. //>>excludeEnd("ide");
  272. messageSends: []
  273. }),
  274. $globals.HLSplitter);
  275. $core.addMethod(
  276. $core.method({
  277. selector: "secondWidget:",
  278. protocol: 'accessing',
  279. fn: function (aWidget){
  280. var self=this;
  281. self["@secondWidget"]=aWidget;
  282. return self;
  283. },
  284. //>>excludeStart("ide", pragmas.excludeIdeData);
  285. args: ["aWidget"],
  286. source: "secondWidget: aWidget\x0a\x09secondWidget := aWidget",
  287. referencedClasses: [],
  288. //>>excludeEnd("ide");
  289. messageSends: []
  290. }),
  291. $globals.HLSplitter);
  292. $core.addMethod(
  293. $core.method({
  294. selector: "setupSplitter",
  295. protocol: 'rendering',
  296. fn: function (){
  297. var self=this;
  298. return self;
  299. },
  300. //>>excludeStart("ide", pragmas.excludeIdeData);
  301. args: [],
  302. source: "setupSplitter",
  303. referencedClasses: [],
  304. //>>excludeEnd("ide");
  305. messageSends: []
  306. }),
  307. $globals.HLSplitter);
  308. $core.addMethod(
  309. $core.method({
  310. selector: "with:with:",
  311. protocol: 'instance creation',
  312. fn: function (aWidget,anotherWidget){
  313. var self=this;
  314. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  315. return $core.withContext(function($ctx1) {
  316. //>>excludeEnd("ctx");
  317. var $1;
  318. $1=self._new();
  319. $recv($1)._firstWidget_(aWidget);
  320. $recv($1)._secondWidget_(anotherWidget);
  321. return $recv($1)._yourself();
  322. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  323. }, function($ctx1) {$ctx1.fill(self,"with:with:",{aWidget:aWidget,anotherWidget:anotherWidget},$globals.HLSplitter.klass)});
  324. //>>excludeEnd("ctx");
  325. },
  326. //>>excludeStart("ide", pragmas.excludeIdeData);
  327. args: ["aWidget", "anotherWidget"],
  328. source: "with: aWidget with: anotherWidget\x0a\x09^ self new\x0a \x09\x09firstWidget: aWidget;\x0a secondWidget: anotherWidget;\x0a yourself",
  329. referencedClasses: [],
  330. //>>excludeEnd("ide");
  331. messageSends: ["firstWidget:", "new", "secondWidget:", "yourself"]
  332. }),
  333. $globals.HLSplitter.klass);
  334. $core.addClass('HLHorizontalSplitter', $globals.HLSplitter, [], 'Helios-Layout');
  335. $core.addMethod(
  336. $core.method({
  337. selector: "cssClass",
  338. protocol: 'accessing',
  339. fn: function (){
  340. var self=this;
  341. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  342. return $core.withContext(function($ctx1) {
  343. //>>excludeEnd("ctx");
  344. var $1;
  345. $1=(
  346. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  347. $ctx1.supercall = true,
  348. //>>excludeEnd("ctx");
  349. ($globals.HLHorizontalSplitter.superclass||$boot.dnu).fn.prototype._cssClass.apply($recv(self), []));
  350. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  351. $ctx1.supercall = false;
  352. //>>excludeEnd("ctx");;
  353. return $recv($1).__comma(" horizontal");
  354. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  355. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},$globals.HLHorizontalSplitter)});
  356. //>>excludeEnd("ctx");
  357. },
  358. //>>excludeStart("ide", pragmas.excludeIdeData);
  359. args: [],
  360. source: "cssClass\x0a\x09^ super cssClass, ' horizontal'",
  361. referencedClasses: [],
  362. //>>excludeEnd("ide");
  363. messageSends: [",", "cssClass"]
  364. }),
  365. $globals.HLHorizontalSplitter);
  366. $core.addMethod(
  367. $core.method({
  368. selector: "panesCssClass",
  369. protocol: 'accessing',
  370. fn: function (){
  371. var self=this;
  372. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  373. return $core.withContext(function($ctx1) {
  374. //>>excludeEnd("ctx");
  375. var $1;
  376. $1=(
  377. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  378. $ctx1.supercall = true,
  379. //>>excludeEnd("ctx");
  380. ($globals.HLHorizontalSplitter.superclass||$boot.dnu).fn.prototype._panesCssClass.apply($recv(self), []));
  381. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  382. $ctx1.supercall = false;
  383. //>>excludeEnd("ctx");;
  384. return $recv($1).__comma(" horizontal");
  385. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  386. }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},$globals.HLHorizontalSplitter)});
  387. //>>excludeEnd("ctx");
  388. },
  389. //>>excludeStart("ide", pragmas.excludeIdeData);
  390. args: [],
  391. source: "panesCssClass\x0a\x09^ super panesCssClass, ' horizontal'",
  392. referencedClasses: [],
  393. //>>excludeEnd("ide");
  394. messageSends: [",", "panesCssClass"]
  395. }),
  396. $globals.HLHorizontalSplitter);
  397. $core.addMethod(
  398. $core.method({
  399. selector: "resize",
  400. protocol: 'actions',
  401. fn: function (){
  402. var self=this;
  403. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  404. return $core.withContext(function($ctx1) {
  405. //>>excludeEnd("ctx");
  406. self._resize_($recv($recv(self["@splitter"])._asJQuery())._css_("top"));
  407. return self;
  408. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  409. }, function($ctx1) {$ctx1.fill(self,"resize",{},$globals.HLHorizontalSplitter)});
  410. //>>excludeEnd("ctx");
  411. },
  412. //>>excludeStart("ide", pragmas.excludeIdeData);
  413. args: [],
  414. source: "resize\x0a\x09self resize: (splitter asJQuery css: 'top')",
  415. referencedClasses: [],
  416. //>>excludeEnd("ide");
  417. messageSends: ["resize:", "css:", "asJQuery"]
  418. }),
  419. $globals.HLHorizontalSplitter);
  420. $core.addMethod(
  421. $core.method({
  422. selector: "resize:",
  423. protocol: 'actions',
  424. fn: function (anInteger){
  425. var self=this;
  426. var container,size,offset,percentage;
  427. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  428. return $core.withContext(function($ctx1) {
  429. //>>excludeEnd("ctx");
  430. var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
  431. $1=$recv(self["@firstPane"])._asJQuery();
  432. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  433. $ctx1.sendIdx["asJQuery"]=1;
  434. //>>excludeEnd("ctx");
  435. container=$recv($1)._parent();
  436. $3=$recv(self["@firstPane"])._asJQuery();
  437. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  438. $ctx1.sendIdx["asJQuery"]=2;
  439. //>>excludeEnd("ctx");
  440. $2=$recv($3)._offset();
  441. offset=$recv($2)._top();
  442. size=$recv(container)._height();
  443. $6=size;
  444. $7=$recv(anInteger).__minus(offset);
  445. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  446. $ctx1.sendIdx["-"]=2;
  447. //>>excludeEnd("ctx");
  448. $5=$recv($6).__minus($7);
  449. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  450. $ctx1.sendIdx["-"]=1;
  451. //>>excludeEnd("ctx");
  452. $4=$recv($5).__slash(size);
  453. percentage=$recv($4).__star((100));
  454. percentage=(80)._min_($recv(percentage)._max_((20)));
  455. $8=$recv(self["@firstPane"])._asJQuery();
  456. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  457. $ctx1.sendIdx["asJQuery"]=3;
  458. //>>excludeEnd("ctx");
  459. $10=$recv(percentage)._asString();
  460. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  461. $ctx1.sendIdx["asString"]=1;
  462. //>>excludeEnd("ctx");
  463. $9=$recv($10).__comma("%");
  464. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  465. $ctx1.sendIdx[","]=1;
  466. //>>excludeEnd("ctx");
  467. $recv($8)._css_put_("bottom",$9);
  468. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  469. $ctx1.sendIdx["css:put:"]=1;
  470. //>>excludeEnd("ctx");
  471. $11=$recv(self["@splitter"])._asJQuery();
  472. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  473. $ctx1.sendIdx["asJQuery"]=4;
  474. //>>excludeEnd("ctx");
  475. $14=(100).__minus(percentage);
  476. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  477. $ctx1.sendIdx["-"]=3;
  478. //>>excludeEnd("ctx");
  479. $13=$recv($14)._asString();
  480. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  481. $ctx1.sendIdx["asString"]=2;
  482. //>>excludeEnd("ctx");
  483. $12=$recv($13).__comma("%");
  484. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  485. $ctx1.sendIdx[","]=2;
  486. //>>excludeEnd("ctx");
  487. $recv($11)._css_put_("top",$12);
  488. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  489. $ctx1.sendIdx["css:put:"]=2;
  490. //>>excludeEnd("ctx");
  491. $recv($recv(self["@secondPane"])._asJQuery())._css_put_("top",$recv($recv((100).__minus(percentage))._asString()).__comma("%"));
  492. return self;
  493. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  494. }, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},$globals.HLHorizontalSplitter)});
  495. //>>excludeEnd("ctx");
  496. },
  497. //>>excludeStart("ide", pragmas.excludeIdeData);
  498. args: ["anInteger"],
  499. 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, '%'",
  500. referencedClasses: [],
  501. //>>excludeEnd("ide");
  502. messageSends: ["parent", "asJQuery", "top", "offset", "height", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"]
  503. }),
  504. $globals.HLHorizontalSplitter);
  505. $core.addMethod(
  506. $core.method({
  507. selector: "setupSplitter",
  508. protocol: 'rendering',
  509. fn: function (){
  510. var self=this;
  511. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  512. return $core.withContext(function($ctx1) {
  513. //>>excludeEnd("ctx");
  514. var $1;
  515. $1=$recv(self["@splitter"])._asJQuery();
  516. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  517. $ctx1.sendIdx["asJQuery"]=1;
  518. //>>excludeEnd("ctx");
  519. $recv($1)._draggable_($globals.HashedCollection._newFromPairs_(["axis","y","containment",$recv($recv(self["@splitter"])._asJQuery())._parent(),"helper","clone","start",(function(e,ui){
  520. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  521. return $core.withContext(function($ctx2) {
  522. //>>excludeEnd("ctx");
  523. return self._startResizing_($recv(ui)._helper());
  524. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  525. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)});
  526. //>>excludeEnd("ctx");
  527. }),"drag",(function(e,ui){
  528. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  529. return $core.withContext(function($ctx2) {
  530. //>>excludeEnd("ctx");
  531. return self._resize_($recv($recv(ui)._offset())._top());
  532. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  533. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)});
  534. //>>excludeEnd("ctx");
  535. })]));
  536. return self;
  537. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  538. }, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},$globals.HLHorizontalSplitter)});
  539. //>>excludeEnd("ctx");
  540. },
  541. //>>excludeStart("ide", pragmas.excludeIdeData);
  542. args: [],
  543. 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 ] }",
  544. referencedClasses: [],
  545. //>>excludeEnd("ide");
  546. messageSends: ["draggable:", "asJQuery", "parent", "startResizing:", "helper", "resize:", "top", "offset"]
  547. }),
  548. $globals.HLHorizontalSplitter);
  549. $core.addMethod(
  550. $core.method({
  551. selector: "startResizing:",
  552. protocol: 'actions',
  553. fn: function (aSplitter){
  554. var self=this;
  555. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  556. return $core.withContext(function($ctx1) {
  557. //>>excludeEnd("ctx");
  558. $recv(aSplitter)._width_($recv($recv(self["@splitter"])._asJQuery())._width());
  559. return self;
  560. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  561. }, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},$globals.HLHorizontalSplitter)});
  562. //>>excludeEnd("ctx");
  563. },
  564. //>>excludeStart("ide", pragmas.excludeIdeData);
  565. args: ["aSplitter"],
  566. source: "startResizing: aSplitter\x0a\x09aSplitter width: splitter asJQuery width",
  567. referencedClasses: [],
  568. //>>excludeEnd("ide");
  569. messageSends: ["width:", "width", "asJQuery"]
  570. }),
  571. $globals.HLHorizontalSplitter);
  572. $core.addClass('HLVerticalSplitter', $globals.HLSplitter, [], 'Helios-Layout');
  573. $core.addMethod(
  574. $core.method({
  575. selector: "cssClass",
  576. protocol: 'accessing',
  577. fn: function (){
  578. var self=this;
  579. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  580. return $core.withContext(function($ctx1) {
  581. //>>excludeEnd("ctx");
  582. var $1;
  583. $1=(
  584. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  585. $ctx1.supercall = true,
  586. //>>excludeEnd("ctx");
  587. ($globals.HLVerticalSplitter.superclass||$boot.dnu).fn.prototype._cssClass.apply($recv(self), []));
  588. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  589. $ctx1.supercall = false;
  590. //>>excludeEnd("ctx");;
  591. return $recv($1).__comma(" vertical");
  592. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  593. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},$globals.HLVerticalSplitter)});
  594. //>>excludeEnd("ctx");
  595. },
  596. //>>excludeStart("ide", pragmas.excludeIdeData);
  597. args: [],
  598. source: "cssClass\x0a\x09^ super cssClass, ' vertical'",
  599. referencedClasses: [],
  600. //>>excludeEnd("ide");
  601. messageSends: [",", "cssClass"]
  602. }),
  603. $globals.HLVerticalSplitter);
  604. $core.addMethod(
  605. $core.method({
  606. selector: "panesCssClass",
  607. protocol: 'accessing',
  608. fn: function (){
  609. var self=this;
  610. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  611. return $core.withContext(function($ctx1) {
  612. //>>excludeEnd("ctx");
  613. var $1;
  614. $1=(
  615. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  616. $ctx1.supercall = true,
  617. //>>excludeEnd("ctx");
  618. ($globals.HLVerticalSplitter.superclass||$boot.dnu).fn.prototype._panesCssClass.apply($recv(self), []));
  619. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  620. $ctx1.supercall = false;
  621. //>>excludeEnd("ctx");;
  622. return $recv($1).__comma(" vertical");
  623. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  624. }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},$globals.HLVerticalSplitter)});
  625. //>>excludeEnd("ctx");
  626. },
  627. //>>excludeStart("ide", pragmas.excludeIdeData);
  628. args: [],
  629. source: "panesCssClass\x0a\x09^ super panesCssClass, ' vertical'",
  630. referencedClasses: [],
  631. //>>excludeEnd("ide");
  632. messageSends: [",", "panesCssClass"]
  633. }),
  634. $globals.HLVerticalSplitter);
  635. $core.addMethod(
  636. $core.method({
  637. selector: "resize",
  638. protocol: 'actions',
  639. fn: function (){
  640. var self=this;
  641. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  642. return $core.withContext(function($ctx1) {
  643. //>>excludeEnd("ctx");
  644. self._resize_($recv($recv(self["@splitter"])._asJQuery())._css_("left"));
  645. return self;
  646. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  647. }, function($ctx1) {$ctx1.fill(self,"resize",{},$globals.HLVerticalSplitter)});
  648. //>>excludeEnd("ctx");
  649. },
  650. //>>excludeStart("ide", pragmas.excludeIdeData);
  651. args: [],
  652. source: "resize\x0a\x09self resize: (splitter asJQuery css: 'left')",
  653. referencedClasses: [],
  654. //>>excludeEnd("ide");
  655. messageSends: ["resize:", "css:", "asJQuery"]
  656. }),
  657. $globals.HLVerticalSplitter);
  658. $core.addMethod(
  659. $core.method({
  660. selector: "resize:",
  661. protocol: 'actions',
  662. fn: function (anInteger){
  663. var self=this;
  664. var container,size,offset,percentage;
  665. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  666. return $core.withContext(function($ctx1) {
  667. //>>excludeEnd("ctx");
  668. var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
  669. $1=$recv(self["@firstPane"])._asJQuery();
  670. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  671. $ctx1.sendIdx["asJQuery"]=1;
  672. //>>excludeEnd("ctx");
  673. container=$recv($1)._parent();
  674. $3=$recv(self["@firstPane"])._asJQuery();
  675. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  676. $ctx1.sendIdx["asJQuery"]=2;
  677. //>>excludeEnd("ctx");
  678. $2=$recv($3)._offset();
  679. offset=$recv($2)._left();
  680. size=$recv(container)._width();
  681. $6=size;
  682. $7=$recv(anInteger).__minus(offset);
  683. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  684. $ctx1.sendIdx["-"]=2;
  685. //>>excludeEnd("ctx");
  686. $5=$recv($6).__minus($7);
  687. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  688. $ctx1.sendIdx["-"]=1;
  689. //>>excludeEnd("ctx");
  690. $4=$recv($5).__slash(size);
  691. percentage=$recv($4).__star((100));
  692. percentage=(80)._min_($recv(percentage)._max_((20)));
  693. $8=$recv(self["@firstPane"])._asJQuery();
  694. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  695. $ctx1.sendIdx["asJQuery"]=3;
  696. //>>excludeEnd("ctx");
  697. $10=$recv(percentage)._asString();
  698. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  699. $ctx1.sendIdx["asString"]=1;
  700. //>>excludeEnd("ctx");
  701. $9=$recv($10).__comma("%");
  702. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  703. $ctx1.sendIdx[","]=1;
  704. //>>excludeEnd("ctx");
  705. $recv($8)._css_put_("right",$9);
  706. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  707. $ctx1.sendIdx["css:put:"]=1;
  708. //>>excludeEnd("ctx");
  709. $11=$recv(self["@splitter"])._asJQuery();
  710. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  711. $ctx1.sendIdx["asJQuery"]=4;
  712. //>>excludeEnd("ctx");
  713. $14=(100).__minus(percentage);
  714. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  715. $ctx1.sendIdx["-"]=3;
  716. //>>excludeEnd("ctx");
  717. $13=$recv($14)._asString();
  718. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  719. $ctx1.sendIdx["asString"]=2;
  720. //>>excludeEnd("ctx");
  721. $12=$recv($13).__comma("%");
  722. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  723. $ctx1.sendIdx[","]=2;
  724. //>>excludeEnd("ctx");
  725. $recv($11)._css_put_("left",$12);
  726. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  727. $ctx1.sendIdx["css:put:"]=2;
  728. //>>excludeEnd("ctx");
  729. $recv($recv(self["@secondPane"])._asJQuery())._css_put_("left",$recv($recv((100).__minus(percentage))._asString()).__comma("%"));
  730. return self;
  731. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  732. }, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},$globals.HLVerticalSplitter)});
  733. //>>excludeEnd("ctx");
  734. },
  735. //>>excludeStart("ide", pragmas.excludeIdeData);
  736. args: ["anInteger"],
  737. 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, '%'",
  738. referencedClasses: [],
  739. //>>excludeEnd("ide");
  740. messageSends: ["parent", "asJQuery", "left", "offset", "width", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"]
  741. }),
  742. $globals.HLVerticalSplitter);
  743. $core.addMethod(
  744. $core.method({
  745. selector: "setupSplitter",
  746. protocol: 'rendering',
  747. fn: function (){
  748. var self=this;
  749. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  750. return $core.withContext(function($ctx1) {
  751. //>>excludeEnd("ctx");
  752. var $1;
  753. $1=$recv(self["@splitter"])._asJQuery();
  754. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  755. $ctx1.sendIdx["asJQuery"]=1;
  756. //>>excludeEnd("ctx");
  757. $recv($1)._draggable_($globals.HashedCollection._newFromPairs_(["axis","x","containment",$recv($recv(self["@splitter"])._asJQuery())._parent(),"helper","clone","start",(function(e,ui){
  758. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  759. return $core.withContext(function($ctx2) {
  760. //>>excludeEnd("ctx");
  761. return self._startResizing_($recv(ui)._helper());
  762. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  763. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)});
  764. //>>excludeEnd("ctx");
  765. }),"drag",(function(e,ui){
  766. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  767. return $core.withContext(function($ctx2) {
  768. //>>excludeEnd("ctx");
  769. return self._resize_($recv($recv(ui)._offset())._left());
  770. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  771. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)});
  772. //>>excludeEnd("ctx");
  773. })]));
  774. return self;
  775. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  776. }, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},$globals.HLVerticalSplitter)});
  777. //>>excludeEnd("ctx");
  778. },
  779. //>>excludeStart("ide", pragmas.excludeIdeData);
  780. args: [],
  781. 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) ] }",
  782. referencedClasses: [],
  783. //>>excludeEnd("ide");
  784. messageSends: ["draggable:", "asJQuery", "parent", "startResizing:", "helper", "resize:", "left", "offset"]
  785. }),
  786. $globals.HLVerticalSplitter);
  787. $core.addMethod(
  788. $core.method({
  789. selector: "startResizing:",
  790. protocol: 'actions',
  791. fn: function (aSplitter){
  792. var self=this;
  793. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  794. return $core.withContext(function($ctx1) {
  795. //>>excludeEnd("ctx");
  796. $recv(aSplitter)._height_($recv($recv(self["@splitter"])._asJQuery())._height());
  797. return self;
  798. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  799. }, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},$globals.HLVerticalSplitter)});
  800. //>>excludeEnd("ctx");
  801. },
  802. //>>excludeStart("ide", pragmas.excludeIdeData);
  803. args: ["aSplitter"],
  804. source: "startResizing: aSplitter\x0a\x09aSplitter height: splitter asJQuery height",
  805. referencedClasses: [],
  806. //>>excludeEnd("ide");
  807. messageSends: ["height:", "height", "asJQuery"]
  808. }),
  809. $globals.HLVerticalSplitter);
  810. $core.addMethod(
  811. $core.method({
  812. selector: "isHeliosSplitter",
  813. protocol: '*Helios-Layout',
  814. fn: function (){
  815. var self=this;
  816. return false;
  817. },
  818. //>>excludeStart("ide", pragmas.excludeIdeData);
  819. args: [],
  820. source: "isHeliosSplitter\x0a\x09^ false",
  821. referencedClasses: [],
  822. //>>excludeEnd("ide");
  823. messageSends: []
  824. }),
  825. $globals.Object);
  826. });