This commit is contained in:
parent
6640314879
commit
11da415eb2
|
@ -15,9 +15,7 @@ require('tinymce/plugins/table');
|
||||||
require('tinymce/plugins/autolink');
|
require('tinymce/plugins/autolink');
|
||||||
require('tinymce/plugins/image');
|
require('tinymce/plugins/image');
|
||||||
require('tinymce/plugins/charmap');
|
require('tinymce/plugins/charmap');
|
||||||
require('tinymce/plugins/print');
|
|
||||||
require('tinymce/plugins/preview');
|
require('tinymce/plugins/preview');
|
||||||
require('tinymce/plugins/hr');
|
|
||||||
require('tinymce/plugins/anchor');
|
require('tinymce/plugins/anchor');
|
||||||
require('tinymce/plugins/pagebreak');
|
require('tinymce/plugins/pagebreak');
|
||||||
require('tinymce/plugins/searchreplace');
|
require('tinymce/plugins/searchreplace');
|
||||||
|
@ -34,7 +32,6 @@ require('tinymce/plugins/table');
|
||||||
require('tinymce/plugins/directionality');
|
require('tinymce/plugins/directionality');
|
||||||
require('tinymce/plugins/emoticons');
|
require('tinymce/plugins/emoticons');
|
||||||
require('tinymce/plugins/template');
|
require('tinymce/plugins/template');
|
||||||
require('tinymce/plugins/paste');
|
|
||||||
const contentUiCss = require('tinymce/skins/ui/oxide/content.css');
|
const contentUiCss = require('tinymce/skins/ui/oxide/content.css');
|
||||||
const contentCss = require('tinymce/skins/content/default/content.css');
|
const contentCss = require('tinymce/skins/content/default/content.css');
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ module.exports = new Class({
|
||||||
async send(url, params) {
|
async send(url, params) {
|
||||||
if (!params) params = {};
|
if (!params) params = {};
|
||||||
params.srv = `json:${url}`;
|
params.srv = `json:${url}`;
|
||||||
return await this.sendWithUrl('POST', '.', params);
|
return this.sendWithUrl('POST', '.', params);
|
||||||
},
|
},
|
||||||
|
|
||||||
async sendForm(form) {
|
async sendForm(form) {
|
||||||
|
@ -136,11 +136,11 @@ module.exports = new Class({
|
||||||
if (elements[i].name)
|
if (elements[i].name)
|
||||||
params[elements[i].name] = elements[i].value;
|
params[elements[i].name] = elements[i].value;
|
||||||
|
|
||||||
return await this.sendWithUrl('POST', form.action, params);
|
return this.sendWithUrl('POST', form.action, params);
|
||||||
},
|
},
|
||||||
|
|
||||||
async sendFormMultipart(form) {
|
async sendFormMultipart(form) {
|
||||||
return await this.request({
|
return this.request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: form.action,
|
url: form.action,
|
||||||
data: new FormData(form)
|
data: new FormData(form)
|
||||||
|
@ -148,7 +148,7 @@ module.exports = new Class({
|
||||||
},
|
},
|
||||||
|
|
||||||
async sendFormData(formData) {
|
async sendFormData(formData) {
|
||||||
return await this.request({
|
return this.request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '',
|
url: '',
|
||||||
data: formData
|
data: formData
|
||||||
|
@ -159,7 +159,7 @@ module.exports = new Class({
|
||||||
* Called when REST response is received.
|
* Called when REST response is received.
|
||||||
*/
|
*/
|
||||||
async sendWithUrl(method, url, params) {
|
async sendWithUrl(method, url, params) {
|
||||||
return await this.request({
|
return this.request({
|
||||||
method,
|
method,
|
||||||
url,
|
url,
|
||||||
data: Vn.Url.makeUri(params),
|
data: Vn.Url.makeUri(params),
|
||||||
|
@ -174,15 +174,15 @@ module.exports = new Class({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: `api/${url}`
|
url: `api/${url}`
|
||||||
});
|
});
|
||||||
return await this.request(config);
|
return this.request(config);
|
||||||
},
|
},
|
||||||
|
|
||||||
async post(url, data, config) {
|
async post(url, data, config) {
|
||||||
return await this.requestData('POST', url, data, config);
|
return this.requestData('POST', url, data, config);
|
||||||
},
|
},
|
||||||
|
|
||||||
async patch(url, data, config) {
|
async patch(url, data, config) {
|
||||||
return await this.requestData('PATCH', url, data, config);
|
return this.requestData('PATCH', url, data, config);
|
||||||
},
|
},
|
||||||
|
|
||||||
async requestData(method, url, data, config) {
|
async requestData(method, url, data, config) {
|
||||||
|
@ -195,7 +195,7 @@ module.exports = new Class({
|
||||||
config.headers = Object.assign({}, config.headers, {
|
config.headers = Object.assign({}, config.headers, {
|
||||||
'Content-Type': 'application/json;charset=utf-8'
|
'Content-Type': 'application/json;charset=utf-8'
|
||||||
});
|
});
|
||||||
return await this.request(config);
|
return this.request(config);
|
||||||
},
|
},
|
||||||
|
|
||||||
async request(config) {
|
async request(config) {
|
||||||
|
@ -215,15 +215,13 @@ module.exports = new Class({
|
||||||
});
|
});
|
||||||
|
|
||||||
request.send(config.data);
|
request.send(config.data);
|
||||||
this._addRequest();
|
|
||||||
return await promise;
|
|
||||||
},
|
|
||||||
|
|
||||||
_addRequest() {
|
|
||||||
this._requestsCount++;
|
this._requestsCount++;
|
||||||
|
|
||||||
if (this._requestsCount === 1)
|
if (this._requestsCount === 1)
|
||||||
this.emit('loading-changed', true);
|
this.emit('loading-changed', true);
|
||||||
|
|
||||||
|
return promise;
|
||||||
},
|
},
|
||||||
|
|
||||||
_onStateChange(request, resolve, reject) {
|
_onStateChange(request, resolve, reject) {
|
||||||
|
@ -308,12 +306,11 @@ module.exports = new Class({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(error);
|
|
||||||
|
|
||||||
if (error.exception == 'SessionExpired')
|
if (error.exception == 'SessionExpired')
|
||||||
this.clearToken();
|
this.clearToken();
|
||||||
|
|
||||||
this.emit('error', error);
|
this.emit('error', error);
|
||||||
|
reject(error);
|
||||||
} else
|
} else
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hedera-web",
|
"name": "hedera-web",
|
||||||
"version": "22.48.20",
|
"version": "22.48.0",
|
||||||
"description": "Verdnatura web page",
|
"description": "Verdnatura web page",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
Loading…
Reference in New Issue