subduino 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/Readme.textile +48 -2
  2. data/VERSION +1 -1
  3. data/bin/subduino +21 -5
  4. data/duino/Makefile +53 -50
  5. data/duino/duino.pde +271 -5
  6. data/lib/subduino.rb +1 -1
  7. data/lib/subduino/parse.rb +23 -34
  8. data/lib/subduino/parse/bool.rb +13 -0
  9. data/lib/subduino/parse/lux.rb +13 -0
  10. data/lib/subduino/parse/temp.rb +17 -0
  11. data/lib/subduino/scaffold/Makefile +59 -51
  12. data/lib/subduino/store.rb +21 -12
  13. data/subduino.gemspec +88 -2
  14. data/webapp/config.yml +20 -0
  15. data/webapp/lib/app.rb +2 -2
  16. data/webapp/lib/duino.rb +9 -16
  17. data/webapp/public/custom.js +187 -0
  18. data/webapp/public/date_input.css +149 -0
  19. data/webapp/public/facebox.css +83 -0
  20. data/webapp/public/facebox.js +319 -0
  21. data/webapp/public/favicon.ico +0 -0
  22. data/webapp/public/icons/current.png +0 -0
  23. data/webapp/public/icons/day.png +0 -0
  24. data/webapp/public/icons/door-big.png +0 -0
  25. data/webapp/public/icons/favicon.png +0 -0
  26. data/webapp/public/icons/irrigation.png +0 -0
  27. data/webapp/public/icons/lamp-big.png +0 -0
  28. data/webapp/public/icons/lightbulb_off.png +0 -0
  29. data/webapp/public/icons/locked.png +0 -0
  30. data/webapp/public/icons/lux.png +0 -0
  31. data/webapp/public/icons/night.png +0 -0
  32. data/webapp/public/icons/noise.png +0 -0
  33. data/webapp/public/icons/onoff.png +0 -0
  34. data/webapp/public/icons/rain.png +0 -0
  35. data/webapp/public/icons/refrigeration.png +0 -0
  36. data/webapp/public/icons/temp.png +0 -0
  37. data/webapp/public/icons/unlocked.png +0 -0
  38. data/webapp/public/images/ajax-loader.gif +0 -0
  39. data/webapp/public/images/b.png +0 -0
  40. data/webapp/public/images/bendl.gif +0 -0
  41. data/webapp/public/images/bendr.gif +0 -0
  42. data/webapp/public/images/bendsb.gif +0 -0
  43. data/webapp/public/images/bg.jpg +0 -0
  44. data/webapp/public/images/bhead.gif +0 -0
  45. data/webapp/public/images/bheadl.gif +0 -0
  46. data/webapp/public/images/bheadr.gif +0 -0
  47. data/webapp/public/images/bl.png +0 -0
  48. data/webapp/public/images/bnd.gif +0 -0
  49. data/webapp/public/images/br.png +0 -0
  50. data/webapp/public/images/bread.gif +0 -0
  51. data/webapp/public/images/btnb.gif +0 -0
  52. data/webapp/public/images/btnb_.gif +0 -0
  53. data/webapp/public/images/btnm.gif +0 -0
  54. data/webapp/public/images/btnm_.gif +0 -0
  55. data/webapp/public/images/btns.gif +0 -0
  56. data/webapp/public/images/btns_.gif +0 -0
  57. data/webapp/public/images/cal.jpg +0 -0
  58. data/webapp/public/images/close.png +0 -0
  59. data/webapp/public/images/closelabel.gif +0 -0
  60. data/webapp/public/images/error.gif +0 -0
  61. data/webapp/public/images/ft.gif +0 -0
  62. data/webapp/public/images/hdr.gif +0 -0
  63. data/webapp/public/images/hdrl.gif +0 -0
  64. data/webapp/public/images/hdrr.gif +0 -0
  65. data/webapp/public/images/hld.jpg +0 -0
  66. data/webapp/public/images/imgb.gif +0 -0
  67. data/webapp/public/images/imgo.gif +0 -0
  68. data/webapp/public/images/imgt.gif +0 -0
  69. data/webapp/public/images/info.gif +0 -0
  70. data/webapp/public/images/jquery.wysiwyg.gif +0 -0
  71. data/webapp/public/images/li.gif +0 -0
  72. data/webapp/public/images/mbg.png +0 -0
  73. data/webapp/public/images/nsp.gif +0 -0
  74. data/webapp/public/images/phs.gif +0 -0
  75. data/webapp/public/images/sdd.jpg +0 -0
  76. data/webapp/public/images/sdd_.jpg +0 -0
  77. data/webapp/public/images/sidebar.gif +0 -0
  78. data/webapp/public/images/sorta.gif +0 -0
  79. data/webapp/public/images/sortd.gif +0 -0
  80. data/webapp/public/images/srch.gif +0 -0
  81. data/webapp/public/images/srch_.gif +0 -0
  82. data/webapp/public/images/success.gif +0 -0
  83. data/webapp/public/images/thumb1.jpg +0 -0
  84. data/webapp/public/images/thumb2.jpg +0 -0
  85. data/webapp/public/images/thumb3.jpg +0 -0
  86. data/webapp/public/images/tiny.gif +0 -0
  87. data/webapp/public/images/tiny_.gif +0 -0
  88. data/webapp/public/images/tl.png +0 -0
  89. data/webapp/public/images/tr.png +0 -0
  90. data/webapp/public/images/upload.gif +0 -0
  91. data/webapp/public/images/warning.gif +0 -0
  92. data/webapp/public/jquery.img.preload.js +152 -0
  93. data/webapp/public/jquery.sparkline.js +85 -0
  94. data/webapp/public/jquery.tablesorter.min.js +2 -0
  95. data/webapp/public/jquery.visualize.js +452 -0
  96. data/webapp/public/jquery.wysiwyg.css +56 -0
  97. data/webapp/public/style.css +881 -0
  98. data/webapp/public/visualize.css +32 -0
  99. data/webapp/views/index.haml +365 -49
  100. data/webapp/views/layout.haml +78 -7
  101. data/webapp/views/template.haml +676 -0
  102. metadata +89 -3
