mwfiae / Steemit-Sidebar

// ==UserScript==
// @name         Steemit-Sidebar
// @namespace    http://tampermonkey.net/
// @copyright 2018, mwfiae (https://steemit.com/@mwfiae)
// @version      0.6.1
// @description  try to take over the world!
// @author       MWFIAE
// @match        http*://steemit.com/*
// @match        http*://steemw.ga/*
// @license MIT
// @grant    GM_getValue
// @grant    GM_setValue
// @grant    GM_getResourceText
// @grant unsafeWindow
// @require http://code.jquery.com/jquery-1.12.4.min.js
// @require https://cdn.steemjs.com/lib/latest/steem.min.js
// @require https://momentjs.com/downloads/moment-with-locales.min.js
// @require https://github.com/inuyaksa/jquery.nicescroll/raw/master/jquery.nicescroll.min.js
// @require https://code.jquery.com/ui/1.12.1/jquery-ui.min.js
// @resource JQUI_CSS https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css
// @updateURL https://openuserjs.org/meta/mwfiae/Steemit-Sidebar.meta.js
// @noframes
// ==/UserScript==
/* jshint -W097 */
'use strict';
// At this point I just want to say 'thank you!' to @therealwolf
// without his help and example coding I wouldn't have 'finished' the project this fast

// Handle multiple languages (only english for now)
const I18N = {
    "en":{
        "username": "Username",
        "vp": "Voting Power",
        "full": "Full",
        "bandwidth": "Bandwidth",
        "sp": "SteemPower",
        "settings_title": "Steemit Sidebar Settings",
        "settings_tab1": "Appearance",
        "settings_tab2": "Links",
        "settings_barcolor_low": "Bar Color Low",
        "settings_barcolor_high": "Bar Color High",
        "settings_warn_refresh": "The following settings require a site-refresh (F5).",
        "settings_sidebar_side": "Sidebar-Side",
        "settings_sidebar_side_left": "left",
        "settings_sidebar_side_right": "right",
        "settings_language": "Language",
        "settings_language_en": "English",
        "settings_restore_links": "Restore Links",
        "settings_links_icon": "Icon",
        "settings_links_url": "Url",
        "settings_links_text": "Text",
    },

}

