(function(cloudStack, $) { cloudStack.uiCustom.recurringSnapshots = function(args) { var desc = args.desc; var selects = args.selects; var actions = args.actions; var dataProvider = args.dataProvider; return function(args) { var $snapshots = $('#template').find('.recurring-snapshots').clone(); var context = args.context; // Update labels $snapshots.find('.forms ul li.hourly a').html(_l('label.hourly')); $snapshots.find('.forms ul li.daily a').html(_l('label.daily')); $snapshots.find('.forms ul li.weekly a').html(_l('label.weekly')); $snapshots.find('.forms ul li.monthly a').html(_l('label.monthly')); $snapshots.find('.field.timezone .name').html(_l('label.timezone')); $snapshots.find('.field.time .name').html(_l('label.time')); $snapshots.find('.field.time .value label').html(_l('label.minute.past.hour')); $snapshots.find('.add-snapshot-action.add').html(_l('label.add')); // Get description $snapshots.find('.desc').html(_l(desc)); // Snapshot type tabs $snapshots.find('.forms').tabs(); // Populate selects $snapshots.find('form select').each(function() { var $select = $(this); var selectData = selects[$select.attr('name')]; if (selectData) { selectData({ response: { success: function(args) { $(args.data).each(function() { var $option = $('