Sha256: 6c356ab86a312c55f3ccd7896559596d9519e706fff4a213e2664a4ab01e4027

Contents?: true

Size: 974 Bytes

Versions: 40

Compression:

Stored size: 974 Bytes

Contents

/*
Usage 1: define the default prefix by using an object with the property prefix as a parameter which contains a string value; {prefix: 'id'}
Usage 2: call the function jQuery.uuid() with a string parameter p to be used as a prefix to generate a random uuid;
Usage 3: call the function jQuery.uuid() with no parameters to generate a uuid with the default prefix; defaul prefix: '' (empty string)
*/

/*
Generate fragment of random numbers
*/
jQuery._uuid_default_prefix = '';
jQuery._uuidlet = function () {
	return(((1+Math.random())*0x10000)|0).toString(16).substring(1);
};
/*
Generates random uuid
*/
jQuery.uuid = function (p) {
	if (typeof(p) == 'object' && typeof(p.prefix) == 'string') {
		jQuery._uuid_default_prefix = p.prefix;
	} else {
		p = p || jQuery._uuid_default_prefix || '';
		return(p+jQuery._uuidlet()+jQuery._uuidlet()+"-"+jQuery._uuidlet()+"-"+jQuery._uuidlet()+"-"+jQuery._uuidlet()+"-"+jQuery._uuidlet()+jQuery._uuidlet()+jQuery._uuidlet());
	};
};

Version data entries

40 entries across 40 versions & 6 rubygems

Version Path
showoff-0.9.10.9 public/js/jquery.uuid.js
showoff-0.9.10.8 public/js/jquery.uuid.js
showoff-0.9.10.7 public/js/jquery.uuid.js
showoff-0.9.10.6 public/js/jquery.uuid.js
showoff-0.9.10.5 public/js/jquery.uuid.js
showoff-0.9.10.4 public/js/jquery.uuid.js
showoff-0.9.10.3 public/js/jquery.uuid.js
showoff-0.9.10.2 public/js/jquery.uuid.js
showoff-0.9.10.1 public/js/jquery.uuid.js
showoff-0.9.10 public/js/jquery.uuid.js
showoff-0.9.9.1 public/js/jquery.uuid.js
showoff-0.9.9 public/js/jquery.uuid.js
showoff-0.9.8.1 public/js/jquery.uuid.js
showoff-0.9.8 public/js/jquery.uuid.js
showoff-0.9.7.1 public/js/jquery.uuid.js
showoff-0.9.7 public/js/jquery.uuid.js
showoffer-0.0.1 public/js/jquery.uuid.js
showoff-alexch-0.7.0.3 public/js/jquery.uuid.js
showoff-alexch-0.7.0.2 public/js/jquery.uuid.js
showoff-alexch-0.7.0.1 public/js/jquery.uuid.js