Commit 65df7c9a213231bf52de59540ed3f61929d698a1

Authored by Victor Costa
1 parent 4522d102

comment_paragraph: remove macro button

plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb
1   -#FIXME See a better way to generalize this parameter.
2 1 ActionView::Base.sanitized_allowed_attributes += ['data-macro', 'data-macro-paragraph_uuid']
3 2  
4 3 class CommentParagraphPlugin::AllowComment < Noosfero::Plugin::Macro
  4 +
5 5 def self.configuration
6   - { :params => [],
7   - :skip_dialog => true,
8   - :generator => 'makeAllCommentable();',
9   - :js_files => 'comment_paragraph.js',
10   - :icon_path => '/plugins/comment_paragraph/images/balloons-comment.png',
11   - :css_files => 'comment_paragraph.css' }
  6 + { :params => [] }
12 7 end
13 8  
14 9 def parse(params, inner_html, source)
... ...
plugins/comment_paragraph/public/comment_paragraph.css
... ... @@ -1,6 +0,0 @@
1   -div.article_comments {
2   - background-color:#dddddd;
3   - border-style: solid;
4   - border-color:#bbbbbb;
5   - border-width:2px;
6   -}
7 0 \ No newline at end of file
plugins/comment_paragraph/public/comment_paragraph.js
... ... @@ -1,57 +0,0 @@
1   -//String.prototype.startsWith = function(needle){
2   -// return(this.indexOf(needle) == 0);
3   -//};
4   -//
5   -//function makeAllCommentable() {
6   -// var paragraphsTxt="";
7   -// var selectedTextCount=0;
8   -// var notSelectedTextCount=0;
9   -// var text;
10   -//
11   -// //Search for text that is not selected in the middle of selected text, in this case unselect everything
12   -// jQuery('#article_body_ifr').contents().find('body').children().each(function( index ) {
13   -// //Check if there are other texts not selected
14   -// var element=jQuery(this).prop('outerHTML');
15   -// if(element.startsWith('<div')){
16   -// selectedTextCount++;
17   -// }else{
18   -// if(! element.startsWith('<p><br></p>') && ! element.startsWith('<p>&nbsp;</p>') ){
19   -// notSelectedTextCount++;
20   -// }
21   -// }
22   -// });
23   -//
24   -// if(selectedTextCount > 0 && notSelectedTextCount>0){
25   -// jQuery('#article_body_ifr').contents().find('body').children('.paragraph_comment').contents().unwrap();
26   -// //Workaround necessary to post the body of the article
27   -// tinymce.activeEditor.execCommand('mceInsertContent', false, " ");
28   -// return;
29   -// }
30   -//
31   -// //Add p tag, when opening the editor. For some season it appear at the end without p tag
32   -// foundCommentableParagraph = false;
33   -// jQuery('#article_body_ifr').contents().find('body').children('div.article_comments').each(function( index ) {
34   -// if(jQuery(this).html()!="" && jQuery(this).html()!=" " && jQuery(this).html()!="<br>"){
35   -// paragraphsTxt+="<p>" + jQuery(this).html() + "</p>";
36   -// }
37   -// foundCommentableParagraph = true;
38   -// });
39   -//
40   -// //undo the paragraph comment tags
41   -// if(foundCommentableParagraph === true){
42   -// tinyMCE.activeEditor.setContent(paragraphsTxt);
43   -// return;
44   -// }
45   -//
46   -// //Wraps the paragraph using the chosen class
47   -// jQuery('#article_body_ifr').contents().find('body').children('p,table,img').each(function( index ) {
48   -// text=jQuery(this).prop('outerHTML');
49   -// if(text!="" && text!=" " && text!="<br>"){
50   -// paragraphsTxt+='<div class="macro article_comments paragraph_comment" data-macro="comment_paragraph_plugin/allow_comment" data-macro-paragraph_uuid="' + index + '">' + text + '</div><br>'
51   -// }
52   -// });
53   -// tinyMCE.activeEditor.setContent(paragraphsTxt);
54   -//
55   -// //Workaround necessary to post the body of the article
56   -// tinymce.activeEditor.execCommand('mceInsertContent', false, " ");
57   -//}
plugins/comment_paragraph/public/images/balloons-comment.png

671 Bytes