Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 98... Línea 98...
98
                            var container = Y.one('#comment-list-'+cid);
98
                            var container = Y.one('#comment-list-'+cid);
99
                            var result = await scope.render([obj], true);
99
                            var result = await scope.render([obj], true);
100
                            var newcomment = Y.Node.create(result.html);
100
                            var newcomment = Y.Node.create(result.html);
101
                            container.appendChild(newcomment);
101
                            container.appendChild(newcomment);
102
                            var ids = result.ids;
102
                            var ids = result.ids;
103
                            var linkText = Y.one('#comment-link-text-' + cid);
103
                            var linkTextCount = Y.one('#comment-link-text-' + cid + ' .comment-link-count');
104
                            if (linkText) {
104
                            if (linkTextCount) {
105
                                linkText.set('innerHTML', M.util.get_string('commentscount', 'moodle', obj.count));
105
                                linkTextCount.set('innerHTML', obj.count);
106
                            }
106
                            }
107
                            for(var i in ids) {
107
                            for(var i in ids) {
108
                                var attributes = {
108
                                var attributes = {
109
                                    color: { to: '#06e' },
109
                                    color: { to: '#06e' },
110
                                    backgroundColor: { to: '#FFE390' }
110
                                    backgroundColor: { to: '#FFE390' }
Línea 247... Línea 247...
247
                };
247
                };
248
                this.request({
248
                this.request({
249
                    scope: scope,
249
                    scope: scope,
250
                    params: params,
250
                    params: params,
251
                    callback: async function(id, ret, args) {
251
                    callback: async function(id, ret, args) {
252
                        var linkText = Y.one('#comment-link-text-' + scope.client_id);
252
                        var linkTextCount = Y.one('#comment-link-text-' + scope.client_id + ' .comment-link-count');
253
                        if (ret.count && linkText) {
253
                        if (linkTextCount) {
254
                            linkText.set('innerHTML', M.util.get_string('commentscount', 'moodle', ret.count));
254
                            linkTextCount.set('innerHTML', ret.count);
255
                        }
255
                        }
256
                        var container = Y.one('#comment-list-'+scope.client_id);
256
                        var container = Y.one('#comment-list-'+scope.client_id);
257
                        var pagination = Y.one('#comment-pagination-'+scope.client_id);
257
                        var pagination = Y.one('#comment-pagination-'+scope.client_id);
258
                        if (ret.pagination) {
258
                        if (ret.pagination) {
259
                            pagination.set('innerHTML', ret.pagination);
259
                            pagination.set('innerHTML', ret.pagination);
Línea 282... Línea 282...
282
                var scope = this,
282
                var scope = this,
283
                    cid = scope.client_id,
283
                    cid = scope.client_id,
284
                    params = {'commentid': id};
284
                    params = {'commentid': id};
285
                function remove_dom(type, anim, cmt) {
285
                function remove_dom(type, anim, cmt) {
286
                    cmt.remove();
286
                    cmt.remove();
287
                    var linkText = Y.one('#comment-link-text-' + cid),
287
                    var linkTextCount = Y.one('#comment-link-text-' + cid + ' .comment-link-count'),
288
                        comments = Y.all('#comment-list-' + cid + ' li');
288
                        comments = Y.all('#comment-list-' + cid + ' li');
289
                    if (linkText && comments) {
289
                    if (linkTextCount) {
290
                        linkText.set('innerHTML', M.util.get_string('commentscount', 'moodle', comments.size()));
290
                        linkTextCount.set('innerHTML', comments.size());
291
                    }
291
                    }
292
                }
292
                }
293
                this.request({
293
                this.request({
294
                    action: 'delete',
294
                    action: 'delete',
295
                    scope: scope,
295
                    scope: scope,