Changeset 3878:fd5264175804 for admin/js/_post.js
- Timestamp:
- 09/17/18 16:46:35 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_post.js
r3706 r3878 2 2 'use strict'; 3 3 4 dotclear.viewCommentContent = function(line) { 4 dotclear.viewCommentContent = function(line, action, e) { 5 action = action || 'toggle'; 6 if ($(line).attr('id') == undefined) { 7 return; 8 } 9 5 10 var commentId = $(line).attr('id').substr(1); 6 11 var tr = document.getElementById('ce' + commentId); 12 var spam = (e.metaKey || $(line).hasClass('sts-junk')); 7 13 8 14 if (!tr) { 9 tr = document.createElement('tr');10 tr.id = 'ce' + commentId;11 var td = document.createElement('td');12 td.colSpan = 6;13 td.className = 'expand';14 tr.appendChild(td);15 16 15 // Get comment content 17 $.get('services.php', { 18 f: 'getCommentById', 19 id: commentId 20 }, function(data) { 21 var rsp = $(data).children('rsp')[0]; 22 23 if (rsp.attributes[0].value == 'ok') { 24 var comment = $(rsp).find('comment_display_content').text(); 25 26 if (comment) { 27 $(td).append(comment); 28 var comment_email = $(rsp).find('comment_email').text(); 29 var comment_site = $(rsp).find('comment_site').text(); 30 // var comment_ip = $(rsp).find('comment_ip').text(); 31 var comment_spam_disp = $(rsp).find('comment_spam_disp').text(); 32 33 $(td).append('<p><strong>' + dotclear.msg.website + 34 '</strong> ' + comment_site + '<br />' + 35 '<strong>' + dotclear.msg.email + '</strong> ' + 36 comment_email + '<br />' + comment_spam_disp + '</p>'); 37 } 16 dotclear.getCommentContent(commentId, function(content) { 17 if (content) { 18 // Content found 19 tr = document.createElement('tr'); 20 tr.id = 'ce' + commentId; 21 var td = document.createElement('td'); 22 td.colSpan = $(line).children('td').length; 23 td.className = 'expand'; 24 tr.appendChild(td); 25 $(td).append(content); 26 $(line).addClass('expand'); 27 line.parentNode.insertBefore(tr, line.nextSibling); 38 28 } else { 39 window.alert($(rsp).find('message').text()); 29 // No content, content not found or server error 30 $(line).removeClass('expand'); 40 31 } 32 }, { 33 ip: false, 34 clean: spam 41 35 }); 42 43 $(line).toggleClass('expand');44 line.parentNode.insertBefore(tr, line.nextSibling);45 } else if (tr.style.display == 'none') {46 $(tr).toggle();47 $(line).toggleClass('expand');48 36 } else { 49 37 $(tr).toggle(); … … 164 152 $('#comments').onetabload(function() { 165 153 $.expandContent({ 154 line: $('#form-comments .comments-list tr:not(.line)'), 166 155 lines: $('#form-comments .comments-list tr.line'), 167 156 callback: dotclear.viewCommentContent … … 176 165 $('#trackbacks').onetabload(function() { 177 166 $.expandContent({ 167 line: $('#form-trackbacks .comments-list tr:not(.line)'), 178 168 lines: $('#form-trackbacks .comments-list tr.line'), 179 169 callback: dotclear.viewCommentContent
Note: See TracChangeset
for help on using the changeset viewer.