From: Chrysostomos Kolovos Date: Wed, 12 Mar 2014 10:52:32 +0000 (+0200) Subject: Chrysostomos for scheduler X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=e4a88c348fe7f795c77f4a60273856ee1ef4d534;p=unfold.git Chrysostomos for scheduler --- diff --git a/plugins/scheduler/__init__.py b/plugins/scheduler/__init__.py deleted file mode 100644 index caaaa521..00000000 --- a/plugins/scheduler/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -from unfold.plugin import Plugin - -class Scheduler(Plugin): - - # set checkboxes if a final column with checkboxes is desired - # pass columns as the initial set of columns - # if None then this is taken from the query's fields - # latitude,longitude, zoom : the starting point - def __init__ (self, query, query_all_resources, query_lease = None, **settings): - Plugin.__init__ (self, **settings) - self.query=query - self.query_all_resources = query_all_resources - self.query_all_resources_uuid = query_all_resources.query_uuid - self.query_lease = query_lease - self.query_lease_uuid = query_lease.query_uuid if query_lease else None - - def template_file (self): - return "scheduler.html" - - def template_env (self, request): - env={} - return env - - def requirements (self): - reqs = { - 'js_files' : [ "js/scheduler.js", - #"//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js", - "js/raphael.js", - "js/manifold.js", "js/manifold-query.js", - "js/spin-presets.js", "js/spin.min.js", "js/jquery.spin.js", - "js/unfold-helper.js", - "js/jquery-ui-timepicker-addon.js", "js/jquery-ui-sliderAccess.js", - ], - 'css_files' : [ "css/scheduler.css", - "css/jquery-ui-timepicker-addon.css", - ], - } - return reqs - - # the list of things passed to the js plugin - def json_settings_list (self): - return ['plugin_uuid','query_uuid', 'query_lease_uuid', 'query_all_resources_uuid'] diff --git a/plugins/scheduler/static/css/scheduler.css b/plugins/scheduler/static/css/scheduler.css deleted file mode 100644 index fbaede02..00000000 --- a/plugins/scheduler/static/css/scheduler.css +++ /dev/null @@ -1,141 +0,0 @@ -/* - $Id: toggle.css 12435 2009-03-11 15:07:00Z thierry $ - */ - -/* this class is used to store data that needs to get passed to javascript code */ -/* these elements are not meant to be rendered */ -.hidden { - display: none; -} -.center { - text-align: center; -} - -.scrollx { - overflow-x:scroll; - height: 340px; -} -.scrolly { -overflow-y : scroll; -} -/* space around various messages */ -div.my-slice-renewal { - margin: 30px; -} - -/* toggles for the nodes sections */ -div#toggle-container-my-slice-persons-current, -div#toggle-container-my-slice-nodes-current { - background: #f0f0f0; -} - -div#toggle-container-my-slice-persons-add, -div#toggle-container-my-slice-nodes-add { - background: #f0e0e0; -} - -/* the scheduler area */ -div#toggle-container-my-slice-nodes-reserve { - background: #def; -} - -/* where the graphics go */ -div#leases_area { - /* padding: 10px 25px; */ -} - -/* don't display the scheduler data table - not quite sure this works */ -table#leases_data { - display: none; -} - -/* the various controls for the scheduler */ -/* upper section, with selection mode */ -#leases_modes { padding: 10px; text-align: center; color: #333; } - -#leases_buttons { padding: 0px 10px 10px 10px; } -#leases_refresh { position: relative; left: 30%;} -#leases_submit { position: relative; left: 60%; } - - -/* column configuation style */ - -div#toggle-container-my-slice-nodes-configuration { - background: #f8f8f8; -} - -OPTION.out{background-color:white; color:black} -OPTION.in{background-color:#CAE8EA; color:#4f6b72} - -div.out{background-color:white; color:black} -div.in{background-color:#CAE8EA; color:#4f6b72} -div.selected{background-color:gray; color:black} -div.invisible{display:none} - -div.toggle-info { - padding: 10px 20px; - background-color: #cae8ea; - margin: 10px 10px; - -} - -div#scrolldiv { - border : solid 2px grey; - padding:4px; - width:300px; - height:180px; - overflow:auto; -} - -th,td.top { - vertical-align: top; - text-align: left; - padding:10px; -} - -td.smallright { - text-align: right; - width:20px; -} - -table.center { - margin-left:auto; - margin-right:auto; -} - -table.columnlist { - width:280px; -} - -td.header { - background-color: #CAE8EA; - text-align: center; - width:30px; -} - -span.header { - font-weight: bold; - color: #3399CC; -} - -a.source-url{ - font-weight: bold; -} - -span.gray{ - color: #555555; -} - -span.short { - height:10px; -} - -span.column-title { - font-size: 12px; - font-weight: bold; -} - -span.column-detail { - font-size: 11px; - font-style: italic; -} diff --git a/plugins/scheduler/static/js/raphael-1.5.2.js b/plugins/scheduler/static/js/raphael-1.5.2.js deleted file mode 100644 index e5e71261..00000000 --- a/plugins/scheduler/static/js/raphael-1.5.2.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Raphael 1.5.2 - JavaScript Vector Library - * - * Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com) - * Licensed under the MIT (http://raphaeljs.com/license.html) license. - */ -(function(){function a(){if(a.is(arguments[0],G)){var b=arguments[0],d=bV[m](a,b.splice(0,3+a.is(b[0],E))),e=d.set();for(var g=0,h=b[w];g";bg=bf.firstChild;bg.style.behavior="url(#default#VML)";if(!(bg&&typeof bg.adj=="object"))return a.type=null;bf=null}a.svg=!(a.vml=a.type=="VML");j[e]=a[e];k=j[e];a._id=0;a._oid=0;a.fn={};a.is=function(a,b){b=x.call(b);if(b=="finite")return!O[f](+a);return b=="null"&&a===null||b==typeof a||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||J.call(a).slice(8,-1).toLowerCase()==b};a.angle=function(b,c,d,e,f,g){{if(f==null){var h=b-d,i=c-e;if(!h&&!i)return 0;return((h<0)*180+y.atan(-i/-h)*180/D+360)%360}return a.angle(b,c,f,g)-a.angle(d,e,f,g)}};a.rad=function(a){return a%360*D/180};a.deg=function(a){return a*180/D%360};a.snapTo=function(b,c,d){d=a.is(d,"finite")?d:10;if(a.is(b,G)){var e=b.length;while(e--)if(B(b[e]-c)<=d)return b[e]}else{b=+b;var f=c%b;if(fb-d)return c-f+b}return c};function bh(){var a=[],b=0;for(;b<32;b++)a[b]=(~(~(y.random()*16)))[H](16);a[12]=4;a[16]=(a[16]&3|8)[H](16);return"r-"+a[v]("")}a.setWindow=function(a){h=a;g=h.document};var bi=function(b){if(a.vml){var c=/^\s+|\s+$/g,d;try{var e=new ActiveXObject("htmlfile");e.write("");e.close();d=e.body}catch(a){d=createPopup().document.body}var f=d.createTextRange();bi=bm(function(a){try{d.style.color=r(a)[Y](c,p);var b=f.queryCommandValue("ForeColor");b=(b&255)<<16|b&65280|(b&16711680)>>>16;return"#"+("000000"+b[H](16)).slice(-6)}catch(a){return"none"}})}else{var h=g.createElement("i");h.title="Raphaël Colour Picker";h.style.display="none";g.body[l](h);bi=bm(function(a){h.style.color=a;return g.defaultView.getComputedStyle(h,p).getPropertyValue("color")})}return bi(b)},bj=function(){return"hsb("+[this.h,this.s,this.b]+")"},bk=function(){return"hsl("+[this.h,this.s,this.l]+")"},bl=function(){return this.hex};a.hsb2rgb=function(b,c,d,e){if(a.is(b,"object")&&"h"in b&&"s"in b&&"b"in b){d=b.b;c=b.s;b=b.h;e=b.o}return a.hsl2rgb(b,c,d/2,e)};a.hsl2rgb=function(b,c,d,e){if(a.is(b,"object")&&"h"in b&&"s"in b&&"l"in b){d=b.l;c=b.s;b=b.h}if(b>1||c>1||d>1){b/=360;c/=100;d/=100}var f={},g=["r","g","b"],h,i,j,k,l,m;if(c){d<0.5?h=d*(1+c):h=d+c-d*c;i=2*d-h;for(var n=0;n<3;n++){j=b+1/3*-(n-1);j<0&&j++;j>1&&j--;j*6<1?f[g[n]]=i+(h-i)*6*j:j*2<1?f[g[n]]=h:j*3<2?f[g[n]]=i+(h-i)*(2/3-j)*6:f[g[n]]=i}}else f={r:d,g:d,b:d};f.r*=255;f.g*=255;f.b*=255;f.hex="#"+(16777216|f.b|f.g<<8|f.r<<16).toString(16).slice(1);a.is(e,"finite")&&(f.opacity=e);f.toString=bl;return f};a.rgb2hsb=function(b,c,d){if(c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b){d=b.b;c=b.g;b=b.r}if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r;c=e.g;d=e.b}if(b>1||c>1||d>1){b/=255;c/=255;d/=255}var f=z(b,c,d),g=A(b,c,d),h,i,j=f;{if(g==f)return{h:0,s:0,b:f,toString:bj};var k=f-g;i=k/f;b==f?h=(c-d)/k:c==f?h=2+(d-b)/k:h=4+(b-c)/k;h/=6;h<0&&h++;h>1&&h--}return{h:h,s:i,b:j,toString:bj}};a.rgb2hsl=function(b,c,d){if(c==null&&a.is(b,"object")&&"r"in b&&"g"in b&&"b"in b){d=b.b;c=b.g;b=b.r}if(c==null&&a.is(b,F)){var e=a.getRGB(b);b=e.r;c=e.g;d=e.b}if(b>1||c>1||d>1){b/=255;c/=255;d/=255}var f=z(b,c,d),g=A(b,c,d),h,i,j=(f+g)/2,k;if(g==f)k={h:0,s:0,l:j};else{var l=f-g;i=j<0.5?l/(f+g):l/(2-f-g);b==f?h=(c-d)/l:c==f?h=2+(d-b)/l:h=4+(b-c)/l;h/=6;h<0&&h++;h>1&&h--;k={h:h,s:i,l:j}}k.toString=bk;return k};a._path2string=function(){return this.join(",")[Y](ba,"$1")};function bm(a,b,c){function d(){var g=Array[e].slice.call(arguments,0),h=g[v]("►"),i=d.cache=d.cache||{},j=d.count=d.count||[];if(i[f](h))return c?c(i[h]):i[h];j[w]>=1000&&delete i[j.shift()];j[L](h);i[h]=a[m](b,g);return c?c(i[h]):i[h]}return d}a.getRGB=bm(function(b){if(!b||!(!((b=r(b)).indexOf("-")+1)))return{r:-1,g:-1,b:-1,hex:"none",error:1};if(b=="none")return{r:-1,g:-1,b:-1,hex:"none"};!(_[f](b.toLowerCase().substring(0,2))||b.charAt()=="#")&&(b=bi(b));var c,d,e,g,h,i,j,k=b.match(N);if(k){if(k[2]){g=T(k[2].substring(5),16);e=T(k[2].substring(3,5),16);d=T(k[2].substring(1,3),16)}if(k[3]){g=T((i=k[3].charAt(3))+i,16);e=T((i=k[3].charAt(2))+i,16);d=T((i=k[3].charAt(1))+i,16)}if(k[4]){j=k[4][s]($);d=S(j[0]);j[0].slice(-1)=="%"&&(d*=2.55);e=S(j[1]);j[1].slice(-1)=="%"&&(e*=2.55);g=S(j[2]);j[2].slice(-1)=="%"&&(g*=2.55);k[1].toLowerCase().slice(0,4)=="rgba"&&(h=S(j[3]));j[3]&&j[3].slice(-1)=="%"&&(h/=100)}if(k[5]){j=k[5][s]($);d=S(j[0]);j[0].slice(-1)=="%"&&(d*=2.55);e=S(j[1]);j[1].slice(-1)=="%"&&(e*=2.55);g=S(j[2]);j[2].slice(-1)=="%"&&(g*=2.55);(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360);k[1].toLowerCase().slice(0,4)=="hsba"&&(h=S(j[3]));j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsb2rgb(d,e,g,h)}if(k[6]){j=k[6][s]($);d=S(j[0]);j[0].slice(-1)=="%"&&(d*=2.55);e=S(j[1]);j[1].slice(-1)=="%"&&(e*=2.55);g=S(j[2]);j[2].slice(-1)=="%"&&(g*=2.55);(j[0].slice(-3)=="deg"||j[0].slice(-1)=="°")&&(d/=360);k[1].toLowerCase().slice(0,4)=="hsla"&&(h=S(j[3]));j[3]&&j[3].slice(-1)=="%"&&(h/=100);return a.hsl2rgb(d,e,g,h)}k={r:d,g:e,b:g};k.hex="#"+(16777216|g|e<<8|d<<16).toString(16).slice(1);a.is(h,"finite")&&(k.opacity=h);return k}return{r:-1,g:-1,b:-1,hex:"none",error:1}},a);a.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||0.75},c=this.hsb2rgb(b.h,b.s,b.b);b.h+=0.075;if(b.h>1){b.h=0;b.s-=0.2;b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})}return c.hex};a.getColor.reset=function(){delete this.start};a.parsePathString=bm(function(b){if(!b)return null;var c={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},d=[];a.is(b,G)&&a.is(b[0],G)&&(d=bo(b));d[w]||r(b)[Y](bb,function(a,b,e){var f=[],g=x.call(b);e[Y](bc,function(a,b){b&&f[L](+b)});if(g=="m"&&f[w]>2){d[L]([b][n](f.splice(0,2)));g="l";b=b=="m"?"l":"L"}while(f[w]>=c[g]){d[L]([b][n](f.splice(0,c[g])));if(!c[g])break}});d[H]=a._path2string;return d});a.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=C(j,3)*a+C(j,2)*3*i*c+j*3*i*i*e+C(i,3)*g,l=C(j,3)*b+C(j,2)*3*i*d+j*3*i*i*f+C(i,3)*h,m=a+2*i*(c-a)+i*i*(e-2*c+a),n=b+2*i*(d-b)+i*i*(f-2*d+b),o=c+2*i*(e-c)+i*i*(g-2*e+c),p=d+2*i*(f-d)+i*i*(h-2*f+d),q=(1-i)*a+i*c,r=(1-i)*b+i*d,s=(1-i)*e+i*g,t=(1-i)*f+i*h,u=90-y.atan((m-o)/(n-p))*180/D;(m>o||n1){x=y.sqrt(x);c=x*c;d=x*d}var z=c*c,A=d*d,C=(f==g?-1:1)*y.sqrt(B((z*A-z*u*u-A*t*t)/(z*u*u+A*t*t))),E=C*c*u/d+(a+h)/2,F=C*-d*t/c+(b+i)/2,G=y.asin(((b-F)/d).toFixed(9)),H=y.asin(((i-F)/d).toFixed(9));G=aH&&(G=G-D*2);!g&&H>G&&(H=H-D*2)}var I=H-G;if(B(I)>k){var J=H,K=h,L=i;H=G+k*(g&&H>G?1:-1);h=E+c*y.cos(H);i=F+d*y.sin(H);m=bt(h,i,c,d,e,0,g,K,L,[H,J,E,F])}I=H-G;var M=y.cos(G),N=y.sin(G),O=y.cos(H),P=y.sin(H),Q=y.tan(I/4),R=4/3*c*Q,S=4/3*d*Q,T=[a,b],U=[a+R*N,b-S*M],V=[h+R*P,i-S*O],W=[h,i];U[0]=2*T[0]-U[0];U[1]=2*T[1]-U[1];{if(j)return[U,V,W][n](m);m=[U,V,W][n](m)[v]()[s](",");var X=[];for(var Y=0,Z=m[w];Y"1e12"&&(l=0.5);B(n)>"1e12"&&(n=0.5);if(l>0&&l<1){q=bu(a,b,c,d,e,f,g,h,l);p[L](q.x);o[L](q.y)}if(n>0&&n<1){q=bu(a,b,c,d,e,f,g,h,n);p[L](q.x);o[L](q.y)}i=f-2*d+b-(h-2*f+d);j=2*(d-b)-2*(f-d);k=b-d;l=(-j+y.sqrt(j*j-4*i*k))/2/i;n=(-j-y.sqrt(j*j-4*i*k))/2/i;B(l)>"1e12"&&(l=0.5);B(n)>"1e12"&&(n=0.5);if(l>0&&l<1){q=bu(a,b,c,d,e,f,g,h,l);p[L](q.x);o[L](q.y)}if(n>0&&n<1){q=bu(a,b,c,d,e,f,g,h,n);p[L](q.x);o[L](q.y)}return{min:{x:A[m](0,p),y:A[m](0,o)},max:{x:z[m](0,p),y:z[m](0,o)}}}),bw=bm(function(a,b){var c=bq(a),d=b&&bq(b),e={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case"M":b.X=a[1];b.Y=a[2];break;case"A":a=["C"][n](bt[m](0,[b.x,b.y][n](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x));d=b.y+(b.y-(b.by||b.y));a=["C",c,d][n](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x));b.qy=b.y+(b.y-(b.qy||b.y));a=["C"][n](bs(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1];b.qy=a[2];a=["C"][n](bs(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][n](br(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][n](br(b.x,b.y,a[1],b.y));break;case"V":a=["C"][n](br(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][n](br(b.x,b.y,b.X,b.Y));break}return a},h=function(a,b){if(a[b][w]>7){a[b].shift();var e=a[b];while(e[w])a.splice(b++,0,["C"][n](e.splice(0,6)));a.splice(b,1);k=z(c[w],d&&d[w]||0)}},i=function(a,b,e,f,g){if(a&&b&&a[g][0]=="M"&&b[g][0]!="M"){b.splice(g,0,["M",f.x,f.y]);e.bx=0;e.by=0;e.x=a[g][1];e.y=a[g][2];k=z(c[w],d&&d[w]||0)}};for(var j=0,k=z(c[w],d&&d[w]||0);j0.5)*2-1;C(e-0.5,2)+C(f-0.5,2)>0.25&&(f=y.sqrt(0.25-C(e-0.5,2))*g+0.5)&&f!=0.5&&(f=f.toFixed(5)-0.00001*g)}return p});b=b[s](/\s*\-\s*/);if(d=="linear"){var i=b.shift();i=-S(i);if(isNaN(i))return null;var j=[0,0,y.cos(i*D/180),y.sin(i*D/180)],k=1/(z(B(j[2]),B(j[3]))||1);j[2]*=k;j[3]*=k;if(j[2]<0){j[0]=-j[2];j[2]=0}if(j[3]<0){j[1]=-j[3];j[3]=0}}var m=bx(b);if(!m)return null;var n=a.getAttribute(I);n=n.match(/^url\(#(.*)\)$/);n&&c.defs.removeChild(g.getElementById(n[1]));var o=bG(d+"Gradient");o.id=bh();bG(o,d=="radial"?{fx:e,fy:f}:{x1:j[0],y1:j[1],x2:j[2],y2:j[3]});c.defs[l](o);for(var q=0,t=m[w];q1?G.opacity/100:G.opacity});case"stroke":G=a.getRGB(o);h[R](n,G.hex);n=="stroke"&&G[f]("opacity")&&bG(h,{"stroke-opacity":G.opacity>1?G.opacity/100:G.opacity});break;case"gradient":(({circle:1,ellipse:1})[f](c.type)||r(o).charAt()!="r")&&bI(h,o,c.paper);break;case"opacity":i.gradient&&!i[f]("stroke-opacity")&&bG(h,{"stroke-opacity":o>1?o/100:o});case"fill-opacity":if(i.gradient){var H=g.getElementById(h.getAttribute(I)[Y](/^url\(#|\)$/g,p));if(H){var J=H.getElementsByTagName("stop");J[J[w]-1][R]("stop-opacity",o)}break}default:n=="font-size"&&(o=T(o,10)+"px");var K=n[Y](/(\-.)/g,function(a){return V.call(a.substring(1))});h.style[K]=o;h[R](n,o);break}}}bM(c,d);m?c.rotate(m.join(q)):S(j)&&c.rotate(j,true)},bL=1.2,bM=function(b,c){if(b.type!="text"||!(c[f]("text")||c[f]("font")||c[f]("font-size")||c[f]("x")||c[f]("y")))return;var d=b.attrs,e=b.node,h=e.firstChild?T(g.defaultView.getComputedStyle(e.firstChild,p).getPropertyValue("font-size"),10):10;if(c[f]("text")){d.text=c.text;while(e.firstChild)e.removeChild(e.firstChild);var i=r(c.text)[s]("\n");for(var j=0,k=i[w];jb.height&&(b.height=e.y+e.height-b.y);e.x+e.width-b.x>b.width&&(b.width=e.x+e.width-b.x)}}a&&this.hide();return b};bN[e].attr=function(b,c){if(this.removed)return this;if(b==null){var d={};for(var e in this.attrs)this.attrs[f](e)&&(d[e]=this.attrs[e]);this._.rt.deg&&(d.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(d.scale=this.scale());d.gradient&&d.fill=="none"&&(d.fill=d.gradient)&&delete d.gradient;return d}if(c==null&&a.is(b,F)){if(b=="translation")return cz.call(this);if(b=="rotation")return this.rotate();if(b=="scale")return this.scale();if(b==I&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[b]}if(c==null&&a.is(b,G)){var g={};for(var h=0,i=b.length;h"));m.W=h.w=m.paper.span.offsetWidth;m.H=h.h=m.paper.span.offsetHeight;m.X=h.x;m.Y=h.y+Q(m.H/2);switch(h["text-anchor"]){case"start":m.node.style["v-text-align"]="left";m.bbx=Q(m.W/2);break;case"end":m.node.style["v-text-align"]="right";m.bbx=-Q(m.W/2);break;default:m.node.style["v-text-align"]="center";break}}};bI=function(a,b){a.attrs=a.attrs||{};var c=a.attrs,d,e="linear",f=".5 .5";a.attrs.gradient=b;b=r(b)[Y](bd,function(a,b,c){e="radial";if(b&&c){b=S(b);c=S(c);C(b-0.5,2)+C(c-0.5,2)>0.25&&(c=y.sqrt(0.25-C(b-0.5,2))*((c>0.5)*2-1)+0.5);f=b+q+c}return p});b=b[s](/\s*\-\s*/);if(e=="linear"){var g=b.shift();g=-S(g);if(isNaN(g))return null}var h=bx(b);if(!h)return null;a=a.shape||a.node;d=a.getElementsByTagName(I)[0]||cd(I);!d.parentNode&&a.appendChild(d);if(h[w]){d.on=true;d.method="none";d.color=h[0].color;d.color2=h[h[w]-1].color;var i=[];for(var j=0,k=h[w];j")}}catch(a){cd=function(a){return g.createElement("<"+a+" xmlns=\"urn:schemas-microsoft.com:vml\" class=\"rvml\">")}}bV=function(){var b=by[m](0,arguments),c=b.container,d=b.height,e,f=b.width,h=b.x,i=b.y;if(!c)throw new Error("VML container not found.");var k=new j,n=k.canvas=g.createElement("div"),o=n.style;h=h||0;i=i||0;f=f||512;d=d||342;f==+f&&(f+="px");d==+d&&(d+="px");k.width=1000;k.height=1000;k.coordsize=b_*1000+q+b_*1000;k.coordorigin="0 0";k.span=g.createElement("span");k.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";n[l](k.span);o.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",f,d);if(c==1){g.body[l](n);o.left=h+"px";o.top=i+"px";o.position="absolute"}else c.firstChild?c.insertBefore(n,c.firstChild):c[l](n);bz.call(k,k,a.fn);return k};k.clear=function(){this.canvas.innerHTML=p;this.span=g.createElement("span");this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";this.canvas[l](this.span);this.bottom=this.top=null};k.remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=bF(a);return true}}var ce=navigator.userAgent.match(/Version\\x2f(.*?)\s/);navigator.vendor=="Apple Computer, Inc."&&(ce&&ce[1]<4||navigator.platform.slice(0,2)=="iP")?k.safari=function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});h.setTimeout(function(){a.remove()})}:k.safari=function(){};var cf=function(){this.returnValue=false},cg=function(){return this.originalEvent.preventDefault()},ch=function(){this.cancelBubble=true},ci=function(){return this.originalEvent.stopPropagation()},cj=(function(){{if(g.addEventListener)return function(a,b,c,d){var e=o&&u[b]?u[b]:b,g=function(e){if(o&&u[f](b))for(var g=0,h=e.targetTouches&&e.targetTouches.length;g1&&(a=Array[e].splice.call(arguments,0,arguments[w]));return new cC(a)};k.setSize=bU;k.top=k.bottom=null;k.raphael=a;function co(){return this.x+q+this.y}bO.resetScale=function(){if(this.removed)return this;this._.sx=1;this._.sy=1;this.attrs.scale="1 1"};bO.scale=function(a,b,c,d){if(this.removed)return this;if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:co};b=b||a;!(+b)&&(b=a);var e,f,g,h,i=this.attrs;if(a!=0){var j=this.getBBox(),k=j.x+j.width/2,l=j.y+j.height/2,m=B(a/this._.sx),o=B(b/this._.sy);c=+c||c==0?c:k;d=+d||d==0?d:l;var r=this._.sx>0,s=this._.sy>0,t=~(~(a/B(a))),u=~(~(b/B(b))),x=m*t,y=o*u,z=this.node.style,A=c+B(k-c)*x*(k>c==r?1:-1),C=d+B(l-d)*y*(l>d==s?1:-1),D=a*t>b*u?o:m;switch(this.type){case"rect":case"image":var E=i.width*m,F=i.height*o;this.attr({height:F,r:i.r*D,width:E,x:A-E/2,y:C-F/2});break;case"circle":case"ellipse":this.attr({rx:i.rx*m,ry:i.ry*o,r:i.r*D,cx:A,cy:C});break;case"text":this.attr({x:A,y:C});break;case"path":var G=bp(i.path),H=true,I=r?x:m,J=s?y:o;for(var K=0,L=G[w];Kr)p=n.data[r*l];else{p=a.findDotsAtSegment(b,c,d,e,f,g,h,i,r/l);n.data[r]=p}r&&(k+=C(C(o.x-p.x,2)+C(o.y-p.y,2),0.5));if(j!=null&&k>=j)return p;o=p}if(j==null)return k},cr=function(b,c){return function(d,e,f){d=bw(d);var g,h,i,j,k="",l={},m,n=0;for(var o=0,p=d.length;oe){if(c&&!l.start){m=cq(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);k+=["C",m.start.x,m.start.y,m.m.x,m.m.y,m.x,m.y];if(f)return k;l.start=k;k=["M",m.x,m.y+"C",m.n.x,m.n.y,m.end.x,m.end.y,i[5],i[6]][v]();n+=j;g=+i[5];h=+i[6];continue}if(!b&&!c){m=cq(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n);return{x:m.x,y:m.y,alpha:m.alpha}}}n+=j;g=+i[5];h=+i[6]}k+=i}l.end=k;m=b?n:c?l:a.findDotsAtSegment(g,h,i[1],i[2],i[3],i[4],i[5],i[6],1);m.alpha&&(m={x:m.x,y:m.y,alpha:m.alpha});return m}},cs=cr(1),ct=cr(),cu=cr(0,1);bO.getTotalLength=function(){if(this.type!="path")return;if(this.node.getTotalLength)return this.node.getTotalLength();return cs(this.attrs.path)};bO.getPointAtLength=function(a){if(this.type!="path")return;return ct(this.attrs.path,a)};bO.getSubpath=function(a,b){if(this.type!="path")return;if(B(this.getTotalLength()-b)<"1e-6")return cu(this.attrs.path,a).end;var c=cu(this.attrs.path,b,1);return a?cu(c,a).end:c};a.easing_formulas={linear:function(a){return a},"<":function(a){return C(a,3)},">":function(a){return C(a-1,3)+1},"<>":function(a){a=a*2;if(a<1)return C(a,3)/2;a-=2;return(C(a,3)+2)/2},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a=a-1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){if(a==0||a==1)return a;var b=0.3,c=b/4;return C(2,-10*a)*y.sin((a-c)*(2*D)/b)+1},bounce:function(a){var b=7.5625,c=2.75,d;if(a<1/c)d=b*a*a;else if(a<2/c){a-=1.5/c;d=b*a*a+0.75}else if(a<2.5/c){a-=2.25/c;d=b*a*a+0.9375}else{a-=2.625/c;d=b*a*a+0.984375}return d}};var cv=[],cw=function(){var b=+(new Date);for(var c=0;cd)return d;while(cf?c=e:d=e;e=(d-c)/2+c}return e}return n(a,1/(200*f))}bO.onAnimation=function(a){this._run=a||0;return this};bO.animate=function(c,d,e,g){var h=this;h.timeouts=h.timeouts||[];if(a.is(e,"function")||!e)g=e||null;if(h.removed){g&&g.call(h);return h}var i={},j={},k=false,l={};for(var m in c)if(c[f](m)){if(X[f](m)||h.paper.customAttributes[f](m)){k=true;i[m]=h.attr(m);i[m]==null&&(i[m]=W[m]);j[m]=c[m];switch(X[m]){case"along":var n=cs(c[m]),o=ct(c[m],n*!(!c.back)),p=h.getBBox();l[m]=n/d;l.tx=p.x;l.ty=p.y;l.sx=o.x;l.sy=o.y;j.rot=c.rot;j.back=c.back;j.len=n;c.rot&&(l.r=S(h.rotate())||0);break;case E:l[m]=(j[m]-i[m])/d;break;case"colour":i[m]=a.getRGB(i[m]);var q=a.getRGB(j[m]);l[m]={r:(q.r-i[m].r)/d,g:(q.g-i[m].g)/d,b:(q.b-i[m].b)/d};break;case"path":var t=bw(i[m],j[m]);i[m]=t[0];var u=t[1];l[m]=[];for(var v=0,x=i[m][w];v= lease[1]) && (timestamp < (lease[1] + lease[2] * 1800)))) { - result = lease; - return false; // stop each - } - }); - -/* - $.each(Array(scheduler.myLeases, scheduler.allLeases), function(i, array) { - $.each(array, function(i, lease) { - if (lease[0] == urn) { - if ((timestamp >= lease[1]) && (timestamp < (lease[1] + lease[2] * 1800))) { - result = lease; - - return false; - } - } - }); - if (result) - return false; - }); -*/ - return result; - }, - - /* Iterative search through raphael.js objects, no forEach, no getById in the current version */ - _lease_element_find: function(urn, start_time) - { - var date = new Date(start_time*1000); - var pos = this._paper.top; - while (pos) { - if (pos.key == urn + "-" + date) - return pos; - pos = pos.prev; - } - return null; - }, - - /** - * @brief Draw - */ - _draw: function() - { - var canvas_id = this._canvas_id; - var o = this.options; - - var total_width = o.x_nodelabel + this.nb_grains() * this.options.leases_w; - var total_height = 2 * o.y_header /* the timelabels */ - + 2 * o.y_sep /* extra space */ - + o.y_node /* all-nodes & timebuttons row */ - + (this._resources.length) * (o.y_node + o.y_sep); /* the regular nodes and preceding space */ - - /* reuse for paper if exists with same size, or (re-)create otherwise */ - var paper; - if (this._paper == null) { - paper = Raphael (canvas_id, total_width + o.x_sep, total_height); - } else if (this._paper.width==total_width && this._paper.height==total_height) { - paper=this._paper; - paper.clear(); - } else { - $("#"+canvas_id)[0].innerHTML=""; - //this.elmt().html(); - paper = Raphael (canvas_id, total_width + o.x_sep, total_height); - } - this._paper = paper; - - /* the path for the triangle-shaped buttons */ - var timebutton_path = "M1,0L"+(this.options.leases_w-1)+",0L"+(this.options.leases_w/2)+","+o.y_header+"L1,0"; - - var axisx = this._axisx; - var axisy = this._resources; - - /* maintain the list of nodelabels for the 'all nodes' button */ - this._nodelabels = []; - - - /* create the time slots legend */ - var top = 0; - var left = o.x_nodelabel; - - var daymarker_height = 2*o.y_header + 2*o.y_sep + (axisy.length + 1) * (o.y_node + o.y_sep); - var daymarker_path = "M0,0L0," + daymarker_height; - - var half_daymarker_off= 2*o.y_header + o.y_sep; - var half_daymarker_path="M0," + half_daymarker_off + "L0," + daymarker_height; - - var col=0; - for (var i=0, len = axisx.length; i < len; ++i) { - /* pick the printable part */ - var timelabel = axisx[i][1]; - var y = top + o.y_header; - if (col % 2 == 0) - y += o.y_header; - col +=1; - /* display time label */ - var timelabel = paper.text(left, y, timelabel).attr(txt_timelabel).attr({"text-anchor": "middle"}); - /* draw vertical line */ - var path_spec = "M" + left + " " + (y+o.y_header / 2) + "L" + left + " " + this.total_height; - var rule = paper.path(path_spec).attr(attr_rules); - /* show a day marker when relevant */ - var timestamp = parseInt(axisx[i][0]); - if ((timestamp % (24 * 3600)) == 0) { - paper.path(daymarker_path).attr({'translation': left + ',' + top}).attr(attr_daymarker); - } else if ( (timestamp%(12*3600))==0) { - paper.path(half_daymarker_path).attr({'translation': left + ',' + top}).attr(attr_daymarker); - } - left += o.leases_w; - } - - ////////// the row with the timeslot buttons (the one labeled 'All nodes') - this.granularity = this.min_granularity; // XXX axisx[1][0]-axisx[0][0]; - - // move two lines down - top += 2 * o.y_header + 2 * o.y_sep; - left = o.x_nodelabel; - // all nodes buttons - var allnodes = paper.text(o.x_nodelabel - o.x_sep, top + o.y_node / 2, "All nodes").attr(txt_allnodes) - .attr({"font-size": o.y_node, "text-anchor": "end", "baseline": "bottom"}); - //allnodes.scheduler = this; - allnodes.click(this._allnodes_click); // XXX click - - // timeslot buttons [it's the triangles above the slots] - for (var i = 0, len = axisx.length; i < len; ++i) { - var timebutton = paper.path(timebutton_path).attr({'translation':left + ',' + top}).attr(attr_timebutton); - timebutton.from_time = axisx[i][0]; - timebutton.scheduler = this; - timebutton.click(this._timebutton_click); - left += (o.leases_w); - } - - //////// the body of the scheduler : loop on nodes - top += o.y_node + o.y_sep; - - var data_index = 0; - this.leases = []; /* XXX ??? XXX */ - - for (var i = 0, len = axisy.length; i < len; ++i) { - var urn = axisy[i][0]; - var nodename = axisy[i][1]; - var type = axisy[i][2]; - left = 0; - /* - * MODIFIED font-size - var nodelabel = paper.text(o.x_nodelabel-x_sep,top+y_node/2,nodename).attr(txt_nodelabel) - .attr ({"font-size":y_node, "text-anchor":"end","baseline":"bottom"}); - */ - var nodelabel = paper.text(o.x_nodelabel - o.x_sep, top + o.y_node / 3, nodename).attr(txt_nodelabel) - .attr({"font-size": "12px", "text-anchor": "end","baseline": "bottom"}); - - this._nodelabel_select(nodelabel, 1); // By default we select all nodes - nodelabel.scheduler = this; - nodelabel.click(this._nodelabel_click); //click action works here - this._nodelabels.push(nodelabel); - - // lease_methods.init_free(nodelabel.click, lease_methods.click_mine); - //lease_methods.init_free(nodelabel.lease); - - left += o.x_nodelabel; - - // data index contains the full array of leases - // not the same amount of grains per node - - // NOTE: remembering the previous lease might help for long leases. - var grain=0; - while (grain < this.nb_grains()) { - - if (l = this._lease_find(urn, this._initial_timestamp + grain * 1800)) { - slicename = l.slice_id; - } else { - slicename = ""; - } - - //lease_id = this.data[data_index][0]; - //slicename = this.data[data_index][1]; - /* Duration should not be the lease duration, but the grain */ - var duration = 1; // this.data[data_index][2]; - - var lease = paper.rect(left, top, o.leases_w * duration, o.y_node, o.radius); - lease.scheduler = this; // we record a pointer to the scheduler in the lease element - //lease.lease_id=lease_id; - lease.nodename = nodename; - lease.urn = urn; - lease.nodelabel = nodelabel; - - if (slicename == "") { - lease.initial = "free"; - this._lease_init_free(lease); - } else if (slicename == o.slicename) { - lease.initial = "mine"; - this._lease_init_mine(lease); - } else { - lease.initial = "other"; - this._lease_init_other(lease, slicename); - } - - lease.from_time = axisx[grain % this.nb_grains()][0]; - grain += duration; - lease.until_time = axisx[grain % this.nb_grains()][0]; - - /* We set a key to the lease element to find it later in the paper thanks to this._lease_element_find() */ - lease.key = urn + '-' + lease.from_time; - - // and vice versa - this._lease_elements.push(lease); - // move on with the loop - left += o.leases_w * duration; - data_index += 1; - } - top += o.y_node + o.y_sep; - }; - }, /* _draw */ - - _init_axisx: function(currentDate) - { - this._axisx = Array(); - - if(currentDate == "") { - // creating timestamp of the current time - currentDate = new Date().getTime() / 1000; - } - this._initial_timestamp = currentDate; - //console.log(currentDate); - - // round it by granularity (becomes an Int) - var rounded = Math.round(currentDate / this.min_granularity) * this.min_granularity; - // Convert Int to Date - rounded = new Date(rounded * 1000); - // get hours and minutes in a 24h format 00:00 - var roundedHours = (rounded.getHours() < 10 ? '0' : '') + rounded.getHours(); - var roundedMinutes = (rounded.getMinutes() < 10 ? '0' : '') + rounded.getMinutes(); - - this._axisx.push(Array(rounded, roundedHours + ":" + roundedMinutes)); - - // Generate as many slots as we need - for(i = 0; i < this.options.leases_slots; i++) { - rounded = this.min_granularity + (rounded.getTime() / 1000); - rounded = new Date(rounded * 1000); - roundedHours = (rounded.getHours() < 10 ? '0' : '') + rounded.getHours(); - roundedMinutes = (rounded.getMinutes() < 10 ? '0' : '') + rounded.getMinutes(); - - this._axisx.push(Array(rounded, roundedHours + ":" + roundedMinutes)); - } - }, - - clear: function () - { - for (var i=0, len = this.leases.length; i0) ? 1 : 0; - for (var i=0, len=this._nodelabels.length; i= until_time) { - if (scan.current == "free") - relevant_free.push(scan); - else if (scan.current == "mine") - relevant_mine.push(scan); - } - } - // window.console.log("Found " + relevant_free.length + " free and " + relevant_mine.length + " mine"); - /* decide what to do, whether book or release */ - if (relevant_mine.length == 0 && relevant_free.length == 0) { - alert ("Nothing to do in this timeslot on the selected nodes"); - return; - } - // if at least one is free, let's book - if (relevant_free.length > 0) { - for (var i = 0, len = relevant_free.length; i < len; ++i) { - var lease = relevant_free[i]; - scheduler._lease_init_mine(lease, scheduler._lease_click_free); - } - // otherwise we unselect - } else { - for (var i = 0, len = relevant_mine.length; i < len; ++i) { - var lease = relevant_mine[i]; - scheduler._lease_init_free(lease, scheduler._lease_click_mine); - } - } - }, /* _timebutton_click */ - - /* --------------------------------------------------------------------- - * The nodelabel buttons - */ - - // set selected mode and render visually - _nodelabel_select: function (nodelabel, flag) - { - nodelabel.selected = flag; - nodelabel.attr({'font-weight': (flag ? 'bold' : 'normal')}); - // TODO - // - // loop on axis x and select each timebutton - // for (var i=0, len=axisx.length; i < len; ++i) - // figure out how to use timebutton_methods.click(); - - }, - - // toggle selected - _nodelabel_click: function (event) - { - this.scheduler._nodelabel_select( this, ! this.selected ); - }, - - - /* --------------------------------------------------------------------- - * The lease buttons - */ - _lease_init_free: function (lease, unclick) - { - var o = lease.scheduler.options; - lease.current = "free"; - // set color - lease.animate((lease.initial == "free") ? attr_lease_free_free : attr_lease_mine_free, o.anim_delay); - // keep track of the current status - // record action - lease.click(this._lease_click_free); - if (unclick) lease.unclick(unclick); - }, - - // find out all the currently free leases that overlap this one - _lease_click_free: function (event) - { - var scheduler = this.scheduler; - - scheduler._lease_init_mine(this, scheduler._lease_click_free); - //publish - //this.from_time - //this.urn - //this.until_time - var urn = this.urn - var start_time = this.from_time.getTime() / 1000; - var end_time = this.until_time.getTime() / 1000; - var duration = (end_time - start_time) / 1800; // XXX HARDCODED LEASE GRAIN - - /* Add a new lease : XXX should be replaced by a dictionary */ - /* - // Do we have a lease with the same urn just before or just after ? - //var removeIdBefore = null; - //var removeIdAfter = null; - var remove_lease_before = null; - var remove_lease_after = null; - // It is important to group leases, while this is technically - // equivalent, some testbeds such as IotLab limit the number of - // leases a user can have. - // XXX we might have several leases before or after if they have - // XXX not been grouped like this tool does - $.each(scheduler._leases, function(i, lease) { - if (lease[0] == urn) { - if (lease[1] + lease[2] * 1800 == start_time) { // XXX HARDCODED LEASE GRAIN - // Merge with previous lease - // removeIdBefore = i; - remove_lease_before = lease; - start_time = lease[1]; - duration += lease[2]; - } - if (lease[1] == end_time) { - // Merge with following lease - // removeIdAfter = i; - remove_lease_after = lease; - duration += lease[2]; - } - } - }); - //if (removeIdBefore != null) { - // scheduler._leases.splice(removeIdBefore , 1); - // if (removeIdAfter != null) - // removeIdAfter -= 1; - //} - //if (removeIdAfter != null) { - // scheduler._leases.splice(removeIdAfter , 1); - //} - - // We add the new lease, no need to push - var new_lease = [this.urn, start_time, duration]; - - // We send events, manifold will inform us about the change and we will react accordingly - /* - if (remove_lease_before != null) - manifold.raise_event(scheduler.options.query_lease_uuid, SET_REMOVED, remove_lease_before); - if (remove_lease_after != null) - manifold.raise_event(scheduler.options.query_lease_uuid, SET_REMOVED, remove_lease_after); - */ - manifold.raise_event(scheduler.options.query_lease_uuid, SET_ADD, new_lease); - //scheduler._leases.push([this.urn, start_time, duration]); - - //console.log(scheduler._leases); - //jQuery.publish('/update-set/' + scheduler.options.query_uuid, [scheduler._leases]); - - /* We need to inform manifold about the whole diff, in addition to maintaining our own structure */ - event.preventDefault(); - }, - - _lease_init_mine: function (lease, unclick) - { - var o = lease.scheduler.options; - lease.current = "mine"; - lease.animate((lease.initial == "mine") ? attr_lease_mine_mine : attr_lease_free_mine, o.anim_delay); - lease.click(this._lease_click_mine); - if (unclick) - lease.unclick(unclick); - }, - - /* TODO: remove selected lease from array _leases and publish change */ - _lease_click_mine: function (event) - { - var scheduler = this.scheduler; - // this lease was originally free but is now marked for booking - // we free just this lease - //console.log('this is mine'); - scheduler._lease_init_free(this, scheduler._lease_click_mine); - event.preventDefault(); - }, - - - lease_init_other: function (lease, slicename) - { - lease.animate (attr_lease_other,anim_delay); - /* a text obj to display the name of the slice that owns that lease */ - var otherslicelabel = lease.scheduler.paper.text (lease.attr("x")+lease.attr("width")/2, - // xxx - lease.attr("y")+lease.attr("height")/2,slicename).attr(txt_otherslice); - /* hide it right away */ - otherslicelabel.hide(); - /* record it */ - lease.label=otherslicelabel; - lease.hover ( function (e) {this.label.toFront();this.label.show();}, - function (e) {this.label.hide();} ); - } - - }); - - $.plugin('Scheduler', Scheduler); - -})(jQuery); diff --git a/plugins/scheduler/template/scheduler.html b/plugins/scheduler/template/scheduler.html deleted file mode 100644 index cd2e9c8e..00000000 --- a/plugins/scheduler/template/scheduler.html +++ /dev/null @@ -1,49 +0,0 @@ -
- - - - -

Date:

- -

Search:

- - - - - - -
- - -
diff --git a/plugins/scheduler2/__init__.py b/plugins/scheduler2/__init__.py new file mode 100755 index 00000000..a1057a4c --- /dev/null +++ b/plugins/scheduler2/__init__.py @@ -0,0 +1,74 @@ +from unfold.plugin import Plugin +import datetime +from datetime import timedelta + +class Scheduler2 (Plugin): + + + def __init__ (self, query, query_all_resources, query_lease = None, **settings): + Plugin.__init__ (self, **settings) + + self.query=query + self.query_all_resources = query_all_resources + self.query_all_resources_uuid = query_all_resources.query_uuid + self.query_lease = query_lease + query_lease.query_uuid if query_lease else None + + #granularity in minutes + granularity = 10 + #self.time_slots = [] + self.time_slots = self.createTimeSlots(granularity) + self.nodes = [ + ['Grid Nodes' , ['node016', 'node017', 'node018', 'node019', 'node020', 'node021', 'node029', 'node030', 'node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031','node031',]], + ['Other Nodes' , ['node022', 'node023', 'node024','node025', 'node026', 'node027', 'node028',]] + ] + + def template_file (self): + return "scheduler.html" + + def requirements (self): + reqs = { + 'js_files' : [ + 'js/scheduler2.js', + 'js/slider/jquery-ui-1.10.3.slider.min.js', + 'js/scheduler-helpers.js', + 'js/table-selector.js', + ], + 'css_files': [ + 'css/scheduler2.css', + 'css/slider/jquery-ui-1.10.3.slider.min.css', + ] + } + return reqs + + # the list of things passed to the js plugin + def json_settings_list (self): + # query_uuid will pass self.query results to the javascript + # and will be available as "record" in : + # on_new_record: function(record) + return ['plugin_uuid', 'domid', 'query_uuid', 'time_slots', 'nodes', 'query_lease_uuid', 'query_all_resources_uuid'] + + + def export_json_settings (self): + return True + + #Creates an Array with the timespans depending on granularity + def createTimeSlots (this, granularity): + #return type + time_slots = [] + #init times + time_s = datetime.time(0,00) + time_f = datetime.time(23,59) + now = datetime.datetime.now() + #calc diffs + dt_s = datetime.datetime.combine(now,time_s) + dt_f = datetime.datetime.combine(now,time_f) + #loop + while (dt_s < dt_f): + tmp = dt_s + dt_s = dt_s + datetime.timedelta(minutes=granularity) + ts = str(tmp.hour).zfill(2) + ':' + str(tmp.minute).zfill(2) + '-' + str(dt_s.hour).zfill(2) + ':' + str(dt_s.minute).zfill(2) + time_slots.append(ts) + #return + return time_slots + diff --git a/plugins/scheduler2/asdf.txt b/plugins/scheduler2/asdf.txt old mode 100644 new mode 100755 diff --git a/plugins/scheduler2/static/css/scheduler2.css b/plugins/scheduler2/static/css/scheduler2.css new file mode 100755 index 00000000..11334334 --- /dev/null +++ b/plugins/scheduler2/static/css/scheduler2.css @@ -0,0 +1,246 @@ +/* +# +# Copyright (c) 2012 NITLab, University of Thessaly, CERTH, Greece +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +# +# This is a MySlice plugin for the NITOS Scheduler +# NITOScheduler v8 +# +*/ +.m-t { + margin-top:5px; +} +.m-b { + margin-bottom:5px; +} +.m-none { + margin:0; +} + +.form-control { + padding-right: 30px; +} + +.form-control + .glyphicon { + position: absolute; + right: 0; + padding: 8px 27px; +} + +#time-range { + margin-top:10px; +} +#TopologyModal .modal-dialog { + width: 700px; +} +#TopologyModal .modal-body { + position: relative; + overflow-y: auto; + max-height: 100%; + padding: 15px; +} +#TopologyModal .modal-header, #TopologyModal .modal-body, #TopologyModal .modal-footer { + background: none repeat scroll 0 0 #FFFFFF; +} +#TopologyModal .modal-header { + border-radius: 11px 11px 0 0; +} +#TopologyModal .modal-body { + border-radius: 0 0 11px 11px; +} + +#scheduler .table { + background:#fff; +} + +#scheduler .control-label { + margin-top: 5px; +} +#lbltime { + display: inline-block; + font-size: 1.2em; + margin-top: 0; + padding: 6px; +} + +/** tables css **/ +#ShedulerNodes-scroll-container { + float: left; + overflow-x: scroll; + overflow-y: hidden; + width: 15%; +} +#ShedulerNodes { + border-collapse: collapse; + border-spacing: 0; + max-width: 500px; + width: 450px; + margin-top:55px; +} + +#ShedulerNodes th{ + height: 60px; +} + +#ShedulerNodes td{ + background: url("../img/podcast-15-w.png") no-repeat scroll 3px 50% #30196D; + border: 1px solid #CDCDCD; + color: #FFFFFF; + height: 27px; + padding: 0 3px 0 19px; +} + +#ShedulerNodes td.verticalIndex { + padding: 0 2px !important; +} + +#ShedulerNodes td .verticalText { + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); + margin-left: -30px; + position: absolute; + transform: rotate(-90deg); +} + +#reservation-table-scroll-container { + overflow-x: scroll; + overflow-y: visible; + padding-bottom: 1px; + width:85%; +} + + +#scheduler-reservation-table { + border-spacing:0; + border-collapse:collapse; + margin-bottom: 0 !important; + overflow: auto; + width: 100%; +} + +#scheduler-reservation-table tr{ + background-color: #A6C9E2 ; +} + +#scheduler-reservation-table tr.even{ + background-color: #E0E0E0 ; +} + +/*background: url("../img/opened-lock-15.png") no-repeat scroll 50% 50% transparent;*/ +#scheduler-reservation-table td { + border: 1px solid #FFFFFF; + cursor: pointer; + height: 27px; + padding: 3px 0 2px; + text-align: center; + width: 25px; +} + +#scheduler-reservation-table td img{ + height: 15px; +} + +#scheduler-reservation-table td.fixed, #scheduler-reservation-table th.fixed{ + position:absolute; + width:4em; + top:auto; + border-right: 2px none black; +} + +#scheduler-reservation-table td.info, #scheduler-reservation-table th { + background: #30196D; + font-weight:normal; + color: #fff; + height: 25px; + padding: 0 3px; + width: auto; +} + +#scheduler-reservation-table th span { + display: block; + line-height: 3px; + margin: 0 auto; + padding: 0 5px; + width: 3px; +} + +#scheduler-reservation-table td.free { +} + +#scheduler-reservation-table td.closed { + background: url("../img/closed-lock-15.png") no-repeat scroll 50% 50% #DD4444; + cursor: not-allowed; +} + +#scheduler-reservation-table td.maintenance { + background: url("../img/tools-15.png") no-repeat scroll 50% 50% #EDA428; +} + +#scheduler-reservation-table td.free:hover ,#scheduler-reservation-table td.selected, #scheduler-reservation-table td.selected_tmp { + background: #25BA25; +} + +td.no-image { + background-image: none !important; + padding: 0 !important; +} + + +/*legend*/ + +.legend ol { + font-size: 0.8em; + list-style: none; + padding: 0; +} + +.legend ol li{ + background: #a6c9e2; /* Old browsers */ + background: -moz-linear-gradient(left, #a6c9e2 28px, #e0e0e0 28px); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, right top, color-stop(28px,#a6c9e2), color-stop(28px,#e0e0e0)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(left, #a6c9e2 28px,#e0e0e0 28px); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(left, #a6c9e2 28px,#e0e0e0 28px); /* Opera 11.10+ */ + background: -ms-linear-gradient(left, #a6c9e2 28px,#e0e0e0 28px); /* IE10+ */ + background: linear-gradient(to right, #a6c9e2 28px,#e0e0e0 28px); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6c9e2', endColorstr='#e0e0e0',GradientType=1 ); /* IE6-9 */ + + padding: 3px 0 3px 30px; + width: 109px; +} + +.legend ol li.free{ + +} + +.legend ol li.closed{ + background: url("../img/closed-lock-15.png") no-repeat scroll 8px 50% #DD4444; +} + +.legend ol li.maintenance { + background: url("../img/tools-15.png") no-repeat scroll 8px 50% #EDA428; +} + +.legend ol li.selected { + background: #25BA25; +} diff --git a/plugins/scheduler2/static/css/slider/images/ui-bg_flat_0_aaaaaa_40x100.png b/plugins/scheduler2/static/css/slider/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100755 index 00000000..5b5dab2a Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-bg_glass_55_fbf9ee_1x400.png b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100755 index 00000000..ad3d6346 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-bg_glass_65_ffffff_1x400.png b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100755 index 00000000..42ccba26 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-bg_glass_75_dadada_1x400.png b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_75_dadada_1x400.png new file mode 100755 index 00000000..5a46b47c Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-bg_glass_75_e6e6e6_1x400.png b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100755 index 00000000..86c2baa6 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-bg_glass_75_ffffff_1x400.png b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_75_ffffff_1x400.png new file mode 100755 index 00000000..e65ca129 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-bg_glass_75_ffffff_1x400.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/plugins/scheduler2/static/css/slider/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100755 index 00000000..7c9fa6c6 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-bg_inset-soft_95_fef1ec_1x100.png b/plugins/scheduler2/static/css/slider/images/ui-bg_inset-soft_95_fef1ec_1x100.png new file mode 100755 index 00000000..0e05810f Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-bg_inset-soft_95_fef1ec_1x100.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-icons_222222_256x240.png b/plugins/scheduler2/static/css/slider/images/ui-icons_222222_256x240.png new file mode 100755 index 00000000..b273ff11 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-icons_222222_256x240.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-icons_2e83ff_256x240.png b/plugins/scheduler2/static/css/slider/images/ui-icons_2e83ff_256x240.png new file mode 100755 index 00000000..09d1cdc8 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-icons_2e83ff_256x240.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-icons_454545_256x240.png b/plugins/scheduler2/static/css/slider/images/ui-icons_454545_256x240.png new file mode 100755 index 00000000..59bd45b9 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-icons_454545_256x240.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-icons_888888_256x240.png b/plugins/scheduler2/static/css/slider/images/ui-icons_888888_256x240.png new file mode 100755 index 00000000..6d02426c Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-icons_888888_256x240.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-icons_cd0a0a_256x240.png b/plugins/scheduler2/static/css/slider/images/ui-icons_cd0a0a_256x240.png new file mode 100755 index 00000000..2ab019b7 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-icons_cd0a0a_256x240.png differ diff --git a/plugins/scheduler2/static/css/slider/images/ui-icons_f6cf3b_256x240.png b/plugins/scheduler2/static/css/slider/images/ui-icons_f6cf3b_256x240.png new file mode 100755 index 00000000..c9869351 Binary files /dev/null and b/plugins/scheduler2/static/css/slider/images/ui-icons_f6cf3b_256x240.png differ diff --git a/plugins/scheduler2/static/css/slider/jquery-ui-1.10.3.slider.min.css b/plugins/scheduler2/static/css/slider/jquery-ui-1.10.3.slider.min.css new file mode 100755 index 00000000..3b7a2c17 --- /dev/null +++ b/plugins/scheduler2/static/css/slider/jquery-ui-1.10.3.slider.min.css @@ -0,0 +1,1614 @@ +/*! + * jQuery UI Bootstrap (0.5) + * http://addyosmani.github.com/jquery-ui-bootstrap + * + * Copyright 2012 - 2013, Addy Osmani + * Dual licensed under the MIT or GPL Version 2 licenses. + * + * Portions copyright jQuery UI & Twitter Bootstrap + */ + + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { + border: 0; clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; +} +.ui-helper-clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.ui-helper-clearfix { + /*display: inline-block; */ + display:block; + min-height: 0; /* support: IE7 */ +} +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { + height:1%; +} + +/* end clearfix */ +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +/* + * jQuery UI Resizable 1.10.0 + * + * Copyright 2013, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://api.jqueryui.com/resizable/ + */ + +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + z-index: 99999; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} + +/* + * jQuery UI Selectable 1.10.0 + * + * Copyright 2013, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://jqueryui.com/selectable/ + */ +.ui-selectable-helper { + position: absolute; + z-index: 100; + border:1px dotted black; +} + +/* + * jQuery UI CSS Framework 1.10.0 + * + * Copyright 2013, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/ + */ + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size:13px; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_75_ffffff_1x400.png) 50% 50% repeat-x; color: #404040; } +.ui-widget-content a { color: #404040; } +.ui-widget-header { + font-weight:bold; + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + border:1px solid #666; + + } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { + + background-color: #e6e6e6; + background-repeat: no-repeat; + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6); + background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); + + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + + color: #333; + font-size: 13px; + line-height: normal; + border: 1px solid #ccc; + border-bottom-color: #bbb; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -webkit-transition: 0.1s linear background-image; + -moz-transition: 0.1s linear background-image; + -ms-transition: 0.1s linear background-image; + -o-transition: 0.1s linear background-image; + transition: 0.1s linear background-image; + overflow: visible; + + } + + +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { + background-position: 0 -15px; + color: #333; + text-decoration: none; + } + +.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ + + +.ui-state-highlight p, .ui-state-error p, .ui-state-default p{ + font-size: 13px; + font-weight: normal; + line-height: 18px; + margin:7px 15px; +} +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight { + + + position: relative; + margin-bottom: 18px; + color: #404040; + background-color: #eedc94; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1), to(#eedc94)); + background-image: -moz-linear-gradient(top, #fceec1, #eedc94); + background-image: -ms-linear-gradient(top, #fceec1, #eedc94); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1), color-stop(100%, #eedc94)); + background-image: -webkit-linear-gradient(top, #fceec1, #eedc94); + background-image: -o-linear-gradient(top, #fceec1, #eedc94); + background-image: linear-gradient(top, #fceec1, #eedc94); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1', endColorstr='#eedc94', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #eedc94 #eedc94 #e4c652; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + border-width: 1px; + border-style: solid; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + + +} +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { + + + position: relative; + margin-bottom: 18px; + color: #ffffff; + border-width: 1px; + border-style: solid; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25); + background-color: #c43c35; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35)); + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(top, #ee5f5b, #c43c35); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #c43c35 #c43c35 #882a25; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + + +} +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */ + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_f6cf3b_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + -moz-border-radius-topleft: 4px; + -webkit-border-top-left-radius: 4px; + -khtml-border-top-left-radius: 4px; + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + -khtml-border-top-right-radius: 4px; + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + -moz-border-radius-bottomleft: 4px; + -webkit-border-bottom-left-radius: 4px; + -khtml-border-bottom-left-radius: 4px; + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + -moz-border-radius-bottomright: 4px; + -webkit-border-bottom-right-radius: 4px; + -khtml-border-bottom-right-radius: 4px; + border-bottom-right-radius: 4px; +} + + +/* Overlays */ + +.ui-widget-overlay { + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .30; + filter:Alpha(Opacity=30); +} + +.ui-widget-shadow { + margin: -8px 0 0 -8px; + padding: 8px; + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .30;filter:Alpha(Opacity=30); + -moz-border-radius: 8px; + -khtml-border-radius: 8px; + -webkit-border-radius: 8px; + border-radius: 8px; +} + +/* + * jQuery UI Accordion 1.10.0 + * + * Copyright 2013, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://jqueryui.com/accordion/ + */ + +/* IE/Win - Fix animation bug - #4615 */ + +.ui-accordion { + width: 100%; +} +.ui-accordion .ui-accordion-header { + cursor: pointer; + position: relative; + margin-top: 1px; + zoom: 1; + font-weight:bold; +} +.ui-accordion .ui-accordion-li-fix { + display: inline; +} +.ui-accordion .ui-accordion-header-active { + border-bottom: 0 !important; +} +.ui-accordion .ui-accordion-header a { + display: block; + font-size: 1em; + padding: .5em .5em .5em 1.7em; +} +.ui-accordion-icons .ui-accordion-header a { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + margin-top: -2px; + position: relative; + top: 1px; + margin-bottom: 2px; + overflow: auto; + display: none; + zoom: 1; +} +.ui-accordion .ui-accordion-content-active { + display: block; +} + +/* + * jQuery UI Autocomplete 1.10.0 + * + * Copyright 2013, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://jqueryui.com/autocomplete/ + */ + +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} + +/* + * jQuery UI Button 1.10.0 + * + * Copyright 2013, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ + +.ui-button { + + cursor: pointer; + display: inline-block; + background-color: #e6e6e6; + background-repeat: no-repeat; + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6); + background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); + padding: 5px 14px 6px; + margin: 0; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + color: #333; + font-size: 13px; + line-height: normal; + border: 1px solid #ccc; + border-bottom-color: #bbb; + + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -webkit-transition: 0.1s linear background-image; + -moz-transition: 0.1s linear background-image; + -ms-transition: 0.1s linear background-image; + -o-transition: 0.1s linear background-image; + transition: 0.1s linear background-image; + overflow: visible; +} /* the overflow property removes extra width in IE */ + +.ui-button-primary { + color: #ffffff; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} + + +.ui-button-success{ + color:#ffffff; + background-color: #57a957; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#62c462), to(#57a957)); + background-image: -moz-linear-gradient(top, #62c462, #57a957); + background-image: -ms-linear-gradient(top, #62c462, #57a957); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); + background-image: -webkit-linear-gradient(top, #62c462, #57a957); + background-image: -o-linear-gradient(top, #62c462, #57a957); + background-image: linear-gradient(top, #62c462, #57a957); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #57a957 #57a957 #3d773d; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} + +.ui-button-error{ + color:#ffffff; + background-color: #c43c35; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b), to(#c43c35)); + background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b), color-stop(100%, #c43c35)); + background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); + background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); + background-image: linear-gradient(top, #ee5f5b, #c43c35); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #c43c35 #c43c35 #882a25; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} + +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ + +.ui-button .ui-button-text { display: block; } +.ui-button-text-only .ui-button-text { } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; /*tempfix*/ display:none;} +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +/* input.ui-button { padding: .4em 1em; } */ + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { top: 50%; margin-top:-3px; margin-bottom:3px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ + + +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-state-active { + color: #ffffff; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.4em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ + + +/* + * jQuery UI Menu 1.10.0 + * +* Copyright 2013, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ + +.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; float:left; outline: none; } +.ui-menu .ui-menu { margin-top: -3px; position: absolute; } +.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1;float: left;clear: left; width: 100%; } +.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; } +.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; } +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: 0; + color: #ffffff; + background: #0064cd; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} +/* Fix problem with border in ui-state-active */ +.ui-menu .ui-menu-item a.ui-state-active { + padding: 1px .4em; +} + +.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; } +.ui-menu .ui-state-disabled a { cursor: default; } + +/* icon support */ +.ui-menu-icons { position: relative; } +.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; } + +/* left-aligned */ +.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; } + +/* right-aligned */ +.ui-menu .ui-menu-icon { position: static; float: right; } + +.ui-menu { width: 200px; margin-bottom: 2em; } + + +/* + * jQuery UI spinner 1.10.0 + * +* Copyright 2013, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ + +.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; } +.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; } +.ui-spinner{} +.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; } +.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */ +.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */ +.ui-spinner-up { top: 0; } +.ui-spinner-down { bottom: 0; } + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position:-65px -16px; +} + +/* + * jQuery UI Dialog 1.10.0 + * + * Copyright 2013, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + width: 300px; + overflow: hidden; + outline: 0; + background-clip: padding-box; + background-color: #FFFFFF; + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 6px 6px 6px 6px; + box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); + /*left: 50%; + margin-left: -280px;*/ + outline: medium none; + position: fixed; + /*top: 10%; + width: 560px;*/ + z-index: 1050; +} +.ui-dialog .ui-dialog-titlebar { /*padding: .4em 1em;*/ + position: relative; + padding:5px 15px; + border:0px 0px 0px 1px solid; + border-color: white; + padding: 5px 15px; + font-size: 18px; + text-decoration:none; + background:none; + -moz-border-radius-bottomright: 0px; + -webkit-border-bottom-right-radius: 0px; + -khtml-border-bottom-right-radius: 0px; + + -moz-border-radius-bottomleft: 0px; + -webkit-border-bottom-left-radius: 0px; + -khtml-border-bottom-left-radius: 0px; + border-bottom-left-radius: 0px; + border-bottom:1px solid #ccc; +} +.ui-dialog .ui-dialog-title { + float: left; + color:#404040; + font-weight:bold; + margin-top:5px; + margin-bottom:5px; + padding:5px; + text-overflow: ellipsis; + overflow: hidden; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 19px; + margin: -20px 0 0 0; + padding: 1px; + height: 18px; + font-size: 20px; + font-weight: bold; + line-height: 13.5px; + text-shadow: 0 1px 0 #ffffff; + filter: alpha(opacity=25); + -khtml-opacity: 0.25; + -moz-opacity: 0.25; + opacity: 0.25; + background:none; + border-width: 0; + border:none; + box-shadow: none; +} + +.ui-dialog .ui-dialog-titlebar-close span { + display: block; + margin: 1px; + text-indent: 9999px; +} + +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 1px; filter: alpha(opacity=90); + -khtml-opacity: 0.90; + -moz-opacity: 0.90; + opacity: 0.90; +} + +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } + +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin: .5em 0 0 0; + background-color: #f5f5f5; + padding: 5px 15px 5px; + border-top: 1px solid #ddd; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; + zoom: 1; + margin-bottom: 0; + +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } + +.ui-dialog-buttonpane .ui-dialog-buttonset .ui-button{ + color: #ffffff; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); +} +/* + * jQuery UI Slider 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; + + color: #ffffff; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + +} + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } + +/* + * jQuery UI Tabs 1.9.2 + * + * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://jqueryui.com/tabs/ + */ + .ui-tabs .ui-tabs-nav{ background:none; border-color: #ddd;border-style: solid;border-width: 0 0 1px;} +.ui-tabs { position: relative; padding: .2em; zoom: 1; border:0px;} /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + + +.ui-tabs .ui-tabs-nav li:hover, .ui-tabs .ui-tabs-nav li a:hover{ + background:whiteSmoke; + border-bottom:1px solid #ddd; + padding-bottom:0px; + color:#00438A; +} + +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; border-bottom:1px solid #DDD; } +.ui-tabs .ui-tabs-nav li { text-decoration: none; list-style: none; float: left; position: relative; top: 1px; padding: 0px 0px 1px 0px; white-space: nowrap; background:none; border:0px; } + +.ui-tabs-nav .ui-state-default{ + -webkit-box-shadow: 0px 0px 0px #ffffff; /* Saf3-4, iOS 4.0.2 - 4.2, Android 2.3+ */ + -moz-box-shadow: 0px 0px 0px #ffffff; /* FF3.5 - 3.6 */ + box-shadow: 0px 0px 0px #ffffff; /* Opera 10.5, IE9, FF4+, Chrome 6+, iOS 5 */ +} +.ui-tabs .ui-tabs-nav li a { + float: left; + text-decoration: none; + cursor: text; + padding: 0 15px; + margin-right: 2px; + line-height: 34px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; + + + } + +.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: 0; padding-bottom: 0px; outline:none;} +.ui-tabs .ui-tabs-nav li.ui-tabs-active , .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: #ffffff; + cursor: default; + color:gray; + outline:none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a{background-color: #ffffff;outline:none;border:none;} +.ui-tabs .ui-tabs-nav li.ui-tabs-active:hover{ + background:#ffffff; + outline:none; + margin-bottom:0px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; color:#0069D6; background:none; font-weight:normal; margin-bottom:-1px;} +/* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs-panel .ui-button{text-decoration:none;} +.ui-tabs .ui-tabs-hide { display: none !important; } + + +/* IE fix for background inheritance from ui-widget*/ +.ui-tabs .ui-tabs-nav li{ + filter:none; +} + +/* + * jQuery UI Tooltip 1.9.0 + * + * Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://jqueryui.com/tooltip/ + */ +.ui-tooltip { + padding:8px; + position:absolute; + z-index:9999; + max-width: 300px; + -o-box-shadow: 0 0 5px #ddd; + -moz-box-shadow: 0 0 5px #ddd; + -webkit-box-shadow: 0 0 5px #ddd; + /*box-shadow: 0 2px 5px #ddd;*/ + box-shadow: inset 0 1px 0 #ffffff; +} + +body .ui-tooltip { border-width:2px; } + +/* + * jQuery UI Datepicker 1.9.0 + * + * Copyright 2012-10-11, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://jqueryui.com/datepicker/ + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; border:0px; font-weight: bold; width: 100%; padding: 4px 0; background-color: #f5f5f5; color: #808080; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } + +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { /*top: 1px;*/ } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } + +.ui-datepicker .ui-datepicker-prev-hover { /*left:1px;*/ } +.ui-datepicker .ui-datepicker-next-hover { /*right:1px;*/ } + +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +} + +.ui-datepicker th{ + font-weight: bold; + color: gray; +} + +.ui-datepicker-today a:hover{ + background-color: #808080; + color: #ffffff; + +} +.ui-datepicker-today a{ + background-color: #BFBFBF; + cursor: pointer; + padding: 0 4px; + margin-bottom:0px; + +} + + +.ui-datepicker td a{ + margin-bottom:0px; + border:0px; +} + +.ui-datepicker td:hover{ + color: #ffffff; +} + +.ui-datepicker td .ui-state-default { + border:0px; + background:none; + margin-bottom:0px; + padding:5px; + color:gray; + text-align: center; + filter:none; +} + + +.ui-datepicker td .ui-state-active{ + background:#BFBFBF; + margin-bottom:0px; + font-size:normal; + text-shadow: 0px; + color: #ffffff; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.ui-datepicker td .ui-state-hover { + color: #ffffff; + background: #0064cd; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; +} + +/* + * jQuery UI Progressbar 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; + +/*this can be removed if ui-widget-header is blue*/ + color: #ffffff; + background-color: #0064cd; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd)); + background-image: -moz-linear-gradient(top, #049cdb, #0064cd); + background-image: -ms-linear-gradient(top, #049cdb, #0064cd); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd)); + background-image: -webkit-linear-gradient(top, #049cdb, #0064cd); + background-image: -o-linear-gradient(top, #049cdb, #0064cd); + background-image: linear-gradient(top, #049cdb, #0064cd); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#049cdb', endColorstr='#0064cd', GradientType=0); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + border-color: #0064cd #0064cd #003f81; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + } + + + +/*** Input field styling from Bootstrap **/ + input, textarea { + -webkit-transition: border linear 0.2s, box-shadow linear 0.2s; + -moz-transition: border linear 0.2s, box-shadow linear 0.2s; + -ms-transition: border linear 0.2s, box-shadow linear 0.2s; + -o-transition: border linear 0.2s, box-shadow linear 0.2s; + transition: border linear 0.2s, box-shadow linear 0.2s; + -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); + -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); +} +input:focus, textarea:focus { + outline: 0; + border-color: rgba(82, 168, 236, 0.8); + -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); + -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6); +} +input[type=file]:focus, input[type=checkbox]:focus, select:focus { + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + outline: 1px dotted #666; +} + +input[type="text"], +input[type="password"], +.ui-autocomplete-input, +textarea, +.uneditable-input { + display: inline-block; + padding: 4px; + font-size: 13px; + line-height: 18px; + color: #808080; + border: 1px solid #ccc; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + + + +/**Toolbar**/ + +.ui-toolbar{ + padding: 7px 14px; + margin: 0 0 18px; + background-color: #f5f5f5; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#ffffff), to(#f5f5f5)); + background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f5f5f5)); + background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); + background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); + background-image: linear-gradient(top, #ffffff, #f5f5f5); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0); + border: 1px solid #ddd; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: inset 0 1px 0 #ffffff; + -moz-box-shadow: inset 0 1px 0 #ffffff; + box-shadow: inset 0 1px 0 #ffffff; +} + + +/***Dialog fixes**/ + +.ui-dialog-buttonset .ui-button:nth-child(2){ + cursor: pointer; + display: inline-block; + background-color: #e6e6e6; + background-repeat: no-repeat; + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), color-stop(25%, #ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -moz-linear-gradient(top, #ffffff, #ffffff 25%, #e6e6e6); + background-image: -ms-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: -o-linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + background-image: linear-gradient(#ffffff, #ffffff 25%, #e6e6e6); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); + padding: 5px 14px 6px; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + color: #333; + font-size: 13px; + line-height: normal; + border: 1px solid #ccc; + border-bottom-color: #bbb; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + -webkit-transition: 0.1s linear all; + -moz-transition: 0.1s linear all; + -ms-transition: 0.1s linear all; + -o-transition: 0.1s linear all; + transition: 0.1s linear all; + overflow: visible; +} + + + +/***Wijmo Theming**/ + +div.wijmo-wijmenu{ + padding:0 20px; + background-color: #222; + background-color: #222222; + background-repeat: repeat-x; + background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222)); + background-image: -moz-linear-gradient(top, #333333, #222222); + background-image: -ms-linear-gradient(top, #333333, #222222); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222)); + background-image: -webkit-linear-gradient(top, #333333, #222222); + background-image: -o-linear-gradient(top, #333333, #222222); + background-image: linear-gradient(top, #333333, #222222); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1); +} + +.wijmo-wijmenu .ui-state-default{ + box-shadow: none; + color:#BFBFBF; +} + +.wijmo-wijmenu .ui-state-default .wijmo-wijmenu-text{ + color:#BFBFBF; +} + +.wijmo-wijmenu .ui-state-hover{ + background: #444; + background: rgba(255, 255, 255, 0.05); +} + +.wijmo-wijmenu .ui-state-hover .wijmo-wijmenu-text{ + color:#ffffff; +} + +div.wijmo-wijmenu .ui-widget-header h3{ + position: relative; + margin-top:1px; + padding:0; +} + +.wijmo-wijmenu h3 a{ + color: #FFFFFF; + display: block; + float: left; + font-size: 20px; + font-weight: 200; + line-height: 1; + margin-left: -20px; + margin-top:1px; + padding: 8px 20px 12px; +} + +.wijmo-wijmenu h3 a:hover{ + background-color: rgba(255, 255, 255, 0.05); + color: #FFFFFF; + text-decoration: none; +} + +.wijmo-wijmenu .ui-widget-header{ + border:0px; +} + +.wijmo-wijmenu .wijmo-wijmenu-parent .wijmo-wijmenu-child{ + padding: 0.3em 0; +} + +div.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-child{ + background: #333; + border:0; + margin:0; + padding: 6px 0; + width:160px; + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; + -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); +} + +div.wijmo-wijmenu .wijmo-wijmenu-item{ + margin:0; + border:0; +} + +.wijmo-wijmenu a.wijmo-wijmenu-link{ + margin:0; + line-height: 19px; + padding: 10px 10px 11px; + border:0; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius:0; +} + +div.wijmo-wijmenu .wijmo-wijmenu-child .wijmo-wijmenu-link{ + display:block; + float:none; + padding: 4px 15px; + width:auto; +} + +div.wijmo-wijmenu .wijmo-wijmenu-child .wijmo-wijmenu-text +{ + float:none; +} + +.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-child .ui-state-hover { + background: #191919; +} + +.wijmo-wijmenu .wijmo-wijmenu-item .wijmo-wijmenu-separator{ + padding: 5px 0; + background-image: none; + background-color: #222; + border-top: 1px solid #444; + border-bottom:0; + border-left:0; + border-right:0; +} + +.wijmo-wijmenu .wijmo-wijmenu-item input { + -moz-transition: none 0s ease 0s; + background-color: rgba(255, 255, 255, 0.3); + border: 1px solid #111111; + border-radius: 4px 4px 4px 4px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset, 0 1px 0 rgba(255, 255, 255, 0.25); + color: rgba(255, 255, 255, 0.75); + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + line-height: 1; + margin: 5px 10px 0 10px; + padding: 4px 9px; + width:100px; +} + +.wijmo-wijmenu .wijmo-wijmenu-item input:hover { + background-color: rgba(255, 255, 255, 0.5); + color: #FFFFFF; +} + +.wijmo-wijmenu .wijmo-wijmenu-item input:focus { + background-color: #FFFFFF; + border: 0 none; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); + color: #404040; + outline: 0 none; + padding: 5px 10px; + text-shadow: 0 1px 0 #FFFFFF; +} + + +.wijmo-wijmenu .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { + text-shadow:none; +} + + +.wijmo-wijmenu .ui-state-default{ + box-shadow: none; + color:#BFBFBF; + filter: none; +} + diff --git a/plugins/scheduler2/static/img/closed-lock-15.png b/plugins/scheduler2/static/img/closed-lock-15.png new file mode 100755 index 00000000..5f52630e Binary files /dev/null and b/plugins/scheduler2/static/img/closed-lock-15.png differ diff --git a/plugins/scheduler2/static/img/closed-lock.png b/plugins/scheduler2/static/img/closed-lock.png new file mode 100755 index 00000000..806fb444 Binary files /dev/null and b/plugins/scheduler2/static/img/closed-lock.png differ diff --git a/plugins/scheduler2/static/img/loading.gif b/plugins/scheduler2/static/img/loading.gif new file mode 100755 index 00000000..973571ec Binary files /dev/null and b/plugins/scheduler2/static/img/loading.gif differ diff --git a/plugins/scheduler2/static/img/nitos_topo.png b/plugins/scheduler2/static/img/nitos_topo.png new file mode 100755 index 00000000..528407b0 Binary files /dev/null and b/plugins/scheduler2/static/img/nitos_topo.png differ diff --git a/plugins/scheduler2/static/img/opened-lock-15.png b/plugins/scheduler2/static/img/opened-lock-15.png new file mode 100755 index 00000000..da6a9239 Binary files /dev/null and b/plugins/scheduler2/static/img/opened-lock-15.png differ diff --git a/plugins/scheduler2/static/img/opened-lock.png b/plugins/scheduler2/static/img/opened-lock.png new file mode 100755 index 00000000..9fba7c83 Binary files /dev/null and b/plugins/scheduler2/static/img/opened-lock.png differ diff --git a/plugins/scheduler2/static/img/podcast-15-w.png b/plugins/scheduler2/static/img/podcast-15-w.png new file mode 100755 index 00000000..658d142b Binary files /dev/null and b/plugins/scheduler2/static/img/podcast-15-w.png differ diff --git a/plugins/scheduler2/static/img/podcast-15.png b/plugins/scheduler2/static/img/podcast-15.png new file mode 100755 index 00000000..70495daa Binary files /dev/null and b/plugins/scheduler2/static/img/podcast-15.png differ diff --git a/plugins/scheduler2/static/img/podcast.png b/plugins/scheduler2/static/img/podcast.png new file mode 100755 index 00000000..6a96d4cc Binary files /dev/null and b/plugins/scheduler2/static/img/podcast.png differ diff --git a/plugins/scheduler2/static/img/pushpin-1.png b/plugins/scheduler2/static/img/pushpin-1.png new file mode 100755 index 00000000..4b4bf224 Binary files /dev/null and b/plugins/scheduler2/static/img/pushpin-1.png differ diff --git a/plugins/scheduler2/static/img/tools-15.png b/plugins/scheduler2/static/img/tools-15.png new file mode 100755 index 00000000..ffd9847c Binary files /dev/null and b/plugins/scheduler2/static/img/tools-15.png differ diff --git a/plugins/scheduler2/static/img/tools.png b/plugins/scheduler2/static/img/tools.png new file mode 100755 index 00000000..421e5f8e Binary files /dev/null and b/plugins/scheduler2/static/img/tools.png differ diff --git a/plugins/scheduler2/static/js/scheduler-helpers.js b/plugins/scheduler2/static/js/scheduler-helpers.js new file mode 100755 index 00000000..a455919f --- /dev/null +++ b/plugins/scheduler2/static/js/scheduler-helpers.js @@ -0,0 +1,32 @@ +function lookup(array, prop, value) { + for (var i = 0, len = array.length; i < len; i++) + if (array[i][prop] === value) return array[i]; +} + +function GetTimeFromInt(intTime) { + var has30 = intTime % 1; + var CurInt = parseInt(intTime / 1); + if (CurInt < 10) + CurInt = "0" + CurInt; + + if (has30 == 0) { + return CurInt + ":00"; + } else { + return CurInt + ":30"; + } +} + +function fixOddEvenClasses() { + $('#' + rsvrTblNm + ' tbody tr').removeClass(); + $('#' + rsvrTblNm + ' tbody tr:visible:even').addClass('even'); + $('#' + rsvrTblNm + ' tbody tr:visible:odd').addClass('odd'); +} + +function isRightClick(e) { + if (e.which) { + return (e.which == 3); + } else if (e.button) { + return (e.button == 2); + } + return false; +} diff --git a/plugins/scheduler2/static/js/scheduler2.js b/plugins/scheduler2/static/js/scheduler2.js new file mode 100755 index 00000000..dd0c8f8a --- /dev/null +++ b/plugins/scheduler2/static/js/scheduler2.js @@ -0,0 +1,314 @@ +/* +# +# Copyright (c) 2013 NITLab, University of Thessaly, CERTH, Greece +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +# +# This is a MySlice plugin for the NITOS Scheduler +# Nitos Scheduler v1 +# +*/ + +/* some params */ +var init_start_visible_index = 10; +var init_end_visible_index = 21; +var rsvrTblNm = "scheduler-reservation-table"; +var SchedulerResources = []; +var schdlr_totalColums = 0; +var SetPerFun = null; +var Sched2 = null; +var Debug = true; +var schdlr_PartsInOneHour = 6; + +(function ($) { + var Scheduler2 = Plugin.extend({ + + /** XXX to check + * @brief Plugin constructor + * @param options : an associative array of setting values + * @param element : + * @return : a jQuery collection of objects on which the plugin is + * applied, which allows to maintain chainability of calls + */ + init: function (options, element) { + // Call the parent constructor, see FAQ when forgotten + this._super(options, element); + + schdlr_totalColums = $("#scheduler-reservation-table th").length; + + //selection from table + $(window).keydown(function (evt) { + if (evt.which == 17) { // ctrl + ctrlPressed = true; + } + }).keyup(function (evt) { + if (evt.which == 17) { // ctrl + ctrlPressed = false; + } + }); + $("#" + rsvrTblNm).on('mousedown', 'td', rangeMouseDown).on('mouseup', 'td', rangeMouseUp).on('mousemove', 'td', rangeMouseMove); + + // Explain this will allow query events to be handled + // What happens when we don't define some events ? + // Some can be less efficient + + if (Debug) console.time("Listening_to_queries"); + /* Listening to queries */ + this.listen_query(options.query_uuid, 'all_ev'); + this.listen_query(options.query_all_resources_uuid, 'all_resources'); + this.listen_query(options.query_lease_uuid, 'lease'); + //this.listen_query(options.query_lease_uuid, 'lease'); + if (Debug) console.timeEnd("Listening_to_queries"); + + }, + + /* PLUGIN EVENTS */ + // on_show like in querytable + + + /* GUI EVENTS */ + + // a function to bind events here: click change + // how to raise manifold events + + + /* GUI MANIPULATION */ + + // We advise you to write function to change behaviour of the GUI + // Will use naming helpers to access content _inside_ the plugin + // always refer to these functions in the remaining of the code + + show_hide_button: function () { + // this.id, this.el, this.cl, this.elts + // same output as a jquery selector with some guarantees + }, + + drawResources: function () { + + //if (Debug) this.debug('foo'); + if (Debug) console.time("each:SchedulerResources"); + + //scheduler-reservation-table main table columns + totalColums = $("#scheduler-reservation-table thead tr th").length; + //var totalCell = []; + //for (var i = 0; i < totalColums; i++) { totalCell.push(""); } + //var srt_body = []; + var totalCell = ""; + for (var i = 0; i < totalColums; i++) totalCell +=""; + var srt_body = ""; + + $.each(SchedulerResources, function (i, group) { + //var groupTR = $("#ShedulerNodes tbody").html('
' + group.groupName + '
'); + var groupTR = $("#ShedulerNodes tbody").html('
' + group.groupName + '
'); + + $.each(group.resources.slice(0,30), function (i, resource) { + if (i == 0) { + //$("#ShedulerNodes tbody tr:first").append('' + resource.hostname + ''); + $(groupTR).find("#schdlr_frstTD").html(resource.hostname); + //$(srt_body).html("" + totalCell + ""); + } else { + $(groupTR).find("tr:last").after('' + resource.hostname + ''); + //$(srt_body).find("tr:last").after("" + totalCell + ""); + } + srt_body += "" + totalCell + ""; + //srt_body.push(''); srt_body = srt_body.concat(totalCell.concat()); srt_body.push('/'); + }); + }); + + //$("#scheduler-reservation-table tbody").html(srt_body.join("")); + $("#scheduler-reservation-table tbody").html(srt_body); + + if (Debug) console.timeEnd("each:SchedulerResources"); + + + $("#" + rsvrTblNm + " tbody tr").each(function (index) { $(this).attr("data-trindex", index); }); + + }, + + /* TEMPLATES */ + + // see in the html template + // How to load a template, use of mustache + + /* QUERY HANDLERS */ + loadWithDate: function () { + // only convention, not strictly enforced at the moment + }, + // How to make sure the plugin is not desynchronized + // He should manifest its interest in filters, fields or records + // functions triggered only if the proper listen is done + + /* all_ev QUERY HANDLERS Start */ + on_all_ev_clear_records: function (data) { + //alert('all_ev clear_records'); + }, + on_all_ev_query_in_progress: function (data) { + // alert('all_ev query_in_progress'); + }, + on_all_ev_new_record: function (data) { + //alert('all_ev new_record'); + }, + on_all_ev_query_done: function (data) { + //alert('all_ev query_done'); + }, + //another plugin has modified something, that requires you to update your display. + on_all_ev_field_state_changed: function (data) { + //alert('all_ev query_done'); + }, + /* all_ev QUERY HANDLERS End */ + /* all_resources QUERY HANDLERS Start */ + on_all_resources_clear_records: function (data) { + //data is empty on load + }, + on_all_resources_query_in_progress: function (data) { + //data is empty on load + }, + on_all_resources_new_record: function (data) { + var tmpGroup = lookup(SchedulerResources, 'groupName', data.type); + if (tmpGroup == null) { + tmpGroup = { groupName: data.type, resources: [] }; + SchedulerResources.push(tmpGroup); + //if (data.type != "node") alert('not all node'); + } + tmpGroup.resources.push(data); + //alert('new_record'); + }, + on_all_resources_query_done: function (data) { + this.drawResources(); + //data is empty on load + /* GUI setup and event binding */ + this._initUI(); + this._SetPeriodInPage(init_start_visible_index, init_end_visible_index); + this.loadWithDate(); + }, + //another plugin has modified something, that requires you to update your display. + on_all_resources_field_state_changed: function (data) { + //alert('all_resources query_done'); + }, + /* all_resources QUERY HANDLERS End */ + /* lease QUERY HANDLERS Start */ + on_lease_clear_records: function (data) { alert('clear_records'); }, + on_lease_query_in_progress: function (data) { alert('query_in_progress'); }, + on_lease_new_record: function (data) { alert('new_record'); }, + on_lease_query_done: function (data) { alert('query_done'); }, + //another plugin has modified something, that requires you to update your display. + on_lease_field_state_changed: function (data) { alert('query_done'); }, + /* lease QUERY HANDLERS End */ + + + // no prefix + + on_filter_added: function (filter) { + + }, + + // ... be sure to list all events here + + /* RECORD HANDLERS */ + on_all_new_record: function (record) { + // + alert('on_all_new_record'); + }, + + debug : function (log_txt) { + if (typeof window.console != 'undefined') { + console.debug(log_txt); + } + }, + + /* INTERNAL FUNCTIONS */ + _initUI: function () { + if (Debug) console.time("_initUI"); + //fix margins in tables + mtNodesTbl = $("#" + rsvrTblNm + " tr:first").outerHeight() + 6; + mtSchrollCon = $("#nodes").outerWidth(); + $("#nodes").css("margin-top", mtNodesTbl); + $("#reservation-table-scroll-container").css("margin-left", mtSchrollCon); + SetPerFun = this._SetPeriodInPage; + //slider + $("#time-range").slider({ + range: true, + min: 0, + max: 24, + step: 0.5, + values: [init_start_visible_index, init_end_visible_index], + slide: function (event, ui) { + SetPerFun(ui.values[0], ui.values[1]); + } + }); + $("#DateToRes").datepicker({ + dateFormat: "yy-mm-dd", + minDate: 0, + numberOfMonths: 3 + }).change(function () { + //Scheduler2.loadWithDate(); + }).click(function () { + $("#ui-datepicker-div").css("z-index", 5); + }); + //other stuff + fixOddEvenClasses(); + $("#" + rsvrTblNm + " td:not([class])").addClass("free"); + if (Debug) console.timeEnd("_initUI"); + }, + _SetPeriodInPage: function (start, end) { + if (Debug) console.time("_SetPeriodInPage"); + ClearTableSelection(); + $("#lbltime").html(GetTimeFromInt(start) + " - " + GetTimeFromInt(end)); + + var start_visible_index = (start * schdlr_PartsInOneHour) + 1; + var end_visible_index = (end * schdlr_PartsInOneHour); + + //hide - show + for (i = 0; i < start_visible_index; i++) { + $("#" + rsvrTblNm + " td:nth-child(" + i + "), #" + rsvrTblNm + " th:nth-child(" + i + ")").hide(); + } + for (i = end_visible_index + 1; i <= schdlr_totalColums; i++) { + $("#" + rsvrTblNm + " td:nth-child(" + i + "), #" + rsvrTblNm + " th:nth-child(" + i + ")").hide(); + } + /*$("#" + rsvrTblNm + " td:not([class*='info']), #" + rsvrTblNm + " th:not([class*='fixed'])").hide();*/ + for (i = start_visible_index; i <= end_visible_index; i++) { + $("#" + rsvrTblNm + " td:nth-child(" + i + "), #" + rsvrTblNm + " th:nth-child(" + i + ")").show(); + } + + if ($("#" + rsvrTblNm + " th:visible:first").width() > 105) { + $("#" + rsvrTblNm + " th span").css("display", "inline") + } else { + $("#" + rsvrTblNm + " th span").css("display", "block"); + } + mtNodesTbl = $("#" + rsvrTblNm + " tr:first").outerHeight() + 6; + $("#nodes").css("margin-top", mtNodesTbl); + //$("#scroll_container").width($("#Search").width() - $("#nodes").width()); + //$("#nodes th").height($("#tblReservation th:visible:first").height() - 2); + if (Debug) console.timeEnd("_SetPeriodInPage"); + } + }); + + //Sched2 = new Scheduler2(); + + /* Plugin registration */ + $.plugin('Scheduler2', Scheduler2); + + // TODO Here use cases for instanciating plugins in different ways like in the pastie. + + +})(jQuery); + + + diff --git a/plugins/scheduler2/static/js/selectRangeWorker.js b/plugins/scheduler2/static/js/selectRangeWorker.js new file mode 100755 index 00000000..5f282702 --- /dev/null +++ b/plugins/scheduler2/static/js/selectRangeWorker.js @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/plugins/scheduler2/static/js/slider/jquery-ui-1.10.3.slider.min.js b/plugins/scheduler2/static/js/slider/jquery-ui-1.10.3.slider.min.js new file mode 100755 index 00000000..b2ea00eb --- /dev/null +++ b/plugins/scheduler2/static/js/slider/jquery-ui-1.10.3.slider.min.js @@ -0,0 +1,6 @@ +/*! jQuery UI - v1.10.3 - 2013-11-26 +* http://jqueryui.com +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.slider.js +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +(function(e,t){function i(t,i){var s,n,r,o=t.nodeName.toLowerCase();return"area"===o?(s=t.parentNode,n=s.name,t.href&&n&&"map"===s.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&a(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&a(t)}function a(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,a){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),a&&a.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var a,s,n=e(this[0]);n.length&&n[0]!==document;){if(a=n.css("position"),("absolute"===a||"relative"===a||"fixed"===a)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,a){return!!e.data(t,a[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var a=e.attr(t,"tabindex"),s=isNaN(a);return(s||a>=0)&&i(t,!s)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(i,a){function s(t,i,a,s){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,a&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===a?["Left","Right"]:["Top","Bottom"],r=a.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+a]=function(i){return i===t?o["inner"+a].call(this):this.each(function(){e(this).css(r,s(this,i)+"px")})},e.fn["outer"+a]=function(t,i){return"number"!=typeof t?o["outer"+a].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,a){var s,n=e.ui[t].prototype;for(s in a)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([i,a[s]])},call:function(e,t,i){var a,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(a=0;s.length>a;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var a=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[a]>0?!0:(t[a]=1,s=t[a]>0,t[a]=0,s)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,a=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(n){}a(t)},e.widget=function(i,s,a){var n,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],n=u+"-"+i,a||(a=s,s=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:a.version,_proto:e.extend({},a),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(a,function(i,a){return e.isFunction(a)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,n=this._superApply;return this._super=e,this._superApply=t,i=a.apply(this,arguments),this._super=s,this._superApply=n,i}}(),t):(l[i]=a,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:n}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var a,n,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(a in r[o])n=r[o][a],r[o].hasOwnProperty(a)&&n!==t&&(i[a]=e.isPlainObject(n)?e.isPlainObject(i[a])?e.widget.extend({},i[a],n):e.widget.extend({},n):n);return i},e.widget.bridge=function(i,a){var n=a.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,a=e.data(this,n);return a?e.isFunction(a[r])&&"_"!==r.charAt(0)?(s=a[r].apply(a,h),s!==a&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,n);t?t.option(r||{})._init():e.data(this,n,new a(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var a,n,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},a=i.split("."),i=a.shift(),a.length){for(n=o[i]=e.widget.extend({},this.options[i]),r=0;a.length-1>r;r++)n[a[r]]=n[a[r]]||{},n=n[a[r]];if(i=a.pop(),s===t)return n[i]===t?null:n[i];n[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,a){var n,r=this;"boolean"!=typeof i&&(a=s,s=i,i=!1),a?(s=n=e(s),this.bindings=this.bindings.add(s)):(a=s,s=this.element,n=this.widget()),e.each(a,function(a,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=a.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?n.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var a,n,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],n=i.originalEvent)for(a in n)a in i||(i[a]=n[a]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,a,n){"string"==typeof a&&(a={effect:a});var r,o=a?a===!0||"number"==typeof a?i:a.effect||i:t;a=a||{},"number"==typeof a&&(a={duration:a}),r=!e.isEmptyObject(a),a.complete=n,a.delay&&s.delay(a.delay),r&&e.effects&&e.effects.effect[o]?s[t](a):o!==t&&s[o]?s[o](a.duration,a.easing,n):s.queue(function(i){e(this)[t](),n&&n.call(s[0]),i()})}})})(jQuery);(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,a=1===i.which,n="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return a&&!n&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e){var t=5;e.widget("ui.slider",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,a=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),n="",r=[];for(i=s.values&&s.values.length||1,a.length>i&&(a.slice(i).remove(),a=a.slice(0,i)),t=a.length;i>t;t++)r.push(n);this.handles=a.add(e(r.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("
").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):this.range=e([])},_setupEvents:function(){var e=this.handles.add(this.range).filter("a");this._off(e),this._on(e,this._handleEvents),this._hoverable(e),this._focusable(e)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,a,n,r,o,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),a=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(a>i||a===i&&(t===u._lastChangedValue||u.values(t)===c.min))&&(a=i,n=e(this),r=t)}),o=this._start(t,r),o===!1?!1:(this._mouseSliding=!0,this._handleIndex=r,n.addClass("ui-state-active").focus(),h=n.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-n.width()/2,top:t.pageY-h.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,r,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,a,n;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),a=this._valueMax()-this._valueMin(),n=this._valueMin()+s*a,this._trimAlignValue(n)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,a,n;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(a=this.values(),a[t]=i,n=this._trigger("slide",e,{handle:this.handles[t],value:i,values:a}),s=this.values(t?0:1),n!==!1&&this.values(t,i,!0))):i!==this.value()&&(n=this._trigger("slide",e,{handle:this.handles[t],value:i}),n!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(t,i){var s,a,n;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),undefined;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,a=arguments[0],n=0;s.length>n;n+=1)s[n]=this._trimAlignValue(a[n]),this._change(null,n);this._refreshValue()},_setOption:function(t,i){var s,a=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(a=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;a>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,i,s,a,n,r=this.options.range,o=this.options,h=this,l=this._animateOff?!1:o.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,o.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},o.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:o.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},o.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:o.animate}))),t=i}):(s=this.value(),a=this._valueMin(),n=this._valueMax(),i=n!==a?100*((s-a)/(n-a)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,o.animate),"min"===r&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},o.animate),"max"===r&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:o.animate}),"min"===r&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},o.animate),"max"===r&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:o.animate}))},_handleEvents:{keydown:function(i){var s,a,n,r,o=e(i.target).data("ui-slider-handle-index");switch(i.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(i.target).addClass("ui-state-active"),s=this._start(i,o),s===!1))return}switch(r=this.options.step,a=n=this.options.values&&this.options.values.length?this.values(o):this.value(),i.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(a+(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(a-(this._valueMax()-this._valueMin())/t);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(a===this._valueMax())return;n=this._trimAlignValue(a+r);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(a===this._valueMin())return;n=this._trimAlignValue(a-r)}this._slide(i,o,n)},click:function(e){e.preventDefault()},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}})})(jQuery); \ No newline at end of file diff --git a/plugins/scheduler2/static/js/table-selector.js b/plugins/scheduler2/static/js/table-selector.js new file mode 100755 index 00000000..b4991519 --- /dev/null +++ b/plugins/scheduler2/static/js/table-selector.js @@ -0,0 +1,167 @@ +////version 3 +var dragStart_td = 0; +var dragStart_tr = 0; +var dragEnd_td = 0; +var dragEnd_tr = 0; +//tmp gia ta loops & check gia to last state +var tmp_dragStart_td; +var tmp_dragStart_tr; +var tmp_dragEnd_td; +var tmp_dragEnd_tr; +var isDragging = false; +var ctrlPressed = false; +// try stop +var continueExecuting = false; +var isExecuting = false; + + + +function rangeMouseDown(e) { + if (Debug) console.time("mouse:rangeMouseDown"); + if (isRightClick(e)) { + return false; + } else { + dragStart_tr = $(this).parent().index(); + dragStart_td = $(this).index(); + dragEnd_tr = dragStart_tr; + dragEnd_td = dragStart_td; + //alert(dragStart_tr); + //var allCells = $("#tblReservation td"); + //dragStart = allCells.index($(this)); + + if ( $(this).hasClass("free")) + $(this).addClass("selected_tmp"); + + isDragging = true; + //selectRange(); + + if (typeof e.preventDefault != 'undefined') { e.preventDefault(); } + document.documentElement.onselectstart = function () { return false; }; + } + if (Debug) console.timeEnd("mouse:rangeMouseDown"); +} + +function rangeMouseUp(e) { + if (Debug) console.time("mouse:rangeMouseUp"); + if (isRightClick(e)) { + return false; + } else { + //var allCells = $("#tblReservation td"); + //dragEnd = allCells.index($(this)); + + dragEnd_tr = $(this).parent().index(); + dragEnd_td = $(this).index(); + + isDragging = false; + selectRange(false); + + document.documentElement.onselectstart = function () { return true; }; + } + if (Debug) console.timeEnd("mouse:rangeMouseUp"); +} + +function rangeMouseMove(e) { + //if (Debug) console.time("mouse:rangeMouseMove"); + if (isDragging) { + dragEnd_tr = $(this).parent().attr('data-trindex'); + dragEnd_td = $(this).attr('data-tdindex'); + + //if (Debug) this.debug('foo'); + + if ((dragEnd_tr != tmp_dragEnd_tr) || (dragEnd_td != tmp_dragEnd_td)) { + //console.log(dragEnd_tr + " - " + tmp_dragEnd_tr); + //console.log(dragEnd_td + " - " + tmp_dragEnd_td); + //selectRange(true); + } + } + //if (Debug) console.timeEnd("mouse:rangeMouseMove"); +} + +function selectRange(IsTemp) { + if (Debug) console.time("mouse:---selectRange"); + + if (!ctrlPressed) + $("#" + rsvrTblNm + " td:not([class='info'],[class='closed'])").removeClass('selected selected_tmp').addClass('free'); + + tmp_dragStart_td = dragStart_td; + tmp_dragStart_tr = dragStart_tr; + tmp_dragEnd_td = dragEnd_td; + tmp_dragEnd_tr = dragEnd_tr; + + if (tmp_dragStart_td > tmp_dragEnd_td) { + var tmp = tmp_dragStart_td; + tmp_dragStart_td = tmp_dragEnd_td; + tmp_dragEnd_td = tmp; + } + + if (tmp_dragStart_tr > tmp_dragEnd_tr) { + var tmp = tmp_dragStart_tr; + tmp_dragStart_tr = tmp_dragEnd_tr; + tmp_dragEnd_tr = tmp; + } + + //alert("tmp_dragStart_td:" + tmp_dragStart_td + "\n tmp_dragStart_tr:" + tmp_dragStart_tr + "\n tmp_dragEnd_td:" + tmp_dragEnd_td + "\n tmp_dragEnd_tr:" + tmp_dragEnd_tr); + + + for (i = tmp_dragStart_tr; i <= tmp_dragEnd_tr; i++) { + for (j = tmp_dragStart_td; j <= tmp_dragEnd_td; j++) { + //alert("i:" + i + "j:" + j); + var cell = $('#' + rsvrTblNm + ' tbody tr:eq(' + i + ') td:eq(' + j + ')'); + //$(cell) + curClass = $(cell).attr("class"); + //alert(curClass); + switch (curClass) { + case "free_tmp": + $(cell).removeClass(); + if (IsTemp) + $(cell).addClass("free_tmp"); + else + $(cell).addClass("free"); + break; + case "free": + $(cell).removeClass(); + if (IsTemp) + $(cell).addClass("selected_tmp"); + else + $(cell).addClass("selected"); + break; + case "selected_tmp": + $(cell).removeClass(); + if (IsTemp) + $(cell).addClass("selected_tmp"); + else + $(cell).addClass("selected"); + break; + case "selected": + $(cell).removeClass(); + if (IsTemp) + $(cell).addClass("free_tmp"); + else + $(cell).addClass("free"); + break; + case "closed": + //do nothing + //alert("not allowed!"); + break; + } + } + } + + + /*if (dragEnd + 1 < dragStart) { // reverse select + //alert(1); + $("#tblReservation td:not([class='info'])").slice(dragEnd, dragStart + 1).addClass('selected'); + } else { + alert(dragStart + "-" + dragEnd); + $("#tblReservation td:not([class='info'])").slice(dragStart, dragEnd).addClass('selected'); + }*/ + + + if (Debug) console.timeEnd("mouse:---selectRange"); +} + +function ClearTableSelection(){ + $('#' + rsvrTblNm + ' .selected').addClass("free").removeClass("selected"); +} + + diff --git a/plugins/scheduler2/templates/scheduler.html b/plugins/scheduler2/templates/scheduler.html new file mode 100755 index 00000000..e4605f03 --- /dev/null +++ b/plugins/scheduler2/templates/scheduler.html @@ -0,0 +1,102 @@ +
+
+
+ +
+
+ + +
+
+ + + +
+
+
+
+ +
+
+
+
+
+ +
+
+ +
+
+ + + {% comment %} + {% for itms in nodes %} + + + + {% for n in itms.1 %} + {% if not forloop.first %} + + {% endif %} + + + {% endfor %} + {% endfor %} + {% endcomment %} + +
{{ itms.0 }}
{{ n }}
+
+
+ + + + {% for ts in time_slots %} + + {% endfor %} + + + + {% comment %} + {% for itms in nodes %} + {% for n in itms.1 %} + + {% for ts in time_slots %} + {% if n == 'node020' %} + + {% elif n == 'node023' or n == 'node030' %} + + {% else %} + + {% endif %} + {% endfor %} + + {% endfor %} + {% endfor %} + {% endcomment %} + +
{{ ts|safe }}
+
+ +
+
    +
  1. free
  2. +
  3. selected
  4. +
  5. reserved
  6. +
  7. maintenance
  8. +