@@ -0,0 +1,319 @@
1
+ /*
2
+ * Facebox (for jQuery)
3
+ * version: 1.2 (05/05/2008)
4
+ * @requires jQuery v1.2 or later
5
+ *
6
+ * Examples at http://famspam.com/facebox/
7
+ *
8
+ * Licensed under the MIT:
9
+ * http://www.opensource.org/licenses/mit-license.php
10
+ *
11
+ * Copyright 2007, 2008 Chris Wanstrath [ chris@ozmm.org ]
12
+ *
13
+ * Usage:
14
+ *
15
+ * jQuery(document).ready(function() {
16
+ * jQuery('a[rel*=facebox]').facebox()
17
+ * })
18
+ *
19
+ * <a href="#terms" rel="facebox">Terms</a>
20
+ * Loads the #terms div in the box
21
+ *
22
+ * <a href="terms.html" rel="facebox">Terms</a>
23
+ * Loads the terms.html page in the box
24
+ *
25
+ * <a href="terms.png" rel="facebox">Terms</a>
26
+ * Loads the terms.png image in the box
27
+ *
28
+ *
29
+ * You can also use it programmatically:
30
+ *
31
+ * jQuery.facebox('some html')
32
+ *
33
+ * The above will open a facebox with "some html" as the content.
34
+ *
35
+ * jQuery.facebox(function($) {
36
+ * $.get('blah.html', function(data) { $.facebox(data) })
37
+ * })
38
+ *
39
+ * The above will show a loading screen before the passed function is called,
40
+ * allowing for a better ajaxy experience.
41
+ *
42
+ * The facebox function can also display an ajax page or image:
43
+ *
44
+ * jQuery.facebox({ ajax: 'remote.html' })
45
+ * jQuery.facebox({ image: 'dude.jpg' })
46
+ *
47
+ * Want to close the facebox? Trigger the 'close.facebox' document event:
48
+ *
49
+ * jQuery(document).trigger('close.facebox')
50
+ *
51
+ * Facebox also has a bunch of other hooks:
52
+ *
53
+ * loading.facebox
54
+ * beforeReveal.facebox
55
+ * reveal.facebox (aliased as 'afterReveal.facebox')
56
+ * init.facebox
57
+ *
58
+ * Simply bind a function to any of these hooks:
59
+ *
60
+ * $(document).bind('reveal.facebox', function() { ...stuff to do after the facebox and contents are revealed... })
61
+ *
62
+ */
63
+ (function($) {
64
+ $.facebox = function(data, klass) {
65
+ $.facebox.loading()
66
+
67
+ if (data.ajax) fillFaceboxFromAjax(data.ajax)
68
+ else if (data.image) fillFaceboxFromImage(data.image)
69
+ else if (data.div) fillFaceboxFromHref(data.div)
70
+ else if ($.isFunction(data)) data.call($)
71
+ else $.facebox.reveal(data, klass)
72
+ }
73
+
74
+ /*
75
+ * Public, $.facebox methods
76
+ */
77
+
78
+ $.extend($.facebox, {
79
+ settings: {
80
+ opacity : 0,
81
+ overlay : true,
82
+ loadingImage : 'images/loading.gif',
83
+ closeImage : 'images/closelabel.gif',
84
+ imageTypes : [ 'png', 'jpg', 'jpeg', 'gif' ],
85
+ faceboxHtml : '\
86
+ <div id="facebox" style="display:none;"> \
87
+ <div class="popup"> \
88
+ <table> \
89
+ <tbody> \
90
+ <tr> \
91
+ <td class="tl"/><td class="b"/><td class="tr"/> \
92
+ </tr> \
93
+ <tr> \
94
+ <td class="b"/> \
95
+ <td class="body"> \
96
+ <div class="content"> \
97
+ </div> \
98
+ <div class="footer"> \
99
+ <a href="#" class="close"> \
100
+ <img src="images/closelabel.gif" title="close" class="close_image" /> \
101
+ </a> \
102
+ </div> \
103
+ </td> \
104
+ <td class="b"/> \
105
+ </tr> \
106
+ <tr> \
107
+ <td class="bl"/><td class="b"/><td class="br"/> \
108
+ </tr> \
109
+ </tbody> \
110
+ </table> \
111
+ </div> \
112
+ </div>'
113
+ },
114
+
115
+ loading: function() {
116
+ init()
117
+ if ($('#facebox .loading').length == 1) return true
118
+ showOverlay()
119
+
120
+ $('#facebox .content').empty()
121
+ $('#facebox .body').children().hide().end().
122
+ append('<div class="loading"><img src="'+$.facebox.settings.loadingImage+'"/></div>')
123
+
124
+ $('#facebox').css({
125
+ top: getPageScroll()[1] + (getPageHeight() / 10),
126
+ left: 385.5
127
+ }).show()
128
+
129
+ $(document).bind('keydown.facebox', function(e) {
130
+ if (e.keyCode == 27) $.facebox.close()
131
+ return true
132
+ })
133
+ $(document).trigger('loading.facebox')
134
+ },
135
+
136
+ reveal: function(data, klass) {
137
+ $(document).trigger('beforeReveal.facebox')
138
+ if (klass) $('#facebox .content').addClass(klass)
139
+ $('#facebox .content').append(data)
140
+ $('#facebox .loading').remove()
141
+ $('#facebox .body').children().fadeIn('normal')
142
+ $('#facebox').css('left', $(window).width() / 2 - ($('#facebox table').width() / 2))
143
+ $(document).trigger('reveal.facebox').trigger('afterReveal.facebox')
144
+ },
145
+
146
+ close: function() {
147
+ $(document).trigger('close.facebox')
148
+ return false
149
+ }
150
+ })
151
+
152
+ /*
153
+ * Public, $.fn methods
154
+ */
155
+
156
+ $.fn.facebox = function(settings) {
157
+ init(settings)
158
+
159
+ function clickHandler() {
160
+ $.facebox.loading(true)
161
+
162
+ // support for rel="facebox.inline_popup" syntax, to add a class
163
+ // also supports deprecated "facebox[.inline_popup]" syntax
164
+ var klass = this.rel.match(/facebox\[?\.(\w+)\]?/)
165
+ if (klass) klass = klass[1]
166
+
167
+ fillFaceboxFromHref(this.href, klass)
168
+ return false
169
+ }
170
+
171
+ return this.click(clickHandler)
172
+ }
173
+
174
+ /*
175
+ * Private methods
176
+ */
177
+
178
+ // called one time to setup facebox on this page
179
+ function init(settings) {
180
+ if ($.facebox.settings.inited) return true
181
+ else $.facebox.settings.inited = true
182
+
183
+ $(document).trigger('init.facebox')
184
+ makeCompatible()
185
+
186
+ var imageTypes = $.facebox.settings.imageTypes.join('|')
187
+ $.facebox.settings.imageTypesRegexp = new RegExp('\.' + imageTypes + '$', 'i')
188
+
189
+ if (settings) $.extend($.facebox.settings, settings)
190
+ $('body').append($.facebox.settings.faceboxHtml)
191
+
192
+ var preload = [ new Image(), new Image() ]
193
+ preload[0].src = $.facebox.settings.closeImage
194
+ preload[1].src = $.facebox.settings.loadingImage
195
+
196
+ $('#facebox').find('.b:first, .bl, .br, .tl, .tr').each(function() {
197
+ preload.push(new Image())
198
+ preload.slice(-1).src = $(this).css('background-image').replace(/url\((.+)\)/, '$1')
199
+ })
200
+
201
+ $('#facebox .close').click($.facebox.close)
202
+ $('#facebox .close_image').attr('src', $.facebox.settings.closeImage)
203
+ }
204
+
205
+ // getPageScroll() by quirksmode.com
206
+ function getPageScroll() {
207
+ var xScroll, yScroll;
208
+ if (self.pageYOffset) {
209
+ yScroll = self.pageYOffset;
210
+ xScroll = self.pageXOffset;
211
+ } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
212
+ yScroll = document.documentElement.scrollTop;
213
+ xScroll = document.documentElement.scrollLeft;
214
+ } else if (document.body) {// all other Explorers
215
+ yScroll = document.body.scrollTop;
216
+ xScroll = document.body.scrollLeft;
217
+ }
218
+ return new Array(xScroll,yScroll)
219
+ }
220
+
221
+ // Adapted from getPageSize() by quirksmode.com
222
+ function getPageHeight() {
223
+ var windowHeight
224
+ if (self.innerHeight) { // all except Explorer
225
+ windowHeight = self.innerHeight;
226
+ } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
227
+ windowHeight = document.documentElement.clientHeight;
228
+ } else if (document.body) { // other Explorers
229
+ windowHeight = document.body.clientHeight;
230
+ }
231
+ return windowHeight
232
+ }
233
+
234
+ // Backwards compatibility
235
+ function makeCompatible() {
236
+ var $s = $.facebox.settings
237
+
238
+ $s.loadingImage = $s.loading_image || $s.loadingImage
239
+ $s.closeImage = $s.close_image || $s.closeImage
240
+ $s.imageTypes = $s.image_types || $s.imageTypes
241
+ $s.faceboxHtml = $s.facebox_html || $s.faceboxHtml
242
+ }
243
+
244
+ // Figures out what you want to display and displays it
245
+ // formats are:
246
+ // div: #id
247
+ // image: blah.extension
248
+ // ajax: anything else
249
+ function fillFaceboxFromHref(href, klass) {
250
+ // div
251
+ if (href.match(/#/)) {
252
+ var url = window.location.href.split('#')[0]
253
+ var target = href.replace(url,'')
254
+ $.facebox.reveal($(target).clone().show(), klass)
255
+
256
+ // image
257
+ } else if (href.match($.facebox.settings.imageTypesRegexp)) {
258
+ fillFaceboxFromImage(href, klass)
259
+ // ajax
260
+ } else {
261
+ fillFaceboxFromAjax(href, klass)
262
+ }
263
+ }
264
+
265
+ function fillFaceboxFromImage(href, klass) {
266
+ var image = new Image()
267
+ image.onload = function() {
268
+ $.facebox.reveal('<div class="image"><img src="' + image.src + '" /></div>', klass)
269
+ }
270
+ image.src = href
271
+ }
272
+
273
+ function fillFaceboxFromAjax(href, klass) {
274
+ $.get(href, function(data) { $.facebox.reveal(data, klass) })
275
+ }
276
+
277
+ function skipOverlay() {
278
+ return $.facebox.settings.overlay == false || $.facebox.settings.opacity === null
279
+ }
280
+
281
+ function showOverlay() {
282
+ if (skipOverlay()) return
283
+
284
+ if ($('facebox_overlay').length == 0)
285
+ $("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')
286
+
287
+ $('#facebox_overlay').hide().addClass("facebox_overlayBG")
288
+ .css('opacity', $.facebox.settings.opacity)
289
+ .click(function() { $(document).trigger('close.facebox') })
290
+ .fadeIn(200)
291
+ return false
292
+ }
293
+
294
+ function hideOverlay() {
295
+ if (skipOverlay()) return
296
+
297
+ $('#facebox_overlay').fadeOut(200, function(){
298
+ $("#facebox_overlay").removeClass("facebox_overlayBG")
299
+ $("#facebox_overlay").addClass("facebox_hide")
300
+ $("#facebox_overlay").remove()
301
+ })
302
+
303
+ return false
304
+ }
305
+
306
+ /*
307
+ * Bindings
308
+ */
309
+
310
+ $(document).bind('close.facebox', function() {
311
+ $(document).unbind('keydown.facebox')
312
+ $('#facebox').fadeOut(function() {
313
+ $('#facebox .content').removeClass().addClass('content')
314
+ hideOverlay()
315
+ $('#facebox .loading').remove()
316
+ })
317
+ })
318
+
319
+ })(jQuery);
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file