Discord dropdown in the menu

discord

#1

Added a dropdown for easier access to Discord in the top right. If something comes up, post da #strats:bugs. Once there’s a icon update from upstream we’ll have the right icon there. Soon™

image


#2

Update: Works on mobile now too (though just links directly)


#3

I assume iterations are ongoing as I was briefly greeted by this beauty a few moments ago
bug or feature


#4

Ok, I should say that I’m wroking on stuff right now. Disregard everything for an hour or so.


#5

Ok, resume testing.


#6

#7

This is pretty nifty. Special Vocino codesauce to make this happen?


#8

Basically just an embed:

</head>

<script>Discourse._registerPluginCode('0.8.9', function (api) {
  api.decorateWidget('header-icons:before', function (helper) {
    return helper.h('li.dropdown#chat', [helper.h('button.dropdown-toggle#chat-button.icon', {
      'attributes': {
        "type": "button",
        "data-toggle": "dropdown",
        "title": "strats discord"
      } }, helper.h('i.fa.fa-comments-o.chat-button-icon.d-icon')), helper.h('ul.dropdown-menu#chat', [helper.h('li', [helper.h('iframe', {
        "src": 'https://discordapp.com/widget?id=[***]&theme=dark', 
        "width": "350",
        "height": "500",
        "allowtransparency": "true",
        "frameborder": "0",
        "id": "chatwidget",
        "name": "chatwidget"
        
      })])])]);
    });
  });</script> 

</body>

<script>
  function reloadIFrame() {
    var disc = document.getElementById("chatwidget");
    if (disc) {
      disc.src="https://discordapp.com/widget?id=[***]&theme=dark";
    }
  }
  window.setInterval("reloadIFrame();", 90000);
</script>

</head> (Mobile)

<script>Discourse._registerPluginCode('0.8.9', function (api) {
  api.decorateWidget('header-icons:before', function (helper) {
    return helper.h('li', [helper.h('a#chatd-button', {
      "href": 'https://discord.gg/WpYhTf8',
      "title": 'discord chat',
      "target": '_blank'
    }, helper.h('i.fa.fa-comments-o.chat-button-icon'
  ))]);
});
});</script>