Commit b12d5b1c40ef06f6142a5ff1ead6e59cbfb39ba3

Authored by Francisco Marcelo de Araújo Lima Júnior
1 parent f7e11979
Exists in master

#community dashboard - updating theme

public/javascripts/community_hub.js
... ... @@ -50,15 +50,12 @@ function new_mediation_comment(button, mediation) {
50 50  
51 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 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 57 if (data.ok) {
59 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 59 jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", false);
63 60 update_mediation_comments(mediation, false);
64 61 setTimeout(function(){
... ... @@ -67,8 +64,6 @@ function new_mediation_comment(button, mediation) {
67 64 mediations.push( [ mediation, setInterval(function() { update_mediation_comments(mediation, false)}, 5000) ] );
68 65 }
69 66 else {
70   - jQuery(".loading-mediation-comment").filter("#" + mediation).addClass("loading-signal-error");
71   - jQuery("body").removeClass("loading");
72 67 jQuery("#mediation-comment-form-" + mediation + " .submit").attr("disabled", false);
73 68 setTimeout(function(){
74 69 clearLoadingMediationCommentSignal(mediation);
... ... @@ -90,23 +85,18 @@ function new_message(button) {
90 85  
91 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 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 92 if (data.ok) {
99 93 jQuery(".hub .form-message #message_body").val('');
100   - jQuery("#loading-message").addClass("loading-signal-done");
101   - jQuery("body").removeClass("loading");
102 94 jQuery(".hub .form-message .submit").attr("disabled", false);
103 95 update_live_stream(false);
104 96 setTimeout(clearLoadingMessageSignal, 3000);
105 97  
106 98 }
107 99 else {
108   - jQuery("#loading-message").addClass("loading-signal-error");
109   - jQuery("body").removeClass("loading");
110 100 jQuery(".hub .form-message .submit").attr("disabled", false);
111 101 setTimeout(clearLoadingMessageSignal, 3000);
112 102 }
... ... @@ -125,23 +115,18 @@ function new_mediation(button) {
125 115  
126 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 120 tinymce.triggerSave();
132 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 123 if (data.ok) {
135   - jQuery("#loading-mediation").addClass("loading-signal-done");
136   - jQuery("body").removeClass("loading");
137 124 jQuery(".hub .form-mediation .submit").attr("disabled", false);
138 125 tinymce.get('article_body').setContent('');
139 126 update_mediations();
140 127 setTimeout(clearLoadingMediationSignal, 3000);
141 128 }
142 129 else {
143   - jQuery("#loading-mediation").addClass("loading-signal-error");
144   - jQuery("body").removeClass("loading");
145 130 jQuery(".hub .form-mediation .submit").attr("disabled", false);
146 131 setTimeout(clearLoadingMediationSignal, 3000);
147 132 }
... ...
public/style.css
... ... @@ -14,6 +14,10 @@
14 14 float: right;
15 15 }
16 16  
  17 +.hub-loading {
  18 + cursor: wait;
  19 +}
  20 +
17 21 .icon-newcommunity-hub,
18 22 .icon-community-hub {
19 23 background-image: url(/plugins/community_hub/icons/community-hub.png)
... ... @@ -615,34 +619,3 @@ textarea#message_body {
615 619 .hub ul.mediation-comment-list {
616 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 38 <% total_mediation_comments = mediation.comments.count %>
39 39  
40 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 42 :class => 'display-comment-form',
43 43 :id => 'top-post-comment-button',
44 44 :onclick => "toogle_mediation_comments(#{mediation.id}); return false;") %>
... ...
views/community_hub_plugin_public/_mediation_comment_form.rhtml
... ... @@ -9,5 +9,4 @@
9 9 :rows => 4,
10 10 :placeholder => _('Type your comment here')) %>
11 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 12 <% end %>
... ...
views/content_viewer/hub.rhtml
... ... @@ -58,7 +58,6 @@
58 58 <%= f.hidden_field :parent_id, :value => @page.id %>
59 59 <%= f.text_area :body, :style => "width: 100%;", :class => "mceEditor" %>
60 60 <%= submit_button('add', _('Post'), :onclick => 'new_mediation(this); return false;') %>
61   - <span id="loading-mediation"></span>
62 61 <% end %>
63 62  
64 63 </div>
... ... @@ -86,7 +85,6 @@
86 85 <br />
87 86 <%= f.text_area :body, :style => "width: 99%;", :cols => "38", :rows => "5", :placeholder => _("Type your message here") %>
88 87 <%= submit_button('add', _('Post'), :onclick => 'new_message(this); return false;') %>
89   - <span id="loading-message"></span>
90 88 <% end %>
91 89  
92 90 </div>
... ...