diff --git a/public/comment_paragraph_macro.js b/public/comment_paragraph_macro.js index 397a403..fff6bd6 100644 --- a/public/comment_paragraph_macro.js +++ b/public/comment_paragraph_macro.js @@ -10,93 +10,48 @@ function getIdCommentParagraph(paragraphId){ return paragraphId.substring(idx+1, paragraphId.length); } -function teleportToBody(element){ - var $ = jQuery; - element.detach(); - $('body').append(element); -} - -function moveCommentsToTheSide(paragraphId, mouseX, mouseY){ - var $ = jQuery; - //var element = sideCommentForm; - //element.detach(); - //if ( $('body #side_comment_form').size === 0){ -// $('body').append(element); -// } - //element.css({top: 0, border-right: 20, position:'absolute'}); -} +jQuery(document).ready(function($) { + $('.display-comment-form').unbind(); + $('.display-comment-form').click(function(){ + var $button = $(this); + showBox($button.parents('.post_comment_box')); + $($button).hide(); + $button.closest('.page-comment-form').find('input').first().focus(); + return false; + }); -//function buildSideCommentBlock(){ -// var $ = jQuery; -// $("body").append('\ -//
+
+ <%= inner_html %>
+
+ |
+
+
+
+ <%= count %>
+
+
+ |
+
+
+ <%=
+ url = { :profile => profile_identifier, :controller => 'comment_paragraph_plugin_profile', :action => 'view_comments', :paragraph_id => paragraph_id, :article_id => article_id}
+ link_to_remote(
+ image_tag("/plugins/comment_paragraph/images/comments.gif"),
+ {
+ :url => url,
+ :method => :post,
+ :condition => "!toggleParagraph(#{paragraph_id})",
+ :complete => "loadCompleted(#{paragraph_id})"
+ },
+ {
+ :id => "link_to_ajax_comments_#{paragraph_id}",
+ :'data-url' => url_for(url)
+ }
+ )%>
+
+
+ |
+
\n\ -// [side comments collumn]
\n\ -//