cpee-worklist 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f5e998b250f45900c42856943ea0ed77674b3dc1aca8a639b9292edb56c5270
4
- data.tar.gz: '060494d5269eab17272165105056c81e93b875fe0722bc3a9a91a8edf488b342'
3
+ metadata.gz: 803b1b014fedfd15a18792b7d8bd8ae44b8ca3f0f9c9e73ee3bce147c079fe66
4
+ data.tar.gz: 0a5faa9d0a7a044a450b17dcf2d30b98774800b5e3cf5d5c1e4e8dc535512d9f
5
5
  SHA512:
6
- metadata.gz: 4774db8305dac31b524e7a9b4256bc40ca0c39d0b599e8989ee8502cd2de6f20a07d60929774643727e5492dd393155bc876760b10990cad0e4bc89e3c511e34
7
- data.tar.gz: 118656ce46e5859ed72efd10648986afeb5ad5cfc359a74dc1317bc6db059505ad928439769c964404361870ad9abf1bd197122ad61317e5e619fc62eb77a561
6
+ metadata.gz: 5cd26a575083104789de654796f57ef5f403e7ee03fc4c0f79b16c0f0ee7225ef904c992eb71760e571c2d536e29bbcec46336baae02375c2e1ff4adf315212f
7
+ data.tar.gz: 60353fd3d43a1419b4633c26dd17aa5da78b350e907a684f3a64618df3055d177ae32cc0a63fc97a6fe8b20db67ac251a04df345e6248d5be82d4642907ca28c
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-worklist"
3
- s.version = "1.0.10"
3
+ s.version = "1.0.11"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0-or-later"
6
6
  s.summary = "Worklist for the cloud process execution engine (cpee.org)"
data/ui/container.html ADDED
@@ -0,0 +1,40 @@
1
+ <!--
2
+ This file is part of CPEE.
3
+
4
+ CPEE is free software: you can redistribute it and/or modify it under the terms
5
+ of the GNU General Public License as published by the Free Software Foundation,
6
+ either version 3 of the License, or (at your option) any later version.
7
+
8
+ CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
9
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10
+ PARTICULAR PURPOSE. See the GNU General Public License for more details.
11
+
12
+ You should have received a copy of the GNU General Public License along with
13
+ CPEE (file COPYING in the main directory). If not, see
14
+ <http://www.gnu.org/licenses/>.
15
+ -->
16
+
17
+ <!DOCTYPE html>
18
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
19
+ <head>
20
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
21
+ <title>Container</title>
22
+
23
+ <!-- libs, do not modify. When local than load local libs. -->
24
+ <script type="text/javascript" src="/js_libs/jquery.min.js"></script>
25
+ <script type="text/javascript" src="/js_libs/jquery.browser.js"></script>
26
+ <script type="text/javascript" src="/js_libs/jquery.svg.min.js"></script>
27
+ <script type="text/javascript" src="/js_libs/jquery.svgdom.min.js"></script>
28
+ <script type="text/javascript" src="/js_libs/vkbeautify.js"></script>
29
+ <script type="text/javascript" src="/js_libs/util.js"></script>
30
+ <script type="text/javascript" src="/js_libs/printf.js"></script>
31
+ <script type="text/javascript" src="/js_libs/strftime.min.js"></script>
32
+ <script type="text/javascript" src="/js_libs/parsequery.js"></script>
33
+ <script type="text/javascript" src="/js_libs/underscore.min.js"></script>
34
+ <script type="text/javascript" src="/js_libs/jquery.caret.min.js"></script>
35
+ <script type="text/javascript" src="/js_libs/jquery.cookie.js"></script>
36
+ <script type="text/javascript" src="/js_libs/marked.min.js"></script>
37
+ </head>
38
+ <body>
39
+ </body>
40
+ </html>
data/ui/css/ui.css CHANGED
@@ -136,8 +136,14 @@ ui-area > form {
136
136
  padding-left: 1em;
137
137
  }
138
138
 
