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
1a439aeb
Commit
1a439aeb
authored
Nov 30, 2015
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'samuel' into unstable
parents
6570d3c1
e31d3672
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
119 additions
and
46 deletions
+119
-46
views.py
annotations/views.py
+3
-0
ngrams.py
rest_v1_0/ngrams.py
+8
-3
Docs_dyna_chart_and_table.js
static/js/Docs_dyna_chart_and_table.js
+18
-0
NGrams_dyna_chart_and_table.js
static/js/NGrams_dyna_chart_and_table.js
+36
-36
jquery.dynatable.js
static/js/jquery/jquery.dynatable.js
+46
-3
documents.html
templates/corpus/documents.html
+2
-2
terms.html
templates/corpus/terms.html
+6
-2
No files found.
annotations/views.py
View file @
1a439aeb
...
...
@@ -90,6 +90,9 @@ class NgramEdit(APIView):
'list_id'
:
list_id
,
}
for
ngram_id
in
ngram_ids
)
def
put
(
self
,
request
,
list_id
,
ngram_ids
):
return
Response
(
None
,
204
)
def
delete
(
self
,
request
,
list_id
,
ngram_ids
):
"""
Delete a ngram from a list
...
...
rest_v1_0/ngrams.py
View file @
1a439aeb
...
...
@@ -305,9 +305,14 @@ class Ngrams(APIView):
def
post
(
self
,
request
,
node_id
):
return
JsonHttpResponse
([
"POST"
,
"ok"
])
def
delete
(
self
,
request
,
node_id
):
print
(
node_id
)
return
JsonHttpResponse
([
"DELETE"
,
"ok"
])
def
put
(
self
,
request
,
corpus_id
):
"""
Add ngrams to Miam list
"""
group_rawreq
=
dict
(
request
.
data
)
print
(
"group_rawreq:"
)
print
(
group_rawreq
)
return
JsonHttpResponse
([
"PUT"
,
"ok"
])
class
Group
(
APIView
):
'''
...
...
static/js/Docs_dyna_chart_and_table.js
View file @
1a439aeb
...
...
@@ -434,6 +434,9 @@ function Main_test( Data , SearchFilter ) {
pushState
:
false
,
// sort: false //i need to fix the sorting function... the current one just sucks
},
// inputs: {
// queries: $('#searchAB')
// },
writers
:
{
_rowWriter
:
ulWriter
// _cellWriter: customCellWriter
...
...
@@ -454,6 +457,19 @@ function Main_test( Data , SearchFilter ) {
var
the_content
=
$
(
"#filter_search"
).
html
();
$
(
""
+
the_content
).
insertAfter
(
"#dynatable-query-search-my-ajax-table"
)
// $('#searchAB').click( function() {
// if($(this).is(':checked')) {
// console.log( "Do stuff")
// $("#dynatable-query-search-my-ajax-table").keyup(function (e) {
// if (e.keyCode == 13) {
// console.log("Do stuff: Just pressed ENTER")
// }
// })
// }
// });
// MyTable.data('dynatable').settings.inputs.queries = { $('#searchAB') }
// .insertAfter("#dynatable-query-search-my-ajax-table")
return
"OK"
...
...
@@ -461,6 +477,7 @@ function Main_test( Data , SearchFilter ) {
function
SearchFilters
(
elem
)
{
var
MODE
=
elem
.
value
;
...
...
@@ -501,6 +518,7 @@ function SearchFilters( elem ) {
// FIRST portion of code to be EXECUTED:
// (3) Get records and hyperdata for paginator
$
.
ajax
({
...
...
static/js/NGrams_dyna_chart_and_table.js
View file @
1a439aeb
...
...
@@ -631,15 +631,15 @@ $("#Save_All").click(function(){
var
corpus_id
=
getIDFromURL
(
"corpus"
)
// not used
// CRUD( list_id , "" , Object.keys(FlagsBuffer["inmap"]).map(Number) , [] , "PUT", function(result) {
// console.log( result )
// });
$
(
"#Save_All"
).
append
(
'<img width="8%" src="/static/img/ajax-loader.gif"></img>'
)
CRUD
(
corpus_id
,
"/group"
,
[]
,
nodes_2group
,
"PUT"
,
function
(
result
)
{
console
.
log
(
" UN ELEFANTE "
+
result
)
CRUD
(
corpus_id
,
"/keep"
,
[]
,
nodes_2inmap
,
"PUT"
,
function
(
result
)
{
console
.
log
(
" DOS ELEFANTES "
+
result
)
CRUD
(
corpus_id
,
"/keep"
,
[]
,
nodes_2outmap
,
"DELETE"
,
function
(
result
)
{
console
.
log
(
" TRES ELEFANTES "
+
result
)
CRUD
(
list_id
,
""
,
nodes_2del
,
[]
,
"DELETE"
,
function
(
result
)
{
console
.
log
(
" CUATRO ELEFANTES "
+
result
)
window
.
location
.
reload
()
});
});
...
...
static/js/jquery/jquery.dynatable.js
View file @
1a439aeb
...
...
@@ -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
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
();
...
...
templates/corpus/documents.html
View file @
1a439aeb
...
...
@@ -105,8 +105,8 @@ th a {
<div
id=
"filter_search"
style=
"visibility:hidden"
>
<span
style=
"font-size:70%;"
>
<input
title=
"Search in Titles"
type=
"checkbox"
checked
onclick=
"return false"
>
TI
</input>
<input
title=
"Search in Abstracts"
type=
"checkbox"
>
AB
</input>
<input
title=
"Search in Titles"
id=
"searchTI"
name=
"searchTI"
type=
"checkbox"
checked
onclick=
"return false"
>
TI
<input
title=
"Search in Abstracts"
id=
"searchAB"
name=
"searchAB"
type=
"checkbox"
>
AB
</span>
<select
id=
"example-single-optgroups"
onchange=
"SearchFilters(this);"
>
<!-- <optgroup label=""> -->
...
...
templates/corpus/terms.html
View file @
1a439aeb
...
...
@@ -243,6 +243,10 @@ input[type=radio]:checked + label {
<div
id=
"filter_search"
style=
"visibility:hidden"
>
<span
style=
"font-size:70%;"
>
<input
title=
"Search in Titles"
type=
"checkbox"
checked
onclick=
"return false"
>
TI
</input>
<input
title=
"Search in Abstracts"
type=
"checkbox"
>
AB
</input>
</span>
<select
id=
"example-single-optgroups"
onchange=
"SearchFilters(this);"
>
<!-- <optgroup label=""> -->
<option
id=
"filter_all"
value=
"filter_all"
>
All
</option>
...
...
@@ -255,9 +259,9 @@ input[type=radio]:checked + label {
<option
id=
"filter_stop-list"
value=
"filter_stop-list"
>
Stop-List
</option>
<!-- </optgroup> -->
</select>
<!--
<button id="ImportList" onclick="GetUserPortfolio(); $('#corpuses').modal('show');" class="btn btn-warning">Import a Corpus-List</button>
-->
</div>
<script
type=
"text/javascript"
src=
"{% static "
js
/
jquery
/
jquery
.
min
.
js
"
%}"
></script>
...
...
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