Helios-Layout.js 28 KB

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