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
a4db60a5
Commit
a4db60a5
authored
Nov 26, 2015
by
delanoe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:PkSM3/garg
parents
78ed5934
41cf3778
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
54 deletions
+30
-54
extras_explorerjs.js
extras_explorerjs.js
+22
-49
settings_explorerjs.js
settings_explorerjs.js
+1
-1
methods.js
tinawebJS/methods.js
+7
-4
No files found.
extras_explorerjs.js
View file @
a4db60a5
...
...
@@ -20,69 +20,39 @@ function getIDFromURL( item ) {
}
function
modify_ngrams
(
classname
)
{
var
selected_ngrams
=
Object
.
keys
(
selections
).
map
(
Number
)
console
.
clear
()
console
.
log
(
selected_ngrams
)
var
corpus_id
=
getIDFromURL
(
"corpus"
)
// not used
var
list_id
=
$
(
"#list_id"
).
val
()
var
nodes
=
[]
var
http_method
=
"DELETE"
//"GET"
var
args
=
selected_ngrams
//[]
var
selected_ngrams
=
$
.
extend
({},
selections
)
console
.
log
(
selected_ngrams
)
if
(
classname
==
"delete"
)
{
var
the_url
=
window
.
location
.
origin
+
"/api/node/"
+
corpus_id
+
"/ngrams"
+
"/keep"
+
"/"
+
nodes
.
join
(
"+"
);
the_url
=
the_url
.
replace
(
/
\/
$/
,
""
);
//remove trailing slash
$
.
ajax
({
method
:
http_method
,
url
:
the_url
,
data
:
args
,
beforeSend
:
function
(
xhr
)
{
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
},
success
:
function
(
data
){
console
.
log
(
"GET"
+
" ok!!"
)
console
.
log
(
nodes
)
console
.
log
(
data
)
console
.
log
(
"Success"
);
},
error
:
function
(
result
)
{
console
.
log
(
result
)
console
.
log
(
"Fail"
);
}
CRUD
(
corpus_id
,
"/keep"
,
[]
,
selected_ngrams
,
"DELETE"
,
function
(
result
)
{
console
.
log
(
" Delete from Map-list: "
+
result
)
CRUD
(
list_id
,
""
,
Object
.
keys
(
selected_ngrams
).
map
(
Number
)
,
[]
,
"DELETE"
,
function
(
result
)
{
console
.
log
(
" Add to Stop-list "
+
result
)
cancelSelection
(
false
)
for
(
var
i
in
selected_ngrams
)
{
partialGraph
.
dropNode
(
i
)
delete
Nodes
[
i
]
}
partialGraph
.
refresh
()
partialGraph
.
draw
()
});
});
// CRUD_( corpus_id , "/keep" , [] , selected_ngrams , "DELETE" , function(result) {
// console.log(" Delete from Map-list: "+result)
// // CRUD( list_id , "" , selected_ngrams , [] , "DELETE", function(result) {
// // console.log(" Add to Stop-list "+result)
// // for(var i in selected_ngrams) {
// // partialGraph.dropNode( selected_ngrams[i] )
// // delete Nodes[selected_ngrams[i]]
// // }
// // partialGraph.refresh()
// // partialGraph.draw()
// // });
// // cancelSelection(false)
// // for(var i in selected_ngrams) {
// // partialGraph.dropNode( selected_ngrams[i] )
// // delete Nodes[selected_ngrams[i]]
// // }
// // partialGraph.refresh()
// // partialGraph.draw()
// });
}
// if(classname=="group") {
// CRUD( corpus_id , "/group" , [] , selected_ngrams , "PUT" , function(result) {
// console.log("
UN ELEFANTE
"+result)
// console.log("
GROUP
"+result)
// CRUD( corpus_id , "/keep" , [] , selected_ngrams , "PUT" , function(result) {
// });
// });
// }
}
function
CRUD
_
(
parent_id
,
action
,
nodes
,
args
,
http_method
,
callback
)
{
function
CRUD
(
parent_id
,
action
,
nodes
,
args
,
http_method
,
callback
)
{
var
the_url
=
window
.
location
.
origin
+
"/api/node/"
+
parent_id
+
"/ngrams"
+
action
+
"/"
+
nodes
.
join
(
"+"
);
the_url
=
the_url
.
replace
(
/
\/
$/
,
""
);
//remove trailing slash
console
.
log
(
the_url
)
...
...
@@ -719,7 +689,7 @@ function printCorpuses() {
for
(
var
i
in
partialGraph
.
_core
.
graph
.
nodes
)
{
thenodes
.
push
(
partialGraph
.
_core
.
graph
.
nodes
[
i
].
id
)
}
console
.
log
(
thenodes
)
$
.
ajax
({
type
:
'GET'
,
url
:
window
.
location
.
origin
+
'/api/corpusintersection/'
+
the_ids
.
join
(
"a"
),
...
...
@@ -729,7 +699,6 @@ function printCorpuses() {
xhr
.
setRequestHeader
(
"X-CSRFToken"
,
getCookie
(
"csrftoken"
));
},
success
:
function
(
data
){
console
.
clear
()
console
.
log
(
"!!!!!!!! in printCorpuses() AJAX!!!!!!!! "
)
for
(
var
i
in
Nodes
)
{
...
...
@@ -740,7 +709,11 @@ function printCorpuses() {
}
cancelSelection
(
false
)
ChangeGraphAppearanceByAtt
(
true
)
clustersBy
(
"inter"
)
console
.
log
(
"YOLOYOLYOLYOYKOYYKYOY"
)
clustersBy
(
"inter"
,
"color"
)
clustersBy
(
"inter"
,
"size"
)
},
error
:
function
(
xhr
,
status
,
error
)
{
...
...
settings_explorerjs.js
View file @
a4db60a5
...
...
@@ -103,7 +103,7 @@ var maxSearchResults = 10;
var
strSearchBar
=
"Search"
;
var
cursor_size_min
=
0
;
var
cursor_size
=
0
;
var
cursor_size
=
1
0
;
var
cursor_size_max
=
100
;
var
desirableTagCloudFont_MIN
=
12
;
...
...
tinawebJS/methods.js
View file @
a4db60a5
...
...
@@ -474,10 +474,13 @@ function updateLeftPanel_fix( sels , oppos ) {
namesDIV
+=
'</h4></div>'
;
var
ngram_actions
=
''
// ngram_actions += '<center>'
// ngram_actions += '<span><button class="delete" onclick="modify_ngrams(this.className)">Delete</button></span>'
// ngram_actions += '<span><button class="group" onclick="modify_ngrams(this.className)">Group</button></span>'
// ngram_actions += '</center>'
if
(
partialGraph
.
states
[
1
].
categories
.
length
==
1
)
{
ngram_actions
+=
'<center>'
ngram_actions
+=
'<span><button class="delete" onclick="modify_ngrams(this.className)">Delete</button></span>'
// if( Object.keys(sels).length>1)
// ngram_actions += '<span><button class="group" onclick="modify_ngrams(this.className)">Group</button></span>'
ngram_actions
+=
'</center>'
}
if
(
oppos
.
length
>
0
)
{
alterNodesDIV
+=
'<div id="opossitesBox">'
;
//tagcloud
...
...
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