// This is the html template for the main area of the sidebar, without the user templates(TEMPLATE_WITH_USER) rendered
const TEMPLATE_WITHOUT_USER = `
<style>
.ui-tabs{ height:100%; }
.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 20%; }
.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
.ui-tabs-vertical .ui-tabs-nav li a { display:inline-block;width: 100% }
.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; }
.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: left; width: 80%; }
.ui-button .ui-icon.ui-icon-closethick {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAVlJREFUOI2Fkj9rwkAYh3+XJleCgYwnUcT+gX4ClyztUCl063dRkiGDDoeDfgMd7isILYRO7ZRvUCoNKMFAbusQcO1iSoiX+NsO3ud533vv0Gq1bM55KISI2+32Fc6k2+3eCSFiznlIKTUJ5zwcDAZPACClTMbj8UOWZds6eDabvTPGegAQRdGb1ul0bosCxlhvPp9/qCapwgDgOM615nneo5QyaZKo4DRN4yAInskR6i8Wi89yQXEdXdepCvZ9fyil3JFSZ6WkmEoFA8C/oE5SThU+ETRJVDAAaFWBYRiXqu66rlNCyEnDi/JBte0ilmXZruu+RFG0zvP890RQ91SHwyG3LMuuk5Am2Pf9IQDUPXGWZVvSBBcLa/onRAgRO45zUwcXUUmSJNloaZr+nIOPHXej0ei+/O33+/0GlFJzOp2+LpfLL8ZYvwpWwxjrr1ar78lksqaUmn9KJe5VUzwlIQAAAABJRU5ErkJggg==') !important;
}

#mw-script-container{
position: fixed;
float: left;
padding-top: 2.5rem;
padding-left: 2em;
padding-right: 2em;
height:100vh;
overflow-y: auto;
z-index: 5;
width: 200px;
display: grid;
grid-template-rows: 1fr 80px;
grid-template-columns: 1fr;
}
.mw-right#mw-script-container{
right: 0;
}
#mw-main{
grid-row-start:1;
grid-row-end:1;
}
#mw-footer{
grid-row-start:2;
grid-row-end:2;
}
#mw-collapse-button{
float: left;
margin-left: 110px;
z-index: 100;
position: fixed;
cursor: pointer;
font-weight: bolder;
margin-top: -16px;
}
#mw-settings{
float: left;
z-index: 100;
cursor: pointer;
position: relative;
top: -15px;
left: -28px;
}
.theme-dark #mw-script-container, .theme-dark #mw-button{
background-color: #1C252B;
}
.theme-light #mw-script-container, .theme-light #mw-button{
background-color: #fcfcfc;
}
#username{display: inline;}
.mw-favicon{width:16px; height: 16px}
.mw-ul{list-style-type:none;}
.mw-button{background-color:transparent; border-width: 1px;}
.mw-nowrap{}
/* Tooltip container */
.mw-tooltip {
position: relative;
display: inline-block;
}

/* Tooltip text */
.mw-tooltip .mw-tooltiptext {
visibility: hidden;
width: 120px;
background-color: #555;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;

/* Position the tooltip text */
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;

/* Fade in tooltip */
opacity: 0;
transition: opacity 0.3s;
}


/* Show the tooltip text when you mouse over the tooltip container */
.mw-tooltip:hover .mw-tooltiptext {
visibility: visible;
opacity: 1;
width: 100%;
}
</style>
<div id="mw-script-container" class="mw-{{settings.side}}">
<div id="mw-main">
<img id="mw-settings" width=32px height=32px src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkAAAAHgCAYAAABNbtJFAAAgAElEQVR4Xuy9eXxc1ZXv+1u7qiR5kEdVyRgzxsxz4pCEwVbJBgIJDWEo2SYhA52kk+4MnbyX+7rTfa9fv9u3b/ft9O2kk3TIcJMmgKUyEGiICWCrZMaEmARMmCFMwlhV8jxbdfZ6n1O2jGw8SKpTwzn7d/4B22evtX7ftVX10xn2FvAgARIgARIgARIgAccIiGN6KZcESIAESIAESIAEQAPESUACJEACJEACJOAcARog51pOwSRAAiRAAiRAAjRAnAMkQAIkQAIkQALOEaABcq7lFEwCJEACJEACJEADxDlAAiRAAiRAAiTgHAEaIOdaTsEkQAIkQAIkQAI0QJwDJEACJEACJEACzhGgAXKu5RRMAiRAAiRAAiRAA8Q5QAIk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UgAQlIQAISCCOgABTGXVUlIAEJSEACEggooAAUEF+lJSABCUhAAhIII6AAFMZdVSUgAQlIQAISCCigABQQX6UlIAEJSEACEggjoAAUxl1VJSABCUhAAhIIKKAAFBBfpSUgAQlIQAISCCOgABTGXVUlIAEJSEACEggooAAUEF+lJSABCUhAAhIII6AAFMZdVSUgAQlIQAISCCigABQQX6UlIAEJSEACEggjoAAUxl1VJSABCUhAAhIIKKAAFBBfpSUgAQlIQAISCCOgABTGXVUlIAEJSEACEggooAAUEF+lJSABCUhAAhIII6AAFMZdVSUgAQlIQAISCCigABQQX6UlIAEJSEACEggjoAAUxl1VJSABCUhAAhIIKKAAFBBfpSUgAQlIQAISCCOgABTGXVUlIAEJSEACEggooAAUEF+lJSABCUhAAhIII6AAFMZdVSUgAQlIQAISCCigABQQX6UlIAEJSEACEggjoAAUxl1VJSABCUhAAhIIKKAAFBBfpSUgAQlIQAISCCOgABTGXVUlIAEJSEACEggooAAUEF+lJSABCUhAAhIII6AAFMZdVSUgAQlIQAISCCigABQQX6UlIAEJSEACEggjoAAUxl1VJSABCUhAAhIIKKAAFBBfpSUgAQlIQAISCCOgABTGXVUlIAEJSEACEggooAAUEF+lJSABCUhAAhIII6AAFMZdVSUgAQlIQAISCCigABQQX6UlIAEJSEACEggjoAAUxl1VJSABCUhAAhIIKKAAFBBfpSUgAQlIQAISCCOgABTGXVUlIAEJSEACEggooAAUEF+lJSABCUhAAhIII6AAFMZdVSUgAQlIQAISCCigABQQX6UlIAEJSEACEggjoAAUxl1VJSABCUhAAhIIKKAAFBBfpSUgAQlIQAISCCOgABTGXVUlIAEJSEACEggooAAUEF+lJSABCUhAAhIII6AAFMZdVSUgAQlIQAISCCigABQQX6UlIAEJSEACEggjoAAUxl1VJSABCUhAAhIIKKAAFBBfpSUgAQlIQAISCCPw/9OajMFU98daAAAAAElFTkSuQmCC"
></img>
<span id="mw-collapse-button">&lang;</span>
<p id="mw-username-p"><input id="mw-username" type="text" value="{{settings.username}}" placeholder="{{i18n.username}}"/></p>
<div id="mw-script-content"></div>
<hr id="mw-divider" />
<div id="mw-script-content-other"></div>
</div>
<div id="mw-footer">
© by <a href="https://steemit.com/@mwfiae">MWFIAE</a>
</div>
</div>
`;

// This is the template for the users that will be rendered inside the main template (TEMPLATE_WITHOUT_USER)
const TEMPLATE_WITH_USER = `
<div id="{{temp.target}}">
<p>
<span><a href="https://steemit.com/@{{user.name}}">{{user.name}}</a> ({{user.displayRep}})</span>
</p>
<span>{{i18n.vp}}</span>
<div id="mw-votepower-{{temp.target}}" class="mw-tooltip" style="width:100%;background-color: lightgrey;">
<style>
#mw-votepower-bar-{{temp.target}} {
width: {{user.trueVotePower}}%;
height: 23px;
background-color: {{temp.vote_color}};
text-align: center; /* To center it horizontally (if you want) */
line-height: 30px; /* To center it vertically */
}
#mw-votepower-bar-text-{{temp.target}}{
color: white;
font-size: 0.8em;
text-align: center; /* To center it horizontally (if you want) */
float: left;
width: 100%;
}
</style>
<span id="mw-votepower-bar-text-{{temp.target}}">{{user.trueVotePower}}%</span>
<div id="mw-votepower-bar-{{temp.target}}"></div>
<div class="mw-tooltiptext">{{i18n.full}}:<br />{{user.voteSpan}}<br />{{user.voteTime}}</div>
</div>
<span>{{i18n.bandwidth}} <span style="font-size: 0.8em">{{temp.bw_p}}%</span></span>
<div id="mw-bandwidth-{{temp.target}}" style="width:100%;background-color: lightgrey;">
<style>
#mw-bandwidth-bar-{{temp.target}} {
width: {{temp.bw_pno0}}%;
height: 23px;
background-color: {{temp.bw_color}};
line-height: 30px; /* To center it vertically */
}
#mw-bandwidth-bar-text-{{temp.target}}{
color: white;
font-size: 0.8em;
text-align: center; /* To center it horizontally (if you want) */
float: left;
width: 100%;
}
</style>
<span id="mw-bandwidth-bar-text-{{temp.target}}" class="mw-nowrap" nowrap>{{temp.bw_c}} \/ {{temp.bw_m}}</span>
<div id="mw-bandwidth-bar-{{temp.target}}"></div>
</div>
<div class="mw-tooltip">
{{i18n.sp}}: <a href="https://steemit.com/@{{user.name}}/transfers">{{user.sp}}</a>
<div class="mw-tooltiptext">Own: {{user.ownSp}}<br>Received: {{user.recSp}}<br>Delegated: {{user.delSp}}<br></div>
</div>
</p>
<ul class="mw-ul">
{{temp.links}}
</ul>
</div>
`;

