Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dollar activity Bootstrap Tour to IntroJS Tour #1236

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions activities/DollarStreet.activity/css/activity.css
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,118 @@ div[slider] > input[type=range]::-ms-tooltip {
width: 100%;
height: 100%;
}

.introjs-overlay {
background-color: #000 !important;
opacity: .8 !important;
}

.introjs-tooltip {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif !important;
border-radius: 6px !important;
padding: 2px 1px !important;
font-size: 14px !important;
}

.introjs-helperLayer{
background: inherit !important;
opacity: 0.6 !important;
}

.customTooltip .introjs-tooltip-header {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
color : #ffffff;
text-shadow: none;
background-color: #808080;
margin: 0;
padding: 5px 10px;
border-bottom: 1px solid #ebebeb;
border-radius: 5px 5px 0 0;
}

.customTooltip .introjs-tooltip-title {
font-size: 14px;
padding: 0px 8px;
font-weight: 800;
}

.customTooltip .introjs-tooltiptext {
color: #000000;
line-height: 1.42857143;
}

.customTooltip .introjs-skipbutton {
float: right;
cursor: pointer;
background-image: url(../icons/dialog-cancel.svg);
width: 25px;
height: 25px;
background-size: 25px 25px;
margin-top: 2px;
padding: 0px;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}

.customTooltip .introjs-nextbutton::before {
content: "";
margin-right: 6px;
background-image: url(../icons/go-right.svg);
width: 20px;
height: 20px;
background-size: 20px 20px;
}

.customTooltip .introjs-prevbutton::before {
content: "";
margin-right: 6px;
background-image: url(../icons/go-left.svg);
width: 20px;
height: 20px;
background-size: 20px 20px;
}

.customTooltip .introjs-tooltipbuttons {
display: flex;
flex-wrap:wrap;
justify-content: center;
align-items: center;
cursor: pointer;
border-top: 0px;
padding: 0px;
text-align: center;
white-space: normal;
}

.customTooltip .introjs-button {
text-shadow: none;
border-radius: 22px;
margin: 5px 8px 8px 8px;
width: fit-content;
background-color: #808080 !important;
display: flex !important;
align-items: center !important;
color: white !important;
padding: 6px 20px 6px 10px;
border: 0px;
}

.customTooltip .introjs-button:focus {
-webkit-box-shadow: 0 0 0 0rem rgba(158, 158, 158, .5);
box-shadow: 0 0 0 0rem rgba(158, 158, 158, .5);
border: 0px;
background-color: #808080 !important;
}

.customTooltip .introjs-disabled {
color: black !important;
border: 0px;
opacity: .65;
}

.customTooltip .introjs-disabled:focus {
-webkit-box-shadow: 0 0 0 0rem rgba(158, 158, 158, .5);
box-shadow: 0 0 0 0rem rgba(158, 158, 158, .5);
border: 0px;
}

This file was deleted.

