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
3ce5f459
Commit
3ce5f459
authored
Jul 13, 2016
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'romain-reintegration-graphExplorer' into anoe-graph
parents
abf2b592
d053c10f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
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
+3
-4
No files found.
annotations/static/annotations/app.js
View file @
3ce5f459
...
@@ -29,7 +29,11 @@
...
@@ -29,7 +29,11 @@
$rootScope
.
projectId
=
path
[
1
];
$rootScope
.
projectId
=
path
[
1
];
$rootScope
.
corpusId
=
path
[
2
];
$rootScope
.
corpusId
=
path
[
2
];
$rootScope
.
docId
=
path
[
3
];
$rootScope
.
docId
=
path
[
3
];
$rootScope
.
focusNgram
=
path
[
4
];
// ex: ["483", "3561", "9754", "35183"]
// (passed from graphExplorer selections)
$rootScope
.
focusNgrams
=
path
[
4
].
split
(
","
);
// debug
// debug
// console.log("==> $rootScope <==")
// console.log("==> $rootScope <==")
...
...
annotations/static/annotations/highlight.js
View file @
3ce5f459
...
@@ -434,10 +434,10 @@
...
@@ -434,10 +434,10 @@
* @param $rootScope (global) to check activeLists and list names
* @param $rootScope (global) to check activeLists and list names
*
*
* add-on mechanism:
* 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)
* (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
(
typeof
$rootScope
.
activeLists
==
"undefined"
)
return
;
if
(
_
.
keys
(
$rootScope
.
activeLists
).
length
===
0
)
return
;
if
(
_
.
keys
(
$rootScope
.
activeLists
).
length
===
0
)
return
;
var
templateBegin
=
"<span ng-controller='TextSelectionController' ng-click='onClick($event)' class='keyword-inline'>"
;
var
templateBegin
=
"<span ng-controller='TextSelectionController' ng-click='onClick($event)' class='keyword-inline'>"
;
...
@@ -540,8 +540,15 @@
...
@@ -540,8 +540,15 @@
// 2nd pass for result html
// 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
)
{
angular
.
forEach
(
sortedSizeAnnotations
,
function
(
annotation
)
{
// again exclude ngrams that are into inactive lists
// again exclude ngrams that are into inactive lists
if
(
$rootScope
.
activeLists
[
annotation
.
list_id
]
===
undefined
)
return
;
if
(
$rootScope
.
activeLists
[
annotation
.
list_id
]
===
undefined
)
return
;
...
@@ -549,8 +556,9 @@
...
@@ -549,8 +556,9 @@
// listName now used to setup css class
// listName now used to setup css class
var
cssClass
=
$rootScope
.
lists
[
annotation
.
list_id
];
var
cssClass
=
$rootScope
.
lists
[
annotation
.
list_id
];
// except if FOCUS
// except if uuid or group mainform is in FOCUS items
if
(
focusNgram
&&
(
annotation
.
uuid
==
focusNgram
||
annotation
.
group
==
focusNgram
))
{
if
(
focusNgrams
&&
(
checkFocusOn
[
annotation
.
uuid
]
||
checkFocusOn
[
annotation
.
group
]))
{
cssClass
=
"FOCUS"
cssClass
=
"FOCUS"
}
}
...
@@ -642,7 +650,7 @@
...
@@ -642,7 +650,7 @@
'#title'
:
angular
.
copy
(
$rootScope
.
title
)
'#title'
:
angular
.
copy
(
$rootScope
.
title
)
},
},
$rootScope
,
$rootScope
,
$rootScope
.
focusNgram
// new: optional focus ngram
$rootScope
.
focusNgram
s
// optional focus ngrams
);
);
// inject highlighted HTML
// inject highlighted HTML
angular
.
forEach
(
result
,
function
(
html
,
eltId
)
{
angular
.
forEach
(
result
,
function
(
html
,
eltId
)
{
...
...
static/lib/graphExplorer/extras_explorerjs.js
View file @
3ce5f459
...
@@ -612,9 +612,8 @@ function getTopPapers(type){
...
@@ -612,9 +612,8 @@ function getTopPapers(type){
}
}
// ex url_mainIDs = {projects: 1, corpora: 2690}
// ex url_mainIDs = {projects: 1, corpora: 2690}
// link to matching document
// 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"
]
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
=
""
;
var
ifjournal
=
""
,
ifauthors
=
""
,
ifkeywords
=
""
,
ifdate
=
""
,
iftitle
=
""
;
...
@@ -635,7 +634,7 @@ function getTopPapers(type){
...
@@ -635,7 +634,7 @@ function getTopPapers(type){
jsstuff
+=
"wnws_buffer = window.open('"
+
getpubAPI
+
"', 'popUpWindow' , '"
+
jsparams
+
"')"
;
jsstuff
+=
"wnws_buffer = window.open('"
+
getpubAPI
+
"', 'popUpWindow' , '"
+
jsparams
+
"')"
;
output
+=
"<li><a onclick=
\"
"
+
jsstuff
+
"
\"
target=_blank>"
+
pub
[
"title"
]
+
"</a>. "
+
ifauthors
+
". "
+
ifjournal
+
". "
+
ifkeywords
+
". "
+
ifdate
+
"
\n
"
;
output
+=
"<li><a onclick=
\"
"
+
jsstuff
+
"
\"
target=_blank>"
+
pub
[
"title"
]
+
"</a>. "
+
ifauthors
+
". "
+
ifjournal
+
". "
+
ifkeywords
+
". "
+
ifdate
+
"
\n
"
;
output
+=
'<a href="'
+
gquery
+
'" target=_blank><img title="Query t
o Google" src="'
+
window
.
location
.
origin
+
'/static/img/google
.png"></img></a>'
output
+=
'<a href="'
+
gquery
+
'" target=_blank><img title="Query t
he web" src="'
+
window
.
location
.
origin
+
'/static/img/searx
.png"></img></a>'
output
+=
"</li>
\n
"
;
output
+=
"</li>
\n
"
;
// for(var j in pub) {
// for(var j in pub) {
// if(j!="abstract")
// if(j!="abstract")
...
...
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