Commit a95522ae authored by EL HASSANE GARGEM's avatar EL HASSANE GARGEM
Browse files

integrate onboarding in edit page

parent 06634c96
......@@ -15,6 +15,23 @@ var partVM = new Vue({
selectedTranscription: null,
comparedTranscriptions: []
},
mounted(){
if(onboarding) {
this.$nextTick(function () {
this.show = {
source: true,
segmentation: true,
visualisation: true,
diplomatic: true
};
let timer = setTimeout(function (){
this.call_introjs();
}.bind(this),
2000);
});
}
},
computed: {
imageSize() {
return this.part.image.size[0]+'x'+this.part.image.size[1];
......@@ -177,6 +194,19 @@ var partVM = new Vue({
}.bind(this));
},
methods: {
call_introjs(){
var document_edit = introJs();
document_edit.setOptions({steps: steps_intro});
document_edit.start();
document_edit.onexit(function () {
// exitonboarding();
});
document_edit.oncomplete(function () {
segmentation_intro.start();
});
console.log("hey you");
},
resetZoom() {
this.zoom.reset();
},
......
......@@ -250,6 +250,7 @@ class EditPart(LoginRequiredMixin, DetailView):
context['object'] = self.object.document
context['document'] = self.object.document
context['part'] = self.object
context['onboarding'] = self.request.user.onboarding
return context
def dispatch(self, *args, **kwargs):
......
......@@ -62,7 +62,7 @@
{% endblock %}
{% block extra_nav %}
<div class="nav-item ml-auto">
<div class="nav-item ml-auto" id="toggle-panels">
<button type="button"
@click="togglePanel"
data-target="source"
......@@ -171,6 +171,7 @@
<SegmentationPanel v-if="show.segmentation && part.loaded"
v-bind:fullsizeimage="fullsizeimage"
v-bind:part="part"
id="segmentation-panel"
ref="segPanel" inline-template>
<div class="col panel">
<div class="tools">
......@@ -333,6 +334,7 @@
<keep-alive>
<VisuPanel v-if="show.visualisation && part.loaded"
v-bind:part="part"
id="transcription-panel"
ref="visuPanel" inline-template>
<div class="col panel">
<div class="tools">
......@@ -544,6 +546,7 @@
<keep-alive>
<DiploPanel v-if="show.diplomatic && part.loaded"
v-bind:part="part"
id="diplomatic-panel"
ref="diploPanel"
inline-template>
<div class="col panel">
......@@ -618,6 +621,7 @@
const TEXT_DIRECTION = '{{document.main_script.text_direction}}';
const DOCUMENT_ID = '{{document.id}}';
var PART_ID = {{part.id}}; // can be changed with next & previous pages
const onboarding = "{{ onboarding }}";
</script>
<script type="text/javascript">
......@@ -643,6 +647,8 @@
<script type="text/javascript" src="{% static 'vendor/undomanager.js' %}"></script>
<script type="text/javascript" src="{% static 'vendor/lodash/lodash.min.js' %}"></script>
<script type="text/javascript" src="{% static 'vendor/jquery/jquery-ui.min.js' %}"></script>
<script src="{% static 'vendor/introjs/intro.js' %}"></script>
<script src="{% static 'js/onboarding/edit.js' %}"></script>
<script type="text/javascript" src="{% static 'js/wheelzoom.js' %}"></script>
<script type="text/javascript" src="{% static 'js/baseline.editor.js' %}"></script>
<script type="text/javascript" src="{% static 'js/edit/components/base_panel.js' %}"></script>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment