Changeset 3878:fd5264175804 for admin
- Timestamp:
- 09/17/18 16:46:35 (7 years ago)
- Branch:
- default
- Location:
- admin
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_comments.js
r3706 r3878 2 2 'use strict'; 3 3 4 dotclear.viewCommentContent = function(line, action ) {4 dotclear.viewCommentContent = function(line, action, e) { 5 5 action = action || 'toggle'; 6 if ($(line).attr('id') == undefined) { 7 return; 8 } 9 6 10 var commentId = $(line).attr('id').substr(1); 7 11 var tr = document.getElementById('ce' + commentId); 12 var spam = (e.metaKey || $(line).hasClass('sts-junk')); 8 13 9 if (!tr && (action == 'toggle' || action == 'open')) { 10 tr = document.createElement('tr'); 11 tr.id = 'ce' + commentId; 12 var td = document.createElement('td'); 13 td.colSpan = 6; 14 td.className = 'expand'; 15 tr.appendChild(td); 16 17 // Get comment content 18 $.get('services.php', { 19 f: 'getCommentById', 20 id: commentId 21 }, function(data) { 22 var rsp = $(data).children('rsp')[0]; 23 24 if (rsp.attributes[0].value == 'ok') { 25 var comment = $(rsp).find('comment_display_content').text(); 26 27 if (comment) { 28 $(td).append(comment); 29 var comment_email = $(rsp).find('comment_email').text(); 30 var comment_site = $(rsp).find('comment_site').text(); 31 var comment_ip = $(rsp).find('comment_ip').text(); 32 var comment_spam_disp = $(rsp).find('comment_spam_disp').text(); 33 34 $(td).append('<p><strong>' + dotclear.msg.website + 35 '</strong> ' + comment_site + '<br />' + 36 '<strong>' + dotclear.msg.email + '</strong> ' + comment_email + '<br />' + 37 '<strong>' + dotclear.msg.ip_address + 38 '</strong> <a href="comments.php?ip=' + comment_ip + '">' + comment_ip + '</a>' + 39 '<br />' + comment_spam_disp + '</p>'); 40 } 14 if (!tr) { 15 // Get comment content if possible 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); 41 28 } else { 42 window.alert($(rsp).find('message').text()); 29 // No content, content not found or server error 30 $(line).removeClass('expand'); 43 31 } 32 }, { 33 clean: spam 44 34 }); 45 35 } else { 36 $(tr).toggle(); 46 37 $(line).toggleClass('expand'); 47 line.parentNode.insertBefore(tr, line.nextSibling);48 } else if (tr && tr.style.display == 'none' && (action == 'toggle' || action == 'open')) {49 $(tr).css('display', 'table-row');50 $(line).addClass('expand');51 } else if (tr && tr.style.display != 'none' && (action == 'toggle' || action == 'close')) {52 $(tr).css('display', 'none');53 $(line).removeClass('expand');54 38 } 55 39 }; -
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 -
admin/js/_posts_list.js
r3706 r3878 2 2 'use strict'; 3 3 4 dotclear.viewPostContent = function(line, action ) {4 dotclear.viewPostContent = function(line, action, e) { 5 5 action = action || 'toggle'; 6 if ($(line).attr('id') == undefined) { 7 return; 8 } 9 6 10 var postId = $(line).attr('id').substr(1); 7 11 var tr = document.getElementById('pe' + postId); 8 12 9 if (!tr && (action == 'toggle' || action == 'open')) { 10 tr = document.createElement('tr'); 11 tr.id = 'pe' + postId; 12 var td = document.createElement('td'); 13 td.colSpan = 8; 14 td.className = 'expand'; 15 tr.appendChild(td); 16 17 // Get post content 18 $.get('services.php', { 19 f: 'getPostById', 20 id: postId, 21 post_type: '' 22 }, function(data) { 23 var rsp = $(data).children('rsp')[0]; 24 25 if (rsp.attributes[0].value == 'ok') { 26 var post = $(rsp).find('post_display_content').text(); 27 var post_excerpt = $(rsp).find('post_display_excerpt').text(); 28 var res = ''; 29 30 if (post) { 31 if (post_excerpt) { 32 res += post_excerpt + '<hr />'; 33 } 34 res += post; 35 $(td).append(res); 36 } 13 if (!tr) { 14 // Get post content if possible 15 dotclear.getEntryContent(postId, function(content) { 16 if (content) { 17 // Content found 18 tr = document.createElement('tr'); 19 tr.id = 'pe' + postId; 20 var td = document.createElement('td'); 21 td.colSpan = $(line).children('td').length; 22 td.className = 'expand'; 23 tr.appendChild(td); 24 $(td).append(content); 25 $(line).addClass('expand'); 26 line.parentNode.insertBefore(tr, line.nextSibling); 37 27 } else { 38 window.alert($(rsp).find('message').text());28 $(line).toggleClass('expand'); 39 29 } 30 }, { 31 clean: (e.metaKey) 40 32 }); 41 42 $(line).addClass('expand'); 43 line.parentNode.insertBefore(tr, line.nextSibling); 44 } else if (tr && tr.style.display == 'none' && (action == 'toggle' || action == 'open')) { 45 $(tr).css('display', 'table-row'); 46 $(line).addClass('expand'); 47 } else if (tr && tr.style.display != 'none' && (action == 'toggle' || action == 'close')) { 48 $(tr).css('display', 'none'); 49 $(line).removeClass('expand'); 33 } else { 34 $(tr).toggle(); 35 $(line).toggleClass('expand'); 50 36 } 51 37 }; -
admin/js/common.js
r3870 r3878 173 173 $('<button type="button" class="details-cmd" aria-label="' + dotclear.img_plus_alt + '">' + dotclear.img_plus_txt + '</button>').click(function(e) { 174 174 toggleArrow(this); 175 callback(line );175 callback(line, '', e); 176 176 e.preventDefault(); 177 177 }).prependTo($(line).children().get(0)); // first td … … 182 182 lines.each(function() { 183 183 toggleArrow(this.firstChild.firstChild, action); 184 callback(this, action );184 callback(this, action, e); 185 185 }); 186 186 e.preventDefault(); -
admin/post.php
r3874 r3878 498 498 $comment_url = $core->adminurl->get("admin.comment", ['id' => $rs->comment_id]); 499 499 500 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 500 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 501 $sts_class = ''; 501 502 switch ($rs->comment_status) { 502 503 case 1: 503 504 $img_status = sprintf($img, __('Published'), 'check-on.png'); 505 $sts_class = 'sts-online'; 504 506 break; 505 507 case 0: 506 508 $img_status = sprintf($img, __('Unpublished'), 'check-off.png'); 509 $sts_class = 'sts-offline'; 507 510 break; 508 511 case -1: 509 512 $img_status = sprintf($img, __('Pending'), 'check-wrn.png'); 513 $sts_class = 'sts-pending'; 510 514 break; 511 515 case -2: 512 516 $img_status = sprintf($img, __('Junk'), 'junk.png'); 517 $sts_class = 'sts-junk'; 513 518 break; 514 519 } 515 520 516 521 echo 517 '<tr class="line ' . ($rs->comment_status != 1 ? ' offline' : ''). '"' .522 '<tr class="line ' . ($rs->comment_status != 1 ? ' offline ' : '') . $sts_class . '"' . 518 523 ' id="c' . $rs->comment_id . '">' . 519 524
Note: See TracChangeset
for help on using the changeset viewer.