Skip to content

Commit 01b96cc

Browse files
committed
inlineParameters now available
1 parent 2678bcd commit 01b96cc

File tree

10 files changed

+133
-26
lines changed

10 files changed

+133
-26
lines changed

clients/web/css/ei.default.css

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,30 @@ pre {
240240
}
241241

242242
/* the outline area */
243+
.ei-outline-setting {
244+
float: left;
245+
width: 20%;
246+
height: 100%;
247+
}
243248
.ei-outline-holder {
244249
position:relative;
245250
overflow: auto;
246251
border:1px solid #a6c9e2;
247252
border-radius:5px;
248-
float: left;
249-
width: 20%;
253+
width: 100%;
254+
height: 100%;
255+
-moz-box-sizing: border-box;
256+
-webkit-box-sizing: border-box;
257+
-ms-box-sizing: border-box;
258+
box-sizing: border-box;
259+
}
260+
.ei-setting-holder {
261+
position:relative;
262+
overflow: auto;
263+
border:1px solid #a6c9e2;
264+
border-radius:5px;
265+
padding: 6px;
266+
width: 100%;
250267
height: 100%;
251268
-moz-box-sizing: border-box;
252269
-webkit-box-sizing: border-box;

clients/web/html/eitheme.default.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
<div class="ei-file-code-outline" id="up">
1414
<div class="ei-filemanager-holder" id="filemanager"></div>
1515
<div class="ei-codearea-holder" id="codearea"></div>
16-
<div class="ei-outline-holder" id="outline"></div>
16+
<div class="" id="up-right">
17+
<div class="ei-setting-holder" id="setting"></div>
18+
<div class="ei-outline-holder" id="outline"></div>
19+
</div>
1720
</div>
1821
<div class="ei-console-holder" id="console"></div>
1922

clients/web/html/eitheme.resizable.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
<div class="ei-file-code-outline" id ="up" >
1616
<div class="ei-filemanager-holder" id="filemanager"></div>
1717
<div class="ei-codearea-holder" id="codearea"></div>
18-
<div class="ei-outline-holder" id="outline"></div>
18+
<div class="ei-outline-setting" id="up-right">
19+
<div class="ei-setting-holder" id="setting"></div>
20+
<div class="ei-outline-holder" id="outline"></div>
21+
</div>
22+
1923
</div>
2024

2125
<div class="ei-console-holder" id="console"></div>

clients/web/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
apps: _ei_data.apps,
121121
examples: _ei_data.examples,
122122
outline: _ei_data.outline,
123+
inlineSetting: _ei_data.inlineSetting,
123124
language: _ei_data.language,
124125
outlineapp: _ei_data.outlineapp,
125126
outlineserver: _ei_data.outlineserver,

clients/web/js/config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ var loadConfig = function(){
1414

1515
if(!data.outline)
1616
_ei_data.outline = "on";
17+
18+
if(!data.inlineSetting)
19+
_ei_data.inlineSetting = "on";
1720

21+
1822
if(!data.language)
1923
_ei_data.language = "text/x-csrc";
2024
}

clients/web/js/constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ var _ei = {
136136
server: "",
137137
app: "absoutline"
138138
},
139+
inlineSetting:{
140+
active: !false
141+
},
139142
general_settings : {
140143
show_svg_in_new_window: "no",
141144
file_selection_mode: "file"

clients/web/js/easyinterface.js

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ window.EasyInterface = (function() {
4848
this.helpButtonHolder = this.holder.find("#help");
4949
this.optionsButtonHolder = this.holder.find("#options");
5050
this.applyButtonHolder = this.holder.find("#apply");
51-
this.toolSelectHolder = this.holder.find("#toolselector");
51+
this.toolSelectHolder = this.holder.find("#toolselector");
52+
this.settingHolder = this.holder.find("#setting");
5253
this.outlineHolder = this.holder.find("#outline");
5354
this.outlineButtonHolder = this.holder.find("#refreshoutline");
5455
this.clearButtonHolder = this.holder.find("#clearanno");
5556
this.upSectionHolder = this.holder.find("#up");
57+
this.rightSectionHolder = this.holder.find("#up-right");
5658
// create/installl the different widgets
5759
this.initCmdEngine();
5860
this.initCodeAreaWidget();
@@ -63,10 +65,27 @@ window.EasyInterface = (function() {
6365
this.initConsoleWidget();
6466
this.initToolSelectorWidget();
6567
this.initOutputManager();
66-
if(_ei.outline.active)
67-
this.initOutlineWidget();
68-
this.initTools();
69-
this.filemanager.setProperties(this.outline,this.tools);
68+
if(_ei.outline.active)
69+
this.initOutlineWidget();
70+
this.initTools();
71+
this.filemanager.setProperties(this.outline,this.tools);
72+
// check Right
73+
if(_ei.outline.active && _ei.inlineSetting.active){
74+
//set heights
75+
this.outlineHolder.css("height","49%");
76+
this.settingHolder.css("height","49%");
77+
}else if(_ei.outline.active){
78+
//remove inlineSetting
79+
this.settingHolder.remove();
80+
}else if(_ei.inlineSetting.active){
81+
//remove outline
82+
this.outlineHolder.remove();
83+
}else{
84+
// codearea expand
85+
this.rightSectionHolder.remove();
86+
this.codeareaHolder = this.codeareaHolder.css("width","78%");
87+
}
88+
7089
// connect the buttons to the corresponding operations
7190
this.applyButtonHolder.button(
7291
{
@@ -77,13 +96,19 @@ window.EasyInterface = (function() {
7796
var ids = [self.codearea.getCurrentTabId()];
7897
self.tools.apply(ids);
7998
} );
80-
99+
if( !_ei.inlineSetting.active ) {
81100
this.optionsButtonHolder.button(
82101
{
83102
icons: {
84103
primary: "ui-icon-gear"
85104
}
86-
} ).click(function() { self.parametersHolder.dialog( "open" ); } );
105+
} ).click(function() {
106+
self.parametersHolder.dialog( "open" );
107+
} );
108+
}else{
109+
this.optionsButtonHolder.remove();
110+
}
111+
87112
this.helpButtonHolder.button(
88113
{
89114
icons: {
@@ -136,12 +161,13 @@ window.EasyInterface = (function() {
136161
_ei.language = options.language || "text/x-csrc";
137162
_ei.serverPath = options.apps || serverPath;
138163
_ei.exampleServerPath = options.examples || examplesPath;
164+
139165
_ei.outline.active = (options.outline=="on")? true : false;
166+
_ei.inlineSetting.active = (options.inlineSetting=="on")? true : false;
140167
if(_ei.outline.active){
141168
_ei.outline.app = options.outlineapp || "outline";
142-
_ei.outline.server = options.outlineserver || _ei.serverPath[0].server;
143-
}
144-
169+
_ei.outline.server = options.outlineserver || _ei.serverPath[0].server;
170+
}
145171
},
146172

147173
//
@@ -352,7 +378,8 @@ window.EasyInterface = (function() {
352378
function() {
353379
var self = this;
354380
this.tools = new Tools({
355-
"parameters": this.parameters,
381+
"parameters": this.parameters,
382+
"inlineParameters": this.settingHolder,
356383
"selector": this.toolSelector,
357384
"filemanager": this.filemanager,
358385
"outline": this.outline,
@@ -400,7 +427,8 @@ window.EasyInterface = (function() {
400427
self.initTool( $(this),currentServer.server );
401428
});// */
402429
});
403-
}}
430+
}}
431+
this.tools.ready();
404432
},
405433

406434
initTool:
@@ -486,8 +514,11 @@ window.EasyInterface = (function() {
486514
var self = this;
487515
var RE = new ResizeEffect({holder:self.holder});
488516
RE.addHorizontalEffect(self.filemanagerHolder,self.codeareaHolder);
489-
if(_ei.outline.active)
490-
RE.addHorizontalEffect(self.codeareaHolder,self.outlineHolder);
517+
if(_ei.outline.active || _ei.inlineSetting.active)
518+
RE.addHorizontalEffect(self.codeareaHolder,self.rightSectionHolder);
519+
if(_ei.outline.active && _ei.inlineSetting.active){
520+
RE.addVerticalEffect(self.settingHolder,self.outlineHolder);
521+
}
491522
RE.addVerticalEffect(self.upSectionHolder,self.consoleHolder);
492523
},
493524
removeOutline:

clients/web/js/parameters.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ window.Parameters = (function() {
1010

1111
this.paramsId = "OPTS-"+parametersId;
1212
this.paramsHolder = place;
13-
this.accord = null;
13+
this.accord = null;
1414
this.sectionInfoById = new Array();
1515
this.secId = 0;
1616
this.setOptions(options);
@@ -457,7 +457,7 @@ window.Parameters = (function() {
457457
//
458458
setActiveParameSet:
459459
function(sectionId) {
460-
if ( sectionId != undefined ) {
460+
if ( sectionId != undefined ) {
461461
this.accord.accordion({active: this.sectionInfoById[sectionId].secId });
462462
} else {
463463
this.accord.accordion({active: false});
@@ -475,6 +475,24 @@ window.Parameters = (function() {
475475
r[p]=sectionParams[p].getValue();
476476
}
477477
return r;
478+
},
479+
480+
481+
//
482+
placeParamSet:
483+
function(toolId,holder){
484+
var tagId = this.sectionId_to_sectionTag( toolId );
485+
this.accord.find("#"+tagId).append($(holder).contents());
486+
},
487+
488+
//
489+
getParamSet:
490+
function(toolId,holder){
491+
var tagId = this.sectionId_to_sectionTag( toolId );
492+
var cont = this.accord.find("#"+tagId).contents();
493+
cont.show();
494+
$(holder).append(cont);
495+
478496
}
479497
};
480498

clients/web/js/tools.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ window.Tools = (function() {
1010
this.filemanager = null;
1111
this.outline = null;
1212
this.cmdengine = null;
13-
this.console = null;
14-
this.setOptions(options);
13+
this.console = null;
14+
this.inlineParams = null;
15+
this.setOptions(options);
1516
};
1617

1718
Tools.prototype = {
@@ -25,13 +26,20 @@ window.Tools = (function() {
2526
setOptions:
2627
function(options) {
2728
this.parameters = options.parameters;
29+
this.inlineParams = options.inlineParameters;
2830
this.selector = options.selector;
2931
this.filemanager = options.filemanager;
3032
this.outline = options.outline;
3133
this.cmdengine = options.cmdengine;
3234
this.outputmanager = options.outputmanager;
3335
this.helps = options.helps;
34-
this.selector.setToolsObj( this );
36+
this.selector.setToolsObj( this );
37+
},
38+
39+
//
40+
ready:
41+
function(){
42+
this.setActiveTool(this.selector.getTool());
3543
},
3644

3745
//
@@ -69,9 +77,17 @@ window.Tools = (function() {
6977
//
7078
setActiveTool:
7179
function(toolId) {
72-
if( !this.tools[toolId]) return;
73-
this.currToolId = toolId;
74-
this.parameters.setActiveParameSet( toolId );
80+
console.log("tool",toolId);
81+
if( !this.tools[toolId])
82+
return;
83+
if( _ei.inlineSetting.active && this.tools[this.currToolId] ){
84+
this.parameters.placeParamSet(this.currToolId,this.inlineParams);
85+
}
86+
this.currToolId = toolId;
87+
this.parameters.setActiveParameSet( toolId );
88+
if( _ei.inlineSetting.active){
89+
this.parameters.getParamSet(toolId,this.inlineParams);
90+
}
7591
},
7692

7793
apply:

clients/web/js/toolselectorwidget.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ window.ToolSelector = (function() {
4646
addTool:
4747
function(toolId, toolDesc) {
4848
this.selector.append("<option value='"+toolId+"'>"+toolDesc+"</option>");
49+
},
50+
51+
//
52+
getTool:
53+
function(){
54+
var val = this.selector.val();
55+
if(!val)
56+
val = $("option",this.selector).value();
57+
console.log(val,"-------");
58+
return val;
4959
}
5060
}
5161

0 commit comments

Comments
 (0)