Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
122ac64e
Commit
122ac64e
authored
Mar 15, 2017
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autocompletes for institutions on user side
parent
3bde2028
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
177 deletions
+24
-177
comex_user_autocompletes.js
static/js/comex_user_autocompletes.js
+24
-177
No files found.
static/js/comex_user_autocompletes.js
View file @
122ac64e
...
@@ -84,172 +84,6 @@
...
@@ -84,172 +84,6 @@
});
});
// autocomplete institution
$
(
function
()
{
var
$orgInput
=
$
(
'#team_lab'
)
var
orgList
=
[
"Centre National de la Recherche Scientifique (CNRS)"
,
"Institut National de la Recherche Agronomique (INRA)"
,
"Université Paris 6 – Pierre et Marie Curie (UPMC)"
,
"University of Warwick"
,
"Instituto Superior das Ciências do Trabalho e da Empresa - Instituto Universitário de Lisboa"
,
"Ecole Normale Supérieure (ENS) - Ulm"
,
"Ecole Polytechnique (X), U. Paris Saclay"
,
"Institut National de Recherche en Informatique et Automatique (INRIA)"
,
"Université Paris 7 – Diderot"
,
"Universidad Nacional Autonoma de Mexico (UNAM)"
,
"Commissariat à l'Energie Atomique (CEA)"
,
"Institut de Recherche en Sciences et Technologies pour l'Environnement et l'Agriculture (IRSTEA)"
,
"Université Paris 1 – Panthéon-Sorbonne"
,
"University College London (UCL)"
,
"State University of São Paulo (UNESP)"
,
"Open University"
,
"Universitat de Barcelona"
,
"Institut des Systèmes Complexes de Paris Ile-de-France (ISCPIF)"
,
"Institut des Systèmes Complexes Rhône Alpes (IXXI)"
,
"Complex System Society"
,
"Institut National de la Santé et de la Recherche Médicale (INSERM), UMRS 707"
,
"Universidad de Zaragoza"
,
"Université du Havre"
,
"Centre for Nonlinear Studies, Institute of Cybernetics at Tallinn University of Technology"
,
"Eotvos Lorand University"
,
"Indiana University"
,
"Institut de Recherche pour le Développement"
,
"Max Planck Institute for Mathematics in the Sciences"
,
"Northeastern University"
,
"Santa Fe Institute"
,
"Universidad Nacional de Colombia"
,
"Universitat Politècnica de Catalunya (UPC)"
,
"Université Grenoble-Alpes"
,
"Université Paris 5 – Descartes"
,
"Sapienza - Università di Roma"
,
"Centre de Coopération Internationale en Recherche Agronomique pour le Développement"
,
"Commonwealth Scientific and Industrial Research Organization"
,
"Complex Open Systems Research Network (COSNet)"
,
"Cranfield Universtiy"
,
"Facultés Universitaires Notre-Dame de la Paix"
,
"Umeå University"
,
"Universidade de Lisboa"
,
"Universitat de les Illes Balears"
,
"Université de Nice – Sophia Antipolis"
,
"Université de Strasbourg"
,
"Université Libre de Bruxelles"
,
"Université Lyon 2 – Lumière"
,
"Université Paris 11 – Sud"
,
"Université Toulouse 1 – Capitole"
,
"University of Limerick"
,
"University of Manchester"
,
"University of Oxford"
,
"University of Cambridge"
,
"University of Stanford"
,
"University of California (UCal), Berkeley"
,
"ETH Zürich"
,
"Bandung Fe Institute"
,
"Bristol Centre for Complexity Sciences"
,
"Center for Genomic Regulation"
,
"Chalmers University of Technology"
,
"Consiglio Nazionale delle Ricerche"
,
"Ecole Polytechnique Fédérale de Lausanne"
,
"Institut Curie"
,
"Institute for Scientific Interchange Foundation"
,
"Instituto de Sistemas Complejos de Valparaiso"
,
"King's College London"
,
"London School of Economics and Political Sciences"
,
"Nanyang Technological University"
,
"Queen Mary, University of London"
,
"Ruhr Universität Bochum"
,
"Technion - Israel Institute of Technology"
,
"Universidad del Rosario"
,
"Universidad Politécnica de Madrid"
,
"Universidade Federal do Rio Grande do Sul"
,
"Universitat Rovira i Virgili"
,
"Université catholique de Louvain"
,
"Université de Cergy-Pontoise"
,
"Université de Lille"
,
"Université de Rouen"
,
"Université de Versailles Saint Quentin"
,
"Université Européenne de Bretagne"
,
"Université Paris 14 – Est Créteil"
,
"University of Amsterdam"
,
"University of Surrey"
,
"Vrije Universiteit Brussel"
,
"Wroclaw University of Technology"
,
"UPM Autonomous Systems Laboratory (ASLab)"
,
"Agency for Science, Technology and Research (A*STAR), Singapore"
,
"Anglia Ruskin University"
,
"ARC Centre for Complex Systems (ACCS)"
,
"Arizona State University"
,
"Brunel University"
,
"Center for the Study of Complex Systems"
,
"Central European University"
,
"Centre for Complex Systems"
,
"Cracow University of Economics, Cracow, Poland"
,
"Delft University of Technology"
,
"Eastern Connecticut State University"
,
"Ecole des Hautes Etudes en Sciences Sociales (EHESS)"
,
"Ecole des Ponts ParisTech, U. Paris Est"
,
"Ecole Superieure de Physique et Chimie Industrielle (ESPCI)"
,
"Emergence Paris"
,
"Ghent University"
,
"Harvard University"
,
"Imperial College London"
,
"Institut des Systèmes Complexes en Normandie"
,
"Institut National Sport Expertise Performance (INSEP)"
,
"Institute for Complex Systems and Mathematical Biology"
,
"Institute for Complex Systems Simulation"
,
"Institute of Energy and Sustainable Development"
,
"Massachusetts Institute of Technology (MIT)"
,
"National Center for Scientific Research 'Demokritos'"
,
"National Centre for Nuclear Research (POLATOM)"
,
"Non-linearity and Complexity Research Group, Aston"
,
"Northwestern University"
,
"Sabanci University"
,
"Swedish Morphological Society"
,
"Technical University of Denmark"
,
"Tel Aviv University"
,
"Telecom ParisTech"
,
"The Australian National University"
,
"The University of Melbourne"
,
"Universidad Carlos III de Madrid"
,
"Universidade Estadual de Campinas"
,
"Universidade Federal do Rio de Janeiro"
,
"Universidade Nova de Lisboa"
,
"Università degli Studi di Bologna"
,
"Università Roma Tre"
,
"Université de Bourgogne"
,
"Université de Montréal"
,
"Université de Valenciennes et du Hainaut-Cambrésis"
,
"Université Paris 4 – Sorbonne"
,
"Université Toulouse 3 – Paul Sabatier"
,
"University of Calgary"
,
"University of Essex"
,
"University of Exeter"
,
"University of Groningen"
,
"University of Hamburg"
,
"University of Lausanne"
,
"University of Macedonia, Thessaloniki, Greece"
,
"University of Maryland"
,
"University of Warsaw"
,
"Uppsala Universitet"
,
"Warsaw University of Technology"
,
"University of California (UCal), Los Angeles"
,
"Institute of Computer Science of Czech Republic (AV ČR)"
,
"Institute for Condensed Matter Physics of the National Academy of Sciences of Ukraine (ICMP)"
,]
$orgInput
.
autocomplete
({
source
:
orgList
,
autoFocus
:
true
,
select
:
function
(
event
,
ui
)
{
// console.log(ui)
// not tab because used to move on to next field
if
(
event
.
keyCode
==
9
)
return
false
;
$orgInput
[
0
].
style
.
fontWeight
=
"bold"
}
});
});
// autocomplete via remote aggs api
// autocomplete via remote aggs api
...
@@ -257,18 +91,25 @@
...
@@ -257,18 +91,25 @@
// => must match the html form input id (eg #keywords)
// => must match the html form input id (eg #keywords)
// => supposed to also match the REST param
// => supposed to also match the REST param
// (eg services/api/aggs?field=keywords)
// (eg services/api/aggs?field=keywords)
function
remoteAutocompleteInit
(
fieldName
)
{
var
nMax
=
100
function
remoteAutocompleteInit
(
fieldName
,
hap
,
altApiName
)
{
var
hapaxThresh
=
1
var
nMax
=
100
var
hapaxThresh
=
1
if
(
hap
!=
null
)
{
hapaxThresh
=
hap
}
var
apiName
=
fieldName
if
(
altApiName
!=
null
)
{
apiName
=
altApiName
}
var
$theInput
=
$
(
'#'
+
fieldName
)
var
$theInput
=
$
(
'#'
+
fieldName
)
var
theValuedArray
=
[]
var
theValuedArray
=
[]
$
.
ajax
({
$
.
ajax
({
type
:
'GET'
,
type
:
'GET'
,
dataType
:
'json'
,
dataType
:
'json'
,
url
:
"/services/api/aggs?field="
+
field
Name
+
"&hapax="
+
hapaxThresh
,
url
:
"/services/api/aggs?field="
+
api
Name
+
"&hapax="
+
hapaxThresh
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
// ex data is array like:
// ex data is array like:
// [{"occs": 1116, "x": null},
// [{"occs": 1116, "x": null},
...
@@ -279,8 +120,11 @@ function remoteAutocompleteInit(fieldName) {
...
@@ -279,8 +120,11 @@ function remoteAutocompleteInit(fieldName) {
for
(
var
i
in
data
)
{
for
(
var
i
in
data
)
{
if
(
data
[
i
].
x
!=
null
)
{
if
(
data
[
i
].
x
!=
null
)
{
var
item
=
data
[
i
].
x
var
item
=
data
[
i
].
x
var
occs
=
data
[
i
].
occs
var
occs
=
data
[
i
].
occs
||
data
[
i
].
n
theValuedArray
.
push
([
item
,
occs
])
if
(
item
&&
item
!=
null
)
{
theValuedArray
.
push
([
item
,
occs
])
}
}
}
}
}
...
@@ -322,9 +166,12 @@ function remoteAutocompleteInit(fieldName) {
...
@@ -322,9 +166,12 @@ function remoteAutocompleteInit(fieldName) {
}
}
$
(
function
()
{
remoteAutocompleteInit
(
'keywords'
)
// initialize the remote ones
remoteAutocompleteInit
(
'hashtags'
)
remoteAutocompleteInit
(
'keywords'
)
});
remoteAutocompleteInit
(
'lab_label'
,
1
,
'laboratories'
)
if
(
document
.
getElementById
(
'hashtags'
))
remoteAutocompleteInit
(
'hashtags'
)
if
(
document
.
getElementById
(
'inst_label'
)
)
remoteAutocompleteInit
(
'inst_label'
,
1
,
'organizations'
)
console
.
log
(
"autocompletes load OK"
)
console
.
log
(
"autocompletes load OK"
)
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