From b12d5b1c40ef06f6142a5ff1ead6e59cbfb39ba3 Mon Sep 17 00:00:00 2001 From: Francisco Marcelo de Araújo Lima Júnior Date: Mon, 5 May 2014 12:10:55 -0300 Subject: [PATCH] #community dashboard - updating theme --- public/javascripts/community_hub.js | 27 ++++++--------------------- public/style.css | 35 ++++------------------------------- views/community_hub_plugin_public/_mediation.rhtml | 2 +- views/community_hub_plugin_public/_mediation_comment_form.rhtml | 1 - views/content_viewer/hub.rhtml | 2 -- 5 files changed, 11 insertions(+), 56 deletions(-) diff --git a/public/javascripts/community_hub.js b/public/javascripts/community_hub.js index bb8d391..416752e 100644 --- a/public/javascripts/community_hub.js +++ b/public/javascripts/community_hub.js @@ -50,15 +50,12 @@ function new_mediation_comment(button, mediation) { jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", true); - jQuery("body").addClass("loading"); - jQuery(".loading-mediation-comment").filter("#" + mediation).addClass("loading-signal-processing"); + jQuery("body").addClass("hub-loading"); jQuery.post(form.attr("action"), form.serialize(), function(data) { - jQuery(".loading-mediation-comment").filter("#" + mediation).removeClass("loading-signal-processing"); + jQuery("body").removeClass("hub-loading"); if (data.ok) { jQuery("#mediation-comment-form-" + mediation + " textarea").val(''); - jQuery(".loading-mediation-comment").filter("#" + mediation).addClass("loading-signal-done"); - jQuery("body").removeClass("loading"); jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", false); update_mediation_comments(mediation, false); setTimeout(function(){ @@ -67,8 +64,6 @@ function new_mediation_comment(button, mediation) { mediations.push( [ mediation, setInterval(function() { update_mediation_comments(mediation, false)}, 5000) ] ); } else { - jQuery(".loading-mediation-comment").filter("#" + mediation).addClass("loading-signal-error"); - jQuery("body").removeClass("loading"); jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", false); setTimeout(function(){ clearLoadingMediationCommentSignal(mediation); @@ -90,23 +85,18 @@ function new_message(button) { jQuery(".hub .form-message .submit").attr("disabled", true); - jQuery("body").addClass("loading"); - jQuery("#loading-message").addClass("loading-signal-processing"); + jQuery("body").addClass("hub-loading"); jQuery.post(form.attr("action"), form.serialize(), function(data) { - jQuery("#loading-message").removeClass("loading-signal-processing"); + jQuery("body").removeClass("hub-loading"); if (data.ok) { jQuery(".hub .form-message #message_body").val(''); - jQuery("#loading-message").addClass("loading-signal-done"); - jQuery("body").removeClass("loading"); jQuery(".hub .form-message .submit").attr("disabled", false); update_live_stream(false); setTimeout(clearLoadingMessageSignal, 3000); } else { - jQuery("#loading-message").addClass("loading-signal-error"); - jQuery("body").removeClass("loading"); jQuery(".hub .form-message .submit").attr("disabled", false); setTimeout(clearLoadingMessageSignal, 3000); } @@ -125,23 +115,18 @@ function new_mediation(button) { jQuery(".hub .form-mediation .submit").attr("disabled", true); - jQuery("body").addClass("loading"); - jQuery("#loading-mediation").addClass("loading-signal-processing"); + jQuery("body").addClass("hub-loading"); tinymce.triggerSave(); jQuery.post(form.attr("action"), form.serialize(), function(data) { - jQuery("#loading-mediation").removeClass("loading-signal-processing"); + jQuery("body").removeClass("hub-loading"); if (data.ok) { - jQuery("#loading-mediation").addClass("loading-signal-done"); - jQuery("body").removeClass("loading"); jQuery(".hub .form-mediation .submit").attr("disabled", false); tinymce.get('article_body').setContent(''); update_mediations(); setTimeout(clearLoadingMediationSignal, 3000); } else { - jQuery("#loading-mediation").addClass("loading-signal-error"); - jQuery("body").removeClass("loading"); jQuery(".hub .form-mediation .submit").attr("disabled", false); setTimeout(clearLoadingMediationSignal, 3000); } diff --git a/public/style.css b/public/style.css index c226e01..af2c5a2 100644 --- a/public/style.css +++ b/public/style.css @@ -14,6 +14,10 @@ float: right; } +.hub-loading { + cursor: wait; +} + .icon-newcommunity-hub, .icon-community-hub { background-image: url(/plugins/community_hub/icons/community-hub.png) @@ -615,34 +619,3 @@ textarea#message_body { .hub ul.mediation-comment-list { width: 80%; } - -.hub #loading-message, -.hub #loading-mediation { - width: 16px; - height: 16px; - display: inline-block; - float: right; - margin-top: -24px; - margin-right: 585px; -} - -.hub .loading-mediation-comment { - width: 16px; - height: 16px; - display: inline-block; - float: right; - margin-top: -25px; - margin-right: 440px; -} - -.loading-signal-done { - background-image: url(/plugins/community_hub/icons/hub-sverde-a.png); -} - -.loading-signal-error { - background-image: url(/plugins/community_hub/icons/hub-svermelho-a.png); -} - -.loading-signal-processing { - background-image: url(/plugins/community_hub/icons/hub-samarelo.gif); -} diff --git a/views/community_hub_plugin_public/_mediation.rhtml b/views/community_hub_plugin_public/_mediation.rhtml index aaa8502..5e21606 100644 --- a/views/community_hub_plugin_public/_mediation.rhtml +++ b/views/community_hub_plugin_public/_mediation.rhtml @@ -38,7 +38,7 @@ <% total_mediation_comments = mediation.comments.count %> - <%= link_to( "#{total_mediation_comments}" + _("Comments") , '#', + <%= link_to( "#{total_mediation_comments} " + _("Comments") , '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "toogle_mediation_comments(#{mediation.id}); return false;") %> diff --git a/views/community_hub_plugin_public/_mediation_comment_form.rhtml b/views/community_hub_plugin_public/_mediation_comment_form.rhtml index fc98a4d..b5834d4 100644 --- a/views/community_hub_plugin_public/_mediation_comment_form.rhtml +++ b/views/community_hub_plugin_public/_mediation_comment_form.rhtml @@ -9,5 +9,4 @@ :rows => 4, :placeholder => _('Type your comment here')) %> <%= submit_button('add', _('Post'), :onclick => "new_mediation_comment(this,#{mediation.id}); return false;") %> - <% end %> diff --git a/views/content_viewer/hub.rhtml b/views/content_viewer/hub.rhtml index 5e5c60f..05f29c3 100644 --- a/views/content_viewer/hub.rhtml +++ b/views/content_viewer/hub.rhtml @@ -58,7 +58,6 @@ <%= f.hidden_field :parent_id, :value => @page.id %> <%= f.text_area :body, :style => "width: 100%;", :class => "mceEditor" %> <%= submit_button('add', _('Post'), :onclick => 'new_mediation(this); return false;') %> - <% end %> @@ -86,7 +85,6 @@
<%= f.text_area :body, :style => "width: 99%;", :cols => "38", :rows => "5", :placeholder => _("Type your message here") %> <%= submit_button('add', _('Post'), :onclick => 'new_message(this); return false;') %> - <% end %> -- libgit2 0.21.2