wangzhibo
4 天以前 ae6f40460dcd56af6c5f60ba52c883854c3bac55
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
99
100
101
102
<!DOCTYPE html>
<head>
    <meta charset="utf-8"/>
    <meta name='viewport' content='initial-scale=1.0, maximum-scale=1.0'>
    <script type="text/javascript" src="js/Uri.js">
    </script>
    <script type="text/javascript" src="js/gadgetbridge_boilerplate.js">
    </script>
    <script type="text/javascript">
    </script>
    <style>
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }
        iframe {
            display: block;
            width: 100%;
            height: 100%;
            border: none;
        }
        body {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        -webkit-touch-callout: none;
        }
        #config_url,#jsondata {
        word-wrap: break-word;
        margin: 20px 0;
        width: 90%;
        }
        .btn {
        display: inline-block;
        position: relative;
        height: 32px;
        line-height: 32px;
        border-radius: 2px;
        font-size: 0.9em;
        background-color: #eee;
        color: #646464;
        text-align: center;
        border-style: none;
        }
        .btn:active {
        border-style: none;
        box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2)inset;
        transition-delay: 0s;
        }
        p {
        width: 90%;
        }
        #pastereturn {
        width: 90%;
        min-height: 3em;
        }
        #step1compat, #step2 {
        display: none;
        }
        <!-- TODO -->
    </style>
</head>
<body>
<div id="step1" class="step">
    <h2>URL of the configuration:</h2>
    <div id="config_url"></div>
    <!--<button class="btn" name="show config" value="show config" onclick="Pebble.showConfiguration()" >Show config / URL</button>-->
    <button class="btn" name="open config" value="open config" onclick="Pebble.actuallyOpenURL()">
        Open configuration website
    </button>
    <h2 class="load_presets">App presets:</h2>
    <button class="btn load_presets" name="read config" value="read config"
            onclick="Pebble.loadPreset()">
        Load saved configuration
    </button>
</div>
<div id="step1compat" class="step">
    <p>In case of "network error" after saving settings in the watchapp, copy the "network error"
        URL and paste it here:</p>
    <textarea id="pastereturn"></textarea><br/>
    <button class="btn" name="parse" onclick="Pebble.parseReturnedPebbleJS()">Parse legacy app
        configuration
    </button>
</div>
<div id="step2" class="step">
    <h2>Incoming configuration data:</h2>
    <div id="jsondata"></div>
    <button class="btn" name="send config" value="send config" onclick="Pebble.sendConfiguration()">
        Send data to pebble
    </button>
    <h2 class="store_presets">App Presets:</h2>
    <button class="btn store_presets" name="store config" value="store config"
            onclick="Pebble.savePreset()">
        Store incoming configuration
    </button>
    <p class="store_presets">Existing presets will be deleted.</p>
</div>
</body>