Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Js portion
- elFinder.prototype.i18.en.messages['cmdcustom'] = 'Create new custom folder';
- elFinder.prototype._options.commands.push('custom');
- elFinder.prototype.commands.custom = function () {
- this.disableOnSearch = !0,
- this.updateOnSelect = !1,
- this.mime = "directory",
- this.prefix = "Style name",
- this.exec = e.proxy(this.fm.res("mixin", "make"), this),
- this.shortcuts = [{
- pattern: "ctrl+shift+s"
- }],
- this.getstate = function () {
- return !this._disabled && this.fm.cwd().write ? 0 : -1
- }
- }
- //C# portion in FileSystemDriver.cs
- JsonResult IDriver.CustomMakeDir(string target, string name) {
- FullPath fullPath = ParsePath(target);
- DirectoryInfo newDir = Directory.CreateDirectory(Path.Combine(fullPath.Directory.FullName, name));
- JsonResult vr = Json(new AddResponse(newDir, fullPath.Root));
- string json = new JavaScriptSerializer().Serialize(vr);
- JsonResultModel jsm = Newtonsoft.Json.JsonConvert.DeserializeObject<JsonResultModel>(json);
- List<Added> listAddedObj = jsm.Data.Added;
- string newParenthash = listAddedObj.FirstOrDefault().Hash; List<string> folders = new List<string> {"COST","MIN","MAX"};
- foreach(string folderName in folders){
- FullPath fullPathn = ParsePath(newParenthash); //ParseCustomPath
- DirectoryInfo newDirn = Directory.CreateDirectory(Path.Combine(fullPathn.Directory.FullName, folderName));
- JsonResult jr = Json(new AddResponse(newDir, fullPathn.Root));
- string jsn = new JavaScriptSerializer().Serialize(jr);
- }
- return vr;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement