Skip to content

Commit

Permalink
SAK-31353 Minor updates to tutorial (sakaiproject#2874)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrogj authored and juanjmerono committed Jun 20, 2016
1 parent 4600087 commit 93df90b
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
3 changes: 3 additions & 0 deletions help/help-component/src/bundle/TutorialMessages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
next=Next
previous=Back

#End Tutorial text:
endTutorial=OK, Got it



#Welcome panel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ public Object getEntity(EntityReference ref) {
}
String previousUrl = tutorialProps.getString(ref.getId() + ".previousUrl");
String nextUrl = tutorialProps.getString(ref.getId() + ".nextUrl");
String sakaiInstanceName = ServerConfigurationService.getString("ui.service", "Sakai");

String sakaiInstanceName = ServerConfigurationService.getString("ui.service", "Sakai");
String selection = tutorialProps.getString(ref.getId() + ".selection");

Map valuesMap = new HashMap<String, String>();
valuesMap.put("selection", tutorialProps.getString(ref.getId() + ".selection"));
valuesMap.put("selection", selection);
valuesMap.put("title", msgs.getFormattedMessage(ref.getId() + ".title", sakaiInstanceName));
valuesMap.put("dialog", tutorialProps.getString(ref.getId() + ".dialog"));
valuesMap.put("positionTooltip", tutorialProps.getString(ref.getId() + ".positionTooltip"));
Expand All @@ -97,6 +98,8 @@ public Object getEntity(EntityReference ref) {
}
if(nextUrl != null && !"".equals(nextUrl)){
footerHtml += "<div class='tut-next'><a href='#' class='qtipLinkButton' onclick='showTutorialPage(\"" + nextUrl + "\");'>" + msgs.getString("next") + "&nbsp;<i class='fa fa-arrow-right'></i></a></div>";
}else{
footerHtml += "<a href='#' class='btn-primary tut-close' onclick='endTutorial(\"" + selection + "\");' >"+ msgs.getString("endTutorial") +"</a>";
}
footerHtml += "</div>";
body += footerHtml;
Expand Down
2 changes: 1 addition & 1 deletion help/help-component/src/tutorial/Tutorial.config
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ introToSakai_refreshTool.selection=.Mrphs-hierarchy--toolName
introToSakai_refreshTool.previousUrl=/direct/tutorial/introToSakai_toolMenuNarrowView.json
introToSakai_refreshTool.nextUrl=/direct/tutorial/introToSakai_helpIcon.json
introToSakai_refreshTool.dialog=
introToSakai_refreshTool.positionTooltip=topMiddle
introToSakai_refreshTool.positionTooltip=topLeft
introToSakai_refreshTool.positionTarget=bottomMiddle
introToSakai_refreshTool.fadeout=

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
margin-left:auto;

}

.tut-close
{
margin: -5px 0 0 0;
}
}
/*
.qtip-shadow {
Expand Down
14 changes: 13 additions & 1 deletion reference/library/src/webapp/js/jquery/qtip/tutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ function startTutorial(opts){
}
}

function endTutorial(selection){
$(selection).qtip('destroy');
}

function showTutorialPage(url, opts){
//store options in cache so we can use the same options from start to end of the tutorial:
if(opts != null)
Expand Down Expand Up @@ -48,6 +52,14 @@ function showTutorialPage(url, opts){
showTutorialPage(response.data.nextUrl);
}
}else{
var selection;

if ($(response.data.selection).length > 1 ){
selection = $(response.data.selection).first();
}else{
selection = $(response.data.selection);
}

previousClicked = false;
var mxWidth = maxWidth;
var totalWidth = $(document).width();
Expand All @@ -56,7 +68,7 @@ function showTutorialPage(url, opts){
mxWidth = totalWidth;
}

$(response.data.selection).qtip(
selection.qtip(
{
content: {
title: response.data.title,
Expand Down

0 comments on commit 93df90b

Please sign in to comment.