/
githubmirror
/
drawio
Обзор
Документация
Войти
/
githubmirror
/
drawio
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
src/main/webapp/js/diagramly/DriveComment.js
64 строки
2 KB
David Benson
30.4.3 release
22 июл 2026, 21:34
22 июл 2026, 21:34
f650bf3
Код
Авторство
О чём код?
/** * Copyright (c) 2020-2025, JGraph Holdings Ltd * Copyright (c) 2020-2025, draw.io AG */ DriveComment = function(file, id, content, modifiedDate, createdDate, isResolved, user, pCommentId) { DrawioComment.call(this, file, id, content, modifiedDate, createdDate, isResolved, user); this.pCommentId = pCommentId; //a reply }; //Extends DrawioComment mxUtils.extend(DriveComment, DrawioComment); DriveComment.prototype.addReply = function(reply, success, error, doResolve, doReopen) { var body = {'content': reply.content}; if (doResolve) { body.action = 'resolve'; } else if (doReopen) { body.action = 'reopen'; } this.file.ui.drive.executeRequest( { fullUrl: this.file.getCommentUrl('/' + this.id + '/replies', 'id'), params: body, method: 'POST' }, mxUtils.bind(this, function(resp) { success(resp.id); //pass reply id }), error); }; DriveComment.prototype.editComment = function(newContent, success, error) { this.content = newContent; var body = {'content': newContent}; this.file.ui.drive.executeRequest( { fullUrl: this.pCommentId ? this.file.getCommentUrl('/' + this.pCommentId + '/replies/' + this.id, 'id') : this.file.getCommentUrl('/' + this.id, 'id'), params: body, method: 'PATCH' }, success, error); }; DriveComment.prototype.deleteComment = function(success, error) { this.file.ui.drive.executeRequest( { fullUrl: this.file.getCommentUrl((this.pCommentId ? '/' + this.pCommentId + '/replies' : '') + '/' + this.id), method: 'DELETE' }, success, error); };