vendor/assets/elfinder_OLD/js/elfinder.full.js
function(prefix, phash, glue) {
		var i = 0, ext = '', p, name;
		
		prefix = this.i18n(false, prefix);
		phash = phash || this.cwd().hash;
		glue = (typeof glue === 'undefined')? ' ' : glue;

		if (p = prefix.match(/^(.+)(\.[^.]+)$/)) {
			ext    = p[2];
			prefix = p[1];
		}
		
		name   = prefix+ext;
		
		if (!this.fileByName(name, phash)) {
			return name;
		}
		while (i < 10000) {
			name = prefix + glue + (++i) + ext;
			if (!this.fileByName(name, phash)) {
				return name;
			}
		}
		return prefix + Math.random() + ext;
	}
function(prefix, phash, glue) {
		var i = 0, ext = '', p, name;
		
		prefix = this.i18n(false, prefix);
		phash = phash || this.cwd().hash;
		glue = (typeof glue === 'undefined')? ' ' : glue;

		if (p = prefix.match(/^(.+)(\.[^.]+)$/)) {
			ext    = p[2];
			prefix = p[1];
		}
		
		name   = prefix+ext;
		
		if (!this.fileByName(name, phash)) {
			return name;
		}
		while (i < 10000) {
			name = prefix + glue + (++i) + ext;
			if (!this.fileByName(name, phash)) {
				return name;
			}
		}
		return prefix + Math.random() + ext;
	}
function ( prefix , phash , glue ) { var i = 0 , ext = '' , p , name ; prefix = this . i18n ( false , prefix ) ; phash = phash || this . cwd ( ) . hash ; glue = ( typeof glue === 'undefined' ) ? ' ' : glue ; if ( p = prefix . match ( / ^(.+)(\.[^.]+)$ / ) ) { ext = p [ 2 ] ; prefix = p [ 1 ] ; } name = prefix + ext ; if ( ! this . fileByName ( name , phash ) ) { return name ; } while ( i < 10000 ) { name = prefix + glue + ( ++ i ) + ext ; if ( ! this . fileByName ( name , phash ) ) { return name ; } } return prefix + Math . random ( ) + ext ; }
Create unique file name in required dir

@param  String  file name
@param  String  parent dir hash
@param  String  glue
@return String
Create unique file name in required dir