Skip to content
Snippets Groups Projects
Commit fb15ddf3 authored by Sebastien Jourdain's avatar Sebastien Jourdain Committed by Code Review
Browse files

Merge topic 'vtkweb-improvement' into master

c3957363 Various VTK-web improvement
parents a43bcf97 c3957363
No related branches found
No related tags found
No related merge requests found
......@@ -131,6 +131,9 @@
if (onClose) {
onClose(code, reason);
}
},{
'maxRetries': 0,
'retryDelay': 2000
});
}
......
......@@ -13,8 +13,8 @@
}
.vtkweb-catalyst-analysis .workbench-toolbar {
position: absolute;
top: 30px;
position: relative;
top: 0px;
left: 0;
right: 0;
padding-top: 5px;
......@@ -35,16 +35,22 @@
}
.vtkweb-catalyst-analysis ul.left {
float: left;
position: relative;
top: 0;
left: 0;
width: 85%;
}
.vtkweb-catalyst-analysis ul.right {
float: right;
margin-right: 5px;
position: absolute;
right: 5px;
top: 5px;
}
.vtkweb-catalyst-analysis .content {
position: relative;
top: 0px;
left: 0;
}
.vtkweb-catalyst-analysis li {
......@@ -101,7 +107,7 @@
.vtkweb-catalyst-analysis .view {
position: relative;
top: 65px;
top: 5px;
}
.vtkweb-catalyst-analysis .view .viewer {
......
......@@ -82,7 +82,7 @@
function analysisItemToOPTION(basePath, item) {
return OPTION_ANALYSIS_ITEM_TEMPLATE
.replace(/PATH/g, basePath + item.id)
.replace(/PATH/g, basePath + '/' + item.id)
.replace(/TITLE/g, item.title);
}
......
......@@ -50,6 +50,7 @@
margin-right: 5px;
text-align: left;
font-weight: bold;
height: 0.5em;
}
.vtk-catalyst-pvweb .control .parameters .label .flag {
......@@ -62,10 +63,6 @@
visibility: visible;
}
.vtk-catalyst-pvweb .control .parameters .label.select {
margin-bottom: 10px;
}
.vtk-catalyst-pvweb .control .parameters .label span {
float: right;
font-weight: normal;
......
(function ($, GLOBAL) {
var SLIDER_TEMPLATE = '<div class="label"><span class="flag vtk-icon-flag"/>LABEL<span class="NAME-value">DEFAULT</span></div><input type="range" min="0" max="SIZE" value="INDEX" name="NAME" data-values="VALUES"/>',
SELECT_TEMPLATE = ' <div class="label select"><span class="flag vtk-icon-flag"/>LABEL<select name="NAME">VALUES</select></div>',
var SLIDER_TEMPLATE = 'PRIORITY<div class="label"><span class="flag vtk-icon-flag"/>LABEL<span class="NAME-value">DEFAULT</span></div><input type="range" min="0" max="SIZE" value="INDEX" name="NAME" data-values="VALUES"/>',
SELECT_TEMPLATE = 'PRIORITY<div class="label select"><span class="flag vtk-icon-flag"/>LABEL<select name="NAME">VALUES</select></div>',
OPTION_TEMPLATE = '<option SELECTED>VALUE</option>',
EXCLUDE_ARGS = { "theta": true };
......@@ -115,23 +115,23 @@
// ========================================================================
var WidgetFactory = {
"range": function(name, label, values, defaultValue) {
return templateReplace(SLIDER_TEMPLATE, name, label, values, defaultValue);
"range": function(name, label, values, defaultValue, priority) {
return templateReplace(SLIDER_TEMPLATE, name, label, values, defaultValue, priority);
},
"list": function(name, label, values, defaultValue) {
"list": function(name, label, values, defaultValue, priority) {
var options = [];
for(var idx in values) {
var selected = (values[idx] === defaultValue) ? 'selected="selected"' : '';
options.push(OPTION_TEMPLATE.replace('VALUE', values[idx]).replace('SELECTED', selected));
}
return templateReplace(SELECT_TEMPLATE, name, label, [ options.join('') ], defaultValue);
return templateReplace(SELECT_TEMPLATE, name, label, [ options.join('') ], defaultValue, priority);
}
};
// ------------------------------------------------------------------------
function templateReplace( templateString, name, label, values, defaultValue) {
return templateString.replace(/NAME/g, name).replace(/LABEL/g, label).replace(/VALUES/g, values.join(':')).replace(/SIZE/g, values.length - 1).replace(/DEFAULT/g, defaultValue).replace(/INDEX/g, values.indexOf(defaultValue));
function templateReplace( templateString, name, label, values, defaultValue, priority) {
return templateString.replace(/NAME/g, name).replace(/LABEL/g, label).replace(/VALUES/g, values.join(':')).replace(/SIZE/g, values.length - 1).replace(/DEFAULT/g, defaultValue).replace(/INDEX/g, values.indexOf(defaultValue)).replace(/PRIORITY/g, " ".substring(0,priority));
}
// ------------------------------------------------------------------------
......@@ -149,6 +149,7 @@
type = args[key].type,
label = args[key].label,
values = args[key].values,
priority = args[key].priority,
defaultValue = args[key]['default'];
// Update default value
......@@ -161,7 +162,7 @@
// Build widget if needed
if(values.length > 1) {
htmlBuffer.push(WidgetFactory[type](name, label, values, defaultValue));
htmlBuffer.push(WidgetFactory[type](name, label, values, defaultValue, priority));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment