I use the jsTree plugin to create a directory tree.
Right click a node, should open a contextmenu where the user can create a new child node and assign a custom name