Blame view

Application_raspberryJustine/pageHTML/mode.html 1.11 KB
c974479b   csaad   réorganisation de...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  <!DOCTYPE html>
  <html lang="en">
    <head>
      <meta charset="UTF-8">
      <link rel="stylesheet" href="mode.css" />
      <title>Changement de mode</title>
  
      <script src="jquery.js"></script>
      <script type= "text/javascript">
        window.WebSocket = (window.WebSocket || window.MozWebSocket);
        var websocket = new WebSocket('ws://192.168.43.222:9000', 'myprotocol');
        websocket.onerror=function(){ $('h1').css('color','red');};
        websocket.onopen=function(){ $('h1').css('color','green');};
        
255e68fb   jsenella   Ajout lecture mod...
15
16
        function sendMessage(){
  	websocket.send($('#onoffswitch').is(':checked'));
c974479b   csaad   réorganisation de...
17
  	}
255e68fb   jsenella   Ajout lecture mod...
18
       
c974479b   csaad   réorganisation de...
19
20
21
22
23
24
25
26
27
28
29
30
      </script>
      
  </head>
  <body>
  <h1>Changement de mode de votre veilleuse connectée</h1>
  <div class="onoffswitch">
      <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked>
      <label class="onoffswitch-label" for="myonoffswitch">
          <span class="onoffswitch-inner"></span>
          <span class="onoffswitch-switch"></span>
      </label>
  </div>
255e68fb   jsenella   Ajout lecture mod...
31
32
  	<button onclick="sendMessage();">Send</button>
      <div id="messages"></div>
c974479b   csaad   réorganisation de...
33
34
35
36
  
  <h3><a href="Menu.html">Retour</a></h3>
  </body>
  </html>