ruote-kit 2.1.10 → 2.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/.gitignore +2 -0
  2. data/CHANGELOG.txt +10 -0
  3. data/Gemfile +21 -5
  4. data/LICENSE.txt +20 -0
  5. data/README.rdoc +132 -80
  6. data/Rakefile +4 -15
  7. data/TODO.txt +12 -0
  8. data/config.ru +22 -14
  9. data/lib/ruote-kit/application.rb +46 -22
  10. data/lib/ruote-kit/helpers/json_helpers.rb +280 -0
  11. data/lib/ruote-kit/helpers/link_helpers.rb +117 -0
  12. data/lib/ruote-kit/helpers/misc_helpers.rb +35 -0
  13. data/lib/ruote-kit/helpers/pagination_helpers.rb +30 -0
  14. data/lib/ruote-kit/helpers/render_helpers.rb +39 -92
  15. data/lib/ruote-kit/public/_ruote/images/favicon.ico +0 -0
  16. data/lib/ruote-kit/public/_ruote/images/ruote.png +0 -0
  17. data/lib/ruote-kit/public/_ruote/images/ruote_buttons.png +0 -0
  18. data/lib/ruote-kit/public/_ruote/javascripts/jquery-1.4.2.min.js +154 -0
  19. data/lib/ruote-kit/public/_ruote/javascripts/rk.js +40 -0
  20. data/lib/ruote-kit/public/_ruote/javascripts/ruote-fluo-editor.js +548 -0
  21. data/lib/ruote-kit/public/_ruote/javascripts/ruote-fluo.js +32 -1
  22. data/lib/ruote-kit/public/_ruote/stylesheets/reset.css +53 -0
  23. data/lib/ruote-kit/public/_ruote/stylesheets/rk.css +355 -16
  24. data/lib/ruote-kit/public/_ruote/stylesheets/ruote-fluo-editor.css +108 -0
  25. data/lib/ruote-kit/resources/errors.rb +46 -43
  26. data/lib/ruote-kit/resources/expressions.rb +92 -35
  27. data/lib/ruote-kit/resources/participants.rb +53 -0
  28. data/lib/ruote-kit/resources/processes.rb +68 -36
  29. data/lib/ruote-kit/resources/schedules.rb +27 -0
  30. data/lib/ruote-kit/resources/workitems.rb +93 -31
  31. data/lib/ruote-kit/spec/ruote_helpers.rb +25 -16
  32. data/lib/ruote-kit/version.rb +3 -1
  33. data/lib/ruote-kit/views/_pagination.html.haml +38 -0
  34. data/lib/ruote-kit/views/_tree_editor.html.haml +52 -0
  35. data/lib/ruote-kit/views/error.html.haml +69 -0
  36. data/lib/ruote-kit/views/errors.html.haml +28 -12
  37. data/lib/ruote-kit/views/expression.html.haml +161 -30
  38. data/lib/ruote-kit/views/expressions.html.haml +26 -21
  39. data/lib/ruote-kit/views/http_error.html.haml +11 -0
  40. data/lib/ruote-kit/views/index.html.haml +4 -0
  41. data/lib/ruote-kit/views/layout.html.haml +52 -32
  42. data/lib/ruote-kit/views/participants.html.haml +79 -0
  43. data/lib/ruote-kit/views/process.html.haml +109 -42
  44. data/lib/ruote-kit/views/process_launched.html.haml +6 -2
  45. data/lib/ruote-kit/views/processes.html.haml +55 -24
  46. data/lib/ruote-kit/views/processes_new.html.haml +36 -0
  47. data/lib/ruote-kit/views/schedules.html.haml +42 -0
  48. data/lib/ruote-kit/views/workitem.html.haml +83 -29
  49. data/lib/ruote-kit/views/workitems.html.haml +42 -19
  50. data/lib/ruote-kit.rb +17 -88
  51. data/ruote-kit.gemspec +68 -80
  52. data/spec/it_has_an_engine.rb +69 -0
  53. data/spec/resources/errors_spec.rb +198 -270
  54. data/spec/resources/expressions_spec.rb +308 -52
  55. data/spec/resources/index_spec.rb +28 -16
  56. data/spec/resources/participants_spec.rb +102 -0
  57. data/spec/resources/processes_spec.rb +218 -104
  58. data/spec/resources/schedules_spec.rb +97 -0
  59. data/spec/resources/workitems_spec.rb +195 -100
  60. data/spec/ruote-kit_configure_spec.rb +32 -75
  61. data/spec/spec.opts +0 -1
  62. data/spec/spec_helper.rb +31 -92
  63. data/spec/webapp_helpers_spec.rb +309 -0
  64. metadata +87 -152
  65. data/lib/ruote-kit/configuration.rb +0 -83
  66. data/lib/ruote-kit/helpers/engine_helpers.rb +0 -24
  67. data/lib/ruote-kit/helpers/form_helpers.rb +0 -11
  68. data/lib/ruote-kit/helpers/launch_item_parser.rb +0 -59
  69. data/lib/ruote-kit/helpers/navigation_helpers.rb +0 -54
  70. data/lib/ruote-kit/helpers.rb +0 -9
  71. data/lib/ruote-kit/public/_ruote/images/bg.gif +0 -0
  72. data/lib/ruote-kit/public/_ruote/images/bg_button_left.gif +0 -0
  73. data/lib/ruote-kit/public/_ruote/images/bg_button_left_cancel.gif +0 -0
  74. data/lib/ruote-kit/public/_ruote/images/bg_button_left_submit.gif +0 -0
  75. data/lib/ruote-kit/public/_ruote/images/bg_button_right.gif +0 -0
  76. data/lib/ruote-kit/public/_ruote/javascripts/SimplyButtons.js +0 -191
  77. data/lib/ruote-kit/public/_ruote/javascripts/fluo-dial.js +0 -149
  78. data/lib/ruote-kit/public/_ruote/stylesheets/SimplyButtons.css +0 -226
  79. data/lib/ruote-kit/public/_ruote/stylesheets/base.css +0 -336
  80. data/lib/ruote-kit/public/_ruote/stylesheets/style.css +0 -393
  81. data/lib/ruote-kit/views/launch_process.html.haml +0 -19
  82. data/lib/ruote-kit/views/process_failed_to_launch.html.haml +0 -7
  83. data/lib/ruote-kit/views/resource_not_found.html.haml +0 -7
  84. data/spec/helpers/render_helpers_spec.rb +0 -214
  85. data/spec/ruote-kit_spec.rb +0 -4
  86. data/spec/views/expressions.html.haml_spec.rb +0 -31
  87. data/spec/views/launch_process.html.haml_spec.rb +0 -22
  88. data/spec/views/process.html.haml_spec.rb +0 -17
  89. data/spec/views/process_launched.html.haml_spec.rb +0 -16
  90. data/spec/views/processes.html.haml_spec.rb +0 -31
  91. data/spec/views/workitems.html.haml_spec.rb +0 -69
@@ -1,191 +0,0 @@
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
- };
@@ -1,149 +0,0 @@
1
-
2
- /*
3
- * OpenWFEru - open source ruby workflow and bpm engine
4
- * (c) 2008 John Mettraux
5
- *
6
- * OpenWFEru is freely distributable under the terms
7
- * of a BSD-style license.
8
- * For details, see the OpenWFEru web site: http://openwferu.rubyforge.org
9
- *
10
- * Made in Japan
11
- */
12
-
13
- //
14
- // example usage :
15
- //
16
- // var d = FluoDial.newDialog
17
- // ("upload new version of expression (as YAML file)", 500, 105);
18
- //
19
- // var f = new Element
20
- // ("form", { "method": "POST", "enctype": "multipart/form-data" });
21
- // var fi = new Element
22
- // ("input", { "type": "file", "name": "expression", "size": "50" });
23
- // var si = new Element
24
- // ("input", { "type": "submit", "value": "upload" });
25
- // f.appendChild(fi);
26
- // f.appendChild(si);
27
- // d.body.appendChild(f);
28
- //
29
-
30
- var FluoDial = function() {
31
-
32
- //
33
- // private methods
34
-
35
- function resizeItem (id, width, height) {
36
- var item = $(id);
37
- item.setStyle({ "width": ""+width+"px" });
38
- item.setStyle({ "height": ""+height+"px" });
39
- }
40
-
41
- function centerItem (id) {
42
-
43
- var item = $(id);
44
-
45
- var w = item.getDimensions()["width"];
46
- var h = item.getDimensions()["height"];
47
-
48
- if (centerItem.arguments.length > 1) {
49
- w = centerItem.arguments[1];
50
- h = centerItem.arguments[2];
51
- }
52
-
53
- var l = (window.innerWidth - w) / 2;
54
- var t = (window.innerHeight - h) / 2;
55
-
56
- item.setStyle({ "left": ""+l+"px" });
57
- item.setStyle({ "top": ""+t+"px" });
58
- }
59
-
60
- function resizeAndCenterItem (id, width, height) {
61
-
62
- resizeItem(id, width, height);
63
- centerItem(id, width, height);
64
- }
65
-
66
- function newRectangle (id, cclass, width, height) {
67
-
68
- var r = $(id);
69
-
70
- if (r) {
71
- r.childElements().each(function (elt) {
72
- elt.remove();
73
- });
74
- r.show();
75
- }
76
- else {
77
- r = new Element("div", { "id": id, "class": cclass });
78
- }
79
-
80
- resizeAndCenterItem(r, width, height);
81
-
82
- return r;
83
- }
84
-
85
- function newDialog (title, width, height) {
86
-
87
- var sheet = newRectangle
88
- ("dial_sheet", "dial_sheet", width, height);
89
- var dialog = newRectangle
90
- ("dial_dialog", "dial_dialog", width-20, height-20);
91
-
92
- document.body.appendChild(sheet);
93
- document.body.appendChild(dialog);
94
-
95
- var header = new Element
96
- ("div", { "class": "dial_header" });
97
- var body = new Element
98
- ("div", { "id": dialog.id+"_body", "class": "dial_body" });
99
-
100
- dialog.appendChild(header);
101
- dialog.appendChild(body);
102
-
103
- dialog.header = header;
104
- dialog.body = body;
105
-
106
- dialog.close = function () {
107
- sheet.hide();
108
- dialog.hide();
109
- };
110
- dialog.show = function () {
111
- sheet.show();
112
- dialog.show();
113
- };
114
- dialog.resize = function (w, h) {
115
- resizeAndCenterItem(sheet, w, h);
116
- resizeAndCenterItem(dialog, w-20, h-20);
117
- };
118
- dialog.stealElement = function (el) {
119
- if ( ! (el instanceof HTMLElement)) el = document.getElementById(el);
120
- this.body.appendChild(el);
121
- //el.parentNode = dialog.body;
122
- }
123
-
124
- var htitle = new Element("div", { "class": "dial_title" });
125
- htitle.appendChild(document.createTextNode(title));
126
- header.appendChild(htitle);
127
-
128
- var hmenu = new Element("div", { "class": "dial_menu" });
129
- var hclose = new Element
130
- ("a",
131
- { "href": "#",
132
- "title": "close this dialog",
133
- "onclick": "$('dial_dialog').close(); return false;" });
134
- hclose.innerHTML = "close";
135
- hmenu.appendChild(hclose);
136
- header.appendChild(hmenu);
137
-
138
- return dialog;
139
- }
140
-
141
- return {
142
-
143
- //
144
- // public methods
145
-
146
- newDialog: newDialog
147
- };
148
- }();
149
-
@@ -1,226 +0,0 @@
1
- /*--------------------------------------------------------------------------------------------------
2
-
3
- Simply Buttons, version 1.0
4
- (c) 2007-2009 Kevin Miller
5
-
6
- This script is freely distributable under the terms of an MIT-style license.
7
-
8
- BUTTON DEFINITIONS
9
-
10
- Edit below at your own risk, everything done here is for a reason for cross browser
11
- compatibility so that the buttons will appear identical in the tested browsers.
12
-
13
- Tested on: IE6 IE7 FF(PC/MAC) Safari SafariMobile Opera(PC/MAC)
14
-
15
- --------------------------------------------------------------------------------------------------*/
16
-
17
- button,
18
- a.button,
19
- a.button:link,
20
- a.button:visited {
21
- /*
22
- Strip down the button and link elements to a base we can work with.
23
- */
24
- padding: 0 0 0 0;
25
- margin: 0 3px 0 3px;
26
- border: none;
27
- display: block;
28
- float: left;
29
- cursor: pointer;
30
- text-decoration: none;
31
- outline: none;
32
- white-space: nowrap;
33
- overflow: visible;
34
- }
35
-
36
- * html a.button,
37
- * html a.button:link,
38
- * html a.button:visited {
39
- /*
40
- IE6 fix to make link fit text.
41
- */
42
- width: 1%;
43
- }
44
-
45
- button, x:-moz-any-link {
46
- /*
47
- FF fix to make button spacing even across browsers.
48
- */
49
- margin: 0 0 0 0;
50
- }
51
-
52
- *:first-child+html button {
53
- /*
54
- Reset IE7 back to what it was for previous fix.
55
- */
56
- margin: 0 3px 0 3px;
57
- }
58
-
59
- button span,
60
- a.button span,
61
- a.button:link span,
62
- a.button:visited span {
63
- /*
64
- Set the span tags to display: block, as they will work our background-image magic.
65
- */
66
- display: block;
67
- }
68
-
69
- /*--------------------------------------------------------------------------------------------------
70
-
71
- CUSTOMIZATIONS
72
-
73
- Edit below to change the look and feel of the buttons and even add more classes for
74
- different looks and feels.
75
-
76
- --------------------------------------------------------------------------------------------------*/
77
-
78
- button,
79
- a.button,
80
- a.button:link,
81
- a.button:visited {
82
- /*
83
- HEIGHT - Total height of button.
84
- */
85
- height: 26px;
86
-
87
- /*
88
- NOTE - You must define the font here otherwise your buttons and links could end up diffrent.
89
- */
90
- font-family: "Helvetica Neue", Helvetica, clean, sans-serif;
91
-
92
- font-size: 13px;
93
- color: #666666;
94
- background-color: #ffffff;
95
- }
96
-
97
- button.button_active,
98
- a.button_active {
99
- }
100
-
101
- button span,
102
- a.button span,
103
- a.button:link span,
104
- a.button:visited span {
105
- /*
106
- Right side padding for button (default).
107
- */
108
- padding: 0 14px 0 0;
109
-
110
- /*
111
- SPAN HEIGHT - This should be 2px smaller than the height set on the button (see HEIGHT).
112
- */
113
- height: 24px;
114
-
115
- /*
116
- We define our background top left and use the 'Sliding Doors' Technique for some fast loading buttons.
117
- */
118
- background: url(../images/bg_button_right.gif) top right;
119
- }
120
-
121
- button span span,
122
- a.button span span,
123
- a.button:link span span,
124
- a.button:visited span span {
125
- /*
126
- Left side padding for button (default).
127
- */
128
- padding: 0 0 0 13px;
129
-
130
- /*
131
- SPAN HEIGHT - This should be 1px smaller than the height set on the button (see HEIGHT).
132
- */
133
- height: 24px;
134
-
135
- /*
136
- SPAN LINE-HEIGHT - This should be 1px smaller than the height set on the button (see HEIGHT) and will
137
- center the text vertcailly.
138
- */
139
- line-height: 24px;
140
-
141
- /*
142
- We define our background top left and use the 'Sliding Doors' Technique for some fast loading buttons.
143
- */
144
- background: url(../images/bg_button_left.gif) top left;
145
- }
146
-
147
- button:hover,
148
- a.button:hover {
149
- color: #000000;
150
- }
151
-
152
- button.submit span,
153
- a.submit span,
154
- a.submit:link span,
155
- a.submit:visited span {
156
- }
157
-
158
- button.submit span span,
159
- a.submit span span,
160
- a.submit:link span span,
161
- a.submit:visited span span {
162
- /*
163
- Give some extra space for the icon.
164
- */
165
- padding-left: 26px;
166
-
167
- /*
168
- Add in a left side piece with an icon.
169
- */
170
- background-image: url(../images/bg_button_left_submit.gif);
171
- }
172
-
173
- button.submit:hover,
174
- a.submit:hover {
175
- }
176
-
177
- button.cancel span,
178
- a.cancel span,
179
- a.cancel:link span,
180
- a.cancel:visited span {
181
- }
182
-
183
- button.cancel span span,
184
- a.cancel span span,
185
- a.cancel:link span span,
186
- a.cancel:visited span span {
187
- /*
188
- Give some extra space for the icon.
189
- */
190
- padding-left: 26px;
191
-
192
- /*
193
- Add in a left side piece with an icon.
194
- */
195
- background-image: url(../images/bg_button_left_cancel.gif);
196
- }
197
-
198
- button.cancel:hover,
199
- a.cancel:hover {
200
- }
201
-
202
- button:active span,
203
- a:active:active span,
204
- /*
205
- 'button_active' is the class used by SimplyButtons.js to create the button states in IE.
206
- */
207
- button.button_active span,
208
- a.button_active:active span {
209
- /*
210
- Using the 'Sliding Doors' Technique we 'slide' the new button state into view.
211
- */
212
- background-position: bottom right;
213
- }
214
-
215
- button:active span span,
216
- a:active:active span span,
217
- /*
218
- 'button_active' is the class used by SimplyButtons.js to create the button states in IE.
219
- */
220
- button.button_active span span,
221
- a.button_active:active span span {
222
- /*
223
- Using the 'Sliding Doors' Technique we 'slide' the new button state into view.
224
- */
225
- background-position: bottom left;
226
- }