From 34f2fc98c91d33b25f1c68a6db55ac119596c5e7 Mon Sep 17 00:00:00 2001 From: cblanc Date: Mon, 27 Apr 2015 23:36:27 +0100 Subject: [PATCH] Move shoutmsg polling invocation to instances where shoutbox is available --- app/assets/javascripts/local.js | 8 -------- app/views/widgets/_shoutbox.html.erb | 13 ++++++++++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/local.js b/app/assets/javascripts/local.js index d15009a..d21797c 100644 --- a/app/assets/javascripts/local.js +++ b/app/assets/javascripts/local.js @@ -24,14 +24,6 @@ $(document).ready(function(){ function HideUserPopupRunner(){ document.getElementById("userPopup").style.visibility = "Hidden"; } - - // Shoutbox - $.PeriodicalUpdater("/shoutmsgs/index.js", { - method: "GET", - type: "script", - minTimeout: 10000, - multiplier: 2 - }); }); $(function() { diff --git a/app/views/widgets/_shoutbox.html.erb b/app/views/widgets/_shoutbox.html.erb index 606b88e..0bf5238 100644 --- a/app/views/widgets/_shoutbox.html.erb +++ b/app/views/widgets/_shoutbox.html.erb @@ -8,4 +8,15 @@ <%= render partial: "shoutmsgs/new", locals: { shoutmsg: Shoutmsg.new } %> <%= link_to "Shoutbox Recent History", controller: :shoutmsgs, action: "index" %>
<%= link_to "Shoutbox Rules", article_path(Article::SB_RULES) %> - \ No newline at end of file + + + \ No newline at end of file