objectId: 695906
type: 3
parentId:
commentId:
name: NAME
commenttext: COMMENT
attachments[10000][url]: 8292488b394caa9.s.siteapi.org/comment/9r01qp6dhzoc80kwwkk48000ss8w0g
attachments[10000][name]: 2-4Е-8181.jpg
attachments[10000][size]: 68514
attachments[10000][timestamp]: 1592930989
attachments[10000][type]: 1
files:
captcha[id]: e9aee5e012d1dc4e65b30854d6ee6e3e
captcha[input]: 333333
initUploadFile: function(e) {
var t, i, n = this, o = ["doc", "docx", "xls", "xlsx", "pdf", "jpg", "jpeg", "gif", "png", "zip", "rar"], a = $(e), r = !1, s = $('<div id="progress"><div class="progressbar-value"></div></div>'), c = "fancybox-content", d = a.attr("data-file-upload") || "/putdocpub";
a.is("#products-order-form") ? c = "products-edit-window" : a.is("#services-order-form") && (c = "services-edit-window"),
t = a.find(".attach-btn a"),
i = new Nethouse.Uploader(t[0],{
path: d
}),
i.addExtensionFilter(o).addFileSizeFilter(20 * Nethouse.Uploader.MB).on("before", function(e) {
e.length && (Notifier.showIndicator(c),
s.hide(),
r || (r = !0,
t.after(s)),
t.hide())
}
.bind(this)).on("progress", function(e) {
s.show(),
s.find(".progressbar-value").css({
width: e.loaded / e.total * 100 + "%"
})
}).on("filecomplete", function(e, i, o) {
if (Notifier.hideIndicator(c),
s.hide(),
t.show(),
e)
return void ntNotification.showError(sprintf(window.view.translate("js_uploader_upload_file_fail"), o.name), 6e3);
var r, d, l, u, m, p, h, f = window.JSON.parse(i.response);
f.success && f.url || ntNotification.showError(sprintf(window.view.translate("js_uploader_upload_file_fail"), o.name), 6e3),
r = f.url,
d = f.name,
l = f.size,
u = f.timestamp,
a.find("#attach-url").val(r),
a.find("#attach-name").val(d),
a.find("#attach-size").val(l),
a.find("#attach-timestamp").val(u),
m = a.find(".attach-info .file-info"),
m.find(".attach-file-name").html(d),
p = n.getHumanReadableFileSize(l),
m.find(".attach-file-size").html(p),
m.parent().show(),
a.find(".attach-btn").hide(),
(h = n.getFileIcon(d)) && a.find(".file-icons").addClass(h)
}).on("error", function(e, i) {
s.hide(),
t.show();
var n = Nethouse.Uploader.Errors;
switch (e) {
case n.EXTENSION:
ntNotification.showError(sprintf(view.translate("js_uploader_extension_fail"), i.file.name, o.join(", ")), 6e3);
break;
case n.MAX_SIZE:
ntNotification.showError(sprintf(view.translate("js_uploader_max_size_fail"), i.file.name, "20 MB"), 6e3)
}
}
.bind(this))
}
JSON.stringify({
value: 'value',
date: 'date'
})
в jetbrains зарепортить можно