Index: pro-bachkim-filespace/sourcecode/assets/js/bootstrap/ace-elements.min.js
===================================================================
--- pro-bachkim-filespace/sourcecode/assets/js/bootstrap/ace-elements.min.js	(revision 42)
+++ pro-bachkim-filespace/sourcecode/assets/js/bootstrap/ace-elements.min.js	(revision 42)
@@ -0,0 +1,1 @@
+if(!("ace" in window)){window.ace={}}jQuery(function(){window.ace.click_event=$.fn.tap?"tap":"click"});(function(e,c){var d="multiple" in document.createElement("INPUT");var j="FileList" in window;var b="FileReader" in window;var f=function(l,m){var k=this;this.settings=e.extend({},e.fn.ace_file_input.defaults,m);this.$element=e(l);this.element=l;this.disabled=false;this.can_reset=true;this.$element.on("change.ace_inner_call",function(o,n){if(n===true){return}return a.call(k)});this.$element.wrap('<div class="ace-file-input" />');this.apply_settings()};f.error={FILE_LOAD_FAILED:1,IMAGE_LOAD_FAILED:2,THUMBNAIL_FAILED:3};f.prototype.apply_settings=function(){var l=this;var k=!!this.settings.icon_remove;this.multi=this.$element.attr("multiple")&&d;this.well_style=this.settings.style=="well";if(this.well_style){this.$element.parent().addClass("ace-file-multiple")}else{this.$element.parent().removeClass("ace-file-multiple")}this.$element.parent().find(":not(input[type=file])").remove();this.$element.after('<label class="file-label" data-title="'+this.settings.btn_choose+'"><span class="file-name" data-title="'+this.settings.no_file+'">'+(this.settings.no_icon?'<i class="'+this.settings.no_icon+'"></i>':"")+"</span></label>"+(k?'<a class="remove" href="#"><i class="'+this.settings.icon_remove+'"></i></a>':""));this.$label=this.$element.next();this.$label.on("click",function(){if(!this.disabled&&!l.element.disabled&&!l.$element.attr("readonly")){l.$element.click()}});if(k){this.$label.next("a").on(ace.click_event,function(){if(!l.can_reset){return false}var m=true;if(l.settings.before_remove){m=l.settings.before_remove.call(l.element)}if(!m){return false}return l.reset_input()})}if(this.settings.droppable&&j){g.call(this)}};f.prototype.show_file_list=function(k){var n=typeof k==="undefined"?this.$element.data("ace_input_files"):k;if(!n||n.length==0){return}if(this.well_style){this.$label.find(".file-name").remove();if(!this.settings.btn_change){this.$label.addClass("hide-placeholder")}}this.$label.attr("data-title",this.settings.btn_change).addClass("selected");for(var p=0;p<n.length;p++){var l=typeof n[p]==="string"?n[p]:e.trim(n[p].name);var q=l.lastIndexOf("\\")+1;if(q==0){q=l.lastIndexOf("/")+1}l=l.substr(q);var m="icon-file";if((/\.(jpe?g|png|gif|svg|bmp|tiff?)$/i).test(l)){m="icon-picture"}else{if((/\.(mpe?g|flv|mov|avi|swf|mp4|mkv|webm|wmv|3gp)$/i).test(l)){m="icon-film"}else{if((/\.(mp3|ogg|wav|wma|amr|aac)$/i).test(l)){m="icon-music"}}}if(!this.well_style){this.$label.find(".file-name").attr({"data-title":l}).find('[class*="icon-"]').attr("class",m)}else{this.$label.append('<span class="file-name" data-title="'+l+'"><i class="'+m+'"></i></span>');var r=e.trim(n[p].type);var o=b&&this.settings.thumbnail&&((r.length>0&&r.match("image"))||(r.length==0&&m=="icon-picture"));if(o){var s=this;e.when(i.call(this,n[p])).fail(function(t){if(s.settings.preview_error){s.settings.preview_error.call(s,l,t.code)}})}}}return true};f.prototype.reset_input=function(){this.$label.attr({"data-title":this.settings.btn_choose,"class":"file-label"}).find(".file-name:first").attr({"data-title":this.settings.no_file,"class":"file-name"}).find('[class*="icon-"]').attr("class",this.settings.no_icon).prev("img").remove();if(!this.settings.no_icon){this.$label.find('[class*="icon-"]').remove()}this.$label.find(".file-name").not(":first").remove();if(this.$element.data("ace_input_files")){this.$element.removeData("ace_input_files");this.$element.removeData("ace_input_method")}this.reset_input_field();return false};f.prototype.reset_input_field=function(){this.$element.wrap("<form>").closest("form").get(0).reset();this.$element.unwrap()};f.prototype.enable_reset=function(k){this.can_reset=k};f.prototype.disable=function(){this.disabled=true;this.$element.attr("disabled","disabled").addClass("disabled")};f.prototype.enable=function(){this.disabled=false;this.$element.removeAttr("disabled").removeClass("disabled")};f.prototype.files=function(){return e(this).data("ace_input_files")||null};f.prototype.method=function(){return e(this).data("ace_input_method")||""};f.prototype.update_settings=function(k){this.settings=e.extend({},this.settings,k);this.apply_settings()};var g=function(){var l=this;var k=this.element.parentNode;e(k).on("dragenter",function(m){m.preventDefault();m.stopPropagation()}).on("dragover",function(m){m.preventDefault();m.stopPropagation()}).on("drop",function(q){q.preventDefault();q.stopPropagation();var p=q.originalEvent.dataTransfer;var o=p.files;if(!l.multi&&o.length>1){var n=[];n.push(o[0]);o=n}var m=true;if(l.settings.before_change){m=l.settings.before_change.call(l.element,o,true)}if(!m||m.length==0){return false}if(m instanceof Array||(j&&m instanceof FileList)){o=m}l.$element.data("ace_input_files",o);l.$element.data("ace_input_method","drop");l.show_file_list(o);l.$element.triggerHandler("change",[true]);return true})};var a=function(){var l=true;if(this.settings.before_change){l=this.settings.before_change.call(this.element,this.element.files||[this.element.value],false)}if(!l||l.length==0){if(!this.$element.data("ace_input_files")){this.reset_input_field()}return false}var m=!j?null:((l instanceof Array||l instanceof FileList)?l:this.element.files);this.$element.data("ace_input_method","select");if(m&&m.length>0){this.$element.data("ace_input_files",m)}else{var k=e.trim(this.element.value);if(k&&k.length>0){m=[];m.push(k);this.$element.data("ace_input_files",m)}}if(!m||m.length==0){return false}this.show_file_list(m);return true};var i=function(o){var n=this;var l=n.$label.find(".file-name:last");var m=new e.Deferred;var k=new FileReader();k.onload=function(q){l.prepend("<img class='middle' style='display:none;' />");var p=l.find("img:last").get(0);e(p).one("load",function(){var t=50;if(n.settings.thumbnail=="large"){t=150}else{if(n.settings.thumbnail=="fit"){t=l.width()}}l.addClass(t>50?"large":"");var s=h(p,t,o.type);if(s==null){e(this).remove();m.reject({code:f.error.THUMBNAIL_FAILED});return}var r=s.w,u=s.h;if(n.settings.thumbnail=="small"){r=u=t}e(p).css({"background-image":"url("+s.src+")",width:r,height:u}).data("thumb",s.src).attr({src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg=="}).show();m.resolve()}).one("error",function(){l.find("img").remove();m.reject({code:f.error.IMAGE_LOAD_FAILED})});p.src=q.target.result};k.onerror=function(p){m.reject({code:f.error.FILE_LOAD_FAILED})};k.readAsDataURL(o);return m.promise()};var h=function(n,s,q){var r=n.width,o=n.height;if(r>s||o>s){if(r>o){o=parseInt(s/r*o);r=s}else{r=parseInt(s/o*r);o=s}}var m;try{var l=document.createElement("canvas");l.width=r;l.height=o;var k=l.getContext("2d");k.drawImage(n,0,0,n.width,n.height,0,0,r,o);m=l.toDataURL()}catch(p){m=null}if(!(/^data\:image\/(png|jpe?g|gif);base64,[0-9A-Za-z\+\/\=]+$/.test(m))){m=null}if(!m){return null}return{src:m,w:r,h:o}};e.fn.ace_file_input=function(m,n){var l;var k=this.each(function(){var q=e(this);var p=q.data("ace_file_input");var o=typeof m==="object"&&m;if(!p){q.data("ace_file_input",(p=new f(this,o)))}if(typeof m==="string"){l=p[m](n)}});return(l===c)?k:l};e.fn.ace_file_input.defaults={style:false,no_file:"No File ...",no_icon:"icon-upload-alt",btn_choose:"Choose",btn_change:"Change",icon_remove:"icon-remove",droppable:false,thumbnail:false,before_change:null,before_remove:null,preview_error:null}})(window.jQuery);(function(a,b){a.fn.ace_spinner=function(c){this.each(function(){var f=c.icon_up||"icon-chevron-up";var j=c.icon_down||"icon-chevron-down";var h=c.on_sides||false;var e=c.btn_up_class||"";var g=c.btn_down_class||"";var d=c.max||999;d=(""+d).length;a(this).addClass("spinner-input form-control").wrap('<div class="ace-spinner">');var k=a(this).closest(".ace-spinner").spinner(c).wrapInner("<div class='input-group'></div>");if(h){a(this).before('<div class="spinner-buttons input-group-btn">							<button type="button" class="btn spinner-down btn-xs '+g+'">								<i class="'+j+'"></i>							</button>						</div>').after('<div class="spinner-buttons input-group-btn">							<button type="button" class="btn spinner-up btn-xs '+e+'">								<i class="'+f+'"></i>							</button>						</div>');k.addClass("touch-spinner");k.css("width",(d*20+40)+"px")}else{a(this).after('<div class="spinner-buttons input-group-btn">							<button type="button" class="btn spinner-up btn-xs '+e+'">								<i class="'+f+'"></i>							</button>							<button type="button" class="btn spinner-down btn-xs '+g+'">								<i class="'+j+'"></i>							</button>						</div>');if("ontouchend" in document||c.touch_spinner){k.addClass("touch-spinner");k.css("width",(d*20+40)+"px")}else{a(this).next().addClass("btn-group-vertical");k.css("width",(d*20+10)+"px")}}a(this).on("mousewheel DOMMouseScroll",function(l){var m=l.originalEvent.detail<0||l.originalEvent.wheelDelta>0?1:-1;k.spinner("step",m>0);k.spinner("triggerChangedEvent");return false});var i=a(this);k.on("changed",function(){i.trigger("change")})});return this}})(window.jQuery);(function(a,b){a.fn.ace_wizard=function(c){this.each(function(){var e=a(this);e.wizard();var d=e.siblings(".wizard-actions").eq(0);var f=e.data("wizard");f.$prevBtn.remove();f.$nextBtn.remove();f.$prevBtn=d.find(".btn-prev").eq(0).on(ace.click_event,function(){e.wizard("previous")}).attr("disabled","disabled");f.$nextBtn=d.find(".btn-next").eq(0).on(ace.click_event,function(){e.wizard("next")}).removeAttr("disabled");f.nextText=f.$nextBtn.text()});return this}})(window.jQuery);(function(a,b){a.fn.ace_colorpicker=function(c){var d=a.extend({pull_right:false,caret:true},c);this.each(function(){var g=a(this);var e="";var f="";a(this).hide().find("option").each(function(){var h="colorpick-btn";if(this.selected){h+=" selected";f=this.value}e+='<li><a class="'+h+'" href="#" style="background-color:'+this.value+';" data-color="'+this.value+'"></a></li>'}).end().on("change.ace_inner_call",function(){a(this).next().find(".btn-colorpicker").css("background-color",this.value)}).after('<div class="dropdown dropdown-colorpicker"><a data-toggle="dropdown" class="dropdown-toggle" href="#"><span class="btn-colorpicker" style="background-color:'+f+'"></span></a><ul class="dropdown-menu'+(d.caret?" dropdown-caret":"")+(d.pull_right?" pull-right":"")+'">'+e+"</ul></div>").next().find(".dropdown-menu").on(ace.click_event,function(j){var h=a(j.target);if(!h.is(".colorpick-btn")){return false}h.closest("ul").find(".selected").removeClass("selected");h.addClass("selected");var i=h.data("color");g.val(i).change();j.preventDefault();return true})});return this}})(window.jQuery);(function(a,b){a.fn.ace_tree=function(d){var c={"open-icon":"icon-folder-open","close-icon":"icon-folder-close",selectable:true,"selected-icon":"icon-ok","unselected-icon":"tree-dot"};c=a.extend({},c,d);this.each(function(){var e=a(this);e.html('<div class = "tree-folder" style="display:none;">				<div class="tree-folder-header">					<i class="'+c["close-icon"]+'"></i>					<div class="tree-folder-name"></div>				</div>				<div class="tree-folder-content"></div>				<div class="tree-loader" style="display:none"></div>			</div>			<div class="tree-item" style="display:none;">				'+(c["unselected-icon"]==null?"":'<i class="'+c["unselected-icon"]+'"></i>')+'				<div class="tree-item-name"></div>			</div>');e.addClass(c.selectable==true?"tree-selectable":"tree-unselectable");e.tree(c)});return this}})(window.jQuery);(function(a,b){a.fn.ace_wysiwyg=function(c,h){var d=a.extend({speech_button:true,wysiwyg:{}},c);var e=["#ac725e","#d06b64","#f83a22","#fa573c","#ff7537","#ffad46","#42d692","#16a765","#7bd148","#b3dc6c","#fbe983","#fad165","#92e1c0","#9fe1e7","#9fc6e7","#4986e7","#9a9cff","#b99aff","#c2c2c2","#cabdbf","#cca6ac","#f691b2","#cd74e6","#a47ae2","#444444"];var g={font:{values:["Arial","Courier","Comic Sans MS","Helvetica","Open Sans","Tahoma","Verdana"],icon:"icon-font",title:"Font"},fontSize:{values:{5:"Huge",3:"Normal",1:"Small"},icon:"icon-text-height",title:"Font Size"},bold:{icon:"icon-bold",title:"Bold (Ctrl/Cmd+B)"},italic:{icon:"icon-italic",title:"Italic (Ctrl/Cmd+I)"},strikethrough:{icon:"icon-strikethrough",title:"Strikethrough"},underline:{icon:"icon-underline",title:"Underline"},insertunorderedlist:{icon:"icon-list-ul",title:"Bullet list"},insertorderedlist:{icon:"icon-list-ol",title:"Number list"},outdent:{icon:"icon-indent-left",title:"Reduce indent (Shift+Tab)"},indent:{icon:"icon-indent-right",title:"Indent (Tab)"},justifyleft:{icon:"icon-align-left",title:"Align Left (Ctrl/Cmd+L)"},justifycenter:{icon:"icon-align-center",title:"Center (Ctrl/Cmd+E)"},justifyright:{icon:"icon-align-right",title:"Align Right (Ctrl/Cmd+R)"},justifyfull:{icon:"icon-align-justify",title:"Justify (Ctrl/Cmd+J)"},createLink:{icon:"icon-link",title:"Hyperlink",button_text:"Add",placeholder:"URL",button_class:"btn-primary"},unlink:{icon:"icon-unlink",title:"Remove Hyperlink"},insertImage:{icon:"icon-picture",title:"Insert picture",button_text:'<i class="icon-file"></i> Choose Image &hellip;',placeholder:"Image URL",button_insert:"Insert",button_class:"btn-success",button_insert_class:"btn-primary",choose_file:true},foreColor:{values:e,title:"Change Color"},backColor:{values:e,title:"Change Background Color"},undo:{icon:"icon-undo",title:"Undo (Ctrl/Cmd+Z)"},redo:{icon:"icon-repeat",title:"Redo (Ctrl/Cmd+Y)"},viewSource:{icon:"icon-code",title:"View Source"}};var f=d.toolbar||["font",null,"fontSize",null,"bold","italic","strikethrough","underline",null,"insertunorderedlist","insertorderedlist","outdent","indent",null,"justifyleft","justifycenter","justifyright","justifyfull",null,"createLink","unlink",null,"insertImage",null,"foreColor",null,"undo","redo",null,"viewSource"];this.each(function(){var r=' <div class="wysiwyg-toolbar btn-toolbar center"> <div class="btn-group"> ';for(var n in f){if(f.hasOwnProperty(n)){var p=f[n];if(p===null){r+=' </div> <div class="btn-group"> ';continue}if(typeof p=="string"&&p in g){p=g[p];p.name=f[n]}else{if(typeof p=="object"&&p.name in g){p=a.extend(g[p.name],p)}else{continue}}var q="className" in p?p.className:"";switch(p.name){case"font":r+=' <a class="btn btn-sm '+q+' dropdown-toggle" data-toggle="dropdown" title="'+p.title+'"><i class="'+p.icon+'"></i><i class="icon-angle-down icon-on-right"></i></a> ';r+=' <ul class="dropdown-menu dropdown-light">';for(var j in p.values){if(p.values.hasOwnProperty(j)){r+=' <li><a data-edit="fontName '+p.values[j]+'" style="font-family:\''+p.values[j]+"'\">"+p.values[j]+"</a></li> "}}r+=" </ul>";break;case"fontSize":r+=' <a class="btn btn-sm '+q+' dropdown-toggle" data-toggle="dropdown" title="'+p.title+'"><i class="'+p.icon+'"></i>&nbsp;<i class="icon-angle-down icon-on-right"></i></a> ';r+=' <ul class="dropdown-menu dropdown-light"> ';for(var t in p.values){if(p.values.hasOwnProperty(t)){r+=' <li><a data-edit="fontSize '+t+'"><font size="'+t+'">'+p.values[t]+"</font></a></li> "}}r+=" </ul> ";break;case"createLink":r+=' <div class="inline position-relative"> <a class="btn btn-sm '+q+' dropdown-toggle" data-toggle="dropdown" title="'+p.title+'"><i class="'+p.icon+'"></i></a> ';r+=' <div class="dropdown-menu dropdown-caret pull-right">							<div class="input-group">								<input class="form-control" placeholder="'+p.placeholder+'" type="text" data-edit="'+p.name+'" />								<span class="input-group-btn">									<button class="btn btn-sm '+p.button_class+'" type="button">'+p.button_text+"</button>								</span>							</div>						</div> </div>";break;case"insertImage":r+=' <div class="inline position-relative"> <a class="btn btn-sm '+q+' dropdown-toggle" data-toggle="dropdown" title="'+p.title+'"><i class="'+p.icon+'"></i></a> ';r+=' <div class="dropdown-menu dropdown-caret pull-right">							<div class="input-group">								<input class="form-control" placeholder="'+p.placeholder+'" type="text" data-edit="'+p.name+'" />								<span class="input-group-btn">									<button class="btn btn-sm '+p.button_insert_class+'" type="button">'+p.button_insert+"</button>								</span>							</div>";if(p.choose_file&&"FileReader" in window){r+='<div class="space-2"></div>							 <div class="center">								<button class="btn btn-sm '+p.button_class+' wysiwyg-choose-file" type="button">'+p.button_text+'</button>								<input type="file" data-edit="'+p.name+'" />							  </div>'}r+=" </div> </div>";break;case"foreColor":case"backColor":r+=' <select class="hide wysiwyg_colorpicker" title="'+p.title+'"> ';for(var m in p.values){r+=' <option value="'+p.values[m]+'">'+p.values[m]+"</option> "}r+=" </select> ";r+=' <input style="display:none;" disabled class="hide" type="text" data-edit="'+p.name+'" /> ';break;case"viewSource":r+=' <a class="btn btn-sm '+q+'" data-view="source" title="'+p.title+'"><i class="'+p.icon+'"></i></a> ';break;default:r+=' <a class="btn btn-sm '+q+'" data-edit="'+p.name+'" title="'+p.title+'"><i class="'+p.icon+'"></i></a> ';break}}}r+=" </div> </div> ";if(d.toolbar_place){r=d.toolbar_place.call(this,r)}else{r=a(this).before(r).prev()}r.find("a[title]").tooltip({animation:false,container:"body"});r.find(".dropdown-menu input:not([type=file])").on(ace.click_event,function(){return false}).on("change",function(){a(this).closest(".dropdown-menu").siblings(".dropdown-toggle").dropdown("toggle")}).on("keydown",function(u){if(u.which==27){this.value="";a(this).change()}});r.find("input[type=file]").prev().on(ace.click_event,function(u){a(this).next().click()});r.find(".wysiwyg_colorpicker").each(function(){a(this).ace_colorpicker({pull_right:true}).change(function(){a(this).nextAll("input").eq(0).val(this.value).change()}).next().find(".btn-colorpicker").tooltip({title:this.title,animation:false,container:"body"})});var k;if(d.speech_button&&"onwebkitspeechchange" in (k=document.createElement("input"))){var i=a(this).offset();r.append(k);a(k).attr({type:"text","data-edit":"inserttext","x-webkit-speech":""}).addClass("wysiwyg-speech-input").css({position:"absolute"}).offset({top:i.top,left:i.left+a(this).innerWidth()-35})}else{k=null}var s=a(this);var l=false;r.find("a[data-view=source]").on("click",function(v){v.preventDefault();if(!l){a("<textarea />").css({width:s.outerWidth(),height:s.outerHeight()}).val(s.html()).insertAfter(s);s.hide();a(this).addClass("active")}else{var u=s.next();s.html(u.val()).show();u.remove();a(this).removeClass("active")}l=!l});var o=a.extend({},{activeToolbarClass:"active",toolbarSelector:r},d.wysiwyg||{});a(this).wysiwyg(o)});return this}})(window.jQuery);
Index: pro-bachkim-filespace/sourcecode/assets/js/filemanager/filemanager.js
===================================================================
--- pro-bachkim-filespace/sourcecode/assets/js/filemanager/filemanager.js	(revision 23)
+++ pro-bachkim-filespace/sourcecode/assets/js/filemanager/filemanager.js	(revision 42)
@@ -85,4 +85,10 @@
 			privateTree.deleteDir(curDir);
 		});
+		
+		$('#btnUpload').click (function() {
+			var curDir = privateTree.getCurrentDir();
+			privateTree.upload();
+		});
+		
 
 
Index: pro-bachkim-filespace/sourcecode/assets/js/jquery/jquery.uploadfile.min.js
===================================================================
--- pro-bachkim-filespace/sourcecode/assets/js/jquery/jquery.uploadfile.min.js	(revision 42)
+++ pro-bachkim-filespace/sourcecode/assets/js/jquery/jquery.uploadfile.min.js	(revision 42)
@@ -0,0 +1,8 @@
+/*!
+ * jQuery Upload File Plugin
+ * version: 3.1.8
+ * @requires jQuery v1.5 or later & form plugin
+ * Copyright (c) 2013 Ravishanker Kusuma
+ * http://hayageek.com/
+ */
+(function(e){if(e.fn.ajaxForm==undefined){e.getScript("http://malsup.github.io/jquery.form.js")}var t={};t.fileapi=e("<input type='file'/>").get(0).files!==undefined;t.formdata=window.FormData!==undefined;e.fn.uploadFile=function(n){function a(){if(r.afterUploadAll&&!u){u=true;(function e(){if(s.sCounter!=0&&s.sCounter+s.fCounter==s.tCounter){r.afterUploadAll(s);u=false}else window.setTimeout(e,100)})()}}function f(t,n,r){r.on("dragenter",function(t){t.stopPropagation();t.preventDefault();e(this).css("border","2px solid #A5A5C7")});r.on("dragover",function(e){e.stopPropagation();e.preventDefault()});r.on("drop",function(r){e(this).css("border","2px dotted #A5A5C7");r.preventDefault();t.errorLog.html("");var i=r.originalEvent.dataTransfer.files;if(!n.multiple&&i.length>1){if(n.showError)e("<div style='color:red;'>"+n.multiDragErrorStr+"</div>").appendTo(t.errorLog);return}if(n.onSelect(i)==false)return;h(n,t,i)});e(document).on("dragenter",function(e){e.stopPropagation();e.preventDefault()});e(document).on("dragover",function(e){e.stopPropagation();e.preventDefault();r.css("border","2px dotted #A5A5C7")});e(document).on("drop",function(e){e.stopPropagation();e.preventDefault();r.css("border","2px dotted #A5A5C7")})}function l(e){var t="";var n=e/1024;if(parseInt(n)>1024){var r=n/1024;t=r.toFixed(2)+" MB"}else{t=n.toFixed(2)+" KB"}return t}function c(t){var n=[];if(jQuery.type(t)=="string"){n=t.split("&")}else{n=e.param(t).split("&")}var r=n.length;var i=[];var s,o;for(s=0;s<r;s++){n[s]=n[s].replace(/\+/g," ");o=n[s].split("=");i.push([decodeURIComponent(o[0]),decodeURIComponent(o[1])])}return i}function h(t,n,r){for(var i=0;i<r.length;i++){if(!p(n,t,r[i].name)){if(t.showError)e("<div style='color:red;'><b>"+r[i].name+"</b> "+t.extErrorStr+t.allowedTypes+"</div>").appendTo(n.errorLog);continue}if(t.maxFileSize!=-1&&r[i].size>t.maxFileSize){if(t.showError)e("<div style='color:red;'><b>"+r[i].name+"</b> "+t.sizeErrorStr+l(t.maxFileSize)+"</div>").appendTo(n.errorLog);continue}if(t.maxFileCount!=-1&&n.selectedFiles>=t.maxFileCount){if(t.showError)e("<div style='color:red;'><b>"+r[i].name+"</b> "+t.maxFileCountErrorStr+t.maxFileCount+"</div>").appendTo(n.errorLog);continue}n.selectedFiles++;var s=t;var o=new FormData;var u=t.fileName.replace("[]","");o.append(u,r[i]);var a=t.formData;if(a){var f=c(a);for(var h=0;h<f.length;h++){if(f[h]){o.append(f[h][0],f[h][1])}}}s.fileData=o;var d=new g(n,t);var v="";if(t.showFileCounter)v=n.fileCounter+t.fileCounterStyle+r[i].name;else v=r[i].name;d.filename.html(v);var m=e("<form style='display:block; position:absolute;left: 150px;' class='"+n.formGroup+"' method='"+t.method+"' action='"+t.url+"' enctype='"+t.enctype+"'></form>");m.appendTo("body");var b=[];b.push(r[i].name);y(m,s,d,b,n,r[i]);n.fileCounter++}}function p(e,t,n){var r=t.allowedTypes.toLowerCase().split(",");var i=n.split(".").pop().toLowerCase();if(t.allowedTypes!="*"&&jQuery.inArray(i,r)<0){return false}return true}function d(e,t){if(e){t.show();var n=new FileReader;n.onload=function(e){t.attr("src",e.target.result)};n.readAsDataURL(e)}}function v(t,n){if(t.showFileCounter){var r=e(".ajax-file-upload-filename").length;n.fileCounter=r+1;e(".ajax-file-upload-filename").each(function(n,i){var s=e(this).html().split(t.fileCounterStyle);var o=parseInt(s[0])-1;var u=r+t.fileCounterStyle+s[1];e(this).html(u);r--})}}function m(n,r,i,s){var o="ajax-upload-id-"+(new Date).getTime();var u=e("<form method='"+i.method+"' action='"+i.url+"' enctype='"+i.enctype+"'></form>");var a="<input type='file' id='"+o+"' name='"+i.fileName+"' accept='"+i.acceptFiles+"'/>";if(i.multiple){if(i.fileName.indexOf("[]")!=i.fileName.length-2){i.fileName+="[]"}a="<input type='file' id='"+o+"' name='"+i.fileName+"' accept='"+i.acceptFiles+"' multiple/>"}var f=e(a).appendTo(u);f.change(function(){n.errorLog.html("");var o=i.allowedTypes.toLowerCase().split(",");var a=[];if(this.files){for(b=0;b<this.files.length;b++){a.push(this.files[b].name)}if(i.onSelect(this.files)==false)return}else{var f=e(this).val();var l=[];a.push(f);if(!p(n,i,f)){if(i.showError)e("<div style='color:red;'><b>"+f+"</b> "+i.extErrorStr+i.allowedTypes+"</div>").appendTo(n.errorLog);return}l.push({name:f,size:"NA"});if(i.onSelect(l)==false)return}v(i,n);s.unbind("click");u.hide();m(n,r,i,s);u.addClass(r);if(t.fileapi&&t.formdata){u.removeClass(r);var c=this.files;h(i,n,c)}else{var d="";for(var b=0;b<a.length;b++){if(i.showFileCounter)d+=n.fileCounter+i.fileCounterStyle+a[b]+"<br>";else d+=a[b]+"<br>";n.fileCounter++}if(i.maxFileCount!=-1&&n.selectedFiles+a.length>i.maxFileCount){if(i.showError)e("<div style='color:red;'><b>"+d+"</b> "+i.maxFileCountErrorStr+i.maxFileCount+"</div>").appendTo(n.errorLog);return}n.selectedFiles+=a.length;var w=new g(n,i);w.filename.html(d);y(u,i,w,a,n,null)}});if(i.nestedForms){u.css({margin:0,padding:0});s.css({position:"relative",overflow:"hidden",cursor:"default"});f.css({position:"absolute",cursor:"pointer",top:"0px",width:"100%",height:"100%",left:"0px","z-index":"100",opacity:"0.0",filter:"alpha(opacity=0)","-ms-filter":"alpha(opacity=0)","-khtml-opacity":"0.0","-moz-opacity":"0.0"});u.appendTo(s)}else{u.appendTo(e("body"));u.css({margin:0,padding:0,display:"block",position:"absolute",left:"-250px"});if(navigator.appVersion.indexOf("MSIE ")!=-1){s.attr("for",o)}else{s.click(function(){f.click()})}}}function g(t,n){this.statusbar=e("<div class='ajax-file-upload-statusbar'></div>").width(n.statusBarWidth);this.preview=e("<img class='ajax-file-upload-preview'></img>").width(n.previewWidth).height(n.previewHeight).appendTo(this.statusbar).hide();this.filename=e("<div class='ajax-file-upload-filename'></div>").appendTo(this.statusbar);this.progressDiv=e("<div class='ajax-file-upload-progress'>").appendTo(this.statusbar).hide();this.progressbar=e("<div class='ajax-file-upload-bar "+t.formGroup+"'></div>").appendTo(this.progressDiv);this.abort=e("<div class='ajax-file-upload-red ajax-file-upload-abort "+t.formGroup+"'>"+n.abortStr+"</div>").appendTo(this.statusbar).hide();this.cancel=e("<div class='ajax-file-upload-red ajax-file-upload-cancel "+t.formGroup+"'>"+n.cancelStr+"</div>").appendTo(this.statusbar).hide();this.done=e("<div class='ajax-file-upload-green'>"+n.doneStr+"</div>").appendTo(this.statusbar).hide();this.download=e("<div class='ajax-file-upload-green'>"+n.downloadStr+"</div>").appendTo(this.statusbar).hide();this.del=e("<div class='ajax-file-upload-red'>"+n.deletelStr+"</div>").appendTo(this.statusbar).hide();if(n.showQueueDiv)e("#"+n.showQueueDiv).append(this.statusbar);else t.errorLog.after(this.statusbar);return this}function y(n,r,i,s,o,u){var f=null;var l={cache:false,contentType:false,processData:false,forceSync:false,type:r.method,data:r.formData,formData:r.fileData,dataType:r.returnType,beforeSubmit:function(e,t,u){if(r.onSubmit.call(this,s)!=false){var f=r.dynamicFormData();if(f){var l=c(f);if(l){for(var h=0;h<l.length;h++){if(l[h]){if(r.fileData!=undefined)u.formData.append(l[h][0],l[h][1]);else u.data[l[h][0]]=l[h][1]}}}}o.tCounter+=s.length;a();return true}i.statusbar.append("<div style='color:red;'>"+r.uploadErrorStr+"</div>");i.cancel.show();n.remove();i.cancel.click(function(){i.statusbar.remove();r.onCancel.call(o,s,i);o.selectedFiles-=s.length;v(r,o)});return false},beforeSend:function(e,n){i.progressDiv.show();i.cancel.hide();i.done.hide();if(r.showAbort){i.abort.show();i.abort.click(function(){e.abort();o.selectedFiles-=s.length})}if(!t.formdata){i.progressbar.width("5%")}else i.progressbar.width("1%")},uploadProgress:function(e,t,n,s){if(s>98)s=98;var o=s+"%";if(s>1)i.progressbar.width(o);if(r.showProgress){i.progressbar.html(o);i.progressbar.css("text-align","center")}},success:function(t,u,a){if(r.returnType=="json"&&e.type(t)=="object"&&t.hasOwnProperty(r.customErrorKeyStr)){i.abort.hide();var f=t[r.customErrorKeyStr];r.onError.call(this,s,200,f,i);if(r.showStatusAfterError){i.progressDiv.hide();i.statusbar.append("<span style='color:red;'>ERROR: "+f+"</span>")}else{i.statusbar.hide();i.statusbar.remove()}o.selectedFiles-=s.length;n.remove();o.fCounter+=s.length;return}o.responses.push(t);i.progressbar.width("100%");if(r.showProgress){i.progressbar.html("100%");i.progressbar.css("text-align","center")}i.abort.hide();r.onSuccess.call(this,s,t,a,i);if(r.showStatusAfterSuccess){if(r.showDone){i.done.show();i.done.click(function(){i.statusbar.hide("slow");i.statusbar.remove()})}else{i.done.hide()}if(r.showDelete){i.del.show();i.del.click(function(){i.statusbar.hide().remove();if(r.deleteCallback)r.deleteCallback.call(this,t,i);o.selectedFiles-=s.length;v(r,o)})}else{i.del.hide()}}else{i.statusbar.hide("slow");i.statusbar.remove()}if(r.showDownload){i.download.show();i.download.click(function(){if(r.downloadCallback)r.downloadCallback(t)})}n.remove();o.sCounter+=s.length},error:function(e,t,u){i.abort.hide();if(e.statusText=="abort"){i.statusbar.hide("slow").remove();v(r,o)}else{r.onError.call(this,s,t,u,i);if(r.showStatusAfterError){i.progressDiv.hide();i.statusbar.append("<span style='color:red;'>ERROR: "+u+"</span>")}else{i.statusbar.hide();i.statusbar.remove()}o.selectedFiles-=s.length}n.remove();o.fCounter+=s.length}};if(r.showPreview&&u!=null){if(u.type.toLowerCase().split("/").shift()=="image")d(u,i.preview)}if(r.autoSubmit){n.ajaxSubmit(l)}else{if(r.showCancel){i.cancel.show();i.cancel.click(function(){n.remove();i.statusbar.remove();r.onCancel.call(o,s,i);o.selectedFiles-=s.length;v(r,o)})}n.ajaxForm(l)}}var r=e.extend({url:"",method:"POST",enctype:"multipart/form-data",formData:null,returnType:null,allowedTypes:"*",acceptFiles:"*",fileName:"file",formData:{},dynamicFormData:function(){return{}},maxFileSize:-1,maxFileCount:-1,multiple:true,dragDrop:true,autoSubmit:true,showCancel:true,showAbort:true,showDone:true,showDelete:false,showError:true,showStatusAfterSuccess:true,showStatusAfterError:true,showFileCounter:true,fileCounterStyle:"). ",showProgress:false,nestedForms:true,showDownload:false,onLoad:function(e){},onSelect:function(e){return true},onSubmit:function(e,t){},onSuccess:function(e,t,n,r){},onError:function(e,t,n,r){},onCancel:function(e,t){},downloadCallback:false,deleteCallback:false,afterUploadAll:false,uploadButtonClass:"ajax-file-upload",dragDropStr:"<span><b>KÃ©o & tháº£ cÃ¡c file vÃ o ÄÃ¢y!</b></span>",abortStr:"Abort",cancelStr:"Cancel",deletelStr:"Delete",doneStr:"Done",multiDragErrorStr:"Multiple File Drag & Drop is not allowed.",extErrorStr:"is not allowed. Allowed extensions: ",sizeErrorStr:"is not allowed. Allowed Max size: ",uploadErrorStr:"Táº£i lÃªn khÃŽng há»£p lá»",maxFileCountErrorStr:" khÃŽng há»£p lá». Sá» lÆ°á»£ng file tá»i Äa cho má»i láº§n táº£i lÃ :",downloadStr:"Download",customErrorKeyStr:"jquery-upload-file-error",showQueueDiv:false,statusBarWidth:500,dragdropWidth:500,showPreview:false,previewHeight:"auto",previewWidth:"100%"},n);this.fileCounter=1;this.selectedFiles=0;this.fCounter=0;this.sCounter=0;this.tCounter=0;var i="ajax-file-upload-"+(new Date).getTime();this.formGroup=i;this.hide();this.errorLog=e("<div></div>");this.after(this.errorLog);this.responses=[];if(!t.formdata){r.dragDrop=false}if(!t.formdata){r.multiple=false}var s=this;var o=e("<div>"+e(this).html()+"</div>");e(o).addClass(r.uploadButtonClass);(function b(){if(e.fn.ajaxForm){if(r.dragDrop){var t=e('<div class="ajax-upload-dragdrop" style="vertical-align:top;"></div>').width(r.dragdropWidth);e(s).before(t);e(t).append(o);e(t).append(e(r.dragDropStr));f(s,r,t)}else{e(s).before(o)}r.onLoad.call(this,s);m(s,i,r,o)}else window.setTimeout(b,10)})();this.startUpload=function(){e("."+this.formGroup).each(function(t,n){if(e(this).is("form"))e(this).submit()})};this.getFileCount=function(){return s.selectedFiles};this.stopUpload=function(){e(".ajax-file-upload-abort").each(function(t,n){if(e(this).hasClass(s.formGroup))e(this).click()})};this.cancelAll=function(){e(".ajax-file-upload-cancel").each(function(t,n){if(e(this).hasClass(s.formGroup))e(this).click()})};this.update=function(t){r=e.extend(r,t)};this.createProgress=function(e){var t=new g(this,r);t.progressDiv.show();t.progressbar.width("100%");t.filename.html(s.fileCounter+r.fileCounterStyle+e);s.fileCounter++;s.selectedFiles++;if(r.showDownload){t.download.show();t.download.click(function(){if(r.downloadCallback)r.downloadCallback.call(s,[e])})}t.del.show();t.del.click(function(){t.statusbar.hide().remove();var n=[e];if(r.deleteCallback)r.deleteCallback.call(this,n,t);s.selectedFiles-=1;v(r,s)})};this.getResponses=function(){return this.responses};var u=false;return this}})(jQuery)
Index: pro-bachkim-filespace/sourcecode/assets/js/vsgrid.js
===================================================================
--- pro-bachkim-filespace/sourcecode/assets/js/vsgrid.js	(revision 23)
+++ pro-bachkim-filespace/sourcecode/assets/js/vsgrid.js	(revision 42)
@@ -9,4 +9,5 @@
 			if( o.dirIDprefix == undefined ) o.dirIDprefix = null;
 			if( o.host == undefined ) o.host = 'http://localhost/';
+			if( o.tree == undefined ) o.tree = null;
 			
 			if( o.sharemodal == undefined ) o.sharemodal = $("#box-shareto");
@@ -48,4 +49,7 @@
 					itemClick(el);
 					switch(action) {
+						case 'newfolder':
+							openNewFolderModal(currentObj);
+							break;
 						case 'rename':
 							rename(el);
@@ -62,4 +66,50 @@
 					}
 					
+				});
+			}
+			
+			var openNewFolderModal = function (c) {
+				$('#box-newfolder').modal('show');
+				$('#frm-newfolder').find('#f-parentid').val(c.id);
+			}
+			
+			var bindCreateFolder = function () {
+				$('#box-newfolder').find('#frm-newfolder').unbind('submit');
+				$('#box-newfolder').find('#btn-submit-newfolder').unbind('click');
+				
+				$('#box-newfolder').find('#frm-newfolder').bind('submit', 
+					function(e){
+						if ($('#frm-newfolder').find('#f-newfoldername').val() == '') {
+							alert('ChÆ°a nháº­p tÃªn thÆ° má»¥c má»i!');
+						}else {
+							var postData = $('#box-newfolder').find('#frm-newfolder').serializeArray();
+							var script = 'ajax/privatecontent/createdir';
+							sendCommand({
+								script: script,
+								postdata:postData,
+								callbackSuccess: function (parsedData) {
+													createNode({
+														id: parsedData.id,
+														name: parsedData.name,
+														curentNode: currentObj,
+														hidden: false,
+														addToJSONData:true});
+													o.tree.createDir(parsedData);
+												}
+							});
+							
+							$('#box-newfolder').modal('hide');
+						}
+						
+						e.preventDefault();
+				});
+				
+				$('#box-newfolder').on('show.bs.modal', function () {
+					$('#box-newfolder').find('#frm-newfolder').get(0).reset();
+				});
+				
+				$('#box-newfolder').find('#btn-submit-newfolder').bind('click',
+					function (){
+						$('#box-newfolder').find('#frm-newfolder').submit();
 				});
 			}
@@ -153,4 +203,18 @@
 				currentObj.id = $(i).attr('rel').substring(3);
 				currentObj.type = $(i).find('>div>div').hasClass('icon-directory') ? 'directory':'file';
+				var item = searchItemByID(currentObj.id, currentObj.type);
+				currentObj.parentID = item.parentID;
+			}
+			
+			var searchItemByID = function (itemID, type) {
+				var source = (type == 'directory') ? o.directoryTreeData.DIRECTORIES : (type == 'file') ? o.directoryTreeData.FILES : null;
+				var item = null;
+				for (var i = 0 ; i < source.length; i++) {
+					if (source[i].id == itemID) {
+						item = source[i];
+						break;
+					}
+				}
+				return item;
 			}
 
@@ -182,4 +246,5 @@
 				
 				keyboardRename();
+				bindCreateFolder();
 			}
 			
@@ -252,18 +317,24 @@
 							p.callbackSuccess(parseData);
 						}
