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
4989f8e3
Commit
4989f8e3
authored
Sep 20, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] annotations: use new api param 'testgroup' in various highlight creation
parent
13275eda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
12 deletions
+30
-12
app.js
annotations/static/annotations/app.js
+17
-2
highlight.js
annotations/static/annotations/highlight.js
+7
-7
http.js
annotations/static/annotations/http.js
+6
-3
No files found.
annotations/static/annotations/app.js
View file @
4989f8e3
...
@@ -97,6 +97,21 @@
...
@@ -97,6 +97,21 @@
// +propToRead+" ("+cache[propToRead]+")")
// +propToRead+" ("+cache[propToRead]+")")
params
[
key
]
=
cache
[
propToRead
]
params
[
key
]
=
cache
[
propToRead
]
}
}
else
if
(
typeof
val
==
"object"
&&
val
[
"fromCacheIfElse"
])
{
var
propToReadIf
=
val
[
"fromCacheIfElse"
][
0
]
var
propToReadElse
=
val
[
"fromCacheIfElse"
][
1
]
// console.log("reading from cache: response data property " +
// "if:"+propToReadIf+" ("+cache[propToReadIf]+")"+
// " else:"+propToReadElse+" ("+cache[propToReadElse]+")")
var
valueIf
=
cache
[
propToReadIf
]
var
valueElse
=
cache
[
propToReadElse
]
if
(
valueIf
&&
valueIf
!=
'null'
&&
valueIf
!=
''
)
{
params
[
key
]
=
valueIf
}
else
{
params
[
key
]
=
valueElse
}
}
}
}
// Now we run the call
// Now we run the call
...
@@ -149,8 +164,8 @@
...
@@ -149,8 +164,8 @@
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
// debug
// debug
//
console.log("==> $rootScope <==")
console
.
log
(
"==> $rootScope <=="
)
//
console.log($rootScope)
console
.
log
(
$rootScope
)
});
});
})(
window
);
})(
window
);
annotations/static/annotations/highlight.js
View file @
4989f8e3
...
@@ -219,9 +219,9 @@
...
@@ -219,9 +219,9 @@
'crudCalls'
:[
'crudCalls'
:[
{
'service'
:
MainApiAddNgramHttpService
,
'action'
:
'put'
,
{
'service'
:
MainApiAddNgramHttpService
,
'action'
:
'put'
,
'params'
:
{
'ngramStr'
:
newNgramText
,
corpusId
:
$rootScope
.
corpusId
},
'params'
:
{
'ngramStr'
:
newNgramText
,
corpusId
:
$rootScope
.
corpusId
},
'dataPropertiesToCache'
:
[
'id'
]
},
'dataPropertiesToCache'
:
[
'id'
,
'group'
]
},
{
'service'
:
MainApiChangeNgramHttpService
,
'action'
:
'put'
,
{
'service'
:
MainApiChangeNgramHttpService
,
'action'
:
'put'
,
'params'
:
{
'listId'
:
stoplist_id
,
'ngramIdList'
:
{
'fromCache
'
:
'id'
}
}
}
'params'
:
{
'listId'
:
stoplist_id
,
'ngramIdList'
:
{
'fromCache
IfElse'
:
[
'group'
,
'id'
]
}
}
}
]
]
})
;
})
;
$scope
.
menuItems
.
push
({
$scope
.
menuItems
.
push
({
...
@@ -230,9 +230,9 @@
...
@@ -230,9 +230,9 @@
'crudCalls'
:[
'crudCalls'
:[
{
'service'
:
MainApiAddNgramHttpService
,
'action'
:
'put'
,
{
'service'
:
MainApiAddNgramHttpService
,
'action'
:
'put'
,
'params'
:
{
'ngramStr'
:
newNgramText
,
corpusId
:
$rootScope
.
corpusId
},
'params'
:
{
'ngramStr'
:
newNgramText
,
corpusId
:
$rootScope
.
corpusId
},
'dataPropertiesToCache'
:
[
'id'
]
},
'dataPropertiesToCache'
:
[
'id'
,
'group'
]
},
{
'service'
:
MainApiChangeNgramHttpService
,
'action'
:
'put'
,
{
'service'
:
MainApiChangeNgramHttpService
,
'action'
:
'put'
,
'params'
:
{
'listId'
:
mainlist_id
,
'ngramIdList'
:
{
'fromCache
'
:
'id'
}
}
}
'params'
:
{
'listId'
:
mainlist_id
,
'ngramIdList'
:
{
'fromCache
IfElse'
:
[
'group'
,
'id'
]
}
}
}
]
]
})
;
})
;
$scope
.
menuItems
.
push
({
$scope
.
menuItems
.
push
({
...
@@ -241,11 +241,11 @@
...
@@ -241,11 +241,11 @@
'crudCalls'
:[
'crudCalls'
:[
{
'service'
:
MainApiAddNgramHttpService
,
'action'
:
'put'
,
{
'service'
:
MainApiAddNgramHttpService
,
'action'
:
'put'
,
'params'
:
{
'ngramStr'
:
newNgramText
,
corpusId
:
$rootScope
.
corpusId
},
'params'
:
{
'ngramStr'
:
newNgramText
,
corpusId
:
$rootScope
.
corpusId
},
'dataPropertiesToCache'
:
[
'id'
]
},
'dataPropertiesToCache'
:
[
'id'
,
'group'
]
},
{
'service'
:
MainApiChangeNgramHttpService
,
'action'
:
'put'
,
{
'service'
:
MainApiChangeNgramHttpService
,
'action'
:
'put'
,
'params'
:
{
'listId'
:
mainlist_id
,
'ngramIdList'
:
{
'fromCache
'
:
'id'
}
}
},
'params'
:
{
'listId'
:
mainlist_id
,
'ngramIdList'
:
{
'fromCache
IfElse'
:
[
'group'
,
'id'
]
}
}
},
{
'service'
:
MainApiChangeNgramHttpService
,
'action'
:
'put'
,
{
'service'
:
MainApiChangeNgramHttpService
,
'action'
:
'put'
,
'params'
:
{
'listId'
:
maplist_id
,
'ngramIdList'
:
{
'fromCache
'
:
'id'
}
}
}
'params'
:
{
'listId'
:
maplist_id
,
'ngramIdList'
:
{
'fromCache
IfElse'
:
[
'group'
,
'id'
]
}
}
}
]
]
})
;
})
;
...
...
annotations/static/annotations/http.js
View file @
4989f8e3
...
@@ -90,17 +90,20 @@
...
@@ -90,17 +90,20 @@
* MainApiAddNgramHttpService: Create and index a new ngram
* MainApiAddNgramHttpService: Create and index a new ngram
* ===========================
* ===========================
* route: PUT api/ngrams?text=mynewngramstring&corpus=corpus_id
* route: PUT api/ngrams?text=mynewngramstring&corpus=corpus_id
* ------
*
* NB it also checks if ngram exists (returns the preexisting id)
* and if it has a mainform/group (via 'testgroup' option)
* (useful if we add it to a list afterwards)
*
*
*/
*/
http
.
factory
(
'MainApiAddNgramHttpService'
,
function
(
$resource
)
{
http
.
factory
(
'MainApiAddNgramHttpService'
,
function
(
$resource
)
{
return
$resource
(
return
$resource
(
// adding explicit "http://" b/c this a cross origin request
// adding explicit "http://" b/c this a cross origin request
'http://'
+
window
.
GARG_ROOT_URL
'http://'
+
window
.
GARG_ROOT_URL
+
"/api/ngrams?text=:ngramStr&corpus=:corpusId"
,
+
"/api/ngrams?text=:ngramStr&corpus=:corpusId
&testgroup
"
,
{
{
ngramStr
:
'@ngramStr'
,
ngramStr
:
'@ngramStr'
,
corpusId
:
'@corpusId'
corpusId
:
'@corpusId'
,
},
},
{
{
put
:
{
put
:
{
...
...
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