|
|
@ -173,7 +173,7 @@ eval("__webpack_require__.r(__webpack_exports__);\naxios.defaults.xsrfCookieName |
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
|
|
|
|
"use strict"; |
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ \"./static/js/http.js\");\n\n\nvar annotationMixin = {\n data: function () {\n return {\n cur: 0,\n items: [{\n id: null,\n text: '',\n labels: []\n }],\n labels: [],\n guideline: 'Here is the Annotation Guideline Text',\n total: 0,\n remaining: 0,\n searchQuery: '',\n url: '',\n picked: 'all',\n }\n },\n methods: {\n nextPage: async function () {\n this.cur += 1;\n if (this.cur == this.items.length) {\n if (this.next) {\n this.url = this.next;\n await this.search();\n this.cur = 0;\n } else {\n this.cur = this.items.length - 1;\n }\n }\n this.showMessage(this.cur);\n },\n prevPage: async function () {\n this.cur -= 1;\n if (this.cur == -1) {\n if (this.prev) {\n this.url = this.prev;\n await this.search();\n this.cur = this.items.length - 1;\n } else {\n this.cur = 0;\n }\n }\n this.showMessage(this.cur);\n },\n search: async function () {\n await _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.url).then(response => {\n this.items = response.data['results'];\n this.next = response.data['next'];\n this.prev = response.data['previous'];\n })\n },\n showMessage: function (index) {\n this.cur = index;\n },\n getState: function () {\n if (this.picked == 'all') {\n return ''\n } else if (this.picked == 'active') {\n return 'true'\n } else {\n return 'false'\n }\n },\n submit: async function () {\n var state = this.getState();\n this.url = `docs/?q=${this.searchQuery}&is_checked=${state}`;\n await this.search();\n this.cur = 0;\n },\n updateProgress: function () {\n _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('progress').then(response => {\n this.total = response.data['total'];\n this.remaining = response.data['remaining'];\n })\n },\n deleteLabel: async function (index) {\n var doc_id = this.items[this.cur].id;\n var annotation_id = this.items[this.cur]['labels'][index].id;\n _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(`docs/${doc_id}/annotations/${annotation_id}`).then(response => {\n this.items[this.cur]['labels'].splice(index, 1)\n });\n this.updateProgress();\n }\n },\n watch: {\n picked: function (){\n this.submit();\n }\n },\n created: function () {\n _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('labels').then(response => {\n this.labels = response.data\n });\n this.updateProgress();\n this.submit();\n },\n computed: {\n achievement: function () {\n var done = this.total - this.remaining;\n var percentage = Math.round(done / this.total * 100);\n return this.total > 0 ? percentage : 0;\n },\n progressColor: function () {\n if (this.achievement < 30) {\n return 'is-danger'\n } else if (this.achievement < 70) {\n return 'is-warning'\n } else {\n return 'is-primary'\n }\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (annotationMixin);\n\n//# sourceURL=webpack:///./static/js/mixin.js?"); |
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./http.js */ \"./static/js/http.js\");\n\n\nvar annotationMixin = {\n data: function () {\n return {\n cur: 0,\n items: [{\n id: null,\n text: '',\n labels: []\n }],\n labels: [],\n guideline: 'Here is the Annotation Guideline Text',\n total: 0,\n remaining: 0,\n searchQuery: '',\n url: '',\n picked: 'all',\n }\n },\n methods: {\n nextPage: async function () {\n this.cur += 1;\n if (this.cur == this.items.length) {\n if (this.next) {\n this.url = this.next;\n await this.search();\n this.cur = 0;\n } else {\n this.cur = this.items.length - 1;\n }\n }\n this.showMessage(this.cur);\n },\n prevPage: async function () {\n this.cur -= 1;\n if (this.cur == -1) {\n if (this.prev) {\n this.url = this.prev;\n await this.search();\n this.cur = this.items.length - 1;\n } else {\n this.cur = 0;\n }\n }\n this.showMessage(this.cur);\n },\n search: async function () {\n await _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.url).then(response => {\n this.items = response.data['results'];\n this.next = response.data['next'];\n this.prev = response.data['previous'];\n })\n },\n showMessage: function (index) {\n this.cur = index;\n },\n getState: function () {\n if (this.picked == 'all') {\n return ''\n } else if (this.picked == 'active') {\n return 'true'\n } else {\n return 'false'\n }\n },\n submit: async function () {\n var state = this.getState();\n this.url = `docs/?q=${this.searchQuery}&is_checked=${state}`;\n await this.search();\n this.cur = 0;\n },\n deleteLabel: async function (index) {\n var doc_id = this.items[this.cur].id;\n var annotation_id = this.items[this.cur]['labels'][index].id;\n _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(`docs/${doc_id}/annotations/${annotation_id}`).then(response => {\n this.items[this.cur]['labels'].splice(index, 1)\n })\n },\n\n removeLabel: function (label) {\n var doc_id = this.items[this.cur].id;\n _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].delete(`docs/${doc_id}/annotations/${label.id}`).then(response => {\n var index = this.items[this.cur]['labels'].indexOf(label)\n this.items[this.cur]['labels'].splice(index, 1)\n })\n }\n },\n watch: {\n picked: function (){\n this.submit();\n },\n items: function () {\n // fetch progress info.\n _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('progress').then(response => {\n this.total = response.data['total'];\n this.remaining = response.data['remaining'];\n })\n }\n },\n created: function () {\n _http_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get('labels').then(response => {\n this.labels = response.data\n });\n this.submit();\n },\n computed: {\n achievement: function () {\n var done = this.total - this.remaining;\n var percentage = Math.round(done / this.total * 100);\n return this.total > 0 ? percentage : 0;\n },\n progressColor: function () {\n if (this.achievement < 30) {\n return 'is-danger'\n } else if (this.achievement < 70) {\n return 'is-warning'\n } else {\n return 'is-primary'\n }\n }\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (annotationMixin);\n\n//# sourceURL=webpack:///./static/js/mixin.js?"); |
|
|
|
|
|
|
|
/***/ }), |
|
|
|
|
|
|
@ -185,7 +185,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _htt |
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
|
|
|
|
|
|
"use strict"; |
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mixin.js */ \"./static/js/mixin.js\");\n/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http.js */ \"./static/js/http.js\");\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(__webpack_require__(/*! vue-shortkey */ \"./node_modules/vue-shortkey/dist/index.js\"));\n\n\n\n\nvar vm = new vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n el: '#mail-app',\n delimiters: ['[[', ']]'],\n data: {\n newTodo: '',\n editedTodo: null\n },\n mixins: [_mixin_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n directives: {\n 'todo-focus': function (el, binding) {\n if (binding.value) {\n el.focus()\n }\n }\n },\n methods: {\n addTodo: function () {\n var value = this.newTodo && this.newTodo.trim()\n if (!value) {\n return\n }\n\n var doc_id = this.items[this.cur].id;\n var payload = {text: value}\n _http_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].post(`docs/${doc_id}/annotations/`, payload).then(response => {\n this.items[this.cur]['labels'].push(response.data)\n })\n\n this.newTodo = ''\n },\n\n removeTodo: function (todo) {\n var doc_id = this.items[this.cur].id;\n _http_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].delete(`docs/${doc_id}/annotations/${todo.id}`).then(response => {\n this.items[this.cur]['labels'].splice(this.items[this.cur]['labels'].indexOf(todo), 1)\n });\n },\n\n editTodo: function (todo) {\n this.beforeEditCache = todo.text\n this.editedTodo = todo\n },\n\n doneEdit: function (todo) {\n if (!this.editedTodo) {\n return\n }\n this.editedTodo = null\n todo.text = todo.text.trim()\n if (!todo.text) {\n this.removeTodo(todo)\n }\n var doc_id = this.items[this.cur].id;\n _http_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].put(`docs/${doc_id}/annotations/${todo.id}`, todo).then(response => {\n console.log(response)\n });\n },\n\n cancelEdit: function (todo) {\n this.editedTodo = null\n todo.text = this.beforeEditCache\n }\n },\n created: function () {\n this.updateProgress();\n this.submit();\n }\n});\n\n//# sourceURL=webpack:///./static/js/seq2seq.js?"); |
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var _mixin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mixin.js */ \"./static/js/mixin.js\");\n/* harmony import */ var _http_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http.js */ \"./static/js/http.js\");\n\nvue__WEBPACK_IMPORTED_MODULE_0__[\"default\"].use(__webpack_require__(/*! vue-shortkey */ \"./node_modules/vue-shortkey/dist/index.js\"));\n\n\n\n\nvar vm = new vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n el: '#mail-app',\n delimiters: ['[[', ']]'],\n data: {\n newTodo: '',\n editedTodo: null\n },\n mixins: [_mixin_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]],\n directives: {\n 'todo-focus': function (el, binding) {\n if (binding.value) {\n el.focus()\n }\n }\n },\n methods: {\n addTodo: function () {\n var value = this.newTodo && this.newTodo.trim()\n if (!value) {\n return\n }\n\n var doc_id = this.items[this.cur].id;\n var payload = {text: value}\n _http_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].post(`docs/${doc_id}/annotations/`, payload).then(response => {\n this.items[this.cur]['labels'].push(response.data)\n })\n\n this.newTodo = ''\n },\n\n removeTodo: function (todo) {\n var doc_id = this.items[this.cur].id;\n _http_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].delete(`docs/${doc_id}/annotations/${todo.id}`).then(response => {\n this.items[this.cur]['labels'].splice(this.items[this.cur]['labels'].indexOf(todo), 1)\n });\n },\n\n editTodo: function (todo) {\n this.beforeEditCache = todo.text\n this.editedTodo = todo\n },\n\n doneEdit: function (todo) {\n if (!this.editedTodo) {\n return\n }\n this.editedTodo = null\n todo.text = todo.text.trim()\n if (!todo.text) {\n this.removeTodo(todo)\n }\n var doc_id = this.items[this.cur].id;\n _http_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].put(`docs/${doc_id}/annotations/${todo.id}`, todo).then(response => {\n console.log(response)\n });\n },\n\n cancelEdit: function (todo) {\n this.editedTodo = null\n todo.text = this.beforeEditCache\n }\n },\n created: function () {\n this.submit();\n }\n});\n\n//# sourceURL=webpack:///./static/js/seq2seq.js?"); |
|
|
|
|
|
|
|
/***/ }) |
|
|
|
|