ruote-kit 2.2.0.3 → 2.3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/CHANGELOG.txt +28 -1
  2. data/CREDITS.txt +8 -2
  3. data/LICENSE.txt +1 -1
  4. data/Rakefile +21 -9
  5. data/lib/ruote-kit.rb +13 -4
  6. data/lib/ruote-kit/core_ext.rb +15 -0
  7. data/lib/ruote-kit/helpers/json_helpers.rb +22 -7
  8. data/lib/ruote-kit/helpers/link_helpers.rb +9 -7
  9. data/lib/ruote-kit/helpers/pagination_helpers.rb +1 -2
  10. data/lib/ruote-kit/helpers/render_helpers.rb +1 -1
  11. data/lib/ruote-kit/public/_ruote/images/favicon.png +0 -0
  12. data/lib/ruote-kit/public/_ruote/images/{ruote_buttons.png → ruote-buttons.png} +0 -0
  13. data/lib/ruote-kit/public/_ruote/images/ruote.png +0 -0
  14. data/lib/ruote-kit/public/_ruote/javascripts/foolbox-all.min.js +3 -0
  15. data/lib/ruote-kit/public/_ruote/javascripts/jquery-1.9.1.min.js +5 -0
  16. data/lib/ruote-kit/public/_ruote/javascripts/rk.js +68 -17
  17. data/lib/ruote-kit/public/_ruote/javascripts/ruote-fluo-all.min.js +3 -0
  18. data/lib/ruote-kit/public/_ruote/stylesheets/rk.css +82 -12
  19. data/lib/ruote-kit/public/_ruote/stylesheets/ruote-buttons.png +0 -0
  20. data/lib/ruote-kit/public/_ruote/stylesheets/ruote-fluo-editor.css +9 -6
  21. data/lib/ruote-kit/public/_ruote/stylesheets/ruote-fluo.css +62 -0
  22. data/lib/ruote-kit/resources/errors.rb +8 -3
  23. data/lib/ruote-kit/resources/expressions.rb +38 -35
  24. data/lib/ruote-kit/resources/participants.rb +1 -1
  25. data/lib/ruote-kit/resources/processes.rb +61 -4
  26. data/lib/ruote-kit/resources/workitems.rb +4 -4
  27. data/lib/ruote-kit/version.rb +1 -1
  28. data/lib/ruote-kit/views/_pagination.html.haml +2 -2
  29. data/lib/ruote-kit/views/_tree_editor.html.haml +63 -30
  30. data/lib/ruote-kit/views/error.html.haml +50 -9
  31. data/lib/ruote-kit/views/errors.html.haml +1 -1
  32. data/lib/ruote-kit/views/expression.html.haml +83 -33
  33. data/lib/ruote-kit/views/expressions.html.haml +23 -8
  34. data/lib/ruote-kit/views/http_error.html.haml +9 -2
  35. data/lib/ruote-kit/views/layout.html.haml +14 -13
  36. data/lib/ruote-kit/views/process.html.haml +75 -20
  37. data/lib/ruote-kit/views/processes.html.haml +9 -3
  38. data/lib/ruote-kit/views/processes_new.html.haml +19 -2
  39. data/lib/ruote-kit/views/schedules.html.haml +2 -2
  40. data/lib/ruote-kit/views/workitem.html.haml +17 -6
  41. data/ruote-kit.gemspec +9 -7
  42. data/spec/cases/orphan_workitem_spec.rb +141 -0
  43. data/spec/core_ext_spec.rb +19 -0
  44. data/spec/resources/errors_spec.rb +182 -156
  45. data/spec/resources/expressions_spec.rb +497 -379
  46. data/spec/resources/index_spec.rb +5 -5
  47. data/spec/resources/participants_spec.rb +64 -75
  48. data/spec/resources/processes_spec.rb +396 -277
  49. data/spec/resources/schedules_spec.rb +92 -76
  50. data/spec/resources/workitems_spec.rb +352 -343
  51. data/spec/ruote-kit_configure_spec.rb +41 -13
  52. data/spec/spec_helper.rb +6 -8
  53. data/spec/support/link_helper.rb +11 -0
  54. data/spec/webapp_helpers_spec.rb +29 -23
  55. metadata +161 -180
  56. data/README.rdoc +0 -313
  57. data/lib/ruote-kit/public/_ruote/images/favicon.ico +0 -0
  58. data/lib/ruote-kit/public/_ruote/javascripts/jquery-1.4.2.min.js +0 -154
  59. data/lib/ruote-kit/public/_ruote/javascripts/ruote-fluo-editor.js +0 -548
  60. data/lib/ruote-kit/public/_ruote/javascripts/ruote-fluo.js +0 -1118
