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
e0b7de0e
Commit
e0b7de0e
authored
Jul 12, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] selected nodes in graph explorer become more highlighted in annotations/doc view
parent
e04e0b51
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
app.js
annotations/static/annotations/app.js
+5
-1
highlight.js
annotations/static/annotations/highlight.js
+15
-7
extras_explorerjs.js
static/lib/graphExplorer/extras_explorerjs.js
+2
-3
No files found.
annotations/static/annotations/app.js
View file @
e0b7de0e
...
...
@@ -29,7 +29,11 @@
$rootScope
.
projectId
=
path
[
1
];
$rootScope
.
corpusId
=
path
[
2
];
$rootScope
.
docId
=
path
[
3
];
$rootScope
.
focusNgram
=
path
[
4
];
// ex: ["483", "3561", "9754", "35183"]
// (passed from graphExplorer selections)
$rootScope
.
focusNgrams
=
path
[
4
].
split
(
","
);
// debug
// console.log("==> $rootScope <==")
...
...
annotations/static/annotations/highlight.js
View file @
e0b7de0e
...
...
@@ -434,10 +434,10 @@
* @param $rootScope (global) to check activeLists and list names
*
* add-on mechanism:
* @param focusNgram
: an ngram_id
to higlight more
* @param focusNgram
s: some ngram_ids
to higlight more
* (it is assumed to be already in one of the active lists)
*/
function
compileNgramsHtml
(
annotations
,
textMapping
,
$rootScope
,
focusNgram
)
{
function
compileNgramsHtml
(
annotations
,
textMapping
,
$rootScope
,
focusNgram
s
)
{
if
(
typeof
$rootScope
.
activeLists
==
"undefined"
)
return
;
if
(
_
.
keys
(
$rootScope
.
activeLists
).
length
===
0
)
return
;
var
templateBegin
=
"<span ng-controller='TextSelectionController' ng-click='onClick($event)' class='keyword-inline'>"
;
...
...
@@ -540,8 +540,15 @@
// 2nd pass for result html
// =========================
// first pass for anchors
// ======================
// a small lookup for possible focus items (they'll get different css)
var
checkFocusOn
=
{}
if
(
focusNgrams
)
{
for
(
var
i
in
focusNgrams
)
{
var
focusNgramId
=
focusNgrams
[
i
]
checkFocusOn
[
focusNgramId
]
=
true
}
}
angular
.
forEach
(
sortedSizeAnnotations
,
function
(
annotation
)
{
// again exclude ngrams that are into inactive lists
if
(
$rootScope
.
activeLists
[
annotation
.
list_id
]
===
undefined
)
return
;
...
...
@@ -549,8 +556,9 @@
// listName now used to setup css class
var
cssClass
=
$rootScope
.
lists
[
annotation
.
list_id
];
// except if FOCUS
if
(
focusNgram
&&
(
annotation
.
uuid
==
focusNgram
||
annotation
.
group
==
focusNgram
))
{
// except if uuid or group mainform is in FOCUS items
if
(
focusNgrams
&&
(
checkFocusOn
[
annotation
.
uuid
]
||
checkFocusOn
[
annotation
.
group
]))
{
cssClass
=
"FOCUS"
}
...
...
@@ -642,7 +650,7 @@
'#title'
:
angular
.
copy
(
$rootScope
.
title
)
},
$rootScope
,
$rootScope
.
focusNgram
// new: optional focus ngram
$rootScope
.
focusNgram
s
// optional focus ngrams
);
// inject highlighted HTML
angular
.
forEach
(
result
,
function
(
html
,
eltId
)
{
...
...
static/lib/graphExplorer/extras_explorerjs.js
View file @
e0b7de0e
...
...
@@ -612,9 +612,8 @@ function getTopPapers(type){
}
// ex url_mainIDs = {projects: 1, corpora: 2690}
// link to matching document
var
getpubAPI
=
window
.
location
.
origin
+
'/projects/'
+
url_mainIDs
[
"projects"
]
+
'/corpora/'
+
url_mainIDs
[
"corpora"
]
+
'/documents/'
+
pub
[
"id"
]
// link to matching document (with focus=selections_ids param)
var
getpubAPI
=
window
.
location
.
origin
+
'/projects/'
+
url_mainIDs
[
"projects"
]
+
'/corpora/'
+
url_mainIDs
[
"corpora"
]
+
'/documents/'
+
pub
[
"id"
]
+
'/focus='
+
theids
.
join
(
","
)
var
ifjournal
=
""
,
ifauthors
=
""
,
ifkeywords
=
""
,
ifdate
=
""
,
iftitle
=
""
;
...
...
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