Commit b12d5b1c40ef06f6142a5ff1ead6e59cbfb39ba3
1 parent
f7e11979
Exists in
community_hub_submodule
#community dashboard - updating theme
Showing
5 changed files
with
11 additions
and
56 deletions
Show diff stats
public/javascripts/community_hub.js
| @@ -50,15 +50,12 @@ function new_mediation_comment(button, mediation) { | @@ -50,15 +50,12 @@ function new_mediation_comment(button, mediation) { | ||
| 50 | 50 | ||
| 51 | jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", true); | 51 | jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", true); |
| 52 | 52 | ||
| 53 | - jQuery("body").addClass("loading"); | ||
| 54 | - jQuery(".loading-mediation-comment").filter("#" + mediation).addClass("loading-signal-processing"); | 53 | + jQuery("body").addClass("hub-loading"); |
| 55 | 54 | ||
| 56 | jQuery.post(form.attr("action"), form.serialize(), function(data) { | 55 | jQuery.post(form.attr("action"), form.serialize(), function(data) { |
| 57 | - jQuery(".loading-mediation-comment").filter("#" + mediation).removeClass("loading-signal-processing"); | 56 | + jQuery("body").removeClass("hub-loading"); |
| 58 | if (data.ok) { | 57 | if (data.ok) { |
| 59 | jQuery("#mediation-comment-form-" + mediation + " textarea").val(''); | 58 | jQuery("#mediation-comment-form-" + mediation + " textarea").val(''); |
| 60 | - jQuery(".loading-mediation-comment").filter("#" + mediation).addClass("loading-signal-done"); | ||
| 61 | - jQuery("body").removeClass("loading"); | ||
| 62 | jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", false); | 59 | jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", false); |
| 63 | update_mediation_comments(mediation, false); | 60 | update_mediation_comments(mediation, false); |
| 64 | setTimeout(function(){ | 61 | setTimeout(function(){ |
| @@ -67,8 +64,6 @@ function new_mediation_comment(button, mediation) { | @@ -67,8 +64,6 @@ function new_mediation_comment(button, mediation) { | ||
| 67 | mediations.push( [ mediation, setInterval(function() { update_mediation_comments(mediation, false)}, 5000) ] ); | 64 | mediations.push( [ mediation, setInterval(function() { update_mediation_comments(mediation, false)}, 5000) ] ); |
| 68 | } | 65 | } |
| 69 | else { | 66 | else { |
| 70 | - jQuery(".loading-mediation-comment").filter("#" + mediation).addClass("loading-signal-error"); | ||
| 71 | - jQuery("body").removeClass("loading"); | ||
| 72 | jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", false); | 67 | jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", false); |
| 73 | setTimeout(function(){ | 68 | setTimeout(function(){ |
| 74 | clearLoadingMediationCommentSignal(mediation); | 69 | clearLoadingMediationCommentSignal(mediation); |
| @@ -90,23 +85,18 @@ function new_message(button) { | @@ -90,23 +85,18 @@ function new_message(button) { | ||
| 90 | 85 | ||
| 91 | jQuery(".hub .form-message .submit").attr("disabled", true); | 86 | jQuery(".hub .form-message .submit").attr("disabled", true); |
| 92 | 87 | ||
| 93 | - jQuery("body").addClass("loading"); | ||
| 94 | - jQuery("#loading-message").addClass("loading-signal-processing"); | 88 | + jQuery("body").addClass("hub-loading"); |
| 95 | 89 | ||
| 96 | jQuery.post(form.attr("action"), form.serialize(), function(data) { | 90 | jQuery.post(form.attr("action"), form.serialize(), function(data) { |
| 97 | - jQuery("#loading-message").removeClass("loading-signal-processing"); | 91 | + jQuery("body").removeClass("hub-loading"); |
| 98 | if (data.ok) { | 92 | if (data.ok) { |
| 99 | jQuery(".hub .form-message #message_body").val(''); | 93 | jQuery(".hub .form-message #message_body").val(''); |
| 100 | - jQuery("#loading-message").addClass("loading-signal-done"); | ||
| 101 | - jQuery("body").removeClass("loading"); | ||
| 102 | jQuery(".hub .form-message .submit").attr("disabled", false); | 94 | jQuery(".hub .form-message .submit").attr("disabled", false); |
| 103 | update_live_stream(false); | 95 | update_live_stream(false); |
| 104 | setTimeout(clearLoadingMessageSignal, 3000); | 96 | setTimeout(clearLoadingMessageSignal, 3000); |
| 105 | 97 | ||
| 106 | } | 98 | } |
| 107 | else { | 99 | else { |
| 108 | - jQuery("#loading-message").addClass("loading-signal-error"); | ||
| 109 | - jQuery("body").removeClass("loading"); | ||
| 110 | jQuery(".hub .form-message .submit").attr("disabled", false); | 100 | jQuery(".hub .form-message .submit").attr("disabled", false); |
| 111 | setTimeout(clearLoadingMessageSignal, 3000); | 101 | setTimeout(clearLoadingMessageSignal, 3000); |
| 112 | } | 102 | } |
| @@ -125,23 +115,18 @@ function new_mediation(button) { | @@ -125,23 +115,18 @@ function new_mediation(button) { | ||
| 125 | 115 | ||
| 126 | jQuery(".hub .form-mediation .submit").attr("disabled", true); | 116 | jQuery(".hub .form-mediation .submit").attr("disabled", true); |
| 127 | 117 | ||
| 128 | - jQuery("body").addClass("loading"); | ||
| 129 | - jQuery("#loading-mediation").addClass("loading-signal-processing"); | 118 | + jQuery("body").addClass("hub-loading"); |
| 130 | 119 | ||
| 131 | tinymce.triggerSave(); | 120 | tinymce.triggerSave(); |
| 132 | jQuery.post(form.attr("action"), form.serialize(), function(data) { | 121 | jQuery.post(form.attr("action"), form.serialize(), function(data) { |
| 133 | - jQuery("#loading-mediation").removeClass("loading-signal-processing"); | 122 | + jQuery("body").removeClass("hub-loading"); |
| 134 | if (data.ok) { | 123 | if (data.ok) { |
| 135 | - jQuery("#loading-mediation").addClass("loading-signal-done"); | ||
| 136 | - jQuery("body").removeClass("loading"); | ||
| 137 | jQuery(".hub .form-mediation .submit").attr("disabled", false); | 124 | jQuery(".hub .form-mediation .submit").attr("disabled", false); |
| 138 | tinymce.get('article_body').setContent(''); | 125 | tinymce.get('article_body').setContent(''); |
| 139 | update_mediations(); | 126 | update_mediations(); |
| 140 | setTimeout(clearLoadingMediationSignal, 3000); | 127 | setTimeout(clearLoadingMediationSignal, 3000); |
| 141 | } | 128 | } |
| 142 | else { | 129 | else { |
| 143 | - jQuery("#loading-mediation").addClass("loading-signal-error"); | ||
| 144 | - jQuery("body").removeClass("loading"); | ||
| 145 | jQuery(".hub .form-mediation .submit").attr("disabled", false); | 130 | jQuery(".hub .form-mediation .submit").attr("disabled", false); |
| 146 | setTimeout(clearLoadingMediationSignal, 3000); | 131 | setTimeout(clearLoadingMediationSignal, 3000); |
| 147 | } | 132 | } |
public/style.css
| @@ -14,6 +14,10 @@ | @@ -14,6 +14,10 @@ | ||
| 14 | float: right; | 14 | float: right; |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | +.hub-loading { | ||
| 18 | + cursor: wait; | ||
| 19 | +} | ||
| 20 | + | ||
| 17 | .icon-newcommunity-hub, | 21 | .icon-newcommunity-hub, |
| 18 | .icon-community-hub { | 22 | .icon-community-hub { |
| 19 | background-image: url(/plugins/community_hub/icons/community-hub.png) | 23 | background-image: url(/plugins/community_hub/icons/community-hub.png) |
| @@ -615,34 +619,3 @@ textarea#message_body { | @@ -615,34 +619,3 @@ textarea#message_body { | ||
| 615 | .hub ul.mediation-comment-list { | 619 | .hub ul.mediation-comment-list { |
| 616 | width: 80%; | 620 | width: 80%; |
| 617 | } | 621 | } |
| 618 | - | ||
| 619 | -.hub #loading-message, | ||
| 620 | -.hub #loading-mediation { | ||
| 621 | - width: 16px; | ||
| 622 | - height: 16px; | ||
| 623 | - display: inline-block; | ||
| 624 | - float: right; | ||
| 625 | - margin-top: -24px; | ||
| 626 | - margin-right: 585px; | ||
| 627 | -} | ||
| 628 | - | ||
| 629 | -.hub .loading-mediation-comment { | ||
| 630 | - width: 16px; | ||
| 631 | - height: 16px; | ||
| 632 | - display: inline-block; | ||
| 633 | - float: right; | ||
| 634 | - margin-top: -25px; | ||
| 635 | - margin-right: 440px; | ||
| 636 | -} | ||
| 637 | - | ||
| 638 | -.loading-signal-done { | ||
| 639 | - background-image: url(/plugins/community_hub/icons/hub-sverde-a.png); | ||
| 640 | -} | ||
| 641 | - | ||
| 642 | -.loading-signal-error { | ||
| 643 | - background-image: url(/plugins/community_hub/icons/hub-svermelho-a.png); | ||
| 644 | -} | ||
| 645 | - | ||
| 646 | -.loading-signal-processing { | ||
| 647 | - background-image: url(/plugins/community_hub/icons/hub-samarelo.gif); | ||
| 648 | -} |
views/community_hub_plugin_public/_mediation.rhtml
| @@ -38,7 +38,7 @@ | @@ -38,7 +38,7 @@ | ||
| 38 | <% total_mediation_comments = mediation.comments.count %> | 38 | <% total_mediation_comments = mediation.comments.count %> |
| 39 | 39 | ||
| 40 | <span class="comment-count"> | 40 | <span class="comment-count"> |
| 41 | - <%= link_to( "<span id='mediation-comment-total-#{mediation.id}'>#{total_mediation_comments}</span>" + _("Comments") , '#', | 41 | + <%= link_to( "<span id='mediation-comment-total-#{mediation.id}'>#{total_mediation_comments}</span> " + _("Comments") , '#', |
| 42 | :class => 'display-comment-form', | 42 | :class => 'display-comment-form', |
| 43 | :id => 'top-post-comment-button', | 43 | :id => 'top-post-comment-button', |
| 44 | :onclick => "toogle_mediation_comments(#{mediation.id}); return false;") %> | 44 | :onclick => "toogle_mediation_comments(#{mediation.id}); return false;") %> |
views/community_hub_plugin_public/_mediation_comment_form.rhtml
| @@ -9,5 +9,4 @@ | @@ -9,5 +9,4 @@ | ||
| 9 | :rows => 4, | 9 | :rows => 4, |
| 10 | :placeholder => _('Type your comment here')) %> | 10 | :placeholder => _('Type your comment here')) %> |
| 11 | <%= submit_button('add', _('Post'), :onclick => "new_mediation_comment(this,#{mediation.id}); return false;") %> | 11 | <%= submit_button('add', _('Post'), :onclick => "new_mediation_comment(this,#{mediation.id}); return false;") %> |
| 12 | - <span id="<%=mediation.id%>" class="loading-mediation-comment"></span> | ||
| 13 | <% end %> | 12 | <% end %> |
views/content_viewer/hub.rhtml
| @@ -58,7 +58,6 @@ | @@ -58,7 +58,6 @@ | ||
| 58 | <%= f.hidden_field :parent_id, :value => @page.id %> | 58 | <%= f.hidden_field :parent_id, :value => @page.id %> |
| 59 | <%= f.text_area :body, :style => "width: 100%;", :class => "mceEditor" %> | 59 | <%= f.text_area :body, :style => "width: 100%;", :class => "mceEditor" %> |
| 60 | <%= submit_button('add', _('Post'), :onclick => 'new_mediation(this); return false;') %> | 60 | <%= submit_button('add', _('Post'), :onclick => 'new_mediation(this); return false;') %> |
| 61 | - <span id="loading-mediation"></span> | ||
| 62 | <% end %> | 61 | <% end %> |
| 63 | 62 | ||
| 64 | </div> | 63 | </div> |
| @@ -86,7 +85,6 @@ | @@ -86,7 +85,6 @@ | ||
| 86 | <br /> | 85 | <br /> |
| 87 | <%= f.text_area :body, :style => "width: 99%;", :cols => "38", :rows => "5", :placeholder => _("Type your message here") %> | 86 | <%= f.text_area :body, :style => "width: 99%;", :cols => "38", :rows => "5", :placeholder => _("Type your message here") %> |
| 88 | <%= submit_button('add', _('Post'), :onclick => 'new_message(this); return false;') %> | 87 | <%= submit_button('add', _('Post'), :onclick => 'new_message(this); return false;') %> |
| 89 | - <span id="loading-message"></span> | ||
| 90 | <% end %> | 88 | <% end %> |
| 91 | 89 | ||
| 92 | </div> | 90 | </div> |