Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LabelsTower
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MaitresNageurs
README
LabelsTower
Commits
78b1d6b8
Commit
78b1d6b8
authored
6 years ago
by
Deleted User
Browse files
Options
Downloads
Patches
Plain Diff
Correction des labels non sélectionnés qui n'étaient pas mis à jour lors du setup_session()
parent
91371110
No related branches found
No related tags found
1 merge request
!57
Correction des labels non sélectionnés qui n'étaient pas mis à jour lors du setup_session()
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/static/js/cookies.js
+29
-7
29 additions, 7 deletions
app/static/js/cookies.js
app/templates/browse.html
+9
-4
9 additions, 4 deletions
app/templates/browse.html
with
38 additions
and
11 deletions
app/static/js/cookies.js
+
29
−
7
View file @
78b1d6b8
...
...
@@ -61,10 +61,32 @@ function save_session() {
}
function
setup_session
()
{
hierarchy
.
old_labels_tab
=
str_to_tab
(
getCookie
(
'
old_labels_tab
'
));
hierarchy
.
unselect_tab
=
str_to_tab
(
getCookie
(
'
unselect_labels_tab
'
));
hierarchy
.
labels_language
=
result
.
labels_language
=
getCookie
(
'
language
'
);
hierarchy
.
init_all_labels
();
result
.
maj_results
(
3
);
hierarchy
.
maj_new_labels_tab
();
}
/**
* Return 0 no cookies are found return 0.
* Else return 1 if old_tab cookie are found => the initialization of tutos
* and labels is done from the labels contained in old_tab.
* If language cookie are found, juste th language is modified => labels tab's
* need to be initialise (return 0).
*/
var
success
=
0
;
if
(
getCookie
(
'
language
'
)
!=
null
&&
getCookie
(
'
language
'
).
length
!=
0
)
hierarchy
.
labels_language
=
result
.
labels_language
=
getCookie
(
'
language
'
);
if
(
getCookie
(
'
old_labels_tab
'
)
!=
null
&&
getCookie
(
'
old_labels_tab
'
).
length
!=
0
)
hierarchy
.
old_labels_tab
=
str_to_tab
(
getCookie
(
'
old_labels_tab
'
));
if
(
getCookie
(
'
unselect_labels_tab
'
)
!=
null
&&
getCookie
(
'
unselect_labels_tab
'
).
length
!=
0
)
hierarchy
.
unselect_tab
=
str_to_tab
(
getCookie
(
'
unselect_labels_tab
'
));
if
(
getCookie
(
'
old_labels_tab
'
)
!=
null
&&
getCookie
(
'
old_labels_tab
'
).
length
!=
0
)
{
hierarchy
.
init_all_labels
();
result
.
maj_results
(
3
);
success
=
1
;
}
else
if
(
getCookie
(
'
unselect_labels_tab
'
)
!=
null
&&
getCookie
(
'
unselect_labels_tab
'
).
length
!=
0
)
{
hierarchy
.
init_all_labels
();
result
.
init_result_tab
();
del_unselect_language
();
result
.
del_unselected_results
();
hierarchy
.
maj_new_labels_tab
();
success
=
1
;
}
return
(
success
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/templates/browse.html
+
9
−
4
View file @
78b1d6b8
...
...
@@ -148,9 +148,12 @@
* Initialise the two different par of hierarcy and
* the array that contain all tutos.
*/
hierarchy
.
init_all_labels
();
hierarchy
.
init_new_labels_tab
();
result
.
init_result_tab
();
setup
=
setup_session
();
if
(
setup
==
0
)
{
hierarchy
.
init_all_labels
();
hierarchy
.
init_new_labels_tab
();
result
.
init_result_tab
();
}
}
function
update_loading
(
value
)
{
...
...
@@ -250,6 +253,7 @@
this
.
new_labels_tab
=
research
(
this
.
new_labels_tab
,
this
.
all_labels
);
this
.
old_labels_tab
=
research
(
this
.
old_labels_tab
,
this
.
all_labels
);
this
.
unselect_tab
=
research
(
this
.
unselect_tab
,
this
.
all_labels
);
save_session
();
update_loading
(
1
);
},
add_label_to_old_tab
:
function
(
index
,
source
)
{
...
...
@@ -268,6 +272,7 @@
this
.
unselect_tab
.
splice
(
index
,
1
);
result
.
maj_results
(
3
);
}
save_session
();
update_loading
(
1
);
},
rm_label_of_old_tab
:
function
(
index
)
{
...
...
@@ -320,7 +325,7 @@
hierarchy
.
maj_new_labels_tab
();
}
else
result
.
maj_results
(
3
);
save_session
();
save_session
();
update_loading
(
1
);
},
maj_new_labels_tab
:
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment