Skip to content

Commit

Permalink
Merge branch 'pr/896' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Laské committed Nov 12, 2020
2 parents 2e27c24 + 88c621d commit 38e4a22
Show file tree
Hide file tree
Showing 13 changed files with 241 additions and 1 deletion.
10 changes: 10 additions & 0 deletions activities/Calligra.activity/css/activity.css
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,16 @@ body {
background-image: url(../icons/restart.svg);
background-size: contain;
}
.player-next {
position: absolute;
top: 130px;
right: 17px;
width: 40px;
height: 40px;
padding: 5px;
background-image: url(../icons/pass-icon.svg);
background-size: contain;
}

.player-restart:disabled {
background-color: lightgray;
Expand Down
112 changes: 112 additions & 0 deletions activities/Calligra.activity/icons/pass-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions activities/Calligra.activity/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<script>if (window.module) module = window.module;</script>
<script src="lib/require.js"></script>
<script type="text/javascript" src="../../cordova.js"></script>
<script src="lib/confetti.browser.min.js"></script>
</head>

<body>
Expand Down
20 changes: 19 additions & 1 deletion activities/Calligra.activity/js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ var app = new Vue({
return;
}

// Dosplay item
// Display item
vm.$refs.toolbar.$refs.lines.isDisabled = false;
vm.$refs.toolbar.$refs.zoombutton.isDisabled = false;
vm.$refs.toolbar.$refs.insertimage.isDisabled = true;
Expand All @@ -147,6 +147,23 @@ var app = new Vue({
document.getElementById("canvas").style.backgroundColor = "#ffffff";
}
},
nextItem: function (item) {
// returns the next letter when Try Next button is clicked
var vm = this;
var index = -1;
for (var i = 0 ; i < vm.currentTemplate.images.length ; i++) {
if (vm.currentTemplate.images[i] == item) {
index = i;
break;
}
}
index++;
if (index === vm.currentTemplate.images.length) {
index = 0;
}
return vm.currentTemplate.images[index];

},

onZoom: function(item) {
var vm = this;
Expand Down Expand Up @@ -223,6 +240,7 @@ var app = new Vue({
options.zoombutton = vm.$refs.toolbar.$refs.zoombutton.$el;
options.backbutton = document.getElementById("back");
options.restartbutton = document.getElementById("player-restart");
options.nextbutton = document.getElementById("player-next-letter");
options.editoraddbutton = document.getElementById("editor-add");
options.editorremovebutton = document.getElementById("editor-remove");
options.editoraddpathbutton = document.getElementById("editor-addpath");
Expand Down
23 changes: 23 additions & 0 deletions activities/Calligra.activity/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var Player = {
<canvas id="letter"></canvas>
</div>
<button id="player-restart" class="player-restart"></button>
<button id="player-next-letter" class="player-next" v-on:click="nextItem()"></button>
<div id="cursor" class="player-cursor"></div>
</div>`,
props: ['item'],
Expand Down Expand Up @@ -197,6 +198,14 @@ var Player = {
if (vm.current.start >= vm.item.starts.length) {
vm.mode = 'end';
vm.setCursorVisibility(false);
setTimeout(function(){
confetti({
particleCount: 200,
spread: 70,
origin: { y: 0.6 }
});
}, 500);

} else {
var lines = [{x: vm.item.starts[vm.current.start].x, y:vm.item.starts[vm.current.start].y}];
vm.moveCursor({x: vm.zoom*lines[0].x, y: vm.zoom*lines[0].y});
Expand Down Expand Up @@ -333,6 +342,20 @@ var Player = {

goBack: function() {
app.displayTemplateView();
},
nextItem: function () {
// When Try Next button is clicked
var vm = this;
vm.item = app.nextItem(vm.item);
var imageObj = new Image();
imageObj.onload = function() {
vm.imageSize = imageObj.width;

vm.onLoad();
vm.startDemoMode();
};
imageObj.src = vm.item.image;

}
},

Expand Down
8 changes: 8 additions & 0 deletions activities/Calligra.activity/js/tutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ var Tutorial = {
stringTutoBackButtonContent: '',
stringTutoRestartButtonTitle: '',
stringTutoRestartButtonContent: '',
stringTutoNextButtonTitle: '',
stringTutoNextButtonContent: '',
stringTutoEditorAddButtonTitle: '',
stringTutoEditorAddButtonContent: '',
stringTutoEditorRemoveButtonTitle: '',
Expand Down Expand Up @@ -154,6 +156,12 @@ var Tutorial = {
placement: "left",
title: this.l10n.stringTutoRestartButtonTitle,
content: this.l10n.stringTutoRestartButtonContent
},
{
element: options.nextbutton,
placement: "left",
title: this.l10n.stringTutoNextButtonTitle,
content: this.l10n.stringTutoNextButtonContent
}
]);
}
Expand Down
8 changes: 8 additions & 0 deletions activities/Calligra.activity/lib/confetti.browser.min.js

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

10 changes: 10 additions & 0 deletions activities/Calligra.activity/locale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ TutoBackButtonTitle=Back
TutoBackButtonContent=Click here to go back to the list of items.
TutoRestartButtonTitle=Restart
TutoRestartButtonContent=Click here to restart the drawing.
TutoNextButtonTitle=Next
TutoNextButtonContent=Click here to attempt the next one.
TutoEditorAddButtonTitle=Add start point
TutoEditorAddButtonContent=Click here to add a start point. Each drawing could have as many start points that you want. It's generally a good way to show where the pen should be up. Once the point is add, use mouse or arrow keys to move it.
TutoEditorRemoveButtonTitle=Remove start point
Expand Down Expand Up @@ -88,6 +90,8 @@ TutoBackButtonTitle=Back
TutoBackButtonContent=Click here to go back to the list of items.
TutoRestartButtonTitle=Restart
TutoRestartButtonContent=Click here to restart the drawing.
TutoNextButtonTitle=Next
TutoNextButtonContent=Click here to attempt the next one.
TutoEditorAddButtonTitle=Add start point
TutoEditorAddButtonContent=Click here to add a start point. Each drawing could have as many start points that you want. It's generally a good way to show where the pen should be up. Once the point is add, use mouse or arrow keys to move it.
TutoEditorRemoveButtonTitle=Remove start point
Expand Down Expand Up @@ -137,6 +141,8 @@ TutoBackButtonTitle=Back
TutoBackButtonContent=Click here to go back to the list of items.
TutoRestartButtonTitle=Restart
TutoRestartButtonContent=Click here to restart the drawing.
TutoNextButtonTitle=Next
TutoNextButtonContent=Click here to attempt the next one.
TutoEditorAddButtonTitle=Add start point
TutoEditorAddButtonContent=Click here to add a start point. Each drawing could have as many start points that you want. It's generally a good way to show where the pen should be up. Once the point is add, use mouse or arrow keys to move it.
TutoEditorRemoveButtonTitle=Remove start point
Expand Down Expand Up @@ -186,6 +192,8 @@ TutoBackButtonTitle=Retour
TutoBackButtonContent=Cliquer ici pour retourner à la liste des éléments.
TutoRestartButtonTitle=Redémarrer
TutoRestartButtonContent=Cliquer ici pour redémarrer le dessin.
TutoNextButtonTitle=Suivant
TutoNextButtonContent=Cliquez ici pour passer à l'élément suivant.
TutoEditorAddButtonTitle=Ajouter un point de départ
TutoEditorAddButtonContent=Cliquer ici pour ajouter un point de départ. Chaque dessin peut avoir autant de points de départ que vous voulez. Cela permet généralement d'indiquer les endroits où le stylo doit être relevé. Une fois le point ajouté, utiliser la souris ou les touches flèches pour le déplacer.
TutoEditorRemoveButtonTitle=Supprimer point de départ
Expand Down Expand Up @@ -235,6 +243,8 @@ TutoBackButtonTitle=Back
TutoBackButtonContent=Click here to go back to the list of items.
TutoRestartButtonTitle=Restart
TutoRestartButtonContent=Click here to restart the drawing.
TutoNextButtonTitle=Next
TutoNextButtonContent=Click here to attempt the next one.
TutoEditorAddButtonTitle=Add start point
TutoEditorAddButtonContent=Click here to add a start point. Each drawing could have as many start points that you want. It's generally a good way to show where the pen should be up. Once the point is add, use mouse or arrow keys to move it.
TutoEditorRemoveButtonTitle=Remove start point
Expand Down
10 changes: 10 additions & 0 deletions activities/Calligra.activity/po/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ msgctxt "TutoRestartButtonContent"
msgid "Click here to restart the drawing."
msgstr "Click here to restart the drawing."

#: TutoNextButtonTitle
msgctxt "TutoNextButtonTitle"
msgid "Next"
msgstr "Next"

#: TutoNextButtonContent
msgctxt "TutoNextButtonContent"
msgid "Click here to attempt the next one."
msgstr "Click here to attempt the next one."

#: TutoEditorAddButtonTitle
msgctxt "TutoEditorAddButtonTitle"
msgid "Add start point"
Expand Down
10 changes: 10 additions & 0 deletions activities/Calligra.activity/po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ msgctxt "TutoRestartButtonContent"
msgid "Click here to restart the drawing."
msgstr "Click here to restart the drawing."

#: TutoNextButtonTitle
msgctxt "TutoNextButtonTitle"
msgid "Next"
msgstr "Next"

#: TutoNextButtonContent
msgctxt "TutoNextButtonContent"
msgid "Click here to attempt the next one."
msgstr "Click here to attempt the next one."

#: TutoEditorAddButtonTitle
msgctxt "TutoEditorAddButtonTitle"
msgid "Add start point"
Expand Down
10 changes: 10 additions & 0 deletions activities/Calligra.activity/po/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ msgctxt "TutoRestartButtonContent"
msgid "Click here to restart the drawing."
msgstr "Cliquer ici pour redémarrer le dessin."

#: TutoNextButtonTitle
msgctxt "TutoNextButtonTitle"
msgid "Next"
msgstr "suivant"

#: TutoNextButtonContent
msgctxt "TutoNextButtonContent"
msgid "Click here to attempt the next one."
msgstr "Cliquez ici pour essayer le suivant."

#: TutoEditorAddButtonTitle
msgctxt "TutoEditorAddButtonTitle"
msgid "Add start point"
Expand Down
10 changes: 10 additions & 0 deletions activities/Calligra.activity/po/pt.po
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,16 @@ msgctxt "TutoRestartButtonContent"
msgid "Click here to restart the drawing."
msgstr "Click here to restart the drawing."

#: TutoNextButtonTitle
msgctxt "TutoNextButtonTitle"
msgid "Next"
msgstr "Next"

#: TutoNextButtonContent
msgctxt "TutoNextButtonContent"
msgid "Click here to attempt the next one."
msgstr "Click here to attempt the next one."

#: TutoEditorAddButtonTitle
msgctxt "TutoEditorAddButtonTitle"
msgid "Add start point"
Expand Down
10 changes: 10 additions & 0 deletions activities/Calligra.activity/po/template.pot
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ msgctxt "TutoRestartButtonContent"
msgid "Click here to restart the drawing."
msgstr ""

#: TutoNextButtonTitle
msgctxt "TutoNextButtonTitle"
msgid "Next"
msgstr ""

#: TutoNextButtonContent
msgctxt "TutoNextButtonContent"
msgid "Click here to attempt the next one."
msgstr ""

#: TutoEditorAddButtonTitle
msgctxt "TutoEditorAddButtonTitle"
msgid "Add start point"
Expand Down

0 comments on commit 38e4a22

Please sign in to comment.