@@ -0,0 +1,3 @@
1
+ /* ruote-fluo-all-2.3.1.min.js | MIT license: http://github.com/jmettraux/ruote-fluo/LICENSE.txt */
2
+ var RuoteFluoEditor=function(){var p={add_child_expression:"add a child expression",cut_expression:"cut expression",moveup_expression:"move expression up",movedown_expression:"move expression down",paste_expression:"paste expression here"};var b=function(){function z(C,D,E){var B=document.createElement("a");B.callback=E;B.className="rfe_button "+C;B.setAttribute("href","");B.setAttribute("title",D);B.setAttribute("onclick","this.callback(); return false;");return B}function A(E){var B=0;var D=document.createElement("span");D.className="rfe_buttons";D.style.opacity=B;var C=f(E);E.onmouseover=function(){D.style.opacity=1;if(C.onOver){C.onOver(s(E.parentNode))}};E.onmouseout=function(){D.style.opacity=B;if(C.onOver){C.onOver(null)}};D.appendChild(z("rfe_add",RuoteFluoEditor.TEXTS.add_child_expression,function(){RuoteFluoEditor.addExpression(E.parentNode,["---",{},[]])}));if(E.parentNode.parentNode!=C){D.appendChild(z("rfe_cut",RuoteFluoEditor.TEXTS.cut_expression,function(){RuoteFluoEditor.removeExpression(E.parentNode)}));D.appendChild(z("rfe_moveup",RuoteFluoEditor.TEXTS.moveup_expression,function(){RuoteFluoEditor.moveExpression(E.parentNode,-1);D.style.opacity=B}));D.appendChild(z("rfe_movedown",RuoteFluoEditor.TEXTS.movedown_expression,function(){RuoteFluoEditor.moveExpression(E.parentNode,+1);D.style.opacity=B}));D.appendChild(z("rfe_paste",RuoteFluoEditor.TEXTS.paste_expression,function(){var F=document._rfe_clipboard;if(F){RuoteFluoEditor.insertExpression(E.parentNode,F)}}))}E.appendChild(D)}return{render:function(D,E){D=u(D);var M=E[0];var K="";if((typeof E[2][0])==="string"){K=E[2].shift()}var G=John.sfy(E[1]);var H=document.createElement("div");H.setAttribute("class","rfe_exp");D.appendChild(H);var C=document.createElement("span");C.setAttribute("class","rfe_exp_span rfe_expression_name");C.appendChild(document.createTextNode(M));H.appendChild(C);var I=document.createElement("span");I.setAttribute("class","rfe_exp_span rfe_expression_atts");I.appendChild(document.createTextNode(" "+G));H.appendChild(I);A(H);var J=function(){var O=H.parentNode;var N=O.parentNode;var P=b.parse(this.value);if(P){O.replaceChild(b.render(O,P),H);g(O)}else{N.removeChild(O);g(N)}};var B=function(N){var O=N||window.event;var P=O.charCode||O.keyCode;if(P===13){this.blur()}return false};var F=function(N){var O=N||window.event;var P=O.charCode||O.keyCode;return(P!=13)};var L=function(){H.removeChild(C);var N=document.createElement("input");N.setAttribute("type","text");N.value=M+" "+G;if(K!=""){N.value=M+" "+K+" "+G}H.replaceChild(N,I);N.onblur=J;N.onkeyup=B;N.onkeypress=F;N.focus()};C.onclick=L;I.onclick=L;return H},parse:function(C){var B=C.match(/^(\S+)(.*)$/);if((!B)||B[1].match(/^-+$/)){return null}return[B[1],John.parse("{"+B[2]+"}"),[]]},toExp:function(C){C=C.firstChild;var B=C.childNodes[0].firstChild.nodeValue;var D=C.childNodes[1].firstChild.nodeValue;return[B,John.parse("{"+D+"}"),[]]}}}();function q(z){return JSON.stringify(z)}function t(z){return q(l(z))}function a(A,z){var D="";for(var C=0;C<z;C++){D=D+" "}D=D+A[0];var E=John.sfy(A[1]);if(E!==""){D=D+" "+E}for(var C=0,B=A[2].length;C<B;C++){D=D+"\n"+a(A[2][C],z+1)}return D}function y(z){return a(l(z),0)}function h(A,z){var D="";var E="";for(var C=0;C<z;C++){E=E+" "}D=D+E+A[0];var F=John.sfy(A[1],{ruby:true});if(F!==""){D=D+" "+F}if(A[2].length>0){D=D+" do";for(var C=0,B=A[2].length;C<B;C++){D=D+"\n"+h(A[2][C],z+1)}D=D+"\n"+E+"end"}return D}function j(z){return h(l(z),0)}function o(z){var C=document.createElement(z[0]);for(k in z[1]){C.setAttribute(k,z[1][k])}for(var B=0,A=z[2].length;B<A;B++){C.appendChild(o(z[2][B]))}return C}function i(z){return(new XMLSerializer()).serializeToString(o(l(z)))}function m(A,B){var z=document.createElement("div");z.className="rfe_text";if(B[2].length>0){z.appendChild(document.createTextNode("end"))}A.appendChild(z)}function r(A,C){A=u(A);var z=A.lastChild;var B=v(A,C);A.replaceChild(B,z);A.appendChild(z);if(z.childNodes.length===0){z.appendChild(document.createTextNode("end"))}g(A)}function d(z){z=u(z);var A=z.parentNode;A.removeChild(z);if(A.childNodes.length===2){A.lastChild.removeChild(A.lastChild.firstChild)}document._rfe_clipboard=l(z);g(A)}function v(z,D,A){var C=document.createElement("div");C.className="rfe_expression";if(!A){C.setAttribute("style","margin-left: 14px;")}z.appendChild(C);if(!(D instanceof Array)){renderExpressionString(C,D.toString());return}b.render(C,D);for(var B=0;B<D[2].length;B++){v(C,D[2][B])}m(C,D);return C}function x(z,A){z=u(z);$(z).addClass("rfe_root");while(z.firstChild){z.removeChild(z.firstChild)}v(z,A,true);z.stack=[];z.currentTree=A}function n(z,B){z=u(z);var A=z.parentNode;if(B===-1){if(z.previousSibling.className!="rfe_expression"){return}A.insertBefore(z,z.previousSibling)}else{if(z.nextSibling.className!="rfe_expression"){return}A.insertBefore(z,z.nextSibling.nextSibling)}RuoteFluoEditor.triggerChange(A)}function e(A,B){A=u(A);var z=v(A.parentNode,B);A.parentNode.insertBefore(z,A);RuoteFluoEditor.triggerChange(A.parentNode)}function g(B){var A=f(B);var z=l(A);c(A,z);if(A.onChange){A.onChange(z)}}function c(A,z){A.stack.push(A.currentTree);A.currentTree=z}function w(A){A=u(A);if(A.stack.length<1){return}while(A.firstChild!=null){A.removeChild(A.firstChild)}var z=A.stack.pop();A.currentTree=z;v(A,z,true);if(A.onChange){A.onChange(z)}}function f(z){z=u(z);if($(z).hasClass("rfe_root")){return z}return f(z.parentNode)}function s(D,G,C){if(!G){G=f(D);C=""}if(G===D){return C.substring(1,C.length)}var A=G.childNodes;var B=-1;for(var z=0;z<A.length;z++){var F=A[z];if(F.nodeType!=1){continue}if(F.className!="rfe_expression"){continue}B+=1;var E=s(D,F,C+"_"+B);if(E!=null){return E}}return null}function l(A){var z=$(u(A));z.focus();if(!z.hasClass("rfe_expression")){z=z.children(".rfe_expression").first()}var B=b.toExp(z[0]);z.children(".rfe_expression").each(function(C,D){B[2].push(l(D))});return B}function u(z){if(z.jquery){return z[0]}if((typeof z)!=="string"){return z}if(z.match(/[\.#\[]/)){return $(z)[0]}return document.getElementById(z)}return{TEXTS:p,ExpressionHead:b,render:x,addExpression:r,removeExpression:d,moveExpression:n,insertExpression:e,triggerChange:g,undo:w,asJson:t,asRadial:y,asRuby:j,asXml:i}}();var FluoEditor=RuoteFluoEditor;$.fn.computedStyle=function(){var f=this.get(0);var b;var h={};if(window.getComputedStyle){var d=function(l,i){return i.toUpperCase()};b=window.getComputedStyle(f,null);for(var g=0,e=b.length;g<e;g++){var a=b[g];var j=a.replace(/\-([a-z])/g,d);var c=b.getPropertyValue(a);h[j]=c}return h}if(b=f.currentStyle){for(var a in b){h[a]=b[a]}return h}if(b=f.style){for(var a in b){if(typeof b[a]!="function"){h[a]=b[a]}}return h}return h};var RuoteFluo=(function(){var s="2.3.1";var j=7;var a=4;var l=this;function c(B){var y=["defs",[]];y[1].push(["marker",{id:"arrowhead",viewBox:"0 0 100 100",refX:"90",refY:"50",markerUnits:"strokeWidth",markerWidth:"10",markerHeight:"10",orient:"auto"},[["path",{"class":"fluo",d:"M 0 0 L 100 50 L 0 100 Z"}]]]);var C=["g",{id:"timer"},[["circle",{"class":"fluo",cx:"14",cy:"14",r:"14",fill:"none",stroke:"black","stroke-width":"1"}],["circle",{"class":"fluo",cx:"14",cy:"14",r:"10",fill:"none",stroke:"black","stroke-width":"1"}],["path",{id:"tt","class":"fluo",d:"M 14 05 L 14 07",fill:"none",stroke:"black","stroke-width":"1"}],]];for(var A=0;A<12;A++){var z=(A+1)*30;C[2].push(["use",{"xlink:href":"#tt",transform:"rotate("+z+", 14, 14)"}])}C[2].push(["path",{"class":"fluo",d:"M 14 10 L 14 14",fill:"none",stroke:"black","stroke-width":"1",transform:"rotate(120, 14, 14)"}]);C[2].push(["path",{"class":"fluo",d:"M 14 08 L 14 14",fill:"none",stroke:"black","stroke-width":"1"}]);y[1].push(C);f(B,y)}function q(E,C,y,D,B){C=C||"svg";y=y||{};B=B||{};var z=document.createElementNS("http://www.w3.org/2000/svg",C);Nu.each(y,function(H,G){var I=null;var F=H.match(/^([a-z]+):([a-z-]+)$/);if(F){I=F[1]}if(I==="xlink"){I="http://www.w3.org/1999/xlink"}if(G instanceof Array){G=G.join(" ")}z.setAttributeNS(I,H,G)});var A=$(z);if(D){A.append(document.createTextNode(D))}E[B.prepend?"prepend":"append"](A);if(C==="svg"){c(A)}return A}function f(D,y){var A=y[0];var z=y[1];var B=y[2]||[];if(z instanceof Array){B=z;z={}}var C=q(D,A,z);Nu.each(B,function(E){f(C,E)});return C}function n(C,A,y,B,z){if(A instanceof Array){return f(C,A)}else{return q(C,A,y,B,z)}}function o(y){if(y.width()===0){return g(y).width}else{return y.width()}}function m(y){if(y.height()===0){return g(y).height}else{return y.height()}}function t(y){return Nu.max(Nu.map(y.children(),function(z){return o($(z))}))}function v(y){return Nu.reduce(Nu.map(y.children(),function(z){return m($(z))}),0,function(A,z){return A+z})}function u(B,A){var z=n(B,"g");var C=0;Nu.each(A,function(D){var y=D;var F="";if(D instanceof Array){F=D[0];y=D[1]}var E=n(z,"text",{"class":$.trim("fluo "+F),x:0},y);C=C+m(E);E.attr("y",C)});z._width=t(z);z._height=v(z);return z}function w(z){var y=Nu.inject(z,0,function(A,B){return Nu.max([A,B._width,B._center||0])});Nu.each(z,function(B){var A=(y-B._width)/2;var C=B._center;if(C){A=(y-C)/2}i(B,A,0)})}function x(z){var y=(z.attr("transform")||"").match(/^translate\((\d+(?:\.\d+)?), (\d+(?:\.\d+)?)\)$/);if(!y){return{x:0,y:0}}return{x:parseFloat(y[1]),y:parseFloat(y[2])}}function g(y){var A=y[0].getBBox();var z=x(y);return{x:z.x,y:z.y,width:A.width,height:A.height}}function i(A,z,C){var B=x(A);A.attr("transform","translate("+(B.x+z)+", "+(B.y+C)+")")}function e(F,z,y,D,C,B){var E=null;var A=a;if(!B.bottom){E=["M",z,y,"L",D+(D>z?-1:1)*A,y,"Q",D,y,D,y+A,"L",D,C];if(B.inner){E=["M"].concat(E.slice(4))}}else{E=["M",z,y,"L",z,C-A,"Q",z,C,z+(D>z?1:-1)*A,C,"L",D,C];if(B.inner){E=E.slice(0,11)}}return n(F,"path",{"class":"fluo rounded_path",d:E,fill:"none"})}function b(y){var z=Nu.find(y[1],function(C,B){return(B===null)});if(z){z=z[0]}var A=Nu.select(y[1],function(C,B){return(B!=null)});return[z,A]}function p(K,E,z,C,y){y=y||{};var A=n(K,"g",{"class":"fluo card"});var H=(y.noCard||y.noRect)?null:n(A,"rect",{"class":"fluo"});var M=null;if(y.noCard){M={_height:0,_width:0}}else{var L=b(z);var B=[["expname",z[0]+(L[0]?" "+L[0]:"")]];Nu.each(L[1],function(O,N){B.push(O+": "+N)});M=u(A,B);i(M,a,0)}var I=M._width;if(!y.noCard){I=I+2*a}var D=n(A,"g",{"class":"fluo card_body"});i(D,I,0);var G=C(D);var J=G[0];var F=G[1];A._width=I+J+(H?a:0);A._height=Nu.max([M._height,F]);if(!y["short"]&&!y.noCard){A._height=A._height+2*a}if(H){H.attr("rx",j);H.attr("ry",j);H.attr("width",""+A._width);H.attr("height",""+A._height)}if(y.rightCentered){A._center=(A._width-J/2-a)*2}A._body=D;return A}var h={};h.text=function(A,z,y){var C=JSON.stringify(y[1]).slice(1,-1);var B=n(A,"text",{"class":"fluo text_exp"},$.trim(y[0]+" "+C));B._width=o(B);B._height=m(B)+a;B.attr("y",m(B));return B};h.any=function(A,z,y){return p(A,z,y,function(E){var C=0;var D=a;var B=0;Nu.each(y[2],function(G){var F=d(E,z+"_"+C,G);i(F,0,D);C=C+1;D=D+F._height+a;B=Nu.max([B,F._width])});return[B,D]})};h.sequence=function(B,z,y){var A=Nu.isEmpty(y[1]);return p(B,z,y,function(G){var E=0;var F=A?0:a;var C=0;var D=Nu.map(y[2],function(J){var H=d(G,z+"_"+E,J);i(H,0,F);E=E+1;F=F+H._height;C=Nu.max([C,H._width]);if(E>=y[2].length){return H}var I=n(G,"path",{"class":"fluo",d:"M 0 0 L 0 11","marker-end":"url(#arrowhead)"});i(I,0,F);F=F+11;I._width=o(I);I._height=m(I);return[H,I]});w(Nu.flatten(D));return[C,F]},{noCard:A})};h.concurrence=function(C,A,y){var E=p(C,A,y,function(I){var G=0;var F=0;var H=Nu.map(y[2],function(K){var J=d(I,A+"_"+G,K);i(J,F,a);F=F+J._width+a;G=G+1;return J._height});return[F-a,Nu.max(H)]},{noRect:true,rightCentered:true});var D=o(E._body);var z=0;var B=E._body.children().length;Nu.each(E._body.children(),function(J){z=z+1;var I=$(J);var G=o(I);var H=m(I);var F=x(I).x;e(E._body,D/2-a,0,F+G/2,a,{bottom:false,inner:z>1&&z<B});e(E._body,F+G/2,H+a,D/2-a,E._height,{bottom:true,inner:z>1&&z<B})});return E};h.wait=function(A,z,y){return p(A,z,y,function(B){var C=n(B,"use",{"xlink:href":"#timer"});return[2*a+o(C),m(C)]},{noRect:true,"short":true,rightCentered:true})};h.sleep=h.wait;Nu.each(["set","rset","unset","rewind","continue","back","break","stop","cancel","skip","jump"],function(y){h[y]=h.text});function d(B,A,z){var y=(h[z[0]]||h.any).call(l,B,A,z);y[0].id="exp_"+A;return y}function r(y){if(y.jquery){return y}if((typeof y)!=="string"){return $(y)}if(y.match(/[\.#\[]/)){return $(y)}return $("#"+y)}this.render=function(z,A,y){y=y||{};$div=r(z);$div.empty();$div[0].ruote_fluo_options=y;$div[0].ruote_fluo_definition=A;$g=d(n($div),"0",A);if(y.noOuterBorder){$g.children("rect").remove()}var H=$g._width+3;var E=$g._height+3;var F=H;var C=E;var B=y.width||y.w;var G=y.height||y.h;if(y.fit){F=$div.innerWidth()-8;C=$div.innerHeight()-8}else{if(B){F=B;C=G}}if(y.fit==="down"&&H<F){F=H;C=E}if(F<0||C<0){F=20;C=20}var D=y.preserveAspectRatio||y.par||"xMidYMin meet";$svg=$g.parent();$svg.attr("class",("ruote_fluo "+($svg.attr("class")||"")).trim());$svg[0].setAttributeNS(null,"viewBox","0 0 "+H+" "+E);$svg[0].setAttributeNS(null,"preserveAspectRatio",D);$svg.attr("width",""+F+"px");$svg.attr("height",""+C+"px");$svg.attr("data-ruote-fluo-scale",""+(F/H));return $g};this.highlight=function(E,C){var A=r(E);$("#"+A[0].id+" rect.fluo_highlight").remove();var B=$("#exp_"+C);if(B.length<1){return}var z=g(B);var y=n(B.parent(),"rect",{"class":"fluo_highlight"},null,{prepend:true});var D=parseFloat(y.computedStyle()["stroke-width"]||"3")+1;y.attr({x:z.x-D,y:z.y-D,width:z.width+2*D,height:z.height+2*D,rx:D,ry:D})};this.pin=function(y,B,G,z){G="fluo_pin fluo_pin_"+G;z=z||"wi";var I=r(y);var A=$("#exp_"+B);if(A.length<1){return}var J=g(A);var K=20;var D=10;var E=40;var H=15;var L=n(A.parent(),"g");var F=n(L,"path",{d:["M",0,H,"L",D,E,"L",K,H,"Q",D,0,0,H],"class":G});var C=n(L,"text",{"class":G,x:K/4,y:E/2},z);w([F,C]);i(L,J.x+J.width-18,J.y-20)};this.computeHeight=function(E,B){var z=r(E);var D=z.children("svg")[0].attributes.viewBox.value.split(" ");var y=parseInt(D[2],10);var A=parseInt(D[3],10);var C=y/B;return Math.round(A/C)};return this}).apply({});var Fluo=RuoteFluo;
3
+ /* compressed from commit f4fab37 */
@@ -1,4 +1,4 @@
1
- e
1
+
2
2
  /* layout */
3
3
 
4
4
  * {
@@ -22,8 +22,8 @@ body {
22
22
  }
23
23
  #hlogo {
24
24
  float: left;
25
- margin-top: 33px;
26
- margin-right: 7px;
25
+ margin-top: 17px;
26
+ margin-right: 27px;
27
27
  }
28
28
  #htext {
29
29
  float: left;
@@ -90,7 +90,7 @@ table.list {
90
90
  }
91
91
  table.list td {
92
92
  border: 1px solid #d0d1d3;
93
- padding: 3px;
93
+ padding: 0px 7px;
94
94
  }
95
95
  table.list thead td {
96
96
  text-align: center;
@@ -112,6 +112,9 @@ table.list td.no_padding {
112
112
  padding: 0;
113
113
  margin: 0;
114
114
  }
115
+ table.list.expressions {
116
+ width: auto;
117
+ }
115
118
 
116
119
  table.details {
117
120
  margin-top: 14px;
@@ -203,6 +206,7 @@ table.participants td {
203
206
  border: 0;
204
207
  padding: 0;
205
208
  margin: 0;
209
+ /*padding: 0px 3px;*/
206
210
  }
207
211
  table.participants td:last-child {
208
212
  padding-left: 7px;
@@ -241,9 +245,19 @@ div.trace {
241
245
  cursor: pointer;
242
246
  }
243
247
 
248
+ /* error details */
249
+
250
+ pre.details {
251
+ font-family: "Menlo Regular", "Monaco", courier, monospace;
252
+ font-size: 10px;
253
+ margin-top: 7px;
254
+ margin-bottom: 5px;
255
+ line-height: 11px;
256
+ }
257
+
244
258
  /* overlay */
245
259
 
246
- div#overlay {
260
+ #overlay {
247
261
  position: absolute;
248
262
  top: 0;
249
263
  left: 0;
@@ -256,15 +270,46 @@ div#overlay {
256
270
  z-index: 99;
257
271
  }
258
272
 
273
+ #zoom {
274
+ position: absolute;
275
+ top: 10%;
276
+ left: 10%;
277
+ right: 10%;
278
+ width: 80%;
279
+ /*
280
+ height: auto;
281
+ */
282
+ min-height: 50px;
283
+ background: #ffffff;
284
+ z-index: 999;
285
+ padding: 14px;
286
+ border-radius: 15px;
287
+ -webkit-border-radius: 15px;
288
+ -moz-border-radius: 15px;
289
+ box-shadow: 0 1px 12px #000;
290
+ -webkit-box-shadow: 0 1px 12px #000;
291
+ -moz-box-shadow: 0 1px 12px #000;
292
+ }
293
+
259
294
  /* fluo */
260
295
 
261
296
  #fluo {
297
+ margin: -3px -3px;
262
298
  float: right;
299
+ text-align: center;
300
+ width: auto;
301
+ }
302
+ #exp_fluo {
303
+ margin: -3px -3px;
304
+ float: right;
305
+ text-align: center;
306
+ width: auto;
263
307
  }
308
+ /* TODO: have a fluo_svg or something class instead of this double def */
264
309
 
265
310
  /* editor */
266
311
 
267
- div#editor {
312
+ #editor {
268
313
  position: absolute;
269
314
  top: 10%;
270
315
  left: 10%;
@@ -281,16 +326,41 @@ div#editor {
281
326
  -webkit-box-shadow: 0 1px 12px #000;
282
327
  -moz-box-shadow: 0 1px 12px #000;
283
328
  }
284
- div#fluo_editor {
329
+ #fluo_editor {
285
330
  }
286
- div#editor > a.ruote_go_button {
331
+ /*
332
+ #editor > a.ruote_go_button {
287
333
  margin-left: 4px;
288
334
  }
289
- #efluo {
290
- margin: -3px -3px;
291
- float: right;
335
+ */
336
+
337
+ .editor_buttons {
338
+ margin-top: 1.0em;
339
+ margin-bottom: 0.2em;
340
+ }
341
+ .editor_buttons button.discard {
342
+ margin-left: 0.7em;
292
343
  }
293
344
 
345
+ /* badge a la Bootstrap (keep in the fridge for now) */
346
+ /*
347
+ .ruote_badge {
348
+ -webkit-border-radius: 3px;
349
+ -moz-border-radius: 3px;
350
+ border-radius: 3px;
351
+ display: inline-block;
352
+ padding: 2px 4px;
353
+ font-size: 11.844px;
354
+ font-weight: bold;
355
+ line-height: 14px;
356
+ color: #ffffff;
357
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
358
+ white-space: nowrap;
359
+ vertical-align: baseline;
360
+ background-color: #999999;
361
+ }
362
+ */
363
+
294
364
  /* buttons +-^vx... */
295
365
 
296
366
  a.ruote_button {
@@ -298,7 +368,7 @@ a.ruote_button {
298
368
  margin-right: 1px;
299
369
  width: 12px;
300
370
  height: 12px;
301
- background: transparent url(../images/ruote_buttons.png) no-repeat;
371
+ background: transparent url(../images/ruote-buttons.png) no-repeat;
302
372
  }
303
373
  a.ruote_plus_button {
304
374
  background-position: 0 0;
@@ -1,5 +1,7 @@
1
-
2
- #fluo_editor {
1
+ /* @override http://127.0.0.1:3000/stylesheets/ruote-fluo-editor.css */
2
+ #fluo {
3
+ }
4
+ #editor {
3
5
  font: 14px/1.4em monaco, mono;
4
6
  text-align: left;
5
7
  color: #000;
@@ -48,7 +50,7 @@ a.rfe_button {
48
50
  margin: 0 -1px;
49
51
  width: 12px;
50
52
  height: 12px;
51
- background: transparent url(/_ruote/images/ruote_buttons.png) no-repeat;
53
+ background: transparent url(./ruote-buttons.png) no-repeat;
52
54
  }
53
55
  a.rfe_add {
54
56
  background-position: 0 0;
@@ -85,13 +87,14 @@ a.rfe_paste:hover {
85
87
  font: 14px/1em monaco, mono;
86
88
  border: 0;
87
89
  padding: 0 10px;
88
- padding-top: 1px;
90
+ padding-top: 0px;
89
91
  margin: 0;
90
92
  margin-left: -11px;
91
- margin-bottom: 1px;
93
+ margin-bottom: 0px;
92
94
  width: 400px;
93
95
  background: #86e74c;
94
96
  border-radius: 15px;
97
+ outline: none;
95
98
  -webkit-border-radius: 15px;
96
99
  -moz-border-radius: 15px;
97
100
  }
@@ -102,7 +105,7 @@ img.rfe_button {
102
105
  /* safari */
103
106
  @media screen and (-webkit-min-device-pixel-ratio:0) {
104
107
  .rfe_exp > input[type="text"] {
105
- padding-top: 2px;
108
+ padding-top: 0px;
106
109
  margin-bottom: 0;
107
110
  }
108
111
 
@@ -0,0 +1,62 @@
1
+
2
+ svg.ruote_fluo {
3
+ padding: 10px;
4
+ }
5
+
6
+ svg rect.fluo {
7
+ fill: none;
8
+ stroke: black;
9
+ stroke-width: 1.1px;
10
+ /*
11
+ rx: 14;
12
+ ry: 14;
13
+ */
14
+ }
15
+
16
+ svg path.fluo {
17
+ stroke: black;
18
+ stroke-width: 0.7px;
19
+ }
20
+
21
+ svg text {
22
+ font-family: Helvetica Neue;
23
+ font-size: 12px;
24
+ /*
25
+ fill: blue;
26
+ */
27
+ }
28
+ svg text.text_exp {
29
+ font-size: 14px;
30
+ }
31
+ svg text.expname {
32
+ font-size: 14px;
33
+ font-weight: 500;
34
+ }
35
+
36
+ svg rect.fluo_highlight {
37
+ stroke: #dedede;
38
+ stroke-width: 3px;
39
+ fill: none;
40
+ }
41
+
42
+ p.fluo.expname {
43
+ margin-bottom: 1em;
44
+ }
45
+
46
+ svg path.fluo_pin {
47
+ height: 30px;
48
+ width: 20px;
49
+ stroke: black;
50
+ stroke-width: 0.7px;
51
+ fill: blue;
52
+ }
53
+ svg text.fluo_pin {
54
+ font-size: 12px;
55
+ }
56
+ svg path.fluo_pin_workitem {
57
+ fill: yellow;
58
+ }
59
+ svg path.fluo_pin_error {
60
+ fill: red;
61
+ }
62
+
@@ -15,10 +15,15 @@ class RuoteKit::Application
15
15
 
16
16
  get '/_ruote/errors/:id' do
17
17
 
18
- @error, @errors = fetch_e
18
+ @error, @errors = fetch_err
19
19
 
20
20
  return http_error(404) if @error.nil? && @errors.nil?
21
21
 
22
+ if @error and request.accept.find { |as| as.match(/html/) }
23
+ @process = RuoteKit.engine.process(@error.wfid)
24
+ @pins = [ [ @error.fei.expid, 'error', 'er' ] ]
25
+ end
26
+
22
27
  if @error
23
28
  respond_with :error
24
29
  else
@@ -42,14 +47,14 @@ class RuoteKit::Application
42
47
  RuoteKit.engine.replay_at_error(error)
43
48
 
44
49
  respond_to do |format|
45
- format.html { redirect '/_ruote/errors' }
50
+ format.html { redirect url('/_ruote/errors') }
46
51
  format.json { json :status, :ok }
47
52
  end
48
53
  end
49
54
 
50
55
  protected
51
56
 
52
- def fetch_e
57
+ def fetch_err
53
58
 
54
59
  fei = params[:id].split('!')
55
60
  wfid = fei.last
@@ -5,9 +5,7 @@ class RuoteKit::Application
5
5
 
6
6
  get '/_ruote/expressions/:id' do
7
7
 
8
- @process, @expression, fei = fetch_pe
9
-
10
- return http_error(404) unless @process
8
+ @process, @expression, fei = fetch_pef
11
9
 
12
10
  if fei
13
11
 
@@ -16,15 +14,18 @@ class RuoteKit::Application
16
14
  etag @expression.to_h['_rev']
17
15
 
18
16
  respond_with :expression
17
+
19
18
  else
20
19
 
20
+ return http_error(404) if @process.nil? or @process.expressions.empty?
21
+
21
22
  respond_with :expressions
22
23
  end
23
24
  end
24
25
 
25
26
  delete '/_ruote/expressions/:id' do
26
27
 
27
- process, expression, fei = fetch_pe
28
+ process, expression, fei = fetch_pef
28
29
 
29
30
  return http_error(404) unless expression
30
31
 
@@ -37,45 +38,52 @@ class RuoteKit::Application
37
38
  end
38
39
 
39
40
  respond_to do |format|
40
- format.html { redirect "/_ruote/expressions/#{expression.fei.wfid}" }
41
+ format.html { redirect url("/_ruote/expressions/#{expression.fei.wfid}") }
41
42
  format.json { json :status, :ok }
42
43
  end
43
44
  end
44
45
 
45
46
  put '/_ruote/expressions/:id' do
46
47
 
47
- process, expression, fei = fetch_pe
48
+ process, exp, fei = fetch_pef
48
49
 
49
- return http_error(404) unless expression
50
+ return http_error(404) unless exp
50
51
 
51
- check_if_match_etag(expression.to_h['_rev'])
52
+ check_if_match_etag(exp.to_h['_rev'])
52
53
 
53
54
  info = begin
54
- fetch_re_apply_info
55
+ fetch_expression_put_info
55
56
  rescue Rufus::Json::ParserError => pe
56
57
  return http_error(400, pe)
57
58
  end
58
59
 
59
- #puts '-' * 80
60
- #p params
61
- #p info
62
- #puts '-' * 80
60
+ if state = info['state']
63
61
 
64
- options = {}
65
- options[:fields] = info.fields if info.fields
66
- options[:tree] = info.tree if info.tree
62
+ if state == 'paused'
63
+ RuoteKit.engine.pause(exp.fei, :breakpoint => info['breakpoint'])
64
+ else
65
+ RuoteKit.engine.resume(exp.fei)
66
+ end
67
67
 
68
- RuoteKit.engine.re_apply(expression.fei, options)
68
+ path = Rack::Utils.unescape(request.path_info)
69
+ path = path + '.json' if request.media_type.match(/json/) # :-(
69
70
 
70
- respond_to do |format|
71
- format.html { redirect "/_ruote/expressions/#{expression.fei.wfid}" }
72
- format.json { json :status, :ok }
71
+ redirect(url(path))
72
+
73
+ else
74
+
75
+ RuoteKit.engine.re_apply(exp.fei, info)
76
+
77
+ respond_to do |format|
78
+ format.html { redirect url("/_ruote/expressions/#{exp.fei.wfid}") }
79
+ format.json { json :status, :ok }
80
+ end
73
81
  end
74
82
  end
75
83
 
76
84
  protected
77
85
 
78
- def fetch_pe
86
+ def fetch_pef
79
87
 
80
88
  fei = params[:id].split('!')
81
89
  wfid = fei.last
@@ -91,27 +99,22 @@ class RuoteKit::Application
91
99
  [ process, expression, fei ]
92
100
  end
93
101
 
94
- def fetch_re_apply_info
102
+ def fetch_expression_put_info
95
103
 
96
- if request.content_type == 'application/json' then
104
+ if request.content_type == 'application/json'
97
105
 
98
106
  data = Rufus::Json.decode(request.body.read)
99
- if exp = data['expression']; data = exp; end
100
107
 
101
- OpenStruct.new(data)
108
+ data['expression'] ? data['expression'] : data
102
109
 
103
110
  else
104
111
 
105
- o = OpenStruct.new
106
-
107
- if fields = params[:fields]
108
- o.fields = Rufus::Json.decode(fields)
109
- end
110
- if tree = params[:tree]
111
- o.tree = Rufus::Json.decode(tree)
112
- end
113
-
114
- o
112
+ {
113
+ 'state' => params[:state],
114
+ 'breakpoint' => !!params[:breakpoint],
115
+ :fields => params[:fields] ? Rufus::Json.decode(params[:fields]) : nil,
116
+ :tree => params[:tree] ? Rufus::Json.decode(params[:tree]) : nil
117
+ }
115
118
  end
116
119
  end
117
120
  end