2 changes: 2 additions & 0 deletions activities/DollarStreet.activity/css/introjs.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions activities/DollarStreet.activity/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
href="lib/sugar-web/graphics/css/sugar-200dpi.css">
<link rel="stylesheet" href="css/activity.css">
<link rel="stylesheet" href="css/libnotify.css">
<link rel="stylesheet" href="css/bootstrap-tour-standalone.min.css">
<link rel="stylesheet" href="css/introjs.css">
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script src="lib/vue.min.js"></script>
<script src="lib/axios.min.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="lib/bootstrap-tour-standalone.min.js"></script>
<script src="lib/intro.js"></script>
<script>if (window.module) module = window.module;</script>
<script src="lib/require.js"></script>
<script type="text/javascript" src="../../cordova.js"></script>
Expand Down
45 changes: 22 additions & 23 deletions activities/DollarStreet.activity/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,75 +237,74 @@ var app = new Vue({
if (vm.currentView == viewList) {
steps = steps.concat([
{
element: "",
orphan: true,
placement: "bottom",
position: "bottom",
title: vm.l10n.stringTutoListWelcomeTitle,
content: vm.l10n.stringTutoListWelcomeContent
intro: vm.l10n.stringTutoListWelcomeContent
},
{
element: "#street-button",
placement: "bottom",
position: "bottom",
title: vm.l10n.stringTutoListIncomeTitle,
content: vm.l10n.stringTutoListIncomeContent
intro: vm.l10n.stringTutoListIncomeContent
},
{
element: "#family-button",
placement: "bottom",
position: "bottom",
title: vm.l10n.stringTutoListFamilyTitle,
content: vm.l10n.stringTutoListFamilyContent
intro: vm.l10n.stringTutoListFamilyContent
},
{
element: "#things-button",
placement: "bottom",
position: "bottom",
title: vm.l10n.stringTutoListThingsTitle,
content: vm.l10n.stringTutoListThingsContent
intro: vm.l10n.stringTutoListThingsContent
},
{
element: "#world-button",
placement: "bottom",
position: "bottom",
title: vm.l10n.stringTutoListRegionTitle,
content: vm.l10n.stringTutoListRegionContent
intro: vm.l10n.stringTutoListRegionContent
},
{
element: placeelement,
placement: "right",
position: "right",
title: vm.l10n.stringTutoListPlaceTitle,
content: vm.l10n.stringTutoListPlaceContent
intro: vm.l10n.stringTutoListPlaceContent
},
]);
} else {
steps = steps.concat([
{
element: "",
orphan: true,
placement: "bottom",
position: "bottom",
title: vm.l10n.stringTutoDetailViewTitle,
content: vm.l10n.stringTutoDetailViewContent
intro: vm.l10n.stringTutoDetailViewContent
},
{
element: ".family-image-container",
placement: "right",
position: "right",
title: vm.l10n.stringTutoDetailImageTitle,
content: vm.l10n.stringTutoDetailImageContent
intro: vm.l10n.stringTutoDetailImageContent
},
{
element: "#family-description",
placement: "left",
position: "left",
title: vm.l10n.stringTutoDetailDescriptionTitle,
content: vm.l10n.stringTutoDetailDescriptionContent
intro: vm.l10n.stringTutoDetailDescriptionContent
},
{
element: placeelement,
placement: "top",
position: "top",
title: vm.l10n.stringTutoDetailThingsTitle,
content: vm.l10n.stringTutoDetailThingsContent
intro: vm.l10n.stringTutoDetailThingsContent
},
{
element: "#family-goback",
placement: "right",
position: "right",
title: vm.l10n.stringTutoDetailBackTitle,
content: vm.l10n.stringTutoDetailBackContent
intro: vm.l10n.stringTutoDetailBackContent
},
]);
}
Expand Down
48 changes: 11 additions & 37 deletions activities/DollarStreet.activity/js/components/SugarTutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,18 @@ Vue.component('sugar-tutorial', {
},
methods: {
show: function (steps) {
var vm = this;
var tour = new Tour({
template: `
<div class='popover tour'>
<div class='arrow'></div>
<h3 class='popover-title tutorial-title'></h3>
<div class='popover-content'></div>
<div class='popover-navigation' style='display: flex; flex-wrap:wrap; justify-content: center; align-items: center'>
<div class='tutorial-prev-icon tutorial-icon-button' data-role='prev'>
<div class='tutorial-prev-icon1 web-activity'></div>
<div class='tutorial-icon-text'>${this.l10n.stringTutoPrev}</div>
</div>
<span data-role='separator' style='margin: 4px'>|</span>
<div class='tutorial-next-icon tutorial-icon-button' data-role='next'>
<div class='tutorial-next-icon1 web-activity'></div>
<div class='tutorial-icon-text'>${this.l10n.stringTutoNext}</div>
</div>
<div class='tutorial-end-icon tutorial-icon-button' data-role='end'>
<div class='tutorial-end-icon1 web-activity'></div>
<div class='tutorial-icon-text'>${this.l10n.stringTutoEnd}</div>
</div>
</div>
</div>`,
storage: false,
backdrop: true,
steps= steps.filter(function (obj) {
return !('element' in obj) || ((obj.element).length && document.querySelector(obj.element) && document.querySelector(obj.element).style.display != 'none');
});
introJs().setOptions({
tooltipClass: 'customTooltip',
steps: steps,
onStart: function (tour) {
vm.$emit('start', tour);
},
onShow: function (tour) {
vm.$emit('show', tour);
},
onEnd: function (tour) {
vm.$emit('end', tour);
},
});
tour.init();
tour.start(true);
prevLabel: this.l10n.stringTutoPrev,
nextLabel: this.l10n.stringTutoNext,
exitOnOverlayClick: false,
nextToDone: false,
showBullets: false
}).start();
}
}
});

This file was deleted.

Loading