Commit 3f9c4420 authored by c24b's avatar c24b

Tour PROJECTS [WIP] add project stop tour

parent befbca35
......@@ -26,48 +26,82 @@ function popOverFactory(selector, pos, confirmation){
var steps = {}
function getStep(element, i){
steps = $(document).find(".tour")
console.log("curr", element);
$(document).on("click", "button[data-role='next']", function(e){
$(element).popover("hide");
native_pop = $(element).children()
native_pop.popover("show");
i = i+1
return i
})
$(document).on("click", "button[data-role='prev']", function(i){
$(element).popover("hide");
native_pop = $(element).children()
native_pop.popover("show");
i = i-1
return i
})
element = steps[i]
popOverFactory(element, "right");
$(element).popover("show");
alert(i);
return [element, i];
}
function nextStep(element, i){
steps = $(document).find(".tour")
$(document).on("click", "button[data-role='next']", function(e){
console.log("curr", element);
$(element).popover("hide");
native_pop = $(element).children()
//native_pop.addClass("tour")
native_pop.popover("show");
i = i+1
active = $.find(".in")
//$("div.status-form").appendTo("Enter a name and click on add project")
//addFormStatus("success","div#createForm", "Enter a name and click on add project")
if (active.length > 0){
return [native_pop, i]
}
else{
element = steps[i]
console.log("next", element);
popOverFactory(element, "right");
$(element).popover("show");
$(element).popover("hide");
return [element, i];
active = $.find(".in")
submit = $(active).find("button")
if (submit.length >= 1){
$(document).on("click", submit, function(e){
i = i+1
"clicked"
})
}
else{
i = i+1
}
});
}
function prevStep(element, i){
steps = $(document).find(".tour")
$(document).on("click", "button[data-role='prev']", function(e){
console.log("curr", element);
$(element).popover("hide");
alert(i)
i = i-1
alert(i)
// if (active.length > 0){
// $("button")
// i = i+2
//native_pop.popover("hide")
//return [native_pop, i]
//$(document).on("change keyup paste", function(){
// alert("typing...")
//})
// }
// else{
// i = i+2
// }
element = steps[i]
console.log("prev", element);
console.log("child", $(document).find(".popover"));
console.log("next", element);
popOverFactory(element, "right");
$(element).popover("show");
return [element, i];
});
}
function activateTour(){
......@@ -89,6 +123,7 @@ function activateTour(){
//buildTour
curr = $(this)
i = -1
//curr, i = getStep(curr,i)
curr, i = nextStep(curr, i)
console.log(i, curr)
if (i > steps.lenght){
......
......@@ -28,21 +28,21 @@
</li>
{% if user.is_authenticated %}
<li><a href="/projects/" class="help" title="All your projects are here.">
<li class="tour" title="Projects" content="This tabs show you all the projects"><a href="/projects/">
<span class="glyphicon glyphicon-home" aria-hidden="true"></span>
Projects
</a>
</li>
{% endif %}
{% if project %}
<li><a href="/projects/{{project.id}}">
<li class="tour" title="Corpus" content="This tabs show you all the corpora of your project"><a href="/projects/{{project.id}}">
<span class="glyphicon glyphicon-book" aria-hidden="true"></span>
{{project.name | truncatechars:15}}
</a>
</li>
{% endif %}
{% if corpus %}
<li><a href="/projects/{{project.id}}/corpora/{{corpus.id}}">
<li class="tour" title="Documents" content="This tabs show you all the documents of your corpus"><a href="/projects/{{project.id}}/corpora/{{corpus.id}}">
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
{{corpus.name | truncatechars:25}}
</a>
......@@ -50,7 +50,7 @@
{% endif %}
{% if view == "graph" %}
<li id="graph-rename" style="padding:15">
<li class="tour" title="Graph" content="This tabs show you all your graphs"id="graph-rename" style="padding:15">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span>
<span id="graph-name" class="editable" ondblclick="makeEditable(this)">
Name your graph
......@@ -115,7 +115,7 @@
{% if corpus %}
<div class="container">
<ul id="corporatop" class="nav nav-tabs navbar-static-top nav-justified">
<li>
<li">
<a type="button" class="btn btn-default {% if view == 'titles' %} active {% endif %}"
onclick="javascript:location.href='/projects/{{project.id}}/corpora/{{ corpus.id }}/'"
data-target='#' href='#'>
......@@ -351,7 +351,7 @@
}
});});
activateTour();
</script>
......
......@@ -42,7 +42,7 @@
<div class="jumbotron">
<div class="row">
<div class="col-md-4">
<h1 class="tour" title="Projects" type="button" content="This is the page for all your project">
<h1>
<span class="glyphicon glyphicon-home" aria-hidden="true"></span>
Projects
</h1>
......@@ -82,7 +82,7 @@
</div>
</div>
<div class="container">
<div class="container" class="tour" title="Projects" type="button" content="Here is the listing of all your project">
<!-- GENERIC STATUS INFO -->
<div id="status" class="row col-lg-12 collapse">
......
Markdown is supported
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