Helios-Layout.js 28 KB

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