Browse Source

Update labeling function

pull/10/head
Hironsan 6 years ago
parent
commit
e28942a30e
4 changed files with 20 additions and 11 deletions
  1. BIN
      doccano/app/db.sqlite3
  2. 20
      doccano/app/server/static/annotation.1.js
  3. 2
      doccano/app/server/static/main.js
  4. 9
      doccano/app/server/templates/annotation.1.html

BIN
doccano/app/db.sqlite3

20
doccano/app/server/static/annotation.1.js

@ -34,10 +34,19 @@ var vm = new Vue({
nextPageNum: 1, nextPageNum: 1,
prevPageNum: 1, prevPageNum: 1,
page: 1, page: 1,
message_body: '',
}, },
methods: { methods: {
addLabel: function (label) { addLabel: function (label) {
for (var i = 0; i < this.items[this.cur]['labels'].length; i++) {
var item = this.items[this.cur]['labels'][i];
if (label == item.text) {
this.deleteLabel(i);
return;
}
}
var label = { var label = {
'text': label, 'text': label,
'prob': null 'prob': null
@ -128,16 +137,11 @@ var vm = new Vue({
}, },
showMessage: function (index) { showMessage: function (index) {
this.cur = index; this.cur = index;
console.log(this.cur);
console.log(this.items[index]);
$('#message-pane').removeClass('is-hidden');
//$('#message-pane').removeClass('is-hidden');
$('.card').removeClass('active'); $('.card').removeClass('active');
$('#msg-card-' + index).addClass('active'); $('#msg-card-' + index).addClass('active');
//$('.message .address .name').text(msg.from);
//$('.message .address .email').text(msg.email);
var text = this.items[index].text; var text = this.items[index].text;
var msg_body = '<p>' + text + '</p>';
$('.message .content').html(msg_body);
this.message_body = text;
}, },
updateProgress: function() { updateProgress: function() {
var self = this; var self = this;
@ -161,7 +165,7 @@ var vm = new Vue({
console.log('ERROR!! happend by Backend.') console.log('ERROR!! happend by Backend.')
}); });
this.updateProgress(); this.updateProgress();
this.submit()
this.submit();
}, },
computed: { computed: {
done: function () { done: function () {

2
doccano/app/server/static/main.js
File diff suppressed because it is too large
View File

9
doccano/app/server/templates/annotation.1.html

@ -11,7 +11,11 @@
<li> <li>
<progress class="progress" v-bind:class="progressColor" v-bind:value="achievement" max="100">30%</progress> <progress class="progress" v-bind:class="progressColor" v-bind:value="achievement" max="100">30%</progress>
</li> </li>
<!--
<li class="level-right has-text-white">
[[ achievement ]]%
</li>
-->
</ul> </ul>
</aside> </aside>
<aside class="menu"> <aside class="menu">
@ -69,7 +73,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="column is-7 message hero is-fullheight is-hidden" id="message-pane">
<div class="column is-7 message hero is-fullheight" id="message-pane">
<div class="action-buttons"> <div class="action-buttons">
<div class="control is-grouped"> <div class="control is-grouped">
<a class="button is-small" v-on:click="prevPage" v-shortkey="['ctrl', 'p']" @shortkey="prevPage"> <a class="button is-small" v-on:click="prevPage" v-shortkey="['ctrl', 'p']" @shortkey="prevPage">
@ -95,6 +99,7 @@
</div> </div>
<hr> <hr>
<div class="content"> <div class="content">
[[ message_body ]]
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save