-
 					}).done(function() {if (p.callbackDone != null)p.callbackDone(this);}).fail(function() {if (p.callbackFail != null)p.callbackFail(this);}).always(function() {if (p.callbackAlways != null)p.callbackAlways(this);});
 				}
 			}
 
-			this.getData = function (data) {
+			this.setData = function (data) {
 				o.directoryTreeData = data.directoryTreeData;
 				o.curentParent = data.curentParent;
-				o.dirIDprefix = data.dirIDprefix
+				o.dirIDprefix = data.dirIDprefix;
 				renderGrid(o);
+			}
+			
+			this.setTree = function (treeObj) {
+				o.tree = treeObj;
 			}
 			
 			this.showModal = function (obj, act) {
 				switch( act ) {
+					case 'newfolder':
+						openNewFolderModal(obj);
+						break;
 					case 'copy':
 					case 'cut':
Index: pro-bachkim-filespace/sourcecode/assets/js/vstree.js
===================================================================
--- pro-bachkim-filespace/sourcecode/assets/js/vstree.js	(revision 23)
+++ pro-bachkim-filespace/sourcecode/assets/js/vstree.js	(revision 42)
@@ -15,4 +15,5 @@
 			if( o.expandEasing == undefined ) o.expandEasing = null;
 			if( o.collapseEasing == undefined ) o.collapseEasing = null;
+			if( o.me == undefined ) o.me = this;
 
 			if( o.directoryTreeData == undefined ) o.directoryTreeData = null;
@@ -107,4 +108,7 @@
 					newdir.id = d.id;
 					newdir.name = d.name;
+					
+					console.log(d.currentNode);
+					
 					newdir.parentID = $(o.container).find(d.currentNode).parent().attr('id').substring(o.dirIDprefix.length, $(d.currentNode).parent().attr('id').length);
 					o.directoryTreeData.DIRECTORIES.push(newdir);
@@ -125,4 +129,5 @@
 								rename(el);
 								break;
+							case 'newfolder':
 							case 'share':
 							case 'copy':
@@ -144,5 +149,5 @@
 			}
 			//END - Create a node of Tree
-
+			
 			var deleteNode = function (parsedData) {
 				if (parsedData.isSuccess == false) return false;
@@ -190,5 +195,6 @@
 				if (o.grid == null) return false;
 				
-				o.grid.getData({
+				o.grid.setTree(o.me);
+				o.grid.setData({
 								directoryTreeData: o.directoryTreeData,
 								curentParent:$(o.container).find('.currentDir').parent().attr('id'),
@@ -281,24 +287,15 @@
 			};
 
-			this.createDir = function(c) {
-				var cid = $(c).parent().attr('id');
-				var pid = cid.substring(o.dirIDprefix.length, cid.length);
-
-				var dirName = prompt("Please enter new directory name", "");
-				var script = 'ajax/privatecontent/createdir';
-
-				if (dirName != null && dirName.length != 0) {
-					sendCommand({
-						script: script,
-						postdata:{parentID:pid,name:dirName},
-						callbackSuccess: function (parsedData) {createNode({
-											id: parsedData.id,
-											name: parsedData.name,
-											curentNode: c,
-											hidden: false,
-											addToJSONData:true});
-										}
-					});
-				}
+			this.createDir = function(data) {
+				var cNode = $('#' + o.dirIDprefix + data.parentID).find('> A');
+				
+				createNode({
+					id: data.id,
+					name: data.name,
+					currentNode: cNode,
+					hidden: false,
+					addToJSONData:true});
+				
+				//console.log($(o.container).find(cNode).parent().attr('id').substring(o.dirIDprefix.length, $(cNode).parent().attr('id').length));
 			}
 
@@ -328,11 +325,29 @@
 				});
 			}
+			
+			this.upload = function () {
+				$('#box-upload').modal('show');
+				
+				$("#fileuploader").uploadFile({
+					url: o.host + 'ajax/privatecontent/upload',
+					fileName:"myfile",
+					multiple:true,
+					maxFileCount: 5,
+					dragDropStr: "<span><b>KÃ©o tháº£ cÃ¡c file vÃ o ÄÃ¢y!</b></span>",
+					uploadErrorStr:"Táº£i lÃªn cÃ³ lá»i!"
+				});
+				
+				$('#box-upload').on('hide.bs.modal', function () {
+					$('#box-upload').find('.modal-body>.row>.col-xs-12>').remove();
+					$('#box-upload').find('.modal-body>.row>.col-xs-12').append('<div id="fileuploader">Chá»n file:</div>');
+				});
+			}
 
 			this.copy = function () {
-				alert ('copy');
+				
 			}
 
 			this.paste = function () {
-				alert ('paste');
+				
 			}
 
Index: pro-bachkim-filespace/sourcecode/assets/js/vupload.js
===================================================================
--- pro-bachkim-filespace/sourcecode/assets/js/vupload.js	(revision 42)
+++ pro-bachkim-filespace/sourcecode/assets/js/vupload.js	(revision 42)
@@ -0,0 +1,12 @@
+if(jQuery) (function($){
+	
+	$.extend($.fn, {
+		violetUpload: function(o) {
+			if( !o ) var o = {};
+			if( o.container == undefined ) o.container = null;
+			
+			
+		}
+	});
+
+})(jQuery);
