Skip to content

Commit

Permalink
update, bugfixes for #78
Browse files Browse the repository at this point in the history
  • Loading branch information
telion2 committed Mar 15, 2018
1 parent 15c2118 commit 18f8dbf
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 52 deletions.
16 changes: 4 additions & 12 deletions views/analysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
v-bind:notemodes="notemodes"
v-bind:researchmode="researchmode"
v-bind:selectedchain="selectedChain"
v-bind:showmode="showMode"
v-bind:contentcontrol="contentcontrol"
v-bind:hoverdata="hoverdata"
v-bind:wordtomarkonhoverdata="wordtomarkonhoverdata"
Expand All @@ -82,7 +81,7 @@
v-on:togglesemanticlass="changeMarkerMode($event)"
v-on:starthover="starthover($event)"
v-on:endhover="endhover($event)"
v-on:entercorrectionmode="entercorrectionmode($event)">
v-on:updateclassestomark="updateclassestomark($event)">
</component>
</div>
</div>
Expand Down Expand Up @@ -124,7 +123,6 @@
offsetend: null,
semanticclass: {},
analysisMode: 'analighter',
showMode: 'entitiesview',
researchmode: '',
classesToMark: {
coref: false,
Expand Down Expand Up @@ -189,6 +187,9 @@
}
},
methods: {
updateclassestomark:function (newClassesToMark) {
this.classesToMark = newClassesToMark;
},
toogleResearchContent: function (toToggle) {
this.contentcontrol.PERSONS[toToggle] = !this.contentcontrol.PERSONS[toToggle];
this.contentcontrol.LOCATIONS[toToggle] = !this.contentcontrol.LOCATIONS[toToggle];
Expand Down Expand Up @@ -221,15 +222,6 @@
changeMarkerMode: function (newClassesToMark) {
this.classesToMark = newClassesToMark;
},
entercorrectionmode: function (correctionMode) {
if (correctionMode === true) {
this.classesToMark.POS = correctionMode;
this.showMode = 'correction';
} else {
this.classesToMark.POS = correctionMode;
this.showMode = 'entitiesview';
}
},
selectText: function (index, modus) {
if (modus === 0) {
this.selectedtextindexes.start = index;
Expand Down
21 changes: 12 additions & 9 deletions views/components/analysis/analighter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
v-on:togglesemanticlass="togglesemanticlass($event)"
v-on:endhover="endhover($event)"
v-on:starthover="starthover($event)"
v-on:editresearch="editresearch($event)">
v-on:editresearch="editresearch($event)"
v-on:selectresearch="selectedresearch($event)">

</component>
</div>
Expand All @@ -31,7 +32,6 @@
props: {
serverip: {type: String, default: ""},
showmode: {type: String, default: ""},
selectedindexes: {type: Object, default: null},
contentcontrol: {type: Object, default: null},
hoverdata: {type: Object, default: null},
Expand All @@ -57,7 +57,8 @@
},
data: function () {
return {
researchdatatoedit: {}
researchdatatoedit: {},
showmode: 'entitiesview'
}
},
methods: {
Expand All @@ -70,14 +71,16 @@
starthover: function (textIndex) {
this.$emit('starthover', textIndex);
},
editresearch: function (researchData){
//emit for a button on toolbar. To Delete if button on toolbar not needed.
this.$emit('entercorrectionmode', true);
this.researchdatatoedit = researchData;
editresearch: function (researchData) {
this.classestomark.POS = true;
this.showmode = 'correction';
this.$emit('updateclassestomark', this.classestomark);
},
selectedresearch:function (researchData) {
this.$emit('entercorrectionmode', false);
selectedresearch: function (researchData) {
this.classestomark.POS = false;
this.showmode = 'entitiesview';
this.researchdatatoedit = researchData;
this.$emit('updateclassestomark', this.classestomark);
}
},
components: {
Expand Down
17 changes: 10 additions & 7 deletions views/components/analysis/correction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
v-bind:contentcontrol="contentcontrol"
v-bind:selectedindexes="selectedindexes"
v-bind:wordtomarkonhoverdata="wordtomarkonhoverdata"
v-bind:selectedchain="selectedchain">
v-bind:selectedchain="selectedchain"
v-on:saveresult="saveresult($event)">
</component>

</div>
Expand All @@ -56,6 +57,7 @@
<script>
import getselectedtext from './mixins/analysis/gettokensofselectedtext.js';
import research from './components/analysis/research.vue';
export default {
mixins: [getselectedtext],
props: {
Expand Down Expand Up @@ -91,12 +93,10 @@
}
},
watch: {
},
watch: {},
computed: {
selectedtokens:function () {
return this.gettokensofselectedtext(this.tokens, this.selectedindexes);
selectedtokens: function () {
return this.gettokensofselectedtext(this.tokens, this.selectedindexes);
},
semclassofselected: function () {
let tokenClass = {};
Expand All @@ -105,6 +105,9 @@
}
},
methods: {
saveresult:function (researchdata) {
this.$emit('selectresearch', researchdata);
},
changeClass: function (newClass) {
//console.log(this.selectedtokens[0].content + " with class " + this.selectedtokens[0].semanticClass+ " is changed to " + newClass);
this.selectedtokens[0].semanticClass = newClass;
Expand All @@ -116,7 +119,7 @@
this.$emit('toggleSuggestions', this.suggestions);
}
},
components:{
components: {
research,
}
}
Expand Down
1 change: 1 addition & 0 deletions views/components/analysis/research.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
saveResult: function (researchdata) {
let socket = io(this.serverip + ':8080');
socket.emit('saveresult', this.docid, this.selectedindexes, researchdata.result['@id']);
this.$emit('saveresult', researchdata);
},
starthover: function (event) {
//this.$emit('starthover', event);
Expand Down
3 changes: 2 additions & 1 deletion views/components/analysis/researchresult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
},
saveResult: function () {
this.$emit('saveresult', this.researchdata);
console.log('Save research Changes.'+ JSON.stringify(this.researchdata.result['@id']));
console.log('Save research Changes.'+ JSON.stringify(this.researchdata));
},
showSource: function () {
try {
Expand All @@ -142,6 +142,7 @@
}
},
editResearch: function () {
console.log('clicked edit Research');
this.$emit('editresearch', this.researchdata);
}
},
Expand Down
61 changes: 38 additions & 23 deletions views/components/analysis/textfeatureviewport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<div class="mdl-cell mdl-cell--6-col"
style="border-right: 1px solid rgba(0,0,0,.1);margin: 0;padding: 8px; width: 50%; overflow-y: auto;">
<div class="mdl-grid" id="textWindow" ref="textWindow"
style="height: auto !important; display: flex; max-height: 100%; padding:0; font-family: 'Roboto Mono', monospace;">
style="height: auto !important; display: flex; max-height: 100%; padding:0; font-family: 'Roboto Mono', monospace;">

<component is="tex"
v-for="(token,i) in tokenstoshow[columnindex]"
v-bind:key="token.textIndex"
Expand Down Expand Up @@ -45,14 +45,14 @@
v-bind:selectedchain="selectedchain"
v-bind:hoverdata="hoverdata"
v-bind:wordtomarkonhoverdata="wordtomarkonhoverdata"
v-bind:showmode="showmode"
v-bind:classestomark="classestomark"
v-bind:contentcontrol="contentcontrol"
v-on:togglesemanticlass="togglesemanticlass($event)"
v-on:entercorrectionmode="entercorrectionmode($event)"
v-on:endhover="endhover($event)"
v-on:jumpmarktext="selectText2($event)"
v-on:starthover="starthover($event)">
v-on:starthover="starthover($event)"
v-on:updateclassestomark="updateclassestomark($event)">
</component>
</keep-alive>
</div>
Expand All @@ -67,23 +67,38 @@
export default {
props: {
serverip: { type: String, default: "" },
columnindex: { type: Number, default: 0 },
tokens: { type: Array, default: function () { return [] }},
notes: { type: Array, default: function () { return [] }},
selectedindexes: { type: Object, default: null },
selectedchain: { type: Number, default: -1 },
hoveredchain: { type: Number, default: -1 },
hoverdata: { type: Object, default: null },
wordtomarkonhoverdata: { type: Array, default: function () { return [] }},
classestomark: { type: Object, default: null },
showmode: { type: String, default: "" },
notemodes: { type: Object, default: null },
researchmode: { type: String, default: "" },
analysismode: { type: String, default: "" },
docid: { type: Number, default: -1 },
tokenstoshow: { type: Array, default: function () { return [] }},
contentcontrol: { type: Object, default: null },
serverip: {type: String, default: ""},
columnindex: {type: Number, default: 0},
tokens: {
type: Array, default: function () {
return []
}
},
notes: {
type: Array, default: function () {
return []
}
},
selectedindexes: {type: Object, default: null},
selectedchain: {type: Number, default: -1},
hoveredchain: {type: Number, default: -1},
hoverdata: {type: Object, default: null},
wordtomarkonhoverdata: {
type: Array, default: function () {
return []
}
},
classestomark: {type: Object, default: null},
notemodes: {type: Object, default: null},
researchmode: {type: String, default: ""},
analysismode: {type: String, default: ""},
docid: {type: Number, default: -1},
tokenstoshow: {
type: Array, default: function () {
return []
}
},
contentcontrol: {type: Object, default: null},
},
data: function () {
return {
Expand All @@ -92,8 +107,8 @@
},
computed: {},
methods: {
entercorrectionmode:function(mode){
this.$emit('entercorrectionmode', mode);
updateclassestomark:function (newClassesToMark) {
this.$emit('updateclassestomark', newClassesToMark);
},
nexttoken: function (index) {
if (this.tokens[index + 1] === undefined) {
Expand Down

0 comments on commit 18f8dbf

Please sign in to comment.