diff --git a/include/admin/comments.inc.php b/include/admin/comments.inc.php index 69ac4da7..e52f992f 100644 --- a/include/admin/comments.inc.php +++ b/include/admin/comments.inc.php @@ -61,8 +61,8 @@ if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminActio $comment['parent_id'] = $serendipity['POST']['replyTo']; if (!empty($comment['comment'])) { if (serendipity_saveComment($serendipity['POST']['entry_id'], $comment, 'NORMAL')) { - echo ''; - echo ''; + $data['commentReplied'] = true; + echo serendipity_smarty_show('admin/comments.inc.tpl', $data); return true; } else { $errormsg .= COMMENT_NOT_ADDED; diff --git a/templates/2k11/admin/comments.inc.tpl b/templates/2k11/admin/comments.inc.tpl index 8f97b0b4..6b2eda3a 100644 --- a/templates/2k11/admin/comments.inc.tpl +++ b/templates/2k11/admin/comments.inc.tpl @@ -1,6 +1,10 @@ {if !empty($errormsg)} {$errormsg} {/if} +{if $commentReplied} + {$CONST.COMMENT_ADDED} + +{else}

{$CONST.COMMENTS}

@@ -82,82 +86,84 @@
-{if !is_array($sql)} - {$CONST.NO_COMMENTS} + {if !is_array($sql)} + {$CONST.NO_COMMENTS} - Return to default comment list {* l18n *} -{else} -
- {$formtoken} - + Return to default comment list {* l18n *} + {else} + + {$formtoken} + -
- {if is_array($comments)} -
-
- - - -
-
+
+ + + +
+ + + {/if} {/if} diff --git a/templates/2k11/admin/serendipity_editor.js.tpl b/templates/2k11/admin/serendipity_editor.js.tpl index e6b8bdbf..438ad15c 100644 --- a/templates/2k11/admin/serendipity_editor.js.tpl +++ b/templates/2k11/admin/serendipity_editor.js.tpl @@ -558,6 +558,14 @@ window.log = function f(){ log.history = log.history || []; log.history.push(arg $('#' + id).toggleClass('multidel_selected'); } + serendipity.closeCommentPopup = function() { + {if $use_popups} + parent.self.close(); + {else} + window.parent.parent.$.magnificPopup.close(); + {/if} + } + }( window.serendipity = window.serendipity || {}, jQuery )); // Source: https://github.com/yatil/accessifyhtml5.js @@ -814,7 +822,11 @@ var AccessifyHTML5 = function (defaults, more_fixes) { $('.comments_reply').click(function(e) { e.preventDefault(); - window.open(this.href, 'CommentForm', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1').focus(); + {if $use_popups} + window.open(this.href, 'CommentForm', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1').focus(); + {else} + $(this).magnificPopup({ type:'iframe' }); + {/if} }); $('.comments_multidelete').click(function() { @@ -987,6 +999,12 @@ var AccessifyHTML5 = function (defaults, more_fixes) { $('.media_pane .pagination').clone().prependTo('.media_pane'); $('.comments_pane .pagination').clone().prependTo('.comments_pane'); $('.entries_pane .pagination').clone().prependTo('.entries_pane'); + + if ($('body').has('#comment_replied').size() > 0) { + $('#comment_replied').click(function() { + serendipity.closeCommentPopup(); + }); + } // Equal Heights