diff --git a/public/comment_paragraph.js b/public/comment_paragraph.js index 056c4f7..16eaa63 100644 --- a/public/comment_paragraph.js +++ b/public/comment_paragraph.js @@ -1,47 +1,8 @@ -function getNextParagraphId() { - max = -1; - paragraphs = jQuery('#article_body_ifr').contents().find('.article_comments'); - paragraphs.each(function(key, value) { - value = jQuery(value).attr('data-macro-paragraph_id'); - if(value>max) max = parseInt(value); - }); - return max+1; -} - function makeCommentable() { - tinyMCE.activeEditor.focus(); - start = jQuery(tinyMCE.activeEditor.selection.getStart()).closest('p'); - end = jQuery(tinyMCE.activeEditor.selection.getEnd()).closest('p'); - - //text = start.parent().children(); - text = jQuery('#article_body_ifr').contents().find('*'); - selection = text.slice(text.index(start), text.index(end)+1); - - hasTag = false; - selection.each(function(key, value) { - commentTag = jQuery(value).closest('.article_comments'); - if(commentTag.length) { - commentTag.children().unwrap('
"); - } - } + tinyMCE.activeEditor.setContent(paragraphsTxt) } -- libgit2 0.21.2