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
e31d3672
Commit
e31d3672
authored
Nov 30, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE] search in abstract OK
parent
d9cf3ba1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
32 deletions
+75
-32
NGrams_dyna_chart_and_table.js
static/js/NGrams_dyna_chart_and_table.js
+29
-29
jquery.dynatable.js
static/js/jquery/jquery.dynatable.js
+46
-3
No files found.
static/js/NGrams_dyna_chart_and_table.js
View file @
e31d3672
...
...
@@ -182,35 +182,35 @@ function printCorpuses() {
$
(
"#closecorpuses"
).
click
();
var
whichlist
=
$
(
'input[name=whichlist]:checked'
).
val
()
var
url
=
window
.
location
.
origin
+
"/api/node/"
+
selected_corpus
+
"/ngrams/list/"
+
whichlist
+
"?custom"
console
.
log
(
url
)
GET_
(
url
,
function
(
results
)
{
if
(
Object
.
keys
(
results
).
length
>
0
)
{
var
sub_ngrams_data
=
{
"ngrams"
:[],
"scores"
:
$
.
extend
({},
NGrams
[
"main"
].
scores
)
}
if
(
whichlist
==
"stop"
)
{
for
(
var
r
in
results
)
{
var
a_ngram
=
results
[
r
]
a_ngram
[
"state"
]
=
System
[
0
][
"statesD"
][
"delete"
]
sub_ngrams_data
[
"ngrams"
].
push
(
a_ngram
)
}
var
result
=
Main_test
(
sub_ngrams_data
,
NGrams
[
"main"
].
scores
.
initial
,
"filter_stop-list"
)
}
if
(
whichlist
==
"miam"
)
{
for
(
var
i
in
NGrams
[
"main"
].
ngrams
)
{
var
local_ngram
=
NGrams
[
"main"
].
ngrams
[
i
]
console
.
log
(
local_ngram
)
}
var
result
=
Main_test
(
sub_ngrams_data
,
NGrams
[
"main"
].
scores
.
initial
,
"filter_all"
)
}
}
});
var
url
=
window
.
location
.
origin
+
"/api/node/"
+
selected_corpus
+
"/ngrams/list/"
+
whichlist
+
"?custom"
console
.
log
(
url
)
GET_
(
url
,
function
(
results
)
{
if
(
Object
.
keys
(
results
).
length
>
0
)
{
var
sub_ngrams_data
=
{
"ngrams"
:[],
"scores"
:
$
.
extend
({},
NGrams
[
"main"
].
scores
)
}
if
(
whichlist
==
"stop"
)
{
for
(
var
r
in
results
)
{
var
a_ngram
=
results
[
r
]
a_ngram
[
"state"
]
=
System
[
0
][
"statesD"
][
"delete"
]
sub_ngrams_data
[
"ngrams"
].
push
(
a_ngram
)
}
var
result
=
Main_test
(
sub_ngrams_data
,
NGrams
[
"main"
].
scores
.
initial
,
"filter_stop-list"
)
}
if
(
whichlist
==
"miam"
)
{
for
(
var
i
in
NGrams
[
"main"
].
ngrams
)
{
var
local_ngram
=
NGrams
[
"main"
].
ngrams
[
i
]
console
.
log
(
local_ngram
)
}
var
result
=
Main_test
(
sub_ngrams_data
,
NGrams
[
"main"
].
scores
.
initial
,
"filter_all"
)
}
}
});
}
...
...
static/js/jquery/jquery.dynatable.js
View file @
e31d3672
...
...
@@ -1149,6 +1149,8 @@
if
(
settings
.
features
.
paginate
)
{
settings
.
dataset
.
page
=
1
;
}
console
.
log
(
"ADD:"
)
console
.
log
(
value
)
settings
.
dataset
.
queries
[
name
]
=
value
;
obj
.
$element
.
trigger
(
'dynatable:queries:added'
,
[
name
,
value
]);
return
dt
;
...
...
@@ -1177,9 +1179,50 @@
}
}
// collect all records that return true for query
settings
.
dataset
.
records
=
$
.
map
(
settings
.
dataset
.
records
,
function
(
record
)
{
return
_this
.
functions
[
query
](
record
,
value
)
?
record
:
null
;
});
if
(
$
(
'input[name=searchAB]:checked'
).
length
==
0
)
{
settings
.
dataset
.
records
=
$
.
map
(
settings
.
dataset
.
records
,
function
(
record
)
{
return
_this
.
functions
[
query
](
record
,
value
)
?
record
:
null
;
});
}
else
{
var
pageurl
=
window
.
location
.
href
.
split
(
"/"
)
var
cid
;
for
(
var
i
in
pageurl
)
{
if
(
pageurl
[
i
]
==
"corpus"
)
{
cid
=
parseInt
(
i
);
break
;
}
}
var
corpus_id
=
pageurl
[
cid
+
1
];
var
search_api
=
window
.
location
.
origin
+
"/v1.0/nodes/"
+
corpus_id
+
"/children/ids?limit=1000&contain="
+
encodeURI
(
value
)
var
coincidences_
=
[]
$
.
ajax
({
type
:
"GET"
,
url
:
search_api
,
dataType
:
"json"
,
async
:
false
,
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
var
results_
=
{}
if
(
data
.
pagination
.
total
>
0
)
{
for
(
var
i
in
data
.
data
)
{
results_
[
data
.
data
[
i
].
id
]
=
true
}
for
(
var
i
in
settings
.
dataset
.
records
)
{
if
(
results_
[
settings
.
dataset
.
records
[
i
].
id
]
)
{
coincidences_
.
push
(
settings
.
dataset
.
records
[
i
]
)
}
}
}
},
error
:
function
(
exception
)
{
console
.
log
(
"error in search_api:"
);
console
.
log
(
exception
)
console
.
log
(
" - - - -- - - -"
)
}
})
settings
.
dataset
.
records
=
coincidences_
}
}
}
settings
.
dataset
.
queryRecordCount
=
obj
.
records
.
count
();
...
...
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