From 65df7c9a213231bf52de59540ed3f61929d698a1 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Mon, 26 Jan 2015 12:28:15 -0300 Subject: [PATCH] comment_paragraph: remove macro button --- plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb | 9 ++------- plugins/comment_paragraph/public/comment_paragraph.css | 6 ------ plugins/comment_paragraph/public/comment_paragraph.js | 57 --------------------------------------------------------- plugins/comment_paragraph/public/images/balloons-comment.png | Bin 671 -> 0 bytes 4 files changed, 2 insertions(+), 70 deletions(-) delete mode 100644 plugins/comment_paragraph/public/comment_paragraph.css delete mode 100644 plugins/comment_paragraph/public/comment_paragraph.js delete mode 100644 plugins/comment_paragraph/public/images/balloons-comment.png diff --git a/plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb b/plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb index 3765480..5c0a813 100644 --- a/plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb +++ b/plugins/comment_paragraph/lib/comment_paragraph_plugin/macros/allow_comment.rb @@ -1,14 +1,9 @@ -#FIXME See a better way to generalize this parameter. ActionView::Base.sanitized_allowed_attributes += ['data-macro', 'data-macro-paragraph_uuid'] class CommentParagraphPlugin::AllowComment < Noosfero::Plugin::Macro + def self.configuration - { :params => [], - :skip_dialog => true, - :generator => 'makeAllCommentable();', - :js_files => 'comment_paragraph.js', - :icon_path => '/plugins/comment_paragraph/images/balloons-comment.png', - :css_files => 'comment_paragraph.css' } + { :params => [] } end def parse(params, inner_html, source) diff --git a/plugins/comment_paragraph/public/comment_paragraph.css b/plugins/comment_paragraph/public/comment_paragraph.css deleted file mode 100644 index 7d32318..0000000 --- a/plugins/comment_paragraph/public/comment_paragraph.css +++ /dev/null @@ -1,6 +0,0 @@ -div.article_comments { - background-color:#dddddd; - border-style: solid; - border-color:#bbbbbb; - border-width:2px; -} \ No newline at end of file diff --git a/plugins/comment_paragraph/public/comment_paragraph.js b/plugins/comment_paragraph/public/comment_paragraph.js deleted file mode 100644 index 497f10a..0000000 --- a/plugins/comment_paragraph/public/comment_paragraph.js +++ /dev/null @@ -1,57 +0,0 @@ -//String.prototype.startsWith = function(needle){ -// return(this.indexOf(needle) == 0); -//}; -// -//function makeAllCommentable() { -// var paragraphsTxt=""; -// var selectedTextCount=0; -// var notSelectedTextCount=0; -// var text; -// -// //Search for text that is not selected in the middle of selected text, in this case unselect everything -// jQuery('#article_body_ifr').contents().find('body').children().each(function( index ) { -// //Check if there are other texts not selected -// var element=jQuery(this).prop('outerHTML'); -// if(element.startsWith('

') && ! element.startsWith('

 

') ){ -// notSelectedTextCount++; -// } -// } -// }); -// -// if(selectedTextCount > 0 && notSelectedTextCount>0){ -// jQuery('#article_body_ifr').contents().find('body').children('.paragraph_comment').contents().unwrap(); -// //Workaround necessary to post the body of the article -// tinymce.activeEditor.execCommand('mceInsertContent', false, " "); -// return; -// } -// -// //Add p tag, when opening the editor. For some season it appear at the end without p tag -// foundCommentableParagraph = false; -// jQuery('#article_body_ifr').contents().find('body').children('div.article_comments').each(function( index ) { -// if(jQuery(this).html()!="" && jQuery(this).html()!=" " && jQuery(this).html()!="
"){ -// paragraphsTxt+="

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

"; -// } -// foundCommentableParagraph = true; -// }); -// -// //undo the paragraph comment tags -// if(foundCommentableParagraph === true){ -// tinyMCE.activeEditor.setContent(paragraphsTxt); -// return; -// } -// -// //Wraps the paragraph using the chosen class -// jQuery('#article_body_ifr').contents().find('body').children('p,table,img').each(function( index ) { -// text=jQuery(this).prop('outerHTML'); -// if(text!="" && text!=" " && text!="
"){ -// paragraphsTxt+='
' + text + '

' -// } -// }); -// tinyMCE.activeEditor.setContent(paragraphsTxt); -// -// //Workaround necessary to post the body of the article -// tinymce.activeEditor.execCommand('mceInsertContent', false, " "); -//} diff --git a/plugins/comment_paragraph/public/images/balloons-comment.png b/plugins/comment_paragraph/public/images/balloons-comment.png deleted file mode 100644 index 819d1f5..0000000 Binary files a/plugins/comment_paragraph/public/images/balloons-comment.png and /dev/null differ -- libgit2 0.21.2