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
759f5c12
Commit
759f5c12
authored
Nov 02, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ANNOTATIONS names: changement des values et name du model de ActiveList
parent
6827c1f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
10 deletions
+36
-10
activelists.js
annotations/static/annotations/activelists.js
+31
-5
main.html
annotations/templates/annotations/main.html
+5
-5
No files found.
annotations/static/annotations/activelists.js
View file @
759f5c12
...
...
@@ -6,15 +6,28 @@
annotationsAppActiveLists
.
controller
(
'ActiveListsController'
,
[
'$scope'
,
'$rootScope'
,
'$timeout'
,
function
(
$scope
,
$rootScope
,
$timeout
)
{
//Lists change
$scope
.
activeListsChange
=
function
()
{
var
selected
=
$
(
'.selectpicker option:selected'
).
val
();
var
newActive
=
{};
$
(
'.selectpicker option:selected'
).
each
(
function
(
item
,
opt
)
{
console
.
log
(
opt
)
// ex opt:
// <option id="list---748" value="MAINLIST">MAINLIST</option>
var
id
=
opt
.
id
.
split
(
"---"
,
2
)[
1
];
newActive
[
id
]
=
opt
.
value
;
if
(
opt
.
value
==
'map list'
){
var
name
=
"map list"
var
value
=
"MAPLIST"
}
else
if
(
opt
.
value
==
"stop list"
){
var
name
=
"stop list"
var
value
=
"STOPLIST"
}
else
{
var
name
=
"candidate list"
var
value
=
"MAINLIST"
}
newActive
[
id
]
=
{
"value"
:
value
,
"name"
:
name
};
});
// ex: {745: "MAINLIST", 748: "MAPLIST"}
...
...
@@ -32,19 +45,32 @@
// FIXME: est-ce qu'on ne pourrait pas directement utiliser lists
// au lieu de recopier dans allListsSelect ?
$rootScope
.
$watchCollection
(
'lists'
,
function
(
newValue
,
oldValue
)
{
console
.
log
(
">>>CHANGE"
,
newValue
,
oldValue
)
if
(
newValue
===
undefined
)
return
;
// reformat lists to allListsSelect
var
allListsSelect
=
[];
// console.log($rootScope.lists)
angular
.
forEach
(
$rootScope
.
lists
,
function
(
value
,
key
)
{
this
.
push
({
//console.log(value, key)
if
(
value
==
"MAPLIST"
){
var
name
=
"map list"
}
else
if
(
value
==
"STOPLIST"
){
var
name
=
"stop list"
}
else
{
var
name
=
"candidate list"
}
allListsSelect
.
push
({
'id'
:
key
,
'label'
:
value
'label'
:
value
,
'name'
:
name
,
});
// initialize activeLists with the MAPLIST by default
if
(
value
==
'MAPLIST'
)
{
$rootScope
.
activeLists
=
{};
$rootScope
.
activeLists
[
key
]
=
value
;
$rootScope
.
activeLists
[
key
]
=
{
"value"
:
value
,
"name"
:
"map terms"
}
;
}
},
allListsSelect
);
...
...
annotations/templates/annotations/main.html
View file @
759f5c12
...
...
@@ -27,9 +27,9 @@
<div
ng-if=
"workflow_finished"
class=
"col-md-4 col-xs-4 tabbable words-panel"
>
<div
class=
"list-selector"
>
<h5>
Select highlighted list(s)
<select
class=
"selectpicker"
multiple
ng-change=
"activeListsChange()"
ng-model=
"lists"
ng-controller=
"ActiveListsController"
>
<select
class=
"selectpicker"
multiple
ng-change=
"activeListsChange()"
ng-model=
"lists"
ng-controller=
"ActiveListsController"
>
<option
ng-repeat=
"item in allListsSelect"
id=
"list---{[{item.id}]}"
ng-disabled=
"{[{ item.label == 'MAPLIST' }]}"
>
{[{item.label
}]}
</option>
<option
ng-repeat=
"item in allListsSelect"
id=
"list---{[{item.id}]}"
>
{[{item.name
}]}
</option>
<!-- to disallow unchecking MapList add this into <option> element: ng-disabled="{[{ item.label == 'MAPLIST' }]}" -->
...
...
@@ -37,9 +37,9 @@
</h5>
<div
class=
"row spacer"
></div>
<ul
class=
"nav nav-pills nav-justified activelists"
>
<li
ng-repeat=
"(listId, list
Name) in activeLists"
ng-class=
"{active: $first == true}"
>
<li
ng-repeat=
"(listId, list
V) in activeLists"
>
<a
href=
"#tab-{[{listId}]}"
data-toggle=
"tab"
>
<span
class=
"{[{list
Name}]} inlay"
>
{[{listN
ame}]}
</span>
<span
class=
"{[{list
V.value}]} inlay"
>
{[{listV.n
ame}]}
</span>
</a>
</li>
</ul>
...
...
@@ -63,7 +63,7 @@
</ul>
</nav>
<div
id=
"addfreengram"
class=
"form-group"
ng-controller=
"NgramInputController"
>
<label
for=
"{[{listId}]}-input"
>
Add a free term to
<span
class=
"{[{listName
}]} inlay"
>
{[{listN
ame}]}
</span>
:
</label>
<label
for=
"{[{listId}]}-input"
>
Add a free term to
<span
class=
"{[{listName
.value}]} inlay"
>
{[{listName.n
ame}]}
</span>
:
</label>
<input
autosave=
"search"
maxlength=
"240"
placeholder=
"Any text"
type=
"text"
class=
"form-control"
id=
"{[{listId}]}-input"
ng-keypress=
"onListSubmit($event, listId)"
>
<button
type=
"submit"
class=
"form-control btn btn-default"
ng-click=
"onListSubmit($event, listId)"
>
Create
&
add
</button>
</div>
...
...
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