|
@@ -9,8 +9,9 @@
|
|
:image="image"
|
|
:image="image"
|
|
:position="current"/>
|
|
:position="current"/>
|
|
|
|
|
|
- <annotation-box v-for="result in data.predictionResults"
|
|
|
|
- v-bind:key="result"
|
|
|
|
|
|
+ <annotation-box v-for="(result, index) in predictions"
|
|
|
|
+ type="server"
|
|
|
|
+ :key="index"
|
|
:image="image"
|
|
:image="image"
|
|
:position="result"/>
|
|
:position="result"/>
|
|
</div>
|
|
</div>
|
|
@@ -54,16 +55,19 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- mediaUrl: function() {
|
|
|
|
|
|
+ mediaUrl: function () {
|
|
return this.socket.media(this.project.id, this.data.id);
|
|
return this.socket.media(this.project.id, this.data.id);
|
|
},
|
|
},
|
|
- mediaUrlSet: function() {
|
|
|
|
|
|
+ mediaUrlSet: function () {
|
|
return this.sizes.map(e => this.mediaUrl + '/' + e + ' ' + e + 'w').join(',');
|
|
return this.sizes.map(e => this.mediaUrl + '/' + e + ' ' + e + 'w').join(',');
|
|
},
|
|
},
|
|
- mediaUrlSizes: function() {
|
|
|
|
|
|
+ mediaUrlSizes: function () {
|
|
return this.sizes.map(e => '(max-width: ' + e + 'px) ' + e + 'px').join(',');
|
|
return this.sizes.map(e => '(max-width: ' + e + 'px) ' + e + 'px').join(',');
|
|
},
|
|
},
|
|
- events: function() {
|
|
|
|
|
|
+ predictions: function () {
|
|
|
|
+ return Object.keys(this.data.predictionResults).map(k => this.data.predictionResults[k]);
|
|
|
|
+ },
|
|
|
|
+ events: function () {
|
|
return {
|
|
return {
|
|
'touchstart': this.press,
|
|
'touchstart': this.press,
|
|
'touchmove': this.track,
|
|
'touchmove': this.track,
|
|
@@ -120,7 +124,7 @@ export default {
|
|
y: this.getY(event)
|
|
y: this.getY(event)
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- track: function(event) {
|
|
|
|
|
|
+ track: function (event) {
|
|
if (this.start) {
|
|
if (this.start) {
|
|
const x = this.getX(event);
|
|
const x = this.getX(event);
|
|
const y = this.getY(event);
|
|
const y = this.getY(event);
|
|
@@ -129,12 +133,10 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
- release: function(event) {
|
|
|
|
- console.log('release', event);
|
|
|
|
-
|
|
|
|
- // TODO send to server
|
|
|
|
|
|
+ release: function () {
|
|
|
|
+ this.socket.post(this.mediaUrl, this.current);
|
|
this.start = false;
|
|
this.start = false;
|
|
- // this.current = this.buildRectangle(this.start.x, this.start.y, this.getX(event), this.getY(event));
|
|
|
|
|
|
+ this.current = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|