tryton-sao 7.0.37 → 7.0.38
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/CHANGELOG +5 -0
- package/dist/tryton-sao.css +24 -3
- package/dist/tryton-sao.js +43 -20
- package/dist/tryton-sao.min.css +24 -3
- package/dist/tryton-sao.min.js +2 -2
- package/package.json +1 -1
- package/src/sao.js +1 -1
- package/src/sao.less +6 -1
- package/src/view/form.js +42 -19
package/CHANGELOG
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
|
|
2
|
+
Version 7.0.38 - 2025-10-20
|
|
3
|
+
---------------------------
|
|
4
|
+
* Bug fixes (see mercurial logs for details)
|
|
5
|
+
* Use sandboxed iframe to display document (issue14290)
|
|
6
|
+
|
|
2
7
|
Version 7.0.37 - 2025-10-02
|
|
3
8
|
---------------------------
|
|
4
9
|
* Bug fixes (see mercurial logs for details)
|
package/dist/tryton-sao.css
CHANGED
|
@@ -10085,21 +10085,42 @@ img.icon {
|
|
|
10085
10085
|
min-width: 120px;
|
|
10086
10086
|
}
|
|
10087
10087
|
.form .form-document object,
|
|
10088
|
-
.board .form-document object
|
|
10088
|
+
.board .form-document object,
|
|
10089
|
+
.form .form-document img,
|
|
10090
|
+
.board .form-document img {
|
|
10089
10091
|
object-fit: scale-down;
|
|
10090
10092
|
object-position: center top;
|
|
10093
|
+
}
|
|
10094
|
+
.form .form-document iframe,
|
|
10095
|
+
.board .form-document iframe {
|
|
10096
|
+
border: 0;
|
|
10097
|
+
}
|
|
10098
|
+
.form .form-document object,
|
|
10099
|
+
.board .form-document object,
|
|
10100
|
+
.form .form-document iframe,
|
|
10101
|
+
.board .form-document iframe,
|
|
10102
|
+
.form .form-document img,
|
|
10103
|
+
.board .form-document img {
|
|
10091
10104
|
width: 100%;
|
|
10092
10105
|
height: 75vh;
|
|
10093
10106
|
}
|
|
10094
10107
|
@media screen and (max-width: 991px) {
|
|
10095
10108
|
.form .form-document object,
|
|
10096
|
-
.board .form-document object
|
|
10109
|
+
.board .form-document object,
|
|
10110
|
+
.form .form-document iframe,
|
|
10111
|
+
.board .form-document iframe,
|
|
10112
|
+
.form .form-document img,
|
|
10113
|
+
.board .form-document img {
|
|
10097
10114
|
height: 50vh;
|
|
10098
10115
|
}
|
|
10099
10116
|
}
|
|
10100
10117
|
@media screen and (max-width: 767px) {
|
|
10101
10118
|
.form .form-document object,
|
|
10102
|
-
.board .form-document object
|
|
10119
|
+
.board .form-document object,
|
|
10120
|
+
.form .form-document iframe,
|
|
10121
|
+
.board .form-document iframe,
|
|
10122
|
+
.form .form-document img,
|
|
10123
|
+
.board .form-document img {
|
|
10103
10124
|
height: 25vh;
|
|
10104
10125
|
}
|
|
10105
10126
|
}
|
package/dist/tryton-sao.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
/* eslint-disable no-redeclare */
|
|
5
5
|
var Sao = {
|
|
6
|
-
__version__: '7.0.
|
|
6
|
+
__version__: '7.0.38',
|
|
7
7
|
};
|
|
8
8
|
/* eslint-enable no-redeclare */
|
|
9
9
|
|
|
@@ -19259,15 +19259,42 @@ function eval_pyson(value){
|
|
|
19259
19259
|
'class': this.class_,
|
|
19260
19260
|
});
|
|
19261
19261
|
|
|
19262
|
-
this.
|
|
19262
|
+
this.content = this._create_content().appendTo(this.el);
|
|
19263
|
+
},
|
|
19264
|
+
_create_content: function(mimetype, url) {
|
|
19265
|
+
let tag_name = 'iframe';
|
|
19266
|
+
if (mimetype) {
|
|
19267
|
+
if (mimetype.startsWith('image/')) {
|
|
19268
|
+
tag_name = 'img';
|
|
19269
|
+
} else if (mimetype == 'application/pdf') {
|
|
19270
|
+
tag_name = 'object';
|
|
19271
|
+
}
|
|
19272
|
+
}
|
|
19273
|
+
let content = jQuery(`<${tag_name}/>`, {
|
|
19263
19274
|
'class': 'center-block',
|
|
19264
|
-
})
|
|
19265
|
-
if (
|
|
19266
|
-
|
|
19275
|
+
});
|
|
19276
|
+
if (tag_name == 'iframe') {
|
|
19277
|
+
content.attr('sandbox', '');
|
|
19267
19278
|
}
|
|
19268
|
-
if (attributes.
|
|
19269
|
-
|
|
19279
|
+
if (this.attributes.height) {
|
|
19280
|
+
content.css('height', parseInt(this.attributes.height, 10));
|
|
19270
19281
|
}
|
|
19282
|
+
if (this.attributes.width) {
|
|
19283
|
+
content.css('width', parseInt(this.attributes.width, 10));
|
|
19284
|
+
}
|
|
19285
|
+
if (url) {
|
|
19286
|
+
// set onload before data/src to be always called
|
|
19287
|
+
content.get().onload = function() {
|
|
19288
|
+
this.onload = null;
|
|
19289
|
+
window.URL.revokeObjectURL(url);
|
|
19290
|
+
};
|
|
19291
|
+
if (tag_name== 'object') {
|
|
19292
|
+
content.attr('data', url);
|
|
19293
|
+
} else {
|
|
19294
|
+
content.attr('src', url);
|
|
19295
|
+
}
|
|
19296
|
+
}
|
|
19297
|
+
return content;
|
|
19271
19298
|
},
|
|
19272
19299
|
display: function() {
|
|
19273
19300
|
Sao.View.Form.Document._super.display.call(this);
|
|
@@ -19283,34 +19310,30 @@ function eval_pyson(value){
|
|
|
19283
19310
|
filename = filename_field.get_client(record);
|
|
19284
19311
|
}
|
|
19285
19312
|
data.done(data => {
|
|
19286
|
-
var url, blob;
|
|
19287
19313
|
if (record !== this.record) {
|
|
19288
19314
|
return;
|
|
19289
19315
|
}
|
|
19290
19316
|
// in case onload was not yet triggered
|
|
19291
|
-
|
|
19317
|
+
let url = this.content.attr('data') ||
|
|
19318
|
+
this.content.attr('src');
|
|
19319
|
+
window.URL.revokeObjectURL(url);
|
|
19320
|
+
let mimetype;
|
|
19292
19321
|
if (!data) {
|
|
19293
19322
|
url = null;
|
|
19294
19323
|
} else {
|
|
19295
|
-
|
|
19324
|
+
mimetype = Sao.common.guess_mimetype(filename);
|
|
19296
19325
|
if (mimetype == 'application/octet-binary') {
|
|
19297
19326
|
mimetype = null;
|
|
19298
19327
|
}
|
|
19299
|
-
blob = new Blob([data], {
|
|
19328
|
+
let blob = new Blob([data], {
|
|
19300
19329
|
'type': mimetype,
|
|
19301
19330
|
});
|
|
19302
19331
|
url = window.URL.createObjectURL(blob);
|
|
19303
19332
|
}
|
|
19304
19333
|
// duplicate object to force refresh on buggy browsers
|
|
19305
|
-
|
|
19306
|
-
|
|
19307
|
-
|
|
19308
|
-
this.onload = null;
|
|
19309
|
-
window.URL.revokeObjectURL(url);
|
|
19310
|
-
};
|
|
19311
|
-
object.attr('data', url);
|
|
19312
|
-
this.object.replaceWith(object);
|
|
19313
|
-
this.object = object;
|
|
19334
|
+
let content = this._create_content(mimetype, url);
|
|
19335
|
+
this.content.replaceWith(content);
|
|
19336
|
+
this.content = content;
|
|
19314
19337
|
});
|
|
19315
19338
|
},
|
|
19316
19339
|
});
|
package/dist/tryton-sao.min.css
CHANGED
|
@@ -10085,21 +10085,42 @@ img.icon {
|
|
|
10085
10085
|
min-width: 120px;
|
|
10086
10086
|
}
|
|
10087
10087
|
.form .form-document object,
|
|
10088
|
-
.board .form-document object
|
|
10088
|
+
.board .form-document object,
|
|
10089
|
+
.form .form-document img,
|
|
10090
|
+
.board .form-document img {
|
|
10089
10091
|
object-fit: scale-down;
|
|
10090
10092
|
object-position: center top;
|
|
10093
|
+
}
|
|
10094
|
+
.form .form-document iframe,
|
|
10095
|
+
.board .form-document iframe {
|
|
10096
|
+
border: 0;
|
|
10097
|
+
}
|
|
10098
|
+
.form .form-document object,
|
|
10099
|
+
.board .form-document object,
|
|
10100
|
+
.form .form-document iframe,
|
|
10101
|
+
.board .form-document iframe,
|
|
10102
|
+
.form .form-document img,
|
|
10103
|
+
.board .form-document img {
|
|
10091
10104
|
width: 100%;
|
|
10092
10105
|
height: 75vh;
|
|
10093
10106
|
}
|
|
10094
10107
|
@media screen and (max-width: 991px) {
|
|
10095
10108
|
.form .form-document object,
|
|
10096
|
-
.board .form-document object
|
|
10109
|
+
.board .form-document object,
|
|
10110
|
+
.form .form-document iframe,
|
|
10111
|
+
.board .form-document iframe,
|
|
10112
|
+
.form .form-document img,
|
|
10113
|
+
.board .form-document img {
|
|
10097
10114
|
height: 50vh;
|
|
10098
10115
|
}
|
|
10099
10116
|
}
|
|
10100
10117
|
@media screen and (max-width: 767px) {
|
|
10101
10118
|
.form .form-document object,
|
|
10102
|
-
.board .form-document object
|
|
10119
|
+
.board .form-document object,
|
|
10120
|
+
.form .form-document iframe,
|
|
10121
|
+
.board .form-document iframe,
|
|
10122
|
+
.form .form-document img,
|
|
10123
|
+
.board .form-document img {
|
|
10103
10124
|
height: 25vh;
|
|
10104
10125
|
}
|
|
10105
10126
|
}
|