|
|
@ -4251,6 +4251,60 @@ var ProcessFile = /*#__PURE__*/function (_Vue) { |
|
|
|
|
|
|
|
return runSearchers; |
|
|
|
}() |
|
|
|
}, { |
|
|
|
key: "runSearchersWithoutDisplacing", |
|
|
|
value: function () { |
|
|
|
var _runSearchersWithoutDisplacing = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee5() { |
|
|
|
var _this5 = this; |
|
|
|
|
|
|
|
var searchers, response; |
|
|
|
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee5$(_context5) { |
|
|
|
while (1) { |
|
|
|
switch (_context5.prev = _context5.next) { |
|
|
|
case 0: |
|
|
|
this.processing = true; |
|
|
|
this.processedFileContent = ''; |
|
|
|
searchers = []; |
|
|
|
Object.values(this.selectedSearchers).forEach(function (searcher) { |
|
|
|
searchers.push({ |
|
|
|
'key': searcher.id, |
|
|
|
'replace_with': _this5.searchersOptions[searcher.id] || '' |
|
|
|
}); |
|
|
|
}); |
|
|
|
_context5.prev = 4; |
|
|
|
_context5.next = 7; |
|
|
|
return this.$api.filterDocument(this.fileContent, searchers, true); |
|
|
|
|
|
|
|
case 7: |
|
|
|
response = _context5.sent; |
|
|
|
this.processedFileContent = this.fileContent; |
|
|
|
this.documentDiffIndexes = response; |
|
|
|
this.createDiffPreview(); |
|
|
|
this.processing = false; |
|
|
|
_context5.next = 17; |
|
|
|
break; |
|
|
|
|
|
|
|
case 14: |
|
|
|
_context5.prev = 14; |
|
|
|
_context5.t0 = _context5["catch"](4); |
|
|
|
this.$emit('error', 'Server error.'); // if (isServerError(e)) {
|
|
|
|
// this.$emit('error', getServerErrorMessage(e));
|
|
|
|
// }
|
|
|
|
|
|
|
|
case 17: |
|
|
|
case "end": |
|
|
|
return _context5.stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, _callee5, this, [[4, 14]]); |
|
|
|
})); |
|
|
|
|
|
|
|
function runSearchersWithoutDisplacing() { |
|
|
|
return _runSearchersWithoutDisplacing.apply(this, arguments); |
|
|
|
} |
|
|
|
|
|
|
|
return runSearchersWithoutDisplacing; |
|
|
|
}() |
|
|
|
/** |
|
|
|
* Create the diff preview for the document |
|
|
|
*/ |
|
|
@ -4284,25 +4338,25 @@ var ProcessFile = /*#__PURE__*/function (_Vue) { |
|
|
|
}, { |
|
|
|
key: "downloadOdt", |
|
|
|
value: function () { |
|
|
|
var _downloadOdt = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee5() { |
|
|
|
var _downloadOdt = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee6() { |
|
|
|
var response; |
|
|
|
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee5$(_context5) { |
|
|
|
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee6$(_context6) { |
|
|
|
while (1) { |
|
|
|
switch (_context5.prev = _context5.next) { |
|
|
|
switch (_context6.prev = _context6.next) { |
|
|
|
case 0: |
|
|
|
_context5.next = 2; |
|
|
|
_context6.next = 2; |
|
|
|
return this.$api.convertFile(this.processedFileContent, this.file.id); |
|
|
|
|
|
|
|
case 2: |
|
|
|
response = _context5.sent; |
|
|
|
response = _context6.sent; |
|
|
|
window.open("".concat(window.location.origin, "/file/download/") + response.path); |
|
|
|
|
|
|
|
case 4: |
|
|
|
case "end": |
|
|
|
return _context5.stop(); |
|
|
|
return _context6.stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, _callee5, this); |
|
|
|
}, _callee6, this); |
|
|
|
})); |
|
|
|
|
|
|
|
function downloadOdt() { |
|
|
@ -4558,39 +4612,46 @@ var ApiService = /*#__PURE__*/function () { |
|
|
|
* |
|
|
|
* @param {string} content The content of the document |
|
|
|
* @param {Array} searchers The list of searchers and their replace values |
|
|
|
* @param {boolean} searchOnly Whether or not to also displace the content (default yes) |
|
|
|
*/ |
|
|
|
|
|
|
|
}, { |
|
|
|
key: "filterDocument", |
|
|
|
value: function () { |
|
|
|
var _filterDocument = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee3(content, searchers) { |
|
|
|
var response; |
|
|
|
var searchOnly, |
|
|
|
response, |
|
|
|
_args3 = arguments; |
|
|
|
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee3$(_context3) { |
|
|
|
while (1) { |
|
|
|
switch (_context3.prev = _context3.next) { |
|
|
|
case 0: |
|
|
|
_context3.prev = 0; |
|
|
|
_context3.next = 3; |
|
|
|
searchOnly = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : false; |
|
|
|
_context3.prev = 1; |
|
|
|
_context3.next = 4; |
|
|
|
return axios__WEBPACK_IMPORTED_MODULE_1___default().post(this.apiRoutes.searchAndDisplace, { |
|
|
|
'content': content, |
|
|
|
'searchers': searchers |
|
|
|
'searchers': searchers, |
|
|
|
'searchOnly': searchOnly |
|
|
|
}); |
|
|
|
|
|
|
|
case 3: |
|
|
|
case 4: |
|
|
|
response = _context3.sent; |
|
|
|
console.log('Search only: ', searchOnly); |
|
|
|
console.log('RESPONSE: ', response); |
|
|
|
return _context3.abrupt("return", response.data); |
|
|
|
|
|
|
|
case 7: |
|
|
|
_context3.prev = 7; |
|
|
|
_context3.t0 = _context3["catch"](0); |
|
|
|
case 10: |
|
|
|
_context3.prev = 10; |
|
|
|
_context3.t0 = _context3["catch"](1); |
|
|
|
throw _context3.t0; |
|
|
|
|
|
|
|
case 10: |
|
|
|
case 13: |
|
|
|
case "end": |
|
|
|
return _context3.stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, _callee3, this, [[0, 7]]); |
|
|
|
}, _callee3, this, [[1, 10]]); |
|
|
|
})); |
|
|
|
|
|
|
|
function filterDocument(_x3, _x4) { |
|
|
@ -29448,13 +29509,6 @@ var render = function() { |
|
|
|
return [ |
|
|
|
_c("Toolbar", { |
|
|
|
scopedSlots: _vm._u([ |
|
|
|
{ |
|
|
|
key: "left", |
|
|
|
fn: function() { |
|
|
|
return [_c("h3", [_vm._v("Original document content")])] |
|
|
|
}, |
|
|
|
proxy: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "right", |
|
|
|
fn: function() { |
|
|
@ -29482,6 +29536,15 @@ var render = function() { |
|
|
|
}, |
|
|
|
proxy: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "title", |
|
|
|
fn: function() { |
|
|
|
return [ |
|
|
|
_vm._v("\n Original document content\n ") |
|
|
|
] |
|
|
|
}, |
|
|
|
proxy: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "content", |
|
|
|
fn: function() { |
|
|
@ -29549,15 +29612,6 @@ var render = function() { |
|
|
|
return [ |
|
|
|
_c("Toolbar", { |
|
|
|
scopedSlots: _vm._u([ |
|
|
|
{ |
|
|
|
key: "left", |
|
|
|
fn: function() { |
|
|
|
return [ |
|
|
|
_c("h3", [_vm._v("Processed document content")]) |
|
|
|
] |
|
|
|
}, |
|
|
|
proxy: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "right", |
|
|
|
fn: function() { |
|
|
@ -29601,7 +29655,18 @@ var render = function() { |
|
|
|
staticClass: |
|
|
|
"p-button-success p-button-outlined p-button-sm", |
|
|
|
attrs: { |
|
|
|
label: "Run filters", |
|
|
|
label: "Run searchers", |
|
|
|
icon: "pi pi-play", |
|
|
|
disabled: !_vm.canRunSearchers() |
|
|
|
}, |
|
|
|
on: { click: _vm.runSearchersWithoutDisplacing } |
|
|
|
}), |
|
|
|
_vm._v(" "), |
|
|
|
_c("Button", { |
|
|
|
staticClass: |
|
|
|
"p-button-success p-button-outlined p-button-sm", |
|
|
|
attrs: { |
|
|
|
label: "Search and displace", |
|
|
|
icon: "pi pi-play", |
|
|
|
disabled: !_vm.canRunSearchers() |
|
|
|
}, |
|
|
@ -29617,6 +29682,15 @@ var render = function() { |
|
|
|
}, |
|
|
|
proxy: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "title", |
|
|
|
fn: function() { |
|
|
|
return [ |
|
|
|
_vm._v("\n Processed document content\n ") |
|
|
|
] |
|
|
|
}, |
|
|
|
proxy: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
key: "content", |
|
|
|
fn: function() { |
|
|
|