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
20af58c3
Commit
20af58c3
authored
Jun 08, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX: annotation view actions affect mainform if subform is highlighted
parent
bdc8d2a1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
highlight.js
annotations/static/annotations/highlight.js
+9
-7
views.py
annotations/views.py
+10
-3
No files found.
annotations/static/annotations/highlight.js
View file @
20af58c3
...
...
@@ -27,7 +27,7 @@
// attach the annotation scope dynamically
if
(
keyword
)
{
// console.log('TextSelectionController found highlighted keyword annotation: ' + keyword.text)
keyword
.
romdebuginfo
=
"source = TextSelectionController"
;
//
keyword.romdebuginfo = "source = TextSelectionController" ;
$scope
.
keyword
=
keyword
;
}
...
...
@@ -35,7 +35,7 @@
$rootScope
.
$emit
(
"positionAnnotationMenu"
,
e
.
pageX
,
e
.
pageY
);
$rootScope
.
$emit
(
"toggleAnnotationMenu"
,
$scope
.
keyword
);
// $rootScope.$emit("toggleAnnotationMenu", {'uuid':42,'list_id':1,'text':'gotcha'});
console
.
log
(
"EMIT toggleAnnotationMenu with
\
$scope.keyword: '"
+
$scope
.
keyword
.
text
+
"'"
)
//
console.log("EMIT toggleAnnotationMenu with \$scope.keyword: '" + $scope.keyword.text +"'")
e
.
stopPropagation
();
};
}]);
...
...
@@ -122,6 +122,7 @@
// otherwise the menu for mainlist items can hide the menu for map items
if
(
$rootScope
.
lists
[
annotation
.
list_id
]
==
"MAPLIST"
)
{
console
.
log
(
$scope
)
$scope
.
menuItems
.
push
({
// "tgtListName" is just used to render the GUI explanation
'tgtListName'
:
'STOPLIST'
,
...
...
@@ -257,13 +258,14 @@
* post/delete
*/
$scope
.
onMenuClick
=
function
(
$event
,
crudActions
)
{
console
.
warn
(
'in onMenuClick'
)
console
.
warn
(
'item.crudActions'
)
console
.
warn
(
crudActions
)
//
console.warn('in onMenuClick')
//
console.warn('item.crudActions')
//
console.warn(crudActions)
if
(
angular
.
isObject
(
$scope
.
selection_text
))
{
var
ngramId
=
$scope
.
selection_text
.
uuid
var
mainformId
=
$scope
.
selection_text
.
group
var
ngramText
=
$scope
.
selection_text
.
text
var
lastCallback
=
function
()
{
...
...
@@ -291,7 +293,7 @@
MainApiChangeNgramHttpService
[
action
](
{
'listId'
:
listId
,
'ngramIdList'
:
ngramId
},
'ngramIdList'
:
mainformId
?
mainformId
:
ngramId
},
// on success
function
(
data
)
{
...
...
@@ -548,7 +550,7 @@
var
cssClass
=
$rootScope
.
lists
[
annotation
.
list_id
];
// except if FOCUS
if
(
annotation
.
uuid
==
focusNgram
)
{
if
(
focusNgram
&&
(
annotation
.
uuid
==
focusNgram
||
annotation
.
group
==
focusNgram
)
)
{
cssClass
=
"FOCUS"
}
...
...
annotations/views.py
View file @
20af58c3
...
...
@@ -40,6 +40,8 @@ class NgramList(APIView):
"""
Get all ngrams for a doc id, sorted by list
usual route: /annotations/documents/<docid>
NB1 : we are within a doc only
NB2 : MAINLIST items are actually MAINLIST without MAP items
NB3 : mostly the mainforms are in lists, but doc can have subform
...
...
@@ -122,8 +124,12 @@ class NgramList(APIView):
# skip object
continue
if
mainform_id
==
ngram_id
:
group
=
None
else
:
group
=
mainform_id
# normal case
doc_ngram_list_add
((
ngram_id
,
obj
.
terms
,
w
,
list_id
))
doc_ngram_list_add
((
ngram_id
,
obj
.
terms
,
group
,
w
,
list_id
))
# debug
# print("annotations.views.NgramList.doc_ngram_list: ", doc_ngram_list)
...
...
@@ -131,10 +137,11 @@ class NgramList(APIView):
'
%
s'
%
doc_id
:
[
{
'uuid'
:
ngram_id
,
'group'
:
group
,
# the mainform if there is a group
'text'
:
ngram_text
,
'occs'
:
ngram_occ
urrence
s
,
'occs'
:
ngram_occs
,
'list_id'
:
list_id
,}
for
(
ngram_id
,
ngram_text
,
ngram_occurrence
s
,
list_id
)
in
doc_ngram_list
for
(
ngram_id
,
ngram_text
,
group
,
ngram_occ
s
,
list_id
)
in
doc_ngram_list
],
'lists'
:
lists
}}
...
...
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