Sha256: 13074e9e5f4c2c3f2caeb50e4ba079d1e46f6d0c87dc9ec80c86f4e7f955b4fe

Contents?: true

Size: 1.2 KB

Versions: 19

Compression:

Stored size: 1.2 KB

Contents

var AdminData = AdminData || {};

AdminData.jsUtil = {

  // TODO since advance search was not working with util confirm , window.confirm is used directly
  // fix it later
	confirm: function(arg) {
		window.confirm(arg);
	},

	buildOptionsFromArray: function(array, element) {
		element.append($('<option />'));
		for (i in array) {
			$('<option />').text(array[i][0]).attr('value', array[i][1]).appendTo(element);
		}
		element.attr('disabled', false);
	},

	colorizeRows: function() {
		$('.colorize tr:odd').addClass('odd');
		$('.colorize tr:even').addClass('even');
	},

	// returns date in string format. example: 07-September-2009  
	dateToString: function(date) {
		var month = (date.getMonth() + 1).toString();
		var day = date.getDate().toString();
		//days between 1 and 9 should have 0 before them
		if (day.length == 1) day = '0' + day;
		var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
		return day + "-" + months[month - 1] + "-" + date.getFullYear();
	},

	randomNumber: function() {
		var maxVal = 100000000,
		minVal = 1;
		var randVal = minVal + (Math.random() * (maxVal - minVal));
		return Math.round(randVal);
	}

};

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
admin_data-1.0.18 lib/js/misc/js_util.js
admin_data-1.0.17 lib/js/misc/js_util.js
admin_data-1.0.16 lib/js/misc/js_util.js
admin_data-1.0.15 lib/js/misc/js_util.js
admin_data-1.0.14 lib/js/misc/js_util.js
admin_data-1.0.13 lib/js/misc/js_util.js
admin_data-1.0.12 lib/js/misc/js_util.js
admin_data-1.0.11 lib/js/misc/js_util.js
admin_data-1.0.10 lib/js/misc/js_util.js
admin_data-1.0.9 lib/js/misc/js_util.js
admin_data-1.0.8 lib/js/misc/js_util.js
admin_data-1.0.7 lib/js/misc/js_util.js
admin_data-1.0.6 lib/js/misc/js_util.js
admin_data-1.0.5 lib/js/misc/js_util.js
admin_data-1.0.4 lib/js/misc/js_util.js
admin_data-1.0.3 lib/js/misc/js_util.js
admin_data-1.0.2 lib/js/misc/js_util.js
admin_data-1.0.1 lib/js/misc/js_util.js
admin_data-1.0.0 lib/js/misc/js_util.js