Done");
$('#onboarding').fadeOut(5000, function () {
$(this).hide();
});
}
function update_checklist_ui(step) {
var checklist_item = $($('#onboarding-checklist').find("i")[steps.indexOf(step)]);
checklist_item.removeClass("icon-vector-check-empty").addClass("icon-vector-check");
if (all_steps_completed()) {
finish_onboarding();
}
}
exports.set_step_info = function (steps) {
_.each(steps, function (step) {
var step_name = step[0];
var status = step[1];
step_info[step_name].status = status;
if (status) {
update_checklist_ui(step_name);
}
});
};
exports.mark_checklist_step = function (step) {
if (!onboarding || step_info[step].status) {
return;
}
step_info[step].status = true;
update_checklist_ui(step);
update_onboarding_steps();
};
function set_up_checklist() {
var onboarding_checklist = $('#onboarding-checklist').empty();
if (all_steps_completed()) {
return;
}
_.each(steps, function (step) {
var entry = $('');
if (step_info[step].status) {
entry.append($(""));
} else {
entry.append($(""));
}
entry.append($('').html(step_info[step].user_message)).attr("id", step);
onboarding_checklist.append(entry);
var register_action = step_info[step].register;
if (register_action !== undefined) {
register_action(step_info[step].status);
}
});
$(document.body).one('click', 'a[href="/apps"]', function (e) {
exports.mark_checklist_step("made_app_sticky");
});
$(document.body).one('click', "#set-up-integration", function (e) {
exports.mark_checklist_step("set_up_integration");
});
$("#onboarding").show();
}
exports.initialize = function () {
onboarding = true;
exports.set_step_info(page_params.onboarding_steps);
set_up_checklist();
};
return exports;
}());