~ps-jenkins/ubuntu-push/ubuntu-vivid-proposed

« back to all changes in this revision

Viewing changes to docs/example-server/notify-form.html

  • Committer: Roberto Alsina
  • Date: 2014-10-24 14:05:51 UTC
  • mfrom: (91.179.41 automatic)
  • mto: This revision was merged to the branch mainline in revision 136.
  • Revision ID: roberto.alsina@canonical.com-20141024140551-tsdz3xggo2rbwlqj
MergeĀ fromĀ automatic

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!doctype html>
2
 
<html>
 
2
<html lang="en">
3
3
<head>
4
 
<title>notify</title>
 
4
<meta name="viewport" content="width=device-width, initial-scale=1">
 
5
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.2.0/united/bootstrap.min.css" rel="stylesheet">
 
6
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
 
7
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
 
8
<script>
 
9
function enableControls() {
 
10
    disabled = !($('#enable')[0].checked);
 
11
    $('#popup')[0].disabled=disabled;
 
12
    $('#persist')[0].disabled=disabled;
 
13
    $('#sound')[0].disabled=disabled;
 
14
    $('#vibrate')[0].disabled=disabled;
 
15
    $('#counter')[0].disabled=disabled;
 
16
};
 
17
 
 
18
function showError()
 
19
{
 
20
    var vars = {};
 
21
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
 
22
    for(var i = 0; i < hashes.length; i++)
 
23
    {
 
24
        hash = hashes[i].split('=');
 
25
        vars[hash[0]] = decodeURIComponent(hash[1]);
 
26
    }
 
27
    if (vars["error"]) {
 
28
        $("<div class='alert alert-danger' role='alert'>" + vars["error"] + "</div>").insertAfter ($("h1"))
 
29
    }
 
30
}
 
31
 
 
32
</script>
 
33
<title>Send a notification</title>
5
34
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
6
35
</head>
7
36
<body>
8
 
<form method="POST" action="/play-notify-form" >
9
 
<label for="nick">Nick:</label><br><input id="nick" name="nick" type="text" autofocus><br>
10
 
<label for="data">Message (JSON):</label><br><textarea id="data" name="data" cols="64" rows="8"></textarea><br>
11
 
<input type="submit" value="notify">
 
37
<div class="container">
 
38
<H1>Send a notification</H1>
 
39
<form method="POST" action="/play-notify-form" role="form">
 
40
<fieldset>
 
41
<div class="form-group">
 
42
    <label for="nick">Nick:</label>
 
43
    <input  class="form-control" placeholder="Message destination" id="nick" name="nick" type="text" autofocus>
 
44
</div>
 
45
<div class="form-group">
 
46
    <label for="message">Message:</label>
 
47
    <textarea class="form-control" placeholder="Message" id="message" name="message" rows="5"></textarea>
 
48
</div>
 
49
<div class="checkbox">
 
50
    <label> <input type="checkbox" id="enable" name="enable" onclick='enableControls()' checked=true> Enable Notifications </label>
 
51
</div>
 
52
<div class="checkbox">
 
53
    <label> <input type="checkbox" id="popup" name="popup" checked=true> Enable Popup </label>
 
54
    <label> <input type="checkbox" id="persist" name="persist" checked=true> Persistent </label>
 
55
    <label> <input type="checkbox" id="sound" name="sound" checked=true> Make Sound </label>
 
56
    <label> <input type="checkbox" id="vibrate" name="vibrate" checked=true> Vibrate </label>
 
57
    <label for="data">
 
58
    <input class="form-control" placeholder="Set Counter" id="counter" name="counter" type="number" value=42 autofocus>
 
59
    </label>
 
60
</div>
 
61
    <button type="submit" class="btn btn-primary" value="notify">Submit</button>
 
62
</fieldset>
12
63
</form>
 
64
</div>
 
65
<script>
 
66
    showError();
 
67
</script>
13
68
</body>
14
69
</html>