+
+
+ +
\ No newline at end of file diff --git a/portal/sliceview.py b/portal/sliceview.py old mode 100644 new mode 100755 index eaec3faa..e28ef018 --- a/portal/sliceview.py +++ b/portal/sliceview.py @@ -18,7 +18,8 @@ from plugins.querygrid import QueryGrid from plugins.queryupdater import QueryUpdater from plugins.googlemap import GoogleMap from plugins.senslabmap import SensLabMap -from plugins.scheduler import Scheduler +#from plugins.scheduler import Scheduler +from plugins.scheduler2 import Scheduler2 from plugins.querycode import QueryCode # Thierry # stay away from query editor for now as it seems to make things go very slow @@ -244,15 +245,29 @@ class SliceView (LoginRequiredAutoLogoutView): checkboxes = True, ) - if do_query_leases: - resources_as_scheduler = Scheduler( - page = page, - title = 'Scheduler', - domid = 'scheduler', - query = sq_resource, - query_all_resources = query_resource_all, - query_lease = sq_lease, - ) + + + #if do_query_leases: + # resources_as_scheduler = Scheduler( + + # page = page, + # title = 'Scheduler', + # domid = 'scheduler', + # query = sq_resource, + # query_all_resources = query_resource_all, + # query_lease = sq_lease, + + # ) + + resources_as_scheduler2 = Scheduler2( + page = page, + domid = 'scheduler', + title = 'Scheduler', + # this is the query at the core of the slice list + query = sq_resource, + query_all_resources = query_resource_all, + query_lease = sq_lease, + ) # with the new 'Filter' stuff on top, no need for anything but the querytable resources_as_list_area = resources_as_list @@ -260,12 +275,13 @@ class SliceView (LoginRequiredAutoLogoutView): resources_sons = [ resources_as_gmap, resources_as_3dmap, - resources_as_scheduler, + resources_as_scheduler2, resources_as_list_area, ] if do_query_leases else [ resources_as_gmap, resources_as_3dmap, resources_as_list_area, + resources_as_scheduler2, ] if insert_grid: resources_sons.append(resources_as_grid) @@ -276,7 +292,8 @@ class SliceView (LoginRequiredAutoLogoutView): title="Resources", outline_complete=True, sons= resources_sons, - active_domid = 'resources-map', + + active_domid = 'scheduler', persistent_active=True, ) main_stack.insert (resources_area)