M1n1K / VK Additional Buttons

// ==UserScript==
// @name         VK Additional Buttons
// @namespace    http://tampermonkey.net/
// @version      1.0.3
// @description  In VK adds additional buttons to the left menu.
// @author       M1n1K
// @match        https://*.vk.com/*
// @copyright    2019, M1n1K (https://openuserjs.org/users/M1n1K)
// @license      MIT
// @grant		 none
// ==/UserScript==

// ==OpenUserJS==
// @author M1n1K
// ==/OpenUserJS==

(() => {

    let sidebar_block = document.getElementById("side_bar_inner")
        .children[0].children[0];

    const sidebar_elements = {
        experts: {
            additional_attr: false,
            href: 'experts',
            name: 'Experts'
        },
        vk_dev: {
            additional_attr: true,
            href: 'dev',
            name: 'VK Dev',
        }
    };
  
  	let innerHTML = ``;

    Object.values(sidebar_elements)
        .forEach(element => {
            innerHTML += `<li id="l_tr" class="">`;

            if (element.additional_attr) {
                innerHTML += `<a href=/${element.href} class="left_row" target=_blank>\ `;
            } else {
                innerHTML += `<a href=/${element.href} class="left_row">\ `;
            }

            innerHTML += `<span class="left_fixer">`;
            innerHTML += `<span class="left_count_wrap fl_r left_void"><span class="inl_bl left_count_sign"></span></span>\ `;

            innerHTML += `<span class="left_icon fl_l"></span>\ `;
            innerHTML += `<span class="left_label inl_bl">${element.name}</span>\ </span>\ </a>\ </div>\ </li>`;

            sidebar_block.innerHTML += innerHTML;
            innerHTML = `<div class="more_div"></div>`;
        });

})();