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");
}
});
}

View file

@ -146,6 +146,9 @@ $(document).ready(function() {
} else {
self.stopRefreshingRecentUploads();
}
// Update usability hint - in common.js
getUsabilityHint();
}
} );
}

View file

@ -154,6 +154,7 @@ function buildScheduleDialog (json, instance_id) {
"class": "btn",
click: function() {
$(this).dialog("close");
//getUsabilityHint();
}
}
]

View file

@ -283,6 +283,8 @@ var AIRTIME = (function(AIRTIME){
mod.enableUI();
//Unneccessary reload of the library pane after moving tracks in the showbuilder pane.
//$("#library_content").find("#library_display").dataTable().fnStandingRedraw();
getUsabilityHint();
};
mod.getSelectedCursors = function() {
@ -316,7 +318,7 @@ var AIRTIME = (function(AIRTIME){
mod.disableUI();
$.post(baseUrl+"showbuilder/schedule-add",
{"format": "json", "mediaIds": aMediaIds, "schedIds": aSchedIds},
{"format": "json", "mediaIds": aMediaIds, "schedIds": aSchedIds},
mod.fnItemCallback
);
};