Welcome to mirror list, hosted at ThFree Co, Russian Federation.

theme.html « webroot « Server « Duplicati - github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 98a53d542223849e9eb38123acfed717a687e394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    <title>Select theme</title>
    <style type="text/css">
    .button {
        display: inline-block;
        padding: 10px;
        background-color: lightblue;
        color: black;
        cursor: pointer;
        margin-right: 10px;
    }

    .button.disabled {
        background-color: lightgray;
        color: white;
        cursor: default;
    }
    </style>
    
    <script type="text/javascript">
    function setDefault(theme) {

        var d = new Date();
        d.setTime(d.getTime() + (90*24*60*60*1000));

        document.cookie = 'default-theme=' + theme  + '; expires=' + d.toUTCString() + '; path=/';
        updateToCurrentTheme();
        return false;
    };

    function parseCookies(){

        var cookiestrings = document.cookie.split('; ');
        var cookies = {};

        for(var i=cookiestrings.length-1; i>=0; i--){
           var parts = cookiestrings[i].split('=');
           cookies[parts[0]] = parts[1];
        }

        return cookies;
    };

    function updateToCurrentTheme() {
        var theme = parseCookies()['default-theme'];

        var themes = ['greeno', 'ngax'];
        for(var k in themes) {
            var el = document.getElementById(themes[k]);
            el.className = "button" + (theme == themes[k] ? " disabled" : "");
        }
    };

    function onLabelClick(e) {
        document.forms[0]['theme'].value = e;
    };

    function setView(theme) {
        window.location = theme;
    };

    // Lazy hack for DOM timing issues...
    window.setTimeout(updateToCurrentTheme, 1000);

    </script>

    <script type="text/javascript" src="oem/root/theme/oem.js" ></script>
    <link rel="stylesheet" type="text/css" href="oem/root/theme/oem.css" />

</head>

<body>
    <h2>Duplicati theme</h2>
    <ul>
        <li class="theme-item">
            <h3 class="title">NgAx - The new responsive theme</h3>
            <div class="buttons">
                <div class="button" id="ngax" onclick="setDefault('ngax')">Use as default</div>
                <div class="button" onclick="setView('ngax')">View now</div>
            </div>
        </li>
        <li class="theme-item">
            <h3 class="title">Greeno - Your friendly green theme</h3>
            <div class="buttons">
                <div class="button" id="greeno" onclick="setDefault('greeno')">Use as default</div>
                <div class="button" onclick="setView('greeno')">View now</div>
            </div>
        </li>
    </ul>

    <script type="text/javascript">updateToCurrentTheme();</script>
</body>    
</html>