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

Commit

Permalink
Browse files Browse the repository at this point in the history
Tab-based editors
  • Loading branch information
cdujeu committed Sep 21, 2013
1 parent 6b85754 commit 83774e3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
4 changes: 2 additions & 2 deletions core/src/plugins/editor.codemirror/class.CodeMirrorEditor.js
Expand Up @@ -19,9 +19,9 @@
*/
Class.create("CodeMirrorEditor", AbstractEditor, {

initialize: function($super, oFormObject)
initialize: function($super, oFormObject, options)
{
$super(oFormObject);
$super(oFormObject, options);

this.textWrapping = false;
this.lineNumbers = true;
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/editor.etherpad/class.EtherpadLauncher.js
Expand Up @@ -23,9 +23,9 @@ Class.create("EtherpadLauncher", AbstractEditor, {
sessionID: null,
node: null,

initialize: function($super, oFormObject)
initialize: function($super, oFormObject, options)
{
$super(oFormObject);
$super(oFormObject, options);
if(!ajaxplorer.user || ajaxplorer.user.canWrite()){
this.canWrite = true;
this.actions.get("saveButton").observe('click', function(){
Expand Down
9 changes: 1 addition & 8 deletions core/src/plugins/gui.ajax/manifest.xml
Expand Up @@ -137,7 +137,7 @@
<div id="flagged_elements" ajxpClass="FetchedResultPane" ajxpOptions='{"nodeProviderProperties":{"get_action":"get_bookmarks", "format":"node_list"},"reloadOnServerMessage":"tree/reload_bookmarks"}'></div>
</div>
<div id="cpane_container" ajxpClass="AjxpPane" ajxpOptions='{"fit":"height","fitParent":"browser"}'>
<div id="cpane_tabs" ajxpClass="AjxpTabulator" ajxpOptions='{"registerAsEditorOpener":true,"defaultTabId": "files","tabInfos" : [{"id":"files","label":"","iconClass":"icon-folder-open", "element":"files_list_pane"}]}'>
<div id="cpane_tabs" ajxpClass="AjxpTabulator" ajxpOptions='{"fit":"height", "fitParent":"browser","registerAsEditorOpener":true,"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" ajxpClass="ActionsToolbar" ajxpOptions='{"submenuClassName":"panelHeaderMenu","submenuPosition":"bottom right","submenuOffsetTop":12,"toolbarsList":["default"],"skipBubbling":true, "skipCarousel":true,"submenuOffsetTop":2}'></div>
Expand All @@ -146,13 +146,6 @@
<div id="content_pane" ajxpClass="FilesList" ajxpOptions='{"displayMode":"detail","replaceScroller":true, "fit":"height", "fitParent":"files_lit_pane", "cellPaddingCorrection":6, "iconBgPosition" : "5px 4px"}' style="border: 1px solid #bbb; border-width:0 1px;"></div>
</div>
</div>
<!--
<div id="cpane_header" class="panelHeader">
<div id="display_toolbar" ajxpClass="ActionsToolbar" ajxpOptions='{"submenuClassName":"panelHeaderMenu","submenuPosition":"bottom right","submenuOffsetTop":12,"toolbarsList":["default"],"skipBubbling":true, "skipCarousel":true,"submenuOffsetTop":2}'></div>
<div id="breadcrumb" ajxpClass="Breadcrumb" style="width:50%;" ajxpOptions='{"flexTo":"cpane_header"}'></div>
</div>
<div id="content_pane" ajxpClass="FilesList" ajxpOptions='{"displayMode":"detail","replaceScroller":true, "fit":"height", "fitParent":"cpane_container", "cellPaddingCorrection":6, "iconBgPosition" : "5px 4px"}' style="border: 1px solid #bbb; border-width:0 1px;"></div>
-->
</div>
</div>
<div id="info_panel" ajxpClass="InfoPanel" ajxpPaneHeader="131" ajxpPaneIcon="file_info.png" 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>
Expand Down
Expand Up @@ -383,11 +383,13 @@ Class.create("AbstractEditor" , {
* @param size int|null
*/
resize : function(size){
if(size){
this.contentMainContainer.setStyle({height:size+"px"});
}else{
fitHeightToBottom(this.contentMainContainer, this.element);
}
if(this.contentMainContainer){
if(size){
this.contentMainContainer.setStyle({height:size+"px"});
}else{
fitHeightToBottom(this.contentMainContainer, this.element);
}
}
this.element.fire("editor:resize", size);
},
/**
Expand Down
Expand Up @@ -88,7 +88,7 @@ Class.create("AjxpTabulator", AjxpPane, {
if(tabInfo.iconClass){
td.insert(new Element('span', {className:tabInfo.iconClass}));
}
td.insert('<span class="tab_label" ajxp_message_id="'+tabInfo.label+'">'+MessageHash[tabInfo.label]+'</span>');
td.insert('<span class="tab_label" ajxp_message_id="'+tabInfo.label+'">'+label+'</span>');
td.observe('click', function(){
this.switchTabulator(tabInfo.id);
}.bind(this) );
Expand Down Expand Up @@ -176,10 +176,10 @@ Class.create("AjxpTabulator", AjxpPane, {
}else if(paneInfo.type == 'widget'){

}

this.resize();
this.tabulatorData.push(tabInfo);
this.switchTabulator(tabInfo.id);
this.resize();
window.setTimeout(this.resize.bind(this), 750);
},

/**
Expand Down Expand Up @@ -270,8 +270,9 @@ Class.create("AjxpTabulator", AjxpPane, {
if(!this.selectedTabInfo) return;
var ajxpObject = this.getAndSetAjxpObject(this.selectedTabInfo);
if(ajxpObject){
fitHeightToBottom($(this.htmlElement).down("#"+this.selectedTabInfo.element));
ajxpObject.resize();
var nodeElement = $(this.htmlElement).down("#"+this.selectedTabInfo.element);
fitHeightToBottom(nodeElement);
ajxpObject.resize(nodeElement?nodeElement.getHeight():this.htmlElement.getHeight());
var left ;
var total = 0;
var cont = this.htmlElement.down('div.tabulatorContainer');
Expand Down

0 comments on commit 83774e3

Please sign in to comment.