$ git clone http://ion.nu/git/webchat
commit 149523e200870c4b3542175c3846f96feb2336bc
Author: Alicia <...>
Date: Thu Jan 7 23:52:04 2016 +0100
Made options (changing account password, channel operations) a collapsible section, starting collapsed.
diff --git a/chat.css b/chat.css
index 0ceeed3..de9f0e3 100644
--- a/chat.css
+++ b/chat.css
@@ -297,3 +297,12 @@ span.modindicator
-ms-text-shadow:0px 0px 1px #000000;
-o-text-shadow:0px 0px 1px #000000;
}
+div.arrowsection>a
+{
+ text-decoration:none;
+ color:#000000;
+}
+div#options_open
+{
+ display:none; /* Start hidden */
+}
diff --git a/chat.php b/chat.php
index 80fdfd0..763f38c 100644
--- a/chat.php
+++ b/chat.php
@@ -28,14 +28,17 @@
</div>
<div id="loggedin">
<button onclick="connection.send('logout');">Log out</button>
- <button onclick="var p=prompt('New account password?');if(p)connection.send('setuserpass:'+p);">Change password</button><br />
- <button onclick="connection.send('registerchannel');" id="registerchannel">Register channel</button>
- <!-- TODO: Move the following into a fullscreen "Channel options" menu? -->
- <button onclick="setupmodmanager(); showfullscreen('managemods', false);" id="managemods_button">Manage moderators</button>
- <button onclick="setupbanlist(); showfullscreen('banlist', false);" id="banlist_button">Banlist</button>
- <button onclick="var p=prompt('New channel password? (empty for no password)');if(p)connection.send('setchanpass:'+p);" id="setchanpass_button">Set channel password</button>
- <button onclick="if(confirm('Are you sure you want to deregister the channel? Channel password, bans and mods will all be lost'))connection.send('deregisterchannel');" id="deregisterchannel_button">Deregister channel</button>
- <br />
+ <div id="options_closed" class="arrowsection"><a href="javascript:;" onclick="document.getElementById('options_closed').style.display='none'; document.getElementById('options_open').style.display='block';"> ▸ Options</a></div>
+ <div id="options_open" class="arrowsection">
+ <a href="javascript:;" onclick="document.getElementById('options_open').style.display='none'; document.getElementById('options_closed').style.display='block';"> ▾ Options</a>
+ <button onclick="var p=prompt('New account password?');if(p)connection.send('setuserpass:'+p);">Change password</button><br /><br />
+ <button onclick="connection.send('registerchannel');" id="registerchannel">Register channel</button>
+ <button onclick="setupmodmanager(); showfullscreen('managemods', false);" id="managemods_button">Manage moderators</button>
+ <button onclick="setupbanlist(); showfullscreen('banlist', false);" id="banlist_button">Banlist</button>
+ <button onclick="var p=prompt('New channel password? (empty for no password)');if(p)connection.send('setchanpass:'+p);" id="setchanpass_button">Set channel password</button>
+ <button onclick="if(confirm('Are you sure you want to deregister the channel? Channel password, bans and mods will all be lost'))connection.send('deregisterchannel');" id="deregisterchannel_button">Deregister channel</button>
+ <br />
+ </div>
</div>
<button onclick="broadcast();" id="broadcastbutton">Broadcast</button><br />
<input type="color" id="color" onchange="setcolor(this.value);" value="#000000" />