Helios-Layout.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  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},$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,$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,$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,$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.a$cls)});
  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.a$cls);
  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,$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,$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,$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,$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,$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,$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. $5=$recv(html)._div();
  209. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  210. $ctx2.sendIdx["div"]=3;
  211. //>>excludeEnd("ctx");
  212. $self.splitter=$recv($5)._class_($self._cssClass());
  213. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  214. $ctx2.sendIdx["class:"]=3;
  215. //>>excludeEnd("ctx");
  216. $6=$recv(html)._div();
  217. $recv($6)._class_("pane");
  218. $self.secondPane=$recv($6)._with_($self._secondWidget());
  219. return $self.secondPane;
  220. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  221. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
  222. //>>excludeEnd("ctx");
  223. }));
  224. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  225. $ctx1.sendIdx["with:"]=1;
  226. //>>excludeEnd("ctx");
  227. $self._setupSplitter();
  228. return self;
  229. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  230. }, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},$globals.HLSplitter)});
  231. //>>excludeEnd("ctx");
  232. },
  233. //>>excludeStart("ide", pragmas.excludeIdeData);
  234. args: ["html"],
  235. 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",
  236. referencedClasses: [],
  237. //>>excludeEnd("ide");
  238. messageSends: ["class:", "div", "panesCssClass", "with:", "firstWidget", "cssClass", "secondWidget", "setupSplitter"]
  239. }),
  240. $globals.HLSplitter);
  241. $core.addMethod(
  242. $core.method({
  243. selector: "resize",
  244. protocol: "rendering",
  245. fn: function (){
  246. var self=this,$self=this;
  247. return self;
  248. },
  249. //>>excludeStart("ide", pragmas.excludeIdeData);
  250. args: [],
  251. source: "resize",
  252. referencedClasses: [],
  253. //>>excludeEnd("ide");
  254. messageSends: []
  255. }),
  256. $globals.HLSplitter);
  257. $core.addMethod(
  258. $core.method({
  259. selector: "secondWidget",
  260. protocol: "accessing",
  261. fn: function (){
  262. var self=this,$self=this;
  263. return $self.secondWidget;
  264. },
  265. //>>excludeStart("ide", pragmas.excludeIdeData);
  266. args: [],
  267. source: "secondWidget\x0a\x09^ secondWidget",
  268. referencedClasses: [],
  269. //>>excludeEnd("ide");
  270. messageSends: []
  271. }),
  272. $globals.HLSplitter);
  273. $core.addMethod(
  274. $core.method({
  275. selector: "secondWidget:",
  276. protocol: "accessing",
  277. fn: function (aWidget){
  278. var self=this,$self=this;
  279. $self.secondWidget=aWidget;
  280. return self;
  281. },
  282. //>>excludeStart("ide", pragmas.excludeIdeData);
  283. args: ["aWidget"],
  284. source: "secondWidget: aWidget\x0a\x09secondWidget := aWidget",
  285. referencedClasses: [],
  286. //>>excludeEnd("ide");
  287. messageSends: []
  288. }),
  289. $globals.HLSplitter);
  290. $core.addMethod(
  291. $core.method({
  292. selector: "setupSplitter",
  293. protocol: "rendering",
  294. fn: function (){
  295. var self=this,$self=this;
  296. return self;
  297. },
  298. //>>excludeStart("ide", pragmas.excludeIdeData);
  299. args: [],
  300. source: "setupSplitter",
  301. referencedClasses: [],
  302. //>>excludeEnd("ide");
  303. messageSends: []
  304. }),
  305. $globals.HLSplitter);
  306. $core.addMethod(
  307. $core.method({
  308. selector: "with:with:",
  309. protocol: "instance creation",
  310. fn: function (aWidget,anotherWidget){
  311. var self=this,$self=this;
  312. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  313. return $core.withContext(function($ctx1) {
  314. //>>excludeEnd("ctx");
  315. var $1;
  316. $1=$self._new();
  317. $recv($1)._firstWidget_(aWidget);
  318. $recv($1)._secondWidget_(anotherWidget);
  319. return $recv($1)._yourself();
  320. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  321. }, function($ctx1) {$ctx1.fill(self,"with:with:",{aWidget:aWidget,anotherWidget:anotherWidget},$globals.HLSplitter.a$cls)});
  322. //>>excludeEnd("ctx");
  323. },
  324. //>>excludeStart("ide", pragmas.excludeIdeData);
  325. args: ["aWidget", "anotherWidget"],
  326. source: "with: aWidget with: anotherWidget\x0a\x09^ self new\x0a \x09\x09firstWidget: aWidget;\x0a secondWidget: anotherWidget;\x0a yourself",
  327. referencedClasses: [],
  328. //>>excludeEnd("ide");
  329. messageSends: ["firstWidget:", "new", "secondWidget:", "yourself"]
  330. }),
  331. $globals.HLSplitter.a$cls);
  332. $core.addClass("HLHorizontalSplitter", $globals.HLSplitter, [], "Helios-Layout");
  333. $core.addMethod(
  334. $core.method({
  335. selector: "cssClass",
  336. protocol: "accessing",
  337. fn: function (){
  338. var self=this,$self=this;
  339. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  340. return $core.withContext(function($ctx1) {
  341. //>>excludeEnd("ctx");
  342. var $1;
  343. $1=(
  344. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  345. $ctx1.supercall = true,
  346. //>>excludeEnd("ctx");
  347. ($globals.HLHorizontalSplitter.superclass||$boot.nilAsClass).fn.prototype._cssClass.apply($self, []));
  348. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  349. $ctx1.supercall = false;
  350. //>>excludeEnd("ctx");;
  351. return $recv($1).__comma(" horizontal");
  352. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  353. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},$globals.HLHorizontalSplitter)});
  354. //>>excludeEnd("ctx");
  355. },
  356. //>>excludeStart("ide", pragmas.excludeIdeData);
  357. args: [],
  358. source: "cssClass\x0a\x09^ super cssClass, ' horizontal'",
  359. referencedClasses: [],
  360. //>>excludeEnd("ide");
  361. messageSends: [",", "cssClass"]
  362. }),
  363. $globals.HLHorizontalSplitter);
  364. $core.addMethod(
  365. $core.method({
  366. selector: "panesCssClass",
  367. protocol: "accessing",
  368. fn: function (){
  369. var self=this,$self=this;
  370. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  371. return $core.withContext(function($ctx1) {
  372. //>>excludeEnd("ctx");
  373. var $1;
  374. $1=(
  375. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  376. $ctx1.supercall = true,
  377. //>>excludeEnd("ctx");
  378. ($globals.HLHorizontalSplitter.superclass||$boot.nilAsClass).fn.prototype._panesCssClass.apply($self, []));
  379. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  380. $ctx1.supercall = false;
  381. //>>excludeEnd("ctx");;
  382. return $recv($1).__comma(" horizontal");
  383. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  384. }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},$globals.HLHorizontalSplitter)});
  385. //>>excludeEnd("ctx");
  386. },
  387. //>>excludeStart("ide", pragmas.excludeIdeData);
  388. args: [],
  389. source: "panesCssClass\x0a\x09^ super panesCssClass, ' horizontal'",
  390. referencedClasses: [],
  391. //>>excludeEnd("ide");
  392. messageSends: [",", "panesCssClass"]
  393. }),
  394. $globals.HLHorizontalSplitter);
  395. $core.addMethod(
  396. $core.method({
  397. selector: "resize",
  398. protocol: "actions",
  399. fn: function (){
  400. var self=this,$self=this;
  401. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  402. return $core.withContext(function($ctx1) {
  403. //>>excludeEnd("ctx");
  404. $self._resize_($recv($recv($self.splitter)._asJQuery())._css_("top"));
  405. return self;
  406. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  407. }, function($ctx1) {$ctx1.fill(self,"resize",{},$globals.HLHorizontalSplitter)});
  408. //>>excludeEnd("ctx");
  409. },
  410. //>>excludeStart("ide", pragmas.excludeIdeData);
  411. args: [],
  412. source: "resize\x0a\x09self resize: (splitter asJQuery css: 'top')",
  413. referencedClasses: [],
  414. //>>excludeEnd("ide");
  415. messageSends: ["resize:", "css:", "asJQuery"]
  416. }),
  417. $globals.HLHorizontalSplitter);
  418. $core.addMethod(
  419. $core.method({
  420. selector: "resize:",
  421. protocol: "actions",
  422. fn: function (anInteger){
  423. var self=this,$self=this;
  424. var container,size,offset,percentage;
  425. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  426. return $core.withContext(function($ctx1) {
  427. //>>excludeEnd("ctx");
  428. var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
  429. $1=$recv($self.firstPane)._asJQuery();
  430. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  431. $ctx1.sendIdx["asJQuery"]=1;
  432. //>>excludeEnd("ctx");
  433. container=$recv($1)._parent();
  434. $3=$recv($self.firstPane)._asJQuery();
  435. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  436. $ctx1.sendIdx["asJQuery"]=2;
  437. //>>excludeEnd("ctx");
  438. $2=$recv($3)._offset();
  439. offset=$recv($2)._top();
  440. size=$recv(container)._height();
  441. $6=size;
  442. $7=$recv(anInteger).__minus(offset);
  443. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  444. $ctx1.sendIdx["-"]=2;
  445. //>>excludeEnd("ctx");
  446. $5=$recv($6).__minus($7);
  447. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  448. $ctx1.sendIdx["-"]=1;
  449. //>>excludeEnd("ctx");
  450. $4=$recv($5).__slash(size);
  451. percentage=$recv($4).__star((100));
  452. percentage=(80)._min_($recv(percentage)._max_((20)));
  453. $8=$recv($self.firstPane)._asJQuery();
  454. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  455. $ctx1.sendIdx["asJQuery"]=3;
  456. //>>excludeEnd("ctx");
  457. $10=$recv(percentage)._asString();
  458. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  459. $ctx1.sendIdx["asString"]=1;
  460. //>>excludeEnd("ctx");
  461. $9=$recv($10).__comma("%");
  462. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  463. $ctx1.sendIdx[","]=1;
  464. //>>excludeEnd("ctx");
  465. $recv($8)._css_put_("bottom",$9);
  466. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  467. $ctx1.sendIdx["css:put:"]=1;
  468. //>>excludeEnd("ctx");
  469. $11=$recv($self.splitter)._asJQuery();
  470. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  471. $ctx1.sendIdx["asJQuery"]=4;
  472. //>>excludeEnd("ctx");
  473. $14=(100).__minus(percentage);
  474. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  475. $ctx1.sendIdx["-"]=3;
  476. //>>excludeEnd("ctx");
  477. $13=$recv($14)._asString();
  478. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  479. $ctx1.sendIdx["asString"]=2;
  480. //>>excludeEnd("ctx");
  481. $12=$recv($13).__comma("%");
  482. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  483. $ctx1.sendIdx[","]=2;
  484. //>>excludeEnd("ctx");
  485. $recv($11)._css_put_("top",$12);
  486. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  487. $ctx1.sendIdx["css:put:"]=2;
  488. //>>excludeEnd("ctx");
  489. $recv($recv($self.secondPane)._asJQuery())._css_put_("top",$recv($recv((100).__minus(percentage))._asString()).__comma("%"));
  490. return self;
  491. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  492. }, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},$globals.HLHorizontalSplitter)});
  493. //>>excludeEnd("ctx");
  494. },
  495. //>>excludeStart("ide", pragmas.excludeIdeData);
  496. args: ["anInteger"],
  497. 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, '%'",
  498. referencedClasses: [],
  499. //>>excludeEnd("ide");
  500. messageSends: ["parent", "asJQuery", "top", "offset", "height", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"]
  501. }),
  502. $globals.HLHorizontalSplitter);
  503. $core.addMethod(
  504. $core.method({
  505. selector: "setupSplitter",
  506. protocol: "rendering",
  507. fn: function (){
  508. var self=this,$self=this;
  509. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  510. return $core.withContext(function($ctx1) {
  511. //>>excludeEnd("ctx");
  512. var $1;
  513. $1=$recv($self.splitter)._asJQuery();
  514. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  515. $ctx1.sendIdx["asJQuery"]=1;
  516. //>>excludeEnd("ctx");
  517. $recv($1)._draggable_($globals.HashedCollection._newFromPairs_(["axis","y","containment",$recv($recv($self.splitter)._asJQuery())._parent(),"helper","clone","start",(function(e,ui){
  518. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  519. return $core.withContext(function($ctx2) {
  520. //>>excludeEnd("ctx");
  521. return $self._startResizing_($recv(ui)._helper());
  522. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  523. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)});
  524. //>>excludeEnd("ctx");
  525. }),"drag",(function(e,ui){
  526. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  527. return $core.withContext(function($ctx2) {
  528. //>>excludeEnd("ctx");
  529. return $self._resize_($recv($recv(ui)._offset())._top());
  530. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  531. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)});
  532. //>>excludeEnd("ctx");
  533. })]));
  534. return self;
  535. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  536. }, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},$globals.HLHorizontalSplitter)});
  537. //>>excludeEnd("ctx");
  538. },
  539. //>>excludeStart("ide", pragmas.excludeIdeData);
  540. args: [],
  541. 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 ] }",
  542. referencedClasses: [],
  543. //>>excludeEnd("ide");
  544. messageSends: ["draggable:", "asJQuery", "parent", "startResizing:", "helper", "resize:", "top", "offset"]
  545. }),
  546. $globals.HLHorizontalSplitter);
  547. $core.addMethod(
  548. $core.method({
  549. selector: "startResizing:",
  550. protocol: "actions",
  551. fn: function (aSplitter){
  552. var self=this,$self=this;
  553. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  554. return $core.withContext(function($ctx1) {
  555. //>>excludeEnd("ctx");
  556. $recv(aSplitter)._width_($recv($recv($self.splitter)._asJQuery())._width());
  557. return self;
  558. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  559. }, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},$globals.HLHorizontalSplitter)});
  560. //>>excludeEnd("ctx");
  561. },
  562. //>>excludeStart("ide", pragmas.excludeIdeData);
  563. args: ["aSplitter"],
  564. source: "startResizing: aSplitter\x0a\x09aSplitter width: splitter asJQuery width",
  565. referencedClasses: [],
  566. //>>excludeEnd("ide");
  567. messageSends: ["width:", "width", "asJQuery"]
  568. }),
  569. $globals.HLHorizontalSplitter);
  570. $core.addClass("HLVerticalSplitter", $globals.HLSplitter, [], "Helios-Layout");
  571. $core.addMethod(
  572. $core.method({
  573. selector: "cssClass",
  574. protocol: "accessing",
  575. fn: function (){
  576. var self=this,$self=this;
  577. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  578. return $core.withContext(function($ctx1) {
  579. //>>excludeEnd("ctx");
  580. var $1;
  581. $1=(
  582. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  583. $ctx1.supercall = true,
  584. //>>excludeEnd("ctx");
  585. ($globals.HLVerticalSplitter.superclass||$boot.nilAsClass).fn.prototype._cssClass.apply($self, []));
  586. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  587. $ctx1.supercall = false;
  588. //>>excludeEnd("ctx");;
  589. return $recv($1).__comma(" vertical");
  590. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  591. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},$globals.HLVerticalSplitter)});
  592. //>>excludeEnd("ctx");
  593. },
  594. //>>excludeStart("ide", pragmas.excludeIdeData);
  595. args: [],
  596. source: "cssClass\x0a\x09^ super cssClass, ' vertical'",
  597. referencedClasses: [],
  598. //>>excludeEnd("ide");
  599. messageSends: [",", "cssClass"]
  600. }),
  601. $globals.HLVerticalSplitter);
  602. $core.addMethod(
  603. $core.method({
  604. selector: "panesCssClass",
  605. protocol: "accessing",
  606. fn: function (){
  607. var self=this,$self=this;
  608. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  609. return $core.withContext(function($ctx1) {
  610. //>>excludeEnd("ctx");
  611. var $1;
  612. $1=(
  613. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  614. $ctx1.supercall = true,
  615. //>>excludeEnd("ctx");
  616. ($globals.HLVerticalSplitter.superclass||$boot.nilAsClass).fn.prototype._panesCssClass.apply($self, []));
  617. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  618. $ctx1.supercall = false;
  619. //>>excludeEnd("ctx");;
  620. return $recv($1).__comma(" vertical");
  621. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  622. }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},$globals.HLVerticalSplitter)});
  623. //>>excludeEnd("ctx");
  624. },
  625. //>>excludeStart("ide", pragmas.excludeIdeData);
  626. args: [],
  627. source: "panesCssClass\x0a\x09^ super panesCssClass, ' vertical'",
  628. referencedClasses: [],
  629. //>>excludeEnd("ide");
  630. messageSends: [",", "panesCssClass"]
  631. }),
  632. $globals.HLVerticalSplitter);
  633. $core.addMethod(
  634. $core.method({
  635. selector: "resize",
  636. protocol: "actions",
  637. fn: function (){
  638. var self=this,$self=this;
  639. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  640. return $core.withContext(function($ctx1) {
  641. //>>excludeEnd("ctx");
  642. $self._resize_($recv($recv($self.splitter)._asJQuery())._css_("left"));
  643. return self;
  644. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  645. }, function($ctx1) {$ctx1.fill(self,"resize",{},$globals.HLVerticalSplitter)});
  646. //>>excludeEnd("ctx");
  647. },
  648. //>>excludeStart("ide", pragmas.excludeIdeData);
  649. args: [],
  650. source: "resize\x0a\x09self resize: (splitter asJQuery css: 'left')",
  651. referencedClasses: [],
  652. //>>excludeEnd("ide");
  653. messageSends: ["resize:", "css:", "asJQuery"]
  654. }),
  655. $globals.HLVerticalSplitter);
  656. $core.addMethod(
  657. $core.method({
  658. selector: "resize:",
  659. protocol: "actions",
  660. fn: function (anInteger){
  661. var self=this,$self=this;
  662. var container,size,offset,percentage;
  663. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  664. return $core.withContext(function($ctx1) {
  665. //>>excludeEnd("ctx");
  666. var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
  667. $1=$recv($self.firstPane)._asJQuery();
  668. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  669. $ctx1.sendIdx["asJQuery"]=1;
  670. //>>excludeEnd("ctx");
  671. container=$recv($1)._parent();
  672. $3=$recv($self.firstPane)._asJQuery();
  673. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  674. $ctx1.sendIdx["asJQuery"]=2;
  675. //>>excludeEnd("ctx");
  676. $2=$recv($3)._offset();
  677. offset=$recv($2)._left();
  678. size=$recv(container)._width();
  679. $6=size;
  680. $7=$recv(anInteger).__minus(offset);
  681. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  682. $ctx1.sendIdx["-"]=2;
  683. //>>excludeEnd("ctx");
  684. $5=$recv($6).__minus($7);
  685. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  686. $ctx1.sendIdx["-"]=1;
  687. //>>excludeEnd("ctx");
  688. $4=$recv($5).__slash(size);
  689. percentage=$recv($4).__star((100));
  690. percentage=(80)._min_($recv(percentage)._max_((20)));
  691. $8=$recv($self.firstPane)._asJQuery();
  692. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  693. $ctx1.sendIdx["asJQuery"]=3;
  694. //>>excludeEnd("ctx");
  695. $10=$recv(percentage)._asString();
  696. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  697. $ctx1.sendIdx["asString"]=1;
  698. //>>excludeEnd("ctx");
  699. $9=$recv($10).__comma("%");
  700. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  701. $ctx1.sendIdx[","]=1;
  702. //>>excludeEnd("ctx");
  703. $recv($8)._css_put_("right",$9);
  704. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  705. $ctx1.sendIdx["css:put:"]=1;
  706. //>>excludeEnd("ctx");
  707. $11=$recv($self.splitter)._asJQuery();
  708. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  709. $ctx1.sendIdx["asJQuery"]=4;
  710. //>>excludeEnd("ctx");
  711. $14=(100).__minus(percentage);
  712. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  713. $ctx1.sendIdx["-"]=3;
  714. //>>excludeEnd("ctx");
  715. $13=$recv($14)._asString();
  716. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  717. $ctx1.sendIdx["asString"]=2;
  718. //>>excludeEnd("ctx");
  719. $12=$recv($13).__comma("%");
  720. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  721. $ctx1.sendIdx[","]=2;
  722. //>>excludeEnd("ctx");
  723. $recv($11)._css_put_("left",$12);
  724. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  725. $ctx1.sendIdx["css:put:"]=2;
  726. //>>excludeEnd("ctx");
  727. $recv($recv($self.secondPane)._asJQuery())._css_put_("left",$recv($recv((100).__minus(percentage))._asString()).__comma("%"));
  728. return self;
  729. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  730. }, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},$globals.HLVerticalSplitter)});
  731. //>>excludeEnd("ctx");
  732. },
  733. //>>excludeStart("ide", pragmas.excludeIdeData);
  734. args: ["anInteger"],
  735. 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, '%'",
  736. referencedClasses: [],
  737. //>>excludeEnd("ide");
  738. messageSends: ["parent", "asJQuery", "left", "offset", "width", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"]
  739. }),
  740. $globals.HLVerticalSplitter);
  741. $core.addMethod(
  742. $core.method({
  743. selector: "setupSplitter",
  744. protocol: "rendering",
  745. fn: function (){
  746. var self=this,$self=this;
  747. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  748. return $core.withContext(function($ctx1) {
  749. //>>excludeEnd("ctx");
  750. var $1;
  751. $1=$recv($self.splitter)._asJQuery();
  752. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  753. $ctx1.sendIdx["asJQuery"]=1;
  754. //>>excludeEnd("ctx");
  755. $recv($1)._draggable_($globals.HashedCollection._newFromPairs_(["axis","x","containment",$recv($recv($self.splitter)._asJQuery())._parent(),"helper","clone","start",(function(e,ui){
  756. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  757. return $core.withContext(function($ctx2) {
  758. //>>excludeEnd("ctx");
  759. return $self._startResizing_($recv(ui)._helper());
  760. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  761. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)});
  762. //>>excludeEnd("ctx");
  763. }),"drag",(function(e,ui){
  764. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  765. return $core.withContext(function($ctx2) {
  766. //>>excludeEnd("ctx");
  767. return $self._resize_($recv($recv(ui)._offset())._left());
  768. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  769. }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)});
  770. //>>excludeEnd("ctx");
  771. })]));
  772. return self;
  773. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  774. }, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},$globals.HLVerticalSplitter)});
  775. //>>excludeEnd("ctx");
  776. },
  777. //>>excludeStart("ide", pragmas.excludeIdeData);
  778. args: [],
  779. 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) ] }",
  780. referencedClasses: [],
  781. //>>excludeEnd("ide");
  782. messageSends: ["draggable:", "asJQuery", "parent", "startResizing:", "helper", "resize:", "left", "offset"]
  783. }),
  784. $globals.HLVerticalSplitter);
  785. $core.addMethod(
  786. $core.method({
  787. selector: "startResizing:",
  788. protocol: "actions",
  789. fn: function (aSplitter){
  790. var self=this,$self=this;
  791. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  792. return $core.withContext(function($ctx1) {
  793. //>>excludeEnd("ctx");
  794. $recv(aSplitter)._height_($recv($recv($self.splitter)._asJQuery())._height());
  795. return self;
  796. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  797. }, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},$globals.HLVerticalSplitter)});
  798. //>>excludeEnd("ctx");
  799. },
  800. //>>excludeStart("ide", pragmas.excludeIdeData);
  801. args: ["aSplitter"],
  802. source: "startResizing: aSplitter\x0a\x09aSplitter height: splitter asJQuery height",
  803. referencedClasses: [],
  804. //>>excludeEnd("ide");
  805. messageSends: ["height:", "height", "asJQuery"]
  806. }),
  807. $globals.HLVerticalSplitter);
  808. $core.addMethod(
  809. $core.method({
  810. selector: "isHeliosSplitter",
  811. protocol: "*Helios-Layout",
  812. fn: function (){
  813. var self=this,$self=this;
  814. return false;
  815. },
  816. //>>excludeStart("ide", pragmas.excludeIdeData);
  817. args: [],
  818. source: "isHeliosSplitter\x0a\x09^ false",
  819. referencedClasses: [],
  820. //>>excludeEnd("ide");
  821. messageSends: []
  822. }),
  823. $globals.Object);
  824. });