Changeset 3878:fd5264175804
- Timestamp:
- 09/17/18 16:46:35 (7 years ago)
- Branch:
- default
- Files:
-
- 2 added
- 8 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 -
inc/admin/lib.dc.page.php
r3874 r3878 765 765 self::jsLoad('js/jquery/jquery.biscuit.js') . 766 766 self::jsLoad('js/common.js') . 767 self::jsLoad('js/services.js') . 767 768 self::jsLoad('js/prelude.js') . 768 769 -
plugins/pages/js/list.js
r3709 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 6 if ($(line).attr('id') == undefined) { … … 11 11 var tr = document.getElementById('pe' + postId); 12 12 13 if (!tr && (action == 'toggle' || action == 'open')) { 14 tr = document.createElement('tr'); 15 tr.id = 'pe' + postId; 16 var td = document.createElement('td'); 17 td.colSpan = 8; 18 td.className = 'expand'; 19 tr.appendChild(td); 20 21 // Get post content 22 $.get('services.php', { 23 f: 'getPostById', 24 id: postId, 25 post_type: '' 26 }, function(data) { 27 var rsp = $(data).children('rsp')[0]; 28 29 if (rsp.attributes[0].value == 'ok') { 30 var post = $(rsp).find('post_display_content').text(); 31 var post_excerpt = $(rsp).find('post_display_excerpt').text(); 32 var res = ''; 33 34 if (post) { 35 if (post_excerpt) { 36 res += post_excerpt + '<hr />'; 37 } 38 res += post; 39 $(td).append(res); 40 } 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); 41 27 } else { 42 window.alert($(rsp).find('message').text());28 $(line).toggleClass('expand'); 43 29 } 30 }, { 31 type: 'page', 32 clean: (e.metaKey) 44 33 }); 45 46 $(line).addClass('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'); 34 } else { 35 $(tr).toggle(); 36 $(line).toggleClass('expand'); 54 37 } 55 38 }; -
plugins/pages/page.php
r3874 r3878 299 299 dcPage::jsModal() . 300 300 dcPage::jsLoad('js/_post.js') . 301 dcPage::jsLoad(dcPage::getPF('pages/js/page.js')) . 301 302 $admin_post_behavior . 302 303 dcPage::jsConfirmClose('entry-form', 'comment-form') . … … 731 732 $comment_url = $core->adminurl->get('admin.comment', ['id' => $rs->comment_id]); 732 733 733 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 734 $img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />'; 735 $sts_class = ''; 734 736 switch ($rs->comment_status) { 735 737 case 1: 736 738 $img_status = sprintf($img, __('Published'), 'check-on.png'); 739 $sts_class = 'sts-online'; 737 740 break; 738 741 case 0: 739 742 $img_status = sprintf($img, __('Unpublished'), 'check-off.png'); 743 $sts_class = 'sts-offline'; 740 744 break; 741 745 case -1: 742 746 $img_status = sprintf($img, __('Pending'), 'check-wrn.png'); 747 $sts_class = 'sts-pending'; 743 748 break; 744 749 case -2: 745 750 $img_status = sprintf($img, __('Junk'), 'junk.png'); 751 $sts_class = 'sts-junk'; 746 752 break; 747 753 } 748 754 749 755 echo 750 '<tr class="line ' . ($rs->comment_status != 1 ? ' offline' : ''). '"' .756 '<tr class="line ' . ($rs->comment_status != 1 ? ' offline ' : '') . $sts_class . '"' . 751 757 ' id="c' . $rs->comment_id . '">' . 752 758
Note: See TracChangeset
for help on using the changeset viewer.