Helios-Layout.js 28 KB

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