// This is the template for the settings menu
const TEMPLATE_SETTINGS_MENU = `
<div id="mw-settings-window" title="{{i18n.settings_title}}">
<div id="tabs">
<ul>
<li><a href="#tabs-1">{{i18n.settings_tab1}}</a></li>
<li><a href="#tabs-2">{{i18n.settings_tab2}}</a></li>
</ul>
<div id="tabs-1">
<table>
<tr>
<td>{{i18n.settings_barcolor_low}}</td>
<td><input id="mw-barColorLow" style="min-width:50px" class="mw-inline" type="color" value="{{settings.barColorLow}}"/></td>

<td>{{i18n.settings_barcolor_high}}</td>
<td><input id="mw-barColorHigh" style="min-width:50px" class="mw-inline" type="color" value="{{settings.barColorHigh}}"/></td>
</tr>
<tr>
<td colspan=4 style="color:red">{{i18n.settings_warn_refresh}}</td>
</tr>
<tr>
<td>{{i18n.settings_sidebar_side}}</td>
<td>
<select id="mw-sidebarSide" style="min-width:50px" class="mw-inline" value="{{settings.barColorLow}}">
<option value="left">{{i18n.settings_sidebar_side_left}}</option>
<option value="right">{{i18n.settings_sidebar_side_right}}</option>
</select>
</td>
<td>{{i18n.settings_language}}</td>
<td>
<select id="mw-language" style="min-width:50px" class="mw-inline" value="{{settings.language}}">
<option value="en">{{i18n.settings_language_en}}</option>
</select>
</td>
</tr>
</table>
</div>
<div id="tabs-2" style="overflow-y: auto">
<input class="mw-button" type="button" id="mw-restore-links" value="{{i18n.settings_restore_links}}"/>
<table id="mw-link-table">
<tr><th>{{i18n.settings_links_icon}}</th><th>{{i18n.settings_links_url}}</th><th>{{i18n.settings_links_text}}</th></tr>
<tr>
<td><input id="mw-new-link-icon" type="text" value="" /></td>
<td><input id="mw-new-link-url" type="text" value="" /></td>
<td><input id="mw-new-link-text" type="text" value="" /></td>
<td><input class="mw-button mw-button-add-link" style="background-color:lightgreen" type="button" value="+" /></td>
</tr>
{{links}}
</table>
</div>
</div>
</div>
`;

// This is the template how a single link should be rendered in the main view
const TEMPLATE_LINK = `<li><a href="{{link.url}}" target="_blank"><img class="mw-favicon" src="{{link.icon}}" />{{link.text}}</a></li>`;

// This is the template how a single link should be rendered in the settings view (editable)
const TEMPLATE_LINK_SETTINGS = `<tr><td><img class="mw-favicon" src="{{link.icon}}" /></td><td>{{link.url}}</td><td>{{link.text}}</td><td><input class="mw-button mw-button-delete-link" style="background-color:pink" type="button" value="x" /></td></tr>`;

// various default links that are included for the convencience of the users
const DEFAULT_LINKS=[
    {url: "https://steemd.com/@{{user.name}}", icon: "https://steemd.com/favicon-steem9.png", text: "Steemd"},
    {url: "https://steemworld.org/@{{user.name}}", icon: "https://steemworld.org/favicon.png", text: "Steemworld"},
    {url: "https://steemnow.com/@{{user.name}}", icon: "https://steemnow.com/favicon.ico", text: "Steemnow"},
    {url: "https://zappl.com/@{{user.name}}", icon: "https://zappl.com/1/images/favicon.png", text: "Zappl"},
    {url: "https://d.tube/#!/c/{{user.name}}", icon: "https://d.tube/DTube_files/images/dtubefavicon.png", text: "D.Tube"},
    {url: "https://dmania.lol/profile/{{user.name}}", icon: "https://dmania.lol/favicon.ico", text: "D.Mania"},
    {url: "https://alpha.steepshot.io/@{{user.name}}", icon: "https://alpha.steepshot.io/static/images/faviconNew.ico", text: "Steepshot"},
];

// use the steemit api node
steem.api.setOptions({
    url: 'https://api.steemit.com'
});

