Howto create button for /list command

70 views
Skip to first unread message

Jan Malaník

unread,
Feb 26, 2017, 4:01:58 PM2/26/17
to kiwiirc
Hi,
I wished to have button for /list command available to users.
After many hours of hard work with Jumper and prawnsalad, many thanks to both of them, we found solution:
Note: all paths are relative to root of Kiwi folder.
1) Edit your ./client/index.html, main section:
                    <ul class="main">
<!--our line -->    <li class="listclick listsh"><i class="fa fa-comment" title="channel list"></i></li>
                        <li class="settings"><i class="fa fa-cogs" title="Settings"></i></li>
                        <li class="startup"><i class="fa fa-home" title="Home"></i></li>
                        <li><a href="https://kiwiirc.com/" target="_blank"><img src="/assets/img/ico.png" alt="KiwiIRC" title="Kiw
                    </ul>

2) create new plugin file ./client/assets/plugins/list.html with content:
<script>
    (function(){
      $('#kiwi .main .listsh').prepend('<li id="id_listsh" class="fa fa-user"></li>');
      $(document).on('click','#id_listsh', function() {
      var input = kiwi.components.ControlInput();
       input.run('/list');
      });
    })();
</script>
class="fa fa-user" you can change to  class="fa fa-comment" to get another icon for button.

3) edit your ./config.js:
conf.client_plugins = [
'/assets/plugins/list.html'
    // name of your plugin file
];

4) reconfigure your kiwi:
./kiwi stop && ./kiwi reconfig && ./kiwi start

I hope that someone will find it usefull :)

Have a nice day and many thanks to all dev guys
Reply all
Reply to author
Forward
0 new messages