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

configuration.html « resources - github.com/ClusterM/pebble-my-data.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6adb9bbfba344e9d440ae3bdce1d56c52750c276 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<!-- -*-coding: utf-8 -*-
vim: sw=2 ts=2 expandtab ai
-->

<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
      body { background-color: black; text-align: center; color: white }
      h1 { margin: 0 }
      small { color: gray }
      a { color: white }
      input { height: 1.5em; font-size: 1.2em; font-weight: bold }
      .text { width: 93%; margin: 0.5em; text-align: center }
      .submit { width: 93%; margin: 0.4em }
      .param { display: inline-table; width: 95%; height: 3em }
      .label,.checkbox { display: table-cell; vertical-align: middle }
      .label { text-align: left }
      .checkbox { text-align: right; width: 1.5em; height: 1.5em }
      .example { width: 75%; display: inline-block; text-align: left; font-size: 0.6em }
    </style>
    <script>

      var config = _CONFIG_;

      function put_config() {
        for (var param in config) {
          var element = document.getElementById(param);
          if (element) {
            if (typeof config[param] === 'boolean') {
              element.checked = config[param];
            } else {
              element.value = config[param];
            }
          }
        }
      }

      function get_config() {
        var form = document.getElementById('config_form');
        for (config = {}, i = 0; i < form.length ; i++) {
          id = form[i].id;
          if (id != "save") {
            if (form[i].type === 'checkbox') {
              config[id] = form[i].checked;
            } else {
              config[id] = form[i].value;
            }
          }
        }
        return window.location.href = "pebblejs://close#" + encodeURIComponent(JSON.stringify(config));
      }

      function toggle_visibility(id) {
        var e = document.getElementById(id);
        if(e.style.display == 'block')
          e.style.display = 'none';
        else
          e.style.display = 'block';
      }
    </script>
  </head>
  <body onload="put_config();">
    <h1>My Data</h1>
    <small>v2.3.3, by bahbka</small>
    <hr size="1" />

    <form action="javascript: get_config();" id="config_form">
      Server URL
      <input type="text" id="url" class="text" value="" placeholder="your URL here">

      <hr size="1" />

      <span onclick="toggle_visibility('auth')">Server auth <small>(optional)</small></span>
      <div id="auth" style="display: none">
      Pebble Token
      <input type="text" id="token" class="text" value="">

      Password
      <input type="password" id="password" class="text" value="">
      </div>

      <hr size="1" />

      <div class="param">
        <div class="label">
          Append GPS coordinates to URL:<br>
          <small>(can eat your phone battery)</small>
        </div>
        <div class="checkbox">
          <input type="checkbox" id="config_location" class="checkbox">
        </div>
      </div>

      <div class="param">
        <div class="label">
          Vibrate on bluetooth connection loss:
        </div>
        <div class="checkbox">
          <input type="checkbox" id="config_vibrate" class="checkbox">
        </div>
      </div>

      <div class="param">
        <div class="label">
          Seconds dots blinking:<br>
          <small>(can eat your pebble battery)</small>
        </div>
        <div class="checkbox">
          <input type="checkbox" id="config_seconds" class="checkbox">
        </div>
      </div>

      <div class="param">
        <div class="label">
          Update with shaking:<br>
          <small>(possible unnecessary updates)</small>
        </div>
        <div class="checkbox">
          <input type="checkbox" id="config_shake" class="checkbox">
        </div>
      </div>
      <input type="submit" id="save" class="submit" value="save and apply">
    </form>

    <hr size="1" />
    <small>see documentation on <a href="https://github.com/bahbka/pebble-my-data/blob/master/README.md">github</a></small><br>
    <small><a href="http://forums.getpebble.com/discussion/13590">discussion</a> at pebble forums</small>
  </body>
</html>