139
- div.task {
140
- padding: 1em;
139
+ .areataskitem iframe {
140
+ width: 100%;
141
+ border:0 none;
142
+ height: 100%;
143
+ margin: 0;
144
+ padding: 0;
145
+ box-sizing: border-box;
146
+ display: block;
141
147
  }
142
148
 
143
149
  #dat_tasks tr.priority_1:nth-child(even) { background-color: #dc8add30; color: ButtonText; }
@@ -164,3 +170,5 @@ div.task {
164
170
  75% { background-color: red; }
165
171
  100% { background-color: #ebdef0; }
166
172
  }
173
+
174
+
data/ui/js/worklist.js CHANGED
@@ -190,105 +190,101 @@ function do_work(taskid,taskidurl) { //{{{
190
190
  }
191
191
  }
192
192
  }
193
- {
194
- let replaces = iform.match(/form="worklist-form"/ms);
195
- if (replaces && replaces.length > 0) {
196
- iform = iform.replaceAll(replaces[0],'form="form_' + taskid + '"');
197
- }
198
- }
199
- {
200
- let replaces = iform.match(/div.task.current/ms);
201
- if (replaces && replaces.length > 0) {
202
- iform = iform.replaceAll(replaces[0],'div.task.task_' + taskid);
203
- }
204
- }
205
193
  {
206
194
  let replaces = iform.match(/worklist-item/ms);
207
195
  if (replaces && replaces.length > 0) {
208
- iform = iform.replaceAll(replaces[0],'div.task.task_' + taskid);
196
+ iform = iform.replaceAll(replaces[0],'body');
209
197
  }
210
198
  }
211
199
  {
212
200
  let replaces = evaltext.match(/worklist-item/ms);
213
201
  if (replaces && replaces.length > 0) {
214
- evaltext = evaltext.replaceAll(replaces[0],'div.task.task_' + taskid);
202
+ evaltext = evaltext.replaceAll(replaces[0],'body');
215
203
  }
216
204
  }
217
205
 
218
- let container = $("<div class='task task_" + taskid + "'><form id='form_" + taskid + "'></form></div>");
219
- container.append(iform);
206
+ let worklist_form = $("<form id='worklist-form'></form></div>");
220
207
 
221
- let form = $("ui-area[data-belongs-to-tab="+taskid+"]");
222
- form.addClass('areataskitem');
223
208
  let data;
224
209
  try { data = res.parameters; } catch (e) { data = {}; }
225
- form.append(container);
226
210
 
227
- eval(evaltext); // investigate indirect eval and strict
211
+ let iframe= $('<iframe src="container.html"></iframe>')[0];
212
+ iframe.onload = () => {
213
+ $(iframe.contentDocument.body).append(worklist_form);
214
+ $(iframe.contentDocument.body).append(iform);
215
+ iframe.contentWindow.data = data;
216
+ iframe.contentWindow.form = $(iframe.contentDocument.body);
217
+ iframe.contentWindow.eval(evaltext); // investigate indirect eval and strict
218
+ $("#worklist-form",iframe.contentWindow.form).on('submit',function(e){
228
219
 
229
- uidash_activate_tab($('ui-tabbar ui-tab[data-tab=' + taskid + ']'));
230
- $("#form_"+taskid).on('submit',function(e){
231
- let scount = 0;
232
- $('select[required][form="form_' + taskid + '"]').each((_,e) => {
233
- if ($(e).val() == null) { scount += 1; }
234
- if (scount == 1) {
235
- $(e).focus();
236
- $(e).removeClass('pulseit');
220
+ let scount = 0;
221
+ $('select[required][form="worklist-form"]',iframe.contentWindow.form).each((_,e) => {
222
+ if ($(e).val() == null) { scount += 1; }
223
+ if (scount == 1) {
224
+ $(e).focus();
225
+ $(e).removeClass('pulseit');
237
226
 
238
- setTimeout(()=>{$(e).addClass('pulseit')},100);;
239
- }
240
- });
241
- if (scount > 0) {
242
- e.preventDefault();
243
- return false;
244
- }
245
- var form_data = $(this).serializeArray();
246
- var send_data = {};
247
- var headers = {};
248
- if (res.collect) { headers['CPEE-UPDATE'] = 'true'; }
249
- send_data['user'] = $("input[name=user-name]").val();
250
- send_data['raw'] = form_data;
251
- send_data['data'] = {};
252
- $.map(send_data['raw'], function(n, i){
253
- send_data['data'][n['name']] = n['value'];
254
- });
255
- $.ajax({
256
- type: "PUT",
257
- url: res.url,
258
- headers: headers,
259
- contentType: "application/json",
260
- data: JSON.stringify(send_data),
261
- success: function(something){
262
- $.ajax({
263
- type: "DELETE",
264
- url: taskidurl,
265
- success: function(del){
266
- uidash_close_tab('ui-tab[data-tab='+taskid+'] ui-close');
267
- get_worklist();
268
- },
269
- error: function(a,b,c){
270
- console.log("Delete failed");
271
- }
272
- });
273
- },
274
- error: function(a,b,c){
275
- $.ajax({
276
- type: "DELETE",
277
- url: taskidurl,
278
- success: function(del){
279
- uidash_close_tab('ui-tab[data-tab='+taskid+'] ui-close');
280
- get_worklist();
281
- },
282
- error: function(a,b,c){
283
- console.log("Delete failed");
227
+ setTimeout(()=>{$(e).addClass('pulseit')},100);;
228
+ }
229
+ });
230
+ if (scount > 0) {
231
+ e.preventDefault();
232
+ return false;
284
233
  }
234
+ var form_data = $(this).serializeArray();
235
+ var send_data = {};
236
+ var headers = {};
237
+ if (res.collect) { headers['CPEE-UPDATE'] = 'true'; }
238
+ send_data['user'] = $("input[name=user-name]").val();
239
+ send_data['raw'] = form_data;
240
+ send_data['data'] = {};
241
+ $.map(send_data['raw'], function(n, i){
242
+ send_data['data'][n['name']] = n['value'];
243
+ });
244
+ $.ajax({
245
+ type: "PUT",
246
+ url: res.url,
247
+ headers: headers,
248
+ contentType: "application/json",
249
+ data: JSON.stringify(send_data),
250
+ success: function(something){
251
+ $.ajax({
252
+ type: "DELETE",
253
+ url: taskidurl,
254
+ success: function(del){
255
+ uidash_close_tab('ui-tab[data-tab='+taskid+'] ui-close');
256
+ get_worklist();
257
+ },
258
+ error: function(a,b,c){
259
+ console.log("Delete failed");
260
+ }
261
+ });
262
+ },
263
+ error: function(a,b,c){
264
+ $.ajax({
265
+ type: "DELETE",
266
+ url: taskidurl,
267
+ success: function(del){
268
+ uidash_close_tab('ui-tab[data-tab='+taskid+'] ui-close');
269
+ get_worklist();
270
+ },
271
+ error: function(a,b,c){
272
+ console.log("Delete failed");
273
+ }
274
+ });
275
+ // TODO
276
+ console.log("Put didnt work");
277
+ }
278
+ });
279
+ e.preventDefault();
285
280
  });
286
- // TODO
287
- console.log("Put didnt work");
288
281
  }
289
- });
290
- e.preventDefault();
291
- });
282
+
283
+ let taskitem = $("ui-area[data-belongs-to-tab="+taskid+"]");
284
+ taskitem.addClass('areataskitem');
285
+ taskitem.append(iframe);
286
+
287
+ uidash_activate_tab($('ui-tabbar ui-tab[data-tab=' + taskid + ']'));
292
288
  },
293
289
  error: function(a,b,c){
294
290
  $.ajax({
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-worklist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2024-07-14 00:00:00.000000000 Z
13
+ date: 2024-07-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl
@@ -109,6 +109,7 @@ files:
109
109
  - server/worklist
110
110
  - server/worklist.conf
111
111
  - tools/cpee-worklist
112
+ - ui/container.html
112
113
  - ui/css/ui.css
113
114
  - ui/direct.html
114
115
  - ui/index.html