digirati-annotation-redux
Advanced tools
Comparing version 0.2.17-alpha.9ab2695c to 0.2.17-alpha.9ed554c7
@@ -18,6 +18,7 @@ import uuid from 'uuid/v4'; | ||
var motivation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'tagging'; | ||
var labelField = arguments[3]; | ||
return function (dispatch, state) { | ||
var id = uuid(); | ||
dispatch({ type: DRAFT_CREATE, payload: { id: id, input: input, template: template, motivation: motivation } }); | ||
dispatch({ type: DRAFT_CREATE, payload: { id: id, input: input, template: template, motivation: motivation, labelField: labelField } }); | ||
dispatch(selectDraft(id)); | ||
@@ -24,0 +25,0 @@ var currentTemplate = getCurrentResourceTemplate(state()); |
@@ -53,7 +53,7 @@ import md5 from 'blueimp-md5'; | ||
export function sendAnnotation(body, target, motivation) { | ||
export function sendAnnotation(body, target, motivation, label) { | ||
return function (dispatch, state) { | ||
dispatch({ type: ELUCIDATE_SEND_ANNOTATION, payload: { annotation: { body: body, target: target, motivation: motivation } } }); | ||
dispatch({ type: ELUCIDATE_SEND_ANNOTATION, payload: { annotation: { body: body, target: target, motivation: motivation, label: label } } }); | ||
var collection = getCollectionId(state()); | ||
return sendAnnotationToServer(collection, body, target, motivation).then(function (annotation) { | ||
return sendAnnotationToServer(collection, body, target, motivation, label).then(function (annotation) { | ||
return dispatch(addElucidateAnnotation(annotation)); | ||
@@ -60,0 +60,0 @@ }); |
@@ -294,6 +294,7 @@ import _regeneratorRuntime from 'babel-runtime/regenerator'; | ||
export function sendAnnotationToServer(server, body, target, motivation) { | ||
export function sendAnnotationToServer(server, body, target, motivation, label) { | ||
return post(server, { | ||
'@context': CONTEXT, | ||
type: 'Annotation', | ||
label: label, | ||
body: body, | ||
@@ -300,0 +301,0 @@ target: target, |
@@ -39,6 +39,7 @@ 'use strict'; | ||
var motivation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'tagging'; | ||
var labelField = arguments[3]; | ||
return function (dispatch, state) { | ||
var id = (0, _v2.default)(); | ||
dispatch({ type: DRAFT_CREATE, payload: { id: id, input: input, template: template, motivation: motivation } }); | ||
dispatch({ type: DRAFT_CREATE, payload: { id: id, input: input, template: template, motivation: motivation, labelField: labelField } }); | ||
dispatch(selectDraft(id)); | ||
@@ -45,0 +46,0 @@ var currentTemplate = (0, _resourceTemplateQuery.getCurrentResourceTemplate)(state()); |
@@ -71,7 +71,7 @@ 'use strict'; | ||
function sendAnnotation(body, target, motivation) { | ||
function sendAnnotation(body, target, motivation, label) { | ||
return function (dispatch, state) { | ||
dispatch({ type: ELUCIDATE_SEND_ANNOTATION, payload: { annotation: { body: body, target: target, motivation: motivation } } }); | ||
dispatch({ type: ELUCIDATE_SEND_ANNOTATION, payload: { annotation: { body: body, target: target, motivation: motivation, label: label } } }); | ||
var collection = (0, _elucidateQuery.getCollectionId)(state()); | ||
return (0, _elucidate.sendAnnotationToServer)(collection, body, target, motivation).then(function (annotation) { | ||
return (0, _elucidate.sendAnnotationToServer)(collection, body, target, motivation, label).then(function (annotation) { | ||
return dispatch(addElucidateAnnotation(annotation)); | ||
@@ -78,0 +78,0 @@ }); |
@@ -322,6 +322,7 @@ 'use strict'; | ||
function sendAnnotationToServer(server, body, target, motivation) { | ||
function sendAnnotationToServer(server, body, target, motivation, label) { | ||
return post(server, { | ||
'@context': CONTEXT, | ||
type: 'Annotation', | ||
label: label, | ||
body: body, | ||
@@ -328,0 +329,0 @@ target: target, |
{ | ||
"name": "digirati-annotation-redux", | ||
"version": "0.2.17-alpha.9ab2695c", | ||
"version": "0.2.17-alpha.9ed554c7", | ||
"description": "Describe annotation-redux here", | ||
@@ -5,0 +5,0 @@ "main": "es/index.js", |
95111
2476