Commits

Joseph Tate committed c2b3a83

Simple wrapper around the elfinder file browser and python cgi connector

  • Participants
  • Parent commits 2fd7e2f

Comments (0)

Files changed (15)

+SHELL:= $(shell which bash)
+
+ELFINDERDIR=elFinder
+ELFINDERLOC=git://github.com/josephtate/elFinder.git
+TRUNKVER=trunk
+BASEDIR=tw2/jqplugins/elfinder
+STATICDIR=$(BASEDIR)/static/jquery/plugins/elfinder/$(TRUNKVER)
+
+update: $(ELFINDERDIR)
+	cd $(ELFINDERDIR) && git pull -u $(ELFINDERLOC)
+	cd $(ELFINDERDIR)/src && $(MAKE) elfinder
+	cp $(ELFINDERDIR)/src/connectors/python/elFinder.py $(BASEDIR)/connector
+	cp $(ELFINDERDIR)/src/connectors/python/connector.py $(BASEDIR)/connector/cgi.py
+	mkdir -p $(STATICDIR)/js
+	mkdir -p $(STATICDIR)/css
+	mkdir -p $(STATICDIR)/images
+	cp $(ELFINDERDIR)/src/elfinder.css $(STATICDIR)/css
+	cp $(ELFINDERDIR)/src/elfinder.full.js $(STATICDIR)/js
+	cp $(ELFINDERDIR)/src/elfinder.min.js $(STATICDIR)/js
+	rsync -r --delete $(ELFINDERDIR)/src/images/ $(STATICDIR)/images/
+
+$(ELFINDERDIR):
+	@[ -d $(ELFINDERDIR) ] || { git clone $(ELFINDERLOC) $(ELFINDERDIR); }
+
+clone: $(ELFINDERDIR)

tw2/jqplugins/elfinder/connector/cgi.py

 #		elf.httpResponse['file'].close()
 #	else:
 #		print json.dumps(elf.httpResponse, indent = True)
-#
+#

tw2/jqplugins/elfinder/connector/elFinder.py

 		self._im = None
 		self._sp = None
 
-
 		self._time = time.time()
 		t = datetime.fromtimestamp(self._time)
 		self._today = time.mktime(datetime(t.year, t.month, t.day).timetuple())
 			self._sp = subprocess
 
 		try:
-			sp = self._sp.Popen(cmd, shell = False, stdout = self._sp.PIPE, stderr = self._sp.PIPE)
-			out, err = sp.communicate()
+			sp = self._sp.Popen(cmd, shell = False, stdout = self._sp.PIPE, stderr = self._sp.PIPE, stdin = self._sp.PIPE)
+			out, err = sp.communicate('')
 			ret = sp.returncode
 			# print cmd, ret, out, err
 		except:

tw2/jqplugins/elfinder/defaults.py

 _plugin_css_dirname_ = 'static/jquery/plugins/%(name)s/%(version)s/%(subdir)s'
 _elfinder_name_       = 'elfinder'
 _elfinder_basename_       = 'elfinder'
-_elfinder_version_        = '1.1'
+_elfinder_version_        = 'trunk'
 _elfinder_debug_          = 'full'

tw2/jqplugins/elfinder/static/jquery/plugins/elfinder/trunk/css/elfinder.css

+
+/* file manager window */
+
+.el-finder {
+	width:100%; 
+	min-width:400px;
+	border:1px solid #ccc;
+	background-color:#eee;
+	font:12px trebuchet ms,lucida grande,verdana,sans-serif;
+	border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;
+}
+
+.el-finder-undocked {
+	position:absolute;
+	min-width:400px;
+	border:1px solid #ccc;
+	padding:5px;
+}
+
+/* error messages */
+.el-finder-err {
+	padding: 15px;
+	text-align:center;
+	background: #fee; 
+	color: #cc0509; 
+	border: 2px #844 solid;
+	border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px;
+}
+
+/* disabled */
+.el-finder-disabled .el-finder-toolbar li,
+.el-finder-disabled .el-finder-nav,
+.el-finder-disabled .el-finder-cwd { 
+	opacity:0.35; filter:Alpha(Opacity=35);
+}
+
+.el-finder .el-finder-droppable {
+	background-color:#99ccff;
+}
+.el-finder .ui-selected {
+	background-color:#ccc;
+/*	background-color:#c5e4f9;*/
+}
+
+.el-finder input {
+	margin:0;
+	padding:0;
+	outline:none;
+	border:1px solid #ccc;
+}
+
+/************************************/
+/*             toolbar              */
+/************************************/         
+
+.el-finder-toolbar ul {
+	padding:5px 7px;
+	margin:0;
+	list-style:none;
+}
+
+.el-finder-toolbar ul li {
+	display: -moz-inline-stack;
+    display: inline-block;
+    zoom: 1;
+    *display: inline;
+	vertical-align: top;
+	height:22px; 
+	width:23px;
+	margin:0 2px;
+	padding:0;
+	background:url('../images/toolbar.png') no-repeat; 
+	border:1px solid #ccc;
+	border-radius:3px; 
+	-moz-border-radius:3px; 
+	-webkit-border-radius:3px;
+}
+.el-finder-toolbar ul li.delim { 
+	border:none;
+	width:3px;
+	background-position: 1px -610px;
+}
+
+.el-finder-toolbar ul li.el-finder-tb-hover {
+	border:1px solid #fff;
+	background-color:#ccc;
+}
+
+.el-finder-toolbar ul li.disabled { opacity:0.35; filter:Alpha(Opacity=35); }
+
+.el-finder-toolbar ul li.back       { background-position: 3px -171px; }
+.el-finder-toolbar ul li.reload     { background-position: 3px -192px; }
+.el-finder-toolbar ul li.select     { background-position: 3px -214px; }
+.el-finder-toolbar ul li.open       { background-position: 4px -235px; }
+.el-finder-toolbar ul li.mkdir      { background-position: 4px -258px; }
+.el-finder-toolbar ul li.mkfile     { background-position: 4px -280px; }
+.el-finder-toolbar ul li.upload     { background-position: 3px -305px; }
+.el-finder-toolbar ul li.rm         { background-position: 3px -330px; }
+.el-finder-toolbar ul li.copy       { background-position: 3px -356px; }
+.el-finder-toolbar ul li.paste      { background-position: 3px -381px; }
+.el-finder-toolbar ul li.rename     { background-position: 3px -407px; }
+.el-finder-toolbar ul li.edit       { background-position: 4px -435px; }
+.el-finder-toolbar ul li.info       { background-position: 3px -462px; }
+.el-finder-toolbar ul li.help       { background-position: 3px -487px; }
+.el-finder-toolbar ul li.icons      { background-position: 3px -537px; }
+.el-finder-toolbar ul li.list       { background-position: 3px -557px; }
+.el-finder-toolbar ul li.uncompress { background-position: 3px -583px; }
+.el-finder-toolbar ul li.resize     { background-position: 3px -647px; }
+.el-finder-toolbar ul li.quicklook  { background-position: 3px -726px; }
+
+.el-finder-dock-button {
+	width:19px;
+	height:19px;
+	float:right;
+	margin: 2px;
+	border:1px solid #ccc;
+	border-radius:3px; 
+	-moz-border-radius:3px; 
+	-webkit-border-radius:3px;
+	background:url('../images/toolbar.png') 2px -705px no-repeat; 
+}
+
+.ui-dialog .el-finder-dock-button {
+	background-position:2px -681px;
+}
+
+.el-finder-dock-button-hover {
+	background-color:#ccc;
+	border:1px solid #fff;
+}
+
+/**********************************************************/
+/*  workzone, container for navigation and current folder */
+/**********************************************************/
+
+.el-finder-workzone {
+	background-color:#fff;
+	border-top:1px solid #ccc;
+	border-bottom:1px solid #ccc;
+	position:relative;
+}
+
+.el-finder-spinner {
+	position:absolute;
+	top:37%;
+	left:37%;
+	width:250px;
+	height:50px;
+	background:transparent url(../images/spinner.gif) 50% 50% no-repeat;
+	display:none;
+}
+
+/* error in workzone */
+.el-finder-workzone p.el-finder-err {
+	display:none;
+	position:absolute;
+	left:37%;
+	top:20px;
+}
+
+/* navigation and current directory */
+.el-finder-nav, .el-finder-cwd {
+	height:350px;
+	overflow:auto;
+	padding:3px 1px;
+}
+
+/************************************/
+/*             navigation           */
+/************************************/
+
+.el-finder-nav {
+	float:left;
+	width : 200px;
+	background:#fff;
+}
+
+.el-finder-nav .ui-resizable-e {
+	right:0;
+}
+
+/* folders tree */
+.el-finder-nav ul {
+	list-style:none;
+	margin:0;
+	padding:0;
+}
+
+.el-finder-nav ul li {
+	clear:both;
+}
+
+ul.el-finder-tree, ul.el-finder-places {
+	margin-bottom:1em;
+}
+
+.el-finder-nav ul li ul {
+	margin-left:12px;
+}
+
+.el-finder-nav ul div {
+	width:12px;
+	height:20px;
+	float:left;
+	margin-right:23px;
+}
+
+.el-finder-nav  a, .el-finder-nav  div.collapsed {
+	background-image:url(../images/toolbar.png);
+	background-repeat:no-repeat;
+}
+.el-finder-nav  div.collapsed {
+	background-position: -1px 7px;
+}
+.el-finder-nav div.expanded {
+	background-position: -1px -9px;
+}
+
+.el-finder-nav a {
+	display: block;
+	white-space:nowrap;
+	line-height:20px;
+	color:#444;
+	cursor:default;
+	text-decoration:none;
+	outline:none;
+	border-radius:3px; 
+	-moz-border-radius:3px; 
+	-webkit-border-radius:3px;
+	background-position: 15px -56px;
+}
+
+.el-finder-nav a.dropbox {
+	background-position: 15px -80px; 
+}
+.el-finder-nav a.readonly {
+	background-position: 15px -104px; 
+}
+.el-finder-nav a.noaccess {
+	background-position: 15px -750px; 
+}
+
+.el-finder-nav a.selected {
+/*	background-color:#ccc;*/
+	background-color:#c5e4f9;
+	background-position: 15px -128px;
+}
+
+.el-finder-nav a.el-finder-tree-root { 
+	background-position: 15px -30px; 
+	font-weight:bold;
+}
+
+.el-finder-nav a.el-finder-places-root {
+	background-position: 15px -152px; 
+	font-weight:bold;
+}
+
+.el-finder-nav ul.el-finder-tree .el-finder-droppable {
+	background-position: 15px -237px; 
+}
+
+
+/***********************************/
+/*     current working directory    */
+/************************************/
+
+.el-finder-cwd {
+	border-left:1px solid #ccc;
+	padding:3px;
+}
+
+/********** view: icons  ************/
+.el-finder-cwd div {
+	width: 81px;
+	display: -moz-inline-stack;
+	display: inline-block;
+	vertical-align: top;
+	zoom: 1;
+	*display: inline;
+	margin:0 3px 3px 0;
+	padding:1px 0;
+	text-align:center;
+	border-radius:5px; 
+	-moz-border-radius:5px; 
+	-webkit-border-radius:5px;
+	color:#000;
+	background-color:transparent;
+}
+
+
+.el-finder-cwd p, 
+.el-finder-ql p {
+	width:48px;
+	height:48px;
+	margin:1px auto;
+	padding:0;
+	border-radius:5px; 
+	-moz-border-radius:5px; 
+	-webkit-border-radius:5px;
+	background: url('../images/icons-big.png') -1px 1px no-repeat;
+}
+
+/* mimetypes */
+
+.directory p { background-position:  0     -50px; }
+.application p,.x-java p { background-position: -1px  -150px; }
+.audio p { background-position: -1px -300px; }
+.image p { background-position: -1px -250px;  }
+.text p, .x-empty p { background-position: -1px  -200px; }
+.video p  { background-position: -1px -350px; }
+.vnd-adobe-photoshop p, .postscript p    { background-position: 0 -250px; }
+/* texts */
+.rtf p, .rtfd p { background-position: 0 -400px; }
+.html p { background-position: 0 -550px; }
+.css p { background-position: 0 -600px; }
+.javascript p, .x-javascript p  { background-position: 0 -650px; }
+.x-perl p { background-position: 0 -700px; }
+.x-python p { background-position: 0 -750px; }
+.x-ruby p { background-position: 0 -800px; }
+.x-sh p, .x-shellscript p { background-position: 0 -850px; }
+.x-c p, .x-java-source p { background-position: 0 -900px; }
+.x-php p  { background-position: 0 -950px; }
+.xml p           { background-position: 0 -1000px; }
+/* applications */
+.vnd-ms-office p, 
+.msword p, 
+.vnd-ms-word p, 
+.vnd-oasis-opendocument-text p,
+.ms-excel p,
+.vnd-ms-excel p,
+.vnd-oasis-opendocument-spreadsheet p,
+.vnd-ms-powerpoint p,
+.vnd-oasis-opendocument-presentation p { background-position: 0 -500px; }
+.pdf p { background-position: 0 -450px; }
+.x-shockwave-flash p { background-position: 0 -1250px; }
+/* archives */
+.zip p, .x-7z-compressed p { background-position: 0 -1050px; }
+.x-gzip p, .x-tar p  { background-position: 0 -1100px; }
+.x-bzip p, .x-bzip2 p { background-position: 0 -1150px; }
+.x-rar p, .x-rar-compressed p { background-position: 0 -1200px; }
+
+
+.el-finder-cwd div.el-finder-droppable p {
+	background-position: 0 -98px;
+}
+
+.el-finder-cwd label {
+	display:block;
+	font-size:11px;
+	line-height:13px;
+	padding:0 1px;
+	margin:0;
+	height:25px;
+	overflow:hidden;
+	cursor:default;
+}
+
+.el-finder-cwd div input { 
+	background:#fff; 
+	color:#000;
+	width:81px;
+	margin-left:-2px; 
+	outline:none; 
+	border:1px solid #ccc;
+	text-align:center;
+}
+
+.el-finder-cwd div em {
+	float:left;
+	margin-top:-40px;
+	margin-left:9px;
+	width:15px;
+	height:16px;
+	background:url(../images/icons-big.png) -17px -1310px no-repeat;
+}
+
+.el-finder-cwd div em.dropbox {
+	float:right;
+	margin-right:9px;
+	background-position: 0 -1308px;
+}
+.el-finder-cwd div em.noread {
+	float:right;
+	margin-right:9px;
+	background-position: 0 -1310px;
+}
+.el-finder-cwd div em.readonly {
+	float:right;
+	margin-right:9px;
+	background-position: -34px -1306px;
+}
+
+.el-finder-cwd div em.noaccess {
+	float:right;
+	margin-right:9px;
+	background-position: 0 -1430px;
+}
+
+/********** view: list  ************/
+
+.el-finder-cwd table {
+	width:100%;
+/*	*width:99%;*/
+	border-collapse: collapse;	
+	border-spacing: 0;
+	border:1px solid #ccc;
+	border-top:0 solid;
+	border-left:0 solid;
+	margin:-3px -3px;
+}
+
+.el-finder-cwd table tr {
+	background:transparent;
+}
+
+.el-finder-cwd table tr.el-finder-row-odd {
+	background-color:#eee;
+}
+
+.el-finder-cwd table tr.ui-selected {
+	background-color:#ccc;
+}
+
+.el-finder-cwd table th,
+.el-finder-cwd table td {
+	padding:3px 5px;
+	border-left:1px solid #ccc;
+	cursor:default;
+	white-space:nowrap;
+	color:#000;
+	
+}
+
+.el-finder-cwd table th {
+	text-align:left;
+	background:#fbf9ee;
+	font-size:.86em;
+}
+
+.el-finder-cwd table td.icon {
+	width:24px;
+}
+
+.el-finder-cwd table  p {
+	width:24px;
+	height:16px;
+	margin:0;
+	padding:0;
+	background:url(../images/icons-small.png) 4px 0 no-repeat;
+}
+
+.el-finder-cwd table .size {
+	text-align:right;
+}
+
+tr.directory   p { background-position:4px  -16px; }
+tr.text        p { background-position:5px  -34px; }
+tr.image       p { background-position:4px  -51px; }
+tr.audio       p { background-position:4px  -70px; }
+tr.video       p { background-position:5px  -89px; }
+tr.application p { background-position:4px -108px; }
+/* text */
+tr.html          p  { background-position:5px  -188px; }
+tr.javascript    p,
+tr.x-javascript  p,
+tr.css   		 p,
+tr.x-sql   		 p,
+tr.xml   		 p,
+tr.x-python   	 p,
+tr.x-java-source p,
+tr.x-perl        p,
+tr.x-ruby        p  { background-position:5px  -228px; }
+tr.x-php         p  { background-position:5px  -247px; }
+tr.x-c           p  { background-position:5px  -208px; }
+tr.x-shellscript p, 
+tr.x-sh          p  { background-position:5px  -168px; }
+tr.rtf p, tr.rtfd p { background-position:5px  -148px; }
+/* application */
+tr.x-shockwave-flash p { background-position:4px  -266px; }
+tr.pdf               p { background-position:4px  -285px; }
+tr.vnd-ms-office     p { background-position:4px  -325px; }
+tr.msword p,
+tr.vnd-oasis-opendocument-text  p,
+tr.vnd-ms-word p { background-position:4px -346px; }
+tr.vnd-ms-excel p,
+tr.ms-excel p,
+tr.vnd-oasis-opendocument-spreadsheet { background-position:4px -365px; }
+tr.vnd-ms-powerpoint p,
+tr.vnd-oasis-opendocument-presentation { background-position:4px -385px; }
+/* archives */
+tr.x-tar   p,
+tr.x-gzip  p,
+tr.x-bzip  p,
+tr.x-bzip2 p,
+tr.zip     p,
+tr.x-rar   p,
+tr.x-rar-compressed p,
+tr.x-7z-compressed  p { background-position:4px -305px; }
+
+tr.el-finder-droppable td.icon  p { background-position:5px -450px; }
+
+.el-finder-cwd table td p em {
+	float:left;
+	width:10px;
+	height:12px;
+	margin-top:5px;
+	background:url(../images/icons-small.png) 0px -405px no-repeat;
+}
+
+.el-finder-cwd table p em.readonly { background-position:0px -433px; }
+.el-finder-cwd table p em.dropbox  { background-position:0px -418px; }
+.el-finder-cwd table p em.noread, 
+.el-finder-cwd table p em.noaccess { background-position:0px -470px; }
+
+/************************************/
+/*              statusbar           */
+/************************************/
+
+.el-finder-statusbar {
+	height:20px;
+}
+
+.el-finder-stat,
+.el-finder-path,
+.el-finder-sel {
+	padding:3px 9px 1px 9px;
+	font-size:11px;
+	color:#555;
+}
+/* current directory path */
+.el-finder-path {
+	float:left;
+}
+/* number folders/files in current directory and size */
+.el-finder-stat {
+	float:right;
+}
+/* info about selected files */
+.el-finder-sel {
+	text-align:center;
+}
+
+/************************************/
+/*           dialog window          */
+/************************************/
+.el-finder-dialog {
+	font-size:.84em;
+}
+.el-finder-dialog form p, .el-finder-dialog .ui-tabs p {
+	margin:.5em;
+}
+.el-finder-dialog .ui-dialog-titlebar { 
+	padding: .2em .1em .1em .8em; 
+}
+.el-finder-dialog .ui-dialog-buttonpane {
+	padding: .1em 1em .1em .4em; 
+	font-size:.9em;
+}
+.el-finder-dialog .ui-dialog-content {
+	padding:5px;
+}
+
+.el-finder-dialog hr {
+	border:0;
+	border-bottom: 1px #ccc solid;
+	clear:both
+}
+.el-finder-dialog ul {
+	margin-top:0;
+}
+
+.el-finder-dialog kbd { font-size:1.2em;}
+.el-finder-dialog a { outline: none;}
+
+.el-finder-dialog textarea { 
+	width:100%; 
+	height:400px; 
+	outline:none; 
+	border:1px solid #ccc;
+	font-family: "Monaco", "Andale Mono", "Lucida Console", monospace;
+}
+
+.ui-state-error {
+	margin: 5px 0; 
+	padding:.5em;
+	clear:both;
+}
+
+.el-finder-dialog .ui-state-error .ui-icon {
+	float: left; 
+	margin-right: .3em;
+}
+
+.el-finder-add-field {
+	cursor:pointer;
+}
+
+.el-finder-add-field span {
+	float:left;
+	margin-right:.7em;
+}
+
+.el-finder-dialog table {
+	width : 100%;
+}
+
+.el-finder-dialog table td {
+	padding:2px 5px;
+
+}
+
+.el-finder-dialog .ui-tabs { 
+	font-size:.98em;
+}
+
+.el-finder-dialog .ui-tabs div {
+	padding:0 .5em;
+}
+.el-finder-dialog .ui-tabs-nav li a {
+	padding:.2em 1em;
+}
+
+/************************************/
+/*            contextmenu           */
+/************************************/
+
+.el-finder-contextmenu { 
+	position:absolute;
+	width:200px;
+	background:#fff; 
+	color:#000;
+	cursor:default; 
+	border:1px solid #ccc;  
+	border-radius:5px; 
+	-moz-border-radius:5px; 
+	-webkit-border-radius:5px;
+	padding:5px 0;
+	
+}
+
+.el-finder-contextmenu div { 
+	position:relative;
+	display:block;
+	margin:0;
+	padding:4px 29px 4px 29px;
+	white-space:nowrap;
+	font:12px trebuchet ms,lucida grande,verdana,sans-serif;
+	background:url('../images/toolbar.png') 0 0 no-repeat;
+}
+
+.el-finder-contextmenu  span {
+	float:right;
+	width:9px;
+	height:18px;
+	margin-right:-27px;
+	background:url(../images/toolbar.png) -4px 5px no-repeat;
+}
+
+.el-finder-contextmenu  div.el-finder-contextmenu-sub {
+	position:absolute;
+	top:0;
+	display:none;
+	margin:0;
+	padding:5px 0;
+	background:#fff; 
+	border:1px solid #ccc;  
+	border-radius:5px; 
+	-moz-border-radius:5px; 
+	-webkit-border-radius:5px;
+}
+
+
+.el-finder-contextmenu div.reload     { background-position: 5px -192px; }
+.el-finder-contextmenu div.select     { background-position: 5px -214px; }
+.el-finder-contextmenu div.open       { background-position: 6px -235px; }
+.el-finder-contextmenu div.mkdir      { background-position: 6px -258px; }
+.el-finder-contextmenu div.mkfile     { background-position: 6px -280px; }
+.el-finder-contextmenu div.upload     { background-position: 5px -305px; }
+.el-finder-contextmenu div.rm         { background-position: 5px -330px; }
+.el-finder-contextmenu div.copy       { background-position: 5px -356px; }
+.el-finder-contextmenu div.cut        { background-position: 5px -631px; }
+.el-finder-contextmenu div.duplicate  { background-position: 5px -356px; }
+.el-finder-contextmenu div.paste      { background-position: 5px -381px; }
+.el-finder-contextmenu div.rename     { background-position: 5px -407px; }
+.el-finder-contextmenu div.edit       { background-position: 6px -435px; }
+.el-finder-contextmenu div.info       { background-position: 5px -462px; }
+.el-finder-contextmenu div.help       { background-position: 5px -487px; }
+.el-finder-contextmenu div.icons      { background-position: 5px -537px; }
+.el-finder-contextmenu div.list       { background-position: 5px -557px; }
+.el-finder-contextmenu div.archive    { background-position: 5px -583px; }
+.el-finder-contextmenu div.extract    { background-position: 5px -583px; }
+.el-finder-contextmenu div.resize     { background-position: 5px -655px; }
+.el-finder-contextmenu div.quicklook  { background-position: 5px -727px; }
+
+.el-finder-contextmenu div.delim { 
+	margin:0; 
+	padding:0; 
+	height:1px; 
+	border-top:1px solid #eee; 
+	background:transparent; 
+	display:block;
+}
+.el-finder-contextmenu div.hover { background-color:#99ccff; }
+
+.el-finder-places {
+	margin-top:.5em;
+}
+
+
+.el-finder-drag-helper {
+	padding:0;
+	cursor:move;
+	zoom:1;
+}
+
+.el-finder-drag-helper div {
+	border:0 solid;
+	margin-left:-57px;
+	
+}
+
+.el-finder-drag-copy {
+	background:url('../images/toolbar.png') 0 -771px no-repeat;
+}
+
+.el-finder-drag-helper label { 
+	border:1px solid #ccc; 
+	background-color:#eee;
+	border-radius:5px; 
+	-moz-border-radius:5px; 
+	-webkit-border-radius:5px;
+}
+
+
+/************************************/
+/*             QuickLook            */
+/************************************/
+
+.el-finder-ql {
+	position:absolute;
+	width:420px;
+	height:auto;
+	padding:12px 9px;
+	text-align:center;
+	border-radius:9px; 
+	-moz-border-radius:9px; 
+	-webkit-border-radius:9px;
+	background:url(../images/ql.png);
+	overflow: inherit !important;
+}
+
+/* toolbar */
+.el-finder-ql div.el-finder-ql-drag-handle {
+	height:18px;
+	font-size:14px;
+	background-color:#777;
+	margin:-12px -9px 12px -9px;
+	padding:3px 0 0 19px;
+	opacity:.8;
+	text-align:center;
+	white-space: nowrap;
+	overflow:hidden;
+	-moz-border-radius-topleft:9px; 
+	-moz-border-radius-topright:9px; 
+	-webkit-border-top-left-radius: 9px;
+	-webkit-border-top-right-radius: 9px; 
+	border-top-left-radius: 9px; 
+	border-top-right-radius: 9px;
+}
+/* close button */
+.el-finder-ql div.el-finder-ql-drag-handle span {
+	float:left;
+	margin:0 19px 0 -15px;
+}
+/* title in tolbar */
+.el-finder-ql div.el-finder-ql-drag-handle strong {
+	line-height:18px;
+	margin-left:-17px;
+	color:#fff;
+}
+
+.el-finder-ql div.el-finder-ql-media {
+	width:100%;
+	padding:0;
+}
+
+.el-finder-ql div.el-finder-ql-content {
+	width:100%;
+	font:.82em/1.3em trebuchet ms,lucida grande,verdana,sans-serif;
+	padding:5px 0;
+	overflow:hidden;
+}
+
+.el-finder-ql div.el-finder-ql-content span,
+.el-finder-ql div.el-finder-ql-content a {
+	display:block;
+	color: #fff;
+}
+
+/* text files preview */
+.el-finder-ql iframe {
+	background:#fff;
+	width:100%;
+	height:315px;
+	padding:0;
+	margin:0;
+	border:none;
+	outline:none;
+}
+
+
+/* images preview */
+.el-finder-ql img {
+	margin:0 auto;
+	border:1px solid #fff;
+}
+
+/* button help */
+.el-finder-help-std {
+	background: url(../images/icons-big.png) 0 -1380px no-repeat;
+	width:48px;
+	height:48px;
+	float:right;
+}
+
+.el-finder-logo {
+	background: url(../images/icons-big.png) 0 -1329px no-repeat;
+	width:48px;
+	height:48px;
+	float:left;
+}

tw2/jqplugins/elfinder/static/jquery/plugins/elfinder/trunk/images/icons-big.png

Added
New image

tw2/jqplugins/elfinder/static/jquery/plugins/elfinder/trunk/images/icons-big.psd

Added
New image

tw2/jqplugins/elfinder/static/jquery/plugins/elfinder/trunk/images/icons-small.png

Added
New image

tw2/jqplugins/elfinder/static/jquery/plugins/elfinder/trunk/images/ql.png

Added
New image

tw2/jqplugins/elfinder/static/jquery/plugins/elfinder/trunk/images/spinner.gif

Added
New image

tw2/jqplugins/elfinder/static/jquery/plugins/elfinder/trunk/images/toolbar.png

Added
New image

tw2/jqplugins/elfinder/static/jquery/plugins/elfinder/trunk/js/elfinder.full.js

+(function($) {
+
+	/**
+	 * @class  File manager (main controller)
+	 * @author dio dio@std42.ru
+	 **/
+	elFinder = function(el, o) {
+		var self = this, id;
+		
+		this.log = function(m) {
+			window.console && window.console.log && window.console.log(m);
+		}
+		/**
+		 * Object. File manager configuration
+		 **/
+		this.options = $.extend({}, this.options, o||{});
+		
+		if (!this.options.url) {
+			alert('Invalid configuration! You have to set URL option.');
+			return;
+		}
+		
+		/**
+		 * String. element id, create random if not set;
+		 **/
+		this.id = '';
+		if ((id = $(el).attr('id'))) {
+			this.id = id;
+		} else {
+			// this.id = 'el-finder-'+Math.random().toString().substring(2);
+		}
+		
+		/**
+		 * String. Version number;
+		 **/
+		this.version  = '1.1 RC3';
+		/**
+		 * String. jQuery version;
+		 **/
+		this.jquery = $.fn.jquery.split('.').join('');
+
+		/**
+		 * Object. Current Working Dir info
+		 **/
+		this.cwd      = {};
+		/**
+		 * Object. Current Dir Content. Files/folders info
+		 **/
+		this.cdc      = {};
+		/**
+		 * Object. Buffer for copied files
+		 **/
+		this.buffer   = {};
+		/**
+		 * Array. Selected files IDs
+		 **/
+		this.selected = [];
+		/**
+		 * Array. Folder navigation history
+		 **/
+		this.history  = [];
+		/**
+		 * Boolean. Enable/disable actions
+		 **/
+		this.locked   = false;
+		/**
+		 * Number. Max z-index on page + 1, need for contextmenu and quicklook
+		 **/
+		this.zIndex = 2;
+		/**
+		 * DOMElement. jQueryUI dialog
+		 **/
+		this.dialog = null;
+		/**
+		 * DOMElement. For docked mode - place where fm is docked
+		 **/
+		this.anchor = this.options.docked ? $('<div/>').hide().insertBefore(el) : null;
+		/**
+		 * Object. Some options get from server
+		 **/
+		this.params = { dotFiles : false, arc : '', uplMaxSize : '' };
+		this.vCookie = 'el-finder-view-'+this.id;
+		this.pCookie = 'el-finder-places-'+this.id;
+		this.lCookie = 'el-finder-last-'+this.id;
+		/**
+		 * Object. View. After init we can accessel as this.view.win
+		 **/
+		this.view = new this.view(this, el);
+		/**
+		 * Object. User Iterface. Controller for commands/buttons/contextmenu
+		 **/
+		this.ui = new this.ui(this);
+		/**
+		 * Object. Set/update events
+		 **/
+		this.eventsManager = new this.eventsManager(this);
+		/**
+		 * Object. Quick Look like in MacOS X :)
+		 **/
+		this.quickLook = new this.quickLook(this);
+
+		/**
+		 * Set/get cookie value
+		 *
+		 * @param  String  name  cookie name
+		 * @param  String  value cookie value, null to unset
+		 **/
+		this.cookie = function(name, value) {
+			if (typeof value == 'undefined') {
+				if (document.cookie && document.cookie != '') {
+					var i, c = document.cookie.split(';');
+					name += '=';
+					for (i=0; i<c.length; i++) {
+						c[i] = $.trim(c[i]);
+						if (c[i].substring(0, name.length) == name) {
+							return decodeURIComponent(c[i].substring(name.length));
+						}
+					}
+				}
+				return '';
+			} else {
+				var d, o = $.extend({}, this.options.cookie);
+				if (value===null) {
+					value = '';
+					o.expires = -1;
+				}
+				if (typeof(o.expires) == 'number') {
+					d = new Date();
+					d.setTime(d.getTime()+(o.expires * 24 * 60 * 60 * 1000));
+					o.expires = d;
+				}
+				document.cookie = name+'='+encodeURIComponent(value)+'; expires='+o.expires.toUTCString()+(o.path ? '; path='+o.path : '')+(o.domain ? '; domain='+o.domain : '')+(o.secure ? '; secure' : '');
+			}
+		}
+
+		/**
+		 * Set/unset this.locked flag
+		 *
+		 * @param  Boolean  state
+		 **/
+		this.lock = function(l) {
+			this.view.spinner((this.locked = l||false));
+			this.eventsManager.lock = this.locked;
+		}
+
+		/**
+		 * Set/unset lock for keyboard shortcuts
+		 *
+		 * @param  Boolean  state
+		 **/
+		this.lockShortcuts = function(l) {
+			this.eventsManager.lock = !!l;
+		}
+		
+		/**
+		 * Set file manager view type (list|icons)
+		 *
+		 * @param  String  v  view name
+		 **/
+		this.setView = function(v) {
+			if (v == 'list' || v == 'icons') {
+				this.options.view = v;
+				this.cookie(this.vCookie, v);
+			}
+		}
+		
+		/**
+		 * make ajax request, show message on error, call callback on success
+		 *
+		 * @param  Object.  data for ajax request
+		 * @param  Function  
+		 * @param  Object   overrwrite some options 
+		 */
+		this.ajax = function(data, callback, options) {
+
+			var opts = {
+				url      : this.options.url,
+				async    : true,
+				type     : 'GET',
+				data     : data,
+				dataType : 'json',
+				cache    : false,
+				lock     : true,
+				force    : false,
+				silent   : false
+			}
+			if (typeof(options) == 'object') {
+				opts = $.extend({}, opts, options);
+			}
+			if (!opts.silent) {
+				opts.error = self.view.fatal;
+			}
+			opts.success = function(data) {
+				opts.lock && self.lock();
+				if (data) {
+					data.debug && self.log(data.debug);
+					if (data.error) {
+						!opts.silent && self.view.error(data.error, data.errorData);
+						if (!opts.force) {
+							return;
+						}
+					}
+					callback(data);
+
+					delete data;
+				}
+				
+			}
+			opts.lock && this.lock(true);
+			$.ajax(opts);
+		}
+		
+		/**
+		 * Load generated thumbnails in background
+		 *
+		 **/
+		this.tmb = function() {
+			this.ajax({cmd : 'tmb', current : self.cwd.hash}, function(data) {
+				if (self.options.view == 'icons' && data.images && data.current == self.cwd.hash) {
+					for (var i in data.images) {
+						if (self.cdc[i]) {
+							self.cdc[i].tmb = data.images[i];
+							$('div[key="'+i+'"]>p', self.view.cwd).css('background', ' url("'+data.images[i]+'") 0 0 no-repeat');
+						}
+						
+					}
+					data.tmb && self.tmb();
+				}
+			}, {lock : false, silent : true});
+		}
+		
+		/**
+		 * Return folders in places IDs
+		 *
+		 * @return Array
+		 **/
+		this.getPlaces = function() {
+			var pl = [], p = this.cookie(this.pCookie);
+			if (p.length) {
+				if (p.indexOf(':')!=-1) {
+					pl = p.split(':');
+				} else {
+					pl.push(p);
+				}
+			}
+			return pl;
+		}
+		
+		/**
+		 * Add new folder to places
+		 *
+		 * @param  String  Folder ID
+		 * @return Boolean
+		 **/
+		this.addPlace = function(id) {
+			var p = this.getPlaces();
+			if ($.inArray(id, p) == -1) {
+				p.push(id);
+				this.savePlaces(p);
+				return true;
+			}
+		}
+		
+		/**
+		 * Remove folder from places
+		 *
+		 * @param  String  Folder ID
+		 * @return Boolean
+		 **/
+		this.removePlace = function(id) {
+			var p = this.getPlaces();
+			if ($.inArray(id, p) != -1) {
+				this.savePlaces($.map(p, function(o) { return o == id?null:o; }));
+				return true;
+			}
+		}
+		
+		/**
+		 * Save new places data in cookie
+		 *
+		 * @param  Array  Folders IDs
+		 **/
+		this.savePlaces = function(p) {
+			this.cookie(this.pCookie, p.join(':'));
+		}
+		
+		/**
+		 * Update file manager content
+		 *
+		 * @param  Object  Data from server
+		 **/
+		this.reload = function(data) {
+			var i;
+			this.cwd = data.cwd;
+			
+			this.cdc = {};
+			for (i=0; i<data.cdc.length ; i++) {
+				if (data.cdc[i].hash && data.cdc[i].name) {
+					this.cdc[data.cdc[i].hash] = data.cdc[i];
+					this.cwd.size += data.cdc[i].size;
+				}
+			}
+
+			if (data.tree) {
+				this.view.renderNav(data.tree);
+				this.eventsManager.updateNav();
+			}
+
+			this.updateCwd();
+			
+			/* tell connector to generate thumbnails */
+			if (data.tmb && !self.locked && self.options.view == 'icons') {
+				self.tmb();
+			}
+			/* have to select some files */
+			if (data.select && data.select.length) {
+				var l = data.select.length;
+				while (l--) {
+					this.cdc[data.select[l]] && this.selectById(data.select[l]);
+				}
+			}
+			this.lastDir(this.cwd.hash);
+			if (this.options.autoReload>0) {
+				this.iID && clearInterval(this.iID);
+				this.iID = setInterval(function() {	!self.locked && self.ui.exec('reload'); }, this.options.autoReload*60000);
+			}
+		}
+		
+		/**
+		 * Redraw current directory
+		 *
+		 */
+		this.updateCwd = function() {
+			this.lockShortcuts(true);
+			this.selected = [];
+			this.view.renderCwd();
+			this.eventsManager.updateCwd();
+			this.view.tree.find('a[key="'+this.cwd.hash+'"]').trigger('select');
+			this.lockShortcuts();
+		}
+		
+		/**
+		 * Execute after files was dropped onto folder
+		 *
+		 * @param  Object  drop event
+		 * @param  Object  drag helper object
+		 * @param  String  target folder ID
+		 */
+		this.drop = function(e, ui, target) {
+			if (ui.helper.find('[key="'+target+'"]').length) {
+				return self.view.error('Unable to copy into itself');
+			}
+			var ids = [];
+			ui.helper.find('div:not(.noaccess):has(>label):not(:has(em[class="readonly"],em[class=""]))').each(function() {
+				ids.push($(this).hide().attr('key'));
+			});
+		
+			if (!ui.helper.find('div:has(>label):visible').length) {
+				ui.helper.hide();
+			}
+			if (ids.length) {
+				self.setBuffer(ids, e.shiftKey?0:1, target);
+				if (self.buffer.files) {
+					/* some strange jquery ui bug (in list view) */
+					setTimeout(function() {self.ui.exec('paste'); self.buffer = {}}, 300);
+				}
+			} else {
+				$(this).removeClass('el-finder-droppable');
+			}
+		}
+		
+		/**
+		 * Return selected files data
+		 *
+		 * @param  Number  if set, returns only element with this index or empty object 
+		 * @return Array|Object
+		 */
+		this.getSelected = function(ndx) {
+			var i, s = [];
+			if (ndx>=0) {
+				return this.cdc[this.selected[ndx]]||{};
+			}
+			for (i=0; i<this.selected.length; i++) {
+				this.cdc[this.selected[i]] && s.push(this.cdc[this.selected[i]]);
+			}
+			return s;
+		}
+		
+		this.select = function(el, reset) {
+			reset && $('.ui-selected', self.view.cwd).removeClass('ui-selected');
+			el.addClass('ui-selected');
+			self.updateSelect();
+		}
+
+		this.selectById = function(id) {
+			var el = $('[key="'+id+'"]', this.view.cwd);
+			if (el.length) {
+				this.select(el);
+				this.checkSelectedPos();
+			}
+		}
+
+		this.unselect = function(el) {
+			el.removeClass('ui-selected');
+			self.updateSelect();
+		}
+
+		this.toggleSelect = function(el) {
+			el.toggleClass('ui-selected');
+			this.updateSelect();
+		}
+
+		this.selectAll = function() {
+			$('[key]', self.view.cwd).addClass('ui-selected')
+			self.updateSelect();
+		}
+
+		this.unselectAll = function() {
+			$('.ui-selected', self.view.cwd).removeClass('ui-selected');
+			self.updateSelect();
+		}
+
+		this.updateSelect = function() {
+			self.selected = [];
+			$('.ui-selected', self.view.cwd).each(function() {
+				self.selected.push($(this).attr('key'));
+			});
+			self.view.selectedInfo();
+			self.ui.update();
+			self.quickLook.update();
+		}
+
+		/**
+		 * Scroll selected element in visible position
+		 *
+		 * @param  Boolean  check last or first selected element?
+		 */
+		this.checkSelectedPos = function(last) {
+			var s = self.view.cwd.find('.ui-selected:'+(last ? 'last' : 'first')).eq(0),
+				p = s.position(),
+				h = s.outerHeight(),
+				ph = self.view.cwd.height();
+			if (p.top < 0) {
+				self.view.cwd.scrollTop(p.top+self.view.cwd.scrollTop()-2);
+			} else if (ph - p.top < h) {
+				self.view.cwd.scrollTop(p.top+h-ph+self.view.cwd.scrollTop());
+			}
+		}
+
+		/**
+		 * Add files to clipboard buffer
+		 *
+		 * @param  Array   files IDs
+		 * @param  Boolean copy or cut files?
+		 * @param  String  destination folder ID
+		 */
+		this.setBuffer = function(files, cut, dst) {
+			var i, id, f;
+			this.buffer = {
+				src   : this.cwd.hash,
+				dst   : dst,
+				files : [],
+				names : [],
+				cut   : cut||0
+			};
+			
+			for (i=0; i<files.length; i++) {
+				id = files[i]; 
+				f = this.cdc[id];
+				if (f && f.read && f.type != 'link') {
+					this.buffer.files.push(f.hash);
+					this.buffer.names.push(f.name);
+				}
+			}
+			
+			if (!this.buffer.files.length) {
+				this.buffer = {};
+			}
+		}
+		
+		/**
+		 * Return true if file name is acceptable
+		 *
+		 * @param  String  file/folder name
+		 * @return Boolean
+		 */
+		this.isValidName = function(n) {
+			if (!this.cwd.dotFiles && n.indexOf('.') == 0) {
+				return false;
+			}
+			return n.match(/^[^\\\/\<\>:]+$/);
+		}
+		
+		/**
+		 * Return true if file with this name exists
+		 *
+		 * @param  String  file/folder name
+		 * @return Boolean
+		 */
+		this.fileExists = function(n) {
+			for (var i in this.cdc) {
+				if (this.cdc[i].name == n) {
+					return i;
+				}
+			}
+			return false;
+		}
+		
+		/**
+		 * Return name for new file/folder
+		 *
+		 * @param  String  base name (i18n)
+		 * @param  String  extension for file
+		 * @return String
+		 */
+		this.uniqueName = function(n, ext) {
+			n = self.i18n(n);
+			var name = n, i = 0, ext = ext||'';
+
+			if (!this.fileExists(name+ext)) {
+				return name+ext;
+			}
+
+			while (i++<100) {
+				if (!this.fileExists(name+i+ext)) {
+					return name+i+ext;
+				}
+			}
+			return name.replace('100', '')+Math.random()+ext;
+		}
+
+		/**
+		 * Get/set last opened dir
+		 *
+		 * @param  String  dir hash
+		 * @return String
+		 */
+		this.lastDir = function(dir) {
+			if (this.options.rememberLastDir) {
+				return dir ? this.cookie(this.lCookie, dir) : this.cookie(this.lCookie);
+			}
+		}
+
+		/**
+		 * Resize file manager
+		 *
+		 * @param  Number  width
+		 * @param  Number  height
+		 */
+		function resize(w, h) {
+			w && self.view.win.width(w);
+			h && self.view.nav.add(self.view.cwd).height(h);
+		}
+		
+		/**
+		 * Resize file manager in dialog window while it resize
+		 *
+		 */
+		function dialogResize() {
+			resize(null, self.dialog.height()-self.view.tlb.parent().height()-($.browser.msie ? 47 : 32))
+		}
+
+		this.time = function() {
+			return new Date().getMilliseconds();
+		}
+
+		/* here we init file manager */
+		
+		this.setView(this.cookie(this.vCookie));
+		resize(self.options.width, self.options.height);
+		
+		/* dialog or docked mode */
+		if (this.options.dialog || this.options.docked) {
+			this.options.dialog = $.extend({width : 570, dialogClass : '', minWidth : 480, minHeight: 330}, this.options.dialog || {});
+			this.options.dialog.dialogClass += 'el-finder-dialog';
+			this.options.dialog.resize = dialogResize;
+			if (this.options.docked) {
+				/* docked mode - create dialog and store size */
+				this.options.dialog.close = function() { self.dock(); };
+				this.view.win.data('size', {width : this.view.win.width(), height : this.view.nav.height()});
+			} else {
+				this.options.dialog.close = function() { 
+					self.destroy();
+				}
+				this.dialog = $('<div/>').append(this.view.win).dialog(this.options.dialog);
+			}
+		}
+
+		this.ajax({ 
+			cmd    : 'open', 
+			target : this.lastDir()||'', 
+			init   : true, 
+			tree   : true 
+			}, 
+			function(data) {
+				if (data.cwd) {
+					self.eventsManager.init();
+					self.reload(data);
+					$.extend(self.params, data.params||{});
+
+					$('*', document.body).each(function() {
+						var z = parseInt($(this).css('z-index'));
+						if (z >= self.zIndex) {
+							self.zIndex = z+1;
+						}
+					});
+					self.ui.init(data.disabled);
+				}
+				
+		}, {force : true});
+			
+		
+		this.open = function() {
+			this.dialog ? this.dialog.dialog('open') : this.view.win.show();
+			this.eventsManager.lock = false;
+		}
+		
+		this.close = function() {
+			this.quickLook.hide();
+			if (this.options.docked && this.view.win.attr('undocked')) {
+				this.dock();
+			} else {
+				this.dialog ? this.dialog.dialog('close') : this.view.win.hide();
+			}
+			this.eventsManager.lock = true;
+		}
+		
+		this.destroy = function() {
+
+			this.eventsManager.lock = true;
+			this.quickLook.hide();
+			if (this.dialog) {
+				this.dialog.dialog('destroy');
+				this.view.win.parent().remove();
+			} else {
+				this.view.win.remove();
+			}
+			this.ui.menu.remove();
+		}
+		
+		this.dock = function() {
+			if (this.options.docked && this.view.win.attr('undocked')) {
+				this.quickLook.hide();
+				var s =this.view.win.data('size');
+				this.view.win.insertAfter(this.anchor).removeAttr('undocked');
+				resize(s.width, s.height);
+				this.dialog.dialog('destroy');
+				this.dialog = null;
+			}
+		}
+		
+		this.undock = function() {
+			if (this.options.docked && !this.view.win.attr('undocked')) {
+				this.quickLook.hide();
+				this.dialog = $('<div/>').append(this.view.win.css('width', '100%').attr('undocked', true).show()).dialog(this.options.dialog);
+				dialogResize();
+			} 
+		}
+	}
+	
+	/**
+	 * Translate message into selected language
+	 *
+	 * @param  String  message in english
+	 * @param  String  translated or original message
+	 */
+	elFinder.prototype.i18n = function(m) {
+		return this.options.i18n[this.options.lang] && this.options.i18n[this.options.lang][m] ? this.options.i18n[this.options.lang][m] :  m;
+	}
+	
+	/**
+	 * Default config
+	 *
+	 */
+	elFinder.prototype.options = {
+		/* connector url. Required! */
+		url            : '',
+		/* interface language */
+		lang           : 'en',
+		/* additional css class for filemanager container */
+		cssClass       : '',
+		/* characters number to wrap file name in icons view. set to 0 to disable wrap */
+		wrap           : 14,
+		/* Name for places/favorites (i18n), set to '' to disable places */
+		places         : 'Places',
+		/* show places before navigation? */
+		placesFirst    : true,
+		/* callback to get file url (for wswing editors) */
+		editorCallback : null,
+		/* string to cut from file url begin before pass it to editorCallback. variants: '' - nothing to cut, 'root' - cut root url, 'http://...' - string if it exists in the beginig of url  */
+		cutURL         : '',
+		/* close elfinder after editorCallback */
+		closeOnEditorCallback : true,
+		/* i18 messages. not set manually! */
+		i18n           : {},
+		/* fm view (icons|list) */
+		view           : 'icons',
+		/* width to overwrite css options */
+		width          : '',
+		/* height to overwrite css options. Attenion! this is heigt of navigation/cwd panels! not total fm height */
+		height         : '',
+		/* disable shortcuts exclude arrows/space */
+		disableShortcuts : false,
+		/* open last visited dir after reload page or close and open browser */
+		rememberLastDir : true,
+		/* cookie options */
+		cookie         : {
+			expires : 30,
+			domain  : '',
+			path    : '/',
+			secure  : false
+		},
+		/* buttons on toolbar */
+		toolbar        : [
+			['back', 'reload'],
+			['select', 'open'],
+			['mkdir', 'mkfile', 'upload'],
+			['copy', 'paste', 'rm'],
+			['rename', 'edit'],
+			['info', 'quicklook'],
+			['icons', 'list'],
+			['help']
+		],
+		/* contextmenu commands */
+		contextmenu : {
+			'cwd'   : ['reload', 'delim', 'mkdir', 'mkfile', 'upload', 'delim', 'paste', 'delim', 'info'],
+			'file'  : ['select', 'open', 'quicklook', 'delim', 'copy', 'cut', 'rm', 'delim', 'duplicate', 'rename', 'edit', 'resize', 'archive', 'extract', 'delim', 'info'],
+			'group' : ['select', 'copy', 'cut', 'rm', 'delim', 'archive', 'extract', 'delim', 'info']
+		},
+		/* jqueryUI dialog options */
+		dialog : null,
+		/* docked mode */
+		docked : false,
+		/* auto reload time (min) */
+		autoReload : 0,
+		/* set to true if you need to select several files at once from editorCallback */
+		selectMultiple : false
+	}
+
+	
+	$.fn.elfinder = function(o) {
+		
+		return this.each(function() {
+			
+			var cmd = typeof(o) == 'string' ? o : '';
+			if (!this.elfinder) {
+				this.elfinder = new elFinder(this, typeof(o) == 'object' ? o : {})
+			}
+			
+			switch(cmd) {
+				case 'close':
+				case 'hide':
+					this.elfinder.close();
+					break;
+					
+				case 'open':
+				case 'show':
+					this.elfinder.open();
+					break;
+				
+				case 'dock':
+					this.elfinder.dock();
+					break;
+					
+				case 'undock':
+					this.elfinder.undock();
+					break;
+					
+				case'destroy':
+					this.elfinder.destroy();
+					break;
+			}
+			
+		})
+	}
+	
+})(jQuery);
+(function($) {
+elFinder.prototype.view = function(fm, el) {
+	var self = this;
+	this.fm = fm;
+	/**
+	 * Object. Mimetypes to kinds mapping
+	 **/
+	this.kinds = {
+		'unknown'                       : 'Unknown',
+		'directory'                     : 'Folder',
+		'symlink'                       : 'Alias',
+		'symlink-broken'                : 'Broken alias',
+		'application/x-empty'           : 'Plain text',
+		'application/postscript'        : 'Postscript document',
+		'application/octet-stream'      : 'Application',
+		'application/vnd.ms-office'     : 'Microsoft Office document',
+		'application/vnd.ms-word'       : 'Microsoft Word document',  
+	    'application/vnd.ms-excel'      : 'Microsoft Excel document',
+		'application/vnd.ms-powerpoint' : 'Microsoft Powerpoint presentation',
+		'application/pdf'               : 'Portable Document Format (PDF)',
+		'application/vnd.oasis.opendocument.text' : 'Open Office document',
+		'application/x-shockwave-flash' : 'Flash application',
+		'application/xml'               : 'XML document', 
+		'application/x-bittorrent'      : 'Bittorrent file',
+		'application/x-7z-compressed'   : '7z archive',
+		'application/x-tar'             : 'TAR archive', 
+	    'application/x-gzip'            : 'GZIP archive', 
+	    'application/x-bzip2'           : 'BZIP archive', 
+	    'application/zip'               : 'ZIP archive',  
+	    'application/x-rar'             : 'RAR archive',
+		'application/javascript'        : 'Javascript application',
+		'text/plain'                    : 'Plain text',
+	    'text/x-php'                    : 'PHP source',
+		'text/html'                     : 'HTML document', 
+		'text/javascript'               : 'Javascript source',
+		'text/css'                      : 'CSS style sheet',  
+	    'text/rtf'                      : 'Rich Text Format (RTF)',
+		'text/rtfd'                     : 'RTF with attachments (RTFD)',
+		'text/x-c'                      : 'C source', 
+		'text/x-c++'                    : 'C++ source', 
+		'text/x-shellscript'            : 'Unix shell script',
+	    'text/x-python'                 : 'Python source',
+		'text/x-java'                   : 'Java source',
+		'text/x-ruby'                   : 'Ruby source',
+		'text/x-perl'                   : 'Perl script',
+	    'text/xml'                      : 'XML document',