Commit 80edc282 authored by Sebastien Jourdain's avatar Sebastien Jourdain
Browse files

Extend vtkWeb with basic properties and improve File browser

Change-Id: Iad350ca42639da1f0ebde22516f78c48a8c84845
parent 28c708e9
......@@ -32,6 +32,10 @@
return parameters;
}
isSecured = function() {
return location.protocol === 'https';
}
// ----------------------------------------------------------------------
// Init vtkWeb module if needed
......@@ -48,5 +52,10 @@
module.version = VERSION;
module.isMobile = isMobile;
module.extractURLParameters = extractURLParameters;
module.properties = {
'sessionManagerURL': location.protocol + "//" + location.hostname + ":" + location.port + "/paraview",
'sessionURL': (isSecured() ? "wss" : "ws") + "://" + location.hostname + ":" + location.port + "/ws"
};
module.NoOp = function() {};
}(window, jQuery));
......@@ -147,6 +147,12 @@
// =======================================================================
function getRelativePath(parentPath, fileName) {
return '.' + pathToStr(getPath(parentPath, fileName).slice(1));
}
// =======================================================================
function initializeListener(container, activePath) {
$('.action', container).click(function(){
var me = $(this), item = $('div', me), pathStr = me.closest('.vtk-directory').attr('path'), type = me.closest('ul').attr('type');
......@@ -170,7 +176,8 @@
container.trigger({
type: 'directory-click',
path: pathStr,
name: me.text()
name: me.text(),
relativePath: getRelativePath(pathStr, me.text())
});
} else {
if(container.data('session')) {
......@@ -184,14 +191,16 @@
container.trigger({
type: 'directory-not-found',
path: pathStr,
name: me.text()
name: me.text(),
relativePath: getRelativePath(pathStr, me.text())
});
}
} else if(type === 'files') {
container.trigger({
type: 'file-click',
path: pathStr,
name: me.text()
name: me.text(),
relativePath: getRelativePath(pathStr, me.text())
});
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment