ruote-kit 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. data/.document +0 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +10 -0
  4. data/README.rdoc +132 -0
  5. data/Rakefile +57 -0
  6. data/config.ru +21 -0
  7. data/lib/ruote-kit/application.rb +50 -0
  8. data/lib/ruote-kit/configuration.rb +52 -0
  9. data/lib/ruote-kit/helpers/engine_helpers.rb +24 -0
  10. data/lib/ruote-kit/helpers/form_helpers.rb +11 -0
  11. data/lib/ruote-kit/helpers/launch_item_parser.rb +59 -0
  12. data/lib/ruote-kit/helpers/navigation_helpers.rb +54 -0
  13. data/lib/ruote-kit/helpers/render_helpers.rb +103 -0
  14. data/lib/ruote-kit/helpers.rb +9 -0
  15. data/lib/ruote-kit/public/_ruote/images/bg.gif +0 -0
  16. data/lib/ruote-kit/public/_ruote/images/bg_button_left.gif +0 -0
  17. data/lib/ruote-kit/public/_ruote/images/bg_button_left_cancel.gif +0 -0
  18. data/lib/ruote-kit/public/_ruote/images/bg_button_left_submit.gif +0 -0
  19. data/lib/ruote-kit/public/_ruote/images/bg_button_right.gif +0 -0
  20. data/lib/ruote-kit/public/_ruote/javascripts/SimplyButtons.js +191 -0
  21. data/lib/ruote-kit/public/_ruote/javascripts/fluo-can.js +1111 -0
  22. data/lib/ruote-kit/public/_ruote/javascripts/fluo-dial.js +149 -0
  23. data/lib/ruote-kit/public/_ruote/javascripts/fluo-json.js +183 -0
  24. data/lib/ruote-kit/public/_ruote/javascripts/fluo-tred.js +515 -0
  25. data/lib/ruote-kit/public/_ruote/stylesheets/SimplyButtons.css +226 -0
  26. data/lib/ruote-kit/public/_ruote/stylesheets/base.css +336 -0
  27. data/lib/ruote-kit/public/_ruote/stylesheets/rk.css +30 -0
  28. data/lib/ruote-kit/public/_ruote/stylesheets/style.css +393 -0
  29. data/lib/ruote-kit/resources/expressions.rb +55 -0
  30. data/lib/ruote-kit/resources/processes.rb +52 -0
  31. data/lib/ruote-kit/resources/workitems.rb +64 -0
  32. data/lib/ruote-kit/spec/ruote_helpers.rb +47 -0
  33. data/lib/ruote-kit/vendor/sinatra-respond_to/LICENSE +21 -0
  34. data/lib/ruote-kit/vendor/sinatra-respond_to/README.markdown +102 -0
  35. data/lib/ruote-kit/vendor/sinatra-respond_to/Rakefile +30 -0
  36. data/lib/ruote-kit/vendor/sinatra-respond_to/VERSION.yml +4 -0
  37. data/lib/ruote-kit/vendor/sinatra-respond_to/lib/sinatra/respond_to.rb +206 -0
  38. data/lib/ruote-kit/vendor/sinatra-respond_to/sinatra-respond_to.gemspec +56 -0
  39. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/app/public/static folder/.keep +0 -0
  40. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/app/public/static.txt +1 -0
  41. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/app/test_app.rb +53 -0
  42. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/app/unreachable_static.txt +1 -0
  43. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/app/views/layout.html.haml +2 -0
  44. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/app/views/resource.html.haml +1 -0
  45. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/app/views/resource.js.erb +3 -0
  46. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/app/views/resource.xml.builder +3 -0
  47. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/extension_spec.rb +403 -0
  48. data/lib/ruote-kit/vendor/sinatra-respond_to/spec/spec_helper.rb +18 -0
  49. data/lib/ruote-kit/views/expression.html.haml +38 -0
  50. data/lib/ruote-kit/views/expressions.html.haml +30 -0
  51. data/lib/ruote-kit/views/index.html.haml +1 -0
  52. data/lib/ruote-kit/views/launch_process.html.haml +19 -0
  53. data/lib/ruote-kit/views/layout.html.haml +46 -0
  54. data/lib/ruote-kit/views/process.html.haml +55 -0
  55. data/lib/ruote-kit/views/processes.html.haml +27 -0
  56. data/lib/ruote-kit/views/resource_not_found.html.haml +7 -0
  57. data/lib/ruote-kit/views/workitem.html.haml +39 -0
  58. data/lib/ruote-kit/views/workitems.html.haml +23 -0
  59. data/lib/ruote-kit.rb +105 -0
  60. data/ruote-kit.gemspec +136 -0
  61. data/spec/helpers/render_helpers_spec.rb +211 -0
  62. data/spec/resources/expressions_spec.rb +179 -0
  63. data/spec/resources/index_spec.rb +46 -0
  64. data/spec/resources/processes_spec.rb +259 -0
  65. data/spec/resources/workitems_spec.rb +308 -0
  66. data/spec/ruote-kit_spec.rb +4 -0
  67. data/spec/spec.opts +2 -0
  68. data/spec/spec_helper.rb +152 -0
  69. data/spec/views/launch_process.html.haml_spec.rb +21 -0
  70. data/spec/views/process.html.haml_spec.rb +16 -0
  71. data/spec/views/processes.html.haml_spec.rb +30 -0
  72. data/spec/views/workitems.html.haml_spec.rb +68 -0
  73. metadata +185 -0
@@ -0,0 +1,191 @@
1
+ // Simply Buttons, version 2.0
2
+ // (c) 2007-2009 Kevin Miller
3
+ //
4
+ // This script is freely distributable under the terms of an MIT-style license.
5
+ //
6
+ /*-----------------------------------------------------------------------------------------------*/
7
+ //
8
+ // * Adjusts the buttons so that they will not have an outline when they are pressed.
9
+ // * If the browser is mobile then we replace the buttons with inputs for compatibility.
10
+ // * Disables the text in the buttons from being selected.
11
+ // * The default styles here are meant for use with the Sliding Doors technique http://alistapart.com/articles/slidingdoors/
12
+ // to be used for IE so we can have nice states with a horrid browser too!
13
+ //
14
+ /*-----------------------------------------------------------------------------------------------*/
15
+
16
+ var SimplyButtons = {
17
+
18
+ options : {
19
+ hyperlinkClass : 'button'
20
+ ,activeButtonClass : 'button_active'
21
+ ,states : {
22
+ outer : {
23
+ active : {
24
+ backgroundPosition : 'bottom left'
25
+ }
26
+ ,inactive : {
27
+ backgroundPosition : 'top left'
28
+ }
29
+ }
30
+ ,inner : {
31
+ active : {
32
+ backgroundPosition : 'bottom right'
33
+ }
34
+ ,inactive : {
35
+ backgroundPosition : 'top right'
36
+ }
37
+ }
38
+ }
39
+ ,iphone : {
40
+ replaceButtons : true
41
+ }
42
+ }
43
+
44
+ ,buttons : []
45
+
46
+ ,iphone : false
47
+
48
+ ,init : function(options)
49
+ {
50
+ for (var property in options)
51
+ {
52
+ this.options[property] = options[property];
53
+ }
54
+
55
+ this.iphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i));
56
+
57
+ this.process(document.getElementsByTagName('button'), false);
58
+ this.process(document.getElementsByTagName('a'), true);
59
+
60
+ if (this.iphone && this.options.iphone.replaceButtons)
61
+ {
62
+ this.remove();
63
+ }
64
+ }
65
+
66
+ ,process : function(elements, links)
67
+ {
68
+ var linkTest = new RegExp('\\b' + this.options.hyperlinkClass + '\\b');
69
+ for (var a = 0; a < elements.length; a++)
70
+ {
71
+ if ((links && linkTest.test(elements[a].className)) || !links)
72
+ {
73
+ if (this.iphone && !links)
74
+ {
75
+ this.mobile(elements[a]);
76
+ }
77
+ else
78
+ {
79
+ this.disable(elements[a]);
80
+ this.setup(elements[a]);
81
+ }
82
+
83
+ if (!links)
84
+ {
85
+ this.buttons.push(elements[a]);
86
+ }
87
+ }
88
+ }
89
+ }
90
+
91
+ ,mobile : function(element)
92
+ {
93
+ var input = document.createElement('input');
94
+ input.setAttribute('type', element.getAttribute('type') == 'submit' ? 'submit' : 'button');
95
+
96
+ var attributes = new Array('id', 'name', 'value', 'class', 'onclick', 'onmouseover', 'onmouseout', 'onpress', 'onfocus', 'onblur', 'onmouseup', 'onmousedown');
97
+ for (var a = 0; a < attributes.length; a++)
98
+ {
99
+ if (element.getAttribute(attributes[a]))
100
+ {
101
+ input.setAttribute(attributes[a], element.getAttribute(attributes[a]));
102
+ }
103
+ }
104
+
105
+ input.style.marginLeft = element.style.marginLeft;
106
+ input.style.marginRight = element.style.marginRight;
107
+
108
+ element.parentNode.insertBefore(input, element);
109
+
110
+ }
111
+
112
+ ,remove : function()
113
+ {
114
+ for (var a = 0; a < this.buttons.length; a++)
115
+ {
116
+ this.buttons[a].parentNode.removeChild(this.buttons[a]);
117
+ }
118
+ }
119
+
120
+ ,disable : function(element)
121
+ {
122
+ element.onselectstart = function() { return false; };
123
+ element.style.MozUserSelect = 'none';
124
+ element.style.KhtmlUserSelect = 'none';
125
+ element.style.UserSelect = 'none';
126
+ element.style.cursor = 'default';
127
+ }
128
+
129
+ ,setup : function(element)
130
+ {
131
+ if (document.all)
132
+ {
133
+ if (element.tagName == 'BUTTON')
134
+ {
135
+ element.attachEvent('onfocus', this.bind(this.toggle, this, element));
136
+ }
137
+ else
138
+ {
139
+ element.attachEvent('onmousedown', this.bind(this.toggle, this, element));
140
+ }
141
+ element.attachEvent('onmouseup', this.bind(this.toggle, this, element));
142
+ }
143
+ else
144
+ {
145
+ element.onfocus = function() { this.blur(); };
146
+ }
147
+ }
148
+
149
+ ,toggle : function(o, element)
150
+ {
151
+ if (element.tagName != 'BUTTON' && element.tagName != 'A')
152
+ {
153
+ while (element.tagName != 'A')
154
+ {
155
+ element = element.parentNode;
156
+ }
157
+ }
158
+ if (event.type == 'focus' || event.type == 'mousedown')
159
+ {
160
+ element.className += ' ' + o.options.activeButtonClass;
161
+ o.style(element.childNodes[0], o.options.states.inner.active);
162
+ o.style(element.childNodes[0].childNodes[0], o.options.states.outer.active);
163
+ element.blur();
164
+ }
165
+ else
166
+ {
167
+ element.className = element.className.replace(o.options.activeButtonClass, '');
168
+ o.style(element.childNodes[0], o.options.states.inner.inactive);
169
+ o.style(element.childNodes[0].childNodes[0], o.options.states.outer.inactive);
170
+ }
171
+ }
172
+
173
+ ,style : function(element, styles)
174
+ {
175
+ for (var property in styles)
176
+ {
177
+ element.style[property] = styles[property];
178
+ }
179
+ }
180
+
181
+ ,bind : function(func)
182
+ {
183
+ var args = [];
184
+ for (var a = 1; a < arguments.length; a++)
185
+ {
186
+ args.push(arguments[a]);
187
+ }
188
+ return function() { return func.apply(this, args); };
189
+ }
190
+
191
+ };