/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */


var settings = [
    {
        setting: "account",
        title: "Sign out",
        text: "Disconnect this device and open the sign in screen.",
        icon: "game-icon game-icon-exit-door",
        color: "red",
        onclick: "logout()"
    },
    {
        setting: "opensource",
        title: "Credits",
        text: "See information on third-party code and artwork used in TerranQuest.",
        icon: "game-icon game-icon-spell-book",
        color: "lightblue",
        onclick: "router.navigate('/credits')"
    },
    {
        setting: "privacy",
        title: "Privacy Policy",
        text: "Know what data we collect and what your rights are.",
        icon: "game-icon game-icon-spy",
        color: "purple",
        onclick: "openBrowser('" + SETTINGS["terms_of_service_url"] + "')"
    },
    {
        setting: "versions",
        title: "TerranQuest v2.0.0",
        text: "Copyright &copy; 2014-2019 Netsyms Technologies.  License: <span style=\"text-decoration: underline;\" onclick=\"openBrowser('https://source.netsyms.com/TerranQuest/Game?pk_campaign=TerranQuestApp');\">Mozilla Public License 2.0</span>.",
        icon: "far fa-copyright margin-vertical",
        color: "gray",
        onclick: ""
    }
];

function loadSettings() {
    $("#settings-bin").html("");
    settings.forEach(function (item) {
        $("#settings-bin").append('<div class="col-100 tablet-33 desktop-25 item-col">'
                + '<div class="card padding-half" onclick="' + item.onclick + '">'
                + '<div class="card-content">'
                + '<i class="item-icon ' + item.icon + ' text-color-' + item.color + '"></i><br />'
                + '<h3>' + item.title + '</h3>'
                + item.text
                + '</div>'
                + '</div>'
                + '</div>');
    });
}