<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Hide Buttons when a user is logged out]]></title><description><![CDATA[<p dir="auto">Hello,<br />
Is there a way to have the buttons of offline users (phone registered but not logged in to FOP2) be css set to display:none; ?</p>
<p dir="auto">Thanks,</p>
<p dir="auto">MC</p>
]]></description><link>http://localhost:4567/topic/2966/hide-buttons-when-a-user-is-logged-out</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 11:03:14 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/2966.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Mar 2021 22:14:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hide Buttons when a user is logged out on Wed, 07 Jul 2021 21:13:08 GMT]]></title><description><![CDATA[<p dir="auto">This is a simple Javascript that modifies the css if the buttons are set to OUT.  I am not the best scripter so I am sure there are more efficient ways to optimise this code.  But hey, it works...  It was added to a seperate file ( in the /var/www/html/fop2/ directory) with a javascript including it (script type="text/javascript" src="thisfile.js") in index.html.</p>
<p dir="auto">I DO NOT THINK IT SURVIVES A VERSION UPGRADE.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nicolas" aria-label="Profile: Nicolas">@<bdi>Nicolas</bdi></a>, it would be nice that in index.html, you include by default a "custom.js" file in a "custom" directory that is preserved in upgrades to allow us to customise as required if need be and survive upgrades.</p>
<p dir="auto">//STARTS HERE<br />
//Maximum buttons used (in doubt, make this higher than need to be but not too high to waste browser speed looking for things that do not exist)<br />
var max_boton = 25;</p>
<p dir="auto">//What is the tag when agent is not in<br />
OUTname = "OUT";</p>
<p dir="auto">//Wait 10 seconds after document is ready to launch function to perpetuity<br />
$( document ).ready(function(){<br />
setTimeout(function() { do_hide_boton(); }, 10000);<br />
}<br />
);</p>
<p dir="auto">//This is the function that shows or hide the buttons<br />
function do_hide_boton()<br />
{</p>
<p dir="auto">//Loop thru all botons up to max_boton<br />
for (boton_num = 1; boton_num &lt; max_boton; boton_num++)<br />
{<br />
//  check if boton exists<br />
if(document.getElementById("presence"+ boton_num) !== null)<br />
{<br />
//If user is logged out OR extension is notregistered hide the button<br />
if(document.getElementById("presence"+ boton_num).getAttribute("data-original-title") == OUTname || document.getElementById("boton"+ boton_num).classList.contains('notregistered'))<br />
{<br />
document.getElementById("boton"+ boton_num).style.display = "none";<br />
}<br />
else<br />
{<br />
document.getElementById("boton"+ boton_num).style.display = "";<br />
}<br />
}</p>
<p dir="auto">} //  for (boton_num = 1; boton_num &lt;= max_boton; boton_num++)</p>
<p dir="auto">//Recall itself every 5000 miliseconds<br />
setTimeout(arguments.callee, 5000);</p>
<p dir="auto">}</p>
]]></description><link>http://localhost:4567/post/12215</link><guid isPermaLink="true">http://localhost:4567/post/12215</guid><dc:creator><![CDATA[Moscou123]]></dc:creator><pubDate>Wed, 07 Jul 2021 21:13:08 GMT</pubDate></item></channel></rss>