diff --git a/plugins/comment_paragraph/public/comment_paragraph.js b/plugins/comment_paragraph/public/comment_paragraph.js index 16eaa63..4e7ad53 100644 --- a/plugins/comment_paragraph/public/comment_paragraph.js +++ b/plugins/comment_paragraph/public/comment_paragraph.js @@ -1,7 +1,20 @@ function makeCommentable() { paragraphsTxt="" + + foundCommentableParagraph = false; + jQuery('#article_body_ifr').contents().find('body').children('div.article_comments').each(function( index ) { + paragraphsTxt+="

" + jQuery(this).html() + "

"; + console.log(jQuery(this).html()) + foundCommentableParagraph = true; + }); + + if(foundCommentableParagraph === true){ + tinyMCE.activeEditor.setContent(paragraphsTxt) + return; + } + jQuery('#article_body_ifr').contents().find('body').children('p').each(function( index ) { - paragraphsTxt+='

' + jQuery(this).html() + '

' + paragraphsTxt+='

' + jQuery(this).html() + '


' }); tinyMCE.activeEditor.setContent(paragraphsTxt) } -- libgit2 0.21.2