SAAS-940: Provide usability hints to user

Customized hints depending on what page the user is on and what action
they just completed.
This commit is contained in:
drigato 2015-07-13 17:02:31 -04:00
parent 48547ee347
commit 25ef70767b
7 changed files with 131 additions and 1 deletions

View file

@ -161,3 +161,24 @@ function removeSuccessMsg() {
$status.fadeOut("slow", function(){$status.empty()});
}
function getUsabilityHint() {
var pathname = window.location.pathname;
$.getJSON("/api/get-usability-hint", {"format": "json", "userPath": pathname}, function(json) {
console.log(json);
var $hint_div = $('.usability_hint');
var current_hint = $hint_div.html();
if (json === "") {
$hint_div.hide();
} else if (current_hint !== json) {
console.log($hint_div);
if ($hint_div.is(":hidden")) {
console.log("hidden");
$hint_div.show();
}
$hint_div.slideUp("slow");
$hint_div.html(json);
$hint_div.slideDown("slow");
}
});
}