-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* successfully load articles from heroku * delete mock article json, alt * add todo comment
- Loading branch information
Showing
15 changed files
with
153 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import data from 'assets/tua.json'; | ||
import $ from 'jquery'; | ||
|
||
const USE_DOCKER = false; | ||
let BASE_URL = 'http://text-thresher.herokuapp.com'; | ||
if (USE_DOCKER) { | ||
BASE_URL = 'http://192.168.99.100:5000'; | ||
} | ||
const ARTICLES_URL = BASE_URL + '/api/articles/'; | ||
const HIGHLIGHTS_URL = BASE_URL + '/api/highlight_groups/'; | ||
|
||
export default class api { | ||
static getArticles() { | ||
// TODO: consider somehow not synch doing this | ||
var res = $.ajax({ url: ARTICLES_URL, async: false }); | ||
if (res.status !== 200) { | ||
return { article: data.results }; | ||
} | ||
// need to have conversation with backend about where these legacy properties | ||
// i.e. topics comes from | ||
var articles = []; | ||
res = JSON.parse(res.responseText); | ||
for (var article of res.results) { | ||
articles.push(Object.assign({}, | ||
{ article, analysis_type: { topics: [{ name: 'Event type' }] } }) | ||
); | ||
} | ||
return articles; | ||
} | ||
|
||
static sendHighlights(highlights) { | ||
// TODO: finish this function | ||
$.ajax({ url: HIGHLIGHTS_URL, | ||
method: 'POST', | ||
data: highlights, | ||
success: _ => _ }); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.fadein-appear { | ||
opacity: 0.01; | ||
} | ||
|
||
.fadein-appear.fadein-appear-active { | ||
opacity: 1; | ||
transition: opacity .5s ease-in; | ||
} | ||
|
||
.fade-between-enter { | ||
opacity: 0.01; | ||
} | ||
|
||
.fade-between-enter.fade-between-enter-active { | ||
opacity: 1; | ||
} | ||
|
||
.fade-between-leave { | ||
/* hacky disappear for state change */ | ||
visibility: hidden; | ||
height: 0px; | ||
width: 0px; | ||
opacity: 1; | ||
} | ||
|
||
.fade-between-leave.fade-between-leave-active { | ||
opacity: 0; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"@context": "http://www.w3.org/ns/anno.jsonld", | ||
"id": "http://example.org/anno23", | ||
"type": "Annotation", | ||
"body": "http://example.org/review1", | ||
"target": { | ||
"source": "http://example.org/ebook1", | ||
"selector": { | ||
"type": "TextPositionSelector", | ||
"start": 412, | ||
"end": 795 | ||
} | ||
} | ||
} | ||
|
||
|
||
/api/ | ||
{ | ||
"@context": "http://www.w3.org/ns/anno.jsonld", | ||
"id": "http://example.org/anno23", | ||
"type": "Annotation", | ||
"body": "http://example.org/review1", | ||
"target": { | ||
"source": "http://example.org/ebook1", | ||
"selector": { | ||
"type": "MultiplePositionSelector", | ||
"offsets": [ | ||
{ | ||
"start": 0, | ||
"end": 5 | ||
}, | ||
{ | ||
"start": 0, | ||
"end": 5 | ||
}, | ||
{ | ||
"start": 0, | ||
"end": 5 | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters