@osimatic/helpers-js 1.0.110 → 1.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/details_sub_array.js +2 -2
- package/file.js +2 -2
- package/http_client.js +3 -0
- package/media.js +1 -1
- package/package.json +1 -1
package/details_sub_array.js
CHANGED
|
@@ -81,7 +81,7 @@ class DetailsSubArray {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
//link.attr('disabled', true).button('loading');
|
|
84
|
-
|
|
84
|
+
HTTPClient.request('GET', link.data('url_details'), null,
|
|
85
85
|
(jsonObj) => {
|
|
86
86
|
if (jsonObj == null) {
|
|
87
87
|
if (typeof callbackOnDetailsActionRequestError != 'undefined' && callbackOnDetailsActionRequestError != null) {
|
|
@@ -108,7 +108,7 @@ class DetailsSubArray {
|
|
|
108
108
|
|
|
109
109
|
onComplete();
|
|
110
110
|
//window.location.replace(decodeURIComponent(urlRetour));
|
|
111
|
-
}
|
|
111
|
+
}
|
|
112
112
|
);
|
|
113
113
|
}
|
|
114
114
|
|
package/file.js
CHANGED
|
@@ -113,7 +113,7 @@ class Img {
|
|
|
113
113
|
$.ajax({
|
|
114
114
|
type: 'GET',
|
|
115
115
|
url: url,
|
|
116
|
-
headers:
|
|
116
|
+
headers: HTTPClient.getHeaders(true),
|
|
117
117
|
cache: false,
|
|
118
118
|
xhrFields: {responseType: 'blob'},
|
|
119
119
|
success: (data) => {
|
|
@@ -121,7 +121,7 @@ class Img {
|
|
|
121
121
|
// $(img).attr('src', urlCreator.createObjectURL(data));
|
|
122
122
|
Img.setBlobToImg($(img), data);
|
|
123
123
|
},
|
|
124
|
-
error: (jqxhr, status, errorThrown) =>
|
|
124
|
+
error: (jqxhr, status, errorThrown) => HTTPClient.logJqueryRequestFailure(jqxhr, status, errorThrown),
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
|
package/http_client.js
CHANGED
|
@@ -140,6 +140,9 @@ class HTTPClient {
|
|
|
140
140
|
static logRequestFailure(response, json) {
|
|
141
141
|
console.error('Request failure. Status: '+response.statusText+' ; HTTP Code : '+response.status, json);
|
|
142
142
|
}
|
|
143
|
+
static logJqueryRequestFailure(jqxhr, status, errorThrown) {
|
|
144
|
+
console.error('Request failure. Status: ' + status + ' ; HTTP Code: ' + jqxhr.status + (null != errorThrown && '' !== errorThrown ? ' ; Error message: ' + errorThrown : ''), jqxhr.responseJSON);
|
|
145
|
+
}
|
|
143
146
|
|
|
144
147
|
static isExpiredToken(response, json) {
|
|
145
148
|
if (response.status !== 401) {
|
package/media.js
CHANGED
|
@@ -45,7 +45,7 @@ class AudioMedia {
|
|
|
45
45
|
let context = new (window.AudioContext || window.webkitAudioContext)();
|
|
46
46
|
let request = new XMLHttpRequest();
|
|
47
47
|
request.open("GET", url, true);
|
|
48
|
-
Object.entries(
|
|
48
|
+
Object.entries(HTTPClient.getHeaders(true)).forEach(([key, value]) => request.setRequestHeader(key, value));
|
|
49
49
|
request.responseType = "arraybuffer";
|
|
50
50
|
|
|
51
51
|
request.onload = function () {
|