// store the Private Posting Key in the userscript section, so other script can't as easily access it.
// NOTE: even without steemit sidebar it's already very easy for other script to do the same and read the private key.
//       so I don't consider this as an vulnerability that the steemit sidebar opens, malicious scripts do have easier
//       and more guaranteed ways to steal the key
var privPostKey= null;

console.log("Starting....");

//Initialize the main object;
let MWSidebar ={
    otherUsername: null,             // the name of the "second" user
    settingsMenu: null,              // a reference to the settings menu
    globalProps:{                    // the globalProps are filled by an api call
        totalVestingFund: 0,
        totalVestingShares: 0,
        maxVirtualBandwidth: 0,
    },
    settings: {                      // All the settings that are currently saved for the user and can be edited via the settings menu
        username: null,              // The username entered
        dateTimeFormat: 'DD.MM. HH:mm:ss',
        collapsed: false,            // If the sidebar should be collapsed/minimized
        barColorLow: "#FF0000",      // The color of the various bars if they get low
        barColorHigh: "#00FF00",     // The color of the various bars if they get high
        links: DEFAULT_LINKS,        // The links that will be rendered
        side: "left",                // The side of the sidebar
        lastSaved: 0,                // The moment the settings were saved, is used by other tabs to auto update
    },
    /**
     * Some helper variables/functions
     */
    helper:{ //Some helper variables/functions
        // The regex to find a mustache style variable (used by my rendering functions)
        regexVariable: new RegExp("{{([^}]*)}}", "gim"),

        /**
         * Linear interpolates between colors, used by the progress bars.
         * @param {string} startColor - The color to lerp from.
         * @param {string} endColor - The color to lerp to.
         * @param {number} amount - The amount of lerp inbetween (0 - 1).
         * @return {string} A color that lies between @startColor and @endColor.
         */
        lerpColor: function(startColor, endColor, amount) {

            var ah = parseInt(startColor.replace(/#/g, ''), 16),
                ar = ah >> 16, ag = ah >> 8 & 0xff, ab = ah & 0xff,
                bh = parseInt(endColor.replace(/#/g, ''), 16),
                br = bh >> 16, bg = bh >> 8 & 0xff, bb = bh & 0xff,
                rr = ar + amount * (br - ar),
                rg = ag + amount * (bg - ag),
                rb = ab + amount * (bb - ab);

            return '#' + ((1 << 24) + (rr << 16) + (rg << 8) + rb | 0).toString(16).slice(1);
        },
        /**
         * Make the amount of bytes readable by humans.
         * @param {number} bytes - The amount of bytes.
         * @return {string} A string representing a human readable amount of bytes
         */
        prettyPrintBytes: function(bytes){

            if(Math.abs(bytes)>1000*1000*1000*1000)
                return (bytes/(1000*1000*1000*1000)).toFixed(2)+" TB";
            if(Math.abs(bytes)>1000*1000*1000)
                return (bytes/(1000*1000*1000)).toFixed(2)+" GB";
            if(Math.abs(bytes)>1000*1000)
                return (bytes/(1000*1000)).toFixed(2)+" MB";
            if(Math.abs(bytes)>1000)
                return (bytes/1000).toFixed(2)+" KB";
            return bytes+" B"
        },
        /**
         * Make a human readable timespan out of seconds.
         * @param {number} seconds - The amount of seconds.
         * @return {string} A string representing a human readable timespan.
         */
        formatSeconds: function(seconds){
            let timeSpan = "";
            if(seconds>24*60*60){
                let days=parseInt(seconds/(24*60*60));
                seconds -= days*24*60*60;
                timeSpan = timeSpan + days+"d ";
            }
            if(seconds>60*60){
                let hours=parseInt(seconds/(60*60));
                seconds -= hours*60*60;
                timeSpan = timeSpan + hours+"h ";
            }
            if(seconds>60){
                let minutes=parseInt(seconds/60);
                seconds -= minutes*60;
                timeSpan = timeSpan + minutes+"m ";
            }
            return timeSpan;
        },
        /**
         * Appends custom css globally.
         * @param {string} css - The css to append.
         * @param {string} id - The id of the generated style block
         */
        addGlobalStyle: function(css, id) {
            $("head:first").append($('<style' + (id !== undefined ? ' id="' + id + '"' : '') + ' type="text/css">' + css + '</style>'));
        },

        /**
         * Replaces the variables in a template with a maximum depth of 5.
         * @param {string} template - The template which should be processed.
         * @param {object} values - An object holding all the values.
         * @param {number} depth - The current depth we are at.
         * @return {string} The processed template.
         */
        fillTemplate: function(template, values, depth){

            if(depth==undefined)
                depth = 1;
            if(depth > 5)
                return template;
            let result = template;
            let regex = new RegExp(MWSidebar.helper.regexVariable);
            let matches=null;
            while(matches = regex.exec(template)){
                let match = matches[1];
                try{
                    let object = values;
                    match.split(".").forEach(function(single){
                        object = object[single];
                    });
                    if((typeof object)=="string" && object.match(new RegExp(MWSidebar.helper.regexVariable))){
                        object = MWSidebar.helper.fillTemplate(object, values, depth+1);
                    }
                    result = result.replace(matches[0], object);
                }
                catch(e){ console.log(e); }
            };
            return result;
        },
        /**
         * Converts a hex string into an ascii string.
         * @param {string} hexx - The hex string to process.
         * @return {string} The resulting ascii string.
         */
        hex2ascii: function(hexx){
            var hex = hexx.toString();//force conversion
            var str = '';
            for (var i = 0; i < hex.length; i += 2)
                str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
            return str;
        },
    },
    /**
     * Functions that are called by the ui
     */
    ui: {
        /**
         * Toggle the collapse state of the Sidebar, saves the settings and rerenders the sidebar (so the state change takes effect)
         */
        toggleCollapse: function(){
            MWSidebar.settings.collapsed = ! MWSidebar.settings.collapsed;
            MWSidebar.saveSettings();
            MWSidebar.refreshCollapse();
        },
        /**
         * Opens the settings menu and wires the events
         */
        openSettings: function (){
            console.log("opening Settings...");
            MWSidebar.settingsMenu.dialog("open");
            $( "#tabs" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" );
            $( "#tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );

            jQuery('#mw-barColorHigh').change(MWSidebar.ui.changeBarColorHigh);
            jQuery('#mw-barColorLow').change(MWSidebar.ui.changeBarColorLow);

            $("#mw-sidebarSide").val(MWSidebar.settings.side) //initialize with the current value.
            jQuery('#mw-sidebarSide').change(MWSidebar.ui.changeSidebarSide);

            $("#mw-language").val(MWSidebar.settings.language) //initialize with the current value.
            jQuery('#mw-language').change(MWSidebar.ui.changeLanguage);


            jQuery("#mw-restore-links").click(MWSidebar.ui.restoreLinks);
            jQuery(".mw-button-delete-link").click(MWSidebar.ui.deleteLink);
            jQuery(".mw-button-add-link").click(MWSidebar.ui.addLink);

            /*$('.ui-dialog').css({
                'width': $(window).width(),
                'height': $(window).height(),
                'left': '0px',
                'top':'0px'
            });*/
        },
        /**
         * Changes the side where the sidebar is rendered
         */
        changeSidebarSide: function(){
            MWSidebar.settings.side = $("#mw-sidebarSide").val();
        },
        /**
         * Change the users language.
         */
        changeLanguage: function(){
            MWSidebar.settings.language = $("#mw-language").val();
            MWSidebar.update();
            MWSidebar.updateOther();
        },
        /**
         * Change the "low" color of the progress bars.
         */
        changeBarColorLow: function(){
            MWSidebar.settings.barColorLow= $("#mw-barColorLow").val();
            MWSidebar.update();
            MWSidebar.updateOther();
        },
        /**
         * Change the "high" color of the progress bars.
         */
        changeBarColorHigh: function(){
            MWSidebar.settings.barColorHigh= $("#mw-barColorHigh").val();
            MWSidebar.update();
            MWSidebar.updateOther();
        },
        /**
         * Remove all links from the dom link table
         */
        removeAllLinks: function(){
            jQuery("#mw-link-table tr:has(.mw-button-delete-link)").remove();
        },
        /**
         * (Re-)Adds all the links to the dom link table
         */
        addAllLinks: function(){
            jQuery("#mw-link-table").append(MWSidebar.settings.links.reduce((result,link)=>{
                return result + MWSidebar.helper.fillTemplate(TEMPLATE_LINK_SETTINGS, {link: link, i18n: I18N[MWSidebar.settings.language]}, 5);
            },""));
            jQuery(".mw-button-delete-link").click(MWSidebar.ui.deleteLink);

            MWSidebar.doUpdate();
            MWSidebar.doUpdateOther();
        },
        /**
         * Add a link to the saved links and rerenders everything
         */
        addLink: function(){
            let icon = jQuery("#mw-new-link-icon").val();
            let url = jQuery("#mw-new-link-url").val();
            let text = jQuery("#mw-new-link-text").val();
            if(url==""){
                alert("You have to enter an url!");
                return;
            }
            if(icon==""&&text==""){
                alert("You have to enter an icon or text!");
                return;
            }
            jQuery("#mw-new-link-icon").val("");
            jQuery("#mw-new-link-url").val("");
            jQuery("#mw-new-link-text").val("");
            let link = {icon: icon, url: url, text: text};
            MWSidebar.settings.links.push(link);
            MWSidebar.saveSettings();
            MWSidebar.ui.removeAllLinks()
            MWSidebar.ui.addAllLinks();
        },
        /**
         * Permanently deletes a link from the settings and dom
         */
        deleteLink: function(e){
            var i= jQuery(".mw-button-delete-link").index(e.target);
            MWSidebar.settings.links.splice(i, 1);
            MWSidebar.saveSettings();
            MWSidebar.ui.removeAllLinks()
            MWSidebar.ui.addAllLinks();
        },
        /**
         * (Re-)Adds all the links to the dom link table
         */
        restoreLinks: function(){
            MWSidebar.settings.links = DEFAULT_LINKS.slice(0);
            MWSidebar.saveSettings();
            MWSidebar.ui.removeAllLinks()
            MWSidebar.ui.addAllLinks();
        }
    },

    /**
     * Calculates the bandwidth for a user
     * @param {object} data - The user data.
     * @return {array} An array containing the new bandwidth, the allocated bandwidth and the remaining bandwidth (in percent).
     */
    calcBandwidth: function(data){
        const STEEMIT_BANDWIDTH_AVERAGE_WINDOW_SECONDS = 60 * 60 * 24 * 7;
        let vestingShares = parseFloat(data.vesting_shares)
        let receivedVestingShares = parseFloat(data.received_vesting_shares)

        let average_bandwidth = parseInt(data.average_bandwidth, 10)

        let delta_time = (new Date - new Date(data.last_bandwidth_update + "Z")) / 1000

        let bandwidthAllocated = (MWSidebar.globalProps.maxVirtualBandwidth  * (vestingShares + receivedVestingShares) / MWSidebar.globalProps.totalVestingShares)
        bandwidthAllocated = Math.round(bandwidthAllocated / 1000000);

        let new_bandwidth = 0
        if (delta_time < STEEMIT_BANDWIDTH_AVERAGE_WINDOW_SECONDS) {
            new_bandwidth = (((STEEMIT_BANDWIDTH_AVERAGE_WINDOW_SECONDS - delta_time)*average_bandwidth)/STEEMIT_BANDWIDTH_AVERAGE_WINDOW_SECONDS)
        }
        new_bandwidth = Math.round(new_bandwidth / 1000000)
        let remaining = 100 - (100 * new_bandwidth / bandwidthAllocated);

        return [new_bandwidth, bandwidthAllocated, remaining];
    },

    /**
     * Processes and formats the raw user data from the api.
     * @param {object} newData - the raw user data from the api.
     * @return {object} The processed and formatted data.
     */
    updateUser: function(newData) {
        if (newData == undefined) {
            user = null;
            return;
        }
        newData.displayRep = steem.formatter.reputation(newData.reputation);

        let base_voting_power = newData.voting_power;
        let last_time = moment.utc(newData.last_vote_time).valueOf();
        let now = moment.utc().valueOf();
        let delta = (now-last_time) /1000;
        let updated_voting_power = base_voting_power +(10000*delta/432000);
        if( updated_voting_power > 10000 ) {
            updated_voting_power = 10000;
        }
        newData.trueVotePower = (updated_voting_power/100).toFixed(2);
        let timeForVotePower = (10000-updated_voting_power)/2000*24*60*60;
        let voteTimeStamp = moment.utc(moment.utc().valueOf() + timeForVotePower*1000);
        newData.voteTime = voteTimeStamp.local().format(MWSidebar.settings.dateTimeFormat);

        newData.voteSpan = MWSidebar.helper.formatSeconds(timeForVotePower);

        newData.sp = 0;
        let effective_vesting_shares =0;
        newData.vesting_shares = parseFloat(newData.vesting_shares.replace(" VESTS",""));
        newData.delegated_vesting_shares = parseFloat(newData.delegated_vesting_shares.replace(" VESTS",""));
        newData.received_vesting_shares = parseFloat(newData.received_vesting_shares.replace(" VESTS",""));
        effective_vesting_shares= newData.vesting_shares - newData.delegated_vesting_shares + newData.received_vesting_shares;
        newData.sp= MWSidebar.globalProps.totalVestingFund * (effective_vesting_shares / MWSidebar.globalProps.totalVestingShares)
        newData.ownSp= (MWSidebar.globalProps.totalVestingFund * ( newData.vesting_shares / MWSidebar.globalProps.totalVestingShares)).toFixed(3)
        newData.recSp= (MWSidebar.globalProps.totalVestingFund * (newData.received_vesting_shares / MWSidebar.globalProps.totalVestingShares)).toFixed(3)
        newData.delSp= (MWSidebar.globalProps.totalVestingFund * (newData.delegated_vesting_shares / MWSidebar.globalProps.totalVestingShares)).toFixed(3)

        newData.sp = newData.sp.toFixed(3);

        let bandwidthData= MWSidebar.calcBandwidth(newData);
        newData.bw_a = bandwidthData[0];
        newData.bw_m = bandwidthData[1];
        newData.bw_p = bandwidthData[2];

        return newData;
    },

    /**
     * Update the dom from the new user data
     * @param {string} target - The id of the target dom element.
     * @param {object} user - The new user data.
     */
    updateDisplay :function(target, user) {
        if (user == undefined)
            return;
        let content = TEMPLATE_WITH_USER;
        let links = MWSidebar.settings.links.reduce((result,link)=>{
            return (result=={}?"":result) + MWSidebar.helper.fillTemplate(TEMPLATE_LINK, {link: link, user: user, i18n: I18N[MWSidebar.settings.language]});
        },"");
        temp = {
            target: target,
            links: links,
            bw_c: MWSidebar.helper.prettyPrintBytes(user.bw_m-user.bw_a),
            bw_m: MWSidebar.helper.prettyPrintBytes(user.bw_m),
            bw_p: user.bw_p.toFixed(2),
            vote_color: MWSidebar.helper.lerpColor(MWSidebar.settings.barColorHigh, MWSidebar.settings.barColorLow, (100-user.trueVotePower)/100),
            bw_color: MWSidebar.helper.lerpColor(MWSidebar.settings.barColorHigh, MWSidebar.settings.barColorLow, (100-user.bw_p)/100),
            bw_pno0: user.bw_p>0?user.bw_p.toFixed(2):"0"
        };
        content = MWSidebar.helper.fillTemplate(TEMPLATE_WITH_USER, {settings: MWSidebar.settings, user: user, temp:temp, i18n: I18N[MWSidebar.settings.language]});

        jQuery("#" + target).replaceWith(content);
        jQuery('#mw-script-container').niceScroll({cursorcolor:"lightblue"});
        MWSidebar.refreshCollapse();
    },

    /**
     * Refresh user data and updates the dom
     * @param {string} account - The (new) accountname.
     * @param {string} target - The id of the target dom element.
     */
    updateAccountInfo : function updateAccountInfo(account, target) {
        if (account == null || account == "") {
            jQuery("#" + target).replaceWith('<div id="{target}"></div>'.replace("{target}", target));
            return;
        }
        steem.api.getAccounts([account], function (err, result) {
            if ( ( err != null && err != "") || result.length == 0) {
                user = null;
                console.log(err);
                return;
            }
            var user = MWSidebar.updateUser(result[0]);
            MWSidebar.updateDisplay(target, user);
        });
    },

    /**
     * Refresh user data for the account in the "search" box
     */
    update: function() {
        MWSidebar.updateAccountInfo( MWSidebar.settings.username, "mw-script-content", false);
    },
    /**
     * Refresh user data for the account of the current page
     */
    updateOther:function() {

        var newOtherUser;
        splits = document.location.pathname.split('/');
        for (i = 0; i < splits.length; i++) {

            if (splits[i].startsWith('@')) {
                newOtherUser = splits[i].replace("@", "");
                break;
            }
            newOtherUser = "";
        }
        if (newOtherUser == MWSidebar.settings.username){
            newOtherUser = "";
        }
        if (newOtherUser !=  MWSidebar.otherUsername) {
            MWSidebar.otherUsername = newOtherUser;
            MWSidebar.updateAccountInfo( MWSidebar.otherUsername, "mw-script-content-other", true);
        }
    },
    /**
     * Updates the username from the ui.
     * @param {event} e - The change event.
     */
    updateUsername : function(e) {
        if (e.which == 13) {
            MWSidebar.settings.username = jQuery('#mw-username').val().toLowerCase();
            MWSidebar.update();
            MWSidebar.saveSettings();
            return false;
        };
    },
    /**
     * Refresh the dom to reflect the collapse state.
     */
    refreshCollapse: function(){
        if( MWSidebar.settings.collapsed){
            jQuery('#mw-script-content').hide();
            jQuery('#mw-script-content-other').hide();
            jQuery('#mw-username-p').hide();
            jQuery('#mw-divider').hide();
            jQuery('#mw-footer').hide();
            jQuery('#mw-collapse-button').css('margin-left','2px');
            jQuery('#mw-script-container').css('width','2px');
            jQuery('#mw-script-container').css('padding-left','9px');
            jQuery('#mw-script-container').css('height','auto');
            jQuery('#mw-script-container').css('background-color','transparent');

            if(MWSidebar.settings.side=="left"){
                jQuery('#mw-collapse-button').html("&rang;");
            }else{
                jQuery('#mw-collapse-button').html("&lang;");
            }
        }else{
            jQuery('#mw-script-content').show();
            jQuery('#mw-script-content-other').show();
            jQuery('#mw-username-p').show();
            jQuery('#mw-divider').show();
            jQuery('#mw-footer').show();
            jQuery('#mw-script-container').css('width','200px');
            jQuery('#mw-script-container').css('padding-left','2em');
            jQuery('#mw-script-container').css('height','100vh');
            jQuery('#mw-script-container').css('background-color','');
            jQuery('#mw-collapse-button').css('margin-left','110px');

            if(MWSidebar.settings.side=="left"){
                jQuery('#mw-collapse-button').html("&lang;");
            }else{
                jQuery('#mw-collapse-button').html("&rang;");
            }
        }
    },
    /**
     * Load all settings from the saved values.
     */
    loadSettings: function(){
        MWSidebar.settings.username = MWSidebar.getSetting("mw-username","");
        MWSidebar.settings.barColorHigh = MWSidebar.getSetting("mw-barColorHigh", "#00FF00");
        MWSidebar.settings.barColorLow = MWSidebar.getSetting("mw-barColorLow", "#FF0000");
        MWSidebar.settings.side = MWSidebar.getSetting("mw-side", "left");
        MWSidebar.settings.language = MWSidebar.getSetting("mw-language", "en");
        MWSidebar.settings.lastSaved = MWSidebar.getSetting("mw-lastSaved", 0);

        let collapsed = MWSidebar.getSetting("mw-collapsed", false);
        MWSidebar.settings.collapsed = collapsed==true || collapsed=="true";

        let json =  MWSidebar.getSetting("mw-links", null);
        if(json==null||json=="")
            MWSidebar.settings.links = DEFAULT_LINKS;
        else
            MWSidebar.settings.links = JSON.parse(json);

        const autopost2 = localStorage.getItem('autopost2');
        if (autopost2) {
            [username, password, memoWif, login_owner_pubkey] = MWSidebar.helper.hex2ascii(autopost2,'hex').toString().split('\t');
            privPostKey = password; //This will be used for upcoming voting features
            if(!MWSidebar.settings.username|| MWSidebar.settings.username=="")
                MWSidebar.settings.username = username;
        }
    },
    /**
     * Save all settings
     */
    saveSettings: function(){
        MWSidebar.settings.lastSaved = moment.utc().valueOf();
        MWSidebar.setSetting("mw-username", MWSidebar.settings.username);
        MWSidebar.setSetting("mw-collapsed", MWSidebar.settings.collapsed);
        MWSidebar.setSetting("mw-barColorHigh", MWSidebar.settings.barColorHigh);
        MWSidebar.setSetting("mw-barColorLow", MWSidebar.settings.barColorLow);
        MWSidebar.setSetting("mw-links", JSON.stringify(MWSidebar.settings.links));
        MWSidebar.setSetting("mw-side", MWSidebar.settings.side);
        MWSidebar.setSetting("mw-language", MWSidebar.settings.language);
        MWSidebar.setSetting("mw-lastSaved", MWSidebar.settings.lastSaved);
    },
    /**
     * Initial DOM-Setup
     */
    setup: function() {
        MWSidebar.loadSettings();

        jQuery('.App__content').eq(0).before(
            MWSidebar.helper.fillTemplate(TEMPLATE_WITHOUT_USER, {settings: MWSidebar.settings, i18n: I18N[MWSidebar.settings.language]})
        );
        MWSidebar.refreshCollapse();
        jQuery('#mw-username').keypress(MWSidebar.updateUsername);
        jQuery('#mw-collapse-button').click(MWSidebar.ui.toggleCollapse);
        jQuery('#mw-settings').click(MWSidebar.ui.openSettings);

        let index = 0;
        let links = MWSidebar.settings.links.reduce((result,link)=>{
            return (result=={}?"":result) + MWSidebar.helper.fillTemplate(TEMPLATE_LINK_SETTINGS, {link: link, i18n: I18N[MWSidebar.settings.language]}, 5);
        },"");
        jQuery("body").append(MWSidebar.helper.fillTemplate(TEMPLATE_SETTINGS_MENU, {settings: MWSidebar.settings, links:links, i18n: I18N[MWSidebar.settings.language]}));

        MWSidebar.settingsMenu = jQuery("#mw-settings-window").dialog({
            autoOpen: false,
            resizable: false,
            height: 600,
            width: "80vw",
            modal: true,
            buttons: {
                "Save Changes": function(){
                    MWSidebar.saveSettings();
                    MWSidebar.settingsMenu.dialog("close");
                    MWSidebar.update();
                    MWSidebar.updateOther();
                }
            },
            close: function() {
                MWSidebar.loadSettings();
                MWSidebar.update();
                MWSidebar.updateOther();
            }
        });
        MWSidebar.helper.addGlobalStyle(GM_getResourceText("JQUI_CSS"));
    },
    /**
     * Save a setting permanently
     * @param {string} cname - The key to save under.
     * @param {string} cvalue - The value to save.
     */
    setSetting: function(cname, cvalue) {
        GM_setValue(cname, cvalue);
    },
    /**
     * Get a setting or returns the default value
     * @param {string} cname - The key of the saved value.
     * @param {string} defaultValue - The default value that is returned if nothing is found.
     */
    getSetting: function(cname, defaultValue) {
        var val=GM_getValue(cname);
        if(val!=null)
            return val;

        var name = cname + "=";
        var decodedCookie = decodeURIComponent(document.cookie);
        var ca = decodedCookie.split(';');
        for (var i = 0; i < ca.length; i++) {
            var c = ca[i];
            while (c.charAt(0) == ' ') {
                c = c.substring(1);
            }
            if (c.indexOf(name) == 0) {
                return c.substring(name.length, c.length);
            }
        }
        if(defaultValue!=null)
            return defaultValue;
        return "";

    },
    /**
     * Async updates the global properties from the api
     */
    updateGlobalProperties: function(){
        steem.api.getDynamicGlobalProperties(function(err, result) {

            MWSidebar.globalProps.totalVestingFund=parseFloat(result.total_vesting_fund_steem.replace(" STEEM", ""));
            MWSidebar.globalProps.totalVestingShares = parseFloat(result.total_vesting_shares.replace(" VESTS", ""));
            MWSidebar.globalProps.maxVirtualBandwidth = parseInt(result.max_virtual_bandwidth, 10);
        });
    },
    /**
     * Update the current user
     */
    doUpdate: function(){
        MWSidebar.update();
        setTimeout(MWSidebar.doUpdate, 10000); //Alle 10 Sekunden das eigene Profil updaten
    },
    /**
     * Update the user from the current page
     */
    doUpdateOther: function(){
        MWSidebar.updateOther();
        setTimeout(MWSidebar.doUpdateOther, 100); //Jede 1/10 Sekunde überprüfen ob man jetzt das Profil eines anderen Users offen hat :)
    },
    /**
     * Update the global properties and replans itself
     */
    doUpdateGlobalProperties: function(){
        MWSidebar.updateGlobalProperties();
        setTimeout(MWSidebar.doUpdateGlobalProperties, 60000); // Jede Minute die neuen Properties holen
    },
    /**
     * Look for setting changes in other tabs replans itself
     */
    doReloadSettings: function(){
        //Falls eine neuere Version der Settings existiert Settings neu laden
        let latest=MWSidebar.getSetting("mw-lastSaved",0)
        if(latest>MWSidebar.settings.lastSaved)
            MWSidebar.loadSettings();
        setTimeout(MWSidebar.doReloadSettings, 1000); // Jede Sekunde prüfen ob neue Einstellungen vorhanden sind
    }
}


/**
 * Entry-Point
 */
$(document).ready(function () {
    steem.api.getDynamicGlobalProperties(function(err, result) {

        MWSidebar.globalProps.totalVestingFund=parseFloat(result.total_vesting_fund_steem.replace(" STEEM", ""));
        MWSidebar.globalProps.totalVestingShares = parseFloat(result.total_vesting_shares.replace(" VESTS", ""));
        MWSidebar.globalProps.maxVirtualBandwidth = parseInt(result.max_virtual_bandwidth, 10);

        MWSidebar.setup();
        MWSidebar.doUpdate();
        MWSidebar.doUpdateOther();
        MWSidebar.doUpdateGlobalProperties();
        MWSidebar.doReloadSettings();
    });
});

//Attaching it to the window of the current site to make debugging alot easier :)
unsafeWindow.MWSidebar = MWSidebar;