Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
26411c46
Commit
26411c46
authored
Oct 13, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TOUR [WIP] Next button ~ok
parent
d919679b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
19 deletions
+40
-19
guided_tour.js
static/lib/gargantext/guided_tour.js
+39
-18
overview.html
templates/pages/projects/overview.html
+1
-1
No files found.
static/lib/gargantext/guided_tour.js
View file @
26411c46
function
popOverFactory
(
selector
,
pos
,
confirmation
){
function
popOverFactory
(
selector
,
pos
,
confirmation
){
//Factory for popover indicated by class tour
//Factory for popover indicated by class tour
// transforming into btn and mapping title and content
// transforming into btn and mapping title and content
$
(
selector
).
attr
({
"type"
:
"button"
,
//
$(selector).attr({ "type": "button",
"data-toggle"
:
"popover"
,
//
"data-toggle": "popover",
"data-placement"
:
pos
,
//
"data-placement": pos,
"data-trigger"
:
"toogle"
,
//
"data-trigger": "toogle",
//
});
//
});
$
(
selector
).
popover
({
$
(
selector
).
popover
({
html
:
true
,
html
:
true
,
title
:
'<h1>'
+
selector
.
attr
(
"title"
)
+
'</h1>'
,
title
:
'<h1>'
+
$
(
selector
)
.
attr
(
"title"
)
+
'</h1>'
,
content
:
'<p class="text-center">'
+
selector
.
attr
(
"content"
)
+
'</p>'
+
content
:
'<p class="text-center">'
+
$
(
selector
)
.
attr
(
"content"
)
+
'</p>'
+
'<div class="btn-group col-sm-12">'
+
'<div class="btn-group col-sm-12">'
+
'<button class="col-sm-6 btn btn-sm btn-danger" data-role="prev">« Prev</button>'
+
'<button class="col-sm-6 btn btn-sm btn-danger" data-role="prev">« Prev</button>'
+
'<button class="col-sm-6 btn btn-sm btn-success" data-role="next">Next »</button>'
+
'<button class="col-sm-6 btn btn-sm btn-success" data-role="next">Next »</button>'
+
'</div><br>'
,
'</div><br>'
,
container
:
'body'
,
container
:
'body'
,
trigger
:
"toogle"
trigger
:
"toogle"
,
placement
:
pos
});
});
//$('.btn').not(this).popover('hide');
//$('.btn').not(this).popover('hide');
//$(selector).popover('toggle');
//$(selector).popover('toggle');
...
@@ -31,11 +32,30 @@ function nextStep(p, val) {
...
@@ -31,11 +32,30 @@ function nextStep(p, val) {
function
previousStep
(
p
,
num
)
{
function
previousStep
(
p
,
num
)
{
return
p
[(
$
.
inArray
(
val
,
p
)
-
1
)
%
p
.
length
];
return
p
[(
$
.
inArray
(
val
,
p
)
-
1
)
%
p
.
length
];
}
}
function
nextStep
(
element
,
i
){
steps
=
$
(
document
).
find
(
".tour"
)
$
(
document
).
on
(
"click"
,
"button[data-role='next']"
,
function
(
e
){
console
.
log
(
"curr"
,
element
);
$
(
element
).
popover
(
"hide"
);
i
=
i
+
1
element
=
steps
[
i
]
console
.
log
(
"next"
,
element
);
popOverFactory
(
element
,
"right"
);
$
(
element
).
popover
(
"show"
);
return
[
i
,
element
];
});
}
function
prevStep
(){
steps
=
$
(
document
).
find
(
".tour"
)
$
(
document
).
on
(
"click"
,
"button[data-role=next]"
,
function
(
e
){
alert
(
"prev"
);
});
}
function
activateTour
(){
function
activateTour
(){
$
(
document
).
on
(
"click"
,
"a#guided_tour"
,
function
(
e
){
$
(
document
).
on
(
"click"
,
"a#guided_tour"
,
function
(
e
){
if
(
$
(
this
).
parent
().
hasClass
(
"active"
)){
if
(
$
(
this
).
parent
().
hasClass
(
"active"
)){
$
(
this
).
parent
().
removeClass
(
"active"
);
$
(
this
).
parent
().
removeClass
(
"active"
);
//$(this).popover("hide");
//$(this).popover("hide");
$
(
'.popover'
).
popover
(
'hide'
);
$
(
'.popover'
).
popover
(
'hide'
);
//$(this).popover("destroy");
//$(this).popover("destroy");
...
@@ -49,12 +69,13 @@ function activateTour(){
...
@@ -49,12 +69,13 @@ function activateTour(){
//show the popover
//show the popover
$
(
this
).
popover
(
'toggle'
);
$
(
this
).
popover
(
'toggle'
);
//buildTour()
//buildTour()
steps
=
$
(
document
).
find
(
".tour"
)
console
.
log
(
steps
)
$
(
".tour"
).
each
(
function
(
i
,
obj
,
steps
){
popOverFactory
(
$
(
this
),
"right"
,
true
)
$
(
this
).
popover
(
"show"
);
})
curr
=
nextStep
(
$
(
this
),
-
1
)
}
console
.
log
(
curr
)
})};
// while ($(document).hasClass("collapse in tour")){
// curr, i = nextStep(curr, i)
// console.log(curr, i)
//
}
})
}
templates/pages/projects/overview.html
View file @
26411c46
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<div
class=
"jumbotron"
>
<div
class=
"jumbotron"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
class=
"col-md-4"
>
<h1
class=
"tour"
title=
"Projects"
content=
"This is the page for all your project"
>
<h1
class=
"tour"
title=
"Projects"
type=
"button"
content=
"This is the page for all your project"
>
<span
class=
"glyphicon glyphicon-home"
aria-hidden=
"true"
></span>
<span
class=
"glyphicon glyphicon-home"
aria-hidden=
"true"
></span>
Projects
Projects
</h1>
</h1>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment