Private_Notes_4_Games

Makes it possible to write notes for games

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name        Private_Notes_4_Games
// @namespace   DanWL
// @description Makes it possible to write notes for games
// @include     https://www.warzone.com/MultiPlayer?GameID=*
// @version     1.0.0.5
// @grant       none
// ==/UserScript==

var GameID = location.href.split(/\?GameID=/i)[1];

function addButton(text, onclick, classes, cssObj) {
    cssObj = cssObj || {position: 'absolute', bottom: '7%', left:'4%', 'z-index': 3}
    let button = document.createElement('button'), btnStyle = button.style
    document.body.appendChild(button)
    button.innerHTML = text
    button.onclick = onclick
    button.className = classes
    Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key])
    return button
}

function duplicate(source) {
    var original = document.getElementById(source);
    var clone = original.cloneNode(true); // "deep" clone
   clone.id = "duplicater" + ++i; // there can only be one element with an ID
clone.innerHTML = 'CLONED'
    clone.onclick = duplicate; // event handlers are not cloned
    return clone;
}

function createUI()
{
	var multiplayer_dropdown = document.getElementById('#ujs_MenuBtn_btn');
	var GameNotesBtn = clone('ujs_MenuBtn_btn');

	multiplayer_dropdown.appendChild(GameNotesBtn);
}
createUI();