Commit d4ce25952f67ee05f17b3975ea1352e1ab5d1fe0
1 parent
88a8110f
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
fixes
Showing
4 changed files
with
29 additions
and
28 deletions
Show diff stats
plugins/community_hub/lib/community_hub_plugin/hub.rb
... | ... | @@ -5,12 +5,19 @@ class CommunityHubPlugin::Hub < Folder |
5 | 5 | |
6 | 6 | attr_accessible :last_changed_by_id, :integer |
7 | 7 | |
8 | + attr_accessible :twitter_enabled, :type => :booelan, :default => false | |
9 | + attr_accessible :twitter_hashtags, :type => :string, :default => "" | |
10 | + attr_accessible :twitter_consumer_key, :type => :string, :default => "" | |
11 | + attr_accessible :twitter_consumer_secret, :type => :string, :default => "" | |
12 | + attr_accessible :twitter_access_token, :type => :string, :default => "" | |
13 | + attr_accessible :twitter_access_token_secret, :type => :string, :default => "" | |
14 | + | |
8 | 15 | settings_items :twitter_enabled, :type => :boolean, :default => false |
9 | 16 | settings_items :twitter_hashtags, :type => :string, :default => "" |
10 | - settings_items :twitter_consumer_key, :type => :string, :default => "" | |
11 | - settings_items :twitter_consumer_secret, :type => :string, :default => "" | |
12 | - settings_items :twitter_access_token, :type => :string, :default => "" | |
13 | - settings_items :twitter_access_token_secret, :type => :string, :default => "" | |
17 | + settings_items :twitter_consumer_key, :type => :string, :default => "" | |
18 | + settings_items :twitter_consumer_secret, :type => :string, :default => "" | |
19 | + settings_items :twitter_access_token, :type => :string, :default => "" | |
20 | + settings_items :twitter_access_token_secret, :type => :string, :default => "" | |
14 | 21 | settings_items :facebook_enabled, :type => :boolean, :default => false |
15 | 22 | settings_items :facebook_page_id, :type => :string, :default => "" |
16 | 23 | settings_items :facebook_pooling_time, :type => :integer, :default => 5 # Time in seconds | ... | ... |
plugins/community_hub/public/javascripts/community_hub.js
... | ... | @@ -103,12 +103,12 @@ function new_message(button) { |
103 | 103 | if (data.ok) { |
104 | 104 | jQuery(".hub .form-message #message_body").val(''); |
105 | 105 | jQuery(".hub .form-message .submit").attr("disabled", false); |
106 | - update_live_stream(false); | |
107 | - message_interval_id = setInterval(function() { update_live_stream(false)}, 5000); | |
106 | + update_live_stream(); | |
107 | + message_interval_id = setInterval(function() { update_live_stream()}, 5000); | |
108 | 108 | } |
109 | 109 | else { |
110 | 110 | jQuery(".hub .form-message .submit").attr("disabled", false); |
111 | - message_interval_id = setInterval(function() { update_live_stream(false)}, 5000); | |
111 | + message_interval_id = setInterval(function() { update_live_stream()}, 5000); | |
112 | 112 | } |
113 | 113 | }, 'json'); |
114 | 114 | |
... | ... | @@ -263,8 +263,7 @@ function update_mediations() { |
263 | 263 | } |
264 | 264 | |
265 | 265 | |
266 | -function update_live_stream(recursive) { | |
267 | - | |
266 | +function update_live_stream() { | |
268 | 267 | if (jQuery("#left-tab.show").size() != 0) { |
269 | 268 | |
270 | 269 | var hub_id = jQuery(".hub").attr('id'); |
... | ... | @@ -281,32 +280,26 @@ function update_live_stream(recursive) { |
281 | 280 | type: 'get', |
282 | 281 | data: { latest_post: latest_post_id, hub: hub_id }, |
283 | 282 | success: function(data) { |
283 | + | |
284 | 284 | if (data.trim().length > 0) { |
285 | 285 | jQuery("#live-posts").prepend(data); |
286 | - if (jQuery("#auto_scrolling").attr('checked')) { | |
286 | + if (jQuery("#auto_scrolling").prop('checked', true)) { | |
287 | 287 | jQuery("#live-posts").scrollTop(0); |
288 | 288 | } |
289 | 289 | else { |
290 | 290 | jQuery("#live-posts").scrollTop(live_scroll_position); |
291 | 291 | } |
292 | - if (first_hub_load) { | |
293 | - jQuery("body").removeClass("hub-loading"); | |
294 | - first_hub_load = false; | |
295 | - } | |
296 | 292 | } |
297 | - }, | |
298 | - error: function(ajax, stat, errorThrown) { | |
293 | + | |
294 | + if (first_hub_load) { | |
295 | + jQuery("body").removeClass("hub-loading"); | |
296 | + first_hub_load = false; | |
297 | + } | |
298 | + | |
299 | 299 | } |
300 | 300 | }); |
301 | 301 | |
302 | 302 | } |
303 | - | |
304 | - if (recursive) { | |
305 | - setTimeout(function() { | |
306 | - update_live_stream(true); | |
307 | - }, 5000); | |
308 | - } | |
309 | - | |
310 | 303 | } |
311 | 304 | |
312 | 305 | function hub_left_tab_click() { |
... | ... | @@ -333,7 +326,8 @@ first_hub_load = true; |
333 | 326 | first_mediations_load = true; |
334 | 327 | |
335 | 328 | jQuery(".hub .envelope").scroll(function() { |
336 | - jQuery("#auto_scrolling").attr('checked', false); | |
329 | + jQuery("#auto_scrolling").prop('checked', false); | |
330 | + | |
337 | 331 | |
338 | 332 | // live stream tab... |
339 | 333 | if (jQuery("#left-tab.show").size() != 0) { |
... | ... | @@ -367,6 +361,6 @@ jQuery(document).ready(function() { |
367 | 361 | |
368 | 362 | jQuery("body").addClass("hub-loading"); |
369 | 363 | |
370 | - message_interval_id = setInterval(function() { update_live_stream(false) }, 5000); | |
364 | + message_interval_id = setInterval(function() { update_live_stream() }, 5000); | |
371 | 365 | |
372 | 366 | }); | ... | ... |
plugins/community_hub/views/community_hub_plugin_public/_mediation_comment_form.html.erb
plugins/community_hub/views/content_viewer/hub.rhtml
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | <div id="input-panel"> |
29 | 29 | <div class="form-message"> |
30 | 30 | |
31 | - <% form_for :message, | |
31 | + <%= form_for :message, | |
32 | 32 | :method => 'post', |
33 | 33 | :url => { |
34 | 34 | :controller => 'community_hub_plugin_public', |
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 | |
67 | 67 | <%= render :file => 'shared/tiny_mce' %> |
68 | 68 | |
69 | - <% form_for :article, | |
69 | + <%= form_for :article, | |
70 | 70 | :method => 'post', |
71 | 71 | :url => { |
72 | 72 | :controller => 'community_hub_plugin_public', | ... | ... |