123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899 |
- define(["amber/boot", "require", "amber/core/Kernel-Objects", "amber/web/Web", "helios/Helios-Core"], function($boot,requirejs){"use strict";
- var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
- var $pkg = $core.addPackage("Helios-Layout");
- $pkg.innerEval = function (expr) { return eval(expr); };
- $pkg.transport = {"type":"amd","amdNamespace":"helios"};
- $core.addClass("HLContainer", $globals.HLWidget, ["splitter"], "Helios-Layout");
- $core.addMethod(
- $core.method({
- selector: "renderOn:",
- protocol: "rendering",
- fn: function (html){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv(html)._div();
- $recv($1)._class_("tool_container");
- $recv($1)._with_($self._splitter());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["html"],
- source: "renderOn: html\x0a\x09html div \x0a \x09class: 'tool_container'; \x0a with: self splitter",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["class:", "div", "with:", "splitter"]
- }),
- $globals.HLContainer);
- $core.addMethod(
- $core.method({
- selector: "splitter",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.splitter;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "splitter\x0a\x09^ splitter",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLContainer);
- $core.addMethod(
- $core.method({
- selector: "splitter:",
- protocol: "accessing",
- fn: function (aSplitter){
- var self=this,$self=this;
- $self.splitter=aSplitter;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aSplitter"],
- source: "splitter: aSplitter\x0a\x09splitter := aSplitter",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLContainer);
- $core.addMethod(
- $core.method({
- selector: "with:",
- protocol: "instance creation",
- fn: function (aSplitter){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._new();
- $recv($1)._splitter_(aSplitter);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"with:",{aSplitter:aSplitter})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aSplitter"],
- source: "with: aSplitter\x0a\x09^ self new \x0a \x09splitter: aSplitter; \x0a yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["splitter:", "new", "yourself"]
- }),
- $globals.HLContainer.a$cls);
- $core.addClass("HLSplitter", $globals.Widget, ["firstWidget", "secondWidget", "firstPane", "secondPane", "splitter"], "Helios-Layout");
- $core.addMethod(
- $core.method({
- selector: "cssClass",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return "splitter";
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "cssClass\x0a\x09^ 'splitter'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "firstWidget",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.firstWidget;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "firstWidget\x0a\x09^ firstWidget",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "firstWidget:",
- protocol: "accessing",
- fn: function (aWidget){
- var self=this,$self=this;
- $self.firstWidget=aWidget;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aWidget"],
- source: "firstWidget: aWidget\x0a\x09firstWidget := aWidget",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "isHeliosSplitter",
- protocol: "testing",
- fn: function (){
- var self=this,$self=this;
- return true;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isHeliosSplitter\x0a\x09^ true",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "panesCssClass",
- protocol: "rendering",
- fn: function (){
- var self=this,$self=this;
- return "panes";
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "panesCssClass\x0a\x09^ 'panes'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "renderOn:",
- protocol: "rendering",
- fn: function (html){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$2,$3,$4;
- $1=$recv(html)._div();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["div"]=1;
- //>>excludeEnd("ctx");
- $recv($1)._class_($self._panesCssClass());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["class:"]=1;
- //>>excludeEnd("ctx");
- $recv($1)._with_((function(){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- $2=$recv(html)._div();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["div"]=2;
- //>>excludeEnd("ctx");
- $recv($2)._class_("pane");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["class:"]=2;
- //>>excludeEnd("ctx");
- $self.firstPane=$recv($2)._with_($self._firstWidget());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["with:"]=2;
- //>>excludeEnd("ctx");
- $3=$recv(html)._div();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["div"]=3;
- //>>excludeEnd("ctx");
- $self.splitter=$recv($3)._class_($self._cssClass());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx2.sendIdx["class:"]=3;
- //>>excludeEnd("ctx");
- $4=$recv(html)._div();
- $recv($4)._class_("pane");
- $self.secondPane=$recv($4)._with_($self._secondWidget());
- return $self.secondPane;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
- //>>excludeEnd("ctx");
- }));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["with:"]=1;
- //>>excludeEnd("ctx");
- $self._setupSplitter();
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["html"],
- 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",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["class:", "div", "panesCssClass", "with:", "firstWidget", "cssClass", "secondWidget", "setupSplitter"]
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "resize",
- protocol: "rendering",
- fn: function (){
- var self=this,$self=this;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "resize",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "secondWidget",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- return $self.secondWidget;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "secondWidget\x0a\x09^ secondWidget",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "secondWidget:",
- protocol: "accessing",
- fn: function (aWidget){
- var self=this,$self=this;
- $self.secondWidget=aWidget;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aWidget"],
- source: "secondWidget: aWidget\x0a\x09secondWidget := aWidget",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "setupSplitter",
- protocol: "rendering",
- fn: function (){
- var self=this,$self=this;
- return self;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "setupSplitter",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.HLSplitter);
- $core.addMethod(
- $core.method({
- selector: "with:with:",
- protocol: "instance creation",
- fn: function (aWidget,anotherWidget){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$self._new();
- $recv($1)._firstWidget_(aWidget);
- $recv($1)._secondWidget_(anotherWidget);
- return $recv($1)._yourself();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"with:with:",{aWidget:aWidget,anotherWidget:anotherWidget})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aWidget", "anotherWidget"],
- source: "with: aWidget with: anotherWidget\x0a\x09^ self new\x0a \x09\x09firstWidget: aWidget;\x0a secondWidget: anotherWidget;\x0a yourself",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["firstWidget:", "new", "secondWidget:", "yourself"]
- }),
- $globals.HLSplitter.a$cls);
- $core.addClass("HLHorizontalSplitter", $globals.HLSplitter, [], "Helios-Layout");
- $core.addMethod(
- $core.method({
- selector: "cssClass",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLHorizontalSplitter.superclass||$boot.nilAsClass).fn.prototype._cssClass.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- return $recv($1).__comma(" horizontal");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' horizontal'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: [",", "cssClass"]
- }),
- $globals.HLHorizontalSplitter);
- $core.addMethod(
- $core.method({
- selector: "panesCssClass",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLHorizontalSplitter.superclass||$boot.nilAsClass).fn.prototype._panesCssClass.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- return $recv($1).__comma(" horizontal");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "panesCssClass\x0a\x09^ super panesCssClass, ' horizontal'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: [",", "panesCssClass"]
- }),
- $globals.HLHorizontalSplitter);
- $core.addMethod(
- $core.method({
- selector: "resize",
- protocol: "actions",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._resize_($recv($recv($self.splitter)._asJQuery())._css_("top"));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"resize",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "resize\x0a\x09self resize: (splitter asJQuery css: 'top')",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["resize:", "css:", "asJQuery"]
- }),
- $globals.HLHorizontalSplitter);
- $core.addMethod(
- $core.method({
- selector: "resize:",
- protocol: "actions",
- fn: function (anInteger){
- var self=this,$self=this;
- var container,size,offset,percentage;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
- $1=$recv($self.firstPane)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=1;
- //>>excludeEnd("ctx");
- container=$recv($1)._parent();
- $3=$recv($self.firstPane)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=2;
- //>>excludeEnd("ctx");
- $2=$recv($3)._offset();
- offset=$recv($2)._top();
- size=$recv(container)._height();
- $6=size;
- $7=$recv(anInteger).__minus(offset);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["-"]=2;
- //>>excludeEnd("ctx");
- $5=$recv($6).__minus($7);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["-"]=1;
- //>>excludeEnd("ctx");
- $4=$recv($5).__slash(size);
- percentage=$recv($4).__star((100));
- percentage=(80)._min_($recv(percentage)._max_((20)));
- $8=$recv($self.firstPane)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=3;
- //>>excludeEnd("ctx");
- $10=$recv(percentage)._asString();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asString"]=1;
- //>>excludeEnd("ctx");
- $9=$recv($10).__comma("%");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv($8)._css_put_("bottom",$9);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["css:put:"]=1;
- //>>excludeEnd("ctx");
- $11=$recv($self.splitter)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=4;
- //>>excludeEnd("ctx");
- $14=(100).__minus(percentage);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["-"]=3;
- //>>excludeEnd("ctx");
- $13=$recv($14)._asString();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asString"]=2;
- //>>excludeEnd("ctx");
- $12=$recv($13).__comma("%");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $recv($11)._css_put_("top",$12);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["css:put:"]=2;
- //>>excludeEnd("ctx");
- $recv($recv($self.secondPane)._asJQuery())._css_put_("top",$recv($recv((100).__minus(percentage))._asString()).__comma("%"));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anInteger"],
- 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, '%'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["parent", "asJQuery", "top", "offset", "height", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"]
- }),
- $globals.HLHorizontalSplitter);
- $core.addMethod(
- $core.method({
- selector: "setupSplitter",
- protocol: "rendering",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv($self.splitter)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=1;
- //>>excludeEnd("ctx");
- $recv($1)._draggable_($globals.HashedCollection._newFromPairs_(["axis","y","containment",$recv($recv($self.splitter)._asJQuery())._parent(),"helper","clone","start",(function(e,ui){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._startResizing_($recv(ui)._helper());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)});
- //>>excludeEnd("ctx");
- }),"drag",(function(e,ui){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._resize_($recv($recv(ui)._offset())._top());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)});
- //>>excludeEnd("ctx");
- })]));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setupSplitter",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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 ] }",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["draggable:", "asJQuery", "parent", "startResizing:", "helper", "resize:", "top", "offset"]
- }),
- $globals.HLHorizontalSplitter);
- $core.addMethod(
- $core.method({
- selector: "startResizing:",
- protocol: "actions",
- fn: function (aSplitter){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aSplitter)._width_($recv($recv($self.splitter)._asJQuery())._width());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aSplitter"],
- source: "startResizing: aSplitter\x0a\x09aSplitter width: splitter asJQuery width",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["width:", "width", "asJQuery"]
- }),
- $globals.HLHorizontalSplitter);
- $core.addClass("HLVerticalSplitter", $globals.HLSplitter, [], "Helios-Layout");
- $core.addMethod(
- $core.method({
- selector: "cssClass",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLVerticalSplitter.superclass||$boot.nilAsClass).fn.prototype._cssClass.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- return $recv($1).__comma(" vertical");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"cssClass",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "cssClass\x0a\x09^ super cssClass, ' vertical'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: [",", "cssClass"]
- }),
- $globals.HLVerticalSplitter);
- $core.addMethod(
- $core.method({
- selector: "panesCssClass",
- protocol: "accessing",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=(
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = true,
- //>>excludeEnd("ctx");
- ($globals.HLVerticalSplitter.superclass||$boot.nilAsClass).fn.prototype._panesCssClass.apply($self, []));
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.supercall = false;
- //>>excludeEnd("ctx");;
- return $recv($1).__comma(" vertical");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"panesCssClass",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "panesCssClass\x0a\x09^ super panesCssClass, ' vertical'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: [",", "panesCssClass"]
- }),
- $globals.HLVerticalSplitter);
- $core.addMethod(
- $core.method({
- selector: "resize",
- protocol: "actions",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $self._resize_($recv($recv($self.splitter)._asJQuery())._css_("left"));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"resize",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "resize\x0a\x09self resize: (splitter asJQuery css: 'left')",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["resize:", "css:", "asJQuery"]
- }),
- $globals.HLVerticalSplitter);
- $core.addMethod(
- $core.method({
- selector: "resize:",
- protocol: "actions",
- fn: function (anInteger){
- var self=this,$self=this;
- var container,size,offset,percentage;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
- $1=$recv($self.firstPane)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=1;
- //>>excludeEnd("ctx");
- container=$recv($1)._parent();
- $3=$recv($self.firstPane)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=2;
- //>>excludeEnd("ctx");
- $2=$recv($3)._offset();
- offset=$recv($2)._left();
- size=$recv(container)._width();
- $6=size;
- $7=$recv(anInteger).__minus(offset);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["-"]=2;
- //>>excludeEnd("ctx");
- $5=$recv($6).__minus($7);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["-"]=1;
- //>>excludeEnd("ctx");
- $4=$recv($5).__slash(size);
- percentage=$recv($4).__star((100));
- percentage=(80)._min_($recv(percentage)._max_((20)));
- $8=$recv($self.firstPane)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=3;
- //>>excludeEnd("ctx");
- $10=$recv(percentage)._asString();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asString"]=1;
- //>>excludeEnd("ctx");
- $9=$recv($10).__comma("%");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=1;
- //>>excludeEnd("ctx");
- $recv($8)._css_put_("right",$9);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["css:put:"]=1;
- //>>excludeEnd("ctx");
- $11=$recv($self.splitter)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=4;
- //>>excludeEnd("ctx");
- $14=(100).__minus(percentage);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["-"]=3;
- //>>excludeEnd("ctx");
- $13=$recv($14)._asString();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asString"]=2;
- //>>excludeEnd("ctx");
- $12=$recv($13).__comma("%");
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx[","]=2;
- //>>excludeEnd("ctx");
- $recv($11)._css_put_("left",$12);
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["css:put:"]=2;
- //>>excludeEnd("ctx");
- $recv($recv($self.secondPane)._asJQuery())._css_put_("left",$recv($recv((100).__minus(percentage))._asString()).__comma("%"));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["anInteger"],
- 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, '%'",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["parent", "asJQuery", "left", "offset", "width", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"]
- }),
- $globals.HLVerticalSplitter);
- $core.addMethod(
- $core.method({
- selector: "setupSplitter",
- protocol: "rendering",
- fn: function (){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- var $1;
- $1=$recv($self.splitter)._asJQuery();
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- $ctx1.sendIdx["asJQuery"]=1;
- //>>excludeEnd("ctx");
- $recv($1)._draggable_($globals.HashedCollection._newFromPairs_(["axis","x","containment",$recv($recv($self.splitter)._asJQuery())._parent(),"helper","clone","start",(function(e,ui){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._startResizing_($recv(ui)._helper());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)});
- //>>excludeEnd("ctx");
- }),"drag",(function(e,ui){
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx2) {
- //>>excludeEnd("ctx");
- return $self._resize_($recv($recv(ui)._offset())._left());
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)});
- //>>excludeEnd("ctx");
- })]));
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"setupSplitter",{})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- 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) ] }",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["draggable:", "asJQuery", "parent", "startResizing:", "helper", "resize:", "left", "offset"]
- }),
- $globals.HLVerticalSplitter);
- $core.addMethod(
- $core.method({
- selector: "startResizing:",
- protocol: "actions",
- fn: function (aSplitter){
- var self=this,$self=this;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- return $core.withContext(function($ctx1) {
- //>>excludeEnd("ctx");
- $recv(aSplitter)._height_($recv($recv($self.splitter)._asJQuery())._height());
- return self;
- //>>excludeStart("ctx", pragmas.excludeDebugContexts);
- }, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter})});
- //>>excludeEnd("ctx");
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: ["aSplitter"],
- source: "startResizing: aSplitter\x0a\x09aSplitter height: splitter asJQuery height",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: ["height:", "height", "asJQuery"]
- }),
- $globals.HLVerticalSplitter);
- $core.addMethod(
- $core.method({
- selector: "isHeliosSplitter",
- protocol: "*Helios-Layout",
- fn: function (){
- var self=this,$self=this;
- return false;
- },
- //>>excludeStart("ide", pragmas.excludeIdeData);
- args: [],
- source: "isHeliosSplitter\x0a\x09^ false",
- referencedClasses: [],
- //>>excludeEnd("ide");
- pragmas: [],
- messageSends: []
- }),
- $globals.Object);
- });
|