lorraine 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Lorraine
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -9,7 +9,6 @@
9
9
  <script src="vendor/jscolor/jscolor.js" type="text/javascript"></script>
10
10
  </head>
11
11
  <body>
12
- <h1>Hey Howdy Hey</h1>
13
- Color: <input class="color {onImmediateChange:'colorChanged(this);'}" value="66ff00">
12
+ Input this color into the internets: <input class="color {onImmediateChange:'colorChanged(this);'}" value="66ff00">
14
13
  </body>
15
14
  </html>
@@ -2,11 +2,13 @@ $(function(){
2
2
 
3
3
  // Find the host
4
4
  //var pathArray = window.location.pathname.split( '/' );
5
- var host = getBaseURL() //pathArray[0]; // + "/";
5
+ var host = getBaseURL() + "faye"; //pathArray[0]; // + "/";
6
+ host = host.replace("/admin", "");
6
7
 
7
8
  // alert(host);
8
9
 
9
- window.faye_client = new Faye.Client(host + "faye");
10
+ window.faye_client = new Faye.Client(host);
11
+ console.log("client: "+ host)
10
12
 
11
13
  window.faye_client.subscribe('/messages', function(message) {
12
14
  alert('Got a message: ' + message.text);
@@ -18,6 +20,10 @@ function illuminatePixel(pixel, r, g, b) {
18
20
  window.faye_client.publish('/illuminate', [1, pixel, r * 4095, g * 4095, b * 4095]);
19
21
  }
20
22
 
23
+ function refresh() {
24
+ window.faye_client.publish('/illuminate', [2]);
25
+ }
26
+
21
27
  function illuminateAll(r, g, b) {
22
28
  illuminatePixel(0, r, g, b);
23
29
  illuminatePixel(1, r, g, b);
@@ -28,7 +34,8 @@ function illuminateAll(r, g, b) {
28
34
 
29
35
 
30
36
  function colorChanged(color) {
31
- illuminateAll(color.rgb[0], color.rgb[1], color.rgb[2])
37
+ illuminateAll(color.rgb[0], color.rgb[1], color.rgb[2]);
38
+ refresh();
32
39
  }
33
40
 
34
41
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: lorraine
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.6
5
+ version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Wil Gieseler