Commit 56cb1129 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Nicolas Wavrant

fix fileTreeView in slaprunner editor

parent b74603bc
...@@ -58,7 +58,7 @@ class FileBrowser(object): ...@@ -58,7 +58,7 @@ class FileBrowser(object):
html += 'gsdirs.push(new gsItem("2", "%s", "%s", "0", "%s", "dir", "%s"));' % (f, ff, md5sum, mdate) html += 'gsdirs.push(new gsItem("2", "%s", "%s", "0", "%s", "dir", "%s"));' % (f, ff, md5sum, mdate)
return html return html
def fancylistDirs(self, dir, key, all=False): def fancylistDirs(self, dir, key, listfiles, all=False):
dir = urllib.unquote(dir) dir = urllib.unquote(dir)
realdir = realpath(self.config, dir) realdir = realpath(self.config, dir)
if not realdir: if not realdir:
...@@ -73,18 +73,18 @@ class FileBrowser(object): ...@@ -73,18 +73,18 @@ class FileBrowser(object):
ff = os.path.join(dir, f) ff = os.path.join(dir, f)
realfile = os.path.join(realdir, f) realfile = os.path.join(realdir, f)
identity = "%s%s" % (key, i) identity = "%s%s" % (key, i)
if not os.path.isdir(realfile): if os.path.isdir(realfile):
dirList.append({"title": f, "key": identity,
"folder":True, "lazy":True, "path": ff})
elif listfiles:
regex = re.compile("(^.*)\.(.*)", re.VERBOSE) regex = re.compile("(^.*)\.(.*)", re.VERBOSE)
ext = regex.sub(r'\2', f) ext = regex.sub(r'\2', f)
if ext == f: if ext == f:
ext = "" ext = ""
dirList.append({"title": f, "key": identity,
"extraClasses": "ext_"+ext, "path": ff})
else:
fileList.append({"title": f, "key": identity, fileList.append({"title": f, "key": identity,
"folder":True, "lazy":True, "path": ff}) "extraClasses": "ext_"+ext, "path": ff})
i+=1 i+=1
return (fileList + dirList) return (dirList + fileList)
def makeDirectory(self, dir, filename): def makeDirectory(self, dir, filename):
"""Create a directory""" """Create a directory"""
......
/******************************************************************************* /*******************************************************************************
* Tree container * Tree container
Lion colors: Lion colors:
gray highlight bar: #D4D4D4 gray highlight bar: #D4D4D4
blue highlight-bar and -border #3875D7 blue highlight-bar and -border #3875D7
*/ */
.ui-helper-hidden { .ui-helper-hidden {
display: none; display: none;
} }
.fancytree-container .fancytree-container
{ {
font-family: tahoma, arial, helvetica; font-family: tahoma, arial, helvetica;
font-size: 10pt; /* font size should not be too big */ font-size: 10pt; /* font size should not be too big */
white-space: nowrap; white-space: nowrap;
padding: 3px; padding: 3px;
margin: 0; /* issue 201 */ margin: 0; /* issue 201 */
background-color: white; background-color: white;
overflow: auto; overflow: auto;
height: 98%; /* issue 263 */ height: 98%; /* issue 263 */
} }
ul.fancytree-container ul ul.fancytree-container ul
{ {
padding: 0 0 0 16px; padding: 0 0 0 16px;
margin: 0; margin: 0;
} }
ul.fancytree-container li ul.fancytree-container li
{ {
list-style-image: none; list-style-image: none;
list-style-position: outside; list-style-position: outside;
list-style-type: none; list-style-type: none;
-moz-background-clip:border; -moz-background-clip:border;
-moz-background-inline-policy: continuous; -moz-background-inline-policy: continuous;
-moz-background-origin: padding; -moz-background-origin: padding;
background-attachment: scroll; background-attachment: scroll;
background-color: transparent; background-color: transparent;
background-position: 0 0; background-position: 0 0;
background-repeat: repeat-y; background-repeat: repeat-y;
background-image: none; /* no v-lines */ background-image: none; /* no v-lines */
margin:0; margin:0;
padding:4px 0 0 0; padding:4px 0 0 0;
} }
/* Suppress lines for last child node */ /* Suppress lines for last child node */
ul.fancytree-container li.fancytree-lastsib ul.fancytree-container li.fancytree-lastsib
{ {
background-image: none; background-image: none;
} }
/* Suppress lines if level is fixed expanded (option minExpandLevel) */ /* Suppress lines if level is fixed expanded (option minExpandLevel) */
ul.fancytree-no-connector > li ul.fancytree-no-connector > li
{ {
background-image: none; background-image: none;
} }
/* Style, when control is disabled */ /* Style, when control is disabled */
.ui-fancytree-disabled ul.fancytree-container .ui-fancytree-disabled ul.fancytree-container
{ {
opacity: 0.5; opacity: 0.5;
/* filter: alpha(opacity=50); /* Yields a css warning */ /* filter: alpha(opacity=50); /* Yields a css warning */
background-color: silver; background-color: silver;
} }
span.fancytree-node
/******************************************************************************* {
* Common icon definitions display: inline-block;
*/ width: 100%;
span.fancytree-empty, border: 1px solid transparent;
span.fancytree-vline, }
/*span.fancytree-connector,*/
span.fancytree-expander,
span.fancytree-icon, /*******************************************************************************
span.fancytree-checkbox, * Common icon definitions
span.fancytree-radio, */
span.fancytree-drag-helper-img, span.fancytree-empty,
#fancytree-drop-marker span.fancytree-vline,
{ /*span.fancytree-connector,*/
width: 16px; span.fancytree-expander,
height: 16px; span.fancytree-icon,
display: inline-block; /* Required to make a span sizable */ span.fancytree-checkbox,
vertical-align: top; span.fancytree-radio,
background-repeat: no-repeat; span.fancytree-drag-helper-img,
background-position: left; #fancytree-drop-marker
background-image: url("images/icons.gif"); {
background-position: 0 0; width: 16px;
} height: 16px;
/** Used by iconclass option */ display: inline-block; /* Required to make a span sizable */
span.fancytree-custom-icon { vertical-align: top;
display: inline-block; background-repeat: no-repeat;
} background-position: left;
/** Used by 'icon' node option: */ background-image: url("images/icons.gif");
.fancytree-container img background-position: 0 0;
{ }
width: 16px; /** Used by iconclass option */
height: 16px; span.fancytree-custom-icon {
margin-left: 3px; display: inline-block;
vertical-align: top; }
border-style: none; /** Used by 'icon' node option: */
} .fancytree-container img
{
width: 16px;
/******************************************************************************* height: 16px;
* Lines and connectors margin-left: 3px;
*/ vertical-align: top;
/* span.fancytree-connector border-style: none;
{ }
background-image: none;
}
*/ /*******************************************************************************
/******************************************************************************* * Lines and connectors
* Expander icon */
* Note: IE6 doesn't correctly evaluate multiples class names, /* span.fancytree-connector
* so we create combined class names that can be used in the CSS. {
* background-image: none;
* Prefix: fancytree-exp- }
* 1st character: 'e': expanded, 'c': collapsed, 'n': no children */
* 2nd character (optional): 'd': lazy (Delayed) /*******************************************************************************
* 3rd character (optional): 'l': Last sibling * Expander icon
*/ * Note: IE6 doesn't correctly evaluate multiples class names,
* so we create combined class names that can be used in the CSS.
span.fancytree-expander *
{ * Prefix: fancytree-exp-
background-position: 0px -80px; * 1st character: 'e': expanded, 'c': collapsed, 'n': no children
cursor: pointer; * 2nd character (optional): 'd': lazy (Delayed)
} * 3rd character (optional): 'l': Last sibling
span.fancytree-expander:hover { background-position: -16px -80px; } */
.fancytree-exp-n span.fancytree-expander:hover /* Collapsed, not delayed, not last sibling */
{ span.fancytree-expander
background-position: -16px -80px; {
} background-position: 0px -80px;
.fancytree-exp-cl span.fancytree-expander /* Collapsed, not delayed, last sibling */ cursor: pointer;
{ }
} span.fancytree-expander:hover { background-position: -16px -80px; }
.fancytree-exp-cd span.fancytree-expander /* Collapsed, delayed, not last sibling */ .fancytree-exp-n span.fancytree-expander:hover /* Collapsed, not delayed, not last sibling */
{ {
} background-position: -16px -80px;
.fancytree-exp-cdl span.fancytree-expander /* Collapsed, delayed, last sibling */ }
{ .fancytree-exp-cl span.fancytree-expander /* Collapsed, not delayed, last sibling */
} {
.fancytree-exp-e span.fancytree-expander, /* Expanded, not delayed, not last sibling */ }
.fancytree-exp-ed span.fancytree-expander, /* Expanded, delayed, not last sibling */ .fancytree-exp-cd span.fancytree-expander /* Collapsed, delayed, not last sibling */
.fancytree-exp-el span.fancytree-expander, /* Expanded, not delayed, last sibling */ {
.fancytree-exp-edl span.fancytree-expander /* Expanded, delayed, last sibling */ }
{ .fancytree-exp-cdl span.fancytree-expander /* Collapsed, delayed, last sibling */
background-position: -32px -80px; {
} }
.fancytree-exp-e span.fancytree-expander:hover, /* Expanded, not delayed, not last sibling */ .fancytree-exp-e span.fancytree-expander, /* Expanded, not delayed, not last sibling */
.fancytree-exp-ed span.fancytree-expander:hover, /* Expanded, delayed, not last sibling */ .fancytree-exp-ed span.fancytree-expander, /* Expanded, delayed, not last sibling */
.fancytree-exp-el span.fancytree-expander:hover, /* Expanded, not delayed, last sibling */ .fancytree-exp-el span.fancytree-expander, /* Expanded, not delayed, last sibling */
.fancytree-exp-edl span.fancytree-expander:hover /* Expanded, delayed, last sibling */ .fancytree-exp-edl span.fancytree-expander /* Expanded, delayed, last sibling */
{ {
background-position: -48px -80px; background-position: -32px -80px;
} }
.fancytree-loading span.fancytree-expander /* 'Loading' status overrides all others */ .fancytree-exp-e span.fancytree-expander:hover, /* Expanded, not delayed, not last sibling */
{ .fancytree-exp-ed span.fancytree-expander:hover, /* Expanded, delayed, not last sibling */
background-position: 0 0; .fancytree-exp-el span.fancytree-expander:hover, /* Expanded, not delayed, last sibling */
background-image: url("images/loading-min.gif"); .fancytree-exp-edl span.fancytree-expander:hover /* Expanded, delayed, last sibling */
} {
background-position: -48px -80px;
.fancytree-exp-n span.fancytree-expander, /* Connector instead of expander, if node has no children */ }
.fancytree-exp-nl span.fancytree-expander .fancytree-loading span.fancytree-expander /* 'Loading' status overrides all others */
{ {
background-image: none; background-position: 0 0;
cursor: default; background-image: url("images/loading-min.gif");
} }
.fancytree-exp-n span.fancytree-expander, /* Connector instead of expander, if node has no children */
/******************************************************************************* .fancytree-exp-nl span.fancytree-expander
* Checkbox icon {
*/ background-image: none;
span.fancytree-checkbox { cursor: default;
margin-left: 3px; }
background-position: 0px -32px;
}
span.fancytree-checkbox:hover { background-position: -16px -32px; } /*******************************************************************************
.fancytree-partsel span.fancytree-checkbox { background-position: -64px -32px; } * Checkbox icon
.fancytree-partsel span.fancytree-checkbox:hover { background-position: -80px -32px; } */
.fancytree-selected span.fancytree-checkbox { background-position: -32px -32px; } span.fancytree-checkbox {
.fancytree-selected span.fancytree-checkbox:hover { background-position: -48px -32px; } margin-left: 3px;
background-position: 0px -32px;
/******************************************************************************* }
* Radiobutton icon span.fancytree-checkbox:hover { background-position: -16px -32px; }
*/ .fancytree-partsel span.fancytree-checkbox { background-position: -64px -32px; }
.fancytree-radio span.fancytree-checkbox { .fancytree-partsel span.fancytree-checkbox:hover { background-position: -80px -32px; }
margin-left: 3px; .fancytree-selected span.fancytree-checkbox { background-position: -32px -32px; }
background-position: 0px -48px; .fancytree-selected span.fancytree-checkbox:hover { background-position: -48px -32px; }
}
.fancytree-radio span.fancytree-checkbox:hover { background-position: -16px -48px; } /*******************************************************************************
.fancytree-radio .fancytree-partsel span.fancytree-checkbox { background-position: -64px -48px; } * Radiobutton icon
.fancytree-radio .fancytree-partsel span.fancytree-checkbox:hover { background-position: -80px -48px; } */
.fancytree-radio .fancytree-selected span.fancytree-checkbox { background-position: -32px -48px; } .fancytree-radio span.fancytree-checkbox {
.fancytree-radio .fancytree-selected span.fancytree-checkbox:hover { background-position: -48px -48px; } margin-left: 3px;
background-position: 0px -48px;
/******************************************************************************* }
* Node type icon .fancytree-radio span.fancytree-checkbox:hover { background-position: -16px -48px; }
* Note: IE6 doesn't correctly evaluate multiples class names, .fancytree-radio .fancytree-partsel span.fancytree-checkbox { background-position: -64px -48px; }
* so we create combined class names that can be used in the CSS. .fancytree-radio .fancytree-partsel span.fancytree-checkbox:hover { background-position: -80px -48px; }
* .fancytree-radio .fancytree-selected span.fancytree-checkbox { background-position: -32px -48px; }
* Prefix: fancytree-ico- .fancytree-radio .fancytree-selected span.fancytree-checkbox:hover { background-position: -48px -48px; }
* 1st character: 'e': expanded, 'c': collapsed
* 2nd character (optional): 'f': folder /*******************************************************************************
*/ * Node type icon
span.fancytree-icon /* Default icon */ * Note: IE6 doesn't correctly evaluate multiples class names,
{ * so we create combined class names that can be used in the CSS.
margin-left: 3px; *
background-position: 0px 0px; * Prefix: fancytree-ico-
} * 1st character: 'e': expanded, 'c': collapsed
.fancytree-ico-cf span.fancytree-icon { background: url(images/directory.min.png) left top no-repeat; width: 22px;}/*background-position: 0px -16px; } /* Collapsed Folder */ * 2nd character (optional): 'f': folder
.fancytree-ico-ef span.fancytree-icon { background: url(images/folder_open.min.png) left top no-repeat; width: 22px; height: 18px;} /* Expanded Folder */ */
.fancytree-statusnode-wait span.fancytree-icon { background-image: url("images/loading-min.gif"); } /* Status node icons */ span.fancytree-icon /* Default icon */
.fancytree-statusnode-error span.fancytree-icon { background-position: 0px -112px; } {
margin-left: 3px;
/* File Extensions*/ margin-top: 1px;
.ext_3gp span.fancytree-icon { background: url(images/film.png) left top no-repeat; } background-position: 0px 0px;
span.ext_afp span.fancytree-icon { background: url(images/code.png) left top no-repeat; } }
span.ext_afpa span.fancytree-icon { background: url(images/code.png) left top no-repeat; } .fancytree-ico-cf span.fancytree-icon { background: url(images/directory.min.png) left top no-repeat; width: 22px;}/*background-position: 0px -16px; } /* Collapsed Folder */
span.ext_asp span.fancytree-icon { background: url(images/code.png) left top no-repeat; } .fancytree-ico-ef span.fancytree-icon { background: url(images/folder_open.min.png) left top no-repeat; width: 22px; height: 18px;} /* Expanded Folder */
span.ext_aspx span.fancytree-icon { background: url(images/code.png) left top no-repeat; } .fancytree-statusnode-wait span.fancytree-icon { background-image: url("images/loading-min.gif"); } /* Status node icons */
span.ext_avi span.fancytree-icon { background: url(images/film.png) left top no-repeat; } .fancytree-statusnode-error span.fancytree-icon { background-position: 0px -112px; }
span.ext_bat span.fancytree-icon { background: url(images/application.png) left top no-repeat; }
span.ext_bmp span.fancytree-icon { background: url(images/picture.png) left top no-repeat; } /* File Extensions*/
span.ext_c span.fancytree-icon { background: url(images/code.png) left top no-repeat; } .ext_3gp span.fancytree-icon { background: url(images/film.png) left top no-repeat; }
span.ext_cfg span.fancytree-icon { background: url(images/cfg.png) left top no-repeat; } span.ext_afp span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_cfm span.fancytree-icon { background: url(images/code.png) left top no-repeat; } span.ext_afpa span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_cgi span.fancytree-icon { background: url(images/code.png) left top no-repeat; } span.ext_asp span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_com span.fancytree-icon { background: url(images/application.png) left top no-repeat; } span.ext_aspx span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_cpp span.fancytree-icon { background: url(images/code.png) left top no-repeat; } span.ext_avi span.fancytree-icon { background: url(images/film.png) left top no-repeat; }
span.ext_css span.fancytree-icon { background: url(images/css.png) left top no-repeat; } span.ext_bat span.fancytree-icon { background: url(images/application.png) left top no-repeat; }
span.ext_doc span.fancytree-icon { background: url(images/doc.png) left top no-repeat; } span.ext_bmp span.fancytree-icon { background: url(images/picture.png) left top no-repeat; }
span.ext_exe span.fancytree-icon { background: url(images/application.png) left top no-repeat; } span.ext_c span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_gif span.fancytree-icon { background: url(images/picture.png) left top no-repeat; } span.ext_cfg span.fancytree-icon { background: url(images/cfg.png) left top no-repeat; }
span.ext_fla span.fancytree-icon { background: url(images/flash.png) left top no-repeat; } span.ext_cfm span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_h span.fancytree-icon { background: url(images/code.png) left top no-repeat; } span.ext_cgi span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_htm span.fancytree-icon { background: url(images/html.png) left top no-repeat; } span.ext_com span.fancytree-icon { background: url(images/application.png) left top no-repeat; }
span.ext_html span.fancytree-icon { background: url(images/html.png) left top no-repeat; } span.ext_cpp span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_jar span.fancytree-icon { background: url(images/java.png) left top no-repeat; } span.ext_css span.fancytree-icon { background: url(images/css.png) left top no-repeat; }
span.ext_jpg span.fancytree-icon { background: url(images/picture.png) left top no-repeat; } span.ext_doc span.fancytree-icon { background: url(images/doc.png) left top no-repeat; }
span.ext_jpeg span.fancytree-icon { background: url(images/picture.png) left top no-repeat; } span.ext_exe span.fancytree-icon { background: url(images/application.png) left top no-repeat; }
span.ext_js span.fancytree-icon { background: url(images/script.png) left top no-repeat; } span.ext_gif span.fancytree-icon { background: url(images/picture.png) left top no-repeat; }
span.ext_lasso span.fancytree-icon { background: url(images/code.png) left top no-repeat; } span.ext_fla span.fancytree-icon { background: url(images/flash.png) left top no-repeat; }
span.ext_log span.fancytree-icon { background: url(images/txt.png) left top no-repeat; } span.ext_h span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_m4p span.fancytree-icon { background: url(images/music.png) left top no-repeat; } span.ext_htm span.fancytree-icon { background: url(images/html.png) left top no-repeat; }
span.ext_mov span.fancytree-icon { background: url(images/film.png) left top no-repeat; } span.ext_html span.fancytree-icon { background: url(images/html.png) left top no-repeat; }
span.ext_mp3 span.fancytree-icon { background: url(images/music.png) left top no-repeat; } span.ext_jar span.fancytree-icon { background: url(images/java.png) left top no-repeat; }
span.ext_mp4 span.fancytree-icon { background: url(images/film.png) left top no-repeat; } span.ext_jpg span.fancytree-icon { background: url(images/picture.png) left top no-repeat; }
span.ext_mpg span.fancytree-icon { background: url(images/film.png) left top no-repeat; } span.ext_jpeg span.fancytree-icon { background: url(images/picture.png) left top no-repeat; }
span.ext_mpeg span.fancytree-icon { background: url(images/film.png) left top no-repeat; } span.ext_js span.fancytree-icon { background: url(images/script.png) left top no-repeat; }
span.ext_ogg span.fancytree-icon { background: url(images/music.png) left top no-repeat; } span.ext_lasso span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
span.ext_pcx span.fancytree-icon { background: url(images/picture.png) left top no-repeat; } span.ext_log span.fancytree-icon { background: url(images/txt.png) left top no-repeat; }
span.ext_pdf span.fancytree-icon { background: url(images/pdf.png) left top no-repeat; } span.ext_m4p span.fancytree-icon { background: url(images/music.png) left top no-repeat; }
span.ext_php span.fancytree-icon { background: url(images/php.png) left top no-repeat; } span.ext_mov span.fancytree-icon { background: url(images/film.png) left top no-repeat; }
span.ext_png span.fancytree-icon { background: url(images/picture.png) left top no-repeat; } span.ext_mp3 span.fancytree-icon { background: url(images/music.png) left top no-repeat; }
span.ext_ppt span.fancytree-icon { background: url(images/ppt.png) left top no-repeat; } span.ext_mp4 span.fancytree-icon { background: url(images/film.png) left top no-repeat; }
span.ext_psd span.fancytree-icon { background: url(images/psd.png) left top no-repeat; } span.ext_mpg span.fancytree-icon { background: url(images/film.png) left top no-repeat; }
span.ext_pl span.fancytree-icon { background: url(images/script.png) left top no-repeat; } span.ext_mpeg span.fancytree-icon { background: url(images/film.png) left top no-repeat; }
span.ext_py span.fancytree-icon { background: url(images/script.png) left top no-repeat; } span.ext_ogg span.fancytree-icon { background: url(images/music.png) left top no-repeat; }
span.ext_rb span.fancytree-icon { background: url(images/ruby.png) left top no-repeat; } span.ext_pcx span.fancytree-icon { background: url(images/picture.png) left top no-repeat; }
span.ext_rbx span.fancytree-icon { background: url(images/ruby.png) left top no-repeat; } span.ext_pdf span.fancytree-icon { background: url(images/pdf.png) left top no-repeat; }
span.ext_rhtml span.fancytree-icon { background: url(images/ruby.png) left top no-repeat; } span.ext_php span.fancytree-icon { background: url(images/php.png) left top no-repeat; }
span.ext_rpm span.fancytree-icon { background: url(images/linux.png) left top no-repeat; } span.ext_png span.fancytree-icon { background: url(images/picture.png) left top no-repeat; }
span.ext_ruby span.fancytree-icon { background: url(images/ruby.png) left top no-repeat; } span.ext_ppt span.fancytree-icon { background: url(images/ppt.png) left top no-repeat; }
span.ext_sql span.fancytree-icon { background: url(images/db.png) left top no-repeat; } span.ext_psd span.fancytree-icon { background: url(images/psd.png) left top no-repeat; }
span.ext_swf span.fancytree-icon { background: url(images/flash.png) left top no-repeat; } span.ext_pl span.fancytree-icon { background: url(images/script.png) left top no-repeat; }
span.ext_tif span.fancytree-icon { background: url(images/picture.png) left top no-repeat; } span.ext_py span.fancytree-icon { background: url(images/script.png) left top no-repeat; }
span.ext_tiff span.fancytree-icon { background: url(images/picture.png) left top no-repeat; } span.ext_rb span.fancytree-icon { background: url(images/ruby.png) left top no-repeat; }
span.ext_txt span.fancytree-icon { background: url(images/txt.png) left top no-repeat; } span.ext_rbx span.fancytree-icon { background: url(images/ruby.png) left top no-repeat; }
span.ext_vb span.fancytree-icon { background: url(images/code.png) left top no-repeat; } span.ext_rhtml span.fancytree-icon { background: url(images/ruby.png) left top no-repeat; }
span.ext_wav span.fancytree-icon { background: url(images/music.png) left top no-repeat; } span.ext_rpm span.fancytree-icon { background: url(images/linux.png) left top no-repeat; }
span.ext_wmv span.fancytree-icon { background: url(images/film.png) left top no-repeat; } span.ext_ruby span.fancytree-icon { background: url(images/ruby.png) left top no-repeat; }
span.ext_xls span.fancytree-icon { background: url(images/xls.png) left top no-repeat; } span.ext_sql span.fancytree-icon { background: url(images/db.png) left top no-repeat; }
span.ext_xml span.fancytree-icon { background: url(images/code.png) left top no-repeat; } span.ext_swf span.fancytree-icon { background: url(images/flash.png) left top no-repeat; }
span.ext_zip span.fancytree-icon { background: url(images/zip.png) left top no-repeat; } span.ext_tif span.fancytree-icon { background: url(images/picture.png) left top no-repeat; }
span.ext_tiff span.fancytree-icon { background: url(images/picture.png) left top no-repeat; }
/******************************************************************************* span.ext_txt span.fancytree-icon { background: url(images/txt.png) left top no-repeat; }
* Node titles span.ext_vb span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
*/ span.ext_wav span.fancytree-icon { background: url(images/music.png) left top no-repeat; }
.fancytree-title { span.ext_wmv span.fancytree-icon { background: url(images/film.png) left top no-repeat; }
display: inline-block; /* Better alignment, when title contains <br> */ span.ext_xls span.fancytree-icon { background: url(images/xls.png) left top no-repeat; }
padding-left: 3px; span.ext_xml span.fancytree-icon { background: url(images/code.png) left top no-repeat; }
padding-right: 3px; /* Otherwise italic font will be outside bounds */ span.ext_zip span.fancytree-icon { background: url(images/zip.png) left top no-repeat; }
color: black; /* inherit doesn't work on IE */
vertical-align: top; /*******************************************************************************
margin: 0px; * Node titles
margin-left: 3px; */
/* border: 1px solid white; /* reserve some space for status borders (Note: 'transparent' would not work in IE6) */ .fancytree-title {
border: 1px solid transparent; /* reserve some space for status borders */ display: inline-block; /* Better alignment, when title contains <br> */
border-radius: 0; padding-left: 3px;
text-decoration: none; padding-right: 3px; /* Otherwise italic font will be outside bounds */
cursor: pointer; color: black; /* inherit doesn't work on IE */
} vertical-align: top;
span.fancytree-focused .fancytree-title { margin: 0px;
/*outline: 1px dotted black;*/ margin-left: 3px;
color: white; /* border: 1px solid white; /* reserve some space for status borders (Note: 'transparent' would not work in IE6) */
} border: 1px solid transparent; /* reserve some space for status borders */
span.fancytree-selected .fancytree-title, border-radius: 0;
span.fancytree-active .fancytree-title { text-decoration: none;
background-color: #D4D4D4; /*gray*/ cursor: pointer;
} }
span.fancytree-selected .fancytree-title { span.fancytree-focused .fancytree-title {
font-style: italic; /*outline: 1px dotted black;*/
} /*color: white;*/
.fancytree-focused span.fancytree-selected .fancytree-title, }
.fancytree-focused span.fancytree-active .fancytree-title { span.fancytree-selected .fancytree-title,
color: white; span.fancytree-active .fancytree-title {
background-color: #3875D7; /*blue*/ /*background-color: #D4D4D4; /*gray*/
} }
span.fancytree-selected .fancytree-title {
/******************************************************************************* font-style: italic;
* 'table' extension }
*/ .fancytree-focused span.fancytree-selected .fancytree-title,
.fancytree-focused span.fancytree-active .fancytree-title {
/* /*color: white;
table.fancytree-ext-table { background-color: #3875D7; /*blue*/
border-collapse: collapse; }
width: 100%;
} span.fancytree-node:hover
table.fancytree-ext-table tbody tr:nth-child(even){ {
background-color: #f4f4f8; background-color: #BDF;
} border-color: #70C0E7;
table.fancytree-ext-table tbody tr td { cursor: pointer;
border: 1px solid lightgray; }
} .fancytree-container.fancytree-focused span.fancytree-node.fancytree-focused
*/ {
table.fancytree-ext-table { border-color: #3399FF;
border-collapse: collapse; /* outline: 1px solid #3399FF; */
} }
table.fancytree-ext-table tbody tr.fancytree-focused { span.fancytree-node.fancytree-active,
background-color: #99DEFD; span.fancytree-node.fancytree-selected
} { /* active/selcted nodes inside inactive tree */
table.fancytree-ext-table tbody tr.fancytree-active { background-color: #F7F7F7;
background-color: royalblue; border-color: #DEDEDE;
} }
table.fancytree-ext-table tbody tr.fancytree-selected {
background-color: #99FDDE; /*******************************************************************************
} * 'table' extension
*/
/*******************************************************************************
* 'columnview' extension /*
*/ table.fancytree-ext-table {
border-collapse: collapse;
/* width: 100%;
table.fancytree-ext-columnview { }
border-collapse: collapse; table.fancytree-ext-table tbody tr:nth-child(even){
width: 100%; background-color: #f4f4f8;
} }
*/ table.fancytree-ext-table tbody tr td {
table.fancytree-ext-columnview td >ul border: 1px solid lightgray;
{ }
padding: 0; */
} table.fancytree-ext-table {
table.fancytree-ext-columnview td >ul li border-collapse: collapse;
{ }
list-style-image: none; table.fancytree-ext-table tbody tr.fancytree-focused {
list-style-position: outside; background-color: #99DEFD;
list-style-type: none; }
-moz-background-clip:border; table.fancytree-ext-table tbody tr.fancytree-active {
-moz-background-inline-policy: continuous; background-color: royalblue;
-moz-background-origin: padding; }
background-attachment: scroll; table.fancytree-ext-table tbody tr.fancytree-selected {
background-color: transparent; background-color: #99FDDE;
background-position: 0 0; }
background-repeat: repeat-y;
background-image: none; /* no v-lines */ /*******************************************************************************
* 'columnview' extension
margin: 0; */
padding: 1px 0 0 0;
} /*
/* table.fancytree-ext-columnview {
table.fancytree-ext-columnview tbody tr[0] { border-collapse: collapse;
height: 200px; width: 100%;
} }
*/ */
table.fancytree-ext-columnview tbody tr td { table.fancytree-ext-columnview td >ul
border: 1px solid gray; {
vertical-align: top; padding: 0;
overflow: auto; }
} table.fancytree-ext-columnview td >ul li
table.fancytree-ext-columnview span.fancytree-node { {
display: inline-block; list-style-image: none;
position: relative; /* allow positioning of embedded spans*/ list-style-position: outside;
width: 100%; list-style-type: none;
} -moz-background-clip:border;
table.fancytree-ext-columnview span.fancytree-node a{ -moz-background-inline-policy: continuous;
border: 1px solid transparent; -moz-background-origin: padding;
background-color: transparent; background-attachment: scroll;
} background-color: transparent;
table.fancytree-ext-columnview span.fancytree-node.fancytree-expanded { background-position: 0 0;
background-color: #ccc; background-repeat: repeat-y;
} background-image: none; /* no v-lines */
table.fancytree-ext-columnview span.fancytree-node.fancytree-active {
background-color: royalblue; margin: 0;
} padding: 1px 0 0 0;
table.fancytree-ext-columnview span.fancytree-cv-right { }
background-position: 0px -80px; /*
position: absolute; table.fancytree-ext-columnview tbody tr[0] {
right: 3px; height: 200px;
} }
*/
table.fancytree-ext-columnview tbody tr td {
/******************************************************************************* border: 1px solid gray;
* 'filter' extension vertical-align: top;
*/ overflow: auto;
.fancytree-ext-filter span.fancytree-node .fancytree-title { }
color: silver; table.fancytree-ext-columnview span.fancytree-node {
font-weight: lighter; display: inline-block;
} position: relative; /* allow positioning of embedded spans*/
.fancytree-ext-filter span.fancytree-node.fancytree-submatch .fancytree-title { width: 100%;
color: black; }
font-weight: normal; table.fancytree-ext-columnview span.fancytree-node a{
} border: 1px solid transparent;
.fancytree-ext-filter span.fancytree-node.fancytree-match .fancytree-title { background-color: transparent;
color: black; }
font-weight: bold; table.fancytree-ext-columnview span.fancytree-node.fancytree-expanded {
} background-color: #ccc;
}
table.fancytree-ext-columnview span.fancytree-node.fancytree-active {
/******************************************************************************* background-color: royalblue;
* Drag'n'drop support }
*/ table.fancytree-ext-columnview span.fancytree-cv-right {
background-position: 0px -80px;
/*** Helper object ************************************************************/ position: absolute;
div.fancytree-drag-helper right: 3px;
{ }
}
div.fancytree-drag-helper a
{ /*******************************************************************************
border: 1px solid gray; * 'filter' extension
background-color: white; */
padding-left: 5px; .fancytree-ext-filter span.fancytree-node .fancytree-title {
padding-right: 5px; color: silver;
opacity: 0.8; font-weight: lighter;
} }
span.fancytree-drag-helper-img .fancytree-ext-filter span.fancytree-node.fancytree-submatch .fancytree-title {
{ color: black;
/* font-weight: normal;
position: relative; }
left: -16px; .fancytree-ext-filter span.fancytree-node.fancytree-match .fancytree-title {
*/ color: black;
} font-weight: bold;
div.fancytree-drag-helper /*.fancytree-drop-accept*/ }
{
/* border-color: green;
background-color: red;*/ /*******************************************************************************
} * Drag'n'drop support
div.fancytree-drop-accept span.fancytree-drag-helper-img */
{
background-position: -32px -112px; /*** Helper object ************************************************************/
} div.fancytree-drag-helper
div.fancytree-drag-helper.fancytree-drop-reject {
{ }
border-color: red; div.fancytree-drag-helper a
} {
div.fancytree-drop-reject span.fancytree-drag-helper-img border: 1px solid gray;
{ background-color: white;
background-position: -16px -112px; padding-left: 5px;
} padding-right: 5px;
opacity: 0.8;
/*** Drop marker icon *********************************************************/ }
span.fancytree-drag-helper-img
#fancytree-drop-marker {
{ /*
width: 24px; position: relative;
position: absolute; left: -16px;
background-position: 0 -128px; */
margin: 0; }
} div.fancytree-drag-helper /*.fancytree-drop-accept*/
#fancytree-drop-marker.fancytree-drop-after, {
#fancytree-drop-marker.fancytree-drop-before /* border-color: green;
{ background-color: red;*/
width:64px; }
background-position: 0 -144px; div.fancytree-drop-accept span.fancytree-drag-helper-img
} {
#fancytree-drop-marker.fancytree-drop-copy background-position: -32px -112px;
{ }
background-position: -64px -128px; div.fancytree-drag-helper.fancytree-drop-reject
} {
#fancytree-drop-marker.fancytree-drop-move border-color: red;
{ }
background-position: -64px -128px; div.fancytree-drop-reject span.fancytree-drag-helper-img
} {
background-position: -16px -112px;
/*** Source node while dragging ***********************************************/ }
span.fancytree-drag-source /*** Drop marker icon *********************************************************/
{
/* border: 1px dotted gray; */ #fancytree-drop-marker
background-color: #e0e0e0; {
} width: 24px;
span.fancytree-drag-source a position: absolute;
{ background-position: 0 -128px;
color: gray; margin: 0;
} }
#fancytree-drop-marker.fancytree-drop-after,
/*** Target node while dragging cursor is over it *****************************/ #fancytree-drop-marker.fancytree-drop-before
{
span.fancytree-drop-target width:64px;
{ background-position: 0 -144px;
/*border: 1px solid gray;*/ }
} #fancytree-drop-marker.fancytree-drop-copy
span.fancytree-drop-target a {
{ background-position: -64px -128px;
} }
span.fancytree-drop-target.fancytree-drop-accept a #fancytree-drop-marker.fancytree-drop-move
{ {
/*border: 1px solid green;*/ background-position: -64px -128px;
background-color: #3169C6 !important; }
color: white !important; /* @ IE6 */
text-decoration: none; /*** Source node while dragging ***********************************************/
}
span.fancytree-drop-target.fancytree-drop-reject span.fancytree-drag-source
{ {
/*border: 1px solid red;*/ /* border: 1px dotted gray; */
} background-color: #e0e0e0;
span.fancytree-drop-target.fancytree-drop-after a }
{ span.fancytree-drag-source a
} {
color: gray;
}
/*** Target node while dragging cursor is over it *****************************/
span.fancytree-drop-target
{
/*border: 1px solid gray;*/
}
span.fancytree-drop-target a
{
}
span.fancytree-drop-target.fancytree-drop-accept a
{
/*border: 1px solid green;*/
background-color: #3169C6 !important;
color: white !important; /* @ IE6 */
text-decoration: none;
}
span.fancytree-drop-target.fancytree-drop-reject
{
/*border: 1px solid red;*/
}
span.fancytree-drop-target.fancytree-drop-after a
{
}
...@@ -11,7 +11,6 @@ $(document).ready(function () { ...@@ -11,7 +11,6 @@ $(document).ready(function () {
CurrentMode, CurrentMode,
script = "/readFolder", script = "/readFolder",
softwareDisplay = true, softwareDisplay = true,
fileTree,
Mode, Mode,
modes, modes,
projectDir = $("input#project").val(), projectDir = $("input#project").val(),
...@@ -86,7 +85,7 @@ $(document).ready(function () { ...@@ -86,7 +85,7 @@ $(document).ready(function () {
function selectFile(file) { function selectFile(file) {
$("#info").empty(); $("#info").empty();
$("#info").append("Selection: " + file); $("#info").append("Current work tree: " + file);
selection = file; selection = file;
return; return;
} }
...@@ -117,7 +116,7 @@ $(document).ready(function () { ...@@ -117,7 +116,7 @@ $(document).ready(function () {
$('#fileTreeFull').hide(); $('#fileTreeFull').hide();
} }
$("#info").empty(); $("#info").empty();
$("#info").append("Selection: " + base_path()); $("#info").append("Current work tree: " + base_path());
selection = ""; selection = "";
} }
...@@ -296,7 +295,7 @@ $(document).ready(function () { ...@@ -296,7 +295,7 @@ $(document).ready(function () {
success: function (data) { success: function (data) {
$("#inline_content").empty(); $("#inline_content").empty();
$("#inline_content").append('<h2 style="color: #4c6172; font: 18px \'Helvetica Neue\', Helvetica, Arial, sans-serif;">Content of file: ' + $("#inline_content").append('<h2 style="color: #4c6172; font: 18px \'Helvetica Neue\', Helvetica, Arial, sans-serif;">Content of file: ' +
node.title +'</h2>'); node.title +'</h2>');
$("#inline_content").append('<br/><div class="main_content"><pre id="editorViewer"></pre></div>'); $("#inline_content").append('<br/><div class="main_content"><pre id="editorViewer"></pre></div>');
viewer = ace.edit("editorViewer"); viewer = ace.edit("editorViewer");
viewer.setTheme("ace/theme/crimson_editor"); viewer.setTheme("ace/theme/crimson_editor");
...@@ -390,8 +389,11 @@ $(document).ready(function () { ...@@ -390,8 +389,11 @@ $(document).ready(function () {
}; };
// --- Init fancytree during startup ---------------------------------------- // --- Init fancytree during startup ----------------------------------------
$(function(){ function initTree(tree, path, key){
$("#fileTree").fancytree({ if (!key){
key = '0';
}
$(tree).fancytree({
activate: function(event, data) { activate: function(event, data) {
var node = data.node; var node = data.node;
}, },
...@@ -404,14 +406,14 @@ $(document).ready(function () { ...@@ -404,14 +406,14 @@ $(document).ready(function () {
}, },
source: { source: {
url: $SCRIPT_ROOT + "/fileBrowser", url: $SCRIPT_ROOT + "/fileBrowser",
data:{opt: 20, dir: currentProject, key: 0}, data:{opt: 20, dir: path, key: key, listfiles: 'yes'},
cache: false cache: false
}, },
lazyload: function(event, data) { lazyload: function(event, data) {
var node = data.node; var node = data.node;
data.result = { data.result = {
url: $SCRIPT_ROOT + "/fileBrowser", url: $SCRIPT_ROOT + "/fileBrowser",
data: {opt: 20, dir: node.data.path , key: node.key} data: {opt: 20, dir: node.data.path , key: node.key, listfiles: 'yes'}
} }
}, },
keydown: function(event, data) { keydown: function(event, data) {
...@@ -461,7 +463,7 @@ $(document).ready(function () { ...@@ -461,7 +463,7 @@ $(document).ready(function () {
bindContextMenu(data.node.span, !data.node.isFolder()); bindContextMenu(data.node.span, !data.node.isFolder());
} }
}); });
}); }
editor.setTheme("ace/theme/crimson_editor"); editor.setTheme("ace/theme/crimson_editor");
...@@ -494,7 +496,9 @@ $(document).ready(function () { ...@@ -494,7 +496,9 @@ $(document).ready(function () {
/*$('#fileTreeFull').fileTree({ root: currentProject, script: $SCRIPT_ROOT + script, folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false, selectFolder: true }, function (file) { /*$('#fileTreeFull').fileTree({ root: currentProject, script: $SCRIPT_ROOT + script, folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false, selectFolder: true }, function (file) {
selectFile(file); selectFile(file);
}, function (file) { openFile(file); });*/ }, function (file) { openFile(file); });*/
$("#info").append("Selection: " + base_path()); initTree('#fileTree', projectDir, 'pfolder');
initTree('#fileTreeFull', currentProject);
$("#info").append("Current work tree: " + base_path());
/*setDetailBox();*/ /*setDetailBox();*/
editor.on("change", function (e) { editor.on("change", function (e) {
...@@ -549,7 +553,7 @@ $(document).ready(function () { ...@@ -549,7 +553,7 @@ $(document).ready(function () {
$("#clearselect").click(function () { $("#clearselect").click(function () {
edit = false; edit = false;
$("#info").empty(); $("#info").empty();
$("#info").append("Selection: " + base_path()); $("#info").append("Current work tree: " + base_path());
$("input#subfolder").val(""); $("input#subfolder").val("");
$("#edit_info").empty(); $("#edit_info").empty();
$("#edit_info").append("No file in editor"); $("#edit_info").append("No file in editor");
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</div> </div>
<div id="details_box"> <div id="details_box">
<div id="fileTree" class="file_tree_short"></div> <div id="fileTree" class="file_tree_short"></div>
<div id="fileTreeFull" style='display:none' class="file_tree_short" title="Double click to edit selected file..."></div> <div id="fileTreeFull" style='display:none' class="file_tree_short"></div>
</div> </div>
</div> </div>
<div id="code"> <div id="code">
......
...@@ -587,60 +587,61 @@ def fileBrowser(): ...@@ -587,60 +587,61 @@ def fileBrowser():
else: else:
opt = int(request.args.get('opt')) opt = int(request.args.get('opt'))
# try: try:
if opt == 1: if opt == 1:
#list files and directories #list files and directories
result = file_request.listDirs(dir) result = file_request.listDirs(dir)
elif opt == 2: elif opt == 2:
#Create file #Create file
result = file_request.makeFile(dir, filename) result = file_request.makeFile(dir, filename)
elif opt == 3: elif opt == 3:
#Create directory #Create directory
result = file_request.makeDirectory(dir, filename) result = file_request.makeDirectory(dir, filename)
elif opt == 4: elif opt == 4:
#Delete a list of files or/and directories #Delete a list of files or/and directories
result = file_request.deleteItem(dir, files) result = file_request.deleteItem(dir, files)
elif opt == 5: elif opt == 5:
#copy a lis of files or/and directories #copy a lis of files or/and directories
result = file_request.copyItem(dir, files) result = file_request.copyItem(dir, files)
elif opt == 6: elif opt == 6:
#rename file or directory #rename file or directory
result = file_request.rename(dir, filename, newfilename) result = file_request.rename(dir, filename, newfilename)
elif opt == 7: elif opt == 7:
result = file_request.copyItem(dir, files, del_source=True) result = file_request.copyItem(dir, files, del_source=True)
elif opt == 8: elif opt == 8:
#donwload file #donwload file
filename = request.args.get('filename').encode('utf-8') filename = request.args.get('filename').encode('utf-8')
result = file_request.downloadFile(request.args.get('dir').encode('utf-8'), result = file_request.downloadFile(request.args.get('dir').encode('utf-8'),
filename) filename)
try: try:
return send_file(result, attachment_filename=filename, as_attachment=True) return send_file(result, attachment_filename=filename, as_attachment=True)
except: except:
abort(404) abort(404)
elif opt == 9: elif opt == 9:
result = file_request.readFile(dir, filename, False) result = file_request.readFile(dir, filename, False)
elif opt == 11: elif opt == 11:
#Upload file #Upload file
result = file_request.uploadFile(dir, request.files) result = file_request.uploadFile(dir, request.files)
elif opt == 14: elif opt == 14:
#Copy file or directory as ... #Copy file or directory as ...
result = file_request.copyAsFile(dir, filename, newfilename) result = file_request.copyAsFile(dir, filename, newfilename)
elif opt == 16: elif opt == 16:
#zip file #zip file
result = file_request.zipFile(dir, filename, newfilename) result = file_request.zipFile(dir, filename, newfilename)
elif opt == 17: elif opt == 17:
#zip file #zip file
result = file_request.unzipFile(dir, filename, newfilename) result = file_request.unzipFile(dir, filename, newfilename)
elif opt == 20: elif opt == 20:
#Fancy Load folder #Fancy Load folder
key = int(request.args.get('key')) key = request.args.get('key')
dir = request.args.get('dir').encode('utf-8') dir = request.args.get('dir').encode('utf-8')
data = file_request.fancylistDirs(dir, key) listfiles = request.args.get('listfiles', '')
result = json.dumps(data) data = file_request.fancylistDirs(dir, key, listfiles)
else: result = json.dumps(data)
result = "ARGS PARSE ERROR: Bad option..." else:
# except Exception as e: result = "ARGS PARSE ERROR: Bad option..."
# return str(e) except Exception as e:
return str(e)
return result return result
......
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