Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Restore folding of the right ("info") panel. And thus restore Downloa…
Browse files Browse the repository at this point in the history
…d and Share actions in the right-click menu. Added an optional foldingMinSize to splitter to keep a different minSize in unfolded mode. Fix #656
  • Loading branch information
cdujeu committed Oct 15, 2014
1 parent 8f520b3 commit 2715ec4
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 120 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/access.fs/fsActions.xml
Expand Up @@ -206,7 +206,7 @@
<action name="download" fileDefault="false">
<gui text="88" title="88" src="download_manager.png" iconClass="icon-download-alt" accessKey="download_access_key" hasAccessKey="true">
<context selection="true" dir="" recycle="false"
actionBar="true" contextMenu="false" infoPanel="true"
actionBar="true" contextMenu="true" infoPanel="true"
actionBarGroup="get,inline,info_panel">
</context>
<selectionContext dir="true" file="true" recycle="false" unique="false" enableRoot="true"/></gui>
Expand Down
6 changes: 3 additions & 3 deletions core/src/plugins/access.fs/fsTemplatePart.xml
Expand Up @@ -35,14 +35,14 @@
<div id="cpane_tabs" ajxpClass="AjxpTabulator" ajxpOptions='{"fit":"height", "fitParent":"browser", "refireResize":0.5, "registerAsEditorOpener":true, "saveState":true,"events":{"ajaxplorer:context_changed":"this.switchTabulator(this.tabulatorData.first().id);"}, "defaultTabId": "files","tabInfos" : [{"id":"files","label":"","iconClass":"icon-folder-open", "element":"files_list_pane"}]}'>
<div id="files_list_pane" ajxpClass="AjxpPane">
<div id="files_list_header" ajxpClass="AjxpPane">
<div id="display_toolbar" class="text_only" ajxpClass="ActionsToolbar" ajxpOptions='{"submenuClassName":"panelHeaderMenu","submenuPosition":"bottom right","submenuOffsetTop":12,"toolbarsList":["default"],"skipBubbling":true, "skipCarousel":true,"submenuOffsetTop":5}'></div>
<div id="display_toolbar" class="text_only" ajxpClass="ActionsToolbar" ajxpOptions='{"submenuClassName":"panelHeaderMenu","submenuPosition":"bottom right","submenuOffsetTop":12,"toolbarsList":["default","vertical_splitter-actions"],"skipBubbling":true, "skipCarousel":true,"submenuOffsetTop":5}'></div>
<div style="float:left;position:fixed;" ajxpClass="AjxpPane" id="buttons_bar_cont" ajxpOptions='{"flexTo":"files_list_header", "flexToMargin":30, "resize_events":["switchDisplayMode-FilesList-content_pane"]}'>
<div id="buttons_bar" class="action_bar" ajxpClass="ActionsToolbar" ajxpOptions='{"toolbarsList":["navigation", "change_main"],"groupOtherToolbars":["more", "change", "remote"], "groupOtherLabel":"More","skipBubbling":true, "skipCarousel":true,"submenuOffsetTop":2}'></div>
</div>
</div>
<div id="vertical_splitter" ajxpClass="Splitter" ajxpOptions='{"direction": "vertical", "initB":"290", "minB":290,"fit":"height","fitParent":"browser", "minSize":280, "invisibleBar": true}'>
<div id="vertical_splitter" ajxpClass="Splitter" ajxpOptions='{"direction": "vertical", "initB":"290", "minB":290,"fit":"height","fitParent":"browser", "minSize":280, "invisibleBar": true, "foldingButton":"B", "foldingButtonText":341, "foldingMinSize":0}'>
<div id="content_pane" ajxpClass="FilesList" ajxpOptions='{"displayMode":"detail","replaceScroller":true, "messageBoxReference":true, "fit":"height", "fitParent":"files_lit_pane", "cellPaddingCorrection":6, "iconBgPosition" : "5px 4px"}'></div>
<div id="info_panel" ajxpClass="InfoPanel" style="top:0;" ajxpOptions='{"replaceScroller":"true", "skipActions":true,"headerToolbarOptions":{"submenuClassName":"panelHeaderMenu","submenuPosition":"bottom right","submenuOffsetTop":12,"toolbarsList":["filter","vertical_splitter-actions"],"skipBubbling":true, "skipCarousel":true,"submenuOffsetTop":2}}'></div>
<div id="info_panel" ajxpClass="InfoPanel" style="top:0;" ajxpOptions='{"replaceScroller":"true", "skipActions":true}'></div>
</div>
</div>
</div>
Expand Down
18 changes: 3 additions & 15 deletions core/src/plugins/action.share/manifest.xml
Expand Up @@ -250,7 +250,7 @@
</action>
<action name="share-edit-shared">
<gui src="share.png" iconClass="icon-share" text="share_center.125" title="share_center.126">
<context dir="true" recycle="hidden" selection="true" actionBar="true" actionBarGroup="get,share_list_toolbar,info_panel_share" behaviour="hidden"/>
<context dir="true" recycle="hidden" selection="true" actionBar="true" contextMenu="true" actionBarGroup="get,share_list_toolbar,info_panel_share" behaviour="hidden"/>
<selectionContext dir="true" file="true" evalMetadata="metadata.get('ajxp_shared')" recycle="false" unique="true" behaviour="hidden"/>
</gui>
<processing>
Expand All @@ -260,21 +260,9 @@
]]></clientCallback>
</processing>
</action>
<action name="share-folder-workspace">
<gui src="share.png" iconClass="icon-share" text="share_center.113" title="share_center.114">
<context dir="true" recycle="hidden" selection="true"/>
<selectionContext dir="true" file="false" evalMetadata="!metadata.get('ajxp_shared')" recycle="false" unique="true"/>
</gui>
<processing>
<clientCallback prepareModal="true"><![CDATA[
if(!ajaxplorer.actionBar.shareCenter) ajaxplorer.actionBar.shareCenter = new ShareCenter();
ajaxplorer.actionBar.shareCenter.performShare('workspace');
]]></clientCallback>
</processing>
</action>
<action name="share-file-minisite">
<gui src="share.png" iconClass="icon-share" text="292" title="292">
<context dir="true" recycle="hidden" selection="true" actionBar="true" actionBarGroup="get,info_panel_share" />
<context dir="true" recycle="hidden" selection="true" actionBar="true" contextMenu="true" actionBarGroup="get,info_panel_share" />
<selectionContext dir="false" file="true" recycle="false" unique="true" evalMetadata="!metadata.get('ajxp_shared')" />
</gui>
<processing>
Expand All @@ -298,7 +286,7 @@
</action>
<action name="share-folder-minisite-public">
<gui src="share.png" iconClass="icon-share" text="292" title="292">
<context dir="true" recycle="hidden" selection="true" actionBar="true" actionBarGroup="get,info_panel_share"/>
<context dir="true" recycle="hidden" selection="true" actionBar="true" contextMenu="true" actionBarGroup="get,info_panel_share"/>
<selectionContext dir="true" file="false" recycle="false" unique="true" evalMetadata="!metadata.get('ajxp_shared')" />
</gui>
<processing>
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.InfoPanel.js
Expand Up @@ -340,14 +340,23 @@ Class.create("InfoPanel", AjxpPane, {
* Resize the panel
*/
resize : function(){
this.contentContainer.removeClassName('double');
this.contentContainer.removeClassName('triple');
this.contentContainer.removeClassName('double')
.removeClassName('triple')
.removeClassName('small')
.removeClassName('tiny');
var previewMaxHeight = 200;
if(parseInt(this.contentContainer.getWidth()) > 500) {
var currentWidth = parseInt(this.contentContainer.getWidth());
if(currentWidth < 280) {
this.contentContainer.addClassName('small');
}
if(currentWidth < 100) {
this.contentContainer.addClassName('tiny');
}
if(currentWidth > 500) {
this.contentContainer.addClassName('double');
previewMaxHeight = 300;
}
if(parseInt(this.contentContainer.getWidth()) > 750) {
if(currentWidth > 750) {
this.contentContainer.addClassName('triple');
previewMaxHeight = 450;
}
Expand Down
77 changes: 43 additions & 34 deletions core/src/plugins/gui.ajax/res/js/lib/prototype/splitter.js
Expand Up @@ -15,12 +15,12 @@
* The selected elements in the jQuery object are converted to a splitter;
* each element should have two child elements which are used for the panes
* of the splitter. The plugin adds a third child element for the splitbar.
*
*
* For more details see: http://methvin.com/jquery/splitter/
*
*
* @example $('#MySplitter').splitter();
* @desc Create a vertical splitter with default settings
* @desc Create a vertical splitter with default settings
*
* @example $('#MySplitter').splitter({direction: 'h', accessKey: 'M'});
* @desc Create a horizontal splitter resizable via Alt+Shift+M
Expand All @@ -41,14 +41,16 @@ Class.create("Splitter", AjxpPane, {
* @param container HTMLElement
* @param options Object
*/
initialize: function(container, options){
initialize: function(container, options){
this.options = Object.extend({
direction : 'vertical',
activeClass : 'active',
fit : null,
minSize : 16,
foldingButton: null,
foldingAlternateClose : null,
foldingButton : null,
foldingAlternateClose : null,
foldingMinSize : null,
foldingButtonText : null,
invisibleBar: false,
onDrag : Prototype.EmptyFunction,
endDrag : Prototype.EmptyFunction,
Expand All @@ -61,9 +63,9 @@ Class.create("Splitter", AjxpPane, {
splitbarClass: 'vsplitbar',
eventPointer: Event.pointerX,
set: 'left',
adjust: 'width',
adjust: 'width',
getAdjust: this.getWidth,
offsetAdjust: 'offsetWidth',
offsetAdjust: 'offsetWidth',
adjSide1: 'Left',
adjSide2: 'Right',
fixed: 'height',
Expand All @@ -76,24 +78,24 @@ Class.create("Splitter", AjxpPane, {
cursor: 'n-resize',
splitbarClass: 'hsplitbar',
eventPointer: Event.pointerY,
set: 'top',
adjust: 'height',
set: 'top',
adjust: 'height',
getAdjust: this.getHeight,
offsetAdjust: 'offsetHeight',
offsetAdjust: 'offsetHeight',
adjSide1: 'Top',
adjSide2: 'Bottom',
fixed: 'width',
getFixed: this.getWidth,
offsetFixed: 'offsetWidth',
fixSide1: 'Left',
fixSide2: 'Right'
fixSide2: 'Right'
};
if(this.options.direction == 'vertical') Object.extend(this.options, verticalOpts);
else Object.extend(this.options, horizontalOpts);

this.htmlElement = $(container);
this.htmlElement.ajxpPaneObject = this;

this.group = $(container).setStyle({position:'relative'});
var divs = this.group.childElements();
divs.each(function(div){
Expand Down Expand Up @@ -125,9 +127,9 @@ Class.create("Splitter", AjxpPane, {
this.endSplitFunc = this.endSplit.bind(this);
this.splitbar.observe("mousedown", this.startSplitFunc);
this.splitbar.observe("mouseup", this.endSplitFunc);

this.initCaches();

this.paneA._init = (this.options.initA==true?parseInt(this.options.getAdjust(this.paneA)):this.options.initA) || 0;
this.paneB._init = (this.options.initB==true?parseInt(this.options.getAdjust(this.paneB)):this.options.initB) || 0;
if(this.paneB._init){
Expand Down Expand Up @@ -231,10 +233,10 @@ Class.create("Splitter", AjxpPane, {
name: oThis.htmlElement.id + '_folding_action',
src:'view_left_close.png',
icon_class:'icon-remove-sign',
text_id:416,
title_id:415,
text:MessageHash[416],
title:MessageHash[415],
text_id:(oThis.options.foldingButtonText?oThis.options.foldingButtonText:416),
title_id:(oThis.options.foldingButtonText?oThis.options.foldingButtonText:415),
text:MessageHash[(oThis.options.foldingButtonText?oThis.options.foldingButtonText:416)],
title:MessageHash[(oThis.options.foldingButtonText?oThis.options.foldingButtonText:415)],
hasAccessKey:false,
subMenu:false,
subMenuUpdateImage:false,
Expand Down Expand Up @@ -316,14 +318,14 @@ Class.create("Splitter", AjxpPane, {
* @param size Integer
* @param keepPercents Boolean
*/
resizeGroup: function(event, size, keepPercents){
resizeGroup: function(event, size, keepPercents){
// console.log("Resize", this.options.direction, size);
var groupInitAdjust = this.group._adjust;
this.group._fixed = this.options.getFixed(this.group) - this.group._borderFixed;
this.group._adjust = this.group[this.options.offsetAdjust] - this.group._borderAdjust;

//if(this.group._fixed <= 0 || this.group._adjust <= 0) return;

// Recompute fixed
var optName = this.options.fixed;
var borderAdjA = this.initBorderA;
Expand All @@ -344,7 +346,7 @@ Class.create("Splitter", AjxpPane, {
}
}
// Recompute adjust
if(keepPercents && !size && groupInitAdjust){
if(keepPercents && !size && groupInitAdjust){
size = parseInt(this.paneA[this.options.offsetAdjust] * this.group._adjust / groupInitAdjust ) + this.initBorderA;
//console.log("moveSplitter::keep", this.options.direction, size);
}else{
Expand Down Expand Up @@ -524,11 +526,11 @@ Class.create("Splitter", AjxpPane, {
* @returns Boolean
*/
doSplitMouse: function(event){
if (!this.splitbar.hasClassName(this.options.activeClass)){
if (!this.splitbar.hasClassName(this.options.activeClass)){
return this.endSplit(event);
}
}
this.moveSplitter(this.paneA._posAdjust + this.options.eventPointer(event));
},
},
/**
* End drag event
* @param event Event
Expand Down Expand Up @@ -561,14 +563,20 @@ Class.create("Splitter", AjxpPane, {
* @param np Integer
*/
moveSplitter:function(np, folding, foldingSize){
var minSize = this.options.minSize;
var minPaneA = this.paneA._min;
var minPaneB = this.paneB._min;
if(folding && this.options.foldingMinSize !== undefined){
minSize = minPaneA = minPaneB = this.options.foldingMinSize;
}
if(!folding && this.options.minA && np < (this.options.minA + 10) && !this.options.noFolding){
np = this.options.minA;
var forceFolded = true;
}
np = Math.max(this.paneA._min+this.paneA._padAdjust, this.group._adjust - (this.paneB._max||9999), this.options.minSize,
Math.min(np, this.paneA._max||9999, this.group._adjust - this.splitbar._adjust -
Math.max(this.paneB._min+this.paneB._padAdjust, this.options.minSize)));
var optNameSet = this.options.set;
np = Math.max(minPaneA+this.paneA._padAdjust, this.group._adjust - (this.paneB._max||9999), minSize,
Math.min(np, this.paneA._max||9999, this.group._adjust - this.splitbar._adjust -
Math.max(minPaneB + this.paneB._padAdjust, minSize)));
var optNameSet = this.options.set;
var optNameAdjust = this.options.adjust;
if(!np) np = this.paneA._init;
this.splitbar.setStyle(this.makeStyleObject(this.options.set, (np + this.splitbar._reAdjust) +'px'));
Expand Down Expand Up @@ -616,6 +624,7 @@ Class.create("Splitter", AjxpPane, {
this.refreshFoldingAction();
}
},

/**
* Cache some CSS properties
* @param jq Object
Expand All @@ -635,8 +644,8 @@ Class.create("Splitter", AjxpPane, {
*/
optCache: function(jq, pane){
jq._min = Math.max(0, this.options["min"+pane] || parseInt(jq.getStyle("min-"+this.options.adjust)) || 0);
jq._max = Math.max(0, this.options["max"+pane] || parseInt(jq.getStyle("max-"+this.options.adjust)) || 0);
},
jq._max = Math.max(0, this.options["max"+pane] || parseInt(jq.getStyle("max-"+this.options.adjust)) || 0);
},
/**
* Initialize css cache
*/
Expand All @@ -655,7 +664,7 @@ Class.create("Splitter", AjxpPane, {
this.cssCache(this.paneB, "_padAdjust", "padding", this.options.adjSide1, this.options.adjSide2);
this.cssCache(this.paneB, "_padFixed", "padding", this.options.fixSide1, this.options.fixSide2);
this.optCache(this.paneA, 'A');
this.optCache(this.paneB, 'B');
this.optCache(this.paneB, 'B');
},
/**
* Get the width of an element
Expand All @@ -681,7 +690,7 @@ Class.create("Splitter", AjxpPane, {
}
return h;
}
},
},
/**
* Create a style object for Prototype setStyle method
* @param propStringName String
Expand Down

0 comments on commit 2715ec4

Please sign in to comment.